[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: *Buffer List* column headers don't sort unless selec
From: |
Daniel Pfeiffer |
Subject: |
Re: address@hidden: *Buffer List* column headers don't sort unless select buffer first] |
Date: |
Fri, 29 Oct 2004 22:08:34 +0200 |
Saluton, Moin,
Richard Stallman <address@hidden> skribis:
> A key sequence that starts with a mouse event is read using the keymaps
> of the buffer in the window that the mouse was in, not the current
> buffer. This does not imply that clicking in a window selects that
> window or its buffer---that is entirely under the control of the command
> binding of the key sequence.
>
> Many others don't work right. For example when you hover over a
> previous comint input, it says that mouse-2 will copy it down. But when
> you do, the key binding comes from the active window, with normally the
> result of pasting into the middle of the old input instead.
>
>
>
> Please try this patch:
>
> *** comint.el 17 Oct 2004 10:12:46 -0400 1.303
> --- comint.el 28 Oct 2004 07:08:57 -0400
> ***************
> *** 788,794 ****
>
> (defun comint-insert-input (&optional event)
> "In a Comint buffer, set the current input to the previous input at
> point."
> ! (interactive "@")
> (if event (mouse-set-point event))
> (let ((pos (point)))
> (if (not (eq (get-char-property pos 'field) 'input))
> --- 788,794 ----
>
> (defun comint-insert-input (&optional event)
> "In a Comint buffer, set the current input to the previous input at
> point."
> ! (interactive "e")
> (if event (mouse-set-point event))
> (let ((pos (point)))
> (if (not (eq (get-char-property pos 'field) 'input))
Yes. that solves this one. I tried something similar for the original bug:
(defun Buffer-menu-make-sort-button (name column)
(if (equal column Buffer-menu-sort-column) (setq column nil))
(propertize name
'help-echo (if column
(concat "mouse-2: sort by " (downcase name))
"mouse-2: sort by visited order")
'mouse-face 'highlight
'keymap (let ((map (make-sparse-keymap)))
(define-key map [header-line mouse-2]
`(lambda (e)
(interactive "e")
(if e (mouse-select-window e))
(Buffer-menu-sort ,column)))
map)))
This doesn't work with save-window-excursion, such that the Buffer-menu is
selected afterwards, but that seems better to me than losing the point.
coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
--
lerne / learn / apprends / lär dig / ucz się Esperanto:
http://lernu.net/