From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "T.V. Raman" Newsgroups: gmane.emacs.devel Subject: files.el: Patch to make project-settings optional/customizable Date: Thu, 13 Nov 2008 07:29:55 -0700 Message-ID: <5f0ff9220811130629t505badf9kb1bcc380df89a08f@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1226586641 32674 80.91.229.12 (13 Nov 2008 14:30:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2008 14:30:41 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 13 15:31:42 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L0dEI-00075A-DS for ged-emacs-devel@m.gmane.org; Thu, 13 Nov 2008 15:31:30 +0100 Original-Received: from localhost ([127.0.0.1]:56537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0dD9-0001zf-Du for ged-emacs-devel@m.gmane.org; Thu, 13 Nov 2008 09:30:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0dCo-0001nu-JB for emacs-devel@gnu.org; Thu, 13 Nov 2008 09:29:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0dCn-0001nA-U3 for emacs-devel@gnu.org; Thu, 13 Nov 2008 09:29:58 -0500 Original-Received: from [199.232.76.173] (port=44248 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0dCn-0001n5-Mp for emacs-devel@gnu.org; Thu, 13 Nov 2008 09:29:57 -0500 Original-Received: from yw-out-1718.google.com ([74.125.46.155]:38957) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0dCn-0005wC-Jq for emacs-devel@gnu.org; Thu, 13 Nov 2008 09:29:57 -0500 Original-Received: by yw-out-1718.google.com with SMTP id 9so413955ywk.66 for ; Thu, 13 Nov 2008 06:29:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=YFgMLIYwyMcjLn4J6F5GhfBDo9bzJfjcRWSnKDDnZzg=; b=WGbJbgKuNWfbf0UuGDK4DPwInHr9mHGivnv3RZwxLvXf7wXwtc6pT6nii3KRDUc+qY geAHvAxCt5PARunTYjABPR92HpZk8OwWgE19TuZt/Bq90sn40zI+MZ4cjJdr9MpMCU6K akqiMGRKfciQQu57Aw2Rc8osXsC90zqfNKRUg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=jFcmaoW+GkJ2Bus1S8Pz2eqda1mQ7m0axQkLLLXwiM7qtx+2IG2/qrrWerwhU6c2Qd ztuuroUKYE9aj9GNFTZ70GWfwyzgqxK1wMnSEDPcNZE88HjSPs9N2U1EIlmPtvXEaRYw JKlq09KIe41Si/eQ4Gm2ORpvO2iGzzrg+D2Nw= Original-Received: by 10.142.108.2 with SMTP id g2mr367526wfc.259.1226586595085; Thu, 13 Nov 2008 06:29:55 -0800 (PST) Original-Received: by 10.142.132.13 with HTTP; Thu, 13 Nov 2008 06:29:55 -0800 (PST) Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:105633 Archived-At: Introduces a defcustom for project-settings-file -- rather than hard-coding the name, and if set to nil, arranges for function project-find-settings-file to do nothing. Index: files.el =================================================================== RCS file: /sources/emacs/emacs/lisp/files.el,v retrieving revision 1.1007 diff -u -r1.1007 files.el --- files.el 30 Oct 2008 04:32:22 -0000 1.1007 +++ files.el 13 Nov 2008 04:53:05 -0000 @@ -3201,6 +3201,12 @@ (if elt (setcdr elt list) (push (cons class list) project-class-alist)))) +(defcustom project-settings-file ".dir-settings.el" + "Settings file for per-project settings. Set this to nil if you dont want to load project-specific settings." + :type '(choice + (const :tag "Ignore" nil) + (file :tag "File")) +:group 'files) (defun project-find-settings-file (file) "Find the settings file for FILE. @@ -3209,8 +3215,9 @@ If the file is in a registered project, a cons from `project-directory-alist' is returned. Otherwise this returns nil." + (when project-settings-file (setq file (expand-file-name file)) - (let* ((settings (locate-dominating-file file ".dir-settings.el")) + (let* ((settings (locate-dominating-file file project-settings-file)) (pda nil)) ;; `locate-dominating-file' may have abbreviated the name. (if settings (setq settings (expand-file-name ".dir-settings.el" settings))) @@ -3223,7 +3230,7 @@ (if (> (length (file-name-directory settings)) (length (car pda))) settings pda) - (or settings pda)))) + (or settings pda))))) (defun project-define-from-project-file (settings-file) "Load a settings file and register a new project class and instance. -- Best Regards, --raman Email: raman@users.sf.net WWW: http://emacspeak.sf.net/raman/ AIM: emacspeak GTalk: tv.raman.tv@gmail.com PGP: http://emacspeak.sf.net/raman/raman-almaden.asc Google: tv+raman IRC: irc://irc.freenode.net/#emacs