From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#41890: 28.0.50; [PATCH]: Add bindings for project.el Date: Thu, 18 Jun 2020 18:22:33 +0100 Message-ID: <874kr8jnl2.fsf@tcd.ie> References: <87blljbarq.fsf@thornhill.no> <87ftasea9s.fsf@warpmail.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="129170"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 41890@debbugs.gnu.org, Dmitry Gutov , juri@linkov.net To: "Philip K." Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 18 19:23:24 2020 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 1jlyG3-000XVl-H2 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Jun 2020 19:23:23 +0200 Original-Received: from localhost ([::1]:34180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlyG2-0001yw-IZ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Jun 2020 13:23:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlyFi-0001yX-Fe for bug-gnu-emacs@gnu.org; Thu, 18 Jun 2020 13:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlyFi-0004JT-3Q for bug-gnu-emacs@gnu.org; Thu, 18 Jun 2020 13:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jlyFh-0003VY-Vn for bug-gnu-emacs@gnu.org; Thu, 18 Jun 2020 13:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Jun 2020 17:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41890 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41890-submit@debbugs.gnu.org id=B41890.159250096413444 (code B ref 41890); Thu, 18 Jun 2020 17:23:01 +0000 Original-Received: (at 41890) by debbugs.gnu.org; 18 Jun 2020 17:22:44 +0000 Original-Received: from localhost ([127.0.0.1]:54260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jlyFQ-0003Ul-4d for submit@debbugs.gnu.org; Thu, 18 Jun 2020 13:22:44 -0400 Original-Received: from mail-qk1-f177.google.com ([209.85.222.177]:46865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jlyFN-0003UT-SA for 41890@debbugs.gnu.org; Thu, 18 Jun 2020 13:22:43 -0400 Original-Received: by mail-qk1-f177.google.com with SMTP id r22so4828326qke.13 for <41890@debbugs.gnu.org>; Thu, 18 Jun 2020 10:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=AgPK90tJ7htC0u1j5dyzhRx49Qg4+m6HF+htF7KvGV0=; b=nl5hvUsVkVK7+agveRHEppJBY5qfsCMlnrYaiHe9AWKnCZDxPPa1RBZGp54k9WXr0N alQupFnjULMe8Rgmtkts3ZNbhaWIuqLkhwQcAGWUKxK2gHj7RPQjIpnIS5SxWm/16Ts9 Bid1GBXepyQT1Sy/v9t8J5CeKv4kknM2H3/G6YKnad99tR8kGz/GY5xcKqoNDvbSMY7S FuUJhVr5J4vnITJ0KqrPG5SIxIQJIs6evuokXCriwMgOah2/1q5VOcmAaeOYLT1iOTkw I6Q3YQAVWY/RiXFfib0Fa8XUxAdk8z4CJBUprNZGM+m1CCqV+eYvhAg6xHbJLqZPkIom SofA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=AgPK90tJ7htC0u1j5dyzhRx49Qg4+m6HF+htF7KvGV0=; b=oVnOopUbgUmCJXhOBWA9oyPEkFj13AiyhaQey13zZHd3FdUvvOhX2Jp3SV2Xm6FL+S F+0Zf7BYAXmvEl2icyqyblKtddToN0u1BapIzAXq+JLMeQ/enz8nQGrnSK3IQuq++j5I igbpcU8ZA9Kbgq2DObz9mVJ6g1TEiGNFZYAq/tuZiEgRPk9l2x8cxBeCgghn8FhqXgsf fU5ygDE5NGdv+BJFkVub9wmOnzCAcgjtCeJGNZhrSff1beuvjK9y6YtEp8uCTXErNCfs UCTrb0rIWU6CVWG6SoW4f8KCnkKfWCHGDqxmGl1yFmXppdgdTqLw+U6m6O7+7WlEt+GK q0yA== X-Gm-Message-State: AOAM5308k5aqGyBVY7TX7N70wmLFu/04rXPYqLp7ZQQiVj9dDFbLMPay hTm/qMwpjLZdGPsCxUzkKSdxXw== X-Google-Smtp-Source: ABdhPJzDSbxPER1VqJhjqH9pXn2KQuHBMW/BwRKW4WflNu1/0ASmvNhlVqkRJH562BTl/TDKAqSgxg== X-Received: by 2002:a37:2d42:: with SMTP id t63mr4619819qkh.291.1592500956223; Thu, 18 Jun 2020 10:22:36 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:1f68:7ff5:120d:64e]) by smtp.gmail.com with ESMTPSA id f30sm3728119qtg.79.2020.06.18.10.22.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2020 10:22:35 -0700 (PDT) In-Reply-To: <87ftasea9s.fsf@warpmail.net> (Philip K.'s message of "Thu, 18 Jun 2020 16:09:03 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:182124 Archived-At: Just some minor nits from me. > From: Philip K > Date: Thu, 18 Jun 2020 16:06:19 +0200 > Subject: [PATCH] Use same keys in project-switch-project as in > project-prefix-map > > * project.el (project-switch-commands): Convert to user option and > change structure. > (project-switch-use-entire-map): Add new option. > (project--keymap-prompt): Adapt to change in project-switch-commands Nit: Missing full stop. > (project-switch-project): Use project-prefix-map instead of > project-switch-commands to query valid commands. > --- > lisp/progmodes/project.el | 63 +++++++++++++++++++++++++-------------- > 1 file changed, 41 insertions(+), 22 deletions(-) > > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index e24d81c1b4..33946f78a8 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -900,27 +900,46 @@ project-prompt-project-dir > ;;; Project switching > > ;;;###autoload > -(defvar project-switch-commands > - '((?f "Find file" project-find-file) > - (?g "Find regexp" project-find-regexp) > - (?d "Dired" project-dired) > - (?v "VC-Dir" project-vc-dir) > - (?e "Eshell" project-eshell)) > - "Alist mapping keys to project switching menu entries. > +(defcustom project-switch-commands > + '((project-find-file . "Find file") > + (project-find-regexp . "Find regexp") > + (project-dired . "Dired") > + (project-vc-dir . "VC-Dir") > + (project-shell . "Shell") > + (project-eshell . "Eshell")) > + "Alist mapping commands to descriptions. > Used by `project-switch-project' to construct a dispatch menu of > commands available upon \"switching\" to another project. > > -Each element looks like (KEY LABEL COMMAND), where COMMAND is the > -command to run when KEY is pressed. LABEL is used to distinguish > -the choice in the dispatch menu.") > +Each element looks like (COMMAND LABEL), where COMMAND should be ^^^^^^^^^^^^^^^ (COMMAND . LABEL) > +bound in `project-prefix-map'. LABEL is used to distinguish the > +choice in the dispatch menu." > + :type '(alist :key-type function > + :value-type string) > + :options (mapcan (lambda (ent) > + (and (commandp (cdr ent)) > + (list (cdr ent)))) > + (cdr project-prefix-map)) > + :version "28.1") > + > +(defcustom project-switch-use-entire-map t > + "Make `project-switch-project' use entire `project-prefix-map'. > +If nil, `project-switch-project' will only recognize commands > +listed in `project-switch-commands', and signal an error when > +others are invoked. Otherwise, all keys in > +`project-switch-commands', are legal even if they aren't listed ^^^ Nit: Unnecessary comma. > +in the minibuffer." > + :type 'bool > + :version "28.1") Thanks, -- Basil