emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FW: Minibuf menu when minibuffer is standalone


From: Juri Linkov
Subject: Re: FW: Minibuf menu when minibuffer is standalone
Date: Thu, 13 Mar 2008 04:01:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-unknown-linux-gnu)

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]