emacs-devel
[Top][All Lists]
Advanced

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

Re: how about a find-library-other-window command?


From: Juri Linkov
Subject: Re: how about a find-library-other-window command?
Date: Wed, 20 Jun 2007 17:09:14 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

>     C-x 4 or some such prefix could automatically add the command's context
>     (buffer name + this-command) to the config variable, so the next call
>     without C-x 4 will reuse this preference once explicitly defined by 
> calling
>     the command with the C-x 4 prefix.
>
> That is not a good implementation, because it requires each command to
> have special code to test the flag.  The original idea was both better
> and simpler.

Let me express more clear what I meant: not each command should test the flag,
but only a new function `show-buffer' used by these commands.

So for instance having

(defun foo ()
  (interactive)
  ...
  (show-buffer new-buffer))

bound to some key (e.g. `C-c C-f').

Then after typing `C-x 4 C-c C-f', the prefix `C-x 4' will set some
special variable, and `show-buffer' called by this command will detect it
and put `this-command' to the user config alist with a flag to reuse this
user preference next time this command is called without the prefix `C-x 4'.

> Another drawback of this method is you'd have to type C-x 4 C-x C-f.

You have to type `C-x 4 C-x C-f' only once.  After `show-buffer' records the
fact of calling with the prefix `C-x 4' first time, it will reuse this
preference on subsequent invocations without the prefix `C-x 4'.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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