From 6cf9c4e49729ffa739532b79a4446bc49b9e9b6a Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Tue, 17 Mar 2009 14:44:50 -0700 Subject: [PATCH] replacing litorgy-make-region-example with the standard org-toggle-fixed-width-section. --- litorgy/litorgy.el | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/litorgy/litorgy.el b/litorgy/litorgy.el index baa9658b5..3ae1cb029 100644 --- a/litorgy/litorgy.el +++ b/litorgy/litorgy.el @@ -93,8 +93,8 @@ lisp code use the `litorgy-add-interpreter' function." (defun litorgy-execute-src-block (&optional arg) "Execute the current source code block, and dump the results into the buffer immediately following the block. Results are -commented by `litorgy-make-region-example'. With optional prefix -don't dump results into buffer." +commented by `org-toggle-fixed-width-section'. With optional +prefix don't dump results into buffer." (interactive "P") (let* ((info (litorgy-get-src-block-info)) (lang (first info)) @@ -159,7 +159,7 @@ existing results currently located after the source block." (let ((beg (point)) (end (progn (insert result) (point)))) - (litorgy-make-region-example beg end)))) + (org-toggle-fixed-width-section beg end)))) (defun litorgy-remove-result () "Remove the result following the current source block" @@ -175,20 +175,6 @@ existing results currently located after the source block." (forward-line -1) (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) "Strip all properties from text return." (set-text-properties 0 (length text) nil text) text)