From 192b65f581034c30739c6438a77dbb3346e6ae26 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 4 Jun 2003 23:15:29 +0000 Subject: [PATCH] (Info-fontify-node): Individually refill menus and paragraphs to preserve menu items and varying indentation. Only color first 9 menu items differently. --- lisp/ChangeLog | 1 + lisp/info.el | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 20b4f734b6c..f2866862eb8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,7 @@ * info.el (Info-fontify-node): Individually refill menus and paragraphs to preserve menu items and varying indentation. + Only color first 9 menu items differently. 2003-06-05 Juanma Barranquero diff --git a/lisp/info.el b/lisp/info.el index 7b30cdfca8d..6f311af7810 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2869,6 +2869,8 @@ the variable `Info-file-list-for-emacs'." (skip-syntax-backward " ") (setq other-tag (cond + ((<= (point) (point-min)) + "See ") ((memq (char-before) '(nil ?\. ?! )) "See ") ((memq (char-before) '( ?\( ?\[ ?\{ ?\, ?\; ?\: )) @@ -2896,15 +2898,23 @@ the variable `Info-file-list-for-emacs'." (push (set-marker (make-marker) start) paragraph-markers))))) - (let ((fill-nobreak-invisible t)) + (let ((fill-nobreak-invisible t) + (fill-individual-varying-indent nil) + (paragraph-start "\f\\|[ \t]*[-*]\\|[ \t]*$") + (paragraph-separate "[ \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) - (fill-paragraph nil) - (backward-paragraph 1)) + (move-to-left-margin) + (when (zerop (forward-paragraph)) + (let ((end (point)) + (beg (progn (backward-paragraph) (point)))) + (fill-individual-paragraphs beg end nil nil) + (goto-char beg)))) (set-marker m nil)))) (goto-char (point-min)) @@ -2919,7 +2929,7 @@ the variable `Info-file-list-for-emacs'." "\\([ \t]*\\)\\)") nil t) (setq n (1+ n)) - (if (zerop (% n 3)) ; visual aids to help with 1-9 keys + (if (and (<= n 9) (zerop (% n 3))) ; visual aids to help with 1-9 keys (put-text-property (match-beginning 0) (1+ (match-beginning 0)) 'font-lock-face 'info-menu-5)) -- 2.39.2