More flexible send-to-program functions

This commit is contained in:
Henrik Lissner 2015-03-18 03:17:24 -04:00
parent e2e38273ba
commit bc1881def9
2 changed files with 20 additions and 14 deletions

View file

@ -28,21 +28,25 @@
(setq appName (concat "-a " appName ".app"))) (setq appName (concat "-a " appName ".app")))
(shell-command (concat "open " appName " " (shell-quote-argument path)))) (shell-command (concat "open " appName " " (shell-quote-argument path))))
(defun my-open-with (appName) (defun my-open-with (appName file)
(interactive "sApp name: ") (interactive "sApp name: ")
(my--open-file-with buffer-file-name appName)) (my--open-file-with file appName))
(defun my-send-to-transmit () (defun my-send-to-transmit (file)
(interactive) (my-open-with "Transmit")) (interactive "f")
(my-open-with "Transmit" file))
(defun my-send-to-launchbar () (defun my-send-to-launchbar (file)
(interactive) (my-open-with "LaunchBar")) (interactive "f")
(my-open-with "LaunchBar" file))
(defun my-send-dir-to-launchbar () (defun my-send-dir-to-launchbar (dir)
(interactive) (my--open-file-with default-directory "LaunchBar")) (interactive "D")
(my--open-file-with dir "LaunchBar"))
(defun my-send-dir-to-finder () (defun my-send-dir-to-finder (dir)
(interactive) (my--open-file-with default-directory "Finder")) (interactive "D")
(my--open-file-with dir "Finder"))
(provide 'core-osx) (provide 'core-osx)

View file

@ -72,10 +72,12 @@
"\\ ]" 'next-buffer "\\ ]" 'next-buffer
"\\ [" 'previous-buffer "\\ [" 'previous-buffer
"\\ o f" 'my-send-dir-to-finder "\\ o f" (λ (my-send-dir-to-finder default-directory))
"\\ o u" 'my-send-to-transmit "\\ o F" 'my-send-dir-to-finder
"\\ o l" 'my-send-to-launchbar "\\ o u" (λ (my-send-to-transmit buffer-file-name))
"\\ o L" 'my-send-dir-to-launchbar "\\ o U" 'my-send-to-transmit
"\\ o l" (λ (my-send-to-launchbar buffer-file-name))
"\\ o L" 'my-send-to-launchbar
;; tmux: cd (default-directory) ;; tmux: cd (default-directory)
"\\ o t" (λ (ex:tmux-chdir nil t)) "\\ o t" (λ (ex:tmux-chdir nil t))