From fc03e613c5d931bcf15f47761566d01ca90d2551 Mon Sep 17 00:00:00 2001 From: djcb Date: Sun, 10 Jun 2012 11:33:31 +0300 Subject: [PATCH] * fix some fallout from recent changes --- emacs/mu4e-headers.el | 2 +- emacs/mu4e-utils.el | 20 ++++++++++---------- emacs/mu4e-view.el | 7 ++++--- emacs/org-mu4e.el | 8 +++----- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/emacs/mu4e-headers.el b/emacs/mu4e-headers.el index 99a4166c..298d36d8 100644 --- a/emacs/mu4e-headers.el +++ b/emacs/mu4e-headers.el @@ -647,7 +647,7 @@ last query, sorting settings." (optchar (or (nth 1 cell) (substring (nth 0 cell) 0 1)))) (setq global-mode-string (concat - (propertize expr 'face 'mu4e-title-face) + (propertize mu4e~headers-last-query 'face 'mu4e-title-face) "(" optchar (if mu4e-headers-sort-revert "d" "a") diff --git a/emacs/mu4e-utils.el b/emacs/mu4e-utils.el index 708b8f3f..101afc18 100644 --- a/emacs/mu4e-utils.el +++ b/emacs/mu4e-utils.el @@ -620,7 +620,7 @@ FUNC (if non-nil) afterwards." (when mu4e-update-timer (cancel-timer mu4e-update-timer) (setq - mu4e-update-timer nil + mu4e-update-timer nil mu4e~maildir-list nil)) (mu4e~proc-kill) (kill-buffer)) @@ -742,21 +742,21 @@ This includes expanding e.g. 3-5 into 3,4,5. If the letter ;; we have found a range A-B, which needs converting ;; into the numbers A, A+1, A+2, ... B. (progn - (setq beg (string-to-int (match-string 1 elem)) - end (string-to-int (match-string 2 elem))) + (setq beg (string-to-number (match-string 1 elem)) + end (string-to-number (match-string 2 elem))) (while (<= beg end) (add-to-list 'list beg 'append) (setq beg (1+ beg)))) ;; else just a number - (add-to-list 'list (string-to-int elem) 'append))) + (add-to-list 'list (string-to-number elem) 'append))) ;; Check that all numbers are valid. (mapc - '(lambda (x) - (cond - ((> x n) - (error "Attachment %d bigger than maximum (%d)" x n)) - ((< x 1) - (error "Attachment number must be greater than 0 (%d)" x)))) + #'(lambda (x) + (cond + ((> x n) + (error "Attachment %d bigger than maximum (%d)" x n)) + ((< x 1) + (error "Attachment number must be greater than 0 (%d)" x)))) list))) diff --git a/emacs/mu4e-view.el b/emacs/mu4e-view.el index b4d82494..e8dc9dcc 100644 --- a/emacs/mu4e-view.el +++ b/emacs/mu4e-view.el @@ -284,7 +284,7 @@ is nil, and otherwise open it." (interactive) (if is-open (mu4e-view-open-attachment msg attachnum) - (mu4e-view-save-attachment msg attachnum))))) + (mu4e-view-save-attachment-single msg attachnum))))) (defun mu4e~view-construct-attachments (msg) "Display attachment information; the field looks like something like: @@ -769,7 +769,7 @@ all messages in the thread at point in the headers view." (progn (setq def (if (= count 1) "1" (format "1-%d" count))) (read-string (mu4e-format "%s (default %s): " prompt def) nil nil def))))) - + (defun mu4e~view-get-attach (msg attnum) "Return the attachment plist in MSG corresponding to attachment number ATTNUM." @@ -815,7 +815,8 @@ attachments, but as this is the default, you may not need it." (let* ((msg (or msg (mu4e-message-at-point))) (attachstr (mu4e~view-get-attach-num "Attachment number range (or 'a' for 'all')" msg t)) - (attachnums (mu4e-split-ranges-to-numbers attachstr count))) + (count (hash-table-count mu4e~view-attach-map)) + (attachnums (mu4e-split-ranges-to-numbers attachstr count))) (dolist (num attachnums) (mu4e-view-save-attachment-single msg num)))) diff --git a/emacs/org-mu4e.el b/emacs/org-mu4e.el index c9bb441b..31a41a2d 100644 --- a/emacs/org-mu4e.el +++ b/emacs/org-mu4e.el @@ -28,6 +28,7 @@ ;;; Code: (require 'org) +(eval-when-compile (require 'org-exp)) (eval-when-compile (require 'cl)) (eval-when-compile (require 'mu4e)) @@ -192,14 +193,12 @@ rich-text version of the what is assumed to be an org-mode body." "Execute keysequence KEYSEQ by (temporarily) switching to compose mode." (mu4e-compose-mode) - (setq org-mu4e-compose-org-mode t) (add-hook 'post-command-hook 'org~mu4e-mime-switch-headers-or-body t t) - (let ((func (lookup-key (current-local-map) key))) + (let ((func (lookup-key (current-local-map) keyseq))) (unless (functionp func) (error "Invalid key binding")) (add-hook 'message-send-hook 'org~mu4e-mime-convert-to-html-maybe t t) - (funcall func))) - + (funcall func))) (defun org~mu4e-mime-switch-headers-or-body () "Switch the buffer to either mu4e-compose-mode (when in headers) @@ -258,7 +257,6 @@ or org-mode (when in the body)," (progn ;; otherwise, remove crap (remove-hook 'post-command-hook 'org~mu4e-mime-switch-headers-or-body t) (org~mu4e-mime-undecorate-headers) ;; shut off org-mode stuff - (setq org-mu4e-compose-org-mode nil) (mu4e-compose-mode) (message "org-mu4e-compose-org-mode disabled"))))