emacs-diffs
[Top][All Lists]
Advanced

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

master 6d1c1fca0aa: ; Simplify (with-current-buffer (get-buffer ...) ...


From: Eli Zaretskii
Subject: master 6d1c1fca0aa: ; Simplify (with-current-buffer (get-buffer ...) ...)
Date: Thu, 14 Mar 2024 06:41:57 -0400 (EDT)

branch: master
commit 6d1c1fca0aa7c5a1ff0254af3f89a34d5309ea0d
Author: Tim Landscheidt <tim@tim-landscheidt.de>
Commit: Eli Zaretskii <eliz@gnu.org>

    ; Simplify (with-current-buffer (get-buffer ...) ...)
    
    There's no need to call 'get-buffer', since 'with-current-buffer'
    does that internally.
    * lisp/calendar/todo-mode.el (todo-merge-category):
    * lisp/comint.el (comint-dynamic-list-completions):
    * lisp/emacs-lisp/checkdoc.el (checkdoc-error):
    * lisp/emacs-lisp/debug.el (debug, debugger-record-expression):
    * lisp/emacs-lisp/eieio-opt.el (eieio-browse):
    * lisp/emacs-lisp/re-builder.el (reb-restart-font-lock):
    * lisp/erc/erc-dcc.el (erc-dcc-do-LIST-command):
    * lisp/eshell/em-unix.el (eshell-poor-mans-grep):
    * lisp/gnus/gnus-group.el (gnus-add-mark):
    * lisp/net/eww.el (eww-next-bookmark, eww-previous-bookmark):
    * lisp/net/sieve.el (sieve-upload):
    * lisp/net/tramp-cmds.el (tramp-cleanup-some-buffers):
    * lisp/obsolete/quickurl.el (quickurl-list-populate-buffer):
    * lisp/org/ob-calc.el: (org-babel-execute:calc):
    * lisp/org/org-agenda.el (org-agenda-use-sticky-p):
    * lisp/pcomplete.el (pcomplete-show-completions):
    * lisp/progmodes/bug-reference.el
    (bug-reference--try-setup-gnus-article):
    * lisp/progmodes/idlw-help.el
    (idlwave-highlight-linked-completions):
    * lisp/progmodes/verilog-mode.el (verilog-preprocess):
    * lisp/replace.el (occur-1):
    * lisp/term.el (term-dynamic-list-completions):
    * lisp/time.el (world-clock-update):
    * lisp/url/url-cache.el (url-store-in-cache):
    * lisp/vc/vc-cvs.el (vc-cvs-merge, vc-cvs-merge-news):
    * lisp/vc/vc-rcs.el (vc-rcs-system-release):
    * lisp/vc/vc-svn.el (vc-svn-merge, vc-svn-merge-news):
    * test/lisp/calendar/icalendar-tests.el
    (icalendar-tests--get-error-string-for-export):
    * test/lisp/erc/erc-dcc-tests.el
    (pcomplete/erc-mode/DCC--get-1flag)
    (pcomplete/erc-mode/DCC--get-2flags)
    (pcomplete/erc-mode/DCC--get-2flags-reverse):
    * test/lisp/erc/erc-networks-tests.el
    (erc-networks--rename-server-buffer--existing--noreuse):
    * test/lisp/erc/erc-scenarios-services-misc.el
    (erc-scenarios-services-misc--reconnect-retry-nick):
    * test/lisp/erc/erc-tests.el (erc--refresh-prompt):
    Replace (with-current-buffer (get-buffer ...) ...) with
    (with-current-buffer ...).
---
 lisp/calendar/todo-mode.el                   | 8 ++++----
 lisp/comint.el                               | 2 +-
 lisp/emacs-lisp/checkdoc.el                  | 2 +-
 lisp/emacs-lisp/debug.el                     | 4 ++--
 lisp/emacs-lisp/eieio-opt.el                 | 2 +-
 lisp/emacs-lisp/re-builder.el                | 2 +-
 lisp/erc/erc-dcc.el                          | 2 +-
 lisp/eshell/em-unix.el                       | 2 +-
 lisp/gnus/gnus-group.el                      | 2 +-
 lisp/net/eww.el                              | 4 ++--
 lisp/net/sieve.el                            | 2 +-
 lisp/net/tramp-cmds.el                       | 2 +-
 lisp/obsolete/quickurl.el                    | 2 +-
 lisp/org/ob-calc.el                          | 2 +-
 lisp/org/org-agenda.el                       | 2 +-
 lisp/pcomplete.el                            | 2 +-
 lisp/progmodes/bug-reference.el              | 2 +-
 lisp/progmodes/idlw-help.el                  | 2 +-
 lisp/progmodes/verilog-mode.el               | 2 +-
 lisp/replace.el                              | 2 +-
 lisp/term.el                                 | 2 +-
 lisp/time.el                                 | 2 +-
 lisp/url/url-cache.el                        | 2 +-
 lisp/vc/vc-cvs.el                            | 4 ++--
 lisp/vc/vc-rcs.el                            | 2 +-
 lisp/vc/vc-svn.el                            | 4 ++--
 test/lisp/calendar/icalendar-tests.el        | 2 +-
 test/lisp/erc/erc-dcc-tests.el               | 6 +++---
 test/lisp/erc/erc-networks-tests.el          | 2 +-
 test/lisp/erc/erc-scenarios-services-misc.el | 2 +-
 test/lisp/erc/erc-tests.el                   | 2 +-
 31 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index f2ee94ec8f7..12287299a7f 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -1612,7 +1612,7 @@ archive file and the source category is deleted."
         (garchive (concat (file-name-sans-extension gfile) ".toda"))
         (archived-count (todo-get-count 'archived))
         here)
-    (with-current-buffer (get-buffer (find-file-noselect tfile))
+    (with-current-buffer (find-file-noselect tfile)
       (widen)
       (let* ((inhibit-read-only t)
             (cbeg (progn
@@ -1638,7 +1638,7 @@ archive file and the source category is deleted."
             (todo-count (todo-get-count 'todo cat))
             (done-count (todo-get-count 'done cat)))
        ;; Merge into goal todo category.
-       (with-current-buffer (get-buffer (find-file-noselect gfile))
+       (with-current-buffer (find-file-noselect gfile)
          (unless (derived-mode-p 'todo-mode) (todo-mode))
          (widen)
          (goto-char (point-min))
@@ -1677,7 +1677,7 @@ archive file and the source category is deleted."
        (mapc (lambda (m) (set-marker m nil))
              (list cbeg tbeg dbeg tend cend))))
     (when (> archived-count 0)
-      (with-current-buffer (get-buffer (find-file-noselect tarchive))
+      (with-current-buffer (find-file-noselect tarchive)
        (widen)
        (goto-char (point-min))
        (let* ((inhibit-read-only t)
@@ -1697,7 +1697,7 @@ archive file and the source category is deleted."
                        (forward-line)
                        (buffer-substring-no-properties (point) cend))))
          ;; Merge into goal archive category, if it exists, else create it.
-         (with-current-buffer (get-buffer (find-file-noselect garchive))
+         (with-current-buffer (find-file-noselect garchive)
            (let ((gbeg (when (re-search-forward
                               (concat "^" (regexp-quote
                                            (concat todo-category-beg goal))
diff --git a/lisp/comint.el b/lisp/comint.el
index 655ff30469c..a8fe095e99c 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -3510,7 +3510,7 @@ the completions."
 
     ;; Read the next key, to process SPC.
     (let (key first)
-      (if (with-current-buffer (get-buffer "*Completions*")
+      (if (with-current-buffer "*Completions*"
            (setq-local comint-displayed-dynamic-completions
                         completions)
            (setq key (read-key-sequence nil)
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 02c11cae573..c22dfb2eb26 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -2794,7 +2794,7 @@ function called to create the messages."
                     ": " msg)))
     (if (string= checkdoc-diagnostic-buffer "*warn*")
         (warn (apply #'concat text))
-      (with-current-buffer (get-buffer checkdoc-diagnostic-buffer)
+      (with-current-buffer checkdoc-diagnostic-buffer
           (let ((inhibit-read-only t)
                 (pt (point-max)))
             (goto-char pt)
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 506b73f6fa2..60d14d11970 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -200,7 +200,7 @@ the debugger will not be entered."
       (let (debugger-value
            (debugger-previous-state
              (if (get-buffer "*Backtrace*")
-                 (with-current-buffer (get-buffer "*Backtrace*")
+                 (with-current-buffer "*Backtrace*"
                    (debugger--save-buffer-state))))
             (debugger-args args)
            (debugger-buffer (get-buffer-create "*Backtrace*"))
@@ -651,7 +651,7 @@ Complete list of commands:
     (princ (debugger-eval-expression exp))
     (terpri))
 
-  (with-current-buffer (get-buffer debugger-record-buffer)
+  (with-current-buffer debugger-record-buffer
     (message "%s"
             (buffer-substring (line-beginning-position 0)
                               (line-end-position 0)))))
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 893f8cd7e7f..bf6be1690e4 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -50,7 +50,7 @@ variable `eieio-default-superclass'."
   (if (not root-class) (setq root-class 'eieio-default-superclass))
   (cl-check-type root-class class)
   (display-buffer (get-buffer-create "*EIEIO OBJECT BROWSE*") t)
-  (with-current-buffer (get-buffer "*EIEIO OBJECT BROWSE*")
+  (with-current-buffer "*EIEIO OBJECT BROWSE*"
     (erase-buffer)
     (goto-char 0)
     (eieio-browse-tree root-class "" "")
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 0a47cca0231..c5307f70d08 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -825,7 +825,7 @@ If SUBEXP is non-nil mark only the corresponding 
sub-expressions."
 
 (defun reb-restart-font-lock ()
   "Restart `font-lock-mode' to fit current regexp format."
-  (with-current-buffer (get-buffer reb-buffer)
+  (with-current-buffer reb-buffer
     (let ((font-lock-is-on font-lock-mode))
       (font-lock-mode -1)
       (kill-local-variable 'font-lock-set-defaults)
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index 522973a0156..b8e16df755b 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -619,7 +619,7 @@ It lists the current state of `erc-dcc-list' in an easy to 
read manner."
                            (buffer-live-p (get-buffer (plist-get elt :file)))
                            (plist-member elt :size))
                       (let ((byte-count (with-current-buffer
-                                            (get-buffer (plist-get elt :file))
+                                            (plist-get elt :file)
                                           (+ (buffer-size) 0.0
                                              erc-dcc-byte-count))))
                         (format " (%d%%)"
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index 23028576f45..751f13cc715 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -789,7 +789,7 @@ available..."
                    (ignore-errors
                      (occur (car args))))
                  (if (get-buffer "*Occur*")
-                     (with-current-buffer (get-buffer "*Occur*")
+                     (with-current-buffer "*Occur*"
                        (setq string (buffer-string))
                        (kill-buffer (current-buffer)))))
                (if string (insert string))
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index d562d052d82..71bfaa639fa 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -4638,7 +4638,7 @@ and the second element is the address."
   "Mark ARTICLE in GROUP with MARK, whether the group is displayed or not."
   (let ((buffer (gnus-summary-buffer-name group)))
     (if (gnus-buffer-live-p buffer)
-       (with-current-buffer (get-buffer buffer)
+       (with-current-buffer buffer
          (gnus-summary-add-mark article mark))
       (gnus-add-marked-articles group (cdr (assq mark gnus-article-mark-lists))
                                (list article)))))
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 2936bc8f099..54847bdf396 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -2267,7 +2267,7 @@ If ERROR-OUT, signal user-error if there are no 
bookmarks."
       (setq first t)
       (eww-read-bookmarks t)
       (eww-bookmark-prepare))
-    (with-current-buffer (get-buffer "*eww bookmarks*")
+    (with-current-buffer "*eww bookmarks*"
       (when (and (not first)
                 (not (eobp)))
        (forward-line 1))
@@ -2286,7 +2286,7 @@ If ERROR-OUT, signal user-error if there are no 
bookmarks."
       (setq first t)
       (eww-read-bookmarks t)
       (eww-bookmark-prepare))
-    (with-current-buffer (get-buffer "*eww bookmarks*")
+    (with-current-buffer "*eww bookmarks*"
       (if first
          (goto-char (point-max))
        (beginning-of-line))
diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el
index fddc6e21bcc..a6ba556e7ae 100644
--- a/lisp/net/sieve.el
+++ b/lisp/net/sieve.el
@@ -354,7 +354,7 @@ Used to bracket operations which move point in the 
sieve-buffer."
     (let ((script (buffer-string))
           (script-name (file-name-sans-extension (buffer-name)))
           err)
-      (with-current-buffer (get-buffer sieve-buffer)
+      (with-current-buffer sieve-buffer
        (setq err (sieve-manage-putscript
                    (or name sieve-buffer-script-name script-name)
                    script sieve-manage-buffer))
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index a545a8e7273..d3af7a009ec 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -281,7 +281,7 @@ non-nil."
   ;; Remove all buffers with a remote default-directory which fit the hook.
   (dolist (name (tramp-list-remote-buffers))
     (and (buffer-live-p (get-buffer name))
-        (with-current-buffer (get-buffer name)
+        (with-current-buffer name
           (run-hook-with-args-until-success 'tramp-cleanup-some-buffers-hook))
         (kill-buffer name))))
 
diff --git a/lisp/obsolete/quickurl.el b/lisp/obsolete/quickurl.el
index 7393bebdce1..7da51a8a4a8 100644
--- a/lisp/obsolete/quickurl.el
+++ b/lisp/obsolete/quickurl.el
@@ -447,7 +447,7 @@ The key bindings for `quickurl-list-mode' are:
 
 (defun quickurl-list-populate-buffer ()
   "Populate the `quickurl-list' buffer."
-  (with-current-buffer (get-buffer quickurl-list-buffer-name)
+  (with-current-buffer quickurl-list-buffer-name
     (let* ((sizes (or (cl-loop for url in quickurl-urls
                                collect (length (quickurl-url-description url)))
                       (list 20)))
diff --git a/lisp/org/ob-calc.el b/lisp/org/ob-calc.el
index d335aab7499..f834f05cb6d 100644
--- a/lisp/org/ob-calc.el
+++ b/lisp/org/ob-calc.el
@@ -93,7 +93,7 @@
      (mapcar #'org-trim
             (split-string (org-babel-expand-body:calc body params) "[\n\r]"))))
   (save-excursion
-    (with-current-buffer (get-buffer "*Calculator*")
+    (with-current-buffer "*Calculator*"
       (prog1
           (calc-eval (calc-top 1))
         (calc-pop 1)))))
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index f8195a053bc..06249ed48fa 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -3883,7 +3883,7 @@ generating a new one."
    ;; buffer found
    (get-buffer org-agenda-buffer-name)
    ;; C-u parameter is same as last call
-   (with-current-buffer (get-buffer org-agenda-buffer-name)
+   (with-current-buffer org-agenda-buffer-name
      (and
       (equal current-prefix-arg
             org-agenda-last-prefix-arg)
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 196c5f159cd..0b34712a50c 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -1140,7 +1140,7 @@ Typing SPC flushes the help buffer."
   (let (event)
     (prog1
         (catch 'done
-          (while (with-current-buffer (get-buffer "*Completions*")
+          (while (with-current-buffer "*Completions*"
                    (setq event (read-event)))
             (cond
              ((eq event ?\s)
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el
index 29ff521253b..977a3d72cb7 100644
--- a/lisp/progmodes/bug-reference.el
+++ b/lisp/progmodes/bug-reference.el
@@ -493,7 +493,7 @@ and set it if applicable."
         ;; the values of the From, To, and Cc headers.
         (let (header-values)
           (with-current-buffer
-              (get-buffer gnus-original-article-buffer)
+              gnus-original-article-buffer
             (save-excursion
               (goto-char (point-min))
               ;; The Newsgroup is omitted because we already matched
diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el
index 217b2ab6691..7bed69a738b 100644
--- a/lisp/progmodes/idlw-help.el
+++ b/lisp/progmodes/idlw-help.el
@@ -631,7 +631,7 @@ Needs additional info stored in global 
`idlwave-completion-help-info'."
 Those words in `idlwave-completion-help-links' have links.  The
 `idlwave-help-link' face is used for this."
   (if idlwave-highlight-help-links-in-completion
-      (with-current-buffer (get-buffer "*Completions*")
+      (with-current-buffer "*Completions*"
        (save-excursion
          (let* ((case-fold-search t)
                 (props (list 'face 'idlwave-help-link))
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 7af78f2229a..a83bad0e8ed 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -5803,7 +5803,7 @@ FILENAME to find directory to run in, or defaults to 
`buffer-file-name'."
         (dir (file-name-directory (or filename buffer-file-name)))
         (cmd (concat "cd " dir "; " command)))
     (with-output-to-temp-buffer "*Verilog-Preprocessed*"
-      (with-current-buffer (get-buffer "*Verilog-Preprocessed*")
+      (with-current-buffer "*Verilog-Preprocessed*"
        (insert (concat "// " cmd "\n"))
        (call-process shell-file-name nil t nil shell-command-switch cmd)
        (verilog-mode)
diff --git a/lisp/replace.el b/lisp/replace.el
index 49e7c85c487..01a892bbba7 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1931,7 +1931,7 @@ See also `multi-occur'."
                    (lambda (boo)
                      (buffer-name (if (overlayp boo) (overlay-buffer boo) 
boo)))
                    active-bufs))
-      (with-current-buffer (get-buffer buf-name)
+      (with-current-buffer buf-name
        (rename-uniquely)))
 
     ;; Now find or create the output buffer.
diff --git a/lisp/term.el b/lisp/term.el
index 2ce0c2b5e79..3a0ecc041ca 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -4342,7 +4342,7 @@ Typing SPC flushes the help buffer."
       (display-completion-list (sort completions 'string-lessp)))
     (message "Hit space to flush")
     (let (key first)
-      (if (with-current-buffer (get-buffer "*Completions*")
+      (if (with-current-buffer "*Completions*"
            (setq key (read-key-sequence nil)
                  first (aref key 0))
            (and (consp first)
diff --git a/lisp/time.el b/lisp/time.el
index 9b932e945ba..a8d3ab9c813 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -611,7 +611,7 @@ To turn off the world time display, go to the window and 
type \\[quit-window]."
 (defun world-clock-update (&optional _arg _noconfirm)
   "Update the `world-clock' buffer."
   (if (get-buffer world-clock-buffer-name)
-      (with-current-buffer (get-buffer world-clock-buffer-name)
+      (with-current-buffer world-clock-buffer-name
         (let ((op (point)))
           (world-clock-display (time--display-world-list))
           (goto-char op)))
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el
index 0d27321cc47..ce6de2b3ee4 100644
--- a/lisp/url/url-cache.el
+++ b/lisp/url/url-cache.el
@@ -70,7 +70,7 @@ FILE can be created or overwritten."
 ;;;###autoload
 (defun url-store-in-cache (&optional buff)
   "Store buffer BUFF in the cache."
-    (with-current-buffer (get-buffer (or buff (current-buffer)))
+    (with-current-buffer (or buff (current-buffer))
       (let ((fname (url-cache-create-filename (url-view-url t))))
         (if (url-cache-prepare fname)
             (let ((coding-system-for-write 'binary))
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el
index 52039f8da74..63b566b0afe 100644
--- a/lisp/vc/vc-cvs.el
+++ b/lisp/vc/vc-cvs.el
@@ -476,7 +476,7 @@ The changes are between FIRST-REVISION and SECOND-REVISION."
                  (concat "-j" first-revision)
                  (concat "-j" second-revision))
   (vc-file-setprop file 'vc-state 'edited)
-  (with-current-buffer (get-buffer "*vc*")
+  (with-current-buffer "*vc*"
     (goto-char (point-min))
     (if (re-search-forward "conflicts during merge" nil t)
        (progn
@@ -495,7 +495,7 @@ The changes are between FIRST-REVISION and SECOND-REVISION."
   (vc-cvs-command nil nil file "update")
   ;; Analyze the merge result reported by CVS, and set
   ;; file properties accordingly.
-  (with-current-buffer (get-buffer "*vc*")
+  (with-current-buffer "*vc*"
     (goto-char (point-min))
     ;; get new working revision
     (if (re-search-forward
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index 1a43b440d18..33377ce1cc8 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -1177,7 +1177,7 @@ variable `vc-rcs-release' is set to the returned value."
   (or vc-rcs-release
       (setq vc-rcs-release
            (or (and (zerop (vc-do-command "*vc*" nil "rcs" nil "-V"))
-                    (with-current-buffer (get-buffer "*vc*")
+                    (with-current-buffer "*vc*"
                       (vc-parse-buffer "^RCS version \\([0-9.]+ *.*\\)" 1)))
                'unknown))))
 
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 96baa642b44..ae281e54519 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -436,7 +436,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
                        (concat first-version ":" second-version)
                      first-version))
   (vc-file-setprop file 'vc-state 'edited)
-  (with-current-buffer (get-buffer "*vc*")
+  (with-current-buffer "*vc*"
     (goto-char (point-min))
     (if (looking-at "C  ")
         1                              ; signal conflict
@@ -450,7 +450,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
   (vc-svn-command nil 0 file "update")
   ;; Analyze the merge result reported by SVN, and set
   ;; file properties accordingly.
-  (with-current-buffer (get-buffer "*vc*")
+  (with-current-buffer "*vc*"
     (goto-char (point-min))
     ;; get new working revision
     (if (re-search-forward
diff --git a/test/lisp/calendar/icalendar-tests.el 
b/test/lisp/calendar/icalendar-tests.el
index 7d3af25ea49..39ad735a789 100644
--- a/test/lisp/calendar/icalendar-tests.el
+++ b/test/lisp/calendar/icalendar-tests.el
@@ -68,7 +68,7 @@
     (with-temp-buffer
       (insert diary-string)
       (icalendar-export-region (point-min) (point-max) file))
-    (with-current-buffer (get-buffer "*icalendar-errors*")
+    (with-current-buffer "*icalendar-errors*"
       (buffer-string))))
 
 ;; ======================================================================
diff --git a/test/lisp/erc/erc-dcc-tests.el b/test/lisp/erc/erc-dcc-tests.el
index a2fb0392727..d4b5919a1cc 100644
--- a/test/lisp/erc/erc-dcc-tests.el
+++ b/test/lisp/erc/erc-dcc-tests.el
@@ -243,7 +243,7 @@
      (delete-region (point) (point-max))
      (insert "/dcc get -")
      (call-interactively #'completion-at-point)
-     (with-current-buffer (get-buffer "*Completions*")
+     (with-current-buffer "*Completions*"
        (goto-char (point-min))
        (search-forward "-s")
        (search-forward "-t"))
@@ -264,7 +264,7 @@
      (delete-region (point) (point-max))
      (insert "/dcc get -")
      (call-interactively #'completion-at-point)
-     (with-current-buffer (get-buffer "*Completions*")
+     (with-current-buffer "*Completions*"
        (goto-char (point-min))
        (search-forward "-s")
        (search-forward "-t"))
@@ -289,7 +289,7 @@
      (delete-region (point) (point-max))
      (insert "/dcc get -")
      (call-interactively #'completion-at-point)
-     (with-current-buffer (get-buffer "*Completions*")
+     (with-current-buffer "*Completions*"
        (goto-char (point-min))
        (search-forward "-s")
        (search-forward "-t"))
diff --git a/test/lisp/erc/erc-networks-tests.el 
b/test/lisp/erc/erc-networks-tests.el
index 90b8aa99741..0d8861f2167 100644
--- a/test/lisp/erc/erc-networks-tests.el
+++ b/test/lisp/erc/erc-networks-tests.el
@@ -1349,7 +1349,7 @@
         (should-not
          (erc-server-process-alive
           (should (get-buffer "#chan/irc.foonet.org"))))
-        (with-current-buffer (get-buffer "#chan/irc.foonet.org")
+        (with-current-buffer "#chan/irc.foonet.org"
           (should-not erc-server-connected)
           (should (eq erc-server-process old-proc))
           (erc-with-server-buffer
diff --git a/test/lisp/erc/erc-scenarios-services-misc.el 
b/test/lisp/erc/erc-scenarios-services-misc.el
index ab4a97c5724..47d0bcff41a 100644
--- a/test/lisp/erc/erc-scenarios-services-misc.el
+++ b/test/lisp/erc/erc-scenarios-services-misc.el
@@ -186,7 +186,7 @@
         (funcall expect 10 "Last login from")
         (funcall expect 10 "Your new nickname is tester")))
 
-    (with-current-buffer (get-buffer "#test")
+    (with-current-buffer "#test"
       (funcall expect 10 "tester ")
       (funcall expect 10 "was created on"))))
 
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 6809d9db41d..3e8ddef3731 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -382,7 +382,7 @@
           (should-not (search-forward (rx (or "9" "10") ">") nil t)))))
 
     (ert-info ("Query buffer")
-      (with-current-buffer (get-buffer "bob")
+      (with-current-buffer "bob"
         (goto-char erc-insert-marker)
         (should (looking-at-p "bob@ServNet 14>"))
         (goto-char erc-input-marker)



reply via email to

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