From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 05 11:23:46 2016 Received: (at submit) by debbugs.gnu.org; 5 Apr 2016 15:23:46 +0000 Received: from localhost ([127.0.0.1]:50501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anSpV-0000OP-OF for submit@debbugs.gnu.org; Tue, 05 Apr 2016 11:23:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anSpU-0000OC-9z for submit@debbugs.gnu.org; Tue, 05 Apr 2016 11:23:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anSpN-0004kI-Mi for submit@debbugs.gnu.org; Tue, 05 Apr 2016 11:23:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anSpN-0004kE-JE for submit@debbugs.gnu.org; Tue, 05 Apr 2016 11:23:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anSpM-0003rX-6H for bug-gnu-emacs@gnu.org; Tue, 05 Apr 2016 11:23:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anSpH-0004gz-Qx for bug-gnu-emacs@gnu.org; Tue, 05 Apr 2016 11:23:36 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anSpH-0004gt-Hr for bug-gnu-emacs@gnu.org; Tue, 05 Apr 2016 11:23:31 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4292 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1anSpG-0005Mf-ST for bug-gnu-emacs@gnu.org; Tue, 05 Apr 2016 11:23:31 -0400 Date: Tue, 05 Apr 2016 18:23:08 +0300 Message-Id: <83oa9om65f.fsf@gnu.org> From: Eli Zaretskii To: bug-gnu-emacs@gnu.org Subject: 25.0.92; Can xref-find-references work without a "project"? MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) In an Emacs tree that is not under any VCS, type: emacs -Q M-x xref-find-references RET current_buffer RET When prompted to choose a project directory, accept the default by typing RET. The result: No project found in ‘THE-DEFAULT-DIRECTORY/’ This is disappointing, since the default implementation of xref-find-references is fully capable of producing the requested results even if no project (in the project.el sense) was created in the directory. I think we shouldn't fail the operation in this case, but instead use the directory specified by the user as the single project root. The proposed patch below implements this. (I'm not married to the patch as shown, so if someone comes up with a more elegant solution, I'd be as happy. The important part is that we should allow this command to be usable even if no project infrastructure was created.) --- lisp/progmodes/project.el~0 2016-01-31 06:43:03.000000000 +0200 +++ lisp/progmodes/project.el 2016-04-05 18:06:43.146022700 +0300 @@ -98,10 +98,12 @@ that it is not applicable, or a project instance.") ;;;###autoload -(defun project-current (&optional maybe-prompt dir) +(defun project-current (&optional maybe-prompt dir noerror) "Return the project instance in DIR or `default-directory'. When no project found in DIR, and MAYBE-PROMPT is non-nil, ask -the user for a different directory to look in." +the user for a different directory to look in. +Optional third argument NOERROR, if non-nil, means don't signal +an error if no project is found in the specified directory." (unless dir (setq dir default-directory)) (let ((pr (project--find-in-directory dir))) (cond @@ -109,6 +111,8 @@ (maybe-prompt (setq dir (read-directory-name "Choose the project directory: " dir nil t) pr (project--find-in-directory dir)) + (if (and (not pr) noerror) + (setq pr dir)) (unless pr (user-error "No project found in `%s'" dir)))) pr)) --- lisp/progmodes/xref.el~0 2016-03-20 06:53:36.000000000 +0200 +++ lisp/progmodes/xref.el 2016-04-05 18:18:47.257475600 +0300 @@ -245,14 +245,19 @@ The default implementation uses `semantic-symref-tool-alist' to find a search tool; by default, this uses \"find | grep\" in the -`project-current' roots." +`project-current' roots, falling back to the directory tree +rooted at the directory specified by user." (cl-mapcan (lambda (dir) (xref-collect-references identifier dir)) - (let ((pr (project-current t))) - (append - (project-roots pr) - (project-external-roots pr))))) + (let* ((pr (project-current t nil 'noerror)) + (roots (ignore-errors (project-roots pr))) + (eroots (ignore-errors (project-external-roots pr)))) + ;; If we didn't find any project files in PR, default to PR + ;; itself as the project's single root. + (if (and (null roots) (null eroots)) + (setq roots (list (expand-file-name pr)))) + (append roots eroots)))) (cl-defgeneric xref-backend-apropos (backend pattern) "Find all symbols that match PATTERN. In GNU Emacs 25.0.92.75 (i686-pc-mingw32) of 2016-04-04 built on HOME-C4E4A596F7 Repository revision: f501116ea896b20f195f5c841e8770d7fe0418b9 Windowing system distributor 'Microsoft Corp.', version 5.1.2600 Configured using: 'configure --prefix=/d/usr --enable-checking=yes,glyphs --with-wide-int --with-modules 'CFLAGS=-O0 -gdwarf-4 -g3'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS MODULES Important settings: value of $LANG: ENU locale-coding-system: cp1255 Major mode: Message Minor modes in effect: mml-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t auto-fill-function: message-do-auto-fill transient-mark-mode: t abbrev-mode: t Recent messages: Checking 167 files in d:/gnu/git/emacs/branch/lisp/emacs-lisp... Checking 24 files in d:/gnu/git/emacs/branch/lisp/cedet... Checking 57 files in d:/gnu/git/emacs/branch/lisp/calendar... Checking 87 files in d:/gnu/git/emacs/branch/lisp/calc... Checking 122 files in d:/gnu/git/emacs/branch/lisp/obsolete... Checking for load-path shadows...done Mark set [2 times] Saved text from "From: eliz@HOME-C4E4A596F7.i-did-not-set" Auto-saving... Modification-flag cleared Load-path shadows: None found. Features: (pp shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote w32notify w32 multi-tty make-network-process emacs) Memory information: ((conses 16 95005 11151) (symbols 56 20730 0) (miscs 48 46 126) (strings 16 17838 6291) (string-bytes 1 448071) (vectors 16 12532) (vector-slots 8 432331 7162) (floats 8 167 313) (intervals 40 563 63) (buffers 856 13)) From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 05 13:23:14 2016 Received: (at 23224) by debbugs.gnu.org; 5 Apr 2016 17:23:14 +0000 Received: from localhost ([127.0.0.1]:50595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anUh8-0004xc-2h for submit@debbugs.gnu.org; Tue, 05 Apr 2016 13:23:14 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:36674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anUh6-0004xO-Ss for 23224@debbugs.gnu.org; Tue, 05 Apr 2016 13:23:13 -0400 Received: by mail-oi0-f43.google.com with SMTP id y204so26012821oie.3 for <23224@debbugs.gnu.org>; Tue, 05 Apr 2016 10:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mime-version; bh=aDKb0jgK4MzLofXpLR9j99gOtg357Yct4seKphtlHYc=; b=jRFchsJZb+25Xs1l8IqQ5q24SrcHGeO0PeJV4tntevSl9cEezcJ1KD+wSC26d59Chb a4N2JVLfhnF7OTNTXa72h0dolrWtnoUcdTjjSEwk5C73Gpp1OBi0T2sjVpa8x6UHA0zl 8KseIqYdp8z8YjwILB9G6lWW3BBLzrPaT7SXegJazl/k71P2TZ8RCxRRXBZl25IakiJF TWh8QAMA5ODadcQHUkfn0A6FfAUNhWBWQq/6Ws3Xtgu4484+0o5iQzjpkW7HD1gx4KUn 6t9ZwqP00+qOlhmn3kxqYKo6X6xloi3UXvwknuy4NZp47K3UzZ7O1+rTIoL5HcJR+t3o 3SGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mime-version; bh=aDKb0jgK4MzLofXpLR9j99gOtg357Yct4seKphtlHYc=; b=Cj/RWkJ7eyPDiYhTv+o3B3CRSuA/4l+tp9aCO+Q2ADzeOd+4I9swXZ4Pu8EgNEVEf8 zGK2rTxsC7oSVxOCLrB4N/cVt39/7NedOpAB6oYH8LIHybh8GTBAQe6xyHKBE5UHiVQ/ iWUklcQL09KoI35MCobaLnngLnlSQZMJSYhmZIba0FRcelQZHGJUBG3wF24VKJe7HYNF BLVDsGwFXO1+YyAuhbAwn6z82fllWGPU0y8hDJS3vcQ/Ot5IKoAVGLAPJ/jqa45UnxrU 3KMp/k3tTlT7Km32qKxw82Oi+vkwiuIgDCKSP+6a43kmTZ1XqtP2WRJ+n8aCZhRpje5d 7wlQ== X-Gm-Message-State: AD7BkJIYzkzX5HqMK69eHWDITeJLT9K9teP8ax9kK4XQpLabsXyKtT+bHPwodt52iZbA/A== X-Received: by 10.157.46.172 with SMTP id w41mr13816521ota.29.1459876987266; Tue, 05 Apr 2016 10:23:07 -0700 (PDT) Received: from Vulcan.local (76-234-68-79.lightspeed.frokca.sbcglobal.net. [76.234.68.79]) by smtp.gmail.com with ESMTPSA id n6sm10039917obi.4.2016.04.05.10.23.05 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 05 Apr 2016 10:23:05 -0700 (PDT) From: John Wiegley X-Google-Original-From: "John Wiegley" Received: by Vulcan.local (Postfix, from userid 501) id 833E513E5DB94; Tue, 5 Apr 2016 10:23:04 -0700 (PDT) To: Eli Zaretskii Subject: Re: bug#23224: 25.0.92; Can xref-find-references work without a "project"? In-Reply-To: <83oa9om65f.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 05 Apr 2016 18:23:08 +0300") Date: Tue, 05 Apr 2016 10:22:59 -0700 Message-ID: References: <83oa9om65f.fsf@gnu.org> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.92 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23224 Cc: 23224@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) >>>>> Eli Zaretskii writes: > I think we shouldn't fail the operation in this case, but instead use the > directory specified by the user as the single project root. I agree. -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 05 20:18:18 2016 Received: (at 23224) by debbugs.gnu.org; 6 Apr 2016 00:18:18 +0000 Received: from localhost ([127.0.0.1]:50817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anbAo-0004hN-Gs for submit@debbugs.gnu.org; Tue, 05 Apr 2016 20:18:18 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:36247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anbAn-0004hB-2l for 23224@debbugs.gnu.org; Tue, 05 Apr 2016 20:18:17 -0400 Received: by mail-wm0-f52.google.com with SMTP id v188so5528686wme.1 for <23224@debbugs.gnu.org>; Tue, 05 Apr 2016 17:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=ggVf3IsbbFD2sTR9kEyGFvC88uFFxj+b/3/Pm/fdjaU=; b=qs0lbjE4VXgoIB0XrhvZfRmNL5McCk+xnt/8rRyot10NgggihI/UBGrrXlJscpaHsa J0N/D4X4f1p47ltj0u1oW98aEUbeect02hPxgEIapLWR0B36IpVeNHz+wAJajCevP00H 9rnHg9LESGN0Rp4Sr2vE83MvwNJGW+ZkyfTHOAh7j/2pV88ShEdlVbLoMxjUoR4ViOG+ 1dX+x8v9OXzaRgznbspK2P87b/MA41GrZ/MYpGtfyH/WLn75hiidj1wjFSaOKgtv2ui/ 00skmfGK9z59dLw9hRJtFoRw4xobUWDe1nH4x1qFWXGcNwMeucptYa9rGigAe2+sYiuN /Osw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ggVf3IsbbFD2sTR9kEyGFvC88uFFxj+b/3/Pm/fdjaU=; b=gVJAeUQIiPOuvltUy3Ndp/3uKFGp1rpPWhaBwHlTJ7C6d0Mxsq4IJzsOXdWzNHKN+O aBMWRPf+jT6rUdY3aqNJl1xG3mQuxuh02361DZjPyVwhE7x+VEk3TmtpfMcUvn9aPuJU YtDHKghFKDOYOYGIaD3PxlZPNUI6WQcXckZMyUSJU8IsLLMdTPVpr5X93gBWZkbGmZai PnP+r7YnexepVmeuzv5nLmarMeaKPwdgnjywcsApitLp0KXoX36CMt9njKNEQqHt7wri Pwnbd2iNdbyXSNlAd6PwPppWIxDvW8uWVXzcrVUn1xsajV3+3kr3WKG7XU/eKJ07aeWD dWzw== X-Gm-Message-State: AD7BkJJfVO7AqhIDYHU+8Y7KW0PNuG0nrOZ2HbKO43pzEu1FkOtMduApPuz1T+iS5hgvXQ== X-Received: by 10.28.109.87 with SMTP id i84mr2935505wmc.3.1459901891245; Tue, 05 Apr 2016 17:18:11 -0700 (PDT) Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id u3sm21879833wmg.15.2016.04.05.17.18.10 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Apr 2016 17:18:10 -0700 (PDT) Subject: Re: bug#23224: 25.0.92; Can xref-find-references work without a "project"? To: Eli Zaretskii , 23224@debbugs.gnu.org References: <83oa9om65f.fsf@gnu.org> From: Dmitry Gutov Message-ID: Date: Wed, 6 Apr 2016 03:18:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <83oa9om65f.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 23224 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On 04/05/2016 06:23 PM, Eli Zaretskii wrote: > I think we shouldn't fail the operation in this case, but instead use > the directory specified by the user as the single project root. Sure, fine by me. > + (let* ((pr (project-current t nil 'noerror)) > + (roots (ignore-errors (project-roots pr))) > + (eroots (ignore-errors (project-external-roots pr)))) > + ;; If we didn't find any project files in PR, default to PR > + ;; itself as the project's single root. > + (if (and (null roots) (null eroots)) > + (setq roots (list (expand-file-name pr)))) > + (append roots eroots)))) I'm going to assume you're teasing here. :) See the counter-proposal below, it should provide a more universal benefit along the same line of reasoning. Unless we come upon situations where we *do* want to abort with an error after asking the user for a project and not finding a "real" one. If 'transient' doesn't sound great, alternative suggestions welcome. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1251bca..9c8a88c 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -101,7 +101,9 @@ project-find-functions (defun project-current (&optional maybe-prompt dir) "Return the project instance in DIR or `default-directory'. When no project found in DIR, and MAYBE-PROMPT is non-nil, ask -the user for a different directory to look in." +the user for a different directory to look in. If that directory +is not a part of a detectable project either, return a +`transient' project instance rooted in it." (unless dir (setq dir default-directory)) (let ((pr (project--find-in-directory dir))) (cond @@ -110,7 +112,8 @@ project-current (setq dir (read-directory-name "Choose the project directory: " dir nil t) pr (project--find-in-directory dir)) (unless pr - (user-error "No project found in `%s'" dir)))) + (message "Using '%s' as a transient project root" dir) + (setq pr (cons 'transient dir))))) pr)) (defun project--find-in-directory (dir) @@ -182,6 +185,9 @@ project--find-in-directory (t (complete-with-action action all-files string pred)))))) +(cl-defmethod project-roots ((project (head transient))) + (list (cdr project))) + (defgroup project-vc nil "Project implementation using the VC package." :version "25.1" From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 06 13:09:33 2016 Received: (at 23224) by debbugs.gnu.org; 6 Apr 2016 17:09:33 +0000 Received: from localhost ([127.0.0.1]:51980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anqxR-0005JH-4i for submit@debbugs.gnu.org; Wed, 06 Apr 2016 13:09:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anqxO-0005J4-Rl for 23224@debbugs.gnu.org; Wed, 06 Apr 2016 13:09:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anqxD-0007oR-Qc for 23224@debbugs.gnu.org; Wed, 06 Apr 2016 13:09:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anqxD-0007nw-My; Wed, 06 Apr 2016 13:09:19 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1905 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1anqxC-0002D4-Vq; Wed, 06 Apr 2016 13:09:19 -0400 Date: Wed, 06 Apr 2016 20:08:59 +0300 Message-Id: <837fgamzpw.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: (message from Dmitry Gutov on Wed, 6 Apr 2016 03:18:09 +0300) Subject: Re: bug#23224: 25.0.92; Can xref-find-references work without a "project"? References: <83oa9om65f.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 23224 Cc: 23224@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Dmitry Gutov > Date: Wed, 6 Apr 2016 03:18:09 +0300 > > On 04/05/2016 06:23 PM, Eli Zaretskii wrote: > > > + (let* ((pr (project-current t nil 'noerror)) > > + (roots (ignore-errors (project-roots pr))) > > + (eroots (ignore-errors (project-external-roots pr)))) > > + ;; If we didn't find any project files in PR, default to PR > > + ;; itself as the project's single root. > > + (if (and (null roots) (null eroots)) > > + (setq roots (list (expand-file-name pr)))) > > + (append roots eroots)))) > > I'm going to assume you're teasing here. :) A little bit. > See the counter-proposal below, it should provide a more universal > benefit along the same line of reasoning. Unless we come upon situations > where we *do* want to abort with an error after asking the user for a > project and not finding a "real" one. I don't know anything about project.el and its users, so I wasn't sure such a change won't break something. But if you say it's okay, I'll stop worrying. > If 'transient' doesn't sound great, alternative suggestions welcome. "ad-hoc"? Please go ahead and push. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 06 19:09:04 2016 Received: (at 23224-done) by debbugs.gnu.org; 6 Apr 2016 23:09:04 +0000 Received: from localhost ([127.0.0.1]:52229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anwZM-0007Vk-9U for submit@debbugs.gnu.org; Wed, 06 Apr 2016 19:09:04 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1anwZK-0007VG-9b for 23224-done@debbugs.gnu.org; Wed, 06 Apr 2016 19:09:02 -0400 Received: by mail-wm0-f43.google.com with SMTP id n3so82113511wmn.0 for <23224-done@debbugs.gnu.org>; Wed, 06 Apr 2016 16:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=XlvYP6L2CaNpEXwB4ROEkKedO1iIlpIC52vYfrHt3iM=; b=OKFeOJDheCe8XU0JMHi7Ex+hc0wy/QlpI58VyG6UastUP/LNwCdRFtIvswgdasonhe oa0BV/clAtRnvvElgvpXtEOrHIdL7czEswA1b6nwQ7R8WyMKJmLIHcEwtuZkRpgEgGnb ZwMQz4Cp8dCPAxMjj9YloXfTpYphE/vp3CCGGIr18NMM+pVgc+ntcFHoDM6WBuLj8R1P 2lTvpHSST2bjYbQ47tPCI/ptCzV9GDonONMAQybO+VthO/KdWX2OBiJnNuW+EbhJG0YQ IufLNzBc6GmJsXc1Dlg3GpaeYoGseAPNV9WevwGI4PjCg2+QMEppsQQi9RVXaegGHA2J 2tXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=XlvYP6L2CaNpEXwB4ROEkKedO1iIlpIC52vYfrHt3iM=; b=gzHCanDoGiNa74FWRq+kUtaaQIiycX3h61/RmbZVWhWgy8RzdSuRFb8kpHQwCnNOh5 IFZN1KbUBjmkRxS3q7UiZGN8M8yrKqcprq4Bimap3NuyVnLdBu5UQc+BbdPzqhT9401u xIsZi82kVJ99MLROzgCGel0IKPJ8rLT59IMDWqQWU7+Z8+7yCZI/xkr4mxHCnaN1d8aZ Tq39jcuBtaKnvalq933p7kBQ5h4/6X7gqTV1nlgXiFP5CINSy5rlVKP5vIu4CIfIuJDS OdCaREHwNBHN4yu0IlauguWE02jvMmr6Rrpco+ZbFhG6VprkG2QOs8k024Heg+CZJ8ym 6R+w== X-Gm-Message-State: AD7BkJLBRBzqgZxfvBzJG4/2Vtk4iEF3pdW5+Z6V/L3dqlpw6WgIFGJQg87wUsXNVy5pJQ== X-Received: by 10.28.6.140 with SMTP id 134mr371715wmg.23.1459984136596; Wed, 06 Apr 2016 16:08:56 -0700 (PDT) Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id e80sm340590wma.1.2016.04.06.16.08.55 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Apr 2016 16:08:55 -0700 (PDT) Subject: Re: bug#23224: 25.0.92; Can xref-find-references work without a "project"? To: Eli Zaretskii References: <83oa9om65f.fsf@gnu.org> <837fgamzpw.fsf@gnu.org> From: Dmitry Gutov Message-ID: Date: Thu, 7 Apr 2016 02:08:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <837fgamzpw.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 23224-done Cc: 23224-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On 04/06/2016 08:08 PM, Eli Zaretskii wrote: > I don't know anything about project.el and its users, so I wasn't sure > such a change won't break something. But if you say it's okay, I'll > stop worrying. project.el users are an unknowable bunch, so far. This change is unlikely to break anything, it just might make using project commands more "magical", possibly not in a good way. Let's just wait for feedback. >> If 'transient' doesn't sound great, alternative suggestions welcome. > > "ad-hoc"? The other options I had: temporary, and simple. But I wanted to emphasize the fact that the user will be asked for the project's directory every time they'll try to use a project-related command. Anyway, you're welcome to change the name, retouch the newly updated docstring, etc. > Please go ahead and push. Thanks. Done, and closing. From unknown Sun Aug 10 16:44:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 05 May 2016 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator