aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2003-06-03 20:28:21 +0000
committerStefan Monnier2003-06-03 20:28:21 +0000
commit0c3aa29ef824c7ffabc7e3e1cbd04e29644753f2 (patch)
treee115e2148e1e4468cbfc401f20b49b303c2c493f
parentdde7f979b8cf83596c151c1394fe6bb07dcf1563 (diff)
downloademacs-0c3aa29ef824c7ffabc7e3e1cbd04e29644753f2.tar.gz
emacs-0c3aa29ef824c7ffabc7e3e1cbd04e29644753f2.zip
(Info-fontify-node): Use :align-to display prop.
Use `invisible' rather than `display' prop to hide text.
-rw-r--r--lisp/info.el61
1 files changed, 34 insertions, 27 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 5cf90a08b67..6deb7ca70c0 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2903,33 +2903,40 @@ the variable `Info-file-list-for-emacs'."
2903 (set-marker m nil)))) 2903 (set-marker m nil))))
2904 2904
2905 (goto-char (point-min)) 2905 (goto-char (point-min))
2906 (if (and (search-forward "\n* Menu:" nil t) 2906 (when (and (search-forward "\n* Menu:" nil t)
2907 (not (string-match "\\<Index\\>" Info-current-node)) 2907 (not (string-match "\\<Index\\>" Info-current-node))
2908 ;; Don't take time to annotate huge menus 2908 ;; Don't take time to annotate huge menus
2909 (< (- (point-max) (point)) Info-fontify-maximum-menu-size)) 2909 (< (- (point-max) (point)) Info-fontify-maximum-menu-size))
2910 (let ((n 0) 2910 (let ((n 0)
2911 cont) 2911 cont)
2912 (while (re-search-forward "^\\* +\\([^:\t\n]*\\)\\(:[^.,:(]*\\(([^)]*)[^.,:]*\\)?[,:.][ \t]*\\)" nil t) 2912 (while (re-search-forward "^\\* +\\([^:\t\n]*\\)\\(:[^.,:(]*\\(([^)]*)[^.,:]*\\)?[,:.]\\([ \t]*\\)\\)" nil t)
2913 (setq n (1+ n)) 2913 (setq n (1+ n))
2914 (if (zerop (% n 3)) ; visual aids to help with 1-9 keys 2914 (if (zerop (% n 3)) ; visual aids to help with 1-9 keys
2915 (put-text-property (match-beginning 0) 2915 (put-text-property (match-beginning 0)
2916 (1+ (match-beginning 0)) 2916 (1+ (match-beginning 0))
2917 'font-lock-face 'info-menu-5)) 2917 'font-lock-face 'info-menu-5))
2918 (add-text-properties (match-beginning 1) (match-end 1) 2918 (add-text-properties (match-beginning 1) (match-end 1)
2919 '(font-lock-face info-xref 2919 '(font-lock-face info-xref
2920 mouse-face highlight 2920 mouse-face highlight
2921 help-echo "mouse-2: go to this node")) 2921 help-echo "mouse-2: go to this node"))
2922 (when (eq Info-hide-note-references t) 2922 (when (eq Info-hide-note-references t)
2923 (add-text-properties (match-beginning 2) (match-end 2) 2923 (put-text-property (match-beginning 2) (match-beginning 4)
2924 (list 'display 2924 'invisible t)
2925 (make-string (max 2 (- 22 (- (match-end 1) (match-beginning 1)))) ? ))) 2925 ;; We need a stretchable space like :align-to but with
2926 (setq cont (looking-at "[ \t]*[^\n]"))) 2926 ;; a minimum value.
2927 (if (eq Info-hide-note-references t) 2927 (put-text-property (match-beginning 4) (match-end 4) 'display
2928 (while (and (= (forward-line 1) 0) 2928 (if (>= 22 (- (match-end 1)
2929 (looking-at "\\([ \t]+\\)[^*\n]")) 2929 (match-beginning 0)))
2930 (add-text-properties (match-beginning 1) (match-end 1) 2930 '(space :align-to 24)
2931 (list 'display (make-string (+ 22 (if cont 4 2)) ? ))) 2931 '(space :width 2)))
2932 (setq cont t)))))) 2932 (setq cont (looking-at "."))
2933 (while (and (= (forward-line 1) 0)
2934 (looking-at "\\([ \t]+\\)[^*\n]"))
2935 (put-text-property (match-beginning 1) (match-end 1) 'display
2936 (if cont
2937 '(space :align-to 26)
2938 '(space :align-to 24)))
2939 (setq cont t))))))
2933 2940
2934 (Info-fontify-menu-headers) 2941 (Info-fontify-menu-headers)
2935 (set-buffer-modified-p nil))))) 2942 (set-buffer-modified-p nil)))))