From: Robert Pluim <rpluim@gmail.com>
To: Bob Rogers <rogers@rgrjr.com>
Cc: 61069@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#61069: 30.0.50; comint-copy-old-input should include continuation lines
Date: Mon, 30 Jan 2023 09:25:19 +0100 [thread overview]
Message-ID: <87bkmgzaxc.fsf@gmail.com> (raw)
In-Reply-To: <25556.39517.23330.591366@orion.rgrjr.com> (Bob Rogers's message of "Fri, 27 Jan 2023 19:45:33 -0800")
>>>>> On Fri, 27 Jan 2023 19:45:33 -0800, Bob Rogers <rogers@rgrjr.com> said:
Bob> Then the following should fit the bill. Given that this solution
Bob> introduces a defcustom, I imagine it should also have a NEWS item as
Bob> well . . .
Yes. And a :version on the new defcustom itself.
Bob> -- Bob
Bob> * lisp/shell.el (shell-get-old-input-include-continuation-lines): New
Bob> defcustom (default nil).
Bob> (shell-get-old-input): Like comint-get-old-input-default but include
Bob> all continuation lines if the above is true.
Bob> (shell-mode): Install shell-get-old-input. (bug#61069)
Two spaces after '.'
Bob> +(defcustom shell-get-old-input-include-continuation-lines nil
Bob> + "If non-nil, shell-get-old-input-default includes \"\\\" lines."
Bob> + :type 'boolean
Bob> + :group 'shell)
Bob> +
"Whether `shell-get-old-input-default' includes \"\\\" lines."
Bob> +(defun shell-get-old-input ()
Bob> + "Default for `comint-get-old-input' in shell-mode.
Bob> +If `comint-use-prompt-regexp' is nil, then either
Bob> +return the current input field, if point is on an input field, or the
Bob> +current line, if point is on an output field.
Bob> +If `comint-use-prompt-regexp' is non-nil, then return
Bob> +the current line with any initial string matching the regexp
Bob> +`comint-prompt-regexp' removed. In either case, if
Bob> +shell-get-old-input-include-continuation-lines is non-nil and the
Bob> +current line ends with a backslash, the next line is also included and
Bob> +examined for a backslash, ending with a final line without a backslash."
Bob> + (let (field-prop bof)
Bob> + (if (and (not comint-use-prompt-regexp)
Bob> + ;; Make sure we're in an input rather than output field.
Bob> + (not (setq field-prop (get-char-property
Bob> + (setq bof (field-beginning)) 'field))))
Bob> + (field-string-no-properties bof)
Emacs uses spaces only in elisp. We even have a .dir-locals.el
enforcing that.
Robert
--
next prev parent reply other threads:[~2023-01-30 8:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 1:43 bug#61069: 30.0.50; comint-copy-old-input should include continuation lines Bob Rogers
2023-01-26 7:04 ` Eli Zaretskii
2023-01-26 7:33 ` Bob Rogers
2023-01-26 8:12 ` Eli Zaretskii
2023-01-26 8:38 ` Bob Rogers
2023-01-26 9:32 ` Eli Zaretskii
2023-01-28 3:45 ` Bob Rogers
2023-01-30 8:25 ` Robert Pluim [this message]
2023-01-30 21:05 ` Bob Rogers
2023-01-31 2:38 ` Bob Rogers
2023-01-31 9:10 ` Robert Pluim
2023-01-31 19:45 ` Bob Rogers
2023-03-30 19:51 ` Bob Rogers
2023-03-31 8:07 ` Robert Pluim
2023-03-31 10:51 ` Eli Zaretskii
2023-03-31 13:01 ` Robert Pluim
2023-03-31 13:23 ` Robert Pluim
2023-04-01 0:15 ` Bob Rogers
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=87bkmgzaxc.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=61069@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=rogers@rgrjr.com \
/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).