[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#8987: 24.0.50; texinfo-insert-menu inserts unnecessary trailing spac
bug#8987: 24.0.50; texinfo-insert-menu inserts unnecessary trailing spaces
Sat, 02 Jul 2011 11:42:23 -0700
texinfo-all-menus-update is a command that updates all menus within a
texinfo buffer. This command calls texinfo-insert-menu in turn to
update each menu. The problem with the latter is that it inserts
unnecessary white spaces at the end of most menu items following
double-colon. For example see bzr version 104838 of emacs trunk checked
in on July 1, 2011 where someone checked in cc-mode.texi with trailing
This problem has existed for many years. I know, because I suffered
through it many times myself. So I looked for a solution and it seems
like making one line change should fix this as shown below.
In emacs-lisp empty string evaluates to boolean true unlike python,
so that one cannot simply test boolean value of a string to detect
empty string verses non-empty string. It looks like testing the
(length) being greater than 0 seems to get the job done.
=== modified file 'lisp/textmodes/texnfo-upd.el'
--- lisp/textmodes/texnfo-upd.el 2011-01-25 04:08:28 +0000
+++ lisp/textmodes/texnfo-upd.el 2011-07-02 18:30:47 +0000
@@ -687,7 +687,7 @@
(insert (format "%s: %s." (car node-part) (cdr node-part)))))
;; Insert the description, if present.
- (when (cdr menu)
+ (when (> (length (cdr menu)) 0)
;; Move to right place.
(indent-to texinfo-column-for-description 2)
;; Insert description.
- bug#8987: 24.0.50; texinfo-insert-menu inserts unnecessary trailing spaces,