help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: !? user-error: Not in a sub-editing buffer


From: tomas
Subject: Re: !? user-error: Not in a sub-editing buffer
Date: Thu, 30 Apr 2015 11:44:33 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Apr 30, 2015 at 11:31:38AM +0200, Gregor Zattler wrote:
> Dear Emacs users,
> 
> since today I cannot save buffers via ^x^s but Emacs says:
> 
> „user-error: Not in a sub-editing buffer“

Just FWIW and the result of a very quick-and-dirty Duck search:

this message lives (among possibly a myriad of other places, what
do I know) in Org-mode:

  (defun org-edit-src-save ()
    "Save parent buffer with current state source-code buffer."
    (interactive)
    (unless (org-src-edit-buffer-p) (user-error "Not in a sub-editing buffer"))
    (set-buffer-modified-p nil)
    (let ((edited-code (org-src--contents-for-write-back))
          (beg org-src--beg-marker)
          (end org-src--end-marker)
          (overlay org-src--overlay))
      (with-current-buffer (org-src--source-buffer)
        (undo-boundary)
        (goto-char beg)
        (delete-region beg end)
        (when (org-string-nw-p edited-code) (insert edited-code))
        (unless (bolp) (insert "\n"))
        (move-overlay overlay beg (point))
        (save-buffer))))

which is, AFAICS there for editing a source block in the source's major
mode: this makes the error message more understandable.

To debug it further you could (a) toggle-debug-on-error; (b) look for
the existence (and state) of a (presumedly) buffer local variable
org-src-edit-buffer-p in the buffer you're trying to save.

Take with a fist of salt.

- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlVB+YEACgkQBcgs9XrR2kb2LgCeNr+2qV5zo4b3Vm0GmAl0AITJ
O2wAmwbBZwvmy0hHWeVqWeo4NfL0IhUs
=M8z1
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]