diff options
author | John Paul Wallington <jpw@pobox.com> | 2002-10-29 04:21:03 +0000 |
---|---|---|
committer | John Paul Wallington <jpw@pobox.com> | 2002-10-29 04:21:03 +0000 |
commit | a1793b2dd29c08c236e4d9a236c55080ee1ec2c6 (patch) | |
tree | 11548f806f6a6e30c5cb93767ffe0419b322ded9 /lisp/ibuffer.el | |
parent | e53f3118cd0bb2de129934047f3f5e382dc9acf9 (diff) | |
download | emacs-a1793b2dd29c08c236e4d9a236c55080ee1ec2c6.tar.gz |
(ibuffer-mouse-popup-menu): Set point before popping
up filter groups menu. Preserve point unless a menu command has
moved it from point clicked.
Diffstat (limited to 'lisp/ibuffer.el')
-rw-r--r-- | lisp/ibuffer.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index d37d5c6f644..464961cc417 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -869,12 +869,13 @@ width and the longest string in LIST." (defun ibuffer-mouse-popup-menu (event) "Display a menu of operations." (interactive "e") - (let ((eventpt (save-excursion - (mouse-set-point event) - (point)))) + (let ((eventpt (posn-point (event-end event))) + (origpt (point))) (unwind-protect (if (get-text-property eventpt 'ibuffer-filter-group-name) - (popup-menu ibuffer-mode-groups-popup) + (progn + (goto-char eventpt) + (popup-menu ibuffer-mode-groups-popup)) (let ((inhibit-read-only t)) (ibuffer-save-marks ;; hm. we could probably do this in a better fashion @@ -884,7 +885,9 @@ width and the longest string in LIST." (ibuffer-set-mark ibuffer-marked-char)) (save-excursion (popup-menu ibuffer-mode-operate-map))))) - (setq buffer-read-only t)))) + (setq buffer-read-only t) + (if (eq eventpt (point)) + (goto-char origpt))))) (defun ibuffer-skip-properties (props direction) (while (and (not (eobp)) |