From f440830d606632693e41c26890ba54f31c57b22a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 21 May 2013 00:25:14 -0700 Subject: [PATCH] Silence some compiler warnings * calculator.el (electric, ehelp): No need to load when compiling. (Electric-command-loop, electric-describe-mode): Declare. * doc-view.el (doc-view-current-converter-processes): Move before use. * files.el (dired-unmark): * progmodes/gud.el (gdb-input): Update declarations. * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Move MODE-set-explicitly definition before use. * erc/erc-log.el (erc-network-name): Declare. * erc/erc-notify.el (pcomplete--here): Declare. (pcomplete/erc-mode/NOTIFY): Require pcomplete. * international/mule-diag.el (mule-diag): Don't use obsolete window-system-version. * mail/feedmail.el (smtpmail): No need to load when compiling. (smtpmail-via-smtp, smtpmail-smtp-server): Declare. * mail/mail-utils.el (rfc822): No need to load when compiling. (rfc822-addresses): Autoload it. (mail-strip-quoted-names): Trivial simplification. * mail/rmail.el (rmail-mime-message-p, rmail-mime-toggle-raw): Declare. (rmail-retry-failure): Don't assume that rmail-mime-feature == rmailmm. * net/snmp-mode.el (tempo): Don't duplicate requires. * progmodes/prolog.el (info): No need to load when compiling. (comint): Require before shell requires it. (Info-goto-node): Autoload it. (Info-follow-nearest-node): Declare. (prolog-help-info, prolog-goto-predicate-info): No need to require info. * textmodes/artist.el (picture-mode-exit): Declare. * textmodes/reftex-parse.el (reftex-parse-from-file): Trivial rewrite so the compiler can parse it better. * url/url-dav.el (url-http): Require it. (url-http-head-file-attributes): Don't autoload it. * url/url-proxy.el (url-http): Autoload it. --- lisp/ChangeLog | 39 +++++++++++++++++++++++++++++++++ lisp/calculator.el | 8 +++++-- lisp/doc-view.el | 9 ++++---- lisp/emacs-lisp/easy-mmode.el | 15 +++++++------ lisp/erc/ChangeLog | 5 +++++ lisp/erc/erc-log.el | 2 ++ lisp/erc/erc-notify.el | 5 +++++ lisp/files.el | 2 +- lisp/international/mule-diag.el | 3 +-- lisp/mail/feedmail.el | 7 +++--- lisp/mail/mail-utils.el | 8 +++---- lisp/mail/rmail.el | 11 +++++++++- lisp/net/snmp-mode.el | 7 +++--- lisp/progmodes/gud.el | 2 +- lisp/progmodes/prolog.el | 10 +++++---- lisp/textmodes/artist.el | 2 ++ lisp/textmodes/reftex-parse.el | 13 ++++++----- lisp/url/ChangeLog | 7 ++++++ lisp/url/url-dav.el | 4 ++-- lisp/url/url-proxy.el | 4 +++- 20 files changed, 119 insertions(+), 44 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c70f156bf45..f723ba346d6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,42 @@ +2013-05-21 Glenn Morris + + * files.el (dired-unmark): + * progmodes/gud.el (gdb-input): Update declarations. + + * calculator.el (electric, ehelp): No need to load when compiling. + (Electric-command-loop, electric-describe-mode): Declare. + + * doc-view.el (doc-view-current-converter-processes): Move before use. + + * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): + Move MODE-set-explicitly definition before use. + + * international/mule-diag.el (mule-diag): + Don't use obsolete window-system-version. + + * mail/feedmail.el (smtpmail): No need to load when compiling. + (smtpmail-via-smtp, smtpmail-smtp-server): Declare. + + * mail/mail-utils.el (rfc822): No need to load when compiling. + (rfc822-addresses): Autoload it. + (mail-strip-quoted-names): Trivial simplification. + + * mail/rmail.el (rmail-mime-message-p, rmail-mime-toggle-raw): Declare. + (rmail-retry-failure): Don't assume that rmail-mime-feature == rmailmm. + + * net/snmp-mode.el (tempo): Don't duplicate requires. + + * progmodes/prolog.el (info): No need to load when compiling. + (comint): Require before shell requires it. + (Info-goto-node): Autoload it. + (Info-follow-nearest-node): Declare. + (prolog-help-info, prolog-goto-predicate-info): No need to require info. + + * textmodes/artist.el (picture-mode-exit): Declare. + + * textmodes/reftex-parse.el (reftex-parse-from-file): + Trivial rewrite so the compiler can parse it better. + 2013-05-20 Leo Liu * progmodes/octave.el (octave-help-mode-map) diff --git a/lisp/calculator.el b/lisp/calculator.el index 89fa460e531..8b253b810f5 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -668,7 +668,9 @@ more information. \\{calculator-mode-map}") -(eval-when-compile (require 'electric) (require 'ehelp)) +(declare-function Electric-command-loop "electric" + (return-tag &optional prompt inhibit-quitting + loop-function loop-state)) ;;;###autoload (defun calculator () @@ -1667,6 +1669,8 @@ Used by `calculator-paste' and `get-register'." (interactive "cRegister to get value from: ") (calculator-put-value (cdr (assq reg calculator-registers)))) +(declare-function electric-describe-mode "ehelp" ()) + (defun calculator-help () ;; this is used as the quick reference screen you get with `h' "Quick reference: @@ -1697,7 +1701,7 @@ Used by `calculator-paste' and `get-register'." (if (or (not calculator-electric-mode) ;; XEmacs has a problem with electric-describe-mode (featurep 'xemacs)) - (describe-mode) + (describe-mode) (electric-describe-mode)) (if calculator-electric-mode (use-global-map g-map)) diff --git a/lisp/doc-view.el b/lisp/doc-view.el index b1f399d5b73..272bb580ec5 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1,6 +1,5 @@ ;;; doc-view.el --- View PDF/PostScript/DVI files in Emacs -*- lexical-binding: t -*- - ;; Copyright (C) 2007-2013 Free Software Foundation, Inc. ;; ;; Author: Tassilo Horn @@ -306,6 +305,10 @@ of the page moves to the previous page." ;;;; Internal Variables +(defvar doc-view-current-converter-processes nil + "Only used internally.") +(make-variable-buffer-local 'doc-view-current-converter-processes) + (defun doc-view-new-window-function (winprops) ;; (message "New window %s for buf %s" (car winprops) (current-buffer)) (cl-assert (or (eq t (car winprops)) @@ -348,10 +351,6 @@ of the page moves to the previous page." "Only used internally.") (make-variable-buffer-local 'doc-view-current-files) -(defvar doc-view-current-converter-processes nil - "Only used internally.") -(make-variable-buffer-local 'doc-view-current-converter-processes) - (defvar doc-view-current-timer nil "Only used internally.") (make-variable-buffer-local 'doc-view-current-timer) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index abe7b1ea741..718018fd2d9 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -419,6 +419,13 @@ See `%s' for more information on %s." ;; up-to-here. :autoload-end + ;; MODE-set-explicitly is set in MODE-set-explicitly and cleared by + ;; kill-all-local-variables. + (defvar-local ,MODE-set-explicitly nil) + (defun ,MODE-set-explicitly () + (setq ,MODE-set-explicitly t)) + (put ',MODE-set-explicitly 'definition-name ',global-mode) + ;; A function which checks whether MODE has been disabled in the major ;; mode hook which has just been run. (add-hook ',minor-MODE-hook ',MODE-set-explicitly) @@ -451,13 +458,7 @@ See `%s' for more information on %s." (defun ,MODE-cmhh () (add-to-list ',MODE-buffers (current-buffer)) (add-hook 'post-command-hook ',MODE-check-buffers)) - (put ',MODE-cmhh 'definition-name ',global-mode) - ;; MODE-set-explicitly is set in MODE-set-explicitly and cleared by - ;; kill-all-local-variables. - (defvar-local ,MODE-set-explicitly nil) - (defun ,MODE-set-explicitly () - (setq ,MODE-set-explicitly t)) - (put ',MODE-set-explicitly 'definition-name ',global-mode)))) + (put ',MODE-cmhh 'definition-name ',global-mode)))) ;;; ;;; easy-mmode-defmap diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 5a6ac93edd0..4f5be776b09 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,5 +1,10 @@ 2013-05-21 Glenn Morris + * erc-log.el (erc-network-name): Declare. + + * erc-notify.el (pcomplete--here): Declare. + (pcomplete/erc-mode/NOTIFY): Require pcomplete. + * erc.el (erc-quit-reason-various-alist) (erc-part-reason-various-alist): Don't mention zippy. (erc-quit-reason, erc-part-reason): Remove zippy options. diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index 465babc74f7..c6ff8fa5bfe 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -378,6 +378,8 @@ This function is a possible value for `erc-generate-log-file-name-function'." ;; we need a make-safe-file-name function. (convert-standard-filename file))) +(declare-function erc-network-name "erc-networks" ()) + (defun erc-generate-log-file-name-network (buffer target nick server port) "Generates a log-file name using the network name rather than server name. This results in a file name of the form #channel!nick@network.txt. diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el index 7061b035e54..db7067eec08 100644 --- a/lisp/erc/erc-notify.el +++ b/lisp/erc/erc-notify.el @@ -235,8 +235,13 @@ with args, toggle notify status of people." (autoload 'pcomplete-erc-all-nicks "erc-pcomplete") +;; "--" is not a typo. +(declare-function pcomplete--here "pcomplete" + (&optional form stub paring form-only)) + ;;;###autoload (defun pcomplete/erc-mode/NOTIFY () + (require 'pcomplete) (pcomplete-here (pcomplete-erc-all-nicks))) (erc-notify-install-message-catalogs) diff --git a/lisp/files.el b/lisp/files.el index eebbf15e02e..871a4b0548b 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -206,7 +206,7 @@ have fast storage with limited space, such as a RAM disk." (declare-function msdos-long-file-names "msdos.c") (declare-function w32-long-file-name "w32proc.c") (declare-function dired-get-filename "dired" (&optional localp no-error-if-not-filep)) -(declare-function dired-unmark "dired" (arg)) +(declare-function dired-unmark "dired" (arg &optional interactive)) (declare-function dired-do-flagged-delete "dired" (&optional nomessage)) (declare-function dos-8+3-filename "dos-fns" (filename)) (declare-function dosified-file-name "dos-fns" (file-name)) diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index 4873a5c8356..dd59d5e77ab 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -1104,8 +1104,7 @@ system which uses fontsets)." (insert-section 2 "Display") (if window-system - (insert (format "Window-system: %s, version %s" - window-system window-system-version)) + (insert (format "Window-system: %s" window-system)) (insert "Terminal: " (getenv "TERM"))) (insert "\n\n") diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 0502e7f9487..091b1a03025 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -370,9 +370,6 @@ (require 'mail-utils) ; pick up mail-strip-quoted-names -(eval-when-compile - (require 'smtpmail)) - (autoload 'mail-do-fcc "sendmail") (defgroup feedmail nil @@ -1619,6 +1616,10 @@ local gurus." ;; These mean "report errors by mail" and "deliver in background". (if (null mail-interactive) '("-oem" "-odb"))))) +(declare-function smtpmail-via-smtp "smtpmail" + (recipient smtpmail-text-buffer &optional ask-for-password)) +(defvar smtpmail-smtp-server) + ;; provided by jam@austin.asc.slb.com (James A. McLaughlin); ;; simplified by WJC after more feedmail development; ;; idea (but not implementation) of copying smtpmail trace buffer to diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index 4b58016ebc6..0129d270db1 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el @@ -183,17 +183,15 @@ as Rmail does." (error "Malformed MIME quoted-printable message")))) (not failed)))))) -(eval-when-compile (require 'rfc822)) +(autoload 'rfc822-addresses "rfc822") (defun mail-strip-quoted-names (address) "Delete comments and quoted strings in an address list ADDRESS. Also delete leading/trailing whitespace and replace FOO with just BAR. Return a modified address list." - (if (null address) - nil + (when address (if mail-use-rfc822 - (progn (require 'rfc822) - (mapconcat 'identity (rfc822-addresses address) ", ")) + (mapconcat 'identity (rfc822-addresses address) ", ") (let (pos) ;; Strip comments. diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 2a1d73faa65..af7ad220595 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -4105,6 +4105,9 @@ The message should be narrowed to just the headers." (autoload 'mail-position-on-field "sendmail") +(declare-function rmail-mime-message-p "rmailmm" ()) +(declare-function rmail-mime-toggle-raw "rmailmm" (&optional state)) + (defun rmail-retry-failure () "Edit a mail message which is based on the contents of the current message. For a message rejected by the mail system, extract the interesting headers and @@ -4117,7 +4120,13 @@ The variable `rmail-retry-ignored-headers' is a regular expression specifying headers which should not be copied into the new message." (interactive) (require 'mail-utils) - (if rmail-enable-mime + ;; FIXME This does not handle rmail-mime-feature != 'rmailmm. + ;; There is no API defined for rmail-mime-feature to provide + ;; rmail-mime-message-p, rmail-mime-toggle-raw equivalents. + ;; But does anyone actually use rmail-mime-feature != 'rmailmm? + (if (and rmail-enable-mime + (eq rmail-mime-feature 'rmailmm) + (featurep rmail-mime-feature)) (with-current-buffer rmail-buffer (if (rmail-mime-message-p) (let ((rmail-mime-mbox-buffer rmail-view-buffer) diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el index 98a7ea68589..cdefc22cd87 100644 --- a/lisp/net/snmp-mode.el +++ b/lisp/net/snmp-mode.el @@ -85,8 +85,9 @@ ;;; Code: (eval-when-compile - (require 'imenu) ; Need this stuff when compiling for imenu macros, etc. - (require 'tempo)) + (require 'imenu)) ; Need this stuff when compiling for imenu macros, etc. + +(require 'tempo) ;;;---------------------------------------------------------------------------- ;; @@ -540,8 +541,6 @@ lines for the purposes of this function." ;; ;;;---------------------------------------------------------------------------- -(require 'tempo) - ;; Perform a completing-read with info given ;; (defun snmp-completing-read (prompt table &optional pred require init hist) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index d5746a870cb..9ee4aae1da6 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -3429,7 +3429,7 @@ With arg, dereference expr if ARG is positive, otherwise do not dereference." ((or `xdb `pdb) (concat "p " expr)) (`sdb (concat expr "/")))) -(declare-function gdb-input "gdb-mi" (command handler)) +(declare-function gdb-input "gdb-mi" (command handler &optional trigger)) (declare-function tooltip-expr-to-print "tooltip" (event)) (declare-function tooltip-event-buffer "tooltip" (event)) diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index ca268eb9f3f..63bd9258d69 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -278,16 +278,16 @@ ;;; Code: +(require 'comint) + (eval-when-compile (require 'font-lock) ;; We need imenu everywhere because of the predicate index! (require 'imenu) ;) - (require 'info) (require 'shell) ) -(require 'comint) (require 'easymenu) (require 'align) @@ -3030,11 +3030,14 @@ The rest of the elements are undefined." (error "Sorry, no help method defined for this Prolog system.")))) )) + +(autoload 'Info-goto-node "info" nil t) +(declare-function Info-follow-nearest-node "info" (&optional FORK)) + (defun prolog-help-info (predicate) (let ((buffer (current-buffer)) oldp (str (concat "^\\* " (regexp-quote predicate) " */"))) - (require 'info) (pop-to-buffer nil) (Info-goto-node prolog-info-predicate-index) (if (not (re-search-forward str nil t)) @@ -3123,7 +3126,6 @@ Only for internal use by `prolog-find-documentation'") (defun prolog-goto-predicate-info (predicate) "Go to the info page for PREDICATE, which is a PredSpec." (interactive) - (require 'info) (string-match "\\(.*\\)/\\([0-9]+\\).*$" predicate) (let ((buffer (current-buffer)) (name (match-string 1 predicate)) diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index 2bd7283676e..0d9c8eb7c64 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -1449,6 +1449,8 @@ Keymap summary (message ""))) (artist-mode-line-show-curr-operation artist-key-is-drawing)) +(declare-function picture-mode-exit "picture" (&optional nostrip)) + (defun artist-mode-exit () "Exit Artist mode. This will call the hook `artist-mode-hook'." (if (and artist-picture-compatibility (eq major-mode 'picture-mode)) diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index 6bfc70c5d44..945e82e365d 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el @@ -238,12 +238,13 @@ of master file." ;; \label{} defs should always be honored, ;; just no keyval style [label=foo] defs. (string-equal "\label{" (substring (reftex-match-string 0) 0 7)) - (not (fboundp 'TeX-current-macro)) - (not (fboundp 'LaTeX-current-environment)) - (not (or (member (save-match-data (TeX-current-macro)) - reftex-label-ignored-macros-and-environments) - (member (save-match-data (LaTeX-current-environment)) - reftex-label-ignored-macros-and-environments)))) + (if (and (fboundp 'TeX-current-macro) + (fboundp 'LaTeX-current-environment)) + (not (or (member (save-match-data (TeX-current-macro)) + reftex-label-ignored-macros-and-environments) + (member (save-match-data (LaTeX-current-environment)) + reftex-label-ignored-macros-and-environments))) + t)) (push (reftex-label-info (reftex-match-string 1) file bound) docstruct))) diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 4c63c548f79..f72f465792b 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,10 @@ +2013-05-21 Glenn Morris + + * url-dav.el (url-http): Require it. + (url-http-head-file-attributes): Don't autoload it. + + * url-proxy.el (url-http): Autoload it. + 2013-05-15 Glenn Morris * url-news.el (url-news): Remove empty custom group. diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el index 6e4191ae7b5..a31206a2f6f 100644 --- a/lisp/url/url-dav.el +++ b/lisp/url/url-dav.el @@ -32,10 +32,12 @@ (require 'xml) (require 'url-util) (require 'url-handlers) +(require 'url-http) (defvar url-dav-supported-protocols '(1 2) "List of supported DAV versions.") +;; Dynamically bound. (defvar url-http-content-type) (defvar url-http-response-status) (defvar url-http-end-of-headers) @@ -621,8 +623,6 @@ Returns t if the lock was successfully released." (url-debug 'dav "Unrecognized DAV:locktype (%S)" (car lock))))) modes)) -(autoload 'url-http-head-file-attributes "url-http") - (defun url-dav-file-attributes (url &optional id-format) (let ((properties (cdar (url-dav-get-properties url)))) (if (and properties diff --git a/lisp/url/url-proxy.el b/lisp/url/url-proxy.el index e858545e121..44587e93bc6 100644 --- a/lisp/url/url-proxy.el +++ b/lisp/url/url-proxy.el @@ -63,6 +63,8 @@ (url-warn 'url (format "Unknown proxy directive: %s" proxy) 'critical) nil)))) +(autoload 'url-http "url-http") + (defun url-proxy (url callback &optional cbargs) ;; Retrieve URL from a proxy. ;; Expects `url-using-proxy' to be bound to the specific proxy to use." @@ -73,7 +75,7 @@ (url-http url callback cbargs)) (t (error "Don't know how to use proxy `%s'" url-using-proxy)))) - + (provide 'url-proxy) ;;; url-proxy.el ends here -- 2.39.2