From 640e52d8fa916fe46ea7adb737d12f2702c88a0a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 May 2022 16:19:12 +0300 Subject: [PATCH] ; Fix mistakes in 'declare function' forms * lisp/progmodes/gdb-mi.el (tooltip-show): * lisp/vc/vc-git.el (grep-expand-template): * lisp/cedet/semantic/imenu.el (pulse-momentary-highlight-one-line): * lisp/mail/feedmail.el (smtpmail-via-smtp): * lisp/mail/rmail.el (rmail-mime-entity-truncated): * lisp/mail/rmailsum.el (rmail-cease-edit): * lisp/progmodes/gud.el (speedbar-toggle-line-expansion) (speedbar-edit-line): * lisp/autoinsert.el (sgml-tag): * lisp/comint.el (url-host, url-type, url-filename): * lisp/progmodes/elisp-mode.el (xref-make, xref-item-location): * lisp/vc/vc-hooks.el (vc-responsible-backend): * lisp/cedet/semantic/complete.el (tooltip-show): * lisp/doc-view.el (tooltip-show): * lisp/follow.el (mwheel-scroll): * lisp/term/pgtk-win.el (pgtk-set-resource): * lisp/progmodes/cperl-mode.el (Info-find-node): * lisp/lpr.el (print-region-function): * lisp/w32-fns.el (w32-version, w32-read-registry): * lisp/emacs-lisp/checkdoc.el (ispell-correct-p, checkdoc-dired): * lisp/progmodes/xref.el (apropos-parse-pattern): * lisp/cus-edit.el (apropos-parse-pattern): * lisp/obsolete/gs.el (x-change-window-property): * lisp/x-dnd.el (x-change-window-property): * lisp/xwidget.el (make-xwidget): * lisp/transient.el (info, Man-find-section, Man-next-section) (Man-getpage-in-background): * lisp/frame.el (x-device-class, pgtk-device-class): * lisp/textmodes/texinfo.el (flymake--log-1): * lisp/term/x-win.el (x-internal-focus-input-context): Fix 'declare function' errors uncovered by 'check-declare'. --- lisp/autoinsert.el | 2 +- lisp/cedet/semantic/complete.el | 3 ++- lisp/cedet/semantic/imenu.el | 3 ++- lisp/comint.el | 6 +++--- lisp/cus-edit.el | 2 +- lisp/doc-view.el | 3 ++- lisp/emacs-lisp/checkdoc.el | 4 ++-- lisp/follow.el | 2 +- lisp/frame.el | 4 ++-- lisp/lpr.el | 2 +- lisp/mail/feedmail.el | 3 ++- lisp/mail/rmail.el | 2 -- lisp/mail/rmailsum.el | 2 +- lisp/obsolete/gs.el | 2 +- lisp/progmodes/cperl-mode.el | 3 ++- lisp/progmodes/elisp-mode.el | 4 ++-- lisp/progmodes/gdb-mi.el | 3 ++- lisp/progmodes/gud.el | 4 ++-- lisp/progmodes/xref.el | 2 +- lisp/term/pgtk-win.el | 2 +- lisp/term/x-win.el | 2 +- lisp/textmodes/texinfo.el | 2 +- lisp/transient.el | 8 ++++---- lisp/vc/vc-git.el | 2 +- lisp/vc/vc-hooks.el | 2 +- lisp/w32-fns.el | 4 ++-- lisp/x-dnd.el | 2 +- lisp/xwidget.el | 2 +- 28 files changed, 43 insertions(+), 39 deletions(-) diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index d25275e3ec4..c12c554498b 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -89,7 +89,7 @@ If this contains a %s, that will be replaced by the matching rule." :type 'string :version "28.1") -(declare-function sgml-tag "sgml-mode" (&optional str arg)) +(declare-function sgml-tag "textmodes/sgml-mode" (&optional str arg)) (defcustom auto-insert-alist `((("\\.\\([Hh]\\|hh\\|hpp\\|hxx\\|h\\+\\+\\)\\'" . "C / C++ header") diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index 2c608fca38a..6a09adca32d 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el @@ -1761,7 +1761,8 @@ Return a cons cell (X . Y)." (defvar tooltip-frame-parameters) -(declare-function tooltip-show "tooltip" (text &optional use-echo-area)) +(declare-function tooltip-show "tooltip" (text &optional use-echo-area + text-face default-face)) (defun semantic-displayer-tooltip-show (text) "Display a tooltip with TEXT near cursor." diff --git a/lisp/cedet/semantic/imenu.el b/lisp/cedet/semantic/imenu.el index 235965a9955..37dc9632729 100644 --- a/lisp/cedet/semantic/imenu.el +++ b/lisp/cedet/semantic/imenu.el @@ -39,7 +39,8 @@ (require 'semantic/sort) (require 'imenu) -(declare-function pulse-momentary-highlight-one-line "pulse" (o &optional face)) +(declare-function pulse-momentary-highlight-one-line "pulse" + (&optional point face)) (declare-function semanticdb-semantic-init-hook-fcn "db-mode") ;; Because semantic imenu tags will hose the current imenu handling diff --git a/lisp/comint.el b/lisp/comint.el index 88eaf1120e3..3dc80c20acb 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -4026,9 +4026,9 @@ arguments, with point where the escape sequence was located." ;; Current directory tracking (OSC 7) -(declare-function url-host "url-parse.el") -(declare-function url-type "url-parse.el") -(declare-function url-filename "url-parse.el") +(declare-function url-host "url/url-parse.el") +(declare-function url-type "url/url-parse.el") +(declare-function url-filename "url/url-parse.el") (defun comint-osc-directory-tracker (_ text) "Update `default-directory' from OSC 7 escape sequences. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index df4edb78a1b..6dff9ec97a2 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1498,7 +1498,7 @@ symbols `custom-face' or `custom-variable'." (custom-buffer-create (custom-sort-items found t nil) "*Customize Saved*")))) -(declare-function apropos-parse-pattern "apropos" (pattern)) +(declare-function apropos-parse-pattern "apropos" (pattern &optional di-all)) (defvar apropos-regexp) ;;;###autoload diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 22570dd5103..9d27347360b 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1641,7 +1641,8 @@ For now these keys are useful: \\[image-kill-buffer] : Kill the conversion process and this buffer. \\[doc-view-kill-proc] : Kill the conversion process.\n"))))) -(declare-function tooltip-show "tooltip" (text &optional use-echo-area)) +(declare-function tooltip-show "tooltip" (text &optional use-echo-area + text-face default-face)) (defun doc-view-show-tooltip () (interactive) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 72eb776b993..2554948890a 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1127,7 +1127,7 @@ When called from Lisp, FILES is a list of filenames." (progn ;; These Dired functions must be defined since we're in a Dired buffer. (declare-function dired-get-filename "dired" - (&optional localp no-error-if-not-filep bof)) + (&optional localp no-error-if-not-filep)) ;; These functions are used by the expansion of `dired-map-over-marks'. (declare-function dired-move-to-filename "dired" (&optional raise-error eol)) @@ -2234,7 +2234,7 @@ If the offending word is in a piece of quoted text, then it is skipped." ;; (defvar ispell-process) (declare-function ispell-buffer-local-words "ispell" ()) -(declare-function ispell-correct-p "ispell" ()) +(declare-function ispell-correct-p "ispell" (&optional following)) (declare-function ispell-set-spellchecker-params "ispell" ()) (declare-function ispell-accept-buffer-local-defs "ispell" ()) (declare-function ispell-error-checking-word "ispell" (word)) diff --git a/lisp/follow.el b/lisp/follow.el index 6c721899d45..adf1c1b762d 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -1552,7 +1552,7 @@ non-first windows in Follow mode." (declare-function scroll-bar-drag "scroll-bar" (event)) (declare-function scroll-bar-scroll-up "scroll-bar" (event)) (declare-function scroll-bar-scroll-down "scroll-bar" (event)) -(declare-function mwheel-scroll "mwheel" (event)) +(declare-function mwheel-scroll "mwheel" (event &optional arg)) (defun follow-scroll-bar-toolkit-scroll (event) (interactive "e") diff --git a/lisp/frame.el b/lisp/frame.el index 49eabcf9786..9b8937c2580 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -2433,8 +2433,8 @@ monitors." ,(display-mm-height display))) (frames . ,(frames-on-display-list display))))))))) -(declare-function x-device-class (name) "x-win.el") -(declare-function pgtk-device-class (name) "pgtk-win.el") +(declare-function x-device-class "term/x-win.el" (name)) +(declare-function pgtk-device-class "term/pgtk-win.el" (name)) (defun device-class (frame name) "Return the class of the device NAME for an event generated on FRAME. diff --git a/lisp/lpr.el b/lisp/lpr.el index 01617ef912a..88b0607b119 100644 --- a/lisp/lpr.el +++ b/lisp/lpr.el @@ -125,7 +125,7 @@ and print the result." (defcustom print-region-function (if (memq system-type '(ms-dos windows-nt)) (progn - (declare-function w32-direct-print-region-function "w32-fns") + (declare-function w32-direct-print-region-function "dos-w32") #'w32-direct-print-region-function) #'call-process-region) "Function to call to print the region on a printer. diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 35e9f73f8cf..af12417f706 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -1619,7 +1619,8 @@ local gurus." (if (null mail-interactive) '("-oem" "-odb"))))) (declare-function smtpmail-via-smtp "smtpmail" - (recipient smtpmail-text-buffer &optional ask-for-password)) + (recipient smtpmail-text-buffer &optional ask-for-password + send-attempts)) (defvar smtpmail-smtp-server) ;; provided by jam@austin.asc.slb.com (James A. McLaughlin); diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 6b058d09f94..8cde590bc00 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -4592,8 +4592,6 @@ Argument MIME is non-nil if this is a mime message." armor-end-regexp (buffer-substring armor-start (- (point-max) after-end))))) -(declare-function rmail-mime-entity-truncated "rmailmm" (entity)) - ;; Should this have a key-binding, or be in a menu? ;; There doesn't really seem to be an appropriate menu. ;; Eg the edit command is not in a menu either. diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 59c2e578d32..b23fbc3f600 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -1475,7 +1475,7 @@ argument says to read a file name and use that file as the inbox." (forward-line -1)) (declare-function rmail-abort-edit "rmailedit" ()) -(declare-function rmail-cease-edit "rmailedit"()) +(declare-function rmail-cease-edit "rmailedit" (&optional abort)) (declare-function rmail-set-label "rmailkwd" (l state &optional n)) (declare-function rmail-output-read-file-name "rmailout" ()) (declare-function mail-send-and-exit "sendmail" (&optional arg)) diff --git a/lisp/obsolete/gs.el b/lisp/obsolete/gs.el index 971e7d2640a..7bf324ceecf 100644 --- a/lisp/obsolete/gs.el +++ b/lisp/obsolete/gs.el @@ -116,7 +116,7 @@ FILE is the value to substitute for the place-holder `'." (/ (* 25.4 mm) 72.0))) (declare-function x-change-window-property "xfns.c" - (prop value &optional frame type format outer-p)) + (prop value &optional frame type format outer-p window-id)) (defun gs-set-ghostview-window-prop (frame spec img-width img-height) "Set the `GHOSTVIEW' window property of FRAME. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 4804b13ded6..1bf77381e8b 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -6382,7 +6382,8 @@ side-effect of memorizing only. Examples in `cperl-style-examples'." (eval '(mode-compile)))) ; Avoid a warning (declare-function Info-find-node "info" - (filename nodename &optional no-going-back strict-case)) + (filename nodename &optional no-going-back strict-case + noerror)) (defun cperl-info-buffer (type) ;; Return buffer with documentation. Creates if missing. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 775b6ebab47..1ae1cf7eb6d 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -776,8 +776,8 @@ functions are annotated with \"\" via the ;;; Xref backend -(declare-function xref-make "xref" (summary location)) -(declare-function xref-item-location "xref" (this)) +(declare-function xref-make "progmodes/xref" (summary location)) +(declare-function xref-item-location "progmodes/xref" (this)) (defun elisp--xref-backend () 'elisp) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index c9b6ccd324f..2319e638543 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1144,7 +1144,8 @@ no input, and GDB is waiting for input." (setq name (nth 1 (split-string define "[( ]"))) (push (cons name define) gdb-define-alist)))) -(declare-function tooltip-show "tooltip" (text &optional use-echo-area)) +(declare-function tooltip-show "tooltip" (text &optional use-echo-area + text-face default-face)) (defconst gdb--string-regexp (rx "\"" (* (or (seq "\\" nonl) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 7092ca2041f..213ebef92f5 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -54,8 +54,8 @@ (declare-function gdb-tooltip-print-1 "gdb-mi" (expr)) (declare-function gud-pp "gdb-mi" (arg)) (declare-function gdb-var-delete "gdb-mi" ()) -(declare-function speedbar-toggle-line-expansion "gud" ()) -(declare-function speedbar-edit-line "gud" ()) +(declare-function speedbar-toggle-line-expansion "speedbar" ()) +(declare-function speedbar-edit-line "speedbar" ()) ;; FIXME: The declares below are necessary because we don't call `gud-def' ;; at toplevel, so the compiler doesn't know under which circumstances ;; they're defined. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 6e763eef018..683589d71c6 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1549,7 +1549,7 @@ This command is intended to be bound to a mouse event." (xref-find-references identifier)) (user-error "No identifier here")))) -(declare-function apropos-parse-pattern "apropos" (pattern)) +(declare-function apropos-parse-pattern "apropos" (pattern &optional do-all)) ;;;###autoload (defun xref-find-apropos (pattern) diff --git a/lisp/term/pgtk-win.el b/lisp/term/pgtk-win.el index 5317f6ba01a..9b22ab0970b 100644 --- a/lisp/term/pgtk-win.el +++ b/lisp/term/pgtk-win.el @@ -97,7 +97,7 @@ the last file dropped is selected." (declare-function x-handle-args "common-win" (args)) (declare-function x-open-connection "pgtkfns.c" (display &optional xrm-string must-succeed)) -(declare-function pgtk-set-resource "pgtkfns.c" (owner name value)) +(declare-function pgtk-set-resource "pgtkfns.c" (attribute value)) ;; Do the actual window system setup here; the above code just defines ;; functions and variables that we use now. diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 08a8bf88e5d..1f29b24ef20 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -1559,7 +1559,7 @@ EVENT is a preedit-text event." (defvaralias 'x-gtk-use-system-tooltips 'use-system-tooltips) -(declare-function x-internal-focus-input-context (focus frame) "xfns.c") +(declare-function x-internal-focus-input-context "xfns.c" (focus)) (defun x-gtk-use-native-input-watcher (_symbol newval &rest _ignored) "Variable watcher for `x-gtk-use-native-input'. diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 71b8d82ed96..5d6f5deae1b 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -39,7 +39,7 @@ (declare-function flymake-make-diagnostic "flymake" ( locus beg end type text &optional data overlay-properties)) -(declare-function flymake--log-1 (level sublog msg &rest args)) +(declare-function flymake--log-1 "flymake" (level sublog msg &rest args)) (eval-when-compile (require 'tex-mode)) (declare-function tex-buffer "tex-mode" ()) diff --git a/lisp/transient.el b/lisp/transient.el index 13e8de258bd..d329bbdbcd1 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -61,10 +61,10 @@ (eval-when-compile (require 'subr-x)) -(declare-function info 'info) -(declare-function Man-find-section 'man) -(declare-function Man-next-section 'man) -(declare-function Man-getpage-in-background 'man) +(declare-function info "info") +(declare-function Man-find-section "man") +(declare-function Man-next-section "man") +(declare-function Man-getpage-in-background "man") (defvar Man-notify-method) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index ad39dc604a9..8937454d111 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1599,7 +1599,7 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"." (declare-function grep-read-regexp "grep" ()) (declare-function grep-read-files "grep" (regexp)) (declare-function grep-expand-template "grep" - (template &optional regexp files dir excl)) + (template &optional regexp files dir excl more-opts)) (defvar compilation-environment) ;; Derived from `lgrep'. diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index bd2ea337b16..76d97716724 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -966,7 +966,7 @@ In the latter case, VC mode is deactivated for this buffer." (defalias 'vc-menu-map vc-menu-map) -(declare-function vc-responsible-backend "vc" (file)) +(declare-function vc-responsible-backend "vc" (file &optional no-error)) (defun vc-menu-map-filter (orig-binding) (if (and (symbolp orig-binding) (fboundp orig-binding)) diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index f353566b060..bdef0ae17cc 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el @@ -312,8 +312,8 @@ names." ;;;; System name and version for emacsbug.el -(declare-function w32-version "w32-win" ()) -(declare-function w32-read-registry "w32fns" (root key name)) +(declare-function w32-version "term/w32-win" ()) +(declare-function w32-read-registry "w32fns.c" (root key name)) (defun w32--os-description () "Return a string describing the underlying OS and its version." diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index c2498a57a13..13a73aa7fb3 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -403,7 +403,7 @@ Currently XDND, Motif and old KDE 1.x protocols are recognized." ;;; XDND protocol. (declare-function x-change-window-property "xfns.c" - (prop value &optional frame type format outer-P)) + (prop value &optional frame type format outer-P window-id)) (defun x-dnd-init-xdnd-for-frame (frame) "Set the XdndAware property for FRAME to indicate that we do XDND." diff --git a/lisp/xwidget.el b/lisp/xwidget.el index e50324ac47c..62da16d486a 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -36,7 +36,7 @@ (require 'format-spec) (declare-function make-xwidget "xwidget.c" - (type title width height arguments &optional buffer related)) + (type title width height &optional arguments buffer related)) (declare-function xwidget-buffer "xwidget.c" (xwidget)) (declare-function set-xwidget-buffer "xwidget.c" (xwidget buffer)) (declare-function xwidget-size-request "xwidget.c" (xwidget)) -- 2.39.2