* looping cursor position in dired
@ 2005-11-17 20:47 Sebastian Luque
0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Luque @ 2005-11-17 20:47 UTC (permalink / raw)
Hello,
Before I start writing something too complicated, what is the best way to
allow the cursor to loop through the dired buffer? i.e. if the cursor is
at the end of the buffer and you hit [up] (dired-next-line), then the
cursor would move to the first line; likewise for the opposite action.
Thanks,
--
Sebastian P. Luque
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: looping cursor position in dired
[not found] <mailman.15691.1132260814.20277.help-gnu-emacs@gnu.org>
@ 2005-11-17 23:54 ` rgb
2005-11-18 0:12 ` Sebastian Luque
0 siblings, 1 reply; 3+ messages in thread
From: rgb @ 2005-11-17 23:54 UTC (permalink / raw)
Sebastian Luque wrote:
> Hello,
>
> Before I start writing something too complicated, what is the best way to
> allow the cursor to loop through the dired buffer? i.e. if the cursor is
> at the end of the buffer and you hit [up] (dired-next-line), then the
> cursor would move to the first line; likewise for the opposite action.
>
> Thanks,
Yes it would be a shame if you did something complicated;)
(defadvice dired-next-line
(before my-buff-wrap activate compile) "With wrapping"
(when (eobp) (goto-char (point-min))))
(defadvice dired-previous-line
(before my-buff-wrap activate compile) "With wrapping"
(when (bobp) (goto-char (point-max))))
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: looping cursor position in dired
2005-11-17 23:54 ` rgb
@ 2005-11-18 0:12 ` Sebastian Luque
0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Luque @ 2005-11-18 0:12 UTC (permalink / raw)
"rgb" <rbielaws@i1.net> wrote:
[...]
> Yes it would be a shame if you did something complicated;)
> (defadvice dired-next-line
> (before my-buff-wrap activate compile) "With wrapping"
> (when (eobp) (goto-char (point-min))))
> (defadvice dired-previous-line
> (before my-buff-wrap activate compile) "With wrapping"
> (when (bobp) (goto-char (point-max))))
Nice, thanks for both the solution and example of defadvice usage!
Thanks,
--
Sebastian P. Luque
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-18 0:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-17 20:47 looping cursor position in dired Sebastian Luque
[not found] <mailman.15691.1132260814.20277.help-gnu-emacs@gnu.org>
2005-11-17 23:54 ` rgb
2005-11-18 0:12 ` Sebastian Luque
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.