emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autoloads and subdirectories


From: Stefan Monnier
Subject: Re: Autoloads and subdirectories
Date: Sun, 29 May 2016 11:01:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> The docs of load-file-name don't say what this variable becomes when outside
> of load. It is always nil when load-in-progress is nil?

I believe so, yes.

>> And why do you need to fallback on byte-compile-current-file or
>> buffer-file-name?
> I'd like this code to work when the form is evaluated with C-M-x in an Emacs
> buffer.  Since this isn't in an eval-when-compile form, though, I guess it
> would work to remove the byte-compile-current-file part.

For C-M-x I guess you do need buffer-file-name.  For M-x eval-buffer
you could use

    ;;;###autoload (defconst realgud-subdir-autoloads-name 
"subdirectory-autoloads.el")
    ;;;###autoload (defconst realgud-content-dir)
    ;;;###autoload   (file-name-directory load-file-name))
    ;;;###autoload (with-demoted-errors "Error loading autoloads: %s"
    ;;;###autoload   (load (expand-file-name realgud-subdir-autoloads-name 
realgud-content-dir) t t))


-- Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]