[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Partial wdired (edit just filename at the point)
From: |
Tomas Hlavaty |
Subject: |
Re: Partial wdired (edit just filename at the point) |
Date: |
Mon, 22 Mar 2021 22:52:08 +0100 |
On Mon 22 Mar 2021 at 17:00, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> As Andreas points out, the last two depend on whether the code is
> compiled or not.
interesting
ELISP> (eval (byte-compile '(type-of '(lambda () 42))))
cons
cons obviously, it was probably meant this:
ELISP> (eval (byte-compile '(type-of (lambda () 42))))
compiled-function
which is the same as the result of:
ELISP> (eval (byte-compile '(type-of #'(lambda () 42))))
compiled-function
> And FWIW, I'd like to get to the point where (type-of (lambda () 42))
> never returns `cons` but always some kind of "function" type instead,
> indeed.
Do you mean more like the Common Lisp behaviour?
Getting back to the original advice, in compiled code or in such `some
kind of "function"' future, using #' will make it not possible to
redefine wdired--preprocess-line in the hook:
(add-hook 'before-change-functions #'wdired--preprocess-line nil t)
while this will keep it possible to redefine wdired--preprocess-line in
the hook:
(add-hook 'before-change-functions 'wdired--preprocess-line nil t)
Is that correct? Or will `some kind of "function"' still behave like a
symbol (backwards compatible)?
I would like to understand when to prefer #' and when '. In Common
Lisp, using #' for lambda is redundant; and if I know that a function
will not change I prefer #' (e.g. #'cons) but if I want to make it
possible to easily redefine the function, I prefer '
(e.g. 'my-function). I am struggling to come up with a strategy when to
prefer #' or ' taking into account current and future Emacs Lisp
befaviour of #'. It seems to me that using #' everywhere will make it
harder to redefine functions.
- Re: Sv: Partial wdired (edit just filename at the point), (continued)
- Re: Partial wdired (edit just filename at the point), Tomas Hlavaty, 2021/03/21
- Re: Partial wdired (edit just filename at the point), tomas, 2021/03/22
- Re: Partial wdired (edit just filename at the point), Arthur Miller, 2021/03/22
- Re: Partial wdired (edit just filename at the point), tomas, 2021/03/22
- Re: Partial wdired (edit just filename at the point), Stefan Monnier, 2021/03/22
- Re: Partial wdired (edit just filename at the point), Tomas Hlavaty, 2021/03/22
- Re: Partial wdired (edit just filename at the point), Andreas Schwab, 2021/03/22
- Re: Partial wdired (edit just filename at the point), Stefan Monnier, 2021/03/22
- Re: Partial wdired (edit just filename at the point),
Tomas Hlavaty <=
- Re: Partial wdired (edit just filename at the point), Stefan Monnier, 2021/03/22
- Re: Partial wdired (edit just filename at the point), Tomas Hlavaty, 2021/03/22
- Re: Partial wdired (edit just filename at the point), Andreas Schwab, 2021/03/22