comparison lisp/mh-e/mh-search.el @ 69298:ba3b5c60823e

(mh-index-update-single-msg): Fix a bug in the handling of duplicate messages. The test in cond was too strong and wasn't catching the case where origin-map was nil.
author Satyaki Das <satyaki@theforce.stanford.edu>
date Mon, 06 Mar 2006 05:21:41 +0000
parents 156eafa22e3e
children d81780942bb8
comparison
equal deleted inserted replaced
69297:c379d6c262b1 69298:ba3b5c60823e
1905 copied from. The function updates the hash tables 1905 copied from. The function updates the hash tables
1906 `mh-index-msg-checksum-map' and `mh-index-checksum-origin-map'. 1906 `mh-index-msg-checksum-map' and `mh-index-checksum-origin-map'.
1907 1907
1908 This function should only be called in the appropriate index 1908 This function should only be called in the appropriate index
1909 folder buffer." 1909 folder buffer."
1910 (cond ((and origin-map (gethash checksum mh-index-checksum-origin-map)) 1910 (cond ((gethash checksum mh-index-checksum-origin-map)
1911 (let* ((intermediate (gethash msg origin-map)) 1911 (when origin-map
1912 (ofolder (car intermediate)) 1912 (let* ((intermediate (gethash msg origin-map))
1913 (omsg (cdr intermediate))) 1913 (ofolder (car intermediate))
1914 ;; This is most probably a duplicate. So eliminate it. 1914 (omsg (cdr intermediate)))
1915 (call-process "rm" nil nil nil 1915 ;; This is most probably a duplicate. So eliminate it.
1916 (format "%s%s/%s" mh-user-path 1916 (call-process "rm" nil nil nil
1917 (substring mh-current-folder 1) msg)) 1917 (format "%s%s/%s" mh-user-path
1918 (when (gethash ofolder mh-index-data) 1918 (substring mh-current-folder 1) msg))
1919 (remhash omsg (gethash ofolder mh-index-data))))) 1919 (when (gethash ofolder mh-index-data)
1920 (remhash omsg (gethash ofolder mh-index-data))))))
1920 (t 1921 (t
1921 (setf (gethash msg mh-index-msg-checksum-map) checksum) 1922 (setf (gethash msg mh-index-msg-checksum-map) checksum)
1922 (when origin-map 1923 (when (and origin-map (gethash msg origin-map))
1923 (setf (gethash checksum mh-index-checksum-origin-map) 1924 (setf (gethash checksum mh-index-checksum-origin-map)
1924 (gethash msg origin-map)))))) 1925 (gethash msg origin-map))))))
1926
1925 1927
1926 (provide 'mh-search) 1928 (provide 'mh-search)
1927 1929
1928 ;; Local Variables: 1930 ;; Local Variables:
1929 ;; indent-tabs-mode: nil 1931 ;; indent-tabs-mode: nil