((remove-hook 'erc-insert-modify-hook 'erc-button-add-buttons)
(remove-hook 'erc-send-modify-hook 'erc-button-add-buttons)
(remove-hook 'erc-complete-functions 'erc-button-next-function)
- (remove-hook 'erc-mode-hook 'erc-button-setup)
- (when (featurep 'xemacs)
- (dolist (buffer (erc-buffer-list))
- (with-current-buffer buffer
- (kill-local-variable 'widget-button-face))))))
+ (remove-hook 'erc-mode-hook 'erc-button-setup)))
;;; Variables
(defvar erc-button-keymap
(let ((map (make-sparse-keymap)))
(define-key map (kbd "RET") 'erc-button-press-button)
- (if (featurep 'xemacs)
- (define-key map (kbd "<button2>") 'erc-button-click-button)
- (define-key map (kbd "<mouse-2>") 'erc-button-click-button))
+ (define-key map (kbd "<mouse-2>") 'erc-button-click-button)
(define-key map (kbd "TAB") 'erc-button-next)
(define-key map (kbd "<backtab>") 'erc-button-previous)
(define-key map [follow-link] 'mouse-face)
(defun erc-button-setup ()
"Add ERC mode-level button movement keys. This is only done once."
;; Make XEmacs use `erc-button-face'.
- (when (featurep 'xemacs)
- (set (make-local-variable 'widget-button-face) nil))
;; Add keys.
(unless erc-button-keys-added
(define-key erc-mode-map (kbd "<backtab>") 'erc-button-previous)
(list 'erc-callback fun)
(list 'keymap erc-button-keymap)
(list 'rear-nonsticky t)
- (and data (list 'erc-data data))))
- (when (featurep 'xemacs)
- (widget-convert-button 'link from to :action 'erc-button-press-button
- :suppress-face t
- ;; Make XEmacs use our faces.
- :button-face (if nick-p
- erc-button-nickname-face
- erc-button-face)
- ;; Make XEmacs behave with mouse-clicks, for
- ;; some reason, widget stuff overrides the
- ;; 'keymap text-property.
- :mouse-down-action 'erc-button-click-button)))
+ (and data (list 'erc-data data)))))
(defun erc-button-add-face (from to face)
"Add FACE to the region between FROM and TO."
are placed.
Note that this should end with a directory separator.")
-;; XEmacs's `replace-match' does not replace matching subexpressions in strings.
(defun erc-replace-match-subexpression-in-string
(newtext string match subexp start &optional fixedcase literal)
"Replace the subexpression SUBEXP of the last match in STRING with NEWTEXT.
MATCH is the text which matched the subexpression (see `match-string').
START is the beginning position of the last match (see `match-beginning').
See `replace-match' for explanations of FIXEDCASE and LITERAL."
- (cond ((featurep 'xemacs)
- (string-match match string start)
- (replace-match newtext fixedcase literal string))
- (t (replace-match newtext fixedcase literal string subexp))))
+ (replace-match newtext fixedcase literal string subexp))
(defalias 'erc-with-selected-window 'with-selected-window)
(defalias 'erc-cancel-timer 'cancel-timer)
:group 'erc-log
:type 'boolean)
-(defcustom erc-log-file-coding-system (if (featurep 'xemacs)
- 'binary
- 'emacs-mule)
+(defcustom erc-log-file-coding-system 'emacs-mule
"The coding system ERC should use for writing log files.
This should ideally, be a \"catch-all\" coding system, like
;; activates it immediately
(easy-menu-define erc-menu erc-mode-map "ERC menu" erc-menu-definition)
(setq erc-menu-defined t))
- (if (featurep 'xemacs)
- (progn
- ;; the menu isn't automatically added to the menu bar in
- ;; XEmacs
- (add-hook 'erc-mode-hook 'erc-menu-add)
- (dolist (buffer (erc-buffer-list))
- (with-current-buffer buffer (erc-menu-add))))
- (erc-menu-add)))
- ((if (featurep 'xemacs)
- (progn
- (remove-hook 'erc-mode-hook 'erc-menu-add)
- (dolist (buffer (erc-buffer-list))
- (with-current-buffer buffer (erc-menu-remove))))
- (erc-menu-remove)
- ;; `easy-menu-remove' is a no-op in Emacs 22
- (message "You might have to restart Emacs to remove the ERC menu"))))
+ (erc-menu-add))
+ ((erc-menu-remove)
+ ;; `easy-menu-remove' is a no-op in Emacs 22
+ (message "You might have to restart Emacs to remove the ERC menu")))
;; silence byte-compiler warning
(defvar erc-menu)
(integer :tag "Column number")
(const :tag "Unspecified" nil)))
-(defcustom erc-timestamp-use-align-to (and (not (featurep 'xemacs))
- (>= emacs-major-version 22)
- (eq window-system 'x))
+(defcustom erc-timestamp-use-align-to (eq window-system 'x)
"If non-nil, use the :align-to display property to align the stamp.
This gives better results when variable-width characters (like
Asian language characters and math symbols) precede a timestamp.
-Unfortunately, it only works in Emacs 22 and when using the X
-Window System.
A side effect of enabling this is that there will only be one
space before a right timestamp in any saved logs."
(defun erc-modified-channels-object (strings)
"Generate a new `erc-modified-channels-object' based on STRINGS."
(if strings
- (if (featurep 'xemacs)
- (let ((e-m-c-s '("[")))
- (push (cons (extent-at 0 (car strings)) (car strings))
- e-m-c-s)
- (dolist (string (cdr strings))
- (push "," e-m-c-s)
- (push (cons (extent-at 0 string) string)
- e-m-c-s))
- (push "] " e-m-c-s)
- (reverse e-m-c-s))
- (concat (if (eq erc-track-position-in-mode-line 'after-modes)
- "[" " [")
- (mapconcat 'identity (nreverse strings) ",")
- (if (eq erc-track-position-in-mode-line 'before-modes)
- "] " "]")))
- (if (featurep 'xemacs) '() "")))
+ (concat (if (eq erc-track-position-in-mode-line 'after-modes)
+ "[" " [")
+ (mapconcat 'identity (nreverse strings) ",")
+ (if (eq erc-track-position-in-mode-line 'before-modes)
+ "] " "]"))
+ ""))
(defvar erc-modified-channels-object (erc-modified-channels-object nil)
"Internal object used for displaying modified channels in the mode line.")
((when (boundp 'erc-track-when-inactive)
(if erc-track-when-inactive
(progn
- (if (featurep 'xemacs)
- (defadvice switch-to-buffer (after erc-update-when-inactive
- (&rest args) activate)
- (erc-user-is-active))
- (add-hook 'window-configuration-change-hook 'erc-user-is-active))
+ (add-hook 'window-configuration-change-hook 'erc-user-is-active)
(add-hook 'erc-send-completed-hook 'erc-user-is-active)
(add-hook 'erc-server-001-functions 'erc-user-is-active))
(erc-track-add-to-mode-line erc-track-position-in-mode-line)
(erc-update-mode-line)
- (if (featurep 'xemacs)
- (defadvice switch-to-buffer (after erc-update (&rest args) activate)
- (erc-modified-channels-update))
- (add-hook 'window-configuration-change-hook
- 'erc-window-configuration-change))
+ (add-hook 'window-configuration-change-hook
+ 'erc-window-configuration-change)
(add-hook 'erc-insert-post-hook 'erc-track-modified-channels)
(add-hook 'erc-disconnected-hook 'erc-modified-channels-update))
;; enable the tracking keybindings
(erc-track-remove-from-mode-line)
(if erc-track-when-inactive
(progn
- (if (featurep 'xemacs)
- (ad-disable-advice 'switch-to-buffer 'after
- 'erc-update-when-inactive)
- (remove-hook 'window-configuration-change-hook
- 'erc-user-is-active))
+ (remove-hook 'window-configuration-change-hook
+ 'erc-user-is-active)
(remove-hook 'erc-send-completed-hook 'erc-user-is-active)
(remove-hook 'erc-server-001-functions 'erc-user-is-active)
(remove-hook 'erc-timer-hook 'erc-user-is-active))
- (if (featurep 'xemacs)
- (ad-disable-advice 'switch-to-buffer 'after 'erc-update)
- (remove-hook 'window-configuration-change-hook
- 'erc-window-configuration-change))
+ (remove-hook 'window-configuration-change-hook
+ 'erc-window-configuration-change)
(remove-hook 'erc-disconnected-hook 'erc-modified-channels-update)
(remove-hook 'erc-insert-post-hook 'erc-track-modified-channels))
;; disable the tracking keybindings
(when removed-channel
(erc-modified-channels-display)))))
-(defvar erc-track-mouse-face (if (featurep 'xemacs)
- 'modeline-mousable
- 'mode-line-highlight)
+(defvar erc-track-mouse-face 'mode-line-highlight
"The face to use when mouse is over channel names in the mode line.")
(defun erc-make-mode-line-buffer-name (string buffer &optional faces count)
((null (car elt)) ; (nil PROPERTY VALUE BEG . END)
(let ((cons (nthcdr 3 elt)))
(cl-incf (car cons) shift)
- (cl-incf (cdr cons) shift)))
- ((and (featurep 'xemacs)
- (extentp (car elt))) ; (EXTENT START END)
- (cl-incf (nth 1 elt) shift)
- (cl-incf (nth 2 elt) shift)))
+ (cl-incf (cdr cons) shift))))
(setq list (cdr list))))))
(defvar erc-valid-nick-regexp "[]a-zA-Z^[;\\`_{}|][]^[;\\`_{}|a-zA-Z0-9-]*"
(defun erc-quit-reason-various (s)
"Choose a quit reason based on S (a string)."
- (when (featurep 'xemacs) (require 'poe))
(let ((res (car (assoc-default (or s "")
erc-quit-reason-various-alist 'string-match))))
(cond
(defun erc-part-reason-various (s)
"Choose a part reason based on S (a string)."
- (when (featurep 'xemacs) (require 'poe))
(let ((res (car (assoc-default (or s "")
erc-part-reason-various-alist 'string-match))))
(cond
(defun erc-cmd-SV ()
"Say the current ERC and Emacs version into channel."
- (erc-send-message (format "I'm using ERC with %s %s (%s%s)%s."
- (if (featurep 'xemacs) "XEmacs" "GNU Emacs")
+ (erc-send-message (format "I'm using ERC with GNU Emacs %s (%s%s)%s."
emacs-version
system-configuration
(concat
(let ((minibuffer-allow-text-properties t)
(read-map minibuffer-local-map))
(insert (read-from-minibuffer "Message: "
- (string (if (featurep 'xemacs)
- last-command-char
- last-command-event))
+ (string last-command-event)
read-map))
(erc-send-current-line)))
If \"k\" is pressed, `erc-set-channel-key' gets called.
Anything else will be sent to `erc-toggle-channel-mode'."
(interactive "kChannel mode (RET to set more than one): ")
- (when (featurep 'xemacs)
- (setq key (char-to-string (event-to-character (aref key 0)))))
(cond ((equal key "\C-g")
(keyboard-quit))
((equal key "\C-m")
(funcall erc-header-line-face-method))
(t
'erc-header-line))))
- (cond ((featurep 'xemacs)
- (setq modeline-buffer-identification
- (list (format-spec erc-mode-line-format spec)))
- (setq modeline-process (list process-status)))
- (t
- (setq mode-line-buffer-identification
- (list (format-spec erc-mode-line-format spec)))
- (setq mode-line-process (list process-status))))
+ (setq mode-line-buffer-identification
+ (list (format-spec erc-mode-line-format spec)))
+ (setq mode-line-process (list process-status))
(when (boundp 'header-line-format)
(let ((header (if erc-header-line-format
(format-spec erc-header-line-format spec)
(if face
(erc-propertize header 'face face)
header)))))))
- (if (featurep 'xemacs)
- (redraw-modeline)
- (force-mode-line-update))))
+ (force-mode-line-update)))
(defun erc-update-mode-line (&optional buffer)
"Update the mode line in BUFFER.