From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Gemini Lasswell Newsgroups: gmane.emacs.bugs Subject: bug#31090: 26.0.91; Edebug incorrectly instruments unquotes in nested backquotes Date: Sat, 07 Apr 2018 16:44:59 -0700 Message-ID: <87fu4662fm.fsf@runbox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1523144647 9026 195.159.176.226 (7 Apr 2018 23:44:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Apr 2018 23:44:07 +0000 (UTC) To: 31090@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 08 01:44:03 2018 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 1f4xV5-0002Gp-6f for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Apr 2018 01:44:03 +0200 Original-Received: from localhost ([::1]:33737 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4xXA-0004Ol-VX for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Apr 2018 19:46:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4xX3-0004O4-9v for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 19:46:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4xX0-0002uc-5d for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 19:46:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33731) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f4xX0-0002uJ-0R for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 19:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f4xWz-0005cs-Mx for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 19:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gemini Lasswell Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Apr 2018 23:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31090 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.152314474721598 (code B ref -1); Sat, 07 Apr 2018 23:46:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Apr 2018 23:45:47 +0000 Original-Received: from localhost ([127.0.0.1]:41628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4xWk-0005cI-Tz for submit@debbugs.gnu.org; Sat, 07 Apr 2018 19:45:47 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4xWj-0005c5-8V for submit@debbugs.gnu.org; Sat, 07 Apr 2018 19:45:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4xWc-0002gg-Gl for submit@debbugs.gnu.org; Sat, 07 Apr 2018 19:45:39 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:33026) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4xWc-0002gO-Cn for submit@debbugs.gnu.org; Sat, 07 Apr 2018 19:45:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4xWa-0004FX-Iy for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 19:45:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4xWX-0002f3-EC for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 19:45:36 -0400 Original-Received: from aibo.runbox.com ([91.220.196.211]:44556) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f4xWW-0002e7-VX for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 19:45:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=Content-Type:MIME-Version:Date:Message-ID:Subject:To:From; bh=G5Sp0qvWXh42yCTGcECZgua/sxLCkeTOe+C52vM15AM=; b=Xyl4TMg9no7EoZvFleuiFBAzj Odu3x0fTBdGZX7wtZbbwcpwFlDWc9uFNJwsWe7iSbfG/h5ewxGUdrZpHDF74VwqwtaAJVECluh78X vxV0GwJN3nyY8nC/8Oq9W7smnqbsVkKtNhD7ihCTESs8M/DwDORL+naiMKUpOohouuYIkegBeptRI 0lYfrxuETU2can84CAW0R8em0UHlNfNQLgUWBDzCOmabIQCeJRMwDvPgPsRwv2skpkXBY6XR6A2hQ 1+ZOrD7OPvbuKdEQphkok5APUIRR8WsbgQEw+D7NcubdoHqDSGfoZ35hOk6wuXvkAkvdx0h3X3Xuh ylALBCNSw==; Original-Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1f4xWU-0003Oc-4r for bug-gnu-emacs@gnu.org; Sun, 08 Apr 2018 01:45:30 +0200 Original-Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=chinook) by mailfront10.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1f4xWJ-0007J6-Ok for bug-gnu-emacs@gnu.org; Sun, 08 Apr 2018 01:45:20 +0200 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:144972 Archived-At: Edebug incorrectly instruments unquotes inside of nested backquotes, causing errors if the incorrectly instrumented forms are part of a macro expansion that then gets executed in another context. To reproduce, enter this code into *scratch*: (defun my-wrap-form (form description) `(unless ,form (message "failed %s" ,description))) (defmacro my-should (form) (declare (debug t)) (let ((fn (gensym "fn-")) (args (gensym "args-")) (value (gensym "value-"))) `(let ((,fn (function ,(car form))) (,args (list ,@(cdr form))) ,value) ,(my-wrap-form `(setq ,value (apply ,fn ,args)) `(nconc (list :form `(,,fn ,@,args)) (list :value ,value)))))) (defun my-test () (my-should (= 1 2))) Then: Navigate to the definition of my-wrap-form and evaluate it with C-M-x Navigate to the definition of my-should and evaluate it with C-u C-M-x Navigate to the definition of my-test and evaluate it with C-M-x g M-: (my-test) RET Result: The debugger appears with an error (wrong-type-argument consp nil) in edebug-before. The sample code above is a much simplified version of the implementation of ert.el's 'should' macro, which Edebug does not instrument correctly. While this nested backquote construction is a valid use of backquote, and Edebug should be fixed to handle it correctly, I think that this is a case where backquote makes readability worse instead of better and the code in ert.el would be more readable if `(,,fn ,@,args) was replaced by a non-backquoted way of doing the same thing, such as (cons ,fn ,args). In GNU Emacs 26.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.21) of 2018-04-03 built on localhost Windowing system distributor 'The X.Org Foundation', version 11.0.11905000 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. my-wrap-form Quit Edebug: my-should Mark set Go... my-test Entering debugger... Back to top level Configured using: 'configure --prefix=/nix/store/4bablkw2fkvnglq8ha4gj1vj29hiavff-emacs-26.0 --with-modules --with-x-toolkit=gtk3 --with-xft' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES THREADS Important settings: value of $EMACSLOADPATH: /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/elpy-1.16.0/elpy hides /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/elpy-1.9.0/elpy /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/elpy-1.16.0/elpy-refactor hides /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/elpy-1.9.0/elpy-refactor /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/elpy-1.16.0/elpy-pkg hides /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/elpy-1.9.0/elpy-pkg /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/elpy-1.16.0/elpy-autoloads hides /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/elpy-1.9.0/elpy-autoloads /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/soap-client-3.1.3/soap-inspect hides /nix/store/4bablkw2fkvnglq8ha4gj1vj29hiavff-emacs-26.0/share/emacs/26.0.91/lisp/net/soap-inspect /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/soap-client-3.1.3/soap-client hides /nix/store/4bablkw2fkvnglq8ha4gj1vj29hiavff-emacs-26.0/share/emacs/26.0.91/lisp/net/soap-client /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/seq-2.20/seq hides /nix/store/4bablkw2fkvnglq8ha4gj1vj29hiavff-emacs-26.0/share/emacs/26.0.91/lisp/emacs-lisp/seq /nix/store/0gdqa4xzckgz3w0h4cyzsv8al82a601k-emacs-packages-deps/share/emacs/site-lisp/elpa/let-alist-1.0.5/let-alist hides /nix/store/4bablkw2fkvnglq8ha4gj1vj29hiavff-emacs-26.0/share/emacs/26.0.91/lisp/emacs-lisp/let-alist Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-mode cl-print debug edebug easymenu misearch multi-isearch map seq seq-25 byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 101864 7133) (symbols 48 21035 1) (miscs 40 52 165) (strings 32 30023 1659) (string-bytes 1 816911) (vectors 16 15702) (vector-slots 8 511581 6094) (floats 8 51 164) (intervals 56 270 0) (buffers 992 13))