[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Selecting a project from the command line
From: |
Stephen Leake |
Subject: |
Re: Selecting a project from the command line |
Date: |
Wed, 01 Sep 2021 13:59:14 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt) |
Manuel Gómez <mgrojo@gmail.com> writes:
> Am 26/8/21 um 18:58 schrieb Stephen Leake:
>> Manuel Gómez <mgrojo@gmail.com> writes:
>>>
>>> Is there a way from the command line to load that GPR file?
>> This should work:
>> emacs --eval "(progn (require 'ada-mode)(wisi-prj-select-file
>> \"wisi.gpr\" (ada-prj-default \"nickname\")))"
>
> That failed for me with this message:
>
> wisi-prj-select-file used without wisi-prj-current-parse in
> project-find-functions
>
> Then I tried:
>
> emacs --eval "(progn (setq project-find-functions
> '(wisi-prj-current-parse))(require 'ada-mode)(wisi-prj-select-file
> \"project.gpr\" (ada-prj-default \"nickname\")))"
>
> Which silenced the message, but the project doesn't seem to be loaded.
> Navigation works, but not C-c C-c. No "WisiPrj Select" menu entry, and
> "Ada > Project files > Show project" says "wisi-prj-show: Wrong type
> argument: wisi-prj, nil"
You only get the "WisiPrj Select" menu when you use
wisi-prj-select-cache; you are using -select-parse.
This works, with emacs -Q:
(progn
(package-initialize)
(require 'wisi-prj)
(setq project-find-functions '(wisi-prj-current-parse))
(wisi-prj-parse-file :prj-file "hello.gpr" :init-prj (ada-prj-default))
(wisi-prj-select-file "hello.gpr" (ada-prj-default))
)
You don't need package-initialize if running 'emacs' without -Q.
Note that you don't need (require 'ada-mode); there are auto-loads in
the right places in ada-mode. However, there is not an auto-load on
wisi-prj-parse-file (because you are not supposed to have to do this),
which is why you need (require 'wisi-prj).
I'll see if I can come up with a small fix to make my first suggestion
work.
--
-- Stephe
- Re: Selecting a project from the command line,
Stephen Leake <=