unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: joaotavora@gmail.com (João Távora)
To: Noam Postavsky <npostavs@gmail.com>
Cc: Alan Mackenzie <acm@muc.de>,
	Tino Calancha <tino.calancha@gmail.com>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: Finding macro-generated ert test definitions
Date: Wed, 23 May 2018 01:52:28 +0100	[thread overview]
Message-ID: <877envmbw3.fsf@gmail.com> (raw)
In-Reply-To: <CAM-tV-_YAbjvtfRtemvwfjiLZOBkqqsPXLCXXWx5kV4D0d+CdQ@mail.gmail.com> (Noam Postavsky's message of "Tue, 22 May 2018 18:55:27 -0400")

Noam Postavsky <npostavs@gmail.com> writes:

> On 22 May 2018 at 15:21, João Távora <joaotavora@gmail.com> wrote:
>
>> 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 <symbol> ...)".
  ;; 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ão, wondering where in bytecomp.el this could be hooked up...



  reply	other threads:[~2018-05-23  0:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 22:55 Finding macro-generated ert test definitions (WAS: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings.) Noam Postavsky
2018-05-23  0:52 ` João Távora [this message]
2018-05-23 14:54 ` Eli Zaretskii
2018-05-23 22:40   ` Noam Postavsky
2018-05-24 16:41     ` Eli Zaretskii
2018-05-24 16:50       ` Finding macro-generated ert test definitions João Távora
2018-05-24 22:34         ` Noam Postavsky
2018-05-24 23:00           ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877envmbw3.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=npostavs@gmail.com \
    --cc=tino.calancha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).