Eli Zaretskii <[EMAIL PROTECTED]> writes:
>> > So may I suggest to define a real function, with a real doc string,
>> > and then bind those clicks to that function?
>>
>> I can't see a clean way to do that, without putting in 8 function
>> definitions that vary from each other by only a couple characters.
>> Yuck.
>
> Perhaps you could use a lambda expression or a macro inside a single
> function. Lisp is an interpreted language, as I'm sure you know.
The code in question goes like this:
(defun Buffer-menu-make-sort-button (column ...)
...
(propertize ...
'keymap (let ((map (make-sparse-keymap))
(fun `(lambda ()
(interactive)
(Buffer-menu-sort ,column))))
(define-key map [header-line mouse-1] fun)
...))
When you bind a function to a key, you can't specify any additional
arguments to pass to that function. So you have to define one
function for each of the possible values of `column' in the code.
The only way I can think of to get around this is to bind to a single
function that tries to re-construct the value of `column' based on
where the mouse was clicked. But that seems like a strange thing to
do -- you're throwing away information that you had (i.e., the value
of `column'), only to do a lot of work find out what it was later on.
I'm not sure which approach is cleaner.
_______________________________________________
Emacs-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-devel