unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* files.el: Patch to make project-settings optional/customizable
@ 2008-11-13 14:29 T.V. Raman
  2008-11-13 15:20 ` Chong Yidong
  0 siblings, 1 reply; 60+ messages in thread
From: T.V. Raman @ 2008-11-13 14:29 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2008-11-24  5:35 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-13 14:29 files.el: Patch to make project-settings optional/customizable T.V. Raman
2008-11-13 15:20 ` Chong Yidong
2008-11-13 16:07   ` Dan Nicolaescu
2008-11-13 16:19     ` Dan Nicolaescu
2008-11-13 16:45       ` Tom Tromey
2008-11-13 17:14         ` Chong Yidong
2008-11-13 17:28           ` Dan Nicolaescu
2008-11-13 17:55             ` Juanma Barranquero
2008-11-13 17:59               ` Dan Nicolaescu
2008-11-13 19:13                 ` Juanma Barranquero
2008-11-13 19:00               ` Tom Tromey
2008-11-13 19:15                 ` Juanma Barranquero
2008-11-13 18:26             ` Chong Yidong
2008-11-13 18:48               ` Dan Nicolaescu
2008-11-18 16:36                 ` Dan Nicolaescu
2008-11-18 22:04                   ` Juri Linkov
2008-11-18 22:15                     ` Dan Nicolaescu
2008-11-18 22:42                       ` Juanma Barranquero
2008-11-18 23:18                         ` Dan Nicolaescu
2008-11-18 23:41                           ` Juanma Barranquero
2008-11-18 22:59                     ` Stefan Monnier
2008-11-18 23:31                       ` Juri Linkov
2008-11-18 23:33                       ` Chong Yidong
2008-11-18 23:41                         ` Dan Nicolaescu
2008-11-18 23:50                           ` Juanma Barranquero
2008-11-19  0:14                             ` Dan Nicolaescu
2008-11-19  1:48                               ` Chong Yidong
2008-11-19  8:26                                 ` Juanma Barranquero
2008-11-19 12:52                               ` Richard M. Stallman
2008-11-18 23:37                       ` Juanma Barranquero
2008-11-19  2:01                         ` Stefan Monnier
2008-11-19  8:39                           ` Juanma Barranquero
2008-11-19 13:27                           ` Dan Nicolaescu
2008-11-19 22:45                           ` Juri Linkov
2008-11-19 22:58                             ` Tom Tromey
2008-11-20  2:18                             ` Stefan Monnier
2008-11-22 19:08                               ` Juri Linkov
2008-11-22 19:40                                 ` Dan Nicolaescu
2008-11-22 19:51                                   ` Juri Linkov
2008-11-22 20:20                                     ` Dan Nicolaescu
2008-11-22 22:03                                       ` Juanma Barranquero
2008-11-23  3:34                                       ` Miles Bader
2008-11-23  5:27                                         ` Stefan Monnier
2008-11-23  5:36                                           ` Juanma Barranquero
2008-11-23  5:58                                             ` Stefan Monnier
2008-11-23  8:10                                           ` Dan Nicolaescu
2008-11-23 10:45                                             ` Juri Linkov
2008-11-23 12:10                                               ` Dan Nicolaescu
2008-11-23 12:41                                                 ` Juanma Barranquero
2008-11-23 17:16                                                   ` Dan Nicolaescu
2008-11-23 17:45                                                     ` Juanma Barranquero
2008-11-23 21:21                                                       ` Dan Nicolaescu
2008-11-24  2:14                                                         ` Stephen J. Turnbull
2008-11-24  3:06                                               ` Dan Nicolaescu
2008-11-24  5:35                                                 ` Chong Yidong
2008-11-22  4:03                             ` Kevin Rodgers
2008-11-19  4:07                         ` Stephen J. Turnbull
2008-11-13 19:04               ` Tom Tromey
2008-11-13 19:23           ` Tom Tromey
2008-11-13 19:55             ` Juanma Barranquero

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).