unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Fix fortune's handling of arguments
@ 2008-09-11  4:58 mail
  2008-09-11 12:08 ` John Paul Wallington
  2008-09-20 20:55 ` Glenn Morris
  0 siblings, 2 replies; 4+ messages in thread
From: mail @ 2008-09-11  4:58 UTC (permalink / raw)
  To: emacs-devel

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





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

end of thread, other threads:[~2008-09-20 20:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-11  4:58 [PATCH] Fix fortune's handling of arguments mail
2008-09-11 12:08 ` John Paul Wallington
2008-09-11 16:36   ` mail
2008-09-20 20:55 ` Glenn Morris

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