summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-02-18 00:59:51 (GMT)
committer Nicolas Goaziou <mail@nicolasgoaziou.fr>2015-02-18 00:59:51 (GMT)
commitc41bbc577e81e9fa5bab2509a8141189e45fe6c7 (patch)
tree312df46ffaa069acb5cc2cbda7a24c1c499ad54e
parent880a2b4f9042e188462c7c6a8996500774c21884 (diff)
downloadorg-mode-maint.zip
org-mode-maint.tar.gz
Fix "Wrong type argument: overlayp"maint
* lisp/org-src.el (org-src-mode-configure-edit-buffer): Fix "Wrong type argument: overlayp". Changing major mode in a source edit buffer resets local variables used to link it to source buffer. As a consequence, overlay in source buffer can no longer be found nor deleted.
-rw-r--r--lisp/org-src.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 752fa30..618ed9f 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -816,7 +816,10 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
(defun org-src-mode-configure-edit-buffer ()
(when (org-bound-and-true-p org-edit-src-from-org-mode)
(org-add-hook 'kill-buffer-hook
- #'(lambda () (delete-overlay org-edit-src-overlay)) nil 'local)
+ (lambda ()
+ (when (overlayp org-edit-src-overlay)
+ (delete-overlay org-edit-src-overlay)))
+ nil 'local)
(if (org-bound-and-true-p org-edit-src-allow-write-back-p)
(progn
(setq buffer-offer-save t)