#
# old_revision [ac436f7dc3636f89df3a9e715b6980e182676002]
#
# patch "ada-mode.el"
#  from [2c087d7b74cde1903cd8af3d00e01f5f7e656620]
#    to [af8b5131b13590d2d182c52e2ca4e754989fc32f]
#
============================================================
--- ada-mode.el	2c087d7b74cde1903cd8af3d00e01f5f7e656620
+++ ada-mode.el	af8b5131b13590d2d182c52e2ca4e754989fc32f
@@ -217,6 +217,17 @@ preserved when the list is written back 
   :group 'ada
   :safe  'listp)
 
+(defcustom ada-case-partial-exceptions-always t
+  "When adjusting case, all occurrences of partial words are to be replaced.
+If nil, the word is adjusted following the rule of title case.
+Occurrences at the start or end of a word will then not be case
+adjusted using exceptions dictionaries.  They will have letter
+case according to `ada-case-identifer'."
+  :type 'boolean
+  :group 'ada
+  :safe  'booleanp)
+(make-variable-buffer-local 'ada-case-partial-exceptions-always)
+
 (defcustom ada-case-keyword 'downcase-word
   "Buffer-local value that may override project variable `case_keyword'.
 Global value is default for project variable `case_keyword'.
@@ -1091,11 +1102,13 @@ Uses `ada-case-identifier', with excepti
   (interactive)
   (save-excursion
     (let ((end   (point-marker))
-	  (start (progn (skip-syntax-backward "w_") (point)))
+	  (first (progn (skip-syntax-backward "w_") (point)))
 	  match
+	  start
 	  next
 	  (done nil))
 
+      (setq start first)
       (if (setq match (assoc-string (buffer-substring-no-properties start end) ada-case-full-exceptions t))
 	  ;; full word exception
 	  (progn
@@ -1121,8 +1134,9 @@ Uses `ada-case-identifier', with excepti
 					ada-case-partial-exceptions t))
 	    ;; see comment above at 'full word exception' for why
 	    ;; we do insert first.
-	    (insert (car match))
-	    (delete-region (point) (1- next)))
+	    (when (or ada-case-partial-exceptions-always (not (or (= (point) first) (= next (1+ end)))))
+	      (insert (car match))
+	      (delete-region (point) (1- next))))
 
 	  (goto-char next)
 	  (if (< (point) end)
