Hello,
do I need to add something for the patch to be included in the geany repository?
I've seen you talked about some "filedefs/filetypes.*" configuration, does it mean it would replace such definitions in the future?
Just a normal build: but a strange configure error did occur.
$$$
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
configure: error: No C++ compiler not found. Please install a C++ compiler.
$$$
I found it's just a ``which`` in configure.in.
QQQ
# check for C++ compiler explicitly and fail if none is found, do this check
# after AC_PROG_CXX has set the CXX environment variable
which $CXX >/dev/null 2>&1
if test "x$?" != "x0"; then
AC_MSG_ERROR([No C++ compiler not found. Please install a C++
compiler.])
fi
QQQ
I didn't know that the ``which`` utility was considered a compiler. :p
How about just using a shell builtin, ``hash``, ``type -P`` or just ``eval
$CXX --version`` as a test instead?
------------------------------------------------------------------
configure.in:18 : which $CXX >/dev/null 2>&1
configure.in:51 : GIT=`which git 2>/dev/null`
configure.in:60 : SVN=`which svn 2>/dev/null`
Found 3 matches for "which".
--
-Erik S
Hi all.
The attached patches implement X session management protocol (XSMP)
support via libSM library.
Why XSMP?
When a user logs out with some instances of Geany running, XSMP
support will allow those instances to safely save their
configuration and gracefully ask the user about unsaved documents. The
logout process will halt until Geany instances report that they are
ready for shutdown.
When the user logs in, all Geany instances will be restored, with
the same documents open. XSMP allows us to set a restart command for
each Geany instance, so I just remember open documents by passing
their file paths via command-line arguments.
Why libSM?
This library is as lightweight as possible. AFAIK, it is written by
the authors of Xorg. It is also very popular, used in claws-mail and
required by GNOME.
Patches:
[1.autotools.patch]
Building with X session management support if libSM library is
present. Is the library is not installed or ./configure was run
with `--enable-libsm=no', XSMP support is disabled.
I tested three cases:
* libSM installed;
* libSM installed, --enable-libsm=no;
* libSM is not installed.
[2.waf.patch]
The same thing, but using waf instead of autotools. It is
possible to disable XSMP support by passing `--disable-libsm'
to `./waf congigure'.
Again, I tested three cases:
* libSM installed;
* libSM installed, --disable-libsm supplied;
* libSM is not installed.
[3.refactor.patch]
This is probably the most doubtful part. In order to support XSMP
properly, I need:
1) a non-destructive function to completely save Geany's state;
2) a function to quit Geany without saving anything and
interacting with user.
I found `main_quit' function to satisfy the (2) requirements. But
there was no function to satisfy (1), so I created a new one called
`main_save' from `quit_app' function located in [callbacks.c].
I also had to
* add `force' argument to `document_close_all' function
to be used when you do not want the function to ask about
unsaved documents;
* create a trivial `project_save' function; add `save_config'
argument to `project_close' function so that I can set it to
FALSE when I already called `project_save'.
I wanted to reuse existing static `check_no_unsaved' function
located in [callbacks.c], so I created new `document_any_unsaved'
function from it.
I renamed `main_quit' function to `main_finalize' in order to point
out that it does not interact with user and does not save anything
(yes, it's doubtful and I'll change it back if you wish).
As far as I understand, none of the changed functions are exported
for plugins, so the changes do not break API or ABI compatibility.
[4.implementation.patch]
The implementation. I did not to extract it to separate source
code files so far, but I'll definitely do it if you wish.
XSMP requires a Geany instance to have the same XSMP client-ID
when it is restarted by the session manager. I created new
`--libsm-client-id' command-line option in order to specify it
in restart command.
Actually, I looked into claws-mail source code and did not find any
code to maintain client-ID there. Maybe maintaining client-ID is
not very important, so I can remove `--libsm-client-id' option if
anyone votes against it.
Problems:
1. Geany session management
I have to use `--no-session' command-line option in restart
command. Please see code comments inside [4.implementation.patch],
the "FIXME" section. There I described, why I have to use the
option and why it is bad.
There is an easy fix: Geany instance should not save Geany session
if the instance is run with `--new-instance' option. I consider
this behaviour acceptable.
If all geany-devel subscribers agree, we should ask geany-users. If
they agree too, anyone can write the necessary code, and I will
change the handling of `--no-session' in my [4.implementation.patch].
Untested functionality:
1. Building on Windows
I had no opportunity to test building on Windows. Autotools and waf
should simply fail to find libsm, thus XSMP support should be
disabled.
TODO:
1. Handle all command-line options
Most of command-line options, specified when running Geany, should
go to restart command. Things get little complicated as some
options need special handling (for example, I think that `--line'
and `--column' options should not go to restart command).
There is a little problem with this task: if I write all
command-line handling code in my `sm_set_command_props' function,
there will be code duplication between `sm_set_command_props'
implementation and the array of GOptionEntry. Every time when a new
command-line option is added, `sm_set_command_props' will have to
be changed, particularly:
* the name of the variable, where the option's value is stored,
will have to be duplicated there;
* the handling of the option will depend on option's type (int,
string, etc.), which is directly corresponds to the type
specified in the `entries' array.
I think, the best solution of this code duplication problem is some
kind of a "reverse" parser of GOptionEntry's. It does not make
sense to write one when you have 10 options or so, most of which
have string values. But if such a "reverse" parser existed, I would
consider using it. Information about whether a particular option
should/shouldn't go to restart command could be placed in a
separate array near `entries'.
Maybe write a plugin?
Yes, it is possible to write a plugin instead of building XSMP
support straight into Geany. The plugin would require:
* some data when initializing (argv[0] and the value of
`--libsm-client-id' command-line option);
* access to `cl_options' struct to set restart command properly;
* access to `main_save' and `main_finalize' functions
in order to control Geany.
A bad thing about this is that we'll still have to hardcode
`--libsm-client-id' command-line option in Geany's source code,
even with XSMP support residing in a plugin.
Summary of questions
* Are there anyone who thinks that `--new-instance's should save
Geany session?
* Are there any "reverse" parser of GOptionEntries?
* Should I write a plugin? If not, should I extract the code into
separate source code files?
Hope you find it useful. Any thoughts?
Best regards,
Eugene.
Sorry, [4.implementation.patch] I attached in the previous message was
little buggy. Here is a new one.
Also, I forgot to mention that these patches are for r4443.
Best regards,
Eugene.
Hi,
I've been looking at Geany for editing VHDL / Verilog files. Overall it
works well with the exception of picking up symbols in the code. VHDL
variables are recognizing (is this a because variable var_name is used
for another language?) but signals are not.
How does Geany recognize symbols, I can't find any config files (I may
of missed them) so presumably it is done in the code. How hard would it
be to add symbol recognition for VHDL / Verilog. If it is reasonably
straight forward I don't mind try to do this.
Regards,
Kelvin Gardiner
The attached patch contains a small enhancement to the filebrowser
plugin. It adds the icon to clear the filter to the filter_entry itself
instead to the toolbar if the GTK version is 2.15.2 or greater.
Hope you enjoy it.
Regards,
Dominic
--
Dominic Hopf <dmaphy(a)gmail.com>
http://dominichopf.de/
Key Fingerprint:
A7DF C4FC 07AE 4DDC 5CA0 BD93 AAB0 6019 CA7D 868D
Hi geany devs!
I'm writing a plugin for an external language (Guile Scheme). Working on
the 0.18 version of geany.
I need to modify the run_cmd options at runtime from inside the plugin.
For example in my: geany/data/filetypes.scheme I do have
run_cmd=guile -s "%f"
I suppose to need a signal, sort of "on_cmd_run", so that I can modify
the interpreter argument list
on the basis of the source code it will run.
For example, sometimes I need to call:
guile -L MY_LOCAL_PATH1[; MY_LOCAL_PATH2; ...] -s "%f",
depending of the environment and the context of the source.
There also more option, depending by the kind of source code the user
has written.
Is this possible at the moment?
thanks and happy hacking!
Roberto
--
--------------------------------------
Roberto Rosetti
OpenPGP Public key: 30575161
Hi,
at first: congratulations for this great piece of software! It's fun to
work with it, everything is well documented and goes straight forward.
Just one little bit was missing for me and adding it was easy ;)
Attached you find a tiny patch which adds a new command line option:
--socket-file. This way you can have different geany instances running
(e.g. one on each workspace) and are able to push new files to a
specific instance.
This applies as well to this feature request:
http://sourceforge.net/tracker/?func=detail&aid=2896027&group_id=153444&ati…
e.g. by using this cmd line to open files:
geany --socket-file=/tmp/geany-sock-$( xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}' )
Regards,
Jörn
--
Think before you code. And while you're coding it won't hurt either. ;)
Index: main.c
===================================================================
--- main.c (Revision 4424)
+++ main.c (Arbeitskopie)
@@ -126,6 +126,7 @@
{ "no-preprocessing", 'P', 0, G_OPTION_ARG_NONE, &no_preprocessing, N_("Don't preprocess C/C++ files when generating tags"), NULL },
#ifdef HAVE_SOCKET
{ "new-instance", 'i', 0, G_OPTION_ARG_NONE, &cl_options.new_instance, N_("Don't open files in a running instance, force opening a new instance"), NULL },
+ { "socket-file", 0, 0, G_OPTION_ARG_FILENAME, &cl_options.socket_filename, N_("Use this socket filename for communication with a geany instance"), NULL },
#endif
{ "line", 'l', 0, G_OPTION_ARG_INT, &cl_options.goto_line, N_("Set initial line number for the first opened file"), NULL },
{ "no-msgwin", 'm', 0, G_OPTION_ARG_NONE, &no_msgwin, N_("Don't show message window at startup"), NULL },
@@ -451,7 +452,7 @@
GError *error = NULL;
GOptionContext *context;
gint i;
- CommandLineOptions def_clo = {FALSE, TRUE, -1, -1, FALSE};
+ CommandLineOptions def_clo = {FALSE, NULL, TRUE, -1, -1, FALSE};
/* first initialise cl_options fields with default values */
cl_options = def_clo;
@@ -535,6 +536,10 @@
#ifdef HAVE_SOCKET
socket_info.ignore_socket = cl_options.new_instance;
+ if ( cl_options.socket_filename )
+ {
+ socket_info.file_name = cl_options.socket_filename;
+ }
#endif
#ifdef HAVE_VTE
vte_info.lib_vte = lib_vte;
Index: main.h
===================================================================
--- main.h (Revision 4424)
+++ main.h (Arbeitskopie)
@@ -28,6 +28,7 @@
typedef struct
{
gboolean new_instance;
+ gchar *socket_filename;
gboolean load_session;
gint goto_line;
gint goto_column;
Dear Geany devs,
I've sent the email below to the wrong mailinglist, so here it is again! ;)
My apologies for those who receive this email twice...
-H-
---------- Forwarded message ----------
From: Harold Aling <geany(a)sait.nl>
Date: Thu, Nov 12, 2009 at 17:16
Subject: PHP constants are not listed in symbol list (patch attached)
To: Geany general discussion list <geany(a)uvena.de>
Dear Geany devs,
I've updated Geany to the latest svn (r4424) and noticed that php
constants didn't show up in the symbol list.
I then baldly opened 'php.c' and started hacking in the regexes to get
them working again. In 'actionscript.c' the constants were part of
"m,macro,macros" so I decided to change that in php.c too. Constants
were showing again! ;)
I also remove a duplicate regex and also added one in my patch to show
constants in a "const NAME = 'value';" notation so all constants are
correctly parsed from this example:
<?php
abstract class test {
const TEST = 'test';
}
define('TEST2', 'test');
?>
Cheers!
Harold