Skip to content

Commit

Permalink
Release version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Feb 14, 2019
0 parents commit 33f538a
Show file tree
Hide file tree
Showing 10 changed files with 7,591 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/config.mk
/docs/*.html
/docs/*.pdf
/docs/dir
/docs/transient/
676 changes: 676 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-include config.mk
include default.mk

.PHONY: lisp docs clean

all: lisp docs

help:
$(info make all - generate lisp and manual)
$(info make docs - generate most manual formats)
$(info make lisp - generate byte-code and autoloads)
$(info make texi - generate texi manual (see comments))
$(info make info - generate info manual)
$(info make html - generate html manual file)
$(info make html-dir - generate html manual directory)
$(info make pdf - generate pdf manual)
$(info make publish - publish snapshot manuals)
$(info make release - publish release manuals)
$(info make clean - remove most generated files)
@printf "\n"

lisp:
@$(MAKE) -C lisp lisp

docs:
@$(MAKE) -C docs docs

texi:
@$(MAKE) -C docs texi

info:
@$(MAKE) -C docs info

html:
@$(MAKE) -C docs html

html-dir:
@$(MAKE) -C docs html-dir

pdf:
@$(MAKE) -C docs pdf

publish:
@$(MAKE) -C docs publish

release:
@$(MAKE) -C docs release

clean:
@printf "Cleaning...\n"
@$(MAKE) -C lisp clean
@$(MAKE) -C docs clean
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Transient commands
==================

Taking inspiration from prefix keys and prefix arguments, Transient
implements a similar abstraction involving a prefix command, infix
arguments and suffix commands. We could call this abstraction a
"transient command", but because it always involves at least two
commands (a prefix and a suffix) we prefer to call it just a
"transient".

> Transient keymaps are a feature provided by Emacs. Transients as
> implemented by this package involve the use of transient keymaps.
>
> Emacs provides a feature that it calls "prefix commands". When we
> talk about "prefix commands" in Transient's documentation, then we
> mean our own kind of "prefix commands", unless specified otherwise.
> To avoid ambiguity we sometimes use the terms "transient prefix
> command" for our kind and "regular prefix command" for Emacs' kind.
When the user calls a transient prefix command, then a transient
(temporary) keymap is activated, which binds the transient's infix and
suffix commands, and functions that control the transient state are
added to `pre-command-hook` and `post-command-hook`. The available
suffix and infix commands and their state are shown in the echo area
until the transient is exited by invoking a suffix command.

Calling an infix command causes its value to be changed. How that is
done depends on the type of the infix command. The simplest case is
an infix command that represents a command-line argument that does not
take a value. Invoking such an infix command causes the switch to be
toggled on or off. More complex infix commands may read a value from
the user, using the minibuffer.

Calling a suffix command usually causes the transient to be exited;
the transient keymaps and hook functions are removed, the echo area no
longer shows information about the (no longer bound) suffix commands,
the values of some public global variables are set, while some
internal global variables are unset, and finally the command is
actually called. Suffix commands can also be configured to not exit
the transient.

A suffix command can, but does not have to, use the infix arguments in
much the same way it can choose to use or ignore the prefix arguments.
For a suffix command that was invoked from a transient the variable
`current-transient-suffixes` and the function `transient-args` serve about
the same purpose as the variables `prefix-arg` and `current-prefix-arg` do
for any command that was called after the prefix arguments have been
set using a command such as `universal-argument`.

![screenshot](http://readme.emacsair.me/assets/readme/transient.png)
25 changes: 25 additions & 0 deletions default.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
PKG = transient

ELS = $(PKG).el
ELS += $(PKG)-demo.el
ELCS = $(ELS:.el=.elc)

DEPS = dash
DEPS += hydra # for lv.el

EMACS ?= emacs
EMACS_ARGS ?=

LOAD_PATH ?= $(addprefix -L ../../,$(DEPS))
LOAD_PATH += -L .

ifndef ORG_LOAD_PATH
ORG_LOAD_PATH = -L ../../dash
ORG_LOAD_PATH += -L ../../org/lisp
ORG_LOAD_PATH += -L ../../org/contrib/lisp
ORG_LOAD_PATH += -L ../../ox-texinfo+
endif

INSTALL_INFO ?= $(shell command -v ginstall-info || printf install-info)
MAKEINFO ?= makeinfo
MANUAL_HTML_ARGS ?= --css-ref /assets/page.css
96 changes: 96 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
-include ../config.mk
include ../default.mk

docs: info html html-dir pdf

info: $(PKG).info dir
html: $(PKG).html
pdf: $(PKG).pdf

ORG_ARGS = --batch -Q $(ORG_LOAD_PATH) -l ox-extra -l ox-texinfo+.el
ORG_EVAL = --eval "(ox-extras-activate '(ignore-headlines))"
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

# This target first bumps version strings in the Org source. The
# necessary tools might be missing so other targets do not depend
# on this target and it has to be run explicitly when appropriate.
#
# AMEND=t make texi Update manual to be amended to HEAD.
# VERSION=N make texi Update manual for release.
#
.PHONY: texi
texi:
@$(EMACS) $(ORG_ARGS) $(PKG).org $(ORG_EVAL)
@printf "\n" >> $(PKG).texi
@rm -f $(PKG).texi~

%.info: %.texi
@printf "Generating $@\n"
@$(MAKEINFO) --no-split $< -o $@

dir: $(PKG).info
@printf "Generating $@\n"
@printf "%s" $^ | xargs -n 1 $(INSTALL_INFO) --dir=$@

HTML_FIXUP_CSS = '/<link rel="stylesheet" type="text\/css" href="\/assets\/page.css">/a\
<link class="s-css-s--style" rel="stylesheet" title="Default" href="/assets/themes/default.css">\
\n<link class="s-css-s--style" rel="stylesheet alternate" title="Default high contrast" href="/assets/themes/default-high-contrast.css">\
\n<link class="s-css-s--style" rel="stylesheet alternate" title="Solarized dark xterm" href="/assets/themes/solarized-dark-xterm.css">\
\n<link class="s-css-s--style" rel="stylesheet alternate" title="Black on white" href="/assets/themes/black-on-white.css">\
\n<script src="/assets/js/simple-css-switch.js"></script>'
HTML_FIXUP_ONLOAD = 's/<body lang="en">/<body lang="en" onload="simpleCssSwitch()">/'
HTML_FIXUP_MENU = '/<\/body>/i<div id="s-css-s--menu"><\/div>'

%.html: %.texi
@printf "Generating $@\n"
@$(MAKEINFO) --html --no-split $(MANUAL_HTML_ARGS) $<
@sed -i -e $(HTML_FIXUP_CSS) -e $(HTML_FIXUP_ONLOAD) -e $(HTML_FIXUP_MENU) $@

html-dir: $(PKG).texi
@printf "Generating $(PKG)/*.html\n"
@$(MAKEINFO) --html $(MANUAL_HTML_ARGS) $<
@for f in $$(find $(PKG) -name '*.html') ; do \
sed -i -e $(HTML_FIXUP_CSS) -e $(HTML_FIXUP_ONLOAD) -e $(HTML_FIXUP_MENU) $$f ; \
done

%.pdf: %.texi
@printf "Generating $@\n"
@texi2pdf --clean $< > /dev/null

DOMAIN ?= magit.vc
PUBLISH_PATH ?= /manual/
RELEASE_PATH ?= /manual/$(VERSION)/

S3_BUCKET ?= s3://$(DOMAIN)
PUBLISH_TARGET = $(S3_BUCKET)$(PUBLISH_PATH)
RELEASE_TARGET = $(S3_BUCKET)$(RELEASE_PATH)

CFRONT_DIST ?= E2LUHBKU1FBV02
CFRONT_PATHS = $(PKG).html $(PKG).pdf $(PKG)/*

comma := ,
empty :=
space := $(empty) $(empty)

publish: html html-dir pdf
@aws s3 cp $(PKG).html $(PUBLISH_TARGET)
@aws s3 cp $(PKG).pdf $(PUBLISH_TARGET)
@aws s3 sync $(PKG) $(PUBLISH_TARGET)$(PKG)/
@printf "Generating CDN invalidation\n"
@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \
"$(subst $(space),$(comma),$(addprefix $(PUBLISH_PATH),$(CFRONT_PATHS)))" > /dev/null

release: html html-dir pdf
@aws s3 cp $(PKG).html $(RELEASE_TARGET)
@aws s3 cp $(PKG).pdf $(RELEASE_TARGET)
@aws s3 sync $(PKG) $(RELEASE_TARGET)$(PKG)/
@printf "Generating CDN invalidation\n"
@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) --paths \
"$(subst $(space),$(comma),$(addprefix $(RELEASE_PATH),$(CFRONT_PATHS)))" > /dev/null

CLEAN = $(PKG).info dir $(PKG) $(PKG).html $(PKG).pdf

clean:
@rm -rf $(CLEAN)
Loading

0 comments on commit 33f538a

Please sign in to comment.