From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Cochran Newsgroups: gmane.emacs.bugs Subject: bug#24133: 25.1.50; Some checkdoc.el functions use call-interactively incorrectly Date: Fri, 19 Aug 2016 18:24:40 -0700 Message-ID: <87bn0oqlk7.fsf@cochranmail.com> References: <2eb6d6f3-09e8-093b-568f-634dced3fcd6@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1471656389 9423 195.159.176.226 (20 Aug 2016 01:26:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 20 Aug 2016 01:26:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 24133@debbugs.gnu.org To: Matthew Malcomson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 20 03:26:22 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bav3D-0001tv-Vn for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Aug 2016 03:26:20 +0200 Original-Received: from localhost ([::1]:59531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bav3A-0005rq-TZ for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Aug 2016 21:26:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bav30-0005rd-UL for bug-gnu-emacs@gnu.org; Fri, 19 Aug 2016 21:26:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bav2w-0001ta-PM for bug-gnu-emacs@gnu.org; Fri, 19 Aug 2016 21:26:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bav2w-0001tW-F0 for bug-gnu-emacs@gnu.org; Fri, 19 Aug 2016 21:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bav2w-0001hO-52 for bug-gnu-emacs@gnu.org; Fri, 19 Aug 2016 21:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Cochran Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Aug 2016 01:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24133 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24133-submit@debbugs.gnu.org id=B24133.14716563076466 (code B ref 24133); Sat, 20 Aug 2016 01:26:02 +0000 Original-Received: (at 24133) by debbugs.gnu.org; 20 Aug 2016 01:25:07 +0000 Original-Received: from localhost ([127.0.0.1]:34588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bav23-0001gD-Ha for submit@debbugs.gnu.org; Fri, 19 Aug 2016 21:25:07 -0400 Original-Received: from mail.workgrouplinux.net ([207.195.177.82]:55615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bav22-0001g4-6m for 24133@debbugs.gnu.org; Fri, 19 Aug 2016 21:25:07 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=simple; d=cochranmail.com; h=from:to :cc:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=dkim1; bh=syljZifn4lSpYl2ViRyuN2DAu2E=; b=L0u1H B+mVfKFs8ifGK953JgDheDQ7m67rBn9b0XLJRyfskTnsc30400D2Or+mqyww7bkU a842a8kc7JI/f0QiFpCoBPJ7uQBFpV13/Qy/1BcleOq96ZV0rr6Z20v1b1iGoqr2 U1lHPzHRLf4t/hszdrI80X6FgkiDKq7M+W5DbRH1O0HD6azp31jhyBlvDrxA0sXK L9MfXWOfUhgQFDFThOPAeeWJiWwIIHjb1Dsni4n24f9JmBJynG5wuhwQeEDkRtKZ 64hNRnS1hRJWtowERzNiIdkwX4IJSJKOuCYrMhzdDcRjM5zfiUhLIidmatQFbTNK 2H2XEA6l5AlwvINsQ== Original-Received: (qmail 21456 invoked by uid 0); 20 Aug 2016 01:25:03 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=private; d=cochranmail.com; b=iffx25zHZmdB/2HMATVC0/MkyYnP4uy0Pz4FKxFSzDWRMJiru3wCbl94ed6bDGQSYQpKVZQ7gOod5o+tadgS+Q==; Original-Received: from 131-191-86-130.as.clicknet.org (HELO SoraLaptop) (robert@cochranmail.com@131.191.86.130) by mail.cochrantribe.org with ESMTPA; 20 Aug 2016 01:25:03 -0000 In-Reply-To: <2eb6d6f3-09e8-093b-568f-634dced3fcd6@gmail.com> (Matthew Malcomson's message of "Tue, 2 Aug 2016 08:08:24 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122398 Archived-At: --=-=-= Content-Type: text/plain Matthew Malcomson writes: > There are a few checkdoc.el functions that pass `current-prefix-arg' > as the third argument (KEYS) to `call-interactively'. > When running any of these with a prefix argument (whether numeric or > a cons cell) gives an error about the argument to `call-interactively' > not being a vector. > e.g. > > emacs -Q > > C-u M-x checkdoc-ispell > > checkdoc-ispell: Wrong type argument: vectorp, (4) > > > I see this with any emacs version I've tried. As it turns out, whoever wrote that wasn't paying close enough attention, as the third argument is supposed to be for events (to satisfy commands that ask for "e", "k", "K", or "U"). It seems that `call-interactively' propagates the prefix argument to the called function automatically (it did with a test command that printed its arg in my git emacs -Q), so you should be able to remove the last 2 arguments to each call and it should Just Work(tm). I have a patch, attached, that does just that. ----- --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-uses-of-call-interactively-in-lisp-emacs-lisp-ch.patch Content-Description: checkdoc.el call-interactively fixup patch >From 77b83195d234efe1e8876733067548d7e9c17271 Mon Sep 17 00:00:00 2001 From: Robert Cochran Date: Fri, 19 Aug 2016 18:03:24 -0700 Subject: [PATCH] Fix uses of (call-interactively) in lisp/emacs-lisp/checkdoc.el * lisp/emacs-lisp/checkdoc.el (checkdoc-ispell) (checkdoc-ispell-current-buffer) (checkdoc-ispell-interactive) (checkdoc-ispell-message-text) (checkdoc-ispell-start) (checkdoc-ispell-continue) (checkdoc-ispell-comments) (checkdoc-ispell-defun): Do not pass 'current-prefix-arg' to 'call-interactively' as an event vector; merely allow it to propagate forward to the interactive call. Passing the prefix argument as the 3rd argument to 'call-interactively' causes the prefix argument to be interpreted as events, which is not only wrong, but also causes a type error, as 'current-prefix-arg' can never be a vector as 'call-interactively' expects. 'call-interactively' automatically passes its prefix argument to the called function, so just do that, eliminating faulty behavior. --- lisp/emacs-lisp/checkdoc.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 3a81ade..769c2fe 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1062,7 +1062,7 @@ checkdoc-ispell Prefix argument is the same as for `checkdoc'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc nil current-prefix-arg))) + (call-interactively #'checkdoc))) ;;;###autoload (defun checkdoc-ispell-current-buffer () @@ -1071,7 +1071,7 @@ checkdoc-ispell-current-buffer Prefix argument is the same as for `checkdoc-current-buffer'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-current-buffer nil current-prefix-arg))) + (call-interactively #'checkdoc-current-buffer))) ;;;###autoload (defun checkdoc-ispell-interactive () @@ -1080,7 +1080,7 @@ checkdoc-ispell-interactive Prefix argument is the same as for `checkdoc-interactive'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-interactive nil current-prefix-arg))) + (call-interactively #'checkdoc-interactive))) ;;;###autoload (defun checkdoc-ispell-message-interactive () @@ -1099,7 +1099,7 @@ checkdoc-ispell-message-text Prefix argument is the same as for `checkdoc-message-text'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-message-text nil current-prefix-arg))) + (call-interactively #'checkdoc-message-text))) ;;;###autoload (defun checkdoc-ispell-start () @@ -1108,7 +1108,7 @@ checkdoc-ispell-start Prefix argument is the same as for `checkdoc-start'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-start nil current-prefix-arg))) + (call-interactively #'checkdoc-start))) ;;;###autoload (defun checkdoc-ispell-continue () @@ -1117,7 +1117,7 @@ checkdoc-ispell-continue Prefix argument is the same as for `checkdoc-continue'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-continue nil current-prefix-arg))) + (call-interactively #'checkdoc-continue))) ;;;###autoload (defun checkdoc-ispell-comments () @@ -1126,7 +1126,7 @@ checkdoc-ispell-comments Prefix argument is the same as for `checkdoc-comments'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-comments nil current-prefix-arg))) + (call-interactively #'checkdoc-comments))) ;;;###autoload (defun checkdoc-ispell-defun () @@ -1135,7 +1135,7 @@ checkdoc-ispell-defun Prefix argument is the same as for `checkdoc-defun'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-defun nil current-prefix-arg))) + (call-interactively #'checkdoc-defun))) ;;; Error Management ;; -- 2.7.4 --=-=-= Content-Type: text/plain ----- HTH, -- ~Robert Cochran GPG Fingerprint - E778 2DD4 FEA6 6A68 6F26 AD2D E5C3 EB36 4886 8871 --=-=-=--