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 668911 - modelines: Support Emacs' Text mode
modelines: Support Emacs' Text mode
Status: RESOLVED FIXED
Product: gedit-plugins
Classification: Other
Component: General
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-28 13:42 UTC by Daniel Trebbien
Modified: 2019-03-23 20:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix (Adds a check for language "text" and handles it specially.) (2.14 KB, patch)
2012-02-08 16:37 UTC, Daniel Trebbien
needs-work Details | Review
Fix (Adds a check for language "text" and handles it specially.) (2.26 KB, patch)
2012-02-08 17:08 UTC, Daniel Trebbien
none Details | Review

Description Daniel Trebbien 2012-01-28 13:42:05 UTC
It would be nice if the modelines plugin could recognize `mode: Text`. The result would be that the GeditDocument's language would be unset, thus using the "Plain Text" highlight mode.
Comment 1 Daniel Trebbien 2012-02-08 16:37:56 UTC
Created attachment 207122 [details] [review]
Fix (Adds a check for language "text" and handles it specially.)
Comment 2 Paolo Borelli 2012-02-08 16:47:57 UTC
Review of attachment 207122 [details] [review]:

::: plugins/modelines/modeline-parser.c
@@ -747,2 +749,3 @@
 	}
 
+	doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)));

the prev code was simply using, GTK_SOURCE_BUFFER (buffer), so I guess you can simply have GEDIT_DOCUMENT (buffer), no need to go through the view

@@ +757,3 @@
 		GtkSourceLanguage *language;
 
 		manager = gedit_get_language_manager ();

manager could be local to the "else" scope

@@ -759,1 +761,1 @@
-		if (language != NULL)
+		if (g_ascii_strcasecmp(options.language_id, "text") == 0)

space before (
Comment 3 Daniel Trebbien 2012-02-08 17:08:58 UTC
Created attachment 207127 [details] [review]
Fix (Adds a check for language "text" and handles it specially.)
Comment 4 Paolo Borelli 2012-02-08 20:48:00 UTC
Fixed. Thanks!