Re: Conditionals in config

Charlie Gordon <[email protected]> Tue, 24 Dec 2024 01:18:18 +0100
Newsgroups gmane.editors.qemacs.devel
Message-ID <[email protected]>
--Apple-Mail=_04FC7308-43EF-4945-96FE-8AC03CBE09C3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hi Marc,

The question is how to you paste the text into the buffer?

* if you use yank (C-y) with working support of the system clipboard, =
TABs in the clipboard should be preserved.
* if you use the terminal pasting feature, qemacs receives the TABs as =
keyboard input and depending on the current buffer mode, they will =
self-insert or cause qemacs to insert spaces up to the indentation.

Which if these do you perform?

Your suggestion to make `.patch`files use TAB as a regular self-insert =
character makes sense.  This cannot be achieved with conditionals in the =
config file, I will look into that.  Makefiles obviously need a similar =
mode.

Chqrlie.

> On 23 Dec 2024, at 22:50, Marc Wilson <[email protected]> wrote:
>=20
> Is there a way to do conditionals in the config file based on filename =
or extension?
>=20
> Example... I have tab expansion turned on and set to four spaces.  I =
touched in a shell a new file with a .patch extension, then opened it in =
qemacs and pasted a patch into it and saved it.
>=20
> But it wouldn't apply.  The code base was tabs, and qemacs had =
replaced the tabs.  Perhaps there's an option to git apply that would =
correct for that, but I don't know what it is.
>=20
> So it would be useful to be able to condition things like that based =
on the filename or extension (or filetype, I could do it the other way =
and only force the expansion on python files ^_^ ).=20
>=20
> --=20
> Marc Wilson
> [email protected] <mailto:[email protected]>

--Apple-Mail=_04FC7308-43EF-4945-96FE-8AC03CBE09C3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dus-ascii"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;">Hi =
Marc,<div><br></div><div>The question is how to you paste the text into =
the buffer?<div><br></div><div>* if you use yank (C-y) with working =
support of the system clipboard, TABs in the clipboard should be =
preserved.</div><div>* if you use the terminal pasting feature, qemacs =
receives the TABs as keyboard input and depending on the current buffer =
mode, they will self-insert or cause qemacs to insert spaces up to the =
indentation.</div><div><br></div><div>Which if these do you =
perform?</div><div><br></div><div>Your suggestion to make `.patch`files =
use TAB as a regular self-insert character makes sense. &nbsp;This =
cannot be achieved with conditionals in the config file, I will look =
into that. &nbsp;Makefiles obviously need a similar =
mode.</div><div><br></div><div>Chqrlie.<br =
id=3D"lineBreakAtBeginningOfMessage"><div><br><blockquote =
type=3D"cite"><div>On 23 Dec 2024, at 22:50, Marc Wilson =
&lt;[email protected]&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div><meta charset=3D"UTF-8"><div =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;">Is there a way =
to do conditionals in the config file based on filename or =
extension?<br></div><div style=3D"caret-color: rgb(0, 0, 0); =
font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><br></div><div style=3D"caret-color: rgb(0, 0, =
0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;">Example... I have tab expansion turned on and =
set to four spaces.&nbsp; I touched in a shell a new file with a .patch =
extension, then opened it in qemacs and pasted a patch into it and saved =
it.<br></div><div style=3D"caret-color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;"><br></div><div style=3D"caret-color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;">But it wouldn't apply.&nbsp; The code base was tabs, and qemacs =
had replaced the tabs.&nbsp; Perhaps there's an option to git apply that =
would correct for that, but I don't know what it is.<br></div><div =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><br></div><div =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;">So it would be =
useful to be able to condition things like that based on the filename or =
extension (or filetype, I could do it the other way and only force the =
expansion on python files ^_^ ).&nbsp;<br></div><div style=3D"caret-color:=
 rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: 400; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><br></div><div id=3D"sig39065985" =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><div =
class=3D"signature">--&nbsp;<br></div><div class=3D"signature">Marc =
Wilson<br></div><div class=3D"signature"><a =
href=3D"mailto:[email protected]">[email protected]</a></div></div></div=
></blockquote></div><br></div></div></body></html>=

--Apple-Mail=_04FC7308-43EF-4945-96FE-8AC03CBE09C3--