* command-line options
@ 2016-06-22 4:48 Tobin Harding
2016-06-30 10:44 ` command-line options v2 Tobin Harding
0 siblings, 1 reply; 6+ messages in thread
From: Tobin Harding @ 2016-06-22 4:48 UTC (permalink / raw)
To: guile-user
What is the Scheme expression required to pass command-line options to Guile?
----
I am using Geiser to run Guile within Emacs and I have
(setq geiser-guile-load-init-file-p t)
in my Emacs init file. All seems well.
From https://www.gnu.org/software/guile/manual/guile.html#Init-File
4.4.1 The Init File, ~/.guile
When run interactively, Guile will load a local initialization file from ~/.guile. This file should contain Scheme expressions for evaluation.
This facility lets the user customize their interactive Guile environment,
pulling in extra modules or parameterizing the REPL implementation.
thanks,
Tobin Harding.
^ permalink raw reply [flat|nested] 6+ messages in thread
* command-line options v2
2016-06-22 4:48 command-line options Tobin Harding
@ 2016-06-30 10:44 ` Tobin Harding
2016-06-30 20:49 ` Vladimir Zhbanov
2016-07-12 22:30 ` Tobin Harding
0 siblings, 2 replies; 6+ messages in thread
From: Tobin Harding @ 2016-06-30 10:44 UTC (permalink / raw)
To: guile-user
Still unable to pass Guile command line options when invoked by Geiser.
I believe there is a simple scheme expression that I can put in ~/.guile to add
command-line options. I cannot find what that expression is?
Previous email to list failed to get a response, I am attempting to re-ask the
same question here in a better fashion.
I have dug around in the source for Geiser (geiser-guile.el) and found a
possible lead
(defun geiser-guile--parameters ()
"Return a list with all parameters needed to start Guile.
This function uses `geiser-guile-init-file' if it exists."
(let ((init-file (and (stringp geiser-guile-init-file)
(expand-file-name geiser-guile-init-file)))
(q-flags (and (not geiser-guile-load-init-file-p) '("-q"))))
`(,@(and (listp geiser-guile-binary) (cdr geiser-guile-binary))
,@q-flags "-L" ,(expand-file-name "guile/" geiser-scheme-dir)
,@(apply 'append (mapcar (lambda (p) (list "-L" p))
geiser-guile-load-path))
,@(and init-file (file-readable-p init-file) (list "-l" init-file)))))
Is anyone able to shed some light on this please?
thanks,
Tobin.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: command-line options v2
2016-06-30 10:44 ` command-line options v2 Tobin Harding
@ 2016-06-30 20:49 ` Vladimir Zhbanov
2016-07-01 1:49 ` Tobin Harding
2016-07-12 22:30 ` Tobin Harding
1 sibling, 1 reply; 6+ messages in thread
From: Vladimir Zhbanov @ 2016-06-30 20:49 UTC (permalink / raw)
To: guile-user
Hi Tobin,
On Thu, Jun 30, 2016 at 08:44:11PM +1000, Tobin Harding wrote:
> Still unable to pass Guile command line options when invoked by Geiser.
>
> I believe there is a simple scheme expression that I can put in ~/.guile to add
> command-line options. I cannot find what that expression is?
>
> Previous email to list failed to get a response, I am attempting to re-ask the
> same question here in a better fashion.
>
> I have dug around in the source for Geiser (geiser-guile.el) and found a
> possible lead
...
>
> Is anyone able to shed some light on this please?
If you mean the code you quoted then while it is Emacs Lisp it's
pretty similar to Scheme. I'm not an expert though I'll try to
decipher something here :-)
> (defun geiser-guile--parameters ()
defun -> define
> "Return a list with all parameters needed to start Guile.
> This function uses `geiser-guile-init-file' if it exists."
> (let ((init-file (and (stringp geiser-guile-init-file)
> (expand-file-name geiser-guile-init-file)))
stringp -> string?
I don't know what expand-file-name is (I suspect it somehow
processes the path it has, use Emacs help to find the proper
info about it), though I see that if geiser-guile-init-file is
string, init-file takes its value.
> (q-flags (and (not geiser-guile-load-init-file-p) '("-q"))))
IIUC, q-flags is a variable which becomes equal to "-q" if
geiser-guile-load-init-file-p is not true (again, p == ? at the
end of a function name)
And next, we have a definition of the command line as a list
> `(,@(and (listp geiser-guile-binary) (cdr geiser-guile-binary))
listp -> list?
if geiser-guile-binary is a list, insert here the value of its
cdr. I don't know what its car would be, however
Now, flags
> ,@q-flags "-L" ,(expand-file-name "guile/" geiser-scheme-dir)
q-flags is mentioned above, the next is "-L", and then
"guile/${geiser-scheme-dir}", I use such a notation assuming it
would be more convenient to read for you
> ,@(apply 'append (mapcar (lambda (p) (list "-L" p))
> geiser-guile-load-path))
here geiser-guile-load-path is taken and, I suspect it is a list
:-), each its path is added with the string "-L" prepended
> ,@(and init-file (file-readable-p init-file) (list "-l" init-file)))))
and eventually, if init-file is defined above, and there is
corresponding file with such a name, load its source code using
the option "-l ${init-file}"
IIUC, you have to somehow redefine this function and add your
options to achieve what you want.
There are another way though. Just run in terminal
guile --listen ${YOUR-OPTIONS}
and run geiser not with 'run-geiser', but using the command
'connect-to-guile' which will connect to the running process.
HTH
--
Vladimir
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: command-line options v2
2016-06-30 20:49 ` Vladimir Zhbanov
@ 2016-07-01 1:49 ` Tobin Harding
0 siblings, 0 replies; 6+ messages in thread
From: Tobin Harding @ 2016-07-01 1:49 UTC (permalink / raw)
To: Vladimir Zhbanov; +Cc: guile-user
On Thu, Jun 30, 2016 at 11:49:01PM +0300, Vladimir Zhbanov wrote:
>
> On Thu, Jun 30, 2016 at 08:44:11PM +1000, Tobin Harding wrote:
> > Still unable to pass Guile command line options when invoked by Geiser.
> > ...
>
> ...
> There are another way though. Just run in terminal
>
> guile --listen ${YOUR-OPTIONS}
>
> and run geiser not with 'run-geiser', but using the command
> 'connect-to-guile' which will connect to the running process.
Nice work around Vladimir. This functions as you say and does solve the
problem. It's a bit ugly though since connect-to-guile can't find a
prompt if we run guile as a background process. It would be nice to have a
cleaner solution, this is a solution however and I am appreciative of that.
Thank you for the time you took walking through procedure in previous email.
thanks,
Tobin.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: command-line options v2
2016-06-30 10:44 ` command-line options v2 Tobin Harding
2016-06-30 20:49 ` Vladimir Zhbanov
@ 2016-07-12 22:30 ` Tobin Harding
2016-07-13 16:12 ` Alex Kost
1 sibling, 1 reply; 6+ messages in thread
From: Tobin Harding @ 2016-07-12 22:30 UTC (permalink / raw)
To: guile-user
On Thu, Jun 30, 2016 at 08:44:11PM +1000, Tobin Harding wrote:
> Still unable to pass Guile command line options when invoked by Geiser.
Problem solved (with input from Andy in guile-devel list thread).
Submitting this solution in the name of completeness.
In order to pass command line options to Guile when using Emacs (Geiser) one
must set the variable geiser-guile-binary. This is set in the Emacs
init file, under custom-set-variables (since it is set by default by Geiser),
and can be changed via the Geiser menu in Emacs.
The trick is that when setting with the mouse under 'Geiser Guile Binary' one
must hit INS and add each option as a separate string. Once done correctly,
within Emacs init file the code should look like this:
(custom-set-variables
...
'(geiser-guile-binary '("/usr/local/bin/guile" "--no-auto-compile"))
thanks,
Tobin.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: command-line options v2
2016-07-12 22:30 ` Tobin Harding
@ 2016-07-13 16:12 ` Alex Kost
0 siblings, 0 replies; 6+ messages in thread
From: Alex Kost @ 2016-07-13 16:12 UTC (permalink / raw)
To: Tobin Harding; +Cc: guile-user
Tobin Harding (2016-07-13 01:30 +0300) wrote:
> On Thu, Jun 30, 2016 at 08:44:11PM +1000, Tobin Harding wrote:
>> Still unable to pass Guile command line options when invoked by Geiser.
>
> Problem solved (with input from Andy in guile-devel list thread).
>
> Submitting this solution in the name of completeness.
>
> In order to pass command line options to Guile when using Emacs (Geiser) one
> must set the variable geiser-guile-binary. This is set in the Emacs
> init file, under custom-set-variables (since it is set by default by Geiser),
> and can be changed via the Geiser menu in Emacs.
>
> The trick is that when setting with the mouse under 'Geiser Guile Binary' one
> must hit INS and add each option as a separate string. Once done correctly,
> within Emacs init file the code should look like this:
>
> (custom-set-variables
> ...
> '(geiser-guile-binary '("/usr/local/bin/guile" "--no-auto-compile"))
Alternatively one can simply put in his/her init file:
(setq geiser-guile-binary '("/usr/local/bin/guile" "--no-auto-compile"))
without using custom stuff, mouse, etc.
--
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-07-13 16:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-22 4:48 command-line options Tobin Harding
2016-06-30 10:44 ` command-line options v2 Tobin Harding
2016-06-30 20:49 ` Vladimir Zhbanov
2016-07-01 1:49 ` Tobin Harding
2016-07-12 22:30 ` Tobin Harding
2016-07-13 16:12 ` Alex Kost
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).