Commits

Anonymous committed 1d0b0a0

Synch up with new upstream version 1.4.9.

  • Participants
  • Parent commits 21ce3f9

Comments (0)

Files changed (24)

-2002-10-14  Rendhalver [Peter Brown]  <rendhalver@xemacs.org>
-
-	* Makefile (VERSION): XEmacs package 1.09 released.
-
 2002-10-12  Ville Skyttä  <ville.skytta@xemacs.org>
 
 	* Makefile (EXTRA_OBJS): New, add etc/po/liece.mo (for make clean).
   Liece works under following environment at least.
   
   - Emacs 20.7
-  - XEmacs 21.4 or later
+  - XEmacs 21.1 or later
   
   This package uses following libraries.
   
   
 ** Setting up your ~/.emacs   
   
-  If you are using Emacs or Mule, please add directory of APEL and
-  Liece to load-path.  If you install by default setting you can write
-  subdirs.el for example:
-  
-  ex:
-  (normal-top-level-add-to-load-path '("apel" "liece"))
-
-  If you are using Emacs 20.3 or XEmacs, prepare `subdirs.el' with
-  following contents, Emacs will find and append each substantial
-  directory to `load-path' automagically.
+  If you are using Emacs 20.7, prepare `subdirs.el' with following
+  contents, Emacs will find and append each substantial directory to
+  `load-path' automagically.
 
   ex:
   (normal-top-level-add-subdirs-to-load-path)
 
-  If you are using Emacs 19 or earlier version of Emacsen, 
-  you have to write more complicated path-setting in your `~/.emacs'.
-  
-  ex: 
-  (setq load-path 
-        (append 
-         (list "/usr/local/lib/mule/site-lisp/apel"
-	       "/usr/local/lib/mule/site-lisp/liece")
-         load-path))
-  
-  For more details, please read `README' file come along with APEL.
-
   If you have never been using liece and/or its variants, 
   add an autoload setting into your `~/.emacs'.
 
   ex:
   (autoload 'liece "liece" nil t)
 
-** Setting up your ~/.liece/init.el
-  
-  If you have never run Liece, and quite unsure to configure startup
-  files in Emacs Lisp, please copy `sample.dot.emacs' file to `~/.liece/init.el'.
+  If you are using Emacs 20.7 and have never run Liece, run
+  `etc/gnu-emacs-user-config' to prepare initial settings.
   
 * Optional packages
 

File configure.in

 AC_INIT(configure.in)
 AC_PREREQ(2.13)
-AM_INIT_AUTOMAKE(liece, 1.4.7)
+AM_INIT_AUTOMAKE(liece, 1.4.9)
 
 AC_PROG_CC
 AC_ISC_POSIX

File etc/.cvsignore

 Makefile.in
 Makefile
+gnu-emacs-user-config

File etc/Makefile.am

 SUBDIRS = icons po styles
 
-EXTRA_DIST = sample.dot.emacs.in
-DISTCLEANFILES = sample.dot.emacs
-pkgdata_DATA = sample.dot.emacs
-sample.dot.emacs: sample.dot.emacs.in
-	sed -e 's!@pkgdatadir@!$(pkgdatadir)!g' $< > $@
+EXTRA_DIST = gnu-emacs-user-config.in
+DISTCLEANFILES = gnu-emacs-user-config
+noinst_DATA = gnu-emacs-user-config
+gnu-emacs-user-config: gnu-emacs-user-config.in
+	sed 's!@pkgdatadir@!$(pkgdatadir)!g' $< > $@
+	chmod +x $@
 
 package:
 install-package: package

File etc/gnu-emacs-user-config.in

+#!/bin/sh
+
+# Copyright (C) 2002 Daiki Ueno
+#
+# This file is part of Liece.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Prepare user settings for GNU Emacs.
+# If you are using XEmacs, you don't need to run this script.
+
+EMACS=${EMACS-emacs}
+
+custom=`cat <<'EOF'
+(custom-set-variables
+  '(liece-intl-catalogue-directory "@pkgdatadir@/locale" nil (liece)
+    "Default location of Liece message catalogs.")
+  '(liece-window-style-directory "@pkgdatadir@/styles" nil (liece)
+    "Default location of Liece style files.")
+  '(liece-icon-directory "@pkgdatadir@/icons" nil (liece)
+    "Default location of Liece icon files."))
+EOF`
+
+$EMACS -eval "$custom" -l cus-edit -f Custom-save -f kill-emacs

File etc/po/.cvsignore

+Makefile.in
+Makefile
 *.mo
+

File etc/sample.dot.emacs.in

-;;; -*- emacs-lisp -*-
-
-(setq liece-intl-catalogue-directory "@pkgdatadir@/locale"
-      liece-window-style-directory "@pkgdatadir@/styles"
-      liece-icon-directory "@pkgdatadir@/icons")

File lisp/.cvsignore

 Makefile.in
+Makefile
 liece-setup.el
 _pkg.el
 auto-autoloads.el

File lisp/ChangeLog

+2002-09-26  Daiki Ueno  <ueno@unixuser.org>
+
+	* liece-minibuf.el (liece-minibuf-completing-read): Don't use the
+	7th argument of completing-read.
+
+2002-09-24  Daiki Ueno  <ueno@unixuser.org>
+
+	* liece-handle.el (liece-handle-mode-message): Check chnlp before
+	passing mode argument to liece-channel-set-*.
+	[cf. <Bug#161779>]
+
+2002-09-03  Daiki Ueno  <ueno@unixuser.org>
+
+	* liece-handle.el (liece-handle-quit-message): Don't use
+	liece-nick-mark-as-apart.
+	(liece-handle-join-message): Ditto.	
+	[cf. <Liece:00080>]
+
+2002-09-01  Daiki Ueno  <ueno@unixuser.org>
+
+	* liece-handle.el (liece-handle-mode-message): The arglist of
+	liece-nick-set-mode was changed.
+
+2002-08-27  Daiki Ueno  <ueno@unixuser.org>
+
+	* liece-commands.el (liece-command-join-channel): User
+	liece-nick-get-joined-channels.
+
+	* liece-channel.el (liece-channel-set-topic): Define as function.
+	(liece-channel-add-mode): Ditto.
+	(liece-channel-remove-mode): Ditto.
+	(liece-channel-set-mode): Ditto.
+	(liece-channel-add-ban): Ditto.
+	(liece-channel-remove-ban): Ditto.
+	(liece-channel-set-ban): Ditto.
+	(liece-channel-add-exception): Ditto.
+	(liece-channel-remove-exception): Ditto.
+	(liece-channel-set-exception): Ditto.
+	(liece-channel-add-invite): Ditto.
+	(liece-channel-remove-invite): Ditto.
+	(liece-channel-set-invite): Ditto.
+	* liece-nick.el (liece-nick-mark-as-part): Replace
+	liece-nick-{mark,unmark}-as-apart.
+	(liece-nick-get-modes): Define as function.
+	(liece-nick-add-mode): Ditto.
+	(liece-nick-remove-mode): Ditto.
+	(liece-nick-set-mode): Ditto.
+	* liece-handle.el (liece-handle-mode-message): Follow the changes
+	of arglists of liece-channel-set-mode and liece-nick-set-mode.
+
+	* liece.el: Fix typo.
+	* liece-misc.el (liece-current-nickname): Define as function.
+	(liece-current-channel): Ditto.
+	(liece-current-channels): Ditto.
+	(liece-current-chat-partner): Ditto.
+	(liece-current-chat-partners): Ditto.
+
+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-07-13  Daiki Ueno  <daiki@xemacs.org>
 
 	* liece-menu.el (liece-menu-add-url): Always switch to *Commands*
 
 	* 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>
 

File lisp/Makefile.am

 
 EMACS = @EMACS@
 XEMACS = @XEMACS@
-export EMACS XEMACS
+PREFIX = @prefix@
+LISPDIR = @lispdir@
+export EMACS XEMACS PREFIX LISPDIR
 
 all: elc
 

File lisp/Makefile.lisp

 PACKAGE	= liece
-VERSION	= 1.4.7
+VERSION	= 1.4.9
 
-ifndef EMACS
-	EMACS = emacs
-endif
-ifndef XEMACS
-	XEMACS = xemacs
-endif
-ifndef FLAGS
-	FLAGS = -batch -q -no-site-file
-endif
-
-TAR	= tar
-
-PREFIX	= NONE
-LISPDIR	= NONE
-PACKAGEDIR = NONE
-VERSION_SPECIFIC_LISPDIR = NONE
-
-GOMI     = liece-setup.el *.elc
+EMACS ?= emacs
+XEMACS ?= xemacs
+FLAGS ?= -batch -q -no-site-file
+TAR ?= tar
+PREFIX ?= NONE
+LISPDIR	?= NONE
+PACKAGEDIR ?= NONE
+VERSION_SPECIFIC_LISPDIR ?= NONE
 
 include ../../../XEmacs.rules
+GOMI = liece-setup.el *.elc
 
 all:: elc
 

File lisp/liece-channel.el

 
 (defun liece-channel-get-modes (&optional chnl)
   "Return CHNL or current channels's mode."
-  (get (intern (or chnl liece-current-channel) liece-obarray)
-       'mode))
+  (get (intern (or chnl liece-current-channel) liece-obarray) 'mode))
 
 (defun liece-channel-get-bans (&optional chnl)
   "Return CHNL or current channels's ban list."
-  (get (intern (or chnl liece-current-channel) liece-obarray)
-       'ban))
+  (get (intern (or chnl liece-current-channel) liece-obarray) 'ban))
 
 (defun liece-channel-get-invites (&optional chnl)
   "Return CHNL or current channels's invite list."
-  (get (intern (or chnl liece-current-channel) liece-obarray)
-       'invite))
+  (get (intern (or chnl liece-current-channel) liece-obarray) 'invite))
 
 (defun liece-channel-get-exceptions (&optional chnl)
   "Return CHNL or current channels's exception list."
-  (get (intern (or chnl liece-current-channel) liece-obarray)
-       'exception))
+  (get (intern (or chnl liece-current-channel) liece-obarray) 'exception))
 
-;;; Internal functions
-(defun liece-channel-remove (chnl chnls)
-  "Remove CHNL from CHNLS."
+;;; Channel status functions
+(defun liece-channel-remove (channel channels)
+  "Remove CHANNEL from CHANNELS."
   (remove-if
    (lambda (item)
-     (and (stringp item) (liece-channel-equal chnl item)))
-   chnls))
+     (and (stringp item) (liece-channel-equal channel item)))
+   channels))
 
-(defun liece-channel-delete (chnl chnls)
-  "Delete CHNL from CHNLS."
+(defun liece-channel-delete (channel channels)
+  "Delete CHANNEL from CHANNELS."
   (delete-if
    (lambda (item)
-     (and (stringp item) (liece-channel-equal chnl item)))
-   chnls))
+     (and (stringp item) (liece-channel-equal channel item)))
+   channels))
 
-(defmacro liece-channel-set-topic (topic &optional chnl)
-  "Set CHNL or current channels's topic."
-  `(put (intern (or ,chnl liece-current-channel) liece-obarray)
-	'topic ,topic))
+(defun liece-channel-set-topic (topic &optional channel)
+  "Set CHANNEL's topic."
+  (put (intern (or channel liece-current-channel) liece-obarray)
+       'topic topic))
 
-(defmacro liece-channel-add-mode (mode &optional chnl)
-  "Add MODE as char to CHNL."
-  `(let ((modes (liece-string-to-list (or (liece-channel-get-modes ,chnl)
-					 ""))))
-     (or (memq ,mode modes)
-	 (push ,mode modes))
-     (put (intern (or ,chnl liece-current-channel) liece-obarray)
-	  'mode (mapconcat #'char-to-string modes ""))))
+(defun liece-channel-add-mode (mode &optional channel)
+  "Add MODE to CHANNEL.
+MODE is a string splitted into characters one by one."
+  (let ((modes
+	 (liece-string-to-list
+	  (or (liece-channel-get-modes channel)
+	      ""))))
+    (or (memq mode modes)
+	(push mode modes))
+    (put (intern (or channel liece-current-channel) liece-obarray)
+	 'mode (mapconcat #'char-to-string modes ""))))
 
-(defmacro liece-channel-remove-mode (mode &optional chnl)
-  "Remove MODE as char to CHNL."
-  `(let ((modes (liece-string-to-list (or (liece-channel-get-modes ,chnl)
-					 ""))))
-     (delq ,mode modes)
-     (put (intern (or ,chnl liece-current-channel) liece-obarray)
-	  'mode (mapconcat #'char-to-string modes ""))))
+(defun liece-channel-remove-mode (mode &optional channel)
+  "Remove MODE from CHANNEL.
+MODE is a string splitted into characters one by one."
+  (let ((modes
+	 (liece-string-to-list
+	  (or (liece-channel-get-modes channel)
+	      ""))))
+    (delq mode modes)
+    (put (intern (or channel liece-current-channel) liece-obarray)
+	 'mode (mapconcat #'char-to-string modes ""))))
 
-(defmacro liece-channel-set-mode (val mode &optional chnl)
-  "Set character VAL as channel MODE into the CHNL."
-  `(if val
-       (liece-channel-add-mode ,mode ,chnl)
-     (liece-channel-remove-mode ,mode ,chnl)))
+(defun liece-channel-set-mode (channel mode flag)
+  "Add or remove channel MODE of CHANNEL.
+MODE is a string splitted into characters one by one.
+If FLAG is non-nil, given modes are added to the channel.
+Otherwise they are removed from the channel."
+  (if flag
+      (liece-channel-add-mode mode channel)
+    (liece-channel-remove-mode mode channel)))
 
-(defmacro liece-channel-add-ban (pattern &optional chnl)
-  "Add ban PATTERN as char to CHNL."
-  `(let ((patterns (liece-channel-get-bans ,chnl)))
-     (or (string-list-member-ignore-case ,pattern patterns)
-	 (push ,pattern patterns))
-     (put (intern (or ,chnl liece-current-channel) liece-obarray)
-	  'ban patterns)))
+(defun liece-channel-add-ban (pattern &optional channel)
+  "Add ban PATTERN to CHANNEL."
+  (let ((patterns (liece-channel-get-bans channel)))
+    (or (string-list-member-ignore-case pattern patterns)
+	(push pattern patterns))
+    (put (intern (or channel liece-current-channel) liece-obarray)
+	 'ban patterns)))
 
-(defmacro liece-channel-remove-ban (pattern &optional chnl)
-  "Remove ban PATTERN as char to CHNL."
-  `(let ((patterns (remove-if (lambda (elm) (string-equal ,pattern elm))
-			      (liece-channel-get-bans ,chnl))))
-     (put (intern (or ,chnl liece-current-channel) liece-obarray)
-	  'ban patterns)))
+(defun liece-channel-remove-ban (pattern &optional channel)
+  "Remove ban PATTERN from CHANNEL."
+  (let ((patterns
+	 (remove-if
+	  (lambda (elm) (string-equal pattern elm))
+	  (liece-channel-get-bans channel))))
+    (put (intern (or channel liece-current-channel) liece-obarray)
+	 'ban patterns)))
 
-(defmacro liece-channel-set-ban (chnl pattern val)
-  "Set ban PATTERN as char to CHNL."
-  `(if val
-       (liece-channel-add-ban ,pattern ,chnl)
-     (liece-channel-remove-ban ,pattern ,chnl)))
+(defun liece-channel-set-ban (channel pattern flag)
+  "Add or remove ban PATTERN to CHANNEL.
+If FLAG is non-nil, given ban patterns are added to the channel.
+Otherwise they are removed from the channel."
+  (if flag
+      (liece-channel-add-ban pattern channel)
+    (liece-channel-remove-ban pattern channel)))
 
-(defmacro liece-channel-add-exception (pattern &optional chnl)
-  "Add exception PATTERN as char to CHNL."
-  `(let ((patterns (liece-channel-get-exceptions ,chnl)))
-     (or (string-list-member-ignore-case ,pattern patterns)
-	 (push ,pattern patterns))
-     (put (intern (or ,chnl liece-current-channel) liece-obarray)
-	  'exception patterns)))
+(defun liece-channel-add-exception (pattern &optional channel)
+  "Add exception PATTERN to CHANNEL."
+  (let ((patterns (liece-channel-get-exceptions channel)))
+    (or (string-list-member-ignore-case pattern patterns)
+	(push pattern patterns))
+    (put (intern (or channel liece-current-channel) liece-obarray)
+	 'exception patterns)))
 
-(defmacro liece-channel-remove-exception (pattern &optional chnl)
-  "Remove exception PATTERN as char to CHNL."
-  `(let ((patterns (remove-if (lambda (elm) (string-equal ,pattern elm))
-			      (liece-channel-get-exceptions ,chnl))))
-     (put (intern (or ,chnl liece-current-channel) liece-obarray)
-	  'exception patterns)))
+(defun liece-channel-remove-exception (pattern &optional channel)
+  "Remove exception PATTERN from CHANNEL."
+  (let ((patterns
+	 (remove-if
+	  (lambda (elm) (string-equal pattern elm))
+	  (liece-channel-get-exceptions channel))))
+    (put (intern (or channel liece-current-channel) liece-obarray)
+	 'exception patterns)))
 
-(defmacro liece-channel-set-exception (chnl pattern val)
-  "Set exception PATTERN as char to CHNL."
-  `(if val
-       (liece-channel-add-exception ,pattern ,chnl)
-     (liece-channel-remove-exception ,pattern ,chnl)))
+(defun liece-channel-set-exception (channel pattern flag)
+  "Add or remove exception PATTERN to CHANNEL.
+If FLAG is non-nil, given exception patterns are added to the channel.
+Otherwise they are removed from the channel."
+  (if flag
+      (liece-channel-add-exception pattern channel)
+     (liece-channel-remove-exception pattern channel)))
 
-(defmacro liece-channel-add-invite (pattern &optional chnl)
-  "Add invite PATTERN as char to CHNL."
-  `(let ((patterns (liece-channel-get-invites ,chnl)))
-     (or (string-list-member-ignore-case ,pattern patterns)
-	 (push ,pattern patterns))
-     (put (intern (or ,chnl liece-current-channel) liece-obarray)
-	  'invite patterns)))
+(defun liece-channel-add-invite (pattern &optional channel)
+  "Add invite PATTERN to CHANNEL."
+  (let ((patterns (liece-channel-get-invites channel)))
+    (or (string-list-member-ignore-case pattern patterns)
+	(push pattern patterns))
+    (put (intern (or channel liece-current-channel) liece-obarray)
+	 'invite patterns)))
 
-(defmacro liece-channel-remove-invite (pattern &optional chnl)
-  "Remove invite PATTERN as char to CHNL."
-  `(let ((patterns (remove-if (lambda (elm) (string-equal ,pattern elm))
-			      (liece-channel-get-invites ,chnl))))
-     (put (intern (or ,chnl liece-current-channel) liece-obarray)
-	  'invite patterns)))
+(defun liece-channel-remove-invite (pattern &optional channel)
+  "Remove invite PATTERN from CHANNEL."
+  (let ((patterns
+	 (remove-if
+	  (lambda (elm) (string-equal pattern elm))
+	  (liece-channel-get-invites channel))))
+    (put (intern (or channel liece-current-channel) liece-obarray)
+	 'invite patterns)))
 
-(defmacro liece-channel-set-invite (chnl pattern val)
-  "Set invite PATTERN as char to CHNL."
-  `(if val
-       (liece-channel-add-invite ,pattern ,chnl)
-     (liece-channel-remove-invite ,pattern ,chnl)))
+(defun liece-channel-set-invite (channel pattern flag)
+  "Add or remove invite PATTERN to CHANNEL.
+If FLAG is non-nil, given invite patterns are added to the channel.
+Otherwise they are removed from the channel."
+  (if flag
+      (liece-channel-add-invite pattern channel)
+     (liece-channel-remove-invite pattern channel)))
   
-(defun liece-channel-virtual (chnl)
+(defun liece-channel-virtual (channel)
   "Convert channel name into internal representation.
-\(For example if CHNL is a string \"#...:*\", it will be converted into
+\(For example if CHANNEL is a string \"#...:*\", it will be converted into
 \"%...\"\)"
   (let ((mapping liece-channel-conversion-map) match)
     (while mapping
-      (if (string-equal-ignore-case (caar mapping) chnl)
+      (if (string-equal-ignore-case (caar mapping) channel)
 	  (setq match (cdar mapping)))
       (pop mapping))
     (if match
 	match
       (save-match-data
 	(cond
-	 ((and (string-match "^[#+]\\(.*\\):\\(.*\\)$" chnl)
-	       (string= (match-string 2 chnl)
-			liece-channel-conversion-default-mask))
-	  (if (eq ?+ (aref chnl 0))
-	      (concat "-" (match-string 1 chnl))
-	    (concat "%" (match-string 1 chnl))))
-	 ((string= "" chnl) chnl)
-;	 ((eq ?! (aref chnl 0))
-;	  (concat "!" (substring chnl (1+ liece-channel-id-length))))
-	 (t chnl))))))
+	 ((string-match
+	   (format "^[#+]\\(.*\\):%s$"
+		   (regexp-quote liece-channel-conversion-default-mask))
+	   channel)
+	  (if (eq ?+ (aref channel 0))
+	      (concat "-" (match-string 1 channel))
+	    (concat "%" (match-string 1 channel))))
+;;;	 ((and (not (equal channel "")) (eq ?! (aref channel 0)))
+;;;	  (concat "!" (substring channel (1+ liece-channel-id-length))))
+	 (t channel))))))
 
-(defun liece-channel-real (chnl)
+(defun liece-channel-real (channel)
   "Convert channel name into external representation.
-\(For example if CHNL is a string \"%...\", it will be converted into
+\(For example if CHANNEL is a string \"%...\", it will be converted into
 \"#...:*\"\)"
   (let ((mapping liece-channel-conversion-map) match)
     (while mapping
-      (if (string-equal-ignore-case (cdar mapping) chnl)
+      (if (string-equal-ignore-case (cdar mapping) channel)
 	  (setq match (caar mapping)))
       (pop mapping))
     (cond
      (match match)
-     ((eq ?% (aref chnl 0))
-      (concat "#" (substring chnl 1) ":"
+     ((eq ?% (aref channel 0))
+      (concat "#" (substring channel 1) ":"
 	      liece-channel-conversion-default-mask))
-     ((eq ?- (aref chnl 0))
-      (concat "+" (substring chnl 1) ":"
+     ((eq ?- (aref channel 0))
+      (concat "+" (substring channel 1) ":"
 	      liece-channel-conversion-default-mask))
-     (t chnl))))
+     (t channel))))
 
 ;;;###liece-autoload
 (defun liece-command-toggle-channel-buffer-mode ()

File lisp/liece-commands.el

       (setq nick (pop nicks)))
     (when nicks
       (setq join-channel-var
-            (or (car (get (intern (car nick) liece-obarray) 'chnl))
+            (or (car (liece-nick-get-joined-channels (car nick)))
                 join-channel-var)))
     (if (liece-channel-member join-channel-var liece-current-channels)
 	(progn

File lisp/liece-ctcp.el

 
 ;; (require 'pccl)
 
-;; (or (broken-p 'ccl-usable) (require 'liece-q-ccl nil 'noerror)
-;;     (require 'liece-q-el))
+;; (if-broken ccl-usable
+;;     (require 'liece-q-el)
+;;   (require 'liece-q-ccl))
 (require 'liece-q-el)
 
 (require 'liece-x-face)

File lisp/liece-emacs.el

 
 (eval-when-compile (ignore-errors (require 'image)))
 
+(require 'pces)
 (require 'derived)
 
 (eval-and-compile

File lisp/liece-handle.el

     ;; Mark temporary apart, if quitting user is one of our chat partners.
     (when (liece-nick-member prefix liece-current-chat-partners)
       (add-to-list 'chnls prefix)
-      (liece-nick-mark-as-apart prefix))
+      (liece-nick-mark-as-part t prefix))
     (if (liece-handle-check-changes-ignored)
 	(return-from liece-handle-quit-message))
     (cond
 (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))
+	      ((and chnlp (eq ?o (car mflgs)))
+	       (liece-channel-set-operator chnl (car margs) val)
+	       (setq margs (cdr margs)))
+	      ((and chnlp (eq ?v (car mflgs)))
+	       (liece-channel-set-voice chnl (car margs) val)
+	       (setq margs (cdr margs)))
+	      ((and chnlp (eq ?b (car mflgs)))
+	       (liece-channel-set-ban chnl (car margs) val)
+	       (setq margs (cdr margs)))
+	      ((and chnlp (eq ?e (car mflgs)))
+	       (liece-channel-set-exception chnl (car margs) val)
+	       (setq margs (cdr margs)))
+	      ((and chnlp (eq ?I (car mflgs)))
+	       (liece-channel-set-invite chnl (car margs) val)
+	       (setq margs (cdr margs)))
+	      (chnlp (liece-channel-set-mode chnl (car mflgs) val))
+	      (t (liece-nick-set-mode chnl (car mflgs) val)))
+	(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))))
      ((string-match " +$" chnl)
       (setq chnl (substring chnl 0 (match-beginning 0)))))
     (setq chnl (liece-channel-virtual chnl))
-    
     (liece-nick-set-user-at-host nick liece-user-at-host)
-    
     (if (liece-nick-equal nick liece-real-nickname)
 	(progn
 	  (and liece-gather-channel-modes
 	       (liece-send "MODE %s " (liece-channel-real chnl)))
 	  (liece-channel-join chnl))
       (liece-nick-join nick chnl))
-    
     (cond
      ((eq flag ?o)
       (liece-channel-set-operator chnl xnick t)
      ((eq flag ?v)
       (liece-channel-set-voice chnl xnick t)
       (setq xnick (concat "+" xnick))))
-    
     (if (liece-handle-check-changes-ignored)
 	(return-from liece-handle-join-message))
-    
+    ;; Restore the private conversation to its original state.
     (when (and (liece-nick-member nick liece-current-chat-partners)
 	       (get (intern nick liece-obarray) 'part))
       (liece-insert-change (liece-pick-buffer nick)
 			    (format (_ "%s has come back as (%s)\n")
 				    nick liece-user-at-host))
-      (liece-nick-unmark-as-apart nick))
-    
+      (liece-nick-mark-as-part nil nick))
     (cond
      (liece-compress-changes
       (let* ((text (format (_ " \\(has\\|have\\) joined channel %s")

File lisp/liece-inlines.el

 (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)))
+(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)))

File lisp/liece-minibuf.el

     (mapconcat (function car) liece-supported-user-mode-alist ""))))
 
 (defun liece-minibuffer-completing-read
-  (prompt table &optional predicate require-match initial-input history default)
-  (completing-read
-   (if default
-       (format "%s(default %s) " prompt default)
-     prompt)
-   table predicate require-match initial-input history default))
+  (prompt table &optional predicate require-match initial-input history
+	  default)
+  (let ((result
+	 (completing-read
+	  (if default
+	      (format "%s(default %s) " prompt default)
+	    prompt)
+	  table predicate require-match initial-input history)))
+    (if (and default (equal result ""))
+	default
+      result)))
 
 (defvar liece-minibuffer-completion-separator ","
   "Separator used for separating strings in `liece-minibuffer-completing-read-multiple'.
       (let ((liece-minibuffer-completion-table
 	     table))
 	(split-string
-	 (completing-read
+	 (liece-minibuffer-completing-read
 	  prompt #'liece-minibuffer-completing-read-multiple-1
 	  predicate require-match initial-input history default)
 	 liece-minibuffer-completion-separator)))))

File lisp/liece-misc.el

 	 (concat "[" ,hostname "]")
        ,hostname)))
 
-(defmacro liece-current-nickname ()
-  "Our current nickname."
-  'liece-real-nickname)
+(defun liece-current-nickname ()
+  "Return the current nickname."
+  liece-real-nickname)
 
-(defmacro liece-current-channel ()
-  "Out current channel."
-  'liece-current-channel)
+(defun liece-current-channel ()
+  "Return the current channel."
+  liece-current-channel)
 
-(defmacro liece-current-channels ()
-  "Out current channels."
-  'liece-current-channels)
+(defun liece-current-channels ()
+  "Return the current channels."
+  liece-current-channels)
 
-(defmacro liece-current-chat-partner ()
-  "Out current chat partner."
-  'liece-current-chat-partner)
+(defun liece-current-chat-partner ()
+  "Return the current chat partner."
+  liece-current-chat-partner)
 
-(defmacro liece-current-chat-partners ()
-  "Out current chat partners."
-  'liece-current-chat-partners)
+(defun liece-current-chat-partners ()
+  "Return the current chat partners."
+  liece-current-chat-partners)
 
 (defmacro liece-scroll-if-visible (window)
   `(if ,window (set-window-point ,window (point-max))))

File lisp/liece-nick.el

   :type 'function
   :group 'liece-vars)
 
-;;; @ internal access methods
-;;;
-(defmacro liece-nick-get-joined-channels (nick)
+;;; Nick status functions
+(defun liece-nick-get-joined-channels (nick)
   "Return channels as list NICK is joined."
-  `(get (intern ,nick liece-obarray) 'chnl))
+  (get (intern (or nick liece-real-nickname) liece-obarray) 'join))
 
-(defmacro liece-nick-get-user-at-host (nick)
+(defun liece-nick-get-user-at-host (nick)
   "Return user-at-host as string NICK is joined."
-  `(get (intern ,nick liece-obarray) 'user-at-host))
+  (get (intern (or nick liece-real-nickname) liece-obarray) 'user-at-host))
 
-(defmacro liece-nick-set-user-at-host (nick uah)
+(defun liece-nick-set-user-at-host (nick user-at-host)
   "Set user at host as string NICK is joined."
-  `(put (intern ,nick liece-obarray) 'user-at-host ,uah))
+  (put (intern (or nick liece-real-nickname) liece-obarray)
+       'user-at-host user-at-host))
 
-(defmacro liece-nick-mark-as-apart (nick)
+(defun liece-nick-mark-as-part (part &optional nick)
   "Mark NICK is temporary apart."
-  `(put (intern ,nick liece-obarray) 'part t))
+  (put (intern (or nick liece-real-nickname) liece-obarray) 'part part))
 
-(defmacro liece-nick-unmark-as-apart (nick)
-  "Mark NICK is temporary apart."
-  `(put (intern ,nick liece-obarray) 'part nil))
+(defun liece-nick-get-modes (&optional nick)
+  "Return modes as string NICK is joined."
+  (get (intern (or nick liece-real-nickname) liece-obarray) 'mode))
 
-(defmacro liece-nick-get-modes (nick)
-  "Return modes as string NICK is joined."
-  `(get (intern ,nick liece-obarray) 'mode))
+(defun liece-nick-add-mode (mode &optional nick)
+  "Add MODE as char to NICK.
+MODE is a string splitted into characters one by one."
+  (let ((modes
+	 (liece-string-to-list
+	  (or (liece-nick-get-modes nick) ""))))
+    (or (memq mode modes)
+	(push mode modes))
+    (put (intern (or nick liece-real-nickname) liece-obarray)
+	 'mode (mapconcat #'char-to-string modes ""))))
 
-(defmacro liece-nick-add-mode (mode &optional nick)
-  "Add MODE as char to NICK."
-  `(let* ((n (intern ,nick liece-obarray))
-	  (modes (liece-string-to-list (or (get n 'mode) ""))))
-     (put n 'mode (mapconcat #'char-to-string
-			     (or (memq ,mode modes)
-				 (cons ,mode modes)) ""))))
+(defun liece-nick-remove-mode (mode &optional nick)
+  "Remove MODE from NICK.
+MODE is a string splitted into characters one by one."
+  (let ((modes
+	 (liece-string-to-list
+	  (or (liece-nick-get-modes nick) ""))))
+    (delq mode modes)
+    (put (intern (or nick liece-real-nickname) liece-obarray)
+	 'mode (mapconcat #'char-to-string modes ""))))
 
-(defmacro liece-nick-remove-mode (mode &optional nick)
-  "Remove MODE as char to NICK."
-  `(let* ((n (intern ,nick liece-obarray))
-	  (modes (liece-string-to-list (or (get n 'mode) ""))))
-     (delq ,mode modes)
-     (put n 'mode (mapconcat #'char-to-string modes ""))))
-
-(defmacro liece-nick-set-mode (val mode &optional nick)
-  "Set MODE as char to CHNL."
-  `(if ,val
-       (liece-nick-add-mode ,mode ,nick)
-     (liece-nick-remove-mode ,mode ,nick)))
+(defun liece-nick-set-mode (nick mode toggle)
+  "Add or remove channel MODE of NICK.
+MODE is a string splitted into characters one by one.
+If FLAG is non-nil, given modes are added to the user.
+Otherwise they are removed from the user."
+  (if toggle
+      (liece-nick-add-mode mode nick)
+     (liece-nick-remove-mode mode nick)))
 
 (defmacro liece-nick-strip (nick)
   `(if (and ,nick (memq (aref ,nick 0) '(?@ ?+ ? )))
        (liece-channel-set-operator ,chnl user t))
       ((char-equal flag ?+)
        (liece-channel-set-voice ,chnl user t)))
-     (or (string-list-member-ignore-case ,chnl (get u 'chnl))
-	 (put u 'chnl (cons ,chnl (get u 'chnl))))
+     (or (string-list-member-ignore-case ,chnl (get u 'join))
+	 (put u 'join (cons ,chnl (get u 'join))))
      (or (string-list-member-ignore-case user (get c 'nick))
 	 (put c 'nick (cons user (get c 'nick))))))
 		
 	 (c (intern ,chnl liece-obarray)))
      (liece-channel-set-operator ,chnl ,user nil)
      (liece-channel-set-voice ,chnl ,user nil)
-     (put u 'chnl (string-list-remove-ignore-case ,chnl (get u 'chnl)))
+     (put u 'join (string-list-remove-ignore-case ,chnl (get u 'join)))
      (put c 'nick (string-list-remove-ignore-case ,user (get c 'nick)))))
 
 ;;;###liece-autoload
 ;;;###liece-autoload
 (defun liece-nick-change (old new)
   (let* ((old (liece-nick-strip old)) (new (liece-nick-strip new))
-	 (chnls (get (intern old liece-obarray) 'chnl)) chnl nbuf)
+	 (chnls (get (intern old liece-obarray) 'join)) chnl nbuf)
     (liece-change-nick-of old new)
     (if new
-	(put (intern new liece-obarray) 'chnl chnls))
+	(put (intern new liece-obarray) 'join chnls))
     (unintern old liece-obarray)
     (dolist (chnl chnls)
       (if (null new)

File lisp/liece-version.el

 (provide 'liece-version)
 
 (product-provide 'liece-version
-  (product-define "Liece" nil '(1 4 7)))
+  (product-define "Liece" nil '(1 4 9)))
 
 (defconst liece-environment-version
   (concat

File lisp/liece-xemacs.el

 	     (if (and (featurep 'xpm)
 		      (setq file (liece-locate-icon-file "liece-pointer.xpm")))
 		 (list (vector 'xpm :file file)))
-	     (if (setq file (liece-locate-icon-file "liece-pointer.xbm"))
+	     (if (and (featurep 'xbm)
+		      (setq file (liece-locate-icon-file "liece-pointer.xbm")))
 		 (list (vector 'xbm :file file)))
 	     '([string :data "Liece:"]))))))
     (set-glyph-face glyph 'modeline-buffer-id)

File lisp/liece.el

     "\C-c9" liece-switch-to-channel-no-19
     "\C-c0" liece-switch-to-channel-no-20))
 
-;;; Keymap macros. -- borrowd from `gnus-util.el'.
-
+;;; Keymap macros. -- borrowed from `gnus-util.el'.
 (defmacro liece-local-set-keys (&rest plist)
   "Set the keys in PLIST in the current keymap."
   `(liece-define-keys-1 (current-local-map) ',plist))