[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bounds-of-thing-at-point for paragraphs
From: |
Christopher Dimech |
Subject: |
bounds-of-thing-at-point for paragraphs |
Date: |
Sun, 1 Nov 2020 17:08:04 +0100 |
Been trying to write a function to transpose two paragraphs but keep the cursor
at the same position. How is it that bounds-of-thing-at-point does not take
paragraph as argument?
(defun Skip-Over-Paragraphs (arg)
(let ((Prg-Bounds (bounds-of-thing-at-point 'paragraph)))
;; ----------------------------------------------------------------
(when Wrd-Bounds
(let*
( (Beg (point))
(End (cdr Prg-Bounds))
(Shift (- Beg End))
;; --------------------------------------------------------
(Cursor-Psn
(save-excursion
(goto-char End) ; [#A]
(if (condition-case err
(progn ; bodyform
(transpose-paragraphs arg) ; [#B]
t
)
(message err) ; Handler when [#B] fails
)
;; ----------------------------------------------
(+ (point) Shift) ; Shift after executing [#B]
nil ; [#B] failed
;; ----------------------------------------------
)
)
)
;; --------------------------------------------------------
)
(when Cursor-Psn (goto-char Cursor-Psn))
)
)
;;-----------------------------------------------------------------
) ; let bounds (start and end locations of word)
)
- bounds-of-thing-at-point for paragraphs,
Christopher Dimech <=
- Re: bounds-of-thing-at-point for paragraphs, Jean Louis, 2020/11/01
- Re: bounds-of-thing-at-point for paragraphs, Christopher Dimech, 2020/11/01
- RE: bounds-of-thing-at-point for paragraphs, Drew Adams, 2020/11/01
- Re: bounds-of-thing-at-point for paragraphs, Jean Louis, 2020/11/01
- RE: bounds-of-thing-at-point for paragraphs, Drew Adams, 2020/11/01
- Re: RE: bounds-of-thing-at-point for paragraphs, Christopher Dimech, 2020/11/01
- RE: RE: bounds-of-thing-at-point for paragraphs, Drew Adams, 2020/11/01
- Re: RE: RE: bounds-of-thing-at-point for paragraphs, Christopher Dimech, 2020/11/01
- Re: RE: RE: bounds-of-thing-at-point for paragraphs, Jean Louis, 2020/11/01
- RE: RE: RE: bounds-of-thing-at-point for paragraphs, Drew Adams, 2020/11/01