unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Patch upstream Git for Elisp diff hunk headings
@ 2021-02-11 14:42 Protesilaos Stavrou
  2021-02-11 18:27 ` Adam Spiers
  0 siblings, 1 reply; 8+ messages in thread
From: Protesilaos Stavrou @ 2021-02-11 14:42 UTC (permalink / raw)
  To: emacs-devel; +Cc: Adam Spiers

Dear members,

Myself and Adam Spiers (in cc) have been discussing the possibility of
patching Git so that it can handle Emacs Lisp diff hunk headings
natively.  Those headings consist of the text that follows the line
ranges that diff outputs.  So this:

  @@ -389,7 +390,7 @@ HEADING HERE

Git produces those headings using language-specific regular expressions.
Elisp is not covered.  Users must thus define their own Git attributes.
Not doing so results in practically useless text for the heading; text
that does not provide an accurate sense of context.

I have noticed that Emacs' git repo includes the file ".gitattributes"
which instructs diffs inside of that repo to use an Elisp-aware regexp
present in "autogen.sh":

  git_config diff.elisp.xfuncname \
             '^\([^[:space:]]*def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'

This is an improvement over the out-of-the-box Git experience.

Now the questions to this list:

1. What do you think about only targeting top-level forms?

2. How about the comments that are interpreted by outline-minor-mode as
   headings?  So the three or more ";;;" at the beginning of a line.
   Would it not be right to match those as well, since they are supposed
   to be 'headings' in Elisp source code?

Thank you in advance!
Protesilaos or "Prot"

-- 
Protesilaos Stavrou
protesilaos.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-02-13 19:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11 14:42 Patch upstream Git for Elisp diff hunk headings Protesilaos Stavrou
2021-02-11 18:27 ` Adam Spiers
2021-02-11 19:05   ` Stefan Kangas
2021-02-12 17:39     ` Basil L. Contovounesios
2021-02-11 19:13   ` Clément Pit-Claudel
2021-02-11 19:15   ` Óscar Fuentes
2021-02-11 19:38   ` Stefan Monnier
2021-02-13 19:35     ` Adam Spiers

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).