Browse Source

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

Eric Schulte 17 years ago
parent
commit
6cf9c4e497
1 changed files with 3 additions and 17 deletions
  1. 3 17
      litorgy/litorgy.el

+ 3 - 17
litorgy/litorgy.el

@@ -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
-don't dump results into buffer."
+commented by `org-toggle-fixed-width-section'.  With optional
+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)