emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: key to yank text at point into minibuffer?


From: Kevin Rodgers
Subject: Re: key to yank text at point into minibuffer?
Date: Thu, 16 Feb 2006 10:16:09 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Drew Adams wrote:
> > I think ffap.el should instead have a minor mode with its own keymap.
>
>     Is it as simple as this:
>     (defvar ffap-mode-map
>        (let ((map (make-sparse-keymap)))
>           (define-key map [S-mouse-3] 'ffap-at-mouse)
>           ...
>           map))
>     (defvar ffap-mode-hook nil "Hook run by `ffap-mode'.")
>     (define-minor-mode ffap-mode
>        "Toggle `ffap' bindings in every buffer.
>     \\{ffap-mode-map}"
>        :global t :lighter ""
>        (run-hooks 'ffap-mode-hook))
>
> Yes, I think so.
>
> However:
>
> . Does "" for :lighter act the same as nil? I'm not sure - the doc only
> speaks of nil. Logically, I guess "" would display an empty string when the
> mode is on and display nothing when it is off ;-).

I guess so, too.  The difference is that an entry isn't added to
minor-mode-alist for :lighter nil.

> . Isn't it good practice to show the mode name in the lighter? Shouldn't
> people see whether or not they are in ffap mode?

I don't know.  I figure the global minor modes I'm familiar with
(auto-compression, font-lock, and mouse-wheel) don't show up in the mode
line so I'd leave it out.  But then, those modes don't override default
keybindings either.  What does everyone think?

There's also a bug above: define-minor-mode already arranges for
ffap-mode-hook (and either ffap-mode-on-hook or ffap-mode-off-hook) to
be run, so calling run-hooks is redundant at best.

--
Kevin Rodgers





reply via email to

[Prev in Thread] Current Thread [Next in Thread]