1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2025-02-10 07:20:35 +01:00

- added compilation macros to use ECl processes procedures;

- added compilation macro to skip SBCL specific muffling condition procedures;
- added purgatory as dependency to installing script.
This commit is contained in:
cage 2022-03-20 12:32:41 +01:00
parent f4d7bb1e94
commit 9910da1837
4 changed files with 19 additions and 22 deletions

View File

@ -140,6 +140,7 @@ install_dependency () {
--eval "(ql:quickload \"babel\")" \ --eval "(ql:quickload \"babel\")" \
--eval "(ql:quickload \"percent-encoding\")" \ --eval "(ql:quickload \"percent-encoding\")" \
--eval "(ql:quickload \"trivial-clipboard\")" \ --eval "(ql:quickload \"trivial-clipboard\")" \
--eval "(ql:quickload \"purgatory\")" \
--eval "(sb-ext:quit)" --eval "(sb-ext:quit)"
} }

View File

@ -16,12 +16,10 @@
(in-package :constants) (in-package :constants)
(eval-when (:compile-toplevel :load-toplevel :execute) (defmacro actual-program-name ()
(defun actual-program-name () `(if (string= +program-name+ "tinmop")
(declare (sb-ext:muffle-conditions sb-ext:compiler-note)) +program-name+
(if (string= +program-name+ "tinmop") ,(format nil "~a (original name: \"tinmop\")" +program-name+)))
"tinmop"
(format nil "~a (original name: \"tinmop\")" +program-name+))))
(define-constant +help-about-message+ (define-constant +help-about-message+
(format nil (format nil

View File

@ -77,10 +77,10 @@
(defun parse-subwin-w (w-as-string) (defun parse-subwin-w (w-as-string)
"Parse a window width, `w-as-string' a fraction of the main window width" "Parse a window width, `w-as-string' a fraction of the main window width"
(declare (sb-ext:muffle-conditions sb-ext:compiler-note)) #+sbcl (declare (sb-ext:muffle-conditions sb-ext:compiler-note))
(parse-subwin-size w-as-string (win-width *main-window*))) (parse-subwin-size w-as-string (win-width *main-window*)))
(defun parse-subwin-h (h-as-string) (defun parse-subwin-h (h-as-string)
"Parse a window height, `h-as-string' a fraction of the main window height" "Parse a window height, `h-as-string' a fraction of the main window height"
(declare (sb-ext:muffle-conditions sb-ext:compiler-note)) #+sbcl (declare (sb-ext:muffle-conditions sb-ext:compiler-note))
(parse-subwin-size h-as-string (win-height *main-window*))) (parse-subwin-size h-as-string (win-height *main-window*)))

View File

@ -77,19 +77,17 @@
&key &key
(wait t) (wait t)
search search
#-win32 pty
input input
output output
(error :output)) (error :output))
#-win32 (sb-ext:run-program program (declare (ignorable search))
#+ecl (ext:run-program program
args args
:wait wait
:search search
:pty pty
:input input :input input
:output output :output output
:error error) :error error
#+win32 (sb-ext:run-program program :wait wait)
#+sbcl (sb-ext:run-program program
args args
:wait wait :wait wait
:search search :search search
@ -98,7 +96,8 @@
:error error)) :error error))
(defun process-exit-code (process) (defun process-exit-code (process)
(sb-ext:process-exit-code process)) #+ecl (nth-value 1 (ext:external-process-status process))
#+sbcl (sb-ext:process-exit-code process))
(defun process-exit-success-p (process) (defun process-exit-success-p (process)
(= (process-exit-code process) 0)) (= (process-exit-code process) 0))
@ -209,9 +208,8 @@
:search t :search t
:wait t :wait t
:output stream :output stream
:error :output)) :error :output)))
(exit-code (sb-ext:process-exit-code process))) (when (not (process-exit-success-p process))
(when (/= exit-code 0)
(error (format nil "File ~s extraction from ~s failed" file-entry zip-file)))))) (error (format nil "File ~s extraction from ~s failed" file-entry zip-file))))))
(defun copy-to-clipboard (text) (defun copy-to-clipboard (text)