From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kazuo YAGI Newsgroups: gmane.emacs.bugs Subject: bug#458: [PATCH] Restrain the load message when emacs running with --script option Date: Sun, 22 Jun 2008 00:15:42 +0900 Message-ID: <485D1B1E.70705@miraclelinux.com> Reply-To: Kazuo YAGI , 458@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030101090902000605040808" X-Trace: ger.gmane.org 1214062059 13225 80.91.229.12 (21 Jun 2008 15:27:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Jun 2008 15:27:39 +0000 (UTC) To: bug-gnu-emacs@gnu.org, =?UTF-8?Q?=E5=85=AB=E6=9C=A8=E5=92=8C=E7=94=9F=EF=BC=88=E4=BC=9A=E7=A4=BE=EF=BC=89?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 21 17:28:23 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KA50e-0007rS-EK for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jun 2008 17:28:12 +0200 Original-Received: from localhost ([127.0.0.1]:49411 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KA4zo-0001bN-TM for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jun 2008 11:27:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KA4zl-0001bC-4q for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 11:27:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KA4zj-0001au-AB for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 11:27:16 -0400 Original-Received: from [199.232.76.173] (port=32862 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KA4zj-0001ar-5U for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 11:27:15 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60939) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KA4zh-0001oP-HO for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 11:27:13 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5LFR9WE026977; Sat, 21 Jun 2008 08:27:10 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m5LFK3lS024717; Sat, 21 Jun 2008 08:20:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Kazuo YAGI Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 21 Jun 2008 15:20:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 458 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121406121823500 (code B ref -1); Sat, 21 Jun 2008 15:20:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 21 Jun 2008 15:13:38 +0000 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5LFDYMr023494 for ; Sat, 21 Jun 2008 08:13:36 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KA4mU-0003Y1-4V for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 11:13:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KA4mR-0003Xp-MI for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 11:13:32 -0400 Original-Received: from [199.232.76.173] (port=53213 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KA4mR-0003Xk-Gk for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 11:13:31 -0400 Original-Received: from nm04omta05.auone-net.jp ([210.196.14.82]:1449 helo=nmomta.auone-net.jp) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KA4mQ-0004DC-6b for bug-gnu-emacs@gnu.org; Sat, 21 Jun 2008 11:13:31 -0400 Original-Received: from [192.168.0.2] ([59.139.230.131]) by nm04mta.auone-net.jp id <20080622001324989.MA46.8184150@nm04mta.auone-net.jp>; Sun, 22 Jun 2008 00:13:24 +0900 User-Agent: Thunderbird 2.0.0.12 (X11/20080227) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Sat, 21 Jun 2008 11:27:16 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:18480 Archived-At: This is a multi-part message in MIME format. --------------030101090902000605040808 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 --------------030101090902000605040808 Content-Type: text/x-diff; name="restrain-load-message.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="restrain-load-message.patch" --- 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)...", --------------030101090902000605040808 Content-Type: text/plain; name="cat.el" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="cat.el" IyEvdXNyL2xvY2FsL2Jpbi9lbWFjcyAtLXNjcmlwdCAKCihkb2xpc3QgKGZpbGUgY29tbWFu ZC1saW5lLWFyZ3MtbGVmdCkKCSh3aXRoLWN1cnJlbnQtYnVmZmVyIChmaW5kLWZpbGUtbm9z ZWxlY3QgZmlsZSkKCQkoc2VuZC1zdHJpbmctdG8tdGVybWluYWwgKGJ1ZmZlci1zdHJpbmcp KSkpCg== --------------030101090902000605040808--