Skip to content

SidharthArya/emacsit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EMACSIT

Emacsit is a toy package manager for emacs. It’s somewhat inspired from vim-plug.

Changes

Some changes have been made to this packages.

  • emacsit::get now uses start-process-shell-command instead of async-shell-command
  • emacsit::byte-compile-all has been changed to emacsit::compile-all, since it uses Makefile if it finds one.
  • A news extension has been added emacsit-repositories. It can manage dependencies.

Introduction

The motivation behind emacsit is to let people easily get any package, from any source. Emacsit allows you to easily clone the required packages from any git repository and immediately put it in your emacs load file. It works on very basic functions, and it doesn’t cause any freezes while it manages your packages. Some people do not care about putting there packages up on MELPA or ELPA, yet their packages are pretty good. Emacsit has been create for using such packages.

The code for this project is extremely simple. Every package added to the list of packages is converted into a string of the form: “https://github.com/SidharthArya/emacsit@/home/user/.emacs.d/packages/SidharthArya/emacsit” So string before @ conveys the repository to be cloned and string after @ is the directory where the package is to be installed. So emacsit-savedir variable is used to specify the directory where all the packages are installed. It is absolutely required that the dependencies be installed before actual package. This process is manual and may require a few tries, since many packages do not mention clearly which packages they depend on.

Feel free to open issues and pull requests if you can offer any improvement or suggestion for this packages.

Alternatives

  • Emacs built-in packages.el with MELPA or Cask.
  • el-get - Look’s Amazing to me. If you have packages from various types of locations: github, emacswiki, GNU ELPA or Marmalade, privately hosted pages, git, bzr, CVS, el-get is one of the goto choices.
  • straight.el - It has a lot of features.
  • quelpa - Build and install your Emacs Lisp packages on-the-fly and directly from source.
  • feather.el - This one seems to be similar to emacsit but better. Haven’t tried though.

You may want to use one of the above, since they are much better supported.

Basic Usage

All you have to do for configuration is to load the emacsit directory to your load path or load emacsit.el directly, and add a variable emacsit::packages which is the list of packages you want to install.

git clone --depth=1 https://github.com/SidharthArya/emacsit $HOME/.emacs.d/packages/SidharthArya/emacsit

Add this to your .emacs file.

(add-to-list 'load-path "~/.emacs.d/packages/SidharthArya/emacsit")
(require 'emacsit)
(setq emacsit::packages '( ;; List of packages you need
			  abo-abo/avy
			  creichert/ido-vertical-mode.el
			  jwiegley/use-package
			  sidhartharya10/emacsit
			  magnars/expand-region.el	
			  emacs-evil/evil
			  https://code.orgmode.org/bzg/org-mode
))
(setq emacsit::savedir "~/.emacs.d/packages")

(emacsit::load)

Following keybindings can be used.

(define-prefix-command 'emacsit)
(define-key global-map (kbd "C-x p")  'emacsit)
(define-key global-map (kbd "C-x p g")  'emacsit::get)
(define-key global-map (kbd "C-x p l")  'emacsit::load)
(define-key global-map (kbd "C-x p b")  'emacsit::compile-all)
(define-key global-map (kbd "C-x p u")  'emacsit::update-all)
  • Use C-x p g to downlaod packages.
  • Use C-x p l to load packages.
  • Use C-x p b to byte compile packages.
  • Use C-x p b to byte update packages.

The two functions emacsit::get and emacsit::load fetch the required packages and append then to your load path respectively. These functions are also interactively callable, so, if you don’t want to fetch the packages every time you start emacs, remove emacsit::get from your configuration.

There is no view for listing the running Emacsit processes. Emacs’s list-processes can be used for listing the current running processes. Each process creates it’s own buffer. Use emacsit::logclear to remove all the created buffers which the packages have been installed successfully.

Extension

emacsit-repositories.el is an extension based on top of emacsit.el. It can manage dependencies out of the box. It requires a file which lists the dependencies of the packages before processing it. An example of this file is present as emacsit-repositories. Basic format is:

#PACKAGE-ALIAS@PACKAGE-SRC#DEPENDENCIES
magit@magit/magit#dash transient with-editor
magit@https://github.com/magit/magit#dash transient with-editor

Basic Usage

 (require 'emacsit-repositories)
 (setq emacsit-repositories::packages '(
					    magit
					    )
	   (emacsit-repository::build-list)
	   (emacsit::get)
	   (emacsit::load)

emacsit-repositories uses emacsit-repository::packages in order to build emacsit::packages A custom file can be used by changing the variable as:

(setq emacsit-repository::repository-file "~/.emacs.d/emacsit-repositories")

emacsit-repositories.el can be used with use-package, it’s not as sane as it should be but it works. To use it, add this your config.

(setq use-package-ensure-function 'emacsit-use-package-ensure)			       

How I use it

(add-to-list 'load-path "/home/arya/.emacs.d/packages/SidharthArya/emacsit")
(require 'emacsit)
(setq emacsit::savedir "/home/arya/.emacs.d/packages")
(setq emacsit::packages '(
				     jwiegley/use-package
				     ))

(emacsit::load)
(require 'use-package)
(require 'emacsit-repositories)
(setq use-package-ensure-function 'emacsit-use-package-ensure)			       
(use-package flycheck
:defer t
:ensure t
:ensure auto-complete/popup-el
:ensure flycheck/flycheck-popup-tip
:init
(require 'flycheck-popup-tip)
	:hook ((prog-mode . flycheck-mode)
	       (prog-mode . flycheck-popup-tip-mode))
)

Note: In emacsit-repository, you can directly add a repository name or github url to ensure function to add it to your load-path.

Set Back

Emacsit repository

  • Currently no way to find out which directories contain the .el files
  • Doesn’t handle the async fetch operations with use-package very well. use-package tries to load while it’s fetching, causing an initial error the first time it’s loaded.

To Do

  • [X] Compiling
  • [X] Updating
  • [X] Compile Cask Packages
  • [X] Dependency Management (through emacsit-repositories.el)
  • [ ] Description of various functions
  • [ ] Cleaning

About

A Toy Package Manager for Emacs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published