GNOME Bugzilla – Bug 693283
[CODE] Hacking on new gedit plugin "SmarterSpaces"
Last modified: 2020-11-24 10:17:37 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.)
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.
Created attachment 235864 [details] Updated version of the plugin which supports preferences.
Created attachment 235865 [details] Updated version of the plugin which supports preferences.
Created attachment 235866 [details] .py code for smarterspaces Updated version of the plugin which supports preferences.
Created attachment 235867 [details] .plugin for smarterspaces Updated version of the plugin which supports preferences.
Created attachment 235868 [details] .xml schema for smarterspaces Updated version of the plugin which supports preferences.
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
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
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
Ping? I thought it was a good thing to submit patches?
Hi James, sorry we didn't come in with it before, I'll try to have a look at your patch today.
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
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.
(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.
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
New new set of fixes as per nacho. Same place as above.
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.