unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Spencer Baugh <sbaugh@janestreet.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Skipping installation of .el.gz files
Date: Mon, 23 Oct 2023 12:42:31 -0400	[thread overview]
Message-ID: <ierlebte1e0.fsf@janestreet.com> (raw)
In-Reply-To: 83wmvdo9ks.fsf@gnu.org

Eli Zaretskii <eliz@gnu.org> writes:
>> From: Spencer Baugh <sbaugh@janestreet.com>
>> Date: Sun, 22 Oct 2023 20:45:46 -0400
>> 
>> 
>> At my site, I'd like to install the Emacs source code along with Emacs
>> and set source-directory, so that users can easily jump to function
>> definitions and search the Emacs source.
>> 
>> This works great for C function definitions, but Lisp function
>> definitions still jump to the .el.gz files which are installed by "make
>> install".  If I delete those files, jumping to Lisp function definitions
>> stops working entirely.
>> 
>> Is there a clean and supported way to teach Emacs to jump to the files
>> in source-directory instead of the .el.gz ones?
>
> I suggest to override find-lisp-object-file-name with a similar
> definition that does what you want.

Hm, I think what it should do is just, when looking for a Lisp file such
as /usr/share/emacs/29.1/lisp/files.elc, if
/usr/share/emacs/29.1/lisp/files.el and
/usr/share/emacs/29.1/lisp/files.el.gz don't exist, then also check for
(concat source-directory "lisp/files.el") and use that if it exists.
Only for Lisp files in the Emacs installation directory, of course.

This seems generally useful for any user who compiles Emacs from source,
installs it, and then keeps the source directory around.  Now they can
skip installing a duplicate copy of the Lisp files and wasting space,
plus if they choose to do that, then when they jump to definition it
will go directly to the source directory, which is how it already works
for C definitions.

Since this is generally useful, could this be an acceptable patch for
upstream?  Or some variation on it?

Any suggestions on how to reliably figure out the Emacs installation
directory for Lisp files?  I think PATH_LOADSEARCH is what I want, but
that's not exposed to Lisp currently.




  parent reply	other threads:[~2023-10-23 16:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23  0:45 Skipping installation of .el.gz files Spencer Baugh
2023-10-23  5:55 ` Emanuel Berg
2023-10-23  6:41 ` Corwin Brust
2023-10-23 16:18   ` Spencer Baugh
2023-10-23 11:35 ` Eli Zaretskii
2023-10-23 12:28   ` Emanuel Berg
2023-10-28 10:44     ` Eli Zaretskii
2023-10-28 10:52       ` Emanuel Berg
2023-10-23 16:42   ` Spencer Baugh [this message]
2023-10-23 18:39     ` Eli Zaretskii
2023-10-23 20:25       ` Spencer Baugh
2023-10-23 20:57         ` Emanuel Berg
2023-10-24 12:35         ` Eli Zaretskii
2023-10-24 12:49           ` Emanuel Berg

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=ierlebte1e0.fsf@janestreet.com \
    --to=sbaugh@janestreet.com \
    --cc=help-gnu-emacs@gnu.org \
    /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).