all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bind "n" and "p" in occur-mode-map
@ 2010-06-24 23:20 Deniz Dogan
  2010-06-25 20:36 ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Deniz Dogan @ 2010-06-24 23:20 UTC (permalink / raw)
  To: Emacs-Devel devel

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

I was thrown off when I realized that occur-mode-map doesn't do
anything useful with "n" and "p" so I figured they could be bound to
occur-next and occur-prev respectively. Currently M-n and M-p are
bound to these functions. Attached is a patch.

Any comments?

-- 
Deniz Dogan

[-- Attachment #2: replace-occur-map.patch --]
[-- Type: application/octet-stream, Size: 504 bytes --]

=== modified file 'lisp/replace.el'
--- lisp/replace.el	2010-05-20 22:49:53 +0000
+++ lisp/replace.el	2010-06-24 23:17:01 +0000
@@ -769,6 +769,8 @@
     (define-key map "g" 'revert-buffer)
     (define-key map "q" 'quit-window)
     (define-key map "z" 'kill-this-buffer)
+    (define-key map "n" 'occur-next)
+    (define-key map "p" 'occur-prev)
     (define-key map "\C-c\C-f" 'next-error-follow-minor-mode)
     (define-key map [menu-bar] (make-sparse-keymap))
     (define-key map [menu-bar occur]


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

* Re: Bind "n" and "p" in occur-mode-map
  2010-06-24 23:20 Bind "n" and "p" in occur-mode-map Deniz Dogan
@ 2010-06-25 20:36 ` Juri Linkov
  2010-06-30 18:45   ` Ted Zlatanov
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2010-06-25 20:36 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: Emacs-Devel devel

> I was thrown off when I realized that occur-mode-map doesn't do
> anything useful with "n" and "p" so I figured they could be bound to
> occur-next and occur-prev respectively. Currently M-n and M-p are
> bound to these functions. Attached is a patch.
>
> Any comments?

There was a plan to converge keybindings of occur and grep/compile.
So maybe grep/compile should bind "n" and "p" as well?  There are
already some letters bound to special commands like `g' bound
to `recompile'.

Oh, no!  I just tried to type `g' in etc/compilation.txt and
it has a disastrous effect - it overwrites the file with the
output of the last compilation command.

I wonder why `g' is bound to `recompile' instead of `revert-buffer'?

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



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

* Re: Bind "n" and "p" in occur-mode-map
  2010-06-25 20:36 ` Juri Linkov
@ 2010-06-30 18:45   ` Ted Zlatanov
  2010-07-02 20:54     ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Ted Zlatanov @ 2010-06-30 18:45 UTC (permalink / raw)
  To: emacs-devel

On Fri, 25 Jun 2010 23:36:32 +0300 Juri Linkov <juri@jurta.org> wrote: 

>> I was thrown off when I realized that occur-mode-map doesn't do
>> anything useful with "n" and "p" so I figured they could be bound to
>> occur-next and occur-prev respectively. Currently M-n and M-p are
>> bound to these functions. Attached is a patch.
>> 
>> Any comments?

JL> There was a plan to converge keybindings of occur and grep/compile.
JL> So maybe grep/compile should bind "n" and "p" as well?

The underlying functionality (next-error/previous-error) is the same so
binding `n'/`p' makes sense to me as well.  But next-error also has the
`C-x `' binding *globally* so maybe it makes sense to think about the
corresponding global binding for previous-error as well.  At least in my
experience it's more useful to jump back and forth between interesting
points in the source buffer than in the adjunct compilation/grep/occur
buffer.

Ted




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

* Re: Bind "n" and "p" in occur-mode-map
  2010-06-30 18:45   ` Ted Zlatanov
@ 2010-07-02 20:54     ` Juri Linkov
  0 siblings, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2010-07-02 20:54 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: emacs-devel

> JL> There was a plan to converge keybindings of occur and grep/compile.
> JL> So maybe grep/compile should bind "n" and "p" as well?
>
> The underlying functionality (next-error/previous-error) is the same so
> binding `n'/`p' makes sense to me as well.  But next-error also has the
> `C-x `' binding *globally* so maybe it makes sense to think about the
> corresponding global binding for previous-error as well.  At least in my
> experience it's more useful to jump back and forth between interesting
> points in the source buffer than in the adjunct compilation/grep/occur
> buffer.

We already have convenient global keybindings `M-g M-n' for `next-error'
and `M-g M-p' for `previous-error'.

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



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

end of thread, other threads:[~2010-07-02 20:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-24 23:20 Bind "n" and "p" in occur-mode-map Deniz Dogan
2010-06-25 20:36 ` Juri Linkov
2010-06-30 18:45   ` Ted Zlatanov
2010-07-02 20:54     ` Juri Linkov

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.