Saturday, February 04, 2012

OSX Emacs Drag and Drop


By default, I find that drag and drop on OSX does not work in the same way that it would on Windows. On Windows, a new buffer is created. On OSX, the file is opened in the same buffer. Googling around gave me - http://stackoverflow.com/questions/1850292/emacs-23-1-and-mac-os-x-problem-with-files-drag-and-drop.

Adding the following text worked fine -

;; Add this to your .emacs file
;; See - http://stackoverflow.com/questions/1850292/emacs-23-1-and-mac-os-x-problem-with-files-drag-and-drop
(define-key global-map [ns-drag-file] 'my-ns-open-files)
(defun my-ns-open-files ()
"Open files in the list 'ns-input-file'."
(interactive)
(mapc 'find-file ns-input-file)
(setq ns-input-file nil))
view raw gistfile1.el hosted with ❤ by GitHub

No comments: