From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: emacs18@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#8987: 24.0.50; texinfo-insert-menu inserts unnecessary trailing spaces Date: Sat, 02 Jul 2011 11:42:23 -0700 Message-ID: Reply-To: emacs18@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1309632203 23399 80.91.229.12 (2 Jul 2011 18:43:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 2 Jul 2011 18:43:23 +0000 (UTC) To: 8987@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 02 20:43:18 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qd59y-0008R0-0f for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jul 2011 20:43:18 +0200 Original-Received: from localhost ([::1]:37872 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qd59x-0008Ee-9C for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jul 2011 14:43:17 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qd59j-0008EY-NB for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2011 14:43:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qd59i-0002ke-OW for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2011 14:43:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qd59i-0002ka-JH for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2011 14:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Qd59i-0006dY-Cz; Sat, 02 Jul 2011 14:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Kim Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Jul 2011 18:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8987 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.130963215825478 (code B ref -1); Sat, 02 Jul 2011 18:43:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Jul 2011 18:42:38 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qd59K-0006ct-EM for submit@debbugs.gnu.org; Sat, 02 Jul 2011 14:42:38 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qd59H-0006cg-UP for submit@debbugs.gnu.org; Sat, 02 Jul 2011 14:42:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qd59B-0002ji-VZ for submit@debbugs.gnu.org; Sat, 02 Jul 2011 14:42:30 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:34970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qd59B-0002je-U9 for submit@debbugs.gnu.org; Sat, 02 Jul 2011 14:42:29 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qd59A-0008ER-PC for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2011 14:42:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qd599-0002jS-Tz for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2011 14:42:28 -0400 Original-Received: from mail-pz0-f41.google.com ([209.85.210.41]:49931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qd599-0002jM-PM for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2011 14:42:27 -0400 Original-Received: by pzk4 with SMTP id 4so351665pzk.0 for ; Sat, 02 Jul 2011 11:42:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:from:to:subject:reply-to:date:message-id:mime-version :content-type; bh=HG6DNrauTFwYxS4+gl6MZwB2Qvz28F4SmyX+N64Dwz8=; b=VwLzZ+QGR0gMi7dcBsx79oOd3EeRW8HK4oqTATXdcPiNuH12gs1i/pD/NTYazhCVve eqwUhoihh0Vg03ZJhjlDr3zYwQEFaCUTB09vZtwHVCqtdwmBnd6/HaSc9kbJppHMnhBO IvgygG3VWPqjkCoLe3xzM/ilp68ftkMT4b/R0= Original-Received: by 10.68.41.168 with SMTP id g8mr5601263pbl.512.1309632146182; Sat, 02 Jul 2011 11:42:26 -0700 (PDT) Original-Received: from kimr-laptop (static-50-53-5-59.bvtn.or.frontiernet.net [50.53.5.59]) by mx.google.com with ESMTPS id k4sm2768065pbl.59.2011.07.02.11.42.24 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 02 Jul 2011 11:42:25 -0700 (PDT) Original-From: Richard Kim X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 02 Jul 2011 14:43:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:47776 Archived-At: 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 white spaces. 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.