GNU bug report logs - #18547
repeated C-s doesn't wrap back to the top if file is .gz

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Wed, 24 Sep 2014 17:46:02 UTC

Severity: wishlist

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 18547 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 18547 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#18547: repeated C-s doesn't wrap back to the top if file is
 .gz
Date: Thu, 25 Sep 2014 01:20:31 +0300
>>> 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."




This bug report was last modified 10 years and 237 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.