[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using called-interactively-p
From: |
uzibalqa |
Subject: |
Using called-interactively-p |
Date: |
Wed, 05 Jul 2023 13:35:12 +0000 |
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)))
- Using called-interactively-p,
uzibalqa <=