From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Re: dirvars.el 1.3 Date: Tue, 20 Jun 2006 13:56:56 +0900 (JST) Message-ID: <20060620.135656.237951233.jet@gyve.org> References: <87k67ih5j5.fsf@penguin.brutt.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1150779452 19666 80.91.229.2 (20 Jun 2006 04:57:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 20 Jun 2006 04:57:32 +0000 (UTC) Cc: matt@lickey.com, rutt.4@osu.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 20 06:57:29 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FsYIp-0002vF-B3 for ged-emacs-devel@m.gmane.org; Tue, 20 Jun 2006 06:57:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsYIo-0000wh-V8 for ged-emacs-devel@m.gmane.org; Tue, 20 Jun 2006 00:57:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FsYIV-0000vn-8C for emacs-devel@gnu.org; Tue, 20 Jun 2006 00:57:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FsYIR-0000rr-0e for emacs-devel@gnu.org; Tue, 20 Jun 2006 00:57:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsYIQ-0000ro-TL for emacs-devel@gnu.org; Tue, 20 Jun 2006 00:57:02 -0400 Original-Received: from [210.130.0.20] (helo=mo01.iij4u.or.jp) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FsYSr-0002zJ-Bn; Tue, 20 Jun 2006 01:07:49 -0400 Original-Received: MO(mo01)id k5K4uvjF003923; Tue, 20 Jun 2006 13:56:57 +0900 (JST) Original-Received: from localhost (h219-110-076-092.catv01.itscom.jp [219.110.76.92]) by r-kk.iij4u.or.jp (4U-MR/r-kk) id k5K4uuXI017265; Tue, 20 Jun 2006 13:56:57 +0900 (JST) Original-To: rms@gnu.org In-Reply-To: X-Mailer: Mew version 4.2.53 on Emacs 22.0.51 / Mule 5.0 (SAKAKI) 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:56020 Archived-At: > People on emacs-devel, would you please look at the code > and see if it is good enough to include? I think it is quite useful. How about adding following two functions? (defun edit-dirvars-file () "Edit dirvars file for the current buffer." (interactive) (let ((dirvars-file (dirvars-find-upwards dirvars-file-name))) (if dirvars-file (find-file dirvars-file) (when (and (interactive-p) (y-or-n-p (format "Cannot find dirvars file for the current buffer. Create %s" dirvars-file-name))) (let ((dir (read-directory-name "At which directory? "))) (find-file (concat (file-name-as-directory dir) dirvars-file-name))))))) Further more it is nice if it is possible to reload a dirvars file in all buffers which share the dirvars fileafter editing the dirvars file. (defun dirvars-list-buffers (common-dirvars-file) "Returns list of buffers which share COMMON-DIRVARS-FILE as dirvars file." (setq common-dirvars-file (expand-file-name common-dirvars-file)) (let (buffers) (dolist (buffer (buffer-list) buffers) (with-current-buffer buffer (when (string= common-dirvars-file (dirvars-find-upwards dirvars-file-name)) (setq buffers (cons buffer buffers))))))) This is for eager emacs lisp programmers. With this function, for example, you can filter the output of C-x C-b. Generally a heavy emacs user loads too many files onto running emacs. So too many files are listed on C-x C-b buffers. In the case that the user wants to switch to the buffer associated with the file under the same sub directory tree, list all buffers are too enough. dirvars-list-buffers can return the the buffer associated with the file under the same sub directory tree if dirvars file exists. Masatake YAMATO