7

In org-mode I use block quotes.

#+BEGIN_QUOTE
Foo.
#+END_QUOTE

However, when I do org-edit-special inside a block quote, I get No special environment to edit here. How can I direct org-mode to treat block quotes (and verse quotes etc) as special environments, so that when I do C-c ' I can edit the quotation in its own buffer the same way I can with other code blocks?

  • 2
    Just out of curiosity, why do you want this behavior? Do you want to use editing commands specific to a certain mode in this block, or do you just want to see it in an isolated buffer? – elethan Nov 21 '15 at 14:40
  • I want the block quote in its own buffer so I can use commands like beginning-of-buffer, end-of-buffer, and mark-whole-buffer. – incandescentman Nov 21 '15 at 23:54
  • 2
    There isn't any way to change the behavior of org-edit-special. If you just want to treat the block as a buffer, select it and narrow the region with C-x n n. – user2699 Nov 22 '15 at 1:20
4

After reading the comments, it appears you're really looking for this:

  • org-narrow-to-block to narrow the buffer to the current block

    1. Place cursor within the boundary of a block, e.g. quote block

      #+BEGIN_VERSE
      Verse Block
      #+END_VERSE
      
      #+BEGIN_VERBATIM
      Verbatim Block
      #+END_VERBATIM
      
      #+BEGIN_QUOTE
      Quote Block
      #+END_QUOTE
      
    2. Type C-x n b

      The buffer will narrow to just the quote block.

      #+BEGIN_QUOTE
      Quote Block
      #+END_QUOTE
      

      Note: If you want your buffer to look more like org-edit-special,
      then type C-x n e instead.

      The buffer will look similar to the example below:

       Quote Block
      
  • widen to remove narrowing from current buffer

    1. Type C-x n w

      #+BEGIN_VERSE
      Verse Block
      #+END_VERSE
      
      #+BEGIN_VERBATIM
      Verbatim Block
      #+END_VERBATIM
      
      #+BEGIN_QUOTE
      Quote Block
      #+END_QUOTE
      

This was answer was tested using

GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)
org-mode version: 9.0

  • 1
    The shortcut should be C-x n b. – user2699 Dec 2 '15 at 0:10
  • @user2699 Thanks for catching typo! I'll fix it! – Melioratus Dec 2 '15 at 18:01
  • Yes that's it! Is there a way to define a function like org-edit-special-or-narrrow-to-block that would detect which is appropriate and do one or the other? That way I could use the same key binding for both since in my mind it's the same operation, even if not in the mind of Emacs. – incandescentman Dec 3 '15 at 2:50
  • 1
    @incandescentman - I believe so but I don't have the elisp skills to do it yet. I imagine the implementation could be similar to org-metaup, org-metadown or org-ctrl-c-ctrl-c. – Melioratus Nov 12 '16 at 21:50
-3

Use instead:

#+begin_example
  Foo.
#+end_example

Then you would be able to do org-edit-special inside the block.

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.