unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Johann Klähn" <johann@jklaehn.de>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: Tassilo Horn <tsdh@gnu.org>,
	 emacs-devel@gnu.org,  Philip Kaludercic <philipk@posteo.net>
Subject: Re: [NonGNU ELPA] New package: eldoc-diffstat
Date: Sat, 14 Dec 2024 22:37:20 +0100	[thread overview]
Message-ID: <87cyhuaqun.fsf@jklaehn.de> (raw)
In-Reply-To: <CADwFkmmDSPoOPMN6ywR=OyPjr6KX3nAHxs9jwyV49xi5oAhf=A@mail.gmail.com> (Stefan Kangas's message of "Sat, 14 Dec 2024 13:24:29 +0000")


Thanks for your comments, everyone!


On Fri, Dec 13, 2024 at 21:23 +0100, Tassilo Horn wrote:
> I'm using it since a couple of days using package-vc and like it very
> much, so I took the liberty to add it to NonGNU ELPA.

Thanks!

> I think you could add a bit more configuration hints to the README.md,

I instead added the globalized minor mode proposed by Stefan, WDYT?


On Sat, Dec 14, 2024 at 13:24 +0000, Stefan Kangas wrote:
> Thanks, this seems pretty useful.  I can see myself wanting to have it
> on sometimes, but not always, so I'd appreciate it being a minor mode
> that I could toggle, instead of just a function.

Good idea, I added a minor mode plus the globalized minor mode you
suggested further below.

> When the mode is toggled on, it could detect automatically that it's in
> a magit buffer, and do the `eldoc-add-command` setup for users
> automatically.

I decided to unconditionally add these commands when the package is
loaded, since this (a) only has to be run once and (b) does not have an
effect unless eldoc is used in a magit buffer.  And in the latter case
the user will likely want these as triggers anyways.

> - An option to use a maximum (or fixed) number of lines

Now done, though eldoc by default strips trailing whitespace so echoing
a fixed number of lines required a kludge.  (But some people may prefer
the effect that the echo area size does not change between commits.)

> - Caching the results for the current buffer to get instant results

Do you mean eagerly compute diffstat?  Or just remember it indefinitely
after the first lookup of a commit?


On Sat, Dec 14, 2024 at 10:11 +0000, Philip Kaludercic wrote:
>    '((Git "git" "--no-pager" "show" "--color=always"
> -         "--format=format:%an <%ae>, %aD:%n%s" "--stat=80")
> +	 "--format=format:%an <%ae>, %aD:%n%s" "--stat=80")

Some lines look like spurious whitespace changes?  I hope I picked out
all functional changes.

> +  ;; Is it an issue that there is the slight possibility of a race
> +  ;; condition here?

I happened to have the same thought yesterday, also w.r.t. the
sentinel function.

>                                         The rewriting of
> `eldoc-diffstat--format-output-buffer' might be controversial, but I
> feel that using a regular expression to destruct the buffer feels more
> robust.

Yes, probably.  Though I decided to keep the original output if the
regex fails to match, as it might help users figure out what's happening.



  reply	other threads:[~2024-12-14 21:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 20:31 [NonGNU ELPA] New package: eldoc-diffstat Johann Klähn
2024-12-13 20:23 ` Tassilo Horn
2024-12-14 13:24   ` Stefan Kangas
2024-12-14 21:37     ` Johann Klähn [this message]
2024-12-15  0:38       ` Stefan Kangas
2024-12-15 10:11       ` Philip Kaludercic
2024-12-14 10:11 ` Philip Kaludercic

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=87cyhuaqun.fsf@jklaehn.de \
    --to=johann@jklaehn.de \
    --cc=emacs-devel@gnu.org \
    --cc=philipk@posteo.net \
    --cc=stefankangas@gmail.com \
    --cc=tsdh@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.
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).