Georg Bauhaus <[email protected]> writes:

> $ /Applications/Emacs.app/Contents/MacOS/Emacs-10.7 -Q \
>   -L ~/src/pure/org.emacs.ada-mode
>
> loaded a.ads (which is Ludovic's unit, the sole entity in the
>     current directory)
>
> M-x ff-find-other-file.
>
> Loading 
> /Applications/Emacs.app/Contents/Resources/lisp/cedet/semantic/wisent/comp.el.gz...
> uncompressing comp.el.gz...done
> Loading 
> /Applications/Emacs.app/Contents/Resources/lisp/cedet/semantic/wisent/comp.el.gz...done
> Working...
> ff-list-replace-env-vars: Wrong type argument: stringp, nil

This is because ff-search-directories is set to
'compilation-search-path, which has the default value of '(nil), which
is supposed to mean "current directory" (see the doc string for
compilation-search-path). So it's a bug in ff-list-replace-env-vars; it
should handle this value. Or, it's a bug in ada-mode; we should not set
ff-search-directories to compilation-search-path.

We should have ada-mode replace nil with the actual current directory.
That fixes this prolem.

here's a patch for this and the previous bug:

#
# old_revision [c570df17b4e1d2234a1a30a12106ebefff381a7c]
#
# patch "ada-mode.el"
#  from [da7274b40a4e10086ec62dea594529d6a9e83eba]
#    to [c1769814d8f02680095640501a62b237d9e02ad7]
#
============================================================
--- ada-mode.el da7274b40a4e10086ec62dea594529d6a9e83eba
+++ ada-mode.el c1769814d8f02680095640501a62b237d9e02ad7
@@ -1838,8 +1838,10 @@ previously set by a file navigation comm
       ;; This will still be confused by multiple references; we need
       ;; to use compiler cross reference info for more precision.
       (while (not done)
-       (when (search-forward-regexp ff-function-name nil t)
-         (setq found (match-beginning 0)))
+       (if (search-forward-regexp ff-function-name nil t)
+           (setq found (match-beginning 0))
+         ;; not in remainder of buffer
+         (setq done t))
        (if (ada-in-string-or-comment-p)
            (setq found nil)
          (setq done t)))
@@ -2635,6 +2637,9 @@ The paragraph is indented on the first l
        ff-file-created-hook 'ada-ff-create-body)
   (add-hook 'ff-pre-load-hook 'ada-which-function)
   (setq ff-search-directories 'compilation-search-path)
+  (when (null (car compilation-search-path))
+    ;; find-file doesn't handle nil in search path
+    (setq compilation-search-path (list (file-name-directory 
(buffer-file-name)))))
   (ada-set-ff-special-constructs)
 
   (set (make-local-variable 'add-log-current-defun-function)

> Typing C-c C-c (compiling the spec) and repeating
> M-x ff-find-other-file mostly fixes this part 

This apparently sets compilation-search-path to something more
reasonable; I did not investigate. Loading an Ada mode project will also
set it.

-- 
-- Stephe

_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to