Xah Talk Show 2024-07-19 Ep563, Emacs Lisp Coding move-html-text-block and random chat

vidthumb zLVDOUMSpDM

ask questions, meanwhile i work on my website.

(defun xah-move-html-text-block ()
  "Move a HTML text block or selection in current buffer to next buffer, with all relative link fixed.
Created: 2024-07-19
Version: 2024-07-19"
  (interactive)
  (let (xp1 xp2 xtext)
    (seq-setq (xp1 xp2) (xah-get-pos-of-block-or))
    (setq xtext
          (save-restriction
            (narrow-to-region xp1 xp2)
            (xah-html-local-links-to-fullpath
             default-directory (point-min) (point-max))
            (delete-and-extract-region (point-min) (point-max))))
    (other-window 1)
    (save-restriction
      (narrow-to-region (point) (point))
      (insert xtext)
      (xah-html-local-links-to-relative-path default-directory (point-min) (point-max)))))