After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 692822 - SPICE syntax highlighting
SPICE syntax highlighting
Status: RESOLVED OBSOLETE
Product: gtksourceview
Classification: Platform
Component: New *.lang file
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2013-01-29 17:58 UTC by Vlad
Modified: 2021-07-05 11:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
.lang file with syntax highlighting for SPICE (9.67 KB, application/octet-stream)
2013-01-29 17:58 UTC, Vlad
Details
color scheme to match spice.lang (7.19 KB, application/xml)
2013-01-29 17:59 UTC, Vlad
Details
test schematic to test the syntax highlighting and colour scheme (3.78 KB, text/plain)
2013-02-02 19:31 UTC, Vlad
Details
A newer version. (10.00 KB, text/plain)
2013-07-10 05:28 UTC, Vlad
Details
A newer version (10.30 KB, application/xml)
2014-04-23 08:54 UTC, Vlad
Details
Corrected colours for gEdit (7.76 KB, application/xml)
2014-04-23 08:57 UTC, Vlad
Details
some updates (12.80 KB, text/plain)
2019-01-22 12:32 UTC, Vlad
Details

Description Vlad 2013-01-29 17:58:10 UTC
Created attachment 234769 [details]
.lang file with syntax highlighting for SPICE

Hello

(In case it doesn't show, I'm new to this)

Searching for SPICE-like syntax highlighting across the 'net I either found none or, those that were, I didn't like, so I made mine. I wrote to the gedit-list and it was suggested I add it here. It's nothing fancy (not what I originally had in mind) but it works just fine and there may be changes from time to time. It's probably something very childish (code-wise) but bear in mind that until some week earlier I had no idea what PCRE means or does.

I also made a color scheme to match LTspice's (which served as a reference), which is nothing else than gedit's own kate.xml modified here and there.

Now, in the mail it was said to properly format it, I did that comparing it with def.lang, but if anything is wrong just say it and I'll modify it accordingly. I may not answer the next day, but I will.


Regards,
Vlad
Comment 1 Vlad 2013-01-29 17:59:55 UTC
Created attachment 234770 [details]
color scheme to match spice.lang

It's kate.xml slightly modified, so I don't know how much this one counts.
Comment 2 Vlad 2013-02-02 08:36:18 UTC
(While scrolling with the touchpad I clicked "Commit", if something bad happens because of it, you have the cause here, sorry for that)
Comment 3 Paolo Borelli 2013-02-02 09:40:12 UTC
I have only glanced at the spice lang file but it seems mostly ok.

However it is not clear to me why do you need to modify the color scheme file...
Comment 4 Vlad 2013-02-02 19:29:02 UTC
(In reply to comment #3)
> I have only glanced at the spice lang file but it seems mostly ok.
> 
> However it is not clear to me why do you need to modify the color scheme
> file...

There's no dependancy of any sort, to each his own. It's simply a personal colour preference (i.e. dark green for comments instead of grey) to make it closer to LTspice's.

Better still, I'll attach a test netlist. This way, the way gedit displays it can be compared with LTspice's colour scheme. Ignore the blatant errors, they're on purpose.

The program is freeware, closed-source and can be freely downloaded from here: http://ltspice.linear.com/software/LTspiceIV.exe .
Comment 5 Vlad 2013-02-02 19:31:34 UTC
Created attachment 235073 [details]
test schematic to test the syntax highlighting and colour scheme

Just ignore any erroros, they're on purpose, it's just a test schematic.
Comment 6 Vlad 2013-07-10 05:28:33 UTC
Created attachment 248793 [details]
A newer version.

Corrected some .func detection and made it more "by the book" (LTspice-wise). It's probably just a bit faster now.
Comment 7 Vlad 2014-04-23 08:54:11 UTC
Created attachment 274937 [details]
A newer version

- values are highlighted without the "=" sign
- corrected the highlighting for "table()"
- added *.mod to the list of recognizable extensions (model list)
Comment 8 Vlad 2014-04-23 08:57:03 UTC
Created attachment 274938 [details]
Corrected colours for gEdit

- corrected the colour display for gEdit when "Display right margin at column ..." and "Display line numbers" options are checked
Comment 9 Vlad 2014-04-24 18:27:08 UTC
Are there other requirements for this? If yes, could you please enumerate them or link me to a place where I can read them?

I have searched a bit and seen another request like mine and it said there to file for a MIME entry in freedesktop.org.xml. I actually headed there to do it but their methods imply specifying a header for *.net, .cir, *.sp (or *.sub, *.lib, *.mod), which I cannot because they are simply ASCII files, nothing more, they can have any character in them. What's more, there is no particular program that opens them up, for example installing LTspice will let it recognize the extensions, installing ngspice will not. PSpice has its own formats but accepts default netlists while Berkeley SPICE does not mingle with extensions, it simply opens them up if they are passed to the program.

So, this syntax highlighting is meant to be used by those users of GtkSourceView family who edit their netlists or libraries (the aforementioned extensions) with gEdit (or Mousepad, Scribes, whatever other editor supports GtkSourceView). They are not special extensions but the syntax highlighting can be used to recognize them and... highlight them. They're just like a *.c file, there's no default C programming software that needs these specific extensions, they are simply ASCII (Unicode, whatever) files that hold lines of characters with C-syntax. That's all.
Comment 10 Vlad 2019-01-22 12:32:22 UTC
Created attachment 374186 [details]
some updates

I have to wonder, is this still alive?
Comment 11 GNOME Infrastructure Team 2021-07-05 11:02:40 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/

Thank you for your understanding and your help.