all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marco Baringer <empb@bese.it>
Subject: Re: Emacs 21.2  :  Can you set it up so the cursor is focused in completeion buffers when they happen?
Date: 07 Sep 2002 21:16:58 +0200	[thread overview]
Message-ID: <m2elc5y5hx.fsf@bese.it> (raw)
In-Reply-To: <6f8cb8c9.0209070835.6c78d074@posting.google.com>

stevesusenet@yahoo.com (Steve) writes:

> I would like emacs to put the cursor there automatically in those
> situations so I do not have to hit C-x o to put it there before I can
> scroll the results.

so, you want to run some code (other-window 1) after emacs has
finishing runing occur (or whatever). sounds like a job for defadvice
to me, what do you say robin? "holy-crazy-elisp-code batman! you may
be on to something!" :)

try something along the lines of:

(defadvice occur (after occur-switch-to-window)
  (other-window 1))
(ad-activate 'occur)

now, since you want to do it for quite a few functions (grep comes to
mind), it'd be nice to wrap it up in a macro like this one:

(defmacro add-switch-to-window-advice (function)
  `(progn
     (defadvice ,function (after ,(intern (concat (symbol-name function) "-switch-to-window")))
       (other-window 1))
     (ad-activate ',function)))

and use it like this:

(add-switch-to-window-advice occur)
(add-switch-to-window-advice grep)
...

or some such madness.

i would not suggest using it for the help functions as you can't do
anything in thoses buffers, only read them so you'd have to opposite
annoyance of having to switch out of those buffers, this is unlike
grep and occur where having the point in thoses buffers is usefull.

-- 
-Marco
Ring the bells that still can ring.
Forget your perfect offering.
There is a crack in everything.
That's how the light gets in.
     -Leonard Cohen

p.s. - i had been happily living with this annoyance for quite a
while. thanks for pointing it out to me.

  reply	other threads:[~2002-09-07 19:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-06 20:31 Emacs 21.2 : Can you set it up so the cursor is focused in completeion buffers when they happen? Steve
2002-09-06 22:21 ` Kevin Rodgers
2002-09-07  3:55   ` Steve
2002-09-07  9:54     ` Marco Baringer
     [not found]     ` <mailman.1031392446.23072.help-gnu-emacs@gnu.org>
2002-09-07 16:35       ` Steve
2002-09-07 19:16         ` Marco Baringer [this message]
2002-09-07 19:27         ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2elc5y5hx.fsf@bese.it \
    --to=empb@bese.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.