#+BEGIN_SRC emacs-lisp :tangle ./early-init.el
(setq gc-cons-threshold most-positive-fixnum
- gc-cons-percentage 0.6)
+ gc-cons-percentage 0.6)
(add-hook 'after-init-hook #'(lambda () (setq gc-cons-threshold (* 1024 1024 25)
- gc-cons-percentage 0.1)))
+ gc-cons-percentage 0.1)))
#+END_SRC
** Basic UI preferences
(blink-cursor-mode -1)
(setq inhibit-startup-screen t
- inhibit-startup-buffer-menu t
- initial-scratch-message (message ";;; Emacs loaded in %s.\n\n" (emacs-init-time))
- server-client-instructions nil
- frame-resize-pixelwise t)
+ inhibit-startup-buffer-menu t
+ initial-scratch-message (message ";;; Emacs loaded in %s.\n\n" (emacs-init-time))
+ server-client-instructions nil
+ frame-resize-pixelwise t)
#+END_SRC
I am fine with the default theme, as long as the background color is similar to engineering paper. Also make every frame open full-screen, and re-emphasize the desire for no scroll-bars.
#+BEGIN_SRC emacs-lisp :tangle ./early-init.el
(setq default-frame-alist '((background-color . "#cae0a6")
- (fullscreen . maximized)
- (vertical-scroll-bars . nil)))
+ (fullscreen . maximized)
+ (vertical-scroll-bars . nil)))
#+END_SRC
** Misc/odd issues
(openwith-mode t))
(setq openwith-associations (list
- (list (openwith-make-extension-regexp
- '("xls" "xlsx" "doc" "docx"
- "ppt" "odt" "ods" "odg" "odp"))
- "LibreOffice"
- '(file))
- (list (openwith-make-extension-regexp
- '("adpro"))
- "ProductivitySuite"
- '(file))))
+ (list (openwith-make-extension-regexp
+ '("xls" "xlsx" "doc" "docx"
+ "ppt" "odt" "ods" "odg" "odp"))
+ "LibreOffice"
+ '(file))
+ (list (openwith-make-extension-regexp
+ '("adpro"))
+ "ProductivitySuite"
+ '(file))))
#+END_SRC
** Non-Package customization
#+BEGIN_SRC emacs-lisp
(setq-default indicate-empty-lines t
- fill-column 80
- tab-width 4
- cursor-type 'bar
- cursor-in-non-selected-windows 'hollow)
+ fill-column 80
+ cursor-type 'bar
+ cursor-in-non-selected-windows 'hollow)
#+END_SRC
*** Backup/Autosave
#+BEGIN_SRC emacs-lisp
(setq vc-make-backup-files t
- backup-by-copying t
- backup-directory-alist `((".*" . ,temporary-file-directory)))
+ backup-by-copying t
+ backup-directory-alist `((".*" . ,temporary-file-directory)))
#+END_SRC
**** Old versions
#+BEGIN_SRC emacs-lisp
(setq delete-old-versions t
- kept-new-versions 5
- kept-old-versions 5)
+ kept-new-versions 5
+ kept-old-versions 5)
#+END_SRC
*** File handling
#+BEGIN_SRC emacs-lisp
(setq attempt-stack-overflow-recovery nil
- attempt-orderly-shutdown-on-fatal-signal nil)
+ attempt-orderly-shutdown-on-fatal-signal nil)
#+END_SRC
I want to strip all trailing whitespace on save, and I want to make all shell scripts executable at the same time.
#+BEGIN_SRC emacs-lisp
(setq ring-bell-function 'ignore
- use-short-answers t
- use-file-dialog nil
- echo-keystrokes 0.1
- read-buffer-completion-ignore-case t
- history-delete-duplicates t)
+ use-short-answers t
+ use-file-dialog nil
+ echo-keystrokes 0.1
+ read-buffer-completion-ignore-case t
+ history-delete-duplicates t)
#+END_SRC
*** Buffer interaction
Save pastes from elsewhere into the kill-ring, and don't ask me about killing processes when I kill a buffer.
#+BEGIN_SRC emacs-lisp
(setq save-interprogram-paste-before-kill t
- confirm-kill-processes nil)
+ confirm-kill-processes nil)
#+END_SRC
**** Scrolling
(defun acme-mouse-kill (ev)
(interactive "e")
(when (use-region-p)
- (call-interactively 'kill-region)))
+ (call-interactively 'kill-region)))
;; (global-set-key (kbd "<mouse-2>") 'acme-mouse-kill)
;; (global-set-key (kbd "<mouse-3>") 'mouse-yank-at-click)
I want nice symbols to look at
#+BEGIN_SRC emacs-lisp
(setq prettify-symbols-alist '(("lambda" . 955)
- ("delta" . 120517)
- ("epsilon" . 120518)
- ("->" . 8594)
- ("<=" . 8804)
- (">=" . 8805)))
+ ("delta" . 120517)
+ ("epsilon" . 120518)
+ ("->" . 8594)
+ ("<=" . 8804)
+ (">=" . 8805)))
(global-prettify-symbols-mode t)
#+END_SRC
#+BEGIN_SRC emacs-lisp
(setq show-paren-delay 0
- show-paren-style 'expression)
+ show-paren-style 'expression)
#+END_SRC
Make the paren "highlight" the same color as the background, and add underline. This adds some amount of "highlighting", since the background color overrides the color set by =hl-line-mode=. Setting the background to nil required me to evaluate the expression again after loading.
#+BEGIN_SRC emacs-lisp
(set-face-attribute 'show-paren-match nil
- :background "#cae0a6"
- :underline t)
+ :background "#cae0a6"
+ :underline t)
#+END_SRC
*** Modeline
I don't like the box around the modeline. In Emacs 29, the face attribute for mode-line will change to mode-line-active
#+BEGIN_SRC emacs-lisp
(set-face-attribute 'mode-line nil
- :background "grey75"
- :foreground "black"
- :box nil)
+ :background "grey75"
+ :foreground "black"
+ :box nil)
(set-face-attribute 'mode-line-inactive nil
- :background "grey90"
- :foreground "dim grey"
- :box nil)
+ :background "grey90"
+ :foreground "dim grey"
+ :box nil)
#+END_SRC
*** C-Style
(defun c-lineup-arglist-tabs-only (ignored)
"Line up argument lists by tabs, not spaces. Stolen from https://kernel.org/doc/html/v4.10/process/coding-style.html"
(let* ((anchor (c-langelem-pos c-syntactic-element))
- (column (c-langelem-2nd-pos c-syntactic-element))
- (offset (- (1+ column) anchor))
- (steps (floor offset c-basic-offset)))
- (* (max steps 1)
- c-basic-offset)))
+ (column (c-langelem-2nd-pos c-syntactic-element))
+ (offset (- (1+ column) anchor))
+ (steps (floor offset c-basic-offset)))
+ (* (max steps 1)
+ c-basic-offset)))
(add-hook 'c-mode-common-hook
- (lambda ()
- ;; Add kernel style
- (c-add-style
- "linux-tabs-only"
- '("linux"
- (c-offsets-alist
- (arglist-cont-nonempty
- c-lineup-gcc-asm-reg
- c-lineup-arglist-tabs-only))))))
+ (lambda ()
+ ;; Add kernel style
+ (c-add-style
+ "linux-tabs-only"
+ '("linux"
+ (c-offsets-alist
+ (arglist-cont-nonempty
+ c-lineup-gcc-asm-reg
+ c-lineup-arglist-tabs-only))))))
(add-hook 'c-mode-hook
- (lambda ()
- (setq indent-tabs-mode t)
- (setq show-trailing-whitespace t)
- (c-set-style "linux-tabs-only")))
+ (lambda ()
+ (setq indent-tabs-mode t)
+ (setq show-trailing-whitespace t)
+ (c-set-style "linux-tabs-only")))
#+END_SRC
*** Windows-Specific
#+BEGIN_SRC emacs-lisp
(when (equal system-type 'windows-nt)
(setq delete-by-moving-to-trash t
- ediff-diff-program "\"c:/Program Files/Git/usr/bin/diff.exe\""
- ediff-diff3-program "\"c:/Program Files/Git/usr/bin/diff3.exe\""
- diff-command "\"c:/Program Files/Git/usr/bin/diff.exe\""
- w32-recognize-altgr 'nil))
+ ediff-diff-program "\"c:/Program Files/Git/usr/bin/diff.exe\""
+ ediff-diff3-program "\"c:/Program Files/Git/usr/bin/diff3.exe\""
+ diff-command "\"c:/Program Files/Git/usr/bin/diff.exe\""
+ w32-recognize-altgr 'nil))
#+END_SRC
** org configuration
I had this in a use-package declaration, but I find this a little nicer.
Just some basic stuff. I don't think I've seen too many configs that don't have at least most of these.
#+BEGIN_SRC emacs-lisp
(setq org-M-RET-may-split-line nil
- org-return-follows-link t
- org-agenda-restore-windows-after-quit t
- org-use-fast-todo-selection 'expert
- org-enforce-todo-dependencies t
- org-enforce-todo-checkbox-dependencies t
- org-agenda-start-on-weekday nil
- org-catch-invisible-edits 'error)
+ org-return-follows-link t
+ org-agenda-restore-windows-after-quit t
+ org-use-fast-todo-selection 'expert
+ org-enforce-todo-dependencies t
+ org-enforce-todo-checkbox-dependencies t
+ org-agenda-start-on-weekday nil
+ org-catch-invisible-edits 'error)
#+END_SRC
*** Bindings
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)
(add-hook 'org-mode-hook (lambda ()
- (define-key org-mode-map (kbd "C-'") nil)))
+ (define-key org-mode-map (kbd "C-'") nil)))
#+END_SRC
*** Directories
Tell org where everything is, also let me refile anywhere.
#+BEGIN_SRC emacs-lisp
(setq org-directory "~/org"
- org-agenda-files '("~/org/"
- "~/org/kasten/")
- org-refile-targets '((nil :maxlevel . 9)
- org-agenda-files :maxlevel . 9)
- org-default-notes-file (concat org-directory "/notes.org"))
+ org-agenda-files '("~/org/"
+ "~/org/kasten/")
+ org-refile-targets '((nil :maxlevel . 9)
+ org-agenda-files :maxlevel . 9)
+ org-default-notes-file (concat org-directory "/notes.org"))
#+END_SRC
*** Keywords and Filtering
Set up some more keywords, and add a filter for unscheduled todo items.
#+BEGIN_SRC emacs-lisp
(setq org-todo-keywords '((sequence "TODO(t@)" "WAITING(w@)" "IN-PROGRESS(i@)" "APPT(a@)" "|"
- "DELEGATED(l@)" "DONE(d@)" "CANCELLED(c@)"))
- org-agenda-custom-commands '(("n" "Agenda and all TODOs"
- ((agenda "") (alltodo "")))
- ("u" "Unscheduled TODOs"
- alltodo "" ((org-agenda-skip-function
- (lambda nil
- (org-agenda-skip-entry-if 'scheduled
- 'deadline
- 'regexp "\n]+>")))
- (org-agenda-overriding-header "Unscheduled TODO entries: ")))))
+ "DELEGATED(l@)" "DONE(d@)" "CANCELLED(c@)"))
+ org-agenda-custom-commands '(("n" "Agenda and all TODOs"
+ ((agenda "") (alltodo "")))
+ ("u" "Unscheduled TODOs"
+ alltodo "" ((org-agenda-skip-function
+ (lambda nil
+ (org-agenda-skip-entry-if 'scheduled
+ 'deadline
+ 'regexp "\n]+>")))
+ (org-agenda-overriding-header "Unscheduled TODO entries: ")))))
#+END_SRC
*** Zettelkasten
Capture Templates per my proclivities.
#+BEGIN_SRC emacs-lisp
(setq org-capture-templates '(("n" "Note" entry (file+olp org-default-notes-file "Notes") "* %u %?")
- ("t" "TODO" entry (file+olp org-default-notes-file "Tasks") "* TODO %? \n %u")
- ("s" "Service" entry (file+olp org-default-notes-file "Service") "* TODO %? \n %u")
- ("z" "Zettel" entry (file erfassen-zettel) "* %? ::")))
+ ("t" "TODO" entry (file+olp org-default-notes-file "Tasks") "* TODO %? \n %u")
+ ("s" "Service" entry (file+olp org-default-notes-file "Service") "* TODO %? \n %u")
+ ("z" "Zettel" entry (file erfassen-zettel) "* %? ::")))
#+END_SRC
*** Auto-archive
(interactive)
(org-map-entries
(lambda ()
- (org-archive-subtree)
- (setq org-map-continue-from (org-element-property :begin (org-element-at-point))))
+ (org-archive-subtree)
+ (setq org-map-continue-from (org-element-property :begin (org-element-at-point))))
"TODO=\"DONE\"|TODO=\"CANCELLED\"|TODO=\"DELEGATED\""
'file)
(save-buffer))
Some basic settings for dealing with source code in an org file. Don't make a new window for source-code edits, and keep indentation consistent.
#+BEGIN_SRC emacs-lisp
(setq org-src-window-setup 'current-window
- org-src-preserve-indentation t)
+ org-src-preserve-indentation t)
#+END_SRC
Make a function to tangle this file, and run it on save.
"Tangle and compile init.org.
Stolen from https://github.com/larstvei/dot-emacs."
(when (equal (buffer-file-name)
- (expand-file-name (concat user-emacs-directory "init.org")))
- (let ((prog-mode-hook nil))
- (org-babel-tangle))))
+ (expand-file-name (concat user-emacs-directory "init.org")))
+ (let ((prog-mode-hook nil))
+ (org-babel-tangle))))
(add-hook 'after-save-hook 'tangle-init)
#+END_SRC
For some reason, the org people decided that =verbatim= doesn't actually mean =verbatim=! This attempts to fix that. I found this solution at [[https://emacs.stackexchange.com/questions/13820/inline-verbatim-and-code-with-quotes-in-org-mode][stackexchange]].
#+BEGIN_SRC emacs-lisp
(eval-after-load "org" '(lambda ()
- (setcar (nthcdr 2 org-emphasis-regexp-components) " \t\r\n,")
- (org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components)
- (org-element--set-regexps)))
+ (setcar (nthcdr 2 org-emphasis-regexp-components) " \t\r\n,")
+ (org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components)
+ (org-element--set-regexps)))
#+END_SRC
** Dired configuration
(setq dired-listing-switches "-alv --group-directories-first")
(add-hook 'dired-mode-hook
- (lambda ()
- (dired-hide-details-mode t)
- (define-key dired-mode-map
- (kbd "RET") 'dired-find-alternate-file)))
+ (lambda ()
+ (dired-hide-details-mode t)
+ (define-key dired-mode-map
+ (kbd "RET") 'dired-find-alternate-file)))
#+END_SRC
** Eshell configuration
#+BEGIN_SRC emacs-lisp
(add-hook 'eshell-mode-hook (lambda ()
- (setq-local corfu-auto nil)
- (corfu-mode)))
+ (setq-local corfu-auto nil)
+ (corfu-mode)))
#+END_SRC
*** Send on Close-Paren
(interactive)
(insert-char ?\))
(cond ((= 0 (car (syntax-ppss)))
- (eshell-send-input))
- ((< (car (syntax-ppss)) 0)
- (message "Check flush-cache"))))
+ (eshell-send-input))
+ ((< (car (syntax-ppss)) 0)
+ (message "Check flush-cache"))))
#+END_SRC
*** Quit or delete-char
Stolen from https://depp.brause.cc/dotemacs"
(interactive "p")
(if (and (eolp) (looking-back eshell-prompt-regexp 0 t))
- (eshell-life-is-too-much) ; https://emacshorrors.com/post/life-is-too-much
- (delete-char arg)))
+ (eshell-life-is-too-much) ; https://emacshorrors.com/post/life-is-too-much
+ (delete-char arg)))
#+END_SRC
*** Bind the defuns
#+BEGIN_SRC emacs-lisp
(add-hook 'eshell-mode-hook
- (lambda ()
- (define-key eshell-mode-map (kbd ")") 'eshell-send-on-close-paren)
- (define-key eshell-mode-map (kbd "C-d") 'eshell-quit-or-delete-char)))
+ (lambda ()
+ (define-key eshell-mode-map (kbd ")") 'eshell-send-on-close-paren)
+ (define-key eshell-mode-map (kbd "C-d") 'eshell-quit-or-delete-char)))
#+END_SRC
** Defuns and Bindings
"Renames the current buffer and the file it is visiting."
(interactive)
(let ((name (buffer-name))
- (filename (buffer-file-name)))
- (if (not (and filename (file-exists-p filename)))
- (error "Buffer '%s' is not visiting a file!" name)
- (let ((new-name (read-file-name "New name: " filename)))
- (if (get-buffer new-name)
- (error "A buffer named '%s' already exists!" new-name)
- (rename-file filename new-name 1)
- (rename-buffer new-name)
- (set-visited-file-name new-name)
- (set-buffer-modified-p nil)
- (message "File '%s' successfully renamed to '%s'"
- name (file-name-nondirectory new-name)))))))
+ (filename (buffer-file-name)))
+ (if (not (and filename (file-exists-p filename)))
+ (error "Buffer '%s' is not visiting a file!" name)
+ (let ((new-name (read-file-name "New name: " filename)))
+ (if (get-buffer new-name)
+ (error "A buffer named '%s' already exists!" new-name)
+ (rename-file filename new-name 1)
+ (rename-buffer new-name)
+ (set-visited-file-name new-name)
+ (set-buffer-modified-p nil)
+ (message "File '%s' successfully renamed to '%s'"
+ name (file-name-nondirectory new-name)))))))
(global-set-key (kbd "C-x C-r") 'rename-current-buffer-file)
#+END_SRC
Stolen from https://depp.brause.cc/dotemacs"
(interactive)
(if (use-region-p)
- (comment-or-uncomment-region (region-beginning) (region-end))
- (comment-or-uncomment-region (line-beginning-position)
- (line-end-position))))
+ (comment-or-uncomment-region (region-beginning) (region-end))
+ (comment-or-uncomment-region (line-beginning-position)
+ (line-end-position))))
(global-set-key (kbd "M-;") 'my-comment-dwim)
#+END_SRC
"Kill region if active, otherwise kill back one word."
(interactive)
(if (use-region-p)
- (call-interactively 'kill-region)
- (call-interactively 'backward-kill-word)))
+ (call-interactively 'kill-region)
+ (call-interactively 'backward-kill-word)))
(global-set-key (kbd "C-w") 'kill-bword-or-region)
#+END_SRC
line. Stolen from BrettWitty's dotemacs github repo."
(interactive "^")
(let ((oldpos (point)))
- (back-to-indentation)
- (and (= oldpos (point))
- (beginning-of-line))))
+ (back-to-indentation)
+ (and (= oldpos (point))
+ (beginning-of-line))))
#+END_SRC
I had issues with =smart-beginning-of-line= in =visual-line-mode=, so =smart-beginning-of-visual-line= was created. It implements part of =back-to-indentation=, but with changes to use =beginning-of-visual-line= instead of =beginning-of-line=.
as a visual-line respecter."
(interactive "^")
(let ((oldpos (point)))
- (beginning-of-visual-line 1)
- (skip-syntax-forward " " (line-end-position))
- (backward-prefix-chars)
- (and (= oldpos (point))
- (beginning-of-visual-line))))
+ (beginning-of-visual-line 1)
+ (skip-syntax-forward " " (line-end-position))
+ (backward-prefix-chars)
+ (and (= oldpos (point))
+ (beginning-of-visual-line))))
#+END_SRC
Remap =move-beginning-of-line=, then remap =beginning-of-visual-line= when going into =visual-line-mode=. A simple remap would not work for =visual-line-mode=, so I explicitly set =C-a=.
#+BEGIN_SRC emacs-lisp
(global-set-key [remap move-beginning-of-line] 'smart-beginning-of-line)
(add-hook 'visual-line-mode-hook (lambda ()
- (global-set-key (kbd "C-a") 'smart-beginning-of-visual-line)))
+ (global-set-key (kbd "C-a") 'smart-beginning-of-visual-line)))
#+END_SRC
I don't want line numbers in the margin unless I am actively trying to go to a line. I override =goto-line= with this function, which shows line numbers, asks me where I want to go, and then hides line numbers.
(defun other-window-or-split-window (&optional window)
(interactive)
(if (= (count-windows) 1)
- (funcall split-window-preferred-function window)
- (other-window 1)))
+ (funcall split-window-preferred-function window)
+ (other-window 1)))
(global-set-key (kbd "M-o") 'other-window-or-split-window)
#+END_SRC
#+BEGIN_SRC emacs-lisp
(unless (equal system-type 'windows-nt)
(if(equal system-type 'berkeley-unix)
- (defun doas ()
- "Use TRAMP to reopen the current buffer as root using doas."
- (interactive)
- (when buffer-file-name
- (find-alternate-file
- (concat "/doas:root@localhost:"
- buffer-file-name))))
- (defun sudo ()
- "Use TRAMP to reopen the current buffer as root using sudo."
- (interactive)
- (when buffer-file-name
- (find-alternate-file
- (concat "/doas:root@localhost:"
- buffer-file-name))))))
+ (defun doas ()
+ "Use TRAMP to reopen the current buffer as root using doas."
+ (interactive)
+ (when buffer-file-name
+ (find-alternate-file
+ (concat "/doas:root@localhost:"
+ buffer-file-name))))
+ (defun sudo ()
+ "Use TRAMP to reopen the current buffer as root using sudo."
+ (interactive)
+ (when buffer-file-name
+ (find-alternate-file
+ (concat "/doas:root@localhost:"
+ buffer-file-name))))))
#+END_SRC
*** Windows
#+BEGIN_SRC emacs-lisp
(when (equal system-type 'windows-nt)
(defun unfuck-aveva-license ()
- "Remove the offending xml files.
+ "Remove the offending xml files.
Use this when aveva can't find ass with both hands."
- (interactive)
- (let ((xml1 "c:/ProgramData/AVEVA/Licensing/License API2/Data/LocalAcquireInfo.xml")
- (xml2 "c:/ProgramData/AVEVA/Licensing/License API2/Data/LocalBackEndAcquireInfo.xml"))
- (when (file-exists-p xml1) (delete-file xml1))
- (when (file-exists-p xml2) (delete-file xml2)))))
+ (interactive)
+ (let ((xml1 "c:/ProgramData/AVEVA/Licensing/License API2/Data/LocalAcquireInfo.xml")
+ (xml2 "c:/ProgramData/AVEVA/Licensing/License API2/Data/LocalBackEndAcquireInfo.xml"))
+ (when (file-exists-p xml1) (delete-file xml1))
+ (when (file-exists-p xml2) (delete-file xml2)))))
#+END_SRC
*** Math
resistance given is done here, instead of doing it in every
function that uses this."
(if (eq nil r2)
- r1
- (inv (+ (inv (float r1)) (inv (float r2))))))
+ r1
+ (inv (+ (inv (float r1)) (inv (float r2))))))
(defun amps-to-volts (amps r1 &optional r2)
"Calculate the voltage, given amperage and impedance.
calculate `amps-to-counts'. Otherwise ignore r1/r2 and calculate
`volts-to-counts'."
(cond ((or (equal 'v type)
- (equal 'V type))
- (list (volts-to-counts upper vmax resolution)
- (volts-to-counts lower vmax resolution)))
- ((or (equal 'i type)
- (equal 'I type))
- (list (amps-to-counts upper vmax resolution r1 r2)
- (amps-to-counts lower vmax resolution r1 r2)))))
+ (equal 'V type))
+ (list (volts-to-counts upper vmax resolution)
+ (volts-to-counts lower vmax resolution)))
+ ((or (equal 'i type)
+ (equal 'I type))
+ (list (amps-to-counts upper vmax resolution r1 r2)
+ (amps-to-counts lower vmax resolution r1 r2)))))
(defun scaleval (pmax pmin emax emin &optional ai)
"Calculate the slope and offset given PLC Max/Min and Eng. Max/Min.
With optional argument `ai', also calculate a final scaled value from an input."
(let* ((div (/ (- pmax pmin) (- (float emax) (float emin))))
- (ofst (- emin (/ pmin div))))
- (if (eq nil ai)
- (list div ofst)
- (list div ofst (+ ofst (/ ai div))))))
+ (ofst (- emin (/ pmin div))))
+ (if (eq nil ai)
+ (list div ofst)
+ (list div ofst (+ ofst (/ ai div))))))
(defun pid-tune (Ku Tu &optional loop-type)
"Use the Ziegler-Nichols method to tune a P, PI or PID loop.
Takes Ku, Tu and optional loop-type (P, PI, or PID [default])
as arguments, and returns appropriate kp, ki, and kd."
(cond ((or (equal 'p loop-type)
- (equal 'P loop-type))
- (list (* 0.5 Ku)))
- ((or (equal 'pi loop-type)
- (equal 'PI loop-type))
- (list (* 0.45 Ku) (/ (* 0.54 Ku) Tu)))
- (t
- (list (* 0.6 Ku) (/ (* 1.2 Ku) Tu) (/ (* 3.0 Ku Tu) 40)))))
+ (equal 'P loop-type))
+ (list (* 0.5 Ku)))
+ ((or (equal 'pi loop-type)
+ (equal 'PI loop-type))
+ (list (* 0.45 Ku) (/ (* 0.54 Ku) Tu)))
+ (t
+ (list (* 0.6 Ku) (/ (* 1.2 Ku) Tu) (/ (* 3.0 Ku Tu) 40)))))
#+END_SRC
*** Refrigeration
Saturated Water Pressure, Humidity Ratio, and Grains of water per
lb of air."
(let* ((sat-water-press (+ .0182795
- (* temp .001029904)
- (* (square temp) 0.00002579408)
- (* (cube temp) (* 2.400493 (^ 10 -7)))
- (* (^ temp 4) (* 8.100939 (^ 10 -10)))
- (* (^ temp 5) (* 3.256805 (^ 10 -11)))
- (* (^ temp 6) (* -1.001922 (^ 10 -13)))
- (* (^ temp 7) (* 2.44161 (^ 10 -16)))))
- (hum-press (* (/ humidity 100.0) sat-water-press))
- (hum-ratio (/ (* hum-press 0.62198) (- 14.7 hum-press)))
- (gns-water-lb-air (* hum-ratio 7000)))
- (list sat-water-press hum-ratio gns-water-lb-air)))
+ (* temp .001029904)
+ (* (square temp) 0.00002579408)
+ (* (cube temp) (* 2.400493 (^ 10 -7)))
+ (* (^ temp 4) (* 8.100939 (^ 10 -10)))
+ (* (^ temp 5) (* 3.256805 (^ 10 -11)))
+ (* (^ temp 6) (* -1.001922 (^ 10 -13)))
+ (* (^ temp 7) (* 2.44161 (^ 10 -16)))))
+ (hum-press (* (/ humidity 100.0) sat-water-press))
+ (hum-ratio (/ (* hum-press 0.62198) (- 14.7 hum-press)))
+ (gns-water-lb-air (* hum-ratio 7000)))
+ (list sat-water-press hum-ratio gns-water-lb-air)))
#+END_SRC
** Customize system