
Hi Racket friends:

Could you inform me about how to add a new LaTeX macro name for DrRacket editor. For example with \triangle (followed by alt-) we can write a triangle symbol in our editor. I would like to be able to write \inv? (for example) and write the symbol ¿ .
Thank you in advance for any pointers or ideas concerning how to accomplish this. Please Keep Safe.

The problem is that these constants are hardcoded, so adding a name for this macro can only be done via a pull request. However, fortunately you can easily use a quickscript for this. There’s already one that demonstrates how to do this: https://github.com/Metaxal/quickscript-extra/blob/master/scripts/complete-word.rkt

Here is a commit, that adds a new TeX command to DrRacket: https://github.com/racket/gui/commit/8f804e752d16c458faac7f049ecfd2f790ab86ec

To tune this to your needs, hit Scripts\|Manage scripts\|New script...
, name it “latex-macro” for example, then paste the code linked above. Change the words
to your needs, and the #:shortcut
and #:shortcut-prefix
also if you want to. Save it. You now have a new entry in the Scripts
menu, and also an associated keybinding

Note that the completion have both a before and an after parts, so in your case you only need the before ("\inv?" "¿" "")

@comer :point_up:

Thank you @laurent.orseau and @soegaard2 for sharing ideas and solutions concerning my problem. I hope to experiment with them. Thank you again.

Thanks again. For the moment I use the following lines: #lang s-exp framework/keybinding-lang
(keybinding "c:?" (λ (editor evt) (send editor insert "¿")))
(keybinding "c:!" (λ (editor evt) (send editor insert "¡")))
and they worked fine under DrRacket editor, after adding them with the preferences menu. It would be nice to have these keybindings by default (for example) in the new Racket 8.0 (that is: if they don’t affect negatively previous bindings). Please Keep Safe.

Is this behavior intended? It looks like a bug to me. (define flip-scope (make-syntax-introducer))
(define stx #'(+ 1 2 3))
(equal? stx (flip-scope (flip-scope stx))) ;; produces #f

Syntax-object equal?
is just eq?
, so not especially useful.

can it be equal? I have this syntax-original-components
function that takes a syntax object and returns a set of all of the pieces of it that are syntax-original?
, and I’d like to test it by checking that the set it returns is equal?
to the set of syntax objects I expect it to find.

I could just check the result of syntax->datum
on the outputs, but I’d like to make sure I’m not throwing away source location information or other useful metadata.

I think we probably shouldn’t drastically change the cost of equal?
on syntax objects at this point (i.e., a full comparison might involve checking a lot of structure), even if it’s not all that useful as-is.

that unfortunately makes sense

There’s so some laziness involved in syntax objects, right? Which would need to be forced for a general equality function.

It could still make sense to have a syntax=?
function in racket/syntax
, much like other kinds of data. Different kinds of equality on syntax objects can also be configured using some keyword argument or so.

I agree, although it would have to be implemented in the core

unsafe-syntax-scope-set=?

Probably doesn’t need to be unsafe

So I’ve adapted a Dockerfile and a docker-compose.yaml from your examples. They are at https://github.com/stormwatch/koyo-shorty/tree/ci I plead to anyone with some spare minutes to look and try them. Do you see any mistake or opportunities for improvement? Thanks in advance