branch: externals/bbdb commit 0cff90e09cd4099d4ba4e3ee6bb366b258c2d97d Author: Roland Winkler <wink...@gnu.org> Commit: Roland Winkler <wink...@gnu.org>
Fix declarations for byte compiler. Use file tex-site.el. --- bbdb-com.el | 5 +++-- bbdb-mhe.el | 1 + bbdb-mua.el | 35 ++++++++++++++++++----------------- bbdb-rmail.el | 15 +++++---------- bbdb-site.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++ bbdb-tex.el | 13 ------------- bbdb-wl.el | 8 +++++--- bbdb.el | 27 +++++++++++++++------------ tex/bbdb.sty | 2 +- 9 files changed, 94 insertions(+), 58 deletions(-) diff --git a/bbdb-com.el b/bbdb-com.el index cf8eefa..500a0e0 100644 --- a/bbdb-com.el +++ b/bbdb-com.el @@ -26,8 +26,9 @@ (require 'bbdb) (require 'mailabbrev) -(declare-function build-mail-aliases "mailalias") -(declare-function browse-url-url-at-point "browse-url") +(eval-and-compile + (autoload 'build-mail-aliases "mailalias") + (autoload 'browse-url-url-at-point "browse-url")) (require 'crm) (defvar bbdb-crm-local-completion-map diff --git a/bbdb-mhe.el b/bbdb-mhe.el index ed9cada..4670171 100644 --- a/bbdb-mhe.el +++ b/bbdb-mhe.el @@ -33,6 +33,7 @@ ;; A simplified `mail-fetch-field'. We could use instead (like rmail): ;; (mail-header (intern-soft (downcase header)) (mail-header-extract)) +;;;###autoload (defun bbdb/mh-header (header) "Find and return the value of HEADER in the current buffer. Returns the empty string if HEADER is not in the message." diff --git a/bbdb-mua.el b/bbdb-mua.el index dc57fd8..db31b06 100644 --- a/bbdb-mua.el +++ b/bbdb-mua.el @@ -37,29 +37,30 @@ (require 'bbdb) (require 'bbdb-com) -(declare-function gnus-fetch-original-field "gnus-utils") -(declare-function gnus-summary-select-article "gnus-sum") -(defvar gnus-article-buffer) +(eval-and-compile + (autoload 'gnus-fetch-original-field "gnus-utils") + (autoload 'gnus-summary-select-article "gnus-sum") + (defvar gnus-article-buffer) -(declare-function bbdb/vm-header "bbdb-vm") -(declare-function vm-follow-summary-cursor "vm-motion") -(declare-function vm-select-folder-buffer "vm-macro") -(declare-function vm-check-for-killed-summary "vm-misc") -(declare-function vm-error-if-folder-empty "vm-misc") + (autoload 'bbdb/vm-header "bbdb-vm") + (autoload 'vm-follow-summary-cursor "vm-motion") + (autoload 'vm-select-folder-buffer "vm-macro") + (autoload 'vm-check-for-killed-summary "vm-misc") + (autoload 'vm-error-if-folder-empty "vm-misc") -(declare-function bbdb/rmail-header "bbdb-rmail") -(defvar rmail-buffer) + (autoload 'bbdb/rmail-header "bbdb-rmail") + (defvar rmail-buffer) -(declare-function bbdb/mh-header "bbdb-mhe") -(declare-function mh-show "mh-show") -(defvar mh-show-buffer) + (autoload 'bbdb/mh-header "bbdb-mhe") + (autoload 'mh-show "mh-show") + (defvar mh-show-buffer) -(defvar mu4e~view-buffer-name) + (defvar mu4e~view-buffer-name) -(declare-function bbdb/wl-header "bbdb-wl") + (autoload 'bbdb/wl-header "bbdb-wl") -(declare-function message-field-value "message") -(declare-function mail-decode-encoded-word-string "mail-parse") + (autoload 'message-field-value "message") + (autoload 'mail-decode-encoded-word-string "mail-parse")) (defconst bbdb-mua-mode-alist '((vm vm-mode vm-virtual-mode vm-summary-mode vm-presentation-mode) diff --git a/bbdb-rmail.el b/bbdb-rmail.el index 69c92ac..719617d 100644 --- a/bbdb-rmail.el +++ b/bbdb-rmail.el @@ -30,19 +30,14 @@ (require 'rmailsum) (require 'mailheader) -(defun bbdb/rmail-new-flag () - "Returns t if the current message in buffer BUF is new." - (rmail-message-labels-p rmail-current-message ", ?\\(unseen\\),")) - +;;;###autoload (defun bbdb/rmail-header (header) "Pull HEADER out of Rmail header." (with-current-buffer rmail-buffer - (if (fboundp 'rmail-get-header) ; Emacs 23 - (rmail-get-header header) - (save-restriction - (with-no-warnings (rmail-narrow-to-non-pruned-header)) - (mail-header (intern-soft (downcase header)) - (mail-header-extract)))))) + (save-restriction + (with-no-warnings (rmail-narrow-to-non-pruned-header)) + (mail-header (intern-soft (downcase header)) + (mail-header-extract))))) ;;;###autoload (defun bbdb-insinuate-rmail () diff --git a/bbdb-site.el b/bbdb-site.el new file mode 100644 index 0000000..dcaf096 --- /dev/null +++ b/bbdb-site.el @@ -0,0 +1,46 @@ +;;; bbdb-site.el --- site-specific variables for BBDB -*- lexical-binding: t -*- + +;; Copyright (C) 2010-2017 Free Software Foundation, Inc. + +;; This file is part of the Insidious Big Brother Database (aka BBDB), + +;; BBDB is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; BBDB is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with BBDB. If not, see <http://www.gnu.org/licenses/>. + +;;; Code: + +(defconst bbdb-version "@PACKAGE_VERSION@" "Version of BBDB.") + +(if (< emacs-major-version 24) + (error "BBDB %s requires GNU Emacs 24 or later" bbdb-version)) + +(defcustom bbdb-tex-path + (let* ((default "@pkgdatadir@") + (dir (cond ((file-accessible-directory-p default) + default) + (load-file-name + (expand-file-name "tex/" (file-name-directory load-file-name))) + (t + (let ((f (locate-file "tex/bbdb.sty" load-path))) + (if f (file-name-directory f))))))) + (if dir (list dir))) + "List of directories with the BBDB TeX files. +If this is t assume that these files reside in directories +that are part of the regular TeX search path." + :group 'bbdb-utilities-tex + :type '(choice (const :tag "Files in TeX path" t) + (repeat (directory :tag "Directory")))) + +(provide 'bbdb-site) + +;;; bbdb-site.el ends here diff --git a/bbdb-tex.el b/bbdb-tex.el index f1984be..38654e3 100644 --- a/bbdb-tex.el +++ b/bbdb-tex.el @@ -296,19 +296,6 @@ The elements EDIT of `bbdb-address-format-list' are ignored." :group 'bbdb-utilities-tex :type 'file) -(defcustom bbdb-tex-path - (let ((d (if load-file-name - (expand-file-name "tex/" (file-name-directory load-file-name)) - (let ((f (locate-file "tex/bbdb.sty" load-path))) - (if f (file-name-directory f)))))) - (if d (list d))) - "List of directories with the BBDB TeX files. -If this is t assume that these files reside in directories -that are part of the regular TeX search path" - :group 'bbdb-utilities-tex - :type '(choice (const :tag "Files in TeX path" t) - (repeat (directory :tag "Directory")))) - ;;; Internal variables (defvar bbdb-tex-rule-last bbdb-tex-rule-default diff --git a/bbdb-wl.el b/bbdb-wl.el index e24b8af..0f523d4 100644 --- a/bbdb-wl.el +++ b/bbdb-wl.el @@ -29,10 +29,12 @@ (defvar wl-summary-mode-map) (defvar wl-draft-mode-map) (defvar wl-summary-buffer-elmo-folder) -(declare-function wl-summary-message-number "wl-summary") -(declare-function elmo-message-entity "elmo-msgdb") -(declare-function elmo-message-entity-field "elmo-msgdb") +(eval-and-compile + (autoload 'wl-summary-message-number "wl-summary") + (autoload 'elmo-message-entity "elmo-msgdb") + (autoload 'elmo-message-entity-field "elmo-msgdb")) +;;;###autoload (defun bbdb/wl-header (header) (elmo-message-entity-field (elmo-message-entity wl-summary-buffer-elmo-folder diff --git a/bbdb.el b/bbdb.el index 2c49e3c..e38ac17 100644 --- a/bbdb.el +++ b/bbdb.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2010-2017 Free Software Foundation, Inc. -;; Version: 0 +;; Version: 3.2 ;; Package-Requires: ((emacs "24")) ;; This file is part of the Insidious Big Brother Database (aka BBDB), @@ -37,6 +37,7 @@ ;;; Code: (require 'timezone) +(require 'bbdb-site) ;; When running BBDB, we have (require 'bbdb-autoloads) (declare-function widget-group-match "wid-edit") @@ -4632,17 +4633,19 @@ If NOISY is non-nil as in interactive calls issue status messages." "Return string describing the version of BBDB. With prefix ARG, insert string at point." (interactive (list (or (and current-prefix-arg 1) t))) - (let* ((source (find-function-noselect 'bbdb-version)) - (version - (when source - (with-current-buffer (car source) - (prog1 - (save-excursion - (goto-char (point-min)) - (when (re-search-forward "^;;+ *Version: \\(.*\\)" nil t) - (match-string-no-properties 1))) - (unless (get-buffer-window nil t) - (kill-buffer (current-buffer))))))) + (let* ((version + (if (string-match "\\`[ \t\n]*[1-9]" bbdb-version) + bbdb-version + (let ((source (find-function-noselect 'bbdb-version))) + (if source + (with-current-buffer (car source) + (prog1 (save-excursion + (goto-char (point-min)) + (when (re-search-forward + "^;;+ *Version: \\(.*\\)" nil t) + (match-string-no-properties 1))) + (unless (get-buffer-window nil t) + (kill-buffer (current-buffer))))))))) (version-string (format "BBDB version %s" (or version "<unknown>")))) (cond ((numberp arg) (insert (message version-string))) ((eq t arg) (message version-string)) diff --git a/tex/bbdb.sty b/tex/bbdb.sty index 8165e78..eec763e 100644 --- a/tex/bbdb.sty +++ b/tex/bbdb.sty @@ -1,6 +1,6 @@ % bbdb.sty --- basic LaTeX style for TeXing BBDB % -% Copyright (C) 2017 Roland Winkler <wink...@gnu.org> +% Copyright (C) 2017 Free Software Foundation, Inc. % % This file is part of the Insidious Big Brother Database (aka BBDB), %