# HG changeset patch # User Oleksandr Gavenko # Date 1492958825 -10800 # Node ID 81091a6d400a9b8c59aff1f434a51ee3156a628a # Parent ff6e296d2b21389dc49b339af7510d875fdf8052 Added key bindings to open file in external IDE. Unified code for error checking in ide-* functions. diff -r ff6e296d2b21 -r 81091a6d400a .emacs-my --- a/.emacs-my Sun Apr 02 16:22:22 2017 +0300 +++ b/.emacs-my Sun Apr 23 17:47:05 2017 +0300 @@ -1386,11 +1386,9 @@ (defun ide-netbeans-open-this-buffer () "Open current buffer in NetBeans." (interactive) - (unless (stringp (buffer-file-name)) + (unless (and (stringp (buffer-file-name)) (file-regular-p (buffer-file-name))) (error "Buffer have no association with a file")) - (if (file-regular-p (buffer-file-name)) - (ide-netbeans-open-file (buffer-file-name) (line-number-at-pos)) - (message "Current buffer wasnt' associated with a real file"))) + (ide-netbeans-open-file (buffer-file-name) (line-number-at-pos))) (defvar ide-idea-program nil "Idea executable or full path, like 'idea64.exe'") @@ -1408,12 +1406,13 @@ (defun ide-idea-open-this-buffer () "Open current buffer in Intellij Idea." (interactive) - (unless (stringp (buffer-file-name)) + (unless (and (stringp (buffer-file-name) (file-regular-p (buffer-file-name)))) (error "Buffer have no association with a file")) - (unless (file-regular-p (buffer-file-name)) - (error "Current buffer isn't associated with a real file")) (ide-idea-open-file (buffer-file-name) (line-number-at-pos))) +(define-key global-map [s-n] 'ide-netbeans-open-this-buffer) +(define-key global-map [s-i] 'ide-idea-open-this-buffer) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (message "calendar")