From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: [PATCH:revised] misc.texi, comint.el Date: Mon, 21 Jun 2004 23:15:48 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <16599.24084.26624.175@nick.uklinux.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1087856266 23840 80.91.224.253 (21 Jun 2004 22:17:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 Jun 2004 22:17:46 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Jun 22 00:17:37 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BcX6e-00064c-00 for ; Tue, 22 Jun 2004 00:17:36 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BcX6e-0000vE-00 for ; Tue, 22 Jun 2004 00:17:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BcX7u-0003ts-81 for emacs-devel@quimby.gnus.org; Mon, 21 Jun 2004 18:18:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BcX7n-0003tn-3P for emacs-devel@gnu.org; Mon, 21 Jun 2004 18:18:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BcX7m-0003tb-9i for emacs-devel@gnu.org; Mon, 21 Jun 2004 18:18:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BcX7m-0003tY-6Y for emacs-devel@gnu.org; Mon, 21 Jun 2004 18:18:46 -0400 Original-Received: from [194.247.51.138] (helo=nick.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BcX6Q-0005VH-FV for emacs-devel@gnu.org; Mon, 21 Jun 2004 18:17:26 -0400 Original-Received: by nick.uklinux.net (Postfix, from userid 501) id 9233075FDE; Mon, 21 Jun 2004 23:15:48 +0100 (BST) Original-To: emacs-devel@gnu.org X-Mailer: VM 6.97 under Emacs 21.2.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25164 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25164 Here's my revised patch for misc.texi (and comint.el). It does the following: 1) Moves comint-dynamic-list-input-ring to the Shell History Ring section. 2) Indexes comint-input-previous-argument and comint-get-next-from-history properly. 3) Replaces comint-copy-old-input and comint-insert-clicked-input with two bindings but just one functionality. (comint-insert-input, comint-mouse-insert-input) Nick 2004-06-21 Nick Roberts * comint.el (comint-insert-clicked-input, comint-copy-old-input): Remove. (comint-insert-input, comint-mouse-insert-input): New functions based on comint-insert-clicked-input for two bindings but just one functionality. 2004-06-21 Nick Roberts * misc.texi (Shell History Copying): Document comint-insert-input. (Shell Ring): Describe comint-dynamic-list-input-ring here. *** misc.texi 24 Mar 2004 20:26:30 +0000 1.50 --- misc.texi 21 Jun 2004 22:51:21 +0100 *************** *** 624,635 **** Move backward across one shell command, but not beyond the current line (@code{shell-backward-command}). - @item C-c C-l - @kindex C-c C-l @r{(Shell mode)} - @findex comint-dynamic-list-input-ring - Display the buffer's history of shell commands in another window - (@code{comint-dynamic-list-input-ring}). - @item M-x dirs Ask the shell what its current directory is, so that Emacs can agree with the shell. --- 624,629 ---- *************** *** 740,752 **** @itemx M-s @var{regexp} @key{RET} Search backwards or forwards for old shell commands that match @var{regexp}. ! @item C-c C-x @r{(Shell mode)} @findex comint-get-next-from-history Fetch the next subsequent command from the history. ! @item C-c . @r{(Shell mode)} @findex comint-input-previous-argument Fetch one argument from an old shell command. @end table Shell buffers provide a history of previously entered shell commands. To --- 734,754 ---- @itemx M-s @var{regexp} @key{RET} Search backwards or forwards for old shell commands that match @var{regexp}. ! @item C-c C-x ! @kindex C-c C-x @r{(Shell mode)} @findex comint-get-next-from-history Fetch the next subsequent command from the history. ! @item C-c . ! @kindex C-c . @r{(Shell mode)} @findex comint-input-previous-argument Fetch one argument from an old shell command. + + @item C-c C-l + @kindex C-c C-l @r{(Shell mode)} + @findex comint-dynamic-list-input-ring + Display the buffer's history of shell commands in another window + (@code{comint-dynamic-list-input-ring}). @end table Shell buffers provide a history of previously entered shell commands. To *************** *** 815,835 **** 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. @end table Moving to a previous input and then copying it with @kbd{C-c ! @key{RET}} produces the same results---the same buffer contents---that ! you would get by using @kbd{M-p} enough times to fetch that previous ! input from the history list. However, @kbd{C-c @key{RET}} copies the ! text from the buffer, which can be different from what is in the history ! list if you edit the input text in the buffer after it has been sent. @node History References @subsubsection Shell History References --- 817,842 ---- 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 ! @key{RET}} or @kbd{Mouse-2} produces the same results---the same ! buffer contents---that you would get by using @kbd{M-p} enough times ! to fetch that previous input from the history list. However, @kbd{C-c ! @key{RET}} copies the text from the buffer, which can be different ! from what is in the history list if you edit the input text in the ! buffer after it has been sent. @node History References @subsubsection Shell History References *** comint.el 02 Jun 2004 17:48:48 +0100 1.298 --- comint.el 21 Jun 2004 22:54:52 +0100 *************** *** 571,577 **** (define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob) (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob) (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob) ! (define-key comint-mode-map "\C-c\C-m" 'comint-copy-old-input) (define-key comint-mode-map "\C-c\C-o" 'comint-delete-output) (define-key comint-mode-map "\C-c\C-r" 'comint-show-output) (define-key comint-mode-map "\C-c\C-e" 'comint-show-maximum-output) --- 571,577 ---- (define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob) (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob) (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob) ! (define-key comint-mode-map "\C-c\C-m" 'comint-insert-input) (define-key comint-mode-map "\C-c\C-o" 'comint-delete-output) (define-key comint-mode-map "\C-c\C-r" 'comint-show-output) (define-key comint-mode-map "\C-c\C-e" 'comint-show-maximum-output) *************** *** 582,588 **** (define-key comint-mode-map "\C-c\C-s" 'comint-write-output) (define-key comint-mode-map "\C-c." 'comint-insert-previous-argument) ;; Mouse Buttons: ! (define-key comint-mode-map [mouse-2] 'comint-insert-clicked-input) ;; Menu bars: ;; completion: (define-key comint-mode-map [menu-bar completion] --- 582,588 ---- (define-key comint-mode-map "\C-c\C-s" 'comint-write-output) (define-key comint-mode-map "\C-c." 'comint-insert-previous-argument) ;; Mouse Buttons: ! (define-key comint-mode-map [mouse-2] 'comint-mouse-insert-input) ;; Menu bars: ;; completion: (define-key comint-mode-map [menu-bar completion] *************** *** 615,621 **** (define-key comint-mode-map [menu-bar inout kill-input] '("Kill Current Input" . comint-kill-input)) (define-key comint-mode-map [menu-bar inout copy-input] ! '("Copy Old Input" . comint-copy-old-input)) (define-key comint-mode-map [menu-bar inout forward-matching-history] '("Forward Matching Input..." . comint-forward-matching-input)) (define-key comint-mode-map [menu-bar inout backward-matching-history] --- 615,621 ---- (define-key comint-mode-map [menu-bar inout kill-input] '("Kill Current Input" . comint-kill-input)) (define-key comint-mode-map [menu-bar inout copy-input] ! '("Copy Old Input" . comint-insert-input)) (define-key comint-mode-map [menu-bar inout forward-matching-history] '("Forward Matching Input..." . comint-forward-matching-input)) (define-key comint-mode-map [menu-bar inout backward-matching-history] *************** *** 798,808 **** (set-process-coding-system proc decoding encoding)) proc)) ! ! (defun comint-insert-clicked-input (event) ! "In a Comint buffer, set the current input to the clicked-on previous input." ! (interactive "e") ! (let ((pos (posn-point (event-end event)))) (if (not (eq (get-char-property pos 'field) 'input)) ;; No input at POS, fall back to the global definition. (let* ((keys (this-command-keys)) --- 798,807 ---- (set-process-coding-system proc decoding encoding)) proc)) ! (defun comint-insert-input () ! "In a Comint buffer, set the current input to the previous input at point." ! (interactive) ! (let ((pos (point))) (if (not (eq (get-char-property pos 'field) 'input)) ;; No input at POS, fall back to the global definition. (let* ((keys (this-command-keys)) *************** *** 816,826 **** (or (marker-position comint-accum-marker) (process-mark (get-buffer-process (current-buffer)))) (point)) ! ;; Insert the clicked-upon input (insert (buffer-substring-no-properties (previous-single-char-property-change (1+ pos) 'field) (next-single-char-property-change pos 'field)))))) ;; Input history processing in a buffer --- 815,830 ---- (or (marker-position comint-accum-marker) (process-mark (get-buffer-process (current-buffer)))) (point)) ! ;; Insert the input at point (insert (buffer-substring-no-properties (previous-single-char-property-change (1+ pos) 'field) (next-single-char-property-change pos 'field)))))) + (defun comint-mouse-insert-input (event) + "In a Comint buffer, set the current input to the previous input you click on." + (interactive "e") + (mouse-set-point event) + (comint-insert-input)) ;; Input history processing in a buffer *************** *** 1858,1874 **** (comint-bol) (buffer-substring-no-properties (point) (line-end-position))))) - (defun comint-copy-old-input () - "Insert after prompt old input at point as new input to be edited. - Calls `comint-get-old-input' to get old input." - (interactive) - (let ((input (funcall comint-get-old-input)) - (process (get-buffer-process (current-buffer)))) - (if (not process) - (error "Current buffer has no process") - (goto-char (process-mark process)) - (insert input)))) - (defun comint-skip-prompt () "Skip past the text matching regexp `comint-prompt-regexp'. If this takes us past the end of the current line, don't skip at all." --- 1862,1867 ----