+2002-08-26 Daiki Ueno <ueno@unixuser.org>
+
+ * liece-handle.el (liece-handle-mode-message): Care
+ liece-channel-set-* are defined as macros.
+ * liece-inlines.el (string-equal-ignore-case): Don't use
+ compare-strings.
+ (string-list-member-ignore-case): Don't use member-ignore-case.
+ Suggested by "Akinori MUSHA" <knu@iDaemons.org>.
+ [cf. <Liece:00075>]
+
2002-08-11 OHASHI Akira <bg66@koka-in.org>
* liece-window.el (liece-configure-windows): Set
function is the slightly modified version of the implementation by
akira yamada <akira@arika.org>. [cf. <Liece:00070>]
+2002-07-13 Daiki Ueno <daiki@xemacs.org>
+
+ * liece-menu.el (liece-menu-add-url): Always switch to *Commands*
+ buffer.
+ * liece-xemacs.el (liece-fix-menu-path-switch-buffer): Removed old
+ defadvice to easy-menu-add-item.
+
+2002-06-08 Adrian Aichner <adrian@xemacs.org>
+
+ * liece-commands.el (liece-command-nickname): Use
+ truncate-string-to-width instead of non-existent truncate-string.
+ * liece.el (liece-open-server): Ditto.
+
+2002-06-05 Steve Youngs <youngs@xemacs.org>
+
+ * liece-inlines.el (string-equal-ignore-case): Don't try to use
+ 'compare-strings'.
+
2002-05-19 Daiki Ueno <ueno@unixuser.org>
* liece-xemacs.el (liece-xemacs-modeline-glyph): Check 'xbm.
+2002-05-04 Stephen J. Turnbull <stephen@xemacs.org>
+
+ * liece-make.el (config-liece-package-directory):
+ * liece-config.el (PACKAGEDIR):
+ Handle case when dirs is nil.
+
+ * Makefile.lisp (package): Preload advice.
+
2002-05-12 Daiki Ueno <ueno@unixuser.org>
* gettext.el (gettext-default-locale): New variable.
package:
$(XEMACS) $(FLAGS) -l ./liece-make.el -f autoload-liece \
$(PREFIX) $(LISPDIR)
- $(XEMACS) $(FLAGS) -l ./liece-make.el -f compile-liece-package \
+ $(XEMACS) $(FLAGS) -l ./liece-make.el -l advice -f compile-liece-package \
$(PACKAGEDIR)
install-package: package
(defun liece-command-nickname (nick)
"Set your nickname to NICK."
(interactive "sEnter your nickname: ")
- (let ((nickname (liece-truncate-string-to-width nick liece-nick-max-length)))
+ (let ((nickname (truncate-string-to-width nick liece-nick-max-length)))
(if (zerop (length nickname))
(liece-message (_ "illegal nickname \"%s\"; not changed") nickname)
(liece-send "NICK %s" nick))))
(setq dir-list (cdr dir-list))))
dir))
-(static-if (fboundp 'truncate-string-to-width)
- (defalias 'liece-truncate-string-to-width 'truncate-string-to-width)
- (defalias 'liece-truncate-string-to-width 'truncate-string))
-
(defvar-maybe completion-display-completion-list-function
'display-completion-list)
(if last-package-load-path
last-packages)))
dir)
- (while (not (file-exists-p (setq dir (car dirs))))
+ (while (and dirs (not (file-exists-p (setq dir (car dirs)))))
(setq dirs (cdr dirs)) )
dir )))
(defun* liece-handle-mode-message (prefix rest)
(if (liece-handle-check-changes-ignored)
(return-from liece-handle-mode-message))
- (let ((chnl " ") (str "") mflag mflags marg margs val md chnlp)
- (or (and (string-match "\\([^ ]*\\) +:?" rest)
- (setq chnl (match-string 1 rest)
- str (substring rest (match-end 0))
- chnlp (liece-channel-p chnl)
- str (if (= (aref str (1- (length str))) ? )
- (substring str 0 -1) str)
- chnl (liece-channel-virtual chnl)))
- (and (string-match " +:" rest)
- (setq str (substring rest (match-end 0))))
- (return-from liece-handle-mode-message))
-
+ (let (mflgs margs val chnl mode chnlp)
+ (if (string-match "\\([^ ]*\\) *:?" rest)
+ (progn
+ (setq chnl (match-string 1 rest)
+ mode (substring rest (match-end 0)))
+ (if (liece-channel-p chnl)
+ (setq chnl (liece-channel-virtual chnl) chnlp t))
+ (if (string-match " *$" mode)
+ (setq mode (substring mode 0 (match-beginning 0)))))
+ (return-from liece-handle-mode-message))
;; parse modes
- (when (string-match "\\([^ ]*\\) +" str)
- (setq mflag (match-string 1 str)
- marg (substring str (match-end 0))
- mflags (liece-string-to-list mflag))
- (while (string-match "^\\([^ ]*\\) +" marg)
- (setq margs (cons (match-string 1 marg) margs)
- marg (substring marg (match-end 0))))
- (or (string= marg "") (setq margs (cons marg margs)))
- (while (setq md (pop mflags))
- (cond ((eq ?- md) (setq val nil))
- ((eq ?+ md) (setq val t))
- ((eq ?o md) (liece-channel-set-operator chnl (pop margs) val))
- ((eq ?v md) (liece-channel-set-voice chnl (pop margs) val))
- ((eq ?b md) (liece-channel-set-ban chnl (pop margs) val))
- ((eq ?e md) (liece-channel-set-exception chnl (pop margs) val))
- ((eq ?I md) (liece-channel-set-invite chnl (pop margs) val))
- (chnlp (liece-channel-set-mode val md chnl))
- (t (liece-nick-set-mode val md chnl)))))
-
+ (when (string-match "\\([^ ]*\\) *" mode)
+ (setq mflgs (liece-string-to-list (match-string 1 mode))
+ margs (delete "" (split-string
+ (substring mode (match-end 0))
+ "[ ]+")))
+ (while mflgs
+ (cond ((eq ?- (car mflgs)) (setq val nil))
+ ((eq ?+ (car mflgs)) (setq val t))
+ ((eq ?o (car mflgs))
+ (liece-channel-set-operator chnl (car margs) val)
+ (setq margs (cdr margs)))
+ ((eq ?v (car mflgs))
+ (liece-channel-set-voice chnl (car margs) val)
+ (setq margs (cdr margs)))
+ ((eq ?b (car mflgs))
+ (liece-channel-set-ban chnl (car margs) val)
+ (setq margs (cdr margs)))
+ ((eq ?e (car mflgs))
+ (liece-channel-set-exception chnl (car margs) val)
+ (setq margs (cdr margs)))
+ ((eq ?I (car mflgs))
+ (liece-channel-set-invite chnl (car margs) val)
+ (setq margs (cdr margs)))
+ (chnlp (liece-channel-set-mode val (car mflgs) chnl))
+ (t (liece-nick-set-mode val (car mflgs) chnl)))
+ (setq mflgs (cdr mflgs))))
(liece-set-channel-indicator)
(cond
(liece-compress-changes
(regexp-quote liece-change-prefix)
(regexp-quote chnl) (regexp-quote prefix)))
(default (format (_ "%sNew mode for %s set by %s: %s\n")
- liece-change-prefix chnl prefix str)))
+ liece-change-prefix chnl prefix mode)))
(liece-replace (liece-pick-buffer chnl)
- match default text (concat ", " str "\n"))
+ match default text (concat ", " mode "\n"))
(liece-replace (if (and liece-current-channel
(liece-channel-equal
chnl liece-current-channel))
liece-D-buffer
(append liece-D-buffer liece-O-buffer))
- match default text (concat ", " str "\n"))))
+ match default text (concat ", " mode "\n"))))
(t
(liece-insert-change (liece-pick-buffer chnl)
(format (_ "New mode for %s set by %s: %s\n")
- chnl prefix str))
+ chnl prefix mode))
(liece-insert-change (if (and liece-current-channel
(liece-channel-equal
chnl liece-current-channel))
liece-D-buffer
(append liece-D-buffer liece-O-buffer))
(format (_ "New mode for %s set by %s: %s\n")
- chnl prefix str))))))
+ chnl prefix mode))))))
(defun* liece-handle-kick-message (prefix rest)
(if (/= 3 (length (setq rest (liece-split-line rest))))
(defmacro string-join (strlst &optional del)
`(mapconcat #'identity ,strlst ,del))
-(static-if (subr-fboundp 'compare-strings)
- (defmacro string-equal-ignore-case (s1 s2)
- `(eq t (compare-strings ,s1 0 nil ,s2 0 nil 'ignore-case)))
- (defmacro string-equal-ignore-case (s1 s2)
- `(string-equal (upcase ,s1) (upcase ,s2))))
-
-(static-if (fboundp 'member-ignore-case)
- (defalias 'string-list-member-ignore-case
- 'member-ignore-case)
- (defsubst string-list-member-ignore-case (thing list)
- "Returns t if thing is member of list, not funcallable"
- (member-if
- (lambda (item)
- (and (stringp item) (string-equal-ignore-case thing item)))
- list)))
+(defmacro string-equal-ignore-case (s1 s2)
+ `(string-equal (upcase ,s1) (upcase ,s2)))
+
+(defsubst string-list-member-ignore-case (thing list)
+ "Returns t if thing is member of list, not funcallable"
+ (member-if
+ (lambda (item)
+ (and (stringp item) (string-equal-ignore-case thing item)))
+ list))
(defsubst string-list-remove-ignore-case (thing list)
(let ((element (string-list-member-ignore-case thing list)))
(if last-package-load-path
last-packages)))
dir)
- (while (not (file-exists-p
- (setq dir (car dirs))))
+ (while (and dirs (not (file-exists-p
+ (setq dir (car dirs)))))
(setq dirs (cdr dirs)))
(defvar PACKAGEDIR dir)
(princ (format "PACKAGEDIR=%s\n" PACKAGEDIR)))))
(defun liece-menu-add-url (url)
(when (boundp 'liece-menu-url-menu-map)
- (easy-menu-add-item
- liece-menu-url-menu-map nil
- (vector url (list 'liece-command-browse-url url) t))))
+ (with-current-buffer liece-command-buffer
+ (easy-menu-add-item
+ nil (list (car liece-menu-url-menu))
+ (vector url (list 'liece-command-browse-url url) t)))))
;;; @ menu callbacks
;;;
(let ((filename (match-string 1 (cdr object))))
(liece-command-dcc-send filename nick))))
-(defadvice easy-menu-add-item
- (around liece-fix-menu-path-switch-buffer activate)
- "Advice for XEmacs 20.4 or earlier."
- (save-excursion
- (set-buffer liece-command-buffer)
- (add-menu-button
- (cons (car (ad-get-arg 0)) (ad-get-arg 1))
- (ad-get-arg 2) (ad-get-arg 3))))
-
(eval-and-compile
(setq liece-x-face-insert-function
(function liece-x-face-insert-with-xemacs))
;; notify the real nickname to the user.
(or liece-real-nickname
(setq liece-real-nickname
- (liece-truncate-string-to-width liece-nickname
- liece-nick-max-length)))
+ (truncate-string-to-width liece-nickname liece-nick-max-length)))
(setq liece-nickname-last liece-real-nickname
liece-nick-accepted 'sent
liece-after-registration t))))