Re: Line Numbers

Charlie Gordon <[email protected]> Sat, 3 Sep 2022 01:56:37 +0200
Newsgroups gmane.editors.qemacs.devel
Message-ID <[email protected]>
--Apple-Mail=_DE7A0521-54C6-4188-B747-39204C0E6C9A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

My mistake: toggle_line_numbers() applies to the current window.

When executed from ~/.qe/config, it applies to a dummy window and has no =
lasting effect. It it debatable whether this dummy window should get the =
default settings for all new windows=E2=80=A6

In the mean time, you can try and add the same line to a `.qerc` file in =
you home directory: it should automatically make line numbers visible =
when you load a new file, but they might disappear when you select =
another file in the same window=E2=80=A6 For work is needed for these =
window properties to get set to meaningful defaults when a different =
buffer is attached to a window, I shall think about a good solution.

Thank you for your feedback

Chqrlie.

>=20
> On 3 Sep 2022, at 01:08, Marc Wilson <[email protected]> wrote:
>=20
> That does not produce an error, but does not work to turn them on, =
either.
>=20
> --=20
> Marc Wilson
> [email protected] <mailto:[email protected]>
>=20
>=20
> On Fri, Sep 2, 2022, at 4:02 PM, Charlie Gordon wrote:
>> There is not, but you can add a line in your ~/.qe/config file:
>>=20
>> toggle_line_numbers();
>>=20
>> Chqrlie
>>=20
>>> On 3 Sep 2022, at 00:46, Marc Wilson <[email protected] =
<mailto:[email protected]>> wrote:
>>>=20
>>> Is there a variable that will force the line numbers on at startup, =
either global or .qerc ?  Reading variables.c doesn=E2=80=99t seem like =
there is one.
>>>=20
>>> --=20
>>> Marc Wilson
>>> [email protected] <mailto:[email protected]>
>>>=20
>>>=20
>>> On Fri, Sep 2, 2022, at 3:39 PM, Charlie Gordon wrote:
>>>> Indeed QE_STYLE_GUTTER is the style used for the line numbers:
>>>>=20
>>>>     /* line numbers */
>>>>     if (ds->line_numbers) {
>>>>         ds->style =3D QE_STYLE_GUTTER;
>>>>         display_printf(ds, -1, -1, "%6d  ", line_num + 1);
>>>>         ds->style =3D 0;
>>>>     }
>>>>=20
>>>> with a default definition of
>>>>=20
>>>>     STYLE_DEF(QE_STYLE_GUTTER, "gutter", /* #f84400 on grey25 */
>>>>               QERGB(0xf8, 0x44, 0x00), QERGB(0x3f, 0x3f, 0x3f), 0, =
0)
>>>>=20
>>>> Chqrlie.
>>>>=20
>>>>> On 3 Sep 2022, at 00:34, Marc Wilson <[email protected] =
<mailto:[email protected]>> wrote:
>>>>>=20
>>>>> What style element name is the numbers themselves?  I figured out =
that =E2=80=9Cgutter=E2=80=9D is the tray the numbers are in.
>>>>>=20
>>>>> --=20
>>>>> Marc Wilson
>>>>> [email protected] <mailto:[email protected]>
>>>>>=20
>>>>>=20
>>>>> On Fri, Sep 2, 2022, at 2:43 PM, Charlie Gordon wrote:
>>>>>> Hello Marc,
>>>>>>=20
>>>>>> You can toggle line numbers display with the toggle-line-numbers =
command bound to "C-x RET l=E2=80=9D and "C-c l=E2=80=9D
>>>>>>=20
>>>>>> This command can be found with the apropos command: C-h a line =
RET
>>>>>>=20
>>>>>> Enjoy!
>>>>>>=20
>>>>>> Chqrlie
>>>>>>=20
>>>>>>> On 2 Sep 2022, at 20:15, Marc Wilson <[email protected] =
<mailto:[email protected]>> wrote:
>>>>>>>=20
>>>>>>> Can Qemacs number lines onscreen?  I realize there=E2=80=99s a =
line counter in the mode line.
>>>>>>>=20
>>>>>>> --=20
>>>>>>> Marc Wilson
>>>>>>> [email protected] <mailto:[email protected]>

--Apple-Mail=_DE7A0521-54C6-4188-B747-39204C0E6C9A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" =
class=3D"">My mistake: toggle_line_numbers() applies to the current =
window.<div class=3D""><br class=3D""></div><div class=3D"">When =
executed from ~/.qe/config, it applies to a dummy window and has no =
lasting effect. It it debatable whether this dummy window should get the =
default settings for all new windows=E2=80=A6</div><div class=3D""><br =
class=3D""></div><div class=3D"">In the mean time, you can try and add =
the same line to a `.qerc` file in you home directory: it should =
automatically make line numbers visible when you load a new file, but =
they might disappear when you select another file in the same window=E2=80=
=A6 For work is needed for these window properties to get set to =
meaningful defaults when a different buffer is attached to a window, I =
shall think about a good solution.</div><div class=3D""><br =
class=3D""></div><div class=3D"">Thank you for your feedback</div><div =
class=3D""><br class=3D""></div><div class=3D"">Chqrlie.</div><div =
class=3D""><br class=3D""><div class=3D""><div><blockquote type=3D"cite" =
class=3D""><div class=3D""><br class=3D"">On 3 Sep 2022, at 01:08, Marc =
Wilson &lt;<a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><div =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D"">That does not produce an error, but does not work to turn =
them on, either.</div><div style=3D"font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><br class=3D""></div><div =
id=3D"sig39065985" style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><div =
class=3D"signature">--&nbsp;<br class=3D""></div><div =
class=3D"signature">Marc Wilson<br class=3D""></div><div =
class=3D"signature"><a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a><br class=3D""></div></div><div =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><br=
 class=3D""></div><div style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D""><br class=3D""></div><div =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D"">On =
Fri, Sep 2, 2022, at 4:02 PM, Charlie Gordon wrote:<br =
class=3D""></div><blockquote type=3D"cite" id=3D"qt" style=3D"font-family:=
 Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; word-wrap: break-word;" class=3D""><div =
class=3D"">There is not, but you can add a line in your ~/.qe/config =
file:<br class=3D""></div><div class=3D"qt-"><br class=3D""></div><div =
class=3D"qt-">toggle_line_numbers();<br class=3D""></div><div =
class=3D"qt-"><br class=3D""></div><div class=3D"qt-">Chqrlie<br =
class=3D""></div><div class=3D"qt-"><div class=3D""><br =
class=3D""></div><div class=3D""><blockquote type=3D"cite" =
class=3D"qt-"><div class=3D"qt-">On 3 Sep 2022, at 00:46, Marc Wilson =
&lt;<a href=3D"mailto:[email protected]" =
class=3D"qt-">[email protected]</a>&gt; wrote:<br class=3D""></div><div =
class=3D""><br class=3D""></div><div class=3D"qt-"><div class=3D"qt-" =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Is there a =
variable that will force the line numbers on at startup, either global =
or .qerc ? &nbsp;Reading variables.c doesn=E2=80=99t seem like there is =
one.<br class=3D""></div><div class=3D"qt-" style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br =
class=3D""></div><div id=3D"qt-sig39065985" class=3D"qt-" =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div =
class=3D"qt-signature">--&nbsp;<br class=3D""></div><div =
class=3D"qt-signature">Marc Wilson<br class=3D""></div><div =
class=3D"qt-signature"><a href=3D"mailto:[email protected]" =
class=3D"qt-">[email protected]</a><br class=3D""></div></div><div =
class=3D"qt-" style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;"><br class=3D""></div><div class=3D"qt-" =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br =
class=3D""></div><div class=3D"qt-" style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Fri, Sep 2, 2022, =
at 3:39 PM, Charlie Gordon wrote:<br class=3D""></div><blockquote =
type=3D"cite" id=3D"qt-qt" class=3D"qt-" style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: =
break-word;"><div class=3D"qt-">Indeed QE_STYLE_GUTTER is the style used =
for the line numbers:<br class=3D""></div><div class=3D"qt-qt-"><br =
class=3D""></div><div class=3D"qt-qt-"><div class=3D"qt-qt-">&nbsp; =
&nbsp; /* line numbers */<br class=3D""></div><div class=3D"qt-qt-">&nbsp;=
 &nbsp; if (ds-&gt;line_numbers) {<br class=3D""></div><div =
class=3D"qt-qt-">&nbsp; &nbsp; &nbsp; &nbsp; ds-&gt;style =3D =
QE_STYLE_GUTTER;<br class=3D""></div><div class=3D"qt-qt-">&nbsp; &nbsp; =
&nbsp; &nbsp; display_printf(ds, -1, -1, "%6d &nbsp;", line_num + 1);<br =
class=3D""></div><div class=3D"qt-qt-">&nbsp; &nbsp; &nbsp; &nbsp; =
ds-&gt;style =3D 0;<br class=3D""></div><div class=3D"qt-qt-">&nbsp; =
&nbsp; }<br class=3D""></div><div class=3D"qt-qt-"><br =
class=3D""></div><div class=3D"qt-qt-">with a default definition of<br =
class=3D""></div><div class=3D"qt-qt-"><br class=3D""></div><div =
class=3D"qt-qt-"><div class=3D"qt-qt-">&nbsp; &nbsp; =
STYLE_DEF(QE_STYLE_GUTTER, "gutter", /* #f84400 on grey25 */<br =
class=3D""></div><div class=3D"qt-qt-">&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; QERGB(0xf8, 0x44, 0x00), QERGB(0x3f, 0x3f, 0x3f), =
0, 0)<br class=3D""></div></div><div class=3D"qt-qt-"><br =
class=3D""></div><div class=3D"qt-qt-">Chqrlie.<br class=3D""></div><div =
class=3D"qt-qt-"><br class=3D""></div><div class=3D"qt-"><blockquote =
type=3D"cite" class=3D"qt-qt-"><div class=3D"qt-qt-">On 3 Sep 2022, at =
00:34, Marc Wilson &lt;<a href=3D"mailto:[email protected]" =
class=3D"qt-qt-">[email protected]</a>&gt; wrote:<br =
class=3D""></div><div class=3D"qt-"><br class=3D""></div><div =
class=3D"qt-qt-"><div class=3D"qt-qt-" style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;">What style element =
name is the numbers themselves? &nbsp;I figured out that =E2=80=9Cgutter=E2=
=80=9D is the tray the numbers are in.<br class=3D""></div><div =
class=3D"qt-qt-" style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;"><br class=3D""></div><div =
id=3D"qt-qt-sig39065985" class=3D"qt-qt-" style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div =
class=3D"qt-qt-signature">--&nbsp;<br class=3D""></div><div =
class=3D"qt-qt-signature">Marc Wilson<br class=3D""></div><div =
class=3D"qt-qt-signature"><a href=3D"mailto:[email protected]" =
class=3D"qt-qt-">[email protected]</a><br class=3D""></div></div><div =
class=3D"qt-qt-" style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;"><br class=3D""></div><div =
class=3D"qt-qt-" style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;"><br class=3D""></div><div =
class=3D"qt-qt-" style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;">On Fri, Sep 2, 2022, at 2:43 PM, =
Charlie Gordon wrote:<br class=3D""></div><blockquote type=3D"cite" =
id=3D"qt-qt-qt" class=3D"qt-qt-" style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: =
break-word;"><div class=3D"qt-qt-qt-">Hello Marc,<br class=3D""></div><div=
 class=3D"qt-qt-qt-"><br class=3D""></div><div class=3D"qt-qt-qt-">You =
can toggle line numbers display with the toggle-line-numbers command =
bound to "C-x RET l=E2=80=9D and "C-c l=E2=80=9D<br class=3D""></div><div =
class=3D"qt-qt-qt-"><br class=3D""></div><div class=3D"qt-qt-qt-">This =
command can be found with the apropos command: C-h a line RET<br =
class=3D""></div><div class=3D"qt-qt-qt-"><br class=3D""></div><div =
class=3D"qt-qt-qt-">Enjoy!<br class=3D""></div><div =
class=3D"qt-qt-qt-"><br class=3D""></div><div =
class=3D"qt-qt-qt-">Chqrlie<br class=3D""></div><div =
class=3D"qt-qt-qt-"><div class=3D"qt-qt-"><br class=3D""></div><div =
class=3D"qt-qt-qt-"><div class=3D"qt-qt-"><blockquote type=3D"cite" =
class=3D"qt-qt-qt-"><div class=3D"qt-qt-qt-">On 2 Sep 2022, at 20:15, =
Marc Wilson &lt;<a href=3D"mailto:[email protected]" =
class=3D"qt-qt-qt-">[email protected]</a>&gt; wrote:<br =
class=3D""></div><div class=3D"qt-qt-"><br class=3D""></div><div =
class=3D"qt-qt-qt-"><div class=3D"qt-qt-qt-" style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;">Can Qemacs number =
lines onscreen? &nbsp;I realize there=E2=80=99s a line counter in the =
mode line.<br class=3D""></div><div class=3D"qt-qt-qt-" =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br =
class=3D""></div><div id=3D"qt-qt-qt-sig39065985" class=3D"qt-qt-qt-" =
style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div =
class=3D"qt-qt-qt-signature">--&nbsp;<br class=3D""></div><div =
class=3D"qt-qt-qt-signature">Marc Wilson<br class=3D""></div><div =
class=3D"qt-qt-qt-signature"><a href=3D"mailto:[email protected]" =
class=3D"qt-qt-qt-">[email protected]</a></div></div></div></blockquote><=
/div></div></div></blockquote></div></blockquote></div></div></blockquote>=
</div></blockquote></div></div></blockquote></div></blockquote></div><br =
class=3D""></div></div></body></html>=

--Apple-Mail=_DE7A0521-54C6-4188-B747-39204C0E6C9A--