diff options
Diffstat (limited to 'lisp/progmodes/ada-mode.el')
-rw-r--r-- | lisp/progmodes/ada-mode.el | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index c9aba0a50d1..4a4e1a7aad4 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el @@ -2,10 +2,10 @@ ;; Copyright (C) 1994-1995, 1997-2019 Free Software Foundation, Inc. -;; Author: Rolf Ebert <ebert@inf.enst.fr> +;; Author: Rolf Ebert <ebert@inf.enst.fr> ;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de> ;; Emmanuel Briot <briot@gnat.com> -;; Maintainer: Stephen Leake <stephen_leake@member.fsf.org> +;; Maintainer: Stephen Leake <stephen_leake@stephe-leake.org> ;; Keywords: languages ada ;; Version: 4.0 @@ -768,7 +768,7 @@ the 4 file locations can be clicked on and jumped to." (interactive "d") (goto-char pos) - (skip-chars-backward "-a-zA-Z0-9_:./\\") + (skip-chars-backward "-a-zA-Z0-9_:./\\\\") (cond ;; special case: looking at a filename:line not at the beginning of a line ;; or a simple line reference "at line ..." @@ -910,7 +910,7 @@ the 4 file locations can be clicked on and jumped to." change)) (replace-match "'A'")) (goto-char from) - (while (re-search-forward "\\(#[0-9a-fA-F]*#\\)" to t) + (while (re-search-forward "\\(#[[:xdigit:]]*#\\)" to t) (setq change (cons (list (match-beginning 1) (length (match-string 1)) (match-string 1)) @@ -1014,7 +1014,7 @@ If PARSE-RESULT is non-nil, use it instead of calling `parse-partial-sexp'." (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_]+\\)" (line-beginning-position))) + (looking-back "\\([0-9]+#[[:xdigit:]_]+\\)" (line-beginning-position))) ;;------------------------------------------------------------------ ;; Contextual menus @@ -4520,6 +4520,7 @@ Moves to `begin' if in a declarative part." (define-key ada-mode-map "\C-c\C-n" 'ada-make-subprogram-body) ;; Use predefined function of Emacs19 for comments (RE) + ;; FIXME: Made redundant with Emacs-21's standard comment-dwim binding on M-; (define-key ada-mode-map "\C-c;" 'comment-region) (define-key ada-mode-map "\C-c:" 'ada-uncomment-region) @@ -4757,16 +4758,17 @@ Moves to `begin' if in a declarative part." ;; function for justifying the comments. ;; ------------------------------------------------------- -(defadvice comment-region (before ada-uncomment-anywhere disable) - (if (and (consp arg) ;; a prefix with \C-u is of the form '(4), whereas - ;; \C-u 2 sets arg to '2' (fixed by S.Leake) - (derived-mode-p 'ada-mode)) - (save-excursion - (let ((cs (concat "^[ \t]*" (regexp-quote comment-start)))) - (goto-char beg) - (while (re-search-forward cs end t) - (replace-match comment-start)) - )))) +(when (or (<= emacs-major-version 20) (featurep 'xemacs)) + (defadvice comment-region (before ada-uncomment-anywhere disable) + (if (and (consp arg) ;; a prefix with \C-u is of the form '(4), whereas + ;; \C-u 2 sets arg to '2' (fixed by S.Leake) + (derived-mode-p 'ada-mode)) + (save-excursion + (let ((cs (concat "^[ \t]*" (regexp-quote comment-start)))) + (goto-char beg) + (while (re-search-forward cs end t) + (replace-match comment-start)) + ))))) (defun ada-uncomment-region (beg end &optional arg) "Uncomment region BEG .. END. @@ -5212,7 +5214,7 @@ Return nil if no body was found." '("<<\\(\\sw+\\)>>" 1 font-lock-constant-face) ;; Highlight based-numbers (R. Reagan <robin-reply@reagans.org>) - (list "\\([0-9]+#[0-9a-fA-F_]+#\\)" '(1 font-lock-constant-face t)) + (list "\\([0-9]+#[[:xdigit:]_]+#\\)" '(1 font-lock-constant-face t)) ;; Ada unnamed numerical constants (list "\\W\\([-+]?[0-9._]+\\)\\>" '(1 font-lock-constant-face)) |