unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Eason Huang <aqua0210@foxmail.com>, 61014@debbugs.gnu.org
Subject: bug#61014: 29.0.60; flymake-mode stderr warning is confusing when edit the init.el or eary-init.el
Date: Thu, 26 Jan 2023 11:16:39 +0000	[thread overview]
Message-ID: <87fsbxlf54.fsf@gmail.com> (raw)
In-Reply-To: <831qnljt26.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 23 Jan 2023 15:09:53 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> 1. create a new .emacs.d folder in the HOME directory
>> 2. create an empty init.e and eary-init.el file in the .emacs.d folder
>> 3. Start Emacs and C-x, C-f open the init.el or early.el
>> 4. M-x flymake-mode, add some blank lines in the init.el or early.el
>> 5. C-x b, Switch to buffer:  *stderr of elisp-flymake-byte-compile*
>> Now you will see the warnings.
>
> João, any comments?  The warning comes from startup.el, but it is
> triggered by what Flymake does, AFAICT.

Sorry for taking so long.

Yes, I have comments.

First of all, let's make it clear that this warning happens in a hidden
Flymake buffer, an implementation detail which stores the stderr output
of the subprocess(es) invoked.  It does not appear in the interactive
seeion's *Warnings* buffer.  Unless I've missed something, the user is
never confronted with it or hindered by it in any way.  It seems to be
largely benign.

The warning only become visible when switching to a specific hidden
buffer, like Eason did, and that operation is more accurately described
as an introspection feature intended for developers, not for users.

So, to summarize, the warning is coming from the subprocess
non-interactive Emacs spawned by the interactive Emacs where
flymake-mode is turned on.  In the interactive Emacs session, nothing
special is going on.

The reason elisp-flymake-byte-compile-load-path has a default value of
"./" is to help with the primary use case for the
elisp-flymake-byte-compile Flymake backend: developing libraries that
`require` other .el libraries.  Such .el files often live in the same
directory of the file/buffer you are editing with flymake-mode turned
on.  So when you're editing x/y/z/foo.el and you type

  (require 'foo-utils)

elisp-flymake-byte-compile will understand that to syntax-check foo.el
with the byte-compiler it needs to load "x/u/z/foo-utils.el".

In Eason's case, the user happens to be editing a .el file in a special
Emacs directory where such a use case is unlikely (though not
impossible).  So every few changes the user does to the buffer,
flymake-mdoe will invoke a Emacs subprocess and give it this particular
load-path initialization, that, in the specific acse of ~/.emacs.d, is
slightly non-orthodox.  And thus the subprocess emacs complains with
this warning which is recorded in the special hidden buffer.

If we're really worries about this, we could special-case this directory
elisp-mode.el.  But I also don't see what the harm could be.  So my
advice is to only do this when someone describes real harm.

João





  reply	other threads:[~2023-01-26 11:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23  2:15 bug#61014: 29.0.60; flymake-mode stderr warning is confusing when edit the init.el or eary-init.el Eason Huang
2023-01-23 13:09 ` Eli Zaretskii
2023-01-26 11:16   ` João Távora [this message]
2023-01-28 11:21     ` Eli Zaretskii
2023-02-02 10:25       ` Eli Zaretskii
2023-02-02 10:50         ` João Távora
2023-02-02 16:01       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-02 17:15         ` Eli Zaretskii
2023-02-12 12:22         ` Eli Zaretskii
2023-02-12 14:45           ` Eason Huang
2023-02-12 14:50             ` Eli Zaretskii

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=87fsbxlf54.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=61014@debbugs.gnu.org \
    --cc=aqua0210@foxmail.com \
    --cc=eliz@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.
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).