Subject: bug#15252: closed (Re: bug#15252: dir-locals: superdir (or parentdir) support)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 15 Nov 2013 04:57:02 +0000

Your bug report

#15252: dir-locals: superdir (or parentdir) support

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
15252: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15252
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#15252: dir-locals: superdir (or parentdir) support
From: Jambunathan K <[email-masked]>
To: [email-masked]
Date: Fri, 15 Nov 2013 10:25:31 +0530
List-Id: <debbugs-submit.debbugs.gnu.org>

OP here.  Closed.

Subject: dir-locals: superdir (or parentdir) support
From: Jambunathan K <[email-masked]>
To: [email-masked]
Date: Tue, 03 Sep 2013 09:09:15 +0530
List-Id: <debbugs-submit.debbugs.gnu.org>

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.