0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-15 20:46:27 +00:00

replacing litorgy-make-region-example with the standard org-toggle-fixed-width-section.

This commit is contained in:
Eric Schulte 2009-03-17 14:44:50 -07:00
parent 47e18380e9
commit 6cf9c4e497

View file

@ -93,8 +93,8 @@ lisp code use the `litorgy-add-interpreter' function."
(defun litorgy-execute-src-block (&optional arg) (defun litorgy-execute-src-block (&optional arg)
"Execute the current source code block, and dump the results "Execute the current source code block, and dump the results
into the buffer immediately following the block. Results are into the buffer immediately following the block. Results are
commented by `litorgy-make-region-example'. With optional prefix commented by `org-toggle-fixed-width-section'. With optional
don't dump results into buffer." prefix don't dump results into buffer."
(interactive "P") (interactive "P")
(let* ((info (litorgy-get-src-block-info)) (let* ((info (litorgy-get-src-block-info))
(lang (first info)) (lang (first info))
@ -159,7 +159,7 @@ existing results currently located after the source block."
(let ((beg (point)) (let ((beg (point))
(end (progn (insert result) (end (progn (insert result)
(point)))) (point))))
(litorgy-make-region-example beg end)))) (org-toggle-fixed-width-section beg end))))
(defun litorgy-remove-result () (defun litorgy-remove-result ()
"Remove the result following the current source block" "Remove the result following the current source block"
@ -175,20 +175,6 @@ existing results currently located after the source block."
(forward-line -1) (forward-line -1)
(point))))) (point)))))
(defun litorgy-make-region-example (beg end)
"Comment out region using the ': ' org example quote."
(interactive "*r")
(let ((size (abs (- (line-number-at-pos end)
(line-number-at-pos beg)))))
(if (= size 0)
(let ((result (buffer-substring beg end)))
(delete-region beg end)
(insert (concat ": " result)))
(save-excursion
(goto-char beg)
(dotimes (n size)
(move-beginning-of-line 1) (insert ": ") (forward-line 1))))))
(defun litorgy-clean-text-properties (text) (defun litorgy-clean-text-properties (text)
"Strip all properties from text return." "Strip all properties from text return."
(set-text-properties 0 (length text) nil text) text) (set-text-properties 0 (length text) nil text) text)