From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 25 03:11:07 2024 Received: (at submit) by debbugs.gnu.org; 25 Dec 2024 08:11:07 +0000 Received: from localhost ([127.0.0.1]:36051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQMTy-0005qr-O6 for submit@debbugs.gnu.org; Wed, 25 Dec 2024 03:11:07 -0500 Received: from lists.gnu.org ([209.51.188.17]:47684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQMTp-0005ps-Kp for submit@debbugs.gnu.org; Wed, 25 Dec 2024 03:10:58 -0500 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 1tQMTo-0008Km-N1 for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 03:10:57 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQMTn-00033e-4C for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 03:10:56 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id DB4F9240002 for ; Wed, 25 Dec 2024 08:10:52 +0000 (UTC) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: Default parser for treesit-explore Organization: LINKOV.NET X-Debbugs-Cc: Yuan Fu Date: Wed, 25 Dec 2024 09:56:20 +0200 Message-ID: <87zfkk191f.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=217.70.183.193; envelope-from=juri@linkov.net; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --=-=-= Content-Type: text/plain Currently loading the desktop is disrupted by the prompt that asks for a parser name when treesit-explore-mode was enabled in a buffer before. The second part of the following patch fixes this by omitting treesit-explore-mode. But anyway it's very tedious to select the single parser every time when enabling treesit-explore-mode. So the first part of this patch avoids this unnecessary selection: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=treesit-explorer-switch-parser.patch diff --git a/lisp/treesit.el b/lisp/treesit.el index 464b7e688be..5428e84fa5a 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -3911,8 +3911,10 @@ treesit-explorer-switch-parser (interactive (list (let* ((parser-alist (treesit--explorer-generate-parser-alist)) - (parser-name (completing-read - "Parser: " (mapcar #'car parser-alist)))) + (parser-name (if (= (length parser-alist) 1) + (car parser-alist) + (completing-read + "Parser: " (mapcar #'car parser-alist))))) (alist-get parser-name parser-alist nil nil #'equal)))) (unless treesit-explore-mode @@ -3952,7 +3954,13 @@ treesit-explore-mode (unless (memq 'treesit--explorer-tree-mode desktop-modes-not-to-save) (push 'treesit--explorer-tree-mode - desktop-modes-not-to-save)))) + desktop-modes-not-to-save))) + ;; Tell `desktop-save' to not save minor mode. + (when (boundp 'desktop-minor-mode-table) + (unless (member '(treesit-explore-mode nil) + desktop-minor-mode-table) + (push '(treesit-explore-mode nil) + desktop-minor-mode-table)))) ;; Turn off explore mode. (remove-hook 'post-command-hook #'treesit--explorer-post-command t) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 25 03:38:20 2024 Received: (at 75079) by debbugs.gnu.org; 25 Dec 2024 08:38:20 +0000 Received: from localhost ([127.0.0.1]:36134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQMuJ-0007ID-UZ for submit@debbugs.gnu.org; Wed, 25 Dec 2024 03:38:20 -0500 Received: from mail-pl1-f182.google.com ([209.85.214.182]:48213) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQMuG-0007Hw-7y for 75079@debbugs.gnu.org; Wed, 25 Dec 2024 03:38:18 -0500 Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-216281bc30fso72183655ad.0 for <75079@debbugs.gnu.org>; Wed, 25 Dec 2024 00:38:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735115831; x=1735720631; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2/mTWWoaeXTRtTauVwh4U1zZrvCg1gbcBXDpWj+gsjo=; b=babDL33ponwZR/rsHWAejwqanxuQdYI6MQJumMYfZX7hBBKOrkljToDnpxoLpk5XN7 Y8HmgBOgaCd3liotistvU7f3RXAj+14VVsTJNdIE3Joa5abhDb+GwwTK9iY38QVCxv2P BoWsugjLE3cU4eMQDSWZDsXFFDkQwMn0yWQBRWb2jb0IwBxsSRrVriwwCaQIQpDLDm06 dcSNxVhv3HrHBk28QpznWflj0MWQCb/GBvog4+nLHn9/63AwZM2x8ydm2XjfbRCwb1qj nufoQ5MMmXhA7RcgIg+IosBU6znNWTf+Yo4FmGH2FGV8PClb7akotjVrWMpVekIJQEtV LqAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735115831; x=1735720631; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2/mTWWoaeXTRtTauVwh4U1zZrvCg1gbcBXDpWj+gsjo=; b=fZIp4EWHnAK8rztT6wSX9nCFkHJCCb3E2a3lLoJudKQiS64EBPu9ToT6XnAoEVv1uE l+shZZwmBKYQavlmaKN0iQBZiad0T521iIabpd0haZheognsYrm1QrP1Bz+6PZcuv5w8 q32BMEukvXheNB9sTswZ539XityVkRzkU4Nrm6ACGNieakwbI+Ajt6x/kWksJe9FH4D+ AwLnKnGqyBXJYAJ+1DcsxpR95yRcuNacaQXDLZWOkxb+TfGEbSUn5y8TCkxsD0mBpZ9w KKmlAhztu3U3CCJfnZQXCVmP/U7A/xYjOeBdjdAsTWmhoqjNFkreR0jI71FA46Oa88DI DgSw== X-Gm-Message-State: AOJu0YyB/1mz4gU/FarhBMz0MT9sbfXyCgoXvYVkVSt8j4+EtI4137ds bEiAK1vY2/BwdHcBnzzdrqlQFuJo3/AlbzL4auqQuQfr/C9kEEf2FPEZA7M2 X-Gm-Gg: ASbGnct4zdB9QC+IxQaNFAqiZSiqocqBLVH3FbNNe/yylFk/GkowPBjWqMi+8/3q8wE 9nfCnsf/qA0iR7VYAXzexCywmv41zc6PmfdzsYdzQlKXOXV1DNNQCC4z+YBaGSYW5DZKLoQDmTc Mi9C7OdnDkDbfAt/gL3P62iNGVy2yhuGAmeCKgQjFwznh+QERneNpGGj/NR9Ma8IeeQ3xJYr8gO IipYFR5ZZ0pruiHp8BJP9kNSIHh5k5fIa3SiZWrJW+ayxlQ3KCOjFj+R8mCq1YeaerVEc6rJxY9 tBo= X-Google-Smtp-Source: AGHT+IE2mzZH5OnpwxRhkDB3/PQFZs0fX3GlGV3/lkVZU8dAvSgrYKgA5NSS9HFrdW8P31hehKbhSQ== X-Received: by 2002:a05:6a00:1a92:b0:725:e499:5b88 with SMTP id d2e1a72fcca58-72abdecb23fmr29529845b3a.25.1735115830493; Wed, 25 Dec 2024 00:37:10 -0800 (PST) Received: from smtpclient.apple ([2601:646:8f81:6120:e179:285e:283:33ae]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842b229ddc4sm8381810a12.29.2024.12.25.00.37.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Dec 2024 00:37:09 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: bug#75079: Default parser for treesit-explore From: Yuan Fu In-Reply-To: <87zfkk191f.fsf@mail.linkov.net> Date: Wed, 25 Dec 2024 00:36:58 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87zfkk191f.fsf@mail.linkov.net> To: Juri Linkov X-Mailer: Apple Mail (2.3776.700.51) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75079 Cc: 75079@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Dec 24, 2024, at 11:56=E2=80=AFPM, Juri Linkov = wrote: >=20 > Currently loading the desktop is disrupted by the prompt > that asks for a parser name when treesit-explore-mode > was enabled in a buffer before. The second part of the > following patch fixes this by omitting treesit-explore-mode. >=20 > But anyway it's very tedious to select the single parser > every time when enabling treesit-explore-mode. So the > first part of this patch avoids this unnecessary selection: >=20 > diff --git a/lisp/treesit.el b/lisp/treesit.el > index 464b7e688be..5428e84fa5a 100644 > --- a/lisp/treesit.el > +++ b/lisp/treesit.el > @@ -3911,8 +3911,10 @@ treesit-explorer-switch-parser > (interactive > (list (let* ((parser-alist > (treesit--explorer-generate-parser-alist)) > - (parser-name (completing-read > - "Parser: " (mapcar #'car = parser-alist)))) > + (parser-name (if (=3D (length parser-alist) 1) > + (car parser-alist) > + (completing-read > + "Parser: " (mapcar #'car = parser-alist))))) > (alist-get parser-name parser-alist > nil nil #'equal)))) > (unless treesit-explore-mode > @@ -3952,7 +3954,13 @@ treesit-explore-mode > (unless (memq 'treesit--explorer-tree-mode > desktop-modes-not-to-save) > (push 'treesit--explorer-tree-mode > - desktop-modes-not-to-save)))) > + desktop-modes-not-to-save))) > + ;; Tell `desktop-save' to not save minor mode. > + (when (boundp 'desktop-minor-mode-table) > + (unless (member '(treesit-explore-mode nil) > + desktop-minor-mode-table) > + (push '(treesit-explore-mode nil) > + desktop-minor-mode-table)))) > ;; Turn off explore mode. > (remove-hook 'post-command-hook > #'treesit--explorer-post-command t) Thanks Juri, have you applied the patch? If not, please feel free to do = :-) Yuan= From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 25 07:39:20 2024 Received: (at 75079) by debbugs.gnu.org; 25 Dec 2024 12:39:20 +0000 Received: from localhost ([127.0.0.1]:36463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQQfX-0001zh-Oi for submit@debbugs.gnu.org; Wed, 25 Dec 2024 07:39:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQQfU-0001zO-KZ for 75079@debbugs.gnu.org; Wed, 25 Dec 2024 07:39:18 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQQfO-0002OV-8f; Wed, 25 Dec 2024 07:39:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wn0zzccpinU3aHPe1i0Az4a1/G3LS5JUUffPS9ovf+0=; b=g2/JGmmOKo+u 4Dy3MRHJDitzETKd/m2B4f6remkhNql7K5HHU4Rk08oAT55v/R48/yTet9y6xkqouPceLRcimiqdw AlCdGDDUyvGnTYdCGd6vapjrsD2cMEwqkjKVBJ97mwEAKwI5ZjMrJkSpJNhy31H8fX5GpwsmZGeMz xj2hb2GV90F6+tOTKvlWXR2it4vT/hxwqKp55JPXas4D4roOw9Ob2yB2yZeTPwhF7rPnNE3GB5Vxm R9RlhKOC981NeDI7Q0X5M+LsY+x+RqBTdzJvcm1yHUrjro2UH+lvKlGvNNjldzb/jGVHrzyjVV7CO 335fgHyx6/nwfmWGMLq8Lw==; Date: Wed, 25 Dec 2024 14:39:05 +0200 Message-Id: <86h66s0weu.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <87zfkk191f.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 25 Dec 2024 09:56:20 +0200) Subject: Re: bug#75079: Default parser for treesit-explore References: <87zfkk191f.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75079 Cc: casouri@gmail.com, 75079@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Yuan Fu > From: Juri Linkov > Date: Wed, 25 Dec 2024 09:56:20 +0200 > > @@ -3952,7 +3954,13 @@ treesit-explore-mode > (unless (memq 'treesit--explorer-tree-mode > desktop-modes-not-to-save) > (push 'treesit--explorer-tree-mode > - desktop-modes-not-to-save)))) > + desktop-modes-not-to-save))) > + ;; Tell `desktop-save' to not save minor mode. > + (when (boundp 'desktop-minor-mode-table) > + (unless (member '(treesit-explore-mode nil) > + desktop-minor-mode-table) > + (push '(treesit-explore-mode nil) > + desktop-minor-mode-table)))) That comment should explain _why_ we don't want desktop-save to save this minor mode. Otherwise it just says what the code does, which is not hard to understand by looking at the code. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 25 12:55:57 2024 Received: (at 75079) by debbugs.gnu.org; 25 Dec 2024 17:55:57 +0000 Received: from localhost ([127.0.0.1]:38738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQVbw-00007X-UI for submit@debbugs.gnu.org; Wed, 25 Dec 2024 12:55:57 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:54263) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQVbu-00007E-V7; Wed, 25 Dec 2024 12:55:55 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 89E701BF204; Wed, 25 Dec 2024 17:55:47 +0000 (UTC) From: Juri Linkov To: Yuan Fu Subject: Re: bug#75079: Default parser for treesit-explore In-Reply-To: (Yuan Fu's message of "Wed, 25 Dec 2024 00:36:58 -0800") Organization: LINKOV.NET References: <87zfkk191f.fsf@mail.linkov.net> Date: Wed, 25 Dec 2024 19:54:38 +0200 Message-ID: <87ed1vy7fl.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 75079 Cc: 75079@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 75079 31.0.50 thanks >> On Dec 24, 2024, at 11:56 PM, Juri Linkov wrote: >> >> Currently loading the desktop is disrupted by the prompt >> that asks for a parser name when treesit-explore-mode >> was enabled in a buffer before. The second part of the >> following patch fixes this by omitting treesit-explore-mode. >> >> But anyway it's very tedious to select the single parser >> every time when enabling treesit-explore-mode. So the >> first part of this patch avoids this unnecessary selection: > > Thanks Juri, have you applied the patch? If not, please feel free to do :-) Now the patch is applied, after fulfilling Eli's request to extend the comments. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 25 15:09:54 2024 Received: (at 75079) by debbugs.gnu.org; 25 Dec 2024 20:09:55 +0000 Received: from localhost ([127.0.0.1]:38937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQXha-0006JK-Kx for submit@debbugs.gnu.org; Wed, 25 Dec 2024 15:09:54 -0500 Received: from mail-pl1-f174.google.com ([209.85.214.174]:56732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQXhX-0006J1-1R for 75079@debbugs.gnu.org; Wed, 25 Dec 2024 15:09:52 -0500 Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2166360285dso67091735ad.1 for <75079@debbugs.gnu.org>; Wed, 25 Dec 2024 12:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735157325; x=1735762125; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SE/0u8b3/PMM3DfxwdEC7NNABI1b7w1cEBX//YVUN0Y=; b=lAgsn1EqX/jM/0/6KCBORShZh0DIk9Ce+GYV9OoN9abUEqEJn6S6DvaEKaxKYEOzgS RwNHjXaPO513jfvMrYDJhlpgQqmyPgQmcxSV01vnkJmISf4Huvzbs8WukkFG4D0R+h6u EdumrnvsJJf7ylmjwfHoPLnxRpGqUXg2XmbnKuHd3jVVMqP/C/ElkWg9Ja00A7q27JvW EA2KCbReFY+fiXgLNFqhkb56w92io+upLg3Q9d5jzt284hVPDxcnDpV9V4ewwiYNMI4u LMhfxJ+Du9MP1oe+3IoRqzfUxNazVoIu3QbCZPVKQsM0TA4Z0YpuvToAO5AkPldIZ0G3 n6tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735157325; x=1735762125; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SE/0u8b3/PMM3DfxwdEC7NNABI1b7w1cEBX//YVUN0Y=; b=PBmS5ij1A13THNEHFWyLzgaPBLoRxXar8Gj/FJ+b5zwY/BCgf0wUssuCysPxXxlwxr bmGnSNszqFwaSn6Lnhcmr9BJcGH/Dj8HWrz7N7t7+AN0JejLWVERKn9rTWHTIFop+r11 GEjZ+9Mn1W2yNATHNzFDs1ozAHS26jzQrltmZ0saE1GM3LTbso486gHF00p1PxWwHkcU DbbQXFDMQEMMJ6JmstEUq9iwzp0x+g1ZzpYSJuGXW5EZbqzZqAHTv7tr8Y7R0Vu7lQc2 mEIO+xQjngK8rze8YoUZA5k8G9tJfTj6VeTqr3h29kieCduCsiNxK6ER7mVhl91v8nHn oC1g== X-Gm-Message-State: AOJu0YwP2ucm4l2LRD0crQl0/mjjWHVV12NaRSCkuUHATORDA5V2rpqP crTUiDybe2XXQxUGw4wdOS7aBv9SNZlp7ToA6uq7P7GZYphEM5d3 X-Gm-Gg: ASbGncswjLlNbhacAV9hg+/TXM9J+04Go20aeli/MmdvSCKNSl7Kq+PqQSH14o7h+6b Cx+qCZT23uxZF0/4YnzviRP67rMgwJDIFuA0ulB35tw9gvxe/lX3JIIteJPDoXKiPVz2j7B4GoN in9zEGkE34kg0/Lcqj1MZDx1W9AaNySorpHF3TnkUy3vaZxxyhBUuspAVK9c6izrfpPaHMLbCm+ TxYfhimnx/eyPpDQRstBhnJ4WptOsVEub9grCVf5eh5mKa0b9kFO+0Zb/q/JvomMrx5smx0turp /Ac= X-Google-Smtp-Source: AGHT+IFlc/0c1O2pzkZtbPB+bs969czWK1cv13bqIq4Wv8hrDaMd9GCBzd9q63xCL2ND27Yx3cNO4Q== X-Received: by 2002:a17:902:cf09:b0:216:7175:41bd with SMTP id d9443c01a7336-219e6f10aadmr320257555ad.39.1735157325069; Wed, 25 Dec 2024 12:08:45 -0800 (PST) Received: from smtpclient.apple ([2601:646:8f81:6120:e179:285e:283:33ae]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc9d462asm105666075ad.127.2024.12.25.12.08.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Dec 2024 12:08:44 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: bug#75079: Default parser for treesit-explore From: Yuan Fu In-Reply-To: <87ed1vy7fl.fsf@mail.linkov.net> Date: Wed, 25 Dec 2024 12:08:33 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <7E77A69F-1FCC-441A-82DE-E51F876B7251@gmail.com> References: <87zfkk191f.fsf@mail.linkov.net> <87ed1vy7fl.fsf@mail.linkov.net> To: Juri Linkov X-Mailer: Apple Mail (2.3776.700.51) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75079 Cc: 75079@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Dec 25, 2024, at 9:54=E2=80=AFAM, Juri Linkov = wrote: >=20 > close 75079 31.0.50 > thanks >=20 >>> On Dec 24, 2024, at 11:56=E2=80=AFPM, Juri Linkov = wrote: >>>=20 >>> Currently loading the desktop is disrupted by the prompt >>> that asks for a parser name when treesit-explore-mode >>> was enabled in a buffer before. The second part of the >>> following patch fixes this by omitting treesit-explore-mode. >>>=20 >>> But anyway it's very tedious to select the single parser >>> every time when enabling treesit-explore-mode. So the >>> first part of this patch avoids this unnecessary selection: >>=20 >> Thanks Juri, have you applied the patch? If not, please feel free to = do :-) >=20 > Now the patch is applied, after fulfilling Eli's request > to extend the comments.=20 Thank you! From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 23 02:41:37 2025 Received: (at 75079) by debbugs.gnu.org; 23 Jan 2025 07:41:37 +0000 Received: from localhost ([127.0.0.1]:38951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tarqL-0002ws-17 for submit@debbugs.gnu.org; Thu, 23 Jan 2025 02:41:37 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:37831) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tarqH-0002wV-J9 for 75079@debbugs.gnu.org; Thu, 23 Jan 2025 02:41:34 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 67A371C0004; Thu, 23 Jan 2025 07:41:26 +0000 (UTC) From: Juri Linkov To: 75079@debbugs.gnu.org Subject: Re: bug#75079: Window for treesit-explore In-Reply-To: <87zfkk191f.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 25 Dec 2024 09:56:20 +0200") Organization: LINKOV.NET References: <87zfkk191f.fsf@mail.linkov.net> Date: Thu, 23 Jan 2025 09:40:44 +0200 Message-ID: <87sepa9dvn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 75079 Cc: Yuan Fu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) BTW, wouldn't it be nicer to display the treesit-explore window below the current buffer, this would keep the user's window layout: diff --git a/lisp/treesit.el b/lisp/treesit.el index 8d86d142e3f..a22c335ae22 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -4122,7 +4224,8 @@ treesit-explorer-switch-parser (user-error "Not in `treesit-explore-mode'")) (setq-local treesit--explorer-parser parser) (display-buffer treesit--explorer-buffer - (cons nil '((inhibit-same-window . t)))) + '(display-buffer-below-selected + (inhibit-same-window . t))) (setq-local treesit--explorer-last-node nil) (treesit--explorer-refresh)) @@ -4176,7 +4279,9 @@ treesit-explore (interactive) (if (and treesit-explore-mode (buffer-live-p treesit--explorer-buffer)) - (display-buffer treesit--explorer-buffer '(nil (inhibit-same-window . t))) + (display-buffer treesit--explorer-buffer + '(display-buffer-below-selected + (inhibit-same-window . t))) (treesit-explore-mode))) From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 27 20:48:26 2025 Received: (at 75079) by debbugs.gnu.org; 28 Jan 2025 01:48:27 +0000 Received: from localhost ([127.0.0.1]:34983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tcaiI-00079G-J1 for submit@debbugs.gnu.org; Mon, 27 Jan 2025 20:48:26 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:51274) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tcaiF-000793-N2 for 75079@debbugs.gnu.org; Mon, 27 Jan 2025 20:48:24 -0500 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2ef70c7efa5so7066836a91.2 for <75079@debbugs.gnu.org>; Mon, 27 Jan 2025 17:48:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738028897; x=1738633697; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Ma0RBrPYEXezKh17Ovliay1tkRluUNeDdhPSGEN8q6Q=; b=jl62ED16tIz+WoVM0SeoXql8xtY8J6b3ELeJoNur0uPqElW8sevBvwOCFlWdTbjUsM lrR91im16V2s1XFlwB9rKIdLQx3C6iMf5y1fiiV6+PnpUioeFMTgOjmElwNWKWvHnIwt 3LN+ZxYm9p9x/DsUqowzEEZEZ1KIomquKtPMM4vTT9slCBRvG3XnkhvINqsJbugTmfgz X1oA9flkoAksyrPfm7yK5BYxs2+bir/45a9qnT20wEHKva8OQpDuAXXHlIyXCDgDMLHb hBOcC0wo5CJXOcCcwDWrHQFFCKzQ0dWhi6bu8lefzNIhLu9YGDIKzb2r8IXFGVcwEEqD bv4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738028897; x=1738633697; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ma0RBrPYEXezKh17Ovliay1tkRluUNeDdhPSGEN8q6Q=; b=QU4AUOvuEEZed8QRXocVrGBqxMPnARt0PzD9j6D0Va6WjfXQ7d1IFCjst36xh6YRYb /Vc8SQSphURp3gCMuuBTVf0ileOcmiFOEfFsI4N5u7A4X4vHfIwkkYYGGWfJEcofizMB ZGw9pTjXqWLgoRFEgRUbCeXRqfXyuzp2uv9bTzvawYXX/LEGYY0IXF0fK9cGJktPTzFm 9wjeozju1bteHwJsOvROZY9AudL0cM0m5JfV8Xkxaqhec72jojf/jzv1JAWllC+jMRCI j/A0r282KBdbdlMKgSBPDPNz0fx+B+kgY9llakUUflahCkMgN8HstebWux7ZzVE+MT80 bW6Q== X-Gm-Message-State: AOJu0YxLFss/b/TvlR2Y4BtUQWRVsi5zqeJk79DzUMasg2q+/1FMvdPY JcO/WX1VjZgROI0+giqZXyqdUcuz8RNwY5jegs5tSdHNpTRaSGsP X-Gm-Gg: ASbGncuSOjz7e20aUGzlevrGBQVStn6aAJMR3Rc6cy2TjCgcPCm1BejQ70wNEf458j6 UuhWGulkjDsmlMnVM5xCUan0wsTV1HwSZnwzhwQ59U/YXoW9+p4l1Gz2Ry0eG2KJ52hsppQar75 nQI20uKgrDEmylCPzJ1dZd6W85kYN5fegk8I3rWxfNCJONroCpFxdDVfiwOGACBdbHhc0uu04Ar gQznC2cuCMwJFTw+vyNv48NORbBlLGmJzlANkDrRjzaj2WfsjX1jth1QbvqyMN21rg+aULdfOvl O1rMmPfSfr0SuJydJR/TqUKVJVAB X-Google-Smtp-Source: AGHT+IFYivn19tcd0nyuwetezSx/ZZQlT9zvNXwLrx1rQ33dHM9YLHXGiJxpadOZAtc40ObnGdmoWg== X-Received: by 2002:a05:6a00:849:b0:725:f18a:da52 with SMTP id d2e1a72fcca58-72daf92a025mr65619860b3a.4.1738028897455; Mon, 27 Jan 2025 17:48:17 -0800 (PST) Received: from smtpclient.apple ([2601:646:8f81:6120:954a:ef64:25ce:1e3c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72f8a6b324bsm8111431b3a.62.2025.01.27.17.48.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jan 2025 17:48:16 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: bug#75079: Window for treesit-explore From: Yuan Fu In-Reply-To: <87sepa9dvn.fsf@mail.linkov.net> Date: Mon, 27 Jan 2025 17:48:05 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <5E199AF5-B117-4042-B4EB-FB96BB844B41@gmail.com> References: <87zfkk191f.fsf@mail.linkov.net> <87sepa9dvn.fsf@mail.linkov.net> To: Juri Linkov X-Mailer: Apple Mail (2.3776.700.51) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 75079 Cc: 75079@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Jan 22, 2025, at 11:40=E2=80=AFPM, Juri Linkov = wrote: >=20 > BTW, wouldn't it be nicer to display the treesit-explore window > below the current buffer, this would keep the user's window layout: >=20 > diff --git a/lisp/treesit.el b/lisp/treesit.el > index 8d86d142e3f..a22c335ae22 100644 > --- a/lisp/treesit.el > +++ b/lisp/treesit.el > @@ -4122,7 +4224,8 @@ treesit-explorer-switch-parser > (user-error "Not in `treesit-explore-mode'")) > (setq-local treesit--explorer-parser parser) > (display-buffer treesit--explorer-buffer > - (cons nil '((inhibit-same-window . t)))) > + '(display-buffer-below-selected > + (inhibit-same-window . t))) > (setq-local treesit--explorer-last-node nil) > (treesit--explorer-refresh)) >=20 > @@ -4176,7 +4279,9 @@ treesit-explore > (interactive) > (if (and treesit-explore-mode > (buffer-live-p treesit--explorer-buffer)) > - (display-buffer treesit--explorer-buffer '(nil = (inhibit-same-window . t))) > + (display-buffer treesit--explorer-buffer > + '(display-buffer-below-selected > + (inhibit-same-window . t))) > (treesit-explore-mode))) It=E2=80=99s hard to say what=E2=80=99s the ideal layout here. My = personal preference is for the explorer window to show up in =E2=80=9Cthe = other window=E2=80=9D. Since I usually have to side-by-side window, = =E2=80=9Cthe other window=E2=80=9D will be on the left or right. And = I=E2=80=99ll be sad if Emacs splits my window vertically to show a new = window below. IOW I think it=E2=80=99s best to use the =E2=80=9Cdefault=E2=80=9D = display behavior that user configured for and probably prefers. Yuan= From unknown Mon Aug 18 15:38:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 25 Feb 2025 12:24:14 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator