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

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

bug#61069: 30.0.50; comint-copy-old-input should include continuation li


From: Bob Rogers
Subject: bug#61069: 30.0.50; comint-copy-old-input should include continuation lines
Date: Wed, 25 Jan 2023 23:33:42 -0800

   From: Eli Zaretskii <eliz@gnu.org>
   Date: Thu, 26 Jan 2023 09:04:34 +0200

   > From: Bob Rogers <rogers@rgrjr.com>
   > Date: Wed, 25 Jan 2023 17:43:02 -0800
   > 
   >    In a shell-mode buffer with lots of "make" output, there will often
   > appear commands with continuation lines.  To use them as new input
   > (e.g. while debugging some bit of makefile logic) requires either
   > marking and copying multiple lines, or multiple invocations of
   > comint-copy-old-input (C-RET in shell-mode) to get the complete command.
   > The attached patch against f0971f94fe42224b4d85bb8b6188d5d805689ddf in
   > master includes those continuation lines, which seems like a desirable
   > bit of dwimmery.  However, I may have misunderstood the purpose of the
   > line-end-position vs. field-end thing.  Also, this assumes shell syntax,
   > so it may be more appropriate to leave comint-get-old-input-default
   > alone and give shell-mode its own shell-get-old-input-default function.

   I don't understand: line-end-position already reports the entire line,
   including continuation lines.  So could you explain the problem with
   the current code in more detail, please?

I'm speaking of shell continuation lines, where a command is broken
across multiple physical lines with backslashes.  Perhaps you think I am
referring to display line wrapping; is where we are miscommunicating?

   > +               ;; Include continuation lines as long as the current
   > +               ;; line ends with a backslash.
   > +               (while (and (not (eobp))
   > +                           (= (char-before) ?\\))
   > +                 (goto-char (line-end-position 2))))

   Or maybe I don't understand what is this "backslash" business is
   about?  AFAICT, the "backslashes" shown for long lines of Make output
   are those produced by the Emacs display, not by the shell, so the code
   you want to change should already take care of that.

   What am I missing?  Could you please show an example of "long Make
   output" where the current code doesn't DTRT, so we'd be on the same
   page wrt the problem?

   Thanks.

Here's an example from building emacs:

        . . .
        rm -f emacs && cp -f temacs emacs
        LC_ALL=C ./temacs -batch  -l loadup --temacs=pdump \
                --bin-dest /usr/local/bin/ --eln-dest 
/usr/local/lib64/emacs/30.0.50/
        Loading loadup.el (source)...
        Dump mode: pdump
        . . .

My thought is that C-RET on the "./temacs -batch" line in a *shell*
buffer should take both that line and the next.

                                        -- Bob





reply via email to

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