ada-mode-users
[Top][All Lists]
Advanced

[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: Thu, 26 Aug 2021 09:58:44 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt)

Manuel Gómez <mgrojo@gmail.com> writes:

> I've playing with Alire and configured the edit command to use emacs
> but the simplest approach is only opening the file:
>
> $ alr config editor.cmd
> editor.cmd=emacs ${GPR_FILE}
>
> Is there a way from the command line to load that GPR file?
> I've tried some variations of this which have all failed:
>
> emacs --eval '(progn (require '\''ada-mode) (ada-build-default-prj
> '\''project.gpr))'

This should work:

emacs  --eval "(progn (require 'ada-mode)(wisi-prj-select-file \"wisi.gpr\" 
(ada-prj-default \"nickname\")))"

ada-prj-default is mentioned in an example in ada-mode.info, but not
defined in the project files section; I'll add that. It is required to
declare that this is an ada-mode project.

wisi-prj-select-file and related functions are defined in the wisi.info
project files section. It is required to create the actual project.

I use a small elisp file for this sort of thing. For example:

-----------------
;; Emacs wisi project definitions for compiling ada-mode in ELPA workspace
;;
;; Copyright (C) 2021  Free Software Foundation, Inc.

(let ((wisi-core (expand-file-name "../wisi")))

  (wisi-prj-select-cache
   "ada_mode.prj"
   (wisi-prj-default ;; for ada-build prj vars
    (create-ada-prj
    :name "ada_mode elpa"
    :compile-env
    (list
     (concat "WISI=" wisi-core))))
   "Makefile"
   ))

------------------

That allows declaring dependent libs, environment variables, etc.

-- 
-- Stephe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]