# HG changeset patch # User Juri Linkov # Date 1081393851 0 # Node ID 4aa6485ff6e3bec396e2df840f502f1e2a2b8ebf # Parent 6d670cd121197c8e22d7342d3b75567a4ff79245 (Info-hide-cookies-node): New function. (Info-select-node): Use it. (Info-display-images-node): Remove message with image file name. diff -r 6d670cd12119 -r 4aa6485ff6e3 lisp/info.el --- a/lisp/info.el Thu Apr 08 02:41:08 2004 +0000 +++ b/lisp/info.el Thu Apr 08 03:10:51 2004 +0000 @@ -1146,12 +1146,28 @@ (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 @@ (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 ()