emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ignoring Info extensions


From: Jan Nieuwenhuizen
Subject: Re: [PATCH] ignoring Info extensions
Date: Mon, 29 Mar 2004 09:57:24 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

>> +;; Texinfo 4.7 will add cookies of the form address@hidden CONTENTS 
>> address@hidden
>
> Please use present or past tense here.

Done.  I haven't seen this in CVS yet, so I'm sending a new version.

The new patch below also removes the debugging message with the image
file name, which is quite annoying when reading the new (LilyPond)
info pages with images.

Greetings,
Jan.



Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.5823
diff -p -u -r1.5823 ChangeLog
--- lisp/ChangeLog      29 Mar 2004 03:51:41 -0000      1.5823
+++ lisp/ChangeLog      29 Mar 2004 07:50:52 -0000
@@ -1,3 +1,13 @@
+2004-03-29  Jan Nieuwenhuizen  <address@hidden>
+
+       * info.el (Info-display-images-node): Remove message with image
+       file name.
+
+2004-02-25  Jan Nieuwenhuizen  <address@hidden>
+
+       * info.el (Info-hide-cookies-node): New function.
+       (Info-select-node): Use it.
+
 2004-03-29  Kenichi Handa  <address@hidden>
 
        * international/mule-util.el (char-displayable-p): Fix generation
Index: lisp/info.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/info.el,v
retrieving revision 1.378
diff -p -u -r1.378 info.el
--- lisp/info.el        22 Mar 2004 17:12:16 -0000      1.378
+++ lisp/info.el        29 Mar 2004 07:50:53 -0000
@@ -1134,12 +1134,28 @@ any double quotes or backslashes must be
               (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 address@hidden CONTENTS address@hidden
+;; Hide any construct of the general form address@hidden@-^_][ ...  
address@hidden@-^_]],
+;; 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.
@@ -1176,6 +1192,7 @@ any double quotes or backslashes must be
        (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 ()

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]