Commit 0565dd25 authored by Antonino D'Annaç's avatar Antonino D'Annaç

cleaner approach, doesn't ask to save the buffer

parent c8d78f71
......@@ -29,26 +29,29 @@
(line-beginning-position)
(line-end-position)
'bdio-record record)
))))
)))
(set-buffer-modified-p nil)
)
(defun bdio-mode--open-file ()
"Open .bdio file using lsbdio."
;;(setq-local bdio-mode--source-file buffer-file-name)
(let ((file (buffer-file-name)))
(when file
(rename-buffer
(format "*BDIO* %s" (file-name-nondirectory file)) t)
(set-visited-file-name nil t)
(let* ((file buffer-file-name)
(buf (get-fbuffer-create
(format "*BDIO* %s" (file-name-nondirectory file)))))
(with-current-buffer buf
(bdio-mode)
(bdio-mode--render-file file))))
(setq-local bdio-mode--source-file file)
(bdio-mode--render-file file)
(pop-to-buffer buf))))
(defun bdio-mode--toggle-record ()
"Expand/collapse current record."
(interactive)
(let ((bdio-file bdio-mode--source-file)
(setq lstart (line-beginning-position))
(lstart (line-beginning-position))
(lend (line-end-position))
(cpoint (point)))
(let* ((record (get-text-property lstart 'bdio-record))
......@@ -73,7 +76,7 @@
(put-text-property lstart lend 'bdio-expanded t)))))
(goto-char cpoint)))
(defun bdio-mode--refresh-file (&rest ARGS)
(defun bdio-mode--refresh-file (ignore-auto noconfirm)
(interactive)
(bdio-mode--render-file bdio-mode--source-file))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment