Closed Jaffe- closed 8 years ago
Hi!
Thanks for the patch!
Can you supply a (simple) example of a typical use -- I'd like to include it on the test suite so that I won't accidentally break the feature in future.
I haven't tested you patch yet, but doesn't this cause #'symbol not to be highlighted?
-- Anders
On Thu, May 5, 2016 at 11:59 PM, Johan Fjeldtvedt notifications@github.com wrote:
When using #' with lambdas in CL, the whole lambda form is highlighted as
if it was a quoted list.
You can view, comment on, or merge this pull request online at:
https://github.com/Lindydancer/lisp-extra-font-lock/pull/1 Commit Summary
- Skip #-quotes in Common Lisp
File Changes
- M lisp-extra-font-lock.el https://github.com/Lindydancer/lisp-extra-font-lock/pull/1/files#diff-0 (5)
Patch Links:
- https://github.com/Lindydancer/lisp-extra-font-lock/pull/1.patch
- https://github.com/Lindydancer/lisp-extra-font-lock/pull/1.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/Lindydancer/lisp-extra-font-lock/pull/1
Yes, you're right, #'symbol is not highlighted now. I'm not sure what the best approach is for not highlighting the lambda quoted with #' here, while also highlighting #'symbol. It could be enough to check for a ( following #'?
Anyway, a typical use is
(mapcar #'(lambda (x) (1+ x)) '(1 2 3 4))
Hi!
Yes, you're right, #'symbol is not highlighted now. I'm not sure what the best approach is for not highlighting the lambda quoted with #' here, while also highlighting #'symbol. It could be enough to check for a ( following #'?
In Common Lisp, can you use the #' construct in other situations than
'(lambda () ...) and #'symbol?
Anyway, I've been playing with the idea to highlight #'symbol as function names, to make them stand out a bit. If #' isn't used in other situations, combining this with your solution would do the trick.
I can see if I come up with something in the next couple of days.
Anyway, a typical use is
(mapcar #'(lambda (x) (1+ x)) '(1 2 3 4))
Thanks! I'll add it the the test suite.
-- Anders
The #'
construct is a part of CL's standard macro syntax, so there are other forms as well. Highlighting # in any such context would be nice, too.
As for #'
it is only used for #'(lambda ...)
(for which #'
is actually redundant, but for historic reasons it is still used) or #'function-name
. Highlighting #'function-name
only would be great. For #'(lambda ...)
forms, maybe the #'
could be highlighted?
Thanks for an awesome package by the way!
Hi!
The #' construct is a part of CL's standard macro syntax https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node191.html, so there are other forms as well. Highlighting # in any such context would be nice, too.
Hmm, seems rather complex... Is there a general rule that I can use, like highlighting all occurrences of #
, so that I don't have to treat each case separately, check for special contexts etc?
As for #' it is only used for #'(lambda ...) (for which #' is actually
redundant, but for historic reasons it is still used) or #'function-name. Highlighting #'function-name only would be great. For #'(lambda ...) forms, maybe the #' could be highlighted?
Technically, I surely can. Today, I highlight backquote. The only thing that worries me is that too much would be highlighted. Of course, I can always add a customizable face (inheriting from the "builtin" or "constant" face, to separate it from backquote), that way people can tweak it any way they like.
Thanks for an awesome package by the way!
Thanks! I really enjoyed writing it!
-- Anders
I think those #<char>
expressions can be divided into literals and "other". Literals such as #*01101
for binary numbers or #(...)
for vectors, could use the constant face. All others could use a different face.
For me personally this isn't very important though. I find the package very useful as is, except for that unwanted highlighting in #'(lambda ...)
expressions.
Hi!
I just pushed a new version. It no longer treats #' as a quote. It highlights #'symbol. I've included the test suite.
Please try it out and see if it works for you.
-- Anders
On Fri, May 6, 2016 at 1:33 PM, Johan Fjeldtvedt notifications@github.com wrote:
I think those #
expressions can be divided into literals and "other". Literals such as #*01101 for binary numbers or #(...) for vectors, could use the constant face. All others could use a different face. For me personally this isn't very important though. I find the package very useful as is, except for that unwanted highlighting in #'(lambda ...) expressions.
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/Lindydancer/lisp-extra-font-lock/pull/1#issuecomment-217417396
It works fine! Thank you.
When using #' with lambdas in CL, the whole lambda form is highlighted as if it was a quoted list.