Open selected outline-mode' files in
read-only-mode'
This commit is contained in:
parent
d3a3a2ceb2
commit
d6a9320fb9
21
README.org
21
README.org
@ -2036,6 +2036,27 @@ file.
|
|||||||
| *pdf-view-fit-width-to-window* | {{{kbd(W)}}} |
|
| *pdf-view-fit-width-to-window* | {{{kbd(W)}}} |
|
||||||
|---------------------------------+----------------|
|
|---------------------------------+----------------|
|
||||||
|
|
||||||
|
** Reading outline files
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: sec:reading-outline-files
|
||||||
|
:END:
|
||||||
|
|
||||||
|
#+caption[Enable ~read-only-mode~ for some files in ~outline-mode~]:
|
||||||
|
#+caption: Enable ~read-only-mode~ for some files in ~outline-mode~.
|
||||||
|
#+name: lst:maybe-read-only-in-outline-mode
|
||||||
|
#+begin_src emacs-lisp -n :results silent
|
||||||
|
(defun maybe-read-only-in-outline-mode ()
|
||||||
|
;; GAV: Should be a toplevel function to call `message' here.
|
||||||
|
(let ((fnsd (buffer-file-name)))
|
||||||
|
;; GAV: `fnsd' is nil during Org export to LaTeX.
|
||||||
|
(when fnsd
|
||||||
|
(setq fnsd (file-name-nondirectory fnsd))
|
||||||
|
(when (member fnsd '("NEWS" "ORG-NEWS" "PROBLEMS"))
|
||||||
|
(message "Visit `%s' in `read-only-mode'" fnsd)
|
||||||
|
(read-only-mode +1)))))
|
||||||
|
(add-hook 'outline-mode-hook #'maybe-read-only-in-outline-mode)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
* Writing
|
* Writing
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: sec:writing
|
:CUSTOM_ID: sec:writing
|
||||||
|
Loading…
Reference in New Issue
Block a user