all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xiyue Deng <manphiz@gmail.com>
To: Michael Heerdegen via "Emacs development discussions."
	<emacs-devel@gnu.org>
Cc: Michael Heerdegen <michael_heerdegen@web.de>
Subject: Re: Question regarding load-path handling for ELPA packages
Date: Sun, 19 May 2024 23:06:34 -0700	[thread overview]
Message-ID: <87ikz93tlh.fsf@debian-hx90.lan> (raw)
In-Reply-To: <87jzjpsgsw.fsf@web.de> (Michael Heerdegen via's message of "Sun,  19 May 2024 22:11:27 +0200")

Hi Michael,

Michael Heerdegen via "Emacs development discussions."
<emacs-devel@gnu.org> writes:

> Xiyue Deng <manphiz@gmail.com> writes:
>
>> Actually I'd like to make dh-elpa handle `load-path' of its package
>> installation directory (by default it's
>> `/usr/share/emacs/site-lisp/elpa/foo') the same as how package.el
>> handles any ELPA package, a.k.a. only add the installation path to
>> `load-path' but not its subdirectories recursively.  Hopefully with your
>> pointer I can figure this out, which make take a while.
>
> Does dh-elpa generate autoloads?  Can that process maybe even just call
> `package-generate-autoloads'?
>
> Anyway, all the magic is the addition of this (constant!) expression:
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path
>              (or (and load-file-name
>                       (directory-file-name
>                        (file-name-directory load-file-name)))
>                  (car load-path)))
> #+end_src
>
> to the generated loaddefs files.  "Constant" means: file names are not
> substituted in that expression - i.e. really that expression literally.
>
> This works because when the according autoloads file is loaded the
> variable `load-file-name' then contains the according current file name
> and ... etc, you get it?
>
> Anyway, ask as many question as you need to understand the process.
>
> If you do want to ask a developer more involved you can for example CC
> Stefan Monnier <monnier@iro.umontreal.ca> though, I think so far I
> answered your questions correctly.
>
>
> Michael.
>
>

Thanks for your expanded explanations and code pointers!  It helped me a
lot in understanding how package.el handles `load-path'.  After some
more investigation, it turns out the behavior I observe in dh-elpa
installation path is actually a result of the existence of subdirs.el in
its parent directory.  I have added an extended explanations in the
Debian tracking bug[1].

I think one last question I'd like to ask is the direction of
subdirectory handling in ELPA packages.  Though currently the case of
auctex may cause breakage, this is in the minority and hence fixing it
can be localized to just one package, while there may be benefits to do
so for other cases.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1069210#15

-- 
Xiyue Deng



  reply	other threads:[~2024-05-20  6:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10  3:09 Question regarding load-path handling for ELPA packages Xiyue Deng
2024-05-17 16:30 ` Xiyue Deng
2024-05-17 17:33   ` Michael Heerdegen via Emacs development discussions.
2024-05-17 21:32     ` Xiyue Deng
2024-05-18 15:18       ` Michael Heerdegen via Emacs development discussions.
2024-05-18 21:04         ` Michael Heerdegen via Emacs development discussions.
2024-05-19  7:29         ` Xiyue Deng
2024-05-19 20:11           ` Michael Heerdegen via Emacs development discussions.
2024-05-20  6:06             ` Xiyue Deng [this message]
2024-05-22 15:53               ` Michael Heerdegen
2024-05-23  1:42                 ` Xiyue Deng
2024-05-26 13:55                   ` Michael Heerdegen
2024-05-27  5:30                     ` Xiyue Deng
2024-05-17 21:33   ` Michael Heerdegen via Emacs development discussions.

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ikz93tlh.fsf@debian-hx90.lan \
    --to=manphiz@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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.
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.