- #Wilcom embroidery studio e3 using column tool to digitize odd shape code
- #Wilcom embroidery studio e3 using column tool to digitize odd shape mac
The author highlights Emacs's ability to apply additional logic when replacing text during a search-and-replace session.
#Wilcom embroidery studio e3 using column tool to digitize odd shape mac
Not long ago, I made a note to go back and read Mac for Translators's Emacs regex with Emacs lisp post. ( setq result (format "Quit %s" (file-name-base old))))))) (set-window-configuration window-configuration) (shell-command (format "open -a Firefox %s -args -new-tab" new))) (shell-command (format "open -a Firefox %s -args -new-tab" old)) (format "Overriding old %s" (file-name-base old)))) (format "Keeping old %s" (file-name-base old)))) ( setq action (read-char-choice (format "Override %s? (y)es (n)o (d)iff in browser? " (switch-to-buffer-other-window ( with-current-buffer (get-buffer-create new-buffer) (switch-to-buffer ( with-current-buffer (get-buffer-create old-buffer) ( let (( window-configuration (current-window-configuration)) ( defun plainorg-snapshot-override-image ( old-buffer old new-buffer new destination) \"/path/to/expected/screenshot.1.png\" \"/path/to/actual/screenshot.1.png\" Newly-taken snapshot does not match reference. "Extract a paths list from FAILURE-MESSAGE of the form: failed - Snapshot does not match reference. ( defun plainorg-snapshot-screenshot-paths ( failure-message) (gethash "classes" (gethash "details" hashtable))))) ( override-result (plainorg-snapshot-override-image ( let* (( paths (plainorg-snapshot-screenshot-paths (string-match-p "Snapshot does not match reference" ( when ( and (gethash "failureMessage" testCase) ( let (( hashtable ( with-current-buffer (get-buffer-create "*build json*") "Find all failed snapshot tests in JSON and offer to override screenshots, comparing them side to side." ( defun plainorg-snapshot-process-json ( result-buffer json) (switch-to-buffer-other-window "*xcodebuild*"))) (insert "\nScreenshot comparison finished\n")) (plainorg-snapshot-process-json (get-buffer "*xcodebuild*") json-tmp-file) (insert "Screenshot comparison started\n\n"))) (insert (format "xcodebuild-to-json exit code: %d\n\n" (process-exit-status p))))) (user-login-name)) "-output" json-tmp-file) "xcodebuild-to-json" "*xcodebuild*" "/opt/homebrew/bin/xcodebuild-to-json" "-derived-data-folder" (format "/Users/%s/Library/Developer/Xcode/DerivedData/" ( when (not (eq 0 (process-exit-status p))) (insert (format "xcodebuild exit code: %d\n\n" (process-exit-status p))))) ( with-current-buffer (get-buffer "*xcodebuild*") "/usr/bin/xcodebuild" "-scheme" "PlainOrg" "-target" "PlainOrgTests" "-destination" "name=iPhone 13" "-quiet" "test") ( unless (file-exists-p (concat project "PlainOrg.xcodeproj")) ( json-tmp-file (make-temp-file "PlainOrg_Tests_" nil ".json")) ( let* (( project (cdr (project-current))) "Invoke xcodebuild, compare failed tests screenshots side-to-side, and offer to override them." Press "d" to open two browser tabs if you'd like to take a closer look (not demoed below).
Oh, and our beloved web browser was also invited to the party. After all, it's your editor.Īnd so here we are, I can now run snapshot tests from Emacs using my hacked up plainorg-snapshot-test-all function and quickly override (or ignore) all newly generated snapshots by merely pressing y/n keys. Throw some elisp at it and you can bend it to your liking. But the important point here is that Emacs is such an amazing malleable power tool.
#Wilcom embroidery studio e3 using column tool to digitize odd shape code
What's left? Glue it all up with some elisp.īeware, the following code snippet is packed with assumptions about my project, it's messy, surely has bugs, can be optimized, etc. David House's xcodebuild-to-json handles this perfectly. Next, I needed a way to parse test execution data to extract failing tests. This is already supported via xcodebuild. All the main pieces were already there, I just needed some elisp glue to bend Emacs my way™.įirst, I needed to run my Xcode builds from the command line. So what does any of this have to do with Emacs? You see, as I added more snapshot tests and made modifications to Plain Org's rendering logic, I needed a quick way to visually inspect and override all goldens.
This is all done rather effortlessly thanks to Point Free's wonderful swift-snapshot-testing utilities.