Update to Org version 7.8.07 (commit da0e6f in Org's repo)

This commit is contained in:
Bastien Guerry 2012-04-01 11:49:25 +02:00
parent 42ee526b1a
commit 153ae947f8
51 changed files with 3468 additions and 1276 deletions

View file

@ -43,6 +43,8 @@
(declare-function org-switch-to-buffer-other-window "org" (&rest args))
(declare-function org-pop-to-buffer-same-window
"org-compat" (&optional buffer-or-name norecord label))
(declare-function org-strip-protective-commas "org" (beg end))
(declare-function org-base-buffer "org" (buffer))
(defcustom org-edit-src-region-extra nil
"Additional regexps to identify regions for editing with `org-edit-src-code'.
@ -153,7 +155,8 @@ but which mess up the display of a snippet in Org exported files.")
(defcustom org-src-lang-modes
'(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist)
("asymptote" . asy) ("dot" . fundamental) ("sqlite" . sql)
("calc" . fundamental) ("C" . c) ("cpp" . c++))
("calc" . fundamental) ("C" . c) ("cpp" . c++)
("screen" . shell-script))
"Alist mapping languages to their major mode.
The key is the language name, the value is the string that should
be inserted as the name of the major mode. For many languages this is
@ -211,16 +214,16 @@ buffer."
(interactive)
(unless (eq context 'save)
(setq org-edit-src-saved-temp-window-config (current-window-configuration)))
(let ((mark (and (org-region-active-p) (mark)))
(case-fold-search t)
(info (org-edit-src-find-region-and-lang))
(full-info (org-babel-get-src-block-info))
(org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive
(beg (make-marker))
(end (make-marker))
(allow-write-back-p (null code))
block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
begline markline markcol line col transmitted-variables)
(let* ((mark (and (org-region-active-p) (mark)))
(case-fold-search t)
(info (org-edit-src-find-region-and-lang))
(full-info (org-babel-get-src-block-info 'light))
(org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive
(beg (make-marker))
(end (make-marker))
(allow-write-back-p (null code))
block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
begline markline markcol line col transmitted-variables)
(if (not info)
nil
(setq beg (move-marker beg (nth 0 info))
@ -306,11 +309,13 @@ buffer."
(error "Language mode `%s' fails with: %S" lang-f (nth 1 e)))))
(dolist (pair transmitted-variables)
(org-set-local (car pair) (cadr pair)))
(when (eq major-mode 'org-mode)
(goto-char (point-min))
(while (re-search-forward "^," nil t)
(if (eq (org-current-line) line) (setq total-nindent (1+ total-nindent)))
(replace-match "")))
(if (eq major-mode 'org-mode)
(progn
(goto-char (point-min))
(while (re-search-forward "^," nil t)
(if (eq (org-current-line) line) (setq total-nindent (1+ total-nindent)))
(replace-match "")))
(org-strip-protective-commas (point-min) (point-max)))
(when markline
(org-goto-line (1+ (- markline begline)))
(org-move-to-column
@ -369,6 +374,15 @@ buffer."
"Construct the buffer name for a source editing buffer."
(concat "*Org Src " org-buffer-name "[ " lang " ]*"))
(defun org-src-edit-buffer-p (&optional buffer)
"Test whether BUFFER (or the current buffer if BUFFER is nil)
is a source block editing buffer."
(let ((buffer (org-base-buffer (or buffer (current-buffer)))))
(and (buffer-name buffer)
(string-match "\\`*Org Src " (buffer-name buffer))
(local-variable-p 'org-edit-src-beg-marker buffer)
(local-variable-p 'org-edit-src-end-marker buffer))))
(defun org-edit-src-find-buffer (beg end)
"Find a source editing buffer that is already editing the region BEG to END."
(catch 'exit