* loading local abbrevs
@ 2017-06-29 9:21 Héctor Lahoz
2017-06-29 9:59 ` tomas
0 siblings, 1 reply; 5+ messages in thread
From: Héctor Lahoz @ 2017-06-29 9:21 UTC (permalink / raw)
To: help-gnu-emacs
Hi.
I'd like to load a file with local abbrevs when I edit any file in
a given directory. So I put a local variable like:
eval: (read-abbrev-file "abbrev_defs")
but it can't find the abbrev_defs. I think it has to do with
load-path. What can I do? I don't want to use an absolute
path because the path might be changed.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: loading local abbrevs
2017-06-29 9:21 loading local abbrevs Héctor Lahoz
@ 2017-06-29 9:59 ` tomas
2017-06-29 10:31 ` Héctor Lahoz
2017-06-29 13:26 ` Stefan Monnier
0 siblings, 2 replies; 5+ messages in thread
From: tomas @ 2017-06-29 9:59 UTC (permalink / raw)
To: help-gnu-emacs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, Jun 29, 2017 at 11:21:35AM +0200, Héctor Lahoz wrote:
> Hi.
>
> I'd like to load a file with local abbrevs when I edit any file in
> a given directory. So I put a local variable like:
>
> eval: (read-abbrev-file "abbrev_defs")
>
> but it can't find the abbrev_defs. I think it has to do with
> load-path. What can I do? I don't want to use an absolute
> path because the path might be changed.
`read-abbrev-file' calls on `load', which uses the variable
`load-path' to decide where to look for the file. So perhaps
one possibility would be to include "." (i.e. the current
directory) in `load-path': I wouldn't recommend that (to be
honest, I'd be a bit scared to do that, but YMMV).
The other possibility would be to provide an absolute path,
along the lines of
(read-abbrev-file
(concat default-directory "abbrev_defs"))
or thereabouts. Season to taste ;-)
cheers
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAllUz2YACgkQBcgs9XrR2kZlowCfSTIFAL/ZPwcjc42HV2OaK4ht
nvMAn1k6WXTrgWGq60lusbUPxvqx8rey
=4gkm
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: loading local abbrevs
2017-06-29 9:59 ` tomas
@ 2017-06-29 10:31 ` Héctor Lahoz
2017-06-29 13:26 ` Stefan Monnier
1 sibling, 0 replies; 5+ messages in thread
From: Héctor Lahoz @ 2017-06-29 10:31 UTC (permalink / raw)
To: help-gnu-emacs
tomas@tuxteam.de wrote:
>
> The other possibility would be to provide an absolute path,
> along the lines of
>
> (read-abbrev-file
> (concat default-directory "abbrev_defs"))
It works. Thanks. :-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: loading local abbrevs
2017-06-29 9:59 ` tomas
2017-06-29 10:31 ` Héctor Lahoz
@ 2017-06-29 13:26 ` Stefan Monnier
2017-06-29 15:20 ` tomas
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2017-06-29 13:26 UTC (permalink / raw)
To: help-gnu-emacs
> (concat default-directory "abbrev_defs"))
You mean (expand-file-name "abbrev_defs" default-directory)
aka (expand-file-name "abbrev_defs")
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: loading local abbrevs
2017-06-29 13:26 ` Stefan Monnier
@ 2017-06-29 15:20 ` tomas
0 siblings, 0 replies; 5+ messages in thread
From: tomas @ 2017-06-29 15:20 UTC (permalink / raw)
To: help-gnu-emacs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, Jun 29, 2017 at 09:26:53AM -0400, Stefan Monnier wrote:
> > (concat default-directory "abbrev_defs"))
>
> You mean (expand-file-name "abbrev_defs" default-directory)
> aka (expand-file-name "abbrev_defs")
Ahem... yes.
(thanks :-)
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAllVGr4ACgkQBcgs9XrR2kaQMwCfXD6DNWYpcNvY9YEvsmKU8A9l
QY8AnRbHR4ZDdKoufqz+T6X6gMhL324C
=SLxS
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-06-29 15:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-29 9:21 loading local abbrevs Héctor Lahoz
2017-06-29 9:59 ` tomas
2017-06-29 10:31 ` Héctor Lahoz
2017-06-29 13:26 ` Stefan Monnier
2017-06-29 15:20 ` tomas
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.