all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug in y-or-n-p?
@ 2005-06-22 15:42 Richard M. Stallman
  2005-06-22 16:39 ` Luc Teirlinck
  2005-06-22 16:55 ` Bug in y-or-n-p? Luc Teirlinck
  0 siblings, 2 replies; 10+ messages in thread
From: Richard M. Stallman @ 2005-06-22 15:42 UTC (permalink / raw)


Can someone please debug this?

    From: "Drew Adams" <drew.adams@oracle.com>

    1. Define these:

    (defun foo () (y-or-n-p "foo? "))
    (defun bar () (y-or-n-p "bar? "))
    (setq kill-emacs-query-functions '(foo bar))

    2. Use the menu-bar File > Exit Emacs. 

    The question "foo? " correctly appears in a popup menu y/n.

    3. Respond `n'  to "foo? ".

    4. The question "bar? " should be asked via a popup menu also, but it
       appears instead in the minibuffer.

    That is, the user starts with the mouse and menu-bar, but he is
    obliged to switch mid-stream to answering with the keyboard.

I think something in the C code is setting last_nonmenu_event
in between the two calls to y-or-n-p.  Could someone please
find out what?

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

* Re: Bug in y-or-n-p?
  2005-06-22 15:42 Bug in y-or-n-p? Richard M. Stallman
@ 2005-06-22 16:39 ` Luc Teirlinck
  2005-06-22 17:00   ` Drew Adams
  2005-06-22 16:55 ` Bug in y-or-n-p? Luc Teirlinck
  1 sibling, 1 reply; 10+ messages in thread
From: Luc Teirlinck @ 2005-06-22 16:39 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:
   
   Can someone please debug this?

       From: "Drew Adams" <drew.adams@oracle.com>

       1. Define these:

       (defun foo () (y-or-n-p "foo? "))
       (defun bar () (y-or-n-p "bar? "))
       (setq kill-emacs-query-functions '(foo bar))

       2. Use the menu-bar File > Exit Emacs. 

       The question "foo? " correctly appears in a popup menu y/n.

       3. Respond `n'  to "foo? ".

       4. The question "bar? " should be asked via a popup menu also, but it
	  appears instead in the minibuffer.

No, the question bar should not be asked at all if you answere `n' to
foo, and in today's CVS it is not asked, at least not on GNU/Linux.

If you answer `y' to foo, then bar should be asked via a popup menu,
and it is, in today's CVS, at least on GNU/Linux.

There is no bug.

>From the kill-emacs-query-functions docstring:

  Functions to call with no arguments to query about killing Emacs.
  If any of these functions returns nil, killing Emacs is cancelled. 

In other words, once you answer `n' to any question, the other
questions are not asked.  The fact that bar was asked for Drew could
have been a temporary bug In CVS which would appear to be fixed now.
Unless it is operating system specific, or a local problem with Drew's
setup.

Sincerely,

Luc.

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

* Re: Bug in y-or-n-p?
  2005-06-22 15:42 Bug in y-or-n-p? Richard M. Stallman
  2005-06-22 16:39 ` Luc Teirlinck
@ 2005-06-22 16:55 ` Luc Teirlinck
  1 sibling, 0 replies; 10+ messages in thread
From: Luc Teirlinck @ 2005-06-22 16:55 UTC (permalink / raw)
  Cc: emacs-devel

>From my previous message:

	  3. Respond `n'  to "foo? ".

	  4. The question "bar? " should be asked via a popup menu also, but it
	     appears instead in the minibuffer.

   No, the question bar should not be asked at all if you answer `n' to
   foo, and in today's CVS it is not asked, at least not on GNU/Linux.

I should added that, after answering `n' to foo:

foo (y or n) n

appears in the minibuffer as a confirmation that you answered `n' to
foo and killing Emacs was cancelled.

Sincerely,

Luc.

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

* RE: Bug in y-or-n-p?
  2005-06-22 16:39 ` Luc Teirlinck
@ 2005-06-22 17:00   ` Drew Adams
  2005-06-22 17:18     ` Luc Teirlinck
  2005-06-22 17:31     ` Distributor [WAS: Bug in y-or-n-p?] Glenn Morris
  0 siblings, 2 replies; 10+ messages in thread
From: Drew Adams @ 2005-06-22 17:00 UTC (permalink / raw)


           1. Define these:
    
           (defun foo () (y-or-n-p "foo? "))
           (defun bar () (y-or-n-p "bar? "))
           (setq kill-emacs-query-functions '(foo bar))
    
           2. Use the menu-bar File > Exit Emacs. 
    
           The question "foo? " correctly appears in a popup menu y/n.
    
           3. Respond `n'  to "foo? ".
    
           4. The question "bar? " should be asked via a popup menu 
              also, but it appears instead in the minibuffer.
    
    No, the question bar should not be asked at all if you answere `n' to
    foo, and in today's CVS it is not asked, at least not on GNU/Linux.
    
    If you answer `y' to foo, then bar should be asked via a popup menu,
    and it is, in today's CVS, at least on GNU/Linux.
    
    There is no bug.
    
    >From the kill-emacs-query-functions docstring:
    
      Functions to call with no arguments to query about killing Emacs.
      If any of these functions returns nil, killing Emacs is cancelled. 
    
    In other words, once you answer `n' to any question, the other
    questions are not asked.  The fact that bar was asked for Drew could
    have been a temporary bug In CVS which would appear to be fixed now.
    Unless it is operating system specific, or a local problem with Drew's
    setup.

I'm sorry, I meant this for foo:

 (defun foo ()  (y-or-n-p "foo? ") t) ; always return `t'


I'm using this version of Emacs:

In GNU Emacs 22.0.50.2 (i386-mingw-nt5.1.2600)
 of 2005-04-16 on LAPTOP
Distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'

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

* Re: Bug in y-or-n-p?
  2005-06-22 17:00   ` Drew Adams
@ 2005-06-22 17:18     ` Luc Teirlinck
  2005-06-22 17:24       ` Drew Adams
  2005-06-22 17:31     ` Distributor [WAS: Bug in y-or-n-p?] Glenn Morris
  1 sibling, 1 reply; 10+ messages in thread
From: Luc Teirlinck @ 2005-06-22 17:18 UTC (permalink / raw)
  Cc: emacs-devel

Drew Adams wrote:

   I'm sorry, I meant this for foo:

    (defun foo ()  (y-or-n-p "foo? ") t) ; always return `t'

After that, and following the rest of your recipe, bar gets asked via
a popup menu, in today's CVS, on GNU/Linux.

Sincerely,

Luc.

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

* RE: Bug in y-or-n-p?
  2005-06-22 17:18     ` Luc Teirlinck
@ 2005-06-22 17:24       ` Drew Adams
  2005-06-23  0:38         ` Juanma Barranquero
  0 siblings, 1 reply; 10+ messages in thread
From: Drew Adams @ 2005-06-22 17:24 UTC (permalink / raw)


        (defun foo ()  (y-or-n-p "foo? ") t) ; always return `t'

    After that, and following the rest of your recipe, bar gets asked via
    a popup menu, in today's CVS, on GNU/Linux.

Great, then it's fixed. Thanks.

In my (April 2005) version, foo gets asked via popup menu, but bar gets
asked via the minibuffer.

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

* Distributor [WAS: Bug in y-or-n-p?]
  2005-06-22 17:00   ` Drew Adams
  2005-06-22 17:18     ` Luc Teirlinck
@ 2005-06-22 17:31     ` Glenn Morris
  2005-06-23 16:54       ` Richard M. Stallman
  1 sibling, 1 reply; 10+ messages in thread
From: Glenn Morris @ 2005-06-22 17:31 UTC (permalink / raw)



> In GNU Emacs 22.0.50.2 (i386-mingw-nt5.1.2600)
> of 2005-04-16 on LAPTOP
> Distributor `Microsoft Corp.', version 5.1.2600

<shudder>

On aesthetic and sanity-preserving grounds, how about the following
change to emacsbug.el?


*** emacsbug.el 23 Nov 2004 19:22:43 -0000 1.63
--- emacsbug.el 22 Jun 2005 17:28:21 -0000
***************
*** 130,136 ****
      (insert "In " (emacs-version) "\n")
      (if (fboundp 'x-server-vendor)
      (condition-case nil
!         (insert "Distributor `" (x-server-vendor) "', version "
                      (mapconcat 'number-to-string (x-server-version)
                      ".") "\n")
                        (error t)))
      (if (and system-configuration-options
--- 130,136 ----
      (insert "In " (emacs-version) "\n")
      (if (fboundp 'x-server-vendor)
      (condition-case nil
!         (insert "X server distributor `" (x-server-vendor) "', version "
                (mapconcat 'number-to-string (x-server-version) ".")
                "\n")
                  (error t)))
      (if (and system-configuration-options

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

* Re: Bug in y-or-n-p?
  2005-06-22 17:24       ` Drew Adams
@ 2005-06-23  0:38         ` Juanma Barranquero
  2005-06-23 14:20           ` Drew Adams
  0 siblings, 1 reply; 10+ messages in thread
From: Juanma Barranquero @ 2005-06-23  0:38 UTC (permalink / raw)
  Cc: emacs-devel

> Great, then it's fixed. Thanks.
> 
> In my (April 2005) version, foo gets asked via popup menu, but bar gets
> asked via the minibuffer.

I don't think it is fixed. You were testing on Windows, weren't you? I
see the same problem with MinGW and MSVC on today's CVS.

-- 
                    /L/e/k/t/u

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

* RE: Bug in y-or-n-p?
  2005-06-23  0:38         ` Juanma Barranquero
@ 2005-06-23 14:20           ` Drew Adams
  0 siblings, 0 replies; 10+ messages in thread
From: Drew Adams @ 2005-06-23 14:20 UTC (permalink / raw)
  Cc: emacs-devel

    > Great, then it's fixed. Thanks.
    > 
    > In my (April 2005) version, foo gets asked via popup menu, 
    > but bar gets asked via the minibuffer.
    
    I don't think it is fixed. You were testing on Windows, weren't you? I
    see the same problem with MinGW and MSVC on today's CVS.
    
Yes, I'm on Windows. Thanks for checking the bug.

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

* Re: Distributor [WAS: Bug in y-or-n-p?]
  2005-06-22 17:31     ` Distributor [WAS: Bug in y-or-n-p?] Glenn Morris
@ 2005-06-23 16:54       ` Richard M. Stallman
  0 siblings, 0 replies; 10+ messages in thread
From: Richard M. Stallman @ 2005-06-23 16:54 UTC (permalink / raw)
  Cc: emacs-devel

    On aesthetic and sanity-preserving grounds, how about the following
    change to emacsbug.el?

Please install it.

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

end of thread, other threads:[~2005-06-23 16:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-22 15:42 Bug in y-or-n-p? Richard M. Stallman
2005-06-22 16:39 ` Luc Teirlinck
2005-06-22 17:00   ` Drew Adams
2005-06-22 17:18     ` Luc Teirlinck
2005-06-22 17:24       ` Drew Adams
2005-06-23  0:38         ` Juanma Barranquero
2005-06-23 14:20           ` Drew Adams
2005-06-22 17:31     ` Distributor [WAS: Bug in y-or-n-p?] Glenn Morris
2005-06-23 16:54       ` Richard M. Stallman
2005-06-22 16:55 ` Bug in y-or-n-p? Luc Teirlinck

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.