;ELC ;;; compiled by jimb@geech.gnu.ai.mit.edu on Mon Jul 5 23:38:23 1993 ;;; from file /gd/gnu/emacs/19.0/lisp/mhspool.el ;;; emacs version 19.15.16. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19")) (require (quote nntp)) (defvar mhspool-list-folders-method (quote mhspool-list-folders-using-sh) "\ *Function to list files in folders. The function should accept a directory as its argument, and fill the current buffer with file and directory names. The output format must be the same as that of 'ls -R1'. Two functions mhspool-list-folders-using-ls and mhspool-list-folders-using-sh are provided now. I suppose the later is faster.") (defvar mhspool-list-directory-switches (quote ("-R")) "\ *Switches for mhspool-list-folders-using-ls to pass to `ls' for getting file lists. One entry should appear on one line. You may need to add `-1' option.") (defconst mhspool-version "MHSPOOL 1.8" "\ Version numbers of this version of MHSPOOL.") (defvar mhspool-spool-directory "~/Mail" "\ Private mail directory.") (defvar mhspool-current-directory nil "\ Current news group directory.") (defalias 'mhspool-retrieve-headers #[(sequence) "q\nG \n   \n\n@  !P!b!b !eb#e`}eb#oۉ#^ebceb#``){eb#``){\n\neb#``){  eb#``){eb#``){!db~`d\")eb#``){!eb#4#@``){B b b \n  & B \nA T ,',V' U' _\"',,V! . " [nntp-server-buffer nil sequence 0 references date lines xref from message-id subject article headers count number file mhspool-current-directory prin1-to-string file-exists-p file-directory-p erase-buffer insert-file-contents search-forward "\n\n" move re-search-forward "\\( ?\n[ ]+\\)+" t replace-match " " "\n" "\nFrom: " "(Unknown User)" "\nSubject: " "(None)" "\nMessage-ID: " "\nDate: " "\nLines: " string-to-int count-lines "\nXref: " "\nReferences: " "\nIn-Reply-To: " vector nntp-large-newsgroup 20 message "MHSPOOL: Receiving headers... %d%%" 100 "MHSPOOL: Receiving headers... done"] 12 "\ Return list of article headers specified by SEQUENCE of article id. The format of list is `([NUMBER SUBJECT FROM XREF LINES DATE MESSAGE-ID REFERENCES] ...)'. If there is no References: field, In-Reply-To: field is used instead. Reader macros for the vector are defined as `nntp-header-FIELD'. Writer macros for the vector are defined as `nntp-set-header-FIELD'. Newsgroup must be selected before calling this."]) (defalias 'mhspool-open-server #[(host &optional service) "!\"'ɔɕO\"\"! * ;O ;O !O O\"p ` \"pjp\" *" [host getenv "NNTPSERVER" nil status string-match ":\\(.+\\)$" file-name-as-directory expand-file-name 1 "~/" mhspool-spool-directory system-name "" nntp-status-string file-directory-p mhspool-open-server-internal service format "No such directory: %s. Goodbye." "NNTP server is not specified." "MHSPOOL: cannot talk to %s."] 6 "\ Open news server on HOST. If HOST is nil, use value of environment variable `NNTPSERVER'. If optional argument SERVICE is non-nil, open by the service name."]) (defalias 'mhspool-close-server #[nil " " [mhspool-close-server-internal] 1 "\ Close news server."]) (byte-code "KM" [mhspool-request-quit mhspool-close-server] 2) (defalias 'mhspool-server-opened #[nil "!" [nntp-server-buffer get-buffer] 2 "\ Return server process status, T or NIL. If the stream is opened, return T, otherwise return NIL."]) (defun mhspool-status-message nil "\ Return server status response as string." nntp-status-string) (defalias 'mhspool-request-article #[(id) "\n!P; ! !? !))" [mhspool-current-directory prin1-to-string id file file-exists-p file-directory-p mhspool-find-file] 4 "\ Select article by message ID (or number)."]) (defalias 'mhspool-request-body #[(id) " !\nqeb#e`|)Ƈ" [mhspool-request-article id nntp-server-buffer search-forward "\n\n" nil t] 4 "\ Select article body by message ID (or number)."]) (defalias 'mhspool-request-head #[(id) " !\nqeb#`Sd|)Ƈ" [mhspool-request-article id nntp-server-buffer search-forward "\n\n" nil t] 4 "\ Select article head by message ID (or number)."]) (defalias 'mhspool-request-stat #[(id) "‡" ["MHSPOOL: STAT is not implemented." nntp-status-string nil] 1 "\ Select article by message ID (or number)."]) (defalias 'mhspool-request-group #[(group) "\n!!\n!\n#!!#\n#!" [file-directory-p mhspool-article-pathname group mhspool-current-directory mhspool-replace-chars-in-string 46 47] 6 "\ Select news GROUP."]) (defalias 'mhspool-request-list #[nil " \"!!Q\n! q  q !eb\n#Ԕԕ{#ymj!j!d۔ە{!\nByJ\n2 \n\"\n\"$\"2 !q ." [nil newsgroup articles file-name-as-directory expand-file-name mhspool-spool-directory directory "^" regexp-quote "\\(.+\\):$" folder-regexp get-buffer-create " *MHSPOOL File List*" buffer nntp-server-buffer erase-buffer mhspool-list-folders-method re-search-forward t mhspool-replace-chars-in-string 1 47 46 looking-at "^$" "^[0-9]+$" string-to-int 0 princ format "%s %d %d n\n" apply max min kill-buffer buffer-size] 8 "\ List active newsgoups."]) (defalias 'mhspool-request-list-newsgroups #[nil "‡" ["MHSPOOL: LIST NEWSGROUPS is not implemented." nntp-status-string nil] 1 "\ List newsgoups (defined in NNTP2)."]) (defalias 'mhspool-request-list-distributions #[nil "‡" ["MHSPOOL: LIST DISTRIBUTIONS is not implemented." nntp-status-string nil] 1 "\ List distributions (defined in NNTP2)."]) (defalias 'mhspool-request-last #[nil "‡" ["MHSPOOL: LAST is not implemented." nntp-status-string nil] 1 "\ Set current article pointer to the previous article in the current news group."]) (defalias 'mhspool-request-next #[nil "‡" ["MHSPOOL: NEXT is not implemented." nntp-status-string nil] 1 "\ Advance current article pointer."]) (defalias 'mhspool-request-post #[nil "‡" ["MHSPOOL: POST: what do you mean?" nntp-status-string nil] 1 "\ Post a new news in current buffer."]) (defalias 'mhspool-open-server-internal #[(host &optional service) " \"!qp!   !)ʇ" [host system-name error "MHSPOOL: cannot talk to %s." get-buffer-create " *nntpd*" nntp-server-buffer buffer-flush-undo erase-buffer kill-all-local-variables t case-fold-search nil nntp-server-process nntp-server-name run-hooks nntp-server-hook] 4 "\ Open connection to news server on HOST by SERVICE (default is nntp)."]) (defalias 'mhspool-close-server-internal #[nil "!‰" [nntp-server-buffer kill-buffer nil nntp-server-process] 2 "\ Close connection to news server."]) (defalias 'mhspool-find-file #[(file) "q ď" [nntp-server-buffer erase-buffer nil (byte-code " !eb#`d{Ƙ!Ň" [insert-file-contents file search-forward "\n\n" nil t " " delete-char 1] 4) ((file-error))] 3 "\ Insert FILE in server buffer safely."]) (defalias 'mhspool-article-pathname #[(group) " !\nQ" [file-name-as-directory mhspool-spool-directory group "/"] 3 "\ Make pathname for GROUP."]) (defalias 'mhspool-replace-chars-in-string #[(string from to) "OG W% H U I T +" [string 0 nil idx len from to] 4 "\ Replace characters in STRING from FROM to TO."]) (defalias 'mhspool-list-folders-using-ls #[(directory) "C\"&" [apply call-process "ls" nil t append mhspool-list-directory-switches directory] 9 "\ List files in folders under DIRECTORY using 'ls'."]) (defalias 'mhspool-list-folders-using-sh #[(directory) "p!\nq DZed &*\n!*" [get-buffer-create " *MHSPOOL Shell Script Buffer*" script buffer erase-buffer "PS2=\n ffind() {\n cd $1; echo $1:\n ls -1\n echo\n for j in `echo *[a-zA-Z]*`\n do\n if [ -d $1/$j ]; then\n ffind $1/$j\n fi\n done\n }\n cd " directory "; ffind `pwd`; exit 0\n" call-process-region "sh" nil kill-buffer] 7 "\ List files in folders under DIRECTORY using '/bin/sh'."]) (provide (quote mhspool))