]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: use lexical-bindings in all libraries
authorJonas Bernoulli <jonas@bernoul.li>
Sun, 10 Jan 2021 14:00:47 +0000 (15:00 +0100)
committerDavid Bremner <david@tethera.net>
Wed, 13 Jan 2021 11:16:04 +0000 (07:16 -0400)
Doing so causes many new compile warnings.  Some of these warnings
concern genuine changes in behavior that have to be addressed right
away.

Many other warnings are due to unused variables.  Nothing has changed
here, except that the byte-compiler can now detect these pre-existing
and harmless issues.  We delay addressing these issues so that we can
focus on the important ones here.

A third group of warnings concern arguments that are not actually used
inside the function but which cannot be removed because the functions
signature is dictated by some outside convention.  Silencing these
warning is also delayed until subsequent commits.

21 files changed:
emacs/coolj.el
emacs/make-deps.el
emacs/notmuch-address.el
emacs/notmuch-compat.el
emacs/notmuch-crypto.el
emacs/notmuch-draft.el
emacs/notmuch-hello.el
emacs/notmuch-jump.el
emacs/notmuch-lib.el
emacs/notmuch-maildir-fcc.el
emacs/notmuch-message.el
emacs/notmuch-mua.el
emacs/notmuch-parser.el
emacs/notmuch-print.el
emacs/notmuch-query.el
emacs/notmuch-show.el
emacs/notmuch-tag.el
emacs/notmuch-tree.el
emacs/notmuch-wash.el
emacs/notmuch.el
emacs/rstdoc.el

index b3e314f0ffa268fb10d38beb7c49abf855e9c4a5..d820525b3f0240a3afe0e41a5faa82b85cd16cd2 100644 (file)
@@ -1,4 +1,4 @@
-;;; coolj.el --- automatically wrap long lines  -*- coding:utf-8 -*-
+;;; coolj.el --- automatically wrap long lines  -*- lexical-binding: t; coding: utf-8 -*-
 
 ;; Copyright (C) 2000, 2001, 2004-2009 Free Software Foundation, Inc.
 
 
 ;; Copyright (C) 2000, 2001, 2004-2009 Free Software Foundation, Inc.
 
index a7699fb1dd05cff9c167217d6671cb0b891dd628..8c9e0a27e988abf1e1da9d1230ea702c856bcdf7 100644 (file)
@@ -1,4 +1,4 @@
-;;; make-deps.el --- compute make dependencies for Elisp sources
+;;; make-deps.el --- compute make dependencies for Elisp sources  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Austin Clements
 ;;
 ;;
 ;; Copyright © Austin Clements
 ;;
index bf29c3a0efcdcd70f95eb156805d823edb194e90..6b1174587d381b452fe9443658727eef0b66d119 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-address.el --- address completion with notmuch
+;;; notmuch-address.el --- address completion with notmuch  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © David Edmondson
 ;;
 ;;
 ;; Copyright © David Edmondson
 ;;
index c4e07780506d84855c46f0169b22368b88319a0d..ad134dfee99c273f7ffb5895730364902abe40af 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-compat.el --- compatibility functions for earlier versions of emacs
+;;; notmuch-compat.el --- compatibility functions for earlier versions of emacs  -*- lexical-binding: t -*-
 ;;
 ;; The functions in this file are copied from more modern versions of
 ;; emacs and are Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2017
 ;;
 ;; The functions in this file are copied from more modern versions of
 ;; emacs and are Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2017
index 6d2d35a53ceed812fa4782d11abf9084e84571d9..ee5231e59ea957d8cfa5e7b7c4b92b9d109810b5 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-crypto.el --- functions for handling display of cryptographic metadata
+;;; notmuch-crypto.el --- functions for handling display of cryptographic metadata  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Jameson Rollins
 ;;
 ;;
 ;; Copyright © Jameson Rollins
 ;;
index 9ce9e736e4a6c36a4b323664097ab0a3508919c8..8af045986ba6c9d34d4cc7360762f1a7fa9fad30 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-draft.el --- functions for postponing and editing drafts
+;;; notmuch-draft.el --- functions for postponing and editing drafts  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Mark Walters
 ;; Copyright © David Bremner
 ;;
 ;; Copyright © Mark Walters
 ;; Copyright © David Bremner
index 28ffedd98ef33be6b4d8ab37f5aaef9cadde223d..586a28489cf9dc570851ef308b9fb8416558bd8a 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-hello.el --- welcome to notmuch, a frontend
+;;; notmuch-hello.el --- welcome to notmuch, a frontend  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © David Edmondson
 ;;
 ;;
 ;; Copyright © David Edmondson
 ;;
index 7a27b6b32c339819cfc2cbaff930d3629a17f9b2..5dcec9700a3417adce62fd200c057ab199374453 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-jump.el --- User-friendly shortcut keys
+;;; notmuch-jump.el --- User-friendly shortcut keys  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Austin Clements
 ;;
 ;;
 ;; Copyright © Austin Clements
 ;;
index 0b698d59a25f2e767c777b72b8a9f626a855e958..7595bbe1f5d3da0a24cc265fe83a2142284486f1 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-lib.el --- common variables, functions and function declarations
+;;; notmuch-lib.el --- common variables, functions and function declarations  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Carl Worth
 ;;
 ;;
 ;; Copyright © Carl Worth
 ;;
index 5de03cc23416e6f5370da66b24264e2e3156542d..e880653cfa5871e1e6fb6eb3860f9a13ea0aacb0 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-maildir-fcc.el --- inserting using a fcc handler
+;;; notmuch-maildir-fcc.el --- inserting using a fcc handler  -*- lexical-binding: t -*-
 
 ;; Copyright © Jesse Rosenthal
 ;;
 
 ;; Copyright © Jesse Rosenthal
 ;;
index c224207098556b1c34a40572f6b90aa008b06dc4..f0e9ffcca7e9408cb1d4e1255627f01a03f91aa5 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-message.el --- message-mode functions specific to notmuch
+;;; notmuch-message.el --- message-mode functions specific to notmuch  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Jesse Rosenthal
 ;;
 ;;
 ;; Copyright © Jesse Rosenthal
 ;;
index 6fe5f6d0152ad855dca18c7fe451c15431b2a13a..d50fdb26afad972e88403ad0bbef8983d7525306 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-mua.el --- emacs style mail-user-agent
+;;; notmuch-mua.el --- emacs style mail-user-agent  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © David Edmondson
 ;;
 ;;
 ;; Copyright © David Edmondson
 ;;
 (declare-function notmuch-draft-postpone "notmuch-draft" ())
 (declare-function notmuch-draft-save "notmuch-draft" ())
 
 (declare-function notmuch-draft-postpone "notmuch-draft" ())
 (declare-function notmuch-draft-save "notmuch-draft" ())
 
+(defvar notmuch-show-indent-multipart)
+(defvar notmuch-show-insert-header-p-function)
+(defvar notmuch-show-max-text-part-size)
+(defvar notmuch-show-insert-text/plain-hook)
+
 ;;; Options
 
 (defcustom notmuch-mua-send-hook nil
 ;;; Options
 
 (defcustom notmuch-mua-send-hook nil
index 4a437016dc6b47d6e6e6fa33d76c31fa6ac1e5df..b8c3fd2c67df90932ec2e66ad0d3c4a8c863937e 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-parser.el --- streaming S-expression parser
+;;; notmuch-parser.el --- streaming S-expression parser  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Austin Clements
 ;;
 ;;
 ;; Copyright © Austin Clements
 ;;
index d7b2fcceaa37e280ce08cccca252a15a48ffa4da..8da9a0918e7701c1b66f647e16bc523bbfd53974 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-print.el --- printing messages from notmuch
+;;; notmuch-print.el --- printing messages from notmuch  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © David Edmondson
 ;;
 ;;
 ;; Copyright © David Edmondson
 ;;
index 72ddd2ceafc28a0aec08f47155e16f2f5cc94429..ffce8814566aa7b2f4740383df03805efed416ea 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-query.el --- provide an emacs api to query notmuch
+;;; notmuch-query.el --- provide an emacs api to query notmuch  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © David Bremner
 ;;
 ;;
 ;; Copyright © David Bremner
 ;;
index 7dfbb32738e0ca949b712b648d547a00db7aa02a..72e21d94387c698739e7cc435d34d13ce40598d1 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-show.el --- displaying notmuch forests
+;;; notmuch-show.el --- displaying notmuch forests  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
 (declare-function notmuch-read-query "notmuch" (prompt))
 (declare-function notmuch-draft-resume "notmuch-draft" (id))
 
 (declare-function notmuch-read-query "notmuch" (prompt))
 (declare-function notmuch-draft-resume "notmuch-draft" (id))
 
+(defvar shr-blocked-images)
+(defvar gnus-blocked-images)
+(defvar shr-content-function)
+
 ;;; Options
 
 (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
 ;;; Options
 
 (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
index 817ea99fcfc33c5b7770ffb0dfc8f44d2f7593c0..fa376b02b5f9ebc6fde1a2a4f8f23c665948e05d 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-tag.el --- tag messages within emacs
+;;; notmuch-tag.el --- tag messages within emacs  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Damien Cassou
 ;; Copyright © Carl Worth
 ;;
 ;; Copyright © Damien Cassou
 ;; Copyright © Carl Worth
@@ -295,22 +295,24 @@ This can be used with `notmuch-tag-format-image-data'."
                      (and (eq (string-match key tag) 0)
                           (= (match-end 0) (length tag)))))))
 
                      (and (eq (string-match key tag) 0)
                           (= (match-end 0) (length tag)))))))
 
-(defun notmuch-tag--do-format (tag formatted-tag formats)
+(defun notmuch-tag--do-format (bare-tag tag formats)
   "Apply a tag-formats entry to TAG."
   (cond ((null formats)                ;; - Tag not in `formats',
   "Apply a tag-formats entry to TAG."
   (cond ((null formats)                ;; - Tag not in `formats',
-        formatted-tag)         ;;   the format is the tag itself.
+        tag)                   ;;   the format is the tag itself.
        ((null (cdr formats))   ;; - Tag was deliberately hidden,
         nil)                   ;;   no format must be returned
        (t
         ;; Tag was found and has formats, we must apply all the
         ;; formats.  TAG may be null so treat that as a special case.
        ((null (cdr formats))   ;; - Tag was deliberately hidden,
         nil)                   ;;   no format must be returned
        (t
         ;; Tag was found and has formats, we must apply all the
         ;; formats.  TAG may be null so treat that as a special case.
-        (let ((bare-tag tag)
-              (tag (copy-sequence (or formatted-tag ""))))
+        (let ((return-tag (copy-sequence (or tag ""))))
           (dolist (format (cdr formats))
           (dolist (format (cdr formats))
-            (setq tag (eval format)))
-          (if (and (null formatted-tag) (equal tag ""))
+            (setq return-tag
+                  (eval format
+                        `((bare-tag . ,bare-tag)
+                          (tag . ,return-tag)))))
+          (if (and (null tag) (equal return-tag ""))
               nil
               nil
-            tag)))))
+            return-tag)))))
 
 (defun notmuch-tag-format-tag (tags orig-tags tag)
   "Format TAG according to `notmuch-tag-formats'.
 
 (defun notmuch-tag-format-tag (tags orig-tags tag)
   "Format TAG according to `notmuch-tag-formats'.
index 713b00daef1003a629208320e61d8e75dac72077..1ed3480115a7b625fc23ced2bb2bcae39dbacaa2 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-tree.el --- displaying notmuch forests
+;;; notmuch-tree.el --- displaying notmuch forests  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
index f371cc4cfde2832abce4ad10c68f5b134cf1fbbe..70eff63777bf09ad320e9772351d30b97f6e8a8d 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch-wash.el --- cleaning up message bodies
+;;; notmuch-wash.el --- cleaning up message bodies  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
index 6a09dd3883ad8819bc734a9184325f1086868c23..ba9488ca42d5b80f1e69a21843718274c063f96a 100644 (file)
@@ -1,4 +1,4 @@
-;;; notmuch.el --- run notmuch within emacs
+;;; notmuch.el --- run notmuch within emacs  -*- lexical-binding: t -*-
 ;;
 ;; Copyright © Carl Worth
 ;;
 ;;
 ;; Copyright © Carl Worth
 ;;
index 4221f142ce74e1ea6598fc4118e02d9b6439d253..c7c130154a582841b084343f38787431e0bbe77a 100644 (file)
@@ -1,4 +1,4 @@
-;;; rstdoc.el --- help generate documentation from docstrings -*-lexical-binding: t-*-
+;;; rstdoc.el --- help generate documentation from docstrings  -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2018 David Bremner
 
 
 ;; Copyright (C) 2018 David Bremner