|
@@ -1820,7 +1820,6 @@ This mode is a simplified version of `adoc-mode'." |
|
|
:group 'awk-preview) |
|
|
:group 'awk-preview) |
|
|
|
|
|
|
|
|
(defcustom awk-preview-default-program |
|
|
(defcustom awk-preview-default-program |
|
|
;; TODO: Use `substitute-command-keys' |
|
|
|
|
|
"# C-c C-l: Update preview C-c C-c: Commit and exit |
|
|
"# C-c C-l: Update preview C-c C-c: Commit and exit |
|
|
# C-c C-r: Resest to original C-c C-k: Abort |
|
|
# C-c C-r: Resest to original C-c C-k: Abort |
|
|
{ |
|
|
{ |
|
@@ -1848,18 +1847,19 @@ cases regardless of this variable." |
|
|
:group 'awk-preview) |
|
|
:group 'awk-preview) |
|
|
|
|
|
|
|
|
(cl-defstruct awk-preview--env |
|
|
(cl-defstruct awk-preview--env |
|
|
|
|
|
;; Whether awk-preview is currently running |
|
|
(running-p nil) |
|
|
(running-p nil) |
|
|
;; Point of beg in source buffer |
|
|
;; Point of beg in source buffer |
|
|
(point-beg nil) |
|
|
(point-beg nil) |
|
|
;; Point of end in source buffer |
|
|
;; Point of end in source buffer |
|
|
(point-end nil) |
|
|
(point-end nil) |
|
|
;; Point of beginning |
|
|
;; Point of beginning |
|
|
;; Used by preview buffer and always same as awk-preview--point-beg |
|
|
|
|
|
|
|
|
;; Used by preview buffer and always same as point-beg |
|
|
(preview-point-beg nil) |
|
|
(preview-point-beg nil) |
|
|
;; Point of beginning |
|
|
;; Point of beginning |
|
|
;; Used by preview buffer and may defferent from awk-preview--point-end |
|
|
|
|
|
|
|
|
;; Used by preview buffer and may defferent from point-end |
|
|
(preview-point-end nil) |
|
|
(preview-point-end nil) |
|
|
;; Awk preview program file name |
|
|
|
|
|
|
|
|
;; Awk preview program temporary file name |
|
|
(program-filename nil) |
|
|
(program-filename nil) |
|
|
;; Source buffer |
|
|
;; Source buffer |
|
|
(source-buffer nil) |
|
|
(source-buffer nil) |
|
@@ -1871,9 +1871,8 @@ cases regardless of this variable." |
|
|
(window-configuration nil) |
|
|
(window-configuration nil) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
(defvar awk-preview--env nil |
|
|
|
|
|
|
|
|
(defvar-local awk-preview--env nil |
|
|
"`awk-preview--env' struct object of currently running.") |
|
|
"`awk-preview--env' struct object of currently running.") |
|
|
(make-variable-buffer-local 'awk-preview--env) |
|
|
|
|
|
(put 'awk-preview--env |
|
|
(put 'awk-preview--env |
|
|
'permanent-local |
|
|
'permanent-local |
|
|
t) |
|
|
t) |
|
@@ -1997,6 +1996,7 @@ DISPLAY non-nil means redisplay buffer as output is inserted." |
|
|
(defun awk-preview-update-preview () |
|
|
(defun awk-preview-update-preview () |
|
|
"Update awk-preview." |
|
|
"Update awk-preview." |
|
|
(interactive) |
|
|
(interactive) |
|
|
|
|
|
(cl-assert awk-preview--env) |
|
|
(with-current-buffer (awk-preview--env-program-buffer awk-preview--env) |
|
|
(with-current-buffer (awk-preview--env-program-buffer awk-preview--env) |
|
|
(write-region (point-min) |
|
|
(write-region (point-min) |
|
|
(point-max) |
|
|
(point-max) |
|
@@ -2055,8 +2055,8 @@ DISPLAY non-nil means redisplay buffer as output is inserted." |
|
|
|
|
|
|
|
|
(defun awk-preview--cleanup() |
|
|
(defun awk-preview--cleanup() |
|
|
"Cleanup awk-preview buffers variables and files." |
|
|
"Cleanup awk-preview buffers variables and files." |
|
|
|
|
|
(cl-assert awk-preview--env) |
|
|
(with-current-buffer (awk-preview--env-source-buffer awk-preview--env) |
|
|
(with-current-buffer (awk-preview--env-source-buffer awk-preview--env) |
|
|
(cl-assert awk-preview--env) |
|
|
|
|
|
(kill-buffer (awk-preview--env-preview-buffer awk-preview--env)) |
|
|
(kill-buffer (awk-preview--env-preview-buffer awk-preview--env)) |
|
|
(when (and (not (buffer-file-name (awk-preview--env-program-buffer awk-preview--env))) |
|
|
(when (and (not (buffer-file-name (awk-preview--env-program-buffer awk-preview--env))) |
|
|
(if (eq 'ask |
|
|
(if (eq 'ask |
|
|