Fix org-contacts file narrowed not widen recovered bug.
This commit is contained in:
parent
03a563b471
commit
84436fd7bc
1 changed files with 10 additions and 9 deletions
|
@ -646,16 +646,17 @@ description."
|
||||||
(org-contact-buffer (get-buffer (find-file-noselect file)))
|
(org-contact-buffer (get-buffer (find-file-noselect file)))
|
||||||
;; get org-contact headline and property drawer.
|
;; get org-contact headline and property drawer.
|
||||||
(contents (with-current-buffer org-contact-buffer
|
(contents (with-current-buffer org-contact-buffer
|
||||||
(goto-char position)
|
|
||||||
(when (derived-mode-p 'org-mode)
|
(when (derived-mode-p 'org-mode)
|
||||||
;; `org-edit-src-code' is not a real narrowing command.
|
(save-excursion
|
||||||
;; Remove this first conditional if you don't want it.
|
(goto-char position)
|
||||||
(cond ((ignore-errors (org-edit-src-code))
|
(cond ((ignore-errors (org-edit-src-code))
|
||||||
(delete-other-windows))
|
(delete-other-windows))
|
||||||
((org-at-block-p)
|
((org-at-block-p)
|
||||||
(org-narrow-to-block))
|
(org-narrow-to-block))
|
||||||
(t (org-narrow-to-subtree)))
|
(t (org-narrow-to-subtree)))
|
||||||
(buffer-substring (point-min) (point-max))))))
|
(let ((content (buffer-substring (point-min) (point-max))))
|
||||||
|
(when (buffer-narrowed-p) (widen))
|
||||||
|
content))))))
|
||||||
(with-current-buffer doc-buffer
|
(with-current-buffer doc-buffer
|
||||||
(read-only-mode 1)
|
(read-only-mode 1)
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
|
|
Loading…
Reference in a new issue