emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/gnorb 14471db 262/449: Silence compiler warnings for un


From: Stefan Monnier
Subject: [elpa] externals/gnorb 14471db 262/449: Silence compiler warnings for unbound vars
Date: Fri, 27 Nov 2020 23:15:52 -0500 (EST)

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

    Silence compiler warnings for unbound vars
    
    * gnorb-bbdb.el (gnorb-bbdb-display-org-tags): Silence
      (gnorb-bbdb-display-messages): Silence
    
    * gnorb-gnus.el (gnorb-gnus-capture-abort-cleanup): Silence
      (gnorb-gnus-search-messages): Silence
    
    * gnorb-registry.el (gnorb-registry-capture-abort-cleanup): Silence
---
 gnorb-bbdb.el     | 75 +++++++++++++++++++++++++++++--------------------------
 gnorb-gnus.el     | 28 +++++++++++----------
 gnorb-registry.el | 21 ++++++++--------
 3 files changed, 66 insertions(+), 58 deletions(-)

diff --git a/gnorb-bbdb.el b/gnorb-bbdb.el
index eba51c1..4754f15 100644
--- a/gnorb-bbdb.el
+++ b/gnorb-bbdb.el
@@ -194,13 +194,16 @@ Org tags are stored in the `gnorb-bbdb-org-tags-field'."
              record
              gnorb-bbdb-org-tag-field)))
     (when val
-      (bbdb-display-text (format fmt gnorb-bbdb-org-tag-field)
-                        `(xfields ,full-field field-label)
-                        'bbdb-field-name)
-      (if (consp val)
-         (bbdb-display-list val gnorb-bbdb-org-tag-field "\n")
-       (insert
-        (bbdb-indent-string (concat val "\n") indent))))))
+      ;; We already know that `fmt' and `indent' are dynamically
+      ;; bound, shut up about it.
+      (with-no-warnings
+       (bbdb-display-text (format fmt gnorb-bbdb-org-tag-field)
+                         `(xfields ,full-field field-label)
+                         'bbdb-field-name)
+       (if (consp val)
+          (bbdb-display-list val gnorb-bbdb-org-tag-field "\n")
+        (insert
+         (bbdb-indent-string (concat val "\n") indent)))))))
 
 ;;;###autoload
 (defun gnorb-bbdb-mail (records &optional subject n verbose)
@@ -452,41 +455,43 @@ layout type."
     (define-key map [mouse-1] 'gnorb-bbdb-mouse-open-link)
     (define-key map (kbd "<RET>") 'gnorb-bbdb-RET-open-link)
     (when val
-      ;; indent and fmt are dynamically bound
       (when (eq format 'multi)
-       (bbdb-display-text (format fmt gnorb-bbdb-messages-field)
-                          `(xfields ,full-field field-label)
-                          'bbdb-field-name))
+       (with-no-warnings ; For `fmt'
+         (bbdb-display-text (format fmt gnorb-bbdb-messages-field)
+                            `(xfields ,full-field field-label)
+                            'bbdb-field-name)))
       (insert (cond ((and (stringp val)
                          (eq format 'multi))
-                    (bbdb-indent-string (concat val "\n") indent))
+                    (with-no-warnings ; For `indent'
+                      (bbdb-indent-string (concat val "\n") indent)))
                    ((listp val)
                     ;; Why aren't I using `bbdb-display-list' with a
                     ;; preformatted list of messages?
                     (concat
-                     (bbdb-indent-string
-                      (mapconcat
-                       (lambda (m)
-                         (prog1
-                             (org-propertize
-                              (concat
-                               (format-time-string
-                                (replace-regexp-in-string
-                                 "%:subject" (gnorb-bbdb-link-subject m)
-                                 (replace-regexp-in-string
-                                  "%:count" (number-to-string count)
-                                  (if (eq format 'multi)
-                                      gnorb-bbdb-message-link-format-multi
-                                    gnorb-bbdb-message-link-format-one)))
-                                (gnorb-bbdb-link-date m)))
-                              'face 'gnorb-bbdb-link
-                              'mouse-face 'highlight
-                              'gnorb-bbdb-link-count count
-                              'keymap map)
-                           (incf count)))
-                       val (if (eq format 'multi)
-                               "\n" ", "))
-                      indent)
+                     (with-no-warnings ; For `indent' again
+                       (bbdb-indent-string
+                        (mapconcat
+                         (lambda (m)
+                           (prog1
+                               (org-propertize
+                                (concat
+                                 (format-time-string
+                                  (replace-regexp-in-string
+                                   "%:subject" (gnorb-bbdb-link-subject m)
+                                   (replace-regexp-in-string
+                                    "%:count" (number-to-string count)
+                                    (if (eq format 'multi)
+                                        gnorb-bbdb-message-link-format-multi
+                                      gnorb-bbdb-message-link-format-one)))
+                                  (gnorb-bbdb-link-date m)))
+                                'face 'gnorb-bbdb-link
+                                'mouse-face 'highlight
+                                'gnorb-bbdb-link-count count
+                                'keymap map)
+                             (incf count)))
+                         val (if (eq format 'multi)
+                                 "\n" ", "))
+                        indent))
                      (if (eq format 'multi) "\n" "")))
                    (t
                     ""))))))
diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index d390dee..a793c0d 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -236,15 +236,16 @@ save them into `gnorb-tmp-dir'."
 (add-hook 'org-capture-mode-hook 'gnorb-gnus-capture-attach)
 
 (defun gnorb-gnus-capture-abort-cleanup ()
-  (when (and org-note-abort
-            (org-capture-get :gnus-attachments))
-    (condition-case error
-       (progn (org-attach-delete-all)
-              (setq abort-note 'clean)
-              ;; remove any gnorb-mail-header values here
-              )
-      (error
-       (setq abort-note 'dirty)))))
+  (with-no-warnings ; For `org-note-abort'
+   (when (and org-note-abort
+             (org-capture-get :gnus-attachments))
+     (condition-case error
+        (progn (org-attach-delete-all)
+               (setq abort-note 'clean)
+               ;; remove any gnorb-mail-header values here
+               )
+       (error
+       (setq abort-note 'dirty))))))
 
 (add-hook 'org-capture-prepare-finalize-hook
          'gnorb-gnus-capture-abort-cleanup)
@@ -560,10 +561,11 @@ work."
             (user-error
              "Please add a \"nngnorb\" backend to your gnus installation."))))
     (when (version= "5.13" gnus-version-number)
-      (setq nnir-current-query nil
-           nnir-current-server nil
-           nnir-current-group-marked nil
-           nnir-artlist nil))
+      (with-no-warnings                  ; All these variables are available.
+       (setq nnir-current-query nil
+             nnir-current-server nil
+             nnir-current-group-marked nil
+             nnir-artlist nil)))
     (gnus-group-read-ephemeral-group
      ;; in 24.4, the group name is mostly decorative. in 24.3, the
      ;; query itself is read from there. It should look like (concat
diff --git a/gnorb-registry.el b/gnorb-registry.el
index b27545e..f70531c 100644
--- a/gnorb-registry.el
+++ b/gnorb-registry.el
@@ -98,16 +98,17 @@ to the message's registry entry, under the 'gnorb-ids key."
 (defun gnorb-registry-capture-abort-cleanup ()
   (when (and (org-capture-get :gnorb-id)
             org-note-abort)
-    (condition-case error
-       (let* ((msg-id (format "<%s>" (plist-get org-store-link-plist 
:message-id)))
-              (existing-org-ids (gnus-registry-get-id-key msg-id 'gnorb-ids))
-              (org-id (org-capture-get :gnorb-id)))
-         (when (member org-id existing-org-ids)
-           (gnus-registry-set-id-key msg-id 'gnorb-ids
-                                     (remove org-id existing-org-ids)))
-         (setq abort-note 'clean))
-      (error
-       (setq abort-note 'dirty)))))
+    (with-no-warnings ; For `abort-note'
+      (condition-case error
+         (let* ((msg-id (format "<%s>" (plist-get org-store-link-plist 
:message-id)))
+                (existing-org-ids (gnus-registry-get-id-key msg-id 'gnorb-ids))
+                (org-id (org-capture-get :gnorb-id)))
+           (when (member org-id existing-org-ids)
+             (gnus-registry-set-id-key msg-id 'gnorb-ids
+                                       (remove org-id existing-org-ids)))
+           (setq abort-note 'clean))
+       (error
+        (setq abort-note 'dirty))))))
 
 (defun gnorb-find-visit-candidates (ids &optional include-zombies)
   "For all message-ids in IDS (which should be a list of



reply via email to

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