emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/git-commit 96a073e6c9 1/2: Copy org-man-export--magit-gitm


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 96a073e6c9 1/2: Copy org-man-export--magit-gitman to docs/Makefile
Date: Thu, 20 Jan 2022 18:58:00 -0500 (EST)

branch: elpa/git-commit
commit 96a073e6c9e4cdc3fadce2430f034783de3f3407
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Copy org-man-export--magit-gitman to docs/Makefile
    
    This makes it easier to build the manuals on *elpa.
---
 default.mk          |  3 +--
 docs/Makefile       | 29 +++++++++++++++++++++++++++--
 lisp/magit-utils.el |  7 +++----
 3 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/default.mk b/default.mk
index db97261cd0..31e140c8cd 100644
--- a/default.mk
+++ b/default.mk
@@ -216,8 +216,7 @@ endif
 endif # ifndef LOAD_PATH
 
 ifndef ORG_LOAD_PATH
-ORG_LOAD_PATH  = $(LOAD_PATH)
-ORG_LOAD_PATH += -L ../../org/lisp
+ORG_LOAD_PATH = -L ../../org/lisp
 endif
 
 ## Publish ###########################################################
diff --git a/docs/Makefile b/docs/Makefile
index cad67df7f8..40f9667b27 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -86,8 +86,8 @@ clean-stats:
 
 ## Release management ################################################
 
-ORG_ARGS  = --batch -Q $(ORG_LOAD_PATH)
-ORG_ARGS += -l magit-utils -l ol-man
+ORG_ARGS  = --batch -Q $(ORG_LOAD_PATH) -l ol-man
+ORG_EVAL += --eval "(progn $$ORG_MAN_EXPORT)"
 ORG_EVAL += --eval "(setq indent-tabs-mode nil)"
 ORG_EVAL += --eval "(setq org-src-preserve-indentation nil)"
 ORG_EVAL += --funcall org-texinfo-export-to-texinfo
@@ -174,6 +174,31 @@ release-manuals: $(PUBLISH_TARGETS)
        @aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) 
--paths \
        "$(subst $(space),$(comma),$(addprefix 
$(RELEASE_PATH),$(CFRONT_PATHS)))" > /dev/null
 
+# Lisp ###############################################################
+
+# When making changes here, then also adjust the copy in magit-utils.el.
+define ORG_MAN_EXPORT
+(advice-add 'org-man-export :around 'org-man-export--magit-gitman)
+(defun org-man-export--magit-gitman (fn link description format)
+  (if (and (eq format 'texinfo) ;'
+           (string-match-p "\\`git" link))
+      (replace-regexp-in-string "%s" link "
+@ifinfo
+@ref{%s,,,gitman,}.
+@end ifinfo
+@ifhtml
+@html
+the <a href=\"http://git-scm.com/docs/%s\";>%s(1)</a> manpage.
+@end html
+@end ifhtml
+@iftex
+the %s(1) manpage.
+@end iftex
+")
+    (funcall fn link description format)))
+endef
+export ORG_MAN_EXPORT
+
 # Templates ##########################################################
 
 define AUTHORS_HEADER
diff --git a/lisp/magit-utils.el b/lisp/magit-utils.el
index 473b70416d..49a88f573c 100644
--- a/lisp/magit-utils.el
+++ b/lisp/magit-utils.el
@@ -1168,6 +1168,9 @@ or (last of all) the value of EXP."
 (advice-add 'Info-follow-nearest-node :around
             'Info-follow-nearest-node--magit-gitman)
 
+;; When making changes here, then also adjust the copy in docs/Makefile.
+;;;###autoload
+(advice-add 'org-man-export :around 'org-man-export--magit-gitman)
 ;;;###autoload
 (defun org-man-export--magit-gitman (fn link description format)
   (if (and (eq format 'texinfo)
@@ -1187,10 +1190,6 @@ the %s(1) manpage.
 ")
     (funcall fn link description format)))
 
-;;;###autoload
-(advice-add 'org-man-export :around
-            'org-man-export--magit-gitman)
-
 ;;; Kludges for Package Managers
 
 (defun magit--straight-chase-links (filename)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]