Merge pull request #1486 from thierryvolpiatto/more_lexical-binding

Add lexical-binding to all files and fix warnings
This commit is contained in:
Dirk-Jan C. Binnema 2019-09-26 00:29:31 +03:00 committed by GitHub
commit 9457f2f591
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 50 additions and 28 deletions

View File

@ -1,4 +1,4 @@
;;; mu4e-actions.el -- part of mu4e, the mu mail user agent ;;; mu4e-actions.el -- part of mu4e, the mu mail user agent -*- lexical-binding: t -*-
;; ;;
;; Copyright (C) 2011-2019 Dirk-Jan C. Binnema ;; Copyright (C) 2011-2019 Dirk-Jan C. Binnema
@ -36,6 +36,11 @@
(declare-function mu4e~proc-extract "mu4e-proc") (declare-function mu4e~proc-extract "mu4e-proc")
(declare-function mu4e-headers-search "mu4e-headers") (declare-function mu4e-headers-search "mu4e-headers")
(defvar mu4e-headers-include-related)
(defvar mu4e-headers-show-threads)
(defvar mu4e-view-show-addresses)
(defvar mu4e-view-date-format)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun mu4e-action-count-lines (msg) (defun mu4e-action-count-lines (msg)

View File

@ -1,4 +1,4 @@
; mu4e-context.el -- part of mu4e, the mu mail user agent ; mu4e-context.el -- part of mu4e, the mu mail user agent -*- lexical-binding: t -*-
;; ;;
;; Copyright (C) 2015-2016 Dirk-Jan C. Binnema ;; Copyright (C) 2015-2016 Dirk-Jan C. Binnema
@ -27,6 +27,10 @@
(require 'cl-lib) (require 'cl-lib)
(require 'mu4e-utils) (require 'mu4e-utils)
(defvar mu4e-move-to-trash-patterns)
(defvar smtpmail-smtp-user)
(defvar mu4e-view-date-format)
(defvar mu4e-contexts nil "The list of `mu4e-context' objects (defvar mu4e-contexts nil "The list of `mu4e-context' objects
describing mu4e's contexts.") describing mu4e's contexts.")

View File

@ -1,4 +1,4 @@
;;; mu4e-contrib.el -- part of mu4e, the mu mail user agent ;;; mu4e-contrib.el -- part of mu4e, the mu mail user agent -*- lexical-binding: t -*-
;; ;;
;; Copyright (C) 2013-2016 Dirk-Jan C. Binnema ;; Copyright (C) 2013-2016 Dirk-Jan C. Binnema
@ -25,12 +25,14 @@
(require 'mu4e) (require 'mu4e)
(defvar bookmark-make-record-function)
(defun mu4e-headers-mark-all-unread-read () (defun mu4e-headers-mark-all-unread-read ()
"Put a ! \(read) mark on all visible unread messages." "Put a ! \(read) mark on all visible unread messages."
(interactive) (interactive)
(mu4e-headers-mark-for-each-if (mu4e-headers-mark-for-each-if
(cons 'read nil) (cons 'read nil)
(lambda (msg param) (lambda (msg _param)
(memq 'unread (mu4e-msg-field msg :flags))))) (memq 'unread (mu4e-msg-field msg :flags)))))
(defun mu4e-headers-flag-all-read () (defun mu4e-headers-flag-all-read ()
@ -46,7 +48,7 @@
(interactive) (interactive)
(mu4e-headers-mark-for-each-if (mu4e-headers-mark-for-each-if
(cons 'something nil) (cons 'something nil)
(lambda (msg param) t)) (lambda (_msg _param) t))
(mu4e-mark-execute-all)) (mu4e-mark-execute-all))
;;; ;;;

View File

@ -1,4 +1,4 @@
;; mu4e-draft.el -- part of mu4e, the mu mail user agent for emacs ;; mu4e-draft.el -- part of mu4e, the mu mail user agent for emacs -*- lexical-binding: t -*-
;; ;;
;; Copyright (C) 2011-2019 Dirk-Jan C. Binnema ;; Copyright (C) 2011-2019 Dirk-Jan C. Binnema
@ -77,6 +77,8 @@ If nil, only do so when sending the message."
(format "mu4e %s; emacs %s" mu4e-mu-version emacs-version) (format "mu4e %s; emacs %s" mu4e-mu-version emacs-version)
"The User-Agent string for mu4e, or nil.") "The User-Agent string for mu4e, or nil.")
(defvar mu4e-view-date-format)
(defun mu4e~draft-cite-original (msg) (defun mu4e~draft-cite-original (msg)
"Return a cited version of the original message MSG as a plist. "Return a cited version of the original message MSG as a plist.
This function uses `mu4e-compose-cite-function', and as such all This function uses `mu4e-compose-cite-function', and as such all
@ -413,9 +415,6 @@ You can append flags."
Replying-to-self is special; in that case, the To and Cc fields Replying-to-self is special; in that case, the To and Cc fields
will be the same as in the original." will be the same as in the original."
(let* ((reply-to-self (mu4e-message-contact-field-matches-me origmsg :from)) (let* ((reply-to-self (mu4e-message-contact-field-matches-me origmsg :from))
(recipnum
(+ (length (mu4e~draft-create-to-lst origmsg))
(length (mu4e~draft-create-cc-lst origmsg t))))
;; reply-to-self implies reply-all ;; reply-to-self implies reply-all
(reply-all (or reply-to-self (reply-all (or reply-to-self
(eq mu4e-compose-reply-recipients 'all) (eq mu4e-compose-reply-recipients 'all)

View File

@ -1,4 +1,4 @@
;;; mu4e-icalendar.el --- reply to iCalendar meeting requests (part of mu4e) -*- lexical-binding: t; -*- ;;; mu4e-icalendar.el --- reply to iCalendar meeting requests (part of mu4e) -*- lexical-binding: t; -*- -*- lexical-binding: t -*-
;; ;;
;; Copyright (C) 2019- Christophe Troestler ;; Copyright (C) 2019- Christophe Troestler

View File

@ -1,4 +1,4 @@
;;; mu4e-lists.el -- part of mu4e, the mu mail user agent ;;; mu4e-lists.el -- part of mu4e, the mu mail user agent -*- lexical-binding: t -*-
;; ;;
;; Copyright (C) 2011-2016 Dirk-Jan C. Binnema ;; Copyright (C) 2011-2016 Dirk-Jan C. Binnema

View File

@ -1,4 +1,4 @@
;; mu4e-mark.el -- part of mu4e, the mu mail user agent ;; mu4e-mark.el -- part of mu4e, the mu mail user agent -*- lexical-binding: t -*-
;; ;;
;; Copyright (C) 2011-2019 Dirk-Jan C. Binnema ;; Copyright (C) 2011-2019 Dirk-Jan C. Binnema
@ -356,7 +356,7 @@ user which one)."
(let ((markpair)) (let ((markpair))
(maphash (maphash
(lambda (docid val) (lambda (docid val)
(let ((mark (car val)) (target (cdr val))) (let ((mark (car val)))
(when (eql mark 'something) (when (eql mark 'something)
(unless markpair (unless markpair
(setq markpair (setq markpair
@ -421,7 +421,7 @@ If NO-CONFIRMATION is non-nil, don't ask user for confirmation."
(when (or (null mu4e~mark-map) (zerop (hash-table-count mu4e~mark-map))) (when (or (null mu4e~mark-map) (zerop (hash-table-count mu4e~mark-map)))
(mu4e-warn "Nothing is marked")) (mu4e-warn "Nothing is marked"))
(maphash (maphash
(lambda (docid val) (lambda (docid _val)
(save-excursion (save-excursion
(when (mu4e~headers-goto-docid docid) (when (mu4e~headers-goto-docid docid)
(mu4e-mark-set 'unmark)))) (mu4e-mark-set 'unmark))))

View File

@ -1,4 +1,4 @@
;;; mu4e-message.el -- part of mu4e, the mu mail user agent ;;; mu4e-message.el -- part of mu4e, the mu mail user agent -*- lexical-binding: t -*-
;; ;;
;; Copyright (C) 2012-2018 Dirk-Jan C. Binnema ;; Copyright (C) 2012-2018 Dirk-Jan C. Binnema
@ -30,6 +30,9 @@
(require 'mu4e-utils) (require 'mu4e-utils)
(require 'flow-fill) (require 'flow-fill)
(defvar mu4e~view-message)
(defvar shr-inhibit-images)
(defcustom mu4e-html2text-command (defcustom mu4e-html2text-command
(if (fboundp 'shr-insert-document) (if (fboundp 'shr-insert-document)
'mu4e-shr2text 'mu4e-shr2text
@ -231,7 +234,7 @@ unless PREFER-HTML is non-nil."
(setq body (funcall func msg body))) (setq body (funcall func msg body)))
body)) body))
(defun mu4e-message-outlook-cleanup (msg body) (defun mu4e-message-outlook-cleanup (_msg body)
"Clean-up MSG's BODY. "Clean-up MSG's BODY.
Esp. MS-Outlook-originating message may not advertise the correct Esp. MS-Outlook-originating message may not advertise the correct
encoding (e.g. 'iso-8859-1' instead of 'windows-1252'), thus encoding (e.g. 'iso-8859-1' instead of 'windows-1252'), thus
@ -331,7 +334,7 @@ Emacs. Based on code by Titus von der Malsburg."
(shr-inhibit-images t)) (shr-inhibit-images t))
(shr-render-region (point-min) (point-max)))) msg)) (shr-render-region (point-min) (point-max)))) msg))
(defun mu4e~html2text-shell (msg cmd) (defun mu4e~html2text-shell (msg _cmd)
"Convert html2 text in MSG using a shell function CMD." "Convert html2 text in MSG using a shell function CMD."
(mu4e~html2text-wrapper (mu4e~html2text-wrapper
(lambda () (lambda ()

View File

@ -1,4 +1,4 @@
;; mu4e-proc.el -- part of mu4e, the mu mail user agent ;; mu4e-proc.el -- part of mu4e, the mu mail user agent -*- lexical-binding: t -*-
;; ;;
;; Copyright (C) 2011-2019 Dirk-Jan C. Binnema ;; Copyright (C) 2011-2019 Dirk-Jan C. Binnema
@ -92,7 +92,7 @@ removed."
(car objcons))))))) (car objcons)))))))
(defun mu4e~proc-filter (proc str) (defun mu4e~proc-filter (_proc str)
"Filter string STR from PROC. "Filter string STR from PROC.
This process the the 'mu server' output. It accumulates the This process the the 'mu server' output. It accumulates the
strings into valid sexps by checking of the ';;eox' `end-of-sexp' strings into valid sexps by checking of the ';;eox' `end-of-sexp'
@ -287,7 +287,7 @@ Start the process if needed."
;; error codes are defined in src/mu-util ;; error codes are defined in src/mu-util
;;(defconst mu4e-xapian-empty 19 "Error code: xapian is empty/non-existent") ;;(defconst mu4e-xapian-empty 19 "Error code: xapian is empty/non-existent")
(defun mu4e~proc-sentinel (proc msg) (defun mu4e~proc-sentinel (proc _msg)
"Function called when the server process PROC terminates with MSG." "Function called when the server process PROC terminates with MSG."
(let ((status (process-status proc)) (code (process-exit-status proc))) (let ((status (process-status proc)) (code (process-exit-status proc)))
(setq mu4e~proc-process nil) (setq mu4e~proc-process nil)

View File

@ -1,4 +1,4 @@
;;; mu4e-speedbar --- Speedbar support for mu4e ;;; mu4e-speedbar --- Speedbar support for mu4e -*- lexical-binding: t -*-
;; Copyright (C) 2012-2018 Antono Vasiljev, Dirk-Jan C. Binnema ;; Copyright (C) 2012-2018 Antono Vasiljev, Dirk-Jan C. Binnema
;; ;;
@ -88,7 +88,7 @@
maildir-name)) maildir-name))
(mu4e-get-maildirs))))) (mu4e-get-maildirs)))))
(defun mu4e~speedbar-maildir (&optional text token ident) (defun mu4e~speedbar-maildir (&optional _text token _ident)
"Jump to maildir TOKEN. TEXT and INDENT are not used." "Jump to maildir TOKEN. TEXT and INDENT are not used."
(dframe-with-attached-buffer (dframe-with-attached-buffer
(mu4e-headers-search (concat "\"maildir:" token "\"") (mu4e-headers-search (concat "\"maildir:" token "\"")
@ -106,13 +106,13 @@
(mu4e-bookmark-query bookmark))) (mu4e-bookmark-query bookmark)))
(mu4e-bookmarks))) (mu4e-bookmarks)))
(defun mu4e~speedbar-bookmark (&optional text token ident) (defun mu4e~speedbar-bookmark (&optional _text token _ident)
"Run bookmarked query TOKEN. TEXT and INDENT are not used." "Run bookmarked query TOKEN. TEXT and INDENT are not used."
(dframe-with-attached-buffer (dframe-with-attached-buffer
(mu4e-headers-search token current-prefix-arg))) (mu4e-headers-search token current-prefix-arg)))
;;;###autoload ;;;###autoload
(defun mu4e-speedbar-buttons (&optional buffer) (defun mu4e-speedbar-buttons (&optional _buffer)
"Create buttons for any mu4e BUFFER." "Create buttons for any mu4e BUFFER."
(interactive) (interactive)
(erase-buffer) (erase-buffer)

View File

@ -1,4 +1,4 @@
;;; mu4e-vars.el -- part of mu4e, the mu mail user agent ;;; mu4e-vars.el -- part of mu4e, the mu mail user agent -*- lexical-binding: t -*-
;; ;;
;; Copyright (C) 2011-2019 Dirk-Jan C. Binnema ;; Copyright (C) 2011-2019 Dirk-Jan C. Binnema

View File

@ -1,4 +1,4 @@
;;; mu4e.el --- part of mu4e, the mu mail user agent ;;; mu4e.el --- part of mu4e, the mu mail user agent -*- lexical-binding: t -*-
;; ;;
;; Copyright (C) 2011-2016 Dirk-Jan C. Binnema ;; Copyright (C) 2011-2016 Dirk-Jan C. Binnema

View File

@ -1,4 +1,4 @@
;;; org-mu4e -- Support for links to mu4e messages/queries from within ;;; org-mu4e -- Support for links to mu4e messages/queries from within -*- lexical-binding: t -*-
;;; org-mode, and for writing message in org-mode, sending them as ;;; org-mode, and for writing message in org-mode, sending them as
;;; rich-text ;;; rich-text
;; ;;
@ -39,6 +39,10 @@
(declare-function mu4e-message "mu4e-message") (declare-function mu4e-message "mu4e-message")
(declare-function mu4e-compose-mode "mu4e-compose") (declare-function mu4e-compose-mode "mu4e-compose")
(defvar org-export-skip-text-before-1st-heading)
(defvar org-export-htmlize-output-type)
(defvar org-export-preserve-breaks)
(defvar org-export-with-LaTeX-fragments)
(defgroup org-mu4e nil (defgroup org-mu4e nil
"Settings for the org-mode related functionality in mu4e." "Settings for the org-mode related functionality in mu4e."

View File

@ -1,4 +1,4 @@
;;; org-mu4e -- Support for links to mu4e messages/queries from within org-mode, ;;; org-mu4e -- Support for links to mu4e messages/queries from within org-mode, -*- lexical-binding: t -*-
;;; and for writing message in org-mode, sending them as rich-text ;;; and for writing message in org-mode, sending them as rich-text
;; ;;
;; Copyright (C) 2012-2016 Dirk-Jan C. Binnema ;; Copyright (C) 2012-2016 Dirk-Jan C. Binnema
@ -34,6 +34,11 @@
(require 'org nil 'noerror) (require 'org nil 'noerror)
(require 'org-exp nil 'noerror) (require 'org-exp nil 'noerror)
(defvar org-export-skip-text-before-1st-heading)
(defvar org-export-htmlize-output-type)
(defvar org-export-preserve-breaks)
(defvar org-export-with-LaTeX-fragments)
(require 'mu4e) (require 'mu4e)
(defgroup org-mu4e nil (defgroup org-mu4e nil