added logging for switching emacs buffers

This commit is contained in:
NJ 2017-06-11 18:02:28 +03:00
parent d4cf614d5d
commit 6fd1ec3f37
1 changed files with 17 additions and 3 deletions

View File

@ -1,6 +1,6 @@
(defun buffer-changes-recorder (change-beg change-end prev-len) (defun buffer-changes-recorder (change-beg change-end prev-len)
(append-to-file ;(append-to-file
;(message (message
(format "%s;%s;%s\n" (format "%s;%s;%s\n"
(buffer-file-name) (buffer-file-name)
(format-time-string "%s") (format-time-string "%s")
@ -13,8 +13,22 @@
(buffer-substring change-beg change-end)) (buffer-substring change-beg change-end))
) )
) )
nil "~/test.log" ; nil "~/test.log"
) )
) )
(add-hook 'after-change-functions 'buffer-changes-recorder) (add-hook 'after-change-functions 'buffer-changes-recorder)
(defun buffer-switchs-recorder ()
;(append-to-file
(message
(format "%s;%s;%s\n"
(buffer-file-name)
(format-time-string "%s")
(format "S;%s;%s" (selected-window) (buffer-name))
)
; nil "~/test.log"
)
)
(add-hook 'buffer-list-update-hook 'buffer-switchs-recorder)