[Top][All Lists]

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

bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs

From: Drew Adams
Subject: bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs
Date: Thu, 28 Apr 2016 09:05:02 -0700 (PDT)

> As Eli pointed out, there's now `inhibit-message'.  Closing.

That is not the Emacs way.  It is not what is recommended
in the manual. See (elisp) `Distinguish Interactive'.


The recommended way to test whether
the function was called using 'call-interactively' is to give it an
optional argument 'print-message' and use the 'interactive' spec to make
it non-'nil' in interactive calls.  Here's an example:

     (defun foo (&optional print-message)
       (interactive "p")
       (when print-message
         (message "foo")))

We use '"p"' because the numeric prefix argument is never 'nil'.
Defined in this way, the function does display the message when called
from a keyboard macro.

   The above method with the additional argument is usually best,
because it allows callers to say "treat this call as interactive".  But
you can also do the job by testing 'called-interactively-p'.

reply via email to

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