From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.bugs Subject: bug#15252: dir-locals: superdir (or parentdir) support Date: Tue, 03 Sep 2013 09:09:15 +0530 Message-ID: <877geyo9p8.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1378179502 18227 80.91.229.3 (3 Sep 2013 03:38:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Sep 2013 03:38:22 +0000 (UTC) To: 15252@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 03 05:38:24 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VGhRf-0002uN-Bl for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Sep 2013 05:38:23 +0200 Original-Received: from localhost ([::1]:42942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGhRe-00030S-EO for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Sep 2013 23:38:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGhRT-0002nC-AO for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2013 23:38:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGhRK-0008EU-TW for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2013 23:38:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGhRK-0008EQ-QB for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2013 23:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VGhRK-0004fo-D5 for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2013 23:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jambunathan K Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Sep 2013 03:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15252 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.137817945817912 (code B ref -1); Tue, 03 Sep 2013 03:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Sep 2013 03:37:38 +0000 Original-Received: from localhost ([127.0.0.1]:38177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VGhQv-0004en-Sr for submit@debbugs.gnu.org; Mon, 02 Sep 2013 23:37:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33252) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VGhQt-0004eP-UZ for submit@debbugs.gnu.org; Mon, 02 Sep 2013 23:37:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGhQg-0007ss-1P for submit@debbugs.gnu.org; Mon, 02 Sep 2013 23:37:30 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:43811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGhQf-0007so-V1 for submit@debbugs.gnu.org; Mon, 02 Sep 2013 23:37:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGhQX-0002cU-HI for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2013 23:37:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGhQP-0007qc-2j for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2013 23:37:13 -0400 Original-Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]:57295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGhQO-0007qU-RR for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2013 23:37:05 -0400 Original-Received: by mail-pa0-f45.google.com with SMTP id bg4so5847129pad.18 for ; Mon, 02 Sep 2013 20:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; bh=ENTRrYruEV92/mSgcNsfSLLxZXkluKRAEy53IFtDMfg=; b=nIQ45fSnMOE1NDEZPCUP1ja3GCrVUFk7cQG8xnuAoYP7bYeUVFbt7yhpg9bZbbxZMw 1EHDUtM1KDKeWPMi4kgb+pZ+tsCOZeElDyFI5i+kretrByq14JtKEsbu3mksuoPXSke4 wc4T2yPew7chaVjTz6TvvCxkPfXTo6vlF7aDPWsDq6ndGawR0VskbJOKc4fhXWZICe0A U6uZw+YTEUK8HT6TBpSM23q2LqRfyOcil3qfiGoxdERB+HGby01j2kfqhujhZZpfyjlk pA7mg9XnVD3PDGqgKoa5riM/bZ+QxaBT3ZTxVZnqhTChUGxfK7mgHsZYfNYYodqRUze0 K7XA== X-Received: by 10.66.188.203 with SMTP id gc11mr29084262pac.63.1378179423892; Mon, 02 Sep 2013 20:37:03 -0700 (PDT) Original-Received: from porunai ([101.63.191.5]) by mx.google.com with ESMTPSA id wp8sm19302270pbc.26.1969.12.31.16.00.00 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 02 Sep 2013 20:37:03 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:77935 Archived-At: 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.