# HG changeset patch # User Martin Rudalics # Date 1220516245 0 # Node ID 69fc13b4259fd630b699d52a619075c14dcf1d54 # Parent 1a78b3eae932710fada8b1a6479f050aa5d54eff (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 -r 1a78b3eae932 -r 69fc13b4259f lisp/info.el --- a/lisp/info.el Thu Sep 04 06:11:18 2008 +0000 +++ b/lisp/info.el Thu Sep 04 08:17:25 2008 +0000 @@ -1213,19 +1213,20 @@ (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 @@ ((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))