Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Problem setting binding -- mode-map does not (yet?) exist
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jim Burton  
View profile  
 More options Mar 12 2010, 8:23 am
From: Jim Burton <jimburt...@gmail.com>
Date: Fri, 12 Mar 2010 05:23:43 -0800 (PST)
Local: Fri, Mar 12 2010 8:23 am
Subject: Problem setting binding -- mode-map does not (yet?) exist
[yas] warning: keybinding "C-?" invalid for snippet "set" since keymap
"latex-mode-map" does not (yet?) exist.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Burton  
View profile  
 More options Mar 12 2010, 8:28 am
From: Jim Burton <jimburt...@gmail.com>
Date: Fri, 12 Mar 2010 05:28:31 -0800 (PST)
Local: Fri, Mar 12 2010 8:28 am
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist
[Sorry, I was halfway through writing this post and google groups
posted it for me.]

I've got a problem with this snippet, intended for latex-mode:

# -*- mode: snippet -*-
# name: set
# key: set
# binding: "C-?"
# --
\{ `yas/selected-text`$1 \\}$0

The "name" part works OK, so I can expand "set" in latex-mode, but not
the binding. Here's what I get in *Messages* after loading with C-c C-
c in snippet-mode or yas/reload-all:

[yas] warning: keybinding "C-?" invalid for snippet "set" since keymap
"latex-mode-map" does not (yet?) exist.

How come? Thanks,

Jim
On Mar 12, 1:23 pm, Jim Burton <jimburt...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Burton  
View profile  
 More options Mar 22 2010, 9:01 am
From: Jim Burton <jimburt...@gmail.com>
Date: Mon, 22 Mar 2010 06:01:28 -0700 (PDT)
Local: Mon, Mar 22 2010 9:01 am
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist
I think this is because the keymap is called LaTeX-mode-map, not latex-
mode-map. This is annoying because the mode is called latex-mode, not
LaTeX-mode and I am guessing you derive the name of the keymap from
the path? Defining latex-mode-map fixes it:

(setq latex-mode-map LaTeX-mode-map)

Jim

On Mar 12, 1:28 pm, Jim Burton <jimburt...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Burton  
View profile  
 More options Mar 22 2010, 9:21 am
From: Jim Burton <jimburt...@gmail.com>
Date: Mon, 22 Mar 2010 06:21:30 -0700 (PDT)
Local: Mon, Mar 22 2010 9:21 am
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist
On Mar 22, 1:01 pm, Jim Burton <jimburt...@gmail.com> wrote:

> I think this is because the keymap is called LaTeX-mode-map, not latex-
> mode-map. This is annoying because the mode is called latex-mode, not
> LaTeX-mode and I am guessing you derive the name of the keymap from
> the path? Defining latex-mode-map fixes it:

> (setq latex-mode-map LaTeX-mode-map)

This only works if it is evaluated after the keymap is defined and
before yas is loaded, but it seems the keymap isn't defined until you
visit a tex file? The only way I can get the keybinding set when I
open a tex file is to add

(setq latex-mode-map LaTeX-mode-map)
(yas/reload-all)

to my LaTeX-mode-hook. I presume there is a better way to do it?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
João Távora  
View profile  
 More options Mar 22 2010, 10:43 am
From: João Távora <joaotav...@gmail.com>
Date: Mon, 22 Mar 2010 15:43:20 +0100
Local: Mon, Mar 22 2010 10:43 am
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist
Hi,

It seems you may be right about the case issue. The setq fix, though
it is close, is not what you want, I think. Try

(defvaralias latex-mode-map LaTeX-mode-map)

And report back here. I'll look into the problem as soon as I can.

Bye!

--
João Távora

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Burton  
View profile  
 More options Mar 22 2010, 10:58 am
From: Jim Burton <jimburt...@gmail.com>
Date: Mon, 22 Mar 2010 07:58:57 -0700 (PDT)
Local: Mon, Mar 22 2010 10:58 am
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist
Thinking about this some more, it seems not to be (only) related to
the name of the keymap but the way yas adds bindings to keymaps --
should it not do so by adding a define-key to the _hook_ for each
mode?

Jim

On Mar 22, 1:21 pm, Jim Burton <jimburt...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
João Távora  
View profile  
 More options Mar 22 2010, 11:13 am
From: João Távora <joaotav...@gmail.com>
Date: Mon, 22 Mar 2010 16:13:13 +0100
Local: Mon, Mar 22 2010 11:13 am
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist

On Mon, Mar 22, 2010 at 3:58 PM, Jim Burton <jimburt...@gmail.com> wrote:
> Thinking about this some more, it seems not to be (only) related to
> the name of the keymap but the way yas adds bindings to keymaps --
> should it not do so by adding a define-key to the _hook_ for each
> mode?

Errr, yes, more or less, it's complicated, but anyway in the trunk and
upcoming 0.7 this problem no longer exists, as a variable called
emulation-mode-maps-alist is used, which simplifies the whole issue
and correctly insulates the mode's maps of all yasnippet interference.

I suspect you're using 0.6something, so I encourage you to try out the trunk:

try svn co http://yasnippet.googlecode.com/svn/trunk yasnippet.

and experiment heavily with keybindings since that's one of the most
underused features. Notice that in the new version, multiple snippets,
even across different modes, can share the same keybinding.

 Bye!
J

--
João Távora

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Burton  
View profile  
 More options Mar 22 2010, 11:26 am
From: Jim Burton <jimburt...@gmail.com>
Date: Mon, 22 Mar 2010 08:26:36 -0700 (PDT)
Local: Mon, Mar 22 2010 11:26 am
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist
On Mar 22, 3:13 pm, João Távora <joaotav...@gmail.com> wrote:

> On Mon, Mar 22, 2010 at 3:58 PM, Jim Burton <jimburt...@gmail.com> wrote:
> > Thinking about this some more, it seems not to be (only) related to
> > the name of the keymap but the way yas adds bindings to keymaps --
> > should it not do so by adding a define-key to the _hook_ for each
> > mode?

> Errr, yes, more or less, it's complicated, but anyway in the trunk and
> upcoming 0.7 this problem no longer exists, as a variable called
> emulation-mode-maps-alist is used, which simplifies the whole issue
> and correctly insulates the mode's maps of all yasnippet interference.

> I suspect you're using 0.6something, so I encourage you to try out the trunk:

> try svn cohttp://yasnippet.googlecode.com/svn/trunkyasnippet.

Yes, I'm using 0.6.1c.

> and experiment heavily with keybindings since that's one of the most
> underused features.

Will do. Thanks,

Jim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Burton  
View profile  
 More options Mar 22 2010, 11:41 am
From: Jim Burton <jimburt...@gmail.com>
Date: Mon, 22 Mar 2010 08:41:13 -0700 (PDT)
Local: Mon, Mar 22 2010 11:41 am
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist
The version from svn seems to be broken for me. Loading a tex document
I get no yas menu and none of the snippets aredefined. I have added
the defvaralias to LaTeX-mode-hook, and get this in *Messages*:

[...]
[yas] Warning: the "# group:" is no longer supported! [80 times]
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading tramp...done
Automatic display of crossref information was turned on
Starting new Ispell process [default] ...
File mode specification error: (void-variable latex-mode-map)
Applying style hooks...
Loading /home/jim/sdf-git/papers/thesis/auto/main.el (source)...done
Applying style hooks... done
File mode specification error: (void-variable latex-mode-map)
[end of messages]

Removing the defvaralias has no effect.

Jim

On Mar 22, 3:13 pm, João Távora <joaotav...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
João Távora  
View profile  
 More options Mar 22 2010, 1:08 pm
From: João Távora <joaotav...@gmail.com>
Date: Mon, 22 Mar 2010 18:08:34 +0100
Local: Mon, Mar 22 2010 1:08 pm
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist
Obviously, being a version currently under development, you must bear
with some instabilities.  :-) can you reproduce this with a clean
emacs -Q run?

like "emacs -Q -l yasnippet.el -l simpleinit.el"

where simpleinit.el would just contain

(setq yas/snippet-dirs <dir-or-list-of-dirs>)
(yas/reload-all)

If it doesn't happen, then its a problem with your previous config. It
if still happens, post a zip of your latex snippets here, or better
yet, all your snippet dirs, as long as they're relatively small.

PS: I don't think the defvaralias matters anymore. It was just a
workaround for 0.6.1, did you try it?

Thanks!
J

--
João Távora

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Burton  
View profile  
 More options Mar 22 2010, 1:32 pm
From: Jim Burton <jimburt...@gmail.com>
Date: Mon, 22 Mar 2010 10:32:35 -0700 (PDT)
Local: Mon, Mar 22 2010 1:32 pm
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist

On Mar 22, 5:08 pm, João Távora <joaotav...@gmail.com> wrote:

> Obviously, being a version currently under development, you must bear
> with some instabilities.  :-) can you reproduce this with a clean
> emacs -Q run?

> like "emacs -Q -l yasnippet.el -l simpleinit.el"

> where simpleinit.el would just contain

> (setq yas/snippet-dirs <dir-or-list-of-dirs>)
> (yas/reload-all)

This loads without any errors (*Messages* contains the warnings from
before but no errors). I can see two problems though: there are no
submenus beneath text-mode, just a long list with every snippet
listed, and although I can select a snippet from the menu, neither tab-
expansion or bindings work. I'm using Gnu Emacs 23.0.91.1.

> If it doesn't happen, then its a problem with your previous config. It
> if still happens, post a zip of your latex snippets here, or better
> yet, all your snippet dirs, as long as they're relatively small.

> PS: I don't think the defvaralias matters anymore. It was just a
> workaround for 0.6.1, did you try it?

Yes I did, and 0.6.1c is working fine for me with that, so I'm quite
happy to stick to that version for now.

Thanks,

Jim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
João Távora  
View profile  
 More options Mar 22 2010, 6:45 pm
From: João Távora <joaotav...@gmail.com>
Date: Mon, 22 Mar 2010 23:45:53 +0100
Local: Mon, Mar 22 2010 6:45 pm
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist
Did you use your own snippets or the snippets in the trunk? In other words, what did you use as

>> (setq yas/snippet-dirs <dir-or-list-of-dirs>)

If you used your own snippet collection please post it here so I can debug this problem.

Thanks,
Joao

On Mar 22, 2010, at 6:32 PM, Jim Burton wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Burton  
View profile  
 More options Mar 23 2010, 6:59 am
From: Jim Burton <jimburt...@gmail.com>
Date: Tue, 23 Mar 2010 03:59:41 -0700 (PDT)
Local: Tues, Mar 23 2010 6:59 am
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist
I was using my own snippets and I discovered that there was a non-
snippet file in amongst them, a lisp file generated by AUCTeX (I think
I accidentally compiled one of the snippet files somehow). Removing
this file fixed the problem.

Thanks for your help.

Jim

On Mar 22, 10:45 pm, João Távora <joaotav...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
João Távora  
View profile  
 More options Mar 23 2010, 8:48 am
From: João Távora <joaotav...@gmail.com>
Date: Tue, 23 Mar 2010 13:48:15 +0100
Local: Tues, Mar 23 2010 8:48 am
Subject: Re: Problem setting binding -- mode-map does not (yet?) exist
OK, so just to confirm. You *can* use the svn trunk (upcoming 0.7)
correctly with your AUCTeX snippets, together with the bundled
snippets.

It's strange about that file, but I'm glad it works. From the
behaviour you described earlier (big list of snippets under
text-mode), I would have guessed you tried to use the 0.6 snippet
collection with 0.7, which is incompatible and would produce just
that, since the hierarchy organization has been completely replaced by
the used of ".yas-parents".

So have fun and report any strange behaviour here,
João

--
João Távora

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »