From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: mail@justinbogner.com Newsgroups: gmane.emacs.devel Subject: [PATCH] Fix fortune's handling of arguments Date: Wed, 10 Sep 2008 22:58:01 -0600 Message-ID: <87zlmfcm92.fsf@justinbogner.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221109443 18875 80.91.229.12 (11 Sep 2008 05:04:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2008 05:04:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 11 07:04:57 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KdeLx-0007Sa-7h for ged-emacs-devel@m.gmane.org; Thu, 11 Sep 2008 07:04:25 +0200 Original-Received: from localhost ([127.0.0.1]:52302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdeKw-0001eE-R8 for ged-emacs-devel@m.gmane.org; Thu, 11 Sep 2008 01:03:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KdeKs-0001e9-2l for emacs-devel@gnu.org; Thu, 11 Sep 2008 01:03:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KdeKq-0001dx-5e for emacs-devel@gnu.org; Thu, 11 Sep 2008 01:03:17 -0400 Original-Received: from [199.232.76.173] (port=57976 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdeKq-0001du-1f for emacs-devel@gnu.org; Thu, 11 Sep 2008 01:03:16 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:47903 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KdeKp-0000YN-Cz for emacs-devel@gnu.org; Thu, 11 Sep 2008 01:03:15 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KdeKl-0008Oj-Fw for emacs-devel@gnu.org; Thu, 11 Sep 2008 05:03:11 +0000 Original-Received: from s010600131023ed49.ed.shawcable.net ([68.149.184.55]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Sep 2008 05:03:11 +0000 Original-Received: from mail by s010600131023ed49.ed.shawcable.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Sep 2008 05:03:11 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 55 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: s010600131023ed49.ed.shawcable.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:J0yzDCOGI9hj3Rl3TANBnuIYrDM= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:103795 Archived-At: On the current CVS, since before August 7th, the custom fortune-program-options doesn't behave properly. To reproduce, assuming you have some fortune cookies in /usr/share/games/fortunes/: emacs -Q (set-variable 'fortune-file "/usr/share/games/fortunes/") (set-variable 'fortune-program-options "-s") (fortune) Using the string "-s " instead of "-s" has the same result. The following patch fixes this by changing the type of fortune-program-options to a list of strings so that call-process can be called properly. Using this patch one sets the variable more like: (set-variable 'fortune-program-options '("-s")) -- Shut off engine before fueling. ===File ~/src/emacs/fortune-args.patch====================== diff --git a/lisp/play/fortune.el b/lisp/play/fortune.el index 5e25eba..b008443 100644 --- a/lisp/play/fortune.el +++ b/lisp/play/fortune.el @@ -87,9 +87,9 @@ Normally you won't have a reason to change it." "Program to select a fortune cookie." :type 'string :group 'fortune) -(defcustom fortune-program-options "" - "Options to pass to the fortune program (a string)." - :type 'string +(defcustom fortune-program-options () + "Options to pass to the fortune program." + :type '(repeat string) :group 'fortune) (defcustom fortune-strfile "strfile" "Program to compute a new fortune database." @@ -299,11 +299,10 @@ when supplied, specifies the file to choose the fortune from." (if fortune-always-compile (fortune-compile fort-file)) - (call-process - fortune-program ;; programm to call - nil fortune-buffer nil ;; INFILE BUFFER DISPLAYP - (concat fortune-program-options fort-file))))) - + (apply 'call-process + fortune-program ;; program to call + nil fortune-buffer nil ;; INFILE BUFFER DISPLAYP + fortune-file fortune-program-options)))) ;;;###autoload (defun fortune (&optional file) ============================================================