From 349c7171fbaeb2db492566af9daeb3a6465545c0 Mon Sep 17 00:00:00 2001 From: Jacob Hrbek Date: Tue, 1 Sep 2020 20:23:05 +0200 Subject: [PATCH] sync for reymacs development --- .../zeres-0/elisp/UNLEASH.el | 15 +++--- .../zeres-0/elisp/output/die.el | 34 ++++++------- .../zeres-0/elisp/output/edebug.el | 6 +-- .../zeres-0/elisp/output/eerror.el | 10 ++-- .../zeres-0/elisp/output/efixme.el | 6 +-- .../zeres-0/elisp/output/einfo.el | 6 +-- .../zeres-0/elisp/output/ewarn.el | 9 ++-- .../zeres-0/elisp/variables/emacs-debug.el | 0 .../zeres-0/elisp/variables/emacs-log-file.el | 49 ++++++++++++++----- 9 files changed, 81 insertions(+), 54 deletions(-) mode change 100644 => 100755 src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-debug.el mode change 100644 => 100755 src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-log-file.el diff --git a/src/RXT0112-1/downstream-classes/zeres-0/elisp/UNLEASH.el b/src/RXT0112-1/downstream-classes/zeres-0/elisp/UNLEASH.el index d280e50..010be09 100755 --- a/src/RXT0112-1/downstream-classes/zeres-0/elisp/UNLEASH.el +++ b/src/RXT0112-1/downstream-classes/zeres-0/elisp/UNLEASH.el @@ -3,17 +3,20 @@ ;; Created by Jacob Hrbek identified with an e-mail and GPG signature <0x765AED304211C28410D5C478FCBA0482B0AB9F10> under all rights reserved in 26/08/2020 11:11:38 CEST ;; WARNING: NOT IMPLEMENTED! -(message "NOT IMPLEMENTED!") -(kill-emacs 36) +;(message "NOT IMPLEMENTED!") +;(kill-emacs 36) -;; Source variables -(load "/home/kreyren/Repositories/Zernit/src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-debug.el") -(load "/home/kreyren/Repositories/Zernit/src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-log-file.el") +(require 'cl-lib) ;; Source wrappers (load "/home/kreyren/Repositories/Zernit/src/RXT0112-1/downstream-classes/zeres-0/elisp/wrappers/zn-defun.el") (load "/home/kreyren/Repositories/Zernit/src/RXT0112-1/downstream-classes/zeres-0/elisp/wrappers/zn-defvar.el") +;; Source variables +(load "/home/kreyren/Repositories/Zernit/src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-debug.el") +(load "/home/kreyren/Repositories/Zernit/src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-log-file.el") +;;(setq emacs-log-file "/home/kreyren/emacs.log") + ;; Source functions (load "/home/kreyren/Repositories/Zernit/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/die.el") (load "/home/kreyren/Repositories/Zernit/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/ewarn.el") @@ -22,4 +25,4 @@ (load "/home/kreyren/Repositories/Zernit/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/edebug.el") (load "/home/kreyren/Repositories/Zernit/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/eerror.el") -(die "true" "dasdgag") +(die "true") diff --git a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/die.el b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/die.el index fd09bdb..5c5d484 100755 --- a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/die.el +++ b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/die.el @@ -34,6 +34,7 @@ (defvar die-format-string-buunexpectedg-debug "UNEXPECTED: %s\n" "Non-standard variable storing formatting string for non-standard function `die' to be used for debugging output using unexpected trap") (defvar die-format-string-unexpected-debug-log "UNEXPECTED: %s\n" "Non-standard variable storing formatting string for non-standard function `die' to be used for debugging log entry using unexpected trap") +;; FIXME-TEST: Make sure that function 'die' works after changes (zn-defun die (exitcode &optional message) "Reimplementation of a non-standard function provided by the Zernit project (https://github.com/RXT0112/Zernit/blob/master/src/RXT0112-1/downstream-classes/zeres-0/bash/output/die.sh) into an emacs lisp that allow assertion of elisp runner with specified exit code and message with logging and debugging. @@ -63,8 +64,7 @@ Requires following variables: ;; Process the message by lenght and debug state ((> (length message) 0) (cond - ;; FIXME: This does not trigger if message is unbound or "" - ((> (lenght message) 0) + ((or (= (length message) 0) (boundp 'message)) (princ (format die-format-string-success message)) (append-to-file (format die-format-string-success-log message) nil emacs-log-file) ) ;; FIXME: Implement logic that triggers only when emacs-debug contains 'function-name @@ -73,10 +73,11 @@ Requires following variables: (append-to-file (format die-format-string-success-debug-log message) nil emacs-log-file ) ) (t (princ (format die-format-string-bug "Function '%1$s' with argument '%2$s' triggered unexpected case while processing variable 'emacs-debug' containing value '%3$s'" function-name exitcode emacs-debug)) ) - ) ) - ((= (length message) 0) - (princ (format die-format-string-success message "Logically determined that processed finished successfully")) - (append-to-file (format die-format-string-success-log message "Logically determined that processed finished successfully") nil emacs-log-file) ) + ) + ) + ((or (= (length message) 0) (boundp 'message)) + (princ (format die-format-string-success "Logically determined that processed finished successfully")) + (append-to-file (format die-format-string-success-log "Logically determined that processed finished successfully") nil emacs-log-file) ) (t (princ (format die-format-string-bug (format "Function '%1$s' tripped unexpected trap while processing message '%2$s' with argument '%3$s'" function-name message exitcode))) (append-to-file (format die-format-string-bug-log (format "Function '%1$s' tripped unexpected trap while processing message '%2$s' with argument '%3$s'" function-name message exitcode)) nil emacs-log-file ) @@ -98,8 +99,7 @@ Requires following variables: ;; Process the message by lenght and debug state ((> (length message) 0) (cond - ;; FIXME: This does not trigger if message is unbound or "" - ((> (lenght message) 0) + ((> (length message) 0) (princ (format die-format-string-failure message)) (append-to-file (format die-format-string-failure-log message) nil emacs-log-file) ) ;; FIXME: Implement logic that triggers only when emacs-debug contains 'function-name @@ -109,7 +109,7 @@ Requires following variables: (t (princ (format die-format-string-bug "Function '%1$s' with argument '%2$s' triggered unexpected case while processing variable 'emacs-debug' containing value '%3$s'" function-name exitcode emacs-debug)) ) ) ) - ((= (length message) 0) + ((or (= (length message) 0) (boundp 'message)) (princ (format die-format-string-failure message "Logically determined that process failed")) (append-to-file (format die-format-string-failure-log message "Logically determined that processed failed") nil emacs-log-file) ) (t @@ -134,7 +134,7 @@ Requires following variables: ((> (length message) 0) (cond ;; FIXME: This does not trigger if message is unbound or "" - ((> (lenght message) 0) + ((> (length message) 0) (princ (format die-format-string-security message)) (append-to-file (format die-format-string-security-log message) nil emacs-log-file) ) ;; FIXME: Implement logic that triggers only when emacs-debug contains 'function-name @@ -144,7 +144,7 @@ Requires following variables: (t (princ (format die-format-string-bug "Function '%1$s' with argument '%2$s' triggered unexpected case while processing variable 'emacs-debug' containing value '%3$s'" function-name exitcode emacs-debug)) ) ) ) - ((= (length message) 0) + ((or (= (length message) 0) (boundp 'message)) (princ (format die-format-string-security message "Runtime tripped security trap, exitting for safety")) (append-to-file (format die-format-string-security-log message "Runtime tripped security trap, exitting for safety") nil emacs-log-file) ) (t @@ -160,7 +160,7 @@ Requires following variables: ((> (length message) 0) (cond ;; FIXME: This does not trigger if message is unbound or "" - ((> (lenght message) 0) + ((> (length message) 0) (princ (format die-format-string-fixme message)) (append-to-file (format die-format-string-fixme-log message) nil emacs-log-file) ) ;; FIXME: Implement logic that triggers only when emacs-debug contains 'function-name @@ -170,7 +170,7 @@ Requires following variables: (t (princ (format die-format-string-bug "Function '%1$s' with argument '%2$s' triggered unexpected case while processing variable 'emacs-debug' containing value '%3$s'" function-name exitcode emacs-debug)) ) ) ) - ((= (length message) 0) + ((or (= (length message) 0) (boundp 'message)) (princ (format die-format-string-fixme message "Runtime tripped fixme trap with no message provided, this is likely a bug where developer forgot to provide a message")) (append-to-file (format die-format-string-fixme-log message "Runtime tripped fixme trap with no message provided, this is likely a bug where developer forgot to provide a message") nil emacs-log-file) ) (t @@ -186,7 +186,7 @@ Requires following variables: ((> (length message) 0) (cond ;; FIXME: This does not trigger if message is unbound or "" - ((> (lenght message) 0) + ((> (length message) 0) (princ (format die-format-string-bug message)) (append-to-file (format die-format-string-bug-log message) nil emacs-log-file) ) ;; FIXME: Implement logic that triggers only when emacs-debug contains 'function-name @@ -196,7 +196,7 @@ Requires following variables: (t (princ (format die-format-string-bug "Function '%1$s' with argument '%2$s' triggered unexpected case while processing variable 'emacs-debug' containing value '%3$s'" function-name exitcode emacs-debug)) ) ) ) - ((= (length message) 0) + ((or (= (length message) 0) (boundp 'message)) (princ (format die-format-string-bug message "Runtime tripped bug trap with no message provided, this is likely a bug where developer forgot to provide a message")) (append-to-file (format die-format-string-bug-log message "Runtime tripped bug trap with no message provided, this is likely a bug where developer forgot to provide a message") nil emacs-log-file) ) (t @@ -212,7 +212,7 @@ Requires following variables: ((> (length message) 0) (cond ;; FIXME: This does not trigger if message is unbound or "" - ((> (lenght message) 0) + ((> (length message) 0) (princ (format die-format-string-unexpected message)) (append-to-file (format die-format-string-unexpected-log message) nil emacs-log-file) ) ;; FIXME: Implement logic that triggers only when emacs-debug contains 'function-name @@ -222,7 +222,7 @@ Requires following variables: (t (princ (format die-format-string-bug "Function '%1$s' with argument '%2$s' triggered unexpected case while processing variable 'emacs-debug' containing value '%3$s'" function-name exitcode emacs-debug)) ) ) ) - ((= (length message) 0) + ((or (= (length message) 0) (boundp 'message)) (princ (format die-format-string-unexpected message "Runtime tripped unexpected trap with no message provided, this is likely a bug where developer forgot to provide a message")) (append-to-file (format die-format-string-unexpected-log message "Runtime tripped unexpected trap with no message provided, this is likely a bug where developer forgot to provide a message") nil emacs-log-file) ) (t diff --git a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/edebug.el b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/edebug.el index f7a237b..f2e372c 100644 --- a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/edebug.el +++ b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/edebug.el @@ -9,14 +9,14 @@ "Non-standard function used to output in the buffer with logging support to annoy the end-user with fixme messages for code quality issues that might influence the runtime" (cond - ((= (lenght message ) 0) - (princ (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message)) + ((or (= (length message) 0) (boundp 'message)) + (princ (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message))) (append-to-file (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message)) nil emacs-log-file) ) ((> (lenght message) 0) (princ (format edebug-format-string message) (append-to-file (format edebug-format-string message) nil emacs-log-file)) ) (t - (princ (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message)) + (princ (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message))) (append-to-file (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message)) nil emacs-log-file) ) ) diff --git a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/eerror.el b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/eerror.el index 28604b4..252c36d 100644 --- a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/eerror.el +++ b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/eerror.el @@ -8,14 +8,14 @@ "Non-standard function used to output in the buffer with logging support to inform the end-user about non-fatal errors" (cond - ((= (lenght message ) 0) - (princ (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message)) + ((or (= (length message) 0) (boundp 'message)) + (princ (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message))) (append-to-file (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message)) nil emacs-log-file) ) ((> (lenght message) 0) - (princ (format eerror-format-string message) - (append-to-file (format eerror-format-string message) nil emacs-log-file)) ) + (princ (format eerror-format-string message)) + (append-to-file (format eerror-format-string message) nil emacs-log-file)) (t - (princ (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message)) + (princ (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message))) (append-to-file (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message)) nil emacs-log-file) ) ) diff --git a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/efixme.el b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/efixme.el index d294b11..47fca2e 100644 --- a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/efixme.el +++ b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/efixme.el @@ -9,14 +9,14 @@ "Non-standard function used to output in the buffer with logging support to annoy the end-user with fixme messages for code quality issues that might influence the runtime" (cond - ((= (lenght message ) 0) + ((or (= (length message) 0) (boundp 'message)) (princ (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message)) - (append-to-file (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message)) nil emacs-log-file) ) + (append-to-file (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message)) nil emacs-log-file)) ) ((> (lenght message) 0) (princ (format efixme-format-string message) (append-to-file (format efixme-format-string message) nil emacs-log-file)) ) (t - (princ (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message)) + (princ (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message))) (append-to-file (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message)) nil emacs-log-file) ) ) diff --git a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/einfo.el b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/einfo.el index 0e8d7dd..c60709a 100644 --- a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/einfo.el +++ b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/einfo.el @@ -8,14 +8,14 @@ "Non-standard function used to output in the buffer with logging support to inform the end-user about runtime events" (cond - ((= (lenght message ) 0) - (princ (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message)) + ((or (= (length message) 0) (boundp 'message)) + (princ (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message))) (append-to-file (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message)) nil emacs-log-file) ) ((> (lenght message) 0) (princ (format einfo-format-string message) (append-to-file (format einfo-format-string message) nil emacs-log-file)) ) (t - (princ (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message)) + (princ (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message))) (append-to-file (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message)) nil emacs-log-file) ) ) diff --git a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/ewarn.el b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/ewarn.el index 0a57221..4847db5 100644 --- a/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/ewarn.el +++ b/src/RXT0112-1/downstream-classes/zeres-0/elisp/output/ewarn.el @@ -8,15 +8,14 @@ "Non-standard function used to output in the buffer with logging support to warn the end-user about potential issues" (cond - ((= (lenght message ) 0) + ((or (= (length message) 0) (boundp 'message)) (princ (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message)) (append-to-file (format die-format-string-bug (format "Function '%1$s' was used without specified message '%2$s'" function-name message)) nil emacs-log-file) ) ((> (lenght message) 0) - (princ (format ewarn-format-string message) - (append-to-file (format ewarn-format-string message) nil emacs-log-file)) ) + (princ (format ewarn-format-string message)) + (append-to-file (format ewarn-format-string message) nil emacs-log-file) ) (t (princ (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message)) - (append-to-file (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message)) nil emacs-log-file) - ) + (append-to-file (format die-format-string-unexpected (format "Function '%1$s' with argument 'message' storing value '%2$s' triggered an unexpected trap which usually indicates insufficient programming logic" function-name message)) nil emacs-log-file))) ) ) ) diff --git a/src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-debug.el b/src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-debug.el old mode 100644 new mode 100755 diff --git a/src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-log-file.el b/src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-log-file.el old mode 100644 new mode 100755 index b768e70..ef1b44c --- a/src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-log-file.el +++ b/src/RXT0112-1/downstream-classes/zeres-0/elisp/variables/emacs-log-file.el @@ -2,33 +2,58 @@ ":"; exec emacs --script "$0" "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*- ;; Created by Jacob Hrbek identified with an electronic mail and GPG signature <0x765AED304211C28410D5C478FCBA0482B0AB9F10> under all rights reserved in 26/08/2020 11:11:38 CEST +;; RELEVANT: XDG specification used for non-standard file hiearchy on unix https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html + ;; FIXME-QA: Wrap defvar simmilar to defun so that we can use 'var-name' (zn-defvar emacs-log-file (cl-case system-type ((gnu gnu/linux gnu/kfreebsd darwin cygwin aix berkeley-unix hpux irix usg-unix-v) + ;;; Find the file to write logs into + ;;; On Linux this should be writing in '/var/log/emacs/emacs-version/emacs.log' assuming it being present else '$HOME/.local/share/emacs/emacs-version/emacs.log' (cond ;; Check if we can use XDG_DATA_HOME variable - ((= (lenght (getenv "XDG_DATA_HOME")) 0) + ;; Check if we can write in /var/log/emacs/emacs-version/emacs.log + ((file-writable-p (format "%1$s%2$s%3$s" "/var/log/emacs/" emacs-build-number "/emacs.log")) + (concat (format "%1$s%2$s%3$s" "/var/log/emacs/" emacs-build-number "/emacs.log")) ) + ((> (length (getenv "XDG_DATA_HOME")) 0) + ;; FIXME-QA: Make sure that XDG_DATA_HOME is present + (cond + ((file-writable-p (concat (getenv "XDG_DATA_HOME") (format "%1$s%2$s" "/emacs/" emacs-build-number "/emacs.log"))) + (concat (getenv "XDG_DATA_HOME") (format "%1$s%2$s" "/emacs/" emacs-build-number "/emacs.log")) ) + (t + (princ "FATAL: %1$s\n" (format "Path '%1$s' is not writable and thus can not be used for a logging file" (concat (getenv "XDG_DATA_HOME") (format "%1$s%2$s" "/emacs/" emacs-build-number "/emacs.log")))) ) + ) + ) + ((= (length (getenv "XDG_DATA_HOME")) 0) ;; FIXME-QA: Make sure that HOME is present ;; FIXME-QA: Make sure that HOME is writable - (string (getenv "HOME")"emacs.log") ) - ((> (lenght (getenv "XDG_DATA_HOME")) 0) - ;; FIXME-QA: Make sure that XDG_DATA_HOME is present - ;; FIXME-QA: Make sure that XDG_DATA_HOME is writable - (string (getenv "XDG_DATA_HOME")"emacs/emacs.log") ) + (cond + ((> (length (getenv "HOME")) 0) + ;; FIXME-QA: Output message inside zn-defvar's argument without getting 'Invalid function' fatal err + ;;(princ "WARN: %1$s\n" (format "Variable 'XDG_DATA_HOME' is storing a blank value '%1$s' and so it can't be used for logging, using '%2$s'" (getenv "XDG_DATA_HOME") (concat (getenv "HOME")"/emacs.log") )) + (concat (getenv "HOME")"/emacs.log") ) + (t + (princ "WARN: %1$s\n" (format "Unable to define variable '%1s$' as variable 'HOME' is storing a blank value '%2$s', thus we are unable to generate a log file" var-name (getenv HOME))) + (concat nil)) + ) + ) (t - (princ (format die-format-string-bug (format "Unexpected happend while defining variable '%1$s' checking for the lenght of 'XDG_DATA_HOME' variable that stores value '%2$s'" var-name (getenv XDG_DATA_HOME)))) + (princ (format "BUG: %1$s\n" (format "Unexpected happend while defining variable '%1$s' checking for the lenght of 'XDG_DATA_HOME' variable that stores value '%2$s'" var-name (getenv XDG_DATA_HOME)))) (append-to-file (format die-format-string-bug (format die-format-string-bug (format "Unexpected happend while defining variable '%1$s' checking for the lenght of 'XDG_DATA_HOME' variable that stores value '%2$s'" var-name (getenv "XDG_DATA_HOME")))) nil emacs-log-file) (kill-emacs 250) ) ) ) ((windows-nt ms-dos) ;; FIXME: Provide a default INITVALUE that contains a sane path to be used for a logging file - (princ (format die-format-string-fixme (format "Platform '%1$s' is not implemented in a non-standard variable '%2$s' to provide INITVALUE" system-type var-name))) + (princ (format "FIXME: %1$s\n" (format "Platform '%1$s' is not implemented in a non-standard variable '%2$s' to provide INITVALUE" system-type var-name))) (kill-emacs 28) ) - (otherwise - (princ (format die-format-string-unexpected (format "Platform '%1$s' is not implemented in defining variable '%2$s'" system-type var-name))) - (append-to-file (format die-format-string-unexpected (format "Platform '%1$s' is not implemented in function '%2$s' to handle assertion for argument '%3$s'" system-type function-name exitcode)) nil emacs-log-file ) + (t + (princ (format "UNEXPECTED: %1$s\n" (format "Platform '%1$s' is not implemented in defining variable '%2$s'" system-type var-name))) + (append-to-file (format "UNEXPECTED: %1$s\n" (format "Platform '%1$s' is not implemented in function '%2$s' to handle assertion for argument '%3$s'" system-type function-name exitcode)) nil emacs-log-file ) (kill-emacs 250) ) ) - "Non-standard variable used by logging backend of the zernit project to generate a log file using programming logic, This must be set otherwise the function is going to fail." + "Non-standard variable used by logging backend of the zernit project to generate a log file using programming logic implemented by zernit project + + On linux this expects environmental variables: + - XDG_DATA_HOME: Used for finding a location used for a log file, if not set it uses HOME/emacs.log + - HOME: Used for finding a location for a log file in case XDG_DATA_HOME is not set, sets itself to 'nil' if HOME is not writable" )