GNOME Bugzilla – Bug 732813
add plugin which will add RPM ChangeLog entries
Last modified: 2019-03-23 20:32:48 UTC
subj. For vim we have spec.pluign which when pressing \+c adding changelog entry for current version in specfile. I think should be great idea to have this one in gedit plugins. So, I've started work on it in wip/rpm-plugin branch. https://git.gnome.org/browse/gedit-plugins/log/?h=wip/rpm-plugin I think I will finish work in near few weeks (have a hardly limited free time) ;(
What about creating a snippet instad?
(In reply to comment #1) > What about creating a snippet instad? https://bugzilla.gnome.org/show_bug.cgi?id=703964 or snippents working in other way?
I am not sure what you mean, the bug you mention is about external tools, and what is described in that bug can be achieved in many ways, for instance you can simply use awk (untested) awk ' BEGIN { a="" b="" }/a:/ { a=$2 } /b:/ { b=$2 } END { print $a %b }' That said, I was suggesting using a snippet not an external tool, so that when you type "log" and press tab, the changelog entry gets inserted
Well. I've tried. But I can't parse file without saving it (it's unsaved in most cases)
Created attachment 280043 [details] rpmspec.xml My current snippet
1. I can't work with non-saved documents 2. I can't add text to specific line (?)
Another option would be to write a gedit commander module, which is more or less like writing a mini-plugin. But there isn't much documentation unfortunately (you can look at existing modules). If you need to parse the document, snippets won't work, but an external tool should.
Created attachment 280064 [details] External tool which provides this functionality
(In reply to comment #7) > Another option would be to write a gedit commander module, which is more or > less like writing a mini-plugin. But there isn't much documentation > unfortunately (you can look at existing modules). If you need to parse the > document, snippets won't work, but an external tool should. I've implemented with external tool. It works. I will look for commander module, because: 1. it should reduce my code 2. I think I can provide real-time adding changelog (while user editing spec) - updating changelog entry Interesting, how I can store username and email. For stand-alone plugin - I've tried store in gsettings and it worked. How I can do with exttols or commander module?
Some issues with exttools: 1. I wan't to place cursor in specific place 2. exttools adding blank line after fully replacing doc.. So I think I should use more low-level API for getting what I need
I have a snippet at https://gitlab.com/snippets/7108 (requires rpm-python package installed). What about closing this bug?
How about a patch to add this snippet?
Created attachment 309393 [details] [review] Add a snippet generating RPM SPEC %changelog line.
Review of attachment 309393 [details] [review]: I am missing here some makefile rules. Like adding the file to extra_dist
Created attachment 309394 [details] [review] Add a snippet generating RPM SPEC %changelog line. Change the tag to just simple 'ch'. Also, add id attribute to the snippet element.
Created attachment 309395 [details] [review] Add a snippet generating RPM SPEC %changelog line. Also, add the line to dist_plugins_snippets_snippets_DATA of the snippets plugin Makefile.am.
Tested including Makefile.am changes and it works. Merging.
Attachment 309395 [details] pushed as d4ce9dd - Add a snippet generating RPM SPEC %changelog line.