Mercurial > emacs
comparison lisp/progmodes/ada-xref.el @ 91239:2fcaae6177a5
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-300
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sun, 16 Dec 2007 05:08:49 +0000 |
parents | 4b09bb044f38 ac7eee19fc7e |
children | 606f2d163a64 |
comparison
equal
deleted
inserted
replaced
91238:5cf14a2107b5 | 91239:2fcaae6177a5 |
---|---|
562 (interactive | 562 (interactive |
563 (list (completing-read "File: " 'ada-do-file-completion))) | 563 (list (completing-read "File: " 'ada-do-file-completion))) |
564 (let ((file (ada-find-src-file-in-dir filename))) | 564 (let ((file (ada-find-src-file-in-dir filename))) |
565 (if file | 565 (if file |
566 (find-file file) | 566 (find-file file) |
567 (error (concat filename " not found in src_dir"))))) | 567 (error "%s not found in src_dir" filename)))) |
568 | 568 |
569 | 569 |
570 ;; ----- Utilities ------------------------------------------------- | 570 ;; ----- Utilities ------------------------------------------------- |
571 | 571 |
572 (defun ada-require-project-file () | 572 (defun ada-require-project-file () |
1720 (if (ada-xref-find-in-modified-ali identlist) | 1720 (if (ada-xref-find-in-modified-ali identlist) |
1721 (set 'declaration-found t) | 1721 (set 'declaration-found t) |
1722 ;; No more idea to find the declaration. Give up | 1722 ;; No more idea to find the declaration. Give up |
1723 (progn | 1723 (progn |
1724 (kill-buffer ali-buffer) | 1724 (kill-buffer ali-buffer) |
1725 (error (concat "No declaration of " (ada-name-of identlist) | 1725 |
1726 " found.")) | 1726 (error "No declaration of %s found." (ada-name-of identlist)) |
1727 ))) | 1727 ))) |
1728 ) | 1728 ) |
1729 | 1729 |
1730 | 1730 |
1731 ;; Now that we have found a suitable line in the .ali file, get the | 1731 ;; Now that we have found a suitable line in the .ali file, get the |
1806 (setq len (length declist)) | 1806 (setq len (length declist)) |
1807 (cond | 1807 (cond |
1808 ;; none => error | 1808 ;; none => error |
1809 ((= len 0) | 1809 ((= len 0) |
1810 (kill-buffer (current-buffer)) | 1810 (kill-buffer (current-buffer)) |
1811 (error (concat "No declaration of " | 1811 (error "No declaration of %s recorded in .ali file" |
1812 (ada-name-of identlist) | 1812 (ada-name-of identlist))) |
1813 " recorded in .ali file"))) | |
1814 | |
1815 ;; one => should be the right one | 1813 ;; one => should be the right one |
1816 ((= len 1) | 1814 ((= len 1) |
1817 (goto-line (caar declist))) | 1815 (goto-line (caar declist))) |
1818 | 1816 |
1819 ;; more than one => display choice list | 1817 ;; more than one => display choice list |
2009 (ada-xref-change-buffer file | 2007 (ada-xref-change-buffer file |
2010 (string-to-number (nth 1 (car list))) | 2008 (string-to-number (nth 1 (car list))) |
2011 (string-to-number (nth 2 (car list))) | 2009 (string-to-number (nth 2 (car list))) |
2012 identlist | 2010 identlist |
2013 other-frame) | 2011 other-frame) |
2014 (error (concat (caar list) " not found in src_dir"))) | 2012 (error "%s not found in src_dir" (caar list))) |
2015 (message "This is only a (good) guess at the cross-reference.") | 2013 (message "This is only a (good) guess at the cross-reference.") |
2016 ) | 2014 ) |
2017 | 2015 |
2018 ;; Else, ask the user | 2016 ;; Else, ask the user |
2019 (t | 2017 (t |