]> code.delx.au - gnu-emacs-elpa/commitdiff
tiny.el: removed `tiny-replace-preceding-sexp'
authoroleh <wave@mail.ua>
Mon, 7 Oct 2013 19:30:16 +0000 (21:30 +0200)
committeroleh <wave@mail.ua>
Mon, 7 Oct 2013 19:30:16 +0000 (21:30 +0200)
tiny.el

diff --git a/tiny.el b/tiny.el
index a717e45aef93583a49e548bf6cd6f9a4d2cc0648..a5ef22b3f9f2a96f097d5e5b8c69c053769ca416 100644 (file)
--- a/tiny.el
+++ b/tiny.el
@@ -114,16 +114,6 @@ At the moment, only `tiny-mapconcat' is supported.
 (defun tiny-setup-default ()
   (global-set-key (kbd "C-;") 'tiny-expand))
 
-(defun tiny-replace-preceding-sexp ()
-  (unless (looking-back ")")
-    (error "bad location"))
-  (let ((sexp (preceding-sexp)))
-    (if (eq (car sexp) 'lambda)
-        (error "lambda evaluates to itself")
-      (let ((value (eval sexp)))
-        (kill-sexp -1)
-        (insert (format "%s" value))))))
-
 (defun tiny-replace-this-sexp ()
   "Eval and replace the current sexp.
 On error go up list and try again."
@@ -131,8 +121,15 @@ On error go up list and try again."
   (catch 'success
     (while t
       (ignore-errors
-        (tiny-replace-preceding-sexp)
-        (throw 'success t))
+        (unless (looking-back ")")
+          (error "bad location"))
+        (let ((sexp (preceding-sexp)))
+          (if (eq (car sexp) 'lambda)
+              (error "lambda evaluates to itself")
+            (let ((value (eval sexp)))
+              (kill-sexp -1)
+              (insert (format "%s" value))
+              (throw 'success t)))))
       ;; if can't replace, go up list
       (condition-case nil
           (tiny-up-list)