Skip to content

Commit

Permalink
context-transient on MELPA now
Browse files Browse the repository at this point in the history
  • Loading branch information
licht1stein committed May 7, 2024
1 parent 4623a39 commit efd8343
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/melpazoid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ jobs:
# RECIPE is your recipe as written for MELPA:
RECIPE: (context-transient :repo "licht1stein/context-transient.el" :fetcher github)
# set this to false (or remove it) if the package isn't on MELPA:
EXIST_OK: false
EXIST_OK: true
run: echo $GITHUB_REF && make -C ~/melpazoid
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# context-transient.el
Easily create context-specific transient menus for Emacs. Context can be anything — buffer name, current git repo, current project etc. See examples.

[![MELPA](https://melpa.org/packages/context-transient-badge.svg)](https://melpa.org/#/context-transient)


## Example
This is a menu I get when pressing F6 while working on one of my projects:

Expand All @@ -12,12 +15,12 @@ What the commands do is not important, what's important is how easy it was to ma
Once you have defined your context-specific transients, call them with `M-x context-transient RET`.

## Installing
Using use-package and elpaca:
You can install it from MELPA using `M-x package-install RET context-transient RET`, or using use-package:

```elisp
(use-package context-transient
:elpaca (:type git :host github :repo "licht1stein/context-transient.el")
:defer nil
:bind ("<f6>" . context-transient))
:defer nil
:bind ("<f6>" . context-transient))
```
I recommend binding `context-transient` to something easily accessible, F6 in the example above.

Expand Down Expand Up @@ -84,15 +87,15 @@ You can run any lisp expression in `:context`. For example, transient only works
:menu
[["Thursday!"
("t" "Once a week" (lambda () (interactive) (message "IT IS THURSDAY!")))]])
```
```

### Clojure Specific Example
Normally with transient you would need to be a bit more verbose to use it to run interactive CIDER commands while working on a Clojure project:
```elisp
(context-transient-define my-clj-transient
:doc "Transient for my-clj-repo"
:repo "my-clj-repo"
:menu
:menu
[["REPL"
("c" "Connect REPL" (lambda () (interactive) (cider-connect-clj '(:host "localhost" :port 63000))) :transient nil)
("d" "Sync deps" (lambda () (interactive) (cider-interactive-eval "(sync-deps)")))]
Expand Down Expand Up @@ -142,7 +145,7 @@ Here's the rewritten menu from above:
("A" "Stop main system" my-stop-sync)]])
```

Note, that the second argument to `defclj` is unquoted Clojure code, not elisp.
Note, that the second argument to `defclj` is unquoted Clojure code, not elisp.

## Clearing context-transients
If for some reason a previously defined transient misbehaves, you can clear all context transients by running `M-x context-transient-clear RET`
Expand Down

0 comments on commit efd8343

Please sign in to comment.