Xah Talk Show 2024-01-08 Ep528 Trackball, Write Emacs Lisp Command to Change Link to Dead Link
- 0:42 keyboard intro
- 1:54 nulea trackball
- 4:40 trackball history
- 5:43 thumb trackball vs index finger
- 12:15 kinesis 360 vs glove80
- 14:07 bloggin and dead links
- 15:05 nushell
- 22:10 coding elisp
- 31:19 code complete
- 32:24 API design issue
(defun xah-html-make-iframe-defunct ()
"Make the HTML iframe under cursor to a defunct form.
for example
<iframe src=\"https://www.youtube.com/abc\" allowfullscreen></iframe>
becomes
<s>https://www.youtube.com/abc</s>
Version: 2024-01-08"
(interactive)
(let (xp1 xp2 xwholeLinkStr xresultStr xurl)
(progn
(forward-word)
(progn
(search-backward "<iframe ")
(setq xp1 (point))
(search-forward "</iframe>")
(setq xp2 (point))
(setq xwholeLinkStr (buffer-substring-no-properties xp1 xp2))
(with-temp-buffer
(insert xwholeLinkStr)
(goto-char (point-min))
(re-search-forward "src=\"\\([^\"]+?\\)\"")
(setq xurl (match-string 1))
(setq xresultStr (format "<s>%s</s>" xurl)))))
(delete-region xp1 xp2)
(goto-char xp1)
(insert xresultStr)))