]> git.eshelyaron.com Git - emacs.git/commitdiff
Accommodate missing spec values in erc-format-message
authorF. Jason Park <jp@neverwas.me>
Sat, 8 Oct 2022 04:55:30 +0000 (21:55 -0700)
committerF. Jason Park <jp@neverwas.me>
Tue, 11 Oct 2022 01:48:01 +0000 (18:48 -0700)
* lisp/erc/erc.el (erc-format-message): Although not mentioned in its
log message, commit 5281946fbf6b3cdbec5ce82e0057c71849faf4d2 "Make
format-spec accept function substitutions" also fixed a bug involving
the `ignore-missing' parameter of `format-spec'.  Until now, ERC has
been relying on the old behavior to gracefully handle malformed server
messages.  This commit tries to regain that functionality.

lisp/erc/erc.el

index f128387bcf6d0021c86b86cdf94b9322d833eea1..db39e341b2f748a6e53bdbd1e7c9b444175534b5 100644 (file)
@@ -6961,6 +6961,8 @@ shortened server name instead."
 
 (defvar tabbar--local-hlf)
 
+;; FIXME when 29.1 is cut and `format-spec' is added to ELPA Compat,
+;; remove the function invocations from the spec form below.
 (defun erc-update-mode-line-buffer (buffer)
   "Update the mode line in a single ERC buffer BUFFER."
   (with-current-buffer buffer
@@ -7325,7 +7327,7 @@ See also `format-spec'."
       (error "No format spec for message %s" msg))
     (when (functionp entry)
       (setq entry (apply entry args)))
-    (format-spec entry (apply #'format-spec-make args))))
+    (format-spec entry (apply #'format-spec-make args) 'ignore)))
 
 ;;; Various hook functions