diff options
author | Juri Linkov <juri@linkov.net> | 2021-11-22 19:39:28 +0200 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2021-11-22 19:39:28 +0200 |
commit | 712898210fdc4d7d5efc1636c68f9eac1632c9f8 (patch) | |
tree | 80e5efdcd19818089852363a133edf76c23092b8 /lisp/proced.el | |
parent | 0dd3883defc04ea02d2f77d79debf4e18157500d (diff) | |
download | emacs-712898210fdc4d7d5efc1636c68f9eac1632c9f8.tar.gz emacs-712898210fdc4d7d5efc1636c68f9eac1632c9f8.tar.bz2 emacs-712898210fdc4d7d5efc1636c68f9eac1632c9f8.zip |
* lisp/proced.el (proced-sort-header): Fix event positions (bug#1779).
The logic was copied from 'tabulated-list-col-sort'.
Diffstat (limited to 'lisp/proced.el')
-rw-r--r-- | lisp/proced.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/proced.el b/lisp/proced.el index fec2a29c847..3b754c24c5f 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -1330,11 +1330,12 @@ It is converted to the corresponding attribute key. This command updates the variable `proced-sort'. Prefix ARG controls sort order, see `proced-sort-interactive'." (interactive (list last-input-event (or last-prefix-arg 'no-arg))) - (let ((start (event-start event)) - col key) + (let* ((start (event-start event)) + (obj (posn-object start)) + col key) (save-selected-window (select-window (posn-window start)) - (setq col (+ (1- (car (posn-actual-col-row start))) + (setq col (+ (if obj (cdr obj) (posn-point start)) (window-hscroll))) (when (and (<= 0 col) (< col (length proced-header-line))) (setq key (get-text-property col 'proced-key proced-header-line)) |