aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2012-04-16 20:01:44 +0000
committerAlan Mackenzie2012-04-16 20:01:44 +0000
commitf0f6bc351ba0e4a9ba5a62fb1bbc6fe4b5ce2e0c (patch)
tree3dd3a0b4e7d98820eda653d3beef1b04c560103f
parent4fc2c72a6fa8b776b6c7aaa42e80cea77b99ad0f (diff)
downloademacs-f0f6bc351ba0e4a9ba5a62fb1bbc6fe4b5ce2e0c.tar.gz
emacs-f0f6bc351ba0e4a9ba5a62fb1bbc6fe4b5ce2e0c.zip
CC Mode: Ensure searching for keywords is case sensitive.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/progmodes/cc-cmds.el39
-rw-r--r--lisp/progmodes/cc-mode.el4
3 files changed, 37 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e1232eb52e5..06a794a79fb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12012-04-16 Alan Mackenzie <acm@muc.de>
2
3 Ensure searching for keywords is case sensitive.
4
5 * progmodes/cc-cmds.el (c-electric-brace, c-electric-lt-gt)
6 (c-electric-paren, c-beginning-of-defun, c-end-of-defun)
7 (c-defun-name, c-mark-function, c-cpp-define-name)
8 (c-comment-indent, c-scan-conditionals, c-indent-defun)
9 (c-context-line-break): bind case-fold-search to nil.
10
11 * progmodes/cc-mode.el (c-font-lock-fontify-region): bind
12 case-fold-search to nil.
13
12012-04-16 Chong Yidong <cyd@gnu.org> 142012-04-16 Chong Yidong <cyd@gnu.org>
2 15
3 * mail/sendmail.el (mail-bury): Call return action with the right 16 * mail/sendmail.el (mail-bury): Call return action with the right
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 55ab6c9981c..9cf20ccb516 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -679,7 +679,7 @@ settings of `c-cleanup-list' are done."
679 ;; We want to inhibit blinking the paren since this would be 679 ;; We want to inhibit blinking the paren since this would be
680 ;; most disruptive. We'll blink it ourselves later on. 680 ;; most disruptive. We'll blink it ourselves later on.
681 (old-blink-paren blink-paren-function) 681 (old-blink-paren blink-paren-function)
682 blink-paren-function) 682 blink-paren-function case-fold-search)
683 683
684 (c-save-buffer-state () 684 (c-save-buffer-state ()
685 (setq safepos (c-safe-position (point) (c-parse-state)) 685 (setq safepos (c-safe-position (point) (c-parse-state))
@@ -1086,7 +1086,7 @@ numeric argument is supplied, or the point is inside a literal."
1086 1086
1087 (interactive "*P") 1087 (interactive "*P")
1088 (let ((c-echo-syntactic-information-p nil) 1088 (let ((c-echo-syntactic-information-p nil)
1089 final-pos close-paren-inserted found-delim) 1089 final-pos close-paren-inserted found-delim case-fold-search)
1090 1090
1091 (self-insert-command (prefix-numeric-value arg)) 1091 (self-insert-command (prefix-numeric-value arg))
1092 (setq final-pos (point)) 1092 (setq final-pos (point))
@@ -1172,7 +1172,8 @@ newline cleanups are done if appropriate; see the variable `c-cleanup-list'."
1172 (interactive "*P") 1172 (interactive "*P")
1173 (let ((literal (c-save-buffer-state () (c-in-literal))) 1173 (let ((literal (c-save-buffer-state () (c-in-literal)))
1174 ;; shut this up 1174 ;; shut this up
1175 (c-echo-syntactic-information-p nil)) 1175 (c-echo-syntactic-information-p nil)
1176 case-fold-search)
1176 (self-insert-command (prefix-numeric-value arg)) 1177 (self-insert-command (prefix-numeric-value arg))
1177 1178
1178 (if (and (not arg) (not literal)) 1179 (if (and (not arg) (not literal))
@@ -1585,7 +1586,7 @@ defun."
1585 ; structure with other users of c-state-cache. 1586 ; structure with other users of c-state-cache.
1586 (orig-point-min (point-min)) (orig-point-max (point-max)) 1587 (orig-point-min (point-min)) (orig-point-max (point-max))
1587 lim ; Position of { which has been widened to. 1588 lim ; Position of { which has been widened to.
1588 where pos) 1589 where pos case-fold-search)
1589 1590
1590 (save-restriction 1591 (save-restriction
1591 (if (eq c-defun-tactic 'go-outward) 1592 (if (eq c-defun-tactic 'go-outward)
@@ -1709,7 +1710,8 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'."
1709 ; structure with other users of c-state-cache. 1710 ; structure with other users of c-state-cache.
1710 (orig-point-min (point-min)) (orig-point-max (point-max)) 1711 (orig-point-min (point-min)) (orig-point-max (point-max))
1711 lim 1712 lim
1712 where pos) 1713 where pos case-fold-search)
1714
1713 (save-restriction 1715 (save-restriction
1714 (if (eq c-defun-tactic 'go-outward) 1716 (if (eq c-defun-tactic 'go-outward)
1715 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace 1717 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace
@@ -1769,8 +1771,8 @@ with a brace block."
1769 (interactive) 1771 (interactive)
1770 (c-save-buffer-state 1772 (c-save-buffer-state
1771 (beginning-of-defun-function end-of-defun-function 1773 (beginning-of-defun-function end-of-defun-function
1772 where pos name-end) 1774 where pos name-end case-fold-search)
1773 1775
1774 (save-restriction 1776 (save-restriction
1775 (widen) 1777 (widen)
1776 (save-excursion 1778 (save-excursion
@@ -1969,7 +1971,7 @@ As opposed to \\[c-beginning-of-defun] and \\[c-end-of-defun], this
1969function does not require the declaration to contain a brace block." 1971function does not require the declaration to contain a brace block."
1970 (interactive) 1972 (interactive)
1971 1973
1972 (let (decl-limits) 1974 (let (decl-limits case-fold-search)
1973 (c-save-buffer-state nil 1975 (c-save-buffer-state nil
1974 ;; We try to be line oriented, unless there are several 1976 ;; We try to be line oriented, unless there are several
1975 ;; declarations on the same line. 1977 ;; declarations on the same line.
@@ -2001,11 +2003,12 @@ function does not require the declaration to contain a brace block."
2001(defun c-cpp-define-name () 2003(defun c-cpp-define-name ()
2002 "Return the name of the current CPP macro, or NIL if we're not in one." 2004 "Return the name of the current CPP macro, or NIL if we're not in one."
2003 (interactive) 2005 (interactive)
2004 (save-excursion 2006 (let (case-fold-search)
2005 (and c-opt-cpp-macro-define-start 2007 (save-excursion
2006 (c-beginning-of-macro) 2008 (and c-opt-cpp-macro-define-start
2007 (looking-at c-opt-cpp-macro-define-start) 2009 (c-beginning-of-macro)
2008 (match-string-no-properties 1)))) 2010 (looking-at c-opt-cpp-macro-define-start)
2011 (match-string-no-properties 1)))))
2009 2012
2010 2013
2011;; Movement by statements. 2014;; Movement by statements.
@@ -2888,7 +2891,8 @@ See `c-indent-comment-alist' for a description."
2888 (eq (match-end 0) eot)) 2891 (eq (match-end 0) eot))
2889 'cpp-end-block) 2892 'cpp-end-block)
2890 (t 2893 (t
2891 'other)))) 2894 'other)))
2895 case-fold-search)
2892 (if (and (memq line-type '(anchored-comment empty-line)) 2896 (if (and (memq line-type '(anchored-comment empty-line))
2893 c-indent-comments-syntactically-p) 2897 c-indent-comments-syntactically-p)
2894 (let ((c-syntactic-context (c-guess-basic-syntax))) 2898 (let ((c-syntactic-context (c-guess-basic-syntax)))
@@ -3024,7 +3028,7 @@ are treated as conditional clause limits. Normally they are ignored."
3024 (let* ((forward (> count 0)) 3028 (let* ((forward (> count 0))
3025 (increment (if forward -1 1)) 3029 (increment (if forward -1 1))
3026 (search-function (if forward 're-search-forward 're-search-backward)) 3030 (search-function (if forward 're-search-forward 're-search-backward))
3027 new) 3031 new case-fold-search)
3028 (unless (integerp target-depth) 3032 (unless (integerp target-depth)
3029 (setq target-depth (if target-depth -1 0))) 3033 (setq target-depth (if target-depth -1 0)))
3030 (save-excursion 3034 (save-excursion
@@ -3226,7 +3230,7 @@ balanced expression is found."
3226In the macro case this also has the effect of realigning any line 3230In the macro case this also has the effect of realigning any line
3227continuation backslashes, unless `c-auto-align-backslashes' is nil." 3231continuation backslashes, unless `c-auto-align-backslashes' is nil."
3228 (interactive "*") 3232 (interactive "*")
3229 (let ((here (point-marker)) decl-limits) 3233 (let ((here (point-marker)) decl-limits case-fold-search)
3230 (unwind-protect 3234 (unwind-protect
3231 (progn 3235 (progn
3232 (c-save-buffer-state nil 3236 (c-save-buffer-state nil
@@ -4638,7 +4642,8 @@ inside a preprocessor directive."
4638 4642
4639 (interactive "*") 4643 (interactive "*")
4640 (let* (c-lit-limits c-lit-type 4644 (let* (c-lit-limits c-lit-type
4641 (c-macro-start c-macro-start)) 4645 (c-macro-start c-macro-start)
4646 case-fold-search)
4642 4647
4643 (c-save-buffer-state () 4648 (c-save-buffer-state ()
4644 (setq c-lit-limits (c-literal-limits nil nil t) 4649 (setq c-lit-limits (c-literal-limits nil nil t)
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 7c018feefbb..ff18f56bbe8 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1170,10 +1170,10 @@ Note that the style variables are always made local to the buffer."
1170 ;; 1170 ;;
1171 ;; 1171 ;;
1172 ;; void myfunc(T* p) {} 1172 ;; void myfunc(T* p) {}
1173 ;; 1173 ;;
1174 ;; Type a space in the first blank line, and the fontification of the next 1174 ;; Type a space in the first blank line, and the fontification of the next
1175 ;; line was fouled up by context fontification. 1175 ;; line was fouled up by context fontification.
1176 (let ((new-beg beg) (new-end end) new-region) 1176 (let ((new-beg beg) (new-end end) new-region case-fold-search)
1177 (if c-in-after-change-fontification 1177 (if c-in-after-change-fontification
1178 (setq c-in-after-change-fontification nil) 1178 (setq c-in-after-change-fontification nil)
1179 (save-restriction 1179 (save-restriction