unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Eshel Yaron <me@eshelyaron.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 62453@debbugs.gnu.org
Subject: bug#62453: 30.0.50; Semicolon in view-lossage yields wrong alignment
Date: Sun, 26 Mar 2023 12:23:56 +0300	[thread overview]
Message-ID: <83wn33ams3.fsf@gnu.org> (raw)
In-Reply-To: <m1cz4wqdpd.fsf@eshelyaron.com> (bug-gnu-emacs@gnu.org)

> Date: Sun, 26 Mar 2023 08:33:18 +0300
> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> 
> It seems like key sequences that end with a semicolon hinder the
> alignment in the `view-lossage` output buffer.  This is a regression
> with respect to the (IMO correct) behavior in Emacs 27.
> 
> With Emacs from master:
> 1. emacs -Q
> 2. type C-;
> 3. type ;
> 4. type C-h l
> 5. The *Help* buffer now shows:
> 
>  C-			; ;; nil
>  ; ;; self-insert-command
>  C-h l ;; view-lossage
> 
> Note that all three lines are formatted incorrectly compared to what we
> get with Emacs 27:
> 
>  C-;			;; nil
>  ;			;; self-insert-command
>  C-h l			;; view-lossage

Does the patch below give good results?

Stefan, any better ideas?  It looks like relying on comment-indent is
quite fragile here, as keys can include a semi-colon, which will be
interpreted as beginning a comment in too many places.  I wonder
whether the two extra bindings I add below really plug all the holes.

diff --git a/lisp/help.el b/lisp/help.el
index 3e94b50..13e61c0 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -689,6 +689,10 @@ view-lossage
       (with-current-buffer standard-output
 	(goto-char (point-min))
 	(let ((comment-start ";; ")
+              ;; Prevent 'comment-indent' from handling a single
+              ;; semicolon as the beginning of a comment.
+              (comment-start-skip ";; ")
+              (comment-use-syntax nil)
               (comment-column 24))
           (while (not (eobp))
             (comment-indent)





  reply	other threads:[~2023-03-26  9:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26  5:33 bug#62453: 30.0.50; Semicolon in view-lossage yields wrong alignment Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-26  9:23 ` Eli Zaretskii [this message]
2023-03-26  9:39   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-26 15:11   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-26 15:27     ` Eli Zaretskii
2023-03-27  7:00       ` Juri Linkov
2023-03-29 11:58     ` Eli Zaretskii

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=83wn33ams3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=62453@debbugs.gnu.org \
    --cc=me@eshelyaron.com \
    --cc=monnier@iro.umontreal.ca \
    /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).