]> git.eshelyaron.com Git - emacs.git/commit
* lisp/dired.el (dired--move-to-next-line): Improve to avoid an infinite loop.
authorJuri Linkov <juri@linkov.net>
Thu, 25 Jan 2024 17:38:03 +0000 (19:38 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 25 Jan 2024 18:06:45 +0000 (19:06 +0100)
commit7e62b994160963a1fb447be49f7845c28b25e719
treead309a01c1b7b253e7961b57709322c54099bc51
parent3000a1605d5541593579a05aad5ee5c1bd842cb5
* lisp/dired.el (dired--move-to-next-line): Improve to avoid an infinite loop.

An infinite loop is possible in a directory without files and subdirectories,
where even lines with . and .. are omitted, so 'dired-between-files' is true
for all Dired lines.  For the case of dired-movement-style=cycle
a guard is triggered when the loop wraps twice while the value 'arg'
is not changing.  And for the case of dired-movement-style=bounded
a guard is triggered when point doesn't move while trying to
go back to the last non-empty line.

(cherry picked from commit b07265f8eed74dda792e13062baae94319484b4b)
lisp/dired.el