From 0c1b7af5c5a4b0b2e7f3fd8a52dcc39b27d41a58 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 8 Apr 2004 03:12:16 +0000 Subject: [PATCH] (Info-hide-cookies-node): New function. (Info-select-node): Use it. (Info-display-images-node): Remove message with image file name. --- lisp/ChangeLog | 8 +++++++- lisp/info.el | 19 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 18256b09a78..f422415461b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-04-07 Jan Nieuwenhuizen + + * info.el (Info-hide-cookies-node): New function. + (Info-select-node): Use it. + (Info-display-images-node): Remove message with image file name. + 2004-04-07 Daniel Pfeiffer * progmodes/compile.el (compilation-warning-face) @@ -186,7 +192,7 @@ 2004-03-31 H,Ae(Bkan Granath (tiny change) - * dired.el (dired-move-to-filename-regexp): Add . to HH:MM. + * dired.el (dired-move-to-filename-regexp): Add `.' to HH:MM. 2004-03-30 Vinicius Jose Latorre diff --git a/lisp/info.el b/lisp/info.el index b42e61003f8..a72ded5bc3d 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1146,12 +1146,28 @@ any double quotes or backslashes must be escaped (\\\",\\\\)." (image (if (file-exists-p image-file) (create-image image-file) "[broken image]"))) - (message "Found image: %S" image-file) (if (not (get-text-property start 'display)) (add-text-properties start (point) `(display ,image rear-nonsticky (display))))))) (set-buffer-modified-p nil))) +;; Texinfo 4.7 adds cookies of the form ^@^H[NAME CONTENTS ^@^H]. +;; Hide any construct of the general form ^@[^@-^_][ ... ^@[^@-^_]], +;; including one optional trailing newline. +(defun Info-hide-cookies-node () + "Hide unrecognised cookies in current node." + (save-excursion + (let ((inhibit-read-only t) + (case-fold-search t)) + (goto-char (point-min)) + (while (re-search-forward + "\\(\0[\0-\37][[][^\0]*\0[\0-\37][]]\n?\\)" + nil t) + (let* ((start (match-beginning 1))) + (if (not (get-text-property start 'invisible)) + (put-text-property start (point) 'invisible t))))) + (set-buffer-modified-p nil))) + (defun Info-select-node () "Select the info node that point is in." ;; Bind this in case the user sets it to nil. @@ -1188,6 +1204,7 @@ any double quotes or backslashes must be escaped (\\\",\\\\)." (if Info-enable-active-nodes (eval active-expression)) (Info-fontify-node) (Info-display-images-node) + (Info-hide-cookies-node) (run-hooks 'Info-selection-hook))))) (defun Info-set-mode-line () -- 2.39.5