Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
Cc: rms@gnu.org, ding@gnus.org
Subject: Re: interactive-p
Date: Thu, 11 Nov 2004 13:00:33 +0900	[thread overview]
Message-ID: <b9y654dqbkt.fsf@jpl.org> (raw)
In-Reply-To: <E1CS5QB-00083T-Ee@fencepost.gnu.org>

>>>>> In <E1CS5QB-00083T-Ee@fencepost.gnu.org> Richard Stallman wrote:

>     I'm not quite sure what counts as bad uses.  Functions that change
>     their behavior surprisingly based on whether they're called
>     interactively or not?

> Please look at the latest commands.texi; it explains what is good
> and bad usage of interactive-p.  I updated it a week ago.

The "Interective Call" section of the Elisp manual mentions a
good example.  We've fixed bad usages of interactive-p in the
emacs-w3m modules about two years ago.  At that time, TSUCHIYA
Masatoshi showed another example as follows:

(defun foo ()
  (interactive)
  (message (if (interactive-p) "Interactrive" "Non Interactrive")))

(let ((ad-default-compilation-action 'never))
  (defadvice foo
    (around foo-wrapper activate)
    ad-do-it))

(symbol-function 'foo)
 => (lambda nil
      "$ad-doc: foo$"
      (interactive)
      (let (ad-return-value)
	(setq ad-return-value (ad-Orig-foo))
	ad-return-value))

Because of this, the foo command will never say "Interactrive".



      reply	other threads:[~2004-11-11  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1COWYP-0001lW-Tc@fencepost.gnu.org>
2004-11-09 23:15 ` interactive-p Lars Magne Ingebrigtsen
2004-11-09 23:33   ` interactive-p Simon Josefsson
2004-11-11  3:14   ` interactive-p Richard Stallman
2004-11-11  4:00     ` Katsumi Yamaoka [this message]

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=b9y654dqbkt.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    --cc=rms@gnu.org \
    /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.
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 NNTP newsgroup(s).