3799 |
(let ((n 0) |
(let ((n 0) |
3800 |
cont) |
cont) |
3801 |
(while (re-search-forward |
(while (re-search-forward |
3802 |
(concat "^\\* +\\(" Info-menu-entry-name-re "\\)\\(:" |
(concat "^\\* Menu:\\|\\(?:^\\* +\\(" Info-menu-entry-name-re "\\)\\(:" |
3803 |
Info-node-spec-re "\\([ \t]*\\)\\)") |
Info-node-spec-re "\\([ \t]*\\)\\)\\)") |
3804 |
nil t) |
nil t) |
3805 |
(when not-fontified-p |
(when (match-beginning 1) |
3806 |
(setq n (1+ n)) |
(when not-fontified-p |
3807 |
(if (and (<= n 9) (zerop (% n 3))) ; visual aids to help with 1-9 keys |
(setq n (1+ n)) |
3808 |
(put-text-property (match-beginning 0) |
(if (and (<= n 9) (zerop (% n 3))) ; visual aids to help with 1-9 keys |
3809 |
(1+ (match-beginning 0)) |
(put-text-property (match-beginning 0) |
3810 |
'font-lock-face 'info-menu-5))) |
(1+ (match-beginning 0)) |
3811 |
(when not-fontified-p |
'font-lock-face 'info-menu-5))) |
3812 |
(add-text-properties |
(when not-fontified-p |
3813 |
(match-beginning 1) (match-end 1) |
(add-text-properties |
3814 |
(list |
(match-beginning 1) (match-end 1) |
3815 |
'help-echo (if (and (match-end 3) |
(list |
3816 |
(not (equal (match-string 3) ""))) |
'help-echo (if (and (match-end 3) |
3817 |
(concat "mouse-2: go to " (match-string 3)) |
(not (equal (match-string 3) ""))) |
3818 |
"mouse-2: go to this node") |
(concat "mouse-2: go to " (match-string 3)) |
3819 |
'mouse-face 'highlight))) |
"mouse-2: go to this node") |
3820 |
(when (or not-fontified-p fontify-visited-p) |
'mouse-face 'highlight))) |
3821 |
(add-text-properties |
(when (or not-fontified-p fontify-visited-p) |
3822 |
(match-beginning 1) (match-end 1) |
(add-text-properties |
3823 |
(list |
(match-beginning 1) (match-end 1) |
3824 |
'font-lock-face |
(list |
3825 |
;; Display visited menu items in a different face |
'font-lock-face |
3826 |
(if (and Info-fontify-visited-nodes |
;; Display visited menu items in a different face |
3827 |
(save-match-data |
(if (and Info-fontify-visited-nodes |
3828 |
(let ((node (if (equal (match-string 3) "") |
(save-match-data |
3829 |
(match-string 1) |
(let ((node (if (equal (match-string 3) "") |
3830 |
(match-string 3))) |
(match-string 1) |
3831 |
(file (file-name-nondirectory Info-current-file)) |
(match-string 3))) |
3832 |
(hl Info-history-list) |
(file (file-name-nondirectory Info-current-file)) |
3833 |
res) |
(hl Info-history-list) |
3834 |
(if (string-match "(\\([^)]+\\))\\([^)]*\\)" node) |
res) |
3835 |
(setq file (file-name-nondirectory |
(if (string-match "(\\([^)]+\\))\\([^)]*\\)" node) |
3836 |
(match-string 1 node)) |
(setq file (file-name-nondirectory |
3837 |
node (if (equal (match-string 2 node) "") |
(match-string 1 node)) |
3838 |
"Top" |
node (if (equal (match-string 2 node) "") |
3839 |
(match-string 2 node)))) |
"Top" |
3840 |
(while hl |
(match-string 2 node)))) |
3841 |
(if (and (string-equal node (nth 1 (car hl))) |
(while hl |
3842 |
(string-equal file |
(if (and (string-equal node (nth 1 (car hl))) |
3843 |
(file-name-nondirectory |
(string-equal file |
3844 |
(nth 0 (car hl))))) |
(file-name-nondirectory |
3845 |
(setq res (car hl) hl nil) |
(nth 0 (car hl))))) |
3846 |
(setq hl (cdr hl)))) |
(setq res (car hl) hl nil) |
3847 |
res))) 'info-xref-visited 'info-xref)))) |
(setq hl (cdr hl)))) |
3848 |
(when (and not-fontified-p (memq Info-hide-note-references '(t hide))) |
res))) 'info-xref-visited 'info-xref)))) |
3849 |
(put-text-property (match-beginning 2) (1- (match-end 6)) |
(when (and not-fontified-p (memq Info-hide-note-references '(t hide))) |
3850 |
'invisible t) |
(put-text-property (match-beginning 2) (1- (match-end 6)) |
3851 |
;; Unhide the file name in parens |
'invisible t) |
3852 |
(if (and (match-end 4) (not (eq (char-after (match-end 4)) ?.))) |
;; Unhide the file name in parens |
3853 |
(remove-text-properties (match-beginning 4) (match-end 4) |
(if (and (match-end 4) (not (eq (char-after (match-end 4)) ?.))) |
3854 |
'(invisible t))) |
(remove-text-properties (match-beginning 4) (match-end 4) |
3855 |
;; We need a stretchable space like :align-to but with |
'(invisible t))) |
3856 |
;; a minimum value. |
;; We need a stretchable space like :align-to but with |
3857 |
(put-text-property (1- (match-end 6)) (match-end 6) 'display |
;; a minimum value. |
3858 |
(if (>= 22 (- (match-end 1) |
(put-text-property (1- (match-end 6)) (match-end 6) 'display |
3859 |
(match-beginning 0))) |
(if (>= 22 (- (match-end 1) |
3860 |
'(space :align-to 24) |
(match-beginning 0))) |
3861 |
'(space :width 2))) |
'(space :align-to 24) |
3862 |
(setq cont (looking-at ".")) |
'(space :width 2))) |
3863 |
(while (and (= (forward-line 1) 0) |
(setq cont (looking-at ".")) |
3864 |
(looking-at "\\([ \t]+\\)[^*\n]")) |
(while (and (= (forward-line 1) 0) |
3865 |
(put-text-property (match-beginning 1) (1- (match-end 1)) |
(looking-at "\\([ \t]+\\)[^*\n]")) |
3866 |
'invisible t) |
(put-text-property (match-beginning 1) (1- (match-end 1)) |
3867 |
(put-text-property (1- (match-end 1)) (match-end 1) |
'invisible t) |
3868 |
'display |
(put-text-property (1- (match-end 1)) (match-end 1) |
3869 |
(if cont |
'display |
3870 |
'(space :align-to 26) |
(if cont |
3871 |
'(space :align-to 24))) |
'(space :align-to 26) |
3872 |
(setq cont t)))))) |
'(space :align-to 24))) |
3873 |
|
(setq cont t))))))) |
3874 |
|
|
3875 |
;; Fontify menu headers |
;; Fontify menu headers |
3876 |
;; Add the face `info-menu-header' to any header before a menu entry |
;; Add the face `info-menu-header' to any header before a menu entry |