emacs lisp live coding + tutorial. command to convert png to jpg while in html buffer 2019-12-09
- emacs. program to convert to jpg while in html buffer. get on to coding it fast. We did 1 hour demo of these commands few days ago.
- Elisp: File and Directory Functions
- Elisp: Get User Input
- Emacs: Convert Image Files in Dired
- Emacs: xah-find.el, Find Replace in Pure Elisp
(defun xah-convert-png-to-jpg-inline () "convert the image file under cursor in a html file, from jpg to png, then, linkify it in html. Version 2019-12-09" (interactive) (let ( inputPath cmdStr fileCoreName ) (setq inputPath (thing-at-point 'filename)) (setq fileCoreName (file-name-sans-extension inputPath)) (setq cmdStr (format "convert %s.png %s.jpg" fileCoreName fileCoreName )) (shell-command cmdStr ) (when (yes-or-no-p "Delete the png file?") (delete-file inputPath)) (search-backward "<" ) (insert fileCoreName ".jpg") (insert "\n") (backward-char 2) (xah-html-image-linkify) ;; ))
If you have a question, put $5 at patreon and message me.