Improve names, comments, and documentation in recent commits
This commit is contained in:
parent
905ba44bf4
commit
d3c55eb86d
15
README.org
15
README.org
@ -333,16 +333,17 @@ recommendation of [[info:emacs#Saving Customizations][saving customizations (inf
|
|||||||
#+name: lst:site-lisp-packages
|
#+name: lst:site-lisp-packages
|
||||||
#+begin_src emacs-lisp -n :results silent
|
#+begin_src emacs-lisp -n :results silent
|
||||||
(with-eval-after-load 'emacs
|
(with-eval-after-load 'emacs
|
||||||
;; Handle user-emacs-directory site-lisp directories as packages.
|
;; https://www.emacswiki.org/emacs/LoadPath
|
||||||
|
;; Make user-emacs-directory site-lisp directories look like packages.
|
||||||
(mapc (apply-partially 'add-to-list 'load-path)
|
(mapc (apply-partially 'add-to-list 'load-path)
|
||||||
(cl-remove-duplicates
|
(cl-remove-duplicates
|
||||||
(mapcar 'directory-file-name
|
(mapcar (lambda (file)
|
||||||
(mapcar 'file-name-directory
|
(directory-file-name (file-name-directory file)))
|
||||||
(directory-files-recursively
|
(directory-files-recursively
|
||||||
(expand-file-name "site-lisp" user-emacs-directory)
|
(expand-file-name "site-lisp" user-emacs-directory) "\\.el$"))
|
||||||
"\\.el$")))
|
|
||||||
:test #'string=))
|
:test #'string=))
|
||||||
|
|
||||||
|
;; See package.el for how to use `loaddefs-generate-dir'.
|
||||||
(defun make-loaddefs-in-buffer-directory ()
|
(defun make-loaddefs-in-buffer-directory ()
|
||||||
"Make or update the autoloads in the directory of the visited file."
|
"Make or update the autoloads in the directory of the visited file."
|
||||||
(interactive)
|
(interactive)
|
||||||
@ -3038,7 +3039,7 @@ The following posts provide programming information:
|
|||||||
(emms-playlist-mode-play-current-track)))))
|
(emms-playlist-mode-play-current-track)))))
|
||||||
|
|
||||||
(defun org-yt-url-browse-open (path)
|
(defun org-yt-url-browse-open (path)
|
||||||
"Open an \"YouTube\" link with `url-browse'."
|
"Open an \"YouTube\" link with `url-browse'."
|
||||||
(let ((url (format "https://www.youtube.com/watch?v=%s" path)))
|
(let ((url (format "https://www.youtube.com/watch?v=%s" path)))
|
||||||
(browse-url url)))
|
(browse-url url)))
|
||||||
|
|
||||||
|
@ -74,15 +74,18 @@ otherwise link to SVG images from exported my-HTML pages."
|
|||||||
;;;; Link
|
;;;; Link
|
||||||
|
|
||||||
(defun org--my-html-embed-svg-p (link)
|
(defun org--my-html-embed-svg-p (link)
|
||||||
|
"Check whether LINK links to an SVG file to embed."
|
||||||
(and (not (org-element-contents link))
|
(and (not (org-element-contents link))
|
||||||
(let ((case-fold-search t))
|
(let ((case-fold-search t))
|
||||||
(string-match-p ".svg\\'" (org-element-property :path link)))))
|
(string-match-p ".svg\\'" (org-element-property :path link)))))
|
||||||
|
|
||||||
(defun org--my-html-format-svg (path)
|
(defun org--my-html-svg-contents (path)
|
||||||
|
"Return the SVG contents of the file named PATH."
|
||||||
;; https://emacs.stackexchange.com/a/57433
|
;; https://emacs.stackexchange.com/a/57433
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert-file-contents path)
|
(insert-file-contents path)
|
||||||
(with-syntax-table nxml-mode-syntax-table
|
(with-syntax-table nxml-mode-syntax-table
|
||||||
|
;; Barf if contents contains no valid SVG.
|
||||||
(while (and (search-forward "<svg")
|
(while (and (search-forward "<svg")
|
||||||
(nth 8 (syntax-ppss)))))
|
(nth 8 (syntax-ppss)))))
|
||||||
(delete-region (point-min) (match-beginning 0))
|
(delete-region (point-min) (match-beginning 0))
|
||||||
@ -170,7 +173,7 @@ contrary to `org-html-link' which can only link such images."
|
|||||||
;; Embed SVG.
|
;; Embed SVG.
|
||||||
((and (plist-get info :my-html-embed-svg)
|
((and (plist-get info :my-html-embed-svg)
|
||||||
(org--my-html-embed-svg-p link))
|
(org--my-html-embed-svg-p link))
|
||||||
(org--my-html-format-svg path))
|
(org--my-html-svg-contents path))
|
||||||
;; Image file.
|
;; Image file.
|
||||||
((and (plist-get info :html-inline-images)
|
((and (plist-get info :html-inline-images)
|
||||||
(org-export-inline-image-p
|
(org-export-inline-image-p
|
||||||
|
Loading…
x
Reference in New Issue
Block a user