From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johannes Weiner Newsgroups: gmane.emacs.devel Subject: Re: .emacs-settings.el Date: Fri, 7 Sep 2007 14:14:55 +0200 Message-ID: <20070907121455.GA22265@saeurebad.de> References: <60282.128.165.123.18.1189002441.squirrel@webmail.lanl.gov> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0488015372==" X-Trace: sea.gmane.org 1189167319 8263 80.91.229.12 (7 Sep 2007 12:15:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Sep 2007 12:15:19 +0000 (UTC) Cc: bob@rattlesnake.com, emacs-devel@gnu.org To: Davis Herring Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 07 14:15:19 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ITcjs-0002zL-Lk for ged-emacs-devel@m.gmane.org; Fri, 07 Sep 2007 14:15:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITcjr-00062E-B4 for ged-emacs-devel@m.gmane.org; Fri, 07 Sep 2007 08:15:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ITcjn-00061B-2V for emacs-devel@gnu.org; Fri, 07 Sep 2007 08:15:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ITcjl-00060D-CO for emacs-devel@gnu.org; Fri, 07 Sep 2007 08:15:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITcjl-00060A-6Q for emacs-devel@gnu.org; Fri, 07 Sep 2007 08:15:01 -0400 Original-Received: from saeurebad.de ([85.214.36.134]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ITcjj-0002H7-RZ for emacs-devel@gnu.org; Fri, 07 Sep 2007 08:15:00 -0400 Original-Received: by saeurebad.de (Postfix, from userid 1000) id 71E302F0146; Fri, 7 Sep 2007 14:14:55 +0200 (CEST) Mail-Followup-To: Davis Herring , bob@rattlesnake.com, emacs-devel@gnu.org In-Reply-To: <60282.128.165.123.18.1189002441.squirrel@webmail.lanl.gov> User-Agent: Mutt/1.5.16 (2007-06-11) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:78144 Archived-At: --===============0488015372== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Sep 05, 2007 at 07:27:21AM -0700, Davis Herring wrote: > .emacs-settings.el can go in other directories than ~; it affects files > found anywhere in the directory tree that contains it. Moreover, it is > not a file of arbitrary Lisp, but rather contains a set of buffer-local > variables to set in the buffers visiting files it affects, subject to the > normal risk-checking. I would really dislike such files. Imagine every editor has a project-speci= fic configuration file in the project root and you have 10 hackers working on t= his project with 10 different editors. And I would dislike to have a limited set of configuration options within s= uch a file. Configuration is .emacs' concern, so how about the following: (defmacro add-project-locals (directory-action-alist) `(add-hook 'find-file-hook (lambda () ,@(mapcar (lambda (dapair) `(when (string-match (concat "^" ,(car dapair)) (buffer-file-name)) ,(cdr dapair))) directory-action-alist)))) Then you have (add-project-locals (("lisp/" . (message "This is a lisp project")) ("src/emacs-cvs/" . (progn ;; do some emacs code specific stuff here)))) expand to (add-hook 'find-file-hook (lambda () (when (string-match (concat "^" "lisp/")) (buffer-file-name) (message "This is a lisp project")) (when (string-match (concat "^" "src/emacs-cvs/") (buffer-file-name)) (progn ;; do some emacs code specific stuff here)))) Of course, this is just a kludgy hack, but I think the approach itself is n= ot as bad as having emacs-specific setup-files spread all over several project-directories. =09 Hannes --/9DWx/yDrRhgMJTb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFG4UC/dvEGNHGk3KARAo7vAJ0dXtuMNMErx8bR48e323K967013wCgi2ZS HK9mehOdJS0v+Q/CCNAMGA0= =ikTz -----END PGP SIGNATURE----- --/9DWx/yDrRhgMJTb-- --===============0488015372== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============0488015372==--