Mercurial > emacs
comparison lisp/info.el @ 54752:4aa6485ff6e3
(Info-hide-cookies-node): New function.
(Info-select-node): Use it.
(Info-display-images-node): Remove message with image file name.
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Thu, 08 Apr 2004 03:10:51 +0000 |
parents | fd0577e11e88 |
children | fe0b01c2265f |
comparison
equal
deleted
inserted
replaced
54751:6d670cd12119 | 54752:4aa6485ff6e3 |
---|---|
1144 (concat default-directory src)) | 1144 (concat default-directory src)) |
1145 "")) | 1145 "")) |
1146 (image (if (file-exists-p image-file) | 1146 (image (if (file-exists-p image-file) |
1147 (create-image image-file) | 1147 (create-image image-file) |
1148 "[broken image]"))) | 1148 "[broken image]"))) |
1149 (message "Found image: %S" image-file) | |
1150 (if (not (get-text-property start 'display)) | 1149 (if (not (get-text-property start 'display)) |
1151 (add-text-properties | 1150 (add-text-properties |
1152 start (point) `(display ,image rear-nonsticky (display))))))) | 1151 start (point) `(display ,image rear-nonsticky (display))))))) |
1152 (set-buffer-modified-p nil))) | |
1153 | |
1154 ;; Texinfo 4.7 adds cookies of the form ^@^H[NAME CONTENTS ^@^H]. | |
1155 ;; Hide any construct of the general form ^@[^@-^_][ ... ^@[^@-^_]], | |
1156 ;; including one optional trailing newline. | |
1157 (defun Info-hide-cookies-node () | |
1158 "Hide unrecognised cookies in current node." | |
1159 (save-excursion | |
1160 (let ((inhibit-read-only t) | |
1161 (case-fold-search t)) | |
1162 (goto-char (point-min)) | |
1163 (while (re-search-forward | |
1164 "\\(\0[\0-\37][[][^\0]*\0[\0-\37][]]\n?\\)" | |
1165 nil t) | |
1166 (let* ((start (match-beginning 1))) | |
1167 (if (not (get-text-property start 'invisible)) | |
1168 (put-text-property start (point) 'invisible t))))) | |
1153 (set-buffer-modified-p nil))) | 1169 (set-buffer-modified-p nil))) |
1154 | 1170 |
1155 (defun Info-select-node () | 1171 (defun Info-select-node () |
1156 "Select the info node that point is in." | 1172 "Select the info node that point is in." |
1157 ;; Bind this in case the user sets it to nil. | 1173 ;; Bind this in case the user sets it to nil. |
1186 (read (current-buffer)))))) | 1202 (read (current-buffer)))))) |
1187 (point-max))) | 1203 (point-max))) |
1188 (if Info-enable-active-nodes (eval active-expression)) | 1204 (if Info-enable-active-nodes (eval active-expression)) |
1189 (Info-fontify-node) | 1205 (Info-fontify-node) |
1190 (Info-display-images-node) | 1206 (Info-display-images-node) |
1207 (Info-hide-cookies-node) | |
1191 (run-hooks 'Info-selection-hook))))) | 1208 (run-hooks 'Info-selection-hook))))) |
1192 | 1209 |
1193 (defun Info-set-mode-line () | 1210 (defun Info-set-mode-line () |
1194 (setq mode-line-buffer-identification | 1211 (setq mode-line-buffer-identification |
1195 (nconc (propertized-buffer-identification "%b") | 1212 (nconc (propertized-buffer-identification "%b") |