-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathar-thingatpt-peel.el
38 lines (33 loc) · 1.25 KB
/
ar-thingatpt-peel.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
;; Peel functions start
(defun ar--raise-inner-list (beg end)
(let* ((bounds (ar-bounds-of-list-atpt))
(inner-beg (or (ignore-errors (caar bounds))(car-save bounds)))
(inner-end
(cond ((ignore-errors (listp bounds))
(if (ignore-errors (numberp (cdr bounds)))
(copy-marker (cdr bounds))
(copy-marker (or (ignore-errors (cdr (cadr bounds)))(ignore-errors (cadr bounds))))))))
;; (inner-end (cadr bounds))
(erg (buffer-substring inner-beg inner-end)))
;; (delete-region inner-beg inner-end)
(goto-char beg)
(delete-region beg end)
(insert erg)))
(defun ar--raise-inner-sexp (beg end)
(skip-chars-forward (concat "^" th-beg-delimiter ar-delimiters-atpt))
(let* ((bounds (ar-bounds-of-delimited-atpt))
(inner-beg (or (ignore-errors (caar bounds))(car-safe bounds)))
(inner-end
(cond ((ignore-errors (listp bounds))
(or (ignore-errors (cdr (cadr bounds)))(ignore-errors (cadr bounds))
(cdr bounds)))))
(erg (buffer-substring inner-beg inner-end)))
(goto-char beg)
(delete-region beg end)
(insert erg)))
(defun ar-peel-list-atpt (&optional arg)
"Remove list at point, preserve inner lists. "
(interactive "*p")
(ar-th-peel 'list arg))
(provide 'ar-thingatpt-peel)
;;; ar-thingatpt-peel.el ends here