emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115579: * comint.el (comint-previous-matching-input


From: Chong Yidong
Subject: [Emacs-diffs] trunk r115579: * comint.el (comint-previous-matching-input-from-input): Retain point.
Date: Wed, 18 Dec 2013 03:02:43 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115579
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/13404
author: Le Wang <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Wed 2013-12-18 11:02:39 +0800
message:
  * comint.el (comint-previous-matching-input-from-input): Retain point.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/comint.el                 comint.el-20091113204419-o5vbwnq5f7feedwu-149
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-18 02:43:47 +0000
+++ b/lisp/ChangeLog    2013-12-18 03:02:39 +0000
@@ -1,3 +1,8 @@
+2013-12-18  Le Wang  <address@hidden>
+
+       * comint.el (comint-previous-matching-input-from-input): Retain
+       point (Bug#13404).
+
 2013-12-18  Chong Yidong  <address@hidden>
 
        * simple.el (append-next-kill): Doc fix (Bug#15995, Bug#16016).

=== modified file 'lisp/comint.el'
--- a/lisp/comint.el    2013-12-13 00:47:18 +0000
+++ b/lisp/comint.el    2013-12-18 03:02:39 +0000
@@ -1210,8 +1210,9 @@
 With prefix argument N, search for Nth previous match.
 If N is negative, search forwards for the -Nth following match."
   (interactive "p")
-  (if (not (memq last-command '(comint-previous-matching-input-from-input
-                               comint-next-matching-input-from-input)))
+  (let ((opoint (point)))
+    (unless (memq last-command '(comint-previous-matching-input-from-input
+                                comint-next-matching-input-from-input))
       ;; Starting a new search
       (setq comint-matching-input-from-input-string
            (buffer-substring
@@ -1219,9 +1220,10 @@
                 (process-mark (get-buffer-process (current-buffer))))
             (point))
            comint-input-ring-index nil))
-  (comint-previous-matching-input
-   (concat "^" (regexp-quote comint-matching-input-from-input-string))
-   n))
+    (comint-previous-matching-input
+     (concat "^" (regexp-quote comint-matching-input-from-input-string))
+     n)
+    (goto-char opoint)))
 
 (defun comint-next-matching-input-from-input (n)
   "Search forwards through input history for match for current input.


reply via email to

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