* bug#18547: repeated C-s doesn't wrap back to the top if file is .gz
@ 2014-09-24 17:09 積丹尼 Dan Jacobson
2014-09-24 19:28 ` Juri Linkov
2014-09-24 19:42 ` 積丹尼 Dan Jacobson
0 siblings, 2 replies; 7+ messages in thread
From: 積丹尼 Dan Jacobson @ 2014-09-24 17:09 UTC (permalink / raw)
To: 18547
$ emacs -q directory_that_contains_a_.gz_file
v on that file. (view mode)
C-s some_string, C-s C-s C-s C-s C-s ... but then instead of wrapping
around back to the top, we get
File not found and directory write-protected
By the way, it happened on a changelog.gz
file, and the prompt was "Multi I-Search" whatever that means.
Debian emacs 24.3+1-5
emacs-version "24.3.1"
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#18547: repeated C-s doesn't wrap back to the top if file is .gz
2014-09-24 17:09 bug#18547: repeated C-s doesn't wrap back to the top if file is .gz 積丹尼 Dan Jacobson
@ 2014-09-24 19:28 ` Juri Linkov
2014-09-24 20:25 ` Stefan Monnier
2014-09-24 19:42 ` 積丹尼 Dan Jacobson
1 sibling, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2014-09-24 19:28 UTC (permalink / raw)
To: 積丹尼 Dan Jacobson; +Cc: 18547
> $ emacs -q directory_that_contains_a_.gz_file
> v on that file. (view mode)
> C-s some_string, C-s C-s C-s C-s C-s ... but then instead of wrapping
> around back to the top, we get
> File not found and directory write-protected
>
> By the way, it happened on a changelog.gz
> file, and the prompt was "Multi I-Search" whatever that means.
It fails because you are using a non-standard file name
"changelog", and not the default "ChangeLog". You can customize
`change-log-default-name' to "changelog" then isearch will wrap
to the beginning instead of trying to wrap to a non-existent "ChangeLog".
I'm not sure whether we should deduce change-log-name from the
file name of the current buffer (removing possible suffixes
like ".10" from "changelog.10").
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#18547: repeated C-s doesn't wrap back to the top if file is .gz
2014-09-24 19:28 ` Juri Linkov
@ 2014-09-24 20:25 ` Stefan Monnier
2014-09-24 22:20 ` Juri Linkov
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2014-09-24 20:25 UTC (permalink / raw)
To: Juri Linkov; +Cc: 18547, 積丹尼 Dan Jacobson
>> File not found and directory write-protected
[...]
> It fails because you are using a non-standard file name
> "changelog", and not the default "ChangeLog". You can customize
> `change-log-default-name' to "changelog" then isearch will wrap
> to the beginning instead of trying to wrap to a non-existent "ChangeLog".
I think failing to switch to another file is fine, but it should
still wrap around, and it should not burp at the user about some
non-existing file.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#18547: repeated C-s doesn't wrap back to the top if file is .gz
2014-09-24 20:25 ` Stefan Monnier
@ 2014-09-24 22:20 ` Juri Linkov
2014-09-25 1:10 ` Stefan Monnier
0 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2014-09-24 22:20 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18547, 積丹尼 Dan Jacobson
>>> File not found and directory write-protected
> [...]
>> It fails because you are using a non-standard file name
>> "changelog", and not the default "ChangeLog". You can customize
>> `change-log-default-name' to "changelog" then isearch will wrap
>> to the beginning instead of trying to wrap to a non-existent "ChangeLog".
>
> I think failing to switch to another file is fine, but it should
> still wrap around, and it should not burp at the user about some
> non-existing file.
Then if there are no files that fit the default naming scheme ChangeLog[.NN],
this patch will wrap around in the current buffer. (I'm not sure whether
it should go into emacs-24 or trunk):
=== modified file 'lisp/vc/add-log.el'
--- lisp/vc/add-log.el 2014-02-10 01:34:22 +0000
+++ lisp/vc/add-log.el 2014-09-24 22:17:34 +0000
@@ -1097,12 +1097,14 @@ (defun change-log-next-buffer (&optional
(ignore-errors
(version< (substring b (length name))
(substring a (length name))))))))
- (files (if isearch-forward files (reverse files))))
- (find-file-noselect
- (if wrap
- (car files)
- (cadr (member (file-name-nondirectory (buffer-file-name buffer))
- files))))))
+ (files (if isearch-forward files (reverse files)))
+ (file (if wrap
+ (car files)
+ (cadr (member (file-name-nondirectory (buffer-file-name buffer))
+ files)))))
+ (if (file-exists-p file)
+ (find-file-noselect file)
+ (current-buffer))))
(defun change-log-fill-forward-paragraph (n)
"Cut paragraphs so filling preserves open parentheses at beginning of lines."
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#18547: repeated C-s doesn't wrap back to the top if file is .gz
2014-09-24 22:20 ` Juri Linkov
@ 2014-09-25 1:10 ` Stefan Monnier
2014-09-25 20:57 ` Juri Linkov
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2014-09-25 1:10 UTC (permalink / raw)
To: Juri Linkov; +Cc: 18547, 積丹尼 Dan Jacobson
> Then if there are no files that fit the default naming scheme ChangeLog[.NN],
> this patch will wrap around in the current buffer.
Thanks Juri.
> (I'm not sure whether it should go into emacs-24 or trunk):
I don't think it's urgent, so: trunk.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#18547: repeated C-s doesn't wrap back to the top if file is .gz
2014-09-25 1:10 ` Stefan Monnier
@ 2014-09-25 20:57 ` Juri Linkov
0 siblings, 0 replies; 7+ messages in thread
From: Juri Linkov @ 2014-09-25 20:57 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 18547-done, 積丹尼 Dan Jacobson
>> (I'm not sure whether it should go into emacs-24 or trunk):
>
> I don't think it's urgent, so: trunk.
Actually there were two cases: when `wrap' is non-nil then a new buffer
"ChangeLog" should not be created (fixes the reported problem).
When `wrap' is nil, then `file-exists-p' will raise a signal
(as `find-file-noselect' did before this patch) that is handled
by `multi-isearch-search-fun' to display the "end of multi" message.
The same patch installed to trunk will handle both cases.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#18547: repeated C-s doesn't wrap back to the top if file is .gz
2014-09-24 17:09 bug#18547: repeated C-s doesn't wrap back to the top if file is .gz 積丹尼 Dan Jacobson
2014-09-24 19:28 ` Juri Linkov
@ 2014-09-24 19:42 ` 積丹尼 Dan Jacobson
1 sibling, 0 replies; 7+ messages in thread
From: 積丹尼 Dan Jacobson @ 2014-09-24 19:42 UTC (permalink / raw)
To: Juri Linkov; +Cc: 18547
On my system
# dlocate changelog|wc -l
2233
# dlocate ChangeLog|wc -l
44
that's all I know.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-09-25 20:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24 17:09 bug#18547: repeated C-s doesn't wrap back to the top if file is .gz 積丹尼 Dan Jacobson
2014-09-24 19:28 ` Juri Linkov
2014-09-24 20:25 ` Stefan Monnier
2014-09-24 22:20 ` Juri Linkov
2014-09-25 1:10 ` Stefan Monnier
2014-09-25 20:57 ` Juri Linkov
2014-09-24 19:42 ` 積丹尼 Dan Jacobson
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).