aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/erc/erc.el
diff options
context:
space:
mode:
authorMiles Bader2006-02-12 12:02:53 +0000
committerMiles Bader2006-02-12 12:02:53 +0000
commit9cc8d0b62e2f9cc8aa5754aafaf359fdfc28edef (patch)
treeffe234ff4943c026a8c304005aca02a42d96061c /lisp/erc/erc.el
parentf828c6fc00bac67e28840637346ddc47b5b6ee2d (diff)
downloademacs-9cc8d0b62e2f9cc8aa5754aafaf359fdfc28edef.tar.gz
emacs-9cc8d0b62e2f9cc8aa5754aafaf359fdfc28edef.zip
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-73
Creator: Michael Olson <mwolson@gnu.org> Merge from erc--emacs--0
Diffstat (limited to 'lisp/erc/erc.el')
-rw-r--r--lisp/erc/erc.el120
1 files changed, 66 insertions, 54 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 936fffa252f..d444ab2af0f 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1719,22 +1719,15 @@ all channel buffers on all servers."
1719(defun erc-migrate-modules (mods) 1719(defun erc-migrate-modules (mods)
1720 "Migrate old names of ERC modules to new ones." 1720 "Migrate old names of ERC modules to new ones."
1721 ;; modify `transforms' to specify what needs to be changed 1721 ;; modify `transforms' to specify what needs to be changed
1722 ;; each item is in the format '(new .old) 1722 ;; each item is in the format '(old . new)
1723 (let ((transforms '((pcomplete . completion))) 1723 (let ((transforms '((pcomplete . completion))))
1724 (modules (copy-alist mods))) 1724 (erc-delete-dups
1725 (dolist (transform transforms) 1725 (mapcar (lambda (m) (or (cdr (assoc m transforms)) m))
1726 (let ((addp nil)) 1726 mods))))
1727 (setq modules (erc-delete-if `(lambda (val) 1727
1728 (and (eq val ',(car transform)) 1728(defcustom erc-modules '(netsplit fill button match track completion readonly
1729 (setq addition t)))
1730 modules))
1731 (when addp
1732 (add-to-list 'modules (cdr transform)))))
1733 (erc-delete-dups modules)))
1734
1735(defcustom erc-modules '(netsplit fill button match track pcomplete readonly
1736 ring autojoin noncommands irccontrols 1729 ring autojoin noncommands irccontrols
1737 stamp) 1730 stamp list)
1738 "A list of modules which erc should enable. 1731 "A list of modules which erc should enable.
1739If you set the value of this without using `customize' remember to call 1732If you set the value of this without using `customize' remember to call
1740\(erc-update-modules) after you change it. When using `customize', modules 1733\(erc-update-modules) after you change it. When using `customize', modules
@@ -1755,40 +1748,42 @@ removed from the list will be disabled."
1755 ;; this test is for the case where erc hasn't been loaded yet 1748 ;; this test is for the case where erc hasn't been loaded yet
1756 (when (fboundp 'erc-update-modules) 1749 (when (fboundp 'erc-update-modules)
1757 (erc-update-modules))) 1750 (erc-update-modules)))
1758 :type '(set :greedy t 1751 :type
1759 (const :tag "Set away status automatically" autoaway) 1752 '(set
1760 (const :tag "Join channels automatically" autojoin) 1753 :greedy t
1761 (const :tag "Integrate with Big Brother Database" bbdb) 1754 (const :tag "Set away status automatically" autoaway)
1762 (const :tag "Buttonize URLs, nicknames, and other text" button) 1755 (const :tag "Join channels automatically" autojoin)
1763 (const :tag "Wrap long lines" fill) 1756 (const :tag "Integrate with Big Brother Database" bbdb)
1764 (const :tag "Highlight or remove IRC control characters" 1757 (const :tag "Buttonize URLs, nicknames, and other text" button)
1765 irccontrols) 1758 (const :tag "Wrap long lines" fill)
1766 (const :tag "Save buffers in logs" log) 1759 (const :tag "Highlight or remove IRC control characters"
1767 (const :tag "Highlight pals, fools, and other keywords" match) 1760 irccontrols)
1768 (const :tag "Detect netsplits" netsplit) 1761 (const :tag "Save buffers in logs" log)
1769 (const :tag "Don't display non-IRC commands after evaluation" 1762 (const :tag "Highlight pals, fools, and other keywords" match)
1770 noncommands) 1763 (const :tag "Detect netsplits" netsplit)
1771 (const :tag 1764 (const :tag "Don't display non-IRC commands after evaluation"
1772 "Notify when the online status of certain users changes" 1765 noncommands)
1773 notify) 1766 (const :tag
1774 (const :tag "Complete nicknames and commands (programmable)" 1767 "Notify when the online status of certain users changes"
1775 completion) 1768 notify)
1776 (const :tag "Complete nicknames and commands (old)" hecomplete) 1769 (const :tag "Complete nicknames and commands (programmable)"
1777 (const :tag "Make displayed lines read-only" readonly) 1770 completion)
1778 (const :tag "Replace text in messages" replace) 1771 (const :tag "Complete nicknames and commands (old)" hecomplete)
1779 (const :tag "Enable an input history" ring) 1772 (const :tag "Make displayed lines read-only" readonly)
1780 (const :tag "Scroll to the bottom of the buffer" scrolltobottom) 1773 (const :tag "Replace text in messages" replace)
1781 (const :tag "Identify to Nickserv (IRC Services) automatically" 1774 (const :tag "Enable an input history" ring)
1782 services) 1775 (const :tag "Scroll to the bottom of the buffer" scrolltobottom)
1783 (const :tag "Convert smileys to pretty icons" smiley) 1776 (const :tag "Identify to Nickserv (IRC Services) automatically"
1784 (const :tag "Play sounds when you receive CTCP SOUND requests" 1777 services)
1785 sound) 1778 (const :tag "Convert smileys to pretty icons" smiley)
1786 (const :tag "Add timestamps to messages" stamp) 1779 (const :tag "Play sounds when you receive CTCP SOUND requests"
1787 (const :tag "Check spelling" spelling) 1780 sound)
1788 (const :tag "Track channel activity in the mode-line" track) 1781 (const :tag "Add timestamps to messages" stamp)
1789 (const :tag "Truncate buffers to a certain size" truncate) 1782 (const :tag "Check spelling" spelling)
1790 (const :tag "Translate morse code in messages" unmorse) 1783 (const :tag "Track channel activity in the mode-line" track)
1791 (repeat :tag "Others" :inline t symbol)) 1784 (const :tag "Truncate buffers to a certain size" truncate)
1785 (const :tag "Translate morse code in messages" unmorse)
1786 (repeat :tag "Others" :inline t symbol))
1792 :group 'erc) 1787 :group 'erc)
1793 1788
1794(defun erc-update-modules () 1789(defun erc-update-modules ()
@@ -1799,14 +1794,11 @@ removed from the list will be disabled."
1799 (cond 1794 (cond
1800 ;; yuck. perhaps we should bring the filenames into sync? 1795 ;; yuck. perhaps we should bring the filenames into sync?
1801 ((string= req "erc-completion") 1796 ((string= req "erc-completion")
1802 (setq req "erc-pcomplete") 1797 (setq req "erc-pcomplete"))
1803 (setq mod 'completion))
1804 ((string= req "erc-pcomplete") 1798 ((string= req "erc-pcomplete")
1805 (setq req "erc-pcomplete")
1806 (setq mod 'completion)) 1799 (setq mod 'completion))
1807 ((string= req "erc-autojoin") 1800 ((string= req "erc-autojoin")
1808 (setq req "erc-join") 1801 (setq req "erc-join")))
1809 (setq mod 'autojoin)))
1810 (condition-case nil 1802 (condition-case nil
1811 (require (intern req)) 1803 (require (intern req))
1812 (error nil)) 1804 (error nil))
@@ -6143,6 +6135,26 @@ This function should be on `erc-kill-channel-hook'."
6143 (funcall erc-part-reason nil)) 6135 (funcall erc-part-reason nil))
6144 nil tgt)))) 6136 nil tgt))))
6145 6137
6138;;; Dealing with `erc-parsed'
6139
6140(defun erc-get-parsed-vector (point)
6141 "Return the whole parsed vector on POINT."
6142 (get-text-property point 'erc-parsed))
6143
6144(defun erc-get-parsed-vector-nick (vect)
6145 "Return nickname in the parsed vector VECT."
6146 (let* ((untreated-nick (and vect (erc-response.sender vect)))
6147 (maybe-nick (when untreated-nick
6148 (car (split-string untreated-nick "!")))))
6149 (when (and (not (null maybe-nick))
6150 (erc-is-valid-nick-p maybe-nick))
6151 untreated-nick)))
6152
6153(defun erc-get-parsed-vector-type (vect)
6154 "Return message type in the parsed vector VECT."
6155 (and vect
6156 (erc-response.command vect)))
6157
6146(provide 'erc) 6158(provide 'erc)
6147 6159
6148;;; Deprecated. We might eventually stop requiring the goodies automatically. 6160;;; Deprecated. We might eventually stop requiring the goodies automatically.