From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] scratch/project 106e023: Add new `project' package, and use it in xref Date: Tue, 07 Jul 2015 23:44:14 -0400 Message-ID: References: <20150708000935.5340.18494@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436327105 26491 80.91.229.3 (8 Jul 2015 03:45:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jul 2015 03:45:05 +0000 (UTC) Cc: Dmitry Gutov To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 08 05:44:57 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZCgI4-00037Q-B3 for ged-emacs-devel@m.gmane.org; Wed, 08 Jul 2015 05:44:56 +0200 Original-Received: from localhost ([::1]:33125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCgI3-0007Tl-5E for ged-emacs-devel@m.gmane.org; Tue, 07 Jul 2015 23:44:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCgHU-00073x-8W for emacs-devel@gnu.org; Tue, 07 Jul 2015 23:44:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCgHQ-0000Bz-T5 for emacs-devel@gnu.org; Tue, 07 Jul 2015 23:44:20 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:30288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCgHQ-0000BN-Pf for emacs-devel@gnu.org; Tue, 07 Jul 2015 23:44:16 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DVFgA731xV/2cGNJ1cgxCEAoVVu0CGQ4EIBAICgTw6EwEBAQEBAQGBCkEFg10BAQRWERIQCzQSFBgNiGPPIwEBAQEGAQEBAR6LOoUFBxaEFwWLRI4qBZsRI4I7gVkigngBAQE X-IPAS-Result: A0DVFgA731xV/2cGNJ1cgxCEAoVVu0CGQ4EIBAICgTw6EwEBAQEBAQGBCkEFg10BAQRWERIQCzQSFBgNiGPPIwEBAQEGAQEBAR6LOoUFBxaEFwWLRI4qBZsRI4I7gVkigngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="129490645" Original-Received: from 157-52-6-103.cpe.teksavvy.com (HELO pastel.home) ([157.52.6.103]) by ironport2-out.teksavvy.com with ESMTP; 07 Jul 2015 23:44:14 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 5D5A05FA7A; Tue, 7 Jul 2015 23:44:14 -0400 (EDT) In-Reply-To: (Dmitry Gutov's message of "Wed, 08 Jul 2015 00:09:36 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187769 Archived-At: > +(defvar project-functions '(project-try-vc > + project-try-ede > + project-ask-user) I think I'd prefer a slightly more verbose name for this variable. Also, I'd suggest you use (list #'foo ... #'bar) so that we automatically check that those functions are known. > +(cl-defgeneric project-root (project) > + "Return the root directory of the current project.") This should specify that it's an absolute file name. > +(cl-defgeneric project-source-directories (project) > + "Return the list of source directories. > +Including any where source (or header, etc) files used by the > +current project may be found. Including those outside of the > +project tree." > + (project-directories project)) Same here: we should explicitly say if relative file names can appear or not in the output. > +(defvar project-vc-root-files '(".git" ".hg" ".bzr")) I'd appreciate if this could be better integrated with VC (so it automatically picks up other names for other supported backends). > +(defun project-try-ede (dir) > + (when (featurep 'ede) > + (cons 'ede (ede-directory-get-open-project dir 'ROOT)))) Why use a cons cell with the car's symbol standing for a type tag, when the carried object is already properly self-describing (IIUC it's an EIEIO object)? Stefan