emacs-devel
[Top][All Lists]
Advanced

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

Re: kill ring menu


From: Miles Bader
Subject: Re: kill ring menu
Date: 22 May 2002 12:46:09 +0900

Colin Walters <address@hidden> writes:
> The only way I can think of to implement said `font-lock-face-category'
> is to loop through all the symbols in `font-lock-category-alist' and use
> `symbol-name' to compare their string names.  That just seemed too
> inefficient.

Um, how about this (in the font-lock code; untested):

   (defun ...do-stuff-to-setup-categories... ()
     ...
     (set (make-local-variable 'font-lock-category-property) 
          ;; you could also embed the buffer name in the name of this
          ;; symbol, if you want the plist to be more clear
          (make-symbol "font-lock-category"))
     ...
     (dolist (cat-name list-of-mode-category-names)
       (put cat-name 
            font-lock-category-property
            (make-symbol (symbol-name cat-name))))
     ...)

   (defun font-lock-face-category (cat-name)
     (get cat-name font-lock-category-property))

Looks pretty efficient to me ... (or you could use Stefan's idea of
buffer-local variables, with the caveats I noted).

-Miles
-- 
o The existentialist, not having a pillow, goes everywhere with the book by
  Sullivan, _I am going to spit on your graves_.



reply via email to

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