qemacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ~/.qe/config detected as Qscript


From: Charlie Gordon
Subject: Re: ~/.qe/config detected as Qscript
Date: Sun, 21 Aug 2022 20:30:34 +0200

On 21 Aug 2022, at 19:48, Piscium <groknok@gmail.com> wrote:
> 
> I wonder why my ~/.qe/config is detected as being of type Qscript
> instead of Text? I googled and apparently Qscript is an obscure script
> language for the Q language, the latter being a proprietary language
> for data analytics.

Qscript is a toy scripting language I wrote a long time ago. I never published 
it because it never reached production stage.
The syntax is close to the C syntax, except there is no preprocessing and fewer 
types and keywords.

> The disadvantage of it being detected as Qscript is that sometimes I
> press return and it indents the next line which is something I don't
> want. The only thing I have in that file besides the settings for two
> variables are comment lines starting with //.

The reason RET causes indentation is you forgot the `;` at the end of the line.
It is optional, but the indenter is not smart enough to distinguish 
continuation lines and single line expressions.
Just end your lines with semicolumns and you will be fine.

> I know that there is a command to change to text mode, however I am
> puzzled why it is detected as Qscript, since it is such an obscure
> language.

Trying to stabilise a syntax for extending qemacs is  along story.
The configuration file parser started as a very primitive string function 
handling a single line at a time,
then I used my toy language Qscript, which is much more elaborate, supports 
function and variable definitions but was not appropriate for the tiny build.
I was unhappy with the integration and unsure about how to handle the tricky 
emacs object model, so I stopped this development and reverted to a simple 
parser, yet capable of handling a full expression syntax and `if` / `else` 
statements. You can evaluate expressions with “eval-expression”, bound to "M-:”.
I explored using Javascript as an extension language, and joined with Fabrice 
Bellard, to write QuickJS, a full featured javascript interpreter, but 
Javascript is way too complex and not well suited for the task, so this issue 
is still open.

Thanks for your feedback,

Cheers

Chqrlie.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]