From: bg66 Date: Wed, 13 Jun 2001 07:32:10 +0000 (+0000) Subject: Merge main trunk. X-Git-Tag: liece-2_0_0-pre1~16 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b563baec95dc6bbc86dba176bc6a4c55dcf97d5c;p=elisp%2Fliece.git Merge main trunk. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 77137ea..195688c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,11 +3,58 @@ * liece-handle.el (liece-handle-privmsg-message): Don't compare when `item' and `liece-current-chat-partner' are nil. +2001-02-12 Daiki Ueno + + * liece-compat.el (liece-read-passwd): Revive. + + * liece-clfns.el (liece-clfns-subr-fboundp): Check existence of + the function `symbol-file'. + + * liece-q-ccl.el: Require `poem' for char-int. + (liece-quote-ccl-256-table): Simplified. + +2001-01-02 Daiki Ueno + + * liece-modules.el: Simplified. + +2000-12-09 Tanaka Akira + + * liece.el (liece-refresh-buffer-window): Simplified. + +2000-11-30 Tanaka Akira + + * liece.el (liece-refresh-buffer-window): Force to display a last + non-empty line in last line in a window on Emacs 21. + +2000-10-19 Daiki Ueno + + * liece-ctcp.el: Remove autoload cookies of + `liece-command-ctcp-generic', + `liece-command-ctcp-userinfo-from-minibuffer', + `liece-command-ctcp-x-face-from-xbm-file' and + `liece-command-send-file'. + + * liece-commands.el: Add autoload setting for + `liece-command-ctcp-action', + `liece-command-ctcp-userinfo-from-minibuffer' and + `liece-command-ctcp-x-face-from-xbm-file'. + +2000-10-16 Daiki Ueno + + * liece-commands.el (liece-command-quit): Use `liece-close-server'. + + * liece.el (liece): Simplify. + (liece-close-server): Accept optional argument `quit-string'. + 2000-10-12 Akira Ohashi * liece-menu.el (liece-menu-ctcp-menu): Follow the CTCP command changed from `liece-command-client-*' to `liece-command-ctcp-*'. +2000-10-07 Daiki Ueno + + * liece-commands.el (liece-command-qualify-nicks): Refer 1st argument. + 2000-10-05 Daiki Ueno * liece-minibuf.el (liece-minibuffer-complete-channel-modes): diff --git a/lisp/liece-clfns.el b/lisp/liece-clfns.el index e3771a5..baf5ace 100644 --- a/lisp/liece-clfns.el +++ b/lisp/liece-clfns.el @@ -34,7 +34,8 @@ "Return t if SYMBOL's function definition is a basic function." (and (fboundp symbol) (or (subrp (symbol-function symbol)) - (string-equal (symbol-file symbol) "subr")))) + (and (fboundp 'symbol-file) + (string-equal (symbol-file symbol) "subr"))))) (if (featurep 'xemacs) nil diff --git a/lisp/liece-commands.el b/lisp/liece-commands.el index 4438a0f..d0070fe 100644 --- a/lisp/liece-commands.el +++ b/lisp/liece-commands.el @@ -40,14 +40,17 @@ (autoload 'liece-dcc-chat-send "liece-dcc") +(autoload 'liece-command-ctcp-action "liece-ctcp" nil t) (autoload 'liece-command-ctcp-version "liece-ctcp" nil t) (autoload 'liece-command-ctcp-userinfo "liece-ctcp" nil t) +(autoload 'liece-command-ctcp-userinfo-from-minibuffer "liece-ctcp" nil t) +(autoload 'liece-command-ctcp-help "liece-ctcp" nil t) (autoload 'liece-command-ctcp-clientinfo "liece-ctcp" nil t) (autoload 'liece-command-ctcp-ping "liece-ctcp" nil t) (autoload 'liece-command-ctcp-time "liece-ctcp" nil t) (autoload 'liece-command-ctcp-x-face "liece-ctcp" nil t) +(autoload 'liece-command-ctcp-x-face-from-xbm-file "liece-ctcp" nil t) (autoload 'liece-command-ctcp-comment "liece-ctcp" nil t) -(autoload 'liece-command-ctcp-help "liece-ctcp" nil t) (defun liece-command-poll-names () "Handler for polling NAMES." @@ -229,9 +232,8 @@ with specified user." (if (eq current-prefix-arg '-) (read-string (format (_ "Key for channel %s: ") join-channel-var)) - (let ((passwd-echo ?*)) - (read-passwd - (format (_ "Key for channel %s: ") join-channel-var)))))) + (liece-read-passwd + (format (_ "Key for channel %s: ") join-channel-var))))) (list join-channel-var key))) (let ((real-chnl (liece-channel-real join-channel-var))) (if (numberp join-channel-var) @@ -473,7 +475,7 @@ Argument CHANGE ." (liece-send "MODE %s %c%s %s" (liece-channel-real liece-current-channel) - (if val ?+ ?-) (make-string (length nicks) ?o) + (if val ?+ ?-) (make-string (length nicks) mode) (string-join nicks " "))) (defun liece-command-set-operators (nicks &optional arg) @@ -780,9 +782,7 @@ If prefix argument ARG is non-nil, leave signoff message." (if arg (read-string (_ "Signoff message: ")) (or liece-signoff-message (product-name (product-find 'liece-version)))))) - (if quit-string - (liece-send "QUIT :%s" quit-string) - (liece-send "QUIT"))))) + (liece-close-server quit-string)))) (defun liece-command-generic (message) "Enter a generic IRC MESSAGE, which is sent to the server. diff --git a/lisp/liece-compat.el b/lisp/liece-compat.el index 3a01cf0..04771ac 100644 --- a/lisp/liece-compat.el +++ b/lisp/liece-compat.el @@ -109,6 +109,17 @@ Otherwise, this function always returns false. (sit-for 2) (delete-region savemax (point-max))))) +(defvar liece-read-passwd nil) +(defun liece-read-passwd (prompt) + (if (not liece-read-passwd) + (if (functionp 'read-passwd) + (setq liece-read-passwd 'read-passwd) + (if (load "passwd" t) + (setq liece-read-passwd 'read-passwd) + (autoload 'ange-ftp-read-passwd "ange-ftp") + (setq liece-read-passwd 'ange-ftp-read-passwd)))) + (funcall liece-read-passwd prompt)) + ;; from XEmacs's subr.el (defun-maybe replace-in-string (str regexp newtext &optional literal) "Replace all matches in STR for REGEXP with NEWTEXT string, diff --git a/lisp/liece-ctcp.el b/lisp/liece-ctcp.el index 1a0b605..238f8ec 100644 --- a/lisp/liece-ctcp.el +++ b/lisp/liece-ctcp.el @@ -544,7 +544,6 @@ (define-obsolete-function-alias 'liece-command-send-action 'liece-command-ctcp-action) -;;;###liece-autoload (defun liece-command-ctcp-generic (nick command) "Ask about someones client clientinfo." (interactive (list (liece-complete-client) (liece-complete-query))) @@ -555,14 +554,12 @@ (setq liece-ctcp-ping-time (current-time))) (liece-send "PRIVMSG %s :\001%s\001" nick command)) -;;;###liece-autoload (defun liece-command-ctcp-userinfo-from-minibuffer (info) "Ask about someones client clientinfo." (interactive (list (read-from-minibuffer "New userinfo: " liece-ctcp-userinfo))) (setq liece-ctcp-userinfo info)) -;;;###liece-autoload (defun liece-command-ctcp-x-face-from-xbm-file (file) (interactive "fXBM File: ") (let (data) @@ -571,7 +568,6 @@ (setq liece-ctcp-x-face (replace-in-string (cadr (nth 3 data)) "[ \t\n]" ""))))) -;;;###liece-autoload (defun liece-command-send-file (file to) "Send a file to given user." (interactive "fFile name: \nsTo whom: ") diff --git a/lisp/liece-modules.el b/lisp/liece-modules.el index a5d1222..14c5b5e 100644 --- a/lisp/liece-modules.el +++ b/lisp/liece-modules.el @@ -3,7 +3,6 @@ ;; Author: Daiki Ueno ;; Created: 1999-04-12 -;; Revised: 1999-03-02 ;; Keywords: IRC, liece, APEL ;; This file is part of Liece. @@ -30,8 +29,7 @@ ;;; Code: (defvar liece-modules-to-compile - '(queue-m - gettext + '(gettext liece-clfns liece-handler liece-compat @@ -65,33 +63,24 @@ liece-window liece)) -(require 'emu) (if (featurep 'xemacs) - (add-to-list 'liece-modules-to-compile 'liece-xemacs) - (add-to-list 'liece-modules-to-compile 'liece-emacs) - (if (fboundp 'set-face-stipple) - (add-to-list 'liece-modules-to-compile 'bitmap-stipple))) + (push 'liece-xemacs liece-modules-to-compile) + (push 'liece-emacs liece-modules-to-compile)) -(when (featurep 'mule) - (add-to-list 'liece-modules-to-compile 'liece-coding)) +(if (fboundp 'set-face-stipple) + (push 'bitmap-stipple liece-modules-to-compile)) -(condition-case () - (progn - (require 'pccl) - (require 'ccl)) - (error nil)) +(if (featurep 'mule) + (push 'liece-coding liece-modules-to-compile)) -(require 'broken) +(require 'pccl) (unless-broken ccl-usable - (add-to-list 'liece-modules-to-compile 'liece-q-ccl)) + (push 'liece-q-ccl liece-modules-to-compile)) -(condition-case () - (require 'cus-face) - (file-error nil)) +(setq liece-modules (cons 'liece-setup liece-modules-to-compile)) -(setq liece-modules (cons 'liece-setup - (delq 'queue-m liece-modules-to-compile))) +(push 'queue-m liece-modules-to-compile) (provide 'liece-modules) diff --git a/lisp/liece-q-ccl.el b/lisp/liece-q-ccl.el index 4ac9cba..324bf6e 100644 --- a/lisp/liece-q-ccl.el +++ b/lisp/liece-q-ccl.el @@ -31,25 +31,16 @@ (require 'broken) (require 'pccl) +(require 'poem) ;char-int (eval-and-compile (defconst liece-quote-ccl-256-table - '( 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 - 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 - 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 - 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 - 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 - 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 - 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 - 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 - 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 - 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 - 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 - 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 - 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 - 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 - 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255))) + (let ((i 0) + table) + (while (< i 256) + (setq table (nconc table (list i)) + i (1+ i))) + table))) (broken-facility ccl-cascading-write "Emacs CCL write command does not accept more than 2 arguments." diff --git a/lisp/liece.el b/lisp/liece.el index c80e779..3e0c1d3 100644 --- a/lisp/liece.el +++ b/lisp/liece.el @@ -351,7 +351,7 @@ is running on." liece-server nil)) ;;;###liece-autoload -(defun liece-close-server () +(defun liece-close-server (&optional quit-string) "Close chat server." (unwind-protect (progn @@ -361,7 +361,9 @@ is running on." (process-sentinel liece-server-process))) (set-process-sentinel liece-server-process nil)) (if (liece-server-opened) - (liece-command-quit))) + (if quit-string + (liece-send "QUIT :%s" quit-string) + (liece-send "QUIT")))) (liece-close-server-internal) ;; Save settings to the `~/.liece/init.el' file. (if liece-save-variables-are-dirty @@ -440,8 +442,8 @@ If optional argument SERVICE is non-nil, open by the service name." (set-process-sentinel liece-server-process 'liece-sentinel) (set-process-filter liece-server-process 'liece-filter) (if (or liece-ask-for-password liece-reconnect-with-password) - (let ((passwd-echo ?*) password) - (setq password (read-passwd (_ "Server Password: "))) + (let ((password + (liece-read-passwd (_ "Server Password: ")))) (or (string= password "") (setq liece-password password)))) (if liece-password @@ -537,47 +539,34 @@ If already connected, just pop up the windows." (liece-intl-load-catalogue)) (if (liece-server-opened) (liece-configure-windows) - (unwind-protect - (progn - (switch-to-buffer - (liece-get-buffer-create liece-command-buffer)) - (unless (eq major-mode 'liece-command-mode) - (liece-command-mode)) - (unless (liece-server-opened) - (liece-start-server confirm))) - (if (not (liece-server-opened)) - (liece-command-quit) - ;; IRC server is successfully open. - (with-current-buffer liece-command-buffer - (setq mode-line-process (concat " " (liece-server-host)))) - (let (buffer-read-only) - (unless liece-keep-buffers - (erase-buffer)) - (sit-for 0)) - - (liece-initialize-buffers) - (liece-configure-windows) - (setq liece-current-channels nil) - (cond - (liece-current-channel - (liece-command-join liece-current-channel)) - (liece-startup-channel - (liece-command-join liece-startup-channel)) - (liece-startup-channel-list - (dolist (chnl liece-startup-channel-list) - (if (listp chnl) - (liece-command-join (car chnl) (cadr chnl)) - (liece-command-join chnl))))) - (when liece-away-message - (liece-command-toggle-away liece-away-message)) - (run-hooks 'liece-startup-hook) - (setq liece-obarray - (or liece-obarray (make-vector liece-obarray-size nil))) - (unless liece-timers-list-initialized-p - (liece-initialize-timers)) - (liece-command-timestamp) - (message (substitute-command-keys - "Type \\[describe-mode] for help")))))) + (switch-to-buffer (liece-get-buffer-create liece-command-buffer)) + (unless (eq major-mode 'liece-command-mode) + (liece-command-mode)) + (liece-start-server confirm) + (let (buffer-read-only) + (unless liece-keep-buffers + (erase-buffer)) + (sit-for 0)) + (liece-initialize-buffers) + (liece-configure-windows) + (setq liece-current-channels nil) + (let ((startup-channels + (if liece-startup-channel + (list liece-startup-channel) + liece-startup-channel-list))) + (dolist (chnl startup-channels) + (if (listp chnl) + (liece-command-join (car chnl) (cadr chnl)) + (liece-command-join chnl)))) + (unless (string-equal liece-away-message "") + (liece-command-toggle-away liece-away-message)) + (run-hooks 'liece-startup-hook) + (setq liece-obarray + (or liece-obarray (make-vector liece-obarray-size nil))) + (unless liece-timers-list-initialized-p + (liece-initialize-timers)) + (liece-command-timestamp) + (message (substitute-command-keys "Type \\[describe-mode] for help")))) ;;;###liece-autoload (defun liece-command-mode () @@ -621,7 +610,7 @@ For a list of the generic commands type \\[liece-command-generic] ? RET. (copy-syntax-table (syntax-table))) (set-syntax-table liece-command-mode-syntax-table) (mapcar - (function (lambda (c) (modify-syntax-entry c "w"))) + (lambda (c) (modify-syntax-entry c "w")) "^[]{}'`")) (run-hooks 'liece-command-mode-hook)) @@ -882,19 +871,16 @@ Only used from `liece-before-insert-functions'." (defun liece-refresh-buffer-window (buffer) "Center point in window of BUFFER and redisplay frame." - (let ((window (liece-get-buffer-window buffer))) - (when (and window (not (pos-visible-in-window-p (point-max) window))) + (let ((window (liece-get-buffer-window buffer)) + (last-point (point-max))) + ;; skip last white spaces + (while (memq (char-before last-point) '(?\n ?\t ?\ )) + (setq last-point (1- last-point))) + (when (and window (not (pos-visible-in-window-p last-point window))) (save-selected-window (select-window window) - (goto-char (point-max)) - (if (null liece-scroll-step) - (recenter (- (liece-window-height window) 1)) - (vertical-motion - (- (or liece-scroll-step - (1+ (/ (liece-window-height window) 2))) - (liece-window-height window))) - (set-window-start window (point)) - (goto-char (point-max))))))) + (goto-char last-point) + (recenter (- (or liece-scroll-step 1))))))) (defmacro liece-save-point (&rest body) "Execute BODY, then goto the point that was around before BODY."