all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: locate-library INTERACTIVE-CALL argument
Date: Tue, 05 Aug 2003 16:35:49 -0600	[thread overview]
Message-ID: <3F303145.9060905@yahoo.com> (raw)
In-Reply-To: mailman.112.1060111669.29551.bug-gnu-emacs@gnu.org

Richard Stallman wrote:

> > Since the intent is to display the message
> > when the command is called interactively, even when it is called via a
> > keyboard macro, why not test for those conditions explicitly with
> > interactive-p and executing-macro respectively?
> 
> There is no way to do that and get the same condition.
> (or (interactive-p) executing-macro) would be t
> when called from Lisp code that was run by a keyboard macro.
> 
> Perhaps there ought to be a way to use interactive-p to get
> such a result.  It could be a good feature.


Do you mean adding an &optional KEYBOARD-MACROS-TOO argument, so it

would return non-nil even when called while executing a keyboard macro?

Or do you mean distinguishing different non-nil return values, e.g.
call-interactively vs. execute-kbd-macro (instead of just t)?


> But there may be a better feature.  Ever since 1985 I had the idea
> that maybe (interactive...)  could be extended with a second argument
> saying how to display the value.  That would be complimentary with the
> existing arg saying how to provide the arguments.  That might be the
> really clean way to do this job.

I don't know what you mean.  (interactive ...) returns a list of values,

which are mapped to the lambda list symbols.  Do you mean that it would
accept an &optional KEYBOARD-MACROS-TOO argument, which would determine
what interactive-p returns while executing a keyboard macro?


If so, I think adding an &optional argument to interactive-p is cleaner,
since it's "closer" to the desired effect than adding one to interactive.

Maybe an example would be helpful.  The question is, given a command foo
that usually displays a message when called interactively, how to allow
the Emacs Lisp programmer to control whether that messsage is displayed
in these different contexts:

1. C-x ( ... M-x foo RET ... C-x )

    should obviously display the message.

2. C-x ( ... M-: (foo ...) RET ... C-x )

    should not.

-- 
Kevin Rodgers

  parent reply	other threads:[~2003-08-05 22:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-31 17:00 locate-library INTERACTIVE-CALL argument Kevin Rodgers
2003-08-02  4:47 ` Richard Stallman
     [not found] ` <mailman.11.1059814578.2377.bug-gnu-emacs@gnu.org>
2003-08-04 16:10   ` Kevin Rodgers
2003-08-05 19:14     ` Richard Stallman
     [not found]     ` <mailman.112.1060111669.29551.bug-gnu-emacs@gnu.org>
2003-08-05 22:35       ` Kevin Rodgers [this message]
2003-08-06 13:04         ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F303145.9060905@yahoo.com \
    --to=ihs_4664@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.