>> Then the keymap doesn't depend on `name' or `column', so it can be created
>> once and for all at the toplevel, right?
>
> Right!
>
> Chong, would you like to work on this?
Yes, it's not hard.
___
Emacs-devel mailing list
Emacs-devel@gnu.org
http://
Stefan Monnier <[EMAIL PROTECTED]> writes:
>> (defun Buffer-menu-make-sort-button (name column)
>> (if (equal column Buffer-menu-sort-column) (setq column nil))
>> (let* ((downname (downcase name))
>> ! (map (make-sparse-keymap)))
>> ;; This keymap handles both nil and non
> (defun Buffer-menu-make-sort-button (name column)
> (if (equal column Buffer-menu-sort-column) (setq column nil))
> (let* ((downname (downcase name))
> ! (map (make-sparse-keymap)))
> ;; This keymap handles both nil and non-nil
> ;; values for Buffer-menu-use-header
Stefan just checked in a different fix to buff-menu.el, defining a
lambda expression and interning it. This fix also has a problem:
`C-h k' can't generate a hyperlink to the Lisp file:
mouse-2 runs the command Buffer-menu-sort-by-name, which is an
interactive Lisp function.
Kim's solution
> Not if you use the right approach.
>
> Try this patch (not fully tested, but shows the principle):
It works. Very clever!
___
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
Chong Yidong <[EMAIL PROTECTED]> writes:
> Eli Zaretskii <[EMAIL PROTECTED]> writes:
>
>>> 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 th
Tomas Zerolo wrote:
> Can't you attach a doc-string to an anonymous function, like so?
>
> `lambda (e)
> ,(concat "Sort buffer by " column)
> ...
Obviously you can include a doc string in a lambda form. The real
question is, will Emacs do the right thing with it? It looks pretty
Eli Zaretskii <[EMAIL PROTECTED]> writes:
>> 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 t
> > Why? It is much more convenient to allow users to click on a link. If
> > the user wants to move the header line (which is not something that
> > people do frequently, anyway), all she has to do is to move the mouse
> > two milimeters to the left, outside the button. This is what people
>
> From: "Richard M. Stallman" <[EMAIL PROTECTED]>
> Date: Tue, 06 Sep 2005 07:22:59 -0400
> Cc: [EMAIL PROTECTED], emacs-devel@gnu.org
>
> I don't think it is worth spending the time to have a long discussion
> about whether to use a macro to define these commands, whether they
> should be lambdas
I don't think it is worth spending the time to have a long discussion
about whether to use a macro to define these commands, whether they
should be lambdas or have names, etc.
Does the current version of the patch actually work,
or is there a bug in it?
_
Can't you attach a doc-string to an anonymous function, like so?
`lambda (e)
,(concat "Sort buffer by " column)
...
(apologies if I am babbling)
regards
-- tomás
signature.asc
Description: Digital signature
___
Emacs-devel mailing l
Eli Zaretskii <[EMAIL PROTECTED]> writes:
> There must be some kind of misunderstanding here. I understand that
> you need to know where the mouse was clicked, but that information is
> stored in the mouse event that invokes the function, so if you use
> `(interactive "e")', you will have access
> Cc: emacs-devel@gnu.org
> From: Chong Yidong <[EMAIL PROTECTED]>
> Date: Mon, 05 Sep 2005 18:18:18 -0400
>
> (defun Buffer-menu-make-sort-button (column ...)
> ...
> (propertize ...
> 'keymap (let ((map (make-sparse-keymap))
> (fun `(lambda ()
>
> > > > because then the header line can then respond to mouse-1 clicks
> > > > and still be dragged (try it on the mode-line to see what I
> > > > mean).
> > >
> > > You can drag it by clicking on any part of the header line outside the
> > > button text. Again, this is the same as I
Nick Roberts <[EMAIL PROTECTED]> writes:
> > > With this patch header-line buttons in the buffer list buffer certainly
> > > respond to Mouse-1 but unfortunately they do this even when
> > > mouse-1-click-follows-link is nil.
> >
> > This behavior is the same as Info-mode. It makes sense be
Chong Yidong writes:
> > With this patch header-line buttons in the buffer list buffer certainly
> > respond to Mouse-1 but unfortunately they do this even when
> > mouse-1-click-follows-link is nil.
>
> This behavior is the same as Info-mode. It makes sense because
> mouse-1 on the header
> With this patch header-line buttons in the buffer list buffer certainly
> respond to Mouse-1 but unfortunately they do this even when
> mouse-1-click-follows-link is nil.
This behavior is the same as Info-mode. It makes sense because
mouse-1 on the header line would not set point, as it would i
Chong Yidong writes:
> This is regarding this FOR-RELEASE item:
>
>** The header-line buttons in the buffer list buffer should respond
> to Mouse-1.
>
> The following patch fixes the bug and simplifies the code. (The `if'
> condition that checks `Buffer-menu-use-header-line' in
> 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'),
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 ch
> Cc: emacs-devel@gnu.org
> From: Chong Yidong <[EMAIL PROTECTED]>
> Date: Mon, 05 Sep 2005 08:31:27 -0400
>
> > 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 functi
Eli Zaretskii <[EMAIL PROTECTED]> writes:
> I realize that the original code had the same problem, but since we
> are changing it: using lambda expressions to bind mouse clicks has a
> negative side effect that "C-h c", "C-h k" and similar help commands,
> when used with these mouse clicks, displa
> From: Chong Yidong <[EMAIL PROTECTED]>
> Date: Sun, 04 Sep 2005 15:16:34 -0400
>
> This is regarding this FOR-RELEASE item:
>
>** The header-line buttons in the buffer list buffer should respond
> to Mouse-1.
>
> The following patch fixes the bug and simplifies the code. (The `if'
>
This is regarding this FOR-RELEASE item:
** The header-line buttons in the buffer list buffer should respond
to Mouse-1.
The following patch fixes the bug and simplifies the code. (The `if'
condition that checks `Buffer-menu-use-header-line' in the old code is
not necessary, because it
25 matches
Mail list logo