General notes on Emacs Ada mode

build/Makefile

o.e.a: release, in use
o.e.a.stephe-1: dead
o.e.a.stephe-2 (from o.e.a with o.w.s-1, o.s_l.s-1): work; ada2020 features
o.e.a.stephe-3 (from o.e.a.s-1): emacs module parser (very old)
o.e.a.stephe-4 (from o.e.a): eglot/ada_language_server
o.e.a.stephe-5 (from o.e.a): libadalang backend
o.e.a.stephe-6 (from ): available

(dvc-state-multiple
'((xmtn . "/Projects/org.stephe_leake.makerules")
  (xmtn . "/Projects/org.stephe_leake.sal")
  (xmtn . "/Projects/org.stephe_leake.aunit_ext")
  (xmtn . "/Projects/org.wisitoken")
  (xgit . "/Projects/elpa") ;; for uniquify-files
  (xmtn . "/Projects/org.emacs.ada-mode/")))

(dvc-propagate-multiple
 '(("../org.stephe_leake.sal"  . "../org.stephe_leake.sal.stephe-1")
   ("../org.wisitoken"         . "../org.wisitoken.stephe-1")
   ("../org.emacs.ada-mode"    . "../org.emacs.ada-mode.stephe-2")))

(dvc-state-multiple
'((xmtn . "c:/Projects/org.stephe_leake.makerules")
  (xmtn . "c:/Projects/org.stephe_leake.sal.stephe-1")
  (xmtn . "c:/Projects/org.stephe_leake.aunit_ext")
  (xmtn . "c:/Projects/org.wisitoken.stephe-1")
  (xmtn . "c:/Projects/org.emacs.ada-mode.stephe-2")))

(dvc-propagate-multiple
 '(("../org.stephe_leake.sal.stephe-1" . "../org.stephe_leake.sal")
   ("../org.wisitoken.stephe-1"        . "../org.wisitoken")
   ("../org.emacs.ada-mode.stephe-2"   . "../org.emacs.ada-mode")))

(setenv "GPR_PROJECT_PATH" "c:/Projects/org.wisitoken/build;c:/Projects/org.stephe_leake.sal/build;c:/Projects/org.stephe_leake.makerules")

 current work
release (see below)

delete gnatcoll xref gnatprep?
    don't support old gnat

xref.From_Prefix does name completion

figure out how gnatfind finds ada_mode-separate_procedure body
    report bug: -f not respected (test/ada_mode.ads)
    improve gpr_query to find separate body

change wisi-cache text property to wisi-navigate

rename "semantic checks" to "in-parse actions", others to "post-parse actions".

start gpr_query.exe in background

move dvc-kill-all-review/workspace to wisi?
    add delete projects in the workspace?
    delete project call wisi-kill-xref, wisi-kill-parser

gpr_query needs list of root types to exclude from tree_[dr]efs?
    --exclude_root_types=<filename>
    books-database_remote.ads:202:30 Database

gpr_query does not see libraries?
    need clear example; libadalang mains vs langkit?
    compare to GPS, gnatinspect

align region too large:
   case A is
      when 0            =>
         --  plain identifier
         RHS.Tokens.Append
           ((Label      => +"",
             Identifier => +Get_Text (Data, Tree, Tree.Child (I, 1))));
   end case;

    ada-align groups preceding comment lines with declarations

    lsp language server can do align as part of "format"

libadalang/lsp backend
    o.e.a.stephe-4 on Debian, for gnatpro 20
    use ada_language_server via lsp

    gnu elpa eglot
        eglot-x has extended xref for ccls server

    https://github.com/microsoft/language-server-protocol/issues/18 semantic info for highlight = face

    Convert wisitoken syntax tree to adalang - plug in to Lang server

    use wisitoken parser with GPS
        add incremental parsing https://www.researchgate.net/profile/SL_Graham/publication/2377179_Efficient_and_Flexible_Incremental_Parsing/links/004635294e13f23ef1000000/Efficient-and-Flexible-Incremental-Parsing.pdf
        ebooks/Parsing/Wager, Graham 1998 Efficient and Flexible Incremental Parsing.pdf

    ada-process.el missing TICK_2 on debian o.e.a.s-5
        because generated by External
        should be ada-process-external.el!

    AdaCore tickets:
        Q406-078 2017-Aug : AdaCore (Nicolas Setton, Arnaud Charlet)
            mentions not fixing old GPS engine in favor of libadalang;
            wait for libadalang to introduce new config flags. Phippe
            Waroquiers wants GPS & Emacs indentation to be the same,
            and match Eurocontrol style.

        R801-052 2018-Aug : Stephe mentions transforming libadalang
            tree to wisitoken tree, using wisitoken indent code.
            AdaCore says GPS not using libadalang for indentation yet.

        R821-023 2018-Aug .. 2018-Dec : gnatpp using libadalang, but it is not ready for indent.

        SA31-041 2019-Oct

    time on huge eurocontrol files c:/eurocontrol
        if need more than one source file, use current buffer or disk file?
        keep one context active, for the current project?
            see playground.adb in libadalang source

    pp-command_lines.ads Name_Casing Name_Case_As_Declared - requires name resolution
        too slow?

improve test/ada_mode-recover_32.adb
    recover gets CONSTRAINT_ERROR, config ops full

if there was a corrected error on a line, that is now gone, the indent
should be recomputed, even if no prior text edited.

java-ch19.wy TryStatement has optional statement-end
    need override on previous tokens

speed up lalr compile
    decrease subprog size?

why is wisi-hanging specified in each use of expression instead of on expression itself?
    change it and see what breaks
    ada-indent-hanging-rel-exp not used consistently?
    either way, improve example in wisi.texi

replace ada.wy with ada_annex_p.wy
    ada.wy:774: ;; FIXME: | digits_constraint
    ada.wy:775: ;; FIXME: | delta_constraint
    ada.wy:1015:;; FIXME: leaving out [renaming] [aspect_specification]
    ada.wy:1245:      ;; FIXME: indentation of comment after 'is' (and 'with' in
    ada.wy:1929: ;; allocator, FIXME: leaving out subpool_specification.

Adjust-indent loop on each token, handle 'end <keyword>'

Eurocontrol/debbugs bugs
https://debbugs.gnu.org/cgi/pkgreport.cgi?package=emacs;include=subject:ada-mode
    1913 non-ascii in regexp (2009!?)
        ada-syntax-propertize assumes ASCII in character literals; wrong (ARM 3.5.2 Wide_Character, Wide_Wide_Character)
        ada-parent-name-regexp is wrong; only used in ada-set-ff-special-constructs
        ada-identifier-at-point is wrong; used in xref/navigation

    33744 indentation of subexpressions
        https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33744
        need to identify subexpressions
        test/hanging.adb need more test cases
        waiting for money
            procedure Operator_Indentation is
            begin
              if B
                   or else C
                     > 2 -- indented relative to "or else"
              then
                null;
              end if;
            end Operator_Indentation;

c:/eurocontrol/query_display-flight_operations.adb
    errors cause huge slowdown in parse speed
        due to parallel parse, delete_dup?
        try bounded stack for main parse
        run under valgrind

    only errors are missing end labels
        lr1 parse face time:
        with all fixed,      0.175579163
        with errors present, 8.395040656

        1  8.282763405
        2  8.146287525
        3  8.083595595
        4  2.576497063
        5  1.448250382
        6  1.461459692
        7  1.437491198
        8  1.420267629
        9  0.160563880

        second ediff-buffers reliably hangs!
            external process communications bug
            update master, try -Q
            emacs 26 ok

    run with profile => recover takes 0% of time (sigh)

    add put (clock) at various places
    after recover at 15304:(PROCEDURE, (122273 . 122281)) Display_Profile line 2784
    takes 6.5 seconds to get to 20650:(END, (170186 . 170188)) Query_Display.Flight_Operations; line 3625

1. 2091:(BEGIN, (18446 . 18450))
   (subprogram_body, (18252 . 18440))
   1 parser, succeed 2, enqueue 2, check  2, cost:  0
   non-ignore solution is wrong, terminated immediately

2. 4143:(BEGIN, (33687 . 33691))
   (subprogram_specification, (33286 . 33350))
   1 parser, succeed 2, enqueue 2, check  2, cost:  0
   extra terminated 4245:(USE, (34365 . 34367))

3. 5177:(FUNCTION, (40478 . 40485))
   (subprogram_specification, (39991 . 40026))
   1 parser, succeed 1, enqueue 4, check  2, cost:  0
   nested inside 4

4. 5255:(BEGIN, (40951 . 40955)) Resume_Token_Goal 5259
   (subprogram_specification, (40699 . 40726))
   209: succeed 2, enqueue 2, check  2, cost:  0
   extra terminated 5275:(BEGIN, (41044 . 41048))

5. 5364:(BEGIN, (41705 . 41709)) Resume_Token_Goal 5368
   (subprogram_specification, (41435 . 41488))
   215: succeed 2, enqueue 2, check  2, cost:  0
   extra terminated 5802:(IDENTIFIER, (45635 . 45643))

6. 7439:(IDENTIFIER, (59232 . 59243)) Resume_Token_Goal 7443
   (subprogram_specification, (59021 . 59051))
   281: succeed 1, enqueue 4, check  2, cost:  0
   7442:(IDENTIFIER, (59256 . 59259))

7. 10700:(BEGIN, (82600 . 82604)) Resume_Token_Goal 10704
   (subprogram_specification, (82299 . 82324))
   340: succeed 2, enqueue 2, check  2, cost:  0
   encounters next error before terminate extra

8a. 627: 15304:(PROCEDURE, (122273 . 122281)) Resume_Token_Goal 15308
    (subprogram_specification, (40699 . 40726))
    627: succeed 1, enqueue 4, check  2, cost:  0
    no terminate needed

8b. 626: 15304:(PROCEDURE, (122273 . 122281)) Resume_Token_Goal 15308
    (subprogram_specification, (82299 . 82324))
    626: succeed 1, enqueue 4, check  2, cost:  0
    no terminate needed

9a. 957: 20650:(END, (170186 . 170188))
Action, expecting: BEGIN, ENTRY, FOR, FUNCTION, GENERIC, NOT, OVERRIDING, PACKAGE, PRAGMA, PROCEDURE, PROTECTED, SUBTYPE, TASK, TYPE, USE, IDENTIFIER, found 20650:(END, (170186 . 170188))
    957: succeed 1, enqueue 40, check  17, cost:  1
    error due to some previous bad recovery

9b. 956: 20650:(END, (170186 . 170188)) Resume_Token_Goal 20654
Action, expecting: BEGIN, ENTRY, FOR, FUNCTION, GENERIC, NOT, OVERRIDING, PACKAGE, PRAGMA, PROCEDURE, PROTECTED, SUBTYPE, TASK, TYPE, USE, IDENTIFIER, found 20650:(END, (170186 . 170188))
    956: succeed 1, enqueue 18, check  7, cost:  1
    error due to some previous bad recovery

10a. 957: 20655:(Wisi_EOI, (170222 . 170221)) Resume_Token_Goal 20659
Action, expecting: BEGIN, ENTRY, FOR, FUNCTION, GENERIC, NOT, OVERRIDING, PACKAGE, PRAGMA, PROCEDURE, PROTECTED, SUBTYPE, TASK, TYPE, USE, IDENTIFIER, found 20655:(Wisi_EOI, (170222 . 170221))
     error due to some previous bad recovery
     957: succeed 1, enqueue 215, check  49, cost:  2

10b. 956: 20655:(Wisi_EOI, (170222 . 170221)) Resume_Token_Goal 20659
Action, expecting: BEGIN, ENTRY, FOR, FUNCTION, GENERIC, NOT, OVERRIDING, PACKAGE, PRAGMA, PROCEDURE, PROTECTED, SUBTYPE, TASK, TYPE, USE, IDENTIFIER, found 20655:(Wisi_EOI, (170222 . 170221))
     error due to some previous bad recovery
     956: succeed 1, enqueue 126, check  23, cost:  1

optimize Grow of SAL.Gen_Unbounded_Definite_Vectors?
    run-time parameter and/or generic parameter giving initial size
    output max size, accumulate in Emacs session

    go thru all uses
        wisitoken.syntax_tree.s.node_arrays

    similar for parse_stack?

enforce unix line endings
    run dos2unix in a mtn pre-commit hook?

time lex with no lex debug

move gnatcoll install instructions to wisi elpa package, for reference
    from wisitoken-grammar-mode.

https://github.com/lapo-luchini/asn1js/blob/master/mirror_to_github.sh
    export, incremental update of git mirror works
    push my stuff to savannah
        also to github?

do module interface
    see if it's faster

packrat
    need to override wisitoken.parse.put_errors for emacs process interface
        derive an Emacs_Parser type?

        or add abstract error_list, change wisi_runtime.put_errors to use that

        using Parser.Put_Errors for now

    langkit packrat is significantly faster than wisitoken lalr
        because of generated code, not table interpreter?
            try generated code for lalr
                lose error correction?
        use non-error-correcting packrat as primary parser, error-correcting lalr as fallback

    generate, compile packrat speed?
        ada_packrat_process_main.adb (31347 lines) compiles _way_ faster than ada_process_main.adb (13692 lines)

make-subprogram-body should strip aspects.

compute align in grammar actions
    align-list action on ':', '=>' etc

support variable pitch fonts
    for indent use (put-text-property 118 120 'display '(space :width (10))))

add wisi-forward-anchor, use for comments after 'is', 'when' in record type

 benchmarks:
    update only in o.e.a

    build/Makefile
        comment out 'export Standard_Common_Build := Debug'
        make recursive-clean build_ada_executables

d:/Apps/GNAT-gpl_2016/gnatcoll-gpl-2016-src/src/sqlite/gnatcoll-xref.adb
    copied to c:/tmp/gnatcoll-xref.adb
    7252 lines, 29461 tokens, 254989 characters

wisi-generate
    $WISI_WISITOKEN/wisi-generate.exe --time ada.wy

    04 mar 2018
        o.e.a.s-2 12.919s
        o.e.a.s-4 24.398s, 24.625s

    12 Apr 2018
        o.e.a.s-4 16.136s

    23 May 2018
        11.967s, 12.035s

    25 Jul 2018
        trees in lr1_items search, -O3
        LALR elisp generate time: 3.290167687
        LALR re2c generate time: 3.309398246
        LR1 re2c generate time: 602.235431713

    26  Jul 2018
        don't loop on all token_ids; loop on set
        LALR elisp generate time: 0.445727505
        LALR re2c generate time: 0.450525800
        LR1 re2c generate time: 31.202567095

    1 Aug 2018 replace Constrain_Terminals with Minimal_Complete_Actions
        LALR elisp generate time: 0.472614643
        LALR re2c generate time: 0.480273867
        LR1 re2c generate time: 31.820868201

mckenzie recover
    ./run_ada_lr1_parse.exe test/ada_mode-recover_partial_02_lr1.adb Indent --debug_mode --enqueue_limit 120_000 --check_delta 20_000 --verbosity 0 1 0

    12 Jul 2019 ada-mode 6.1.1
        0: succeed 2, enqueue 110, check  14, cost:  2
        time 0.003358967

        1: fail; enqueue limit ( 120000 cost 11)
        1: fail, enqueue 120063, check  11824, max shared_token  64
        0: succeed 2, enqueue 73734, check  7599, cost:  8
        time 0.680450032

    o.e.a-m just_pushed_back_or_inlined expanded
        0.671804168, 0.673667911, 0.671176628

    "", drop token_index compare
        0.678247599, 0.670705783, 0.678376354

    o.e.a-m.s-4 config_heap.pre_add
        0: succeed 2, enqueue 110, check  14, cost:  2
        time 0.003585515

        0: fail; enqueue limit ( 120000 cost 10)
        1: succeed 2, enqueue 73734, check  7599, cost:  8
        time 0.665732656, 0.661565665, 0.660932083, 0.668397249 - not worth it

    o.e.a-m.s-4, o.w.s-2 binary search action_for
        0: succeed 2, enqueue 110, check  14, cost:  2
        time: 0.003279674

        0: fail; enqueue limit ( 120000 cost 11)
        1: succeed 2, enqueue 73734, check  7599, cost:  8
        time: 0.665491758

        after propagate:
        0.695314665, 0.691568300, 0.714005333

    binary search goto_for
        0.696081911, 0.727982272, 0.692549635 -- no slower, no faster; keep for clean

    sal.list in sal.unbounded_queue
        0.679426409, 0.703120410, 0.711440799

    use spark bounded_queue; no controlled
        0.703130227, 0.677916459, 0.674938851

    in bounded_queue, add suppress (all_checks), explicit check for full
        0.768971400, 0.677694819, 0.699692724, 0.680185725

    spark bounded_stack, suppress (all_checks)
        0.475089053, 0.471345331, 0.470334167 yes!

navigate, face, indent
    make -r benchmark
        uses gnatcoll-xref.adb

    27 Nov 2017 - compute actions in Ada
        1.377199 seconds 3 gcs 6560 responses 0.509915 wait
        1.523548 seconds 2 gcs 6560 responses 0.518090 wait

    12 Apr 2018 - syntax table
        navigate 1.411872 seconds 4 gcs 6560 responses 0.352224 wait
        face     1.507372 seconds 5 gcs 2145 responses 0.319860 wait
        indent   1.447788 seconds 1 gcs 7251 responses 0.350474 wait

    23 May 2018
        navigate 1.542892 seconds 4 gcs 6560 responses 0.473158 wait
        face     1.645698 seconds 4 gcs 2145 responses 0.452539 wait
        indent   1.603725 seconds 1 gcs 7251 responses 0.491922 wait

    2 Sep 2018
    using lalr
        navigate 0.985181 seconds 4 gcs 6568 responses 0.248143 wait
        face     1.119776 seconds 4 gcs 2145 responses 0.246759 wait
        indent   1.033525 seconds 1 gcs 7251 responses 0.251972 wait
    lr1:
        navigate 0.968994 seconds 4 gcs 6568 responses 0.231818 wait
        face     1.085459 seconds 4 gcs 2145 responses 0.219220 wait
        indent   1.020811 seconds 1 gcs 7251 responses 0.237752 wait

    12 Jul 2019 ada-mode 6.1.1
        navigate 1.383730 seconds 6 gcs 7431 responses 0.241632 wait
        face     1.490733 seconds 8 gcs 2151 responses 0.215659 wait
        indent   1.382439 seconds 3 gcs 7252 responses 0.241366 wait

 wisi work

disable or use electric-indent-post-self-insert-function
    called during ada-indent-newline-indent
    on post-self-insert-hook
        use that for ada-mode capitalization

ada-goto-declaration-start
    fails on task declaration
        only a problem if misusing C-c C-b ada-make-subprogram-body to make a task body
        C-x C-e skeleton expand works fine

        ada-make-subprogram-body should throw an error if it's not on a
        _subprogram_ spec, and recommend C-c C-e in the error message.

        but also fails on
        task body TA is
        begin
           null;
        end TA;

        fix the latter, see if it fixes ada-make-subprogram-body
            if not, make it throw an error.

    fails on separate (P) procedure X;
        C-c C-e works

        but also fails on
        separate (P)
        procedure X;
        is
        begin
        end X;

        fix the latter, see if it fixes ada-make-subprogram-body
            if not, obsolete that.

add "show all overloads" in navigate
    leave out file, line, col from gpr-query id

completion
    (info "(elisp)Completion")
    http://emacswiki.org/emacs/CategoryCompletion
    autocomplete package

    examples:
        Ada.Text_IO.<tab> => Put, Put_line, Get, etc
            needs new query; all symbols that match prefix
            better as an ASIS query?

        what does GPS do?
            works on non-compiled, bad syntax code
            type 'with '; puts up a list of all packages in the project.
            type 'with Ada.'; list of all children of Ada
                requires scroll, <ret> to select
                while scrolling, puts up help text next to list

            type 'Put', puts up a list of all simple names in project matching that prefix
            type 'Put (', puts up a list of all params of all Puts (_not_ filtered by current context clause)

            does _not_ handle 'foo_io.put', where 'foo_io' is an instance of A.Tio.float_io.
                maybe it would if foo_io is:
                    a library package instantiation
                    a local instantiation, but was previously compiled

            find the GPS source code

    match GPS behavior
        get completion candidates from gpr_query
        all names in scope at point

    built-in pcomplete
        completion-at-point-functions

    http://elpa.gnu.org/packages/company.html
        including C++ parameters, class members

    MELPA package auto-complete
    https://github.com/auto-complete/auto-complete
    https://github.com/capitaomorte/yasnippet

c:/Archive/Emacs/slime-2.10.1.tar.gz

move stuff out of ada-mode-keys.el
    ada-make-package-spec
        skel default to (ada-name-from-file-name (buffer-file-name))?

different casing for identifiers (uppercase) and attributes (mixed)

refactoring

    rename entity:
        use xref to rename all uses (with/without confirm)

    change parameter_result_profile
        make same change in all overrides
        offer to walk thru all uses

    promote primitive subprogram-local variable to type component

    move primitive from parent to child class

    extract subprogram
        from Eclipse
        highlight lines of source
        prompt for name
        it guesses parameter_result_profile

support for "Adadoc"?
    formatted comments that mention parameters; check that they are all mentioned, spelled correctly

 debug hints, relevant files
https://debbugs.gnu.org/Developer.html
https://debbugs.gnu.org/server-control.html
https://debbugs.gnu.org/cgi/pkgreport.cgi?package=emacs;include=subject:ada-mode

gdb run_ada_parse
    in wisitoken-wisi_runtime.adb Indent_Action_0:
        break on 'if token.first_indent_line then' line 1050
        call wisitoken.syntax_trees.id (tree, nonterm)
        p data.descriptor.image ($)
        p i
        p data.descriptor.image (token.id)
        p token.line
        p token.col
        p pair
        p data.indents.elements.ea(token.line)

    in wisitoken-semantic_state.adb Reduce
        break on 'nonterm.paren_state := ' line 334
        p descriptor.image (nonterm.id)
        p i
        p descriptor.image (aug_token.id)
        p aug_token
        p nonterm

to change process executable for all current and future buffers:

    in any *.adb buffer:
    (setf (wisi-process--parser-exec-file wisi--parser)
      "c:/Projects/org.emacs.ada-mode.stephe-2/ada_mode_wisi_parse.exe")
    M-x wisi-kill-parser

    to undo:
      (setf (wisi-process--parser-exec-file wisi--parser)
        "ada_mode_wisi_parse.exe")
    M-x wisi-kill-parser

    if *-process.el has changed:
    in *-process.el: M-x eval-buffer
    in *.<lang> buffer:
    (wisi-kill-parser
    (setq wisi-process--alist nil)
    M-x <lang>-mode

Edebug displays

in wisi-process-parse--Reduce_Stack:
(setq edebug-eval-list
 '(tokens-1
   tok
   (aref token-table (aref tokens-1 i))
   (queue-head (wisi-process--parser-parse-stack wisi--parser))
   sexp
   ))

in wisi-parse-reduce:
(setq edebug-eval-list
 '(nonterm
   tok
   first
   ))

in wisi--indent-token-1:
(setq edebug-eval-list
 '((wisi-ind-indent wisi--indent)
   wisi-nterm
   i
   delta
   indent
   ))

in wisi-indent-action:
(setq edebug-eval-list
 '((wisi-ind-indent wisi--indent)
   wisi-nterm
   wisi-tokens
   deltas
   wisi-token-index
   tok
   token-delta
   comment-delta
   ))

wisi-indent-region:
(setq edebug-eval-list
 '((wisi-ind-indent wisi--indent)
   anchor-indent
   i
   indent
   new-indent
   ))

use elp (emacs lisp profiler)?
    (with-current-buffer (find-file-noselect "~/src/xdisp.c")
      (elp-instrument-function 'c-beginning-of-defun)
      (goto-char (point-max))
      (condition-case nil
          (while (beginning-of-defun) nil)
        (error nil))
      (elp-results))

(progn (profiler-start 'cpu) (time-it 'wisi-parse-buffer 10) (profiler-report) (profiler-stop))
    B - profiler-report-render-reversed-calltree shows low-level time hogs

attach gud-gdb to running emacs: attach <process id>
    source emacs/src/.gdbinit
    xbacktrace shows lisp backtrace

"kill -USR2 <emacspid>" which should also drop you into the (elisp?) debugger.

(browse-url "c:/Projects/arm_info/org.adaic.arm_form/build/html/arm2012/RM-P.html")
(info "(aarm2012)Annex P" "*info Annex P*")
http://www.ada-auth.org/standards/
(info "(elisp)Parser State" "*info syntax-ppss*")
"c:/home/stephe/Backup/eBooks/Dick Grune/Parsing.pdf" [dickgrune]

http://savannah.gnu.org/projects/emacs/

http://git.savannah.gnu.org/cgit/emacs.git/tree/README?h=elpa
http://elpa.gnu.org/

https://www.dropbox.com/sh/7jr3vbv9tm1zod0/jPuvfrJAe8
    w32 builds of cutting-edge emacs branches, pretests

ftp://alpha.gnu.org/gnu/emacs/pretest/
    untar with cygwin
    in mys32 under emacs:
        cd /c/Projects/emacs/emacs-24.3.9x
        ./configure --prefix=/mingw32
        make
        # don't make install, just run from the build dir

 access to ada-france:

anonymous (read only) access:
    mtn --db ~/monotone-dbs/ada-france.db --key '' pull www.ada-france.org "org.emacs.*"

read/write access requires a public key:
    send output of 'mtn pubkey' to Ludovic Brenta
    <ludovic@ludovic-brenta.org> or Stephe Leake
    <stephen_leake@stephe-leake.org>

    add it to monotone db via 'mtn read'
    add it to /etc/monotone/write-permissions
    /etc/init.d/monotone restart

    mtn --db ~/monotone-dbs/ada-france.db sync "mtn://www.ada-france.org?org.emacs.*"

 git config for elpa checkout
in ~/.gitconfig:
    # 15 Feb 2016: ELPA has an object that fails this check; only need
    # to disable (set to false) when pull a full repository (that includes that
    # object)
        fsckObjects = false

[core]
	repositoryformatversion = 0
	filemode = false # don't set exec bits
	bare = false
	logallrefupdates = true
	ignorecase = true
[remote "origin"]
	fetch = +refs/heads/master:refs/remotes/origin/master
	push  = +refs/heads/master
	url = stephen_leake@git.sv.gnu.org:/srv/git/emacs/elpa.git
[branch "master"]
	remote = origin
	merge = refs/heads/master

 beta test release
run all tests

do wisitoken, sal release

bump version (elpa releases don't have to be consecutive)

Makefile pub install-elpa elpa-zip-2
    # install-elpa verifies all required files are included and byte-compile successfully.

verify beta install instructions d:/Web/savannah/ada-mode/index.html

(dvc-state-one ".")

in cygwin console for gpg prompts:
    cd /Projects/elpa/archive/packages
    ls *.tar*
    rm <old>.tar*
    gpg -b *.tar.*

    scp *.tar.* stephen_leake@dl.sv.nongnu.org:/releases/ada-mode/

all below from "build/Makefile tag zip"
    except don't commit elpa?

 release process
keep status in ~/projects.text
do wisitoken release ../org.wisitoken/build/release_process.text

(dvc-status ".")

# uninstall elpa packages before change version
build/Makefile uninstall-elpa

check for ELPA patches by others
    (dvc-status "/Projects/elpa")
        revert local changes in ada, wisi, ada-ref-main; commit in uniquify
    (dvc-pull "/Projects/elpa")
    (dvc-sync-review "/Projects/elpa")
        update
        clean, quit sync
    cd c:/Projects/elpa
    git log -2 -- packages/wisi
    git log -2 -- packages/ada-mode
    git log -2 -- packages/ada-ref-man
    git log -2 -- packages/uniquify-files
    if changes:
        (dvc-log "/Projects/elpa/packages/<dir>/<file>")
        apply changes to current

check emacs buglist
    http://debbugs.gnu.org/cgi/pkgreport.cgi?package=ada-mode
    to update a bug: nnn@debbugs.gnu.org
        subject: from bug title, for people who rely on that.
    if fixed in devel sources, add 'pending' tag:
        control@debbugs.gnu.org
        tags nnn + pending

check for latest Emacs release
    http://ftp.gnu.org/gnu/emacs/windows/

run all tests without elpa:
    build/Makefile elisp
    build/Makefile byte-compile-clean

    - Windows master Emacs, current gnat
    - Windows Emacs 25.3, current gnat
    - Windows Emacs 26.1, current gnat
    - Debian testing, current gnat (community or pro)

compare:
    build stuff to compare with previous release in elpa:
        build/Makefile pub

    (list-packages)
        install previous ada-mode, wisi, ada-ref-man from public ELPA for diffs
        change versions in compares below to match installed versions.

    (ediff-directories "~/.emacs.d/elpa/wisi-2.1.1" "/Projects/elpa/packages/wisi" nil)
        NEWS-wisi.text
            copyright date
            add release date
            add new features

    (ediff-directories "~/.emacs.d/elpa/ada-mode-6.1.1" "/Projects/elpa/packages/ada-mode" nil)
        NEWS-ada-mode.text
            add release date
            add new features

    (ediff-directories "~/.emacs.d/elpa/ada-ref-man-2012.5" "/Projects/elpa/packages/ada-ref-man" nil)
        /Projects/org.adaic.arm_form/NEWS
            add release date, new features

bump versions
    Gnu ELPA requires single digits between dots in versions

    bump if _any_ changes other than autoloads, so ELPA package handler knows to update
        bump third digit for bug fixes, minor features
        bump second digit for major features
            - GPS indentation engine add/delete
            - partial parse
            - delete elisp lexer
        bump first digit for really major or user-incompatible changes
            - 5 use parser
            - 6 compute indentation in grammar actions, external parser with error correction
            - 7 move lots of stuff to wisi; many ada-* variables, functions deleted.

    emacs_wisi_common_parse.ads
        (should have been changed already, but verify)
        Protocol_Version if this file changed, or
        wisi-process-parse.el -send-parse, -send-refactor, -execute
        changed, or for bug fixes/features in parser or wisi.adb
        ie, if installed parser must be replaced on upgrade or downgrade

    wisi-ada.ads
        (should have been changed already, but verify)
        Language_Protocol_Version if this file changed, or for bug fixes/features in wisi-ada.adb
        ie, if installed parser must be replaced on upgrade or downgrade

    wisi.el
        Version:

    wisi.texi
        @title
        @node top

    README-wisi
        first line

    build.sh
        GPR_PROJECT_PATH wisi version

    install.sh
        GPR_PROJECT_PATH wisi version

    ada-mode.el
        Version:
        package-requires wisi version
        ada-mode-version

    ada-mode.texi
        @title
        @node top

    README-ada-mode
        first line

    ada-ref-man.el
        Version:

    build/Makefile
        run uninstall-elpa with old values before changing!
        ADA_MODE_VERSION
        ADA_REF_MAN_VERSION
        WISI_VERSION
        WISITOKEN_GENERATE := ~/.emacs.d/elpa/wisi-i.j.k/

    d:/Web/savannah/ada-mode/index.html
        find-replace ada-mode i.j.k
        wisi version does not appear
        _not_ WisiToken (done in wisitoken release)

    _not_ d:/Web/stephe-leake/ada/wisitoken.html - done in wisitoken release

    ~/Web/Makefile
        ADA_MODE_VERSION
        _not_ WISITOKEN_ZIP_VERSION

verify other metadata
    ada-mode.el
    ada-ref-man.el
    wisi.el

prep for elpa tests:
    build/Makefile byte-compile-clean pub
    # pushes to elpa workspace, builds archive

Check copyright on files in published in elpa
    c:/Projects/elpa/GNUMakefile check_copyrights
    change to FSF

Emacs 25.3, current gnat
    ~/bin/emacs-25.sh
    (add-to-list 'package-archives (cons "test" "/Projects/elpa/archive/packages"))
    build/Makefile install-elpa
    (gpr-query-kill-all-sessions)
    (list-processes)
    # 'd' = kill; gpr_mode_wisi_parse.exe, ada_mode_lr1_wisi_parse.exe
    cd ~/.emacs.d/elpa/ada-mode-7.0.1; ./build.sh; ./install.sh
    cd ~/.emacs.d/elpa/wisi-3.0.1; ./build-wisitoken-bnf-generate.sh

    restart Emacs to set load-path

    build/Makefile compile-ada-test autoloads test-clean
    build/Makefile test TEST_DIR=elpa

    build/Makefile uninstall-elpa
    (gpr-query-kill-all-sessions)
    build/Makefile recursive-clean clean # if changing compilers

sync for Debian check bogus execute permissions:
    current Emacs for dvc
    # dvc-state-multiple above
    # not elpa; commit elpa on Debian for file permissions
    $ mtn_sync_ada_france.sh
    (dvc-sync-review ".")

Debian stable has elpa checkout
    ~/bin/mtn_sync_ada_france.sh
    (dvc-sync-review ".")

    if new machine, install gnat CE 2019, gnatcoll
        http://libre.adacore.com
        ada-mode.texi

    (dvc-pull "/Projects/elpa")
    (dvc-sync-review "/Projects/elpa")

    build/Makefile
        # no ARM_INFO on Debian
        docs pub-ada pub-wisi clean-elpa build-elpa uninstall-elpa
        install-elpa
            # byte-compile errors, warnings show in *compile-log*

    check for bogus execute permissions in elpa
        $ cd /Projects/elpa/
        $ ls -R -l packages/ada-mode | grep -- -rwx
        $ ls -R -l packages/wisi | grep -- -rwx
        $ chmod -x *.el *.adb
        # keep execute on *.sh

    commit elpa:
    (dvc-state-one "/Projects/elpa")
        add/delete, stage, commit ada-mode, wisi

    (dvc-push "/Projects/elpa")
    (dvc-sync-review "/Projects/elpa")

    # dvc-state-multiple above
    $ mtn_sync_ada_france.sh
    (dvc-sync-review ".")

On Windows
$ mtn_sync_ada_france.sh
(dvc-sync-review ".")

delete changes in elpa:
    $ cd /Projects/elpa/
    $ git checkout .

update elpa, commit elpa/ada-ref-man (not done on Debian)
    (dvc-pull "/Projects/elpa")
    (dvc-sync-review "/Projects/elpa")

    build/Makefile pub-ada-ref-man

    (dvc-state-one "/Projects/elpa")
        add, stage, commit

    (dvc-push "/Projects/elpa")
    (dvc-sync-review "/Projects/elpa")

    # 24 hrs for web repository to update

after Gnu ELPA updated, test install from GNU ELPA
    5.1.8 crashed emacs for me
    see 'build/Makefile install-elpa' above for details
    also wisitoken-grammar-mode

(dvc-state-one ".")
build/Makefile tag zip

~/bin/mtn_sync_ada_france.sh

in cygwin console for gpg prompts:
    cd /Projects/org.emacs.ada-mode/build/
    ls *.tar*
    rm <old>.tar*
    gpg -b *.tar.*

    scp *.tar.* stephen_leake@dl.sv.nongnu.org:/releases/ada-mode/

~/Web/Makefile
    # no 'sync' here; all on savannah via cvs, scp
    ada-mode

commit savannah
    if emacs cvs-examine fails, do 'cvs status' in shell to see real error message (probably IP address confusion)
        # see projects.text "conflicting keys for savannah"
        $ cd /d/Web/savannah/ada-mode
        $ cvs status
        # edit ~/.ssh/known_hosts, delete offending one, repeat 'cvs status'
    (cvs-examine "d:/Web/savannah/ada-mode" nil)
    mark all 'm'
    commit   'c'
    edit commit message "release version i.j.k"
    C-c C-c

    takes ~ 10 min for http://www.nongnu.org/ada-mode/ to reflect cvs commit

post on emacs-ada-mode mailing list, c.l.a newsgroup:

-------------------
Gnu Emacs Ada mode beta test 7.0.0
-------------------

Gnu Emacs Ada mode beta test 7.0.0 is now available at
http://www.nongnu.org/ada-mode/. This is a significant refactoring,
which may affect some user custom code, so it is not in Gnu ELPA yet.

To install, download the candidate ELPA archive, set package-archives
to point to it, and use list-packages (more detailed instructions at
http://www.nongnu.org/ada-mode/).

The wisi package now provides a more complete integration with Emacs
project.el.

Several bugs have been fixed.

You may want to work thru the tutorials in ada-mode.info again; they
now cover many of the new features.

See the NEWS files in ~/.emacs.d/elpa/ada-mode-7.0.0 and wisi-3.0.0,
for more details. See wisi.info in the release for more information on
the package.el integration.

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

-------------------
Gnu Emacs Ada mode 6.2.1 released.
-------------------

Gnu Emacs Ada mode 6.2.1 is now available in GNU ELPA. This is a minor
feature and bug fix release.


See the NEWS files in ~/.emacs.d/elpa/ada-mode-6.2.1 and wisi-2.2.1,
or at http://www.nongnu.org/ada-mode/, for more details.

The process parser requires a manual compile step, after the normal
list-packages installation:

cd ~/.emacs.d/elpa/ada-mode-6.2.1
./build.sh

This requires AdaCore gnatcoll packages which you may not have
installed; see ada-mode.info Installation for help in installing them.
--------------------

mark fixed bugs
    add to NEWS-ada-mode.text or NEWS-wisi.text when closed.
    confirm with submitter.
    http://debbugs.gnu.org/cgi/pkgreport.cgi?package=ada-mode
    http://debbugs.gnu.org/Developer.html
    email to nnn@debbugs.gnu.org giving ada-mode version containing fix
    email to nnn-close@debbugs.gnu.org
    subject: 'closed by ada-mode version i.j.k'
    don't include Version: header; that's an Emacs version
    debbugs updates ada-mode summary page within half an hour; no emails

check https://www.emacswiki.org/emacs/AdaMode
    https://www.emacswiki.org/emacs/StephenLeake

-- end of file
