Gnus development mailing list
 help / color / mirror / Atom feed
* Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
@ 2007-08-29 18:24 Reiner Steib
  2007-12-14 21:09 ` Reiner Steib
  0 siblings, 1 reply; 14+ messages in thread
From: Reiner Steib @ 2007-08-29 18:24 UTC (permalink / raw)
  To: ding

Hi,

do we really need gnus-yes-or-no-p and gnus-y-or-n-p?

They are there since almost forever. From the comment, I'd guess it
could have been a workaround for a bug in the corresponding Emacs
functions.  

,----[ 3.1          (larsi    04-Mar-97) ]
| ;; Two silly functions to ensure that all `y-or-n-p' questions clear
| ;; the echo area.
| (defun gnus-y-or-n-p (prompt)
|   (prog1
|       (y-or-n-p prompt)
|     (message "")))
| 
| (defun gnus-yes-or-no-p (prompt)
|   (prog1
|       (yes-or-no-p prompt)
|     (message "")))
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2007-08-29 18:24 Do we need gnus-yes-or-no-p and gnus-y-or-n-p? Reiner Steib
@ 2007-12-14 21:09 ` Reiner Steib
  2007-12-17  1:44   ` Katsumi Yamaoka
  0 siblings, 1 reply; 14+ messages in thread
From: Reiner Steib @ 2007-12-14 21:09 UTC (permalink / raw)
  To: ding

On Wed, Aug 29 2007, Reiner Steib wrote:

> do we really need gnus-yes-or-no-p and gnus-y-or-n-p?
>
> They are there since almost forever. From the comment, I'd guess it
> could have been a workaround for a bug in the corresponding Emacs
> functions.  
>
> ,----[ 3.1          (larsi    04-Mar-97) ]
> | ;; Two silly functions to ensure that all `y-or-n-p' questions clear
> | ;; the echo area.
[...]

I defaliased them to the original Emacs functions.  If nobody
complains after some time, we can get rid of the aliases and use the
original functions.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2007-12-14 21:09 ` Reiner Steib
@ 2007-12-17  1:44   ` Katsumi Yamaoka
  2007-12-17  2:26     ` Katsumi Yamaoka
  2007-12-18 23:01     ` Katsumi Yamaoka
  0 siblings, 2 replies; 14+ messages in thread
From: Katsumi Yamaoka @ 2007-12-17  1:44 UTC (permalink / raw)
  To: ding

>>>>> Reiner Steib wrote:

> On Wed, Aug 29 2007, Reiner Steib wrote:

>> do we really need gnus-yes-or-no-p and gnus-y-or-n-p?
>>
>> They are there since almost forever. From the comment, I'd guess it
>> could have been a workaround for a bug in the corresponding Emacs
>> functions.
>>
>> ,----[ 3.1          (larsi    04-Mar-97) ]
>>| ;; Two silly functions to ensure that all `y-or-n-p' questions clear
>>| ;; the echo area.
> [...]

> I defaliased them to the original Emacs functions.  If nobody
> complains after some time, we can get rid of the aliases and use the
> original functions.

Sorry for my lazy response.  I wish that a command like the
following clears a question out after I answer.

(defun foo ()
  "Switch to buffer named foo."
  (interactive)
  (when (y-or-n-p "Switch to buffer foo? ")
    (switch-to-buffer "foo")))

This should be fixed if it is considered to be a bug of Emacs,
and we will be able to remove `gnus-y-or-n-p' at last when Gnus
comes not to support the versions of Emacsen having the bug.  In
other words, if we don't use `gnus-y-or-n-p' we have to keep
having `(message "")' with `y-or-n-p' that doesn't follow a
function that clears or changes the echo area (minibuffer?)
until Gnus comes not to support buggy Emacsen.  I think.



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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2007-12-17  1:44   ` Katsumi Yamaoka
@ 2007-12-17  2:26     ` Katsumi Yamaoka
  2007-12-18 23:01     ` Katsumi Yamaoka
  1 sibling, 0 replies; 14+ messages in thread
From: Katsumi Yamaoka @ 2007-12-17  2:26 UTC (permalink / raw)
  To: ding

>>>>> Katsumi Yamaoka wrote:

> This should be fixed if it is considered to be a bug of Emacs,
[...]
> until Gnus comes not to support buggy Emacsen.  I think.

I meant that ``buggy Emacsen'' are all the versions of Emacsen
and XEmacsen for the time being.



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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2007-12-17  1:44   ` Katsumi Yamaoka
  2007-12-17  2:26     ` Katsumi Yamaoka
@ 2007-12-18 23:01     ` Katsumi Yamaoka
  2007-12-19  2:37       ` Katsumi Yamaoka
  1 sibling, 1 reply; 14+ messages in thread
From: Katsumi Yamaoka @ 2007-12-18 23:01 UTC (permalink / raw)
  To: ding

>>>>> Katsumi Yamaoka wrote:
>>>>>> Reiner Steib wrote:

>> On Wed, Aug 29 2007, Reiner Steib wrote:

>>> do we really need gnus-yes-or-no-p and gnus-y-or-n-p?
>>>
>>> They are there since almost forever. From the comment, I'd guess it
>>> could have been a workaround for a bug in the corresponding Emacs
>>> functions.
>>>
>>> ,----[ 3.1          (larsi    04-Mar-97) ]
>>>| ;; Two silly functions to ensure that all `y-or-n-p' questions clear
>>>| ;; the echo area.
>> [...]

>> I defaliased them to the original Emacs functions.  If nobody
>> complains after some time, we can get rid of the aliases and use the
>> original functions.

> Sorry for my lazy response.  I wish that a command like the
> following clears a question out after I answer.

> (defun foo ()
>   "Switch to buffer named foo."
>   (interactive)
>   (when (y-or-n-p "Switch to buffer foo? ")
>     (switch-to-buffer "foo")))

> This should be fixed if it is considered to be a bug of Emacs,
> and we will be able to remove `gnus-y-or-n-p' at last when Gnus
> comes not to support the versions of Emacsen having the bug.  In
> other words, if we don't use `gnus-y-or-n-p' we have to keep
> having `(message "")' with `y-or-n-p' that doesn't follow a
> function that clears or changes the echo area (minibuffer?)
> until Gnus comes not to support buggy Emacsen.  I think.

I forgot checking `yes-or-no-p'.  I verified that it clears a
question by itself with Emscs 20.7-23.0.60 and XEmacs 21.4/21.5.

(defun fooo ()
  "Switch to buffer named fooo."
  (interactive)
  (when (yes-or-no-p "Switch to buffer fooo? ")
    (switch-to-buffer "fooo")))

I don't know why `gnus-yes-or-no-p' was introduced, but it might
have been for Emacs 19 because it appeared in "(ding) Gnus v0.30"
(I no longer have Emacs 19 and cannot verify it).  Anyway, I
believe we don't need `gnus-yes-or-no-p'

OTOH, I also checked `y-or-n-p' again with all the versions of
Emacsen and confirmed it doesn't clear a question.  So, I strongly
oppose to making `gnus-y-or-n-p' alias to `y-or-n-p' or removing
`gnus-y-or-n-p'.

Regards,



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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2007-12-18 23:01     ` Katsumi Yamaoka
@ 2007-12-19  2:37       ` Katsumi Yamaoka
  2008-01-05 20:46         ` Reiner Steib
  0 siblings, 1 reply; 14+ messages in thread
From: Katsumi Yamaoka @ 2007-12-19  2:37 UTC (permalink / raw)
  To: ding

>>>>> Katsumi Yamaoka wrote:

> Anyway, I believe we don't need `gnus-yes-or-no-p'

> OTOH, I also checked `y-or-n-p' again with all the versions of
> Emacsen and confirmed it doesn't clear a question.  So, I strongly
> oppose to making `gnus-y-or-n-p' alias to `y-or-n-p' or removing
> `gnus-y-or-n-p'.

Try `c' and `n' in the group buffer.



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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2007-12-19  2:37       ` Katsumi Yamaoka
@ 2008-01-05 20:46         ` Reiner Steib
  2008-01-06  0:21           ` Katsumi Yamaoka
  0 siblings, 1 reply; 14+ messages in thread
From: Reiner Steib @ 2008-01-05 20:46 UTC (permalink / raw)
  To: ding

On Wed, Dec 19 2007, Katsumi Yamaoka wrote:

>>>>>> Katsumi Yamaoka wrote:
>
>> Anyway, I believe we don't need `gnus-yes-or-no-p'
>
>> OTOH, I also checked `y-or-n-p' again with all the versions of
>> Emacsen and confirmed it doesn't clear a question.  So, I strongly
>> oppose to making `gnus-y-or-n-p' alias to `y-or-n-p' or removing
>> `gnus-y-or-n-p'.
>
> Try `c' and `n' in the group buffer.

You mean `c' for `gnus-group-catchup-current' or
`gnus-topic-catchup-articles' and answering `n' to the y-or-n-p
prompt?

What I see in the echo area is:

- c --> Mark all unread articles in ulm.test as read? (y or n) 

- n --> Mark all unread articles in ulm.test as read? (y or n) n

  ... i.e. the response "n" stays there until you hit some other key
  (e.g. `p', `n', ...).

I fail to see anything wrong here.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2008-01-05 20:46         ` Reiner Steib
@ 2008-01-06  0:21           ` Katsumi Yamaoka
  2008-01-06  9:25             ` Reiner Steib
  0 siblings, 1 reply; 14+ messages in thread
From: Katsumi Yamaoka @ 2008-01-06  0:21 UTC (permalink / raw)
  To: ding

>>>>> Reiner Steib <reinersteib+gmane@imap.cc> wrote:

> On Wed, Dec 19 2007, Katsumi Yamaoka wrote:

>>> So, I strongly oppose to making `gnus-y-or-n-p' alias to `y-or-n-p'
>>> or removing `gnus-y-or-n-p'.

>> Try `c' and `n' in the group buffer.

> You mean `c' for `gnus-group-catchup-current' or
> `gnus-topic-catchup-articles' and answering `n' to the y-or-n-p
> prompt?

Yes, I did.

> What I see in the echo area is:

> - c --> Mark all unread articles in ulm.test as read? (y or n)

> - n --> Mark all unread articles in ulm.test as read? (y or n) n

>   ... i.e. the response "n" stays there until you hit some other key
>   (e.g. `p', `n', ...).

> I fail to see anything wrong here.

Hm, but if the function to query is `yes-or-no-p', the echo area
is cleared just after entering `n o <RET>'.  I think that that
`y-or-n-p' leaves the question and the answer in the echo area
is not intentional.  If anything, we may call it a bug.



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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2008-01-06  0:21           ` Katsumi Yamaoka
@ 2008-01-06  9:25             ` Reiner Steib
  2008-01-07  6:33               ` Katsumi Yamaoka
  0 siblings, 1 reply; 14+ messages in thread
From: Reiner Steib @ 2008-01-06  9:25 UTC (permalink / raw)
  To: ding

On Sun, Jan 06 2008, Katsumi Yamaoka wrote:

>>>>>> Reiner Steib <reinersteib+gmane@imap.cc> wrote:
>> I fail to see anything wrong here.
>
> Hm, but if the function to query is `yes-or-no-p', the echo area
> is cleared just after entering `n o <RET>'.  I think that that
> `y-or-n-p' leaves the question and the answer in the echo area
> is not intentional.  

Maybe, maybe not.  I could imagine that it is intentional: In contrast
to yes-or-no-p it is much easier to type y, n, SPC, DEL, etc
accidentally, so it might be useful for the user to see what he has
typed.

Do you or anyone have real life examples (in Gnus) where leaving the
message in the echo area after `(gnus-)y-or-n-p' is confusing?

> If anything, we may call it a bug.

If so, it would be a general bug in (X)Emacs and should be fixed
there, not in Gnus, IMHO.

Would you like to ask if it's intentional on emacs-devel/xemacs-beta?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2008-01-06  9:25             ` Reiner Steib
@ 2008-01-07  6:33               ` Katsumi Yamaoka
  2008-01-07  6:34                 ` Katsumi Yamaoka
  0 siblings, 1 reply; 14+ messages in thread
From: Katsumi Yamaoka @ 2008-01-07  6:33 UTC (permalink / raw)
  To: ding

>>>>> Reiner Steib wrote:
> On Sun, Jan 06 2008, Katsumi Yamaoka wrote:
>> `y-or-n-p' leaves the question and the answer in the echo area
>> is not intentional.

> Maybe, maybe not.

Maybe no one can answer that it is intentional or not.

> I could imagine that it is intentional: In contrast
> to yes-or-no-p it is much easier to type y, n, SPC, DEL, etc
> accidentally, so it might be useful for the user to see what he has
> typed.

I admit that there is some truth in what you wrote.

> Do you or anyone have real life examples (in Gnus) where leaving the
> message in the echo area after `(gnus-)y-or-n-p' is confusing?

Maybe it's a matter of a sense of beauty.  You don't mind it, but
I do.  And Lars might have felt it like me, too.  Here is a
ChangeLog entry for ding Gnus v0.29[1]:

Tue Feb 28 00:25:04 1995  Lars Ingebrigtsen  <lars (at) eyesore.no>
[...]
	* gnus.el: All y-or-n-p's and yes-or-no-p's delete their messages
	from the echo area.

(At that time, the latest released version of Emacs was 19.28.
 IIRC, there is no difference in the behavior of `y-or-n-p'
 between 19.28 and the recent ones.  Although I believe
 `gnus-yes-or-no-p' was useless even then.)

>> If anything, we may call it a bug.

> If so, it would be a general bug in (X)Emacs and should be fixed
> there, not in Gnus, IMHO.

But if it's a bug and even if it is fixed, we still have to support
old Emacsen.

> Would you like to ask if it's intentional on emacs-devel/xemacs-beta?

Yes, I'll do it.

[1] You can find it in:
    ftp://ftp.gnus.org/pub/gnus/old/dgnus-0.30.tar.gz



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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2008-01-07  6:33               ` Katsumi Yamaoka
@ 2008-01-07  6:34                 ` Katsumi Yamaoka
  2008-01-07 17:16                   ` Richard Stallman
  0 siblings, 1 reply; 14+ messages in thread
From: Katsumi Yamaoka @ 2008-01-07  6:34 UTC (permalink / raw)
  To: emacs-devel, xemacs-beta; +Cc: ding

Hi,

In the Gnus mailing list, now it is being discussed whether the
behavior of `y-or-n-p' that it does not clear the echo area is
intentional.  While `yes-or-no-p' clears the question and the
answer in the echo area after entering `y e s' or `n o' and RET,
`y-or-n-p' does not do so after entering `y' or `n'.  E.g.:

(defun foo ()
  "Switch to buffer named foo."
  (interactive)
  (when (y-or-n-p "Switch to buffer foo? ")
    (switch-to-buffer "foo")))

(Please try it with `yes-or-no-p' as well.)

The behavior of `y-or-n-p' that it doesn't clear the question
and the answer is not serious of course, but I feel it is not
cool.  Lars seems to have felt it like me and introduced the
function `gnus-y-or-n-p' in February, 1995:

(defun gnus-y-or-n-p (prompt)
  (prog1
      (y-or-n-p prompt)
    (message "")))

Currently, it is commented out in the trunk by Reiner Steib.  He
also wrote the benefit of leaving the question and the answer in
the echo area as follows:

(http://article.gmane.org/gmane.emacs.gnus.general/66061)
> In contrast to yes-or-no-p it is much easier to type y, n,
> SPC, DEL, etc accidentally, so it might be useful for the user
> to see what he has typed.

(You can read the whole thread in:
http://news.gmane.org/group/gmane.emacs.gnus.general/thread=65099/force_load=t)

But I like the behavior that it clears the echo area like
`yes-or-no-p', even if it is a side effect of the RET key.

Could someone draw the conclusion?  And if it is regarded as a
bug, I hope it is fixed in the future (in that case, we need to
uncomment `gnus-y-or-n-p' for old Emacsen).

Regards,



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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2008-01-07  6:34                 ` Katsumi Yamaoka
@ 2008-01-07 17:16                   ` Richard Stallman
  2008-01-07 22:52                     ` Katsumi Yamaoka
  0 siblings, 1 reply; 14+ messages in thread
From: Richard Stallman @ 2008-01-07 17:16 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: emacs-devel, xemacs-beta, ding

    The behavior of `y-or-n-p' that it doesn't clear the question
    and the answer is not serious of course, but I feel it is not
    cool.

It is intentional.

    Currently, it is commented out in the trunk by Reiner Steib.  He
    also wrote the benefit of leaving the question and the answer in
    the echo area as follows:

    (http://article.gmane.org/gmane.emacs.gnus.general/66061)
    > In contrast to yes-or-no-p it is much easier to type y, n,
    > SPC, DEL, etc accidentally, so it might be useful for the user
    > to see what he has typed.

Yes, that is the reason.



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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2008-01-07 17:16                   ` Richard Stallman
@ 2008-01-07 22:52                     ` Katsumi Yamaoka
  2008-02-16 12:22                       ` Reiner Steib
  0 siblings, 1 reply; 14+ messages in thread
From: Katsumi Yamaoka @ 2008-01-07 22:52 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel, xemacs-beta, ding

>>>>> Richard Stallman wrote:

> It is intentional.

Reiner> In contrast to yes-or-no-p it is much easier to type y, n,
Reiner> SPC, DEL, etc accidentally, so it might be useful for the user
Reiner> to see what he has typed.

> Yes, that is the reason.

Thanks for enlightening me.  This has dispelled my long-standing
doubt that the Lisp programs[1] that clear the echo area are few
except for the ones of Gnus (and emacs-w3m).  I agree with not
deleting on purpose the question and the answer that `y-or-n-p'
displays.  Though this doesn't mean changing my sense of beauty.
I.e., I don't like it.

[1] ediff-quit-meta-buffer, help-with-tutorial, mh-search-folder,
    dissociated-press, and c-submit-bug-report in Emacs.



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

* Re: Do we need gnus-yes-or-no-p and gnus-y-or-n-p?
  2008-01-07 22:52                     ` Katsumi Yamaoka
@ 2008-02-16 12:22                       ` Reiner Steib
  0 siblings, 0 replies; 14+ messages in thread
From: Reiner Steib @ 2008-02-16 12:22 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: xemacs-beta, ding, emacs-devel

On Mon, Jan 07 2008, Katsumi Yamaoka wrote:

>>>>>> Richard Stallman wrote:
[ `y-or-n-p' doesn't clear the echo area after user input ]
>> It is intentional.
>
> Reiner> In contrast to yes-or-no-p it is much easier to type y, n,
> Reiner> SPC, DEL, etc accidentally, so it might be useful for the user
> Reiner> to see what he has typed.
>
>> Yes, that is the reason.
>
> Thanks for enlightening me.  This has dispelled my long-standing
> doubt that the Lisp programs[1] that clear the echo area are few
> except for the ones of Gnus (and emacs-w3m).  I agree with not
> deleting on purpose the question and the answer that `y-or-n-p'
> displays.  Though this doesn't mean changing my sense of beauty.
> I.e., I don't like it.

I'd suggest to keep
  (defalias 'gnus-y-or-n-p 'y-or-n-p)
  (defalias 'gnus-yes-or-no-p 'yes-or-no-p)
for some weeks and replace the callers[1] with `yes-or-no-p' and
`y-or-n-p' unless there are strong objections.

Bye, Reiner.

[1]
gnus/lisp$ grep -nH -e gnus-yes-or-no-p *.el|wc -l
22

gnus/lisp$ grep -nH -e gnus-y-or-n-p *.el|wc -l
34
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

end of thread, other threads:[~2008-02-16 12:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-29 18:24 Do we need gnus-yes-or-no-p and gnus-y-or-n-p? Reiner Steib
2007-12-14 21:09 ` Reiner Steib
2007-12-17  1:44   ` Katsumi Yamaoka
2007-12-17  2:26     ` Katsumi Yamaoka
2007-12-18 23:01     ` Katsumi Yamaoka
2007-12-19  2:37       ` Katsumi Yamaoka
2008-01-05 20:46         ` Reiner Steib
2008-01-06  0:21           ` Katsumi Yamaoka
2008-01-06  9:25             ` Reiner Steib
2008-01-07  6:33               ` Katsumi Yamaoka
2008-01-07  6:34                 ` Katsumi Yamaoka
2008-01-07 17:16                   ` Richard Stallman
2008-01-07 22:52                     ` Katsumi Yamaoka
2008-02-16 12:22                       ` Reiner Steib

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