help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to quote a list of functions?


From: Emanuel Berg
Subject: Re: How to quote a list of functions?
Date: Sat, 22 Aug 2015 01:38:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

"Pascal J. Bourguignon" <pjb@informatimago.com>
writes:

> And if it's a function designator it can be either,
> when both designate the same function, or one or the
> other when they designate different functions.
>
> apply takes a function designator (and therefore so do
> all the functions that call apply, from funcall,
> mapcar, etc).

Thanks to these tools [1], which a couple of posts
back were dismissed by several people as would only
work on trivial cases because of computer science
theory (!) - luckily this use case was trivial enough!
probably because it is useful - because of those
selfsame tools, I've now come up to speed tracking all
quoted functions in my Elisp - as it is, I have
several hundreds! Tho not that many individual cases
when the function they are passed to is considered.
Here are the results so far:

add-hook FUNCTION #'
advice-add SYMBOL ... FUNCTION ' ... #'
apply FUNCTION #'
call-interactively FUNCTION #'
defalias SYMBOL '
define-key "command [or] symbol" #'
enable-jump interface to funcall FUNCTION #'
global-set-key COMMAND #'
gnus-group-sort-function "-function" #'
local-set-key COMMAND #'
setq SYM '
super-global-set-key interface to global-set-key COMMAND #'

More to come...

Here is an interesting case with apply. If "find-f" is
sharp quoted, it won't work!

(defun find-file-at-line (&optional other-window)
  (interactive "P")
  (let ((possible-filename (thing-at-point 'filename))
        (find-f (if other-window 'find-file-other-window 'find-file)) )
    (if (and possible-filename (file-exists-p possible-filename))
          (apply find-f `(,possible-filename))
      (progn
        (forward-char 1)
        (find-file-at-line) ))))

[1] http://user.it.uu.se/~embe8573/conf/emacs-init/search-regexp-in-files.el
    http://user.it.uu.se/~embe8573/conf/emacs-init/list-quoted-functions.el

--
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

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