Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 280533 - x11-libs/gtksourceview gentoo.lang file causes gedit to wrong highlighting plain text files
Summary: x11-libs/gtksourceview gentoo.lang file causes gedit to wrong highlighting pl...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on: 214850
Blocks:
  Show dependency tree
 
Reported: 2009-08-06 05:44 UTC by Andrew Cowie
Modified: 2010-06-13 16:13 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Remove the MIME type claim from gentoo.lang (gentoo.lang_remove-mimetype-claim.patch,385 bytes, patch)
2009-11-08 19:19 UTC, Léo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cowie 2009-08-06 05:44:55 UTC
Every time I use GEdit to {open a, create a new} text file, it thinks the filetype is something called "gentoo" and imposes all sorts of highlighting on what is a *text* file, yo.

The UI to switch the highlighting mode to "Plain Text" is cumbersome. And you'd think that for .txt as an extension, it would figure out that it should be "Plain Text".

I can't for the life of me find where GEdit has been told to use this as the default format. It's horrible.

One possibiltiy is gtksourceview's /usr/share/gtksourceview-2.0/language-specs/gentoo.lang Obviously that's the markup file, but I can't see anything in there that talks about .txt, nor anything in either package that says it should be used.

Is there anything that can be done to make the default for plain text files "Plain Text"?

AfC
Comment 1 Rémi Cardona (RETIRED) gentoo-dev 2009-08-06 06:27:42 UTC
Confirming but this oddity hasn't bothered me half as much as Andrew ;)
Comment 2 Léo 2009-11-08 19:19:03 UTC
Created attachment 209658 [details, diff]
Remove the MIME type claim from gentoo.lang

Hi,

The problem is caused by the fact that the Gentoo syntax file is the only syntax file claiming the text/plain MIME type. The "Plain Text" entry in Gedit is virtual, and does not claim the MIME type.

The solution is to remove the MIME type claim, which should not be here anyway, as it is a matching claim (and there is no MIME type which would help to differentiate Gentoo scripts enough), and not a definition claim (which would be a shell script MIME type anyway).

I attached the patch for this.

The workaround, for users, until it is applied by the Gentoo team (to /usr/portage/x11-libs/gtksourceview/files/2.0/gentoo.lang), is to simply modify the installed file directly (/usr/share/gtksourceview-2.0/language-specs/gentoo.lang), or if it is not applied soon, to copy the file to /home/x/.local/share/gtksourceview-2.0/language-specs/gentoo.lang and modify it there, not forgetting to remove it later, so it does not override later updates to the Gentoo syntax file. Then close any Gedit window, and restart it.

Thanks in advance to everyone who will work on this.

Bye.
Comment 3 Xepher 2010-03-14 08:31:16 UTC
Confirmed... both as annoying, and that the patch from Bonnet fixes it. (Came to the same fix on my own, and was going to add the same patch.) Ebuilds and such are still opened with the gentoo highlighting from the *.ebuild glob feature in the .lang file.
Comment 4 Pacho Ramos gentoo-dev 2010-04-26 21:57:12 UTC
Is the rest of gnome team ok with applying that patch?
Comment 5 Pacho Ramos gentoo-dev 2010-06-13 16:13:10 UTC
+*gtksourceview-2.10.3 (13 Jun 2010)
+
+  13 Jun 2010; Pacho Ramos <pacho@gentoo.org> files/2.0/gentoo.lang,
+  +gtksourceview-2.10.3.ebuild, metadata.xml:
+  Add new version for Gnome 2.30 and fix bug 280533 removing text/plain from
+  gentoo.lang.