texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Bracket convenience


From: Álvaro Tejero Cantero
Subject: Re: [Texmacs-dev] Bracket convenience
Date: 21 Mar 2003 17:43:14 +0100

Please!, Please!

And also make them autoadjust size depending on the content, leaving
C-Tab to circulate between sizes of delimiters. (This could lead to the
discussion of wether C-Tab is for structured variants or for
presentational ones, but anyway...).

cheers, álv.


On Fri, 2003-03-21 at 05:42, Nix N. Nix wrote:
> How about introducing a convenient way to create pairs of brackets ?
> 
> We already have A-( for large left '(', etc. How about having a function
> that produces a matching pair ? Not only that, but it should first cut
> the selection, if there is one, then insert the selection between the
> matched brackets.
> 
> This was one of the first things I've implemented when I first found
> TeXmacs (0.3.x.x).  However, I used custom macros and stuff like that to
> do it:
> 
> <assign|roundbrackets|<macro|x|<left|(><arg|x><right|)>>>
> 
> Then, I assigned C-( and C-) to (make-expand-arg "roundbrackets")
> 
> Not a very pretty solution, especially if you want to copy say, only the
> opening bracket and not the closing bracket.  So, how about this:
> 
> (define (make-brackets left right)
>   (if (selection-active-normal?)
>     (begin (cut "primary") (make-large-left left)
>       (paste "primary") (make-large-right right))
>     (begin (make-large-left left) (make-large-right right))))
> 
> accompanied by:
> 
> (kbd-map in-math?
> ("C-(" (make-brackets "(" ")"))
> ("C-)" (make-brackets "(" ")"))
> ("C-[" (make-brackets "[" "]"))
> ("C-]" (make-brackets "[" "]"))
> ("C-{" (make-brackets "{" "}"))
> ("C-}" (make-brackets "{" "}"))
> ("C-<" (make-brackets "langle" "rangle"))
> ("C->" (make-brackets "langle" "rangle"))
> ("C-|" (make-brackets "|" "|"))
> ("C-:" (make-brackets "||" "||"))
> ("M-C->" (make-brackets "|" ">"))  ;; Used in Quantum Mechanics: "bra"
> ("M-C-<" (make-brackets "<" "|"))) ;; Used in Quantum Mechanics: "ket"
> 
> These are the shortcuts I have been using essentially forever.  It might
> be a cool idea to have them in TeXmacs.  What do you think ?
> 
> 
> 
> _______________________________________________
> Texmacs-dev mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/texmacs-dev
-- 
álvaro tejero cantero
alqua.com, la red en estudio
"La perfection est atteinte non quand il ne reste rien à
ajouter, mais quand il ne reste rien à enlever"
Saint-Exupéry.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]