From: gebser@speakeasy.net
Subject: Re: "variable [in .emacs] is void"
Date: Mon, 22 Dec 2003 22:11:32 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.44.0312221742400.23118-100000@www> (raw)
In-Reply-To: <m3ad5kj1go.fsf@hamster.pflaesterer.de>
At 17:01 (UTC+0100) on Mon, 22 Dec 2003 Karl Pflästerer said:
= An unnamed person wrote:
=
= ...
=
= You needn't duplicate the `eval-after-load' macro.
=
= > Even tidier and more readable, can I put all the sendmail-dependent
= > defines in a separate (possibly byte-compiled) file and then have
= > something like an "include" in my emacs evaluate them all subject to an
= > (eval-after-load "sendmail" ...)?
=
= Yes. That's the way a lot of people prefer. Like that you don't lose
= the oversight over your config files.
=
; first-try... didn't work
= (eval-after-load "sendmail"
= (load "privhooks"))
For some reason this first try didn't work. But specifying the entire
name and path did-- ungefaehr:
;second-try... worked
(eval-after-load "sendmail"
(load "~/privhooks.el"))
The "load" function, according to the docs, searches the loadpath, not
my home directory. So that part of the failure is understandable.
Then I thought that in the event I later compile privhooks.el, I want
the normal emacs behavior: first look for an *.elc and if that's not
found, then use the *.el. So I tried:
;third-try... didn't work
(eval-after-load "sendmail"
(load "~/privhooks"))
But this didn't work either. So I went back to the full filespec. But
being the fastidious sort, I'd like to make "~/privhooks" work.
The "load" doc says (in part):
(load FILE &optional NOERROR NOMESSAGE NOSUFFIX MUST-SUFFIX)
If optional fourth arg NOSUFFIX is non-nil, don't try adding
suffixes `.elc' or `.el' to the specified name FILE.
If optional fifth arg MUST-SUFFIX is non-nil, insist on
the suffix `.elc' or `.el'; don't accept just FILE unless
it ends in one of those suffixes or includes a directory name.
I would think that load's default behavior would make third-try
workable. But testing shows this isn't the case. So then I must
specify the arg to accomplish this-- I'm guessing something like this:
;fourth try, guessing syntax for five args: all Messaging on.
(eval-after-load "sendmail"
'(load "~/privhooks" nil nil nil t))
Nope. The world still sucks. But hang on... dance around the cauldron
one more time... toss in that eye of newt.
;fifth try, guessing syntax again. Works!
(eval-after-load "sendmail"
(load "~/privhooks" nil nil nil t))
Note the lack of a quote beginning the second line.
Two other things tell me this works, two lines which appear in
*Messages*:
Loading ~/.privhooks (source)...
Error in init file: Symbol's value as variable is void: mail-mode-map
The first line appears approximately whenever the syntax has been
without the quote. (And actually I tried a lot more than what I've
written here.) The second line confirms that the file is being loaded
because "mail-mode-map" only occurs in this file. (Now to figure out
why that part isn't working... again.)
So it's all good now... well, almost all of it. Thanks very much to
Kevin and especially Karl for advancing the emacs movement.
next prev parent reply other threads:[~2003-12-23 3:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.471.1072109811.868.help-gnu-emacs@gnu.org>
2003-12-22 16:01 ` "variable [in .emacs] is void" Karl Pflästerer
2003-12-22 18:28 ` Karl Pflästerer
2003-12-23 3:11 ` gebser [this message]
[not found] <mailman.501.1072152815.868.help-gnu-emacs@gnu.org>
2003-12-23 17:39 ` Kevin Rodgers
2004-01-02 14:53 ` gebser
[not found] <mailman.498.1072144317.868.help-gnu-emacs@gnu.org>
2003-12-23 17:27 ` Kevin Rodgers
[not found] <mailman.431.1072038664.868.help-gnu-emacs@gnu.org>
2003-12-21 20:07 ` Karl Pflästerer
2003-12-22 15:14 ` gebser
2003-12-22 19:27 ` Kevin Rodgers
2003-12-23 0:49 ` gebser
[not found] <mailman.415.1071963863.868.help-gnu-emacs@gnu.org>
2003-12-21 17:18 ` Karl Pflästerer
2003-12-21 19:28 ` gebser
[not found] <mailman.408.1071929942.868.help-gnu-emacs@gnu.org>
2003-12-20 15:29 ` Tim McNamara
2003-12-20 23:58 ` gebser
2003-12-20 16:24 ` Karl Pflästerer
2003-12-20 22:42 ` gebser
2003-12-20 13:16 gebser
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.44.0312221742400.23118-100000@www \
--to=gebser@speakeasy.net \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).