GNU bug report logs - #458
[PATCH] Restrain the load message when emacs running with --script option

Previous Next

Package: emacs;

Reported by: Kazuo YAGI <kyagi <at> miraclelinux.com>

Date: Sat, 21 Jun 2008 15:20:03 UTC

Severity: wishlist

Tags: patch

Merged with 4237

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 458 in the body.
You can then email your comments to 458 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#458; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Kazuo YAGI <kyagi <at> miraclelinux.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Kazuo YAGI <kyagi <at> miraclelinux.com>
To: bug-gnu-emacs <at> gnu.org,
        八木和生(会社)
 <kyagi <at> miraclelinux.com>
Subject: [PATCH] Restrain the load message when emacs running with --script
 option
Date: Sun, 22 Jun 2008 00:15:42 +0900
[Message part 1 (text/plain, inline)]
Hi guys,

This is a very simple patch for "src/lread.c" to restrain emacs
to printing the load message when running with --script option.

I also attached the test script(cat.el) to reproduce this bug,
and show how emacs works before/after applying this patch below.

/// BEFORE PATCHED ///////////////////////////////////////////////////
$ ./cat.el cat.el
Loading subst-ksc...
Loading subst-gb2312...
Loading subst-big5...
Loading subst-jis...
#!/usr/local/bin/emacs --script

(dolist (file command-line-args-left)
	(with-current-buffer (find-file-noselect file)
		(send-string-to-terminal (buffer-string))))

/// AFTER  PATCHED ///////////////////////////////////////////////////
$ ./cat.el cat.el
#!/usr/local/bin/emacs --script

(dolist (file command-line-args-left)
	(with-current-buffer (find-file-noselect file)
		(send-string-to-terminal (buffer-string))))

Thanks,
- Kazuo YAGI

; In GNU Emacs 22.2.2 (i686-pc-linux-gnu)
;  of 2008-06-21 on teresa
; Windowing system distributor `The X.Org Foundation', version 11.0.10400090
[restrain-load-message.patch (text/x-diff, inline)]
--- emacs-22.2/src/lread.c	2008-01-10 21:16:15.000000000 +0900
+++ emacs-22.2tmp/src/lread.c	2008-06-21 22:20:52.000000000 +0900
@@ -1003,7 +1003,7 @@ Return t if the file exists and loads su
   if (! NILP (Vpurify_flag))
     Vpreloaded_file_list = Fcons (file, Vpreloaded_file_list);
 
-  if (NILP (nomessage))
+  if (!noninteractive && NILP (nomessage))
     {
       if (!safe_p)
 	message_with_string ("Loading %s (compiled; note unsafe, not compiled in Emacs)...",
[cat.el (text/plain, inline)]
#!/usr/local/bin/emacs --script 

(dolist (file command-line-args-left)
	(with-current-buffer (find-file-noselect file)
		(send-string-to-terminal (buffer-string))))

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#458; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Joe Wells <jbw <at> macs.hw.ac.uk>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #10 received at 458 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Joe Wells <jbw <at> macs.hw.ac.uk>
To: 458 <at> debbugs.gnu.org
Subject: Re: bug#458: [PATCH] Restrain the load message when emacs running with --script option
Date: Sun, 22 Jun 2008 09:48:06 +0100
Kazuo YAGI <kyagi <at> miraclelinux.com> writes:

> This is a very simple patch for "src/lread.c" to restrain emacs
> to printing the load message when running with --script option.

Hurray!  Yes, please install this patch!  This will help silence a lot
of my cron jobs that spew out these loading messages.

-- 
Joe Wells


-- 
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.





Tags added: patch Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Tue, 01 Jul 2008 07:15:03 GMT) Full text and rfc822 format available.

Severity set to `wishlist' from `normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Tue, 01 Jul 2008 07:15:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#458; Package emacs. (Mon, 06 Jul 2009 13:45:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 06 Jul 2009 13:45:05 GMT) Full text and rfc822 format available.

Message #19 received at 458 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Kazuo YAGI <kyagi <at> miraclelinux.com>
Cc: 458 <at> debbugs.gnu.org, Joe Wells <jbw <at> macs.hw.ac.uk>
Subject: Re: [PATCH] Restrain the load message when emacs running with --script option
Date: Sun, 05 Jul 2009 01:10:38 -0400
> This is a very simple patch for "src/lread.c" to restrain emacs to
> printing the load message when running with --script option.

Could you explain why this is a good thing?  If the load message is not
desired, the lisp code should call `load' with a NOERROR argument, or
use `require'.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#458; Package emacs. (Mon, 06 Jul 2009 14:50:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joe Wells <jbw <at> macs.hw.ac.uk>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 06 Jul 2009 14:50:04 GMT) Full text and rfc822 format available.

Message #24 received at 458 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Joe Wells <jbw <at> macs.hw.ac.uk>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Kazuo YAGI <kyagi <at> miraclelinux.com>, 458 <at> debbugs.gnu.org
Subject: Re: [PATCH] Restrain the load message when emacs running with --script option
Date: Mon, 06 Jul 2009 15:45:22 +0100
Chong Yidong <cyd <at> stupidchicken.com> writes:

>> This is a very simple patch for "src/lread.c" to restrain emacs to
>> printing the load message when running with --script option.
>
> Could you explain why this is a good thing?  If the load message is not
> desired, the lisp code should call `load' with a NOERROR argument, or
> use `require'.

For example, I have an Emacs script that prints these messages in the
middle of its run:

  Loading subst-ksc...
  Loading subst-gb2312...
  Loading subst-big5...
  Loading subst-jis...

These are not files I loaded directly.  Some package which is not
under the control of ordinary users is loading them.

It is this kind of message that needs to be silenced.

I hope this helps.

-- 
Joe

P.S.  I'm not entirely sure why I got CC-ed on this message, but I'm
happy to comment on it!


-- 
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#458; Package emacs. (Mon, 06 Jul 2009 14:55:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 06 Jul 2009 14:55:08 GMT) Full text and rfc822 format available.

Message #29 received at 458 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Joe Wells <jbw <at> macs.hw.ac.uk>
Cc: Kazuo YAGI <kyagi <at> miraclelinux.com>, 458 <at> debbugs.gnu.org
Subject: Re: [PATCH] Restrain the load message when emacs running with --script option
Date: Mon, 06 Jul 2009 10:52:35 -0400
Joe Wells <jbw <at> macs.hw.ac.uk> writes:

> For example, I have an Emacs script that prints these messages in the
> middle of its run:
>
>   Loading subst-ksc...
>   Loading subst-gb2312...
>   Loading subst-big5...
>   Loading subst-jis...
>
> These are not files I loaded directly.  Some package which is not
> under the control of ordinary users is loading them.

Could you find out which package is performing this noisy loading?
Normally, packages should use `require', which does not emit messages
when loading.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#458; Package emacs. (Thu, 09 Jul 2009 18:00:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joe Wells <jbw <at> macs.hw.ac.uk>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 09 Jul 2009 18:00:04 GMT) Full text and rfc822 format available.

Message #34 received at 458 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Joe Wells <jbw <at> macs.hw.ac.uk>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Kazuo YAGI <kyagi <at> miraclelinux.com>, 458 <at> debbugs.gnu.org
Subject: Re: [PATCH] Restrain the load message when emacs running with --script option
Date: Thu, 09 Jul 2009 18:52:43 +0100
Chong Yidong <cyd <at> stupidchicken.com> writes:

> Joe Wells <jbw <at> macs.hw.ac.uk> writes:
>
>> For example, I have an Emacs script that prints these messages in the
>> middle of its run:
>>
>>   Loading subst-ksc...
>>   Loading subst-gb2312...
>>   Loading subst-big5...
>>   Loading subst-jis...
>>
>> These are not files I loaded directly.  Some package which is not
>> under the control of ordinary users is loading them.
>
> Could you find out which package is performing this noisy loading?
> Normally, packages should use `require', which does not emit messages
> when loading.

Sorry, don't have time to track this down.  Other packages have other
problems.  For example, on another system, I have a Emacs script that
emits these messages:

  Loading /usr/share/emacs/site-lisp/site-start.d/auctex-init.el (source)...
  Loading /usr/share/emacs/site-lisp/site-start.d/auctex.el (source)...
  Loading /usr/share/emacs/site-lisp/site-start.d/ess-init.el (source)...
  Loading /usr/share/emacs/site-lisp/site-start.d/focus-init.el (source)...
  Loading /usr/share/emacs/site-lisp/site-start.d/igrep-init.el (source)...
  Loading /usr/share/emacs/site-lisp/site-start.d/logo-mode.el (source)...
  Loading /usr/share/emacs/site-lisp/site-start.d/php-mode-init.el (source)...
  Loading /usr/share/emacs/site-lisp/site-start.d/po-mode-init.el (source)...
  Loading /usr/share/emacs/site-lisp/site-start.d/preview-latex.el (source)...
  Loading /usr/share/emacs/site-lisp/site-start.d/psgml-init.el (source)...
  Loading /usr/share/emacs/site-lisp/site-start.d/rpm-spec-mode-init.el (source)...
  Loading /usr/local/share/emacs/site-lisp/sml-mode/sml-mode-startup.el (source)...
  Loading subst-ksc...
  Loading subst-gb2312...
  Loading subst-big5...
  Loading subst-jis...
  Loading quail/latin-ltx...
  
  
  
  Loading vc-cvs...

In this case, a bunch of extra loading messages get printed by
site-specific initialization files that come with extra packages (from
Fedora).

(By the way, I don't know what is printing the 3 blank lines in the
middle of the messages above.)

In general, it would be nice if there was a global variable which when
non-nil means “don't print any loading messages at all right now” and
if using the --script command-line option set this variable to t.

I hope this message helps.

-- 
Joe


-- 
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#458; Package emacs. (Thu, 09 Jul 2009 22:00:03 GMT) Full text and rfc822 format available.

Message #37 received at 458 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: Joe Wells <jbw <at> macs.hw.ac.uk>
Cc: 458 <at> debbugs.gnu.org, Chong Yidong <cyd <at> stupidchicken.com>,
        Kazuo YAGI <kyagi <at> miraclelinux.com>
Subject: Re: bug#458: [PATCH] Restrain the load message when emacs running with --script option
Date: Thu, 9 Jul 2009 14:51:44 -0700 (PDT)
Joe Wells <jbw <at> macs.hw.ac.uk> writes:

  > Chong Yidong <cyd <at> stupidchicken.com> writes:
  > 
  > > Joe Wells <jbw <at> macs.hw.ac.uk> writes:
  > >
  > >> For example, I have an Emacs script that prints these messages in the
  > >> middle of its run:
  > >>
  > >>   Loading subst-ksc...
  > >>   Loading subst-gb2312...
  > >>   Loading subst-big5...
  > >>   Loading subst-jis...
  > >>
  > >> These are not files I loaded directly.  Some package which is not
  > >> under the control of ordinary users is loading them.
  > >
  > > Could you find out which package is performing this noisy loading?
  > > Normally, packages should use `require', which does not emit messages
  > > when loading.
  > 
  > Sorry, don't have time to track this down.  Other packages have other
  > problems.  For example, on another system, I have a Emacs script that
  > emits these messages:
  > 
  >   Loading /usr/share/emacs/site-lisp/site-start.d/auctex-init.el (source)...
  >   Loading /usr/share/emacs/site-lisp/site-start.d/auctex.el (source)...
  >   Loading /usr/share/emacs/site-lisp/site-start.d/ess-init.el (source)...
  >   Loading /usr/share/emacs/site-lisp/site-start.d/focus-init.el (source)...
  >   Loading /usr/share/emacs/site-lisp/site-start.d/igrep-init.el (source)...
  >   Loading /usr/share/emacs/site-lisp/site-start.d/logo-mode.el (source)...
  >   Loading /usr/share/emacs/site-lisp/site-start.d/php-mode-init.el (source)...
  >   Loading /usr/share/emacs/site-lisp/site-start.d/po-mode-init.el (source)...
  >   Loading /usr/share/emacs/site-lisp/site-start.d/preview-latex.el (source)...
  >   Loading /usr/share/emacs/site-lisp/site-start.d/psgml-init.el (source)...
  >   Loading /usr/share/emacs/site-lisp/site-start.d/rpm-spec-mode-init.el (source)...
  >   Loading /usr/local/share/emacs/site-lisp/sml-mode/sml-mode-startup.el (source)...

These looks like a Fedora (or RedHat system) system, site-start.el loads
these files.
site-start.el is not provided by emacs, but by the distribution.
You can ask them to use the NOMESSAGE argument to `load' ...



Forcibly Merged 458 4237. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Sat, 22 Aug 2009 20:20:05 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#458; Package emacs. (Wed, 11 Apr 2012 12:18:02 GMT) Full text and rfc822 format available.

Message #42 received at 458 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Dan Nicolaescu <dann <at> ics.uci.edu>
Cc: 458 <at> debbugs.gnu.org, Joe Wells <jbw <at> macs.hw.ac.uk>,
	Chong Yidong <cyd <at> stupidchicken.com>, Kazuo YAGI <kyagi <at> miraclelinux.com>
Subject: Re: bug#458: [PATCH] Restrain the load message when emacs running
	with --script option
Date: Wed, 11 Apr 2012 14:15:49 +0200
Dan Nicolaescu <dann <at> ics.uci.edu> writes:

> site-start.el is not provided by emacs, but by the distribution.
> You can ask them to use the NOMESSAGE argument to `load' ...

Yeah, this seems like a bug in the Fedora setup, and not something that
needs fixing in Emacs, so I'm closing this report.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




bug closed, send any further explanations to 458 <at> debbugs.gnu.org and Kazuo YAGI <kyagi <at> miraclelinux.com> Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 11 Apr 2012 12:18:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 May 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.