all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: directory specific configuration
Date: Tue, 21 Jul 2009 17:02:11 +0200	[thread overview]
Message-ID: <87my6y6pvw.fsf@tux.homenetwork> (raw)
In-Reply-To: 24585256.post@talk.nabble.com

Hi,

giampi <giampisalvi@gmail.com> writes:

> Hi all,
> short version of the question: is there a way to make emacs read (besides
> the local ~/.emacs file) also a directory specific .emacs file, in case that
> file exists?
>
> long version: I use emacs to write latex files. I often use different
> languages and therefore would like to use different dictionaries in ispell.
> I also often split the document in several tex files, so, every time I have
> to set the dictionary manually for each file. Each document is in a
> different directory, so it would be practical for me to have an automatic
> way to always start emacs with the right dictionary depending on the
> directory I run from (or, better, depending on the location of the file I
> open).
>
> I bet this would require just a few lines of lisp in ~/.emacs that do:
> 1) get directory of the file I'm opening
> 2) check if a .emacs file exists for that directory
> 3) source the .emacs file
> Unfortunately I'm no lisp programmer, so any help would be appreciated.
>
> Thank you!
> Giampiero
>
> If it is relevant, I'm using GNU Emacs 23.0.91.1 on an Ubuntu 9.04 machine

An other approach is to set by file the dictionnary you want to use by
adding these lines at end of your files: (change the comments strings,
depending the mode you use e.g latex)

,----
| # Local Variables:
| # ispell-local-dictionary: "english"
| # End:
`----

With this example when you launch flyspell-mode in this buffer, you will
have the english dictionnary.


-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





  reply	other threads:[~2009-07-21 15:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21 10:30 directory specific configuration giampi
2009-07-21 15:02 ` Thierry Volpiatto [this message]
     [not found] <mailman.2911.1248187239.2239.help-gnu-emacs@gnu.org>
2009-07-21 15:16 ` Pascal J. Bourguignon
2009-07-21 15:27 ` Dmitry Dzhus
2009-07-21 15:48   ` giampi
     [not found]   ` <mailman.2919.1248191311.2239.help-gnu-emacs@gnu.org>
2009-07-22  7:13     ` Peter Brett
     [not found] ` <mailman.2916.1248190162.2239.help-gnu-emacs@gnu.org>
2009-07-22  8:58   ` Pascal J. Bourguignon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87my6y6pvw.fsf@tux.homenetwork \
    --to=thierry.volpiatto@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.