all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Schmidt <christopher@ch.ristopher.com>
To: 12761@debbugs.gnu.org
Subject: bug#12761: cl-lib.el functions do not get font-locked like cl.el ones
Date: Sat, 15 Dec 2012 16:54:24 +0000 (GMT)	[thread overview]
Message-ID: <87r4mrl0hj@ch.ristopher.com> (raw)
In-Reply-To: <jwvvcdsks16.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 30 Oct 2012 09:33:16 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> So maybe that special treatment (lexical-let, letf, etc)
>> should be removed, to make everyone equally miserable.
>
> Right.  But then the "cl-*" versions could be fine choices (tho I'd
> much rather not hard code those things in the font-lock rules.
> Couldn't we build those dynamically by loading cl-lib.el, then going
> through the obarray, keeping all macros whose name starts with "cl-"
> but not "cl--"?).

+1.

I think it might be a good idea to remove CL font lock support in
emacs-lisp-mode and its deviates by default.  A function that adds
keyword highlighting on the fly could be added, though.

    (require 'cl-lib)

    (defun add-cl-font-lock-keywords ()
      (font-lock-add-keywords
       'emacs-lisp-mode
       (eval-when-compile
         (cl-loop
          for s being the symbols
          for n = (symbol-name s)
          when (and (string-match-p "^cl-[^-]" n)
                    (condition-case nil
                        (eq (car (symbol-function s)) 'macro)
                      (error)))
          collect (list (concat "(\\(?:[ \t]*\\)\\<\\("
                                (regexp-quote n)
                                "\\)\\>")
                        1
                        font-lock-keyword-face)
          end))))

An user just needs to put (add-cl-font-lock-keywords) in his init.el in
case he really wants CL font lock support.

I am just brainstorming here.  This does not take care of
lisp-interaction-mode, *scratch*, etc.

        Christopher





  reply	other threads:[~2012-12-15 16:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29  7:58 bug#12761: cl-lib.el functions do not get font-locked like cl.el ones Glenn Morris
2012-10-29 13:53 ` Stefan Monnier
2012-10-30  7:37   ` Glenn Morris
2012-10-30 13:33     ` Stefan Monnier
2012-12-15 16:54       ` Christopher Schmidt [this message]
2013-08-13 22:59 ` bug#12761: bug #12761 - please do it Drew Adams
2013-08-14  0:44   ` Stefan Monnier
2013-08-14  1:49     ` Drew Adams
2013-08-14  2:33       ` Stefan Monnier
2013-08-14  2:36         ` Drew Adams
2013-08-14 12:29         ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r4mrl0hj@ch.ristopher.com \
    --to=christopher@ch.ristopher.com \
    --cc=12761@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.