# HG changeset patch # User Juanma Barranquero # Date 1052078040 0 # Node ID d29943b8f8298fd3a6c2b0ca20d4743b4a1a87be # Parent 10d1a300112780bbf2b3198d2a7cc022ad1d8669 (uniquify-buffer-name-style, uniquify-after-kill-buffer-p) (uniquify-ask-about-buffer-names-p, uniquify-ignore-buffers-re) (uniquify-min-dir-content, uniquify-separator, uniquify-trailing-separator-p): Remove redundant group specification. (uniquify-file-name-nondirectory): Delete. (uniquify-rationalize-file-buffer-names): Simplify. Use directory names as `filename' component of uniquify-item. (uniquify-get-proposed-name): Adjust now that `filename' does not include `base'. diff -r 10d1a3001127 -r d29943b8f829 lisp/progmodes/ada-xref.el --- a/lisp/progmodes/ada-xref.el Sun May 04 19:30:19 2003 +0000 +++ b/lisp/progmodes/ada-xref.el Sun May 04 19:54:00 2003 +0000 @@ -44,6 +44,8 @@ (require 'compile) (require 'comint) +(require 'find-file) +(require 'ada-mode) ;; ------ Use variables (defcustom ada-xref-other-buffer t @@ -515,7 +517,7 @@ ;; one (in case ada-xref-project-files is nil) (or ada-xref-project-files '(nil))) - (if (not ada-xemacs) + (if (not (featurep 'xemacs)) (if (lookup-key ada-mode-map [menu-bar Ada Project]) (setcdr (lookup-key ada-mode-map [menu-bar Ada Project]) submenu))) @@ -726,61 +728,61 @@ (let* ((buffer (run-hook-with-args-until-success 'ada-load-project-hook prj-file))) (unless buffer - (setq buffer (find-file-noselect prj-file nil))) - (set-buffer buffer)) + (setq buffer (find-file-noselect prj-file nil))) + (set-buffer buffer)) - (widen) - (goto-char (point-min)) + (widen) + (goto-char (point-min)) - ;; Now overrides these values with the project file - (while (not (eobp)) - (if (looking-at "^\\([^=]+\\)=\\(.*\\)") - (cond - ((string= (match-string 1) "src_dir") - (add-to-list 'src_dir - (file-name-as-directory (match-string 2)))) - ((string= (match-string 1) "obj_dir") - (add-to-list 'obj_dir - (file-name-as-directory (match-string 2)))) - ((string= (match-string 1) "casing") - (set 'casing (cons (match-string 2) casing))) - ((string= (match-string 1) "build_dir") - (set 'project - (plist-put project 'build_dir - (file-name-as-directory (match-string 2))))) - ((string= (match-string 1) "make_cmd") - (add-to-list 'make_cmd (match-string 2))) - ((string= (match-string 1) "comp_cmd") - (add-to-list 'comp_cmd (match-string 2))) - ((string= (match-string 1) "check_cmd") - (add-to-list 'check_cmd (match-string 2))) - ((string= (match-string 1) "run_cmd") - (add-to-list 'run_cmd (match-string 2))) - ((string= (match-string 1) "debug_pre_cmd") - (add-to-list 'debug_pre_cmd (match-string 2))) - ((string= (match-string 1) "debug_post_cmd") - (add-to-list 'debug_post_cmd (match-string 2))) - (t - (set 'project (plist-put project (intern (match-string 1)) - (match-string 2)))))) - (forward-line 1)) + ;; Now overrides these values with the project file + (while (not (eobp)) + (if (looking-at "^\\([^=]+\\)=\\(.*\\)") + (cond + ((string= (match-string 1) "src_dir") + (add-to-list 'src_dir + (file-name-as-directory (match-string 2)))) + ((string= (match-string 1) "obj_dir") + (add-to-list 'obj_dir + (file-name-as-directory (match-string 2)))) + ((string= (match-string 1) "casing") + (set 'casing (cons (match-string 2) casing))) + ((string= (match-string 1) "build_dir") + (set 'project + (plist-put project 'build_dir + (file-name-as-directory (match-string 2))))) + ((string= (match-string 1) "make_cmd") + (add-to-list 'make_cmd (match-string 2))) + ((string= (match-string 1) "comp_cmd") + (add-to-list 'comp_cmd (match-string 2))) + ((string= (match-string 1) "check_cmd") + (add-to-list 'check_cmd (match-string 2))) + ((string= (match-string 1) "run_cmd") + (add-to-list 'run_cmd (match-string 2))) + ((string= (match-string 1) "debug_pre_cmd") + (add-to-list 'debug_pre_cmd (match-string 2))) + ((string= (match-string 1) "debug_post_cmd") + (add-to-list 'debug_post_cmd (match-string 2))) + (t + (set 'project (plist-put project (intern (match-string 1)) + (match-string 2)))))) + (forward-line 1)) - (if src_dir (set 'project (plist-put project 'src_dir - (reverse src_dir)))) - (if obj_dir (set 'project (plist-put project 'obj_dir - (reverse obj_dir)))) - (if casing (set 'project (plist-put project 'casing - (reverse casing)))) - (if make_cmd (set 'project (plist-put project 'make_cmd - (reverse make_cmd)))) - (if comp_cmd (set 'project (plist-put project 'comp_cmd - (reverse comp_cmd)))) - (if check_cmd (set 'project (plist-put project 'check_cmd - (reverse check_cmd)))) - (if run_cmd (set 'project (plist-put project 'run_cmd - (reverse run_cmd)))) - (set 'project (plist-put project 'debug_post_cmd - (reverse debug_post_cmd))) + (if src_dir (set 'project (plist-put project 'src_dir + (reverse src_dir)))) + (if obj_dir (set 'project (plist-put project 'obj_dir + (reverse obj_dir)))) + (if casing (set 'project (plist-put project 'casing + (reverse casing)))) + (if make_cmd (set 'project (plist-put project 'make_cmd + (reverse make_cmd)))) + (if comp_cmd (set 'project (plist-put project 'comp_cmd + (reverse comp_cmd)))) + (if check_cmd (set 'project (plist-put project 'check_cmd + (reverse check_cmd)))) + (if run_cmd (set 'project (plist-put project 'run_cmd + (reverse run_cmd)))) + (set 'project (plist-put project 'debug_post_cmd + (reverse debug_post_cmd))) (set 'project (plist-put project 'debug_pre_cmd (reverse debug_pre_cmd))) @@ -833,7 +835,7 @@ ;; Add the directories to the search path for ff-find-other-file ;; Do not add the '/' or '\' at the end - (setq ada-search-directories + (setq ada-search-directories-internal (append (mapcar 'directory-file-name compilation-search-path) ada-search-directories)) @@ -905,7 +907,7 @@ (concat "'\"" (substring entity 1 -1) "\"'")) entity)) (switches (ada-xref-get-project-field 'gnatfind_opt)) - (command (concat "gnatfind " switches " " + (command (concat "gnat find " switches " " quote-entity (if file (concat ":" (file-name-nondirectory file))) (if line (concat ":" line)) @@ -917,7 +919,10 @@ ;; If a project file is defined, use it (if (and ada-prj-default-project-file (not (string= ada-prj-default-project-file ""))) - (setq command (concat command " -p" ada-prj-default-project-file))) + (if (string-equal (file-name-extension ada-prj-default-project-file) + "gpr") + (setq command (concat command " -P" ada-prj-default-project-file)) + (setq command (concat command " -p" ada-prj-default-project-file)))) (if (and append (get-buffer "*gnatfind*")) (save-excursion @@ -2231,9 +2236,8 @@ "Function called by `ada-mode-hook' to initialize the ada-xref.el package. For instance, it creates the gnat-specific menus, sets some hooks for find-file...." - (make-local-hook 'ff-file-created-hooks) ;; This should really be an `add-hook'. -stef - (setq ff-file-created-hooks 'ada-make-body-gnatstub) + (setq ff-file-created-hook 'ada-make-body-gnatstub) ;; Completion for file names in the mini buffer should ignore .ali files (add-to-list 'completion-ignored-extensions ".ali") @@ -2263,7 +2267,7 @@ (ada-initialize-runtime-library "") ;; Add these standard directories to the search path -(set 'ada-search-directories +(set 'ada-search-directories-internal (append (mapcar 'directory-file-name ada-xref-runtime-library-specs-path) ada-search-directories))