aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2008-09-04 08:17:57 +0000
committerMartin Rudalics2008-09-04 08:17:57 +0000
commit3bfd723a3858a4cddf29e0e6c5da7cb60f590106 (patch)
tree6cea2838c3f062b3addd6e2d3bf9a8b24ed02c37
parentc7dfa6a3f1330f260e9bda005ead44667cb6a537 (diff)
downloademacs-3bfd723a3858a4cddf29e0e6c5da7cb60f590106.tar.gz
emacs-3bfd723a3858a4cddf29e0e6c5da7cb60f590106.zip
(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)
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/info.el31
2 files changed, 22 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 190dbf9f511..e6e570082ca 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12008-09-04 Martin Rudalics <rudalics@gmx.at>
2
3 * info.el (Info-dir-remove-duplicates): Narrow buffer when
4 removing duplicate entries under same heading. Don't skip char
5 matching anything but a space or tab at bol. (Bug#864)
6
12008-09-03 Alan Mackenzie <acm@muc.de> 72008-09-03 Alan Mackenzie <acm@muc.de>
2 8
3 * progmodes/cc-defs.el (c-version): Increment to 5.31.6 9 * 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."
1213 (delete-region (1- (point)) (point)))) 1213 (delete-region (1- (point)) (point))))
1214 1214
1215 ;; Now remove duplicate entries under the same heading. 1215 ;; Now remove duplicate entries under the same heading.
1216 (let ((seen nil) 1216 (let (seen)
1217 (limit (point-marker))) 1217 (save-restriction
1218 (goto-char start) 1218 (narrow-to-region start (point))
1219 (while (and (> limit (point)) 1219 (goto-char (point-min))
1220 (re-search-forward "^* \\([^:\n]+:\\(:\\|[^.\n]+\\).\\)" 1220 (while (re-search-forward "^* \\([^:\n]+:\\(:\\|[^.\n]+\\).\\)" nil 'move)
1221 limit 'move)) 1221 ;; Fold case straight away; `member-ignore-case' here wasteful.
1222 ;; Fold case straight away; `member-ignore-case' here wasteful. 1222 (let ((x (downcase (match-string 1))))
1223 (let ((x (downcase (match-string 1)))) 1223 (if (member x seen)
1224 (if (member x seen) 1224 (delete-region
1225 (delete-region (match-beginning 0) 1225 (match-beginning 0)
1226 (progn (re-search-forward "^[^ \t]" nil t) 1226 (if (re-search-forward "^[^ \t]" nil 'move)
1227 (match-beginning 0))) 1227 (goto-char (match-beginning 0))
1228 (push x seen)))))))))) 1228 (point-max)))
1229 (push x seen)))))))))))
1229 1230
1230;; Note that on entry to this function the current-buffer must be the 1231;; Note that on entry to this function the current-buffer must be the
1231;; *info* buffer; not the info tags buffer. 1232;; *info* buffer; not the info tags buffer.
@@ -3836,10 +3837,10 @@ the variable `Info-file-list-for-emacs'."
3836 ((string-equal (downcase tag) "prev") Info-prev-link-keymap) 3837 ((string-equal (downcase tag) "prev") Info-prev-link-keymap)
3837 ((string-equal (downcase tag) "next") Info-next-link-keymap) 3838 ((string-equal (downcase tag) "next") Info-next-link-keymap)
3838 ((string-equal (downcase tag) "up" ) Info-up-link-keymap)))))) 3839 ((string-equal (downcase tag) "up" ) Info-up-link-keymap))))))
3839 3840
3840 (when (> Info-breadcrumbs-depth 0) 3841 (when (> Info-breadcrumbs-depth 0)
3841 (Info-insert-breadcrumbs)) 3842 (Info-insert-breadcrumbs))
3842 3843
3843 ;; Treat header line. 3844 ;; Treat header line.
3844 (when Info-use-header-line 3845 (when Info-use-header-line
3845 (goto-char (point-min)) 3846 (goto-char (point-min))