comparison lisp/mh-e/mh-search.el @ 71529:11d2aeb1c67a

(mh-search, mh-index-group-by-folder): Add "the" in loop construct to be consistent with other loops, and because edebug doesn't work without it. (mh-folder-exists-p): Strip + from folder to avoid redundant +s in regexp (closes SF #1514424).
author Bill Wohler <wohler@newt.com>
date Thu, 29 Jun 2006 21:03:45 +0000
parents b5aec585f378
children e3694f1cb928
comparison
equal deleted inserted replaced
71528:113cbc14f25c 71529:11d2aeb1c67a
316 ;; Write out data to disk. 316 ;; Write out data to disk.
317 (unless mh-flists-called-flag (mh-index-write-data)) 317 (unless mh-flists-called-flag (mh-index-write-data))
318 318
319 (message "%s found %s matches in %s folders" 319 (message "%s found %s matches in %s folders"
320 (upcase-initials (symbol-name mh-searcher)) 320 (upcase-initials (symbol-name mh-searcher))
321 (loop for msg-hash being hash-values of mh-index-data 321 (loop for msg-hash being the hash-values of mh-index-data
322 sum (hash-table-count msg-hash)) 322 sum (hash-table-count msg-hash))
323 (loop for msg-hash being hash-values of mh-index-data 323 (loop for msg-hash being the hash-values of mh-index-data
324 count (> (hash-table-count msg-hash) 0))))))) 324 count (> (hash-table-count msg-hash) 0)))))))
325 325
326 ;; Shush compiler. 326 ;; Shush compiler.
327 (defvar pick-folder) ; XEmacs 327 (defvar pick-folder) ; XEmacs
328 328
1360 Returns an alist with the the folder names in the car and the cdr 1360 Returns an alist with the the folder names in the car and the cdr
1361 being the list of messages originally from that folder." 1361 being the list of messages originally from that folder."
1362 (save-excursion 1362 (save-excursion
1363 (goto-char (point-min)) 1363 (goto-char (point-min))
1364 (let ((result-table (make-hash-table :test #'equal))) 1364 (let ((result-table (make-hash-table :test #'equal)))
1365 (loop for msg being hash-keys of mh-index-msg-checksum-map 1365 (loop for msg being the hash-keys of mh-index-msg-checksum-map
1366 do (push msg (gethash (car (gethash 1366 do (push msg (gethash (car (gethash
1367 (gethash msg mh-index-msg-checksum-map) 1367 (gethash msg mh-index-msg-checksum-map)
1368 mh-index-checksum-origin-map)) 1368 mh-index-checksum-origin-map))
1369 result-table))) 1369 result-table)))
1370 (loop for x being the hash-keys of result-table 1370 (loop for x being the hash-keys of result-table
1522 (and (mh-folder-name-p folder) 1522 (and (mh-folder-name-p folder)
1523 (save-excursion 1523 (save-excursion
1524 (with-temp-buffer 1524 (with-temp-buffer
1525 (mh-exec-cmd-output "folder" nil "-fast" "-nocreate" folder) 1525 (mh-exec-cmd-output "folder" nil "-fast" "-nocreate" folder)
1526 (goto-char (point-min)) 1526 (goto-char (point-min))
1527 (looking-at (format "+?%s" folder)))))) 1527 ;; Strip + from folder; use optional + in regexp.
1528 (looking-at (format "+?%s" (substring folder 1)))))))
1528 1529
1529 (defun mh-msg-exists-p (msg folder) 1530 (defun mh-msg-exists-p (msg folder)
1530 "Check if MSG exists in FOLDER." 1531 "Check if MSG exists in FOLDER."
1531 (file-exists-p (format "%s%s/%s" mh-user-path (substring folder 1) msg))) 1532 (file-exists-p (format "%s%s/%s" mh-user-path (substring folder 1) msg)))
1532 1533