1

When I use C-c' (org-edit-special) to edit an org-mode code block, I am running into an error. After I open the code block and edit it, then exit with C-c' again, the code block is locked (I think that is the right term).

If I try to edit the same area in the org file in either org-mode or in the org-edit-special emacs-lisp-mode I get the following error (as displayed in my **Messages** buffer):

user-error: Cannot modify an area being edited in a dedicated buffer

even though I have closed the org-mode src emacs-lisp-mode editing buffer with either C-c' or C-cC-k

I am using the following version of Emacs:

GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-06-06

with the following version of org-mode:

Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /app/share/emacs/26.1/lisp/org/)

installed on Ubuntu 18.04 with Flatpak via Flathub

Here are some screenshots if that might relevant to others:

Here is a screenshot of me before editing with C-c': Here is a screenshot of me before editing with <kbd>C-c '</kbd>

Here is a screenshot of me editing: Here is a screenshot of me editing

Here is a screenshot of that part of the file now being locked: Here is a screenshot of that part of the file now being locked

I am quite sure this a problem is due to a plugin, and not a problem caused by Emacs or Org-mode, but I wanted to post this in case anyone else was running into the same issue. What really motivated me to create this post was the fact that there are only 30 results for searching for this error on Google (hopefully soon to be 8).

2

It turns out it I was correct in my suspicion that this was not due to Emacs or Org-mode, but in fact was due to my paredit configuration:

(use-package paredit :ensure t :config (autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t) ;; (add-hook 'prog-mode-hook #'enable-paredit-mode) (add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) (add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode) (add-hook 'ielm-mode-hook #'enable-paredit-mode) (add-hook 'lisp-mode-hook #'enable-paredit-mode) (add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) (add-hook 'scheme-mode-hook #'enable-paredit-mode) (add-hook 'geiser-repl-mode-hook #'enable-paredit-mode) (add-hook 'slime-repl-mode-hook #'enable-paredit-mode) (add-hook 'clojure-mode-hook #'enable paredit-mode) (add-hook 'clojurescript-mode-hook #'enable-paredit-mode) (add-hook 'org-src-mode-hook #'enable paredit-mode))

specifically, it seems that:

(add-hook 'org-src-mode-hook #'enable paredit-mode)

was causing my issue. If you are having the error

Cannot modify an area being edited in a dedicated buffer

and have this line enabled in your paredit configuration, I recommend commenting it out and seeing if that fixes your issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.