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: resend: [PATCH] ignoring Info extensions Date: Thu, 11 Mar 2004 20:47:57 +0100 Organization: Jan at Appel Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <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 1079241709 15666 80.91.224.253 (14 Mar 2004 05:21:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 14 Mar 2004 05:21:49 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Mar 14 06:21:37 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 1B2O49-0003wX-00 for ; Sun, 14 Mar 2004 06:21:37 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B2O49-0004sF-00 for ; Sun, 14 Mar 2004 06:21:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B2NpU-00026c-BA for emacs-devel@quimby.gnus.org; Sun, 14 Mar 2004 00:06:28 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B2Mhx-0002TH-Nh for emacs-devel@gnu.org; Sat, 13 Mar 2004 22:54:37 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B2MRU-00053k-Rg for emacs-devel@gnu.org; Sat, 13 Mar 2004 22:38:08 -0500 Original-Received: from [80.126.34.178] (helo=peder.flower) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B1WA5-0004aG-UE for emacs-devel@gnu.org; Thu, 11 Mar 2004 14:48:11 -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 1B1W9u-0007t2-00; Thu, 11 Mar 2004 20:47:58 +0100 Original-To: karl@freefriends.org (Karl Berry) 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:20436 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20436 Let's try this one again. From: Jan Nieuwenhuizen Subject: [PATCH] ignoring Info extensions To: karl@freefriends.org (Karl Berry) cc: emacs-devel@gnu.org Date: Thu, 26 Feb 2004 12:12:36 +0100 Message-ID: <87ptc2rt5n.fsf@peder.flower> Karl Berry writes: > We may want to skip some whitespace around the > cookie... > > I think [..] we do want to skip a newline after a cookie. > I think it would be good to post the code to the list and ask "someone" > to make sure it gets into the RC branch (somehow). Done, patch below. Greetings, Jan. Index: lisp/ChangeLog =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v retrieving revision 1.5713 diff -p -u -r1.5713 ChangeLog --- lisp/ChangeLog 25 Feb 2004 00:07:33 -0000 1.5713 +++ lisp/ChangeLog 26 Feb 2004 01:38:24 -0000 @@ -1,3 +1,8 @@ +2004-02-25 Jan Nieuwenhuizen + + * info.el (Info-hide-cookies-node): New function. + (Info-select-node): Use it. + 2004-02-24 Vinicius Jose Latorre * ebnf-abn.el: New file, implements an ABNF parser. Index: lisp/info.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/info.el,v retrieving revision 1.376 diff -p -u -r1.376 info.el --- lisp/info.el 29 Dec 2003 19:18:53 -0000 1.376 +++ lisp/info.el 26 Feb 2004 01:38:35 -0000 @@ -1139,6 +1139,23 @@ any double quotes or backslashes must be start (point) `(display ,image rear-nonsticky (display))))))) (set-buffer-modified-p nil))) +;; Texinfo 4.7 will add 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. @@ -1175,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