From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tomas Hlavaty Newsgroups: gmane.emacs.devel Subject: Re: Partial wdired (edit just filename at the point) Date: Mon, 22 Mar 2021 21:08:16 +0100 Message-ID: <87ft0nar4f.fsf@logand.com> References: <87v99kgni5.fsf@logand.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37893"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Arthur Miller , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 22 21:13:51 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOQvu-0009mL-Px for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Mar 2021 21:13:50 +0100 Original-Received: from localhost ([::1]:53326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOQvt-0000I3-RN for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Mar 2021 16:13:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOQua-0007dy-DW for emacs-devel@gnu.org; Mon, 22 Mar 2021 16:12:28 -0400 Original-Received: from logand.com ([37.48.87.44]:35306) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOQuY-00036b-Kr for emacs-devel@gnu.org; Mon, 22 Mar 2021 16:12:28 -0400 Original-Received: by logand.com (Postfix, from userid 1001) id A16761A9F35; Mon, 22 Mar 2021 21:12:23 +0100 (CET) X-Mailer: emacs 27.1 (via feedmail 11-beta-1 Q) In-Reply-To: Received-SPF: pass client-ip=37.48.87.44; envelope-from=tom@logand.com; helo=logand.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266816 Archived-At: On Mon 22 Mar 2021 at 09:11, Stefan Monnier wrote: > Tomas Hlavaty [2021-03-21 23:17:38] wrote: >> On Wed 17 Mar 2021 at 22:10, Stefan Monnier 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). Thanks for the great explanation! Emacs Lisp: (type-of 'type-of) -> symbol (type-of #'type-of) -> symbol (type-of (lambda () 42)) -> cons (type-of #'(lambda () 42)) -> cons Common Lisp: (type-of 'type-of) -> SYMBOL (type-of #'type-of) -> FUNCTION (type-of (lambda () 42)) -> FUNCTION (type-of #'(lambda () 42)) -> FUNCTION