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 721946 - Add new env var GEDIT_CURRENT_DOCUMENT_PATH
Add new env var GEDIT_CURRENT_DOCUMENT_PATH
Status: RESOLVED FIXED
Product: gedit-plugins
Classification: Other
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: Sindhu S
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2014-01-10 17:27 UTC by Sindhu S
Modified: 2019-03-23 20:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add GEDIT_CURRENT_DOCUMENT_LANGUAGE env var (1.05 KB, patch)
2014-01-10 17:27 UTC, Sindhu S
none Details | Review
Add GEDIT_CURRENT_DOCUMENT_LANGUAGE env var (1011 bytes, patch)
2014-01-10 18:18 UTC, Sindhu S
needs-work Details | Review
Add GEDIT_CURRENT_DOCUMENT_LANGUAGE env var (1010 bytes, patch)
2014-01-10 18:55 UTC, Sindhu S
accepted-commit_now Details | Review

Description Sindhu S 2014-01-10 17:27:19 UTC
Created attachment 265950 [details] [review]
Add GEDIT_CURRENT_DOCUMENT_LANGUAGE env var

I'd like to have this reviewed to know what I am doing wrong. Currently the env var contains None.
Comment 1 jessevdk@gmail.com 2014-01-10 17:50:10 UTC
Review of attachment 265950 [details] [review]:

It doesn't make sense to add it there. This needs to be added in run_external_tool, have a look at where GEDIT_CURRENT_LINE is set for example.
Comment 2 Sindhu S 2014-01-10 18:18:23 UTC
Created attachment 265962 [details] [review]
Add GEDIT_CURRENT_DOCUMENT_LANGUAGE env var

Added line to correct place. returns language of current document.
Comment 3 Ignacio Casal Quinteiro (nacho) 2014-01-10 18:48:40 UTC
Review of attachment 265962 [details] [review]:

See the comment.

::: plugins/externaltools/tools/functions.py
@@ +84,2 @@
         capture.set_env(GEDIT_CURRENT_LINE=piter.get_text(end))
+        capture.set_env(GEDIT_CURRRENT_DOCUMENT_LANGUAGE=document.get_language().get_id())

as said on irc, get_language() might return None, so you need to do get_id only if get_language if not none
Comment 4 Sindhu S 2014-01-10 18:55:39 UTC
Created attachment 265965 [details] [review]
Add GEDIT_CURRENT_DOCUMENT_LANGUAGE env var
Comment 5 Ignacio Casal Quinteiro (nacho) 2014-01-10 19:03:46 UTC
Review of attachment 265965 [details] [review]:

Looks good.
Comment 6 Sindhu S 2014-01-10 19:07:01 UTC
Pushed to master in 9165399

Available at https://git.gnome.org/browse/gedit/commit/?id=9165399b6d38b3cc7fefef7336d0af7874efd1eb

Marking bug as RESOLVED and FIXED.