From 067a9ec6a52254ec3eb430b7fb671469b0694892 Mon Sep 17 00:00:00 2001 From: Frank Lanitz Date: Fri, 5 Aug 2016 18:40:20 +0200 Subject: [PATCH 1/6] Rename plugin and fix build system --- Makefile.am | 8 ++++---- build/geanylipsum.m4 | 9 --------- build/lipsum.m4 | 9 +++++++++ geanylipsum/src/Makefile.am | 10 ---------- {geanylipsum => lipsum}/AUTHORS | 0 {geanylipsum => lipsum}/COPYING | 0 {geanylipsum => lipsum}/ChangeLog | 0 {geanylipsum => lipsum}/INSTALL | 0 {geanylipsum => lipsum}/Makefile.am | 2 +- {geanylipsum => lipsum}/NEWS | 0 {geanylipsum => lipsum}/README | 0 lipsum/src/Makefile.am | 10 ++++++++++ geanylipsum/src/geanylipsum.c => lipsum/src/lipsum.c | 0 po/POTFILES.in | 6 +++--- 14 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 build/geanylipsum.m4 create mode 100644 build/lipsum.m4 delete mode 100644 geanylipsum/src/Makefile.am rename {geanylipsum => lipsum}/AUTHORS (100%) rename {geanylipsum => lipsum}/COPYING (100%) rename {geanylipsum => lipsum}/ChangeLog (100%) rename {geanylipsum => lipsum}/INSTALL (100%) rename {geanylipsum => lipsum}/Makefile.am (74%) rename {geanylipsum => lipsum}/NEWS (100%) rename {geanylipsum => lipsum}/README (100%) create mode 100644 lipsum/src/Makefile.am rename geanylipsum/src/geanylipsum.c => lipsum/src/lipsum.c (100%) diff --git a/Makefile.am b/Makefile.am index 7b59b0706..1a1a99565 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,10 +59,6 @@ if ENABLE_GEANYLATEX SUBDIRS += geanylatex endif -if ENABLE_GEANYLIPSUM -SUBDIRS += geanylipsum -endif - if ENABLE_GEANYLUA SUBDIRS += geanylua endif @@ -108,6 +104,10 @@ if ENABLE_LINEOPERATIONS SUBDIRS += lineoperations endif +if ENABLE_LIPSUM +SUBDIRS += lipsum +endif + if ENABLE_MARKDOWN SUBDIRS += markdown endif diff --git a/build/geanylipsum.m4 b/build/geanylipsum.m4 deleted file mode 100644 index d48db2c4f..000000000 --- a/build/geanylipsum.m4 +++ /dev/null @@ -1,9 +0,0 @@ -AC_DEFUN([GP_CHECK_GEANYLIPSUM], -[ - GP_ARG_DISABLE([GeanyLipsum], [auto]) - GP_COMMIT_PLUGIN_STATUS([GeanyLipsum]) - AC_CONFIG_FILES([ - geanylipsum/Makefile - geanylipsum/src/Makefile - ]) -]) diff --git a/build/lipsum.m4 b/build/lipsum.m4 new file mode 100644 index 000000000..8aac46534 --- /dev/null +++ b/build/lipsum.m4 @@ -0,0 +1,9 @@ +AC_DEFUN([GP_CHECK_GEANYLIPSUM], +[ + GP_ARG_DISABLE([Lipsum], [auto]) + GP_COMMIT_PLUGIN_STATUS([Lipsum]) + AC_CONFIG_FILES([ + lipsum/Makefile + lipsum/src/Makefile + ]) +]) diff --git a/geanylipsum/src/Makefile.am b/geanylipsum/src/Makefile.am deleted file mode 100644 index 4e733a5ff..000000000 --- a/geanylipsum/src/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -include $(top_srcdir)/build/vars.build.mk -plugin = geanylipsum - -geanyplugins_LTLIBRARIES = geanylipsum.la - -geanylipsum_la_SOURCES = geanylipsum.c -geanylipsum_la_CPPFLAGS = $(AM_CPPFLAGS) -DG_LOG_DOMAIN=\"GeanyLipsum\" -geanylipsum_la_LIBADD = $(COMMONLIBS) - -include $(top_srcdir)/build/cppcheck.mk diff --git a/geanylipsum/AUTHORS b/lipsum/AUTHORS similarity index 100% rename from geanylipsum/AUTHORS rename to lipsum/AUTHORS diff --git a/geanylipsum/COPYING b/lipsum/COPYING similarity index 100% rename from geanylipsum/COPYING rename to lipsum/COPYING diff --git a/geanylipsum/ChangeLog b/lipsum/ChangeLog similarity index 100% rename from geanylipsum/ChangeLog rename to lipsum/ChangeLog diff --git a/geanylipsum/INSTALL b/lipsum/INSTALL similarity index 100% rename from geanylipsum/INSTALL rename to lipsum/INSTALL diff --git a/geanylipsum/Makefile.am b/lipsum/Makefile.am similarity index 74% rename from geanylipsum/Makefile.am rename to lipsum/Makefile.am index b04cccf1e..ddeecd9d0 100644 --- a/geanylipsum/Makefile.am +++ b/lipsum/Makefile.am @@ -1,4 +1,4 @@ include $(top_srcdir)/build/vars.auxfiles.mk SUBDIRS = src -plugin = geanylipsum +plugin = lipsum diff --git a/geanylipsum/NEWS b/lipsum/NEWS similarity index 100% rename from geanylipsum/NEWS rename to lipsum/NEWS diff --git a/geanylipsum/README b/lipsum/README similarity index 100% rename from geanylipsum/README rename to lipsum/README diff --git a/lipsum/src/Makefile.am b/lipsum/src/Makefile.am new file mode 100644 index 000000000..e3711cebb --- /dev/null +++ b/lipsum/src/Makefile.am @@ -0,0 +1,10 @@ +include $(top_srcdir)/build/vars.build.mk +plugin = lipsum + +geanyplugins_LTLIBRARIES = lipsum.la + +lipsum_la_SOURCES = lipsum.c +lipsum_la_CPPFLAGS = $(AM_CPPFLAGS) -DG_LOG_DOMAIN=\"Lipsum\" +lipsum_la_LIBADD = $(COMMONLIBS) + +include $(top_srcdir)/build/cppcheck.mk diff --git a/geanylipsum/src/geanylipsum.c b/lipsum/src/lipsum.c similarity index 100% rename from geanylipsum/src/geanylipsum.c rename to lipsum/src/lipsum.c diff --git a/po/POTFILES.in b/po/POTFILES.in index 715487af0..35ec494af 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -148,9 +148,6 @@ geanylatex/src/latexencodings.c geanylatex/src/latexstructure.c geanylatex/src/reftex.c -# geanylipsum -geanylipsum/src/geanylipsum.c - # geanyLua geanylua/glspi.h geanylua/glspi_ver.h @@ -221,6 +218,9 @@ git-changebar/src/gcb-plugin.c # LineOperations lineoperations/src/lineoperations.c +# lipsum +lipsum/src/lipsum.c + # Markdown markdown/src/conf.c markdown/src/plugin.c From fb48d40c276019af80871fb74d0738d0bafbbf23 Mon Sep 17 00:00:00 2001 From: Frank Lanitz Date: Fri, 5 Aug 2016 18:47:18 +0200 Subject: [PATCH 2/6] Update plugins's name in README and code --- lipsum/README | 13 +++++-------- lipsum/src/lipsum.c | 8 ++++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lipsum/README b/lipsum/README index 3aa4fa5c3..cecdefaeb 100644 --- a/lipsum/README +++ b/lipsum/README @@ -1,4 +1,4 @@ -GeanyLipsum +Lipsum ----------- .. contents:: @@ -6,7 +6,7 @@ GeanyLipsum About ------ -GeanyLipsum is a plugin for Geany that implements a Lorem Ipsum +Lipsum is a plugin for Geany that implements a Lorem Ipsum generator to insert placeholder text into your document. @@ -41,9 +41,9 @@ github.com. Get the code by: git clone https://github.com/geany/geany-plugins.git If you want to create a patch, please respect the license of -GeanyLipsum as well as intellectual property of third. Patches that +Lipsum as well as intellectual property of third. Patches that should be included to the default distribution must be licensed under -the same conditions as GeanyLipsum by the copyright owner (GPL2+). +the same conditions as Lipsum by the copyright owner (GPL2+). Known issues @@ -58,7 +58,7 @@ https://github.com/geany/geany-plugins/issues License ------- -GeanyLipsum and all its parts is distributed under the terms of the +Lipsum and all its parts is distributed under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. A copy of this license can be found in the file COPYING @@ -75,6 +75,3 @@ Frank Lanitz (frank(at)geany(dot)org). Please also do so, if you got any questions and visiting http://plugins.geany.org didn't help you to figure out the answer. Visiting the website is also a good start if you want to check for any update on this plugin. - -A more historical page can be found at -http://frank.uvena.de/en/Geany/geanylipsum diff --git a/lipsum/src/lipsum.c b/lipsum/src/lipsum.c index 0f484b3ee..863076105 100644 --- a/lipsum/src/lipsum.c +++ b/lipsum/src/lipsum.c @@ -1,7 +1,7 @@ /* - * geanylipsum.c + * lipsum.c * - * Copyright 2008-2015 Frank Lanitz + * Copyright 2008-2016 Frank Lanitz * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,9 +36,9 @@ PLUGIN_VERSION_CHECK(224) PLUGIN_SET_TRANSLATABLE_INFO( LOCALEDIR, GETTEXT_PACKAGE, - _("GeanyLipsum"), + _("Lipsum"), _("Creating dummy text with Geany"), - "0.4.4", + VERSION, "Frank Lanitz ") static GtkWidget *main_menu_item = NULL; From 8068fa2503d6812b08cd42a525e96b70b16548ea Mon Sep 17 00:00:00 2001 From: Frank Lanitz Date: Fri, 5 Aug 2016 18:47:43 +0200 Subject: [PATCH 3/6] Make ChangeLog as not used anymore --- lipsum/ChangeLog | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lipsum/ChangeLog b/lipsum/ChangeLog index 84ddfa087..2ed5a347a 100644 --- a/lipsum/ChangeLog +++ b/lipsum/ChangeLog @@ -1,3 +1,6 @@ +####################### +# Not in usage anymore +####################### 2010-09-23 Frank Lanitz * Replace deprecated PLUGIN_KEY_GROUP macro. @@ -10,7 +13,7 @@ 2009-04-11 Frank Lanitz - * Add not complete part of Lorem Ipsum text if there is any at end of + * Add not complete part of Lorem Ipsum text if there is any at end of insertion. From c4cabd9c622d6eaf464ae58cd71b934174f32e89 Mon Sep 17 00:00:00 2001 From: Frank Lanitz Date: Fri, 5 Aug 2016 19:06:46 +0200 Subject: [PATCH 4/6] Add migration of configuration files --- lipsum/src/lipsum.c | 60 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/lipsum/src/lipsum.c b/lipsum/src/lipsum.c index 863076105..72aa5bdfa 100644 --- a/lipsum/src/lipsum.c +++ b/lipsum/src/lipsum.c @@ -28,6 +28,10 @@ #endif #include +#include +#include +#include + GeanyPlugin *geany_plugin; GeanyData *geany_data; @@ -144,12 +148,68 @@ plugin_init(G_GNUC_UNUSED GeanyData *data) GtkWidget *menu_lipsum = NULL; GKeyFile *config = g_key_file_new(); gchar *config_file = NULL; + gchar *config_file_old = NULL; + gchar *config_dir = NULL; + gchar *config_dir_old = NULL; GeanyKeyGroup *key_group; + config_file = g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S, "plugins", G_DIR_SEPARATOR_S, "geanylipsum", G_DIR_SEPARATOR_S, "lipsum.conf", NULL); + #ifndef G_OS_WIN32 + /* We try only to move if we are on not Windows platform */ + config_dir_old = g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S, + "plugins", G_DIR_SEPARATOR_S, "geanylipsum", NULL); + config_file_old = g_strconcat(config_dir_old, G_DIR_SEPARATOR_S, + "lipsum.conf", NULL); + config_dir = g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S, + "plugins", G_DIR_SEPARATOR_S, "lipsum", NULL); + if (g_file_test(config_file_old, G_FILE_TEST_EXISTS)) + { + if (dialogs_show_question( + _("Renamed plugin detected!\n" + "\n" + "GeanyLipsum has been renamed to Lipsum -- you surely have " + "already recognised it. \n" + "Geany is able to migrate your old plugin configuration by " + "moving the old configuration file to new location.\n" + "Move now?"))) + { + if (g_rename(config_dir_old, config_dir) == 0) + { + dialogs_show_msgbox(GTK_MESSAGE_INFO, + _("Your configuration directory has been " + "successfully moved from \"%s\" to \"%s\"."), + config_dir_old, config_dir); + } + else + { + /* If there was an error on migrating we need + * to load from original one. + * When saving new configuration it will go to + * new folder so migration should + * be implicit. */ + g_free(config_file); + config_file = g_strdup(config_file_old); + dialogs_show_msgbox( + GTK_MESSAGE_WARNING, + _("Your old configuration directory \"%s\" could " + "not be moved to \"%s\" (%s). " + "Please move manually the directory to the new location."), + config_dir_old, + config_dir, + g_strerror(errno)); + } + } + } + + g_free(config_dir_old); + g_free(config_dir); + g_free(config_file_old); + #endif + /* Initialising options from config file if there is any*/ g_key_file_load_from_file(config, config_file, G_KEY_FILE_NONE, NULL); lipsum = utils_get_setting_string(config, "snippets", "lipsumtext", default_loremipsum); From 1a645eb9516736781b99e094592dc21717eb7f85 Mon Sep 17 00:00:00 2001 From: Frank Lanitz Date: Fri, 5 Aug 2016 19:09:41 +0200 Subject: [PATCH 5/6] Change keybinding domain --- lipsum/src/lipsum.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lipsum/src/lipsum.c b/lipsum/src/lipsum.c index 72aa5bdfa..033f6d882 100644 --- a/lipsum/src/lipsum.c +++ b/lipsum/src/lipsum.c @@ -175,6 +175,7 @@ plugin_init(G_GNUC_UNUSED GeanyData *data) "already recognised it. \n" "Geany is able to migrate your old plugin configuration by " "moving the old configuration file to new location.\n" + "Attention: this will not include your keybindings.\n" "Move now?"))) { if (g_rename(config_dir_old, config_dir) == 0) @@ -231,7 +232,7 @@ plugin_init(G_GNUC_UNUSED GeanyData *data) main_menu_item = menu_lipsum; /* init keybindings */ - key_group = plugin_set_key_group(geany_plugin, "geanylipsum", COUNT_KB, NULL); + key_group = plugin_set_key_group(geany_plugin, "lipsum", COUNT_KB, NULL); keybindings_set_item(key_group, LIPSUM_KB_INSERT, kblipsum_insert, 0, 0, "insert_lipsum", _("Insert Lipsum text"), menu_lipsum); } From 9abd912b7f9c40cebb8b5a6a00d0be27645e1936 Mon Sep 17 00:00:00 2001 From: Frank Lanitz Date: Wed, 10 Aug 2016 20:27:09 +0200 Subject: [PATCH 6/6] A few improvements as suggested by review of PR --- MAINTAINERS | 11 ++++++----- NEWS | 3 ++- README | 2 +- build/lipsum.m4 | 2 +- configure.ac | 2 +- lipsum/README | 2 +- lipsum/src/lipsum.c | 18 +++++++++--------- 7 files changed, 21 insertions(+), 19 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 4ca7f3049..f03100b00 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -95,11 +95,6 @@ M: Frank Lanitz W: http://frank.uvena.de/en/Geany/geanylatex/ S: Maintained -geanylipsum -P: Frank Lanitz -M: Frank Lanitz -W: http://plugins.geany.org/geanylipsum.html -S: Maintained geanylua P: @@ -173,6 +168,12 @@ M: Sylvan Mostert W: S: Maintained +lipsum +P: Frank Lanitz +M: Frank Lanitz +W: http://plugins.geany.org/lipsum.html +S: Maintained + markdown P: Matthew Brush M: Matthew Brush diff --git a/NEWS b/NEWS index 01d84b5c2..5fdc9b7e0 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ Geany Plugins 1.29 (not yet released) - No changes by now. + General: + * Rename plugin GeanyLipsum to Lipsum (PR#472) Geany Plugins 1.28 (2016-07-10) diff --git a/README b/README index 88f9b45d7..01434b0c0 100644 --- a/README +++ b/README @@ -60,7 +60,6 @@ Available plugins are: * ``geanygendoc`` -- the GeanyGenDoc plugin * ``geanyinsertnum`` -- the GeanyInsertNum plugin * ``geanylatex`` -- the GeanyLaTeX plugin -* ``geanylipsum`` -- the GeanyLipsum plugin * ``geanylua`` -- the GeanyLua plugin * ``geanymacro`` -- the GeanyMacro plugin * ``geanyminiscript`` -- the GeanyMiniScript plugin @@ -73,6 +72,7 @@ Available plugins are: * ``gitchangebar`` -- the GitChangeBar plugin * ``gtkspell`` -- GeanyVC's spell-check support * ``lineoperations`` -- simple line functions that can be applied to an open file +* ``lipsum`` -- the Lipsum plugin * ``markdown`` -- the Markdown plugin * ``multiterm`` -- the multiterm plugin * ``overview``-- the overview plugin diff --git a/build/lipsum.m4 b/build/lipsum.m4 index 8aac46534..8c711f0cf 100644 --- a/build/lipsum.m4 +++ b/build/lipsum.m4 @@ -1,4 +1,4 @@ -AC_DEFUN([GP_CHECK_GEANYLIPSUM], +AC_DEFUN([GP_CHECK_LIPSUM], [ GP_ARG_DISABLE([Lipsum], [auto]) GP_COMMIT_PLUGIN_STATUS([Lipsum]) diff --git a/configure.ac b/configure.ac index 83e458050..ed1b782db 100644 --- a/configure.ac +++ b/configure.ac @@ -43,7 +43,6 @@ GP_CHECK_GEANYEXTRASEL GP_CHECK_GEANYGENDOC GP_CHECK_GEANYINSERTNUM GP_CHECK_GEANYLATEX -GP_CHECK_GEANYLIPSUM GP_CHECK_GEANYLUA GP_CHECK_GEANYMACRO GP_CHECK_GEANYMINISCRIPT @@ -55,6 +54,7 @@ GP_CHECK_GEANYPG GP_CHECK_GENIUSPASTE GP_CHECK_GITCHANGEBAR GP_CHECK_LINEOPERATIONS +GP_CHECK_LIPSUM GP_CHECK_MARKDOWN GP_CHECK_MULTITERM GP_CHECK_OVERVIEW diff --git a/lipsum/README b/lipsum/README index cecdefaeb..c47b8d1f7 100644 --- a/lipsum/README +++ b/lipsum/README @@ -1,5 +1,5 @@ Lipsum ------------ +------ .. contents:: diff --git a/lipsum/src/lipsum.c b/lipsum/src/lipsum.c index 033f6d882..bd4d063ec 100644 --- a/lipsum/src/lipsum.c +++ b/lipsum/src/lipsum.c @@ -160,22 +160,22 @@ plugin_init(G_GNUC_UNUSED GeanyData *data) #ifndef G_OS_WIN32 /* We try only to move if we are on not Windows platform */ - config_dir_old = g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S, - "plugins", G_DIR_SEPARATOR_S, "geanylipsum", NULL); - config_file_old = g_strconcat(config_dir_old, G_DIR_SEPARATOR_S, + config_dir_old = g_build_filename(geany->app->configdir, + "plugins", "geanylipsum", NULL); + config_file_old = g_build_filename(config_dir_old, "lipsum.conf", NULL); - config_dir = g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S, - "plugins", G_DIR_SEPARATOR_S, "lipsum", NULL); + config_dir = g_build_filename(geany->app->configdir, + "plugins", "lipsum", NULL); if (g_file_test(config_file_old, G_FILE_TEST_EXISTS)) { if (dialogs_show_question( _("Renamed plugin detected!\n" "\n" - "GeanyLipsum has been renamed to Lipsum -- you surely have " - "already recognised it. \n" + "As you may have already noticed, GeanyLipsum has been " + "renamed to just Lipsum. \n" "Geany is able to migrate your old plugin configuration by " "moving the old configuration file to new location.\n" - "Attention: this will not include your keybindings.\n" + "Warning: This will not include your keybindings.\n" "Move now?"))) { if (g_rename(config_dir_old, config_dir) == 0) @@ -198,7 +198,7 @@ plugin_init(G_GNUC_UNUSED GeanyData *data) GTK_MESSAGE_WARNING, _("Your old configuration directory \"%s\" could " "not be moved to \"%s\" (%s). " - "Please move manually the directory to the new location."), + "Please manually move the directory to the new location."), config_dir_old, config_dir, g_strerror(errno));