From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: Re: Finding macro-generated ert test definitions Date: Wed, 23 May 2018 01:52:28 +0100 Message-ID: <877envmbw3.fsf@gmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1527036635 31386 195.159.176.226 (23 May 2018 00:50:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 May 2018 00:50:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: Alan Mackenzie , Tino Calancha , Emacs developers To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 23 02:50:30 2018 Return-path: Envelope-to: ged-emacs-devel@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 1fLHz4-00084p-IW for ged-emacs-devel@m.gmane.org; Wed, 23 May 2018 02:50:30 +0200 Original-Received: from localhost ([::1]:58647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLI1B-00057C-Oa for ged-emacs-devel@m.gmane.org; Tue, 22 May 2018 20:52:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLI15-00056w-5S for emacs-devel@gnu.org; Tue, 22 May 2018 20:52:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLI11-0000BB-Vw for emacs-devel@gnu.org; Tue, 22 May 2018 20:52:35 -0400 Original-Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]:45682) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fLI11-0000Af-OI for emacs-devel@gnu.org; Tue, 22 May 2018 20:52:31 -0400 Original-Received: by mail-wr0-x229.google.com with SMTP id w3-v6so15569874wrl.12 for ; Tue, 22 May 2018 17:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=FPm9n3I9SDTQINgUt6gM+0V58SN+S+butTc9AqOQjw4=; b=N+XEdgKIAMFCwBfHj1BGetNAWSPgBqA9EMKdhR+Qw4VaWBxzomKIak3/JnjVWO2VCQ RHmegVuYaOc01lYS0IxcXlTY9HmhqbxbTjdryNiksXJ9L+ZtmLsokCRuBGnnuJVonK5H 2ijn0kqdIiVYgqoHFIkfenEdly4eGM28HRm881qiMDrtm7BcCFHtNNGl34xSSsQDz2v4 j3LIkVUgz/fy0drcW/tMTMMEk+AlvHR8KzJL3QGYU0nysbP2+KX0IW5t8iMwTDnhiP3V 8k5ERPMpwrAe4kqYGqLstHNgaakQ0Qxroxd9NlNGVlFMqqjys9hlLEu+QM1EYM7OeUb4 oqBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=FPm9n3I9SDTQINgUt6gM+0V58SN+S+butTc9AqOQjw4=; b=Ac5PhCMgW/TiKyhdtiIsBfWLUMg8gcszN8ibBiwrFsQSztDK4zEGejwz5VDIinvjnR YlMwznRxe7J/6MbVpehUMkb0itPbAwuyK9dPNbVTvnIpFKan/7nB48/+QhJO+4yhhIGW YL8nCh0EuecYBJ5ciNslfp41ib+bF83LQCkIlErTfl5kZYVYXAdqaesCLuaMDJ6WJflk CwAXmeZ3Q6Z8PRR/R+q7zJoMzKw3dkrogAI07NrJaYsCz2GI5R9/aUSXibM6MyuvbuJp 4eZm5slirkXaD3PDvyT5bGmjXwyuiSlD5qWkUp+aQ0Q8kvtP7Wyt74fpbqbLtTRvt1v4 Hyzw== X-Gm-Message-State: ALKqPwdvBc0ChXc8UbUwftf7TiO9kn4wul8F+1sw4hqUYt79eUBKu3SQ sLM6HRMV2IzYlcQrMH4TYjk= X-Google-Smtp-Source: AB8JxZplUHIuxqmkXiBSWeiVTzCw1K+Qe7BC1ItqKTUaSxnzq1F91pc/pwoGSSqUL/XZhbEsX0p8mg== X-Received: by 2002:adf:8212:: with SMTP id 18-v6mr452219wrb.144.1527036750287; Tue, 22 May 2018 17:52:30 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id 12-v6sm1884527wmn.27.2018.05.22.17.52.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 May 2018 17:52:29 -0700 (PDT) In-Reply-To: (Noam Postavsky's message of "Tue, 22 May 2018 18:55:27 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225582 Archived-At: Noam Postavsky writes: > On 22 May 2018 at 15:21, Jo=C3=A3o T=C3=A1vora wro= te: > >> Also M-x ert-find-test-other-window could have helped you, but it >> doesn't (brings me to the beginning of the file, which isn't helpful). I >> don't know why, does anyone? > > It works by searching the source file for "(ert-deftest TEST-NAME", > but in this case TEST-NAME doesn't occur in the source, it's produced > at compile time by the define-electric-pair-test macro. > > See ert--find-test-regexp and find-function-search-for-symbol. > Oh. I naively thought that the byte-compiler was providing positional hints to f-f-s-for-symbol, but it's just a text search: from find-function-search-for-symbol: ;; `regexp' matches definitions using known forms like ;; `defun', or `defvar'. But some functions/variables ;; are defined using special macros (or functions), so ;; if `regexp' can't find the definition, we look for ;; something of the form "(SOMETHING ...)". ;; This fails to distinguish function definitions from ;; variable declarations (or even uses thereof), but is ;; a good pragmatic fallback. (Had me fooled until now, so I guess it's not so bad) Jo=C3=A3o, wondering where in bytecomp.el this could be hooked up...