branch: externals-release/wisi commit 1c4b099bf1f93cebee523b0ba75ccab6c6c2a2f0 Author: Stephen Leake <stephen_le...@stephe-leake.org> Commit: Stephen Leake <stephen_le...@stephe-leake.org>
Release 4.3.2 * NEWS: Version. * README: * wisi.el: --- NEWS | 7 ++++++- README | 2 +- emacs_wisi_common_parse.adb | 2 +- wisi-parse-common.el | 7 ++++++- wisi-process-parse.el | 5 ++++- wisi.el | 2 +- wisitoken-bnf-generate.adb | 2 +- wisitoken-syntax_trees.adb | 4 ++++ 8 files changed, 24 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 2413062e57..bbd9f62724 100644 --- a/NEWS +++ b/NEWS @@ -6,10 +6,15 @@ Please send wisi bug reports to bug-gnu-em...@gnu.org, with 'wisi' in the subject. If possible, use M-x report-emacs-bug. +* wisi 4.3.2 +21 Oct 2023 + +** wisi-incremental-parse-enable is now t by default. + * wisi 4.3.0 15 Sep 2023 -* Use WisiToken 4.2.0. +** Use WisiToken 4.2.0. * wisi 4.2.3 26 Jan 2023 diff --git a/README b/README index 7f73c3f30c..08fe5971a7 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Emacs wisi package 4.3.0 +Emacs wisi package 4.3.2 The wisi package provides utilities for using generalized error-correcting LR parsers (in external processes) to do indentation, diff --git a/emacs_wisi_common_parse.adb b/emacs_wisi_common_parse.adb index 5fc3877ee7..4bedff3f55 100644 --- a/emacs_wisi_common_parse.adb +++ b/emacs_wisi_common_parse.adb @@ -2,7 +2,7 @@ -- -- See spec. -- --- Copyright (C) 2018 - 2022 Free Software Foundation, Inc. +-- Copyright (C) 2018 - 2023 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or -- modify it under terms of the GNU General Public License as diff --git a/wisi-parse-common.el b/wisi-parse-common.el index 7d516b6385..d565c712e7 100644 --- a/wisi-parse-common.el +++ b/wisi-parse-common.el @@ -22,7 +22,7 @@ ;;; Code: (require 'cl-lib) -(defcustom wisi-incremental-parse-enable nil +(defcustom wisi-incremental-parse-enable t "If non-nil, use incremental parse when possible." :type 'boolean :group 'wisi @@ -240,6 +240,11 @@ The value is a list (source-buffer (font-lock-begin region font-lock attempted to fontify while the parser was busy.") +(defvar wisi-parse-full-read-only nil + ;; Only one buffer can be doing a full parse. + "Non-nil if `wisi-parse-full-active is t and the buffer was +originally read-only.") + (cl-defgeneric wisi-parse-incremental (parser parser-action &key full nowait) "Incrementally parse current buffer. PARSER-ACTION (one of `wisi-post-parse-actions') is used to diff --git a/wisi-process-parse.el b/wisi-process-parse.el index f5efea4974..60bbdaa2bf 100644 --- a/wisi-process-parse.el +++ b/wisi-process-parse.el @@ -151,7 +151,9 @@ Otherwise add PARSER to `wisi-process--alist', return it." (wisi-parse-log-message wisi-parser-shared "parse--filter found prompt - initial full")) (if (buffer-live-p (car wisi-parse-full-active)) (with-current-buffer (car wisi-parse-full-active) - (read-only-mode -1) + (if wisi-parse-full-read-only + (setq wisi-parse-full-read-only nil) + (read-only-mode -1)) (let ((region (cdr wisi-parse-full-active))) (font-lock-flush (max (point-min) (car region)) (min (point-max) (cdr region)))) @@ -1212,6 +1214,7 @@ Source buffer is current." ((and full nowait) (set-process-filter (wisi-process--parser-process parser) #'wisi-process-parse--filter) (setq wisi-parse-full-active (cons (current-buffer) (cons (point-min) (point-max)))) + (setq wisi-parse-full-read-only buffer-read-only) (read-only-mode 1) (wisi-process-parse--send-incremental-parse parser full)) (t diff --git a/wisi.el b/wisi.el index 7ac38a6e9d..ba704d36f9 100644 --- a/wisi.el +++ b/wisi.el @@ -7,7 +7,7 @@ ;; Keywords: parser ;; indentation ;; navigation -;; Version: 4.3.0 +;; Version: 4.3.2 ;; package-requires: ((emacs "25.3") (seq "2.20")) ;; URL: https://stephe-leake.org/ada/wisitoken.html ;; diff --git a/wisitoken-bnf-generate.adb b/wisitoken-bnf-generate.adb index fbc83d0a8e..fa5f128841 100644 --- a/wisitoken-bnf-generate.adb +++ b/wisitoken-bnf-generate.adb @@ -54,7 +54,7 @@ is use Ada.Text_IO; First : Boolean := True; begin - Put_Line (Standard_Error, "version 4.2"); -- matches release version in Docs/wisitoken.html + Put_Line (Standard_Error, "version 4.2.1"); -- matches release version in Docs/wisitoken.html Put_Line (Standard_Error, "wisitoken-bnf-generate [options] {wisi grammar file}"); Put_Line (Standard_Error, "Generate source code implementing a parser for the grammar."); New_Line (Standard_Error); diff --git a/wisitoken-syntax_trees.adb b/wisitoken-syntax_trees.adb index 41232b6f14..7bcbcc31b9 100644 --- a/wisitoken-syntax_trees.adb +++ b/wisitoken-syntax_trees.adb @@ -7534,6 +7534,10 @@ package body WisiToken.Syntax_Trees is Shared_Link => Tree.Stream_First (Tree.Shared_Stream, Skip_SOI => True).Element.Cur, Elements => <>))) do + -- WORKAROUND: This is broken by gnat 13; ada-mode + -- test/ada_mode-function_2.adb fails with a ref_count error. + Tree.Enable_Ref_Count_Check (Result, Enable => False); + Tree.Next_Stream_Label := @ + 1; end return; end New_Stream;