From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jan Nieuwenhuizen Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] ignoring Info extensions Date: Mon, 29 Mar 2004 09:57:24 +0200 Organization: Jan at Appel Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87wu54dr17.fsf_-_@peder.flower> References: <878yi7f9n6.fsf@peder.flower> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1080547460 19314 80.91.224.253 (29 Mar 2004 08:04:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 29 Mar 2004 08:04:20 +0000 (UTC) Cc: karl@freefriends.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Mar 29 10:04:11 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B7rkg-0003Xz-00 for ; Mon, 29 Mar 2004 10:04:10 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B7rkg-0005WT-00 for ; Mon, 29 Mar 2004 10:04:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B7rh8-0007XS-G9 for emacs-devel@quimby.gnus.org; Mon, 29 Mar 2004 03:00:30 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B7ren-0007Fn-83 for emacs-devel@gnu.org; Mon, 29 Mar 2004 02:58:05 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B7reE-000758-Qc for emacs-devel@gnu.org; Mon, 29 Mar 2004 02:58:01 -0500 Original-Received: from [80.126.34.178] (helo=peder.flower) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B7reE-000753-9H for emacs-devel@gnu.org; Mon, 29 Mar 2004 02:57:30 -0500 Original-Received: from localhost.localdomain ([127.0.0.1] helo=peder.flower ident=janneke) by peder.flower with esmtp (Exim 3.36 #1 (Debian)) id 1B7re9-0005nb-00; Mon, 29 Mar 2004 09:57:25 +0200 Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "14 Mar 2004 09:39:13 +0200") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21047 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21047 >> +;; Texinfo 4.7 will add cookies of the form ^@^H[NAME CONTENTS ^@^H]. > > 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 + + * info.el (Info-display-images-node): Remove message with image + file name. + +2004-02-25 Jan Nieuwenhuizen + + * info.el (Info-hide-cookies-node): New function. + (Info-select-node): Use it. + 2004-03-29 Kenichi Handa * 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 ^@^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. @@ -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 | GNU LilyPond - The music typesetter http://www.xs4all.nl/~jantien | http://www.lilypond.org