* org-src.el (org-src-strip-leading-and-trailing-blank-lines):
New variable allowing prevention of automatic stripping of
leading and trailing blank lines when exiting edit buffer.
(org-edit-src-exit): Respect value of
`org-src-strip-leading-and-trailing-blank-lines'
(org-src-native-tab-command-maybe): Bind
`org-src-strip-leading-and-trailing-blank-lines' to nil during
this function.
Hi,
The attached patch makes it clear when a language mode has thrown an
error. This can clear up confusion whether an error is originating from
Org-mode or form the language-mode in question.
Should this be committed?
Best -- Eric
* org-src.el (org-src-tab-indents-natively): New variable controlling
whether language-native TAB action should be performed
(org-src-native-tab-command-maybe): New function to perform
language-native TAB action.
(org-tab-first-hook): Add `org-src-native-tab-command-maybe'
* org.el (org-fontify-meta-lines-and-blocks): Alter main
regexp to match code blocks with switches and header
args. Call `org-src-font-lock-fontify-block' for automatic
fontification of code in code blocks, controlled by variable
`org-src-fontify-natively'.
(org-src-fontify-natively): New variable
* org-src.el (org-src-font-lock-fontify-block): New function
called during font-lock
(org-src-fontify-block): New function for manual fontification
of code block at point.
(org-src-fontify-buffer): New function to manually fontify all
code blocks in buffer
(org-src-get-lang-mode): New utility function to map language
name as a string to major mode symbol
Based on an initial fontification patch by David O'Toole and
suggestions from Carsten Dominik.
* ob.el (org-babel-do-in-edit-buffer): Suppress message and
check that org-src buffer is current before attempting exit
* org-src.el (org-edit-src-code): New argument quietlyp allows
message to be suppressed
* org-src.el (ob-comint): require 'ob-comint
(org-src-babel-info): define variable
Also, reposition `org-src-do-at-code-block' and
`org-src-do-key-sequence-at-code-block' function definitions within
the file.
* ob.el (org-babel-do-in-edit-buffer): New macro to
evaluate lisp in the language major mode edit buffer.
(org-babel-do-key-sequence-in-edit-buffer): New function to call
an arbitrary key sequence in the language major mode edit
buffer
* org-src.el (org-src-switch-to-buffer): Add new allowed value
'switch-invisibly for `org-src-window-setup'.
* ob-keys.el (org-babel-key-bindings): Bind
`org-babel-do-key-sequence-in-edit-buffer' to x and C-x in
`org-babel-map'
* org-src.el (ob-keys): Require ob-keys, because
`org-babel-map' is used.
(org-src-do-at-code-block): New macro to evaluate lisp with
point at the start of the Org code block containing the code
in this edit buffer.
(org-src-do-key-sequence-at-code-block): New function to
execute command bound to key at the Org code block containing
the code in this edit buffer.
* org-src.el (org-edit-src-code): If at src block, store babel
info as buffer local variable.
(org-src-associate-babel-session): New function to associate
code edit buffer with comint session. Does nothing
unless a language-specific function named
`org-babel-LANG-associate-session' exists.
(org-src-babel-configure-edit-buffer): New function to be
called in `org-src-mode-hook'.
(org-src-mode-hook): add `org-src-babel-configure-edit-buffer'
to hook.
This is the fifth patch in a series that makes some straightforward
corrections to a number of docstrings. Each change is normally to:
- correct a typo, or
- fix up hyperlinks to function or variable names, or
- ensure slightly better conformance with the documentation guidelines
and tips given in the Elisp manual
No attempt is made to provide missing docstrings or document arguments.
Cheers,
Phil
Carsten Dominik <dominik@uva.nl> writes:
> Hi Dan,
>
> after a long time, I tried to edit a fixed width region today.
> So I entered
>
> : a
> : b
> : c
>
> and pressed "C-c '" in there. The edit buffer came up in
> read-only mode, which should not be so.
>
> Also, when I do "C-c '" in an empty line, it used to be the case
> that I get an empty artist buffer which I can then edit. Also this
> buffer comes up as read-only.
>
> I suspect that this has to do with the changes you made for read-only
> view buffers. Before I dive into this issue myself, maybe it will be
> much
> easier if you do this?
Hi Carsten,
You're right that it dates from then. Here's the fix I suggest. I've
tested that this results in writable fixed-width edit buffers, writable
src edit buffers, and non-writable babel preview buffers.
Dan
--8<---------------cut here---------------start------------->8---
commit ed4eb9d150
Author: Dan Davison <davison@stats.ox.ac.uk>
Date: Sat Jun 5 12:35:19 2010 +0100
* lisp/org-src.el: Prevent fixed-width region edit buffers
being created as read-only.
Modified lisp/org-src.el
org-edit-src-code gains extra optional arguments `code' and
`edit-buffer-name'. If `code' is supplied, then this code forms the
contents of the edit buffer, which is made read-only. In this case,
the mechanisms for writing back to the org buffer on save are
disabled.
Optional argument `edit-buffer-name' allows a name for the edit buffer
to be supplied.
This support was totally broken. It works now again. Unfortunately
it is not possible to edit the table directly in the org-mode buffer
anymore - to edit such a table, you have to use C-c '