On Fri, 13 Nov 2015 10:41:39 -0600
Kent Tenney <[email protected]> wrote:
> > and as John mentioned you have
>
> > ,,={|{x='__NEXT_PLACEHOLDER'}|}
>
> > in the `@data abbreviations` node?
>
> Of course not, I'm an idiot.
> Much better now, having followed directions.
>
> Other editors make a big deal of snippet capability not nearly
> as nice as this. Is there a reason it's not available by default?
x;;={|{x=os.system("mkext2fs /dev/sda1")}|}
could turn x;; into an abbreviation that formats your hard drive... I
think it's its relationship to unexpected execution of code in received
.leo documents that causes caution, although I agree that's unfortunate.
Might be possible to hit middle ground where just snippet insertion and
a hard ,, select next work, and you have to change a setting to enable
the more general {|{ code here }|} expansion.
Maybe file an enhancement bug?
Cheers -Terry
> Thanks,
> Kent
>
> On Fri, Nov 13, 2015 at 9:55 AM, 'Terry Brown' via leo-editor
> <[email protected]> wrote:
> > On Fri, 13 Nov 2015 08:21:47 -0600
> > Kent Tenney <[email protected]> wrote:
> >
> >> I have the following abbrev def:
> >> ====================================
> >> svg;;=<svg xmlns="http://www.w3.org/2000/svg"
> >> \:xmlns:xlink="http://www.w3.org/1999/xlink"
> >> \:width="<|width|>" height="<|height|>" viewBox="<|viewbox|>"
> >> \:xml:lang="en">
> >> \:</svg>
> >> ====================================
> >>
> >> When I type svg;; it appears as desired, with 'width' selected and
> >> focused I enter a number, type double comma and get
> >>
> >> width="200,," height="<|height|>" viewBox="<|viewbox|>"
> >>
> >> enable-abbreviations and scripting-abbreviations are True
> >
> > and as John mentioned you have
> >
> > ,,={|{x='__NEXT_PLACEHOLDER'}|}
> >
> > in the `@data abbreviations` node?
> >
> > do
> >
> > c.frame.log.clearLog()
> > g.es(c.config.getData('abbreviations'))
> >
> > to check you're not getting more than one `@data abbreviations`
> > node in the mix
> >
> > It's working for me, so if the above doesn't help, you're going to
> > need to try a vanilla setup and track down what's different. I
> > assume you're running a recent build, ,, was broken at one point
> > many months back.
> >
> > Cheers -Terry
> >
> >> Thanks,
> >> Kent
> >>
> >> Leo 5.1-final, build 20151028094354, Wed Oct 28 09:43:54 CDT 2015
> >> Git repo info: branch = master, commit = 1f46364de6bc
> >> Python 2.7.6, PyQt version 4.8.6
> >> linux2
> >>
> >>
> >>
> >> On Fri, Nov 13, 2015 at 7:09 AM, john lunzer <[email protected]>
> >> wrote:
> >> > Abbreviations are the cat's pajamas. Definitely a great feature
> >> > to have. My double comma shortcut is working correctly.
> >> >
> >> > Unfortunately abbreviations are notoriously difficult to set up.
> >> >
> >> > Two settings need to be present in your myLeoSettings.py under
> >> > your @settings node:
> >> >
> >> > @bool enable-abbreviations = True
> >> >
> >> > @bool scripting-abbreviations = True
> >> >
> >> >
> >> > In addition you need a "@data abbreviations" node (this can be
> >> > found in leo\config\exampleSettings.leo) under your @settings
> >> > node which contains :
> >> >
> >> > # special case, causes core to select next place holder for
> >> > editing ,,={|{x='__NEXT_PLACEHOLDER'}|}
> >> >
> >> >
> >> > And for the funner more advanced abbreviations you need "@data
> >> > abbreviations-subst-env" from leoSettings.leo under your
> >> > @settings node.
> >> >
> >> > If ensuring you have those in place doesn't work we need to get
> >> > Terry involved, but hopefully it shouldn't come to that.
> >> >
> >> > On Friday, November 13, 2015 at 7:41:57 AM UTC-5, Kent Tenney
> >> > wrote:
> >> >>
> >> >> Why am I not making more use of these, they look
> >> >> to be the cat's pajamas.
> >> >>
> >> >> Is the double comma capability working for others?
> >> >>
> >> >> ========================================
> >> >> Abbreviations can define templates in which ``<|a-field-name|>``
> >> >> denotes a field to be filled in::
> >> >>
> >> >> input;;=<input type="text/submit/hidden/button"
> >> >> \:name="<|name|>"
> >> >> \:value="" id="<|id|>">\n
> >> >>
> >> >> Typing ``,,`` after inserting a template selects the next field.
> >> >> ========================================
> >> >>
> >> >> I find the first field is handled correctly, double comma just
> >> >> emits the commas.
> >> >>
> >> >> Thanks,
> >> >> Kent
> >> >
> >> > --
> >> > You received this message because you are subscribed to the
> >> > Google Groups "leo-editor" group.
> >> > To unsubscribe from this group and stop receiving emails from it,
> >> > send an email to [email protected].
> >> > To post to this group, send email to [email protected].
> >> > Visit this group at http://groups.google.com/group/leo-editor.
> >> > For more options, visit https://groups.google.com/d/optout.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "leo-editor" group. To unsubscribe from this group and stop
> > receiving emails from it, send an email to
> > [email protected]. To post to this group,
> > send email to [email protected]. Visit this group at
> > http://groups.google.com/group/leo-editor. For more options, visit
> > https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.