summaryrefslogtreecommitdiff
path: root/lisp/ibuffer.el
diff options
context:
space:
mode:
authorJohn Paul Wallington <jpw@pobox.com>2002-10-29 04:21:03 +0000
committerJohn Paul Wallington <jpw@pobox.com>2002-10-29 04:21:03 +0000
commita1793b2dd29c08c236e4d9a236c55080ee1ec2c6 (patch)
tree11548f806f6a6e30c5cb93767ffe0419b322ded9 /lisp/ibuffer.el
parente53f3118cd0bb2de129934047f3f5e382dc9acf9 (diff)
downloademacs-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.el13
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))