Re: Stylesheet usability

Tim Hutt via Ipe-discuss <ipe-discuss-rGrgPyRx506NN8uzcEdRPYRWq/[email protected]> Tue, 30 Apr 2019 15:54:00 +0100
Newsgroups gmane.comp.graphics.ipe.general
Message-ID <CAKuVd4CHGQA9uTrnLpHP3X23pYoDnR3raqwbx6j_iUcqAX6HbQ@mail.gmail.com>
--===============3894457688989984114==
Content-Type: multipart/alternative; boundary="000000000000e0cf630587c092ff"

--000000000000e0cf630587c092ff
Content-Type: text/plain; charset="UTF-8"

Re 2 a), I was thinking something like the following. It *almost* works on
Mac, except the "Waiting for external editor" dialog never disappears.
Haven't tested it on Windows.

if config.platform == "apple" then
  prefs.external_editor = "/usr/bin/open -W -n -e %s"
elseif config.platform == "win" then
  prefs.external_editor = "%WINDIR%\\notepad.exe %s"
else
  if os.getenv("EDITOR") then
    prefs.external_editor = os.getenv("EDITOR") .. " %s"
  else
    prefs.external_editor = nil
  end
end



On Tue, 30 Apr 2019 at 15:32, Tim Hutt <[email protected]> wrote:

> Hi,
>
> I really love IPE, but a long-time usability issue for me is editing
> stylesheets. There are two main issues:
>
> 1. It doesn't seem possible to have an embedded style-sheet - if I want
> just one file to be a weird size I have to make a stylesheet specific to
> that file, and then remember to copy it around with that file. It's a bit
> awkward. An implicit "(embedded)" stylesheet would be great.
>
> 2. In the stylesheets dialog there is a convenient Edit button but I have
> never actually successfully used it because it always tells me there is no
> text editor configured. I assume to do that I have to edit the `prefs.lua`
> file which is ... somewhere... This is usually way more hassle than I want
> to deal with so I give up. I can think of two good solutions:
>
>   a) Use an editor provided by the OS, e.g. using `open` on Mac,
> `xdg-open` on Linux, etc.
>   b) Provide a built-in editor. This can literally just be a dialog box
> with an edit box in it. That is still 100 times better than "Sorry no
> external editor defined"
>
> If there is a sensible default editor you could also make
> `App->Preferences` (or whatever the equivalent on Windows is) open
> `prefs.lua` in that editor so I don't have to go hunting through app
> bundles for it.
>
> Cheers,
>
> Tim
>
> PS: Hope that wasn't too ranty - it's just a small annoyance in an
> otherwise excellent program that I have let build up rather than actually
> fixing it...
>

--000000000000e0cf630587c092ff
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Re 2 a), I was thinking something like th=
e following. It *almost* works on Mac, except the &quot;Waiting for externa=
l editor&quot; dialog never disappears. Haven&#39;t tested it on Windows.<d=
iv><br></div><div>if config.platform =3D=3D &quot;apple&quot; then<br></div=
><div>=C2=A0 prefs.external_editor =3D &quot;/usr/bin/open -W -n -e %s&quot=
;</div><div>elseif config.platform =3D=3D &quot;win&quot; then</div><div>=
=C2=A0 prefs.external_editor =3D &quot;%WINDIR%\\notepad.exe %s&quot;</div>=
<div>else</div><div>=C2=A0 if os.getenv(&quot;EDITOR&quot;) then</div><div>=
=C2=A0 =C2=A0 prefs.external_editor =3D os.getenv(&quot;EDITOR&quot;) .. &q=
uot; %s&quot;</div><div>=C2=A0 else=C2=A0</div><div>=C2=A0 =C2=A0 prefs.ext=
ernal_editor =3D nil</div><div>=C2=A0 end</div><div>end</div><div><br></div=
><div><br></div></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr"=
 class=3D"gmail_attr">On Tue, 30 Apr 2019 at 15:32, Tim Hutt &lt;<a href=3D=
"mailto:[email protected]">[email protected]</a>&gt; wrote:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
 solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">Hi,<div><br></di=
v><div>I really love IPE, but a long-time usability issue for me is editing=
 stylesheets. There are two main issues:</div><div><br></div><div>1. It doe=
sn&#39;t seem possible to have an embedded style-sheet - if I want just one=
 file to be a weird size I have to make a stylesheet specific to that file,=
 and then remember to copy it around with that file. It&#39;s a bit awkward=
. An implicit &quot;(embedded)&quot; stylesheet would be great.</div><div><=
br></div><div>2. In the stylesheets dialog there is a convenient Edit butto=
n but I have never actually successfully used it because it always tells me=
 there is no text editor configured. I assume to do that I have to edit the=
 `prefs.lua` file which is ... somewhere... This is usually way more hassle=
 than I want to deal with so I give up. I can think of two good solutions:<=
/div><div><br></div><div>=C2=A0 a) Use an editor provided by the OS, e.g. u=
sing `open` on Mac, `xdg-open` on Linux, etc.<br></div><div>=C2=A0 b) Provi=
de a built-in editor. This can literally just be a dialog box with an edit =
box in it. That is still 100 times better than &quot;Sorry no external edit=
or defined&quot;</div><div><br></div><div>If there is a sensible default ed=
itor you could also make `App-&gt;Preferences` (or whatever the equivalent =
on Windows is) open `prefs.lua` in that editor so I don&#39;t have to go hu=
nting through app bundles for it.</div><div><br></div><div>Cheers,</div><di=
v><br></div><div>Tim</div><div><br></div><div>PS: Hope that wasn&#39;t too =
ranty - it&#39;s just a small annoyance in an otherwise excellent program t=
hat I have let build up rather than actually fixing it...</div></div>
</blockquote></div>

--000000000000e0cf630587c092ff--

--===============3894457688989984114==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Ipe-discuss mailing list
Ipe-discuss-rGrgPyRx506NN8uzcEdRPYRWq/[email protected]
https://mailman.science.uu.nl/mailman/listinfo/ipe-discuss

--===============3894457688989984114==--