diff options
| author | Thien-Thi Nguyen | 2006-07-16 21:12:46 +0000 |
|---|---|---|
| committer | Thien-Thi Nguyen | 2006-07-16 21:12:46 +0000 |
| commit | 072cb54a86df049efc2eb6669b1427807a058c2b (patch) | |
| tree | 1c7ad08383ca7e092e6fa6031f323189b89e2187 | |
| parent | 7365aa8be1aec39f60512f7b84262f5e022f63cf (diff) | |
| download | emacs-072cb54a86df049efc2eb6669b1427807a058c2b.tar.gz emacs-072cb54a86df049efc2eb6669b1427807a058c2b.zip | |
(ada-mode): Rewrite ff-special-constructs init.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/progmodes/ada-mode.el | 82 |
2 files changed, 39 insertions, 53 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b67abf8e294..2aa9500a9ec 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2006-07-16 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 2 | |||
| 3 | * find-file.el (ff-special-constructs): Doc fix. Also, for C/C++ | ||
| 4 | entry, don't assign to free var; simply return the extracted filename. | ||
| 5 | (ff-treat-as-special): Incorporate common preamble from callers. | ||
| 6 | (ff-other-file-name, ff-find-the-other-file): | ||
| 7 | Update call to ff-treat-as-special. | ||
| 8 | |||
| 9 | * progmodes/ada-mode.el (ada-mode): Rewrite ff-special-constructs init. | ||
| 10 | |||
| 1 | 2006-07-16 Mathias Dahl <mathias.dahl@gmail.com> | 11 | 2006-07-16 Mathias Dahl <mathias.dahl@gmail.com> |
| 2 | 12 | ||
| 3 | * tumme.el (tumme-get-comment): Fix bug. | 13 | * tumme.el (tumme-get-comment): Fix bug. |
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index 9dc74264da8..bc00d859c2d 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el | |||
| @@ -1208,60 +1208,36 @@ If you use ada-xref.el: | |||
| 1208 | ff-file-created-hook 'ada-make-body) | 1208 | ff-file-created-hook 'ada-make-body) |
| 1209 | (add-hook 'ff-pre-load-hook 'ada-which-function-are-we-in) | 1209 | (add-hook 'ff-pre-load-hook 'ada-which-function-are-we-in) |
| 1210 | 1210 | ||
| 1211 | ;; Some special constructs for find-file.el | 1211 | ;; Some special constructs for find-file.el. |
| 1212 | ;; We do not need to add the construction for 'with', which is in the | ||
| 1213 | ;; standard find-file.el | ||
| 1214 | (make-local-variable 'ff-special-constructs) | 1212 | (make-local-variable 'ff-special-constructs) |
| 1215 | 1213 | (mapc (lambda (pair) | |
| 1216 | ;; Go to the parent package : | 1214 | (add-to-list 'ff-special-constructs pair)) |
| 1217 | (add-to-list 'ff-special-constructs | 1215 | `( |
| 1218 | (cons (eval-when-compile | 1216 | ;; Go to the parent package. |
| 1219 | (concat "^\\(private[ \t]\\)?[ \t]*package[ \t]+" | 1217 | (,(eval-when-compile |
| 1220 | "\\(body[ \t]+\\)?" | 1218 | (concat "^\\(private[ \t]\\)?[ \t]*package[ \t]+" |
| 1221 | "\\(\\(\\sw\\|[_.]\\)+\\)\\.\\(\\sw\\|_\\)+[ \t\n]+is")) | 1219 | "\\(body[ \t]+\\)?" |
| 1222 | (lambda () | 1220 | "\\(\\(\\sw\\|[_.]\\)+\\)\\.\\(\\sw\\|_\\)+[ \t\n]+is")) |
| 1223 | (if (fboundp 'ff-get-file) | 1221 | . ,(lambda () |
| 1224 | (if (boundp 'fname) | 1222 | (ff-get-file |
| 1225 | (set 'fname (ff-get-file | 1223 | ada-search-directories-internal |
| 1226 | ada-search-directories-internal | 1224 | (ada-make-filename-from-adaname (match-string 3)) |
| 1227 | (ada-make-filename-from-adaname | 1225 | ada-spec-suffixes))) |
| 1228 | (match-string 3)) | 1226 | ;; A "separate" clause. |
| 1229 | ada-spec-suffixes))))))) | 1227 | ("^separate[ \t\n]*(\\(\\(\\sw\\|[_.]\\)+\\))" |
| 1230 | ;; Another special construct for find-file.el : when in a separate clause, | 1228 | . ,(lambda () |
| 1231 | ;; go to the correct package. | 1229 | (ff-get-file |
| 1232 | (add-to-list 'ff-special-constructs | 1230 | ada-search-directories-internal |
| 1233 | (cons "^separate[ \t\n]*(\\(\\(\\sw\\|[_.]\\)+\\))" | 1231 | (ada-make-filename-from-adaname (match-string 1)) |
| 1234 | (lambda () | 1232 | ada-spec-suffixes))) |
| 1235 | (if (fboundp 'ff-get-file) | 1233 | ;; A "with" clause. |
| 1236 | (if (boundp 'fname) | 1234 | ("^with[ \t]+\\([a-zA-Z0-9_\\.]+\\)" |
| 1237 | (setq fname (ff-get-file | 1235 | . ,(lambda () |
| 1238 | ada-search-directories-internal | 1236 | (ff-get-file |
| 1239 | (ada-make-filename-from-adaname | 1237 | ada-search-directories-internal |
| 1240 | (match-string 1)) | 1238 | (ada-make-filename-from-adaname (match-string 1)) |
| 1241 | ada-spec-suffixes))))))) | 1239 | ada-spec-suffixes))) |
| 1242 | 1240 | )) | |
| 1243 | ;; Another special construct, that redefines the one in find-file.el. The | ||
| 1244 | ;; old one can handle only one possible type of extension for Ada files | ||
| 1245 | ;; remove from the list the standard "with..." that is put by find-file.el, | ||
| 1246 | ;; since it uses the old ada-spec-suffix variable | ||
| 1247 | ;; This one needs to replace the standard one defined in find-file.el (with | ||
| 1248 | ;; Emacs <= 20.4), since that one uses the old variable ada-spec-suffix | ||
| 1249 | (let ((old-construct | ||
| 1250 | (assoc "^with[ \t]+\\([a-zA-Z0-9_\\.]+\\)" ff-special-constructs)) | ||
| 1251 | (new-cdr | ||
| 1252 | (lambda () | ||
| 1253 | (if (fboundp 'ff-get-file) | ||
| 1254 | (if (boundp 'fname) | ||
| 1255 | (set 'fname (ff-get-file | ||
| 1256 | ada-search-directories-internal | ||
| 1257 | (ada-make-filename-from-adaname | ||
| 1258 | (match-string 1)) | ||
| 1259 | ada-spec-suffixes))))))) | ||
| 1260 | (if old-construct | ||
| 1261 | (setcdr old-construct new-cdr) | ||
| 1262 | (add-to-list 'ff-special-constructs | ||
| 1263 | (cons "^with[ \t]+\\([a-zA-Z0-9_\\.]+\\)" | ||
| 1264 | new-cdr)))) | ||
| 1265 | 1241 | ||
| 1266 | ;; Support for outline-minor-mode | 1242 | ;; Support for outline-minor-mode |
| 1267 | (set (make-local-variable 'outline-regexp) | 1243 | (set (make-local-variable 'outline-regexp) |