unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Q about occur buffer/point
@ 2003-05-29  3:12 Mike Ballard
  2003-05-29  8:28 ` Kai Großjohann
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Ballard @ 2003-05-29  3:12 UTC (permalink / raw)



Hi - 

I like to use occur to search large files but don't like that point
switches out of the occur buffer when selecting a line.  Is there a way to
have everything work as it does now but keep point in the occur buffer?

Mike
-- 

mike.ballard--at--earthlink.net

  "Play an accordion, go to jail.  It's the law!"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Q about occur buffer/point
  2003-05-29  3:12 Q about occur buffer/point Mike Ballard
@ 2003-05-29  8:28 ` Kai Großjohann
  2003-05-29 10:44   ` Matthias Meulien
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Großjohann @ 2003-05-29  8:28 UTC (permalink / raw)


Mike Ballard <dont_w@nt_spam.org> writes:

> I like to use occur to search large files but don't like that point
> switches out of the occur buffer when selecting a line.  Is there a way to
> have everything work as it does now but keep point in the occur buffer?

Hit C-h b in the *Occur* buffer for the key bindings.  You'll find
C-o, I guess.
-- 
This line is not blank.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Q about occur buffer/point
  2003-05-29  8:28 ` Kai Großjohann
@ 2003-05-29 10:44   ` Matthias Meulien
  2003-05-29 23:08     ` Mike Ballard
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Meulien @ 2003-05-29 10:44 UTC (permalink / raw)


kai.grossjohann@gmx.net (Kai Großjohann) wrote:

> (...) Hit C-h b in the *Occur* buffer for the key bindings. You'll
> find C-o, 

Only on recent version of emacs I guess... 

>From my init file :

(defun alt-occur-mode-view-occurrence ()
  "View the occurrence the current line describes."
  (interactive)
  (let ((pos (occur-mode-find-occurrence)))
    (pop-to-buffer occur-buffer)
    (goto-char (marker-position pos))
    (pop-to-buffer "*Occur*")))

(add-hook 'occur-mode-hook
	  '(lambda ()
	     (setq truncate-lines t)
	     (hl-line-mode 1)
	     (define-key occur-mode-map "v" 'alt-occur-mode-view-occurrence)
	     (define-key occur-mode-map "q" 'delete-window)))

Bye,
-- 
Matthias

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Q about occur buffer/point
  2003-05-29 10:44   ` Matthias Meulien
@ 2003-05-29 23:08     ` Mike Ballard
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Ballard @ 2003-05-29 23:08 UTC (permalink / raw)



On Thu May 29, Matthias Meulien woke me from a deep sleep when he said:

<snip>

> From my init file :
> 
> (defun alt-occur-mode-view-occurrence ()
>   "View the occurrence the current line describes."
>   (interactive)
>   (let ((pos (occur-mode-find-occurrence)))
>     (pop-to-buffer occur-buffer)
>     (goto-char (marker-position pos))
>     (pop-to-buffer "*Occur*")))
> 
> (add-hook 'occur-mode-hook
> 	  '(lambda ()
> 	     (setq truncate-lines t)
> 	     (hl-line-mode 1)
> 	     (define-key occur-mode-map "v" 'alt-occur-mode-view-occurrence)
> 	     (define-key occur-mode-map "q" 'delete-window)))
> 

Perfect!!  Thanks so much....

Mike
-- 

mike.ballard--at--earthlink.net

  "Play an accordion, go to jail.  It's the law!"

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-05-29 23:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-29  3:12 Q about occur buffer/point Mike Ballard
2003-05-29  8:28 ` Kai Großjohann
2003-05-29 10:44   ` Matthias Meulien
2003-05-29 23:08     ` Mike Ballard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).