9

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?

3
  • 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
    Commented Nov 21, 2015 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. Commented Nov 21, 2015 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
    Commented Nov 22, 2015 at 1:20

2 Answers 2

5

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

4
  • 1
    The shortcut should be C-x n b.
    – user2699
    Commented Dec 2, 2015 at 0:10
  • @user2699 Thanks for catching typo! I'll fix it!
    – Melioratus
    Commented Dec 2, 2015 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. Commented Dec 3, 2015 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
    Commented Nov 12, 2016 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 and acknowledge you have read our privacy policy.

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