unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15377: 24.1; erc-mode-line-update-buffer can mishandle updates when there is no topic
@ 2013-09-14  0:32 Vivek Dasmohapatra
  2013-09-14 23:33 ` Glenn Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Vivek Dasmohapatra @ 2013-09-14  0:32 UTC (permalink / raw)
  To: 15377


Very rarely, erc can start throwing lots of errors inside its process
sentinel - a couple of users on #emacs also reported it recently:

[conversation edited for noise]
<xxxx> sigh, periodically, my erc … "error in process
       filter: Invalid format character: `%o'"

<yyyy> xxxx: I've seen this error a few times before--typically when my
       bouncer has just experienced connection difficulties and is in a
       disconnect/reconnect thrash.

I tracked it down to:

erc-header-line-format: "%n on %t (%m,%l) %o"

And in erc-update-mode-line-buffer:

    (let ((spec (format-spec-make
                 ⋮
                 ?o (erc-controls-strip erc-channel-topic)

And then:

    (format-spec erc-header-line-format spec)

But erc-controls-strip can return nil, which does make format-spec
choke on "%o", since it does not differentiate between a spec with
no ?o element and one containing ?o nil.

The following should fix it:

--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -6210,7 +6210,7 @@ if `erc-away' is non-nil."
 		 ?m (erc-format-channel-modes)
 		 ?n (or (erc-current-nick) "")
 		 ?N (erc-format-network)
-		 ?o (erc-controls-strip erc-channel-topic)
+		 ?o (or (erc-controls-strip erc-channel-topic) "")
 		 ?p (erc-port-to-string erc-session-port)
 		 ?s (erc-format-target-and/or-server)
 		 ?S (erc-format-target-and/or-network)

I have no real test recipe, since the error is intermittent and
I don't know what makes the erc-channel-topic degrade to nil,
but you can try this:

M-: (let (erc-channel-topic) (erc-update-mode-line-buffer (current-buffer)))

with an erc-buffer current.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#15377: 24.1; erc-mode-line-update-buffer can mishandle updates when there is no topic
  2013-09-14  0:32 bug#15377: 24.1; erc-mode-line-update-buffer can mishandle updates when there is no topic Vivek Dasmohapatra
@ 2013-09-14 23:33 ` Glenn Morris
  0 siblings, 0 replies; 2+ messages in thread
From: Glenn Morris @ 2013-09-14 23:33 UTC (permalink / raw)
  To: 15377-done

Version: 24.4

Thanks; applied.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-14 23:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-14  0:32 bug#15377: 24.1; erc-mode-line-update-buffer can mishandle updates when there is no topic Vivek Dasmohapatra
2013-09-14 23:33 ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).