]> code.delx.au - gnu-emacs/blobdiff - lisp/info.el
(vc-cvs-repository-hostname): New operation.
[gnu-emacs] / lisp / info.el
index 54e6f6d1f02de615f1ae226c7b1898205c7da9b0..424de35b5851d111960817dc0f1577c0d19da608 100644 (file)
@@ -139,7 +139,7 @@ These directories are searched after those in `Info-directory-list'."
   :type '(repeat directory)
   :group 'info)
 
-(defcustom Info-scroll-prefer-subnodes t
+(defcustom Info-scroll-prefer-subnodes nil
   "*If non-nil, \\<Info-mode-map>\\[Info-scroll-up] in a menu visits subnodes.
 If this is non-nil, and you scroll far enough in a node that its menu
 appears on the screen, the next \\<Info-mode-map>\\[Info-scroll-up]
@@ -162,6 +162,14 @@ If value is non-nil but not t, the reference section is still shown."
                 (other :tag "Replace only tag" tag))
   :group 'info)
 
+(defcustom Info-refill-paragraphs nil
+  "*If non-nil, attempt to refill paragraphs with hidden references.
+This refilling may accidentally remove explicit line breaks in the info
+file, so be prepared for a few surprises if you enable this feature."
+  :version "21.4"
+  :type 'boolean
+  :group 'info)
+
 (defcustom Info-mode-hook
   ;; Try to obey obsolete Info-fontify settings.
   (unless (and (boundp 'Info-fontify) (null Info-fontify))
@@ -1547,9 +1555,10 @@ FOOTNOTENAME may be an abbreviation of the reference name."
   (skip-chars-forward " \t\n")
   (let ((beg (point))
        str)
-    (while (not (looking-at ":*[,.;() \t\n]"))
-      (skip-chars-forward "^:")
-      (forward-char 1))
+    (while (progn
+            (skip-chars-forward "^:")
+            (forward-char 1)
+            (not (looking-at ":*[,.;() \t\n]"))))
     (setq str
          (if (looking-at ":")
              (buffer-substring-no-properties beg (1- (point)))
@@ -2747,7 +2756,7 @@ the variable `Info-file-list-for-emacs'."
   "Add the face `info-menu-header' to any header before a menu entry."
   (save-excursion
     (goto-char (point-min))
-    (when (re-search-forward "\\* Menu:" nil t)
+    (when (re-search-forward "^\\* Menu:" nil t)
       (put-text-property (match-beginning 0) (match-end 0)
                         'font-lock-face 'info-menu-header)
       (while (re-search-forward "\n\n\\([^*\n ].*\\)\n\n?[*]" nil t)
@@ -2872,13 +2881,19 @@ the variable `Info-file-list-for-emacs'."
                (goto-char start)
                (skip-syntax-backward " ")
                (setq other-tag
-                     (cond
-                      ((<= (point) (point-min))
-                       "See ")
-                      ((memq (char-before) '(nil ?\. ?! ))
-                       "See ")
-                      ((memq (char-before) '( ?\( ?\[ ?\{ ?\, ?\; ?\: ))
-                       "see ")))
+                     (cond ((memq (char-before) '(nil ?\. ?! ??))
+                            "See ")
+                           ((memq (char-before) '(?\, ?\; ?\: ?-))
+                            "see ")
+                           ((memq (char-before) '(?\( ?\[ ?\{))
+                            ;; Check whether the paren is preceded by
+                            ;; an end of sentence
+                            (skip-syntax-backward " (")
+                            (if (memq (char-before) '(nil ?\. ?! ??))
+                                "See "
+                              "see "))
+                           ((save-match-data (looking-at "\n\n"))
+                            "See ")))
                (goto-char next))
              (if hide-tag
                  (add-text-properties (match-beginning 1) (match-end 1)
@@ -2898,27 +2913,30 @@ the variable `Info-file-list-for-emacs'."
                (save-excursion
                  (goto-char (match-beginning 1))
                  (insert other-tag)))
-             (when (or hide-tag (eq Info-hide-note-references t))
+             (when (and Info-refill-paragraphs
+                        (or hide-tag (eq Info-hide-note-references t)))
                (push (set-marker (make-marker) start)
                      paragraph-markers)))))
 
-       (let ((fill-nobreak-invisible t)
-             (fill-individual-varying-indent nil)
-             (paragraph-start "\f\\|[ \t]*[-*]\\|[ \t]*$")
-             (paragraph-separate ".*\\.[ \t]*\n[ \t]\\|[ \t]*[-*]\\|[ \t\f]*$")
-             (adaptive-fill-mode nil))
-         (goto-char (point-max))
-         (while paragraph-markers
-           (let ((m (car paragraph-markers)))
-             (setq paragraph-markers (cdr paragraph-markers))
-             (when (< m (point))
-               (goto-char m)
-               (beginning-of-line)
-               (let ((beg (point)))
-                 (when (zerop (forward-paragraph))
-                   (fill-individual-paragraphs beg (point) nil nil)
-                   (goto-char beg))))
-             (set-marker m nil))))
+       (when (and Info-refill-paragraphs
+                  paragraph-markers)
+         (let ((fill-nobreak-invisible t)
+               (fill-individual-varying-indent nil)
+               (paragraph-start "\f\\|[ \t]*[-*]\\|[ \t]*$")
+               (paragraph-separate ".*\\.[ \t]*\n[ \t]\\|[ \t]*[-*]\\|[ \t\f]*$")
+               (adaptive-fill-mode nil))
+           (goto-char (point-max))
+           (while paragraph-markers
+             (let ((m (car paragraph-markers)))
+               (setq paragraph-markers (cdr paragraph-markers))
+               (when (< m (point))
+                 (goto-char m)
+                 (beginning-of-line)
+                 (let ((beg (point)))
+                   (when (zerop (forward-paragraph))
+                     (fill-individual-paragraphs beg (point) nil nil)
+                     (goto-char beg))))
+               (set-marker m nil)))))
 
        (goto-char (point-min))
        (when (and (search-forward "\n* Menu:" nil t)