riece-copy-case-table to define.
* riece-xemacs.el (riece-set-case-syntax-pair): Workaround for
XEmacs 21.1.
(riece-copy-case-table): Ditto.
* riece-emacs.el (riece-copy-case-table): New alias.
* riece-globals.el (riece-channel-regexp): Use
riece-make-interval-regexp to define.
(riece-user-regexp): Ditto.
* riece-compat.el (riece-make-interval-regexp): New function.
(setq riece-read-passwd 'ange-ftp-read-passwd))))
(funcall riece-read-passwd prompt))
+(if (string-match "0\\{0\\}" "")
+ (defun riece-make-interval-regexp (regexp min &optional max)
+ (if max
+ (concat regexp (format "\\{%d,%d\\}" min max))
+ (concat regexp (format "\\{%d\\}" min))))
+ ;; Emacs 20.7 doesn't support \{...\} in regexps.
+ (defun riece-make-interval-regexp (regexp min &optional max)
+ (mapconcat #'identity
+ (nconc (make-list min regexp)
+ (if max
+ (make-list (- max min) (concat regexp "?"))))
+ "")))
+
(provide 'riece-compat)
;;; riece-compat.el ends here
(defalias 'riece-set-case-syntax-pair
'set-case-syntax-pair)
+(defalias 'riece-copy-case-table
+ 'copy-case-table)
+
;;; stolen (and renamed) from gnus-ems.el.
;;; In GNU Emacs, user can intercept whole mouse tracking events by
;;; assigning [mouse-X]. In XEmacs, however, which causes different
;;; Code:
+(require 'riece-compat) ;riece-make-interval-regexp
+
;;; Constants:
(defconst riece-channel-regexp
- "\\([+&#]\\|![A-Z0-9]\\{5\\}\\|!!\\)[^\0\7\r\n ,:]*\\(:[^\0\7\r\n ,:]*\\)?")
+ (concat "\\([+&#]\\|!"
+ (riece-make-interval-regexp "[A-Z0-9]" 5)
+ "\\|!!\\)[^\0\7\r\n ,:]*\\(:[^\0\7\r\n ,:]*\\)?"))
+
(defconst riece-user-regexp
- "[][\\\\`_^{|}A-Za-z][][\\\\`_^{|}A-Za-z0-9-]\\{0,8\\}")
+ (concat "[][\\\\`_^{|}A-Za-z]"
+ (riece-make-interval-regexp "[][\\\\`_^{|}A-Za-z0-9-]" 0 8)))
;;; Global variables:
(defvar riece-server-process-alist nil
(defvar riece-expand-identity-string-function nil)
(defvar riece-identity-prefix-case-table
- (let ((table (copy-case-table (standard-case-table))))
+ (let ((table (riece-copy-case-table (standard-case-table))))
(riece-set-case-syntax-pair ?\[ ?{ table)
(riece-set-case-syntax-pair ?\] ?} table)
(riece-set-case-syntax-pair ?\\ ?| table)
(defalias 'riece-simplify-mode-line-format
'riece-xemacs-simplify-modeline-format)
-(defalias 'riece-set-case-syntax-pair
- 'put-case-table-pair)
+(if (fboundp 'put-case-table-pair)
+ (defalias 'riece-set-case-syntax-pair
+ 'put-case-table-pair)
+ ;; In XEmacs 21.1, case-table is a list of strings.
+ (defun riece-set-case-syntax-pair (uc lc case-table)
+ (aset (car case-table) (char-to-int uc) lc)
+ (if (nth 1 case-table)
+ (aset (nth 1 case-table) (char-to-int lc) uc))
+ (if (nth 2 case-table)
+ (aset (nth 2 case-table) (char-to-int uc) lc))))
+
+(if (fboundp 'copy-case-table)
+ (defalias 'riece-copy-case-table 'copy-case-table)
+ ;; In XEmacs 21.1, case-table is a list of strings.
+ (defun riece-copy-case-table (case-table)
+ (mapcar #'copy-sequence case-table)))
;;; stolen (and renamed) from gnus-xmas.el.
;;; In GNU Emacs, user can intercept whole mouse tracking events by