;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\207" [require mh-e gnus-util imenu] 2) #@40 Cached value of chosen search program. (defvar mh-searcher nil (#$ . 495)) #@45 Function which executes the search program. (defvar mh-search-function nil (#$ . 576)) #@150 Function to parse the next line of output. Expected to return a list of three strings: name of the folder, message number, and optionally the match. (defvar mh-search-next-result-function nil (#$ . 670)) #@43 Function used to construct search regexp. (defvar mh-search-regexp-builder nil (#$ . 880)) #@69 Folder that contains the folders resulting from the index searches. (defvar mh-index-folder "+mhe-index" (#$ . 977)) #@64 Subfolder for `mh-index-folder' where flists output is placed. (defvar mh-flists-results-folder "sequence" (#$ . 1100)) (defvar mh-flists-called-flag nil) #@4914 Search your MH mail. This command helps you find messages in your entire corpus of mail. You can search for messages to or from a particular person or about a particular subject. In fact, you can also search for messages containing selected strings in any arbitrary header field or any string found within the messages. Out of the box, MH-E uses "pick" to find messages. With a little extra effort, you can set an indexing program which rewards you with extremely quick results. The drawback is that sometimes the index does not contain the words you're looking for. You can still use "pick" in these situations. You are prompted for the FOLDER to search. This can be "all" to search all folders. Note that the search works recursively on the listed folder. Next, an MH-Search buffer appears where you can enter search criteria SEARCH-REGEXP. From: To: Cc: Date: Subject: -------- Edit this template by entering your search criteria in an appropriate header field that is already there, or create a new field yourself. If the string you're looking for could be anywhere in a message, then place the string underneath the row of dashes. As an example, let's say that we want to find messages from Ginnean about horseback riding in the Kosciusko National Park (Australia) during January, 1994. Normally we would start with a broad search and narrow it down if necessary to produce a manageable amount of data, but we'll cut to the chase and create a fairly restrictive set of criteria as follows:\ From: ginnean To: Cc: Date: Jan 1994 Subject: -------- horse kosciusko As with MH-Letter mode, MH-Search provides commands like \[mh-to-field] to help you fill in the blanks.\ If you find that you do the same thing over and over when editing the search template, you may wish to bind some shortcuts to keys. This can be done with the variable `mh-search-mode-hook', which is called when \[mh-search] is run on a new pattern.\ To perform the search, type \[mh-index-do-search]. Sometimes you're searching for text that is either not indexed, or hasn't been indexed yet. In this case you can override the default method with the pick method by running the command \[mh-pick-do-search]. The messages that are found are put in a temporary sub-folder of "+mhe-index" and are displayed in an MH-Folder buffer. This buffer is special because it displays messages from multiple folders; each set of messages from a given folder has a heading with the folder name.\ The appearance of the heading can be modified by customizing the face `mh-search-folder'. You can jump back and forth between the headings using the commands \[mh-index-next-folder] and \[mh-index-previous-folder]. In addition, the command \[mh-index-visit-folder] can be used to visit the folder of the message at point. Initially, only the messages that matched the search criteria are displayed in the folder. While the temporary buffer has its own set of message numbers, the actual messages numbers are shown in the visited folder. Thus, the command \[mh-index-visit-folder] is useful to find the actual message number of an interesting message, or to view surrounding messages with the command \[mh-rescan-folder]. Because this folder is temporary, you'll probably get in the habit of killing it when you're done with \[mh-kill-folder]. You can regenerate the results by running this command with a prefix argument REDO-SEARCH-FLAG. Note: This command uses an "X-MHE-Checksum:" header field to cache the MD5 checksum of a message. This means that if an incoming message already contains an "X-MHE-Checksum:" field, that message might not be found by this command. The following "procmail" recipe avoids this problem by renaming the existing header field: :0 wf | formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum" Configuring Indexed Searches The command \[mh-search] runs the command defined by the option `mh-search-program'. The default value is "Auto-detect" which means that MH-E will automatically choose one of "swish++", "swish-e", "mairix", "namazu", "pick" and "grep" in that order. If, for example, you have both "swish++" and "mairix" installed and you want to use "mairix", then you can set this option to "mairix". The documentation for the following commands describe how to set up the various indexing programs to use with MH-E. - `mh-swish++-execute-search' - `mh-swish-execute-search' - `mh-mairix-execute-search' - `mh-namazu-execute-search' - `mh-pick-execute-search' - `mh-grep-execute-search' In a program, if FOLDER is "+" or nil, then mail in all folders are searched. Optional argument WINDOW-CONFIG stores the window configuration that will be restored after the user quits the folder containing the index search results. (defalias 'mh-search #[(folder search-regexp &optional redo-search-flag window-config) "\3062h\203! \203!\n\203! \204!\307\310\311\f\"\210)\312\306\313\"\210 9\2032\31434\"\210\312\306\313\"\210\315 \210\3164\206=5\f\317\3206\321 !#789:\203z\f\203z\322p!\323!\210\212\324\313\325#\210)\324\313\326\327\330%\2107)\202\201\3317 \"7\317\332;\3333\334\"#\335\336\337\"\335\336\337\"<=>\340\341?\"\210@> \"\210\340\342?\"\210eb\210\313AB \211A\203\374A\343=\204\262\344A@=\"\204\341A@C=D\345C\335\336\337\"D#\210*AA@E\344A@=\"F\345E\307F#\210*\202\262)\346\347=\"\210\3507\313=\n" "where is the first letter of the desired field\n" "(except for From: which uses \"m\").")) (#$ . 16744)) (put 'mh-search-mode 'mode-class 'special) (defvar mh-search-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [mh-search-mode-hook variable-documentation put "Hook run after entering MH-Search mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp mh-search-mode-map definition-name mh-search-mode] 4) (defvar mh-search-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\317#\207" [mh-search-mode-abbrev-table mh-search-mode-map variable-documentation put purecopy "Keymap for `mh-search-mode'." boundp mh-search-mode-syntax-table definition-name mh-search-mode (lambda (#1=#:def-tmp-var) (defvar mh-search-mode-syntax-table #1#)) make-syntax-table "Syntax table for `mh-search-mode'." (lambda (#1#) (defvar mh-search-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `mh-search-mode'." derived-mode-parent] 5) #@672 Mode for creating search templates in MH-E.\ Edit this template by entering your search criteria in an appropriate header field that is already there, or create a new field yourself. If the string you're looking for could be anywhere in a message, then place the string underneath the row of dashes. To perform the search, type \[mh-index-do-search]. Sometimes you're searching for text that is either not indexed, or hasn't been indexed yet. In this case you can override the default method with the pick method by running the command \[mh-pick-do-search]. The hook `mh-search-mode-hook' is called upon entry to this mode. \{mh-search-mode-map} (defalias 'mh-search-mode #[nil "\306\300!\210\307\310 \210\311\312\313 !\210\314\f!\210 \315!\210\316!\210)\317\320!\207" [delay-mode-hooks major-mode mode-name mh-search-mode-map mh-search-mode-syntax-table mh-search-mode-abbrev-table make-local-variable t kill-all-local-variables mh-search-mode "MH-Search" use-local-map set-syntax-table easy-menu-add mh-set-help run-mode-hooks mh-search-mode-hook local-abbrev-table mh-pick-menu mh-search-mode-help-messages] 2 (#$ . 18681) nil]) #@123 Find messages using `mh-search-program'. If optional argument SEARCHER is present, use it instead of `mh-search-program'. (defalias 'mh-index-do-search #[(&optional searcher) "\306!\204\n\307\310!\210\311 \n !\211\203\312\f \313 $\202!\307\314!*\207" [searcher regexp-list mh-search-regexp-builder pattern mh-current-folder mh-previous-window-config mh-search-choose error "No search program found" mh-pick-parse-search-buffer mh-search nil "No search terms"] 6 (#$ . 19854) nil]) #@90 Find messages using "pick". Uses the pick method described in `mh-pick-execute-search'. (defalias 'mh-pick-do-search #[nil "\300\301!\207" [mh-index-do-search pick] 2 (#$ . 20348) nil]) #@214 Parse the search buffer contents. The function returns an alist. The car of each element is either the header name to search in or nil to search the whole message. The cdr of the element is the pattern to search. (defalias 'mh-pick-parse-search-buffer #[nil "\212\304\211\211\211eb\210m\204R\305\306\307 \310#\203\310\202L\311 \210`\n\203+`\2023\305\312\307 \310#\210`\n?\205A\313\314 S\"\227!\315\314 \307 \"!B B\304y\210\202\f -\207" [begin start in-body-flag pattern-list nil search-forward "--------" mh-line-end-position t beginning-of-line ":" intern buffer-substring-no-properties mh-index-parse-search-regexp] 5 (#$ . 20542)]) #@174 Construct parse tree for INPUT-STRING. All occurrences of &, |, ! and ~ in INPUT-STRING are replaced by AND, OR and NOT as appropriate. Then the resulting string is parsed. (defalias 'mh-index-parse-search-regexp #[(input-string) "\306\307\310!r q\210\311\216\nc\210\312\313\314\"\210\312\315\316\"\210\312\317\316\"\210\312\320\316\"\210\312\321\322\"\210\312\323\322\"\210\312\324\322\"\210\312\325\326\"\210\312\327\326\"\210\312\330\326\"\210\312\331\326\"\210\312\332\333\"\210\312\334\333\"\210\312\335\336\"\210\312\337\336\"\210\340\341ed{\"+\342\343!!\306\211\211\211-\306.\211/\2039/@\211.\344\267\202\343\345 B\2020\346 B\2020\347 B\2020\350 B\2020\351\352 \f\"!\2110@0A@) @\346=\203\305 A\346\f\211A\242D\fB @\350=\2030 A\f\211A\242\350\f\211A\242 E\fB\2020 @\346=\203 A\346.D\fB @\350=\2030 A\f\211A\242\350\f\211A\242 E\fB\2020 @\350=\203+ A\350\f\211A\242.E\fB\2020.\fB/A\211/\204y*\f\211A\242 \204G\f\203L\353\354\"\210-\207" [input #1=#:temp-buffer input-string oper1 operand-stack op-stack nil generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] mh-replace-string " " " " " AND " " and " "&" " -and " " OR " " or " "|" " -or " " NOT " " not " "!" "~" " -not " "(" " ( " " -lbrace " ")" " ) " " -rbrace " format "( %s )" mh-index-add-implicit-ops split-string #s(hash-table size 5 test equal rehash-size 1.5 rehash-threshold 0.8125 purecopy t data ("(" 132 "not" 139 "or" 146 "and" 153 ")" 160)) paren not or and cl-values-list mh-index-evaluate error "Invalid regexp: %s" tokens token --dolist-tail-- #2=#:--cl-var--] 5 (#$ . 21201)]) #@44 Add implicit operators in the list TOKENS. (defalias 'mh-index-add-implicit-ops #[(tokens) "\304\211\211 \203N \211A\242\211\305\232\204\"\306\232\204\"\307\232\203+\304\nB\202 \2039\306\nB\211\2039\304\nB\310\232\204\311\232\204\312\202\n\237+\207" [current literal-seen result tokens nil ")" "and" "or" "(" "not" t] 4 (#$ . 22866)]) #@74 Read expression till starting paren based on OP-STACK and OPERAND-STACK. (defalias 'mh-index-evaluate #[(op-stack operand-stack) "\3042T\305\211\n\203O\n\211A\242\211\306\267\202/\307\304\n D\"\210\202\310 \211A\242D B\202 \311=\204; \312=\203 \211A\242 \211A\242E B\202\313\314!*0\207" [oper1 op op-stack operand-stack --cl-block-mh-index-evaluate-- nil #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (paren 24 not 34)) throw not and or error "Ran out of tokens"] 5 (#$ . 23238)]) #@36 List of possible searcher choices. (defvar mh-search-choices '((swish++ mh-swish++-binary mh-swish++-execute-search mh-swish++-next-result mh-swish++-regexp-builder) (swish mh-swish-binary mh-swish-execute-search mh-swish-next-result nil) (mairix mh-mairix-binary mh-mairix-execute-search mh-mairix-next-result mh-mairix-regexp-builder) (namazu mh-namazu-binary mh-namazu-execute-search mh-namazu-next-result nil) (pick mh-pick-binary mh-pick-execute-search mh-pick-next-result mh-pick-regexp-builder) (grep mh-grep-binary mh-grep-execute-search mh-grep-next-result nil)) (#$ . 23788)) #@328 Choose a searching function. The side-effects of this function are that the variables `mh-searcher', `mh-search-function', and `mh-search-next-result-function' are set according to the first searcher in `mh-search-choices' present on the system. If optional argument SEARCHER is present, use it instead of `mh-search-program'. (defalias 'mh-search-choose #[(&optional searcher) "\3062Q\203\307 \"C\202\n\203\307\n \"C\202  \203N \211A\242\211A@J\211\203J\f@ \310\f8\311\f8\312\f8\313\306 \"\210*\202)\3140\207" [searcher mh-search-choices mh-search-program program-alist current executable --cl-block-nil-- assoc 2 3 4 throw nil mh-searcher mh-search-function mh-search-next-result-function mh-search-regexp-builder] 4 (#$ . 24381)]) (defvar mh-swish++-binary (byte-code "\300\301!\206 \300\302!\207" [executable-find "search++" "search"] 2)) (defvar mh-swish++-directory ".swish++") (defvar mh-swish-folder nil) #@1222 Execute swish++. In the examples below, replace "/home/user/Mail" with the path to your MH directory. First create the directory "/home/user/Mail/.swish++". Then create the file "/home/user/Mail/.swish++/swish++.conf" with the following contents: IncludeMeta Bcc Cc Comments Content-Description From Keywords IncludeMeta Newsgroups Resent-To Subject To IncludeMeta Message-Id References In-Reply-To IncludeFile Mail * IndexFile /home/user/Mail/.swish++/swish++.index Use the following command line to generate the swish index. Run this daily from cron: find /home/user/Mail -path /home/user/Mail/mhe-index -prune \ -o -path /home/user/Mail/.swish++ -prune \ -o -name "[0-9]*" -print \ | index -c /home/user/Mail/.swish++/swish++.conf - This command does not index the folders that hold the results of your searches in "+mhe-index" since they tend to be ephemeral and the original messages are indexed anyway. On some systems (Debian GNU/Linux, for example), use "index++" instead of "index". In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search. (defalias 'mh-swish++-execute-search #[(folder-path search-regexp) "\306!q\210\307 \210 \204\310\311!\210\312 \313\314\313\315\316\317\320\n #\f&\210eb\210\321 \211GS\"\211\322\232\2035 \2029\317\323 \")\211\207" [mh-temp-index-buffer mh-swish++-binary mh-user-path mh-swish++-directory search-regexp folder-path get-buffer-create erase-buffer error "Set `mh-swish++-binary' appropriately" call-process nil (t nil) "-m" "10000" format "-i%s%s/swish++.index" substring "/" "%s/" last-char mh-swish-folder] 12 (#$ . 25330)]) (defalias 'mh-swish++-next-result 'mh-swish-next-result) #@75 Generate query for swish++. REGEXP-LIST is an alist of fields and values. (defalias 'mh-swish++-regexp-builder #[(regexp-list) "\304 \305\211\203M @\211A\203F\306\n@\203\307\202\304\n@\203*\310\n@!\202+\304\n@\2034\311\2025\304\312\nA!\n@\203B\313\202C\304\260 A\211\204\n*\314\315\")\207" [regexp regexp-list elem --dolist-tail-- "" nil " and " "(" symbol-name " = " mh-swish++-print-regexp ")" substring 4] 8 (#$ . 27147)]) #@48 Return infix expression corresponding to EXPR. (defalias 'mh-swish++-print-regexp #[(expr) ":\204\n\301\302\"\207@\303=\203\301\304\305A@!\"\207\301\306\305A@!\307@!\305AA@!$\207" [expr format "%s" not "(not %s)" mh-swish++-print-regexp "(%s %s %s)" symbol-name] 6 (#$ . 27601)]) (defvar mh-swish-binary (executable-find "swish-e")) (defvar mh-swish-directory ".swish") #@1515 Execute swish-e. In the examples below, replace "/home/user/Mail" with the path to your MH directory. First create the directory "/home/user/Mail/.swish". Then create the file "/home/user/Mail/.swish/config" with the following contents: DefaultContents TXT* IndexDir /home/user/Mail IndexFile /home/user/Mail/.swish/index IndexName "Mail Index" IndexDescription "Mail Index" IndexPointer "http://nowhere" IndexAdmin "nobody" #MetaNames automatic IndexReport 3 FollowSymLinks no UseStemming no IgnoreTotalWordCountWhenRanking yes WordCharacters abcdefghijklmnopqrstuvwxyz0123456789- BeginCharacters abcdefghijklmnopqrstuvwxyz EndCharacters abcdefghijklmnopqrstuvwxyz0123456789 IgnoreLimit 50 1000 IndexComments 0 FileRules filename contains \D FileRules pathname contains /home/user/Mail/.swish FileRules pathname contains /home/user/Mail/mhe-index This configuration does not index the folders that hold the results of your searches in "+mhe-index" since they tend to be ephemeral and the original messages are indexed anyway. If there are any directories you would like to ignore, append lines like the following to "config": FileRules pathname contains /home/user/Mail/scripts Use the following command line to generate the swish index. Run this daily from cron: swish-e -c /home/user/Mail/.swish/config In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search. (defalias 'mh-swish-execute-search #[(folder-path search-regexp) "\306!q\210\307 \210 \204\310\311!\210\312 \313\314\313\315\n\316\317\320 \f#&\210eb\210\321 \211GS\"\211\322\232\2035 \2029\317\323 \")\211\207" [mh-temp-index-buffer mh-swish-binary search-regexp mh-user-path mh-swish-directory folder-path get-buffer-create erase-buffer error "Set `mh-swish-binary' appropriately" call-process nil (t nil) "-w" "-f" format "%s%s/index" substring "/" "%s/" last-char mh-swish-folder] 13 (#$ . 27989)]) #@40 Get the next result from swish output. (defalias 'mh-swish-next-result #[nil "\3062\257m\204`f\307\232\203\310\306\311\"\210`f\312\232\203 \310\306\313\"\210\314\315\316 \317#\314\315\316 \317#\2036 \204;\310\306\313\"\210 S\320\321 \"!\204L\310\306\313\"\210\322\323\317#\204Y\310\306\313\"\210\321`T\"\324 \n\"\204k\310\306\313\"\210\324\f\n\"\203\211\325\225\nGSW\203\211\326\327\330\n\325\225\nGS#\"\202\215\310\306\313\")\321`T \"\3311\237\332\n!0\202\241\210\311\211\206\252\310\306\313\"*\311E*0\311y\210\207" [start end s mh-swish-folder mh-user-path n --cl-block-nil-- 46 throw nil 35 error search-forward " " mh-line-end-position t file-exists-p buffer-substring-no-properties search-backward "/" string-match 0 format "+%s" substring (error) string-to-number] 7 (#$ . 30021)]) (defvar mh-mairix-binary (executable-find "mairix")) (defvar mh-mairix-directory ".mairix") (defvar mh-mairix-folder nil) #@731 Execute mairix. In the examples below, replace "/home/user/Mail" with the path to your MH directory. First create the directory "/home/user/Mail/.mairix". Then create the file "/home/user/Mail/.mairix/config" with the following contents: base=/home/user/Mail # List of folders that should be indexed. 3 dots at the end means there # are subfolders within the folder mh=archive...:inbox:drafts:news:sent:trash vfolder_format=mh database=/home/user/Mail/.mairix/database Use the following command line to generate the mairix index. Run this daily from cron: mairix -f /home/user/Mail/.mairix/config In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP-LIST is used to search. (defalias 'mh-mairix-execute-search #[(folder-path search-regexp-list) "\306!q\210\307 \210 \204\310\311!\210\312\313 \314\315\314\316\317\320\321\n #\f& \210eb\210\322 \211GS\"\211\323\232\2036 \202:\320\324 \")\211\207" [mh-temp-index-buffer mh-mairix-binary mh-user-path mh-mairix-directory search-regexp-list folder-path get-buffer-create erase-buffer error "Set `mh-mairix-binary' appropriately" apply call-process nil (t nil) "-r" "-f" format "%s%s/config" substring "/" "%s/" last-char mh-mairix-folder] 13 (#$ . 30965)]) #@40 Return next result from mairix output. (defalias 'mh-mairix-next-result #[nil "\3052{m\204n\203l\203\306\305\307\"\210\307f\310=\204!\306\305\311\"\210`\307\211\312 \313 \314#\2047\306\305\311\"\210\315\224b\210`\n\232\204F\306\305\311\"\210 b\210\316\317\n\314#\204V\306\305\311\"\210`T\nb\210\313\f \314#\204i\306\305\311\"\210\320\321\322`S\"\"\323\322 \"!\307E+0\307y\210\207" [msg-start end start mh-mairix-folder mh-user-path --cl-block-nil-- throw nil 47 error mh-line-end-position search-forward t 0 search-backward "/" format "+%s" buffer-substring-no-properties string-to-number] 5 (#$ . 32239)]) #@74 Generate query for mairix. REGEXP-LIST is an alist of fields and values. (defalias 'mh-mairix-regexp-builder #[(regexp-list) "\306 \306\211\203 @\211A\203\n@\307=\203\310\202\242\n@\311=\203(\312\202\242\n@\313=\2033\314\202\242\n@\315=\203>\316\202\242\n@\317=\203I\320\202\242\n@\321=\203T\322\202\242\n@\323=\203_\324\202\242\n@\325=\203j\326\202\242\n@\327=\203u\330\202\242\n@\331=\203\200\332\202\242\n@\333=\203\213\334\202\242\n@\335=\203\226\336\202\242\n@\337=\203\241\340\202\242\341\342\nA!A\341\211\306(\211\203 @\211(A\341)\211*\306+\211\203\362 @+)\343+:\204\330\341\202\331\344+:\204\344+\202\350+A@R) A\211\204\307*\f\345\346)\347\"Q* A\211\204\263*\346\f\347\"*PB A\211\204\n*)\207" [result regexp-list pair --dolist-tail-- final sop nil to "t:" from "f:" cc "c:" to-or-cc "tc:" address "a:" subject "s:" subject-or-body "bs:" date "d:" message-id "m:" message-body "b:" message-size "z:" message-attachment-name "n:" message-flags "F:" "" mh-mairix-convert-to-sop* "," "~" "/" substring 1 conjunct expr-string expr-list e] 7 (#$ . 32872)]) #@38 Convert EXPR to sum of product form. (defalias 'mh-mairix-convert-to-sop* #[(expr) ":\204 \306\307DD\207@\306=\2038\306\310\311A\"\312\211 :\2033 @\313\nA! \244 A\211\202 \237+B\207@\307=\203\260\310\311A\"\312\211\211\211A\242\203\255\211A\242\312 A\312\211\203\243@\fA\312\211\203\231@\307\314AA\"BBA\211\204|*A\211\204l*\306)B\202Q +\207A@:\204\275\306\307DD\207A@@\315=\203\316\311A@A@!\207A@@\307=\203\343\311\306\310\316A@A\"B!\207A@@\306=\203\370\311\307\310\317A@A\"B!\207\320\321\"\207" [expr #1=#:--cl-var-- e #2=#:--cl-var-- next-factor result or and mapcar mh-mairix-convert-to-sop* nil reverse append not #[(x) "\301D\207" [x not] 2] #[(x) "\301D\207" [x not] 2] error "Unreachable: %s" conjuncts res t1 --dolist-tail-- t2] 6 (#$ . 34006)]) (defvar mh-namazu-binary (executable-find "namazu")) (defvar mh-namazu-directory ".namazu") (defvar mh-namazu-folder nil) #@874 Execute namazu. In the examples below, replace "/home/user/Mail" with the path to your MH directory. First create the directory "/home/user/Mail/.namazu". Then create the file "/home/user/Mail/.namazu/mknmzrc" with the following contents: package conf; # Don't remove this line! $ADDRESS = \='user@localhost\='; $ALLOW_FILE = "[0-9]*"; $EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)"; This configuration does not index the folders that hold the results of your searches in "+mhe-index" since they tend to be ephemeral and the original messages are indexed anyway. Use the following command line to generate the namazu index. Run this daily from cron: mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \ -q /home/user/Mail In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search. (defalias 'mh-namazu-execute-search #[(folder-path search-regexp) "\306\307 #\310\n!\204\311\312\n\"\210\313 !\204\311\314!\210\315\f!q\210\316 \210\317 \320\321\320\322 \n&\210eb\210\323\211GS\"\211\324\232\203E\202J\306\325\")\211)\207" [mh-user-path mh-namazu-directory namazu-index-directory mh-namazu-binary mh-temp-index-buffer search-regexp format "%s%s" file-exists-p error "Namazu directory %s not present" executable-find "Set `mh-namazu-binary' appropriately" get-buffer-create erase-buffer call-process nil (t nil) "-alR" substring "/" "%s/" folder-path last mh-namazu-folder] 9 (#$ . 34979)]) #@41 Get the next result from namazu output. (defalias 'mh-namazu-next-result #[nil "\3062lm\203 \307\306\310\"\210\311`\312 \"\313 \"\314\232\204!\307\306\315\"\210\316!\204,\307\306\315\"\210\313\n\"\210\317\314\225\"\320\321 \"\211\204E\307\306\315\"\210\322\323\317 \314\f#\"\3241\\\325\317 \fT\"!0\202^\210\310\211\206g\307\306\315\")\310E+0\310y\210\207" [file-name mh-namazu-folder mh-user-path folder/msg mark n --cl-block-nil-- throw nil buffer-substring-no-properties mh-line-end-position string-match 0 error file-exists-p substring mh-search-from-end 47 format "+%s" (error) string-to-number] 7 (#$ . 36483)]) (defvar mh-pick-binary "pick") #@69 Search components that are supported by single-dash option in pick. (defconst mh-pick-single-dash '(cc date from subject to) (#$ . 37153)) #@282 Execute pick. Read "pick(1)" or the section Finding Messages with pick in the MH book to find out more about how to enter the criteria (see URL `http://www.ics.uci.edu/~mh/book/mh/finpic.htm'). In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search. (defalias 'mh-pick-execute-search #[(folder-path search-regexp) "\306!q\210\307 \210\310\311 \nG\"!\211\312\f:\203=\f@\313 P\211\314\261\210\315\316\317\320\"\312\321\312 \322&\210\fA\211\202+eb\207" [mh-temp-index-buffer folder-path mh-user-path folders #1=#:--cl-var-- folder get-buffer-create erase-buffer mh-folder-list substring nil "+" "\n" apply call-process expand-file-name "pick" (t nil) "-list" mh-progs search-regexp] 10 (#$ . 37299)]) #@37 Return the next pick search result. (defalias 'mh-pick-next-result #[nil "\3012<m\203 \302\301\303\"\210\304\305\306 \307#\203\"\310\311 \306 \"\302\301\312\"\210\304\313\306 \307#\2040\302\301\312\"\210\314\310\311 \306 \"!\303E0\303y\210\207" [mh-index-pick-folder --cl-block-nil-- throw nil search-forward-regexp "^\\+" mh-line-end-position t buffer-substring-no-properties mh-line-beginning-position error "^[1-9][0-9]*$" string-to-number] 5 (#$ . 38050)]) #@52 Generate pick search expression from PATTERN-LIST. (defalias 'mh-pick-regexp-builder #[(pattern-list) "\305 \305\211\203a @\211A\203Z\306\307\310\311\312!\203)\n@\203)\313\314\nA\"\202+\nA\n@\203U\311\312!\203>\313\315\n@\"\202V\n@\f\235\203M\313\316\n@\"\202V\313\317\n@\"\202V\320\"\321$ A\211\204\n*A)\207" [result pattern-list pattern --dolist-tail-- mh-pick-single-dash nil append ("-and" "-lbrace") mh-pick-construct-regexp mh-variant-p gnu-mh format "--pattern=%s" "--component=%s" "-%s" "--%s" "-search" ("-rbrace")] 9 (#$ . 38523)]) #@99 Construct pick compatible expression corresponding to EXPR. COMPONENT is the component to search. (defalias 'mh-pick-construct-regexp #[(expr component) ":\204 D\207@\302=\203$\303\304\305A@ \"\306\305AA@ \"\307$B\207@\310=\203?\303\304\305A@ \"\311\305AA@ \"\312$B\207@\313=\203T\303\314\304\305A@ \"\315\"BB\207\316\317@\"\207" [expr component and "-lbrace" append mh-pick-construct-regexp ("-and") ("-rbrace") or ("-or") ("-rbrace") not "-not" ("-rbrace") error "Unknown operator %s seen"] 7 (#$ . 39091)]) (defvar mh-grep-binary (executable-find "grep")) #@324 Execute grep. Unlike the other search methods, this method does not use the MH-Search buffer. Instead, you simply enter a regular expression in the minibuffer. For help in constructing regular expressions, see your man page for "grep". In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search. (defalias 'mh-grep-execute-search #[(folder-path search-regexp) "\304!q\210\305 \210\306 \307\310\307\311\312\n &\210eb\207" [mh-temp-index-buffer mh-grep-binary search-regexp folder-path get-buffer-create erase-buffer call-process nil (t nil) "-i" "-r"] 9 (#$ . 39673)]) #@183 Read the next result. Parse it and return the message folder, message index and the match. If no other matches left then return nil. If the current record is invalid return `error'. (defalias 'mh-grep-next-result #[nil "\3062tm\203 \307\306\310\"\210\311 \312 \310\211\nb\210\313\f \314#\204'\307\306\315\"\210`\313\316 \314#\2046\307\306\315\"\210\317` \"\320u\210`\321\322 \314#\204M\307\306\315\"\210\323\324\317 `\"\"\3251c\326\317`T\"!0\202e\210\310\211\206o\307\306\315\") E-0\310y\210\207" [msg-end folder-start bol-pos eol-pos mh-user-path match --cl-block-nil-- throw nil mh-line-end-position mh-line-beginning-position search-forward t error ":" buffer-substring-no-properties -1 search-backward "/" format "+%s" (error) string-to-number n] 6 (#$ . 40277)]) #@166 Partition the messages based on source folder. Returns an alist with the folder names in the car and the cdr being the list of messages originally from that folder. (defalias 'mh-index-group-by-folder #[nil "\212eb\210\303\304\305\"\306\307 \"\210\310\306\311\"\210\n\237+\207" [result-table mh-index-msg-checksum-map #1=#:--cl-var-- make-hash-table :test equal maphash #[(msg #2=#:--cl-var--) "\306\211 \"\n\"@\f\307 \306 \"B #*\207" [msg mh-index-msg-checksum-map mh-index-checksum-origin-map #3=#:v result-table #4=#:v gethash puthash] 6] nil #[(x #5=#:--cl-var--) "\303 \"\237B\nB\211\207" [x result-table #1# gethash] 4]] 3 (#$ . 41070)]) #@57 Annotate the search results with original folder names. (defalias 'mh-index-insert-folder-headers #[nil "\306\307!\310 \307\211\211eb\210m\204@\311\211\306\307! \"\"@\211\203: \232\204:\2032\312\2023\313 \312\261\210 \307y\210\202\f\203L\314 \210\315\f\316\"\210\317 !\210-\320 \207" [last-folder current-folder buffer-read-only old-buffer-modified-flag cur-msg mh-index-msg-checksum-map mh-get-msg-num nil buffer-modified-p gethash "\n" "" mh-notate-cur mh-goto-msg t set-buffer-modified-p mh-index-create-imenu-index mh-index-checksum-origin-map] 6 (#$ . 41731)]) #@28 Delete the folder headers. (defalias 'mh-index-delete-folder-headers #[nil "\303\304!\305 \304\211\204m\204\304y\210\303\304!\211\203 eb\210m\204C\306\304f\307\"\2043\306\304f\310\"\203=`\304y\210`|\210\202\304y\210\202\n\203M\311\n\312\211#\210\313 !+\207" [buffer-read-only old-buffer-modified-flag cur-msg mh-get-msg-num nil buffer-modified-p char-equal 43 10 mh-goto-msg t set-buffer-modified-p] 5 (#$ . 42323)]) (mh-require 'which-func nil t) #@69 Create alist of folder names and positions in index folder buffers. (defalias 'mh-index-create-imenu-index #[nil "\212\303\300!\203 \304\305eb\210\306\307\305\304#\203)\212\310 \210\311`\312 \"\313 B B)\202 \237\211*\207" [which-func-mode alist imenu--index-alist boundp t nil re-search-forward "^\\+" beginning-of-line buffer-substring-no-properties mh-line-end-position point-marker] 4 (#$ . 42794)]) #@60 Non-nil means that this folder was generated by searching. (defalias 'mh-search-p #[nil "\207" [mh-index-data] 1 (#$ . 43211)]) #@307 Perform the outstanding operations on the actual messages. The copies in the searched folder are then deleted, refiled, blacklisted and whitelisted to get the desired result. Before processing the messages we make sure that the message is identical to the one that the user has marked in the index buffer. (defalias 'mh-index-execute-commands #[nil "\212\306\307\310\311\312\313\n\306\211 :\203% @\314\fA! \244 A\211\202 \237+ $\307\"\"\210 +\207" [mh-speed-flists-inhibit-flag folders mh-refile-list #1=#:--cl-var-- x #2=#:--cl-var-- nil t maphash #[(folder msgs) " B\306!\204\307\310\311\312\n!$\207rq\210 \f \313\n\313\211\314\216\315 .\207" [folder folders msgs mh-refile-list mh-delete-list mh-blacklist get-buffer apply mh-exec-cmd "rmm" mh-coalesce-msg-list nil #[nil "\306\307\"\n\310\211 :\203% @\211\f>\204\f B A\211\202\f \237+ \310\211:\203S@\211\f>\204J\fBA\211\2025\237+\310\211:\203\202@\211\f>\204y\fBA\211\202d\237+\311\312 !\210\312 \205\224\313 \207" [old-refile-list mh-refile-list old-delete-list #3=#:--cl-var-- x #4=#:--cl-var-- mapcar #[(x) "@A\305\211 :\203\" @\211\f>\204\n B A\211\202\n \237+B\207" [x #5=#:--cl-var-- y #6=#:--cl-var-- msgs nil] 4] nil mh-set-folder-modified-p mh-outstanding-commands-p mh-notate-deleted-and-refiled msgs mh-delete-list old-blacklist #7=#:--cl-var-- #8=#:--cl-var-- mh-blacklist old-whitelist #9=#:--cl-var-- #10=#:--cl-var-- mh-whitelist] 4] mh-execute-commands mh-whitelist old-whitelist old-blacklist old-delete-list old-refile-list] 7] mh-index-matching-source-msgs append reverse mh-delete-list mh-blacklist mh-whitelist] 9 (#$ . 43347)]) #@357 Given STRING generate a name which is suitable for use as a folder name. White space from the beginning and end are removed. All spaces in the name are replaced with underscores and all / are replaced with $. If STRING is longer than 20 it is truncated too. STRING could be a list of strings in which case they are concatenated to construct the base name. (defalias 'mh-index-generate-pretty-name #[(string) "\306\307!rq\210\310\216 ;\203 c\210\2027 @\203 @c\210 A\311\211\2036 @\312\n\261\210 A\211\204'*\313\314\315\"\313\316\315\"\313\317\315\"\320ed\321\322\323%\210\320ed\324\322\323%\210\320ed\325\322\323%\210eb\210m\204s\311f\326>\203s\327\330!\210\202adb\210o\204\211`Sf\331>\203\211\327\332!\210\202v\320ed\322\333\323%\210\320ed\334\333\323%\210\320ed\335\333\323%\210\320ed\336\333\323%\210\320ed\337\340\323%\210\341\342 \343\" \344=\203\307\345\346()#\202\325\f(\232\203\324\f\347P\202\325\f,\207" [#1=#:temp-buffer string s --dolist-tail-- out mh-searcher generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] nil "_" mh-replace-string "-lbrace" " " "-rbrace" "-search" subst-char-in-region 40 32 t 41 45 (32 9 10 13 95) delete-char 1 (32 9 10 13 95) -1 95 9 10 13 47 36 truncate-string-to-width buffer-string 20 flists format "%s/%s" "1" mh-flists-results-folder mh-flists-sequence] 7 (#$ . 45081)]) #@25 Check if FOLDER exists. (defalias 'mh-folder-exists-p #[(folder) "\302!\205&\212\303\304!r q\210\305\216\306\307\310\311\312%\210eb\210\313\314\315\316\317\"\"!,\207" [folder #1=#:temp-buffer mh-folder-name-p generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] mh-exec-cmd-output "folder" nil "-fast" "-nocreate" looking-at format "+?%s" substring 1] 6 (#$ . 46474)]) #@32 Check if MSG exists in FOLDER. (defalias 'mh-msg-exists-p #[(msg folder) "\303\304\305\306 \307\"\n$!\207" [mh-user-path folder msg file-exists-p format "%s%s/%s" substring 1] 7 (#$ . 46895)]) #@399 Return a folder name based on NAME for search results of SEARCH-REGEXP. If folder NAME already exists and was generated for the same SEARCH-REGEXP then it is reused. Otherwise if the folder NAME was generated from a different search then check if NAME-2 can be used. Otherwise try NAME-3. This is repeated till we find a new folder name. If the folder returned doesn't exist then it is created. (defalias 'mh-index-new-folder #[(name search-regexp) "\306!\204\n\307\310!\210\311\312\313\312 \311\232\203\202!\314\315 #\316\n!\2030\317\n! \232\2038\n\312\211\2029\313\203C T\211\202\f,\320!\203S\321!\210\212\322\312\323#\210)\322\312\324\325\326%\210\327!\210\330\331!\203u\332!\210)\207" [name i candidate #1=#:--cl-var-- #2=#:--cl-var-- search-regexp mh-folder-name-p error "The argument should be a valid MH folder name" 1 nil t format "%s-%s" mh-folder-exists-p mh-index-folder-search-regexp get-buffer mh-process-or-undo-commands mh-exec-cmd-quiet "rmf" "folder" "-create" "-fast" mh-remove-from-sub-folders-cache boundp mh-speed-folder-map mh-speed-add-folder chosen-name] 7 (#$ . 47096)]) #@139 If FOLDER was created by an index search, return the search regexp. Return nil if FOLDER doesn't exist or the .mhe_index file is garbled. (defalias 'mh-index-folder-search-regexp #[(folder) "\3041)\305\306!rq\210\307\216\310\311\312 \313\n\314\" $!\210eb\210\315\316!\210\317p!A@+0\207\210\320\207" [#1=#:temp-buffer mh-user-path folder mh-index-data-file (error) generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] insert-file-contents format "%s%s/%s" substring 1 forward-list 3 read nil] 7 (#$ . 48241)]) #@61 Mirror sequences present in source folders in index folder. (defalias 'mh-index-create-sequences #[nil "\306\307\310\"\311\312\313\n\"\210\314 \315\"\311\211\203\211 @\316\f\"\316\"\211@A\3171C\316\316 \"\"0\202E\210\311\311 :\203\200@ \320 \"\203p\320 \"\211!\f!AB\241\210)\202w \fDBA\211\202L. A\211\204*\"\311 \":\203\270\"@ \321\322\323 \324\325 @!\326\327\330 A\"&\210\"A\211\"\202\222,\311\207" [seq-list seq-hash mh-index-data mh-current-folder msg --dolist-tail-- make-hash-table :test equal nil maphash #[(folder #1=#:--cl-var--) "\n\304 \305\306\307\"! #*\207" [folder #2=#:v seq-hash #3=#:v puthash mh-create-sequence-map mh-read-folder-sequences nil] 6] mh-translate-range "all" gethash (error) assoc apply mh-exec-cmd "mark" "-sequence" symbol-name "-add" mapcar #[(x) "\301\302\"\207" [x format "%s"] 3] mh-index-msg-checksum-map checksum mh-index-checksum-origin-map pair ofolder omsg #4=#:--cl-var-- seq #5=#:v #6=#:--cl-var--] 11 (#$ . 48800)]) #@187 Return a map from msg number to list of sequences in which it is present. SEQ-LIST is an assoc list whose keys are sequence names and whose cdr is the list of messages in that sequence. (defalias 'mh-create-sequence-map #[(seq-list) "\306  \307\n:\203U\n@\211@\310 >\204N\311 @!\203N A\307\f:\203M\f@ @\f  \312 \f\313 \"B#\210+\fA\211\202$*\nA\211\202+\207" [map seq-list #1=#:--cl-var-- seq #2=#:--cl-var-- msg make-hash-table nil mh-unpropagated-sequences mh-valid-seq-p puthash gethash #3=#:v #4=#:v #5=#:v] 7 (#$ . 49844)]) #@171 Add to SEQ the messages in the list MSGS. This function updates the source folder sequences. Also makes an attempt to update the source folder buffer if we have it open. (defalias 'mh-index-add-to-sequence #[(seq msgs) "\212\304 >?\205\305!\205\306\307\310\311\312 !\"\210\n*)\207" [seq mh-speed-flists-inhibit-flag folders msgs mh-unpropagated-sequences mh-valid-seq-p nil t maphash #[(folder msgs) " B\304\305\306\307\310\311\312\313\n!\314\315\316 !\"& \210\317!\205'rq\210\320 \n\")\207" [folder folders seq msgs apply mh-exec-cmd-quiet nil "mark" "-add" "-nozero" "-sequence" symbol-name mapcar #[(x) "\301\302\"\207" [x format "%s"] 3] mh-coalesce-msg-list get-buffer mh-put-msg-in-seq] 13] mh-index-matching-source-msgs] 4 (#$ . 50408)]) #@159 Delete from SEQ the messages in MSGS. This function updates the source folder sequences. Also makes an attempt to update the source folder buffer if present. (defalias 'mh-index-delete-from-sequence #[(seq msgs) "\212\304 >?\205\305!\205\306\307\310\311\312 !\"\210\n*)\207" [seq mh-speed-flists-inhibit-flag folders msgs mh-unpropagated-sequences mh-valid-seq-p nil t maphash #[(folder msgs) " B\304\305\306\307\310\311\312\313\n!\314\315\316 !\"& \210\317!\205(rq\210\320 \n\321#)\207" [folder folders seq msgs apply mh-exec-cmd-quiet nil "mark" "-del" "-nozero" "-sequence" symbol-name mapcar #[(x) "\301\302\"\207" [x format "%s"] 3] mh-coalesce-msg-list get-buffer mh-delete-msg-from-seq t] 13] mh-index-matching-source-msgs] 4 (#$ . 51175)]) #@42 List of sequences that aren't preserved. (defvar mh-unpropagated-sequences '(cur range subject search) (#$ . 51944)) #@200 Return a list of sequences that aren't propagated to the source folders. It is just the sequences in the variable `mh-unpropagated-sequences' in addition to the Previous-Sequence (see mh-profile 5). (defalias 'mh-unpropagated-sequences #[nil "\203 B\207 \207" [mh-previous-seq mh-unpropagated-sequences] 2 (#$ . 52068)]) #@238 Return a table of original messages and folders for messages in MSGS. If optional argument DELETE-FROM-INDEX-DATA is non-nil, then each of the messages, whose counter-part is found in some source folder, is removed from `mh-index-data'. (defalias 'mh-index-matching-source-msgs #[(msgs &optional delete-from-index-data) "\306\307\310\" \311\211\203p @\312\n\f\"\312 \" \203h@\203hA\203h\313A@ #\203hA@\314\312\"B#\210+\203h\315A\312@\"\"\210* A\211\204 *)\207" [table msgs msg --dolist-tail-- mh-index-msg-checksum-map checksum make-hash-table :test equal nil gethash mh-index-match-checksum puthash remhash mh-index-checksum-origin-map pair #1=#:v #2=#:v #3=#:v delete-from-index-data mh-index-data] 7 (#$ . 52400)]) #@69 Check if MSG in FOLDER has X-MHE-Checksum header value of CHECKSUM. (defalias 'mh-index-match-checksum #[(msg folder checksum) "\305\306!rq\210\307\216\310 \311\312\313\314\315\n &\210eb\210\316`\317 \"\f\230+\207" [#1=#:temp-buffer mh-scan-prog folder msg checksum generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] mh-exec-cmd-output nil "-width" "80" "-format" "%{x-mhe-checksum}\n" buffer-substring-no-properties mh-line-end-position] 9 (#$ . 53179)]) #@27 Write index data to file. (defalias 'mh-index-write-data #[nil "\3061q\307=\204\310\311\"\210 \n \f P\312\211\313\314! \315\216rq\210\316\317\"\210\316\320\"\210\316\320\"\210\321p\"\210\322c\210\321p\"\210\322c)rq\210\323\312\211 \312\324%\210.\f0\207\210\312\207" [major-mode mh-index-data mh-index-msg-checksum-map mh-index-checksum-origin-map mh-index-previous-search mh-index-sequence-search-flag (error) mh-folder-mode error "Can't be called from folder in \"%s\"" nil generate-new-buffer " *temp file*" #[nil "\301!\205 \302!\207" [#1=#:temp-buffer buffer-name kill-buffer] 2] mh-index-write-hashtable #[(x) "\302\303\304 \"\210\237)\207" [#2=#:--cl-var-- x nil maphash #[(y #3=#:--cl-var--) " B\211\207" [y #2#] 2]] 3] identity pp "\n" write-region 0 buffer-file-name mh-index-data-file print-level print-length outfile sequence-search-flag previous-search checksum-origin-map msg-checksum-map data #1# #4=#:temp-file] 8 (#$ . 53687)]) #@109 Write TABLE to `current-buffer'. PROC is used to serialize the values corresponding to the hash table keys. (defalias 'mh-index-write-hashtable #[(table proc) "\302\303\304\305 \"\210\237)p\"\210\306c\207" [#1=#:--cl-var-- table pp nil maphash #[(x #2=#:--cl-var--) " \304\n\"!B B\211\207" [x proc table #1# gethash] 5] "\n"] 4 (#$ . 54690)]) #@28 Read index data from file. (defalias 'mh-index-read-data #[nil "\3061a\307=\204\310\311\"\210 \nP\312\211\211\211\211\313\314!rq\210\315\216\316!\210eb\210\317\320!\317\321!\317\321!\322p!\322p!+ \f \211.0\207\210\312\207" [major-mode buffer-file-name mh-index-data-file t5 t4 t3 (error) mh-folder-mode error "Can't be called from folder in \"%s\"" nil generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1=#:temp-buffer buffer-name kill-buffer] 2] insert-file-contents-literally mh-index-read-hashtable #[(data) "\306\307\310\" \311\n:\203#\n@\211\312\f\313 #\210*\nA\211\202\n+\207" [table data #2=#:--cl-var-- x #3=#:v #4=#:v make-hash-table :test equal nil puthash t] 5] identity read t2 t1 infile #1# mh-index-data mh-index-msg-checksum-map mh-index-checksum-origin-map mh-index-previous-search mh-index-sequence-search-flag] 6 (#$ . 55044)]) #@103 From BUFFER read a hash table serialized as a list. PROC is used to convert the value to actual data. (defalias 'mh-index-read-hashtable #[(proc) "\306\307\310\"\311p!\312 :\203) @\211@\313 \nA!\f#\210* A\211\202\f+\207" [table #1=#:--cl-var-- pair #2=#:v #3=#:v proc make-hash-table :test equal read nil puthash] 5 (#$ . 55963)]) #@53 Check if a program to create a checksum is present. (defalias 'mh-checksum-choose #[nil "\303\301!?\205D\304\305\"\306\307!\203\306\307!C\310\211\202C\306\311!\203/\306\311!\312D\313\211\202C\306\312!\203@\306\312!C\314\211\202C\315\316!)\207" [exec-path mh-checksum-cmd mh-checksum-parser boundp append ("/sbin" "/usr/sbin") executable-find "md5sum" mh-md5sum-parser "openssl" "md5" mh-openssl-parser mh-md5-parser error "No suitable checksum program"] 3 (#$ . 56312)]) #@22 Parse md5sum output. (defalias 'mh-md5sum-parser #[nil "\304 \305 \306\211\307\310\n\311#\nb\210\312\313 \311# \2031\2031\314\315T\n\"!\315 S\"B\2024\306\211B,\207" [last-slash first-space end begin mh-line-beginning-position mh-line-end-position nil search-forward " " t search-backward "/" string-to-number buffer-substring-no-properties] 4 (#$ . 56805)]) #@23 Parse openssl output. (defalias 'mh-openssl-parser #[nil "\304 \305 \306\211\nb\210\307\310 \311#\307\312 \311#\211\205/ \205/\313\314T S\"!\314 T\n\"B,\207" [last-slash last-space end begin mh-line-beginning-position mh-line-end-position nil search-backward " " t "/" string-to-number buffer-substring-no-properties] 5 (#$ . 57181)]) (defalias 'mh-md5-parser 'mh-openssl-parser) #@350 Annotate all as yet unannotated messages in FOLDER with their MD5 hash. As a side effect msg -> checksum map is updated. Optional argument ORIGIN-MAP is a hash table which maps each message in the index folder to the original folder and message from whence it was copied. If present the checksum -> (origin-folder, origin-index) map is updated too. (defalias 'mh-index-update-maps #[(folder &optional origin-map) "\306!\210r\307 !q\210\310 \210\311\312!r\nq\210\313\216\314 \315\316\317\320\321\f\322&\210eb\210\315\211'm\204x\323`\324 \"'\315y\210\212\325\326'\"\203ql\203Y q\210(\327\f\330\"\331'\332\261\210\202q\323`\324 \"\333'!'\fq\210\334' )#\210))\315y\210\202+-m\203\201o\204\302\335\336*\"\210eb\210m\204\302+ \211,@',A'\203\273\337\340\f'\341\342\343\344 \345& \210r\fq\210\334' )#\210)\315y\210+\202\212)\346 \207" [mh-index-msg-checksum-map mh-temp-checksum-buffer #1=#:temp-buffer mh-scan-prog folder checksum clrhash get-buffer-create erase-buffer generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] mh-exec-cmd-output nil "-width" "80" "-format" "%(msg)\n%{x-mhe-checksum}\n" "all" buffer-substring-no-properties mh-line-end-position string-match "^[0-9]*$" substring 1 "/" "\n" string-to-number mh-index-update-single-msg apply mh-xargs mh-exec-cmd "anno" "-component" "X-MHE-Checksum" "-nodate" "-text" "-inplace" mh-index-write-data msg mh-user-path origin-map mh-checksum-cmd mh-checksum-parser intermediate] 11 (#$ . 57577)]) #@417 Update various maps for one message. MSG is an index folder message, CHECKSUM its MD5 hash and ORIGIN-MAP, if non-nil, a hash table containing which maps each message in the index folder to the folder and message that it was copied from. The function updates the hash tables `mh-index-msg-checksum-map' and `mh-index-checksum-origin-map'. This function should only be called in the appropriate index folder buffer. (defalias 'mh-index-update-single-msg #[(msg checksum origin-map) "\306 \"\203<\n\205h\306 \n\"\211@\fA\307\310\311\211\211\312\313\314\315\" $%\210\306 \"\205:\316\306 \"\"+\207 \317#\210*\n\205h\306 \n\"\205h \317\306 \n\"#*\207" [checksum mh-index-checksum-origin-map origin-map msg intermediate ofolder gethash call-process "rm" nil format "%s%s/%s" substring 1 remhash puthash omsg mh-user-path mh-current-folder mh-index-data #1=#:v mh-index-msg-checksum-map #2=#:v #3=#:v #4=#:v] 12 (#$ . 59108)]) (provide 'mh-search)