all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kazuo YAGI <kyagi@miraclelinux.com>
To: bug-gnu-emacs@gnu.org, 八木和生(会社) <kyagi@miraclelinux.com>
Subject: bug#458: [PATCH] Restrain the load message when emacs running with --script option
Date: Sun, 22 Jun 2008 00:15:42 +0900	[thread overview]
Message-ID: <485D1B1E.70705@miraclelinux.com> (raw)

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

             reply	other threads:[~2008-06-21 15:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-21 15:15 Kazuo YAGI [this message]
     [not found] <mailman.13668.1214062038.18990.bug-gnu-emacs@gnu.org>
2008-06-22  8:48 ` bug#458: [PATCH] Restrain the load message when emacs running with --script option Joe Wells
  -- strict thread matches above, loose matches on Subject: below --
2009-07-05  5:10 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

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=485D1B1E.70705@miraclelinux.com \
    --to=kyagi@miraclelinux.com \
    --cc=458@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.