From 9aa5fff5364fb739fa879d3f8cbde9011f248132 Mon Sep 17 00:00:00 2001 From: teranisi Date: Sun, 23 Dec 2001 03:23:53 +0000 Subject: [PATCH] Synch up with the main trunk. --- doc/wl-ja.texi | 7 +++++ doc/wl.texi | 8 ++++++ elmo/ChangeLog | 25 +++++++++++++++++ elmo/elmo-imap4.el | 10 +++++-- elmo/elmo-net.el | 9 +++--- elmo/elmo-nntp.el | 5 +++- elmo/elmo-pop3.el | 77 ++++++++++++++++++++++++++++++---------------------- elmo/elmo.el | 1 + wl/ChangeLog | 27 ++++++++++++++++++ wl/wl-draft.el | 9 ++++++ wl/wl-e21.el | 3 +- wl/wl-folder.el | 26 ++++++++++-------- wl/wl-mule.el | 3 +- wl/wl-util.el | 16 +++++------ wl/wl-vars.el | 5 ++++ wl/wl-version.el | 2 +- wl/wl-xmas.el | 3 +- 17 files changed, 171 insertions(+), 65 deletions(-) diff --git a/doc/wl-ja.texi b/doc/wl-ja.texi index d21a3cc..d2a8dcb 100644 --- a/doc/wl-ja.texi +++ b/doc/wl-ja.texi @@ -4272,6 +4272,13 @@ Wanderlust のオフラインモード/オンラインモードをトグルします。 アドレスマネージャを起動します。 @xref{Address Manager}. (@code{wl-addrmgr}) + +@item C-c C-d +@kindex C-c C-d (Draft) +@findex wl-draft-elide-region +ポイントとマークの間の文を省きます (@code{wl-draft-elide-region})。文章 +は切られて (killed) 変数 @code{wl-draft-elide-ellipsis} の値で置き換えら +れます。デフォルトの省略符号として使われる値は (@samp{[...]}) です。 @end table @section カスタマイズ変数 diff --git a/doc/wl.texi b/doc/wl.texi index b0a4604..4200f8d 100644 --- a/doc/wl.texi +++ b/doc/wl.texi @@ -4306,6 +4306,14 @@ Selects a template. Enter Address Manager. @xref{Address Manager}. (@code{wl-addrmgr}) + +@item C-c C-d +@kindex C-c C-d (Draft) +@findex wl-draft-elide-region +Elide the text between point and mark (@code{wl-draft-elide-region}). +The text is killed and replaced with the contents of the variable +@code{wl-draft-elide-ellipsis}. The default value is to use an ellipsis +(@samp{[...]}). @end table @section Customizable Variables diff --git a/elmo/ChangeLog b/elmo/ChangeLog index f8d4a70..a3601a5 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,30 @@ 2001-12-19 Yuuichi Teranishi + * elmo.el (luna-define-class): Added `biff' slot. + + * elmo-pop3.el (elmo-pop3-debug): Split biff log. + (elmo-pop3-debug-inhibit-logging): Abolished. + (elmo-network-close-session): Eliminated needless let. + (elmo-pop3-get-session): Set prefix 'BIFF' if biff folder. + (elmo-pop3-send-command): Added `no-log' argument. + (elmo-pop3-process-filter): Use `with-current-buffer'. + (elmo-pop3-auth-user): Set `no-log' argument; Delete process + if login failure. + (elmo-pop3-auth-apop): Likewise. + (elmo-network-authenticate-session): Likewise. + + * elmo-nntp.el (elmo-nntp-get-session): Set prefix 'BIFF' + if biff folder. + + * elmo-net.el (elmo-network-session-password-key): Use class symbol + string to determine protocol. + (elmo-network-session-name-prefix): Abolished. + (elmo-network-session-cache-key): Follow the change above. + (elmo-network-open-session): Ditto. + + * elmo-imap4.el (elmo-imap4-send-command): Modified error message. + (elmo-imap4-get-session): Set prefix 'BIFF' if biff folder. + * elmo-util.el (elmo-file-field-primitive-condition-match): Fixed unmatch condition checking. diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 4d5bf6a..1f35051 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -198,7 +198,6 @@ Debug information is inserted in the buffer \"*IMAP4 DEBUG*\"") (insert "NO LOGGING\n") (insert (apply 'format message args) "\n"))))) - (defsubst elmo-imap4-decode-folder-string (string) (if elmo-imap4-use-modified-utf7 (utf7-decode-string string 'imap) @@ -284,7 +283,7 @@ Returns a TAG string which is assigned to the COMMAND." (elmo-imap4-process-bye session)) (setq elmo-imap4-current-response nil) (if elmo-imap4-parsing - (error "IMAP process is running. Please wait (or plug again.)")) + (error "IMAP process is running. Please wait (or plug again)")) (setq elmo-imap4-parsing t) (elmo-imap4-debug "<-(%s)- %s" tag command) (while (setq token (car command-args)) @@ -640,7 +639,12 @@ BUFFER must be a single-byte buffer." (elmo-imap4-folder-mailbox-internal folder))))) (defun elmo-imap4-get-session (folder &optional if-exists) - (elmo-network-get-session 'elmo-imap4-session "IMAP" folder if-exists)) + (elmo-network-get-session 'elmo-imap4-session + (concat + (if (elmo-folder-biff-internal folder) + "BIFF-") + "IMAP") + folder if-exists)) (defun elmo-imap4-session-select-mailbox (session mailbox &optional force no-error) diff --git a/elmo/elmo-net.el b/elmo/elmo-net.el index afd2fa8..6f2d6c3 100644 --- a/elmo/elmo-net.el +++ b/elmo/elmo-net.el @@ -113,19 +113,20 @@ (defsubst elmo-network-session-password-key (session) (format "%s:%s/%s@%s:%d" - (elmo-network-session-name-internal session) + (upcase + (nth 1 (split-string (symbol-name + (luna-class-name session)) "[4-]"))) (elmo-network-session-user-internal session) (elmo-network-session-auth-internal session) (elmo-network-session-server-internal session) (elmo-network-session-port-internal session))) (defvar elmo-network-session-cache nil) -(defvar elmo-network-session-name-prefix nil) (defsubst elmo-network-session-cache-key (name folder) "Returns session cache key for NAME and FOLDER." (format "%s:%s/%s@%s:%d%s" - (concat elmo-network-session-name-prefix name) + name (elmo-net-folder-user-internal folder) (elmo-net-folder-auth-internal folder) (elmo-net-folder-server-internal folder) @@ -212,7 +213,7 @@ Returns a process object. if making session failed, returns nil." :process nil :greeting nil)) (buffer (format " *%s session for %s@%s:%d%s" - (concat elmo-network-session-name-prefix name) + name user server port diff --git a/elmo/elmo-nntp.el b/elmo/elmo-nntp.el index 8cd3d60..4bbf723 100644 --- a/elmo/elmo-nntp.el +++ b/elmo/elmo-nntp.el @@ -245,7 +245,10 @@ Don't cache if nil.") (defun elmo-nntp-get-session (folder &optional if-exists) (elmo-network-get-session 'elmo-nntp-session - "NNTP" + (concat + (if (elmo-folder-biff-internal folder) + "BIFF-") + "NNTP") folder if-exists)) diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index 2af46c9..94caee7 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -66,15 +66,15 @@ set as non-nil.") "Non-nil forces POP3 folder as debug mode. Debug information is inserted in the buffer \"*POP3 DEBUG*\"") -(defvar elmo-pop3-debug-inhibit-logging nil) - ;;; Debug (defsubst elmo-pop3-debug (message &rest args) (if elmo-pop3-debug - (with-current-buffer (get-buffer-create "*POP3 DEBUG*") - (goto-char (point-max)) - (if elmo-pop3-debug-inhibit-logging - (insert "NO LOGGING\n") + (let ((biff (string-match "BIFF-" (buffer-name))) + pos) + (with-current-buffer (get-buffer-create (concat "*POP3 DEBUG*" + (if biff "BIFF"))) + (goto-char (point-max)) + (setq pos (point)) (insert (apply 'format message args) "\n"))))) ;;; ELMO POP3 folder @@ -149,15 +149,13 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (when (memq (process-status (elmo-network-session-process-internal session)) '(open run)) - (let ((buffer (process-buffer - (elmo-network-session-process-internal session)))) - (elmo-pop3-send-command (elmo-network-session-process-internal session) - "quit") - ;; process is dead. - (or (elmo-pop3-read-response - (elmo-network-session-process-internal session) - t) - (error "POP error: QUIT failed")))) + (elmo-pop3-send-command (elmo-network-session-process-internal session) + "quit") + ;; process is dead. + (or (elmo-pop3-read-response + (elmo-network-session-process-internal session) + t) + (error "POP error: QUIT failed"))) (kill-buffer (process-buffer (elmo-network-session-process-internal session))) (delete-process (elmo-network-session-process-internal session)))) @@ -167,15 +165,20 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") nil (elmo-pop3-folder-use-uidl-internal folder)))) - (elmo-network-get-session 'elmo-pop3-session "POP3" folder if-exists))) - -(defun elmo-pop3-send-command (process command &optional no-erase) + (elmo-network-get-session 'elmo-pop3-session + (concat + (if (elmo-folder-biff-internal folder) + "BIFF-") + "POP3") + folder if-exists))) + +(defun elmo-pop3-send-command (process command &optional no-erase no-log) (with-current-buffer (process-buffer process) (unless no-erase (erase-buffer)) (goto-char (point-min)) (setq elmo-pop3-read-point (point)) - (elmo-pop3-debug "SEND: %s\n" command) + (elmo-pop3-debug "SEND: %s\n" (if no-log "" command)) (process-send-string process command) (process-send-string process "\r\n"))) @@ -220,8 +223,7 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") return-value))) (defun elmo-pop3-process-filter (process output) - (save-excursion - (set-buffer (process-buffer process)) + (with-current-buffer (process-buffer process) (goto-char (point-max)) (insert output) (elmo-pop3-debug "RECEIVED: %s\n" output) @@ -240,18 +242,24 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") ;; try USER/PASS (elmo-pop3-send-command process - (format "user %s" (elmo-network-session-user-internal session))) + (format "user %s" (elmo-network-session-user-internal session)) + nil 'no-log) (or (elmo-pop3-read-response process t) - (signal 'elmo-authenticate-error - '(elmo-pop-auth-user))) + (progn + (delete-process process) + (signal 'elmo-authenticate-error + '(elmo-pop-auth-user)))) (elmo-pop3-send-command process (format "pass %s" (elmo-get-passwd - (elmo-network-session-password-key session)))) + (elmo-network-session-password-key session))) + nil 'no-log) (or (elmo-pop3-read-response process t) - (signal 'elmo-authenticate-error - '(elmo-pop-auth-user))))) + (progn + (delete-process process) + (signal 'elmo-authenticate-error + '(elmo-pop-auth-user)))))) (defun elmo-pop3-auth-apop (session) (if (string-match "^\+OK .*\\(<[^\>]+>\\)" @@ -267,12 +275,15 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") 1 (elmo-network-session-greeting-internal session)) (elmo-get-passwd - (elmo-network-session-password-key session)))))) + (elmo-network-session-password-key session))))) + nil 'no-log) (or (elmo-pop3-read-response (elmo-network-session-process-internal session) t) - (signal 'elmo-authenticate-error - '(elmo-pop3-auth-apop)))) + (progn + (delete-process (elmo-network-session-process-internal session)) + (signal 'elmo-authenticate-error + '(elmo-pop3-auth-apop))))) (signal 'elmo-open-error '(elmo-pop3-auth-apop)))) (luna-define-method elmo-network-initialize-session-buffer :after @@ -314,7 +325,6 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (with-current-buffer (process-buffer (elmo-network-session-process-internal session)) (let* ((process (elmo-network-session-process-internal session)) - (elmo-pop3-debug-inhibit-logging t) (auth (elmo-network-session-auth-internal session)) (auth (mapcar '(lambda (mechanism) (upcase (symbol-name mechanism))) (if (listp auth) auth (list auth)))) @@ -355,7 +365,8 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (concat " " (elmo-base64-encode-string - (sasl-step-data step) 'no-line-break))))) ;) + (sasl-step-data step) 'no-line-break)))) + nil 'no-log) (catch 'done (while t (unless (setq response (elmo-pop3-read-response process t)) @@ -383,7 +394,7 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"") (if (sasl-step-data step) (elmo-base64-encode-string (sasl-step-data step) 'no-line-break) - ""))))))))) + "") nil 'no-log)))))))) (luna-define-method elmo-network-setup-session ((session elmo-pop3-session)) diff --git a/elmo/elmo.el b/elmo/elmo.el index e4bf81f..95a3f26 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -109,6 +109,7 @@ If a folder name begins with PREFIX, use BACKEND." message-modified ; message is modified. mark-modified ; mark is modified. process-duplicates ; read or hide + biff ; folder for biff )) (luna-define-internal-accessors 'elmo-folder)) diff --git a/wl/ChangeLog b/wl/ChangeLog index 2f0a579..d0d79fc 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,30 @@ +2001-12-21 Katsumi Yamaoka + + * wl-draft.el (wl-draft-elide-region): New user command. + * wl-vars.el (wl-draft-elide-ellipsis): New user option. + + * wl-e21.el (wl-draft-key-setup): Bind the key `C-c C-d' to the + command `wl-draft-elide-region'. + * wl-mule.el: Ditto. + * wl-xmas.el: Ditto. + +2001-12-20 Yuuichi Teranishi + + * wl-util.el (wl-biff-check-folder): Fix for non-pop3 folders. + (wl-biff-check-folder-async): Removed needless let. + +2001-12-19 Yuuichi Teranishi + + * wl-util.el (wl-biff-check-folders): Set `no-cache' argument of + wl-folder-get-elmo-folder. + (wl-biff-check-folder): Set `biff' argument of + `wl-folder-check-one-entity'. + (wl-biff-check-folder-async): Setup `biff' slot of folder. + + * wl-folder.el (wl-folder-get-elmo-folder): Added `no-cache' argument. + (wl-folder-check-one-entity): Added `biff' argument; + Setup `biff' slot of folder. + 2001-12-18 Yuuichi Teranishi * wl-fldmgr.el (wl-fldmgr-add-completion-all-completions): Removed diff --git a/wl/wl-draft.el b/wl/wl-draft.el index d6d28d7..7477196 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -732,6 +732,15 @@ Reply to author if WITH-ARG is non-nil." (mail-position-on-field "to")) (insert "\nFcc: ")) +;; Imported from message.el. +(defun wl-draft-elide-region (b e) + "Elide the text in the region. +An ellipsis (from `wl-draft-elide-ellipsis') will be inserted where the +text was killed." + (interactive "r") + (kill-region b e) + (insert wl-draft-elide-ellipsis)) + ;; function for wl-sent-message-via (defmacro wl-draft-sent-message-p (type) diff --git a/wl/wl-e21.el b/wl/wl-e21.el index 579749c..a9f48e2 100644 --- a/wl/wl-e21.el +++ b/wl/wl-e21.el @@ -610,7 +610,8 @@ Special commands: (define-key wl-draft-mode-map "\C-c\C-p" 'wl-draft-preview-message) (define-key wl-draft-mode-map "\C-c\C-a" 'wl-addrmgr) (define-key wl-draft-mode-map "\C-x\C-s" 'wl-draft-save) - (define-key wl-draft-mode-map "\C-xk" 'wl-draft-mimic-kill-buffer)) + (define-key wl-draft-mode-map "\C-xk" 'wl-draft-mimic-kill-buffer) + (define-key wl-draft-mode-map "\C-c\C-d" 'wl-draft-elide-region)) (defun wl-draft-overload-functions () (wl-mode-line-buffer-identification) diff --git a/wl/wl-folder.el b/wl/wl-folder.el index 9722be7..523f7b1 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -305,13 +305,15 @@ (setq li (cdr li)))))))) ;;; ELMO folder structure with cache. -(defmacro wl-folder-get-elmo-folder (entity) +(defmacro wl-folder-get-elmo-folder (entity &optional no-cache) "Get elmo folder structure from entity." - (` (or (wl-folder-elmo-folder-cache-get (, entity)) - (let* ((name (elmo-string (, entity))) - (folder (elmo-make-folder name))) - (wl-folder-elmo-folder-cache-put name folder) - folder)))) + (` (if (, no-cache) + (elmo-make-folder (elmo-string (, entity))) + (or (wl-folder-elmo-folder-cache-get (, entity)) + (let* ((name (elmo-string (, entity))) + (folder (elmo-make-folder name))) + (wl-folder-elmo-folder-cache-put name folder) + folder))))) (defmacro wl-folder-elmo-folder-cache-get (name &optional hashtb) "Returns a elmo folder structure associated with NAME from HASHTB. @@ -798,12 +800,14 @@ Optional argument ARG is repeart count." (run-hooks 'wl-folder-check-entity-hook) ret-val)) -(defun wl-folder-check-one-entity (entity) - (let* ((folder (wl-folder-get-elmo-folder entity)) +(defun wl-folder-check-one-entity (entity &optional biff) + (let* ((folder (wl-folder-get-elmo-folder entity biff)) (nums (condition-case err - (if (wl-string-match-member entity wl-strict-diff-folders) - (elmo-strict-folder-diff folder) - (elmo-folder-diff folder)) + (progn + (if biff (elmo-folder-set-biff-internal folder t)) + (if (wl-string-match-member entity wl-strict-diff-folders) + (elmo-strict-folder-diff folder) + (elmo-folder-diff folder))) (error ;; maybe not exist folder. (if (and (not (memq 'elmo-open-error diff --git a/wl/wl-mule.el b/wl/wl-mule.el index 065060a..e8540d3 100644 --- a/wl/wl-mule.el +++ b/wl/wl-mule.el @@ -158,7 +158,8 @@ Special commands: (define-key wl-draft-mode-map "\C-c\C-p" 'wl-draft-preview-message) (define-key wl-draft-mode-map "\C-x\C-s" 'wl-draft-save) (define-key wl-draft-mode-map "\C-c\C-a" 'wl-addrmgr) - (define-key wl-draft-mode-map "\C-xk" 'wl-draft-mimic-kill-buffer)) + (define-key wl-draft-mode-map "\C-xk" 'wl-draft-mimic-kill-buffer) + (define-key wl-draft-mode-map "\C-c\C-d" 'wl-draft-elide-region)) (defun wl-draft-overload-menubar () (local-set-key [menu-bar mail send] diff --git a/wl/wl-util.el b/wl/wl-util.el index d591fd6..aae027b 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -818,7 +818,7 @@ This function is imported from Emacs 20.7." folder) (if (eq (length flist) 1) (wl-biff-check-folder-async (wl-folder-get-elmo-folder - (car flist)) (interactive-p)) + (car flist) 'biff) (interactive-p)) (unwind-protect (while flist (setq folder (wl-folder-get-elmo-folder (car flist)) @@ -833,12 +833,10 @@ This function is imported from Emacs 20.7." (defun wl-biff-check-folder (folder) (if (eq (elmo-folder-type-internal folder) 'pop3) (unless (elmo-pop3-get-session folder 'if-exists) - ;; Currently no main pop3 process. - (let ((elmo-network-session-name-prefix "BIFF-")) - (wl-folder-check-one-entity - (elmo-folder-name-internal folder)))) - (let ((elmo-network-session-name-prefix "BIFF-")) - (wl-folder-check-one-entity (elmo-folder-name-internal folder))))) + (wl-folder-check-one-entity (elmo-folder-name-internal folder) + 'biff)) + (wl-folder-check-one-entity (elmo-folder-name-internal folder) + 'biff))) (defun wl-biff-check-folder-async-callback (diff data) (if (nth 1 data) @@ -856,6 +854,7 @@ This function is imported from Emacs 20.7." (defun wl-biff-check-folder-async (folder notify-minibuf) (when (elmo-folder-plugged-p folder) + (elmo-folder-set-biff-internal folder t) (if (and (eq (elmo-folder-type-internal folder) 'imap4) (elmo-folder-use-flag-p folder)) ;; Check asynchronously only when IMAP4 and use server diff. @@ -866,8 +865,7 @@ This function is imported from Emacs 20.7." (list (elmo-folder-name-internal folder) (get-buffer wl-folder-buffer-name) notify-minibuf)) - (let ((elmo-network-session-name-prefix "BIFF-")) - (elmo-folder-diff-async folder))) + (elmo-folder-diff-async folder)) (unwind-protect (wl-biff-notify (car (wl-biff-check-folder folder)) notify-minibuf) diff --git a/wl/wl-vars.el b/wl/wl-vars.el index 369d324..52f9c6e 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -952,6 +952,11 @@ ex. :group 'wl-draft :group 'wl-setting) +(defcustom wl-draft-elide-ellipsis "\n[...]\n\n" + "*The string which is inserted for elided text." + :type 'string + :group 'wl-draft) + (defcustom wl-template-alist nil "Alist of template." :type '(repeat (list (string :tag "Name") diff --git a/wl/wl-version.el b/wl/wl-version.el index 7b427f3..d50ca77 100644 --- a/wl/wl-version.el +++ b/wl/wl-version.el @@ -46,7 +46,7 @@ "Wanderlust" nil (eval-when-compile (product-version (product-find 'elmo-version))) ; equals to ELMO version. - "Something-pre")) + "Something-pre2")) (defconst wl-version-status nil "Wanderlust verstion status. For override default rule. diff --git a/wl/wl-xmas.el b/wl/wl-xmas.el index b60ba74..2799c53 100644 --- a/wl/wl-xmas.el +++ b/wl/wl-xmas.el @@ -514,7 +514,8 @@ Special commands: (define-key wl-draft-mode-map "\C-c\C-p" 'wl-draft-preview-message) (define-key wl-draft-mode-map "\C-x\C-s" 'wl-draft-save) (define-key wl-draft-mode-map "\C-c\C-a" 'wl-addrmgr) - (define-key wl-draft-mode-map "\C-xk" 'wl-draft-mimic-kill-buffer)) + (define-key wl-draft-mode-map "\C-xk" 'wl-draft-mimic-kill-buffer) + (define-key wl-draft-mode-map "\C-c\C-d" 'wl-draft-elide-region)) (defun wl-draft-overload-functions () (wl-mode-line-buffer-identification) -- 1.7.10.4