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

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

[elpa] 02/03: * packages/gnorb/gnorb.el: Mention dependency on cl-lib. R


From: Stefan Monnier
Subject: [elpa] 02/03: * packages/gnorb/gnorb.el: Mention dependency on cl-lib. Require `bbdb' here, and not during compilation. * packages/gnorb/gnorb-utils.el: Don't require `cl'. Don't require `bbdb', in case it's not installed. * packages/gnorb/gnorb-registry.el: Require cl-lib. Use cl-lib names. * packages/gnorb/gnorb-org.el: Require cl-lib. Use cl-lib names. * packages/gnorb: Fix up copyright and compilation. * packages/gnorb/gnorb-bbdb.el: Require `cl-lib'. Use cl-lib names. (bbdb-separator-alist, bbdb-xfield-label-list): Check before use.
Date: Fri, 10 Oct 2014 18:25:35 +0000

monnier pushed a commit to branch master
in repository elpa.

commit 859937ce40faaa84ec9599ff7fb51f955c821cc6
Author: Stefan Monnier <address@hidden>
Date:   Fri Oct 10 14:25:00 2014 -0400

    * packages/gnorb/gnorb.el: Mention dependency on cl-lib.
    Require `bbdb' here, and not during compilation.
    * packages/gnorb/gnorb-utils.el: Don't require `cl'.
    Don't require `bbdb', in case it's not installed.
    * packages/gnorb/gnorb-registry.el: Require cl-lib.  Use cl-lib names.
    * packages/gnorb/gnorb-org.el: Require cl-lib.  Use cl-lib names.
    * packages/gnorb: Fix up copyright and compilation.
    * packages/gnorb/gnorb-bbdb.el: Require `cl-lib'.  Use cl-lib names.
    (bbdb-separator-alist, bbdb-xfield-label-list): Check before use.
---
 packages/gnorb/gnorb-bbdb.el     |   32 ++++++++++++++++++--------------
 packages/gnorb/gnorb-gnus.el     |    8 ++++++--
 packages/gnorb/gnorb-org.el      |   18 +++++++++++++-----
 packages/gnorb/gnorb-registry.el |   13 ++++++++-----
 packages/gnorb/gnorb-utils.el    |    5 ++---
 packages/gnorb/gnorb.el          |    4 +++-
 packages/gnorb/nngnorb.el        |    2 +-
 7 files changed, 51 insertions(+), 31 deletions(-)

diff --git a/packages/gnorb/gnorb-bbdb.el b/packages/gnorb/gnorb-bbdb.el
index b30298f..2404985 100644
--- a/packages/gnorb/gnorb-bbdb.el
+++ b/packages/gnorb/gnorb-bbdb.el
@@ -1,6 +1,6 @@
 ;;; gnorb-bbdb.el --- The BBDB-centric functions of gnorb
 
-;; Copyright (C) 2014  Eric Abrahamsen
+;; Copyright (C) 2014  Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <address@hidden>
 ;; Keywords: 
@@ -25,6 +25,7 @@
 ;;; Code:
 
 (require 'gnorb-utils)
+(require 'cl-lib)
 
 (defgroup gnorb-bbdb nil
   "The BBDB bits of gnorb."
@@ -36,8 +37,9 @@
   :group 'gnorb-bbdb
   :type 'symbol)
 
-(unless (assoc gnorb-bbdb-org-tag-field bbdb-separator-alist)
-  (push `(,gnorb-bbdb-org-tag-field ":" ":") bbdb-separator-alist))
+(when (boundp 'bbdb-separator-alist)    ;Allow compilation if BBDB is absent!
+  (unless (assoc gnorb-bbdb-org-tag-field bbdb-separator-alist)
+    (push `(,gnorb-bbdb-org-tag-field ":" ":") bbdb-separator-alist)))
 
 (defcustom gnorb-bbdb-messages-field 'messages
   "The name (as a symbol) of the field where links to recent gnus
@@ -104,7 +106,7 @@ mentioned in the docstring of `format-time-string', which 
see."
   Defaults to org-link."
   :group 'gnorb-bbdb)
 
-(defstruct gnorb-bbdb-link
+(cl-defstruct gnorb-bbdb-link
   subject date group id)
 
 (defcustom gnorb-bbdb-posting-styles nil
@@ -147,6 +149,8 @@ be composed, just as in `gnus-posting-styles'.
 An example value might look like:"
   :group 'gnorb-bbdb)
 
+(defvar message-mode-hook)
+
 ;;;###autoload
 (defun gnorb-bbdb-mail (records &optional subject n verbose)
   "\\<bbdb-mode-map>Acts just like `bbdb-mail', except runs
@@ -332,15 +336,14 @@ both, use \"C-u\" before the \"*\"."
         (mapconcat
          'identity
          (delete-dups
-          (mapcan (lambda (r)
+          (cl-mapcan (lambda (r)
                     (bbdb-record-xfield-split r gnorb-bbdb-org-tag-field))
                   records))
          "|")))
     (if tag-string
        ;; C-u = all headings, not just todos
-       (if (equal current-prefix-arg '(4))
-           (org-tags-view nil tag-string)
-         (org-tags-view t tag-string))
+       (org-tags-view (not (equal current-prefix-arg '(4)))
+                       tag-string)
       (error "No org-tags field present"))))
 
 ;;;###autoload
@@ -360,13 +363,13 @@ a prefix arg and \"*\", the prefix arg must come first."
                             gnorb-gnus-mail-search-backends)
                      (error "No search backend specified")))
         (search-string
-         (funcall (second backend)
+         (funcall (cl-second backend)
                   (cl-mapcan 'bbdb-record-mail records))))
     (when (equal current-prefix-arg '(4))
       (setq search-string
            (read-from-minibuffer
-            (format "%s search string: " (first backend)) search-string)))
-    (funcall (third backend) search-string)
+            (format "%s search string: " (cl-first backend)) search-string)))
+    (funcall (cl-third backend) search-string)
     (delete-other-windows)))  
 
 ;;;###autoload
@@ -379,7 +382,8 @@ a prefix arg and \"*\", the prefix arg must come first."
 
 ;;; Field containing links to recent messages
 
-(add-to-list 'bbdb-xfield-label-list gnorb-bbdb-messages-field nil 'eq)
+(when (boundp 'bbdb-xfield-label-list)
+  (add-to-list 'bbdb-xfield-label-list gnorb-bbdb-messages-field nil 'eq))
 
 (defun gnorb-bbdb-display-messages (record format)
   "Show links to the messages collected in the
@@ -425,7 +429,7 @@ layout type."
                               'mouse-face 'highlight
                               'gnorb-bbdb-link-count count
                               'keymap map)
-                           (incf count)))
+                           (cl-incf count)))
                        val (if (eq format 'multi)
                                "\n" ", "))
                       indent)
@@ -553,7 +557,7 @@ to a message into the record's `gnorb-bbdb-messages-field'."
                              (time-less-p
                               (gnorb-bbdb-link-date b)
                               (gnorb-bbdb-link-date a))))))
-         (setq val (subseq val 0 gnorb-bbdb-collect-N-messages))
+         (setq val (cl-subseq val 0 gnorb-bbdb-collect-N-messages))
          (bbdb-record-set-xfield record
                                  gnorb-bbdb-messages-field
                                  (delq nil val))
diff --git a/packages/gnorb/gnorb-gnus.el b/packages/gnorb/gnorb-gnus.el
index ba72107..75da114 100644
--- a/packages/gnorb/gnorb-gnus.el
+++ b/packages/gnorb/gnorb-gnus.el
@@ -1,6 +1,6 @@
 ;;; gnorb-gnus.el --- The gnus-centric fuctions of gnorb
 
-;; Copyright (C) 2014  Eric Abrahamsen
+;; Copyright (C) 2014  Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <address@hidden>
 ;; Keywords: 
@@ -247,7 +247,9 @@ save them into `gnorb-tmp-dir'."
 (defun gnorb-gnus-capture-abort-cleanup ()
   (when (and org-note-abort
             (org-capture-get :gnus-attachments))
-    (condition-case error
+    ;; FIXME: Yuck: setting `abort-note' will fail as soon as org-capture.el is
+    ;; compiled with lexical-binding!
+    (condition-case nil
        (progn (org-attach-delete-all)
               (setq abort-note 'clean)
               ;; remove any gnorb-mail-header values here
@@ -433,6 +435,8 @@ work."
           "Message will trigger TODO state-changes after sending"
         "A TODO will be made from this message after it's sent")))))
 
+(defvar org-capture-link-is-already-stored)
+
 (defun gnorb-gnus-outgoing-make-todo-1 ()
   (unless gnorb-gnus-new-todo-capture-key
     (error "No capture template key set, customize 
gnorb-gnus-new-todo-capture-key"))
diff --git a/packages/gnorb/gnorb-org.el b/packages/gnorb/gnorb-org.el
index bc46eda..72d3df8 100644
--- a/packages/gnorb/gnorb-org.el
+++ b/packages/gnorb/gnorb-org.el
@@ -1,6 +1,6 @@
 ;;; gnorb-org.el --- The Org-centric functions of gnorb
 
-;; Copyright (C) 2014  Eric Abrahamsen
+;; Copyright (C) 2014  Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen  <address@hidden>
 ;; Keywords: 
@@ -25,6 +25,7 @@
 ;;; Code:
 
 (require 'gnorb-utils)
+(require 'cl-lib)
 
 (defgroup gnorb-org nil
   "The Org bits of Gnorb."
@@ -177,7 +178,7 @@ might have been in the outgoing message's headers and call
                   strings)
                  ((numberp gnorb-org-mail-scan-scope)
                   (delq nil
-                        (subseq
+                        (cl-subseq
                          strings 0 (1+ gnorb-org-mail-scan-scope))))
                  ;; We could provide more options here. 'tree vs
                  ;; 'subtree, for instance.
@@ -215,7 +216,7 @@ See the docstring of `gnorb-org-handle-mail' for details."
          (when assoc-msg-ids
            (car
             (sort
-             (remove-if
+             (cl-remove-if
               (lambda (m)
                 (let ((from (car (gnus-registry-get-id-key m 'sender))))
                   (or (null from)
@@ -240,6 +241,8 @@ See the docstring of `gnorb-org-handle-mail' for details."
      (latest-msg-id
       `(:gnus ,(list (gnorb-msg-id-to-link latest-msg-id)))))))
 
+(defvar message-beginning-of-line)
+
 (defun gnorb-org-setup-message
     (&optional messages mails from cc bcc attachments text ids)
   "Common message setup routine for other gnorb-org commands.
@@ -340,6 +343,8 @@ current heading, or the heading indicated by optional 
argument ID."
             (org-attach-file-list attach-dir))))
       files)))
 
+(defvar message-mode-hook)
+
 ;;;###autoload
 (defun gnorb-org-handle-mail (&optional arg text file)
   "Handle current headline as a mail TODO.
@@ -477,6 +482,8 @@ respective (usual) file extensions. Ugly way to do it, but 
what
 the hey..."
   :group 'gnorb-org)
 
+(defvar org-export-show-temporary-export-buffer)
+
 ;;;###autoload
 (defun gnorb-org-email-subtree (&optional arg)
   "Call on a subtree to export it either to a text string or a file,
@@ -501,7 +508,8 @@ default set of parameters."
           "Export backend: "
           (mapcar (lambda (b)
                     (symbol-name (org-export-backend-name b)))
-                  org-export--registered-backends) nil t))
+                  org-export--registered-backends)
+           nil t))
         (backend-symbol (intern backend-string))
         (f-or-t (org-completing-read "Export as file or text? "
                                      '("file" "text") nil t))
@@ -606,7 +614,7 @@ search."
             (setq tag-clause (cdr (org-make-tags-matcher str)))
             (unless (equal str "")
               (setq recs
-                    (remove-if-not
+                    (cl-remove-if-not
                      (lambda (r)
                        (let ((rec-tags (bbdb-record-xfield
                                         r gnorb-bbdb-org-tag-field)))
diff --git a/packages/gnorb/gnorb-registry.el b/packages/gnorb/gnorb-registry.el
index 0eee32c..ecd723e 100644
--- a/packages/gnorb/gnorb-registry.el
+++ b/packages/gnorb/gnorb-registry.el
@@ -1,6 +1,6 @@
 ;;; gnorb-registry.el --- Registry implementation for Gnorb
 
-;; This file is in the public domain.
+;; Copyright (C) 2014  Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <address@hidden>
 
@@ -49,6 +49,7 @@
 ;;; Code:
 
 (require 'gnus-registry)
+(require 'cl-lib)
 
 (defgroup gnorb-registry nil
   "Gnorb's use of the Gnus registry."
@@ -98,13 +99,15 @@ 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
+    (condition-case nil
        (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)))
+          ;; FIXME: Yuck!  This will fail as soon as org-capture.el is compiled
+          ;; with lexical-binding.
          (setq abort-note 'clean))
       (error
        (setq abort-note 'dirty)))))
@@ -167,8 +170,8 @@ your Org files."
                       'gnus))
          (dolist (l (plist-get links :gnus))
            (gnorb-registry-make-entry
-            (second (split-string l "#")) nil nil
-            id (first (split-string l "#"))))
+            (cl-second (split-string l "#")) nil nil
+            id (cl-first (split-string l "#"))))
          (dolist (p props)
            (setq id )
            (gnorb-registry-make-entry p nil nil id nil)
@@ -177,7 +180,7 @@ your Org files."
            ;; it.
            (unless (gnus-registry-get-id-key p 'group)
              (gnorb-msg-id-to-group p))
-           (incf count)))))
+           (cl-incf count)))))
      gnorb-org-find-candidates-match
      'agenda 'archive 'comment)
     (message "Collecting all relevant Org headings, this could take a while... 
done")
diff --git a/packages/gnorb/gnorb-utils.el b/packages/gnorb/gnorb-utils.el
index 68fe6b6..b4fec36 100644
--- a/packages/gnorb/gnorb-utils.el
+++ b/packages/gnorb/gnorb-utils.el
@@ -1,6 +1,6 @@
 ;;; gnorb-utils.el --- Common utilities for all gnorb stuff.
 
-;; Copyright (C) 2014  Eric Abrahamsen
+;; Copyright (C) 2014  Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <address@hidden>
 ;; Keywords:
@@ -24,11 +24,10 @@
 
 ;;; Code:
 
-(require 'cl)
 (require 'mailcap)
 (require 'gnus)
 ;(require 'message)
-(require 'bbdb)
+;; (require 'bbdb) ;Avoid compilation failure if BBDB is not available.
 (require 'org)
 (require 'org-bbdb)
 (require 'org-gnus)
diff --git a/packages/gnorb/gnorb.el b/packages/gnorb/gnorb.el
index b702b71..c0db6af 100644
--- a/packages/gnorb/gnorb.el
+++ b/packages/gnorb/gnorb.el
@@ -1,8 +1,9 @@
 ;;; gnorb.el --- Glue code between Gnus, Org, and BBDB
 
-;; Copyright (C) 2014  Eric Abrahamsen
+;; Copyright (C) 2014  Free Software Foundation, Inc.
 
 ;; Version: 1
+;; Package-Requires: ((cl-lib "0.5"))
 
 ;; Maintainer: Eric Abrahamsen <address@hidden>
 
@@ -30,6 +31,7 @@
 
 ;;; Code:
 
+(if t (require 'bbdb))      ;`if'-trick avoids loading bbdb during compilation!
 (require 'gnorb-utils)
 (require 'nngnorb)
 (require 'gnorb-gnus)
diff --git a/packages/gnorb/nngnorb.el b/packages/gnorb/nngnorb.el
index bdaf569..0f0999a 100644
--- a/packages/gnorb/nngnorb.el
+++ b/packages/gnorb/nngnorb.el
@@ -1,6 +1,6 @@
 ;;; nngnorb.el --- Gnorb backend for Gnus
 
-;; This file is in the public domain.
+;; Copyright (C) 2014  Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <address@hidden>
 



reply via email to

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