unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Geiser vs. guile-mode?
@ 2020-02-04 15:18 Pierre Neidhardt
  2020-02-04 16:16 ` Jérémy Korwin-Zmijowski
  0 siblings, 1 reply; 22+ messages in thread
From: Pierre Neidhardt @ 2020-02-04 15:18 UTC (permalink / raw)
  To: guile-user

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

Hi!

At the Guix days a little while back we had a session about the tooling to hack
Guile code.

In particular, Geiser seemed to unanimously cause issues:

- How do we insert breakpoints?
- How do we inspect compound objects?  (e.g. SLIME / CIDER style)
- How do we use the stepper (for debugging)?
- Documentation lookup does not work.

The last issue has been reported a long time ago and still hasn't been fixed upstream:

  https://gitlab.com/jaor/geiser/issues/252

I find the situation a hindrance to Guile development.
I suppose the Guile Studio is also concerned by this.

What do you people suggest?

I know that the Racket community decided to follow its own route with
racket-mode.  So what about a Guile-mode that's well tailored to Guile
development?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Geiser vs. guile-mode?
  2020-02-04 15:18 Geiser vs. guile-mode? Pierre Neidhardt
@ 2020-02-04 16:16 ` Jérémy Korwin-Zmijowski
  2020-02-04 16:40   ` Pierre Neidhardt
  0 siblings, 1 reply; 22+ messages in thread
From: Jérémy Korwin-Zmijowski @ 2020-02-04 16:16 UTC (permalink / raw)
  To: guile-user, Pierre Neidhardt

Hi Pierre !

In my position I am actually writing an emacs-guile.el to address some of your points. With the knowledge I have as a beginner with emacs and guile haha.

I want it to be guile-dev-centric, easy to share and to extend. With an attention not to overtool the user.

Jérémy

Le 4 février 2020 16:18:23 GMT+01:00, Pierre Neidhardt <mail@ambrevar.xyz> a écrit :
>Hi!
>
>At the Guix days a little while back we had a session about the tooling
>to hack
>Guile code.
>
>In particular, Geiser seemed to unanimously cause issues:
>
>- How do we insert breakpoints?
>- How do we inspect compound objects?  (e.g. SLIME / CIDER style)
>- How do we use the stepper (for debugging)?
>- Documentation lookup does not work.
>
>The last issue has been reported a long time ago and still hasn't been
>fixed upstream:
>
>  https://gitlab.com/jaor/geiser/issues/252
>
>I find the situation a hindrance to Guile development.
>I suppose the Guile Studio is also concerned by this.
>
>What do you people suggest?
>
>I know that the Racket community decided to follow its own route with
>racket-mode.  So what about a Guile-mode that's well tailored to Guile
>development?
>
>-- 
>Pierre Neidhardt
>https://ambrevar.xyz/

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


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

* Re: Geiser vs. guile-mode?
  2020-02-04 16:16 ` Jérémy Korwin-Zmijowski
@ 2020-02-04 16:40   ` Pierre Neidhardt
  2020-02-07 13:50     ` Pierre Neidhardt
  0 siblings, 1 reply; 22+ messages in thread
From: Pierre Neidhardt @ 2020-02-04 16:40 UTC (permalink / raw)
  To: Jérémy Korwin-Zmijowski, guile-user

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

Good to hear, thanks for working on this!

Do you have a public repository to share?

You may want to look at racket-mode, CIDER and SLIME / SLY for inspiration.
This video in particular may be of interest:
https://www.youtube.com/watch?v=NDHi6aWyI0Y

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Geiser vs. guile-mode?
  2020-02-04 16:40   ` Pierre Neidhardt
@ 2020-02-07 13:50     ` Pierre Neidhardt
  2020-02-07 16:19       ` Jérémy Korwin-Zmijowski
                         ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Pierre Neidhardt @ 2020-02-07 13:50 UTC (permalink / raw)
  To: Jérémy Korwin-Zmijowski, guile-user

[-- Attachment #1: Type: text/plain, Size: 620 bytes --]

Great news: Jao just fixed issue 252 mentioned above and seized the
opportunity to release Geiser 0.11.

Looks like I was a bit fast in my call for a guile-mode ;)

So what about helping upstream with the implementation of the
aforementioned features, namely:

- How do we insert breakpoints?
- How do we inspect compound objects?  (e.g. SLIME / CIDER style)
- How do we use the stepper (for debugging)?

I thought of another one which is a must in SLIME/SLY: the interactive
backtrace.  We can toggle the display of local variables, go to
definition, etc.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Geiser vs. guile-mode?
  2020-02-07 13:50     ` Pierre Neidhardt
@ 2020-02-07 16:19       ` Jérémy Korwin-Zmijowski
  2020-02-07 16:30         ` Matt Wette
  2020-02-08 16:30         ` Pierre Neidhardt
  2020-02-07 23:44       ` Jose A. Ortega Ruiz
  2020-02-14  8:38       ` Pierre Neidhardt
  2 siblings, 2 replies; 22+ messages in thread
From: Jérémy Korwin-Zmijowski @ 2020-02-07 16:19 UTC (permalink / raw)
  To: Pierre Neidhardt, guile-user

This is great news Pierre ! Geiser is a central point.

I will release my emacs-guile.el as soon as I give it a proper repo. 
Here is my motivation (the vision) : "remove friction when coding with Guile in Emacs by providing a ready to use Guile IDE which you can then customize to your needs".
As a beginner in Guile (and Scheme) I would have benefit such dotfile to focus my time on learning Guile rather than learning Emacs.

So here are the features I would like to provide (don't see here any priorized order):
- No errors and no warning out of the box when Emacs start and when using following features :
- Install from Guix and MELPA?
- [Magit] git versionning
- [Geiser] REPL, go to documentation
- [?] go to definition in Guile source code (even Guile's modules, srfi, ...)
- [Paredit] code manipulation facilities
- [?guile-fmt?] code formatting according style guidelines (does Guilers have some?)
- [emacs-refactor.el] refactoring facilities like extract functions, variables, ...
- [YASnippet] provide template (GPL insertion, test harness skeleton, ...)
- [?] Debugging facilities (stepper, breakpoints, inspection, ...)

If you mind, I would be glad if any of you could share the specific emacs modules and configuration you find useful in a guile dev purpose (ie : link to your dotfile, why you use these conf, etc...) 

Then I can integrate all of it in a single emacs-guile.el file to speed up the process. And i would suggest to put this file anywhere easily accessible to the community as soon as it is consistent enough.

Freely yours,

Jérémy

Le 7 février 2020 14:50:07 GMT+01:00, Pierre Neidhardt <mail@ambrevar.xyz> a écrit :
>Great news: Jao just fixed issue 252 mentioned above and seized the
>opportunity to release Geiser 0.11.
>
>Looks like I was a bit fast in my call for a guile-mode ;)
>
>So what about helping upstream with the implementation of the
>aforementioned features, namely:
>
>- How do we insert breakpoints?
>- How do we inspect compound objects?  (e.g. SLIME / CIDER style)
>- How do we use the stepper (for debugging)?
>
>I thought of another one which is a must in SLIME/SLY: the interactive
>backtrace.  We can toggle the display of local variables, go to
>definition, etc.
>
>-- 
>Pierre Neidhardt
>https://ambrevar.xyz/

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


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

* Re: Geiser vs. guile-mode?
  2020-02-07 16:19       ` Jérémy Korwin-Zmijowski
@ 2020-02-07 16:30         ` Matt Wette
  2020-02-07 17:50           ` sirgazil
  2020-02-08 16:30         ` Pierre Neidhardt
  1 sibling, 1 reply; 22+ messages in thread
From: Matt Wette @ 2020-02-07 16:30 UTC (permalink / raw)
  To: guile-user

Thanks for doing this.   I'd like to have #! ... !# handled robustly as 
comment.
It's not working for me and I believe I saw a comment in the code that 
it was
intentionally left out (for some reason I don't remember).

On 2/7/20 8:19 AM, Jérémy Korwin-Zmijowski wrote:
> This is great news Pierre ! Geiser is a central point.
>
> I will release my emacs-guile.el as soon as I give it a proper repo.
> Here is my motivation (the vision) : "remove friction when coding with Guile in Emacs by providing a ready to use Guile IDE which you can then customize to your needs".
> As a beginner in Guile (and Scheme) I would have benefit such dotfile to focus my time on learning Guile rather than learning Emacs.
>
> So here are the features I would like to provide (don't see here any priorized order):
> - No errors and no warning out of the box when Emacs start and when using following features :
> - Install from Guix and MELPA?
> - [Magit] git versionning
> - [Geiser] REPL, go to documentation
> - [?] go to definition in Guile source code (even Guile's modules, srfi, ...)
> - [Paredit] code manipulation facilities
> - [?guile-fmt?] code formatting according style guidelines (does Guilers have some?)
> - [emacs-refactor.el] refactoring facilities like extract functions, variables, ...
> - [YASnippet] provide template (GPL insertion, test harness skeleton, ...)
> - [?] Debugging facilities (stepper, breakpoints, inspection, ...)
>
> If you mind, I would be glad if any of you could share the specific emacs modules and configuration you find useful in a guile dev purpose (ie : link to your dotfile, why you use these conf, etc...)
>
> Then I can integrate all of it in a single emacs-guile.el file to speed up the process. And i would suggest to put this file anywhere easily accessible to the community as soon as it is consistent enough.
>
> Freely yours,
>
> Jérémy
>
> Le 7 février 2020 14:50:07 GMT+01:00, Pierre Neidhardt <mail@ambrevar.xyz> a écrit :
>> Great news: Jao just fixed issue 252 mentioned above and seized the
>> opportunity to release Geiser 0.11.
>>
>> Looks like I was a bit fast in my call for a guile-mode ;)
>>
>> So what about helping upstream with the implementation of the
>> aforementioned features, namely:
>>
>> - How do we insert breakpoints?
>> - How do we inspect compound objects?  (e.g. SLIME / CIDER style)
>> - How do we use the stepper (for debugging)?
>>
>> I thought of another one which is a must in SLIME/SLY: the interactive
>> backtrace.  We can toggle the display of local variables, go to
>> definition, etc.
>>
>> -- 
>> Pierre Neidhardt
>> https://ambrevar.xyz/




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

* Re: Geiser vs. guile-mode?
  2020-02-07 16:30         ` Matt Wette
@ 2020-02-07 17:50           ` sirgazil
  2020-02-07 22:24             ` Matt Wette
  2020-02-18 23:53             ` sirgazil
  0 siblings, 2 replies; 22+ messages in thread
From: sirgazil @ 2020-02-07 17:50 UTC (permalink / raw)
  To: Matt Wette; +Cc: guile-user

 ---- On Fri, 07 Feb 2020 11:30:43 -0500 Matt Wette <matt.wette@gmail.com> wrote ----
 > Thanks for doing this.   I'd like to have #! ... !# handled robustly as 
 > comment.
 > It's not working for me and I believe I saw a comment in the code that 
 > it was
 > intentionally left out (for some reason I don't remember).

I don't remember those block comments working for me either, so I use #| ... |# instead for top-level and nested block comments.



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

* Re: Geiser vs. guile-mode?
  2020-02-07 17:50           ` sirgazil
@ 2020-02-07 22:24             ` Matt Wette
  2020-02-08 18:14               ` Ricardo Wurmus
  2020-02-18 23:53             ` sirgazil
  1 sibling, 1 reply; 22+ messages in thread
From: Matt Wette @ 2020-02-07 22:24 UTC (permalink / raw)
  To: guile-user

On 2/7/20 9:50 AM, sirgazil wrote:
>   ---- On Fri, 07 Feb 2020 11:30:43 -0500 Matt Wette <matt.wette@gmail.com> wrote ----
>   > Thanks for doing this.   I'd like to have #! ... !# handled robustly as
>   > comment.
>   > It's not working for me and I believe I saw a comment in the code that
>   > it was
>   > intentionally left out (for some reason I don't remember).
>
> I don't remember those block comments working for me either, so I use #| ... |# instead for top-level and nested block comments.
>

And for scripts I use the following which seems like a kludge to me.

#!/bin/sh
#|
xxx
xxx
xxx
exec guile $0 "$@
|#
!#




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

* Re: Geiser vs. guile-mode?
  2020-02-07 13:50     ` Pierre Neidhardt
  2020-02-07 16:19       ` Jérémy Korwin-Zmijowski
@ 2020-02-07 23:44       ` Jose A. Ortega Ruiz
  2020-02-14  8:38       ` Pierre Neidhardt
  2 siblings, 0 replies; 22+ messages in thread
From: Jose A. Ortega Ruiz @ 2020-02-07 23:44 UTC (permalink / raw)
  To: guile-user

On Fri, Feb 07 2020, Pierre Neidhardt wrote:

> Great news: Jao just fixed issue 252 mentioned above and seized the
> opportunity to release Geiser 0.11.
>
> Looks like I was a bit fast in my call for a guile-mode ;)
>
> So what about helping upstream with the implementation of the
> aforementioned features

I would greatly appreciate that.  Guile is geiser's main implementation,
and the best supported one.

> - How do we insert breakpoints?
> - How do we inspect compound objects?  (e.g. SLIME / CIDER style)
> - How do we use the stepper (for debugging)?

I'd be happy to discuss this and even implement it myself, or help with
it if people cannot wait (i won't be fast) and send patches.

Thanks,
jao
-- 
If at first you don't succeed, try and try and try again. And then give up.
There's no point making a damn fool out of yourself.
 -Dilbert's Rules of Work, slightly paraphrased




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

* Re: Geiser vs. guile-mode?
  2020-02-07 16:19       ` Jérémy Korwin-Zmijowski
  2020-02-07 16:30         ` Matt Wette
@ 2020-02-08 16:30         ` Pierre Neidhardt
  1 sibling, 0 replies; 22+ messages in thread
From: Pierre Neidhardt @ 2020-02-08 16:30 UTC (permalink / raw)
  To: Jérémy Korwin-Zmijowski, guile-user

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

I think what you are trying to achieve here goes a bit beyond a
Guile "mode".

Have you heard of Guile-studio, an integrated development environment
which is essentially a pre-configured Emacs I believe?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Geiser vs. guile-mode?
  2020-02-07 22:24             ` Matt Wette
@ 2020-02-08 18:14               ` Ricardo Wurmus
  2020-02-08 18:59                 ` Matt Wette
  0 siblings, 1 reply; 22+ messages in thread
From: Ricardo Wurmus @ 2020-02-08 18:14 UTC (permalink / raw)
  To: Matt Wette; +Cc: guile-user


Matt Wette <matt.wette@gmail.com> writes:

> On 2/7/20 9:50 AM, sirgazil wrote:
>>   ---- On Fri, 07 Feb 2020 11:30:43 -0500 Matt Wette <matt.wette@gmail.com> wrote ----
>>   > Thanks for doing this.   I'd like to have #! ... !# handled robustly as
>>   > comment.
>>   > It's not working for me and I believe I saw a comment in the code that
>>   > it was
>>   > intentionally left out (for some reason I don't remember).
>>
>> I don't remember those block comments working for me either, so I use #| ... |# instead for top-level and nested block comments.
>>
>
> And for scripts I use the following which seems like a kludge to me.
>
> #!/bin/sh
> #|
> xxx
> xxx
> xxx
> exec guile $0 "$@
> |#
> !#

Why is this necessary?  Why not use guile in the shebang?

-- 
Ricardo



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

* Re: Geiser vs. guile-mode?
  2020-02-08 18:14               ` Ricardo Wurmus
@ 2020-02-08 18:59                 ` Matt Wette
       [not found]                   ` <F5513F8F-F6A8-4AAC-8AF3-C91991CE8E40@korwin-zmijowski.fr>
  0 siblings, 1 reply; 22+ messages in thread
From: Matt Wette @ 2020-02-08 18:59 UTC (permalink / raw)
  To: guile-user

On 2/8/20 10:14 AM, Ricardo Wurmus wrote:
> Matt Wette <matt.wette@gmail.com> writes:
>
>> On 2/7/20 9:50 AM, sirgazil wrote:
>>>    ---- On Fri, 07 Feb 2020 11:30:43 -0500 Matt Wette <matt.wette@gmail.com> wrote ----
>>>    > Thanks for doing this.   I'd like to have #! ... !# handled robustly as
>>>    > comment.
>>>    > It's not working for me and I believe I saw a comment in the code that
>>>    > it was
>>>    > intentionally left out (for some reason I don't remember).
>>>
>>> I don't remember those block comments working for me either, so I use #| ... |# instead for top-level and nested block comments.
>>>
>> And for scripts I use the following which seems like a kludge to me.
>>
>> #!/bin/sh
>> #|
>> xxx
>> xxx
>> xxx
>> exec guile $0 "$@
>> |#
>> !#
> Why is this necessary?  Why not use guile in the shebang?
>

Finding the right installed guile, setting environment variables
(like GUILE_LOAD_PATH), etc.  And it's not always about avoiding
something because it's not necessary, sometime easier to use sh.




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

* Re: Geiser vs. guile-mode?
       [not found]                   ` <F5513F8F-F6A8-4AAC-8AF3-C91991CE8E40@korwin-zmijowski.fr>
@ 2020-02-13  9:38                     ` Jérémy Korwin-Zmijowski
  0 siblings, 0 replies; 22+ messages in thread
From: Jérémy Korwin-Zmijowski @ 2020-02-13  9:38 UTC (permalink / raw)
  To: guile-user, Matt Wette

Mistake, here is the full text haha

Here is the repo I am using for my emacs conf dedicated to Guile !

https://framagit.org/Jeko/emacs-guile

If anyone can benefit/want to contribute/submit ideas/share ... Anyway you get it.

Thank you!

Jérémy

Le 13 février 2020 10:34:45 GMT+01:00, "Jérémy Korwin-Zmijowski" <jeremy@korwin-zmijowski.fr> a écrit :
>Here is the repo I am using for my emacs conf dedicated to Guile 
>
>Le 8 février 2020 19:59:14 GMT+01:00, Matt Wette <matt.wette@gmail.com>
>a écrit :
>>On 2/8/20 10:14 AM, Ricardo Wurmus wrote:
>>> Matt Wette <matt.wette@gmail.com> writes:
>>>
>>>> On 2/7/20 9:50 AM, sirgazil wrote:
>>>>>    ---- On Fri, 07 Feb 2020 11:30:43 -0500 Matt Wette
>><matt.wette@gmail.com> wrote ----
>>>>>    > Thanks for doing this.   I'd like to have #! ... !# handled
>>robustly as
>>>>>    > comment.
>>>>>    > It's not working for me and I believe I saw a comment in the
>>code that
>>>>>    > it was
>>>>>    > intentionally left out (for some reason I don't remember).
>>>>>
>>>>> I don't remember those block comments working for me either, so I
>>use #| ... |# instead for top-level and nested block comments.
>>>>>
>>>> And for scripts I use the following which seems like a kludge to
>me.
>>>>
>>>> #!/bin/sh
>>>> #|
>>>> xxx
>>>> xxx
>>>> xxx
>>>> exec guile $0 "$@
>>>> |#
>>>> !#
>>> Why is this necessary?  Why not use guile in the shebang?
>>>
>>
>>Finding the right installed guile, setting environment variables
>>(like GUILE_LOAD_PATH), etc.  And it's not always about avoiding
>>something because it's not necessary, sometime easier to use sh.

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


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

* Re: Geiser vs. guile-mode?
  2020-02-07 13:50     ` Pierre Neidhardt
  2020-02-07 16:19       ` Jérémy Korwin-Zmijowski
  2020-02-07 23:44       ` Jose A. Ortega Ruiz
@ 2020-02-14  8:38       ` Pierre Neidhardt
  2 siblings, 0 replies; 22+ messages in thread
From: Pierre Neidhardt @ 2020-02-14  8:38 UTC (permalink / raw)
  To: Jérémy Korwin-Zmijowski, guile-user

[-- Attachment #1: Type: text/plain, Size: 361 bytes --]

Update: I've reported some issues upstream:

- Structure inspector? https://gitlab.com/jaor/geiser/issues/293
- Automatically show an interactive backtrace buffer https://gitlab.com/jaor/geiser/issues/295
- Pretty-printing is very slow https://gitlab.com/jaor/geiser/issues/296

Contributions are welcome!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Geiser vs. guile-mode?
  2020-02-07 17:50           ` sirgazil
  2020-02-07 22:24             ` Matt Wette
@ 2020-02-18 23:53             ` sirgazil
  2020-02-19 14:16               ` Ricardo Wurmus
  2020-02-20 22:50               ` Jose A. Ortega Ruiz
  1 sibling, 2 replies; 22+ messages in thread
From: sirgazil @ 2020-02-18 23:53 UTC (permalink / raw)
  To: Matt Wette; +Cc: guile-user

I also find some fundamental things missing when programming in Guile Scheme (with Emacs+Geiser):

1. On-the-fly syntax checking (see flycheck)
2. Immediate availability of new symbols after importing a module.

Without (1) I don't get alerted about modules imported but not used, symbols used but not defined, ... These would have helped me when writing my first Guix packages, where I copy/pasted inputs from other package definitions without importing the modules they were defined in,  or when I deleted inputs I didn't need but left their corresponding modules around.

Without (2) I have to evaluate the buffer manually so that I have autocomplete, autodoc, go to definition, etc., for the symbols defined in the imported modules.

I get these two features when I install emacs-elpy, an "Emacs Python Development Environment". I expected to have them too when I installed Geiser, the "Emacs environment to hack in Scheme".


---
https://sirgazil.bitbucket.io/






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

* Re: Geiser vs. guile-mode?
  2020-02-18 23:53             ` sirgazil
@ 2020-02-19 14:16               ` Ricardo Wurmus
  2020-02-20 14:24                 ` sirgazil
  2020-02-20 22:50               ` Jose A. Ortega Ruiz
  1 sibling, 1 reply; 22+ messages in thread
From: Ricardo Wurmus @ 2020-02-19 14:16 UTC (permalink / raw)
  To: sirgazil; +Cc: guile-user, Matt Wette


sirgazil <sirgazil@zoho.com> writes:

> I also find some fundamental things missing when programming in Guile Scheme (with Emacs+Geiser):
>
> 1. On-the-fly syntax checking (see flycheck)

This is available by default in “Guile Studio”[1].  It works by compiling
the buffer:

--8<---------------cut here---------------start------------->8---
(require 'flycheck)
(flycheck-define-checker guile
                         "A Guile syntax checker with `guild compile'."
                         :command ("guild" "compile" "--to=cps"
                                   "--warn=unused-variable"
                                   "--warn=unused-toplevel"
                                   "--warn=unbound-variable"
                                   "--warn=macro-use-before-definition"
                                   "--warn=arity-mismatch"
                                   "--warn=duplicate-case-datum"
                                   "--warn=bad-case-datum"
                                   "--warn=format"
                                   source)
                         :predicate
                         (lambda ()
                           (and (boundp 'geiser-impl--implementation)
                                (eq geiser-impl--implementation 'guile)))
                         :verify
                         (lambda (checker)
                           (let ((geiser-impl (bound-and-true-p geiser-impl--implementation)))
                             (list
                              (flycheck-verification-result-new
                               :label "Geiser Implementation"
                               :message (cond
                                         ((eq geiser-impl 'guile) "Guile")
                                         (geiser-impl (format "Other: %s" geiser-impl))
                                         (t "Geiser not active"))
                               :face (cond
                                      ((or (eq geiser-impl 'guile)) 'success)
                                      (t '(bold error)))))))
                         :error-patterns
                         ((warning
                           line-start (file-name) ":" line ":" column ": warning:" (message) line-end)
                          (error
                           line-start (file-name) ":" line ":" column ":" (message) line-end))
                         :modes (scheme-mode geiser-mode))
(add-to-list 'flycheck-checkers 'guile)
(global-flycheck-mode 1)
--8<---------------cut here---------------end--------------->8---


-- 
Ricardo


[1]: https://git.elephly.net/software/guile-studio.git, available via
Guix: “guix install guile-studio”.



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

* Re: Geiser vs. guile-mode?
  2020-02-19 14:16               ` Ricardo Wurmus
@ 2020-02-20 14:24                 ` sirgazil
  0 siblings, 0 replies; 22+ messages in thread
From: sirgazil @ 2020-02-20 14:24 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Matt Wette, guile-user

 ---- On Wed, 19 Feb 2020 09:16:34 -0500 Ricardo Wurmus <rekado@elephly.net> wrote ----
 > 
 > sirgazil <sirgazil@zoho.com> writes:
 > 
 > > I also find some fundamental things missing when programming in Guile Scheme (with Emacs+Geiser):
 > >
 > > 1. On-the-fly syntax checking (see flycheck)
 > 
 > This is available by default in “Guile Studio”[1].  It works by compiling
 > the buffer:
 > 
 > --8<---------------cut here---------------start------------->8---
 > (require 'flycheck)
 > (flycheck-define-checker guile
 >                          "A Guile syntax checker with `guild compile'."
 >                          :command ("guild" "compile" "--to=cps"
 >                                    "--warn=unused-variable"
 >                                    "--warn=unused-toplevel"
 >                                    "--warn=unbound-variable"
 >                                    "--warn=macro-use-before-definition"
 >                                    "--warn=arity-mismatch"
 >                                    "--warn=duplicate-case-datum"
 >                                    "--warn=bad-case-datum"
 >                                    "--warn=format"
 >                                    source)
 >                          :predicate
 >                          (lambda ()
 >                            (and (boundp 'geiser-impl--implementation)
 >                                 (eq geiser-impl--implementation 'guile)))
 >                          :verify
 >                          (lambda (checker)
 >                            (let ((geiser-impl (bound-and-true-p geiser-impl--implementation)))
 >                              (list
 >                               (flycheck-verification-result-new
 >                                :label "Geiser Implementation"
 >                                :message (cond
 >                                          ((eq geiser-impl 'guile) "Guile")
 >                                          (geiser-impl (format "Other: %s" geiser-impl))
 >                                          (t "Geiser not active"))
 >                                :face (cond
 >                                       ((or (eq geiser-impl 'guile)) 'success)
 >                                       (t '(bold error)))))))
 >                          :error-patterns
 >                          ((warning
 >                            line-start (file-name) ":" line ":" column ": warning:" (message) line-end)
 >                           (error
 >                            line-start (file-name) ":" line ":" column ":" (message) line-end))
 >                          :modes (scheme-mode geiser-mode))
 > (add-to-list 'flycheck-checkers 'guile)
 > (global-flycheck-mode 1)
 > --8<---------------cut here---------------end--------------->8---

Thanks, Ricardo :)

Any reason why this checker is not integrated into Flycheck? Currently, the only supported Scheme in Flycheck is Chikken...



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

* Re: Geiser vs. guile-mode?
  2020-02-18 23:53             ` sirgazil
  2020-02-19 14:16               ` Ricardo Wurmus
@ 2020-02-20 22:50               ` Jose A. Ortega Ruiz
  2020-02-21  0:01                 ` sirgazil
  1 sibling, 1 reply; 22+ messages in thread
From: Jose A. Ortega Ruiz @ 2020-02-20 22:50 UTC (permalink / raw)
  To: guile-user

On Tue, Feb 18 2020, sirgazil wrote:

> 2. Immediate availability of new symbols after importing a module.

I'm not sure what you mean here by "importing a module".  Loading or
compiling a given module makes transitively availabe all the symbols in
modules it imports, provided you're in the context of a module where
they're visible.  If you mean automatically loading a module when you
open its file in emacs, that's just

    (add-hook 'geiser-mode-hook #'geiser-compile-current-buffer)

But possibly you mean something else?

Cheers,
jao
-- 
Spend the afternoon. You can't take it with you.
  -Annie Dillard, author (b. 1945)




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

* Re: Geiser vs. guile-mode?
  2020-02-20 22:50               ` Jose A. Ortega Ruiz
@ 2020-02-21  0:01                 ` sirgazil
  2020-02-21  1:44                   ` Jose A. Ortega Ruiz
  0 siblings, 1 reply; 22+ messages in thread
From: sirgazil @ 2020-02-21  0:01 UTC (permalink / raw)
  To: Jose A. Ortega Ruiz; +Cc: guile-user

Hi Jose,

 ---- On Thu, 20 Feb 2020 17:50:05 -0500 Jose A. Ortega Ruiz <jao@gnu.org> wrote ----
 > On Tue, Feb 18 2020, sirgazil wrote:
 > 
 > > 2. Immediate availability of new symbols after importing a module.
 > 
 > I'm not sure what you mean here by "importing a module".  Loading or
 > compiling a given module makes transitively availabe all the symbols in
 > modules it imports, provided you're in the context of a module where
 > they're visible.  If you mean automatically loading a module when you
 > open its file in emacs, that's just
 > 
 >     (add-hook 'geiser-mode-hook #'geiser-compile-current-buffer)
 > 
 > But possibly you mean something else?

By importing a module I mean adding it to (use-modules ...) while working on a Guile Scheme file.

But now that you mention opening a file, I think the complete behavior I would expect would be that doing the following,

1. Visit path/to/file.scm
2. M-x run-guile

would make symbols of all existing modules in (use-modules ...) to become available for autocomplete, autodoc, etc. And

3. Add more modules to (use-modules ...) during my work

would also make the symbols of the new modules available for autocomplete, etc.

Currently, I have to evaluate the buffer manually (C-c C-b) for these things to happen.



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

* Re: Geiser vs. guile-mode?
  2020-02-21  0:01                 ` sirgazil
@ 2020-02-21  1:44                   ` Jose A. Ortega Ruiz
  2020-02-21  8:41                     ` Arne Babenhauserheide
  0 siblings, 1 reply; 22+ messages in thread
From: Jose A. Ortega Ruiz @ 2020-02-21  1:44 UTC (permalink / raw)
  To: guile-user

On Thu, Feb 20 2020, sirgazil wrote:

[...]

> By importing a module I mean adding it to (use-modules ...) while
> working on a Guile Scheme file.
>
> But now that you mention opening a file, I think the complete behavior
> I would expect would be that doing the following,
>
> 1. Visit path/to/file.scm
> 2. M-x run-guile
>
> would make symbols of all existing modules in (use-modules ...) to
> become available for autocomplete, autodoc, etc. And
>
> 3. Add more modules to (use-modules ...) during my work
>
> would also make the symbols of the new modules available for autocomplete, etc.
>
> Currently, I have to evaluate the buffer manually (C-c C-b) for these
> things to happen.

yes. but i'm afraid that's by design.  we don't continuously evaluate
what you write in a buffer.  writing something by mistake in use-modules
would then pollute the whole namespace, invisibly if one later removes
the use-modules subclause.  maybe that flymake/flycheck function will do
that for you? (to be honest, it's not something i find natural, so i'd
add it to geiser only if someone else contributes it and it's an
opt-in).

sorry for not being more helpful! :)

cheers,
jao
-- 
“If I can do it better in Emacs I use Emacs. Otherwise, I use Emacs.”
 - Mike Zamansky




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

* Re: Geiser vs. guile-mode?
  2020-02-21  1:44                   ` Jose A. Ortega Ruiz
@ 2020-02-21  8:41                     ` Arne Babenhauserheide
  2020-02-21 22:57                       ` Jose A. Ortega Ruiz
  0 siblings, 1 reply; 22+ messages in thread
From: Arne Babenhauserheide @ 2020-02-21  8:41 UTC (permalink / raw)
  To: guile-user


Jose A. Ortega Ruiz <jao@gnu.org> writes:
> we don't continuously evaluate
> what you write in a buffer.  writing something by mistake in use-modules
> would then pollute the whole namespace, invisibly if one later removes
> the use-modules subclause.  maybe that flymake/flycheck function will do
> that for you? (to be honest, it's not something i find natural, so i'd
> add it to geiser only if someone else contributes it and it's an
> opt-in).

Would it be possible to recognize when something is removed from
use-modules and to re-evaluate the whole file in a fresh REPL then?

Basically what I want is the quality of configuration-free
auto-completion I get in IntelliJ for Java. And I know that that’s a
very high bar. Avoiding the need for extra-actions is also important for
new users, because it reduces the amount of extra-actions needed to
start working efficiently.

Would it be possible to re-evaluate on save?
(defun re-evaluate-buffer () …)
(add-hook 'after-save-hook 're-evaluate-buffer)

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken



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

* Re: Geiser vs. guile-mode?
  2020-02-21  8:41                     ` Arne Babenhauserheide
@ 2020-02-21 22:57                       ` Jose A. Ortega Ruiz
  0 siblings, 0 replies; 22+ messages in thread
From: Jose A. Ortega Ruiz @ 2020-02-21 22:57 UTC (permalink / raw)
  To: guile-user

On Fri, Feb 21 2020, Arne Babenhauserheide wrote:

[...]

> Would it be possible to re-evaluate on save?
> (defun re-evaluate-buffer () …)
> (add-hook 'after-save-hook 're-evaluate-buffer)

yes, all you need for that is:

  (defun re-evaluate-buffer ()
    (when geiser-mode (geiser-compile-current-buffer)))

(but guile will enter the debugger if you save a buffer with errors.)




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

end of thread, other threads:[~2020-02-21 22:57 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-04 15:18 Geiser vs. guile-mode? Pierre Neidhardt
2020-02-04 16:16 ` Jérémy Korwin-Zmijowski
2020-02-04 16:40   ` Pierre Neidhardt
2020-02-07 13:50     ` Pierre Neidhardt
2020-02-07 16:19       ` Jérémy Korwin-Zmijowski
2020-02-07 16:30         ` Matt Wette
2020-02-07 17:50           ` sirgazil
2020-02-07 22:24             ` Matt Wette
2020-02-08 18:14               ` Ricardo Wurmus
2020-02-08 18:59                 ` Matt Wette
     [not found]                   ` <F5513F8F-F6A8-4AAC-8AF3-C91991CE8E40@korwin-zmijowski.fr>
2020-02-13  9:38                     ` Jérémy Korwin-Zmijowski
2020-02-18 23:53             ` sirgazil
2020-02-19 14:16               ` Ricardo Wurmus
2020-02-20 14:24                 ` sirgazil
2020-02-20 22:50               ` Jose A. Ortega Ruiz
2020-02-21  0:01                 ` sirgazil
2020-02-21  1:44                   ` Jose A. Ortega Ruiz
2020-02-21  8:41                     ` Arne Babenhauserheide
2020-02-21 22:57                       ` Jose A. Ortega Ruiz
2020-02-08 16:30         ` Pierre Neidhardt
2020-02-07 23:44       ` Jose A. Ortega Ruiz
2020-02-14  8:38       ` Pierre Neidhardt

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