Hi,
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.
Cheers,
Jiri
On Thu, Sep 16, 2010 at 19:27, Thomas Martitz
<thomas.martitz(a)student.htw-berlin.de> wrote:
> On 16.09.2010 02:23, Lex Trotman wrote:
>>
>> Hi Jiri,
>>
>> I couldn't get this to work at all, it printed "calling indent this
>> line" all the time but didn't indent :-(
>>
>> I only had half an hour so I couldn't investigate much.
>>
>
> I have the same experience. Auto-indentation doesn't seem to work anymore
> (e.g. when hitting enter after on a line that ends with {, or when typing
> }).
I have just re-tested it again and it works on my machine (I have
forgotten one trace in the code - that's what you see in the console).
A quick question: have you read the commit log?
This patch makes it possible to specify several regex patterns for every
filetype which determine under what condition the indentation is performed.
The pattern variables are specified under the [settings] section of the
given filetype and their value is the regex to be used. The variables are
as follows:
* indent_this_line_regex - the match is performed after every keystroke
and if the regex matches, the indentation is performed on the current
line
* indent_next_line_regex - the match is performed only when enter is
pressed. The indentation is applied on the next line
* unindent_this_line_regex - like indent_this_line_regex but
unindents instead
* unindent_next_line_regex - like indent_next_line_regex but indents instead
Comments and strings are detected from the lexer so these can be ignored
inside the patterns. For instance these are very basic rules for GNU
indent style:
indent_next_line_regex=^.*\\{[[:blank:]]*$
unindent_this_line_regex=^[[:blank:]]*\\}$
indent_this_line_regex=^[[:blank:]]+\\{$
unindent_next_line_regex=^[[:blank:]]*\\}[[:blank:]]*$
By commenting-out the last two lines you get ANSI indentation style.
If you replace \\{ and \\} with begin and end, respectively, you
get analogous rules for pascal. Notice the double-escaping of { and } -
the first escape sequence is for the keyfile ini format (so for the
regex itself \\ becomes \).
This means that in order to make it work e.g. for C, you have to edit
~/.config/geany/filedefs/filetypes.c
(or the corresponding file under /usr/local/share/geany) and add
indent_next_line_regex=^.*\\{[[:blank:]]*$
unindent_this_line_regex=^[[:blank:]]*\\}$
indent_this_line_regex=^[[:blank:]]+\\{$
unindent_next_line_regex=^[[:blank:]]*\\}[[:blank:]]*$
under the [settings] section (+ restart geany). Please let me know if
it works (but also in the opposite case ;-).
Jiri
>
> Best regards.
> _______________________________________________
> Geany-devel mailing list
> Geany-devel(a)uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
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.
-tnx!-
Harold
Hi all.
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
trunk.
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]
block_cursor=<Alt>bracketleft
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…
Best regards,
Eugene.
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:
-------------------8<-------------------8<-------------------8<-------------------8<
Hello all,
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
sci_get_eol_mode(doc->editor->sci).
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.
Regards,
Manuel
-------------------8<-------------------8<-------------------8<-------------------8<
Hi,
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
geany's code.
Cheers,
Jiri
Hi, all,
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.
--
E-ragds: Jimmy
Hi,
> 2010-08-10 Nick Treleaven
>
> * src/stash.c:
> Fix writing the default value when a key is missing for hidden
> prefs, even if it was overridden when it was originally read.
In what case is this required? If a hidden pref is overriden by
reading, it exists in the keyfile, and so won't be written anyway.
--
E-gards: Jimmy
Hi,
The following bug on sf.net:
http://sourceforge.net/tracker/?func=detail&aid=2896027&group_id=153444&ati…
states:
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?
Cheers,
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/