Skip to content

Commit

Permalink
Add lang/factor module (doomemacs#2129)
Browse files Browse the repository at this point in the history
Factor is a stack based programming language with an awesome emacs mode.

* remove extra layer of nesting for keybinds
* use-package!
* lazy load fuel
* fue listener typo
* remove extra space
* Add README
  • Loading branch information
rgrinberg authored and Henrik Lissner committed Dec 3, 2019
1 parent 7cec80e commit f5910ca
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
1 change: 1 addition & 0 deletions init.example.el
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun
;;lean
;;factor
;;ledger ; an accounting system in Emacs
;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
Expand Down
43 changes: 43 additions & 0 deletions modules/lang/factor/README.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#+TITLE: lang/factor
#+DATE: December 3, 2019
#+SINCE: v3.0.0
#+STARTUP: inlineimages

* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#hacks][Hacks]]
- [[#prerequisites][Prerequisites]]
- [[#configuration][Configuration]]
- [[#troubleshooting][Troubleshooting]]

* Description
This module adds support to the [[https://github.com/factor/factor][factor]] programming language and its associated
_fuel_ emacs plugin.

+ If possible, include a brief list of feature highlights here
+ Like code completion, syntax checking or available snippets
+ Include links to packages & external things where possible

** Module Flags
This module provides no flags.

** Plugins
{A list of linked plugins}

** Hacks
{A list of internal modifications to included packages}

* Prerequisites
You must install [[https://github.com/factor/factor][factor]] to use the advanced functionality of this module.

* Configuration
This module requires the installation of factor to be available at
=fuel-factor-root-dir=. Here's an example of how to set it:
#+BEGIN_SRC emacs-lisp
(setq fuel-factor-root-dir "/Applications/factor")
#+END_SRC

* Troubleshooting
Common issues and their solution, or places to look for help.
47 changes: 47 additions & 0 deletions modules/lang/factor/config.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
;;; lang/factor/config.el -*- lexical-binding: t; -*-

(use-package! fuel-mode
:defer t
:init
(set-eval-handler! 'factor-mode #'fuel-eval-region)
(set-repl-handler! 'factor-mode #'run-factor)
:config
(set-lookup-handlers! 'factor-mode
:definition #'fuel-edit-word-at-point
:references #'fuel-show-callers
:documentation #'fuel-help))

(map! :after factor-mode
:map factor-mode-map
:localleader
"t" #'fuel-test-vocab
(:prefix ("e" . "eval")
"d" #'fuel-eval-definition
"R" #'fuel-eval-extended-region
"r" #'fuel-eval-region)
(:prefix ("h" . "help")
"p" #'fuel-apropos
"v" #'fuel-show-file-words
"c" #'fuel-show-callees
"e" #'fuel-stack-effect-region)
(:prefix ("s" . "scaffold")
"v" #'fuel-scaffold-vocab
"h" #'fuel-scaffold-help
"t" #'fuel-scaffold-tests)
(:prefix ("r" . "refactor")
"s" #'fuel-refactor-extract-sexp
"w" #'fuel-refactor-extract-region
"v" #'fuel-refactor-extract-vocab
"i" #'fuel-refactor-inline-word
"g" #'fuel-refactor-make-generic
"u" #'fuel-update-usings
"r" #'fuel-refactor-rename-word))

(map! :after fuel-listener
:map fuel-listener-mode-map
:localleader
"e" #'fuel-edit-vocabulary
"r" #'fuel-refresh-all
"i" #'fuel-stack-mode
"h" #'fuel-help
"s" #'fuel-scaffold-vocab)
4 changes: 4 additions & 0 deletions modules/lang/factor/packages.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
;; -*- no-byte-compile: t; -*-
;;; lang/factor/packages.el

(package! fuel)

0 comments on commit f5910ca

Please sign in to comment.