unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#458: [PATCH] Restrain the load message when emacs running with --script option
@ 2009-07-05  5:10 Chong Yidong
  2009-07-06 14:45 ` Joe Wells
  0 siblings, 1 reply; 8+ messages in thread
From: Chong Yidong @ 2009-07-05  5:10 UTC (permalink / raw)
  To: Kazuo YAGI; +Cc: Joe Wells, 458

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





^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <mailman.13668.1214062038.18990.bug-gnu-emacs@gnu.org>]
* bug#458: [PATCH] Restrain the load message when emacs running with --script option
@ 2008-06-21 15:15 Kazuo YAGI
  0 siblings, 0 replies; 8+ messages in thread
From: Kazuo YAGI @ 2008-06-21 15:15 UTC (permalink / raw)
  To: bug-gnu-emacs,
	八木和生(会社)

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

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

[-- Attachment #2: restrain-load-message.patch --]
[-- Type: text/x-diff, Size: 471 bytes --]

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

[-- Attachment #3: cat.el --]
[-- Type: text/plain, Size: 166 bytes --]

#!/usr/local/bin/emacs --script 

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-04-11 12:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-05  5:10 bug#458: [PATCH] Restrain the load message when emacs running with --script option Chong Yidong
2009-07-06 14:45 ` Joe Wells
2009-07-06 14:52   ` Chong Yidong
2009-07-09 17:52     ` Joe Wells
2009-07-09 21:51       ` Dan Nicolaescu
2012-04-11 12:15         ` Lars Magne Ingebrigtsen
     [not found] <mailman.13668.1214062038.18990.bug-gnu-emacs@gnu.org>
2008-06-22  8:48 ` Joe Wells
  -- strict thread matches above, loose matches on Subject: below --
2008-06-21 15:15 Kazuo YAGI

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