emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Partial wdired (edit just filename at the point)


From: Stefan Monnier
Subject: Re: Partial wdired (edit just filename at the point)
Date: Mon, 22 Mar 2021 09:11:28 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Tomas Hlavaty [2021-03-21 23:17:38] wrote:
> On Wed 17 Mar 2021 at 22:10, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>> +  (add-hook 'before-change-functions 'wdired--preprocess-line nil t)
>>   Please use #' rather than ' to quote functions (I know the rest of the
>>   code here doesn't (yet), but we should move towards more systematic
>>   use of #' so as to better catch obsolete functions and other issues).  ]
> That is a strange advice.  I would expect #' to remove the indirection
> via symbol with consequence, that redefining the named function would
> not be reflected in the original #' value.
> What is the difference between #' and ' in emacs lisp?
> Is it different from Common Lisp?

Yes, it's indeed different from Common Lisp: it doesn't have the same
effect as `symbol-function`.

In ELisp, when quoting a symbol, #' only tells Emacs that the intention
is to refer to the function by that name more than the symbol itself,
but semantically, it's almost identical to ' and almost always just
returns the symbol.  The "almost" is for the exception of references to
lexically scoped functions (where #' works like in Common Lisp).

Lexically-scoped functions occur most directly via `cl-flet` and
`cl-labels`, but they can also occur more indirectly via things like
`cl-defmethod` (where `cl-call-next-method` is lexically scoped) or
`named-let` (which rely on `cl-flet` or `cl-labels` internally).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]