unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* resend: [PATCH] ignoring Info extensions
@ 2004-03-11 19:47 Jan Nieuwenhuizen
  2004-03-14  7:39 ` Eli Zaretskii
  0 siblings, 1 reply; 26+ messages in thread
From: Jan Nieuwenhuizen @ 2004-03-11 19:47 UTC (permalink / raw)
  Cc: emacs-devel


Let's try this one again.

From: Jan Nieuwenhuizen <janneke@gnu.org>
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  <janneke@gnu.org>
+
+	* info.el (Info-hide-cookies-node): New function.
+	(Info-select-node): Use it.
+
 2004-02-24  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
 
 	* 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 <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2004-04-03 23:39 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-11 19:47 resend: [PATCH] ignoring Info extensions Jan Nieuwenhuizen
2004-03-14  7:39 ` Eli Zaretskii
2004-03-14 12:53   ` Jan Nieuwenhuizen
2004-03-29  7:57   ` Jan Nieuwenhuizen
2004-03-31 20:56     ` Juri Linkov
2004-04-01  2:01       ` Karl Berry
2004-04-01  5:53         ` Eli Zaretskii
2004-04-01 16:33         ` Juri Linkov
2004-04-01 19:53           ` Eli Zaretskii
2004-04-02  3:27             ` Juri Linkov
2004-04-02  7:47               ` Eli Zaretskii
2004-04-03  1:30               ` Richard Stallman
2004-04-02  1:50           ` Karl Berry
2004-04-02  3:32             ` Juri Linkov
2004-04-02 14:16               ` Karl Berry
2004-04-02 18:19                 ` Juri Linkov
2004-04-02 19:28                   ` Eli Zaretskii
2004-04-02 21:38                     ` Juri Linkov
2004-04-03  0:19                     ` Karl Berry
2004-04-02 19:29                 ` Eli Zaretskii
2004-04-02  7:43             ` Eli Zaretskii
2004-04-02 21:47         ` Juri Linkov
2004-04-03  1:25           ` Karl Berry
2004-04-03  4:56             ` Juri Linkov
2004-04-03  9:05             ` Eli Zaretskii
2004-04-03 23:39           ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).