(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)
;; 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.