all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Loading a file vs evaluating its buffer
@ 2014-10-06  7:40 Thorsten Jolitz
  0 siblings, 0 replies; 3+ messages in thread
From: Thorsten Jolitz @ 2014-10-06  7:40 UTC (permalink / raw)
  To: help-gnu-emacs


Hi List, 

when I try to store the installation directory of an app while loading
its init file "A.el" with this code

#+BEGIN_SRC emacs-lisp
(defvar my-installation-directory ""
 "My installation directory.")

(setq my-installation-directory
      (file-name-directory
       (directory-file-name
	(file-name-directory
	 (buffer-file-name)))))
#+END_SRC

I get 

,----
| Load error for /home/tj/junk/el/A.el:
| (wrong-type-argument stringp nil)
`----

but doing M-x eval-buffer in buffer "A.el" works as expected:

,----[ C-h v my-installation-directory RET ]
| my-installation-directory is a variable defined in `A.el'.
| Its value is "/home/tj/junk/"
| 
| Documentation:
| My installation directory.
`----

How can I get the same result when loading the file?

-- 
cheers,
Thorsten




^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <mailman.10550.1412581277.1147.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2014-10-06  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-06  7:40 Loading a file vs evaluating its buffer Thorsten Jolitz
     [not found] <mailman.10550.1412581277.1147.help-gnu-emacs@gnu.org>
2014-10-06  8:15 ` Pascal J. Bourguignon
2014-10-06  8:33   ` Thorsten Jolitz

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.