all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bob Rogers <rogers-emacs@rgrjr.dyndns.org>
Subject: comint-insert-input on non-command lines:  A trivial fix, a quibble, and a bug
Date: Sat, 6 May 2006 16:05:09 -0400	[thread overview]
Message-ID: <17501.373.791079.156322@rgrjr.dyndns.org> (raw)

   First the fix (see the diff below):  When you type "C-c RET"
(comint-insert-input) in shell mode (e.g.) with point on a line of
output, nothing happens, not even a ding.  This seems to be because
comint-insert-input is trying to invoke the "RET" binding, but doesn't
allow for the fact that this-command-keys returns a string.  The patch
makes it work for me, though only if you define "working" as "insert a
newline at point".

   Hence the quibble:  I would argue that these bindings are backwards.
There have been many times that I've typed "RET" (comint-send-input) in
a shell buffer and mistakenly expected newline insertion, instead of the
defined "reinvoke this command" behavior.  In contrast, I never expect
insertion when I type "C-c RET"; besides which, the side-effects of an
accidental "C-c RET" are easier to undo.  So if "safety" were the reason
for changing comint-insert-input to work only on actual command input,
then it seems inconsistent not to do the same for comint-send-input as
well.  Moreover, I would argue that comint-send-input should be the
picky one, and comint-insert-input should be more forgiving, so that you
could then get the current effect of "RET" on an arbitrary line by
typing "C-c RET RET", i.e. insert at the process mark and then submit
it.  As it is, I see no way to get the former comint-copy-old-input
behavior, save by cut-and-paste.  Or have I missed something?

   If not, that's the bug:  I find it extremely useful to be able to
reinvoke lines of transcript output (e.g. commands echoed by "make")
after editing them, so it is frustrating that "C-c RET" no longer works
for that.  Even if the new behavior is deemed a feature (or gets
grandfathered due to release pressure), it amounts to an incompatible
change, but I can't find any mention of this in NEWS.  (Except for the
command name, the description in misc.texi hasn't changed, though the
new behavior does match it better than the old behavior did.)

   So the question is:  Misfeature, or documentation oversight?

   TIA,

					-- Bob Rogers
					   http://rgrjr.dyndns.org/

------------------------------------------------------------------------
Index: lisp/comint.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/comint.el,v
retrieving revision 1.340
diff -c -r1.340 comint.el
*** lisp/comint.el	22 Apr 2006 23:30:13 -0000	1.340
--- lisp/comint.el	6 May 2006 16:07:16 -0000
***************
*** 807,813 ****
      (if (not (eq (get-char-property (point) 'field) 'input))
  	;; No input at POS, fall back to the global definition.
  	(let* ((keys (this-command-keys))
! 	       (last-key (and (vectorp keys) (aref keys (1- (length keys)))))
  	       (fun (and last-key (lookup-key global-map (vector last-key)))))
  	  (goto-char pos)
  	  (and fun (call-interactively fun)))
--- 807,814 ----
      (if (not (eq (get-char-property (point) 'field) 'input))
  	;; No input at POS, fall back to the global definition.
  	(let* ((keys (this-command-keys))
! 	       (last-key (and (or (vectorp keys) (stringp keys))
! 			      (aref keys (1- (length keys)))))
  	       (fun (and last-key (lookup-key global-map (vector last-key)))))
  	  (goto-char pos)
  	  (and fun (call-interactively fun)))

             reply	other threads:[~2006-05-06 20:05 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-06 20:05 Bob Rogers [this message]
2006-05-08  0:31 ` comint-insert-input on non-command lines: A trivial fix, a quibble, and a bug Nick Roberts
2006-05-08  3:16   ` Luc Teirlinck
2006-05-08  3:49   ` Luc Teirlinck
2006-05-08  4:49     ` Miles Bader
2006-05-08 14:08       ` Stefan Monnier
2006-05-09  2:33         ` Miles Bader
2006-05-08  4:08   ` Luc Teirlinck
2006-05-08  4:18     ` Nick Roberts
2006-05-09  1:55       ` Bob Rogers
2006-05-09  3:11         ` Nick Roberts
2006-05-10  3:01           ` Bob Rogers
2006-05-10  5:57             ` Nick Roberts
2006-05-09  3:01       ` Luc Teirlinck
2006-05-09  3:21         ` Nick Roberts
2006-05-09  3:59           ` Luc Teirlinck
2006-05-09  6:17             ` Nick Roberts
2006-05-09 14:58               ` Luc Teirlinck
2006-05-10  1:09                 ` Nick Roberts
2006-05-10  1:13                   ` Luc Teirlinck
2006-05-10  1:58                   ` Miles Bader
2006-05-10  2:21                     ` Nick Roberts
2006-05-10  2:32                       ` Miles Bader
2006-05-10  3:50                         ` Nick Roberts
2006-05-10  4:09                           ` Miles Bader
2006-05-10  4:41                   ` Luc Teirlinck
2006-05-10  5:29                     ` Nick Roberts
2006-05-10  6:06                       ` Luc Teirlinck
2006-05-10  6:27                         ` Miles Bader
2006-05-10 21:38                         ` comint-insert-input on non-command lines: Nick Roberts
2006-05-11  1:12                           ` Luc Teirlinck
2006-05-11  1:33                           ` Luc Teirlinck
2006-05-11 18:31                             ` Richard Stallman
2006-05-11 20:29                               ` Nick Roberts
2006-05-11 22:40                               ` Luc Teirlinck
2006-05-14 23:29                                 ` Richard Stallman
2006-05-15  3:46                                   ` Luc Teirlinck
2006-05-15 20:37                                     ` Richard Stallman
2006-05-28  2:11                                       ` Luc Teirlinck
2006-05-28  3:48                                         ` Luc Teirlinck
2006-05-29  3:41                                         ` Nick Roberts
2006-05-29  3:58                                           ` Luc Teirlinck
2006-05-31  3:14                                             ` Luc Teirlinck
2006-05-31  3:24                                               ` Bob Rogers
2006-05-09  4:15           ` comint-insert-input on non-command lines: A trivial fix, a quibble, and a bug Luc Teirlinck
2006-05-10  5:19   ` Luc Teirlinck
2006-05-10  6:04     ` Nick Roberts

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17501.373.791079.156322@rgrjr.dyndns.org \
    --to=rogers-emacs@rgrjr.dyndns.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.