[Top][All Lists]

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

[VM] patch to stop buffer name flickering

From: Julian Bradfield
Subject: [VM] patch to stop buffer name flickering
Date: Sun, 22 Jan 2012 13:47:49 +0000
User-agent: slrn/0.9.9p1 (Linux)

When you reply to a non-ascii sender, VM has a very annoying habit of
flicking the compose buffer name back and forth between ... and ...<1>
(or whatever it is).
This is because of a couple of minor logic errors in the buffer
renaming code.

Here's a patch (against 8.2.0b).
Sorry I didn't send this in when I did it a few months ago!

--- vm-reply.el.orig    2012-01-22 13:43:14.000000000 +0000
+++ vm-reply.el 2012-01-22 13:40:47.000000000 +0000
@@ -961,10 +961,12 @@
            (if (> (length prefix) 44)
                (setq prefix (concat (substring prefix 0 40) " ...")))
            (setq name prefix n 2)
-           (while (get-buffer name)
-             (setq name (format "%s<%d>" prefix n))
-             (vm-increment n))
-           (rename-buffer name))))))
+           (if (equal name (buffer-name))
+               t ; do nothing
+             (while (get-buffer name)
+               (setq name (format "%s<%d>" prefix n))
+               (vm-increment n))
+             (rename-buffer name)))))))
 (defun vm-mail-mark-replied ()
@@ -2076,9 +2078,9 @@
            newbufname (funcall vm-chop-full-name-function newbufname)
            newbufname (or (car newbufname) (car (cdr newbufname)))
            newbufname (format fmt newbufname ellipsis
-                              (mail-fetch-field "Subject")))
+                              (mail-fetch-field "Subject"))
+           newbufname (vm-sanitize-buffer-name newbufname))
       (unless (equal newbufname curbufname)
-       (setq newbufname (vm-sanitize-buffer-name newbufname))
        (rename-buffer newbufname t)))))

reply via email to

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