From 72e6fb997a8d22e4366785834a85013ff4eac7a0 Mon Sep 17 00:00:00 2001 From: djcb Date: Sat, 29 Jun 2013 13:07:32 +0300 Subject: [PATCH] * mu4e: make the byte-compiler happy --- mu4e/mu4e-proc.el | 25 ++++++++++++------------- mu4e/mu4e-utils.el | 14 +++++++++++++- mu4e/mu4e-vars.el | 3 +++ mu4e/mu4e-view.el | 4 ---- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/mu4e/mu4e-proc.el b/mu4e/mu4e-proc.el index 3948e674..13badaa7 100644 --- a/mu4e/mu4e-proc.el +++ b/mu4e/mu4e-proc.el @@ -51,8 +51,16 @@ a length cookie: (purecopy (concat mu4e~cookie-pre "\\([[:xdigit:]]+\\)" mu4e~cookie-post)) "Regular expression matching the length cookie. Match 1 will be the length (in hex).") -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defsubst mu4e~proc-send-command (frm &rest args) + "Send as command to the mu server process. +Start the process if needed." + (unless (mu4e~proc-running-p) + (mu4e~proc-start)) + (let ((cmd (apply 'format frm args))) + (mu4e-log 'to-server "%s" cmd) + (process-send-string mu4e~proc-process (concat cmd "\n")))) (defun mu4e~proc-start () "Start the mu server process." @@ -291,7 +299,7 @@ The server output is as follows: (t (error "Something bad happened to the mu server process"))))) -(defsubst mu4e--docid-msgid-param (docid-or-msgid) +(defsubst mu4e~docid-msgid-param (docid-or-msgid) "Construct a backend parameter based on DOCID-OR-MSGID." (format (if (stringp docid-or-msgid) @@ -299,15 +307,6 @@ The server output is as follows: "docid:%d") docid-or-msgid)) -(defsubst mu4e~proc-send-command (frm &rest args) - "Send as command to the mu server process. -Start the process if needed." - (unless (mu4e~proc-running-p) - (mu4e~proc-start)) - (let ((cmd (apply 'format frm args))) - (mu4e-log 'to-server "%s" cmd) - (process-send-string mu4e~proc-process (concat cmd "\n")))) - (defun mu4e~proc-remove (docid) "Remove message identified by docid. The results are reporter through either (:update ... ) or (:error) @@ -388,7 +387,7 @@ or (:error ) sexp, which are handled my `mu4e-update-func' and (mu4e-error "At least one of maildir and flags must be specified")) (unless (or (not maildir) (file-exists-p (concat mu4e-maildir "/" maildir "/"))) (mu4e-error "Target dir does not exist")) - (let* ((idparam (mu4e--docid-msgid-param docid-or-msgid)) + (let* ((idparam (mu4e~docid-msgid-param docid-or-msgid)) (flagstr (when flags (concat " flags:" @@ -499,7 +498,7 @@ The result will be delivered to the function registered as `mu4e-message-func'." (mu4e~proc-send-command "cmd:view %s extract-images:%s extract-encrypted:%s use-agent:true" - (mu4e--docid-msgid-param docid-or-msgid) + (mu4e~docid-msgid-param docid-or-msgid) (if images "true" "false") (if decrypt "true" "false"))) diff --git a/mu4e/mu4e-utils.el b/mu4e/mu4e-utils.el index b9087e4f..25e288ce 100644 --- a/mu4e/mu4e-utils.el +++ b/mu4e/mu4e-utils.el @@ -36,8 +36,20 @@ (require 'mu4e-lists) ;;(require 'mu4e-proc) (require 'doc-view) -(require 'org) + +;; keep the byte-compiler happy +(declare-function mu4e~proc-mkdir "mu4e-proc") +(declare-function mu4e~proc-ping "mu4e-proc") +(declare-function mu4e~proc-contacts "mu4e-proc") +(declare-function mu4e~proc-kill "mu4e-proc") +(declare-function mu4e~proc-index "mu4e-proc") +(declare-function mu4e~proc-add "mu4e-proc") +(declare-function mu4e~proc-mkdir "mu4e-proc") +(declare-function mu4e~proc-running-p "mu4e-proc") +(declare-function show-all "org") + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; the following is taken from org.el; we copy it here since we don't want to ;; depend on org-mode directly (it causes byte-compilation errors) TODO: a diff --git a/mu4e/mu4e-vars.el b/mu4e/mu4e-vars.el index a49df926..df5b33b3 100644 --- a/mu4e/mu4e-vars.el +++ b/mu4e/mu4e-vars.el @@ -614,6 +614,9 @@ Note, :sortable does not work for custom header fields.") (defvar mu4e~view-msg nil "The message being viewed in view mode.") +(defvar mu4e~view-headers-buffer nil + "The headers buffer connected to this view.") + (defvar mu4e~contacts-for-completion nil "List of contacts (ie. 'name '). This is used by the completion functions in mu4e-compose, and diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index ed3ab97a..604e5d0d 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -113,10 +113,6 @@ The first letter of NAME is used as a shortcut character.") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; some buffer-local variables / constants -(defvar mu4e~view-headers-buffer nil - "The headers buffer connected to this view.") - (defvar mu4e~view-cited-hidden nil "Whether cited lines are hidden.") (defvar mu4e~view-link-map nil "A map of some number->url so we can jump to url by number.")