Commit Graph

148 Commits

Author SHA1 Message Date
Sergey Litvinov c0e2351e1a Map "cpp" to c++-mode 2011-08-05 11:32:02 -06:00
emacs 7340cee33a Update website to show 7.7 as current release 2011-07-28 10:33:35 +00:00
Bastien Guerry 5c53026d32 Fix (a lot of) compiler warnings.
Also introduce `org-pop-to-buffer-same-window' as a compatibility
function for Emacs =>24.1.
2011-07-18 19:25:10 +02:00
Bastien Guerry 9c05a7c781 Bump to version 7.6 2011-07-06 21:06:03 +02:00
Dan Davison 4f3a31dd97 Fix a bug in in-buffer src fontification
* lisp/org-src.el: Append a space character to copied text so that the
                   final text property change is picked up correctly
2011-06-17 16:51:29 -07:00
Eric Schulte 94b325839c Replacing '(λ...) with #'(λ...).
* lisp/org-ascii.el (org-export-as-ascii): Replacing '(λ...) with #'(λ...).
* lisp/org-attach.el: Replacing '(λ...) with #'(λ...).
  (org-attach-commit): Replacing '(λ...) with #'(λ...).
* lisp/org-exp.el: Replacing '(λ...) with #'(λ...).
  (org-export-handle-include-files): Replacing '(λ...) with #'(λ...).
* lisp/org-html.el: Replacing '(λ...) with #'(λ...).
  (org-export-as-html): Replacing '(λ...) with #'(λ...).
* lisp/org-mouse.el: Replacing '(λ...) with #'(λ...).
  (org-mouse-popup-global-menu): Replacing '(λ...) with
  (org-mode-hook): Replacing '(λ...) with #'(λ...).
  (org-agenda-mode-hook): Replacing '(λ...) with #'(λ...).
* #'(λ...).Replacing '(λ...) with #'(λ...).
  (org-mouse-context-menu): Replacing '(λ...) with #'(λ...).
* lisp/org-src.el: Replacing '(λ...) with #'(λ...).
  (org-src-mode-configure-edit-buffer): Replacing '(λ...) with #'(λ...).
* lisp/org-table.el: Replacing '(λ...) with #'(λ...).
  (org-table-fix-formulas-confirm): Replacing '(λ...) with #'(λ...).
* lisp/org.el: Replacing '(λ...) with #'(λ...).
  (org-confirm-shell-link-function): Replacing '(λ...) with
  (org-category): Replacing '(λ...) with #'(λ...).
* #'(λ...).Replacing '(λ...) with #'(λ...).
  (org-time-stamp-rounding-minutes): Replacing '(λ...) with #'(λ...).
2011-06-14 12:01:04 -07:00
Eric Schulte 1997e19bd5 org-src-lang-modes: added alias "C" to "c"
* lisp/org-src.el (org-src-lang-modes): Added a language alias of "C"
  to "c".
2011-04-15 10:16:52 -06:00
Eric Schulte 30931bfe1d edit-prep: language specific src-edit buffer preparation, with R session association
* lisp/ob-R.el (org-babel-edit-prep:R): Associate the appropriate R
  process with the edit buffer when :session is specified.

* lisp/org-src.el (org-edit-src-code): Allow language-specific
  edit-buffer preparation by calling the org-babel-edit-prep:lang
  function when it is defined.
2011-04-02 11:46:08 -06:00
emacs 11a10bdfe7 Update website to show 7.5 as current release 2011-03-07 14:27:39 +00:00
Bastien Guerry 846a2d13d3 Code cleanup: use (org-mode-p) when possible. 2011-02-15 05:18:22 +01:00
Bastien Guerry a923f528cd org-src.el: allow source editing from modes derived from Org.
* org-src.el (org-edit-src-code): allow to edit source code
from modes derived from Org.
2011-02-15 05:04:22 +01:00
Dan Davison 10f5ac643d Reorganize org-edit-src-code; allow buffer-local `org-edit-src-content-indentation'
* lisp/org-src.el (org-edit-src-code): When generating the code edit
buffer, it is necessary for several variables to inherit their values
from the parent org buffer. These changes collect all such variables
together into a single association list of (variable-name value)
pairs. In addition, a new variable is added to the list:
`org-edit-src-content-indentation'. This has the effect that a buffer
local value can be used for that variable.
2011-02-13 11:00:17 +00:00
Dan Davison bbb28d5bf8 Get rid of extra help message when editing src code
* lisp/org-src.el (org-edit-src-persistent-message): Change docstring.
(org-edit-src-code): Get rid of help message in echo area.
* lisp/ob.el (org-babel-do-in-edit-buffer): Do not pass 'quietly
argument to org-edit-src-code as this has been removed
2011-02-01 11:44:32 +00:00
Dan Davison 7fa375d632 Avoid errors during fontification of src blocks.
* lisp/org-src.el (org-src-font-lock-fontify-block): Test, early on,
that a major-mode function corresponding to the language string
exists.

Thanks to Bernt Hansen for the report and investigation.
2010-12-22 11:50:42 +00:00
Carsten Dominik 7666ba421f Version number back to 7.4 2010-12-10 18:49:40 +01:00
Carsten Dominik 76a25715c9 Bump version number to 7.5 2010-12-10 18:43:10 +01:00
Dan Davison 9db0d7e20b Tweak condition for src buffer to inherit active region.
* lisp/org-src.el (org-edit-src-code): Allow region to be inherited by
edit buffer when mark is one character beyond end of src block.

Thanks to Jambunathan K. for the bug report:

 C-c C-v C-M-h and C-c C-v C-x interaction

   In the block below do

   1. C-c C-v C-M-h, C-c C-v C-x C-M-\
   2. Mark (just) the code-block with C-SPC etc etc. C-c C-v C-x C-M-\

   See the difference in behaviour.

<text:p text:style-name="Standard">This is a xref to
<text:bookmark-ref text:reference-format="text"
text:ref-name="__RefHeading__1669_1684552201">Heading8
</text:bookmark-ref>.</text:p>

I have transient mark mode on.
2010-11-19 23:32:30 +00:00
Bastien Guerry 6630edbd0f Set version number to 7.3 2010-11-07 14:52:14 +01:00
Eric Schulte 598be4a4a4 ob-calc: added to org-src-lang-modes, safer evaluation, better error messages
* lisp/ob-calc.el (org-babel-execute:calc): safer evaluation and
  hopefully better error messages

* lisp/org-src.el (org-src-lang-modes): mapping calc blocks to
  fundamental mode
2010-10-29 19:18:28 -06:00
Carsten Dominik 82af72eef7 Push version number to 7.02trans 2010-10-29 09:11:46 +02:00
Dan Davison 60423d2805 Avoid resolving babel references with C-c '
* org-src.el (org-edit-src-code): Supply non-nil argument to
	`org-babel-get-src-block-info' to avoid resolving variable
	references
2010-10-21 13:06:56 +01:00
Carsten Dominik 5014288b68 Fix Emacs 22 compatibility
* lisp/org-src.el (org-edit-src-code): Use `org-region-active-p'.
2010-10-12 17:51:31 +02:00
Dan Davison 9c211df6ae Don't move point when generating org-src edit buffer
* org-src.el (org-edit-src-code): Don't move point when
	generating edit buffer
2010-09-30 11:43:55 +01:00
Dan Davison 940ab32aa8 Adjustment of location of point when generating org-src edit buffer
* org-src.el (org-edit-src-code): Deal with point being in #+end_src line
2010-09-30 11:43:55 +01:00
Dan Davison 1923c54502 Add customize interface for `org-src-tab-acts-natively'
* org-src.el (org-src-tab-acts-natively): Add customize interface
2010-09-21 15:17:01 +01:00
Dan Davison ca4391f9b5 Provide control over stripping of leading/trailing blank lines from code blocks
* 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.
2010-09-21 15:02:33 +01:00
Dan Davison 92249cffb0 Transmit active region from Org buffer to code edit buffer
* org-src.el (org-edit-src-code): If mark was inside code
    block then code edit buffer inherits mark with active region.
2010-09-21 15:02:33 +01:00
Eric Schulte 2a688e9aeb Explicitly mention when a language-mode throws an error
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
2010-09-14 14:03:15 +02:00
Dan Davison 0d5791e7b7 Allow language-native TAB command in code blocks.
* 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'
2010-09-02 11:57:03 -07:00
Dan Davison abfc2cc30e Re-use hidden language major mode buffers during code fontification
* org-src.el (org-src-font-lock-fontify-block): Re-use hidden
	language major mode buffers during fontification
2010-09-02 08:13:13 -07:00
Dan Davison 73957b8fbf Fontify code in code blocks.
* 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.
2010-09-02 08:12:58 -07:00
Dan Davison 49d63185cc babel: Docstring improvement
* org-src.el (org-edit-src-code): Improve docstring

Patch from Richard Riley
2010-09-01 21:16:15 -07:00
Dan Davison 4ac8294020 Avoid error and unnecessary message in transient use of code edit buffer
* 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
2010-08-17 23:40:53 -04:00
Dan Davison 76790e1aa8 Get rid of some compiler warnings.
* 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.
2010-08-17 22:37:19 -04:00
Dan Davison f9cecd192d Make language major mode commands available at Org code blocks.
* 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'
2010-08-17 17:46:04 -04:00
Dan Davison 441288ee72 Make Org-babel commands available in code edit buffers
* 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.
2010-08-17 17:45:47 -04:00
Dan Davison b61e0c4dfc Associate code edit buffer with babel comint session, if one exists.
* 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.
2010-08-17 17:32:23 -04:00
Carsten Dominik 6268cceec3 Mention release 7.01 on the website, push release number to 7.01trans 2010-07-19 08:33:24 +02:00
Philip Rooke 6e6790f685 Correct some doc strings [part 5]
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
2010-07-18 07:23:51 +02:00
Eric Schulte 869082e5fd added sqlite -> sql-mode mapping to org-src-lang-modes
* lisp/org-src.el (org-src-lang-modes): added sqlite to sql-mode
2010-07-07 12:40:43 -07:00
Dan Davison cab9fefbf9 Read-only src buffers
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
2010-06-05 14:31:35 +02:00
Michael Sperber 67b5a92c78 Fix org-src saving mechanism for XEmacs
write-contents-hooks is not buffer-local by default in XEmacs 21.4.
2010-05-24 09:20:23 -04:00
Carsten Dominik c86a3fc4aa Push version number to 6.36trans 2010-05-09 06:24:20 +02:00
Carsten Dominik 88100d1580 Release 6.36a 2010-05-09 06:13:54 +02:00
Carsten Dominik f5cffa89ef Minor fixes 2010-05-08 09:25:47 +02:00
Dan Davison b1f1cdda40 Correct free variable error in org-src.el 2010-05-02 00:57:30 -04:00
Dan Davison 182b107682 Correct coderef switch in docstring 2010-04-30 22:53:53 -04:00
Dan Davison 02e557745f org-src: different message in read-only mode 2010-04-23 10:10:01 -06:00
Dan Davison d1b8b347fe Allow org-src edit buffer to be used in read-only mode
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.
2010-04-23 10:10:01 -06:00
Carsten Dominik 008dbe15ec Don't mistake ditaa figures for tables
Patch by Dan Davison, after a report by Bernt Hansen.
2010-04-21 09:49:31 +02:00