[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnorb b53c93f 354/449: Enormous quantities of compiler-

From: Stefan Monnier
Subject: [elpa] externals/gnorb b53c93f 354/449: Enormous quantities of compiler-inspired fixes
Date: Fri, 27 Nov 2020 23:16:10 -0500 (EST)

branch: externals/gnorb
commit b53c93f8883257d805607d4683dc68055642a918
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Enormous quantities of compiler-inspired fixes
    And this isn't even the half of it. Essentially, I was lying to myself
    that these libraries are independently usable. They've got all kinds
    of cross-dependencies; I'll either need to give up on the idea
    altogether, or do some serious code-combing.
 gnorb-bbdb.el     | 28 ++++++++++++++--------------
 gnorb-gnus.el     | 13 +++++++++++--
 gnorb-org.el      | 40 +++++++++++++++++++++++++++++++++-------
 gnorb-registry.el |  8 ++++----
 gnorb-utils.el    | 10 +++++++---
 nngnorb.el        | 24 ++++++++++++------------
 6 files changed, 81 insertions(+), 42 deletions(-)

diff --git a/gnorb-bbdb.el b/gnorb-bbdb.el
index b607fec..82c8edc 100644
--- a/gnorb-bbdb.el
+++ b/gnorb-bbdb.el
@@ -28,6 +28,8 @@
 ;;; Code:
 (require 'bbdb)
+(require 'bbdb-com)
+(require 'bbdb-mua)
 (require 'gnorb-utils)
 (require 'cl-lib)
@@ -105,7 +107,7 @@ mentioned in the docstring of `format-time-string', which 
   :group 'gnorb-bbdb
   :type 'string)
-(defface gnorb-bbdb-link (org-compatible-face 'org-link nil)
+(defface gnorb-bbdb-link 'org-link
   "Custom face for displaying message links in the *BBDB* buffer.
   Defaults to org-link."
   :group 'gnorb-bbdb)
@@ -148,10 +150,10 @@ returns either t or nil. In this case, the second element 
of the
 list is disregarded.
 All following elements should be field setters for the message to
-be composed, just as in `gnus-posting-styles'.
+be composed, just as in `gnus-posting-styles'."
-An example value might look like:"
-  :group 'gnorb-bbdb)
+  :group 'gnorb-bbdb
+  :type 'list)
 (when (fboundp 'bbdb-record-xfield-string)
   (fset (intern (format "bbdb-read-xfield-%s"
@@ -174,12 +176,12 @@ An example value might look like:"
                     "[ \t\n]*"))
            (crm-local-completion-map bbdb-crm-local-completion-map)
            (table (cl-mapcar #'car
-                          (org-global-tags-completion-table
-                           (org-agenda-files))))
+                             (org-global-tags-completion-table
+                              (org-agenda-files))))
            (init (if (consp init)
-                     (bbdb-join init
-                                (nth 2 (assq gnorb-bbdb-org-tag-field
-                                             bbdb-separator-alist)))
+                     (apply #'bbdb-concat (nth 2 (assq gnorb-bbdb-org-tag-field
+                                                       bbdb-separator-alist))
+                            init)
         "Tags: " table
@@ -245,7 +247,7 @@ is non-nil (as in interactive calls) be verbose."
 (defun gnorb-bbdb-configure-posting-styles (recs)
   ;; My most magnificent work of copy pasta!
   (dolist (r recs)
-    (let (field val label rec-val element filep
+    (let (field val label rec-val filep
                element v value results name address)
       (dolist (style gnorb-bbdb-posting-styles)
        (setq field (pop style)
@@ -334,7 +336,6 @@ is non-nil (as in interactive calls) be verbose."
       (setq name (assq 'name results)
            address (assq 'address results))
       (setq results (delq name (delq address results)))
-      (gnus-make-local-hook 'message-setup-hook)
       (setq results (sort results (lambda (x y)
                                    (string-lessp (car x) (car y)))))
       (dolist (result results)
@@ -522,7 +523,7 @@ layout type."
 (fset (intern (format "bbdb-read-xfield-%s"
-      (lambda (&optional init)
+      (lambda (&optional _init)
        (user-error "This field shouldn't be edited manually")))
 ;; Open links from the *BBDB* buffer.
@@ -545,8 +546,7 @@ that contact will start collecting links to messages."
   (unless (fboundp 'bbdb-record-xfield-string)
     (user-error "This function only works with the git version of BBDB"))
-  (let* ((record (bbdb-current-record))
-        msg-list target-msg)
+  (let (msg-list target-msg)
     (if (not (memq gnorb-bbdb-messages-field
                   (mapcar 'car (bbdb-record-xfields record))))
        (when (y-or-n-p
diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index 3b045da..3350518 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -25,13 +25,22 @@
 ;;; Code:
 (require 'gnus)
+(require 'gnus-sum)
+(require 'gnus-art)
+(require 'message)
+(require 'org)
+(require 'org-attach)
+(require 'org-capture)
 (require 'gnorb-utils)
+(require 'mm-decode)
 (declare-function org-gnus-article-link "org-gnus"
                  (group newsgroups message-id x-no-archive))
 (declare-function org-gnus-follow-link "org-gnus"
                  (group article))
+(defvar org-refile-targets)
 (defgroup gnorb-gnus nil
   "The Gnus bits of Gnorb."
   :tag "Gnorb Gnus"
@@ -160,7 +169,7 @@ each message."
     (when data
       (gnorb-gnus-attach-part data))))
-(defun gnorb-gnus-attach-part (handle &optional org-heading)
+(defun gnorb-gnus-attach-part (handle)
   "Attach HANDLE to an existing org heading."
   (let* ((filename (gnorb-gnus-save-part handle))
         (org-refile-targets gnorb-gnus-trigger-refile-targets)
@@ -246,7 +255,7 @@ save them into `gnorb-tmp-dir'."
     (when (and org-note-abort
               (or gnorb-gnus-capture-always-attach
                   (org-capture-get :gnus-attachments)))
-     (condition-case error
+     (condition-case nil
         (progn (org-attach-delete-all)
                (setq abort-note 'clean)
                ;; remove any gnorb-mail-header values here
diff --git a/gnorb-org.el b/gnorb-org.el
index 0916b83..2bb21c1 100644
--- a/gnorb-org.el
+++ b/gnorb-org.el
@@ -25,7 +25,25 @@
 ;;; Code:
 (require 'gnorb-utils)
-(require 'cl-lib)
+(eval-when-compile (require 'cl-lib))
+(defvar gnorb-bbdb-posting-styles)
+(defvar gnorb-bbdb-org-tag-field)
+(defvar bbdb-buffer-name)
+(defvar message-alternative-emails)
+;; This many autoloads means either we should require bbdb outright,
+;; or something needs refactoring.
+(autoload 'gnorb-bbdb-configure-posting-styles "gnorb-bbdb")
+(autoload 'gnorb-registry-org-id-search "gnorb-registry")
+(autoload 'bbdb-completing-read-record "bbdb")
+(autoload 'bbdb-record-name "bbdb")
+(autoload 'bbdb-message-search "bbdb")
+(autoload 'bbdb-mail-address "bbdb")
+(autoload 'bbdb-record-xfield "bbdb")
+(autoload 'bbdb-records "bbdb")
+(autoload 'bbdb-search "bbdb")
+(autoload 'bbdb-display-records "bbdb")
 (defgroup gnorb-org nil
   "The Org bits of Gnorb."
@@ -89,7 +107,10 @@ is disabled entirely, or `gnorb-org-handle-mail' has been 
 with a prefix arg, the heading and body text of the subtree under
 point will instead be scanned for gnus:, mailto:, and bbdb:
 links. This option controls how many paragraphs of body text to
-scan. Set to 0 to only look in the heading.")
+scan. Set to 0 to only look in the heading."
+  :group 'gnorb-org
+  :type '(choice (const :tag "Whole subtree" all)
+                (integer :tag "Number of paragraphs")))
@@ -147,7 +168,7 @@ we came from."
   (setq gnorb-message-org-ids nil)
-(defun gnorb-org-extract-links (&optional arg region)
+(defun gnorb-org-extract-links (&optional _arg region)
   "See if there are viable links in the subtree under point."
   ;; We're not currently using the arg. What could we do with it?
   (let (strings)
@@ -489,7 +510,9 @@ async, subtreep, visible-only, and body-only."
   "Correspondence between export backends and their
 respective (usual) file extensions. Ugly way to do it, but what
 the hey..."
-  :group 'gnorb-org)
+  :group 'gnorb-org
+  :type '(repeat
+         (list symbol string)))
 (defvar org-export-show-temporary-export-buffer)
@@ -554,7 +577,8 @@ default set of parameters."
   "Should the capture process store a link to the gnus message or
   BBDB record under point, even if it's not part of the template?
   You'll probably end up needing it, anyway."
-  :group 'gnorb-org)
+  :group 'gnorb-org
+  :type 'boolean)
 (defun gnorb-org-capture-collect-link ()
   (when gnorb-org-capture-collect-link-p
@@ -577,7 +601,8 @@ default set of parameters."
 Records are considered matching if they have an `org-tags' field
 matching the current Agenda search. The name of that field can be
 customized with `gnorb-bbdb-org-tag-field'."
-  :group 'gnorb-org)
+  :group 'gnorb-org
+  :type 'boolean)
 (defcustom gnorb-org-bbdb-popup-layout 'pop-up-multi-line
   "Default BBDB buffer layout for automatic Org Agenda display."
@@ -606,7 +631,7 @@ search."
                 (eq org-agenda-type 'tags))
            (or (called-interactively-p 'any)
-          (let ((todo-only nil)
+          (let ((org--matcher-tags-todo-only nil)
                 (str (or str org-agenda-query-string))
                 or-terms term rest out-or acc tag-clause)
@@ -635,6 +660,7 @@ search."
                                     (case-fold-search t)
                                     (org-trust-scanner-tags t))
+                                ;; This is bad, we're lexically bound, now.
                                 (eval tag-clause)))))
          ((eq major-mode 'org-mode)
diff --git a/gnorb-registry.el b/gnorb-registry.el
index 3ef1486..31d06cb 100644
--- a/gnorb-registry.el
+++ b/gnorb-registry.el
@@ -97,7 +97,7 @@ to the message's registry entry, under the 'gnorb-ids key."
   (when (and (org-capture-get :gnorb-id)
     (with-no-warnings ; For `abort-note'
-      (condition-case error
+      (condition-case nil
          (let* ((msg-id (format "<%s>" (plist-get org-store-link-plist 
                 (existing-org-ids (gnus-registry-get-id-key msg-id 'gnorb-ids))
                 (org-id (org-capture-get :gnorb-id)))
@@ -154,7 +154,7 @@ after an Org heading is deleted, for instance."
   (let ((assoc-msgs (gnorb-registry-org-id-search org-id))
         (registry-lookup-secondary gnus-registry-db 'gnorb-ids)))
-    (mapcar
+    (mapc
      (lambda (msg-id)
        (let ((org-ids
              (gnus-registry-get-id-key msg-id 'gnorb-ids)))
@@ -230,7 +230,7 @@ number of tracked messages, the number of tracked headings, 
and how much of the
                                 (gnorb-flush-dead-associations t)
-(defun gnorb-refresh-usage-status (&optional ignore-auto noconfirm)
+(defun gnorb-refresh-usage-status ()
   "Clear and re-format the *Gnorb Usage* buffer."
   (let ((messages (length (gnorb-registry-tracked-messages)))
        (headings (length (gnorb-registry-tracked-headings)))
@@ -280,7 +280,7 @@ your Org files."
        (let ((id (org-id-get))
             (props (org-entry-get-multivalued-property
               (point) gnorb-org-msg-id-key))
-            links group)
+            links)
        (when props
          ;; If the property is set, we should probably assume that any
          ;; Gnus links in the subtree are relevant, and should also be
diff --git a/gnorb-utils.el b/gnorb-utils.el
index 4e79204..aaa86cc 100644
--- a/gnorb-utils.el
+++ b/gnorb-utils.el
@@ -24,15 +24,19 @@
 ;;; Code:
-(require 'cl-lib)
+(eval-when-compile (require 'cl-lib))
 (require 'pcase)
+(require 'org)
+(require 'org-agenda)
+(require 'org-element)
 (require 'mailcap)
 (defgroup gnorb nil
   "Glue code between Gnus, Org, and BBDB."
-  :tag "Gnorb")
+  :tag "Gnorb"
+  :group 'mail)
@@ -303,7 +307,7 @@ numbers (no upper bound)."
        (when-let ((win (get-buffer-window gnorb-select-choice-buffer)))
          (quit-window win))))))
-(defun gnorb-trigger-todo-action (arg &optional id)
+(defun gnorb-trigger-todo-action (_arg &optional id)
   "Do the actual restore action. Two main things here. First: if
 we were in the agenda when this was called, then keep us in the
 agenda. Then let the user choose an action from the value of
diff --git a/nngnorb.el b/nngnorb.el
index 732254e..c24aa03 100644
--- a/nngnorb.el
+++ b/nngnorb.el
@@ -59,7 +59,7 @@
 (add-to-list 'nnir-engines
             '(gnorb nnir-run-gnorb))
-(defun nnir-run-gnorb (query server &optional group)
+(defun nnir-run-gnorb (query _server &optional _group)
   "Run the actual search for messages to display. See nnir.el for
 some details of how this gets called.
@@ -266,7 +266,7 @@ continue to provide tracking of sent messages."
   (gnus-summary-mail-forward n t)
-(defun gnorb-summary-reply-hook (&rest args)
+(defun gnorb-summary-reply-hook (&rest _args)
   "Function that runs after any command that creates a reply."
   ;; Not actually a "hook"
   (let* ((msg-id (if message-reply-headers
@@ -355,31 +355,31 @@ the message being included in this search."
 (defvar nngnorb-status-string "")
-(defun nngnorb-retrieve-headers (articles &optional group server fetch-old)
+(defun nngnorb-retrieve-headers (_articles &optional _group _server _fetch-old)
   (with-current-buffer nntp-server-buffer
-(defun nngnorb-open-server (server &optional definitions)
+(defun nngnorb-open-server (_server &optional _definitions)
-(defun nngnorb-close-server (&optional server)
+(defun nngnorb-close-server (&optional _server)
 (defun nngnorb-request-close ()
-(defun nngnorb-server-opened (&optional server)
+(defun nngnorb-server-opened (&optional _server)
-(defun nngnorb-status-message (&optional server)
+(defun nngnorb-status-message (&optional _server)
-(defun nngnorb-request-article (article &optional group server to-buffer)
+(defun nngnorb-request-article (_article &optional _group _server _to-buffer)
   (setq nngnorb-status-string "No such group")
-(defun nngnorb-request-group (group &optional server fast info)
+(defun nngnorb-request-group (_group &optional _server _fast _info)
   (let (deactivate-mark)
     (with-current-buffer nntp-server-buffer
@@ -387,15 +387,15 @@ the message being included in this search."
   (setq nngnorb-status-string "No such group")
-(defun nngnorb-close-group (group &optional server)
+(defun nngnorb-close-group (_group &optional _server)
-(defun nngnorb-request-list (&optional server)
+(defun nngnorb-request-list (&optional _server)
   (with-current-buffer nntp-server-buffer
-(defun nngnorb-request-post (&optional server)
+(defun nngnorb-request-post (&optional _server)
   (setq nngnorb-status-string "Read-only server")

reply via email to

[Prev in Thread] Current Thread [Next in Thread]