# HG changeset patch # User Chong Yidong # Date 1265671649 18000 # Node ID bb513dfefeafa0f9557ce7f966fcfb3202cd72bc # Parent 759400918e76f4e0dfd02de5f502c3861dcf50df Fix ada-mode handling of number literals. * progmodes/ada-mode.el (ada-in-numeric-literal-p): New function. (ada-adjust-case): Don't adjust case in hexadecimal number literals. diff -r 759400918e76 -r bb513dfefeaf lisp/ChangeLog --- a/lisp/ChangeLog Mon Feb 08 09:11:15 2010 -0800 +++ b/lisp/ChangeLog Mon Feb 08 18:27:29 2010 -0500 @@ -1,3 +1,9 @@ +2010-02-08 Jose E. Marchesi + + * progmodes/ada-mode.el (ada-in-numeric-literal-p): New function. + (ada-adjust-case): Don't adjust case in hexadecimal number + literals. + 2010-02-08 Kenichi Handa * international/mule-util.el (with-coding-priority): Add autoload diff -r 759400918e76 -r bb513dfefeaf lisp/progmodes/ada-mode.el --- a/lisp/progmodes/ada-mode.el Mon Feb 08 09:11:15 2010 -0800 +++ b/lisp/progmodes/ada-mode.el Mon Feb 08 18:27:29 2010 -0500 @@ -1017,6 +1017,9 @@ (line-beginning-position) (point)))) (or (ada-in-string-p parse-result) (ada-in-comment-p parse-result))) +(defsubst ada-in-numeric-literal-p () + "Return t if point is after a prefix of a numeric literal." + (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)")) ;;------------------------------------------------------------------ ;; Contextual menus @@ -1606,6 +1609,8 @@ (eq (char-syntax (char-before)) ?w) ;; if in a string or a comment (not (ada-in-string-or-comment-p)) + ;; if in a numeric literal + (not (ada-in-numeric-literal-p)) ) (if (save-excursion (forward-word -1)