]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix naming of buffers for tags ending in Y in 'mpc'
authorjohn muhl <jm@pub.pink>
Tue, 8 Oct 2024 17:24:27 +0000 (12:24 -0500)
committerEshel Yaron <me@eshelyaron.com>
Tue, 22 Oct 2024 18:54:41 +0000 (20:54 +0200)
* lisp/mpc.el (mpc-tagbrowser-buf): Use 'mpc-tagbrowser-tag-name'
to ensure buffers corresponding to tags that end in Y are
correctly pluralized; e.g. the tag "Directory" should create a
buffer named "*MPC Directories*" not "*MPC Directorys".

(cherry picked from commit 60e58be091bf075a03ac431444aa9c9b5832bb19)

lisp/mpc.el

index ea472751832891015df35ad704a3f2650e9ae117..b71cd445738ad024198e978d7632e29160da3880 100644 (file)
@@ -1561,9 +1561,10 @@ when constructing the set of constraints."
    (t (concat (symbol-name tag) "s"))))
 
 (defun mpc-tagbrowser-buf (tag)
-  (let ((buf (mpc-proc-buffer (mpc-proc) tag)))
+  (let ((buf (mpc-proc-buffer (mpc-proc) tag))
+        (tag-name (mpc-tagbrowser-tag-name tag)))
     (if (buffer-live-p buf) buf
-      (setq buf (get-buffer-create (format "*MPC %ss*" tag)))
+      (setq buf (get-buffer-create (format "*MPC %s*" tag-name)))
       (mpc-proc-buffer (mpc-proc) tag buf)
       (with-current-buffer buf
         (let ((inhibit-read-only t))
@@ -1574,7 +1575,7 @@ when constructing the set of constraints."
           (insert mpc-tagbrowser-all-name "\n"))
         (forward-line -1)
         (setq mpc-tag tag)
-        (setq mpc-tag-name (mpc-tagbrowser-tag-name tag))
+        (setq mpc-tag-name tag-name)
         (mpc-tagbrowser-all-select)
         (mpc-tagbrowser-refresh)
         buf))))