all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Lennart Borgman \(gmail\)" <lennart.borgman@gmail.com>,
	Drew Adams <drew.adams@oracle.com>,
	'Emacs-Devel' <emacs-devel@gnu.org>
Subject: Re: FW: Minibuf menu when minibuffer is standalone
Date: Thu, 13 Mar 2008 04:01:19 +0200	[thread overview]
Message-ID: <87lk4n5teo.fsf@jurta.org> (raw)
In-Reply-To: <jwvk5k8kav4.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 11 Mar 2008 21:11:40 -0400")

> In any case I've changed the Quit to use the same binding as C-g (so
> C-g is shown in the shortcuts) and tweaked the "Enter" entry so it shows
> RET (or thing) rather than C-j (or nothing).

BTW, a similar thing could be done to the toolbar.  The "kill" icon on
the toolbar kills the current buffer, but it is greyed out when the
minibuffer is active.  However, it is natural from the user's point of
view to expect that clicking on this icon will "kill" the minibuffer
when it is active.  Internally, killing the normal buffer and the
minibuffer is implemented by separate functions, but for the user of
the toolbar this distinction is not essential.

I propose the following patch that enables the kill icon in the minibuffer
and calls `abort-recursive-edit' when clicked on.  This makes more
conventient for mouse users to get out of the minibuffer.

Index: lisp/menu-bar.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/menu-bar.el,v
retrieving revision 1.323
diff -c -r1.323 menu-bar.el
*** lisp/menu-bar.el	11 Mar 2008 22:02:46 -0000	1.323
--- lisp/menu-bar.el	13 Mar 2008 02:00:19 -0000
***************
*** 1439,1447 ****
      (not (window-minibuffer-p (frame-selected-window menu-frame)))))
  
  (defun kill-this-buffer ()	; for the menu bar
!   "Kill the current buffer."
    (interactive)
!   (kill-buffer (current-buffer)))
  
  (defun kill-this-buffer-enabled-p ()
    (let ((count 0)
--- 1439,1451 ----
      (not (window-minibuffer-p (frame-selected-window menu-frame)))))
  
  (defun kill-this-buffer ()	; for the menu bar
!   "Kill the current buffer.
! When called in the minibuffer, get out of the minibuffer
! using `abort-recursive-edit'."
    (interactive)
!   (if (menu-bar-non-minibuffer-window-p)
!       (kill-buffer (current-buffer))
!     (abort-recursive-edit)))
  
  (defun kill-this-buffer-enabled-p ()
    (let ((count 0)
***************
*** 1450,1457 ****
        (or (string-match "^ " (buffer-name (car buffers)))
  	  (setq count (1+ count)))
        (setq buffers (cdr buffers)))
!     (and (menu-bar-non-minibuffer-window-p)
! 	 (> count 1))))
  
  (put 'dired 'menu-enable '(menu-bar-non-minibuffer-window-p))
  
--- 1454,1461 ----
        (or (string-match "^ " (buffer-name (car buffers)))
  	  (setq count (1+ count)))
        (setq buffers (cdr buffers)))
!     (or (not (menu-bar-non-minibuffer-window-p))
! 	(> count 1))))
  
  (put 'dired 'menu-enable '(menu-bar-non-minibuffer-window-p))

-- 
Juri Linkov
http://www.jurta.org/emacs/




  reply	other threads:[~2008-03-13  2:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11 19:08 FW: Minibuf menu when minibuffer is standalone Drew Adams
2008-03-11 19:34 ` Lennart Borgman (gmail)
2008-03-11 21:10 ` Stefan Monnier
2008-03-11 21:39   ` Lennart Borgman (gmail)
2008-03-11 21:50     ` Stefan Monnier
2008-03-11 22:05       ` Lennart Borgman (gmail)
2008-03-12  1:11         ` Stefan Monnier
2008-03-13  2:01           ` Juri Linkov [this message]
2008-03-11 23:11   ` Drew Adams

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=87lk4n5teo.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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.