From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Johann_Kl=C3=A4hn?= Newsgroups: gmane.emacs.devel Subject: Re: [NonGNU ELPA] New package: eldoc-diffstat Date: Sat, 14 Dec 2024 22:37:20 +0100 Message-ID: <87cyhuaqun.fsf@jklaehn.de> References: <87y10osimb.fsf@jklaehn.de> <87r06b72oe.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21931"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Tassilo Horn , emacs-devel@gnu.org, Philip Kaludercic To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 15 06:43:20 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tMhPT-0005ZT-HD for ged-emacs-devel@m.gmane-mx.org; Sun, 15 Dec 2024 06:43:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMhOi-0003J2-K2; Sun, 15 Dec 2024 00:42:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMZpQ-0002dO-6h for emacs-devel@gnu.org; Sat, 14 Dec 2024 16:37:36 -0500 Original-Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMZpM-000309-6O; Sat, 14 Dec 2024 16:37:35 -0500 Original-Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 3301A138349A; Sat, 14 Dec 2024 16:37:29 -0500 (EST) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Sat, 14 Dec 2024 16:37:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jklaehn.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1734212249; x=1734298649; bh=3hIuqCPbWd BcGr2WV/f854upP5cjVhl3SpyE1kzFfSI=; b=iGrctF2mzLGmyKe7h/MPzs1g+W 6ez5ospm5aR9rJDfXsNoY09Srr662XkDbO1MDsMFIYix1haU/3Q15JjSSaVe00kc VKRdoT6IGlDFvO0QMQs63wORL+6ZhXvSjTZkBnJ25Nx+f8BMmoweI0X1dUJNOZiP lVjURfsh81kmxuEmed9vTxlrnhXr81ISe/ZmhY0PryGL2IXx7shL1fa4pDYC67jf s79asQCQPRqsfB6X6t8ZFyqbqdLMGFibap+sRYMNoJvZSOMopcx2D7oEA7sy/Mm8 unOoV+lP0XRFIEM+WPVNC/i2w629I8cXj0cALBjqhKoPmLWtcBVn2VdHt6ZA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1734212249; x=1734298649; bh=3hIuqCPbWdBcGr2WV/f854upP5cjVhl3Spy E1kzFfSI=; b=qAt5IzxwAlINo/Jd0YffMXoWI429gc+rvCPce1lvejuSZNnPy9p 6uxDE1VBm4i+vGlfwYVnogaEtY5pjlk48W4iiSR8BPQYRGtOgRx6X/O0e4oPYtaF 4vnT76lH7VKEhjeTxmBGABYLQNU/yQz1vLXcc8cWmi3+QMuhUREva0AGVzeNidy6 0Z/exKc7E3mYAsMZDuWQJo9l+t35dMOb33rcBk30saovPXfk+5ELy/bcW/4qA8H8 /WnUP0DPh6BNYQR1gpxldRrVORwtj803HJ+3cglWmOFeLLMJItwa7T94j2hJXLfc XaE7zy1nArCBov/IDEi9NRrb29EflgoaP8g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeelgdduhedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefujghffffkgggtsehttdertddttdejnecu hfhrohhmpeflohhhrghnnhcumfhlmohhnhcuoehjohhhrghnnhesjhhklhgrvghhnhdrug gvqeenucggtffrrghtthgvrhhnpefghfetfffhgfffudekffeuudeitdetffetlefggfff teelheehveelvdfffedvvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehjohhhrghnnhesjhhklhgrvghhnhdruggvpdhnsggprhgtphhtthho peegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehsthgvfhgrnhhkrghnghgrsh esghhmrghilhdrtghomhdprhgtphhtthhopehtshguhhesghhnuhdrohhrghdprhgtphht thhopegvmhgrtghsqdguvghvvghlsehgnhhurdhorhhgpdhrtghpthhtohepphhhihhlih hpkhesphhoshhtvghordhnvght X-ME-Proxy: Feedback-ID: iae1440ff:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 14 Dec 2024 16:37:28 -0500 (EST) In-Reply-To: (Stefan Kangas's message of "Sat, 14 Dec 2024 13:24:29 +0000") Received-SPF: pass client-ip=103.168.172.151; envelope-from=johann@jklaehn.de; helo=fout-a8-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 15 Dec 2024 00:42:28 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326514 Archived-At: 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.