Re: [PATCH] emacs: remap send-message and send-message-and-exit

Subject: Re: [PATCH] emacs: remap send-message and send-message-and-exit

Date: Mon, 07 Jun 2021 19:09:32 +0300

To: edef

Cc: notmuch@notmuchmail.org

From: Tomi Ollila


On Fri, Jun 04 2021, edef@edef.eu wrote:

>> >  (defvar notmuch-message-mode-map
>> >    (let ((map (make-sparse-keymap)))
>> > -    (define-key map (kbd "C-c C-c") #'notmuch-mua-send-and-exit)
>> > -    (define-key map (kbd "C-c C-s") #'notmuch-mua-send)
>> > +    (define-key map [remap message-send-and-exit] 'notmuch-mua-send-and-exit)
>> > +    (define-key map [remap message-send] 'notmuch-mua-send)
>> 
>> where did the # characters disappear here ?
>> 
>> afaic #' is the recommended way here...

> I'm not sure where to find that recommendation — the Emacs manual and
> information I've found in the wild don't use it for define-key.

In this particular case, around the change #' is used, 
and in change ' is used.

(in some other parts in notmuch elisp source there is only ' used
-- consistency -- in one way or another, would be nice...)

emacs sharp quote   can be used in internet searches to find more info,

then, in

http://www.gnu.org/software/emacs/manual/html_node/elisp/Anonymous-Functions.html


  Special Form: function function-object

      This special form returns function-object without evaluating it. In
      this, it is similar to quote (see Quoting). But unlike quote, it also
      serves as a note to the Emacs evaluator and byte-compiler that
      function-object is intended to be used as a function. Assuming
      function-object is a valid lambda expression, this has two effects:

          When the code is byte-compiled, function-object is compiled into a
          byte-code function object (see Byte Compilation).
          When lexical binding is enabled, function-object is converted into
          a closure. See Closures. 

      When function-object is a symbol and the code is byte compiled, the
      byte-compiler will warn if that function is not defined or might not be
      known at run time. 

  The read syntax #' is a short-hand for using function. 

Tomi
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: