aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/erc
diff options
context:
space:
mode:
authorStefan Monnier2014-09-30 19:19:31 -0400
committerStefan Monnier2014-09-30 19:19:31 -0400
commit07bec0fc67ee0b26685f0ec7f28d9b73f67bf3de (patch)
tree222adf06960f86aa8b2f560217d39c9fe39d3996 /lisp/erc
parent6aed001ad31d41f028d77e66e597b7b3ab4e31ae (diff)
parentd3b7a90bc2ad20192d1afd23eb1aa6a18ceda569 (diff)
downloademacs-07bec0fc67ee0b26685f0ec7f28d9b73f67bf3de.tar.gz
emacs-07bec0fc67ee0b26685f0ec7f28d9b73f67bf3de.zip
Merge from emacs-24
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/ChangeLog10
-rw-r--r--lisp/erc/erc-track.el79
2 files changed, 49 insertions, 40 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index b5dd3f2f359..1ea79dbbc1a 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,11 @@
12014-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * erc-track.el (erc-modified-channels-display): Update all mode lines
4 if needed (bug#18510). Remove call to erc-modified-channels-object
5 where we ignored the return value.
6 (erc-modified-channels-update): Don't force-mode-line-update here
7 any more.
8
12014-09-26 Kelvin White <kwhite@gnu.org> 92014-09-26 Kelvin White <kwhite@gnu.org>
2 10
3 * erc.el (erc-format-nick): Fix code regression - Bug #18551 11 * erc.el (erc-format-nick): Fix code regression - Bug #18551
@@ -12,7 +20,7 @@
12 (erc-cmd-SV, erc-ctcp-query-VERSION, erc-version, erc-version-string): 20 (erc-cmd-SV, erc-ctcp-query-VERSION, erc-version, erc-version-string):
13 Change version string. 21 Change version string.
14 22
152014-08-13 Kelvin White <kwhite@gnu.org> 232014-08-13 Kelvin White <kwhite@gnu.org>
16 24
17 * erc.el (erc-send-input): Disable display commands in current buffer 25 * erc.el (erc-send-input): Disable display commands in current buffer
18 (erc-format-target-and/or-network): Fix cases when buffer name is set 26 (erc-format-target-and/or-network): Fix cases when buffer name is set
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 3f7b6a7b501..706cce2fefe 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -767,8 +767,7 @@ ARGS are ignored."
767 (erc-modified-channels-remove-buffer buffer)))) 767 (erc-modified-channels-remove-buffer buffer))))
768 erc-modified-channels-alist) 768 erc-modified-channels-alist)
769 (when removed-channel 769 (when removed-channel
770 (erc-modified-channels-display) 770 (erc-modified-channels-display)))
771 (force-mode-line-update t)))
772 (remove-hook 'post-command-hook 'erc-modified-channels-update))) 771 (remove-hook 'post-command-hook 'erc-modified-channels-update)))
773 772
774(defvar erc-track-mouse-face (if (featurep 'xemacs) 773(defvar erc-track-mouse-face (if (featurep 'xemacs)
@@ -825,43 +824,45 @@ Use `erc-make-mode-line-buffer-name' to create buttons."
825 ((eq 'importance erc-track-switch-direction) 824 ((eq 'importance erc-track-switch-direction)
826 (erc-track-sort-by-importance))) 825 (erc-track-sort-by-importance)))
827 (run-hooks 'erc-track-list-changed-hook) 826 (run-hooks 'erc-track-list-changed-hook)
828 (unless (eq erc-track-position-in-mode-line nil) 827 (when erc-track-position-in-mode-line
829 (if (null erc-modified-channels-alist) 828 (let* ((oldobject erc-modified-channels-object)
830 (setq erc-modified-channels-object (erc-modified-channels-object nil)) 829 (strings
831 ;; erc-modified-channels-alist contains all the data we need. To 830 (when erc-modified-channels-alist
832 ;; better understand what is going on, we split things up into 831 ;; erc-modified-channels-alist contains all the data we need. To
833 ;; four lists: BUFFERS, COUNTS, SHORT-NAMES, and FACES. These 832 ;; better understand what is going on, we split things up into
834 ;; four lists we use to create a new 833 ;; four lists: BUFFERS, COUNTS, SHORT-NAMES, and FACES. These
835 ;; `erc-modified-channels-object' using 834 ;; four lists we use to create a new
836 ;; `erc-make-mode-line-buffer-name'. 835 ;; `erc-modified-channels-object' using
837 (let* ((buffers (mapcar 'car erc-modified-channels-alist)) 836 ;; `erc-make-mode-line-buffer-name'.
838 (counts (mapcar 'cadr erc-modified-channels-alist)) 837 (let* ((buffers (mapcar 'car erc-modified-channels-alist))
839 (faces (mapcar 'cddr erc-modified-channels-alist)) 838 (counts (mapcar 'cadr erc-modified-channels-alist))
840 (long-names (mapcar #'(lambda (buf) 839 (faces (mapcar 'cddr erc-modified-channels-alist))
841 (or (buffer-name buf) 840 (long-names (mapcar #'(lambda (buf)
842 "")) 841 (or (buffer-name buf)
843 buffers)) 842 ""))
844 (short-names (if (functionp erc-track-shorten-function) 843 buffers))
845 (funcall erc-track-shorten-function 844 (short-names (if (functionp erc-track-shorten-function)
846 long-names) 845 (funcall erc-track-shorten-function
847 long-names)) 846 long-names)
848 strings) 847 long-names))
849 (while buffers 848 strings)
850 (when (car short-names) 849 (while buffers
851 (setq strings (cons (erc-make-mode-line-buffer-name 850 (when (car short-names)
852 (car short-names) 851 (setq strings (cons (erc-make-mode-line-buffer-name
853 (car buffers) 852 (car short-names)
854 (car faces) 853 (car buffers)
855 (car counts)) 854 (car faces)
856 strings))) 855 (car counts))
857 (setq short-names (cdr short-names) 856 strings)))
858 buffers (cdr buffers) 857 (setq short-names (cdr short-names)
859 counts (cdr counts) 858 buffers (cdr buffers)
860 faces (cdr faces))) 859 counts (cdr counts)
861 (when (featurep 'xemacs) 860 faces (cdr faces)))
862 (erc-modified-channels-object nil)) 861 strings)))
863 (setq erc-modified-channels-object 862 (newobject (erc-modified-channels-object strings)))
864 (erc-modified-channels-object strings)))))) 863 (unless (equal oldobject newobject)
864 (setq erc-modified-channels-object newobject)
865 (force-mode-line-update t)))))
865 866
866(defun erc-modified-channels-remove-buffer (buffer) 867(defun erc-modified-channels-remove-buffer (buffer)
867 "Remove BUFFER from `erc-modified-channels-alist'." 868 "Remove BUFFER from `erc-modified-channels-alist'."