bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#458: [PATCH] Restrain the load message when emacs running with --scr


From: Kazuo YAGI
Subject: bug#458: [PATCH] Restrain the load message when emacs running with --script option
Date: Sun, 22 Jun 2008 00:15:42 +0900
User-agent: Thunderbird 2.0.0.12 (X11/20080227)

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
--- 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)...",
#!/usr/local/bin/emacs --script 

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

reply via email to

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