aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/erc/erc-menu.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc/erc-menu.el')
-rw-r--r--lisp/erc/erc-menu.el121
1 files changed, 121 insertions, 0 deletions
diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el
new file mode 100644
index 00000000000..8e1f81adf75
--- /dev/null
+++ b/lisp/erc/erc-menu.el
@@ -0,0 +1,121 @@
1;; erc-menu.el -- Menu-bar definitions for ERC
2
3;; Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
4
5;; Author: Mario Lang <mlang@delysid.org>
6;; Keywords: comm, processes, menu
7;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcMenu
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software; you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation; either version 2, or (at your option)
14;; any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24;; Boston, MA 02110-1301, USA.
25
26;;; Commentary:
27
28;; Loading this file defines a menu for ERC.
29
30;;; Code:
31
32(require 'easymenu)
33
34(defvar erc-menu-definition
35 (list "IRC"
36 ["Connect to server..." erc-select t]
37 ["Disconnect from server..." erc-quit-server erc-server-connected]
38 "-"
39 ["List channels..." erc-cmd-LIST
40 (and erc-server-connected (fboundp 'erc-cmd-LIST))]
41 ["Join channel..." erc-join-channel erc-server-connected]
42 ["Start a query..." erc-cmd-QUERY erc-server-connected]
43 "-"
44 ["List users in channel" erc-channel-names erc-channel-users]
45 ["List channel operators" erc-cmd-OPS erc-channel-users]
46 ["Input action..." erc-input-action (erc-default-target)]
47 ["Set topic..." erc-set-topic
48 (and (and (erc-default-target) (not (erc-query-buffer-p)))
49 (or (not (member "t" erc-channel-modes))
50 (erc-channel-user-op-p (erc-current-nick))))]
51 (list "Channel modes"
52 ["Change mode..." erc-insert-mode-command
53 (erc-channel-user-op-p (erc-current-nick))]
54 ["No external send" (erc-toggle-channel-mode "n")
55 :active (erc-channel-user-op-p (erc-current-nick))
56 :style toggle :selected (member "n" erc-channel-modes)]
57 ["Topic set by channel operator" (erc-toggle-channel-mode "t")
58 :style toggle :selected (member "t" erc-channel-modes)
59 :active (erc-channel-user-op-p (erc-current-nick))]
60 ["Invite only" (erc-toggle-channel-mode "i")
61 :style toggle :selected (member "i" erc-channel-modes)
62 :active (erc-channel-user-op-p (erc-current-nick))]
63 ["Private" (erc-toggle-channel-mode "p")
64 :style toggle :selected (member "p" erc-channel-modes)
65 :active (erc-channel-user-op-p (erc-current-nick))]
66 ["Secret" (erc-toggle-channel-mode "s")
67 :style toggle :selected (member "s" erc-channel-modes)
68 :active (erc-channel-user-op-p (erc-current-nick))]
69 ["Moderated" (erc-toggle-channel-mode "m")
70 :style toggle :selected (member "m" erc-channel-modes)
71 :active (erc-channel-user-op-p (erc-current-nick))]
72 ["Set a limit..." erc-set-channel-limit
73 (erc-channel-user-op-p (erc-current-nick))]
74 ["Set a key..." erc-set-channel-key
75 (erc-channel-user-op-p (erc-current-nick))])
76 ["Leave this channel..." erc-part-from-channel erc-channel-users]
77 "-"
78 (list "Pals, fools and other keywords"
79 ["Add pal..." erc-add-pal]
80 ["Delete pal..." erc-delete-pal]
81 ["Add fool..." erc-add-fool]
82 ["Delete fool..." erc-delete-fool]
83 ["Add keyword..." erc-add-keyword]
84 ["Delete keyword..." erc-delete-keyword]
85 ["Add dangerous host..." erc-add-dangerous-host]
86 ["Delete dangerous host..." erc-delete-dangerous-host])
87 "-"
88 (list "IRC services"
89 ["Identify to NickServ..." erc-nickserv-identify
90 (and erc-server-connected (functionp 'erc-nickserv-identify))])
91 "-"
92 ["Save buffer in log" erc-save-buffer-in-logs
93 (fboundp 'erc-save-buffer-in-logs)]
94 ["Truncate buffer" erc-truncate-buffer (fboundp 'erc-truncate-buffer)]
95 "-"
96 ["Customize ERC" (customize-group 'erc) t]
97 ["Enable/Disable ERC Modules" (customize-variable 'erc-modules) t]
98 ["Show ERC version" erc-version t])
99 "ERC menu definition.")
100
101;; `erc-mode-map' must be defined before doing this
102(eval-after-load "erc"
103 '(progn
104 (easy-menu-define erc-menu erc-mode-map "ERC menu" erc-menu-definition)
105 (easy-menu-add erc-menu erc-mode-map)
106
107 ;; for some reason the menu isn't automatically added to the menu bar
108 (when (featurep 'xemacs)
109 (add-hook 'erc-mode-hook
110 (lambda () (easy-menu-add erc-menu erc-mode-map))))))
111
112(provide 'erc-menu)
113
114;;; erc-menu.el ends here
115;;
116;; Local Variables:
117;; indent-tabs-mode: t
118;; tab-width: 8
119;; End:
120
121;; arch-tag: 671219f2-b082-4753-a185-1d0c7e0c05bd