Gnus development mailing list
 help / color / mirror / Atom feed
* Re: interactive-p
       [not found] <E1COWYP-0001lW-Tc@fencepost.gnu.org>
@ 2004-11-09 23:15 ` Lars Magne Ingebrigtsen
  2004-11-09 23:33   ` interactive-p Simon Josefsson
  2004-11-11  3:14   ` interactive-p Richard Stallman
  0 siblings, 2 replies; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2004-11-09 23:15 UTC (permalink / raw)
  Cc: ding

Richard Stallman <rms@gnu.org> writes:

> Could you please check for bad uses of interactive-p in these files?

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 ack when it's done.
>
> gnus/gnus-art.el

The usage here (in one function) seems to make sense.

> gnus/message.el

Look ok here, too.  (Only used in XEmacs, by the way.)

> gnus/pgg.el

Here it's used throughout the package, which seems odd.  I've Cc'd
this message to the Gnus mailing list; perhaps people there have
input on why pgg.el does it this way.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: interactive-p
  2004-11-09 23:15 ` interactive-p Lars Magne Ingebrigtsen
@ 2004-11-09 23:33   ` Simon Josefsson
  2004-11-11  3:14   ` interactive-p Richard Stallman
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Josefsson @ 2004-11-09 23:33 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Richard Stallman <rms@gnu.org> writes:
>
>> Could you please check for bad uses of interactive-p in these files?
>
> 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?
...
>> gnus/pgg.el
>
> Here it's used throughout the package, which seems odd.  I've Cc'd
> this message to the Gnus mailing list; perhaps people there have
> input on why pgg.el does it this way.

IIUC, it do this to be able to have a nice user interface when used
interactively, e.g., switch to the output buffer after decrypting
something, but at the same be usable from lisp code that do not want
pgg to do anything with the user interface.

Is that bad?

The number of uses can be reduced, but I'm not sure I see why that is
better.




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

* Re: interactive-p
  2004-11-09 23:15 ` interactive-p Lars Magne Ingebrigtsen
  2004-11-09 23:33   ` interactive-p Simon Josefsson
@ 2004-11-11  3:14   ` Richard Stallman
  2004-11-11  4:00     ` interactive-p Katsumi Yamaoka
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2004-11-11  3:14 UTC (permalink / raw)
  Cc: ding

    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.



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

* Re: interactive-p
  2004-11-11  3:14   ` interactive-p Richard Stallman
@ 2004-11-11  4:00     ` Katsumi Yamaoka
  0 siblings, 0 replies; 4+ messages in thread
From: Katsumi Yamaoka @ 2004-11-11  4:00 UTC (permalink / raw)
  Cc: rms, ding

>>>>> 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".



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

end of thread, other threads:[~2004-11-11  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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     ` interactive-p Katsumi Yamaoka

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).