Skip to content

Emacs package manager, lighter with more features.

Notifications You must be signed in to change notification settings

SpringHan/gpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Gpack

Gpack(means Get Package) is an Emacs package manager, which is light with more features.

Syntax

Gpack’s main function is gpack (A macro). It has some keywords:

  • :repo - Get the remote git repository The arg of :repo can be a string, which is the git repository url.

    If it’s “UserName/RepositoryName”, the GitHub is the default remote.It can be other repositorys.

    The arg also can be a list.The first element is the url, others is the keywords with args.You can get them in the second example.

    gpack-repo-directory is the variable of the repo’s path.By default, it’s "~/.emacs.d/third-party/"

    Examples:

    (gpack test
      :repo "SpringHan/test")
        
    (gpack test
      :repo ("SpringHan/test" :save "Test" :load custom-theme-load-path :depth nil))
    ;;; `:save' is the local directory's name which will be clone at locale.
    ;;; `:load' is the load path.
    ;;; `:depth' is the depth for the clone, it can be number.If it's nil, the whole repository will be clone.
        
  • :hook - Add hooks Examples:
    (gpack test
      :hook (after-init-hook . test-mode))
        
    (gpack test
      :hook (after-init-hook . (test-mode test-2-mode)))
        
    (gpack test
      :hook ((emacs-lisp-mode-hook after-init-hook) . test-mode))
        
    (gpack test
      :hook ((after-init-hook . test-mode)
             (emacs-lisp-mode-hook . (test-mode test-2-mode))
             ((lisp-mode-hook python-mode-hook) . test-mode)))
        
  • :var - Set variables Examples:
    (gpack test
      :var (test . t))
        
    (gpack test
      :var ((test . t)
            (test-2 . t)))
        
  • :key - Define keybindings Examples:
    (gpack test
      :key ("s" . test))
        
    (gpack test
      :key (test-mode-map . ("s" . test)))
        
    (gpack test
      :key (test-mode-map (("s" . test)
                           ("x" . test-x))))
        
    (gpack test
      :key ((test-mode-map . (("s" . test)
                              ("x" . test-x)))
            ("b" . test-b)))
        
  • :load-path - Load the local directory Examples:
    (gpack test
      :load-path "~/.emacs.d/third-party/lightgit")
    ;;; It is same as:
    (add-to-list 'load-path "~/.emacs.d/third-party/lightgit")
    (require 'test)
        
    (gpack test
      :load-path ("~/.emacs.d/themes" . custom-theme-load-path)	;It is same as: (add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
      )
        
  • :before - Eval before loading package Example:
    (gpack test
      :before (message "Test"))
        
  • :config - The configuration which will be evaled after loading package Example:
    (gpack test
      :config (progn
                (test-init)
                (test-haha)))
        
  • :disable - Disable the package Example:
    (gpack test
      :disable)
        
  • :autoload - Autoload the package This keyword will be used if the package has the autoload feature.
    (gpack test
      :autoload)
        
  • :un-require - Don’t require the package This keyword is useful for theme.
    (gpack theme
      :load-path ("~/.emacs.d/themes" . custom-theme-load-path)
      :config (load-theme 'theme t)
      :un-require)
        
  • :delete - Delete the current package
    (gpack test
      :delete)
        

About

Emacs package manager, lighter with more features.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published