emacs-devel
[Top][All Lists]
Advanced

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

Re: Easy configuration of a site-lisp directory


From: Basil L. Contovounesios
Subject: Re: Easy configuration of a site-lisp directory
Date: Wed, 11 Aug 2021 14:42:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Stefan Monnier <monnier@iro.umontreal.ca>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  emacs-devel@gnu.org,
>>  arthur.miller@live.com,  yuri.v.khan@gmail.com
>> Date: Tue, 10 Aug 2021 16:51:29 -0400
>> 
>> Clément Pit-Claudel [2021-08-10 14:06:53] wrote:
>> > On 8/10/21 1:50 PM, Eli Zaretskii wrote:
>> >> and use the TAGS table there, M-. will give you sources in
>> >> Git, not those of the installed Emacs.
>> > Yep, that's the part I was missing: setting up Elisp tags to point to the
>> > git repo.  There's a nice magic to the way it works with C sources that
>> > isn't the same with the (installed) Elisp sources, that's it.
>> 
>> The magic is the `find-function-C-source-directory` variable
>
> That's irrelevant to M-. I think.

FWIW, I run an installed Emacs, but tell M-. to prefer the Git sources
with the following MWE:

(defvar blc-dataroot-dir
  (file-name-directory (directory-file-name data-directory))
  "Machine-independent data root directory.")

(defun blc-dataroot-to-src (file)
  "Map FILE under `blc-dataroot-dir' to `source-directory'.
Return FILE unchanged if not under `blc-dataroot-dir'."
  (if (and (stringp file)
           (file-in-directory-p file blc-dataroot-dir))
      (expand-file-name (file-relative-name file blc-dataroot-dir)
                        source-directory)
    file))

(define-advice find-function-search-for-symbol
    (:around (search sym type lib) blc-dataroot-to-src)
  "Pass LIB through `blc-dataroot-to-src'."
  (funcall search sym type (blc-dataroot-to-src lib)))

-- 
Basil



reply via email to

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