Add checks for: Buffer have no association with a file.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 05 Nov 2012 10:22:39 +0200
changeset 986 6e74bf91f1df
parent 985 ad3c49e55848
child 987 8b4880af8c8a
Add checks for: Buffer have no association with a file.
.emacs-my
--- a/.emacs-my	Fri Nov 02 12:09:02 2012 +0200
+++ b/.emacs-my	Mon Nov 05 10:22:39 2012 +0200
@@ -979,6 +979,8 @@
 (defun netbeans-open-this-buffer ()
   "Open file for burrent buffer in NetBeans."
   (interactive)
+  (unless (stringp (buffer-file-name))
+    (error "Buffer have no association with a file"))
   (if (file-regular-p (buffer-file-name))
       (netbeans-open-file (buffer-file-name) (line-number-at-pos))
     (message "Current buffer wasnt' associated with a real file")))