indent based on subsequence of symbol

Lucien Pullen drurowin at gmail.com
Fri Oct 18 05:00:39 UTC 2013


Also sprach Luís Oliveira on 2013-10-15:
> On Tue, Oct 15, 2013 at 5:42 AM, Lucien Pullen <drurowin at gmail.com> wrote:
>> It seems that *application-hints-table* is only used once, so subsequent
>> symbols indent like functions [and not macros].  Getting indentation for
>> the first symbol somehow tells slime to not call
>> swank::symbol-indentation again.
>
> That information comes from the elisp function
> `slime-update-system-indentation', which is only invoked by
> `slime-handle-indentation-update' which in turn gets triggered when
> SLIME gets an :INDENTATION-UPDATE message from SWANK. There seems to
> be some caching going on there. Can you figure out how it works?

On the SWANK side there is a function update-indentation/delta-for-emacs
that handles updating the cache with symbol-indentation based on the
_currently_ _interned_ symbols in the current package.  That function is
called often during normal typing at the REPL.  The problem has nothing
to do with the cache.

What has me confused is how the initial automatic macro is indented
properly, before the REPL form has been read by the lisp system and the
symbol interned.  I know that, when defining a flet or labels SLIME will
offer completion hints for those local functions when in the body of the
flet or labels.

I'll look into how that is done, as well as for macrolet, tomorrow
unless someone knows off the top of their head.

If this is done in the Emacs Lisp side, I assume there is a reason,
other than this is a new feature, why SLIME doesn't query the lisp
system [when it is connected] with the specific symbol it doesn't know
about?

(
  The way I understand it, the ugly optimization with semantic
  indentation has to do with guessing correct indentation for macros
  defined normally instead of scanning for every macro defined.
)



More information about the slime-devel mailing list