;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Mon Apr 17 19:46:59 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/mhspool.el ;;; emacs version 19.28.90.26. ;;; 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 "`/gd/gnu/emacs/19.0/lisp/mhspool.el' was compiled for Emacs 19")) (require (quote nntp)) #@338 *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-folders-method (quote mhspool-list-folders-using-sh) (#$ . -507)) #@155 *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. (defvar mhspool-list-directory-switches (quote ("-R")) (#$ . -938)) #@45 Version numbers of this version of MHSPOOL. (defconst mhspool-version "MHSPOOL 1.8" (#$ . 1166)) #@25 Private mail directory. (defvar mhspool-spool-directory "~/Mail" (#$ . 1269)) #@31 Current news group directory. (defvar mhspool-current-directory nil (#$ . 1353)) #@413 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-retrieve-headers #[(sequence) "q\nG \n \f \n\n@  !P!b!b !eb#e`}eb#oۉ#^ebceb#``){eb#``){\n\neb#``){  eb#``){eb#``){!db~`d\")eb#``){!eb#4#@``){B b b \n  \f&\fB\f\nA T ,',V' U' _\"',,V!\f. " [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 (#$ . 1441)]) #@158 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-open-server #[(host &optional service) "!\"'ɔɕO\"\"! * ;O ;O !O O\"p ` \"pjp\"\f*" [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 (#$ . 2964)]) #@20 Close news server. (defalias 'mhspool-close-server #[nil " " [mhspool-close-server-internal] 1 (#$ . 3653)]) (byte-code "KM" [mhspool-request-quit mhspool-close-server] 2) #@98 Return server process status, T or NIL. If the stream is opened, return T, otherwise return NIL. (defalias 'mhspool-server-opened #[nil "!" [nntp-server-buffer get-buffer] 2 (#$ . 3836)]) #@42 Return server status response as string. (defalias 'mhspool-status-message #[nil "" [nntp-status-string] 1 (#$ . 4037)]) #@43 Select article by message ID (or number). (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 (#$ . 4166)]) #@48 Select article body 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 (#$ . 4408)]) #@48 Select article head 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 (#$ . 4624)]) #@43 Select article by message ID (or number). (defalias 'mhspool-request-stat #[(id) "‡" ["MHSPOOL: STAT is not implemented." nntp-status-string nil] 1 (#$ . 4841)]) #@20 Select news GROUP. (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 (#$ . 5012)]) #@24 List active newsgoups. (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 (#$ . 5253)]) #@36 List newsgoups (defined in NNTP2). (defalias 'mhspool-request-list-newsgroups #[nil "‡" ["MHSPOOL: LIST NEWSGROUPS is not implemented." nntp-status-string nil] 1 (#$ . 5913)]) #@40 List distributions (defined in NNTP2). (defalias 'mhspool-request-list-distributions #[nil "‡" ["MHSPOOL: LIST DISTRIBUTIONS is not implemented." nntp-status-string nil] 1 (#$ . 6098)]) #@80 Set current article pointer to the previous article in the current news group. (defalias 'mhspool-request-last #[nil "‡" ["MHSPOOL: LAST is not implemented." nntp-status-string nil] 1 (#$ . 6293)]) #@34 Advance current article pointer. (defalias 'mhspool-request-next #[nil "‡" ["MHSPOOL: NEXT is not implemented." nntp-status-string nil] 1 (#$ . 6500)]) #@36 Post a new news in current buffer. (defalias 'mhspool-request-post #[nil "‡" ["MHSPOOL: POST: what do you mean?" nntp-status-string nil] 1 (#$ . 6661)]) #@70 Open connection to news server on HOST by SERVICE (default is nntp). (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 (#$ . 6823)]) #@34 Close connection to news server. (defalias 'mhspool-close-server-internal #[nil "!‰" [nntp-server-buffer kill-buffer nil nntp-server-process] 2 (#$ . 7278)]) #@38 Insert FILE in server buffer safely. (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 "\f" delete-char 1] 4) ((file-error))] 3 (#$ . 7454)]) #@26 Make pathname for GROUP. (defalias 'mhspool-article-pathname #[(group) " !\nQ" [file-name-as-directory mhspool-spool-directory group "/"] 3 (#$ . 7739)]) #@47 Replace characters in STRING from FROM to TO. (defalias 'mhspool-replace-chars-in-string #[(string from to) "OG \fW% H U I T +" [string 0 nil idx len from to] 4 (#$ . 7902)]) #@51 List files in folders under DIRECTORY using 'ls'. (defalias 'mhspool-list-folders-using-ls #[(directory) "C\"&" [apply call-process "ls" nil t append mhspool-list-directory-switches directory] 9 (#$ . 8107)]) #@56 List files in folders under DIRECTORY using '/bin/sh'. (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 (#$ . 8335)]) (provide (quote mhspool))