Commit 10fe410f authored by Jonas Bernoulli's avatar Jonas Bernoulli

Consolidate function declarations and compile-time imports

By the way, in order to get the number of false-positives down to
only three, one has to teach `check-declare-verify' about `cl-defun'.
parent 8d9afa3a
......@@ -129,9 +129,10 @@
(defvar font-lock-beg)
(defvar font-lock-end)
(declare-function magit-expand-git-file-name 'magit-git)
(declare-function magit-list-local-branch-names 'magit-git)
(declare-function magit-list-remote-branch-names 'magit-git)
(declare-function magit-expand-git-file-name "magit-git" (filename))
(declare-function magit-list-local-branch-names "magit-git" ())
(declare-function magit-list-remote-branch-names "magit-git"
(&optional remote relative))
;;; Options
;;;; Variables
......
......@@ -35,21 +35,21 @@
(require 'magit-wip)
;; For `magit-apply'
(declare-function magit-am-popup 'magit-sequence)
(declare-function magit-patch-apply-popup 'magit-files)
(declare-function magit-am-popup "magit-sequence" (&optional arg))
(declare-function magit-patch-apply-popup "magit-files" (&optional arg))
;; For `magit-discard-files'
(declare-function magit-checkout-stage 'magit)
(declare-function magit-checkout-read-stage 'magit)
(declare-function magit-checkout-stage "magit" (file arg))
(declare-function magit-checkout-read-stage "magit" (file))
(defvar auto-revert-verbose)
;; For `magit-stage-untracked'
(declare-function magit-submodule-add 'magit-submodule)
(declare-function magit-submodule-read-name-for-path 'magit-submodule)
(declare-function borg--maybe-absorb-gitdir 'borg)
(declare-function borg--sort-submodule-sections 'borg)
(declare-function magit-submodule-add "magit-submodule"
(url &optional path name args))
(declare-function magit-submodule-read-name-for-path "magit-submodule"
(path &optional prefer-short))
(declare-function borg--maybe-absorb-gitdir "borg" (pkg))
(declare-function borg--sort-submodule-sections "borg" (file))
(defvar borg-user-emacs-directory)
(require 'dired)
;;; Options
(defcustom magit-delete-by-moving-to-trash t
......
......@@ -34,12 +34,6 @@
(eval-when-compile (require 'epa)) ; for `epa-protocol'
(eval-when-compile (require 'epg))
(declare-function epg-sub-key-id 'epg)
(declare-function epg-key-sub-key-list 'epg)
(declare-function epg-key-user-id-list 'epg)
(declare-function epg-user-id-string 'epg)
(declare-function epg-decode-dn 'epg)
(declare-function epg-list-keys 'epg)
;;; Options
......
......@@ -32,18 +32,18 @@
(require 'magit-core)
;; For `magit-diff-popup'
(declare-function magit-stash-show 'magit-stash)
(declare-function magit-stash-show "magit-stash" (stash &optional args files))
;; For `magit-diff-visit-file'
(declare-function dired-jump 'dired-x)
(declare-function magit-find-file-noselect 'magit)
(declare-function magit-status-internal 'magit)
(declare-function dired-jump "dired-x" (&optional other-window file-name))
(declare-function magit-find-file-noselect "magit-files" (rev file))
(declare-function magit-status-internal "magit-status" (directory))
;; For `magit-diff-while-committing'
(declare-function magit-commit-message-buffer 'magit)
(declare-function magit-commit-message-buffer "magit-commit" ())
;; For `magit-insert-revision-gravatar'
(defvar gravatar-size)
;; For `magit-show-commit' and `magit-diff-show-or-scroll'
(declare-function magit-blame-chunk-get 'magit-blame)
(declare-function magit-blame-mode 'magit-blame)
(declare-function magit-blame-chunk-get "magit-blame" (key &optional pos))
(declare-function magit-blame-mode "magit-blame" (&optional arg))
(defvar magit-blame-mode)
(defvar git-rebase-line)
......
......@@ -26,8 +26,7 @@
(require 'magit)
(declare-function dired-do-shell-command 'dired-aux)
(declare-function dired-read-shell-command 'dired-aux)
(declare-function dired-read-shell-command "dired-aux" (prompt arg files))
(defgroup magit-extras nil
"Additional functionality for Magit."
......
......@@ -34,12 +34,13 @@
(require 'magit-utils)
(require 'magit-section)
(declare-function magit-call-git 'magit-process)
(declare-function magit-maybe-make-margin-overlay 'magit-log)
(declare-function magit-process-buffer 'magit-process)
(declare-function magit-process-file 'magit-process)
(declare-function magit-process-insert-section 'magit-process)
(declare-function magit-refresh 'magit-mode)
(declare-function magit-call-git "magit-process" (&rest args))
(declare-function magit-maybe-make-margin-overlay "magit-margin" ())
(declare-function magit-process-buffer "magit-process" (&optional nodisplay))
(declare-function magit-process-file "magit-process" (&rest args))
(declare-function magit-process-insert-section "magit-process"
(pwe program args &optional errcode errlog))
(declare-function magit-refresh "magit-mode" ())
(defvar magit-process-error-message-regexps)
(defvar magit-refresh-args) ; from `magit-mode' for `magit-current-file'
(defvar magit-branch-prefer-remote-upstream)
......
......@@ -32,11 +32,15 @@
(require 'magit-core)
(require 'magit-diff)
(declare-function magit-blob-visit 'magit)
(declare-function magit-insert-head-branch-header 'magit)
(declare-function magit-insert-upstream-branch-header 'magit)
(declare-function magit-read-file-from-rev 'magit)
(declare-function magit-show-commit 'magit)
(declare-function magit-blob-visit "magit-files" (blob-or-file line))
(declare-function magit-insert-head-branch-header "magit-status"
(&optional branch))
(declare-function magit-insert-upstream-branch-header "magit-status"
(&optional branch pull keyword))
(declare-function magit-read-file-from-rev "magit-files"
(rev prompt &optional default))
(declare-function magit-show-commit "magit-diff"
(arg1 &optional arg2 arg3 arg4))
(defvar magit-refs-indent-cherry-lines)
(defvar magit-refs-margin)
(defvar magit-refs-show-commit-count)
......
......@@ -42,9 +42,9 @@
(defvar magit-diff-show-xref-buttons)
(defvar magit-revision-show-xref-buttons)
;; For `magit-refresh' and `magit-refresh-all'
(declare-function magit-auto-revert-buffers 'magit-autorevert)
(declare-function magit-auto-revert-buffers "magit-autorevert" ())
;; For `magit-refresh-buffer'
(declare-function magit-process-unset-mode-line-error-status 'magit-process)
(declare-function magit-process-unset-mode-line-error-status "magit-process" ())
(require 'format-spec)
(require 'help-mode)
......
......@@ -41,11 +41,8 @@
(require 'magit-git)
(require 'magit-mode)
(eval-when-compile (require 'dired))
(declare-function dired-uncache 'dired)
(eval-when-compile (require 'auth-source))
(declare-function auth-source-search 'auth-source)
(declare-function auth-source-search "auth-source"
(&rest spec &key max require create delete &allow-other-keys))
;;; Options
......@@ -842,8 +839,6 @@ as argument."
(setq mode-line-process str)))
(force-mode-line-update t)))
(declare-function magit-repository-local-repository "magit-mode")
(defun magit-process-set-mode-line-error-status (&optional error str)
"Apply an error face to the string set by `magit-process-set-mode-line'.
......@@ -971,7 +966,7 @@ Limited by `magit-process-error-tooltip-max-lines'."
(setq default-dir (process-get arg 'default-dir))
(setq section (process-get arg 'section))
(setq arg (process-exit-status arg)))
(when (featurep 'dired)
(when (fboundp 'dired-uncache)
(dired-uncache default-dir))
(when (buffer-live-p process-buf)
(with-current-buffer process-buf
......
......@@ -31,7 +31,7 @@
(require 'magit-core)
(declare-function magit-status-internal 'magit-status)
(declare-function magit-status-internal "magit-status" (directory))
(defvar x-stretch-cursor)
......
......@@ -35,9 +35,11 @@
(require 'magit-utils)
(declare-function magit-maybe-make-margin-overlay 'magit-log)
(declare-function magit-repository-local-get 'magit-mode)
(declare-function magit-repository-local-set 'magit-mode)
(declare-function magit-maybe-make-margin-overlay "magit-margin" ())
(declare-function magit-repository-local-get "magit-mode"
(key &optional default repository))
(declare-function magit-repository-local-set "magit-mode"
(key value &optional repository))
(defvar magit-keep-region-overlay)
;;; Options
......
......@@ -44,11 +44,14 @@
(require 'crm)
(eval-when-compile (require 'ido))
(declare-function ido-completing-read+ 'ido-completing-read+)
(declare-function Info-get-token 'info)
(declare-function ido-completing-read+ "ido-completing-read+"
(prompt collection &optional predicate
require-match initial-input
hist def inherit-input-method))
(declare-function Info-get-token "info" (pos start all &optional errorstring))
(eval-when-compile (require 'vc-git))
(declare-function vc-git--run-command-string 'vc-git)
(declare-function vc-git--run-command-string "vc-git" (file &rest args))
(defvar magit-wip-before-change-mode)
......
......@@ -61,12 +61,6 @@
(require 'format-spec)
(require 'package nil t) ; used in `magit-version'
(eval-when-compile (require 'dired-x))
(declare-function dired-jump 'dired-x)
(eval-when-compile (require 'eshell))
(declare-function eshell-parse-arguments 'eshell)
(eval-when-compile (require 'message))
(defconst magit--minimal-git "1.9.4")
(defconst magit--minimal-emacs "24.4")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment