IRC channel logs

2022-09-08.log

back to list of logs

<daviid>any emacs font-lock/color highlight pro? i asked the following quiz on #emacs, but so far no answer- https://paste.centos.org/view/a6cf8a68
<daviid>jao: ^^ would you be able to help? i see geiser also offers additional font-lock scheme-mode stuff, so maybe you'd know what's wrong in my attempt
<jao>daviid, in your regexp, this "\\(\\|-method\\*?\\|-vfunc\\)\\|" looks as if the leading "\\(\\|" is a leftover
<jao>in line 7 of https://paste.centos.org/view/55226c4a
<daviid>jao: what would be correct?
<daviid>i should remove the \\)\\|
<jao>i haven't tried, but at first glance, "-method\\*?\\|-vfunc\\)\\|"
<daviid>just keep "\\(\\|-method\\*?\\|-vfunc"
<daviid>?
<daviid>ah
<daviid>let me try whatyousuggest, i am lost here :)
<jao>you could try (re-search-forward ...) with your regexp to see if it works
<jao>re-build is nice for testing too
<daviid>jao: that didn't solve the problem, it still highlight as in the img paste
<jao>if you just try blindly, it probably won't work :) just read the resulting regular expression and understand it, how many groups it has, etc... the numbers afterwards refer to them
<jao>(i cannot look at it closer right now, sorry)
<daviid>i was hoping someone would spot the mistake, i really don't understand nothing about this, but thanksfor your help
<daviid>jao: fwiw, someone in #emacs kindly looked at it, and proposed this - https://paste.centos.org/view/bdcfcab5 - wich is not working yet, but they say it's the 'new way of doing this' and admittedly more readable. with this new code, i et this font-lock 'rendering' - https://imgur.com/a/wGZS7t6
<daviid>i can't figure out why it's not working
<jao>possibly because this-is-not-a-word in scheme mode
<jao>check with names that don't contain dashes and see if it works
<jao>if it does, that's the reason; instead of "word" it should be a "symbol"... not sure how to express that in that, ahem, readable syntax
<daviid>jao: hum ok will check
<daviid>tx
<daviid>i also tried this, (group (or "define-vfunc" "define-method*")), soit would apply this font-lockto both , but it misteriously fails
<daviid>jao: when i (define-vfunc (get (self <solitaire-peg>)) '(size contents)), it's not even rendering the define-vfunc anymore
***Spawns_carpeting is now known as Spawns_Carpeting
<jao>off the top of my head, i'd use something like "(\\(define-vfunc\\) +(\\([^ ]+\\) +(\\([^ ]\\)+ +(?\\([^ ]+\\))?[^)]*)"
<jao>but you should really just fire re-build, type in the regular expression and check it
<jao>blind copy and paste of what we see is not going to help, because we don't have time to check for you :)
***rgherdt_ is now known as rgherdt
<civodul>ArneBab: hi! yes; sorry for not following up, i've been swamped lately
<civodul>should call-with-input-file and call-with-output-file always use O_CLOEXEC?
<civodul>my take: yes
<civodul>because in spirit, the lifetime of the port is well-defined and doesn't escape the dynamic extent of the call
***fnstudio_ is now known as fnstudio
<jpoiret>civodul: I'd agree
<jpoiret>better: Guile-specific produres should all have O_CLOEXEC by default
<jpoiret>did you have a chance to look at my patchset by the way?
<jpoiret>the gnulib update might be messy but the rest seems to work quite well
<dsmith-work>Hey Hi Howdy, Guilers
<cwebber>rekado: finally booted up guile-studio, this is neat
<daviid>jao: sure,i naivelythought you would have the knowledge and experience to just spot the mistake in the 'so called by #emacs regex 'legacy code' that I copied from guile-scheme.el to 'play around' ...
<daviid>jao: i'd like to understand how this happens in uile/eiser, i mean font-lock and color highlighting, because, it just appens :), but i didn't add any specific code in my .emacs, as the one suggested by guile-scheme.el for example, nor any code that would have been suggested by geiser (I am not aware of any)
<daviid>jao: because then, one could just add '-vfunc' in that code, recompile/install and bingo. that would help g-golf users, not just 'me'
<daviid>jao: for define-method*, smae but then it should also handle #:optioanal and #:keyword, like define*, lambda* - that would serve all guilers (that use the define-method* proposed by Mark H. Weaver)
<ArneBab>civodul: no problem, I fully know being swamped (that’s why I usually only accept small tasks). Can you ack my request for inclusion? If not, whom should I ask instead? https://savannah.gnu.org/project/memberlist.php?group=guile
<jao>daviid, i'm not sure what code in geiser-guile are you referring to?
<daviid>my kb is failing a few keys, g and h (onlyif i press a ton ...) sorry for te misspelling
<jao>i don't know about guile-scheme.el
<daviid>jao: i don't kow, i open a sceme file, and witout having done any specific config in .emacs, it does font-locking color highlight the scheme code
<jao>then that must be in emacs' vanilla scheme mode
<jao>or some other package. geiser doesn't define font lock rules for define-method
<daviid>including goops code, which is not 'scheme' ... so, how does that happens, if you know ...
<daviid>ok
<daviid>emacs definitely 'knows' it's guile and even if i didn't 'M-x run-guile yet, the minor mode point guile and geiser
*daviid issuch a poor emacs user :)
<daviid>jao: fwiw, the legacy code (the one I first pasted to ask for help) is, to my own surprise, workinbg better then the code proposed by an emacs user and that uses 'rx ...'
<jao>where did you see the code you were trying to change?
<daviid>jao: in the guile tree, emacs/guile-scheme.el - line 53 and below ...
<jao>(calling string regexps "legacy" is an exaggeration, imho)
<daviid>jao: they called it 'legacy code' in #emacs, just repeating here :) i also don't think it is appropirate, but no #emacs users would help my with that 'legacy code' :):)
<jao>that's also an exaggeration. i am an emacs user.
<daviid>ah sure, i meant my attempts to get help 'there'...
<jao>i see no reason really why changing "\\(\\|-public\\|-method\\|-generic\\)\\|" to "\\(\\|-public\\|-method\\|-generic\\|-vfunc\\)\\|" wouldn't work for define-vfunc in the same way as it works for define-method, if their syntax is the same.
<daviid>right, i didn't try that,i actually 'partially' copied that code in my .emacs, and failed ...
<daviid>i need to try to understand if that file is installed, and wherer,
<daviid>the define-method* probably needs more care (?)
<daviid>but just adding it would at least offer font-lock for what is 'equal' to define-method
<jao>geiser doesn't install or use it, and it's possibly not quite compatible with the guile-scheme-mode it defines
<daviid>right, and i am lost as in how all this happens, what file can i change to acheive the goal ...
<daviid>if no file is installed, how does it correctly font-lock goops code
<daviid>which is definitely not in scheme.el or what ever ...
<jao>one thing you can try is assign the value you want directly to scheme-mode, with (font-lock-add-keywords 'scheme-mode modified-guile-geiser-font-lock-value)
<daviid>you mean i'd define modified-guile-geiser-font-lock-value
<jao>yes
<jao>adding that -vfunc to the full definition
<daviid>what full definition?
<jao>guile-scheme-font-lock-keywords
<jao>copy that defconst
<daviid>ah, that refers to undefined variables, unless i load thosse too
<daviid>ok, i'll try that route., thanks.
<jao>ah, i think you can remove the (list starting in line 69
<jao>so you don't depend on anything else, at least for your current purposes
<daviid>but that is exactly what I pasted here to ask for your help, and that does not work (yet)
<jao>did you do the font-lock-add-keywords bit?
<daviid>let me pste again, GIVE ME A SEC
<daviid>sorry, hit the capslock without willing to
<jao>daviid, alternatively, feel free to open an issue in geiser-guile for geiser to incorporate fontlock for define-method &co. and i'll add it eventually
<jao>(geiser guile variety)
<daviid>hereis the additional code in my .emacs - https://paste.centos.org/view/62657784 - hereis how it font-lock a define-vfunc and a define-method* - https://imgur.com/a/79SUQXn
<daviid>jao: it is define-method*, define-method works fine in emacs/geuser already
<daviid>but thatwould need morethen just adding defibne-method*, i think, as it would need to handle #:optional and #:keyword font-lock args ...
<jao>i don't think geiser is responsible of define-method working as you want
<daviid>jao: it is working for all of us, whether usig geiser or not, just open emacs no geiser and open a goopsfile, it will font-lock the goops code
<daviid>jao: Definbe-method* is _not_ part of goops, it is an additional code
<daviid>sorry, define-method* is _not_ in goops
<jao>i don't have guile-scheme.el in my filesystem, so i pretty much doubt that :)
<jao>geiser-guile only highlights the 'define-method' part, but not the inner arg names
<jao>and doesn't even know goops exists
<daviid>it definitely highlight the typed args, when a define-method arg is typed, it highlight the type, not the arg name
<daviid>right
<dsmith-work>daviid: You are probably talking about the scheme.el that comes with emacs. There is a variable scheme-font-lock-keywords-1 that looks like it handles define-method
<daviid>so back to my originbal quiz (not directed to you, just sharing}, how does all this happens, where is the file i can change ...
<daviid>dsmith-work: oh, i'll look tx
<dsmith-work>And (defvar scheme-font-lock-keywords scheme-font-lock-keywords-1)
<daviid>i didn't think scheme.el had goops related font-lock code
<jao>define-method is not a goops invention
<dsmith-work>;; Declarations. Hannes Haug <hannes.haug@student.uni-tuebingen.de> says
<dsmith-work>;; this works for SOS, STklos, SCOOPS, Meroon and Tiny CLOS.
<dsmith-work>
<dsmith-work>A comment in the file
<daviid>jao: sure, not scheme though, why would it be in scheme.el, but nice...
<daviid>ok great i'll lookinto it, asap, tx
<daviid>i'll still have to get help for define-method* though, but let's see how i can just get define-vfunc work now
<daviid>jao: is there a geiser ML?
<daviid>just curious
<dsmith-work>There are other clos-like thins besides goops.
<jao>daviid, geiser-users@nongnu.org
<daviid>tx
<daviid>i am probably a member already then, but i forgot
<daviid>forgot if ...
<dsmith-work>daviid: You probably want to change -method\\| to -method\\*?\\|
<dsmith-work>Though it looks like it already matches define*-method
<dsmith-work>daviid: So if you just change your api, it will JustWork™ ;^}
<daviid>dsmith-work: i won't dothat, but tx
<daviid>i am on seomethingelseright now, will get backto this later today ... tx
<dsmith-work>daviid: Yeah, JK. Didn't think you would. (change api)
<apteryx>could someone explain to me what (= procedure object) does in a (ice-9 match) pattern?
<apteryx>the doc is a bit too spartan to be useful on the matter
<lilyp>apteryx: it calls (procedure pattern) and binds it to object
<apteryx>I see, thanks!