1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-26 07:33:39 +00:00

Merge branch 'origin-maint'

This commit is contained in:
Eric Schulte 2012-02-18 10:39:04 -07:00
commit 5a24348778
4 changed files with 28 additions and 18 deletions

View File

@ -2269,8 +2269,10 @@ block but are passed literally to the \"example-block\"."
(defun org-babel-strip-protective-commas (body)
"Strip protective commas from bodies of source blocks."
(when body
(replace-regexp-in-string "^,#" "#" body)))
(with-temp-buffer
(insert body)
(org-strip-protective-commas (point-min) (point-max))
(buffer-string)))
(defun org-babel-script-escape (str &optional force)
"Safely convert tables into elisp lists."

View File

@ -1767,17 +1767,7 @@ from the buffer."
beg-content end-content
`(org-protected t original-indentation ,ind org-native-text t))
;; strip protective commas
(save-excursion
(save-match-data
(goto-char beg-content)
(let ((front-line (save-excursion
(re-search-forward
"[^[:space:]]" end-content t)
(goto-char (match-beginning 0))
(current-column))))
(while (re-search-forward "^[ \t]*\\(,\\)" end-content t)
(when (= (current-column) front-line)
(replace-match "" nil nil nil 1))))))
(org-strip-protective-commas beg-content end-content)
(delete-region (match-beginning 0) (match-end 0))
(save-excursion
(goto-char beg)

View File

@ -308,11 +308,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

View File

@ -5495,6 +5495,22 @@ will be prompted for."
'(font-lock-fontified t face font-lock-comment-face)))
(t nil))))))
(defun org-strip-protective-commas (beg end)
"Strip protective commas between BEG and END in the current buffer."
(interactive "r")
(save-excursion
(save-match-data
(goto-char beg)
(let ((front-line (save-excursion
(re-search-forward
"[^[:space:]]" end t)
(goto-char (match-beginning 0))
(current-column))))
(while (re-search-forward "^[ \t]*\\(,\\)\\([*]\\|#\\+\\)" end t)
(goto-char (match-beginning 1))
(when (= (current-column) front-line)
(replace-match "" nil nil nil 1)))))))
(defun org-activate-angle-links (limit)
"Run through the buffer and add overlays to links."
(if (re-search-forward org-angle-link-re limit t)