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?K=C3=A9vin_Le_Gouguec?= Newsgroups: gmane.emacs.devel Subject: Re: emacs-30 f0daa2f2153: Conservative heuristic for tree-sitter parser ranges (bug#73324) Date: Sun, 22 Sep 2024 23:23:06 +0200 Message-ID: <87tte7mlhh.fsf@gmail.com> References: <172663360099.23732.9998257239822693024@vcs2.savannah.gnu.org> <20240918042641.56C7BC410E2@vcs2.savannah.gnu.org> <87v7yt322l.fsf@yahoo.com> <87y13kz1ji.fsf@yahoo.com> <4A9D96DA-C260-46B6-A3BC-E2F4A9E5C8E2@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30122"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Po Lu , Stefan Kangas , emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 22 23:24:17 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 1ssU41-0007hQ-RB for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Sep 2024 23:24:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssU31-000126-PG; Sun, 22 Sep 2024 17:23:15 -0400 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 1ssU2z-00011a-5x for emacs-devel@gnu.org; Sun, 22 Sep 2024 17:23:13 -0400 Original-Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssU2x-0003I0-AN for emacs-devel@gnu.org; Sun, 22 Sep 2024 17:23:12 -0400 Original-Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42cb0d0311fso4871845e9.1 for ; Sun, 22 Sep 2024 14:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727040189; x=1727644989; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nVkyHRrUCCaoDJLtW2PI+bWJJeSYE9hXXp/EGjUqdJA=; b=GUH5h7O8ovoqL4YG7FuZPIZ3smY5yQUXTZ1El8ldkyWNk9Q6yqxSOcpHjKoZH8+Bgz 6T9k6gcA8W/jrQhPnSg5l7w7Zb/ol+6dt7kzMzz5RL7g2FlKY1I5eSEeflryPuxmKYQV 92bMRytUFCwL3FfDOcZ0CVsFGf3HJAm+Yn4gLQ2z/N5ABWAjxAWfv/qKEoKhhRUUjit3 Lkbeza1r42kl+2Kj+Z57GRLIooiE0ZZJ+wCWQ0ZJLIpCAy/gH78/FA987jLJPToUYwuI IpYnLXJSPy+lFvbM/w9CAXbtg9bY9o+kx5Ge1umi3F8oUv5+lSI2sUddopvBIG/UOC8k pyGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727040189; x=1727644989; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nVkyHRrUCCaoDJLtW2PI+bWJJeSYE9hXXp/EGjUqdJA=; b=GYML2wc9AYbSKJyrz7wd/uEAUcod/1SEpAPXolEBuNr8QvDGiYaKEaGVqbxiy5Jr2x NKJwzpZkHY2GzgS7v7ISL9PM/z4zAo9SGtGC1J/9krh0KGa752dW2oFj2UcfL7nAckk/ EL+fieeBW8T28KisDIBi2D7eGGcAr7Joh0PxS4n3eHbyPaynDx+WiHlzDyeeth6LhQyD 9aMhdXjKqSOdIL/jK5l1saQtzJM43yLCrtcY10XLA9kX33ZKXI3dPgwgwVpSNW1lKqgA 0cchJ7f1U4TRkVqt4ln6CA8rQsY+MHy6sfuP1BLxpsJNbAOplbWJRZzrhUvpMy4KbHdE RmfA== X-Forwarded-Encrypted: i=1; AJvYcCX8FmbDmUQe5nR0co7KnfC7CpxwJQtoBwNmkMPYTTQo3aJQc8minpJ0cVUstk+/57SUYTQqI+aRMaBKyg==@gnu.org X-Gm-Message-State: AOJu0Yz+UQ5esi3RqcmAj7tousR8ebeH9IAYsQv0sMG8Iu8ZwO8qGMDP 0C2/+imST2cBUre6ByFe18176ht7A2yKkcSLkno1fWRPT+IYarY/3nBj/ZFD X-Google-Smtp-Source: AGHT+IFUuyjtlrs8VPAA9o9/XT4BAcCXOmNG5mh0SOX9hACg3ZYI8uujnjtjVvRgKCWprmzlhU0Y8Q== X-Received: by 2002:a05:6000:1a8b:b0:374:c796:4c3e with SMTP id ffacd0b85a97d-37a41fdc35amr2470749f8f.0.1727040188797; Sun, 22 Sep 2024 14:23:08 -0700 (PDT) Original-Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e7543b999sm109777875e9.18.2024.09.22.14.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Sep 2024 14:23:07 -0700 (PDT) In-Reply-To: <4A9D96DA-C260-46B6-A3BC-E2F4A9E5C8E2@gmail.com> (Yuan Fu's message of "Sat, 21 Sep 2024 23:44:38 -0700") Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=kevin.legouguec@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:323937 Archived-At: Yuan Fu writes: >> On Sep 21, 2024, at 10:43=E2=80=AFPM, Po Lu wrote: >>=20 >> Stefan Kangas writes: >>=20 >>>> Please fill ChangeLog entries in commit messages to a width of 64 >>>> columns, not 71 or 72, as here. >>>=20 >>> I don't want to get into another argument about this, but I don't see >>> any problem with the above formatting, FWIW. >>>=20 >>> In any case, I really don't think it is a good use of our time to police >>=20 >> It is a good (and a exceedingly slight) use of my time. >>=20 >>> the recently introduced default of 64 columns here. We never did that >>> before, when the default in `vc-git-log-edit-mode' was 70 characters, >>> and there is no reason to start doing it now. >>=20 >> That point is moot when most of us were self-consciously observing this >> standard before it was formalized in .dir-locals.el. > > I took a look and it=E2=80=99s set for log-edit-mode only. It would be ni= ce if magit can pick it up. I=E2=80=99m sure a lot of people (me included) = use magit for developing Emacs. The only problem is magit=E2=80=99s commit = message editing buffer doesn=E2=80=99t have a special major mode. It does g= it-commit-mode which is a minor mode, and runs git-commit-setup-hook. But I= =E2=80=99m not sure how to edit dir-locals to set fill-column using a hook = or minor mode. Kludge from my personal config reproduced below=C2=B9, if it can help. It adds a function to git-commit-setup-hook that sets fill-column when it detects that one of the remotes is Emacs's Savannah repo. Thinking more about it, and considering the existence of the git-commit-major-mode variable, I guess one could also 1) define a major mode derived from text-mode in their personal config; 2) add a .dir-locals-2.el file to their Emacs checkout that sets git-commit-major-mode to that-new-mode, and fill-column to *checks config* 63 *checks discussion* ^W64 *ponders git-blaming to see what Past Self has to say for himself* *looks at the time* *you're off the hook, Past Self* for that-new-mode. Thinking *more* about it, setting git-commit-major-mode to log-edit-mode in .dir-locals-2.el sounds like TRT in theory; in practice though I bet it would lead to "interesting" fireworks=C2=B2. =C2=B9 ``` (defun my/git-upstreams () ;; TODO: memoize, perhaps? (seq-uniq (seq-keep (lambda (remote-desc) (and (string-match "\\`.*\t\\(.*\\) (fetch)\\'" remote-desc) (match-string 1 remote-desc))) (process-lines "git" "remote" "-v")))) (defun my/emacs-repo-p (upstreams) "Guess whether we are working in the Emacs repository. UPSTREAMS is a list of fetch URLs." (member "https://git.savannah.gnu.org/git/emacs.git" upstreams)) (defvar my/git-commit-fill-columns '((my/emacs-repo-p . 63))) (cl-defun my/git-commit-maybe-set-fill-column () (let ((remotes (my/git-upstreams))) (pcase-dolist (`(,pred . ,column) my/git-commit-fill-columns) (when (funcall pred remotes) (cl-return-from my/git-commit-maybe-set-fill-column (setq fill-column column)))))) (add-hook 'git-commit-setup-hook 'my/git-commit-maybe-set-fill-column) ``` =C2=B2 Off the top of my head: * bindings conflicting, e.g. log-edit-done vs with-editor-finish: guessing the minor mode wins in that case=E2=80=A6 =F0=9F=AB=A3 * log-edit-generate-changelog-from-diff being ineffectual because log-edit-diff-function is not set up: something to kludge around, though Magit does also provide magit-commit-add-log from the diff buffer =F0=9F=A4= =B7