From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: cl-defgeneric vs random funcall in project.el Date: Fri, 31 Jul 2015 09:36:58 -0500 Message-ID: <86fv44z94l.fsf@stephe-leake.org> References: <86oaiwa57v.fsf@stephe-leake.org> <55B79B3F.1060200@yandex.ru> <86wpxj93r2.fsf@stephe-leake.org> <55B82A0C.5040709@yandex.ru> <86fv4782k2.fsf@stephe-leake.org> <55B92F76.7060104@yandex.ru> <86380686sm.fsf@stephe-leake.org> <55BA0AC4.7060906@yandex.ru> <86mvyd7jf0.fsf@stephe-leake.org> <55BA5BDD.1080009@yandex.ru> <86k2thz0dw.fsf@stephe-leake.org> <55BAC366.1010803@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1438353539 24871 80.91.229.3 (31 Jul 2015 14:38:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jul 2015 14:38:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 31 16:38:49 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 1ZLBSS-0001Df-8a for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2015 16:38:48 +0200 Original-Received: from localhost ([::1]:44666 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLBSR-0001Ru-Fc for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2015 10:38:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLBS8-0001Md-VQ for emacs-devel@gnu.org; Fri, 31 Jul 2015 10:38:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLBRx-0003BL-Io for emacs-devel@gnu.org; Fri, 31 Jul 2015 10:38:28 -0400 Original-Received: from gproxy2-pub.mail.unifiedlayer.com ([69.89.18.3]:40624) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZLBRx-00039W-BW for emacs-devel@gnu.org; Fri, 31 Jul 2015 10:38:17 -0400 Original-Received: (qmail 18260 invoked by uid 0); 31 Jul 2015 14:38:08 -0000 Original-Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy2.mail.unifiedlayer.com with SMTP; 31 Jul 2015 14:38:08 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmgw4 with id z2e21q00l2UdiVW012e5GU; Fri, 31 Jul 2015 08:38:08 -0600 X-Authority-Analysis: v=2.1 cv=OJm0g0qB c=1 sm=1 tr=0 a=CQdxDb2CKd3SRg4I0/XZPQ==:117 a=CQdxDb2CKd3SRg4I0/XZPQ==:17 a=DsvgjBjRAAAA:8 a=f5113yIGAAAA:8 a=9i_RQKNPAAAA:8 a=y7kgw_RnJtkA:10 a=hEr_IkYJT6EA:10 a=x_XPkuGwIRMA:10 a=zOBTXjUuO1YA:10 a=vaJtXVxTAAAA:8 a=zTpX7n7bV345mFHEz88A:9 a=Nx9kOSv0l3txOYOX:21 a=bUsbZfvYnJuKkHTN:21 Original-Received: from [76.218.37.33] (port=55094 helo=TAKVER2) by host114.hostmonster.com with esmtpa (Exim 4.84) (envelope-from ) id 1ZLBRi-0006v6-0o for emacs-devel@gnu.org; Fri, 31 Jul 2015 08:38:02 -0600 In-Reply-To: <55BAC366.1010803@yandex.ru> (Dmitry Gutov's message of "Fri, 31 Jul 2015 03:37:58 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) X-Identified-User: {2442:host114.hostmonster.com:stephele:stephe-leake.org} {sentby:smtp auth 76.218.37.33 authed with stephen_leake@stephe-leake.org} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 69.89.18.3 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:188237 Archived-At: Dmitry Gutov writes: > On 07/31/2015 02:33 AM, Stephen Leake wrote: > >> If the elisp project backend just used load-path as project-search-path, >> what desired functionality would you lose? > > xref-find-references won't search inside the current project root. It would help to be more specific. Since we disagree, you can't assume I'll guess what you have in mind; my first response was "so why would you want to?". To be truly persuasive, you need to anticipate that response, and address it before it happens. A concrete example directory structure: myproj/ # contains README, some docs .git/ # contains git repo build/ contains Makefile, test outputs, intermediate files lisp/ # contains *.el files lisp-emacs-24.3/ # contains *.el files only needed with emacs 24.3 test/ # contains test drivers, known good results The user has set load-path to (".../myproj/lisp" "~/.emacs.d/elpa/..." ".../emacs-25.0/share/..." ...) One search the user might want to do: find the name of an elisp function in a test driver script file, to see how it is tested, while simultaneously finding all places that function is used in the *.el files, to review the test cases to ensure they are sufficient. xref-find-references should do that search. So I agree this is a case for the user adding things to project-search-path that are not on load-path. It would be wrong to add the entire directory tree that contains .git; the user is using emacs 25, so they don't want to see the emacs 24.3 files. Obviously, there is a separate case where they do want to see those files; that's a different project configuration. We could provide: (defun project-create (root) "Return a project object that has root directory ROOT. Also enters the project in `project-root-alist'." ...) `project-root-alist' associates root directories with project objects; `project-current' walks up the current directory tree until it finds a matching entry in the alist. If that fails, it tries the other methods it currenty uses. (defun project-add-search-path (project path) "Add PATH (a list of directories) to `project-search-path' for PROJECT. If the directories are relative, they are first expanded relative to `default-directory'." ... ) (defun project-add-search-ignore (project ignores) "Add IGNORES (a list of shell glob patterns) to `project-ignores' for PROJECT." ...) Then, in the same place they add myproj/lisp to load-path, the user adds: (defvar my-proj (project-create ".../myproj")) (project-add-search-path my-proj '(".../myproj/build" ".../myproj/test")) # ignore intermediate test files (project-add-search-ignore my-proj '(".../myproj/build/*.temp")) xref-find-references then searches all files in all directories on `project-search-path' and respects `project-ignores'. -- -- Stephe