unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Using called-interactively-p
@ 2023-07-05 13:35 uzibalqa
  2023-07-05 15:25 ` Marcin Borkowski
  0 siblings, 1 reply; 7+ messages in thread
From: uzibalqa @ 2023-07-05 13:35 UTC (permalink / raw)
  To: uzibalqa via Users list for the GNU Emacs text editor

I have the following function that executes the command (do-this) when
the function skatpad is called interactively by the user, but executes 
(do-that) if the function is called from elisp code.

The documentation suggests to use "called-interactively-p" instead of
(interactive-p).

Looking at the documentation, it is not quite clear whether KIND should be
a symbol or a string.  This problem of distinguishing between a symbol and
a string, is something that occurs frequently in the documentation.  A source
of constant deliberation for me.

(defun skatpad (opord &rest args)
  (interactive)

  (if (interactive-p)
      (do-this)
    (do-that)))




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-06 21:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-05 13:35 Using called-interactively-p uzibalqa
2023-07-05 15:25 ` Marcin Borkowski
2023-07-05 15:40   ` uzibalqa
2023-07-05 20:26     ` Emanuel Berg
2023-07-06 18:55     ` Marcin Borkowski
2023-07-06 21:36       ` Emanuel Berg
2023-07-05 17:52   ` Emanuel Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).