From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.bugs Subject: bug#21072: Brave new mark-defun (and a testing tool) Date: Wed, 03 May 2017 17:20:56 +0200 Message-ID: <87shkmvuef.fsf@jane> References: <87o9ydrzkr.fsf@mbork.pl> <87k272wh8x.fsf@users.sourceforge.net> <871st4aal7.fsf@jane> <87tw5l7v26.fsf@jane> <877f2hs1nw.fsf@users.sourceforge.net> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> <878tmhogb0.fsf@users.sourceforge.net> <8760hlo9os.fsf@users.sourceforge.net> <8737cpo7st.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1493824880 3376 195.159.176.226 (3 May 2017 15:21:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 3 May 2017 15:21:20 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 26.0.50 Cc: Stefan Monnier , 21072@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 03 17:21:16 2017 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 1d5w5b-0000jE-LE for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 May 2017 17:21:15 +0200 Original-Received: from localhost ([::1]:37317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5w5e-0007jj-9F for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 May 2017 11:21:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5w5U-0007i4-4w for bug-gnu-emacs@gnu.org; Wed, 03 May 2017 11:21:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5w5O-0008OP-5c for bug-gnu-emacs@gnu.org; Wed, 03 May 2017 11:21:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54764) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d5w5O-0008O6-2h for bug-gnu-emacs@gnu.org; Wed, 03 May 2017 11:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d5w5N-0001hD-T7 for bug-gnu-emacs@gnu.org; Wed, 03 May 2017 11:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 May 2017 15:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21072 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14938248246461 (code B ref 21072); Wed, 03 May 2017 15:21:01 +0000 Original-Received: (at 21072) by debbugs.gnu.org; 3 May 2017 15:20:24 +0000 Original-Received: from localhost ([127.0.0.1]:52963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5w4l-0001g9-Tf for submit@debbugs.gnu.org; Wed, 03 May 2017 11:20:24 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:51211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5w4j-0001g0-SS for 21072@debbugs.gnu.org; Wed, 03 May 2017 11:20:22 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 95258E661F; Wed, 3 May 2017 17:20:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YLMUhYmGsKD5; Wed, 3 May 2017 17:20:09 +0200 (CEST) Original-Received: from localhost (apn-31-0-23-9.dynamic.gprs.plus.pl [31.0.23.9]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 7B32CE6585; Wed, 3 May 2017 17:20:09 +0200 (CEST) In-reply-to: <8737cpo7st.fsf@users.sourceforge.net> 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:132222 Archived-At: On 2017-05-01, at 00:21, npostavs@users.sourceforge.net wrote: > Stefan Monnier writes: > >> This suggests that the first arg is not "evaluated by the macro itself >> at compile time", but instead is passed unevaluated to `insert`, in >> which case it can't be instrumented. > > Oh, I see, this patch works, although it surprised me a bit to start > stepping immediately when doing the C-u C-M-x. > > --- i/test/lisp/emacs-lisp/lisp-tests.el > +++ w/test/lisp/emacs-lisp/lisp-tests.el > @@ -320,12 +320,10 @@ elisp-tests-with-temp-buffer > of the form =!NAME= in CONTENTS are removed, and a for each one a > variable called NAME is bound to the position of the word's > start." > - (declare (indent 1) (debug (form body))) > + (declare (indent 1) (debug (def-form body))) > (let* ((var-pos nil) > (text (with-temp-buffer > - (insert (cond ((symbolp contents) > - (symbol-value contents)) > - (t contents))) > + (insert (eval contents)) > (goto-char (point-min)) > (while (re-search-forward elisp-test-point-position-regex nil t) > (push (list (intern (match-string-no-properties 1)) Hi Stefan and Noam, I finally analyzed Noam's code, and the very same thing occurred to me: that using `(eval contents)' would both be more reasonable (after all, CONTENTS might be neither a symbol nor a string, but some expression!) and at the same time consistent with Noam's rewording of the docstring. Thanks! I'm in a train now, and with limited access to the internet, so I'll get back to this thread (and push the branch after clean-up - I guess I'll have to delete the current branch first, right?) soon. It's good that the Emacs manuals are available offline - I'll read about arguments to `debug' now. ;-) Best, -- Marcin Borkowski