From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#75079: Default parser for treesit-explore Date: Wed, 25 Dec 2024 00:36:58 -0800 Message-ID: References: <87zfkk191f.fsf@mail.linkov.net> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) 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="12526"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 75079@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 25 09:39:25 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tQMvM-00037e-Mx for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Dec 2024 09:39:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQMv3-0003ER-0P; Wed, 25 Dec 2024 03:39:05 -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 1tQMv1-0003Dx-93 for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 03:39:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQMv0-0004ln-P1 for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 03:39:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:Date:In-Reply-To:From:Mime-Version:To:Subject; bh=2/mTWWoaeXTRtTauVwh4U1zZrvCg1gbcBXDpWj+gsjo=; b=bHsBjY5MeRZEAI5bVL+10rqOeAN8d4VWnKzpYvoktvN/Wzl1A4QUsumidR3hq1EY2Db3VDrCm3WTpduvDDE/lvGSZ0/j+G2rTpip1fipLyufFSGU4Z+G22tIkHZss7zzIzUkVMbZ6QTf7fNoOA6fGCsUNrhy0W+v73hRgXG7nnt/JL25jgOnlNpL7AV9Z+RgCjMkux0y5vSKKEX4SlPoScDRhjfajil50xECoGx4LAFzZiLr9UKh52cQvwtwSnX6gbYvfOBa+VwyneeTM+yQ4ISg6UHDJ+R7w6iQYN2rbSnmIdV/WYktEuKCogdlNa5GDgCM+M/hxfKr+01p3spYrw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQMv0-0007JS-CV for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2024 03:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Dec 2024 08:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75079 X-GNU-PR-Package: emacs Original-Received: via spool by 75079-submit@debbugs.gnu.org id=B75079.173511590028041 (code B ref 75079); Wed, 25 Dec 2024 08:39:02 +0000 Original-Received: (at 75079) by debbugs.gnu.org; 25 Dec 2024 08:38:20 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: <87zfkk191f.fsf@mail.linkov.net> X-Mailer: Apple Mail (2.3776.700.51) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297724 Archived-At: > 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=