I'm sending my stack of patches against geany again, this time as individual patches. Here's the full list:
[PATCH 01/19] Prevent -Wmissing-prototypes report warning when compiling a plugin
[PATCH 02/19] Add signals for project options dialog opening and closing
[PATCH 03/19] Make the project menu accessible by plugins
[PATCH 04/19] Make it possible to change project patterns by plugins
[PATCH 05/19] Don't be annoying when not necessary
[PATCH 06/19] Make it possible for plugins to change the base directory of msgwindow
[PATCH 07/19] Open the file in the msgwindow even if no linenumber is specified
[PATCH 08/19] When closing tab, return to the document at the top of the MRU list
[PATCH 09/19] Use wider entry for project file path
[PATCH 10/19] New utils function to get relative path from one directory to another
[PATCH 11/19] File name in the project settings dialog shouldn't look it is editable
[PATCH 12/19] Use relative paths in the project files
[PATCH 13/19] Remove the "set" button from the project properties dialog
[PATCH 14/19] Rewrite tab switching queue
[PATCH 15/19] Do not insert --include= when the search pattern entry is empty
[PATCH 16/19] Use project patterns in the FIF dialog
[PATCH 17/19] Make the tab switching dialog a bit more useful
[PATCH 18/19] Use standard include paths for "open selected file"
[PATCH 19/19] Use per document indent sizes
Only some of them are required by gproject - others are just suggestions for improvements. I didn't explicitly distinguish between these two types of patches but it should be pretty clear from the description. There have been some minor changes since my last post - mainly the change of the FIF dialog to contain combo box for pattern selection and there are also some new patches - the detailed description is in the individual emails. Of course many of the patches are suggestions only so further discussion is welcome.
Dear Geany devs,
Some time ago I received the attached patch though this list (from
Enrico?). I really love the added functionality to prevent duplicate
automatically added quotes and brackets.
Can this be added to Geany itself? Ideally this would be activated
with a checkbox in prefs > editor > completions.
I attach three patches:
1. Keybindings to insert new line after/before current
2. Snippet keybindings support
3. Automatically insert additional indentation in XML/HTML files if
previous line ends with an opening tag
They must be unrelated and can be applied independently of each other.
Some of the patches have drawbacks. Before "polishing" them, I want to
know whether they are useful and may go to trunk.
The drawback of the first patch is that I doubt it's so useful. I know
Vi[m] provides shortcuts for these actions ('o' and 'O' in normal
mode), but their necessity is questionable for me. I implemented this
to ease XML editing with tag autocompletion turned on. Suppose you
need to write to consequent <li>'s. Without this patch you need to
press End+Enter after writing the first <li> to place the cursor where
you need to start the second. With my patch, you only need to press
one shortcut you can assign in Preferences > Keybindings :)
The drawback of the third patch is that it's not completed. If user
likes to leave HTML tags like <br> "unclosed", she would be disturbed by
automatic indentation caused by my patch, so a check box in Preferences
is desirable. I'll code it as soon as we decide this patch can go to
Speaking about the second patch, here is an example of assigning a
keybinding (I currently use it in my user snippets.conf):
# special group to define keybindings
# keybindings' format resembles the one used in Preferences >
# Keybindings tab
Keybindings may be assigned either in user or global snippets.conf (I'm
not sure if the latter is useful). Another decision I made is to allow
keybindings for snippets in [Special] section (like "block_cursor" used
above). While "block_cursor" snippet is not very useful when you have
to type its name, it is useful when you just have to press a shortcut.
And, as usual for me, all of these patches lack user documentation…
I've found one more issue with Geany's "Safe file saving" option. When using g_file_set_contents(), file ownership and permissions are replaced with those for a new file. That fully conforms to GLib documentation (http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#g-fil…), but is not good sometimes (e.g. editing an executable script file).
I propose to use GIO API (GFile) instead of g_file_set_contents; the patch is attached. This solution, however, raises some questions:
- It does work for my system (Ubuntu 9.10), but will it work for others, especially Windows? It seems that GIO is also available on Win32, but it requires some testing
- This cannot be named "Safe" file saving, as it does not create a backup first (we can call g_file_replace_contents with make_backup = TRUE, but it would not delete this backup file when the operation completes). Maybe there should be some other configuration option to use (or not to use) this setting? Or should I replace "unsafe" file saving with GIO functions instead of replacing "safe"?
Or even more - make this option work like in GEdit (which, I suppose, uses g_file_replace_contents for both cases, with make_backup=TRUE in "safe" case), adding the corresponding checkbox to preferences dialog?
What do you think?
Sorry for reposting this message but i just realized i didn't include
the "[PATCH]" prefix in the subject of my previous mail to this list, so
the original text follows:
i already searched for this feature, in case someone else was
already working on it or if it simply was a bad idea to implement.
For now, i haven't found anything nor something against it so i
implemented this simple feature, that basically ensure no mixed line
endings control characters (le-cc) will be saved in the document, patch
is attached (i used the latest SVN head, 5089).
Let me explain the use case: i'm currently working on a project where
some of the files contains mixed line endings control characters, ie.,
some lines end with just CR, other with just LF: there is an easy way to
convert everyone of these control charaters to something else via
"Document->Set line endings->Convert and set ..." but this isn't
something i always manage to remember to do and, better, i would like
the editor to take care of that for me.
So this patch add just that: in the "Preferences->Files->Saving files"
dialog i added a checkbox and, if checked, the editor will always
convert any le-cc to the one currently actively on the document via
I also would like to propose a change in the way le-cc are presented to
the user, but i'll do a new post eventually.
I started implementing the idea of indenting based on regular
expressions and have noticed that geany can be compiled without regex
support. Obviously in this case the indent thing wouldn't work. I
don't quite understand when someone would want to compile geany
without regex. By default in configure.ac you use the system regex
library. If it doesn't exist, geany is compiled without regex support.
Why not to automatically fallback to using the regex library shipped
with geany when system regtex library is missing so there is always
some regex support? This would also remove many ugly ifdefs from the
This is an alternate implementation of Eugene's X11 session support.
The main difference is that the state each running Geany is saved
into a separate temporary Geany configuration file.
Each Geany is restored exactly it was before the session was closed,
including open files, options (including applied but unsaved),
per-document options (even if no project file is open) etc.
There are no races when saving geany.conf, it's not saved at all. If
you want to save the options, so that the next Geany will use them,
just go to the Geany you want the options from and save them,
exactly as you would do before the session was closed.
Should there be "main" and "option-saving" instances, which ones,
and how should they differ from the "secondary" instances? As Eugene
pointed out, this is not related to the session management, at least
with this SM implementation.
The patch applies against the latest svn-4933. Of course, it should
not be included in 0.19, I only finished it today. Some parts of
Eugene's SM were reverted, since they were not required.
The following bug on sf.net:
If I work, I have often open more projects on more workspaces. And
I have more runned Geany, too. But if I want open some file, it is
open in window of Geany which was open first. I would like to open
file in Geany which is at the same workspaces.
I would also like this functionality, but the bug has been closed,
without an explanation.
I've had a look at the geany sources, and I think I know how to add
this functionality. Would a clean patch for this be accepted?
Erik de Castro Lopo
I sent in a patch on April 23rd, but have not received any accept /
reject notice, possibly because I didn't tag it with [patch], so here
it is again. Resolves feature request #2990915 as illustrated here:
When comment_use_indent is set to true in per-filetype config,
comments are no longer indented on a line-by-line basis, but have the
indentation of the least indented line in the block. This looks a lot
In addition, empty lines are commented out by default. In the original
patch, I introduced a new option for it, but Thomas Martitz suggested
that this is not preferable.
I am just curious what the current thought is on compiling with GIO when
The only reason I ask is that it (seems to) solve the GVfs bug issues at
least after I applied Алексей's patch and for me that is really a huge
benefit, but yet I understand the added complexity and maintainability
I was following the other "Safe file saving - permissions issue" thread
but it I couldn't tell if a decision had been reached, and it covered a
few other topics.
p.s. I know all the arguments against FTP, but sometimes my hands are
tied (clients are reluctant to change), despite protest. =)