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 22:52:08 +0100 Message-ID: <87tup2ambb.fsf@logand.com> References: <87v99kgni5.fsf@logand.com> <87ft0nar4f.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="5261"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andreas Schwab , 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 22:53:19 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 1lOSUB-0001FV-Ey for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Mar 2021 22:53:19 +0100 Original-Received: from localhost ([::1]:56268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOSUA-0002UT-G6 for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Mar 2021 17:53:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOST9-0001l3-5t for emacs-devel@gnu.org; Mon, 22 Mar 2021 17:52:15 -0400 Original-Received: from logand.com ([37.48.87.44]:36562) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOST7-0004Vq-1f for emacs-devel@gnu.org; Mon, 22 Mar 2021 17:52:14 -0400 Original-Received: by logand.com (Postfix, from userid 1001) id D15A71A9F38; Mon, 22 Mar 2021 22:52:10 +0100 (CET) X-Mailer: emacs 27.1 (via feedmail 11-beta-1 I) 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:266837 Archived-At: On Mon 22 Mar 2021 at 17:00, Stefan Monnier 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.