Organize integrations section
authorDaniel Semyonov <daniel@dsemy.com>
Wed, 30 Jun 2021 22:48:33 +0000 (01:48 +0300)
committerAlex Schroeder <alex@gnu.org>
Thu, 1 Jul 2021 06:51:12 +0000 (08:51 +0200)
Mark different sections with comments.
Move all declarations for byte compilation to 'eval-when-compile'
blocks at the start of the appropriate sections.

elpher.el

index c7be956..d9046bc 100644 (file)
--- a/elpher.el
+++ b/elpher.el
@@ -1784,6 +1784,13 @@ If ADDRESS is already bookmarked, update the label only."
 ;;; Integrations
 ;;
 
 ;;; Integrations
 ;;
 
+;;; Org
+
+;; Avoid byte compilation warnings.
+(eval-when-compile
+  (declare-function org-link-store-props "ol")
+  (declare-function org-link-set-parameters "ol"))
+
 (defun elpher-org-export-link (link description format protocol)
   "Export a LINK with DESCRIPTION for the given PROTOCOL and FORMAT.
 
 (defun elpher-org-export-link (link description format protocol)
   "Export a LINK with DESCRIPTION for the given PROTOCOL and FORMAT.
 
@@ -1801,8 +1808,6 @@ of gemini, gopher or finger."
              url
            (format "%s (%s)" desc url))))))
 
              url
            (format "%s (%s)" desc url))))))
 
-;; Avoid byte compilation warnings.
-(declare-function org-link-store-props "ol")
 (defun elpher-org-store-link ()
   "Store link to an `elpher' page in Org."
   (when (eq major-mode 'elpher-mode)
 (defun elpher-org-store-link ()
   "Store link to an `elpher' page in Org."
   (when (eq major-mode 'elpher-mode)
@@ -1829,8 +1834,6 @@ paramter elpher, where link is self-contained."
                (format "%s:%s" protocol link))))
     (elpher-go url)))
 
                (format "%s:%s" protocol link))))
     (elpher-go url)))
 
-;; Avoid byte compilation warnings.
-(declare-function org-link-set-parameters "ol")
 (with-eval-after-load 'org
   (org-link-set-parameters
    "elpher"
 (with-eval-after-load 'org
   (org-link-set-parameters
    "elpher"
@@ -1854,6 +1857,12 @@ paramter elpher, where link is self-contained."
              (elpher-org-export-link link description format "finger"))
    :follow (lambda (link _arg) (elpher-org-follow-link link "finger"))))
 
              (elpher-org-export-link link description format "finger"))
    :follow (lambda (link _arg) (elpher-org-follow-link link "finger"))))
 
+;;; Browse URL
+
+;; Avoid byte compilation warnings.
+(eval-when-compile
+  (defvar thing-at-point-uri-schemes))
+
 ;;;###autoload
 (defun elpher-browse-url-elpher (url &rest _args)
   "Browse URL using Elpher.  This function is used by `browse-url'."
 ;;;###autoload
 (defun elpher-browse-url-elpher (url &rest _args)
   "Browse URL using Elpher.  This function is used by `browse-url'."
@@ -1878,15 +1887,15 @@ paramter elpher, where link is self-contained."
                       ;; chain must continue, then return t.
                       t))))))
 
                       ;; chain must continue, then return t.
                       t))))))
 
-;; Avoid byte compilation warnings.
-(eval-when-compile
-  (defvar thing-at-point-uri-schemes)
-  (defvar mu4e~view-beginning-of-url-regexp))
-
 ;; Register "gemini://" as a URI scheme so `browse-url' does the right thing
 (with-eval-after-load 'thingatpt
   (add-to-list 'thing-at-point-uri-schemes "gemini://"))
 
 ;; Register "gemini://" as a URI scheme so `browse-url' does the right thing
 (with-eval-after-load 'thingatpt
   (add-to-list 'thing-at-point-uri-schemes "gemini://"))
 
+;;; Mu4e:
+
+(eval-when-compile
+  (defvar mu4e~view-beginning-of-url-regexp))
+
 (with-eval-after-load 'mu4e-view
   ;; Make mu4e aware of the gemini world
   (setq mu4e~view-beginning-of-url-regexp
 (with-eval-after-load 'mu4e-view
   ;; Make mu4e aware of the gemini world
   (setq mu4e~view-beginning-of-url-regexp