You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some users might appreciate the traditional Save As Dialog, here is a rough implementation, based on https://www.emacswiki.org/emacs/MacOSTweaks via Apple-Script, also implementing the Open Dialog. It is replacing the corresponding section in the init.el as below:
Seems like some escape characters are missing. But I'm not sure if it's a good idea to override the regular saving and opening mechanisms. Maybe provide these functions without hotkeys for now. Or augment them with alt:
Some users might appreciate the traditional Save As Dialog, here is a rough implementation, based on https://www.emacswiki.org/emacs/MacOSTweaks via Apple-Script, also implementing the Open Dialog. It is replacing the corresponding section in the init.el as below:
;; Things you'd expect from macOS app.
(defun mac-open-file (filename &optional wildcards)
(interactive
(let ((last-nonmenu-event nil))
(find-file-read-args "Find existing file: " t))
)
; (find-file-existing filename wildcards)
(find-file-existing filename)
)
(defun mac-save-file-as ()
(interactive)
(let ((file (do-applescript "try
POSIX path of (choose file name with prompt "Save As...")
end try")))
(if (not (equal file ""))
(write-file file)
(beep))
))
(defun mac-save-file ()
(interactive)
(if (buffer-modified-p)
(if (equal buffer-file-name nil)
(let ((file (do-applescript "try
POSIX path of (choose file name with prompt "Save As...")
end try")))
(if (not (equal file ""))
(write-file file)
(beep))
)
(save-buffer)
)))
(global-set-key (kbd "s-o") 'mac-open-file) ;; open
(global-set-key (kbd "s-s") 'mac-save-file) ;; save
(global-set-key (kbd "s-S") 'mac-save-file-as) ;; save as
(global-set-key (kbd "s-q") 'save-buffers-kill-emacs) ;; quit
(global-set-key (kbd "s-a") 'mark-whole-buffer) ;; select all
;; (global-set-key (kbd "s-z") 'undo)
The text was updated successfully, but these errors were encountered: