Commits

March Liu committed 999f363

reflector the warp it mode

Comments (0)

Files changed (1)

raw-elisp/march/macos/site-lisp/wrap-it.el

 (defun wrap-it (beg end left right)
   "wrap beg to end use left and right"
-  (save-excursion ((goto-char end)
+  (save-excursion (goto-char end)
                    (insert right)
                    (goto-char beg)
-                   (insert left))))
+                   (insert left)))
 
 (defun wrap-thing-helper (thing left right)
   "wrap these"
-  (let ((contents (thing-at-point-with-bounds thing)))
-       (let ((beg (car (cdr contents)))
-             (end (cdr (cdr contents))))
+  (let ((bounds ((bounds-of-thing-at-point thing)))
+       (let ((beg (car bounds))
+             (end (cdr bounds)))
          (wrap-it beg end left right))))
 
 (defun wrap-thing (thing symbols)