From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Zhu Zihao Newsgroups: gmane.emacs.bugs Subject: bug#41572: 28.0.50; [PATCH] Support plain project marked with file .emacs-project Date: Thu, 28 May 2020 11:32:04 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000096a7b705a6acf9c2" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="64011"; mail-complaints-to="usenet@ciao.gmane.io" To: 41572@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 28 06:46:17 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 1jeAQq-000GZF-0a for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 May 2020 06:46:16 +0200 Original-Received: from localhost ([::1]:59486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeAQp-0008Aw-0x for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 May 2020 00:46:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60450) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeAQd-00089A-0x for bug-gnu-emacs@gnu.org; Thu, 28 May 2020 00:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jeAQc-00031L-Na for bug-gnu-emacs@gnu.org; Thu, 28 May 2020 00:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jeAQc-0008Hb-Lc for bug-gnu-emacs@gnu.org; Thu, 28 May 2020 00:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Zhu Zihao Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 May 2020 04:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41572 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.159064111531758 (code B ref -1); Thu, 28 May 2020 04:46:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 May 2020 04:45:15 +0000 Original-Received: from localhost ([127.0.0.1]:50629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jeAPr-0008GA-0h for submit@debbugs.gnu.org; Thu, 28 May 2020 00:45:15 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:44556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1je9HG-0006SU-VJ for submit@debbugs.gnu.org; Wed, 27 May 2020 23:32:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1je9HG-0007xS-PF for bug-gnu-emacs@gnu.org; Wed, 27 May 2020 23:32:18 -0400 Original-Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:37506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1je9HF-0000eZ-T9 for bug-gnu-emacs@gnu.org; Wed, 27 May 2020 23:32:18 -0400 Original-Received: by mail-wr1-x430.google.com with SMTP id x13so11719813wrv.4 for ; Wed, 27 May 2020 20:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=nvwWOMTGQ77E0LmZeuZKEvQxuFEurtKs8hS6ulk6Aag=; b=isjhY+H8PBGWl+nyBooQ6/yNroJxqyv6LFGDCCbIMNeIe0Brrv80UhWt5tF/xz8xxM 1uXlaeC6hT6WSG8n8Siou9iIx/cxtO7oOWD6PGNVzWnYIW0JP+l2Hp1RYxkwwu7olpeW 7Rc3JlkdfS+fN67g87lgcu9u9WgHO7JM1ABNwmykmrQIOceL0PxQYGah3KbZcolkTNAC d+aNFIMgyD/e1K7Olpehg+t7yTndewS4SxZ3nKST7Y/QmZuPP4a+d98VAgzqsbboOn3V fkF8rYXRE+2v+SC/IcR3imPlFAO6RWmdKGne0CPv8yPKwPU8lOc1GezXkzFTPWDPb+ui GKuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=nvwWOMTGQ77E0LmZeuZKEvQxuFEurtKs8hS6ulk6Aag=; b=Oqs9QMIyZAeUdESmJqJENpJ9PXlYPQdirma0xx0OXoo8S1RzUAMXi67OkFsVO1Im80 w/1ZXLeazHTJV5TzerFPTGT4aGRMR5D9A5ONnc/BDWREOO4bK8DqDZSrKdF7hxKEEaK9 ofdsV3k1tfXXZXyxBrBBVN0ab5E8n5IgCZEeNEThZAjv9aJaOGhSLdRlAII4hNaq8DDo QSk32MF6i9R2hSF1sq++cOS8CA6QlRRQhMsVa64wdfwahHA31Bg4pix6r1zgZRvVDtxc gp7knW8ew0OE9tw6WHZE2QU3Dl/svtC6BHmZ2X2+1n0wgpFBFoAr1c/GhAv/ihtrf6Bw 9rqQ== X-Gm-Message-State: AOAM532aBH7RmLlFBesCuIW2sUwzTpfkNfL6fTZdu+vaF1BHjFpe/P1y YMqmkxhvR6HPmSQr5eM6LuKXiWWFlj62pGON4xU6PTCGc5A= X-Google-Smtp-Source: ABdhPJxTdukTWahp/AqRaOdg6icx3eip4dzVvwdvd0qOyYZnmu7XjEn1D9dP00fsG7jNn1jWO6AhKjNPVTjF0XY7R1g= X-Received: by 2002:a5d:4801:: with SMTP id l1mr1237166wrq.235.1590636735538; Wed, 27 May 2020 20:32:15 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=cjpeople2013@gmail.com; helo=mail-wr1-x430.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Mailman-Approved-At: Thu, 28 May 2020 00:45:13 -0400 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:181123 Archived-At: --00000000000096a7b705a6acf9c2 Content-Type: text/plain; charset="UTF-8" This patch add support for "plain project" in project.el. Plain project is a kind of project without any VC backend but should be. To mark a directoy as project, put an empty magic file .emacs-project under the directory, and project.el should be responsible for it. ~~~~ >From cb0a67cfacf141a8b1955c08c3f459bcac801a39 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Thu, 28 May 2020 11:04:44 +0800 Subject: [PATCH] Support plain project marked with file .emacs-project * lisp/progmodes/project.el (project-try-plain): New function * lisp/progmodes/project.el (project-root): New dispatch variants * lisp/progmodes/project.el (project-find-functions): Add project-try-plain --- lisp/progmodes/project.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 88f73e4fb31..4c1810aeb56 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -94,7 +94,7 @@ (require 'cl-generic) -(defvar project-find-functions (list #'project-try-vc) +(defvar project-find-functions (list #'project-try-plain #'project-try-vc) "Special hook to find the project containing a given directory. Each functions on this hook is called in turn with one argument (the directory) and should return either nil to mean @@ -194,6 +194,18 @@ project-files (or dirs (list (project-root project))))) +(defun project-try-plain (dir) + "Return the plain project instance of current DIR. + +A directory with magic file \".emacs-project\" will be recognized as +plain project." + (pcase (locate-dominating-file dir ".emacs-project") + (`nil nil) + (root (cons 'plain root)))) + +(cl-defmethod project-root ((project (head plain))) + (cdr project)) + (defun project--files-in-directory (dir ignores &optional files) (require 'find-dired) (require 'xref) -- 2.26.2 --00000000000096a7b705a6acf9c2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

This patch add support for "p= lain project" in project.el. Plain project is a
kind of project wit= hout any VC backend but should be.

To mark a directoy as project, pu= t an empty magic file .emacs-project under the

directory, and p= roject.el should be responsible for it.

~~~~
=

From cb0a67cfacf141a8b1955c08c3f459bcac801a39 Mon Sep 1= 7 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Thu, 28 May 2020 11:04:44 +0800Subject: [PATCH] Support plain project marked with file .emacs-project
* lisp/progmodes/project.el (project-try-plain): New function
* lis= p/progmodes/project.el (project-root): New dispatch variants
* lisp/prog= modes/project.el (project-find-functions): Add project-try-plain
---
= =C2=A0lisp/progmodes/project.el | 14 +++++++++++++-
=C2=A01 file changed= , 13 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/projec= t.el b/lisp/progmodes/project.el
index 88f73e4fb31..4c1810aeb56 100644--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ = -94,7 +94,7 @@
=C2=A0
=C2=A0(require 'cl-generic)
=C2=A0
-(= defvar project-find-functions (list #'project-try-vc)
+(defvar proje= ct-find-functions (list #'project-try-plain #'project-try-vc)
= =C2=A0=C2=A0 "Special hook to find the project containing a given dire= ctory.
=C2=A0Each functions on this hook is called in turn with one
= =C2=A0argument (the directory) and should return either nil to mean
@@ -= 194,6 +194,18 @@ project-files
=C2=A0=C2=A0=C2=A0 (or dirs
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (list (project-root project)))))
=C2= =A0
+(defun project-try-plain (dir)
+=C2=A0 "Return the plain pr= oject instance of current DIR.
+
+A directory with magic file \"= .emacs-project\" will be recognized as
+plain project."
+= =C2=A0 (pcase (locate-dominating-file dir ".emacs-project")
+= =C2=A0=C2=A0=C2=A0 (`nil nil)
+=C2=A0=C2=A0=C2=A0 (root (cons 'plain= root))))
+
+(cl-defmethod project-root ((project (head plain)))
+= =C2=A0 (cdr project))
+
=C2=A0(defun project--files-in-directory (dir= ignores &optional files)
=C2=A0=C2=A0 (require 'find-dired)
= =C2=A0=C2=A0 (require 'xref)
--
2.26.2



--00000000000096a7b705a6acf9c2--