org-noter icon indicating copy to clipboard operation
org-noter copied to clipboard

feature request: kill pdf and note buffer on session quit

Open agzam opened this issue 5 years ago • 3 comments

Would be nice if on q, it automatically closes both: pdf and notes buffer (with a prompt if unsaved)

agzam avatar Jul 07 '19 22:07 agzam

As a workaround for myself I did this:As a workaround I did this:

(defun org-noter-kill-the-note-buffer (&rest _ignore)
  (setq notes-fname (org-noter--session-notes-file-path org-noter--session))
  (setq pdf-fname (buffer-file-name (org-noter--session-doc-buffer org-noter--session)))
  (run-at-time "0.5 sec" nil (lambda ()
                                (kill-buffer (get-file-buffer pdf-fname))
                                (switch-to-buffer (get-file-buffer notes-fname))
                                (kill-buffer-ask (get-file-buffer notes-fname))
                                (makunbound 'notes-fname)
                                (makunbound 'pdf-fname))))

(advice-add #'org-noter-kill-session :before 'org-noter-kill-the-note-buffer)

It's a bit messy, but works for me

agzam avatar Jul 07 '19 23:07 agzam

+1 for the request to kill the PDF buffer. However I’d appreciate an option to keep the notes buffer.

rosetree avatar Jul 23 '19 08:07 rosetree

Even I may use the option to kill the PDF buffer! Will add this to my todo list, thanks!

weirdNox avatar Aug 12 '19 23:08 weirdNox