unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Exploring a code base?
Date: Sat, 07 Nov 2020 16:47:46 +0200	[thread overview]
Message-ID: <837dqx6x65.fsf@gnu.org> (raw)
In-Reply-To: <alpine.NEB.2.22.394.2011071522180453.11418@sdf.lonestar.org> (message from Gregory Heytings on Sat, 07 Nov 2020 14:33:25 +0000)

> Date: Sat, 07 Nov 2020 14:33:25 +0000
> From: Gregory Heytings <ghe@sdf.org>
> cc: help-gnu-emacs@gnu.org
> 
> > Basically, I'm asking why having a flat list of all the users of a data 
> > type, and reading the code of all of them, is not enough for this kind 
> > of job?  What am I missing?
> 
> IIUC, Yuri, Stefan and Dmitry all described the same problem, each with 
> their own words

I've read the entire thread, thank you.

>                 using M-. and M-? works fine for simple tasks (say, 
> change the name of a given function or struct field in a codebase, or see 
> where a given type is used), but when you are tackling a more complex task 
> you often have to put searches on a kind of "stack", on which you can save 
> your current search state, and from which you can resume your current 
> search at a later stage. Say, you are making changes to the occurrences of 
> "foo", and at some point during that work you see that you need to change 
> something around the occurrences of "bar", and at some point during that 
> work you see that you need to change the occurrences of "baz", and so 
> forth.

When that happens, it means you should change the search criteria.
For example, if you looked for a variable, but found that more than
one variable is involved, you need to search for the data type (if all
the variables use the same data type), or search for several
identifiers instead of just one.  the tools mentioned all support such
multiple searches, so I still don't think I understand the problem.

I used this technique in some pretty complex projects (as in: about 1
million code lines of sophisticated C++), and it scaled well.

As for discovering that a problem includes more places and symbols
than one originally envisioned: one can maintain a flat list of
functions/modules/whatever to look into, and add to that as more stuff
is being found.  You can do it in Org or even in a simple text buffer.
If there's really a need to maintain some structure, one can use Org's
level headings to that end.

Bottom line: I still don't see the problem, and my question above
still stands.



  reply	other threads:[~2020-11-07 14:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 11:38 Exploring a code base? Yuri Khan
2020-10-27 11:58 ` Christopher Dimech
2020-10-27 14:15 ` Stefan Monnier
2020-10-27 15:55 ` Drew Adams
2020-10-27 20:56 ` Dmitry Gutov
2020-11-07 13:26   ` Yuri Khan
2020-11-07 13:56     ` Eli Zaretskii
2020-11-07 14:33       ` Gregory Heytings via Users list for the GNU Emacs text editor
2020-11-07 14:47         ` Eli Zaretskii [this message]
2020-11-07 15:32           ` Gregory Heytings via Users list for the GNU Emacs text editor
2020-11-07 15:52             ` Stefan Monnier
2020-11-07 15:58               ` Eli Zaretskii
2020-11-07 17:24                 ` Eric Abrahamsen
2020-11-07 19:23               ` Dmitry Gutov
2020-11-07 19:40     ` Dmitry Gutov
2020-10-27 20:59 ` Perry Smith
2020-10-27 22:53 ` Daniel Martín
2020-10-27 23:15   ` Stefan Monnier
2020-10-28  0:59 ` Skip Montanaro

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=837dqx6x65.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).