* mu4e: improve the address autocompletion and its documentation

This commit is contained in:
djcb
2012-06-20 11:29:19 +03:00
parent ef17c2f731
commit b1449376b4
3 changed files with 33 additions and 21 deletions

View File

@ -554,13 +554,16 @@ This is used by the completion function in mu4e-compose."
(let ((name (plist-get contact :name))
(mail (plist-get contact :mail)))
;;(message "N:%S M:%S" name mail)
(when mail
(unless ;; ignore some address ('noreply' etc.)
(and mu4e-compose-complete-ignore-address-regexp
(string-match mu4e-compose-complete-ignore-address-regexp mail))
(add-to-list 'lst
(if name
(format "%s <%s>" name mail)
mail)))))
(setq mu4e~contacts-for-completion lst)
(mu4e-message "Contacts received: %d"
(mu4e-message "Contacts received: %d"
(length mu4e~contacts-for-completion)))))
@ -625,10 +628,11 @@ FUNC (if non-nil) afterwards."
;; get the address list
(when mu4e-compose-complete-addresses
(setq mu4e-contacts-func 'mu4e~fill-contacts)
(mu4e~proc-contacts
mu4e-compose-complete-only-newer-than
;; calculate time_t value -- now minus so-many days
(floor (- (float-time (current-time))
(mu4e~proc-contacts
mu4e-compose-complete-only-personal
(when mu4e-compose-complete-only-after
(floor (float-time
(apply 'encode-time
(org-parse-time-string mu4e-compose-complete-only-after)))))))))
(defun mu4e~stop ()
@ -726,6 +730,8 @@ either 'to-server, 'from-server or 'misc. This function is meant for debugging."
(forward-line (- mu4e~log-max-lines lines))
(beginning-of-line)
(delete-region (point-min) (point)))))))))
(defun mu4e-toggle-logging ()
"Toggle between enabling/disabling debug-mode (in debug-mode,
@ -737,6 +743,8 @@ mu4e logs some of its internal workings to a log-buffer. See
(mu4e-message "debug logging has been %s"
(if mu4e-debug "enabled" "disabled"))
(mu4e-log 'misc "logging enabled"))
(defun mu4e-show-log ()
"Visit the mu4e debug log."
@ -746,7 +754,6 @@ mu4e logs some of its internal workings to a log-buffer. See
(error "No debug log available"))
(switch-to-buffer buf)))
(defun mu4e-split-ranges-to-numbers (str n)
"Convert STR containing attachment numbers into a list of numbers.
@ -830,8 +837,6 @@ displaying it). Do _not_ bury the current buffer, though."
after PROMPT. Formats are all that are accepted by
`parse-time-string'."
(let ((timestr (read-string (mu4e-format "%s" prompt))))
(apply 'encode-time (org-parse-time-string timestr))))
(apply 'encode-time (org-parse-time-string timestr))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -853,6 +858,5 @@ displaying it). Do _not_ bury the current buffer, though."
(goto-char (point-min)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(provide 'mu4e-utils)