🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #189124

Selective file loading in .emacs

#189124
From: Paul Henning
Date: Wed, 24 Apr 1991 21:40
18 lines
1388 bytes
I was wondering if there is a way to selectively load an .elc file from
.emacs depending on the extension of the file being loaded.  I have heavily
modified the ada.el in the distribution to conform to site requirements
and have compilied into my root directory.  I would like a .emacs that
will load ada2.elc only when someone invokes emacs with "emacs file.a"
where the .a is the important bit of course.

This is what I tried:
(if (eq (substring (buffer-name) 0 -2) ".a" ) (load "~/ada2.elc") nil)

I also substituted 'file-name-nondirectory' for 'buffer-name' but it appears
as if BUFFER and FILE are bound after .emacs is run...

Any suggestions would be greatly appreciated... Sorry if this is completely
novice (I tried FAQ, honestly!).

Paul Henning
phenning@umaxc.weeg.uiowa.edu
Technical Details
Message-ID: <5705@ns-mx.uiowa.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!ns-mx!umaxc.weeg.uiowa.edu!csh007

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,168ec0827c4bd125,start
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-04-25 00:35:12 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!ns-mx!umaxc.weeg.uiowa.edu!csh007
From: csh007@umaxc.weeg.uiowa.edu (Paul Henning)
Newsgroups: gnu.emacs.help
Subject: Selective file loading in .emacs
Message-ID: <5705@ns-mx.uiowa.edu>
Date: 24 Apr 91 21:40:29 GMT
Sender: news@ns-mx.uiowa.edu
Reply-To: csh007@umaxc.weeg.uiowa.edu (Paul Henning)
Distribution: gnu
Organization: U of Iowa, Iowa City, IA
Lines: 18