All Projects → mrkkrp → ebal

mrkkrp / ebal

Licence: other
*DEPRECATED* Emacs interface to Cabal and Stack

Programming Languages

emacs lisp
2029 projects

Projects that are alternatives of or similar to ebal

Haskell Language Server
Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Stars: ✭ 1,857 (+6303.45%)
Mutual labels:  stack, cabal
KAI
KAI is a distributed computing model written in modern C++ and is cross-plaftorm. Using custom language translators and an executor, KAI provides full reflection, persistence and cross-process communications without having to modify existing source code. KAI Comes with an automated, generational tricolor garbage collector, and Console- and Windo…
Stars: ✭ 13 (-55.17%)
Mutual labels:  stack
C Macro Collections
Easy to use, header only, macro generated, generic and type-safe Data Structures in C
Stars: ✭ 192 (+562.07%)
Mutual labels:  stack
data-structure-project
自己实现集合框架系列整理总结
Stars: ✭ 29 (+0%)
Mutual labels:  stack
Call in stack
Call a function in a new stack that allocated anywhere. Do not be afraid of stack limit in your coroutines! Try to make your stack shareable between all coroutines!
Stars: ✭ 197 (+579.31%)
Mutual labels:  stack
Data-Structure-Algorithm-Programs
This Repo consists of Data structures and Algorithms
Stars: ✭ 464 (+1500%)
Mutual labels:  stack
Piladb
Lightweight RESTful database engine based on stack data structures
Stars: ✭ 184 (+534.48%)
Mutual labels:  stack
PYKE
Indev golfing language
Stars: ✭ 18 (-37.93%)
Mutual labels:  stack
interview-cookbook
A playground for learning DataStructures, Algorithms, and Object-Oriented Concepts.
Stars: ✭ 25 (-13.79%)
Mutual labels:  stack
sippet
C++ SIP stack based on Chromium source code
Stars: ✭ 23 (-20.69%)
Mutual labels:  stack
Golang Examples
Some examples for the programming language Go.
Stars: ✭ 14 (-51.72%)
Mutual labels:  stack
React Native Modalfy
🥞 Modal citizen of React Native.
Stars: ✭ 212 (+631.03%)
Mutual labels:  stack
deck
DECK is a powerful and high performant local web development studio unlike any other.
Stars: ✭ 1,414 (+4775.86%)
Mutual labels:  stack
Data Structures
A collection of powerful data structures
Stars: ✭ 2,534 (+8637.93%)
Mutual labels:  stack
the-stack
Website and datasets for The Stack, Daily Bruin's data journalism and newsroom tech blog.
Stars: ✭ 26 (-10.34%)
Mutual labels:  stack
Interview Questions
List of all the Interview questions practiced from online resources and books
Stars: ✭ 187 (+544.83%)
Mutual labels:  stack
nano-node-docker
Setup a fully automated NANO cryptocurrency node as part of an dockerized stack with fast-syncing and easy SSL support.
Stars: ✭ 77 (+165.52%)
Mutual labels:  stack
vabal
cabal in Valle
Stars: ✭ 43 (+48.28%)
Mutual labels:  cabal
SQLCallStackResolver
Utility to resolve SQL Server callstacks to their correct symbolic form using just PDBs and without a dump file
Stars: ✭ 55 (+89.66%)
Mutual labels:  stack
UnityGUI
UGUI Panel Systems for navigation, animation and more
Stars: ✭ 80 (+175.86%)
Mutual labels:  stack

Ebal

License GPL 3 MELPA Build Status

If you're using Stack, please prefer hasky-stack from now on. If you're using Cabal, please prefer hasky-cabal. Ebal has been deprecated in favor of these packages.

This is an Emacs interface to Cabal and Stack. Currently, it provides fast and easy access to most commands (†—commands available in Stack mode):

  • M-x ebal-init cabal init (useful even in Stack mode)
  • M-x ebal-execute—opens a popup menu with the following:
    • b build
    • c configure
    • d sdist
    • e bench
    • f freeze
    • g fetch
    • g haddock
    • i install
    • k check
    • l list
    • n sandbox init
    • o info
    • t test
    • u update
    • x sandbox delete
    • z clean

Note that stack init is called for you automatically in Stack mode when stack.yaml is missing.

Installation

If you would like to install the package manually, download or clone it and put on Emacs' load-path, then you can require it in your init file like this:

(require 'ebal)

It's available via MELPA, so you can just M-x package-install RET ebal RET.

Usage

If you want to use Ebal with Stack, add this to your configuration:

(setq ebal-operation-mode 'stack)

The package provides two commands:

  • ebal-init that acts as a wizard helping create new Cabal project;

  • ebal-execute—this allows to perform any command while visiting any file or directory in a project.

You can create key bindings for these commands to simplify interaction. I advise creating of simple key binding at least for ebal-execute, since you will call it often.

ebal-init

The wizard mirrors built-in Cabal command cabal init, but thanks to Emacs, it provides probably much better experience than the original command line tool. It's worth noticing that Ebal doesn't perform generation of .cabal file for you, it only gathers arguments for invocation of cabal init.

ebal-execute

The command displays a popup menu that contains name of project and its version. It also displays collection of commands, to invoke any of them, you only need to press a key:

Ebal Execute

Some commands, like build can gather additional info to help you to enter arguments. build shows a list of all build targets extracted from your .cabal file, while cabal info will display complete list of installed packages to choose from, etc.

The usage should be pretty straightforward, so let me tell you how to customize the package.

Customization

To customize Ebal, you can either set variables or use the customization interface, which may seem more friendly for some people.

To use the customization interface type M-x customize-group RET ebal RET.


ebal-operation-mode ⇒ cabal

Mode of operation for Ebal package.

The following values are recognized:

  • cabal—Ebal works as an interface for Cabal
  • stack—Ebal works as an interface for Stack

All other values of this variable produce the same effect as cabal.


ebal-cabal-executable ⇒ nil

Path to Cabal executable.

If it's not nil, this value is used in invocation of Cabal commands instead of the standard "cabal" string. Set this variable if your Cabal is in a strange place where OS cannot find it.

Note that the path is quoted with shell-quote-argument before being used to compose command line.


ebal-stack-executable ⇒ nil

Similar to ebal-cabal-executable, but for Stack.


ebal-global-option-alist ⇒ nil

Alist that maps names of commands to their default options.

Names of commands are symbols and options are lists of strings.

Note that this is a global collection of options. If you want to specify an option to be used only with a specific command and in a specific project, see ebal-project-option-alist and corresponding setup instructions.


ebal-project-option-alist ⇒ nil

Alist that maps names of commands to their default options.

Names of commands are symbols and options are lists of strings.

This variable represents user's preferences for current project. Value of the variable is read from "*.ebal" file that may be present in project's root directory (the same directory that contains "*.cabal" file).

Don't set this variable manually, instead create "project-name.ebal" file and put desired value (a Lisp Object) into it unquoted.


ebal-sandboxing ⇒ ask

This determines Ebal's policy towards sandboxing.

The following values are recognized (Cabal mode only):

  • nil—don't create sandboxes unless user explicitly runs command to create one.

  • ask—ask if user wants to create a sandbox (so it's harder to forget to create it), this is often preferable because most Haskell developers want sandboxes everywhere nowadays (default).

  • always—create sandboxes silently when they are missing and they should be created. With this option every your project is sandboxed without any effort on your side.

All other values of this variable produce the same effect as always.


ebal-completing-read-function ⇒ ebal-built-in-completing-read

Function to be called when requesting input from the user.


ebal-select-command-function ⇒ ebal-command-popup

Function to call to select Ebal command.

This is what ebal-execute uses. Default is Ebal custom popup buffer, but you can use IDO-powered variant if you like or plain ebal-command-completing-read.

The function is called with arguments like those that completing-read takes.


ebal-popup-key-alist ⇒ nil

Alist that maps names of commands to keys used in Ebal popup.

This is used by ebal-command-popup.


ebal-before-init-hook ⇒ nil

Hook to run before execution of ebal-init function.


ebal-after-init-hook ⇒ nil

Hook to run after execution of ebal-init function.


ebal-before-command-hook ⇒ nil

Hook to run before execution of particular command.

Name of the command is available in ebal--actual-command.


ebal-after-command-hook ⇒ nil

Hook to run after execution of particular command.

Name of the command is available in ebal--actual-command.

Defining your own commands

This is somewhat advanced topic, but it's possible to define your own commands. Use ebal--define-command to define new commands, see its associated documentation in Emacs. Here is an example of calling yesod devel with stack:

(require 'ebal)

(ebal--define-command yesod-devel ?y stack
  (ebal--ensure-stack-init ebal--last-directory)
  (ebal--perform-command "exec" "--" "yesod" "devel"))

This is admittedly basic example, but it should be of some use. See how other commands are defined in source code for inspiration.

License

Copyright © 2015–2018 Mark Karpov

Distributed under GNU GPL, version 3.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].