From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#50482: Unhelpful error message whilst byte-compiling a function. Date: Thu, 9 Sep 2021 17:13:19 +0000 Message-ID: References: <87k0jpu7xm.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="HaOx1usLsxI2NVN/" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38946"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50482@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 09 19:14:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mONcp-0009sn-Br for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Sep 2021 19:14:11 +0200 Original-Received: from localhost ([::1]:35424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mONcn-0008JQ-Cg for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Sep 2021 13:14:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mONcg-0008J2-Gy for bug-gnu-emacs@gnu.org; Thu, 09 Sep 2021 13:14:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52808) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mONcg-0005AF-9I for bug-gnu-emacs@gnu.org; Thu, 09 Sep 2021 13:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mONcg-0006SJ-2i for bug-gnu-emacs@gnu.org; Thu, 09 Sep 2021 13:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Sep 2021 17:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50482 X-GNU-PR-Package: emacs Original-Received: via spool by 50482-submit@debbugs.gnu.org id=B50482.163120760824759 (code B ref 50482); Thu, 09 Sep 2021 17:14:02 +0000 Original-Received: (at 50482) by debbugs.gnu.org; 9 Sep 2021 17:13:28 +0000 Original-Received: from localhost ([127.0.0.1]:36121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mONc8-0006RH-DO for submit@debbugs.gnu.org; Thu, 09 Sep 2021 13:13:28 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:37986 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1mONc6-0006Qz-I1 for 50482@debbugs.gnu.org; Thu, 09 Sep 2021 13:13:27 -0400 Original-Received: (qmail 19586 invoked by uid 3782); 9 Sep 2021 17:13:19 -0000 Original-Received: from acm.muc.de (p4fe15aa8.dip0.t-ipconnect.de [79.225.90.168]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 09 Sep 2021 19:13:19 +0200 Original-Received: (qmail 7186 invoked by uid 1000); 9 Sep 2021 17:13:19 -0000 Content-Disposition: inline In-Reply-To: <87k0jpu7xm.fsf@gnus.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:213929 Archived-At: --HaOx1usLsxI2NVN/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, Lars. On Thu, Sep 09, 2021 at 16:42:29 +0200, Lars Ingebrigtsen wrote: > Alan Mackenzie writes: > > I'm working on a function which begins thus: > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > (defun jit-lock--run-functions-new (beg end &optional last-fun) > > (let ((tight-beg nil) (tight-end nil) ; The region we have fully fontified. > > (loose-beg beg) (loose-end end)) ; The maximum region we have fontified > > ; with at least some of > > ; `jit-lock-functions'. > > (run-hook-wrapped > > 'jit-lock-functions > > ...... > > ...... > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > On doing M-x compile-defun on this function, I get as sum total of the > > output in *Compile-Log* this: > > Buffer jit-lock.el:416:1: Error: Wrong number of arguments: # > macroexp--warn-wrap>, 3 > If I just put that in a buffer (and add some closing parentheses), I > don't get that warning. Is there something else needed? It would appear so. On putting the entire function into *scratch*, compile-defun gives the same error in scratch, so I'm attaching the file. Note that lexical-binding was t in my *scratch*. > > .. I don't know what this means. Line 416 is the line where the defun > > starts. I don't have `macroexp--warn-wrap' anywhere in my source code, > > it's not clear to what form 3 arguments are being wrongly passed, or > > where. > The warn-wrap stuff comes from `with-suppressed-warnings', I think. Just to be entirely clear, I'm not asking for help in debugging this error message (although that wouldn't go amiss) - I'm asking that Emacs be amended such that this unhelpful message cannot appear any more. > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany). --HaOx1usLsxI2NVN/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="jit-lock--run-functions-new.el" (defun jit-lock--run-functions-new (beg end &optional last-fun) (let ((tight-beg nil) (tight-end nil) ; The region we have fully fontified. (loose-beg beg) (loose-end end)) ; The maximum region we have fontified ; with at least some of ; `jit-lock-functions'. (run-hook-wrapped 'jit-lock-functions (lambda (fun) (if (eq fun last-fun) ;; If an earlier function in a recursive call has enlarged ;; the region being fontified, we need to re-run `last-fun'. (progn (when (< loose-beg beg) (pcase-let* ((res (funcall fun loose-beg beg)) (`(,this-beg . ,this-end) (if (eq (car-safe res) 'jit-lock-bounds) (cdr res) (cons loose-beg beg)))) (setq loose-beg this-beg))) (when (> loose-end end) (pcase-let* ((res (funcall fun end loose-end)) (`(,this-beg . ,this-end) (if (eq (car-safe res) 'jit-lock-bounds) (cdr res) (cons end loose-end)))) (setq loose-end this-end))) t) ; quit `run-hook-wrapped'. (pcase-let* ;; The first function in `jit-lock-functions' can expand ;; the region into `tight-beg' and `tight-end'. These ;; arguments are passed to the next function (if any). ;; Subsequently, the expanded region from any function is ;; stored in `loose-beg' and `loose-end', and is likewise ;; passed to the next function. ((res (funcall fun loose-beg loose-end)) (`(,this-beg . ,this-end) (if (eq (car-safe res) 'jit-lock-bounds) (cdr res) (cons beg end)))) ;;;; NEW STOUGH, 2021-09-07 (when (< this-beg loose-beg) (let ((sub-beg (car (jit-lock--run-functions this-beg loose-beg fun)))) (setq loose-beg this-beg))) (when (> this-end loose-end) (jit-lock--run-functions loose-end this-end) (setq loose-end this-end)) ;;;; END OF NEW STOUGH (or tight-beg (setq tight-beg (min this-beg beg))) (or tight-end (setq tight-end (max this-end end))) (setq loose-beg (min loose-beg this-beg)) (setq loose-end (max loose-end this-end)) nil)))) ; Carry on executing the hook. `(,(or tight-beg beg) ,(or tight-end end) ,loose-beg ,loose-end))) --HaOx1usLsxI2NVN/--