• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/mh-e/

Lines Matching defs:folder

63 Expected to return a list of three strings: name of the folder,
69 (defvar mh-index-folder "+mhe-index"
72 (defvar mh-flists-results-folder "sequence"
73 "Subfolder for `mh-index-folder' where flists output is placed.")
85 (defun mh-search (folder search-regexp
103 listed folder.
138 \\[mh-to-field] to help you fill in the blanks.\\<mh-folder-mode-map>
152 The messages that are found are put in a temporary sub-folder of
155 folders; each set of messages from a given folder has a heading
156 with the folder name.\\<mh-folder-mode-map>
159 face `mh-search-folder'. You can jump back and forth between the
160 headings using the commands \\[mh-index-next-folder] and
161 \\[mh-index-previous-folder].
163 In addition, the command \\[mh-index-visit-folder] can be used to
164 visit the folder of the message at point. Initially, only the
166 folder. While the temporary buffer has its own set of message
168 folder. Thus, the command \\[mh-index-visit-folder] is useful to
170 view surrounding messages with the command \\[mh-rescan-folder].
172 Because this folder is temporary, you'll probably get in the
173 habit of killing it when you're done with \\[mh-kill-folder].
211 folder containing the index search results."
223 (mh-prompt-for-folder "Search" "+" nil "all" t)))
243 (mh-search-folder folder window-config)
250 (index-folder (format "%s/%s" mh-index-folder
252 ;; Create a new folder for the search results or recreate the old one...
257 (mh-exec-cmd-quiet nil "folder" "-create" "-fast" buffer-name)
258 (setq index-folder buffer-name))
259 (setq index-folder (mh-index-new-folder index-folder search-regexp)))
261 (let ((folder-path (format "%s%s" mh-user-path (substring folder 1)))
262 (folder-results-map (make-hash-table :test #'equal))
266 (funcall mh-search-function folder-path search-regexp)
274 (unless (gethash (car next-result) folder-results-map)
275 (setf (gethash (car next-result) folder-results-map)
278 (gethash (car next-result) folder-results-map))
282 (maphash #'(lambda (folder msgs)
283 (let ((cur (car (mh-translate-range folder "cur")))
287 (mh-exec-cmd "refile" msgs "-src" folder
288 "-link" index-folder)
291 (mh-exec-cmd-quiet nil "mark" folder "-add" "-zero"
297 (cons folder msg)))))
298 folder-results-map)
300 ;; Vist the results folder.
301 (mh-visit-folder index-folder () (list folder-results-map origin-map))
310 (mh-speed-flists t mh-current-folder))
315 (setq mh-index-previous-search (list folder mh-searcher search-regexp))
328 (defvar pick-folder) ; XEmacs
330 (defun mh-search-folder (folder window-config)
334 configuration and is used when the search folder is dismissed."
335 (interactive (list (mh-prompt-for-folder "Search" mh-current-folder nil nil t)
337 (let ((pick-folder (if (equal folder "+") mh-current-folder folder)))
343 (mh-make-local-vars 'mh-current-folder folder
388 (split-string (read-string "Search folder(s) (default all): "))
403 (split-string (read-string "Search folder(s) (default all): "))
408 (defvar mh-mairix-folder) ; XEmacs
421 (split-string (read-string "Search folder(s) (default all): "))
431 (mh-mairix-folder mh-user-path)
433 (new-folder (format "%s/%s/%s" mh-index-folder
434 mh-flists-results-folder sequence))
435 (window-config (if (equal new-folder mh-current-folder)
440 (cond ((buffer-live-p (get-buffer new-folder))
441 ;; The destination folder is being visited. Trick `mh-search'
442 ;; into thinking that the folder resulted from a previous search.
443 (set-buffer new-folder)
446 ((mh-folder-exists-p new-folder)
449 (mh-exec-cmd-quiet nil "rmf" new-folder)))
450 (setq message (mh-search "+" mh-flists-results-folder
471 (insert "for folder in `" (expand-file-name "flists" mh-progs) " "
476 (loop for folder in mh-flists-search-folders
478 (concat " " (mh-quote-for-shell folder)))))
481 (expand-file-name "mhpath" mh-progs) " \"+$folder\" " seq "\n"
489 (defun mh-index-next-folder (&optional backward-flag)
490 "Jump to the next folder marker.
514 (defun mh-index-previous-folder ()
515 "Jump to the previous folder marker."
517 (mh-index-next-folder t))
520 (defun mh-index-visit-folder ()
521 "Visit original folder from where the message at point was found."
524 (error "Not in an index folder"))
525 (let (folder msg)
531 (setq folder (buffer-substring-no-properties
535 (when (not folder)
536 (setq folder (car (gethash (gethash msg mh-index-msg-checksum-map)
538 (when (or (not (get-buffer folder))
539 (y-or-n-p (format "Reuse buffer displaying %s? " folder)))
540 (mh-visit-folder
541 folder (loop for x being the hash-keys of (gethash folder mh-index-data)
542 when (mh-msg-exists-p x folder) collect x)))))
644 (mh-search mh-current-folder pattern nil mh-previous-window-config)
840 (defvar mh-swish-folder nil)
842 (defun mh-swish++-execute-search (folder-path search-regexp)
885 (setq mh-swish-folder
886 (let ((last-char (substring folder-path (1- (length folder-path)))))
888 folder-path
889 (format "%s/" folder-path)))))
921 (defun mh-swish-execute-search (folder-path search-regexp)
976 (setq mh-swish-folder
977 (let ((last-char (substring folder-path (1- (length folder-path)))))
979 folder-path
980 (format "%s/" folder-path)))))
1000 (unless (string-match mh-swish-folder s)
1017 (defvar mh-mairix-folder nil)
1019 (defun mh-mairix-execute-search (folder-path search-regexp-list)
1032 # are subfolders within the folder
1053 (setq mh-mairix-folder
1054 (let ((last-char (substring folder-path (1- (length folder-path)))))
1056 folder-path
1057 (format "%s/" folder-path)))))
1070 (unless (search-forward mh-mairix-folder end t)
1150 (defvar mh-namazu-folder nil)
1152 (defun mh-namazu-execute-search (folder-path search-regexp)
1190 (setq mh-namazu-folder
1191 (let ((last (substring folder-path (1- (length folder-path)))))
1193 folder-path
1194 (format "%s/" folder-path))))))
1203 (unless (equal (string-match mh-namazu-folder file-name) 0)
1208 (let* ((folder/msg (substring file-name (match-end 0)))
1209 (mark (mh-search-from-end ?/ folder/msg)))
1211 (list (format "+%s" (substring folder/msg 0 mark))
1213 (substring folder/msg (1+ mark))))))
1220 (defvar mh-index-pick-folder)
1225 (defun mh-pick-execute-search (folder-path search-regexp)
1237 (mh-folder-list (substring folder-path (length mh-user-path)))))
1238 (loop for folder in folders do
1239 (setq folder (concat "+" folder))
1240 (insert folder "\n")
1242 nil '(t nil) nil folder "-list" search-regexp)))
1251 (setq mh-index-pick-folder
1257 (list mh-index-pick-folder
1312 (defun mh-grep-execute-search (folder-path search-regexp)
1325 "-i" "-r" search-regexp folder-path)
1330 Parse it and return the message folder, message index and the
1339 folder-start msg-end)
1343 (setq folder-start (point))
1349 (unless (search-backward "/" folder-start t)
1352 folder-start (point)))
1366 (defun mh-index-group-by-folder ()
1367 "Partition the messages based on source folder.
1368 Returns an alist with the the folder names in the car and the cdr
1369 being the list of messages originally from that folder."
1382 (defun mh-index-insert-folder-headers ()
1383 "Annotate the search results with original folder names."
1387 current-folder last-folder)
1390 (setq current-folder (car (gethash (gethash (mh-get-msg-num nil)
1393 (when (and current-folder (not (equal current-folder last-folder)))
1394 (insert (if last-folder "\n" "") current-folder "\n")
1395 (setq last-folder current-folder))
1404 (defun mh-index-delete-folder-headers ()
1405 "Delete the folder headers."
1427 "Create alist of folder names and positions in index folder buffers."
1444 "Non-nil means that this folder was generated by searching."
1453 The copies in the searched folder are then deleted/refiled to get
1461 (lambda (folder msgs)
1462 (push folder folders)
1463 (if (not (get-buffer folder))
1464 ;; If source folder not open, just delete the messages...
1465 (apply #'mh-exec-cmd "rmm" folder (mh-coalesce-msg-list msgs))
1468 (set-buffer folder)
1483 (mh-set-folder-modified-p (mh-outstanding-commands-p))
1493 "Given STRING generate a name which is suitable for use as a folder name.
1524 (format "%s/%s" mh-flists-results-folder mh-flists-sequence))
1525 ((equal out mh-flists-results-folder) (concat out "1"))
1528 (defun mh-folder-exists-p (folder)
1530 (and (mh-folder-name-p folder)
1533 (mh-exec-cmd-output "folder" nil "-fast" "-nocreate" folder)
1535 ;; Strip + from folder; use optional + in regexp.
1536 (looking-at (format "+?%s" (substring folder 1)))))))
1538 (defun mh-msg-exists-p (msg folder)
1540 (file-exists-p (format "%s%s/%s" mh-user-path (substring folder 1) msg)))
1542 (defun mh-index-new-folder (name search-regexp)
1543 "Return a folder name based on NAME for search results of SEARCH-REGEXP.
1545 If folder NAME already exists and was generated for the same
1548 Otherwise if the folder NAME was generated from a different
1550 This is repeated till we find a new folder name.
1552 If the folder returned doesn't exist then it is created."
1553 (unless (mh-folder-name-p name)
1554 (error "The argument should be a valid MH folder name"))
1558 when (or (not (mh-folder-exists-p candidate))
1559 (equal (mh-index-folder-search-regexp candidate)
1565 ;; Recreate folder...
1567 (mh-exec-cmd-quiet nil "folder" "-create" "-fast" chosen-name)
1569 (when (boundp 'mh-speed-folder-map)
1570 (mh-speed-add-folder chosen-name))
1573 (defun mh-index-folder-search-regexp (folder)
1580 (format "%s%s/%s" mh-user-path (substring folder 1) mh-index-data-file))
1592 "Mirror sequences present in source folders in index folder."
1595 (loop for folder being the hash-keys of mh-index-data
1596 do (setf (gethash folder seq-hash)
1598 (mh-read-folder-sequences folder nil))))
1599 (dolist (msg (mh-translate-range mh-current-folder "all"))
1610 do (apply #'mh-exec-cmd "mark" mh-current-folder
1630 This function updates the source folder sequences. Also makes an
1631 attempt to update the source folder buffer if we have it open."
1638 (maphash (lambda (folder msgs)
1639 (push folder folders)
1640 ;; Add messages to sequence in source folder...
1641 (apply #'mh-exec-cmd-quiet nil "mark" folder
1645 ;; Update source folder buffer if we have it open...
1646 (when (get-buffer folder)
1648 (set-buffer folder)
1656 This function updates the source folder sequences. Also makes an
1657 attempt to update the source folder buffer if present."
1663 (maphash (lambda (folder msgs)
1664 (push folder folders)
1665 ;; Remove messages from sequence in source folder...
1666 (apply #'mh-exec-cmd-quiet nil "mark" folder
1670 ;; Update source folder buffer if we have it open...
1671 (when (get-buffer folder)
1673 (set-buffer folder)
1694 folder, is removed from `mh-index-data'."
1706 (defun mh-index-match-checksum (msg folder checksum)
1710 "-format" "%{x-mhe-checksum}\n" folder msg)
1724 (unless (eq major-mode 'mh-folder-mode)
1725 (error "Can't be called from folder in \"%s\"" major-mode))
1755 (unless (eq major-mode 'mh-folder-mode)
1756 (error "Can't be called from folder in \"%s\"" major-mode))
1852 (defun mh-index-update-maps (folder &optional origin-map)
1856 index folder to the original folder and message from whence it
1857 was copied. If present the checksum -> (origin-folder,
1868 folder "all")
1880 (insert mh-user-path (substring folder 1) "/" msg "\n"))
1886 (set-buffer folder)
1899 (mh-exec-cmd "anno" folder msg "-component" "X-MHE-Checksum"
1903 (set-buffer folder)
1910 MSG is a index folder message, CHECKSUM its MD5 hash and
1912 message in the index folder to the folder and message that it was
1917 folder buffer."
1926 (substring mh-current-folder 1) msg))