Skip to Content.
Sympa Menu

texmacs-users - Re: [texmacs-users] quoting [was : Re: last question… (read only if you want to see the working code)]

Subject: mailing-list for TeXmacs Users

List archive

Chronological Thread  
  • From: vincent douce <address@concealed>
  • To: address@concealed
  • Subject: Re: [texmacs-users] quoting [was : Re: last question… (read only if you want to see the working code)]
  • Date: Tue, 24 Dec 2024 10:08:18 +0100

i am beginning to have some quite proper code
i am wondering if one day some of my shortcuts could be implemented directly in TeXmacs
i can assure you they are very useful
Vincent


;---------------------- arbre de probas —————————
;
;
;

;i am working on it (some adjstements of dimensions have to be finished)
;juste to show
;
;
;
;
;
(kbd-map
(:mode in-text?)

("a z P"
;définition des abscisses et des ordonnées des lignes
(define xx1 "-4.4") (define xx2 "-1.4")(define xx3 "1.3")
(define yy1 "-3")(define yy2 "-2")(define yy3 "-1")
(define yy0 "0");coin le plus à gauche (début de l'arbre)
(define yy4 "1")(define yy5 "2")(define yy6 "3")
(begin; je n'ai pas compris pourquoi le define doit etre avant le begin...

(insert `;quasi quote pour pouvoir unquote les variables xxi et yyi

(math (tabular* (tformat (cwith "1" "-1" "2" "2" "cell-halign" "l") (cwith "1" "-1" "2" "2" "cell-height" "1cm") (cwith "1" "-1" "2" "2" "cell-vmode" "exact") (cwith "1" "-1" "1" "-1" "cell-valign" "c") (cwith "1" "-1" "2" "2" "cell-width" "2.5cm") (cwith "1" "-1" "2" "2" "cell-hmode" "exact") (cwith "1" "-1" "4" "4" "cell-width" "2.5cm") (cwith "1" "-1" "4" "4" "cell-hmode" "exact") (cwith "1" "-1" "4" "4" "cell-halign" "l") (cwith "4" "4" "1" "1" "cell-width" "2.5cm") (cwith "4" "4" "1" "1" "cell-hmode" "exact") (cwith "1" "-1" "6" "6" "cell-width" "3.5cm") (cwith "1" "-1" "6" "6" "cell-hmode" "exact") (cwith "1" "-1" "6" "6" "cell-halign" "l")

(table
;première ligne
(row
(cell "") (cell "") (cell "")
(cell (concat "p" (rsub "A") (around* "(" "B" ")") "="))
(cell "")
(cell (concat "p" (around* "(" "A<cap>B" ")") "="))
(cell ""))
;seconde ligne
(row
(cell "")
(cell (concat "p" (around* "(" "A" ")") "="))
(cell "")
(cell "")
(cell "")
(cell "")
(cell ""))
;troisième ligne
(row
(cell "")
(cell "")
(cell "")
(cell (concat "p" (rsub "A") (around* "(" (wide "B" "<wide-bar>") ")") "="))
(cell "")
(cell (concat "p" (around* "(" (concat "A<cap>" (wide "B" "<wide-bar>")) ")")))
(cell ""))
;quatrième ligne (contient les graphiques)
(row
(cell "")
(cell "")
(cell (draw-over "" (with "gr-mode" (tuple "edit" "line") "gr-frame" (tuple "scale" "1cm" (tuple "0.49gw" "0.5gh")) (graphics
(line (point ,xx2 ,yy5) (point ,xx1 ,yy0) (point ,xx2 ,yy2))
(line (point ,xx3 ,yy6) (point ,xx2 ,yy5) (point ,xx3 ,yy4))
(line (point ,xx3 ,yy3) (point ,xx2 ,yy2) (point ,xx3 ,yy1))
)) "4.10cm"))
(cell "") (cell "") (cell "") (cell ""))
;cinquième ligne
(row
(cell "")
(cell "")
(cell "")
(cell (concat "p" (rsub (wide "A" "<wide-bar>")) (around* "(" "B" ")") "="))
(cell "")
(cell (concat "p" (around* "(" (concat (wide "A" "<wide-bar>") "<cap>B") ")")))
(cell ""))
;sixième ligne
(row
(cell "")
(cell (concat "p" (around* "(" (wide "A" "<wide-bar>") ")") "="))
(cell "")
(cell "")
(cell "")
(cell "")
(cell ""))
;septième ligne
(row
(cell "")
(cell "")
(cell "")
(cell (concat "p" (rsub (wide "A" "<wide-bar>")) (around* "(" (wide "B" "<wide-bar>") ")") "="))
(cell "")
(cell (concat "p" (around* "(" (concat (wide "A" "<wide-bar>") "<cap>" (wide "B" "<wide-bar>")) ")")))
(cell ""))

);table
)))



);insert
);begin
);"a z p"
);kbd-map

;-----------------------------------------------

Le 24 déc. 2024 à 10:06, vincent douce <address@concealed> a écrit :

sorry i had clicked on « repond » instead of « respond to all"

Début du message réexpédié :

De: vincent douce <address@concealed>
Objet: quoting [was : Re: [texmacs-users] last question… (read only if you want to see the working code)]
Date: 24 décembre 2024 à 09:46:28 UTC+1
À: Giovanni Piredda <address@concealed>

Giovanni hello
before reading your message i had tried this
<GraphiqueCollé-6.png>
i have put a quasiquote instead of the general quote
then i have unquoted the variable and it works
so your solution was the same, hopefully i had not seen your mail before i try this

now i understand and now it works so thanks for your help 

but it remains a theoric point that i dont understand

so : the quote symbol ‘( will quote everything inside the (…)
ok
what i had not guessed is that it will quote also what is written in all level of inside parenthesis
(define x 4)
‘(+ (- x 2) 3)
the x is also quoted
i had not guessed this but now for me is is clear, it is logical

but in this case, why is the instruction « point » evaleatued  ?

i explain :
my orignal code with the simple quote (before i work on it) was something like (insert ’(…(thing …….(thing …(line.(point ‘’3’’ ‘’4''.)))….))

-> if the quote at the beginning quotes eveyrthing in all levels of inside parenthesis, then how it is that « line » and « point » are evaluated (and they are, since the line was drawed with this code)

Vincent

Le 24 déc. 2024 à 00:56, Giovanni Piredda <address@concealed> a écrit :

After having defined x1:

(kbd-map ("p tab" (insert `(point ,x1 "0"))))

On 23/12/24 22:48, Giovanni Piredda wrote:
I had not noticed the attachment, please accept my apology.

On the other hand, the text in the attachment is clear, and you are not following what it says.

One more hint:

quoting avec ' qui dit :  n'évalue rien à l'intérieur des ()

quasiquoting avec ` qui dit  ne pas exécuter sauf le unquoting ,



On 23/12/24 22:44, Giovanni Piredda wrote:

On 23/12/24 21:22, vincent douce wrote:

so i can’t see the problem



Because this is the wrong approach in my opinion.

I _suggest_ that you read this first: https://www.cs.utexas.edu/ftp/garbage/cs345/schintro-v13/schintro_129.html

But if you don't want, just let me know and I will write the answer to your question.

Here is a hint:

according to « quotes » i think that (point xx "-1") is correct : point is a function, xx a variable, both have to be evaluated

and are they, if they are inside an _expression_ that is quoted? Your quoted _expression_ starts with

'(with

and *contains*

(point xx "-1")

!!!!








Archive powered by MHonArc 2.6.24.

Top of Page