From: Martin Rudalics Date: Thu, 4 Sep 2008 08:17:57 +0000 (+0000) Subject: (Info-dir-remove-duplicates): Narrow buffer when X-Git-Tag: emacs-pretest-23.0.90~3050 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3bfd723a3858a4cddf29e0e6c5da7cb60f590106;p=emacs.git (Info-dir-remove-duplicates): Narrow buffer when removing duplicate entries under same heading. Don't skip char matching anything but a space or tab at bol. (Bug#864) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 190dbf9f511..e6e570082ca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2008-09-04 Martin Rudalics + + * info.el (Info-dir-remove-duplicates): Narrow buffer when + removing duplicate entries under same heading. Don't skip char + matching anything but a space or tab at bol. (Bug#864) + 2008-09-03 Alan Mackenzie * progmodes/cc-defs.el (c-version): Increment to 5.31.6 diff --git a/lisp/info.el b/lisp/info.el index fada0045782..b9a772af74e 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1213,19 +1213,20 @@ a case-insensitive match is tried." (delete-region (1- (point)) (point)))) ;; Now remove duplicate entries under the same heading. - (let ((seen nil) - (limit (point-marker))) - (goto-char start) - (while (and (> limit (point)) - (re-search-forward "^* \\([^:\n]+:\\(:\\|[^.\n]+\\).\\)" - limit 'move)) - ;; Fold case straight away; `member-ignore-case' here wasteful. - (let ((x (downcase (match-string 1)))) - (if (member x seen) - (delete-region (match-beginning 0) - (progn (re-search-forward "^[^ \t]" nil t) - (match-beginning 0))) - (push x seen)))))))))) + (let (seen) + (save-restriction + (narrow-to-region start (point)) + (goto-char (point-min)) + (while (re-search-forward "^* \\([^:\n]+:\\(:\\|[^.\n]+\\).\\)" nil 'move) + ;; Fold case straight away; `member-ignore-case' here wasteful. + (let ((x (downcase (match-string 1)))) + (if (member x seen) + (delete-region + (match-beginning 0) + (if (re-search-forward "^[^ \t]" nil 'move) + (goto-char (match-beginning 0)) + (point-max))) + (push x seen))))))))))) ;; Note that on entry to this function the current-buffer must be the ;; *info* buffer; not the info tags buffer. @@ -3836,10 +3837,10 @@ the variable `Info-file-list-for-emacs'." ((string-equal (downcase tag) "prev") Info-prev-link-keymap) ((string-equal (downcase tag) "next") Info-next-link-keymap) ((string-equal (downcase tag) "up" ) Info-up-link-keymap)))))) - + (when (> Info-breadcrumbs-depth 0) (Info-insert-breadcrumbs)) - + ;; Treat header line. (when Info-use-header-line (goto-char (point-min))