### Example build.yml Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org An example configuration file for building Emacs with specific options. ```yaml icon: dragon-plus patches: - fix-window-role inject_path: true #+end_src ``` -------------------------------- ### Cask Installation Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/development-guidelines.org Commands to install emacs-plus-app and emacs-plus-app@master casks. ```bash $ make cask # Install emacs-plus-app cask $ make cask@master # Install emacs-plus-app@master cask ``` -------------------------------- ### Installation commands Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Commands to tap the repository and install Emacs Plus, either as pre-built binaries (Cask) or from source (Formula). ```bash $ brew tap d12frosted/emacs-plus # Pre-built binaries (fast, ~1 min) $ brew install --cask emacs-plus-app # latest stable $ brew install --cask emacs-plus-app@master # nightly from master # Build from source (customizable, ~30 min) $ brew install emacs-plus [options] # latest stable $ brew install emacs-plus@master [options] # from master ``` -------------------------------- ### Usage in a formula Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Example of how the `create_emacs_client_app` method is used within a Homebrew formula after icon installation. ```ruby # After icon installation create_emacs_client_app(icons_dir) ``` -------------------------------- ### Local patch utility example Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/development-guidelines.org Example of using the local_patch utility function provided by EmacsBase. ```ruby local_patch "system-appearance", sha: "2a0ce452b164eee3689ee0c58e1f47db368cb21b724cda56c33f6fe57d95e9b7" ``` -------------------------------- ### Install emacs-plus@30 with Emacs Client.app Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Command to install emacs-plus@30 with a custom icon. ```bash brew install emacs-plus@30 --with--icon ``` -------------------------------- ### Formula installation for custom builds Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/NEWS.org Use the formula (=brew install emacs-plus@30=) if you need custom icons, patches, or specific build options. Use the cask for quick installation with sensible defaults. ```bash brew install emacs-plus@30 ``` -------------------------------- ### Manually Start Emacs Daemon Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Provides the command to manually start the Emacs daemon, useful for debugging startup issues. ```bash #{prefix}/Emacs.app/Contents/MacOS/Emacs --daemon ``` -------------------------------- ### Install Emacs Plus from Feature Branch Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Installs Emacs Plus from a specific feature branch by switching the tap's branch and then installing the formula. Requires jq. ```bash $ brew uninstall emacs-plus@29 $ cd $(brew tap-info --json d12frosted/emacs-plus@29 | jq -r '.[0].path') && git switch BRANCH $ brew install emacs-plus@29 [OPTIONS] ``` -------------------------------- ### Pre-built binaries (Cask) installation Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Commands to install pre-built Emacs Plus binaries using Homebrew Cask. ```bash $ brew tap d12frosted/emacs-plus $ brew install --cask emacs-plus-app # latest stable $ brew install --cask emacs-plus-app@master # nightly from master ``` -------------------------------- ### Automated Test Script for Emacs Client Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md A comprehensive bash script to automate various tests for the Emacs Client application, including setup, app verification, daemon start, file opening, and cleanup. ```bash #!/bin/bash # test-emacs-client.sh set -e PREFIX=$(brew --prefix emacs-plus@30) EMACSCLIENT="$PREFIX/bin/emacsclient" TEST_DIR="$HOME/emacs-client-tests" echo "=== Emacs Client.app Test Suite ===" # Cleanup echo "Cleaning up old test files..." pkill -f "Emacs.*daemon" || true rm -rf "$TEST_DIR" mkdir -p "$TEST_DIR" # Create test files echo "Creating test files..." cd "$TEST_DIR" echo "Test 1" > test1.txt echo "Test 2" > test2.org echo "Test 3" > "file with spaces.txt" # Test 1: Check app exists echo "Test 1: Checking Emacs Client.app exists..." if [ -d "$PREFIX/Emacs Client.app" ]; then echo "✅ PASS: Emacs Client.app found" else echo "❌ FAIL: Emacs Client.app not found" exit 1 fi # Test 2: Check bundle identifier echo "Test 2: Checking bundle identifier..." BUNDLE_ID=$(osascript -e 'id of application "Emacs Client"' 2>/dev/null || echo "") if [ "$BUNDLE_ID" = "org.gnu.EmacsClient" ]; then echo "✅ PASS: Correct bundle identifier" else echo "❌ FAIL: Wrong bundle identifier: $BUNDLE_ID" exit 1 fi # Test 3: Launch app and verify daemon starts echo "Test 3: Testing daemon auto-start..." open -a "Emacs Client" sleep 3 if pgrep -f "Emacs.*daemon" > /dev/null; then echo "✅ PASS: Daemon started" else echo "❌ FAIL: Daemon did not start" exit 1 fi # Test 4: Open file via command line echo "Test 4: Opening file with Emacs Client..." open -a "Emacs Client" "$TEST_DIR/test1.txt" sleep 2 # Check if file is in buffer list $EMACSCLIENT -e '(buffer-file-name)' | grep -q "test1.txt" if [ $? -eq 0 ]; then echo "✅ PASS: File opened successfully" else echo "❌ FAIL: File not opened" exit 1 fi # Test 5: Open file with spaces echo "Test 5: Opening file with spaces in name..." open -a "Emacs Client" "$TEST_DIR/file with spaces.txt" sleep 2 $EMACSCLIENT -e '(buffer-file-name)' | grep -q "file with spaces" if [ $? -eq 0 ]; then echo "✅ PASS: File with spaces opened" else echo "❌ FAIL: File with spaces not opened" exit 1 fi # Cleanup echo "Cleaning up..." pkill -f "Emacs.*daemon" || true echo "" echo "=== Test Suite Complete ===" echo "✅ All automated tests passed!" please run manual tests from docs/emacs-client-app-testing.md" ``` -------------------------------- ### Installing development version via formula alias Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/NEWS.org Example of using the new emacs-plus@master formula alias to install the current development version. ```bash $ brew install emacs-plus@master # Always installs development version ``` -------------------------------- ### Install Old Versions of Emacs Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Commands to tap the repository and install older versions of Emacs. ```bash $ brew tap d12frosted/emacs-plus $ brew install emacs-plus@28 [options] # install Emacs 28 $ brew install emacs-plus@27 [options] # install Emacs 27 $ brew install emacs-plus@26 [options] # install Emacs 26 ``` -------------------------------- ### External patch URL example Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/development-guidelines.org Example of how a patch URL would be specified in a Homebrew formula. ```ruby patch do url "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/system-appearance.patch" sha256 "2a0ce452b164eee3689ee0c58e1f47db368cb21b724cda56c33f6fe57d95e9b7" end ``` -------------------------------- ### Manually Start Emacs Daemon Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Command to manually start the Emacs daemon, typically used for testing connection to an existing daemon. ```bash $(brew --prefix emacs-plus@30)/Emacs.app/Contents/MacOS/Emacs --daemon ``` -------------------------------- ### Example build.yml for community features Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org A sample configuration file for enabling community features and custom patches in Emacs+. ```yaml ``` -------------------------------- ### Revision Pinning Configuration Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Example of how to pin to a specific git revision for version-specific installations. ```yaml # Pin to a specific git revision (version-specific) # revision: # "30": abc123def456 # "31": 789abcdef123 ``` -------------------------------- ### Installing Emacs Plus via Homebrew Cask Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/NEWS.org Commands to install Emacs Plus using Homebrew Cask, providing pre-built binaries for faster installation. ```bash $ brew install --cask emacs-plus-app # Stable $ brew install --cask emacs-plus-app@master # Development ``` -------------------------------- ### Install Emacs Client.app in Other Formulas Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Ruby code snippet demonstrating how to integrate the Emacs Client.app creation into other emacs-plus formula installations. ```ruby def install # ... existing installation code ... if (build.with? "cocoa") && (build.without? "x11") # ... icon installation code ... # Create Emacs Client.app create_emacs_client_app(icons_dir) # Install both apps prefix.install "nextstep/Emacs.app" prefix.install "nextstep/Emacs Client.app" # ... rest of installation ... end end ``` -------------------------------- ### Test org-protocol URL Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Example of an org-protocol URL to test capture functionality. ```text org-protocol://capture?template=t&url=https://example.com&title=Test ``` -------------------------------- ### Configure Icon Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Example of how to add a custom icon to the build configuration. ```yaml icon: dragon-plus ``` -------------------------------- ### Install Emacs Plus using Formula Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Installs the latest stable or development version of Emacs Plus using the Homebrew formula, with support for custom options. ```bash $ brew tap d12frosted/emacs-plus $ brew install emacs-plus [options] # latest stable $ brew install emacs-plus@master [options] # from master ``` -------------------------------- ### Using Community Features Configuration Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/README.md Example of how to configure community patches and icons in the `build.yml` file. ```yaml icon: icon-name-from-registry # OR icon: url: https://example.com/external.icns sha256: def456... ``` -------------------------------- ### Install emacs-plus@32 Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/NEWS.org Installs the emacs-plus@32 formula, which tracks Emacs master development. ```bash brew tap d12frosted/emacs-plus brew install emacs-plus@32 ``` -------------------------------- ### Add Icon to build.yml Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/icons/README.md Example of how to add an icon to your `~/.config/emacs-plus/build.yml` file. ```yaml icon: icon-name ``` ```yaml icon: dragon-plus ``` -------------------------------- ### Install Package Ignoring Dependencies Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Command to install a package while ignoring its dependencies, useful when the regular 'emacs' package is required separately. ```bash $ brew install cask --ignore-dependencies ``` -------------------------------- ### Community Patches Configuration Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Example of how to apply community patches, including those from a registry and external/local URLs. ```yaml # Apply community patches # patches: # - patch-name-from-registry # - my-patch: # url: https://example.com/external.patch # sha256: abc123... # - local-patch: # url: ~/.config/emacs-plus/my-local.patch ``` -------------------------------- ### External Icon Configuration Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Example of how to use an external icon with SHA256 verification. ```yaml # Use an external icon (requires SHA256 verification) # icon: # url: https://example.com/my-icon.icns # sha256: abc123... ``` -------------------------------- ### Configuration Example Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/patches/aggressive-read-buffering/README.md Add the aggressive-read-buffering patch to your `~/.config/emacs-plus/build.yml` configuration file. ```yaml patches: - aggressive-read-buffering ``` -------------------------------- ### Pinning a specific commit using build.yml Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Configuration example for pinning a specific commit for development versions of emacs-plus. ```yaml revision: "31": 6abea4d98d1d964c68a78cb9b5321071da851654 "32": abc123def456789 ``` -------------------------------- ### Cask renaming for emacs-plus Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/NEWS.org Demonstrates the old and new commands for installing emacs-plus via Homebrew Cask, reflecting the renaming to emacs-plus-app. ```bash # Old (no longer works) $ brew install --cask emacs-plus@30 $ brew install --cask emacs-plus@31 # New $ brew install --cask emacs-plus-app # Stable (currently Emacs 30) $ brew install --cask emacs-plus-app@master # Development (Emacs master) ``` -------------------------------- ### Reinstall Emacs Plus Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Uninstalls and then installs Emacs Plus to apply desired options, avoiding the 'reinstall' command which can cause compilation errors. ```bash $ brew uninstall emacs-plus $ brew install emacs-plus [options] ``` -------------------------------- ### Get Emacs Client Bundle Identifier Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Command to retrieve the bundle identifier for the Emacs Client application. ```bash osascript -e 'id of application "Emacs Client"' ``` -------------------------------- ### Local file paths for patches in build.yml Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/NEWS.org Example of using local file paths for patches in build.yml, supporting absolute, home-relative, and relative paths. ```yaml patches: - my-patch: url: ~/.config/emacs-plus/my-patch.patch sha256: abc123... - another-patch: url: ./relative-to-config.patch sha256: def456... ``` -------------------------------- ### Testing and Validation Commands Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/development-guidelines.org Commands for running unit tests and validating configurations. ```bash $ make test # Run all unit tests $ make validate # Validate build.yml config $ make postinstall-formula # Simulate formula post_install $ make postinstall-cask # Simulate cask postflight ``` -------------------------------- ### Verify PATH and Homebrew Binaries Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Steps to launch Emacs Client, enter a shell buffer, and check the PATH environment variable and the location of git and brew binaries. ```bash echo $PATH which git which brew ``` -------------------------------- ### Create test files Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Commands to create a directory and several test files for Emacs Client testing. ```bash mkdir -p ~/emacs-client-tests cd ~/emacs-client-tests echo "Test file 1" > test1.txt echo "Test file 2" > test2.org echo "#!/bin/bash\necho 'test'" > test-script.sh echo "# Test markdown" > test.md touch "test with spaces.txt" ``` -------------------------------- ### Check Icon File Reference Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Verifies the CFBundleIconFile entry in the Info.plist to ensure it's set to 'applet'. ```bash /usr/libexec/PlistBuddy -c 'Print :CFBundleIconFile' "Emacs Client.app/Contents/Info.plist" ``` -------------------------------- ### Launch Emacs Client from Command Line Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Opens a specific file with Emacs Client from the command line to observe any error messages. ```bash open -a "Emacs Client" file.txt ``` -------------------------------- ### Local formula build commands Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/development-guidelines.org Commands to build Emacs formulas locally using the Makefile. ```bash $ make formula-30 # Build Emacs 30 (stable release) $ make formula-30 --HEAD # Build Emacs 30 from emacs-30 branch HEAD $ make formula-31 # Build Emacs 31 (always from emacs-31 branch HEAD) $ make formula-32 # Build Emacs 32 (always from master HEAD) ``` -------------------------------- ### Configuring icons with --with-icon or build.yml Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/NEWS.org Illustrates how to set icons using the --with-icon option or by configuring build.yml, replacing deprecated legacy options. ```bash # Using --with-icon $ brew install emacs-plus --with-icon=modern-icon # Using build.yml $ echo "icon: modern-icon" > ~/.config/emacs-plus/build.yml $ brew install emacs-plus ``` -------------------------------- ### Remove fix-macos-tahoe-scrolling from build.yml Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/NEWS.org Example of removing the fix-macos-tahoe-scrolling patch from build.yml as it is now built-in. ```yaml # No longer needed - remove from build.yml patches: - fix-macos-tahoe-scrolling ``` -------------------------------- ### Create Deeply Nested Directory and File Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Commands to create a deeply nested directory structure and a file within it for testing long path handling. ```bash mkdir -p ~/emacs-client-tests/very/long/path/with/many/directories/to/test/path/handling echo "Deep file" > ~/emacs-client-tests/very/long/path/with/many/directories/to/test/path/handling/deep.txt ``` -------------------------------- ### Initialize exec-path-from-shell for Cask Builds Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Elisp code to initialize `exec-path-from-shell` for cask builds, as PATH injection is not available. ```elisp (exec-path-from-shell-initialize) ``` -------------------------------- ### Open Non-Existent File with Emacs Client Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Command to test how Emacs Client handles opening a non-existent file path. ```bash open -a "Emacs Client" /tmp/nonexistent-file.txt ``` -------------------------------- ### Regenerate Previews and README Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/icons/README.md Command to regenerate icon previews and the README file using a Ruby script. ```bash ruby scripts/generate-icon-previews.rb ``` -------------------------------- ### Get Daemon Process ID Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Command to find the process ID of the running Emacs daemon. ```bash pgrep -f "Emacs.*daemon" ``` -------------------------------- ### Verify Icon File Existence and Assets.car Removal Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Lists the contents of the Resources directory to confirm the presence of 'applet.icns' and the absence of 'droplet.icns' or 'Assets.car'. ```bash ls -la "Emacs Client.app/Contents/Resources/" ``` -------------------------------- ### Create aliases for Emacs applications in /Applications Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Shell commands to create aliases for Emacs and Emacs Client applications in the /Applications directory. ```bash # Get the prefix PREFIX=$(brew --prefix emacs-plus@30) # Create aliases osascript -e "tell application \"Finder\" to make alias file to posix file \"$PREFIX/Emacs.app\" at posix file \"/Applications\" with properties {name:\"Emacs.app\"}" osascript -e "tell application \"Finder\" to make alias file to posix file \"$PREFIX/Emacs Client.app\" at posix file \"/Applications\" with properties {name:\"Emacs Client.app\"}" ``` -------------------------------- ### Submitting an Icon - Helper Script Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/README.md Command to run the helper script for creating a community icon. ```bash ./scripts/create-community-icon.rb ``` -------------------------------- ### Example Config Function Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/patches/frame-transparency/README.md Emacs Lisp function to apply frame transparency parameters, including alpha background, blur, and alpha elements. ```emacs-lisp (defun my/apply-frame-transparency (&optional frame) "Apply macOS transparency parameters to FRAME (defaults to selected frame)." (with-selected-frame (or frame (selected-frame)) (set-frame-parameter nil 'alpha-background 0.7) (set-frame-parameter nil 'ns-background-blur 30) (set-frame-parameter nil 'ns-alpha-elements '(ns-alpha-all)))) ;; ns-background-blur must be in default-frame-alist to configure the ;; NSWindow backing material at frame creation time (required for blur). ;; This ensures emacsclient frames inherit it automatically. (add-to-list 'default-frame-alist '(ns-background-blur . 30)) (add-to-list 'default-frame-alist '(ns-alpha-elements ns-alpha-all)) (add-hook 'after-make-frame-functions #'my/apply-frame-transparency) (unless (daemonp) (add-hook 'window-setup-hook #'my/apply-frame-transparency)) ;; Apply transparency immediately for non-daemon graphical startup, ;; where neither after-make-frame-functions nor window-setup-hook fires. (when (display-graphic-p) (my/apply-frame-transparency)) ``` -------------------------------- ### Submitting a Patch - Helper Script Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/README.md Command to run the helper script for creating a community patch. ```bash ./scripts/create-community-patch.rb ``` -------------------------------- ### Create Test File with Special Characters Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Command to create a test file with special characters in its name. ```bash cd ~/emacs-client-tests touch "test's & file (copy).txt" ``` -------------------------------- ### Reinstall Emacs+ with New Icon Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/icons/README.md Commands to reinstall Emacs+ after updating the `build.yml` file to change icons. ```bash brew reinstall emacs-plus@32 # formula ``` ```bash brew reinstall --cask emacs-plus-app@master # cask ``` -------------------------------- ### AppleScript `on run` Handler Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md The AppleScript code that handles launching Emacs Client.app without any files, typically from Spotlight or the Dock. It injects the environment and calls `emacsclient`. ```applescript on run -- PATH injection logic here do shell script pathEnv & "#{prefix}/bin/emacsclient -c -a '' -n" tell application "Emacs" to activate end run ``` -------------------------------- ### Check Document Type Associations Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Commands to check which applications are associated with specific file extensions using the 'duti' tool. ```bash duti -x txt duti -x org duti -x sh ``` -------------------------------- ### Create Application Alias Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Bash command to create an alias for the Emacs Client application in the /Applications directory. ```bash osascript -e 'tell application "Finder" to make alias file to posix file "#{prefix}/Emacs Client.app" at posix file "/Applications" with properties {name:"Emacs Client.app"}' ``` -------------------------------- ### Copy Emacs Client.app for org-protocol Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Command to copy the Emacs Client application to /Applications for reliable org-protocol handling. ```bash cp -r "$(brew --prefix)/opt/emacs-plus@30/Emacs Client.app" /Applications/ ``` -------------------------------- ### Create Aliases for Emacs.app and Emacs Client.app Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Bash commands to create aliases for `Emacs.app` and `Emacs Client.app` in the `/Applications` directory. ```bash # Get the installation prefix (use emacs-plus@30, emacs-plus@31, or emacs-plus@32) PREFIX=$(brew --prefix emacs-plus@30) # Create aliases in /Applications osascript -e 'tell application "Finder" to make alias file to posix file "'$PREFIX'/Emacs.app" at posix file "/Applications" with properties {name:"Emacs.app"}' osascript -e 'tell application "Finder" to make alias file to posix file "'$PREFIX'/Emacs Client.app" at posix file "/Applications" with properties {name:"Emacs Client.app"}' ``` -------------------------------- ### Reset Launch Services Cache and Refresh Finder Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Kills the Launch Services cache and restarts the Finder to ensure icon and file association changes are recognized. ```bash /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user killall Finder # Refresh Finder ``` -------------------------------- ### Copy Emacs.app for Spotlight integration Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/NEWS.org The =emacs= command now automatically finds =Emacs.app= in =/Applications= or =~/Applications=. This allows you to copy the app for better Spotlight indexing. ```bash cp -r "$(brew --prefix)/opt/emacs-plus@30/Emacs.app" /Applications/ ``` -------------------------------- ### Emacsclient Command Line Test Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Command to open a file using emacsclient from the command line, verifying its integration with the Emacs daemon. ```bash $(brew --prefix emacs-plus@30)/bin/emacsclient -c ~/emacs-client-tests/test.md ``` -------------------------------- ### Compile Assets.car for macOS Tahoe Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/icons/README.md Command to compile an Assets.car file from an .icon bundle using Apple's actool. ```bash actool icon.icon --compile . --app-icon IconName --enable-on-demand-resources NO \ --minimum-deployment-target 26.0 --platform macosx --output-partial-info-plist /dev/null ``` -------------------------------- ### Verify opened files in ibuffer Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Emacs Lisp command to open the ibuffer and check if all specified files are listed as open buffers. ```elisp M-x ibuffer ``` -------------------------------- ### Detect Emacs Plus and Configure init.el Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/README.org Elisp code to detect Emacs Plus versions and conditionally configure `init.el`, including skipping `exec-path-from-shell` if PATH was already injected. ```elisp (when (bound-and-true-p ns-emacs-plus-version) ;; Emacs Plus specific configuration ) ;; Skip exec-path-from-shell if PATH was already injected (unless (bound-and-true-p ns-emacs-plus-injected-path) (exec-path-from-shell-initialize)) ;; Check specific version (when (and (bound-and-true-p ns-emacs-plus-version) (>= ns-emacs-plus-version 31)) ;; Emacs Plus 31+ specific ) ``` -------------------------------- ### AppleScript `on open location` Handler Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md The AppleScript code that handles opening `org-protocol://` URLs. It injects the environment and calls `emacsclient` with the URL. ```applescript on open location this_URL -- PATH injection logic here do shell script pathEnv & "#{prefix}/bin/emacsclient -n " & quoted form of this_URL tell application "Emacs" to activate end open location ``` -------------------------------- ### Detecting Emacs Plus version in init.el Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/NEWS.org Elisp code demonstrating how to detect if Emacs Plus is running and check its version in init.el. ```elisp (when (bound-and-true-p ns-emacs-plus-version) ;; Emacs Plus specific configuration ) ;; Or check specific version (when (and (bound-and-true-p ns-emacs-plus-version) (>= ns-emacs-plus-version 31)) ;; Emacs Plus 31+ specific ) ``` -------------------------------- ### Ensure No Daemon is Running Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Command to ensure no Emacs daemon processes are active before testing auto-start functionality. ```bash pkill -f "Emacs.*daemon" ``` -------------------------------- ### Compile Emacs Client App Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Command to compile the AppleScript into an Emacs Client application bundle. ```bash osacompile -o "Emacs Client.app" emacs-client.applescript ``` -------------------------------- ### AppleScript `on open` Handler Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md The AppleScript code that handles opening files dropped onto the Emacs Client.app icon or selected via 'Open With'. It converts paths, injects the environment, and calls `emacsclient`. ```applescript on open theDropped repeat with oneDrop in theDropped set dropPath to quoted form of POSIX path of oneDrop -- PATH injection logic here do shell script pathEnv & "#{prefix}/bin/emacsclient -c -a '' -n " & dropPath end repeat tell application "Emacs" to activate end open ``` -------------------------------- ### Configuration for build.yml Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/patches/mac-font-use-typo-metrics/README.md Add the patch to your `~/.config/emacs-plus/build.yml` configuration file. ```yaml patches: - mac-font-use-typo-metrics ``` -------------------------------- ### Check Daemon Running Status Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app.md Verifies if the Emacs daemon process is currently running. ```bash ps aux | grep "Emacs.*daemon" ``` -------------------------------- ### Rebuild Emacs Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/patches/aggressive-read-buffering/README.md After updating the configuration, rebuild Emacs using the provided Homebrew command. ```bash brew reinstall emacs-plus@30 ``` -------------------------------- ### Rebuild Emacs command Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/community/patches/mac-font-use-typo-metrics/README.md After updating the configuration, rebuild Emacs using the brew command. ```bash brew reinstall emacs-plus@31 # or @29, @30 ``` -------------------------------- ### Check daemon uptime Source: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/docs/emacs-client-app-testing.md Command to check the uptime of the Emacs daemon process to ensure it hasn't reset. ```bash # Check daemon uptime hasn't reset ps -p $(pgrep -f "Emacs.*daemon") -o etime ```