Adding my hot-new Ironsworn package to my loader
This commit is contained in:
parent
ac229daab0
commit
6b2df99faf
2 changed files with 32 additions and 21 deletions
|
@ -58,8 +58,19 @@ Been working on a project for getting Emacs helping as a /Dungeon Master's Assis
|
|||
(use-package rpgdm
|
||||
:straight (:local-repo "~/other/rpgdm")
|
||||
:commands (rpgdm-mode rpgdm-tables-load)
|
||||
:init (setq rpgdm-base (expand-file-name "~/other/rpgdm"))
|
||||
:config (ha-leader "t D" '("rpg dm" . rpgdm-mode))))
|
||||
#+END_SRC
|
||||
And my new Ironsworn project:
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(when (f-directory? "~/other/emacs-ironsworn")
|
||||
(use-package rpgdm-ironsworn
|
||||
:after rpgdm
|
||||
:straight (:local-repo "~/other/emacs-ironsworn")
|
||||
:init
|
||||
(setq rpgdm-ironsworn-project (expand-file-name "~/other/emacs-ironsworn"))))
|
||||
#+END_SRC
|
||||
* Technical Artifacts :noexport:
|
||||
Let's =provide= a name so we can =require= this file:
|
||||
|
||||
|
|
|
@ -43,18 +43,18 @@ either :html or :text, and the second is the clipboard contents."
|
|||
Let's define the clipboard for a Mac. The challenge here is that we need to binary unpack the data from a call to Applescript.
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun ha-get-mac-clipboard ()
|
||||
(defun ha-get-mac-clipboard ()
|
||||
"Returns a list where the first entry is the content type,
|
||||
either :html or :text, and the second is the clipboard contents."
|
||||
(destructuring-bind (exit-code contents)
|
||||
either :html or :text, and the second is the clipboard contents."
|
||||
(cl-destructuring-bind (exit-code contents)
|
||||
(shell-command-with-exit-code "osascript" "-e" "the clipboard as \"HTML\"")
|
||||
(if (= 0 exit-code)
|
||||
(list :html (ha-convert-applescript-to-html contents))
|
||||
(list :text (shell-command-to-string "osascript -e 'the clipboard'")))))
|
||||
|
||||
(defun ha-convert-applescript-to-html (packed-contents)
|
||||
(defun ha-convert-applescript-to-html (packed-contents)
|
||||
"Applescript's clipboard returns the contents in a packed array.
|
||||
Convert and return this encoding into a UTF-8 string."
|
||||
Convert and return this encoding into a UTF-8 string."
|
||||
(cl-flet ((hex-pack-bytes (tuple) (string-to-number (apply 'string tuple) 16)))
|
||||
(let* ((data (-> packed-contents
|
||||
(substring 10 -2) ; strips off the =«data RTF= and =»\= bits
|
||||
|
@ -71,7 +71,7 @@ And define the same interface for Linux. Keep in mind, we need the exit code fro
|
|||
#+BEGIN_SRC emacs-lisp
|
||||
(defun ha-get-linux-clipboard ()
|
||||
"Return the clipbaard for a Unix-based system. See `ha-get-clipboard'."
|
||||
(destructuring-bind (exit-code contents)
|
||||
(cl-destructuring-bind (exit-code contents)
|
||||
(shell-command-with-exit-code "xclip" "-o" "-t" "text/html")
|
||||
(if (= 0 exit-code)
|
||||
(list :html contents)
|
||||
|
|
Loading…
Reference in a new issue