make sure that i dont mess my precious files

main
千住柱間 2024-01-22 05:22:50 +00:00
parent 6cee0c7c07
commit c11553663d
1 changed files with 11 additions and 0 deletions

View File

@ -1,6 +1,17 @@
;; -*- mode: emacs-lisp; buffer-read-only: t; -*-
;; be paranoid, only open org files in read-only mode.
;;
(defun myorg-open-read-only-mode ()
"Enable `read-only-mode' for Org mode files."
(when (and buffer-file-name
(string-match "\\.org\\'" buffer-file-name))
(read-only-mode 1)))
(add-hook 'org-mode-hook 'myorg-open-read-only-mode)
;;;; add inactive timestamp to every org-item
;; https://stackoverflow.com/a/52815573/5115219
;; https://emacs.stackexchange.com/a/45369/29404