Subject: Re: bug#1169: 23.0.60; (substitute-command-keys "\\{...}") adds extra newline

From: Johan Bockgård <[email-masked]>
Date: Tue, 29 May 2012 19:44:58 +0200

Lars Magne Ingebrigtsen <[email-masked]> writes:

> "Drew Adams" <[email-masked]> writes:
>
>> (substitute-command-keys "\\{minibuffer-local-map}") ; or another map
>>
>> The returned string ends in \n\n. It should end in just \n.
[...]

> I've now made the change,

This change breaks the highlighting code in `help-make-xrefs' which
assumes that a list of key bindings produced by substitute-command-keys
(in `documentation') ends with an extra blank line:

    (while (re-search-forward "^key +binding\n\\(-+ +\\)-+\n\n"
                              nil t)
      (let ((col (- (match-end 1) (match-beginning 1))))
        (while
            (and (not (eobp))
                 ;; Stop at a pair of blank lines.
                 (not (looking-at "\n\\s-*\n")))

Example:

   emacs -Q
   C-h m
   C-x o
   M->

Note the highlighted "or"s in the last two paragraphs.