bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Keybinding Patch gtags.el


From: Stan Moore
Subject: RE: Keybinding Patch gtags.el
Date: Wed, 11 Sep 2013 18:50:41 -0400

From: Shigio YAMAGUCHI [mailto:address@hidden
> Sent: Tuesday, September 10, 2013 9:44 PM
> To: Stan Moore
> Cc: address@hidden
> Subject: Re: Keybinding Patch gtags.el
>
> On Tue, 10 Sep 2013 18:13:35 -0400
> "Stan Moore" <address@hidden> wrote:
>
> Although I am sorry, I don't know well about the 'package'.
> But we should follow the custom of emacs always.
> If the custom is insufficient in a certain case, we should change it or
add a
> new one to it, I think.
> Probably, It should be discussed in the emacs mailing list.

I'm fine with setting the variable globally in .emacs which is probably more
typical.  My point was really about my personal current "custom" which is
changing as emacs changes. Unless you feel strongly about a discussion, I'm
OK. At this point I’m not trying to change emacs or even encourage trying
anything different. I was responding to a change from emacs when I started
using "packages" and had to change my old habit. It's possible there's
another solution that I'm unaware of as I didn't really spend much time
looking. Once I understood what was happening it was trivial to work around.


I'm not aware that emacs has really developed a customary method for setups;
in my experience flexibility is the custom. Some people and packages only
use the customization interface, others prefer to hack up some code in
.emacs directly. I've seen all kinds of setup code: some good, some bad,
some outdated, and some just terrible. If you feel a custom exists then by
all means follow it with my blessings.

One thing I see in many packages is the ability to toggle the keybindings.
Instead of a simple variable read during mode activation the package uses a
toggle function that can install or remove the keybindings. I guess that's
one possible future enhancement.

The official GNU Global manual (info) has a chapter about using gtags.el
with emacs but it doesn't mention the keybindings. Instead it has the user
manually call the functions by name. In that documentation, the gtags-mode
is set in the c-mode hook but the keybinding var is not mentioned.

The 'package' system is relatively new and is almost certain to grow. It is
built in to the core emacs so it isn't going away. Basically it is a
repository system that allows users to simply select a package and the
installation is transparent and automatic. A user can also update installed
"packages" in between emacs releases. You can try M-x list-packages from a
stock emacs and see quite a few offerings. The stock installation only looks
at only one repository but there are others (MELPA, ...) available. I
haven't used it long myself, but so far it seems like a great idea.

> > The crux of the problem is timing. The variable must be set before the
> > mode is active so you could set it anywhere prior to activating the
> > mode. Lately I've been moving things into hooks to accommodate the
> > package system. With packages, they aren't on the load path until
> > AFTER .emacs is processed so autoloads can't work. I suppose there are
> > options but I've been putting things into hooks that run after init;
> > and in several I need to setup configuration variable status.
> >
> > In this case my personal preference was to get ahead of the curve and
> > put the whole gtags setup in the hook. In the future, if gtags is
> > added to the load path late I won't even notice because the c-mode
> > hooks will always come after the "system" init is finished. The
> > packages almost make "system" init a two stage process so this allows
> > for that possibility and doesn’t have any real side effects of it is
relatively
> harmless.
> >
> > At the moment I'm using a local copy of gtags but if a newer version
> > was to show up in packages I would probably just add the package and
> > that would break gtags if the variable wasn't set after the "system"
> > init and before the mode is activated. The first time I had that
> > happen with a different package it was nontrivial to figure out what
> > was happening. When I found out that packages are added to the load
> > path after .emacs it was a surprise. The packages system is causing
> > many to dig through crufty old parts of .emacs and in the long run
that's
> probably a good thing.
> >
> > The above notwithstanding, I wouldn't have any problem if the
> > documentation examples set the variable globally and loaded the mode
> > in the typical fashion. The keybindings work fine as long as the
> > variable is set before the mode is activated.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]