emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp ChangeLog comint.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/lisp ChangeLog comint.el
Date: Thu, 22 Oct 2009 03:24:35 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/10/22 03:24:34

Modified files:
        lisp           : ChangeLog comint.el 

Log message:
        (comint-read-input-ring, comint-write-input-ring)
        (comint-substitute-in-file-name)
        (comint-dynamic-complete-as-filename)
        (comint-dynamic-simple-complete)
        (comint-dynamic-list-filename-completions)
        (comint-dynamic-list-completions)
        (comint-redirect-results-list-from-process): Minor simplifications.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16471&r2=1.16472
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/comint.el?cvsroot=emacs&r1=1.395&r2=1.396

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16471
retrieving revision 1.16472
diff -u -b -r1.16471 -r1.16472
--- ChangeLog   21 Oct 2009 22:58:58 -0000      1.16471
+++ ChangeLog   22 Oct 2009 03:24:31 -0000      1.16472
@@ -1,7 +1,17 @@
+2009-10-22  Stefan Monnier  <address@hidden>
+
+       * comint.el (comint-read-input-ring, comint-write-input-ring)
+       (comint-substitute-in-file-name)
+       (comint-dynamic-complete-as-filename)
+       (comint-dynamic-simple-complete)
+       (comint-dynamic-list-filename-completions)
+       (comint-dynamic-list-completions)
+       (comint-redirect-results-list-from-process): Minor simplifications.
+
 2009-10-21  Kevin Ryde  <address@hidden>
 
-       * emacs-lisp/checkdoc.el (checkdoc-file-comments-engine): When
-       inserting ";;; Code" put it before any ";;;###autoload" cookie on
+       * emacs-lisp/checkdoc.el (checkdoc-file-comments-engine):
+       When inserting ";;; Code" put it before any ";;;###autoload" cookie on
        the first form.  And insert a blank line after ";;; Code" since
        that's usual style.  (My Bug#4612.)
 

Index: comint.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/comint.el,v
retrieving revision 1.395
retrieving revision 1.396
diff -u -b -r1.395 -r1.396
--- comint.el   15 Oct 2009 01:50:23 -0000      1.395
+++ comint.el   22 Oct 2009 03:24:34 -0000      1.396
@@ -902,8 +902,7 @@
                (size comint-input-ring-size)
                (ring (make-ring size)))
           (unwind-protect
-              (save-excursion
-                (set-buffer history-buf)
+              (with-current-buffer history-buf
                 (widen)
                 (erase-buffer)
                 (insert-file-contents file)
@@ -912,17 +911,22 @@
                 (goto-char (point-max))
                 (let (start end history)
                   (while (and (< count size)
-                              (re-search-backward comint-input-ring-separator 
nil t)
+                              (re-search-backward comint-input-ring-separator
+                                                   nil t)
                               (setq end (match-beginning 0)))
-                    (if (re-search-backward comint-input-ring-separator nil t)
-                        (setq start (match-end 0))
-                      (setq start (point-min)))
+                    (setq start
+                           (if (re-search-backward comint-input-ring-separator
+                                                   nil t)
+                               (match-end 0)
+                             (point-min)))
                     (setq history (buffer-substring start end))
                     (goto-char start)
-                    (if (and (not (string-match comint-input-history-ignore 
history))
+                    (if (and (not (string-match comint-input-history-ignore
+                                                 history))
                              (or (null comint-input-ignoredups)
                                  (ring-empty-p ring)
-                                 (not (string-equal (ring-ref ring 0) 
history))))
+                                 (not (string-equal (ring-ref ring 0)
+                                                     history))))
                         (progn
                           (ring-insert-at-beginning ring history)
                           (setq count (1+ count)))))))
@@ -952,8 +956,7 @@
                (index (ring-length ring)))
           ;; Write it all out into a buffer first.  Much faster, but messier,
           ;; than writing it one line at a time.
-          (save-excursion
-            (set-buffer history-buf)
+          (with-current-buffer history-buf
             (erase-buffer)
             (while (> index 0)
               (setq index (1- index))
@@ -1737,7 +1740,8 @@
        (let ((functions comint-preoutput-filter-functions))
          (while (and functions string)
            (if (eq (car functions) t)
-               (let ((functions (default-value 
'comint-preoutput-filter-functions)))
+               (let ((functions
+                       (default-value 'comint-preoutput-filter-functions)))
                  (while (and functions string)
                    (setq string (funcall (car functions) string))
                    (setq functions (cdr functions))))
@@ -2731,11 +2735,8 @@
              env-var-val)
          (save-match-data
            (while (string-match "%\\([^\\\\/]*\\)%" name)
-             (setq env-var-name
-                   (substring name (match-beginning 1) (match-end 1)))
-             (setq env-var-val (if (getenv env-var-name)
-                                   (getenv env-var-name)
-                                 ""))
+             (setq env-var-name (match-string 1 name))
+             (setq env-var-val (or (getenv env-var-name) ""))
              (setq name (replace-match env-var-val t t name))))))
     name))
 
@@ -2836,7 +2837,7 @@
         (completion (file-name-completion filenondir directory)))
     (cond ((null completion)
           (if minibuffer-p
-              (minibuffer-message (format " [No completions of %s]" filename))
+              (minibuffer-message "No completions of %s" filename)
             (message "No completions of %s" filename))
           (setq success nil))
          ((eq completion t)            ; Means already completed "file".
@@ -2911,7 +2912,7 @@
         (completions (all-completions stub candidates)))
     (cond ((null completions)
           (if minibuffer-p
-              (minibuffer-message (format " [No completions of %s]" stub))
+              (minibuffer-message "No completions of %s" stub)
             (message "No completions of %s" stub))
           nil)
          ((= 1 (length completions))   ; Gotcha!
@@ -2962,7 +2963,7 @@
         (completions (file-name-all-completions filenondir directory)))
     (if (not completions)
        (if (window-minibuffer-p (selected-window))
-           (minibuffer-message (format " [No completions of %s]" filename))
+           (minibuffer-message "No completions of %s" filename)
          (message "No completions of %s" filename))
       (comint-dynamic-list-completions
        (mapcar 'comint-quote-filename completions)
@@ -3012,7 +3013,7 @@
       (with-output-to-temp-buffer "*Completions*"
        (display-completion-list completions common-substring))
       (if (window-minibuffer-p (selected-window))
-         (minibuffer-message " [Type space to flush; repeat completion command 
to scroll]")
+         (minibuffer-message "Type space to flush; repeat completion command 
to scroll")
        (message "Type space to flush; repeat completion command to scroll")))
 
     ;; Read the next key, to process SPC.
@@ -3296,13 +3297,15 @@
           (list comint-redirect-output-buffer)))
        (filtered-input-string input-string))
 
-    ;; If there are any filter functions, give them a chance to modify the 
string
+    ;; If there are any filter functions, give them a chance to modify
+    ;; the string.
     (let ((functions comint-redirect-filter-functions))
       (while (and functions filtered-input-string)
        (if (eq (car functions) t)
            ;; If a local value says "use the default value too",
            ;; do that.
-           (let ((functions (default-value 'comint-redirect-filter-functions)))
+           (let ((functions
+                   (default-value 'comint-redirect-filter-functions)))
              (while (and functions filtered-input-string)
                (setq filtered-input-string
                      (funcall (car functions) filtered-input-string))
@@ -3422,8 +3425,7 @@
 REGEXP-GROUP is the regular expression group in REGEXP to use."
   (let ((output-buffer " *Comint Redirect Work Buffer*")
        results)
-    (save-excursion
-      (set-buffer (get-buffer-create output-buffer))
+    (with-current-buffer (get-buffer-create output-buffer)
       (erase-buffer)
       (comint-redirect-send-command-to-process command
                                               output-buffer process nil t)
@@ -3438,11 +3440,10 @@
       (and (looking-at command)
           (forward-line))
       (while (re-search-forward regexp nil t)
-       (setq results
-             (cons (buffer-substring-no-properties
+       (push (buffer-substring-no-properties
                     (match-beginning regexp-group)
                     (match-end regexp-group))
-                   results)))
+              results))
       results)))
 
 (dolist (x '("^Not at command line$"




reply via email to

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