jingtaozf / literate-smalltalk

A literate programming tool to write Smalltalk code in org mode.
Apache License 2.0
6 stars 3 forks source link

M-X commands for literate-smalltalk-foo are not showing up in the helm buffer #6

Closed gettimothy closed 3 weeks ago

gettimothy commented 1 month ago

Disregard...

I did not have polyorg mode loaded per the "messages" buffer. I had to run the snippet I post below manually.

That got them showing up.

I look forward to using this!

thx

I have an emacs-configuration.org file that I use when I started doing LSP in java/php....

In that file, I have your suggested code....

** Literate Elisp

(load "/home/wm/.emacs.d/elpa/literate-elisp-20220626.932/literate-elisp.el") (literate-elisp-load "/home/wm/.emacs.d/org/literate-smalltalk.org") (add-to-list 'org-src-lang-modes '("smalltalk" . "literate-smalltalk-code")) (use-package poly-org :ensure t)

Yet, when I attempt to load the RPackage(?) contents, the literate-smalltalk-foo commands do not show in the helm autocomplete.

Am I missing something obvious?

thx

jingtaozf commented 1 month ago

@gettimothy After loading literate-smalltalk.org we should be able to use Emacs Command literate-smalltalk-package-to-org-section.

I can't find any obvious error in the above code, but you can try to execute Ctrl-h f to describe the above function to ensure whether Emacs has loaded it or not.

gettimothy commented 1 month ago

Thank you for the reply.

I will do it this weekend.

cordially

---- On Mon, 29 Jul 2024 21:30:26 -0400 Jingtao Xu @.***> wrote ---

https://github.com/gettimothy After loading literate-smalltalk.org we should be able to use Emacs Command literate-smalltalk-package-to-org-section.

I can't find any obvious error in the above code, but you can try to execute Ctrl-h f to describe the above function to ensure whether Emacs has loaded it or not.

— Reply to this email directly, https://github.com/jingtaozf/literate-smalltalk/issues/6#issuecomment-2257287932, or https://github.com/notifications/unsubscribe-auth/AARQMVGFEWDCNP6C6GPLZ4LZO3UDFAVCNFSM6AAAAABLU5ZCYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJXGI4DOOJTGI. You are receiving this because you were mentioned.

gettimothy commented 1 month ago

Here is my scratch .org file per the tutorial

# -*- encoding:utf-8 Mode: POLY-ORG; tab-width: 2; org-src-preserve-indentation: t; -*- ---
#+PROPERTY: header-args :results silent
#+PROPERTY: literate-load yes
#+PROPERTY: literate-lang smalltalk
#+PROPERTY: literate-class LiterateServer

I try to load the packages with M-X literate-smalltalk-package-to-org-section.

and get the error:

helm-M-x-execute-command: Symbol’s function definition is void: case

hmmm....perhaps the helm is interfering....

In the buffer I type....

(literate-smalltalk-package-to-org-section) and describe function...

literate-smalltalk-package-to-org-section is an interactive Lisp
function.

(literate-smalltalk-package-to-org-section &optional PACKAGES)

Not documented.

[back]

wich tells me the function exists.

I will try disabling helm.

gettimothy commented 1 month ago

Ok, I stripped everything out except for literate

Loading /home/wm/.emacs.d/elpa/literate-elisp-20220626.932/literate-elisp.el (source)...done
Loading /home/wm/.emacs.d/org/literate-smalltalk.org...
cond: End of file during parsing

which would explain the void....

gettimothy commented 1 month ago

alright...

I did a git clone on the repo and copied the literate-smalltalk.org to the working directory and that fixed end of file during parsing issue.

But when I try to load the packages I get...

Loading /home/wm/.emacs.d/org/literate-smalltalk.org...done
progn: Symbol’s function definition is void: case

Could it be an emacs version issue? I am on 27.

thanks for your time.

gettimothy commented 1 month ago

Hi

I added some commentary at the issues page.

A search for reasons for the error include those found here:

https://search.brave.com/search?q=emacs+progn%3A+Symbol%E2%80%99s+function+definition+is+void%3A+case&source=web&summary=1&summary_og=9ae7c76ccd60a2c11d9d07

I am on emacs 27

Also, we are on the pharo discord, where I was told of your work.

I am known as tty there.

cordially

t

---- On Mon, 29 Jul 2024 21:30:26 -0400 Jingtao Xu @.***> wrote ---

https://github.com/gettimothy After loading literate-smalltalk.org we should be able to use Emacs Command literate-smalltalk-package-to-org-section.

I can't find any obvious error in the above code, but you can try to execute Ctrl-h f to describe the above function to ensure whether Emacs has loaded it or not.

— Reply to this email directly, https://github.com/jingtaozf/literate-smalltalk/issues/6#issuecomment-2257287932, or https://github.com/notifications/unsubscribe-auth/AARQMVGFEWDCNP6C6GPLZ4LZO3UDFAVCNFSM6AAAAABLU5ZCYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJXGI4DOOJTGI. You are receiving this because you were mentioned.

gettimothy commented 1 month ago

I upgraded emacs to the latest 29.4 ish version...

I forgot to start the pharo server and tried to run the package- command and got a promissing error:

open-network-stream: make client process failed: Connection refused, :name, localhost, :buffer, #<killed buffer>, :host, localhost, :service, 9092, :nowait, nil, :noquery, nil, :tls-parameters, nil, :coding, nil

Then I started pharo and the literate server and I am right back to the

progn: Symbol’s function definition is void: case

I will look at the literate lisp code a bit and see what I can see.

gettimothy commented 1 month ago

Ok...some progress

in Emacs type 'Object' and literate-smalltalk-browse-class opens a browser in Pharo.

So we know the two are talking...

literate-smalltalk-update-source

making completion list...
let*: Symbol’s function definition is void: second
Mark set

'literate-smalltalk-index-classes: Symbol’s function definition is void: loop'

so, it appears somethig basic is wonky on the emacs side....

gettimothy commented 1 month ago

First off, thanks for you work. This is fun to mess around with.

In a REPL buffer per your instructions, I ran

(literate-smalltalk-packages) with M- eval-last-sexp

It enters the debugger which I am able to pretty print using this persons toggle function: https://emacs.stackexchange.com/questions/54311/can-emacs-show-formatted-backtraces

The backtrace is quite large, but working from the bottom up, I see a package list being returned along with some errors. Here is that snippet.

                                   (:params nil :parser json-read :type "GET" :sync t :data nil :complete
                                            (lambda
                                              (&rest --cl-rest--)
                                              "\n\n(fn &key RESPONSE &allow-other-keys)"
                                              (let*
                                                  ((response
                                                    (car
                                                     (cdr ...))))
                                                (progn
                                                  (setq literate-smalltalk-last-response response)
                                                  (case
                                                   (progn
                                                     (or ... ...)
                                                     (aref response 1))
                                                   (200
                                                    (setq resp ...))
                                                   (500
                                                    (user-error "Pharo failed:%s" ...))
                                                   (t
                                                    (user-error "Failed to request to remote pharo:%s" response))))))
                                            :error #f(compiled-function
                                                      (&rest rest)
                                                      #<bytecode 0x2ed168f70e00e11>)
                                            :url "http://localhost:9092/api/Packages" :response #s(request-response :status-code 200 :history nil :data
                                                                                                                    ((status . "success")
                                                                                                                     (packages .
                                                                                                                               ["AST-Core" "AST-Core-Tests" "AST-Core-Traits" "Alien-Core" "Announcements-Core" "Announcements-Core-Tests" "Announcements-Help" "Athens-Balloon" "Athens-Cairo" "Athens-Cairo-Tests" "Athens-Core" "Athens-Core-Tests" "Athens-Examples" "Athens-Morphic" "Athens-Text" "BaselineOfAthens" "BaselineOfBaseLibraries" "BaselineOfBasicTools" "BaselineOfBeacon" "BaselineOfCalypso" "BaselineOfClap" "BaselineOfClassAnnotation" "BaselineOfClassParser" "BaselineOfCommander" "BaselineOfCommander2" "BaselineOfDependencyAnalyzer" "BaselineOfDisplay" "BaselineOfDrTests" "BaselineOfEmergencyDebugger" "BaselineOfEnlumineurFormatter" "BaselineOfEpicea" "BaselineOfFlashback" "BaselineOfFuel" "BaselineOfFuelPlatform" "BaselineOfFuzzyMatcher" "BaselineOfGeneralHelp" "BaselineOfGeneralTests" "BaselineOfGeometry" "BaselineOfHeuristicCompletion" "BaselineOfIDE" "BaselineOfIceberg" "BaselineOfKernelTests" "BaselineOfLibGit" "BaselineOfLiterateSmalltalk" "BaselineOfManifest" "BaselineOfMenuRegistration" "BaselineOfMetacello" "BaselineOfMicrodown" "BaselineOfMisc" "BaselineOfMonticello" ...]))
                                                                                                                    :error-thrown nil :symbol-status success :url "http://localhost:9092/api/Packages" :done-p nil :settings #3 :-buffer #<killed buffer> :-raw-header "HTTP/1.1 200 OK\nContent-Length: 18434\nContent-Type..." :-timer nil :-backend url-retrieve)
                                            :encoding utf-8))
  request("http://localhost:9092/api/Packages" :params nil :parser json-read :type "GET" :sync t :data nil :complete

I will dig into this next weekend.

Fun stuff and thank you for your work.

gettimothy commented 3 weeks ago

I got stuff working by changing the functions loop, case and typecase in the lisp code to cl-loop, cl-case and cl-typecase.

This is a fun project, thank you for your work.

jingtaozf commented 3 weeks ago

Can you create a pull request for your changes so I can merge them? Thanks for your support.

gettimothy @.***>于2024年8月19日 周一23:34写道:

I got stuff working by changing the functions loop, case and typecase in the lisp code to cl-loop, cl-case and cl-typecase.

This is a fun project, thank you for your work.

— Reply to this email directly, view it on GitHub https://github.com/jingtaozf/literate-smalltalk/issues/6#issuecomment-2296865572, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABAMYUUHST6HJJIDVAFK2TZSIF7HAVCNFSM6AAAAABLU5ZCYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJWHA3DKNJXGI . You are receiving this because you commented.Message ID: @.***>

vonHabsi commented 3 weeks ago

I got stuff working by changing the functions loop, case and typecase in the lisp code to cl-loop, cl-case and cl-typecase.

This is a fun project, thank you for your work.

Glad to see that you succeeded, with me noticing this only 11 minutes after you posted.

Looking forward to the pull requests that fix the issues.

gettimothy commented 3 weeks ago

Hi guys,

I have never done a pull request and I am afraid of breaking things.

In Emacs, just do a M-x query-replace  on...

loop -> cl-loop

case -> cl-case

typecase -> cl-typecase

in the literate-smalltalk.org file.

cordially,

t

---- On Mon, 19 Aug 2024 11:46:19 -0400 Jingtao Xu @.***> wrote ---

Can you create a pull request for your changes so I can merge them? Thanks for your support.

gettimothy @.***>于2024年8月19日 周一23:34写道:

I got stuff working by changing the functions loop, case and typecase in the lisp code to cl-loop, cl-case and cl-typecase.

This is a fun project, thank you for your work.

— Reply to this email directly, view it on GitHub https://github.com/jingtaozf/literate-smalltalk/issues/6#issuecomment-2296865572, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABAMYUUHST6HJJIDVAFK2TZSIF7HAVCNFSM6AAAAABLU5ZCYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJWHA3DKNJXGI . You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, https://github.com/jingtaozf/literate-smalltalk/issues/6#issuecomment-2296891535, or https://github.com/notifications/unsubscribe-auth/AARQMVGRF3E6FILXHHU6KRTZSIHMXAVCNFSM6AAAAABLU5ZCYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJWHA4TCNJTGU. You are receiving this because you modified the open/close state.

gettimothy commented 2 weeks ago

I have forked the repo.

I will work on the pull-request next weekend,

Thanks for your help

---- On Mon, 19 Aug 2024 11:48:09 -0400 Frank Church @.***> wrote ---

I got stuff working by changing the functions loop, case and typecase in the lisp code to cl-loop, cl-case and cl-typecase.

This is a fun project, thank you for your work.

Glad to see that you succeeded, with me noticing this only 11 minutes after you posted?

Looking forward to the pull requests that fix the issue.

— Reply to this email directly, https://github.com/jingtaozf/literate-smalltalk/issues/6#issuecomment-2296895360, or https://github.com/notifications/unsubscribe-auth/AARQMVGR6Z5MAKBQVB3RNXLZSIHTTAVCNFSM6AAAAABLU5ZCYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJWHA4TKMZWGA. You are receiving this because you modified the open/close state.