GNU bug report logs -
#1297
font-lock-keywords-case-fold-search doc and usage
Previous Next
Reported by: Dan Nicolaescu <dann <at> ics.uci.edu>
Date: Sun, 2 Nov 2008 16:05:05 UTC
Severity: normal
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 1297 in the body.
You can then email your comments to 1297 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#1297
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Dan Nicolaescu <dann <at> ics.uci.edu>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
font-lock-keywords-case-fold-search docstring should make it more clear
that font-lock-defaults erases it.
There is one victim in the tree. `lisp-mode' does:
(make-local-variable 'font-lock-keywords-case-fold-search)
(setq font-lock-keywords-case-fold-search t)
but the value of font-lock-keywords-case-fold-search in a lisp-mode
buffer is nil, that's because font-lock-defaults does a
kill-local-variable on it...
Reply sent to
Chong Yidong <cyd <at> stupidchicken.com>
:
You have taken responsibility.
Full text and
rfc822 format available.
Notification sent to
Dan Nicolaescu <dann <at> ics.uci.edu>
:
bug acknowledged by developer.
Full text and
rfc822 format available.
Message #10 received at 1297-done <at> emacsbugs.donarmstrong.com (full text, mbox):
> font-lock-keywords-case-fold-search docstring should make it more clear
> that font-lock-defaults erases it.
Okay, I changed it to make it hopefully clearer.
> There is one victim in the tree. `lisp-mode' does:
>
> (make-local-variable 'font-lock-keywords-case-fold-search)
> (setq font-lock-keywords-case-fold-search t)
>
> but the value of font-lock-keywords-case-fold-search in a lisp-mode
> buffer is nil, that's because font-lock-defaults does a
> kill-local-variable on it...
Great catch. No one has complained about this, so clearly it's OK for
font-lock-keywords-case-fold-search to be nil. I removed the bogus
8-year-old setting of font-lock-keywords-case-fold-search.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#1297
; Package
emacs
.
Full text and
rfc822 format available.
Message #13 received at 1297 <at> emacsbugs.donarmstrong.com (full text, mbox):
Chong Yidong <cyd <at> stupidchicken.com> writes:
> > font-lock-keywords-case-fold-search docstring should make it more clear
> > that font-lock-defaults erases it.
>
> Okay, I changed it to make it hopefully clearer.
Thanks.
> > There is one victim in the tree. `lisp-mode' does:
> >
> > (make-local-variable 'font-lock-keywords-case-fold-search)
> > (setq font-lock-keywords-case-fold-search t)
> >
> > but the value of font-lock-keywords-case-fold-search in a lisp-mode
> > buffer is nil, that's because font-lock-defaults does a
> > kill-local-variable on it...
>
> Great catch. No one has complained about this, so clearly it's OK for
> font-lock-keywords-case-fold-search to be nil. I removed the bogus
> 8-year-old setting of font-lock-keywords-case-fold-search.
But that's not quite right, not sure about the standard, but there are
lisps that are case insensitive:
(DEFUN foo (arg)
blah)
ought to be fontified the same was as:
(defun foo (arg)
blah)
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#1297
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Chong Yidong <cyd <at> stupidchicken.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #18 received at 1297 <at> emacsbugs.donarmstrong.com (full text, mbox):
Dan Nicolaescu <dann <at> ics.uci.edu> writes:
> > Great catch. No one has complained about this, so clearly it's OK for
> > font-lock-keywords-case-fold-search to be nil. I removed the bogus
> > 8-year-old setting of font-lock-keywords-case-fold-search.
>
> But that's not quite right, not sure about the standard, but there are
> lisps that are case insensitive:
>
> (DEFUN foo (arg)
> blah)
>
> ought to be fontified the same was as:
>
> (defun foo (arg)
> blah)
We can put this in the wishlist. I don't see any reason to rock this
particular boat right now.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#1297
; Package
emacs
.
Full text and
rfc822 format available.
Message #21 received at 1297 <at> emacsbugs.donarmstrong.com (full text, mbox):
Chong Yidong <cyd <at> stupidchicken.com> writes:
> Dan Nicolaescu <dann <at> ics.uci.edu> writes:
>
> > > Great catch. No one has complained about this, so clearly it's OK for
> > > font-lock-keywords-case-fold-search to be nil. I removed the bogus
> > > 8-year-old setting of font-lock-keywords-case-fold-search.
> >
> > But that's not quite right, not sure about the standard, but there are
> > lisps that are case insensitive:
> >
> > (DEFUN foo (arg)
> > blah)
> >
> > ought to be fontified the same was as:
> >
> > (defun foo (arg)
> > blah)
>
> We can put this in the wishlist. I don't see any reason to rock this
> particular boat right now.
It's easier to fix than to write a wishlist item
--- lisp-mode.el.~1.230.~ 2008-11-02 21:49:24.000000000 -0800
+++ lisp-mode.el 2008-11-03 23:13:38.000000000 -0800
@@ -195,7 +195,8 @@
;; The LISP-SYNTAX argument is used by code in inf-lisp.el and is
;; (uselessly) passed from pp.el, chistory.el, gnus-kill.el and score-mode.el
-(defun lisp-mode-variables (&optional lisp-syntax)
+;; KEYWORDS-CASE-SENSITIVE means that for font-lock keywords will not be case sensitive.
+(defun lisp-mode-variables (&optional lisp-syntax keywords-case-insensitive)
(when lisp-syntax
(set-syntax-table lisp-mode-syntax-table))
(setq local-abbrev-table lisp-mode-abbrev-table)
@@ -241,9 +242,9 @@
(setq multibyte-syntax-as-symbol t)
(set (make-local-variable 'syntax-begin-function) 'beginning-of-defun)
(setq font-lock-defaults
- '((lisp-font-lock-keywords
+ `((lisp-font-lock-keywords
lisp-font-lock-keywords-1 lisp-font-lock-keywords-2)
- nil nil (("+-*/.<>=!?$%_&~^:@" . "w")) nil
+ nil ,keywords-case-insensitive (("+-*/.<>=!?$%_&~^:@" . "w")) nil
(font-lock-mark-block-function . mark-defun)
(font-lock-syntactic-face-function
. lisp-font-lock-syntactic-face-function))))
@@ -464,7 +465,7 @@ if that value is non-nil."
(use-local-map lisp-mode-map)
(setq major-mode 'lisp-mode)
(setq mode-name "Lisp")
- (lisp-mode-variables)
+ (lisp-mode-variables nil t)
(make-local-variable 'comment-start-skip)
(setq comment-start-skip
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
Message #22 received at 1297-done <at> emacsbugs.donarmstrong.com (full text, mbox):
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
> > It's easier to fix than to write a wishlist item
>
> Thank you. Please move the docstring where it belongs while you're there.
Done.
Thanks.
bug archived.
Request was from
Debbugs Internal Request <don <at> donarmstrong.com>
to
internal_control <at> emacsbugs.donarmstrong.com
.
(Fri, 05 Dec 2008 15:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 16 years and 203 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.