unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Max Brieiev <max.brieiev@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 48452@debbugs.gnu.org
Subject: bug#48452: 28.0.50; flymake for elisp does not respect `load-path`
Date: Thu, 14 Jul 2022 12:22:53 +0300	[thread overview]
Message-ID: <87sfn4caky.fsf@gmail.com> (raw)
In-Reply-To: <874jzlp12v.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 13 Jul 2022 15:57:28 +0200")

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Do you have a complete step by step recipe that demonstrates the
> problem?  I tried the original instructions, but got no messages from
> flymake (except complaining that the .emacs file doesn't start with ;;;
> Commentary).

`elisp-flymake-byte-compile' is a flymake backend for the elisp-mode.

It runs emacs in batch mode with -Q flag as a child process to provide
diagnostics for the current buffer.

In this case the `load-path' of the child process includes only builtin
packages, while the `load-path' of the parent process includes all the
directories added by the normal bootstrap process.

The load-path for the child process is controlled with
`elisp-flymake-byte-compile-load-path'. By default, it contains only
current directory.

The following hack "fixed" the issue for me:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: elisp-mode.el.diff --]
[-- Type: text/x-patch, Size: 663 bytes --]

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 0c4a9bfdbe..db3592b903 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -2145,7 +2145,7 @@ current buffer state and calls REPORT-FN when done."
                    "--batch"
                    ;; "--eval" "(setq load-prefer-newer t)" ; for testing
                    ,@(mapcan (lambda (path) (list "-L" path))
-                             elisp-flymake-byte-compile-load-path)
+                             load-path)
                    "-f" "elisp-flymake--batch-compile-for-flymake"
                    ,temp-file)
         :connection-type 'pipe

[-- Attachment #3: Type: text/plain, Size: 74 bytes --]


Can we add some user-friendly knobs to control this behavior of flymake?

      parent reply	other threads:[~2022-07-14  9:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-15 20:46 bug#48452: 28.0.50; flymake for elisp does not respect `load-path` Max Brieiev
2022-07-13 11:47 ` Lars Ingebrigtsen
2022-07-13 13:47   ` Max Brieiev
2022-07-13 13:57     ` Lars Ingebrigtsen
2022-07-13 16:24       ` Max Brieiev
2022-07-14 17:15         ` Lars Ingebrigtsen
2022-07-14 20:29           ` João Távora
2022-07-15  9:46             ` Lars Ingebrigtsen
2022-07-15 10:03               ` João Távora
2022-07-16 10:12                 ` Lars Ingebrigtsen
2022-07-18 19:17                   ` João Távora
2022-07-22 19:52                     ` Lars Ingebrigtsen
2022-07-22 21:09                       ` João Távora
2022-07-22 21:12                         ` Lars Ingebrigtsen
2022-07-22 21:46                           ` João Távora
2022-07-23  5:50                             ` Lars Ingebrigtsen
2022-07-23  9:24                               ` João Távora
2022-07-23 14:26                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-23 17:45                                   ` João Távora
2022-07-23 17:55                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-24  9:18                                     ` Lars Ingebrigtsen
2022-07-24  9:57                                       ` João Távora
2022-07-23 15:05                                 ` Max Brieiev
2022-07-23 17:16                                   ` João Távora
2022-07-15 11:53             ` Max Brieiev
2022-07-14  9:22       ` Max Brieiev [this message]

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=87sfn4caky.fsf@gmail.com \
    --to=max.brieiev@gmail.com \
    --cc=48452@debbugs.gnu.org \
    --cc=larsi@gnus.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).