From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/3958 Path: main.gmane.org!not-for-mail From: "Giuseppe Bilotta" Newsgroups: gmane.comp.tex.context Subject: Re: Comments on \defineshortcut Date: Fri, 2 Feb 2001 22:47:23 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <008701c08d62$08079540$a3ccfea9@nuovo> References: <3.0.6.32.20010202100725.019aa100@server-1> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035394658 21602 80.91.224.250 (23 Oct 2002 17:37:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:37:38 +0000 (UTC) Cc: "ConTeXt" Original-To: "Hans Hagen" Xref: main.gmane.org gmane.comp.tex.context:3958 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:3958 > At 01:16 PM 2/1/01 +0100, Giuseppe Bilotta wrote: > >Hello, I'm playing with shortcuts now, and I found some limitations on the > >current implementation. > > > >It's impossible to re-define shortcuts other than <>; the reason is that, > once I > >issue > > > >\defineshortcut [()][a][style=\overstrike] > > > >I cannot issue > > > >\defineshortcut [()][b][style=\underline] > > > >later because an "undefined control sequence" error is issued. > > \def\dodefineshortcut[#1][#2][#3]% > {\ifthirdargument > \ConvertConstantAfter\doifelse{#1}{} > {\dododefineshortcut[<>][#2][#3]} > {\dododefineshortcut[#1][#2][#3]}% > \else\ifsecondargument > \dododefineshortcut[<>][#1][#2]% > \else > \dododefineshortcut[<>][][#1]% > \fi\fi} > Will patch, recreate and test ASAP. > > >Second problem: ligs fail in some cases (if I \defineshortcut > >[--][o][style\overstrike] then the following lines misses a few beats: > > > >it seems -o:to work- well--does it?---really? > > see it this way: in --- the first - picks up everything uuntil the next - > so the third - triggers a new - which cannot find its matching - > even the -- lig is lost, anyway. But never mind: > >Third problem: math fails too: > >> > >$(a+b)/(a-c-d)_{a+b}$ > >with -- and ++ defined as shortcuts fail (not on parenthesis, if I make those > >active too; depends on the fact that parenthesis are delimiters in math > mode?) > > Hm, this works ok here, unless of course you redefine + a few times since > then the last meaning is used. > > \defineshortcut[++] saves the old meaning which is + > \defineshortcut[++] saves th eole meaning which is shortcut > > and in math mode the second one is used which means that the first shortcut > is invokes. > Maybe then saving should check if the old meaning was already a shortcut ... if this is doable. > PS. Actually i implemented shortcuts as a kind of joke. Such a pity it's only a joke :-). They are very good for fast typing ... Thanks very much Giuseppe Bilotta Using Microsoft products is like having sex without condoms---but much less pleasurable