Skip to content

Instantly share code, notes, and snippets.

@railwaycat
railwaycat / Emacs_starter.pl
Last active Jun 15, 2021
Start Emacs.app from CLI
View Emacs_starter.pl
#!/usr/bin/perl
# Emacs starter for Emacs mac port
# Thanks to Aquamacs Project and David Reitter
my $args = "";
my $tmpfiles = "";
for my $f (@ARGV) {
View mac-switch-meta.el
;; Keybonds
(global-set-key [(hyper a)] 'mark-whole-buffer)
(global-set-key [(hyper v)] 'yank)
(global-set-key [(hyper c)] 'kill-ring-save)
(global-set-key [(hyper s)] 'save-buffer)
(global-set-key [(hyper l)] 'goto-line)
(global-set-key [(hyper w)]
(lambda () (interactive) (delete-window)))
(global-set-key [(hyper z)] 'undo)
@railwaycat
railwaycat / multi-tty-27.diff
Created Aug 16, 2020
multi-tty patch for Emacs Mac port for 27.1
View multi-tty-27.diff
diff --git a/lisp/server.el b/lisp/server.el
index 5efba17a01..357a6e5945 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1182,10 +1182,9 @@ The following commands are accepted by the client:
;; choice there.) In daemon mode on Windows, we can't
;; make tty frames, so force the frame type to GUI
;; there too.
- (when (or (and (eq system-type 'windows-nt)
- (or (daemonp)
@railwaycat
railwaycat / emacs-26.2-rc1-mac-7.5-no-title-bar.patch
Last active Apr 26, 2020
emacs-26.2-rc1-mac-7.5-no-title-bar.patch
View emacs-26.2-rc1-mac-7.5-no-title-bar.patch
diff -ruN mituharu-emacs-mac-85a43e7fcf73/lisp/cus-start.el mituharu-emacs-mac-patched/lisp/cus-start.el
--- mituharu-emacs-mac-85a43e7fcf73/lisp/cus-start.el 2019-03-22 01:05:44.000000000 -0400
+++ mituharu-emacs-mac-patched/lisp/cus-start.el 2019-04-04 15:08:10.000000000 -0400
@@ -580,6 +580,7 @@
(mac-pass-command-to-system mac boolean "22.1")
(mac-pass-control-to-system mac boolean "22.1")
(mac-drawing-use-gcd mac boolean "24.4")
+ (mac-use-title-bar mac boolean "25.2")
(mac-frame-tabbing mac (choice (const automatic) (const inverted)
(const nil) (const t)) "24.5")
@railwaycat
railwaycat / mac_org_9.3.diff
Created Dec 4, 2019
patch for org-9.3 release to fit in emacs-mac
View mac_org_9.3.diff
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 4446a169d..2d1f2ff92 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -646,7 +646,12 @@ use of this function is for the stuck project list."
(gui-get-selection value 'STRING)
(gui-get-selection value 'TEXT)))))
((and (eq window-system 'w32) (fboundp 'w32-get-clipboard-data))
- (w32-get-clipboard-data))))
+ (w32-get-clipboard-data))
View pkgconfig_10.15.diff
diff --git a/Library/Homebrew/os/mac/pkgconfig/10.15/libxml-2.0.pc b/Library/Homebrew/os/mac/pkgconfig/10.15/libxml-2.0.pc
index c297c6b45..22b2e69e8 100644
--- a/Library/Homebrew/os/mac/pkgconfig/10.15/libxml-2.0.pc
+++ b/Library/Homebrew/os/mac/pkgconfig/10.15/libxml-2.0.pc
@@ -1,7 +1,8 @@
prefix=/usr
+xcode_prefix=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk${prefix}
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
-includedir=${prefix}/include
@railwaycat
railwaycat / org-9.2.6-mac-port.diff
Last active Oct 22, 2019
emacs mac port patch for org-9.2.6
View org-9.2.6-mac-port.diff
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 7603f9688..d552d2095 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -555,7 +555,12 @@ use of this function is for the stuck project list."
(gui-get-selection value 'STRING)
(gui-get-selection value 'TEXT)))))
((and (eq window-system 'w32) (fboundp 'w32-get-clipboard-data))
- (w32-get-clipboard-data))))
+ (w32-get-clipboard-data))
View basic-theme.el
;;; basic-theme.el --- Minimal color theme for Emacs
;; Copyright (C) 2019 Xin Xu <railwaycat@gmail.com>
;; Author: Xin Xu
;; Version: 1.0
;; This file is not a part of GNU Emacs.
;;; License:
View pkgconfig_10.14.diff
diff --git a/Library/Homebrew/os/mac/pkgconfig/10.14/libxml-2.0.pc b/Library/Homebrew/os/mac/pkgconfig/10.14/libxml-2.0.pc
index c297c6b45..7a037a9cf 100644
--- a/Library/Homebrew/os/mac/pkgconfig/10.14/libxml-2.0.pc
+++ b/Library/Homebrew/os/mac/pkgconfig/10.14/libxml-2.0.pc
@@ -1,7 +1,8 @@
prefix=/usr
+xcode_prefix=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk${prefix}
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
-includedir=${prefix}/include
View emacs-mac-title-bar.patch
--- mituharu-emacs-mac-7fdbfba85d54/src/macappkit.m 2018-09-08 21:02:50.000000000 -0400
+++ mituharu-emacs-mac/src/macappkit.m 2018-09-11 13:56:12.000000000 -0400
@@ -2074,6 +2074,18 @@
@implementation EmacsWindow
++ (NSButton *)standardWindowButton:(NSWindowButton)b forStyleMask:(NSWindowStyleMask)styleMask
+{
+
+ NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];