unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: nickrob@snap.net.nz, rogers-emacs@rgrjr.dyndns.org, emacs-devel@gnu.org
Subject: Re: comint-insert-input on non-command lines:
Date: Sat, 27 May 2006 21:11:58 -0500 (CDT)	[thread overview]
Message-ID: <200605280211.k4S2Bw5D026516@jane.dms.auburn.edu> (raw)
In-Reply-To: <E1Ffjok-0000W7-RH@fencepost.gnu.org> (message from Richard Stallman on Mon, 15 May 2006 16:37:26 -0400)

Here are finally my proposed code and doc changes.  The code change
removes the misleading mouse-face and mouse-2 help-echo over old input
when `comint-use-prompt-regexp' is non-nil, because mouse-2 just yanks
as usual in that case.  The change to shell.el is minor: it just makes
the shell-mode docstring use shell-mode-map, even if `C-h f
shell-mode' was not done from a shell buffer.

I can install if desired.

===File ~/comint.el-diff====================================
Index: comint.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/comint.el,v
retrieving revision 1.345
diff -c -r1.345 comint.el
*** comint.el	26 May 2006 16:44:53 -0000	1.345
--- comint.el	28 May 2006 02:00:53 -0000
***************
*** 1510,1532 ****
  				(concat input "\n")))
  
  	  (let ((beg (marker-position pmark))
! 	      (end (if no-newline (point) (1- (point))))
! 	      (inhibit-modification-hooks t))
  	    (when (> end beg)
! 	      ;; Set text-properties for the input field
! 	      (add-text-properties
! 	       beg end
! 	       '(front-sticky t
! 		 font-lock-face comint-highlight-input
! 		 mouse-face highlight
! 		 help-echo "mouse-2: insert after prompt as new input"))
  	      (unless comint-use-prompt-regexp
  		;; Give old user input a field property of `input', to
  		;; distinguish it from both process output and unsent
  		;; input.  The terminating newline is put into a special
  		;; `boundary' field to make cursor movement between input
  		;; and output fields smoother.
! 		(put-text-property beg end 'field 'input)))
  	    (unless (or no-newline comint-use-prompt-regexp)
  	      ;; Cover the terminating newline
  	      (add-text-properties end (1+ end)
--- 1510,1532 ----
  				(concat input "\n")))
  
  	  (let ((beg (marker-position pmark))
! 		(end (if no-newline (point) (1- (point))))
! 		(inhibit-modification-hooks t))
  	    (when (> end beg)
! 	      (add-text-properties beg end
! 				   '(front-sticky t
! 				     font-lock-face comint-highlight-input))
  	      (unless comint-use-prompt-regexp
  		;; Give old user input a field property of `input', to
  		;; distinguish it from both process output and unsent
  		;; input.  The terminating newline is put into a special
  		;; `boundary' field to make cursor movement between input
  		;; and output fields smoother.
! 		(add-text-properties
! 		 beg end
! 		 '(mouse-face highlight
! 		   help-echo "mouse-2: insert after prompt as new input"
! 		   field input))))
  	    (unless (or no-newline comint-use-prompt-regexp)
  	      ;; Cover the terminating newline
  	      (add-text-properties end (1+ end)
============================================================

===File ~/shell.el-diff=====================================
*** shell.el	26 May 2006 16:27:31 -0500	1.137
--- shell.el	27 May 2006 18:30:48 -0500	
***************
*** 367,373 ****
  (put 'shell-mode 'mode-class 'special)
  
  (define-derived-mode shell-mode comint-mode "Shell"
!   "Major mode for interacting with an inferior shell.
  \\[comint-send-input] after the end of the process' output sends the text from
      the end of process to the end of the current line.
  \\[comint-send-input] before end of process output copies the current line minus the prompt to
--- 367,373 ----
  (put 'shell-mode 'mode-class 'special)
  
  (define-derived-mode shell-mode comint-mode "Shell"
!   "Major mode for interacting with an inferior shell.\\<shell-mode-map>
  \\[comint-send-input] after the end of the process' output sends the text from
      the end of process to the end of the current line.
  \\[comint-send-input] before end of process output copies the current line minus the prompt to
============================================================

===File ~/misc.texi-diff====================================
*** misc.texi	17 May 2006 23:42:26 -0500	1.85
--- misc.texi	27 May 2006 20:55:01 -0500	
***************
*** 873,889 ****
  Move point to the following prompt (@code{comint-next-prompt}).
  
  @kindex C-c RET @r{(Shell mode)}
! @findex comint-insert-input
  @item C-c @key{RET}
  Copy the input command which point is in, inserting the copy at the end
! of the buffer (@code{comint-insert-input}).  This is useful if you
  move point back to a previous command.  After you copy the command, you
  can submit the copy as input with @key{RET}.  If you wish, you can
! edit the copy before resubmitting it.
  
  @item Mouse-2
! Copy the input command that you click on, inserting the copy at the end
! of the buffer.
  @end table
  
    Moving to a previous input and then copying it with @kbd{C-c
--- 873,893 ----
  Move point to the following prompt (@code{comint-next-prompt}).
  
  @kindex C-c RET @r{(Shell mode)}
! @findex comint-copy-old-input
  @item C-c @key{RET}
  Copy the input command which point is in, inserting the copy at the end
! of the buffer (@code{comint-copy-old-input}).  This is useful if you
  move point back to a previous command.  After you copy the command, you
  can submit the copy as input with @key{RET}.  If you wish, you can
! edit the copy before resubmitting it.  If you use this command on an
! output line, it copies that line to the end of the buffer.
  
  @item Mouse-2
! Copy the old input command that you click on, inserting the copy at the end
! of the buffer (@code{comint-insert-input}).  This command only works if
! @code{comint-use-prompt-regexp} is @code{nil} (the default).
! If @code{comint-use-prompt-regexp} is non-@code{nil} or if point is
! not over old input, @kbd{Mouse-2} just yanks as usual.
  @end table
  
    Moving to a previous input and then copying it with @kbd{C-c
============================================================

===File ~/inf-lisp-el-diff==================================
*** inf-lisp.el	10 Feb 2006 08:34:48 -0600	1.43
--- inf-lisp.el	27 May 2006 20:54:12 -0500	
***************
*** 232,262 ****
  documentation for variable `inferior-lisp-buffer'.
  
  \\{inferior-lisp-mode-map}
! 
! Customisation: Entry to this mode runs the hooks on `comint-mode-hook' and
  `inferior-lisp-mode-hook' (in that order).
  
  You can send text to the inferior Lisp process from other buffers containing
  Lisp source.
!     switch-to-lisp switches the current buffer to the Lisp process buffer.
!     lisp-eval-defun sends the current defun to the Lisp process.
!     lisp-compile-defun compiles the current defun.
!     lisp-eval-region sends the current region to the Lisp process.
!     lisp-compile-region compiles the current region.
  
      Prefixing the lisp-eval/compile-defun/region commands with
      a \\[universal-argument] causes a switch to the Lisp process buffer after sending
      the text.
  
  Commands:
! Return after the end of the process' output sends the text from the
      end of process to point.
! Return before the end of the process' output copies the sexp ending at point
      to the end of the process' output, and sends it.
! Delete converts tabs to spaces as it moves back.
! Tab indents for Lisp; with argument, shifts rest
      of expression rigidly with the current line.
! C-M-q does Tab on each line starting within following expression.
  Paragraphs are separated only by blank lines.  Semicolons start comments.
  If you accidentally suspend your process, use \\[comint-continue-subjob]
  to continue it."
--- 232,269 ----
  documentation for variable `inferior-lisp-buffer'.
  
  \\{inferior-lisp-mode-map}
! \\<inferior-lisp-mode-map>
! Customization: Entry to this mode runs the hooks on `comint-mode-hook' and
  `inferior-lisp-mode-hook' (in that order).
  
  You can send text to the inferior Lisp process from other buffers containing
  Lisp source.
!     `switch-to-lisp' switches the current buffer to the Lisp process buffer.
!     `lisp-eval-defun' sends the current defun to the Lisp process.
!     `lisp-compile-defun' compiles the current defun.
!     `lisp-eval-region' sends the current region to the Lisp process.
!     `lisp-compile-region' compiles the current region.
  
      Prefixing the lisp-eval/compile-defun/region commands with
      a \\[universal-argument] causes a switch to the Lisp process buffer after sending
      the text.
  
  Commands:
! \\[comint-send-input] after the end of the process' output sends the text from the
      end of process to point.
! \\[comint-send-input] before the end of the process' output copies the sexp ending at point
      to the end of the process' output, and sends it.
! \\[comint-copy-old-input] copies the sexp ending at point to the end of the process' output,
!     allowing you to edit it before sending it.
! If `comint-use-prompt-regexp' is nil (the default), \\[comint-insert-input] on old input
!    copies the entire old input to the end of the process' output, allowing
!    you to edit it before sending it.  If point is not on old input or if
!    `comint-use-prompt-regexp' is non-nil, \\[comint-insert-input] behaves according to
!    its global binding.
! \\[backward-delete-char-untabify] converts tabs to spaces as it moves back.
! \\[lisp-indent-line] indents for Lisp; with argument, shifts rest
      of expression rigidly with the current line.
! \\[indent-sexp] does \\[lisp-indent-line] on each line starting within following expression.
  Paragraphs are separated only by blank lines.  Semicolons start comments.
  If you accidentally suspend your process, use \\[comint-continue-subjob]
  to continue it."
============================================================

  reply	other threads:[~2006-05-28  2:11 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-06 20:05 comint-insert-input on non-command lines: A trivial fix, a quibble, and a bug Bob Rogers
2006-05-08  0:31 ` 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 [this message]
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

  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=200605280211.k4S2Bw5D026516@jane.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@gnu.org \
    --cc=nickrob@snap.net.nz \
    --cc=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 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).