emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 8a3cab0 27/46: tiny.el: removed `tiny-replace-preceding-se


From: Oleh Krehel
Subject: [elpa] master 8a3cab0 27/46: tiny.el: removed `tiny-replace-preceding-sexp'
Date: Sun, 22 Mar 2015 17:42:33 +0000

branch: master
commit 8a3cab094fe19ea986bc0cb38201c0dc413201d1
Author: oleh <address@hidden>
Commit: oleh <address@hidden>

    tiny.el: removed `tiny-replace-preceding-sexp'
---
 tiny.el |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/tiny.el b/tiny.el
index a717e45..a5ef22b 100644
--- 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]