version bump

This commit is contained in:
Igor Shymko 2016-08-29 19:33:19 +03:00
parent 96bf3b708b
commit 60cc2646b8

View File

@ -5,7 +5,7 @@
;; Author: Igor Shymko <igor.shimko@gmail.com> ;; Author: Igor Shymko <igor.shimko@gmail.com>
;; URL: https://github.com/ancane/markdown-preview-mode ;; URL: https://github.com/ancane/markdown-preview-mode
;; Keywords: markdown, preview ;; Keywords: markdown, preview
;; Version: 0.4 ;; Version: 0.5
;; Package-Requires: ((websocket "1.6") (markdown-mode "2.1") (cl-lib "0.5")) ;; Package-Requires: ((websocket "1.6") (markdown-mode "2.1") (cl-lib "0.5"))
;; This file is not part of GNU Emacs. ;; This file is not part of GNU Emacs.
@ -51,6 +51,12 @@
:group 'markdown-preview :group 'markdown-preview
:type 'string) :type 'string)
(defcustom markdown-preview-file-name
".markdown-preview.html"
"Markdown preview file name"
:group 'markdown-preview
:type 'string)
(defvar markdown-preview--websocket-server nil (defvar markdown-preview--websocket-server nil
"`markdown-preview' Websocket server.") "`markdown-preview' Websocket server.")
@ -74,9 +80,8 @@
(defun markdown-preview--open-browser-preview () (defun markdown-preview--open-browser-preview ()
"Open the markdown preview in the browser." "Open the markdown preview in the browser."
(let* ((dir-of-buffer-to-preview (file-name-directory (let* ((dir-of-buffer-to-preview (file-name-directory (buffer-file-name)))
(buffer-file-name (get-buffer (buffer-name))))) (preview-file (concat dir-of-buffer-to-preview markdown-preview-file-name)))
(preview-file (concat dir-of-buffer-to-preview ".markdown-preview.html")))
(if (not (file-exists-p preview-file)) (if (not (file-exists-p preview-file))
(copy-file markdown-preview--preview-url preview-file)) (copy-file markdown-preview--preview-url preview-file))
(browse-url preview-file))) (browse-url preview-file)))