annotate lisp/erc/erc-ibuffer.el @ 99537:f04ecf72fb00

*** empty log message ***
author Jay Belanger <jay.p.belanger@gmail.com>
date Fri, 14 Nov 2008 05:32:46 +0000
parents b52fd6b0e051
children a9dc0e7c3f2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
1 ;;; erc-ibuffer.el --- ibuffer integration with ERC
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
2
95614
b52fd6b0e051 Remove unnecessary eval-when-compiles.
Glenn Morris <rgm@gnu.org>
parents: 94660
diff changeset
3 ;; Copyright (C) 2002, 2004, 2006, 2007, 2008
b52fd6b0e051 Remove unnecessary eval-when-compiles.
Glenn Morris <rgm@gnu.org>
parents: 94660
diff changeset
4 ;; Free Software Foundation, Inc.
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
5
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
6 ;; Author: Mario Lang <mlang@delysid.org>
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
7 ;; Keywords: comm
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
8 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcIbuffer
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
9
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
11
94660
2a734255bcc7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87567
diff changeset
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
94660
2a734255bcc7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87567
diff changeset
14 ;; the Free Software Foundation, either version 3 of the License, or
2a734255bcc7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87567
diff changeset
15 ;; (at your option) any later version.
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
16
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
21
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
94660
2a734255bcc7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87567
diff changeset
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
24
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
26
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
27 ;; This file contains code related to Ibuffer and ERC. Totally alpha,
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
28 ;; needs work. Usage: Type / C-e C-h when in Ibuffer-mode to see new
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
29 ;; limiting commands
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
30
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
31 ;;; Code:
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
32
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
33 (require 'ibuffer)
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
34 (require 'ibuf-ext)
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
35 (require 'erc)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
36
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
37 (defgroup erc-ibuffer nil
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
38 "The Ibuffer group for ERC."
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
39 :group 'erc)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
40
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
41 (defcustom erc-ibuffer-keyword-char ?k
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
42 "Char used to indicate a channel which had keyword traffic lately (hidden)."
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
43 :group 'erc-ibuffer
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
44 :type 'character)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
45 (defcustom erc-ibuffer-pal-char ?p
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
46 "Char used to indicate a channel which had pal traffic lately (hidden)."
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
47 :group 'erc-ibuffer
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
48 :type 'character)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
49 (defcustom erc-ibuffer-fool-char ?f
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
50 "Char used to indicate a channel which had fool traffic lately (hidden)."
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
51 :group 'erc-ibuffer
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
52 :type 'character)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
53 (defcustom erc-ibuffer-dangerous-host-char ?d
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
54 "Char used to indicate a channel which had dangerous-host traffic lately
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
55 \(hidden)."
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
56 :group 'erc-ibuffer
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
57 :type 'character)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
58
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
59 (define-ibuffer-filter erc-server
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
60 "Toggle current view to buffers which are related to ERC servers."
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
61 (:description "erc servers"
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
62 :reader
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
63 (let ((regexp
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
64 (read-from-minibuffer "Limit by server (regexp) (RET for all): ")))
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
65 (if (string= regexp "")
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
66 ".*"
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
67 regexp)))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
68 (with-current-buffer buf
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
69 (and (eq major-mode 'erc-mode)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
70 (string-match qualifier (or erc-server-announced-name
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
71 erc-session-server)))))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
72
85743
763be5e829a7 Sync from upstream ERC
Michael Olson <mwolson@gnu.org>
parents: 85650
diff changeset
73 ;; Silence the byte-compiler
95614
b52fd6b0e051 Remove unnecessary eval-when-compiles.
Glenn Morris <rgm@gnu.org>
parents: 94660
diff changeset
74 (defvar erc-modified-channels-alist)
85650
437a25964d35 * emulation/edt-mapper.el (edt-emacs-variant): Replace the only
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78219
diff changeset
75
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
76 (define-ibuffer-column erc-modified (:name "M")
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
77 (if (and (boundp 'erc-track-mode)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
78 erc-track-mode)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
79 (let ((entry (assq (current-buffer) erc-modified-channels-alist)))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
80 (if entry
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
81 (if (> (length entry) 1)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
82 (cond ((eq 'pal (nth 1 entry))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
83 (string erc-ibuffer-pal-char))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
84 ((eq 'fool (nth 1 entry))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
85 (string erc-ibuffer-fool-char))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
86 ((eq 'keyword (nth 1 entry))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
87 (string erc-ibuffer-keyword-char))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
88 ((eq 'dangerous-host (nth 1 entry))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
89 (string erc-ibuffer-dangerous-host-char))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
90 (t "$"))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
91 (string ibuffer-modified-char))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
92 " "))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
93 " "))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
94
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
95 (define-ibuffer-column erc-server-name (:name "Server")
74093
bc5d69739d5e Merge from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
96 (if (and erc-server-process (processp erc-server-process))
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
97 (with-current-buffer (process-buffer erc-server-process)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
98 (or erc-server-announced-name erc-session-server))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
99 ""))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
100
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
101 (define-ibuffer-column erc-target (:name "Target")
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
102 (if (eq major-mode 'erc-mode)
74093
bc5d69739d5e Merge from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
103 (cond ((and erc-server-process (processp erc-server-process)
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
104 (eq (current-buffer) (process-buffer erc-server-process)))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
105 (concat "Server " erc-session-server ":"
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
106 (erc-port-to-string erc-session-port)))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
107 ((erc-channel-p (erc-default-target))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
108 (concat (erc-default-target)))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
109 ((erc-default-target)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
110 (concat "Query: " (erc-default-target)))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
111 (t "(parted)"))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
112 (buffer-name)))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
113
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
114 (define-ibuffer-column erc-topic (:name "Topic")
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
115 (if (and (eq major-mode 'erc-mode)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
116 erc-channel-topic)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
117 (erc-controls-interpret erc-channel-topic)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
118 ""))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
119
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
120 (define-ibuffer-column
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
121 erc-members (:name "Users")
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
122 (if (and (eq major-mode 'erc-mode)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
123 (boundp 'erc-channel-users)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
124 (hash-table-p erc-channel-users)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
125 (> (hash-table-size erc-channel-users) 0))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
126 (number-to-string (hash-table-size erc-channel-users))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
127 ""))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
128
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
129 (define-ibuffer-column erc-away (:name "A")
74093
bc5d69739d5e Merge from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
130 (if (and erc-server-process
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
131 (processp erc-server-process)
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
132 (erc-away-time))
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
133 "A"
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
134 " "))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
135
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
136 (define-ibuffer-column
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
137 erc-op (:name "O")
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
138 (if (and (eq major-mode 'erc-mode)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
139 (erc-channel-user-op-p (erc-current-nick)))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
140 "@"
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
141 " "))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
142
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
143 (define-ibuffer-column erc-voice (:name "V")
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
144 (if (and (eq major-mode 'erc-mode)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
145 (erc-channel-user-voice-p (erc-current-nick)))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
146 "+"
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
147 " "))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
148
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
149 (define-ibuffer-column erc-channel-modes (:name "Mode")
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
150 (if (and (eq major-mode 'erc-mode)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
151 (or (> (length erc-channel-modes) 0)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
152 erc-channel-user-limit))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
153 (concat (apply 'concat
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
154 "(+" erc-channel-modes)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
155 (if erc-channel-user-limit
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
156 (format "l %d" erc-channel-user-limit)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
157 "")
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
158 ")")
87567
4c3c683cdff8 * erc-ibuffer.el (erc-channel-modes):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85743
diff changeset
159 (if (not (derived-mode-p 'erc-mode))
4c3c683cdff8 * erc-ibuffer.el (erc-channel-modes):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85743
diff changeset
160 (format-mode-line mode-name nil nil (current-buffer))
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
161 "")))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
162
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
163 (define-ibuffer-column erc-nick (:name "Nick")
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
164 (if (eq major-mode 'erc-mode)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
165 (erc-current-nick)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
166 ""))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
167
68471
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
168 (defvar erc-ibuffer-formats
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
169 '((mark erc-modified erc-away erc-op erc-voice " " (erc-nick 8 8) " "
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
170 (erc-target 18 40) (erc-members 5 5 :center)
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
171 (erc-channel-modes 6 16 :center) " " (erc-server-name 20 30) " "
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
172 (erc-topic 10 -1))
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
173 (mark erc-modified erc-away erc-op erc-voice " " (erc-target 18 40)
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
174 (erc-members 5 5 :center) (erc-channel-modes 9 20 :center) " "
87ff4350c1ce Revision: emacs@sv.gnu.org/emacs--devo--0--patch-24
Miles Bader <miles@gnu.org>
parents: 68451
diff changeset
175 (erc-topic 10 -1))))
68451
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
176 (setq ibuffer-formats (append ibuffer-formats erc-ibuffer-formats))
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
177
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
178 (defvar erc-ibuffer-limit-map nil
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
179 "Prefix keymap to use for ERC related limiting.")
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
180 (define-prefix-command 'erc-ibuffer-limit-map)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
181 (define-key 'erc-ibuffer-limit-map (kbd "s") 'ibuffer-limit-by-erc-server)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
182 (define-key ibuffer-mode-map (kbd "/ \C-e") 'erc-ibuffer-limit-map)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
183
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
184 (provide 'erc-ibuffer)
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
185
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
186 ;;; erc-ibuffer.el ends here
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
187 ;;
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
188 ;; Local Variables:
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
189 ;; indent-tabs-mode: t
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
190 ;; tab-width: 8
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
191 ;; End:
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
192
fc745b05e928 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-22
Miles Bader <miles@gnu.org>
parents:
diff changeset
193 ;; arch-tag: fbad56a5-8595-45e0-a8c8-d8bb91e26944