bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#12272: 24.1.50; extra newline at end of node (elisp) Standard Regexp


From: Juri Linkov
Subject: bug#12272: 24.1.50; extra newline at end of node (elisp) Standard Regexps
Date: Sat, 25 Aug 2012 22:41:43 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu)

> This Info node has 3 empty lines at the end, not 2 like other nodes.

At the end of most nodes makeinfo adds 1 empty line (2 newline chars),
and at the end of chapters makeinfo adds 2 empty lines (3 newline chars).

There is no need to have empty lines at the end of nodes at all, so they
could be safely removed, exactly like the standalone Info reader already
does:

=== modified file 'lisp/info.el'
--- lisp/info.el        2012-08-25 18:49:47 +0000
+++ lisp/info.el        2012-08-25 19:40:45 +0000
@@ -4844,6 +4844,12 @@ (defun Info-fontify-node ()
                                  mouse-face highlight
                                  help-echo "mouse-2: go to this URL"))))
 
+      ;; Hide empty lines at the end of the node.
+      (goto-char (point-max))
+      (skip-chars-backward "\n")
+      (when (< (1+ (point)) (point-max))
+       (put-text-property (1+ (point)) (point-max) 'invisible t))
+
       (set-buffer-modified-p nil))))
 
 ;;; Speedbar support:






reply via email to

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