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 693283 - [CODE] Hacking on new gedit plugin "SmarterSpaces"
[CODE] Hacking on new gedit plugin "SmarterSpaces"
Status: RESOLVED OBSOLETE
Product: gedit-plugins
Classification: Other
Component: General
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-06 22:08 UTC by James
Modified: 2020-11-24 10:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
.plugin file for gedit (5.21 KB, application/octet-stream)
2013-02-06 22:08 UTC, James
  Details
code for smarterspaces plugin (9.69 KB, text/plain)
2013-02-06 22:09 UTC, James
  Details
Updated version of the plugin which supports preferences. (1.10 KB, text/xml)
2013-02-13 03:43 UTC, James
  Details
Updated version of the plugin which supports preferences. (5.28 KB, application/octet-stream)
2013-02-13 03:44 UTC, James
  Details
.py code for smarterspaces (13.27 KB, text/x-python)
2013-02-13 03:45 UTC, James
  Details
.plugin for smarterspaces (5.28 KB, text/plain)
2013-02-13 03:45 UTC, James
  Details
.xml schema for smarterspaces (1.10 KB, text/xml)
2013-02-13 03:46 UTC, James
  Details
Patch to upstream gedit-plugins (17.86 KB, patch)
2013-03-02 04:28 UTC, James
needs-work Details | Review
Latest version with your suggestions fixed (21.88 KB, patch)
2013-07-11 08:40 UTC, James
none Details | Review

Description James 2013-02-06 22:08:45 UTC
Created attachment 235333 [details]
.plugin file for gedit

Hi there,

pbor and nacho told me to post this here. Original post is:
https://mail.gnome.org/archives/gedit-list/2013-February/msg00000.html (read for description of what it does)

In short, I've written either a new plugin, or a large patch. You can decide which you prefer. This is meant to extend what the "Smart Spaces" plugin does. I recommend you either:

1) Include this as a new plugin if you want the user to be able to also have the option of using smart spaces the old way.

2) Update smart spaces with this patch, because I think the new functionality is absolutely better, and if you're using smart spaces, you're happy to have this functionality too.

There are a few things I've commented with XXX which I'd like someone to review. Please also try this out, and let me know if you find any problems or corner cases.

When you're happy with the code, let me know, and I'll turn it into a git patch in the format you ask for.

Thanks!
James
(Long time GNOME user, trying to see if I like being a code contributor too. Let me know if I'm doing this wrong.)
Comment 1 James 2013-02-06 22:09:54 UTC
Created attachment 235334 [details]
code for smarterspaces plugin

Here's the meat. Please test this out, and I would also love to hear your advice on a few of the XXX in the code. However, despite those, everything seems to work perfectly.

See: https://mail.gnome.org/archives/gedit-list/2013-February/msg00000.html for more information.
Comment 2 James 2013-02-13 03:43:48 UTC
Created attachment 235864 [details]
Updated version of the plugin which supports preferences.
Comment 3 James 2013-02-13 03:44:19 UTC
Created attachment 235865 [details]
Updated version of the plugin which supports preferences.
Comment 4 James 2013-02-13 03:45:12 UTC
Created attachment 235866 [details]
.py code for smarterspaces

Updated version of the plugin which supports preferences.
Comment 5 James 2013-02-13 03:45:50 UTC
Created attachment 235867 [details]
.plugin for smarterspaces

Updated version of the plugin which supports preferences.
Comment 6 James 2013-02-13 03:46:35 UTC
Created attachment 235868 [details]
.xml schema for smarterspaces

Updated version of the plugin which supports preferences.
Comment 7 James 2013-02-13 03:52:33 UTC
Attached you'll now find an updated version of this plugin which includes some recommendations made in #gedit.

* Preferences to enable/disable which "smart" features you'd like to have "on". Using gsettings of course.
Many thanks to gregier for helping me find my way around plugin_info.

* Added keybindings for keypad arrow keys. You can choose to have these use a different "smart" setting if you want to be able to use arrows to navigate one space at a time. You can still use the mouse as well if you really want.

* A corresponding "smart delete" feature, to match the smart backspace, which is all that the original "smart spaces" plugin did.

* A bit of code cleanup.

So, I think this plugin should probably replace the "smartspaces" one at this point. I'd prefer a straight replace, but if you'd prefer to rename it to "smartspaces" that's okay too ;)

James
Comment 8 James 2013-03-02 04:28:13 UTC
Created attachment 237775 [details] [review]
Patch to upstream gedit-plugins

I hope that I formatted this properly. This is a patch of my smarterspaces branch against gedit-plugins master as of March 1st, 2013
Comment 9 James 2013-03-02 04:29:05 UTC
I decided I'd try and submit this as a git patch to the existing 'smart spaces' plugin since it now doesn't make sense to have two because I added a preferences dialog to choose which of the new "smarterspaces" functionality you want included. You can leave the new functionality unchecked to maintain "legacy" smart spaces behaviour.

I'm new to collaborative coding, so please let me know if I didn't format this patch properly. Hopefully this makes it easier to pull.

Cheers,
James
Comment 10 James 2013-07-11 07:27:47 UTC
Ping? I thought it was a good thing to submit patches?
Comment 11 Ignacio Casal Quinteiro (nacho) 2013-07-11 07:30:11 UTC
Hi James, sorry we didn't come in with it before, I'll try to have a look at your patch today.
Comment 12 Ignacio Casal Quinteiro (nacho) 2013-07-11 07:38:36 UTC
Review of attachment 237775 [details] [review]:

I see the patch is not yet finished. Please see the comments inline.

::: plugins/smartspaces/smartspaces.py
@@ +86,3 @@
+
+        if event.keyval in [Gdk.KEY_Left, Gdk.KEY_Right] and self.settings.get_boolean('smart-arrows'):
+            pass # TODO: Not implemented yet...

I'd say remove the parts of the code not implemented

::: plugins/smartspaces/org.gnome.gedit.plugins.smartspaces.gschema.xml
@@ +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schemalist>

use 2 spaces indentation and description and summary should be translatable, check other plugins to see how to do this.

::: plugins/smartspaces/smartspaces.plugin.desktop.in.in
@@ +4,3 @@
 IAge=3
 _Name=Smart Spaces
+_Description=Really forget you're not using tabulations.

Leave the description as it was :)

@@ +8,3 @@
+Authors=Steve Frécinaux <steve@istique.net>;Garrett Regier <garrettregier@gmail.com>;James Shubin <james@shubin.ca>
+Copyright=Copyright © 2006 Steve Frécinaux;Copyright © 2013 Garrett Regier;Copyright © 2013 James Shubin
+Website=https://ttboj.wordpress.com/smarter-spaces/

keep the previous website
Comment 13 James 2013-07-11 08:40:33 UTC
Created attachment 248907 [details] [review]
Latest version with your suggestions fixed

Should match what's in my git repo, and applies against your gedit-plugins master.
Comment 14 James 2013-07-11 08:41:22 UTC
(In reply to comment #11)
> Hi James, sorry we didn't come in with it before, I'll try to have a look at
> your patch today.

Thanks for taking a look...(In reply to comment #12)


> Review of attachment 237775 [details] [review]:
> 
> I see the patch is not yet finished. Please see the comments inline.
I think somehow you're looking at an old version. Newest version is here:
https://github.com/purpleidea/gedit-plugins/tree/smarterspaces in the smarterspaces branch.

I'll attach a new patch too.

> 
> ::: plugins/smartspaces/org.gnome.gedit.plugins.smartspaces.gschema.xml
> @@ +1,2 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +<schemalist>
> 
> use 2 spaces indentation and description and summary should be translatable,
> check other plugins to see how to do this.
Changed this and pushed to the above url too. Wasn't sure about the translation bit :(

> 
> ::: plugins/smartspaces/smartspaces.plugin.desktop.in.in
> @@ +4,3 @@
>  IAge=3
>  _Name=Smart Spaces
> +_Description=Really forget you're not using tabulations.
> 
> Leave the description as it was :)
Oh but I *really* forget ;) Changed back. Your loss.

> 
> @@ +8,3 @@
> +Authors=Steve Frécinaux <steve@istique.net>;Garrett Regier
> <garrettregier@gmail.com>;James Shubin <james@shubin.ca>
> +Copyright=Copyright © 2006 Steve Frécinaux;Copyright © 2013 Garrett
> Regier;Copyright © 2013 James Shubin
> +Website=https://ttboj.wordpress.com/smarter-spaces/
> 
> keep the previous website
Sure, also done in git.
Comment 15 James 2013-07-11 11:17:15 UTC
Update:

Latest patches and .ui additions as you requested are here:
https://github.com/purpleidea/gedit-plugins

The code itself works, but as discussed you would check the build code / macro stuff so that it builds the "right" way.

cheers
Comment 16 James 2013-07-11 11:34:28 UTC
New new set of fixes as per nacho.

Same place as above.
Comment 17 Sébastien Wilmet 2020-11-24 10:17:37 UTC
Mass-closing of all gedit-plugins bugzilla tickets.

Special "code" to find again all those gedit-plugins bugzilla tickets that were open before the mass-closing:

2bfe1b0590a78457e1f1a6a90fb975f5878cb60064ccfe1d7db76ca0da52f0f3

By searching the above sha256sum in bugzilla, the gedit contributors can find again the tickets. We may be interested to do so when we work on a specific area of the code, to at least know the known problems and possible enhancements.

We do this mass-closing because bugzilla.gnome.org is being replaced by gitlab.gnome.org.