GNU bug report logs - #15252
dir-locals: superdir (or parentdir) support

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Tue, 3 Sep 2013 03:38:02 UTC

Severity: wishlist

Done: Jambunathan K <kjambunathan <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: dir-locals: superdir (or parentdir) support
Date: Tue, 03 Sep 2013 09:09:15 +0530
Introductory word:

I am having a private library that implements a unified search
interface.  It will use `cscope' as search engine while visiting *.[ch]
files and `rgrep' as search engine while visiting *.el files.  

The search as it stands will be on the whole of search tree.

It is "specified" in as .dir-locals.el as below.


~/src/emacs/trunk/.dir-locals.el:

    ((c-mode
      (search-dir . "~/src/emacs/trunk/")
      (search-engine . cscope))
     (emacs-lisp-mode
      (search-dir . "~/src/emacs/trunk/lisp")
      (search-engine . rgrep)))

----------------------------------------------------------------

Problem:


If I am visiting an Org file (say trunk/lisp/org/org.el), the recursive
search *on whole lisp tree* happens just fine.

But if I am visiting a Gnus file (say trunk/lisp/org/org.el), the
recursive search fails.


----------------------------------------------------------------

Diagnosis:


The reason is this because Gnus has it's own .dir-locals.el for lisp
files.

~/src/emacs/trunk/lisp/gnus/.dir-locals.el:

    ((emacs-lisp-mode . ((show-trailing-whitespace . t))))


----------------------------------------------------------------

What I need:

So to realize my use case, I want that the "emacs-lisp-mode" settings
from Gnus tree be merged with that specified from trunk.

----------------------------------------------------------------

One possible way to achieve it:


Introduce a `superdir' or a `parentdir' keyword, to traverse till the
root.

~/src/emacs/trunk/lisp/gnus/.dir-locals.el:

    ((emacs-lisp-mode . ((show-trailing-whitespace . t)
			 (superdir . t) ; <=====================
			 )))


Compare `superdir' to the already existing `subdir'.  From 

(info "(emacs) Directory Variables")

    ((c-mode . ((c-file-style . "BSD")
                (subdirs . nil) ; <=====================
                )))

----------------------------------------------------------------

Closing note:

Particularly useful for "submodules" which are part of a "sumo" project.








This bug report was last modified 11 years and 186 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.