Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on expansion of snippets in html-mode #24

Closed
joaotavora opened this issue Nov 3, 2011 · 6 comments
Closed

Error on expansion of snippets in html-mode #24

joaotavora opened this issue Nov 3, 2011 · 6 comments
Assignees

Comments

@joaotavora
Copy link
Owner

Hi!

As you might now Emacs has a cool feature in html-mode so that when you for
example do a "u-tag" Emacs will show an underline on the word in it. And if
you do a "h1-tag" Emacs will make it a bit larger and bold.

I have noticed that you cannot expand snippet when in one of those special
tags.
For example if I have:

My name %%{cursor here}

(%% is an expansion for <%= %>)

If I then try to expand I'll get this:
[yas]error in condition evaluation: Wrong type argument: stringp, (bold
underline)

Google Code Info:
Issue #: 21
Author: johan.re...@gmail.com
Created On: 2008-04-22T18:35:08.000Z
Closed On: 2008-04-23T01:53:25.000Z

@ghost ghost assigned joaotavora Nov 3, 2011
@joaotavora
Copy link
Owner Author

Hi, thank you for reporting this bug. But if I remember correctly. This had been
fixed in version 0.5.2. Please download the latest version. :)

Google Code Info:
Author: plus...@gmail.com
Created On: 2008-04-23T01:53:25.000Z

@joaotavora
Copy link
Owner Author

I use the SVN-version and therefore mostly has the newest version. As I have now, and
there's still the problem!

Forgot to include my Emacs version before:
GNU Emacs 22.1.1 (i686-pc-linux-gnu, GTK+ Version 2.12.8)

Google Code Info:
Author: johan.re...@gmail.com
Created On: 2008-04-23T06:17:26.000Z

@joaotavora
Copy link
Owner Author

Hi, it shouldn't be that. If you are using the svn version. Maybe you need to
re-compile the bundle? or redo a byte-compilation if you use .elc file. And if you
still have the problem, please check the code you got, it should like this:

(defvar yas/buffer-local-condition
'(if (and (not (bobp))
(or (equal "font-lock-comment-face"
(get-char-property (1- (point))
'face))
(equal "font-lock-string-face"
(get-char-property (1- (point))
'face))))
'(require-snippet-condition . force-in-comment)
t)

Note in previous version it used "string=" instead of "equal" that caused the error.

Google Code Info:
Author: plus...@gmail.com
Created On: 2008-04-23T06:29:47.000Z

@joaotavora
Copy link
Owner Author

But even if I compile my lib shouldn't Emacs use the .el file if it's newer then the
.elc file?

Anyway, I'll try to recompile when I get home.

Google Code Info:
Author: johan.re...@gmail.com
Created On: 2008-04-23T07:47:30.000Z

@joaotavora
Copy link
Owner Author

I'm not sure for normal .el file. But at least for ~/.emacs, Emacs will use the
compiled file even if the .el file is newer than .elc file -- but a warning will be
reported.

Google Code Info:
Author: plus...@gmail.com
Created On: 2008-04-23T09:29:00.000Z

@joaotavora
Copy link
Owner Author

Works perfectly after compiling the lib!

Thanks! =)

Google Code Info:
Author: johan.re...@gmail.com
Created On: 2008-04-23T13:37:21.000Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant