unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
Cc: emacs-devel@gnu.org
Subject: resend: [PATCH] ignoring Info extensions
Date: Thu, 11 Mar 2004 20:47:57 +0100	[thread overview]
Message-ID: <878yi7f9n6.fsf@peder.flower> (raw)


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

             reply	other threads:[~2004-03-11 19:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-11 19:47 Jan Nieuwenhuizen [this message]
2004-03-14  7:39 ` resend: [PATCH] ignoring Info extensions 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878yi7f9n6.fsf@peder.flower \
    --to=janneke@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).