erc-commit
[Top][All Lists]
Advanced

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

[Erc-commit] [commit][master] Make setting topic work after running /LIS


From: mwolson
Subject: [Erc-commit] [commit][master] Make setting topic work after running /LIST.
Date: Thu, 10 Jan 2008 03:40:04 -0500

commit b634481a85c784685529084740b1e96a2ada7ecd
Author: Michael W. Olson <address@hidden>
Date:   Thu Jan 10 03:31:31 2008 -0500

    Make setting topic work after running /LIST.

diff --git a/ChangeLog b/ChangeLog
index 19b2d10..07c0d74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,8 @@
        * erc-list-old.el: Renamed from old erc-list.el.
 
        * erc.el (erc-modules): Add list-old.
+       (erc-set-topic): Handle case where there are no newlines in the
+       existing topic, which happens when /LIST is run.
 
 2008-01-04  Stefan Monnier  <address@hidden>
 
diff --git a/erc.el b/erc.el
index 4b98b68..6bc7d76 100644
--- a/erc.el
+++ b/erc.el
@@ -3701,8 +3701,9 @@ If `point' is at the beginning of a channel name, use 
that as default."
     (read-from-minibuffer
      (concat "Set topic of " (erc-default-target) ": ")
      (when erc-channel-topic
-       (cons (apply 'concat (butlast (split-string erc-channel-topic "\C-o")))
-            0)))))
+       (let ((ss (split-string erc-channel-topic "\C-o")))
+        (cons (apply 'concat (if (cdr ss) (butlast ss) ss))
+              0))))))
   (let ((topic-list (split-string topic "\C-o"))) ; strip off the topic setter
     (erc-cmd-TOPIC (concat (erc-default-target) " " (car topic-list)))))
 




reply via email to

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