Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-08-24 19:39:44 +02:00
parent 40bcda7365
commit e3e993e26c
72 changed files with 35566 additions and 0 deletions

View File

@ -0,0 +1 @@
737661

View File

@ -0,0 +1,2 @@
/mnt/c/Users/marcin.wozniak/repos/backend/restservice/src/main/java/com/plannaplan/controllers/controllers.md
/mnt/c/Users/marcin.wozniak/repos/backend/restservice/src/main/java/com/plannaplan/controllers/#controllers.md#

View File

@ -0,0 +1,447 @@
(1
(load-relative .
[(0 1)
nil "relative file load (within a multi-file Emacs package)" single])
(test-unit .
[(0 1)
nil "Unit Test Framework for Emacs Lisp " single])
(zenburn .
[(1 8)
nil "just some alien fruit salad to keep you in the zone" single])
(multi-project .
[(0 0 1)
nil "Work with multiple projects" single])
(hungry-delete .
[(1 0)
nil "hungry delete minor mode" single])
(Save-visited-files .
[(1 2)
nil "save opened files across sessions" single])
(c-eldoc .
[(0 6)
nil "helpful description of the arguments to C functions" single])
(mv-shell .
[(1 0)
nil "keep buffers in sync with filename throughout 'mv'commands in shell-mode." single])
(diff-git .
[(0 1 1)
nil "Git integration with diff-mode" single])
(html-script-src .
[(0 0 2)
nil "Insert <script src=\"..\"> for popular JavaScript libraries" single])
(rvm .
[(1 1)
nil "Emacs integration for rvm" single])
(elisp-depend .
[(0 4 1)
nil "Parse depend libraries of elisp file." single])
(perspective .
[(1 3)
nil "switch between named \"perspectives\" of the editor" single])
(ruby-electric .
[(1 1)
nil "electric editing commands for ruby files" single])
(yari .
[(0 3)
nil "Yet Another RI interface for Emacs" single])
(smex .
[(1 1 1)
nil "M-x interface with Ido-style fuzzy matching." single])
(drag-stuff .
[(0 0 3)
nil "Drag stuff (lines, words, region, etc...) around" single])
(ruby-test-mode .
[(1 0)
nil "Minor mode for Behaviour and Test Driven" single])
(applescript-mode .
[(20090321)
nil "major mode for editing AppleScript source" single])
(mediawiki .
[(1 1)
nil "mediawiki frontend" single])
(wrap-region .
[(0 1 3)
nil "Wrap text with punctation or tag" single])
(twitter .
[(20090422)
nil "Simple Emacs-based client for Twitter" single])
(pastie .
[(20091230)
nil "Emacs integration for pastie.org" single])
(textmate .
[(1)
nil "TextMate minor mode for Emacs" single])
(yaml-mode .
[(0 0 5)
nil "Major mode for editing YAML files" single])
(rspec-mode .
[(0 2)
((ruby-mode
(1 1)))
"Enhance ruby-mode for RSpec" single])
(htmlize .
[(1 37)
nil "Convert buffer text and decorations to HTML." single])
(swank-clojure .
[(1 1 0)
((slime-repl
(20091016))
(clojure-mode
(1 6)))
"slime adapter for clojure" single])
(slime-repl .
[(20100404)
((slime
(20100404)))
"Read-Eval-Print Loop written in Emacs Lisp" single])
(slime .
[(20100404)
nil "Superior Lisp Interaction Mode for Emacs" single])
(nterm .
[(0 1)
nil "New TERMinal emulator" single])
(sass-mode .
[(3 0 14)
((haml-mode
(3 0 14)))
"Major mode for editing Sass files" single])
(haml-mode .
[(3 0 14)
nil "Major mode for editing Haml files" single])
(smart-tab .
[(0 3)
nil "Intelligent tab completion and indentation." single])
(cssh .
[(0 7)
nil "clusterssh implementation for emacs" single])
(relax .
[(0 2)
((json
(1 2))
(javascript
(1 99 8)))
"For browsing and interacting with CouchDB" single])
(shellfm .
[(0 1)
nil "Emacs Shell.FM interface" single])
(texdrive .
[(0 3 1)
nil "minor mode for creating png images from TeX formulae " single])
(paredit .
[(20)
nil "Parenthesis-Editing Minor Mode" single])
(rotate-text .
[(0 1)
nil "cycle through words, symbols and patterns" single])
(full-ack .
[(0 2 1)
nil "a front-end for ack" single])
(recent-addresses .
[(0 1)
nil "store and recall recently used email addresses" single])
(test-case-mode .
[(0 1)
((fringe-helper
(0 1 1)))
"unit test front-end" single])
(nav .
[(35)
nil "Emacs mode for IDE-like navigation of directories" single])
(company .
[(0 5)
nil "extensible inline text completion mechanism" tar])
(guess-style .
[(0 1)
nil "automatic setting of code style variables" single])
(clojure-test-mode .
[(1 4)
((slime
(20091016))
(clojure-mode
(1 7)))
"Minor mode for Clojure tests" single])
(clojure-mode .
[(1 7 1)
nil "Major mode for Clojure code" single])
(magit .
[(0 8 1)
nil "control Git from Emacs." single])
(w3 .
[(4 0 46)
nil "A web browser written entirely in Emacs Lisp" tar])
(yasnippet-bundle .
[(0 6 1)
nil "Yet another snippet extension (Auto compiled bundle)" single])
(rinari .
[(2 1)
((ruby-mode
(1 1))
(inf-ruby
(2 1))
(ruby-compilation
(0 7))
(jump
(2 0)))
"Rinari Is Not A Rails IDE" single])
(jump .
[(2 0)
((findr
(0 7))
(inflections
(1 0)))
"build functions which contextually jump between files" single])
(inflections .
[(1 0)
nil "convert english words between singular and plural" single])
(tumble .
[(1 1)
((http-post-simple
(1 0)))
"an Emacs mode for Tumblr" single])
(http-post-simple .
[(1 0)
nil "HTTP POST requests using the url library" single])
(findr .
[(0 7)
nil "Breadth-first file-finding facility for (X)Emacs" single])
(ruby-compilation .
[(0 7)
((ruby-mode
(1 1))
(inf-ruby
(2 1)))
"run a ruby process in a compilation buffer" single])
(gist .
[(0 5)
nil "Emacs integration for gist.github.com" single])
(confluence .
[(1 4)
((xml-rpc
(1 6 4)))
"Emacs mode for interacting with confluence wikis" single])
(epresent .
[(0 1)
nil "Simple presentation mode for Emacs" single])
(inf-ruby .
[(2 1)
((ruby-mode
(1 1)))
"Run a ruby process in a buffer" single])
(ruby-mode .
[(1 1)
nil "Major mode for editing Ruby files" single])
(idle-highlight .
[(1 0)
nil "highlight the word the point is on" single])
(find-file-in-project .
[(2 0)
((project-local-variables
(0 2)))
"Find files in a project quickly." single])
(project-local-variables .
[(0 2)
nil "set project-local variables from a file" single])
(lusty-explorer .
[(2 4)
nil "Dynamic filesystem explorer and buffer switcher" single])
(tempo-snippets .
[(0 1 5)
nil "visual insertion of tempo templates" single])
(highlight-80+ .
[(1 0)
nil "highlight characters beyond column 80" single])
(echo-pick .
[(0 1)
nil "filter for echo area status messages" single])
(fringe-helper .
[(0 1 1)
nil "helper functions for fringe bitmaps" single])
(elk-test .
[(0 3 2)
((fringe-helper
(0 1 1)))
"Emacs Lisp testing framework" single])
(compile-bookmarks .
[(0 2)
nil "bookmarks for compilation commands" single])
(pov-mode .
[(3 2)
nil "Major mode for editing POV-Ray scene files." tar])
(js2-mode .
[(20090723)
nil "an improved JavaScript editing mode" single])
(ert .
[(0 1)
nil "Emacs Lisp Regression Testing" single])
(jtags .
[(0 96)
nil "enhanced tags functionality for Java development" single])
(eproject .
[(0 4)
nil "project workspaces for emacs" tar])
(log4j-mode .
[(1 3)
nil "major mode for viewing log files" single])
(nxml-mode .
[(20041004)
nil "Major mode for editing XML documents." tar])
(columnify .
[(1 0)
nil "arrange lines into columns" single])
(gdb-mi .
[(0 6 1 0)
nil "User Interface for running GDB" single])
(asciidoc .
[(0 1)
nil "asciidoc text file development support" single])
(shell-current-directory .
[(0 1)
nil "create new shell based on buffer directory" single])
(facebook .
[(0 0 1)
((json
(0)))
"Access the Facebook API from emacs" single])
(json .
[(1 2)
nil "JavaScript Object Notation parser / generator" single])
(pick-backup .
[(0 8)
nil "easy access to versioned backup files" single])
(idle-require .
[(1 0)
nil "load elisp libraries while Emacs is idle" single])
(highlight-symbol .
[(1 1)
nil "automatic and manual symbol highlighting" single])
(auto-dictionary .
[(1 0 1)
nil "automatic dictionary switcher for flyspell" single])
(dictionary .
[(1 8 7)
nil "an interface to an RFC 2229 dictionary server" tar])
(muse .
[(3 20)
nil "Authoring and publishing tool" tar])
(jimb-patch .
[(1 5)
nil "clean a patch for submission via email" single])
(lisppaste .
[(1 8)
((xml-rpc
(1 6 7)))
"Interact with the lisppaste pastebot via XML-RPC." single])
(weblogger .
[(1 4 3)
((xml-rpc
(1 6 5)))
"Weblog maintenance via XML-RPC APIs" single])
(xml-rpc .
[(1 6 7)
nil "An elisp implementation of clientside XML-RPC" single])
(iresize .
[(0 2)
nil "Interactively resize a window" single])
(sgftree .
[(0 1)
nil "Read an sgf file and represent it as a tree" single])
(chess .
[(1 96)
nil "Play chess in Emacs" tar])
(etags-select .
[(1 11)
nil "Select from multiple tags" single])
(less .
[(0 2)
nil "less style view mode" single])
(smart-operator .
[(0 9)
nil "Insert operators packed with whitespaces smartly" single])
(dired-isearch .
[(0 3)
nil "isearch in Dired" single])
(cal-china-x .
[(0 6)
nil "Chinese calendar extras" single])
(wajig .
[(0 53)
nil "an interface for wajig" single])
(erc .
[(5 3)
nil "An Emacs Internet Relay Chat client" tar])
(emms .
[(3 0)
nil "The Emacs Multimedia System" tar])
(archive-downloader .
[(1 1)
nil "Download files from archive.org" single])
(package .
[(0 9)
nil "Simple package system for Emacs" single])
(highlight-parentheses .
[(1 0 1)
nil "highlight surrounding parentheses" single])
(kill-ring-search .
[(1 1)
nil "incremental search for the kill ring" single])
(tex-math-preview .
[(8)
nil "preview TeX math expressions." single])
(gtk-look .
[(19)
nil "lookup Gtk and Gnome documentation." single])
(xtide .
[(16)
nil "XTide display in Emacs" single])
(compilation-recenter-end .
[(4)
nil "compilation-mode window recentre" single])
(gdb-shell .
[(0 4)
nil "minor mode to add gdb features to shell" single])
(highline .
[(4 2)
nil "minor mode to highlight current line in buffer" single])
(lua-mode .
[(20100617)
nil "a major-mode for editing Lua scripts" single])
(css-mode .
[(1 0)
nil "Major mode for editing Cascading Style Sheets" single])
(javascript .
[(2 2 1)
nil "Major mode for editing JavaScript source text" single])
(light-symbol .
[(0 1)
nil "Minor mode to highlight symbol under point" single])
(worklog .
[(2 4 2)
nil "time tracking mode" single])
(abacus .
[(1 0 2)
nil "Abacus Calculator" single])
(sudoku .
[(0 3)
nil "Simple sudoku game, can download puzzles from the web." single])
(caps-mode .
[(1 0)
nil "(minor mode) letters are inserted capitalized" single])
(lambdacalc .
[(1 0)
nil "Interpret lambda calculus expressions" single])
(wtf .
[(2 0)
nil "Look up conversational and computing acronyms" single])
(blank-mode .
[(6 6)
nil "Minor mode to visualize blanks" single])
(bubbles .
[(0 5)
nil "Puzzle game for Emacs." single])
(newsticker .
[(1 10)
nil "Headline news ticker" tar])
(changelog-url .
[(0 1)
nil "ChangeLog bugzilla buttonizer" tar]))

View File

@ -0,0 +1,2 @@
(1 (org . [(20200824) ( ) "Outline-based notes management and organizer" tar])
(org-plus-contrib . [(20200824) ( ) "Outline-based notes management and organizer" tar]))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2020-08-24T11:05:02+0200 using RSA

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
;;; auto-package-update-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "auto-package-update" "auto-package-update.el"
;;;;;; (0 0 0 0))
;;; Generated autoloads from auto-package-update.el
(autoload 'auto-package-update-now "auto-package-update" "\
Update installed Emacs packages.
\(fn)" t nil)
(autoload 'auto-package-update-at-time "auto-package-update" "\
Try to update every day at the specified TIME.
\(fn TIME)" nil nil)
(autoload 'auto-package-update-maybe "auto-package-update" "\
Update installed Emacs packages if at least `auto-package-update-interval' days have passed since the last update.
\(fn)" nil nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "auto-package-update" '("auto-package-update-" "apu--")))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; auto-package-update-autoloads.el ends here

View File

@ -0,0 +1,2 @@
;;; -*- no-byte-compile: t -*-
(define-package "auto-package-update" "20200421.309" "Automatically update Emacs packages." '((emacs "24.4") (dash "2.1.0")) :commit "cf7f7486ed699f2ed7cc8af950740aece0de6124" :keywords '("package" "update") :authors '(("Renan Ranelli")) :maintainer '("Renan Ranelli") :url "http://github.com/rranelli/auto-package-update.el")

View File

@ -0,0 +1,360 @@
;;; auto-package-update.el --- Automatically update Emacs packages.
;; Copyright (C) 2014 Renan Ranelli <renanranelli at google mail>
;; Author: Renan Ranelli
;; URL: http://github.com/rranelli/auto-package-update.el
;; Package-Version: 20200421.309
;; Package-Commit: cf7f7486ed699f2ed7cc8af950740aece0de6124
;; Version: 1.7
;; Keywords: package, update
;; Package-Requires: ((emacs "24.4") (dash "2.1.0"))
;; This file is NOT part of GNU Emacs.
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; See <http://www.gnu.org/licenses/> for a copy of the GNU General
;; Public License.
;;; Commentary:
;;
;; This package provides functionality for automatically updating your Emacs
;; packages periodically. It is specially useful for people that work in
;; multiple machines and tend to forget to manually update packages from time to
;; time.
;; The main idea is that you set a desired periodicity for the updates, and when
;; you start Emacs, the packages will be automatically updated if enough days
;; have passed since the last update.
;;; Requirements:
;;
;; This package was tested for GNU Emacs 24.4 and above. Older Emacsen are not
;; supported yet.
;;; Installation:
;;
;; You can install via `MELPA`, or manually by downloading `auto-package-update.el` and
;; adding the following to your init file:
;;
;; ```elisp
;; (add-to-list 'load-path "/path/to/auto-package-update")
;; (require 'auto-package-update)
;; ```
;;; Usage:
;;
;; If `auto-package-update.el` is installed properly, you can add the following
;; line to your `.emacs`.
;;
;; ```elisp
;; (auto-package-update-maybe)
;; ```
;;
;; This will update your installed packages at startup if there is an update
;; pending.
;;
;; You can register a check every day at a given time using `auto-package-update-at-time':
;;
;; ```elisp
;; (auto-package-update-at-time "03:00")
;; ```
;;
;; will check for pending updates every three o'clock a.m..
;;
;; You can also use the function `auto-package-update-now' to update your
;; packages immediatelly at any given time.
;;; Customization:
;;
;; The periodicity (in days) of the update is given by the custom
;; variable `auto-package-update-interval`. The default interval is 7
;; days but if you want to change it, all you need is:
;;
;; ```elisp
;; (setq auto-package-update-interval 14)
;; ```
;;
;; Sometimes it is useful to skip an automatic update, e.g. when you're in a hurry
;; or don't have a working internet connection.
;; Use this setting to show a manual prompt before automatic updates:
;;
;; ```elisp
;; (setq auto-package-update-prompt-before-update t)
;; ```
;;
;; To delete residual old version directory when updating, set to
;; true variable `auto-package-update-delete-old-versions`. The
;; default value is `nil`. If you want to enable deleting:
;;
;; ```elisp
;; (setq auto-package-update-delete-old-versions t)
;; ```
;;
;;; Hooks
;;
;; If you want to add functions to run *before* and *after* the package update, you can
;; use the `auto-package-update-before-hook' and `auto-package-update-after-hook' hooks.
;; For example:
;;
;; ```elisp
;; (add-hook 'auto-package-update-before-hook
;; (lambda () (message "I will update packages now")))
;; ```
;;; Changelog:
;; 1.7 - Add option to prompt user before running auto-package-update-maybe <br/>
;; 1.6.1 - Replace deprecated `toggle-read-only' with `read-only-mode' to remove byte compile warnings. Thanx to @syohex. <br/>
;; 1.6 - Add option to remove old packages from `.emacs.d/elpa' when updating. Thanks to @JesusMtnez. <br/>
;; 1.5 - Allow user to check for updates every day at specified time. <br/>
;; 1.4 - Add before and after update hooks. <br/>
;; 1.3 - Do not break if a package is not available in the repositories.
;; Show update results in a temporary buffer instead of the echo area<br/>
;; 1.2 - Refactor for independence on package-menu functions. <br/>
;; 1.1 - Support GNU Emacs 24.3. <br/>
;; 1.0 - First release. <br/>
;;; Code:
(require 'dash)
(require 'package)
(unless package--initialized
(package-initialize))
;;
;;; Customization
;;
(defgroup auto-package-update nil
"Automatically update Emacs packages."
:group 'package)
(defcustom auto-package-update-interval
7
"Interval in DAYS for automatic package update."
:group 'auto-package-update
:type 'integer)
(defcustom auto-package-update-before-hook '()
"List of functions to be called before running an automatic package update."
:type 'hook
:group 'auto-package-update)
(defcustom auto-package-update-after-hook '()
"List of functions to be called after running an automatic package update."
:type 'hook
:group 'auto-package-update)
(defcustom auto-package-update-last-update-day-filename
".last-package-update-day"
"Name of the file in which the last update day is going to be stored."
:type 'string
:group 'auto-package-update)
(defcustom auto-package-update-buffer-name
"*package update results*"
"Name of the buffer that shows updated packages and error after execution."
:type 'string
:group 'auto-package-update)
(defcustom auto-package-update-delete-old-versions
nil
"If not nil, delete old versions directories."
:type 'boolean
:group 'auto-package-update)
(defcustom auto-package-update-prompt-before-update
nil
"Prompt user (y/n) before running auto-package-update-maybe"
:type 'boolean
:group 'auto-package-update)
(defcustom auto-package-update-hide-results
nil
"If not nil, the result of auto package update in buffer
`auto-package-update-buffer-name' will not be shown."
:type 'boolean
:group 'auto-package-update)
(defvar auto-package-update-last-update-day-path
(expand-file-name auto-package-update-last-update-day-filename user-emacs-directory)
"Path to the file that will hold the day in which the last update was run.")
(defvar apu--old-versions-dirs-list
()
"List with old versions directories to delete.")
;;
;;; File read/write helpers
;;
(defun apu--read-file-as-string (file)
"Read FILE contents."
(when (file-exists-p file)
(with-temp-buffer
(insert-file-contents file)
(buffer-string))))
(defun apu--write-string-to-file (file string)
"Substitute FILE contents with STRING."
(with-temp-buffer
(insert string)
(when (file-writable-p file)
(write-region (point-min)
(point-max)
file))))
;;
;;; Update day read/write functions
;;
(defun apu--today-day ()
(time-to-days (current-time)))
(defun apu--write-current-day ()
"Store current day."
(apu--write-string-to-file
auto-package-update-last-update-day-path
(int-to-string (apu--today-day))))
(defun apu--read-last-update-day ()
"Read last update day."
(string-to-number
(apu--read-file-as-string auto-package-update-last-update-day-path)))
;;
;;; Package update
;;
(defun apu--should-update-packages-p ()
"Return non-nil when an update is due."
(and
(or
(not (file-exists-p auto-package-update-last-update-day-path))
(let* ((last-update-day (apu--read-last-update-day))
(days-since (- (apu--today-day) last-update-day)))
(>=
(/ days-since auto-package-update-interval)
1)))
(apu--get-permission-to-update-p)))
(defun apu--get-permission-to-update-p ()
"(Optionally) Prompt permission to perform update"
(if auto-package-update-prompt-before-update
(y-or-n-p "Auto-update packages now?")
t))
(defun apu--package-up-to-date-p (package)
(when (and (package-installed-p package)
(cadr (assq package package-archive-contents)))
(let* ((newest-desc (cadr (assq package package-archive-contents)))
(installed-desc (cadr (or (assq package package-alist)
(assq package package--builtins))))
(newest-version (package-desc-version newest-desc))
(installed-version (package-desc-version installed-desc)))
(version-list-<= newest-version installed-version))))
(defun apu--package-out-of-date-p (package)
(not (apu--package-up-to-date-p package)))
(defun apu--packages-to-install ()
(delete-dups (-filter 'apu--package-out-of-date-p package-activated-list)))
(defun apu--add-to-old-versions-dirs-list (package)
"Add package old version dir to apu--old-versions-dirs-list"
(let ((desc (cadr (assq package package-alist))))
(add-to-list 'apu--old-versions-dirs-list (package-desc-dir desc))))
(defun apu--delete-old-versions-dirs-list ()
"Delete package old version dirs saved in variable apu--old-versions-dirs-list"
(dolist (old-version-dir-to-delete apu--old-versions-dirs-list)
(delete-directory old-version-dir-to-delete t))
;; Clear list
(setq apu--old-versions-dirs-list ()))
(defun apu--safe-package-install (package)
(condition-case ex
(progn
(when auto-package-update-delete-old-versions
(apu--add-to-old-versions-dirs-list package))
(package-install-from-archive (cadr (assoc package package-archive-contents)))
(add-to-list 'apu--package-installation-results
(format "%s up to date." (symbol-name package))))
('error (add-to-list 'apu--package-installation-results
(format "Error installing %s" (symbol-name package))))))
(defun apu--safe-install-packages (packages)
(let (apu--package-installation-results)
(dolist (package-to-update packages)
(apu--safe-package-install package-to-update))
(when auto-package-update-delete-old-versions
(apu--delete-old-versions-dirs-list))
apu--package-installation-results))
(defun apu--write-results-buffer (contents)
(let ((inhibit-read-only t))
(if (not auto-package-update-hide-results)
(pop-to-buffer auto-package-update-buffer-name)
(set-buffer
(get-buffer-create auto-package-update-buffer-name))
(bury-buffer
auto-package-update-buffer-name))
(erase-buffer)
(insert contents)
(read-only-mode 1)
(auto-package-update-minor-mode 1)))
(define-minor-mode auto-package-update-minor-mode
"Minor mode for displaying package update results."
:group 'auto-package-update
:keymap '(("q" . quit-window)))
(defun apu--filter-quelpa-packages (package-list)
"Return PACKAGE-LIST without quelpa packages."
(if (fboundp 'quelpa)
(let ((filtered-package-list package-list))
(dolist (package quelpa-cache)
(let ((package-name (car package)))
(setq filtered-package-list
(delq package-name filtered-package-list))))
filtered-package-list))
package-list)
;;;###autoload
(defun auto-package-update-now ()
"Update installed Emacs packages."
(interactive)
(run-hooks 'auto-package-update-before-hook)
(package-refresh-contents)
(let* ((package-list (apu--filter-quelpa-packages (apu--packages-to-install)))
(installation-report (apu--safe-install-packages package-list)))
(apu--write-current-day)
(apu--write-results-buffer
(mapconcat #'identity
(cons "[PACKAGES UPDATED]:" installation-report)
"\n")))
(run-hooks 'auto-package-update-after-hook))
;;;###autoload
(defun auto-package-update-at-time (time)
"Try to update every day at the specified TIME."
(run-at-time time 86400 'auto-package-update-maybe))
;;;###autoload
(defun auto-package-update-maybe ()
"Update installed Emacs packages if at least \
`auto-package-update-interval' days have passed since the last update."
(when (apu--should-update-packages-p)
(auto-package-update-now)))
(provide 'auto-package-update)
;;; auto-package-update.el ends here

View File

@ -0,0 +1,86 @@
;;; bind-key-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "bind-key" "bind-key.el" (0 0 0 0))
;;; Generated autoloads from bind-key.el
(autoload 'bind-key "bind-key" "\
Bind KEY-NAME to COMMAND in KEYMAP (`global-map' if not passed).
KEY-NAME may be a vector, in which case it is passed straight to
`define-key'. Or it may be a string to be interpreted as
spelled-out keystrokes, e.g., \"C-c C-z\". See documentation of
`edmacro-mode' for details.
COMMAND must be an interactive function or lambda form.
KEYMAP, if present, should be a keymap variable or symbol.
For example:
(bind-key \"M-h\" #'some-interactive-function my-mode-map)
(bind-key \"M-h\" #'some-interactive-function 'my-mode-map)
If PREDICATE is non-nil, it is a form evaluated to determine when
a key should be bound. It must return non-nil in such cases.
Emacs can evaluate this form at any time that it does redisplay
or operates on menu data structures, so you should write it so it
can safely be called at any time.
\(fn KEY-NAME COMMAND &optional KEYMAP PREDICATE)" nil t)
(autoload 'unbind-key "bind-key" "\
Unbind the given KEY-NAME, within the KEYMAP (if specified).
See `bind-key' for more details.
\(fn KEY-NAME &optional KEYMAP)" nil t)
(autoload 'bind-key* "bind-key" "\
Similar to `bind-key', but overrides any mode-specific bindings.
\(fn KEY-NAME COMMAND &optional PREDICATE)" nil t)
(autoload 'bind-keys "bind-key" "\
Bind multiple keys at once.
Accepts keyword arguments:
:map MAP - a keymap into which the keybindings should be
added
:prefix KEY - prefix key for these bindings
:prefix-map MAP - name of the prefix map that should be created
for these bindings
:prefix-docstring STR - docstring for the prefix-map variable
:menu-name NAME - optional menu string for prefix map
:filter FORM - optional form to determine when bindings apply
The rest of the arguments are conses of keybinding string and a
function symbol (unquoted).
\(fn &rest ARGS)" nil t)
(autoload 'bind-keys* "bind-key" "\
\(fn &rest ARGS)" nil t)
(autoload 'describe-personal-keybindings "bind-key" "\
Display all the personal keybindings defined by `bind-key'.
\(fn)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "bind-key" '("compare-keybindings" "get-binding-description" "bind-key" "personal-keybindings" "override-global-m")))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; bind-key-autoloads.el ends here

View File

@ -0,0 +1,2 @@
;;; -*- no-byte-compile: t -*-
(define-package "bind-key" "20200805.1727" "A simple way to manage personal keybindings" 'nil :commit "4fb1f9a68f1e7e7d614652afc017a6652fd029f1" :keywords '("keys" "keybinding" "config" "dotemacs") :authors '(("John Wiegley" . "johnw@newartisans.com")) :maintainer '("John Wiegley" . "johnw@newartisans.com") :url "https://github.com/jwiegley/use-package")

View File

@ -0,0 +1,459 @@
;;; bind-key.el --- A simple way to manage personal keybindings
;; Copyright (c) 2012-2017 John Wiegley
;; Author: John Wiegley <johnw@newartisans.com>
;; Maintainer: John Wiegley <johnw@newartisans.com>
;; Created: 16 Jun 2012
;; Modified: 29 Nov 2017
;; Version: 2.4
;; Package-Version: 20200805.1727
;; Package-Commit: 4fb1f9a68f1e7e7d614652afc017a6652fd029f1
;; Keywords: keys keybinding config dotemacs
;; URL: https://github.com/jwiegley/use-package
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the gnu general public license as
;; published by the free software foundation; either version 3, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; without any warranty; without even the implied warranty of
;; merchantability or fitness for a particular purpose. see the gnu
;; general public license for more details.
;; You should have received a copy of the gnu general public license
;; along with gnu emacs; see the file copying. if not, write to the
;; free software foundation, inc., 59 temple place - suite 330,
;; boston, ma 02111-1307, usa.
;;; Commentary:
;; If you have lots of keybindings set in your .emacs file, it can be hard to
;; know which ones you haven't set yet, and which may now be overriding some
;; new default in a new emacs version. This module aims to solve that
;; problem.
;;
;; Bind keys as follows in your .emacs:
;;
;; (require 'bind-key)
;;
;; (bind-key "C-c x" 'my-ctrl-c-x-command)
;;
;; If the keybinding argument is a vector, it is passed straight to
;; `define-key', so remapping a key with `[remap COMMAND]' works as
;; expected:
;;
;; (bind-key [remap original-ctrl-c-x-command] 'my-ctrl-c-x-command)
;;
;; If you want the keybinding to override all minor modes that may also bind
;; the same key, use the `bind-key*' form:
;;
;; (bind-key* "<C-return>" 'other-window)
;;
;; If you want to rebind a key only in a particular keymap, use:
;;
;; (bind-key "C-c x" 'my-ctrl-c-x-command some-other-mode-map)
;;
;; To unbind a key within a keymap (for example, to stop your favorite major
;; mode from changing a binding that you don't want to override everywhere),
;; use `unbind-key':
;;
;; (unbind-key "C-c x" some-other-mode-map)
;;
;; To bind multiple keys at once, or set up a prefix map, a `bind-keys' macro
;; is provided. It accepts keyword arguments, please see its documentation
;; for a detailed description.
;;
;; To add keys into a specific map, use :map argument
;;
;; (bind-keys :map dired-mode-map
;; ("o" . dired-omit-mode)
;; ("a" . some-custom-dired-function))
;;
;; To set up a prefix map, use `:prefix-map' and `:prefix' arguments (both are
;; required)
;;
;; (bind-keys :prefix-map my-customize-prefix-map
;; :prefix "C-c c"
;; ("f" . customize-face)
;; ("v" . customize-variable))
;;
;; You can combine all the keywords together. Additionally,
;; `:prefix-docstring' can be specified to set documentation of created
;; `:prefix-map' variable.
;;
;; To bind multiple keys in a `bind-key*' way (to be sure that your bindings
;; will not be overridden by other modes), you may use `bind-keys*' macro:
;;
;; (bind-keys*
;; ("C-o" . other-window)
;; ("C-M-n" . forward-page)
;; ("C-M-p" . backward-page))
;;
;; After Emacs loads, you can see a summary of all your personal keybindings
;; currently in effect with this command:
;;
;; M-x describe-personal-keybindings
;;
;; This display will tell you if you've overridden a default keybinding, and
;; what the default was. Also, it will tell you if the key was rebound after
;; your binding it with `bind-key', and what it was rebound it to.
;;; Code:
(require 'cl-lib)
(require 'easy-mmode)
(defgroup bind-key nil
"A simple way to manage personal keybindings"
:group 'emacs)
(defcustom bind-key-column-widths '(18 . 40)
"Width of columns in `describe-personal-keybindings'."
:type '(cons integer integer)
:group 'bind-key)
(defcustom bind-key-segregation-regexp
"\\`\\(\\(C-[chx] \\|M-[gso] \\)\\([CM]-\\)?\\|.+-\\)"
"Regular expression used to divide key sets in the output from
\\[describe-personal-keybindings]."
:type 'regexp
:group 'bind-key)
(defcustom bind-key-describe-special-forms nil
"If non-nil, extract docstrings from lambdas, closures and keymaps if possible."
:type 'boolean
:group 'bind-key)
;; Create override-global-mode to force key remappings
(defvar override-global-map (make-keymap)
"override-global-mode keymap")
(define-minor-mode override-global-mode
"A minor mode so that keymap settings override other modes."
t "")
;; the keymaps in `emulation-mode-map-alists' take precedence over
;; `minor-mode-map-alist'
(add-to-list 'emulation-mode-map-alists
`((override-global-mode . ,override-global-map)))
(defvar personal-keybindings nil
"List of bindings performed by `bind-key'.
Elements have the form ((KEY . [MAP]) CMD ORIGINAL-CMD)")
;;;###autoload
(defmacro bind-key (key-name command &optional keymap predicate)
"Bind KEY-NAME to COMMAND in KEYMAP (`global-map' if not passed).
KEY-NAME may be a vector, in which case it is passed straight to
`define-key'. Or it may be a string to be interpreted as
spelled-out keystrokes, e.g., \"C-c C-z\". See documentation of
`edmacro-mode' for details.
COMMAND must be an interactive function or lambda form.
KEYMAP, if present, should be a keymap variable or symbol.
For example:
(bind-key \"M-h\" #'some-interactive-function my-mode-map)
(bind-key \"M-h\" #'some-interactive-function 'my-mode-map)
If PREDICATE is non-nil, it is a form evaluated to determine when
a key should be bound. It must return non-nil in such cases.
Emacs can evaluate this form at any time that it does redisplay
or operates on menu data structures, so you should write it so it
can safely be called at any time."
(let ((namevar (make-symbol "name"))
(keyvar (make-symbol "key"))
(kdescvar (make-symbol "kdesc"))
(bindingvar (make-symbol "binding")))
`(let* ((,namevar ,key-name)
(,keyvar (if (vectorp ,namevar) ,namevar
(read-kbd-macro ,namevar)))
(kmap (if (and ,keymap (symbolp ,keymap)) (symbol-value ,keymap) ,keymap))
(,kdescvar (cons (if (stringp ,namevar) ,namevar
(key-description ,namevar))
(if (symbolp ,keymap) ,keymap (quote ,keymap))))
(,bindingvar (lookup-key (or kmap global-map) ,keyvar)))
(let ((entry (assoc ,kdescvar personal-keybindings))
(details (list ,command
(unless (numberp ,bindingvar)
,bindingvar))))
(if entry
(setcdr entry details)
(add-to-list 'personal-keybindings (cons ,kdescvar details))))
,(if predicate
`(define-key (or kmap global-map) ,keyvar
'(menu-item "" nil :filter (lambda (&optional _)
(when ,predicate
,command))))
`(define-key (or kmap global-map) ,keyvar ,command)))))
;;;###autoload
(defmacro unbind-key (key-name &optional keymap)
"Unbind the given KEY-NAME, within the KEYMAP (if specified).
See `bind-key' for more details."
`(progn
(bind-key ,key-name nil ,keymap)
(setq personal-keybindings
(cl-delete-if #'(lambda (k)
,(if keymap
`(and (consp (car k))
(string= (caar k) ,key-name)
(eq (cdar k) ',keymap))
`(and (stringp (car k))
(string= (car k) ,key-name))))
personal-keybindings))))
;;;###autoload
(defmacro bind-key* (key-name command &optional predicate)
"Similar to `bind-key', but overrides any mode-specific bindings."
`(bind-key ,key-name ,command override-global-map ,predicate))
(defun bind-keys-form (args keymap)
"Bind multiple keys at once.
Accepts keyword arguments:
:map MAP - a keymap into which the keybindings should be
added
:prefix KEY - prefix key for these bindings
:prefix-map MAP - name of the prefix map that should be created
for these bindings
:prefix-docstring STR - docstring for the prefix-map variable
:menu-name NAME - optional menu string for prefix map
:filter FORM - optional form to determine when bindings apply
The rest of the arguments are conses of keybinding string and a
function symbol (unquoted)."
(let (map
doc
prefix-map
prefix
filter
menu-name
pkg)
;; Process any initial keyword arguments
(let ((cont t))
(while (and cont args)
(if (cond ((and (eq :map (car args))
(not prefix-map))
(setq map (cadr args)))
((eq :prefix-docstring (car args))
(setq doc (cadr args)))
((and (eq :prefix-map (car args))
(not (memq map '(global-map
override-global-map))))
(setq prefix-map (cadr args)))
((eq :prefix (car args))
(setq prefix (cadr args)))
((eq :filter (car args))
(setq filter (cadr args)) t)
((eq :menu-name (car args))
(setq menu-name (cadr args)))
((eq :package (car args))
(setq pkg (cadr args))))
(setq args (cddr args))
(setq cont nil))))
(when (or (and prefix-map (not prefix))
(and prefix (not prefix-map)))
(error "Both :prefix-map and :prefix must be supplied"))
(when (and menu-name (not prefix))
(error "If :menu-name is supplied, :prefix must be too"))
(unless map (setq map keymap))
;; Process key binding arguments
(let (first next)
(while args
(if (keywordp (car args))
(progn
(setq next args)
(setq args nil))
(if first
(nconc first (list (car args)))
(setq first (list (car args))))
(setq args (cdr args))))
(cl-flet
((wrap (map bindings)
(if (and map pkg (not (memq map '(global-map
override-global-map))))
`((if (boundp ',map)
,(macroexp-progn bindings)
(eval-after-load
,(if (symbolp pkg) `',pkg pkg)
',(macroexp-progn bindings))))
bindings)))
(append
(when prefix-map
`((defvar ,prefix-map)
,@(when doc `((put ',prefix-map 'variable-documentation ,doc)))
,@(if menu-name
`((define-prefix-command ',prefix-map nil ,menu-name))
`((define-prefix-command ',prefix-map)))
,@(if (and map (not (eq map 'global-map)))
(wrap map `((bind-key ,prefix ',prefix-map ,map ,filter)))
`((bind-key ,prefix ',prefix-map nil ,filter)))))
(wrap map
(cl-mapcan
(lambda (form)
(let ((fun (and (cdr form) (list 'function (cdr form)))))
(if prefix-map
`((bind-key ,(car form) ,fun ,prefix-map ,filter))
(if (and map (not (eq map 'global-map)))
`((bind-key ,(car form) ,fun ,map ,filter))
`((bind-key ,(car form) ,fun nil ,filter))))))
first))
(when next
(bind-keys-form (if pkg
(cons :package (cons pkg next))
next) map)))))))
;;;###autoload
(defmacro bind-keys (&rest args)
"Bind multiple keys at once.
Accepts keyword arguments:
:map MAP - a keymap into which the keybindings should be
added
:prefix KEY - prefix key for these bindings
:prefix-map MAP - name of the prefix map that should be created
for these bindings
:prefix-docstring STR - docstring for the prefix-map variable
:menu-name NAME - optional menu string for prefix map
:filter FORM - optional form to determine when bindings apply
The rest of the arguments are conses of keybinding string and a
function symbol (unquoted)."
(macroexp-progn (bind-keys-form args nil)))
;;;###autoload
(defmacro bind-keys* (&rest args)
(macroexp-progn (bind-keys-form args 'override-global-map)))
(defun get-binding-description (elem)
(cond
((listp elem)
(cond
((memq (car elem) '(lambda function))
(if (and bind-key-describe-special-forms
(stringp (nth 2 elem)))
(nth 2 elem)
"#<lambda>"))
((eq 'closure (car elem))
(if (and bind-key-describe-special-forms
(stringp (nth 3 elem)))
(nth 3 elem)
"#<closure>"))
((eq 'keymap (car elem))
"#<keymap>")
(t
elem)))
;; must be a symbol, non-symbol keymap case covered above
((and bind-key-describe-special-forms (keymapp elem))
(let ((doc (get elem 'variable-documentation)))
(if (stringp doc) doc elem)))
((symbolp elem)
elem)
(t
"#<byte-compiled lambda>")))
(defun compare-keybindings (l r)
(let* ((regex bind-key-segregation-regexp)
(lgroup (and (string-match regex (caar l))
(match-string 0 (caar l))))
(rgroup (and (string-match regex (caar r))
(match-string 0 (caar r))))
(lkeymap (cdar l))
(rkeymap (cdar r)))
(cond
((and (null lkeymap) rkeymap)
(cons t t))
((and lkeymap (null rkeymap))
(cons nil t))
((and lkeymap rkeymap
(not (string= (symbol-name lkeymap) (symbol-name rkeymap))))
(cons (string< (symbol-name lkeymap) (symbol-name rkeymap)) t))
((and (null lgroup) rgroup)
(cons t t))
((and lgroup (null rgroup))
(cons nil t))
((and lgroup rgroup)
(if (string= lgroup rgroup)
(cons (string< (caar l) (caar r)) nil)
(cons (string< lgroup rgroup) t)))
(t
(cons (string< (caar l) (caar r)) nil)))))
;;;###autoload
(defun describe-personal-keybindings ()
"Display all the personal keybindings defined by `bind-key'."
(interactive)
(with-output-to-temp-buffer "*Personal Keybindings*"
(princ (format (concat "Key name%s Command%s Comments\n%s %s "
"---------------------\n")
(make-string (- (car bind-key-column-widths) 9) ? )
(make-string (- (cdr bind-key-column-widths) 8) ? )
(make-string (1- (car bind-key-column-widths)) ?-)
(make-string (1- (cdr bind-key-column-widths)) ?-)))
(let (last-binding)
(dolist (binding
(setq personal-keybindings
(sort personal-keybindings
(lambda (l r)
(car (compare-keybindings l r))))))
(if (not (eq (cdar last-binding) (cdar binding)))
(princ (format "\n\n%s: %s\n%s\n\n"
(cdar binding) (caar binding)
(make-string (+ 21 (car bind-key-column-widths)
(cdr bind-key-column-widths)) ?-)))
(if (and last-binding
(cdr (compare-keybindings last-binding binding)))
(princ "\n")))
(let* ((key-name (caar binding))
(at-present (lookup-key (or (symbol-value (cdar binding))
(current-global-map))
(read-kbd-macro key-name)))
(command (nth 1 binding))
(was-command (nth 2 binding))
(command-desc (get-binding-description command))
(was-command-desc (and was-command
(get-binding-description was-command)))
(at-present-desc (get-binding-description at-present))
)
(let ((line
(format
(format "%%-%ds%%-%ds%%s\n" (car bind-key-column-widths)
(cdr bind-key-column-widths))
key-name (format "`%s\'" command-desc)
(if (string= command-desc at-present-desc)
(if (or (null was-command)
(string= command-desc was-command-desc))
""
(format "was `%s\'" was-command-desc))
(format "[now: `%s\']" at-present)))))
(princ (if (string-match "[ \t]+\n" line)
(replace-match "\n" t t line)
line))))
(setq last-binding binding)))))
(provide 'bind-key)
;; Local Variables:
;; outline-regexp: ";;;\\(;* [^\s\t\n]\\|###autoload\\)\\|("
;; indent-tabs-mode: nil
;; End:
;;; bind-key.el ends here

Binary file not shown.

View File

@ -0,0 +1,26 @@
;;; dash-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "dash" "dash.el" (0 0 0 0))
;;; Generated autoloads from dash.el
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "dash" '("dash-" "-keep" "-butlast" "-non" "-only-some" "-zip" "-e" "->" "-a" "-gr" "-when-let" "-d" "-l" "-s" "-p" "-r" "-m" "-i" "-f" "-u" "-value-to-list" "-t" "--" "-c" "!cons" "!cdr")))
;;;***
;;;### (autoloads nil nil ("dash-pkg.el") (0 0 0 0))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; dash-autoloads.el ends here

View File

@ -0,0 +1,9 @@
(define-package "dash" "20200803.1520" "A modern list library for Emacs" 'nil :commit "b92ab5a39b987e4fe69317b9d9fda452300baf20" :keywords
'("lists")
:authors
'(("Magnar Sveen" . "magnars@gmail.com"))
:maintainer
'("Magnar Sveen" . "magnars@gmail.com"))
;; Local Variables:
;; no-byte-compile: t
;; End:

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
This is the file .../info/dir, which contains the
topmost node of the Info hierarchy, called (dir)Top.
The first time you invoke Info you start off looking at this node.

File: dir, Node: Top This is the top of the INFO tree
This (the Directory node) gives a menu of major topics.
Typing "q" exits, "H" lists all Info commands, "d" returns here,
"h" gives a primer for first-timers,
"mEmacs<Return>" visits the Emacs manual, etc.
In Emacs, you can click mouse button 2 on a menu item or cross reference
to select it.
* Menu:
Emacs
* Dash: (dash.info). A modern list library for GNU Emacs

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,82 @@
;;; htmlize-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "htmlize" "htmlize.el" (0 0 0 0))
;;; Generated autoloads from htmlize.el
(autoload 'htmlize-buffer "htmlize" "\
Convert BUFFER to HTML, preserving colors and decorations.
The generated HTML is available in a new buffer, which is returned.
When invoked interactively, the new buffer is selected in the current
window. The title of the generated document will be set to the buffer's
file name or, if that's not available, to the buffer's name.
Note that htmlize doesn't fontify your buffers, it only uses the
decorations that are already present. If you don't set up font-lock or
something else to fontify your buffers, the resulting HTML will be
plain. Likewise, if you don't like the choice of colors, fix the mode
that created them, or simply alter the faces it uses.
\(fn &optional BUFFER)" t nil)
(autoload 'htmlize-region "htmlize" "\
Convert the region to HTML, preserving colors and decorations.
See `htmlize-buffer' for details.
\(fn BEG END)" t nil)
(autoload 'htmlize-file "htmlize" "\
Load FILE, fontify it, convert it to HTML, and save the result.
Contents of FILE are inserted into a temporary buffer, whose major mode
is set with `normal-mode' as appropriate for the file type. The buffer
is subsequently fontified with `font-lock' and converted to HTML. Note
that, unlike `htmlize-buffer', this function explicitly turns on
font-lock. If a form of highlighting other than font-lock is desired,
please use `htmlize-buffer' directly on buffers so highlighted.
Buffers currently visiting FILE are unaffected by this function. The
function does not change current buffer or move the point.
If TARGET is specified and names a directory, the resulting file will be
saved there instead of to FILE's directory. If TARGET is specified and
does not name a directory, it will be used as output file name.
\(fn FILE &optional TARGET)" t nil)
(autoload 'htmlize-many-files "htmlize" "\
Convert FILES to HTML and save the corresponding HTML versions.
FILES should be a list of file names to convert. This function calls
`htmlize-file' on each file; see that function for details. When
invoked interactively, you are prompted for a list of files to convert,
terminated with RET.
If TARGET-DIRECTORY is specified, the HTML files will be saved to that
directory. Normally, each HTML file is saved to the directory of the
corresponding source file.
\(fn FILES &optional TARGET-DIRECTORY)" t nil)
(autoload 'htmlize-many-files-dired "htmlize" "\
HTMLize dired-marked files.
\(fn ARG &optional TARGET-DIRECTORY)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "htmlize" '("htmlize-")))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; htmlize-autoloads.el ends here

View File

@ -0,0 +1,2 @@
;;; -*- no-byte-compile: t -*-
(define-package "htmlize" "20200816.746" "Convert buffer text and decorations to HTML." 'nil :commit "49205105898ba8993b5253beec55d8bddd820a70" :keywords '("hypermedia" "extensions") :authors '(("Hrvoje Niksic" . "hniksic@gmail.com")) :maintainer '("Hrvoje Niksic" . "hniksic@gmail.com") :url "https://github.com/hniksic/emacs-htmlize")

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,32 @@
;;; impatient-mode-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "impatient-mode" "impatient-mode.el" (0 0 0
;;;;;; 0))
;;; Generated autoloads from impatient-mode.el
(autoload 'impatient-mode "impatient-mode" "\
Serves the buffer live over HTTP.
\(fn &optional ARG)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "impatient-mode" '("httpd/imp" "imp")))
;;;***
;;;### (autoloads nil nil ("impatient-mode-pkg.el") (0 0 0 0))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; impatient-mode-autoloads.el ends here

View File

@ -0,0 +1,12 @@
(define-package "impatient-mode" "20200723.2117" "Serve buffers live over HTTP"
'((emacs "24.3")
(simple-httpd "1.5.0")
(htmlize "1.40"))
:commit "cbddfd54242210df3e1c3b590fada5bb5423f5ed" :authors
'(("Brian Taylor" . "el.wubo@gmail.com"))
:maintainer
'("Brian Taylor" . "el.wubo@gmail.com")
:url "https://github.com/netguy204/imp.el")
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@ -0,0 +1,330 @@
;;; impatient-mode.el --- Serve buffers live over HTTP -*- lexical-binding: t; -*-
;; This is free and unencumbered software released into the public domain.
;; Author: Brian Taylor <el.wubo@gmail.com>
;; Version: 1.1
;; URL: https://github.com/netguy204/imp.el
;; Package-Requires: ((emacs "24.3") (simple-httpd "1.5.0") (htmlize "1.40"))
;;; Commentary:
;; impatient-mode is a minor mode that publishes the live buffer
;; through the local simple-httpd server under /imp/live/<buffer-name>/.
;; To unpublish a buffer, toggle impatient-mode off.
;; Start the simple-httpd server (`httpd-start') and visit /imp/ on
;; the local server. There will be a listing of all the buffers that
;; currently have impatient-mode enabled. This is likely to be found
;; here:
;; http://localhost:8080/imp/
;; Except for html-mode buffers, buffers will be prettied up with
;; htmlize before being sent to clients. This can be toggled at any
;; time with `imp-toggle-htmlize'.
;; Because html-mode buffers are sent raw, you can use impatient-mode
;; see your edits to an HTML document live! This is perhaps the
;; primary motivation of this mode.
;; To receive updates the browser issues a long poll on the client
;; waiting for the buffer to change -- server push. The response
;; happens in an `after-change-functions' hook. Buffers that do not
;; run these hooks will not be displayed live to clients.
;;; Code:
(require 'cl-lib)
(require 'url-util)
(require 'simple-httpd)
(require 'htmlize)
(defgroup impatient nil
"Serve buffers live over HTTP."
:group 'comm)
(defcustom impatient-mode-delay nil
"The delay in seconds between a keypress and the browser reload.
Set to nil for no delay"
:group 'impatient
:type 'boolean)
(defcustom imp-default-user-filters '((mhtml-mode . nil)
(html-mode . nil)
(web-mode . nil))
"Alist indicating which filter should be used for which modes."
:group 'impatient
:type 'sexp)
(defvar-local imp--idle-timer nil
"A timer that goes off after `impatient-mode-delay' seconds of inactivity")
(defvar-local imp-user-filter #'imp-htmlize-filter
"Per buffer html-producing function by user.")
(defvar-local imp-client-list ()
"List of client processes watching the current buffer.")
(defvar-local imp-last-state 0
"State sequence number.")
(defvar-local imp-related-files nil
"Files that seem to be related to this buffer")
(defvar-local imp--buffer-dirty-p nil
"If non-nil, buffer has been modified but not sent to clients.")
(defvar impatient-mode-map (make-sparse-keymap)
"Keymap for impatient-mode.")
;;;###autoload
(define-minor-mode impatient-mode
"Serves the buffer live over HTTP."
:group 'impatient
:lighter " imp"
:keymap impatient-mode-map
(if (not impatient-mode)
(progn
(imp--cleanup-timer)
(remove-hook 'after-change-functions #'imp--on-change t))
(add-hook 'kill-buffer-hook #'imp--cleanup-timer nil t)
(add-hook 'after-change-functions #'imp--on-change nil t)
(imp-remove-user-filter)))
(defvar imp-shim-root (file-name-directory load-file-name)
"Location of data files needed by impatient-mode.")
(defun imp-set-user-filter (fn)
"Set a FN as user-defined filter for this buffer.
FUNCTION should accept one argument, the buffer to be filtered,
and will be evaluated with the output buffer set as the current
buffer."
(interactive "aCustom filter: ")
(setq imp-user-filter fn)
(cl-incf imp-last-state)
(imp--notify-clients))
(defun imp-remove-user-filter ()
"Set the user-defined filter for this buffer to the default."
(interactive)
(let ((lookup (assoc major-mode imp-default-user-filters)))
(if lookup
(imp-set-user-filter (cdr lookup))
(kill-local-variable 'imp-user-filter)))
(cl-incf imp-last-state)
(imp--notify-clients))
(defun imp-htmlize-filter (buffer)
"Htmlize BUFFER before sending to clients."
(let ((html-buffer (save-match-data (htmlize-buffer buffer))))
(princ (with-current-buffer html-buffer (buffer-string)))
(kill-buffer html-buffer)))
(defun imp-toggle-htmlize ()
"Toggle htmlize of buffer."
(interactive)
(if (eq imp-user-filter 'imp-htmlize-filter)
(imp-set-user-filter nil)
(imp-set-user-filter 'imp-htmlize-filter)))
(defun imp-visit-buffer (&optional arg)
"Visit the current buffer in a browser.
If given a prefix ARG, visit the buffer listing instead."
(interactive "P")
(unless (process-status "httpd")
(httpd-start))
(unless impatient-mode
(impatient-mode))
(let* ((proc (get-process "httpd"))
(proc-info (process-contact proc t))
(raw-host (plist-get proc-info :host))
(host (if (member raw-host
'(nil local "127.0.0.1" "::1" "0.0.0.0" "::"))
"localhost"
raw-host))
(local-addr (plist-get proc-info :local))
(port (aref local-addr (1- (length local-addr))))
(url (format "http://%s:%d/imp/" host port)))
(unless arg
(setq url (format "%slive/%s/" url (url-hexify-string (buffer-name)))))
(browse-url url)))
(defun imp-buffer-enabled-p (buffer)
"Return t if BUFFER has impatient-mode enabled."
(and buffer (with-current-buffer (get-buffer buffer) impatient-mode)))
(defun imp--buffer-list ()
"List of all buffers with impatient-mode enabled."
(cl-remove-if-not 'imp-buffer-enabled-p (buffer-list)))
(defun imp--should-not-cache-p (path)
"True if the PATH should be stamped with a no-cache header."
(let ((mime-type (httpd-get-mime (file-name-extension path))))
(member mime-type '("text/css" "text/html" "text/xml"
"text/plain" "text/javascript"))))
(defun httpd/imp/static (proc path _query req)
"Serve up static files."
(let* ((file (file-name-nondirectory path))
(clean (expand-file-name file imp-shim-root)))
(if (file-exists-p clean)
(httpd-send-file proc clean req)
(httpd-error proc 404))))
(defun imp-serve-buffer-list (proc)
"Serve a list of published buffers."
(with-httpd-buffer proc "text/html; charset=utf-8"
(insert "<html><head>\n")
(insert "<title>impatient-mode buffer list</title>\n")
(insert "</head><body>\n")
(insert "<h1>Public Buffers</h1>\n<hr/>")
(insert "<ul>\n")
(dolist (buffer (imp--buffer-list))
(insert (format "<li><a href=\"live/%s/\">%s</a></li>\n"
(url-hexify-string (buffer-name buffer))
(url-insert-entities-in-string (buffer-name buffer)))))
(insert "</ul>\n<hr/>")
(insert "Enable <code>impatient-mode</code> in buffers to publish them.")
(insert "</body></html>")))
(defun imp--private (proc buffer-name)
(httpd-error proc 403
(format "Buffer %s is private or doesn't exist." buffer-name)))
(defun httpd/imp/live (proc path _query req)
"Serve up the shim that lets us watch a buffer change."
(let* ((index (expand-file-name "index.html" imp-shim-root))
(decoded (url-unhex-string path))
(parts (cdr (split-string decoded "/")))
(buffer-name (nth 2 parts))
(file (httpd-clean-path (mapconcat 'identity (nthcdr 3 parts) "/")))
(buffer (get-buffer buffer-name))
(buffer-file (buffer-file-name buffer))
(buffer-dir (and buffer-file (file-name-directory buffer-file))))
(cond
((equal (file-name-directory decoded) "/imp/live/")
(httpd-redirect proc (concat decoded "/")))
((not (imp-buffer-enabled-p buffer)) (imp--private proc buffer-name))
((and (not (string= file "./")) buffer-dir)
(let* ((full-file-name (expand-file-name file buffer-dir))
(mime-type (httpd-get-mime (file-name-extension full-file-name)))
(live-buffer (cl-remove-if-not
(lambda (buf) (equal full-file-name (buffer-file-name buf)))
(imp--buffer-list))))
(with-current-buffer buffer-name
(add-to-list 'imp-related-files full-file-name))
(if live-buffer
(with-temp-buffer
(insert-buffer-substring (cl-first live-buffer))
(if (imp--should-not-cache-p decoded)
(httpd-send-header proc mime-type 200
:Cache-Control "no-cache")
(httpd-send-header proc mime-type 200
:Cache-Control
"max-age=60, must-revalidate")))
(httpd-send-file proc full-file-name req))))
(t (imp-buffer-enabled-p buffer) (httpd-send-file proc index req)))))
(defun httpd/imp (proc path &rest _)
(cond
((equal path "/imp") (httpd-redirect proc "/imp/"))
((equal path "/imp/") (imp-serve-buffer-list proc))
(t (httpd-error proc 403 (format "%s not found" path)))))
(defun imp--send-state (proc)
(let ((id (number-to-string imp-last-state))
(user-filter imp-user-filter)
(buffer (current-buffer)))
(with-temp-buffer
(let ((standard-output (current-buffer)))
(if user-filter
(funcall user-filter buffer)
(insert-buffer-substring buffer))
(httpd-send-header proc "text/html" 200
:Cache-Control "no-cache"
:X-Imp-Count id)))))
(defun imp--send-state-ignore-errors (proc)
(condition-case _
(imp--send-state proc)
(error nil)))
(defun imp--notify-clients ()
(while imp-client-list
(imp--send-state-ignore-errors (pop imp-client-list))))
(defun imp--cleanup-timer ()
"Destroy any timer associated with this buffer."
(when imp--idle-timer
(cancel-timer (cdr imp--idle-timer))
(setf imp--idle-timer nil)))
(defun imp--start-idle-timer ()
"Start/update the idle timer as appropriate."
(cond
;; Timer doesn't exist and shouldn't (do nothing)
((and (null impatient-mode-delay) (null imp--idle-timer)))
;; Timer exists when it shouldnt
((and (null impatient-mode-delay) imp--idle-timer)
(cancel-timer (cdr imp--idle-timer))
(setf imp--idle-timer nil))
;; Timer doesn't exist when it should
((and impatient-mode-delay (null imp--idle-timer))
(let* ((buffer (current-buffer))
(timer (run-with-idle-timer
impatient-mode-delay :repeat
(lambda ()
(with-current-buffer buffer
(imp--after-timeout))))))
(setf imp--idle-timer (cons impatient-mode-delay timer))))
;; Timer delay is incorrect
((not (eql (car imp--idle-timer) impatient-mode-delay))
(timer-set-idle-time (cdr imp--idle-timer)
impatient-mode-delay
:repeat)
(setf (car imp--idle-timer) impatient-mode-delay))))
(defun imp--on-change (&rest _)
"Hook for `after-change-functions'."
(imp--start-idle-timer)
(if impatient-mode-delay
(setf imp--buffer-dirty-p :dirty)
(imp--update-buffer)))
(defun imp--after-timeout ()
"Execute after `impatient-mode-delay' seconds of idleness."
(when imp--buffer-dirty-p
(imp--update-buffer))
(imp--start-idle-timer))
(defun imp--update-buffer ()
"Update this buffer in the browser."
(setf imp--buffer-dirty-p nil)
(cl-incf imp-last-state)
;; notify our clients
(imp--notify-clients)
;; notify any clients that we're in the `imp-related-files' list for
(let ((buffer-file (buffer-file-name (current-buffer))))
(dolist (buffer (imp--buffer-list))
(with-current-buffer buffer
(when (member buffer-file imp-related-files)
(imp--notify-clients))))))
(defun httpd/imp/buffer (proc path query &rest _)
"Servlet that accepts long poll requests."
(let* ((decoded (url-unhex-string path))
(buffer-name (file-name-nondirectory decoded))
(buffer (get-buffer buffer-name))
(req-last-id (string-to-number (or (cadr (assoc "id" query)) "0"))))
(if (imp-buffer-enabled-p buffer)
(with-current-buffer buffer
(if (equal req-last-id imp-last-state)
(push proc imp-client-list) ; this client is sync'd
(imp--send-state-ignore-errors proc))) ; this client is behind
(imp--private proc buffer-name))))
(provide 'impatient-mode)
;;; impatient-mode.el ends here

View File

@ -0,0 +1,114 @@
<!DOCTYPE html>
<meta charset="utf-8">
<script type="text/javascript" src="/imp/static/jquery.js"></script>
<style type="text/css">
html {
overflow: auto;
}
html, body, div, iframe {
margin: 0px;
padding: 0px;
height: 100%;
border: none;
}
iframe {
display: block;
width: 100%;
border: none;
overflow-y: auto;
overflow-x: hidden;
}
</style>
<iframe id="content"
name="content"
src="/imp/static/loading.html"
frameborder="0"
marginheight="0"
marginwidth="0"
width="100%"
height="100%"
scrolling="auto"
content="text/html;charset=UTF-8">
</iframe>
<script type="text/javascript">
var buffer = window.location.pathname.split('/')[3];
var max_period = 60000;
var min_period = 1000;
var next_period = min_period;
var alpha = 1.2;
var current_id = '-1';
$('head').append($('<title/>').text(decodeURI(buffer)));
var nextTimeout = function() {
var next = next_period;
next_period = Math.min(max_period, next_period * alpha);
return next;
};
var resetTimeout = function() {
next_period = min_period;
};
var frameToDocument = function(iframe) {
return (iframe.contentDocument) ? iframe.contentDocument : iframe.Document;
};
var printIframe = function(data) {
var iframeJQ = $('#content');
var doc = frameToDocument(iframeJQ[0]);
var iwindow = iframeJQ[0].contentWindow;
var offX = iwindow.pageXOffset, offY = iwindow.pageYOffset;
if (offY && offY >= $(doc.body).height() - $(iwindow).height()) {
offY = null; // follow the end of the buffer
}
doc.open();
doc.write(data);
doc.close();
iwindow.scrollTo(offX, offY != null ? offY : $(doc.body).height());
};
var setIframe = function(count, newText) {
if(!count) {
// error parsing client result
printIframe('0', 'error parsing the response from emacs');
} else {
current_id = count;
printIframe(newText);
}
};
var refresh = function() {
var url = "/imp/buffer/" + buffer;
var gotData = function(data, status, xhr) {
resetTimeout();
setIframe(xhr.getResponseHeader("X-Imp-Count"), data);
refresh();
};
var errorRetry = function() {
setTimeout(refresh, nextTimeout());
};
$.get(url + '?id=' + current_id, gotData).error(errorRetry);
};
$(document).ready(function() {
var iframeJQ = $('#content');
iframeJQ.load(function() {
// now we need to tweak the stylesheet links so that firefox will
// refresh them properly
$('link', frameToDocument(iframeJQ[0])).each(function(index, el) {
var href = $(el).attr('href');
// Only refresh impatient-mode hosted content
if(href && !/^[a-zA-z]+:\/\//.exec(href)) {
$(el).attr('href', $(el).attr('href') + '?' + new Date().getTime());
}
});
});
refresh();
});
</script>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
<!DOCTYPE html>
<meta charset="utf-8">
<h1>Loading Content</h1>

View File

@ -0,0 +1,27 @@
;;; magit-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "magit" "magit.el" (0 0 0 0))
;;; Generated autoloads from magit.el
(autoload 'magit-status "magit" "\
\(fn DIR)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "magit" '("magit-" "remove-dupes")))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; magit-autoloads.el ends here

View File

@ -0,0 +1,2 @@
;;; -*- no-byte-compile: t -*-
(define-package "magit" "0.8.1" "control Git from Emacs." 'nil)

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,14 @@
;;; Commentary:
;; Invoking the magit-status function will show a buffer with the
;; status of the current git repository and its working tree. That
;; buffer offers key bindings for manipulating the status in simple
;; ways.
;;
;; The status buffer mainly shows the difference between the working
;; tree and the index, and the difference between the index and the
;; current HEAD. You can add individual hunks from the working tree
;; to the index, and you can commit the index.
;;
;; See the Magit User Manual for more information.

View File

@ -0,0 +1,44 @@
;;; simple-httpd-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "simple-httpd" "simple-httpd.el" (0 0 0 0))
;;; Generated autoloads from simple-httpd.el
(autoload 'httpd-start "simple-httpd" "\
Start the web server process. If the server is already
running, this will restart the server. There is only one server
instance per Emacs instance.
\(fn)" t nil)
(autoload 'httpd-stop "simple-httpd" "\
Stop the web server if it is currently running, otherwise do nothing.
\(fn)" t nil)
(autoload 'httpd-running-p "simple-httpd" "\
Return non-nil if the simple-httpd server is running.
\(fn)" nil nil)
(autoload 'httpd-serve-directory "simple-httpd" "\
Start the web server with given `directory' as `httpd-root'.
\(fn DIRECTORY)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "simple-httpd" '("httpd" "defservlet" "with-httpd-buffer")))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; simple-httpd-autoloads.el ends here

View File

@ -0,0 +1,2 @@
;;; -*- no-byte-compile: t -*-
(define-package "simple-httpd" "20191103.1446" "pure elisp HTTP server" '((cl-lib "0.3")) :commit "22ce66ea43e0eadb9ec1d691a35d9695fc29cee6" :authors '(("Christopher Wellons" . "wellons@nullprogram.com")) :maintainer '("Christopher Wellons" . "wellons@nullprogram.com") :url "https://github.com/skeeto/emacs-http-server")

View File

@ -0,0 +1,904 @@
;;; simple-httpd.el --- pure elisp HTTP server
;; This is free and unencumbered software released into the public domain.
;; Author: Christopher Wellons <wellons@nullprogram.com>
;; URL: https://github.com/skeeto/emacs-http-server
;; Package-Version: 20191103.1446
;; Package-Commit: 22ce66ea43e0eadb9ec1d691a35d9695fc29cee6
;; Version: 1.5.1
;; Package-Requires: ((cl-lib "0.3"))
;;; Commentary:
;; Use `httpd-start' to start the web server. Files are served from
;; `httpd-root' on port `httpd-port' using `httpd-ip-family' at host
;; `httpd-host'. While the root can be changed at any time, the server
;; needs to be restarted in order for a port change to take effect.
;; Everything is performed by servlets, including serving
;; files. Servlets are enabled by setting `httpd-servlets' to true
;; (default). Servlets are four-parameter functions that begin with
;; "httpd/" where the trailing component specifies the initial path on
;; the server. For example, the function `httpd/hello-world' will be
;; called for the request "/hello-world" and "/hello-world/foo".
;; The default servlet `httpd/' is the one that serves files from
;; `httpd-root' and can be turned off through redefinition or setting
;; `httpd-serve-files' to nil. It is used even when `httpd-servlets'
;; is nil.
;; The four parameters for a servlet are process, URI path, GET/POST
;; arguments (alist), and the full request object (header
;; alist). These are ordered by general importance so that some can be
;; ignored. Two macros are provided to help with writing servlets.
;; * `with-httpd-buffer' -- Creates a temporary buffer that is
;; automatically served to the client at the end of the body.
;; Additionally, `standard-output' is set to this output
;; buffer. For example, this servlet says hello,
;; (defun httpd/hello-world (proc path &rest args)
;; (with-httpd-buffer proc "text/plain"
;; (insert "hello, " (file-name-nondirectory path))))
;; This servlet be viewed at http://localhost:8080/hello-world/Emacs
;; * `defservlet' -- Similar to the above macro but totally hides the
;; process object from the servlet itself. The above servlet can be
;; re-written identically like so,
;; (defservlet hello-world text/plain (path)
;; (insert "hello, " (file-name-nondirectory path)))
;; Note that `defservlet' automatically sets `httpd-current-proc'. See
;; below.
;; The "function parameters" part can be left empty or contain up to
;; three parameters corresponding to the final three servlet
;; parameters. For example, a servlet that shows *scratch* and doesn't
;; need parameters,
;; (defservlet scratch text/plain ()
;; (insert-buffer-substring (get-buffer-create "*scratch*")))
;; A higher level macro `defservlet*' wraps this lower-level
;; `defservlet' macro, automatically binding variables to components
;; of the request. For example, this binds parts of the request path
;; and one query parameter. Request components not provided by the
;; client are bound to nil.
;; (defservlet* packages/:package/:version text/plain (verbose)
;; (insert (format "%s\n%s\n" package version))
;; (princ (get-description package version))
;; (when verbose
;; (insert (format "%S" (get-dependencies package version)))))
;; It would be accessed like so,
;; http://example.com/packages/foobar/1.0?verbose=1
;; Some support functions are available for servlets for more
;; customized responses.
;; * `httpd-send-file' -- serve a file with proper caching
;; * `httpd-redirect' -- redirect the browser to another url
;; * `httpd-send-header' -- send custom headers
;; * `httpd-error' -- report an error to the client
;; * `httpd-log' -- log an object to *httpd*
;; Some of these functions require a process object, which isn't
;; passed to `defservlet' servlets. Use t in place of the process
;; argument to use `httpd-current-proc' (like `standard-output').
;; If you just need to serve static from some location under some
;; route on the server, use `httpd-def-file-servlet'. It expands into
;; a `defservlet' that serves files.
;;; History:
;; Version 1.5.1: improvements
;; * Add `httpd-running-p'
;; * Properly handle "Connection: close" and HTTP/1.0
;; Version 1.5.0: improvements
;; * Drastically improved performance for large requests
;; * More HTTP status codes
;; Version 1.4.6: fixes
;; * Added httpd-serve-directory
;; * Fix some encoding issues
;; Version 1.4.5: fixes
;; * Update to cl-lib from cl
;; Version 1.4.4: features
;; * Common Lisp &key-like defservlet* argument support
;; * Fix up some defservlet* usage warnings.
;; Version 1.4.3: features
;; * Add `httpd-discard-buffer'
;; * Add `httpd-def-file-servlet'
;; * Be more careful about not sending extra headers
;; Version 1.4.2: features, fixes
;; * `defservlet*' macro
;; Version 1.4.1: small bug fixes, one feature
;; * All mime-type parameters now accept string designators
;; * Documentation update
;; Version 1.4.0: features, API change, and fixes
;; * Removed httpd-send-buffer; httpd-send-header now does this implicitly
;; * httpd-send-header now accepts keywords instead
;; * Fix httpd-clean-path in Windows
;; * Fix a content-length bug
;; * defservlet fontification
;; Version 1.3.1: features and fixes
;; * Set `standard-output' in `with-httpd-buffer'
;; Version 1.3.0: security fix
;; * Fix path expansion security issue
;; * Fix coding system (don't default)
;; Version 1.2.4: fixes
;; * Handle large POSTs
;; * Fix date strings
;;; Code:
(require 'cl-lib)
(require 'pp)
(require 'url-util)
(defgroup simple-httpd nil
"A simple web server."
:group 'comm)
(defcustom httpd-ip-family 'ipv4
"Web server IP family used by `make-network-process'."
:group 'simple-httpd
:type 'symbol)
(defcustom httpd-host nil
"Web server host name used by `make-network-process'."
:group 'simple-httpd
:type '(choice (const nil) (const local) string))
(defcustom httpd-port 8080
"Web server port."
:group 'simple-httpd
:type 'integer)
(defcustom httpd-root "~/public_html"
"Web server file root."
:group 'simple-httpd
:type 'directory)
(defcustom httpd-serve-files t
"Enable serving files from `httpd-root'."
:group 'simple-httpd
:type 'boolean)
(defcustom httpd-listings t
"If true, serve directory listings."
:group 'simple-httpd
:type 'boolean)
(defcustom httpd-servlets t
"Enable servlets."
:group 'simple-httpd
:type 'boolean)
(defcustom httpd-show-backtrace-when-error nil
"If true, show backtrace on error page."
:group 'simple-httpd
:type 'boolean)
(defcustom httpd-start-hook nil
"Hook to run when the server has started."
:group 'simple-httpd
:type 'hook)
(defcustom httpd-stop-hook nil
"Hook to run when the server has stopped."
:group 'simple-httpd
:type 'hook)
(defvar httpd-server-name (format "simple-httpd (Emacs %s)" emacs-version)
"String to use in the Server header.")
(defvar httpd-mime-types
'(("png" . "image/png")
("gif" . "image/gif")
("jpg" . "image/jpeg")
("jpeg" . "image/jpeg")
("tif" . "image/tif")
("tiff" . "image/tiff")
("ico" . "image/x-icon")
("svg" . "image/svg+xml")
("css" . "text/css; charset=utf-8")
("htm" . "text/html; charset=utf-8")
("html" . "text/html; charset=utf-8")
("xml" . "text/xml; charset=utf-8")
("rss" . "text/xml; charset=utf-8")
("atom" . "text/xml; charset=utf-8")
("txt" . "text/plain; charset=utf-8")
("el" . "text/plain; charset=utf-8")
("js" . "text/javascript; charset=utf-8")
("md" . "text/x-markdown; charset=utf-8")
("gz" . "application/octet-stream")
("ps" . "application/postscript")
("eps" . "application/postscript")
("pdf" . "application/pdf")
("tar" . "application/x-tar")
("zip" . "application/zip")
("mp3" . "audio/mpeg")
("wav" . "audio/x-wav")
("flac" . "audio/flac")
("spx" . "audio/ogg")
("oga" . "audio/ogg")
("ogg" . "audio/ogg")
("ogv" . "video/ogg")
("mp4" . "video/mp4")
("mkv" . "video/x-matroska")
("webm" . "video/webm"))
"MIME types for headers.")
(defvar httpd-indexes
'("index.html"
"index.htm"
"index.xml")
"File served by default when accessing a directory.")
(defvar httpd-status-codes
'((100 . "Continue")
(101 . "Switching Protocols")
(102 . "Processing")
(200 . "OK")
(201 . "Created")
(202 . "Accepted")
(203 . "Non-authoritative Information")
(204 . "No Content")
(205 . "Reset Content")
(206 . "Partial Content")
(207 . "Multi-Status")
(208 . "Already Reported")
(226 . "IM Used")
(300 . "Multiple Choices")
(301 . "Moved Permanently")
(302 . "Found")
(303 . "See Other")
(304 . "Not Modified")
(305 . "Use Proxy")
(307 . "Temporary Redirect")
(308 . "Permanent Redirect")
(400 . "Bad Request")
(401 . "Unauthorized")
(402 . "Payment Required")
(403 . "Forbidden")
(404 . "Not Found")
(405 . "Method Not Allowed")
(406 . "Not Acceptable")
(407 . "Proxy Authentication Required")
(408 . "Request Timeout")
(409 . "Conflict")
(410 . "Gone")
(411 . "Length Required")
(412 . "Precondition Failed")
(413 . "Payload Too Large")
(414 . "Request-URI Too Long")
(415 . "Unsupported Media Type")
(416 . "Requested Range Not Satisfiable")
(417 . "Expectation Failed")
(418 . "I'm a teapot")
(421 . "Misdirected Request")
(422 . "Unprocessable Entity")
(423 . "Locked")
(424 . "Failed Dependency")
(426 . "Upgrade Required")
(428 . "Precondition Required")
(429 . "Too Many Requests")
(431 . "Request Header Fields Too Large")
(444 . "Connection Closed Without Response")
(451 . "Unavailable For Legal Reasons")
(499 . "Client Closed Request")
(500 . "Internal Server Error")
(501 . "Not Implemented")
(502 . "Bad Gateway")
(503 . "Service Unavailable")
(504 . "Gateway Timeout")
(505 . "HTTP Version Not Supported")
(506 . "Variant Also Negotiates")
(507 . "Insufficient Storage")
(508 . "Loop Detected")
(510 . "Not Extended")
(511 . "Network Authentication Required")
(599 . "Network Connect Timeout Error"))
"HTTP status codes.")
(defvar httpd-html
'((403 . "<!DOCTYPE html>
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>The requested URL is forbidden.</p>
<pre>%s</pre>
</body></html>")
(404 . "<!DOCTYPE html>
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<pre>%s</pre>
</body></html>")
(500 . "<!DOCTYPE html>
<html><head>
<title>500 Internal Error</title>
</head><body>
<h1>500 Internal Error</h1>
<p>Internal error when handling this request.</p>
<pre>%s</pre>
</body></html>"))
"HTML for various errors.")
;; User interface
;;;###autoload
(defun httpd-start ()
"Start the web server process. If the server is already
running, this will restart the server. There is only one server
instance per Emacs instance."
(interactive)
(httpd-stop)
(httpd-log `(start ,(current-time-string)))
(make-network-process
:name "httpd"
:service httpd-port
:server t
:host httpd-host
:family httpd-ip-family
:filter 'httpd--filter
:coding 'binary
:log 'httpd--log)
(run-hooks 'httpd-start-hook))
;;;###autoload
(defun httpd-stop ()
"Stop the web server if it is currently running, otherwise do nothing."
(interactive)
(when (process-status "httpd")
(delete-process "httpd")
(httpd-log `(stop ,(current-time-string)))
(run-hooks 'httpd-stop-hook)))
;;;###autoload
(defun httpd-running-p ()
"Return non-nil if the simple-httpd server is running."
(not (null (process-status "httpd"))))
;;;###autoload
(defun httpd-serve-directory (directory)
"Start the web server with given `directory' as `httpd-root'."
(interactive "DServe directory: \n")
(setf httpd-root directory)
(httpd-start)
(message "Started simple-httpd on %s:%d, serving: %s"
(cl-case httpd-host
((nil) "0.0.0.0")
((local) "localhost")
(otherwise httpd-host)) httpd-port directory))
(defun httpd-batch-start ()
"Never returns, holding the server open indefinitely for batch mode.
Logs are redirected to stdout. To use, invoke Emacs like this:
emacs -Q -batch -l simple-httpd.elc -f httpd-batch-start"
(if (not noninteractive)
(error "Only use `httpd-batch-start' in batch mode!")
(httpd-start)
(defalias 'httpd-log 'pp)
(while t (sleep-for 60))))
;; Utility
(defun httpd-date-string (&optional date)
"Return an HTTP date string (RFC 1123)."
(format-time-string "%a, %e %b %Y %T GMT" date t))
(defun httpd-etag (file)
"Compute the ETag for FILE."
(concat "\"" (substring (sha1 (prin1-to-string (file-attributes file))) -16)
"\""))
(defun httpd--stringify (designator)
"Turn a string designator into a string."
(let ((string (format "%s" designator)))
(if (keywordp designator)
(substring string 1)
string)))
;; Networking code
(defun httpd--connection-close-p (request)
"Return non-nil if the client requested \"connection: close\"."
(or (equal '("close") (cdr (assoc "Connection" request)))
(equal '("HTTP/1.0") (cddr (assoc "GET" request)))))
(defun httpd--filter (proc chunk)
"Runs each time client makes a request."
(with-current-buffer (process-get proc :request-buffer)
(setf (point) (point-max))
(insert chunk)
(let ((request (process-get proc :request)))
(unless request
(when (setf request (httpd-parse))
(delete-region (point-min) (point))
(process-put proc :request request)))
(when request
(let ((content-length (cadr (assoc "Content-Length" request))))
(when (or (null content-length)
(= (buffer-size) (string-to-number content-length)))
(let* ((content (buffer-string))
(uri (cl-cadar request))
(parsed-uri (httpd-parse-uri (concat uri)))
(uri-path (httpd-unhex (nth 0 parsed-uri)))
(uri-query (append (nth 1 parsed-uri)
(httpd-parse-args content)))
(servlet (httpd-get-servlet uri-path)))
(erase-buffer)
(process-put proc :request nil)
(setf request (nreverse (cons (list "Content" content)
(nreverse request))))
(httpd-log `(request (date ,(httpd-date-string))
(address ,(car (process-contact proc)))
(get ,uri-path)
,(cons 'headers request)))
(if (null servlet)
(httpd--error-safe proc 404)
(condition-case error-case
(funcall servlet proc uri-path uri-query request)
(error (httpd--error-safe proc 500 error-case))))
(when (httpd--connection-close-p request)
(process-send-eof proc)))))))))
(defun httpd--log (server proc message)
"Runs each time a new client connects."
(with-current-buffer (generate-new-buffer " *httpd-client*")
(process-put proc :request-buffer (current-buffer)))
(set-process-sentinel proc #'httpd--sentinel)
(httpd-log (list 'connection (car (process-contact proc)))))
(defun httpd--sentinel (proc message)
"Runs when a client closes the connection."
(unless (string-match-p "^open " message)
(let ((buffer (process-get proc :request-buffer)))
(when buffer
(kill-buffer buffer)))))
;; Logging
(defun httpd-log (item)
"Pretty print a lisp object to the log."
(with-current-buffer (get-buffer-create "*httpd*")
(setf buffer-read-only nil)
(let ((follow (= (point) (point-max))))
(save-excursion
(goto-char (point-max))
(pp item (current-buffer)))
(if follow (goto-char (point-max))))
(setf truncate-lines t
buffer-read-only t)
(set-buffer-modified-p nil)))
;; Servlets
(defvar httpd-current-proc nil
"The process object currently in use.")
(defvar httpd--header-sent nil
"Buffer-local variable indicating if the header has been sent.")
(make-variable-buffer-local 'httpd--header-sent)
(defun httpd-resolve-proc (proc)
"Return the correct process to use. This handles `httpd-current-proc'."
(if (eq t proc) httpd-current-proc proc))
(defmacro with-httpd-buffer (proc mime &rest body)
"Create a temporary buffer, set it as the current buffer, and,
at the end of body, automatically serve it to an HTTP client with
an HTTP header indicating the specified MIME type. Additionally,
`standard-output' is set to this output buffer and
`httpd-current-proc' is set to PROC."
(declare (indent defun))
(let ((proc-sym (make-symbol "--proc--")))
`(let ((,proc-sym ,proc))
(with-temp-buffer
(setf major-mode 'httpd-buffer)
(let ((standard-output (current-buffer))
(httpd-current-proc ,proc-sym))
,@body)
(unless httpd--header-sent
(httpd-send-header ,proc-sym ,mime 200))))))
(defun httpd-discard-buffer ()
"Don't respond using current server buffer (`with-httpd-buffer').
Returns a process for future response."
(when (eq major-mode 'httpd-buffer) (setf httpd--header-sent t))
httpd-current-proc)
(defmacro defservlet (name mime path-query-request &rest body)
"Defines a simple httpd servelet. The servlet runs in a
temporary buffer which is automatically served to the client
along with a header.
A servlet that serves the contents of *scratch*,
(defservlet scratch text/plain ()
(insert-buffer-substring (get-buffer-create \"*scratch*\")))
A servlet that says hello,
(defservlet hello-world text/plain (path)
(insert \"hello, \" (file-name-nondirectory path))))"
(declare (indent defun))
(let ((proc-sym (make-symbol "proc"))
(fname (intern (concat "httpd/" (symbol-name name)))))
`(defun ,fname (,proc-sym ,@path-query-request &rest ,(cl-gensym))
(with-httpd-buffer ,proc-sym ,(httpd--stringify mime)
,@body))))
(defun httpd-parse-endpoint (symbol)
"Parse an endpoint definition template for use with `defservlet*'."
(cl-loop for item in (split-string (symbol-name symbol) "/")
for n upfrom 0
when (and (> (length item) 0) (eql (aref item 0) ?:))
collect (cons (intern (substring item 1)) n) into vars
else collect item into path
finally
(cl-return
(cl-values (intern (mapconcat #'identity path "/")) vars))))
(defvar httpd-path nil
"Anaphoric variable for `defservlet*'.")
(defvar httpd-query nil
"Anaphoric variable for `defservlet*'.")
(defvar httpd-request nil
"Anaphoric variable for `defservlet*'.")
(defvar httpd-split-path nil
"Anaphoric variable for `defservlet*'.")
(defmacro defservlet* (endpoint mime args &rest body)
"Like `defservlet', but automatically bind variables/arguments
to the request. Trailing components of the ENDPOINT can be bound
by prefixing these components with a colon, acting like a template.
(defservlet* packages/:package/:version text/plain (verbose)
(insert (format \"%s\\n%s\\n\" package version))
(princ (get-description package version))
(when verbose
(insert (format \"%S\" (get-dependencies package version)))))
When accessed from this URL,
http://example.com/packages/foobar/1.0?verbose=1
the variables package, version, and verbose will be bound to the
associated components of the URL. Components not provided are
bound to nil. The query arguments can use the Common Lisp &key
form (variable default provided-p).
(defservlet* greeting/:name text/plain ((greeting \"hi\" greeting-p))
(princ (format \"%s, %s (provided: %s)\" greeting name greeting-p)))
The original path, query, and request can be accessed by the
anaphoric special variables `httpd-path', `httpd-query', and
`httpd-request'."
(declare (indent defun))
(let ((path-lexical (cl-gensym))
(query-lexical (cl-gensym))
(request-lexical (cl-gensym)))
(cl-multiple-value-bind (path vars) (httpd-parse-endpoint endpoint)
`(defservlet ,path ,mime (,path-lexical ,query-lexical ,request-lexical)
(let ((httpd-path ,path-lexical)
(httpd-query ,query-lexical)
(httpd-request ,request-lexical)
(httpd-split-path (split-string
(substring ,path-lexical 1) "/")))
(let ,(cl-loop for (var . pos) in vars
for extract =
`(httpd-unhex (nth ,pos httpd-split-path))
collect (list var extract))
(let ,(cl-loop for arg in args
for has-default = (listp arg)
for has-default-p = (and has-default
(= 3 (length arg)))
for arg-name = (symbol-name
(if has-default (cl-first arg) arg))
when has-default collect
(list (cl-first arg)
`(let ((value (assoc ,arg-name httpd-query)))
(if value
(cl-second value)
,(cl-second arg))))
else collect
(list arg `(cl-second
(assoc ,arg-name httpd-query)))
when has-default-p collect
(list (cl-third arg)
`(not (null (assoc ,arg-name httpd-query)))))
,@body)))))))
(font-lock-add-keywords
'emacs-lisp-mode
'(("(\\<\\(defservlet\\*?\\)\\> +\\([^ ()]+\\) +\\([^ ()]+\\)"
(1 'font-lock-keyword-face)
(2 'font-lock-function-name-face)
(3 'font-lock-type-face))))
(defmacro httpd-def-file-servlet (name root)
"Defines a servlet that serves files from ROOT under the route NAME.
(httpd-def-file-servlet my/www \"/var/www/\")
Automatically handles redirects and uses `httpd-serve-root' to
actually serve up files."
(let* ((short-root (directory-file-name (symbol-name name)))
(path-root (concat short-root "/"))
(chop (length path-root)))
`(defservlet ,name nil (uri-path query request)
(setf httpd--header-sent t) ; Don't actually use this temp buffer
(if (= (length uri-path) ,chop)
(httpd-redirect t ,path-root)
(let ((path (substring uri-path ,chop)))
(httpd-serve-root t ,root path request))))))
;; Request parsing
(defun httpd--normalize-header (header)
"Destructively capitalize the components of HEADER."
(mapconcat #'capitalize (split-string header "-") "-"))
(defun httpd-parse ()
"Parse HTTP header in current buffer into association list.
Leaves the point at the start of the request content. Returns nil
if it failed to parse a complete HTTP header."
(setf (point) (point-min))
(when (looking-at "\\([^ ]+\\) +\\([^ ]+\\) +\\([^\r]+\\)\r\n")
(let ((method (match-string 1))
(path (decode-coding-string (match-string 2) 'iso-8859-1))
(version (match-string 3))
(headers ()))
(setf (point) (match-end 0))
(while (looking-at "\\([-!#-'*+.0-9A-Z^_`a-z|~]+\\): *\\([^\r]+\\)\r\n")
(setf (point) (match-end 0))
(let ((name (match-string 1))
(value (match-string 2)))
(push (list (httpd--normalize-header name)
(decode-coding-string value 'iso-8859-1)) headers)))
(when (looking-at "\r\n")
(setf (point) (match-end 0))
(cons (list method path version) (nreverse headers))))))
(defun httpd-unhex (str)
"Fully decode the URL encoding in STR (including +'s)."
(when str
(let ((nonplussed (replace-regexp-in-string (regexp-quote "+") " " str)))
(decode-coding-string (url-unhex-string nonplussed t) 'utf-8))))
(defun httpd-parse-args (argstr)
"Parse a string containing URL encoded arguments."
(unless (zerop (length argstr))
(mapcar (lambda (str)
(mapcar 'httpd-unhex (split-string str "=")))
(split-string argstr "&"))))
(defun httpd-parse-uri (uri)
"Split a URI into its components.
The first element of the return value is the script path, the
second element is an alist of variable/value pairs, and the third
element is the fragment."
(let ((p1 (string-match (regexp-quote "?") uri))
(p2 (string-match (regexp-quote "#") uri))
retval)
(push (if p2 (httpd-unhex (substring uri (1+ p2)))) retval)
(push (if p1 (httpd-parse-args (substring uri (1+ p1) p2))) retval)
(push (substring uri 0 (or p1 p2)) retval)))
(defun httpd-escape-html-buffer ()
"Escape current buffer contents to be safe for inserting into HTML."
(setf (point) (point-min))
(while (search-forward-regexp "[<>&]" nil t)
(replace-match
(cl-case (aref (match-string 0) 0)
(?< "&lt;")
(?> "&gt;")
(?& "&amp;")))))
(defun httpd-escape-html (string)
"Escape STRING so that it's safe to insert into an HTML document."
(with-temp-buffer
(insert string)
(httpd-escape-html-buffer)
(buffer-string)))
;; Path handling
(defun httpd-status (path)
"Determine status code for PATH."
(cond
((not (file-exists-p path)) 404)
((not (file-readable-p path)) 403)
((and (file-directory-p path) (not httpd-listings)) 403)
(200)))
(defun httpd-clean-path (path)
"Clean dangerous .. from PATH and remove the leading slash."
(let* ((sep (if (member system-type '(windows-nt ms-dos)) "[/\\]" "/"))
(split (delete ".." (split-string path sep)))
(unsplit (mapconcat 'identity (delete "" split) "/")))
(concat "./" unsplit)))
(defun httpd-gen-path (path &optional root)
"Translate GET to secure path in ROOT (`httpd-root')."
(let ((clean (expand-file-name (httpd-clean-path path) (or root httpd-root))))
(if (file-directory-p clean)
(let* ((dir (file-name-as-directory clean))
(indexes (cl-mapcar (apply-partially 'concat dir) httpd-indexes))
(existing (cl-remove-if-not 'file-exists-p indexes)))
(or (car existing) dir))
clean)))
(defun httpd-get-servlet (uri-path)
"Determine the servlet to be executed for URI-PATH."
(if (not httpd-servlets)
'httpd/
(cl-labels ((cat (x)
(concat "httpd/" (mapconcat 'identity (reverse x) "/"))))
(let ((parts (cdr (split-string (directory-file-name uri-path) "/"))))
(or
(cl-find-if 'fboundp (mapcar 'intern-soft
(cl-maplist #'cat (reverse parts))))
'httpd/)))))
(defun httpd-serve-root (proc root uri-path &optional request)
"Securely serve a file from ROOT from under PATH."
(let* ((path (httpd-gen-path uri-path root))
(status (httpd-status path)))
(cond
((not (= status 200)) (httpd-error proc status))
((file-directory-p path) (httpd-send-directory proc path uri-path))
(t (httpd-send-file proc path request)))))
(defun httpd/ (proc uri-path query request)
"Default root servlet which serves files when httpd-serve-files is T."
(if (and httpd-serve-files httpd-root)
(httpd-serve-root proc httpd-root uri-path request)
(httpd-error proc 403)))
(defun httpd-get-mime (ext)
"Fetch MIME type given the file extention."
(or (and ext (cdr (assoc (downcase ext) httpd-mime-types)))
"application/octet-stream"))
;; Data sending functions
(defun httpd-send-header (proc mime status &rest header-keys)
"Send an HTTP header with given MIME type and STATUS, followed
by the current buffer. If PROC is T use the `httpd-current-proc'
as the process.
Extra headers can be sent by supplying them like keywords, i.e.
(httpd-send-header t \"text/plain\" 200 :X-Powered-By \"simple-httpd\")"
(let ((status-str (cdr (assq status httpd-status-codes)))
(headers `(("Server" . ,httpd-server-name)
("Date" . ,(httpd-date-string))
("Connection" . "keep-alive")
("Content-Type" . ,(httpd--stringify mime))
("Content-Length" . ,(httpd--buffer-size)))))
(unless httpd--header-sent
(setf httpd--header-sent t)
(with-temp-buffer
(insert (format "HTTP/1.1 %d %s\r\n" status status-str))
(cl-loop for (header value) on header-keys by #'cddr
for header-name = (substring (symbol-name header) 1)
for value-name = (format "%s" value)
collect (cons header-name value-name) into extras
finally (setf headers (nconc headers extras)))
(dolist (header headers)
(insert (format "%s: %s\r\n" (car header) (cdr header))))
(insert "\r\n")
(process-send-region (httpd-resolve-proc proc)
(point-min) (point-max)))
(process-send-region (httpd-resolve-proc proc)
(point-min) (point-max)))))
(defun httpd-redirect (proc path &optional code)
"Redirect the client to PATH (default 301). If PROC is T use
the `httpd-current-proc' as the process."
(httpd-log (list 'redirect path))
(httpd-discard-buffer)
(with-temp-buffer
(httpd-send-header proc "text/plain" (or code 301) :Location path)))
(defun httpd-send-file (proc path &optional req)
"Serve file to the given client. If PROC is T use the
`httpd-current-proc' as the process."
(httpd-discard-buffer)
(let ((req-etag (cadr (assoc "If-None-Match" req)))
(etag (httpd-etag path))
(mtime (httpd-date-string (nth 4 (file-attributes path)))))
(if (equal req-etag etag)
(with-temp-buffer
(httpd-log `(file ,path not-modified))
(httpd-send-header proc "text/plain" 304))
(httpd-log `(file ,path))
(with-temp-buffer
(set-buffer-multibyte nil)
(insert-file-contents-literally path)
(httpd-send-header proc (httpd-get-mime (file-name-extension path))
200 :Last-Modified mtime :ETag etag)))))
(defun httpd-send-directory (proc path uri-path)
"Serve a file listing to the client. If PROC is T use the
`httpd-current-proc' as the process."
(httpd-discard-buffer)
(let ((title (concat "Directory listing for "
(url-insert-entities-in-string uri-path))))
(if (equal "/" (substring uri-path -1))
(with-temp-buffer
(httpd-log `(directory ,path))
(insert "<!DOCTYPE html>\n")
(insert "<html>\n<head><title>" title "</title></head>\n")
(insert "<body>\n<h2>" title "</h2>\n<hr/>\n<ul>")
(dolist (file (directory-files path))
(unless (eq ?. (aref file 0))
(let* ((full (expand-file-name file path))
(tail (if (file-directory-p full) "/" ""))
(f (url-insert-entities-in-string file))
(l (url-hexify-string file)))
(insert (format "<li><a href=\"%s%s\">%s%s</a></li>\n"
l tail f tail)))))
(insert "</ul>\n<hr/>\n</body>\n</html>")
(httpd-send-header proc "text/html; charset=utf-8" 200))
(httpd-redirect proc (concat uri-path "/")))))
(defun httpd--buffer-size (&optional buffer)
"Get the buffer size in bytes."
(let ((orig enable-multibyte-characters)
(size 0))
(with-current-buffer (or buffer (current-buffer))
(set-buffer-multibyte nil)
(setf size (buffer-size))
(if orig (set-buffer-multibyte orig)))
size))
(defun httpd-error (proc status &optional info)
"Send an error page appropriate for STATUS to the client,
optionally inserting object INFO into page. If PROC is T use the
`httpd-current-proc' as the process."
(httpd-discard-buffer)
(httpd-log `(error ,status ,info))
(with-temp-buffer
(let ((html (or (cdr (assq status httpd-html)) ""))
(contents
(if (not info)
""
(with-temp-buffer
(let ((standard-output (current-buffer)))
(insert "error: ")
(princ info)
(insert "\n")
(when httpd-show-backtrace-when-error
(insert "backtrace: ")
(princ (backtrace))
(insert "\n"))
(httpd-escape-html-buffer)
(buffer-string))))))
(insert (format html contents)))
(httpd-send-header proc "text/html" status)))
(defun httpd--error-safe (&rest args)
"Call httpd-error and report failures to *httpd*."
(condition-case error-case
(apply #'httpd-error args)
(error (httpd-log `(hard-error ,error-case)))))
(provide 'simple-httpd)
;;; simple-httpd.el ends here

View File

@ -0,0 +1,18 @@
This is the file .../info/dir, which contains the
topmost node of the Info hierarchy, called (dir)Top.
The first time you invoke Info you start off looking at this node.

File: dir, Node: Top This is the top of the INFO tree
This (the Directory node) gives a menu of major topics.
Typing "q" exits, "H" lists all Info commands, "d" returns here,
"h" gives a primer for first-timers,
"mEmacs<Return>" visits the Emacs manual, etc.
In Emacs, you can click mouse button 2 on a menu item or cross reference
to select it.
* Menu:
Emacs
* use-package: (use-package). Declarative package configuration for Emacs.

View File

@ -0,0 +1,232 @@
;;; use-package-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "use-package-bind-key" "use-package-bind-key.el"
;;;;;; (0 0 0 0))
;;; Generated autoloads from use-package-bind-key.el
(autoload 'use-package-autoload-keymap "use-package-bind-key" "\
Loads PACKAGE and then binds the key sequence used to invoke
this function to KEYMAP-SYMBOL. It then simulates pressing the
same key sequence a again, so that the next key pressed is routed
to the newly loaded keymap.
This function supports use-package's :bind-keymap keyword. It
works by binding the given key sequence to an invocation of this
function for a particular keymap. The keymap is expected to be
defined by the package. In this way, loading the package is
deferred until the prefix key sequence is pressed.
\(fn KEYMAP-SYMBOL PACKAGE OVERRIDE)" nil nil)
(autoload 'use-package-normalize-binder "use-package-bind-key" "\
\(fn NAME KEYWORD ARGS)" nil nil)
(defalias 'use-package-normalize/:bind 'use-package-normalize-binder)
(defalias 'use-package-normalize/:bind* 'use-package-normalize-binder)
(defalias 'use-package-autoloads/:bind 'use-package-autoloads-mode)
(defalias 'use-package-autoloads/:bind* 'use-package-autoloads-mode)
(autoload 'use-package-handler/:bind "use-package-bind-key" "\
\(fn NAME KEYWORD ARGS REST STATE &optional BIND-MACRO)" nil nil)
(defalias 'use-package-normalize/:bind-keymap 'use-package-normalize-binder)
(defalias 'use-package-normalize/:bind-keymap* 'use-package-normalize-binder)
(autoload 'use-package-handler/:bind-keymap "use-package-bind-key" "\
\(fn NAME KEYWORD ARGS REST STATE &optional OVERRIDE)" nil nil)
(autoload 'use-package-handler/:bind-keymap* "use-package-bind-key" "\
\(fn NAME KEYWORD ARG REST STATE)" nil nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-bind-key" '("use-package-handler/:bind*")))
;;;***
;;;### (autoloads nil "use-package-core" "use-package-core.el" (0
;;;;;; 0 0 0))
;;; Generated autoloads from use-package-core.el
(autoload 'use-package "use-package-core" "\
Declare an Emacs package by specifying a group of configuration options.
For full documentation, please see the README file that came with
this file. Usage:
(use-package package-name
[:keyword [option]]...)
:init Code to run before PACKAGE-NAME has been loaded.
:config Code to run after PACKAGE-NAME has been loaded. Note that
if loading is deferred for any reason, this code does not
execute until the lazy load has occurred.
:preface Code to be run before everything except `:disabled'; this
can be used to define functions for use in `:if', or that
should be seen by the byte-compiler.
:mode Form to be added to `auto-mode-alist'.
:magic Form to be added to `magic-mode-alist'.
:magic-fallback Form to be added to `magic-fallback-mode-alist'.
:interpreter Form to be added to `interpreter-mode-alist'.
:commands Define autoloads for commands that will be defined by the
package. This is useful if the package is being lazily
loaded, and you wish to conditionally call functions in your
`:init' block that are defined in the package.
:hook Specify hook(s) to attach this package to.
:bind Bind keys, and define autoloads for the bound commands.
:bind* Bind keys, and define autoloads for the bound commands,
*overriding all minor mode bindings*.
:bind-keymap Bind a key prefix to an auto-loaded keymap defined in the
package. This is like `:bind', but for keymaps.
:bind-keymap* Like `:bind-keymap', but overrides all minor mode bindings
:defer Defer loading of a package -- this is implied when using
`:commands', `:bind', `:bind*', `:mode', `:magic', `:hook',
`:magic-fallback', or `:interpreter'. This can be an integer,
to force loading after N seconds of idle time, if the package
has not already been loaded.
:after Delay the use-package declaration until after the named modules
have loaded. Once load, it will be as though the use-package
declaration (without `:after') had been seen at that moment.
:demand Prevent the automatic deferred loading introduced by constructs
such as `:bind' (see `:defer' for the complete list).
:if EXPR Initialize and load only if EXPR evaluates to a non-nil value.
:disabled The package is ignored completely if this keyword is present.
:defines Declare certain variables to silence the byte-compiler.
:functions Declare certain functions to silence the byte-compiler.
:load-path Add to the `load-path' before attempting to load the package.
:diminish Support for diminish.el (if installed).
:delight Support for delight.el (if installed).
:custom Call `custom-set' or `set-default' with each variable
definition without modifying the Emacs `custom-file'.
(compare with `custom-set-variables').
:custom-face Call `customize-set-faces' with each face definition.
:ensure Loads the package using package.el if necessary.
:pin Pin the package to an archive.
\(fn NAME &rest ARGS)" nil t)
(function-put 'use-package 'lisp-indent-function '1)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-core" '("use-package-")))
;;;***
;;;### (autoloads nil "use-package-delight" "use-package-delight.el"
;;;;;; (0 0 0 0))
;;; Generated autoloads from use-package-delight.el
(autoload 'use-package-normalize/:delight "use-package-delight" "\
Normalize arguments to delight.
\(fn NAME KEYWORD ARGS)" nil nil)
(autoload 'use-package-handler/:delight "use-package-delight" "\
\(fn NAME KEYWORD ARGS REST STATE)" nil nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-delight" '("use-package-normalize-delight")))
;;;***
;;;### (autoloads nil "use-package-diminish" "use-package-diminish.el"
;;;;;; (0 0 0 0))
;;; Generated autoloads from use-package-diminish.el
(autoload 'use-package-normalize/:diminish "use-package-diminish" "\
\(fn NAME KEYWORD ARGS)" nil nil)
(autoload 'use-package-handler/:diminish "use-package-diminish" "\
\(fn NAME KEYWORD ARG REST STATE)" nil nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-diminish" '("use-package-normalize-diminish")))
;;;***
;;;### (autoloads nil "use-package-ensure" "use-package-ensure.el"
;;;;;; (0 0 0 0))
;;; Generated autoloads from use-package-ensure.el
(autoload 'use-package-normalize/:ensure "use-package-ensure" "\
\(fn NAME KEYWORD ARGS)" nil nil)
(autoload 'use-package-handler/:ensure "use-package-ensure" "\
\(fn NAME KEYWORD ENSURE REST STATE)" nil nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-ensure" '("use-package-")))
;;;***
;;;### (autoloads nil "use-package-jump" "use-package-jump.el" (0
;;;;;; 0 0 0))
;;; Generated autoloads from use-package-jump.el
(autoload 'use-package-jump-to-package-form "use-package-jump" "\
Attempt to find and jump to the `use-package' form that loaded
PACKAGE. This will only find the form if that form actually
required PACKAGE. If PACKAGE was previously required then this
function will jump to the file that originally required PACKAGE
instead.
\(fn PACKAGE)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-jump" '("use-package-find-require")))
;;;***
;;;### (autoloads nil "use-package-lint" "use-package-lint.el" (0
;;;;;; 0 0 0))
;;; Generated autoloads from use-package-lint.el
(autoload 'use-package-lint "use-package-lint" "\
Check for errors in use-package declarations.
For example, if the module's `:if' condition is met, but even
with the specified `:load-path' the module cannot be found.
\(fn)" t nil)
(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "use-package-lint" '("use-package-lint-declaration")))
;;;***
;;;### (autoloads nil nil ("use-package-pkg.el" "use-package.el")
;;;;;; (0 0 0 0))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; use-package-autoloads.el ends here

View File

@ -0,0 +1,172 @@
;;; use-package-bind-key.el --- Support for the :bind/:bind-keymap keywords -*- lexical-binding: t; -*-
;; Copyright (C) 2012-2017 John Wiegley
;; Author: John Wiegley <johnw@newartisans.com>
;; Maintainer: John Wiegley <johnw@newartisans.com>
;; Created: 17 Jun 2012
;; Modified: 4 Dec 2017
;; Version: 1.0
;; Package-Requires: ((emacs "24.3") (use-package "2.4") (bind-key "2.4"))
;; Keywords: dotemacs startup speed config package
;; URL: https://github.com/jwiegley/use-package
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 3, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; Provides support for the :bind, :bind*, :bind-keymap and :bind-keymap*
;; keywords. Note that these are currently still baked into
;; `use-package-keywords' and `use-package-deferring-keywords', although this
;; is harmless if they are never used.
;;; Code:
(require 'use-package-core)
(require 'bind-key)
;;;###autoload
(defun use-package-autoload-keymap (keymap-symbol package override)
"Loads PACKAGE and then binds the key sequence used to invoke
this function to KEYMAP-SYMBOL. It then simulates pressing the
same key sequence a again, so that the next key pressed is routed
to the newly loaded keymap.
This function supports use-package's :bind-keymap keyword. It
works by binding the given key sequence to an invocation of this
function for a particular keymap. The keymap is expected to be
defined by the package. In this way, loading the package is
deferred until the prefix key sequence is pressed."
(if (not (require package nil t))
(use-package-error (format "Cannot load package.el: %s" package))
(if (and (boundp keymap-symbol)
(keymapp (symbol-value keymap-symbol)))
(let* ((kv (this-command-keys-vector))
(key (key-description kv))
(keymap (symbol-value keymap-symbol)))
(if override
(bind-key* key keymap)
(bind-key key keymap))
(setq unread-command-events
(mapcar (lambda (ev) (cons t ev))
(listify-key-sequence kv))))
(use-package-error
(format "package.el %s failed to define keymap %s"
package keymap-symbol)))))
;;;###autoload
(defun use-package-normalize-binder (name keyword args)
(let ((arg args)
args*)
(while arg
(let ((x (car arg)))
(cond
;; (KEY . COMMAND)
((and (consp x)
(or (stringp (car x))
(vectorp (car x)))
(or (use-package-recognize-function (cdr x) t #'stringp)))
(setq args* (nconc args* (list x)))
(setq arg (cdr arg)))
;; KEYWORD
;; :map KEYMAP
;; :prefix-docstring STRING
;; :prefix-map SYMBOL
;; :prefix STRING
;; :filter SEXP
;; :menu-name STRING
;; :package SYMBOL
((or (and (eq x :map) (symbolp (cadr arg)))
(and (eq x :prefix) (stringp (cadr arg)))
(and (eq x :prefix-map) (symbolp (cadr arg)))
(and (eq x :prefix-docstring) (stringp (cadr arg)))
(eq x :filter)
(and (eq x :menu-name) (stringp (cadr arg)))
(and (eq x :package) (symbolp (cadr arg))))
(setq args* (nconc args* (list x (cadr arg))))
(setq arg (cddr arg)))
((listp x)
(setq args*
(nconc args* (use-package-normalize-binder name keyword x)))
(setq arg (cdr arg)))
(t
;; Error!
(use-package-error
(concat (symbol-name name)
" wants arguments acceptable to the `bind-keys' macro,"
" or a list of such values"))))))
args*))
;;;; :bind, :bind*
;;;###autoload
(defalias 'use-package-normalize/:bind 'use-package-normalize-binder)
;;;###autoload
(defalias 'use-package-normalize/:bind* 'use-package-normalize-binder)
;; jww (2017-12-07): This is too simplistic. It will fail to determine
;; autoloads in this situation:
;; (use-package foo
;; :bind (:map foo-map (("C-a" . func))))
;;;###autoload
(defalias 'use-package-autoloads/:bind 'use-package-autoloads-mode)
;;;###autoload
(defalias 'use-package-autoloads/:bind* 'use-package-autoloads-mode)
;;;###autoload
(defun use-package-handler/:bind
(name _keyword args rest state &optional bind-macro)
(use-package-concat
(use-package-process-keywords name rest state)
`(,@(mapcar
#'(lambda (xs)
`(,(if bind-macro bind-macro 'bind-keys)
:package ,name ,@(use-package-normalize-commands xs)))
(use-package-split-list-at-keys :break args)))))
(defun use-package-handler/:bind* (name keyword arg rest state)
(use-package-handler/:bind name keyword arg rest state 'bind-keys*))
;;;; :bind-keymap, :bind-keymap*
;;;###autoload
(defalias 'use-package-normalize/:bind-keymap 'use-package-normalize-binder)
;;;###autoload
(defalias 'use-package-normalize/:bind-keymap* 'use-package-normalize-binder)
;;;###autoload
(defun use-package-handler/:bind-keymap
(name _keyword args rest state &optional override)
(use-package-concat
(use-package-process-keywords name rest state)
(mapcar
#'(lambda (binding)
`(,(if override 'bind-key* 'bind-key)
,(car binding)
#'(lambda ()
(interactive)
(use-package-autoload-keymap
',(cdr binding) ',(use-package-as-symbol name)
,override))))
args)))
;;;###autoload
(defun use-package-handler/:bind-keymap* (name keyword arg rest state)
(use-package-handler/:bind-keymap name keyword arg rest state t))
(provide 'use-package-bind-key)
;;; use-package-bind-key.el ends here

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,91 @@
;;; use-package-delight.el --- Support for the :delight keyword -*- lexical-binding: t; -*-
;; Copyright (C) 2012-2017 John Wiegley
;; Author: John Wiegley <johnw@newartisans.com>
;; Maintainer: John Wiegley <johnw@newartisans.com>
;; Created: 17 Jun 2012
;; Modified: 3 Dec 2017
;; Version: 1.0
;; Package-Requires: ((emacs "24.3") (use-package "2.4"))
;; Keywords: dotemacs startup speed config package
;; URL: https://github.com/jwiegley/use-package
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 3, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; Provides support for the :delight keyword, which is made available by
;; default by requiring `use-package'.
;;; Code:
(require 'use-package-core)
(defun use-package-normalize-delight (name args)
"Normalize ARGS for a single call to `delight'."
(when (eq :eval (car args))
;; Handle likely common mistake.
(use-package-error ":delight mode line constructs must be quoted"))
(cond ((and (= (length args) 1)
(use-package-non-nil-symbolp (car args)))
`(,(nth 0 args) nil ,name))
((= (length args) 2)
`(,(nth 0 args) ,(nth 1 args) ,name))
((= (length args) 3)
args)
(t
(use-package-error
":delight expects `delight' arguments or a list of them"))))
;;;###autoload
(defun use-package-normalize/:delight (name _keyword args)
"Normalize arguments to delight."
(cond ((null args)
`((,(use-package-as-mode name) nil ,name)))
((and (= (length args) 1)
(use-package-non-nil-symbolp (car args)))
`((,(car args) nil ,name)))
((and (= (length args) 1)
(stringp (car args)))
`((,(use-package-as-mode name) ,(car args) ,name)))
((and (= (length args) 1)
(listp (car args))
(eq 'quote (caar args)))
`((,(use-package-as-mode name) ,@(cdar args) ,name)))
((and (= (length args) 2)
(listp (nth 1 args))
(eq 'quote (car (nth 1 args))))
`((,(car args) ,@(cdr (nth 1 args)) ,name)))
(t (mapcar
(apply-partially #'use-package-normalize-delight name)
(if (use-package-non-nil-symbolp (car args))
(list args)
args)))))
;;;###autoload
(defun use-package-handler/:delight (name _keyword args rest state)
(let ((body (use-package-process-keywords name rest state)))
(use-package-concat
body
`((if (fboundp 'delight)
(delight '(,@args)))))))
(add-to-list 'use-package-keywords :delight t)
(provide 'use-package-delight)
;;; use-package-delight.el ends here

View File

@ -0,0 +1,80 @@
;;; use-package-diminish.el --- Support for the :diminish keyword -*- lexical-binding: t; -*-
;; Copyright (C) 2012-2017 John Wiegley
;; Author: John Wiegley <johnw@newartisans.com>
;; Maintainer: John Wiegley <johnw@newartisans.com>
;; Created: 17 Jun 2012
;; Modified: 3 Dec 2017
;; Version: 1.0
;; Package-Requires: ((emacs "24.3") (use-package "2.4"))
;; Keywords: dotemacs startup speed config package
;; URL: https://github.com/jwiegley/use-package
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 3, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; Provides support for the :diminish keyword, which is made available by
;; default by requiring `use-package'.
;;; Code:
(require 'use-package-core)
(defun use-package-normalize-diminish (name label arg &optional recursed)
"Normalize the arguments to diminish down to a list of one of two forms:
SYMBOL
(SYMBOL . STRING)"
(cond
((not arg)
(list (use-package-as-mode name)))
((use-package-non-nil-symbolp arg)
(list arg))
((stringp arg)
(list (cons (use-package-as-mode name) arg)))
((and (consp arg) (stringp (cdr arg)))
(list arg))
((and (not recursed) (listp arg) (listp (cdr arg)))
(mapcar #'(lambda (x) (car (use-package-normalize-diminish
name label x t))) arg))
(t
(use-package-error
(concat label " wants a string, symbol, "
"(symbol . string) or list of these")))))
;;;###autoload
(defun use-package-normalize/:diminish (name keyword args)
(use-package-as-one (symbol-name keyword) args
(apply-partially #'use-package-normalize-diminish name) t))
;;;###autoload
(defun use-package-handler/:diminish (name _keyword arg rest state)
(let ((body (use-package-process-keywords name rest state)))
(use-package-concat
(mapcar #'(lambda (var)
`(if (fboundp 'diminish)
,(if (consp var)
`(diminish ',(car var) ,(cdr var))
`(diminish ',var))))
arg)
body)))
(add-to-list 'use-package-keywords :diminish t)
(provide 'use-package-diminish)
;;; use-package-diminish.el ends here

View File

@ -0,0 +1,214 @@
;;; use-package-ensure.el --- Support for the :ensure and :pin keywords -*- lexical-binding: t; -*-
;; Copyright (C) 2012-2017 John Wiegley
;; Author: John Wiegley <johnw@newartisans.com>
;; Maintainer: John Wiegley <johnw@newartisans.com>
;; Created: 17 Jun 2012
;; Modified: 3 Dec 2017
;; Version: 1.0
;; Package-Requires: ((emacs "24.3") (use-package "2.4"))
;; Keywords: dotemacs startup speed config package
;; URL: https://github.com/jwiegley/use-package
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 3, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; Provides support for the :ensure and :pin keywords, which is made available
;; by default by requiring `use-package'.
;;; Code:
(require 'cl-lib)
(require 'use-package-core)
(defgroup use-package-ensure nil
"Support for :ensure and :pin keywords in use-package declarations."
:group 'use-package)
(eval-when-compile
(declare-function package-installed-p "package")
(declare-function package-read-all-archive-contents "package" ()))
(defcustom use-package-always-ensure nil
"Treat every package as though it had specified using `:ensure SEXP'.
See also `use-package-defaults', which uses this value."
:type 'sexp
:group 'use-package-ensure)
(defcustom use-package-always-pin nil
"Treat every package as though it had specified using `:pin SYM'.
See also `use-package-defaults', which uses this value."
:type 'symbol
:group 'use-package-ensure)
(defcustom use-package-ensure-function 'use-package-ensure-elpa
"Function that ensures a package is installed.
This function is called with three arguments: the name of the
package declared in the `use-package' form; the arguments passed
to all `:ensure' keywords (always a list, even if only one); and
the current `state' plist created by previous handlers.
Note that this function is called whenever `:ensure' is provided,
even if it is nil. It is up to the function to decide on the
semantics of the various values for `:ensure'.
This function should return non-nil if the package is installed.
The default value uses package.el to install the package."
:type '(choice (const :tag "package.el" use-package-ensure-elpa)
(function :tag "Custom"))
:group 'use-package-ensure)
;;;; :pin
(defun use-package-normalize/:pin (_name keyword args)
(use-package-only-one (symbol-name keyword) args
#'(lambda (_label arg)
(cond
((stringp arg) arg)
((use-package-non-nil-symbolp arg) (symbol-name arg))
(t
(use-package-error
":pin wants an archive name (a string)"))))))
(eval-when-compile
(defvar package-pinned-packages)
(defvar package-archives))
(defun use-package-archive-exists-p (archive)
"Check if a given ARCHIVE is enabled.
ARCHIVE can be a string or a symbol or 'manual to indicate a
manually updated package."
(if (member archive '(manual "manual"))
't
(let ((valid nil))
(dolist (pa package-archives)
(when (member archive (list (car pa) (intern (car pa))))
(setq valid 't)))
valid)))
(defun use-package-pin-package (package archive)
"Pin PACKAGE to ARCHIVE."
(unless (boundp 'package-pinned-packages)
(setq package-pinned-packages ()))
(let ((archive-symbol (if (symbolp archive) archive (intern archive)))
(archive-name (if (stringp archive) archive (symbol-name archive))))
(if (use-package-archive-exists-p archive-symbol)
(add-to-list 'package-pinned-packages (cons package archive-name))
(error "Archive '%s' requested for package '%s' is not available."
archive-name package))
(unless (bound-and-true-p package--initialized)
(package-initialize t))))
(defun use-package-handler/:pin (name _keyword archive-name rest state)
(let ((body (use-package-process-keywords name rest state))
(pin-form (if archive-name
`(use-package-pin-package ',(use-package-as-symbol name)
,archive-name))))
;; Pinning should occur just before ensuring
;; See `use-package-handler/:ensure'.
(if (bound-and-true-p byte-compile-current-file)
(eval pin-form) ; Eval when byte-compiling,
(push pin-form body)) ; or else wait until runtime.
body))
;;;; :ensure
(defvar package-archive-contents)
;;;###autoload
(defun use-package-normalize/:ensure (_name keyword args)
(if (null args)
(list t)
(use-package-only-one (symbol-name keyword) args
#'(lambda (_label arg)
(cond
((symbolp arg)
(list arg))
((and (listp arg) (= 3 (length arg))
(symbolp (nth 0 arg))
(eq :pin (nth 1 arg))
(or (stringp (nth 2 arg))
(symbolp (nth 2 arg))))
(list (cons (nth 0 arg) (nth 2 arg))))
(t
(use-package-error
(concat ":ensure wants an optional package name "
"(an unquoted symbol name), or (<symbol> :pin <string>)"))))))))
(defun use-package-ensure-elpa (name args _state &optional _no-refresh)
(dolist (ensure args)
(let ((package
(or (and (eq ensure t) (use-package-as-symbol name))
ensure)))
(when package
(require 'package)
(when (consp package)
(use-package-pin-package (car package) (cdr package))
(setq package (car package)))
(unless (package-installed-p package)
(condition-case-unless-debug err
(progn
(when (assoc package (bound-and-true-p
package-pinned-packages))
(package-read-all-archive-contents))
(if (assoc package package-archive-contents)
(package-install package)
(package-refresh-contents)
(when (assoc package (bound-and-true-p
package-pinned-packages))
(package-read-all-archive-contents))
(package-install package))
t)
(error
(display-warning 'use-package
(format "Failed to install %s: %s"
name (error-message-string err))
:error))))))))
;;;###autoload
(defun use-package-handler/:ensure (name _keyword ensure rest state)
(let* ((body (use-package-process-keywords name rest state)))
;; We want to avoid installing packages when the `use-package' macro is
;; being macro-expanded by elisp completion (see `lisp--local-variables'),
;; but still install packages when byte-compiling, to avoid requiring
;; `package' at runtime.
(if (bound-and-true-p byte-compile-current-file)
;; Eval when byte-compiling,
(funcall use-package-ensure-function name ensure state)
;; or else wait until runtime.
(push `(,use-package-ensure-function ',name ',ensure ',state)
body))
body))
(add-to-list 'use-package-defaults
'(:ensure (list use-package-always-ensure)
(lambda (name args)
(and use-package-always-ensure
(not (plist-member args :load-path))))) t)
(add-to-list 'use-package-defaults
'(:pin use-package-always-pin use-package-always-pin) t)
(add-to-list 'use-package-keywords :ensure)
(add-to-list 'use-package-keywords :pin)
(provide 'use-package-ensure)
;;; use-package-ensure.el ends here

View File

@ -0,0 +1,79 @@
;;; use-package-jump.el --- Attempt to jump to a use-package declaration -*- lexical-binding: t; -*-
;; Copyright (C) 2012-2017 John Wiegley
;; Author: John Wiegley <johnw@newartisans.com>
;; Maintainer: John Wiegley <johnw@newartisans.com>
;; Created: 17 Jun 2012
;; Modified: 3 Dec 2017
;; Version: 1.0
;; Package-Requires: ((emacs "24.3") (use-package "2.4"))
;; Keywords: dotemacs startup speed config package
;; URL: https://github.com/jwiegley/use-package
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 3, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; Provides the command `M-x use-package-jump-to-package-form', however it
;; only works if the package being jumped to was required during
;; initialization. If it was delay-loaded, it will not work. Improvements are
;; needed.
;;; Code:
(require 'use-package-core)
(defun use-package-find-require (package)
"Find file that required PACKAGE by searching `load-history'.
Returns an absolute file path or nil if none is found."
(catch 'suspect
(dolist (filespec load-history)
(dolist (entry (cdr filespec))
(when (equal entry (cons 'require package))
(throw 'suspect (car filespec)))))))
;;;###autoload
(defun use-package-jump-to-package-form (package)
"Attempt to find and jump to the `use-package' form that loaded
PACKAGE. This will only find the form if that form actually
required PACKAGE. If PACKAGE was previously required then this
function will jump to the file that originally required PACKAGE
instead."
(interactive (list (completing-read "Package: " features)))
(let* ((package (if (stringp package) (intern package) package))
(requiring-file (use-package-find-require package))
file location)
(if (null requiring-file)
(user-error "Can't find file requiring file; may have been autoloaded")
(setq file (if (string= (file-name-extension requiring-file) "elc")
(concat (file-name-sans-extension requiring-file) ".el")
requiring-file))
(when (file-exists-p file)
(find-file-other-window file)
(save-excursion
(goto-char (point-min))
(setq location
(re-search-forward
(format (eval use-package-form-regexp-eval) package) nil t)))
(if (null location)
(message "No use-package form found.")
(goto-char location)
(beginning-of-line))))))
(provide 'use-package-jump)
;;; use-package-jump.el ends here

View File

@ -0,0 +1,84 @@
;;; use-package-lint.el --- Attempt to find errors in use-package declarations -*- lexical-binding: t; -*-
;; Copyright (C) 2012-2017 John Wiegley
;; Author: John Wiegley <johnw@newartisans.com>
;; Maintainer: John Wiegley <johnw@newartisans.com>
;; Created: 17 Jun 2012
;; Modified: 3 Dec 2017
;; Version: 1.0
;; Package-Requires: ((emacs "24.3") (use-package "2.4"))
;; Keywords: dotemacs startup speed config package
;; URL: https://github.com/jwiegley/use-package
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 3, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; Provides the command `M-x use-package-lint'.
;;; Code:
(require 'cl-lib)
(require 'use-package-core)
(defun use-package-lint-declaration (name plist)
(dolist (path (plist-get plist :load-path))
(unless (file-exists-p path)
(display-warning
'use-package
(format "%s :load-path does not exist: %s"
name path) :error)))
(unless (or (plist-member plist :disabled)
(plist-get plist :no-require)
(locate-library (use-package-as-string name) nil
(plist-get plist :load-path)))
(display-warning
'use-package
(format "%s module cannot be located" name) :error))
;; (dolist (command (plist-get plist :commands))
;; (unless (string= (find-lisp-object-file-name command nil)
;; (locate-library (use-package-as-string name) nil
;; (plist-get plist :load-path)))
;; (display-warning
;; 'use-package
;; (format "%s :command is from different path: %s"
;; name (symbol-name command)) :error)))
)
;;;###autoload
(defun use-package-lint ()
"Check for errors in use-package declarations.
For example, if the module's `:if' condition is met, but even
with the specified `:load-path' the module cannot be found."
(interactive)
(save-excursion
(goto-char (point-min))
(let ((re (eval use-package-form-regexp-eval)))
(while (re-search-forward re nil t)
(goto-char (match-beginning 0))
(let ((decl (read (current-buffer))))
(when (eq (car decl) 'use-package)
(use-package-lint-declaration
(use-package-as-string (cadr decl))
(use-package-normalize-keywords
(cadr decl) (cddr decl)))))))))
(provide 'use-package-lint)
;;; use-package-lint.el ends here

View File

@ -0,0 +1,13 @@
(define-package "use-package" "20200721.2156" "A configuration macro for simplifying your .emacs"
'((emacs "24.3")
(bind-key "2.4"))
:commit "4fb1f9a68f1e7e7d614652afc017a6652fd029f1" :keywords
'("dotemacs" "startup" "speed" "config" "package")
:authors
'(("John Wiegley" . "johnw@newartisans.com"))
:maintainer
'("John Wiegley" . "johnw@newartisans.com")
:url "https://github.com/jwiegley/use-package")
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@ -0,0 +1,54 @@
;;; use-package.el --- A configuration macro for simplifying your .emacs -*- lexical-binding: t; -*-
;; Copyright (C) 2012-2017 John Wiegley
;; Author: John Wiegley <johnw@newartisans.com>
;; Maintainer: John Wiegley <johnw@newartisans.com>
;; Created: 17 Jun 2012
;; Modified: 29 Nov 2017
;; Version: 2.4
;; Package-Requires: ((emacs "24.3") (bind-key "2.4"))
;; Keywords: dotemacs startup speed config package
;; URL: https://github.com/jwiegley/use-package
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 3, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; The `use-package' declaration macro allows you to isolate package
;; configuration in your ".emacs" in a way that is performance-oriented and,
;; well, just tidy. I created it because I have over 80 packages that I use
;; in Emacs, and things were getting difficult to manage. Yet with this
;; utility my total load time is just under 1 second, with no loss of
;; functionality!
;;
;; Please see README.md from the same repository for documentation.
;;; Code:
(require 'use-package-core)
(require 'use-package-bind-key)
(require 'use-package-diminish)
(require 'use-package-delight)
(require 'use-package-ensure)
(declare-function use-package-jump-to-package-form "use-package-jump")
(autoload #'use-package-jump-to-package-form "use-package-jump" nil t)
(provide 'use-package)
;;; use-package.el ends here

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
;;; vscode-dark-plus-theme-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name
(or (file-name-directory #$) (car load-path))))
;;;### (autoloads nil "vscode-dark-plus-theme" "vscode-dark-plus-theme.el"
;;;;;; (0 0 0 0))
;;; Generated autoloads from vscode-dark-plus-theme.el
(when (and (boundp 'custom-theme-load-path) load-file-name) (add-to-list 'custom-theme-load-path (file-name-as-directory (file-name-directory load-file-name))))
;;;***
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; vscode-dark-plus-theme-autoloads.el ends here

View File

@ -0,0 +1,2 @@
;;; -*- no-byte-compile: t -*-
(define-package "vscode-dark-plus-theme" "20200818.341" "Default Visual Studio Code Dark+ theme" 'nil :commit "a33ef7fd5d9249bbb59fcb822c032e28bb3bf792" :authors '(("Ian Y.E. Pan")) :maintainer '("Ian Y.E. Pan") :url "https://github.com/ianpan870102/vscode-dark-plus-emacs-theme")

View File

@ -0,0 +1,516 @@
;;; vscode-dark-plus-theme.el --- Default Visual Studio Code Dark+ theme -*- lexical-binding: t; -*-
;; Copyright (C) 2020 Ian Y.E. Pan
;; Author: Ian Y.E. Pan
;; URL: https://github.com/ianpan870102/vscode-dark-plus-emacs-theme
;; Package-Version: 20200818.341
;; Package-Commit: a33ef7fd5d9249bbb59fcb822c032e28bb3bf792
;; Version: 1.5.0
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;; This file is not part of Emacs.
;;; Commentary:
;; A complete port of the default Visual Studio Dark+ theme.
;; Official colors from Microsoft's Visual Studio Code:
;; "#DCDCAA"
;; "#4EC9B0"
;; "#C586C0"
;; "#9CDCFE"
;; "#51B6C4",
;; "#CE9178"
;; "#d16969"
;; "#d7ba7d"
;; "#569cd6"
;; "#C8C8C8"
;; "#d4d4d4"
;; "#b5cea8"
;; "#f44747"
;; "#6A9955"
;;; Code:
(deftheme vscode-dark-plus)
(let ((class '((class color) (min-colors 89)))
(fg0 "#aeafad")
(fg1 "#d4d4d4") ; default fg
(fg2 "#e8e8e8")
(fg3 "#f4f4f4")
(fg4 "#fafafa")
(bg0 "#111111")
(bg1 "#1e1e1e") ; default bg
(bg2 "#252526")
(bg3 "#313131")
(bg4 "#4b474c")
(bg-hl "#264f78")
(vc-r "#a41511")
(vc-g "#4a7f00")
(vc-b "#207fa1")
(key2 "#ce9178")
(key3 "#9cdcfe")
(accent "#ffffff")
(numeric "#b5cea8")
(mode-line-bg "#007acc")
(mode-line-bg-dark "#005aa3")
(line-num "#838383")
(builtin "#c586c0")
(keyword "#569cd6")
(const "#4ec9b0")
(comment "#6a9955")
(doc "#ce9178")
(doc-alt "#888888")
(func "#dcdcaa")
(str "#ce9178")
(type "#4ec9b0")
(var "#9cdcfe")
(warning "#f16969")
;; standardized palette
(ms-yellow "#dcdcaa")
(ms-bluegreen "#4ec9b0")
(ms-magenta "#c586c0")
(ms-lightblue "#9cdcfe")
(ms-orange "#ce9178")
(ms-lightorange "#d7ba7d")
(ms-red "#d16969")
(ms-green "#6a9955")
(ms-blue "#569cd6")
(ms-lightred "#f19999")
(ms-lightgreen "#b5cea8")
;; (ms-lightblue "#9cdcfe")
(ms-red-bg "#551b1e")
(ms-blue-bg "#040e3f")
(ms-green-bg "#39422a")
(ms-red-bghl "#74140f")
(ms-blue-bghl "#141e4f")
(ms-green-bghl "#4b5332"))
(custom-theme-set-faces
'vscode-dark-plus
`(default ((,class (:background ,bg1 :foreground ,fg1))))
`(font-lock-builtin-face ((,class (:foreground ,builtin))))
`(font-lock-comment-face ((,class (:foreground ,comment))))
`(font-lock-negation-char-face ((,class (:foreground ,const))))
`(font-lock-reference-face ((,class (:foreground ,const))))
`(font-lock-constant-face ((,class (:foreground ,const))))
`(font-lock-doc-face ((,class (:foreground ,doc))))
`(font-lock-function-name-face ((,class (:foreground ,func :bold nil))))
`(font-lock-keyword-face ((,class (:bold nil :foreground ,keyword))))
`(font-lock-string-face ((,class (:foreground ,str))))
`(font-lock-type-face ((,class (:foreground ,type ))))
`(font-lock-variable-name-face ((,class (:foreground ,var))))
`(font-lock-warning-face ((,class (:foreground ,warning :background ,bg2))))
`(font-lock-regexp-grouping-backslash ((,class (:foreground ,ms-lightorange))))
`(font-lock-regexp-grouping-construct ((,class (:foreground ,ms-lightorange))))
`(region ((,class (:background ,bg-hl :extend nil))))
`(highlight ((,class (:foreground ,fg3 :background ,bg3))))
`(hl-line ((,class (:background ,bg3))))
`(fringe ((,class (:background ,bg1 :foreground ,fg4))))
`(cursor ((,class (:background ,fg1))))
`(show-paren-match-face ((,class (:background ,warning))))
`(show-paren-match ((t (:foreground ,fg3 :background ,bg4 :bold t))))
`(show-paren-mismatch ((t (:background ,warning))))
`(isearch ((,class (:bold nil :foreground ,accent :background ,bg4))))
`(vertical-border ((,class (:foreground ,bg3))))
`(minibuffer-prompt ((,class (:foreground ,ms-bluegreen :weight normal))))
`(default-italic ((,class (:italic t))))
`(link ((,class (:foreground ,ms-blue :underline t))))
`(error ((,class (:foreground ,ms-orange))))
`(warning ((,class (:foreground ,ms-magenta))))
`(success ((,class (:foreground ,ms-bluegreen))))
`(dired-directory ((t (:inherit (font-lock-keyword-face)))))
`(line-number ((,class (:foreground ,line-num :background nil))))
`(line-number-current-line ((,class (:foreground ,fg1 :background nil))))
`(mode-line ((,class (:bold nil :foreground ,fg4 :background ,mode-line-bg))))
`(mode-line-inactive ((,class (:bold nil :foreground ,fg1 :background ,mode-line-bg-dark))))
`(mode-line-buffer-id ((,class (:bold nil :foreground ,accent :background nil))))
`(mode-line-highlight ((,class (:foreground ,keyword :box nil :weight normal))))
`(mode-line-emphasis ((,class (:foreground ,fg1))))
`(company-preview-common ((t (:foreground unspecified :background ,bg2))))
`(company-scrollbar-bg ((t (:background ,bg2))))
`(company-scrollbar-fg ((t (:background ,bg3))))
`(company-tooltip ((t (:inherit default :background ,bg2))))
`(company-tooltip-common ((t (:foreground ,ms-blue :bold t))))
`(company-tooltip-selection ((t (:background ,bg-hl))))
`(company-tooltip-annotation ((t (:foreground ,doc-alt)))) ; parameter hints etc.
`(org-document-title ((,class (:foreground ,type :height 1.2 :bold t))))
`(org-level-1 ((,class (:bold nil :foreground ,ms-bluegreen :height 1.1))))
`(org-level-2 ((,class (:bold nil :foreground ,ms-lightblue))))
`(org-level-3 ((,class (:bold nil :foreground ,ms-blue))))
`(org-level-4 ((,class (:bold nil :foreground ,ms-bluegreen))))
`(org-code ((,class (:foreground ,fg2))))
`(org-hide ((,class (:foreground ,fg4))))
`(org-date ((,class (:underline t :foreground ,var) )))
`(org-footnote ((,class (:underline t :foreground ,fg4))))
`(org-link ((,class (:underline t :foreground ,type ))))
`(org-special-keyword ((,class (:foreground ,ms-green))))
`(org-block ((,class (:foreground ,fg2 :background ,bg0 :extend t))))
`(org-quote ((,class (:inherit org-block :slant italic))))
`(org-verse ((,class (:inherit org-block :slant italic))))
`(org-todo ((,class (:box (:line-width 1 :color ,ms-lightred) :foreground ,ms-lightred :bold nil))))
`(org-done ((,class (:box (:line-width 1 :color ,ms-lightgreen) :foreground ,ms-lightgreen :bold nil ))))
`(org-warning ((,class (:underline t :foreground ,warning))))
`(org-agenda-structure ((,class (:weight normal :foreground ,fg3 :box (:color ,fg4) :background ,bg3))))
`(org-agenda-date ((,class (:foreground ,var :height 1.1 ))))
`(org-agenda-date-weekend ((,class (:weight normal :foreground ,fg4))))
`(org-agenda-date-today ((,class (:weight normal :foreground ,keyword :height 1.2))))
`(org-agenda-done ((,class (:foreground ,bg4))))
`(org-scheduled ((,class (:foreground ,type))))
`(org-scheduled-today ((,class (:foreground ,func :weight normal :height 1.2))))
`(org-ellipsis ((,class (:foreground ,builtin))))
`(org-verbatim ((,class (:foreground ,fg4))))
`(org-document-info-keyword ((,class (:foreground ,ms-green))))
`(org-sexp-date ((,class (:foreground ,fg4))))
`(org-table ((,class (:foreground ,fg2 :background ,bg3))))
`(font-latex-bold-face ((,class (:foreground ,type))))
`(font-latex-italic-face ((,class (:foreground ,key3 :italic t))))
`(font-latex-string-face ((,class (:foreground ,str))))
`(font-latex-match-reference-keywords ((,class (:foreground ,const))))
`(font-latex-match-variable-keywords ((,class (:foreground ,var))))
`(ido-only-match ((,class (:foreground ,keyword))))
`(ido-subdir ((,class (:weight normal :foreground ,fg0))))
`(ido-first-match ((,class (:foreground ,keyword :bold nil))))
`(gnus-header-content ((,class (:foreground ,keyword))))
`(gnus-header-from ((,class (:foreground ,var))))
`(gnus-header-name ((,class (:foreground ,type))))
`(gnus-header-subject ((,class (:foreground ,func :bold nil))))
`(mu4e-view-url-number-face ((,class (:foreground ,type))))
`(mu4e-cited-1-face ((,class (:foreground ,fg2))))
`(mu4e-cited-7-face ((,class (:foreground ,fg3))))
`(mu4e-header-marks-face ((,class (:foreground ,type))))
`(ffap ((,class (:foreground ,fg4))))
`(js2-private-function-call ((,class (:foreground ,const))))
`(js2-jsdoc-html-tag-delimiter ((,class (:foreground ,str))))
`(js2-jsdoc-html-tag-name ((,class (:foreground ,key2))))
`(js2-external-variable ((,class (:foreground ,type ))))
`(js2-function-param ((,class (:foreground ,const))))
`(js2-jsdoc-value ((,class (:foreground ,str))))
`(js2-private-member ((,class (:foreground ,fg3))))
`(js2-warning ((t (:underline ,warning))))
`(js2-error ((t (:foreground ,warning :weight normal))))
`(js2-jsdoc-tag ((t (:foreground ,var))))
`(js2-jsdoc-type ((t (:foreground ,var))))
`(js2-instance-member ((t (:foreground ,var))))
`(js2-object-property ((t (:foreground ,func))))
`(js2-magic-paren ((t (:foreground ,const))))
`(js2-function-call ((t (:foreground ,const))))
`(js2-keywords ((t (:foreground ,keyword))))
`(js3-warning-face ((,class (:underline ,keyword))))
`(js3-error-face ((,class (:underline ,warning))))
`(js3-external-variable-face ((,class (:foreground ,var))))
`(js3-function-param-face ((,class (:foreground ,key3))))
`(js3-jsdoc-tag-face ((,class (:foreground ,keyword))))
`(js3-instance-member-face ((,class (:foreground ,const))))
`(ac-completion-face ((,class (:underline t :foreground ,keyword))))
`(info-quoted-name ((,class (:foreground ,builtin))))
`(info-string ((,class (:foreground ,str))))
`(icompletep-determined ((,class :foreground ,builtin)))
`(slime-repl-inputed-output-face ((,class (:foreground ,type))))
`(trailing-whitespace ((,class :foreground nil :background ,warning)))
`(lazy-highlight ((,class (:foreground ,fg2 :background ,bg3))))
`(undo-tree-visualizer-current-face ((,class :foreground ,builtin)))
`(undo-tree-visualizer-default-face ((,class :foreground ,fg2)))
`(undo-tree-visualizer-unmodified-face ((,class :foreground ,var)))
`(undo-tree-visualizer-register-face ((,class :foreground ,type)))
`(rainbow-delimiters-depth-1-face ((,class :foreground "gold")))
`(rainbow-delimiters-depth-2-face ((,class :foreground "orchid")))
`(rainbow-delimiters-depth-3-face ((,class :foreground "LightSkyBlue")))
`(rainbow-delimiters-depth-4-face ((,class :foreground "gold")))
`(rainbow-delimiters-depth-5-face ((,class :foreground "orchid")))
`(rainbow-delimiters-depth-6-face ((,class :foreground "LightSkyBlue")))
`(rainbow-delimiters-depth-7-face ((,class :foreground "gold")))
`(rainbow-delimiters-depth-8-face ((,class :foreground "orchid")))
`(rainbow-delimiters-depth-9-face ((,class :foreground "LightSkyBlue")))
`(rainbow-delimiters-unmatched-face ((,class :foreground ,warning)))
`(magit-item-highlight ((,class :background ,bg3)))
`(magit-hunk-heading ((,class (:background ,bg3))))
`(magit-hunk-heading-highlight ((,class (:background ,bg3))))
`(magit-bisect-bad ((t (:foreground ,ms-red))))
`(magit-bisect-good ((t (:foreground ,ms-green))))
`(magit-bisect-skip ((t (:foreground ,ms-orange))))
`(magit-blame-date ((t (:foreground ,ms-red))))
`(magit-blame-heading ((t (:foreground ,ms-orange :background ,bg3 :extend t))))
`(magit-branch ((,class (:foreground ,ms-blue :weight normal))))
`(magit-branch-current ((t (:foreground ,ms-blue))))
`(magit-branch-local ((t (:foreground ,ms-bluegreen))))
`(magit-branch-remote ((t (:foreground ,ms-green))))
`(magit-cherry-equivalent ((t (:foreground ,ms-magenta))))
`(magit-cherry-unmatched ((t (:foreground ,ms-bluegreen))))
`(magit-diff-added ((t (:foreground ,fg2 :background ,ms-green-bg :extend t))))
`(magit-diff-added-highlight ((t (:foreground ,fg3 :background ,ms-green-bghl :extend t))))
`(magit-diff-removed ((t (:foreground ,fg2 :background ,ms-red-bg :extend t))))
`(magit-diff-removed-highlight ((t (:foreground ,fg3 :background ,ms-red-bghl :extend t))))
`(magit-diff-base ((t (:foreground ,bg1 :background ,ms-orange :extend t))))
`(magit-diff-base-highlight ((t (:foreground ,ms-orange :background ,bg3 :extend t))))
`(magit-diff-context ((t (:foreground ,fg0 :extend t))))
`(magit-diff-context-highlight ((,class (:foreground ,fg1 :background ,bg2))))
`(magit-diff-file-header ((,class (:foreground ,fg2 :background ,bg3))))
`(magit-diff-file-heading ((t (:foreground ,fg1 :extend t))))
`(magit-diff-file-heading-highlight ((t (:background ,bg3 :extend t))))
`(magit-diff-file-heading-selection ((t (:foreground ,ms-orange :background ,bg3 :extend t))))
`(magit-diff-hunk-heading ((t (:foreground ,fg1 :background ,bg3 :extend t))))
`(magit-diff-hunk-heading-highlight ((t (:background ,bg3 :extend t))))
`(magit-diff-lines-heading ((t (:foreground ,ms-yellow :background ,ms-red :extend t))))
`(magit-diffstat-added ((t (:foreground ,ms-green))))
`(magit-diffstat-removed ((t (:foreground ,ms-orange))))
`(magit-dimmed ((t (:foreground ,comment))))
`(magit-filename ((t (:foreground ,ms-magenta))))
`(magit-hash ((t (:foreground ,comment))))
`(magit-header-line ((t (:inherit nil))))
`(magit-log-author ((t (:foreground ,ms-orange))))
`(magit-log-date ((t (:foreground ,ms-blue))))
`(magit-log-graph ((t (:foreground ,comment))))
`(magit-mode-line-process ((t (:foreground ,ms-orange))))
`(magit-mode-line-process-error ((t (:foreground ,ms-red))))
`(magit-process-ok ((t (:inherit success))))
`(magit-process-ng ((t (:inherit error))))
`(magit-reflog-amend ((t (:foreground ,ms-magenta))))
`(magit-reflog-checkout ((t (:foreground ,ms-blue))))
`(magit-reflog-cherry-pick ((t (:foreground ,ms-green))))
`(magit-reflog-commit ((t (:foreground ,ms-green))))
`(magit-reflog-merge ((t (:foreground ,ms-green))))
`(magit-reflog-other ((t (:foreground ,ms-bluegreen))))
`(magit-reflog-rebase ((t (:foreground ,ms-magenta))))
`(magit-reflog-remote ((t (:foreground ,ms-bluegreen))))
`(magit-reflog-reset ((t (:inherit error))))
`(magit-refname ((t (:foreground ,comment))))
`(magit-section-heading ((t (:foreground ,ms-magenta))))
`(magit-section-heading-selection ((t (:foreground ,ms-orange :extend t))))
`(magit-section-highlight ((t (:background ,bg3 :extend t))))
`(magit-sequence-drop ((t (:foreground ,ms-red))))
`(magit-sequence-head ((t (:foreground ,ms-blue))))
`(magit-sequence-part ((t (:foreground ,ms-orange))))
`(magit-sequence-stop ((t (:foreground ,ms-green))))
`(magit-signature-bad ((t (:inherit error))))
`(magit-signature-error ((t (:inherit error))))
`(magit-signature-expired-key ((t (:foreground ,ms-orange))))
`(magit-signature-good ((t (:inherit success))))
`(magit-signature-revoked ((t (:foreground ,ms-magenta))))
`(magit-signature-untrusted ((t (:foreground ,ms-bluegreen))))
`(magit-tag ((t (:foreground ,ms-yellow))))
`(term ((,class (:foreground ,fg1 :background ,bg1))))
`(term-color-black ((,class (:foreground ,bg3 :background ,bg3))))
`(term-color-blue ((,class (:foreground ,ms-blue :background ,func))))
`(term-color-red ((,class (:foreground ,ms-red :background ,bg3))))
`(term-color-green ((,class (:foreground ,ms-green :background ,bg3))))
`(term-color-yellow ((,class (:foreground ,ms-yellow :background ,var))))
`(term-color-magenta ((,class (:foreground ,ms-magenta :background ,builtin))))
`(term-color-cyan ((,class (:foreground ,ms-bluegreen :background ,str))))
`(term-color-white ((,class (:foreground ,fg1 :background ,fg2))))
`(diredfl-autofile-name ((t (:foreground ,fg0))))
`(diredfl-compressed-file-name ((t (:foreground ,ms-yellow))))
`(diredfl-compressed-file-suffix ((t (:foreground ,doc-alt))))
`(diredfl-date-time ((t (:foreground ,ms-bluegreen))))
`(diredfl-deletion ((t (:foreground ,ms-red :bold t))))
`(diredfl-deletion-file-name ((t (:foreground ,ms-red ))))
`(diredfl-dir-heading ((t (:foreground ,ms-blue :bold t))))
`(diredfl-dir-name ((t (:foreground ,ms-blue))))
`(diredfl-dir-priv ((t (:foreground ,ms-blue))))
`(diredfl-exec-priv ((t (:foreground ,ms-green))))
`(diredfl-executable-tag ((t (:foreground ,ms-green))))
`(diredfl-file-name ((t (:foreground ,fg1))))
`(diredfl-file-suffix ((t (:foreground ,doc-alt))))
`(diredfl-flag-mark ((t (:foreground ,ms-yellow :bold t))))
`(diredfl-ignored-file-name ((t (:foreground ,doc-alt))))
`(diredfl-link-priv ((t (:foreground ,ms-magenta))))
`(diredfl-no-priv ((t (:foreground ,fg1))))
`(diredfl-number ((t (:foreground ,ms-orange))))
`(diredfl-other-priv ((t (:foreground ,ms-magenta))))
`(diredfl-rare-priv ((t (:foreground ,fg1))))
`(diredfl-read-priv ((t (:foreground ,ms-yellow))))
`(diredfl-symlink ((t (:foreground ,ms-magenta))))
`(diredfl-tagged-autofile-name ((t (:foreground ,fg0))))
`(diredfl-write-priv ((t (:foreground ,ms-red))))
`(helm-header ((,class (:foreground ,fg2 :background ,bg1 :underline nil :box nil))))
`(helm-source-header ((,class (:foreground ,keyword :background ,bg1 :underline nil :weight normal))))
`(helm-selection ((,class (:background ,bg-hl :underline nil :extend t))))
`(helm-selection-line ((,class (:background ,bg-hl :extend t))))
`(helm-visible-mark ((,class (:foreground ,bg1 :background ,bg3))))
`(helm-candidate-number ((,class (:foreground ,bg1 :background ,fg1))))
`(helm-separator ((,class (:foreground ,type :background ,bg1))))
`(helm-time-zone-current ((,class (:foreground ,builtin :background ,bg1))))
`(helm-time-zone-home ((,class (:foreground ,type :background ,bg1))))
`(helm-buffer-not-saved ((,class (:foreground ,type :background ,bg1))))
`(helm-buffer-process ((,class (:foreground ,builtin :background ,bg1))))
`(helm-buffer-saved-out ((,class (:foreground ,fg1 :background ,bg1))))
`(helm-buffer-size ((,class (:foreground ,fg1 :background ,bg1))))
`(helm-ff-directory ((,class (:foreground ,func :background ,bg1 :weight normal))))
`(helm-ff-file ((,class (:foreground ,fg1 :background ,bg1 :weight normal))))
`(helm-ff-executable ((,class (:foreground ,key2 :background ,bg1 :weight normal))))
`(helm-ff-invalid-symlink ((,class (:foreground ,key3 :background ,bg1 :weight normal))))
`(helm-ff-symlink ((,class (:foreground ,keyword :background ,bg1 :weight normal))))
`(helm-ff-prefix ((,class (:foreground ,bg1 :background ,keyword :weight normal))))
`(helm-grep-cmd-line ((,class (:foreground ,fg1 :background ,bg1))))
`(helm-grep-file ((,class (:foreground ,fg1 :background ,bg1))))
`(helm-grep-finish ((,class (:foreground ,fg2 :background ,bg1))))
`(helm-grep-lineno ((,class (:foreground ,fg1 :background ,bg1))))
`(helm-grep-match ((,class (:foreground nil :background nil :inherit helm-match))))
`(helm-grep-running ((,class (:foreground ,func :background ,bg1))))
`(helm-moccur-buffer ((,class (:foreground ,func :background ,bg1))))
`(helm-source-go-package-godoc-description ((,class (:foreground ,str))))
`(helm-bookmark-w3m ((,class (:foreground ,type))))
`(web-mode-html-tag-bracket-face ((,class (:foreground "#808080"))))
`(web-mode-html-tag-face ((,class (:foreground ,keyword))))
`(web-mode-html-attr-name-face ((,class (:foreground ,var))))
`(web-mode-html-attr-value-face ((,class (:foreground ,str))))
`(web-mode-html-attr-equal-face ((,class (:foreground ,fg1))))
`(web-mode-builtin-face ((,class (:inherit ,font-lock-builtin-face))))
`(web-mode-comment-face ((,class (:inherit ,font-lock-comment-face))))
`(web-mode-constant-face ((,class (:inherit ,font-lock-constant-face))))
`(web-mode-keyword-face ((,class (:foreground ,keyword))))
`(web-mode-doctype-face ((,class (:inherit ,font-lock-doc-face))))
`(web-mode-function-name-face ((,class (:inherit ,font-lock-function-name-face))))
`(web-mode-string-face ((,class (:foreground ,str))))
`(web-mode-type-face ((,class (:inherit ,font-lock-type-face))))
`(web-mode-warning-face ((,class (:inherit ,font-lock-warning-face))))
`(web-mode-json-key-face ((,class (:foreground ,str))))
`(web-mode-json-context-face ((,class (:foreground ,str))))
`(diff-header ((t (:foreground ,ms-bluegreen :background nil))))
`(diff-file-header ((t (:foreground ,fg3 :background nil))))
`(diff-hunk-header ((t (:foreground ,fg4 :background ,bg3))))
`(diff-added ((t (:foreground ,fg2 :background ,ms-green-bg))))
`(diff-removed ((t (:foreground ,fg2 :background ,ms-red-bg))))
`(diff-changed ((t (:foreground ,fg2 :background ,ms-blue-bg))))
`(diff-refine-added ((t (:foreground ,fg3 :background ,ms-green-bghl))))
`(diff-refine-removed ((t (:foreground ,fg3 :background ,ms-red-bghl))))
`(diff-refine-changed ((t (:foreground ,fg3 :background ,ms-blue-bghl))))
`(ediff-fine-diff-Ancestor ((t (:background ,ms-red-bghl))))
`(ediff-fine-diff-A ((t (:background ,ms-red-bghl))))
`(ediff-fine-diff-B ((t (:background ,ms-green-bghl))))
`(ediff-fine-diff-C ((t (:background ,ms-blue-bghl))))
`(ediff-current-diff-Ancestor ((t (:background ,ms-red-bg))))
`(ediff-current-diff-A ((t (:background ,ms-red-bg))))
`(ediff-current-diff-B ((t (:background ,ms-green-bg))))
`(ediff-current-diff-C ((t (:background ,ms-blue-bg))))
`(ediff-even-diff-Ancestor ((t (:background ,bg3))))
`(ediff-even-diff-A ((t (:background ,bg3))))
`(ediff-even-diff-B ((t (:background ,bg3))))
`(ediff-even-diff-C ((t (:background ,bg3))))
`(ediff-odd-diff-Ancestor ((t (:background ,bg3))))
`(ediff-odd-diff-A ((t (:background ,bg3))))
`(ediff-odd-diff-B ((t (:background ,bg3))))
`(ediff-odd-diff-C ((t (:background ,bg3))))
`(jde-java-font-lock-package-face ((t (:foreground ,var))))
`(jde-java-font-lock-public-face ((t (:foreground ,keyword))))
`(jde-java-font-lock-private-face ((t (:foreground ,keyword))))
`(jde-java-font-lock-constant-face ((t (:foreground ,const))))
`(jde-java-font-lock-modifier-face ((t (:foreground ,key3))))
`(jde-jave-font-lock-protected-face ((t (:foreground ,keyword))))
`(jde-java-font-lock-number-face ((t (:foreground ,numeric))))
`(centaur-tabs-default ((t (:background ,bg1 :foreground ,fg1))))
`(centaur-tabs-selected ((t (:background ,bg1 :foreground ,fg3 :box nil))))
`(centaur-tabs-unselected ((t (:background ,bg2 :foreground ,fg0 :box nil))))
`(centaur-tabs-selected-modified ((t (:background ,bg2 :foreground ,accent :box nil))))
`(centaur-tabs-unselected-modified ((t (:background ,bg2 :foreground ,fg4 :box nil))))
`(centaur-tabs-active-bar-face ((t (:background ,accent :box nil))))
`(centaur-tabs-modified-marker-selected ((t (:inherit 'centaur-tabs-selected-modified :foreground ,accent :box nil))))
`(centaur-tabs-modified-marker-unselected ((t (:inherit 'centaur-tabs-unselected-modified :foreground ,accent :box nil))))
`(solaire-default-face ((t (:inherit default :background ,bg2))))
`(solaire-minibuffer-face ((t (:inherit default :background ,bg2))))
`(solaire-hl-line-face ((t (:inherit hl-line :background ,bg3))))
`(solaire-org-hide-face ((t (:inherit org-hide :background ,bg2))))
`(ivy-confirm-face ((t (:inherit minibuffer-prompt :foreground ,keyword))))
`(ivy-current-match ((t (:background ,bg-hl :extend t))))
`(ivy-highlight-face ((t (:inherit font-lock-builtin-face))))
`(ivy-match-required-face ((t (:inherit minibuffer-prompt :foreground ,warning))))
`(ivy-minibuffer-match-face-1 ((t (:inherit isearch))))
`(ivy-minibuffer-match-face-2 ((t (:inherit ivy-minibuffer-match-face-1))))
`(ivy-minibuffer-match-face-3 ((t (:inherit ivy-minibuffer-match-face-2))))
`(ivy-minibuffer-match-face-4 ((t (:inherit ivy-minibuffer-match-face-2))))
`(ivy-minibuffer-match-highlight ((t (:inherit ivy-current-match))))
`(ivy-modified-buffer ((t (:inherit default :foreground ,var))))
`(ivy-virtual ((t (:inherit default :foreground ,doc-alt))))
`(ivy-posframe ((t (:background "#252526"))))
`(counsel-key-binding ((t (:foreground ,var))))
`(swiper-match-face-1 ((t (:inherit ivy-minibuffer-match-face-1))))
`(swiper-match-face-2 ((t (:inherit ivy-minibuffer-match-face-2))))
`(swiper-match-face-3 ((t (:inherit ivy-minibuffer-match-face-3))))
`(swiper-match-face-4 ((t (:inherit ivy-minibuffer-match-face-4))))
`(swiper-line-face ((t (:foreground ,fg0 :background ,bg4 :extend t))))
`(git-gutter:added ((t (:background ,vc-g :foreground ,vc-g :weight normal))))
`(git-gutter:deleted ((t (:background ,vc-r :foreground ,vc-r :weight normal))))
`(git-gutter:modified ((t (:background ,vc-b :foreground ,vc-b :weight normal))))
`(git-gutter-fr:added ((t (:background ,vc-g :foreground ,vc-g :weight normal))))
`(git-gutter-fr:deleted ((t (:background ,vc-r :foreground ,vc-r :weight normal))))
`(git-gutter-fr:modified ((t (:background ,vc-b :foreground ,vc-b :weight normal))))
`(diff-hl-insert ((t (:background ,vc-g :foreground ,vc-g))))
`(diff-hl-delete ((t (:background ,vc-r :foreground ,vc-r))))
`(diff-hl-change ((t (:background ,vc-b :foreground ,vc-b))))
`(neo-dir-link-face ((t (:foreground "#cccccc" :family "Sans Serif"))))
`(neo-header-face ((t (:foreground "#cccccc" :family "Sans Serif"))))
`(neo-banner-face ((t (:foreground "#cccccc" :family "Sans Serif"))))
`(neo-root-dir-face ((t (:foreground "#cccccc" :family "Sans Serif"))))
`(neo-file-link-face ((t (:foreground "#aaaaaa" :family "Sans Serif"))))
`(neo-expand-btn-face ((t (:foreground "#aaaaaa"))))
`(sml/global ((t (:foreground ,fg1 :weight normal))))
`(sml/filename ((t (:foreground ,fg1 :weight normal))))
`(sml/line-number ((t (:foreground ,fg1 :weight normal))))
`(sml/prefix ((t (:foreground ,fg1 :weight normal))))
`(sml/read-only ((t (:foreground ,fg1 :weight normal))))
`(sml/modes ((t (:foreground ,fg1 :weight normal))))
`(sml/modified ((t (:foreground ,ms-lightred :weight normal))))
`(sml/charging ((t (:foreground ,ms-green :weight normal))))
`(evil-ex-substitute-matches ((t (:foreground ,warning :weight normal :strike-through t))))
`(evil-ex-substitute-replacement ((t (:foreground ,ms-bluegreen :weight normal))))
`(hl-todo ((t (:inverse-video t))))
`(highlight-numbers-number ((t (:foreground ,numeric))))
`(highlight-operators-face ((t (:inherit default))))
`(highlight-symbol-face ((t (:background "#343a40"))))))
;;;###autoload
(when (and (boundp 'custom-theme-load-path) load-file-name)
(add-to-list 'custom-theme-load-path
(file-name-as-directory (file-name-directory load-file-name))))
(provide-theme 'vscode-dark-plus)
(provide 'vscode-dark-plus-theme)
;;; vscode-dark-plus-theme.el ends here

14
.emacs.d/emacs-custom.el Normal file
View File

@ -0,0 +1,14 @@
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
(quote
(vscode-dark-plus-theme use-package magit impatient-mode auto-package-update))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

14
.emacs.d/emacs-custom.el~ Normal file
View File

@ -0,0 +1,14 @@
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
(quote
(magit impatient-mode use-package auto-package-update))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

69
.emacs.d/init.el Normal file
View File

@ -0,0 +1,69 @@
; Packages
;; package archives
(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives
'(
("ELPA" . "http://tromey.com/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")
("ORG" . "https://orgmode.org/elpa/")
)
)
(package-initialize)
;; install use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package)
)
;; Set path to store "custom-set"
(setq custom-file "~/.emacs.d/emacs-custom.el")
;; Theme
(use-package vscode-dark-plus-theme
:ensure t
:config
(load-theme 'vscode-dark-plus t))
;; Auto enable markdown into html previewOB
(use-package auto-package-update
:ensure t
:config
(setq auto-package-update-interval 5
auto-package-update-delete-old-verions t)
(auto-package-update-maybe)
)
(use-package impatient-mode
:ensure t
:mode
(
("\\.md\\'" . impatient-mode)
)
:hook
(
(impatient-mode . html-mode)
)
:config
(add-hook 'html-mode-hook
(lambda ()
(unless (get-process "httpd")
(message "starting httpd server...")
(httpd-start)
)
(impatient-mode)
(imp-set-user-filter 'markdown-html)
(imp-visit-buffer)
)
)
)
(global-set-key (kbd "C-x g") 'magit-status)
(defun markdown-html (buffer)
(princ (with-current-buffer buffer
(format "<!DOCTYPE html><html><title>Impatient Markdown</title><xmp theme=\"united\" style=\"display:none;\"> %s </xmp><script src=\"http://strapdownjs.com/v/0.2/strapdown.js\"></script></html>" (buffer-substring-no-properties (point-min) (point-max))))
(current-buffer)))

69
.emacs.d/init.el~ Normal file
View File

@ -0,0 +1,69 @@
; Packages
;; package archives
(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives
'(
("ELPA" . "http://tromey.com/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")
("ORG" . "https://orgmode.org/elpa/")
)
)
(package-initialize)
;; install use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package)
)
;; Set path to store "custom-set"
(setq custom-file "~/.emacs.d/emacs-custom.el")
;; Theme
(use-package vscode-dark-plus-theme
:ensure t
:config
(load-theme 'vscode-dark-plus t))
;; Auto enable markdown into html previewOB
(use-package auto-package-update
:ensure t
:config
(setq auto-package-update-interval 5
auto-package-update-delete-old-verions t)
(auto-package-update-maybe)
)
(use-package impatient-mode
:ensure t
:mode
(
("\\.md\\'" . impatient-mode)
)
:hook
(
(impatient-mode . html-mode)
)
:config
(add-hook 'html-mode-hook
(lambda ()
(unless (get-process "httpd")
(message "starting httpd server...")
(httpd-start)
)
(impatient-mode)
(imp-set-user-filter 'markdown-html)
(imp-visit-buffer)
)
)
)
(global-set-key (kbd "C-x g") 'magit-status)
;;(defun markdown-html (buffer)
;; (princ (with-current-buffer buffer
;; (format "<!DOCTYPE html><html><title>Impatient Markdown</title><xmp theme=\"united\" style=\"display:none;\"> %s </xmp><script src=\"http://strapdownjs.com/v/0.2/strapdown.js\"></script></html>" (buffer-substring-no-properties (point-min) (point-max))))
;; (current-buffer)))