From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: How to quote a list of functions? Date: Sat, 22 Aug 2015 01:38:02 +0200 Message-ID: <87io88dxgl.fsf@nl106-137-147.student.uu.se> References: <87mvxug2us.fsf@nl106-137-147.student.uu.se> <87vbch1gb0.fsf@nl106-137-147.student.uu.se> <87wpwudby7.fsf@nl106-137-147.student.uu.se> <20150817062952.GD17453@tuxteam.de> <87wpwtbe71.fsf@nl106-137-147.student.uu.se> <87r3n07tve.fsf@mbork.pl> <87io8cyv38.fsf@nl106-137-147.student.uu.se> <87y4h7fjcz.fsf@mbork.pl> <20150819202135.GA7200@tuxteam.de> <87wpwo769m.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1440200421 23733 80.91.229.3 (21 Aug 2015 23:40:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Aug 2015 23:40:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 22 01:40:12 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZSvuu-0003zz-AK for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Aug 2015 01:40:12 +0200 Original-Received: from localhost ([::1]:44878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSvut-0006g0-K1 for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Aug 2015 19:40:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSvuf-0006fJ-Rk for help-gnu-emacs@gnu.org; Fri, 21 Aug 2015 19:39:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZSvuc-00068i-Mw for help-gnu-emacs@gnu.org; Fri, 21 Aug 2015 19:39:57 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:48717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSvuc-00068N-HG for help-gnu-emacs@gnu.org; Fri, 21 Aug 2015 19:39:54 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZSvuZ-0003qI-U9 for help-gnu-emacs@gnu.org; Sat, 22 Aug 2015 01:39:51 +0200 Original-Received: from nl106-137-190.student.uu.se ([130.243.137.190]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 22 Aug 2015 01:39:51 +0200 Original-Received: from embe8573 by nl106-137-190.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 22 Aug 2015 01:39:51 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 56 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-190.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:1383XOJAxaSiqJ1LjbaeFW9cPPM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106761 Archived-At: "Pascal J. Bourguignon" 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