diff --git a/.orgConf.el b/.orgConf.el index 7218b60..c0d8d2e 100644 --- a/.orgConf.el +++ b/.orgConf.el @@ -32,6 +32,7 @@ (org-todo (if (= n-not-done 0) "DONE" "TODO")))) (add-hook 'org-after-todo-statistics-hook 'org-summary-todo) +;(setq org-doing-file "~/.emacs.d/GTD/orgBoss/newgtd.org") ;(if (boundp 'org-user-agenda-files) ; (setq org-agenda-files org-user-agenda-files) (setq org-agenda-files (list @@ -488,10 +489,11 @@ In ~%s~: ; type 相当于 #+TYP_TODO 也有两种类型 ; sequence 相当于 #+SEQ_TODO 也有两种类型 ; 可以写出多个sequence 等你工作 学习 继续进行修改 但是注意无论是type还是sequence都得有| +; TODO 要做 DOING正咋做 PENDING做完了再做 WAITING做了一半得等其他人完成 (setq org-todo-keywords '((type "工作(w!)" "学习(s!)" "休闲(l!)" "|") (type "REPORT(r!)" "BUG(b!)" "KNOWNCAUSE(k!)" "|" "FIXED(f!)") - (sequence "PENDING(p!)" "TODO(t!)" "DOING(i!)" "|" "DONE(d!)" "CANCELED(c!)" "ABORT(a@/!)") + (sequence "PENDING(p!)" "TODO(t!)" "DOING(i!)" "WAITING(e!)" "|" "DONE(d!)" "CANCELED(c!)" "ABORT(a@/!)") )) (setq org-todo-keyword-faces '(("工作" . (:background "red" :foreground "white" :weight bold)) @@ -514,12 +516,6 @@ In ~%s~: ("@Company" . ?o) ("@Home" . ?H) ("@NCEPU" . ?n) - (:endgroup . nil) - (:newline) - (:startgroup . nil) - ("WAITING" . ?w) - ("HOLD" . ?h) - (:endgroup . nil) (:newline) (:startgroup . nil) diff --git a/GTD/orgBoss/IDEA/idea.org b/GTD/orgBoss/IDEA/idea.org index 84cb6d6..6651ead 100644 --- a/GTD/orgBoss/IDEA/idea.org +++ b/GTD/orgBoss/IDEA/idea.org @@ -335,3 +335,13 @@ CLOCK: [2018-03-14 周三 18:49]--[2018-03-14 周三 18:51] => 0:02 一根电线【一个箭头表示】一个变量(一个参数、一个属性),一个基点一个函数,一个站点一个模块 箭头只有开始和结束上面没有基础的数值或者变量,开始地方分布在箭尾、结束地方分布在箭头,其他地方都得有基础的数值和变量名 +** TODO [#A] 师出有名 <2018-07-26 周四 10:40> + +任何的描述都应该有理有据,有其出处,处则为location,也即为名 + +师出有名,名为location(联想到名字---地名----标识----tag---mark(以小见大)) +** TODO [#A] 路要靠自己走 <2018-07-27 周五 06:13> + +自己走出来的路,就是好路,走不出来,那就只能感叹! + +从大到小,抓住重点,以重点论、两点论为纲!!不断深化自己的见识 diff --git a/GTD/orgBoss/Note/notes.org b/GTD/orgBoss/Note/notes.org index 1617627..9fb998e 100644 --- a/GTD/orgBoss/Note/notes.org +++ b/GTD/orgBoss/Note/notes.org @@ -664,3 +664,10 @@ higher aerodynamic blade forces(又加上了balde) than for static stall(加 spanwise and temporal extend of the dyanmic stall region 进一步参考 [Wind turbine aerodynamic in yaw.pdf P153] +** 校医院取药 [#B] :@NCEPU: +DEADLINE: <2018-08-01 周三> +:LOGBOOK: +CLOCK: [2018-07-31 周二 16:12]--[2018-07-31 周二 16:13] => 0:01 +:END: + Added: [2018-07-31 周二 16:12] + diff --git a/GTD/orgBoss/newgtd.org b/GTD/orgBoss/newgtd.org index 1611388..b4d1433 100644 --- a/GTD/orgBoss/newgtd.org +++ b/GTD/orgBoss/newgtd.org @@ -1201,15 +1201,17 @@ SCHEDULED: <2017-11-14 周二> - State "TODO" from "DONE" [2017-12-22 周五 10:38] - State "DONE" from "TODO" [2017-12-22 周五 10:38] LIC算法改进 -** TODO [#A] 基于多轴角运动的气动特性和流场分析大论文 <2018-06-25 周一 16:19>[0/4] :学术: +** TODO [#A] 基于多轴角运动的气动特性和流场分析大论文 <2018-06-25 周一 16:19>[1/4] :学术: DEADLINE: <2019-04-15 周一> :PROPERTIES: :Effort: 16:00 :END: + - State "TODO" from "TODO" [2018-07-31 周二 16:19] :LOGBOOK: CLOCK: [2018-06-25 周一 16:19]--[2018-06-26 周二 12:02] => 19:43 :END: + 1. [ ] 绪论 2. [ ] 第二章 方法介绍 @@ -1329,7 +1331,7 @@ DEADLINE: <2018-07-03 周二> :Effort: 4:00 :END: :LOGBOOK: - CLOCK: [2018-07-25 周三 10:55] + CLOCK: [2018-07-28 周六 19:50]--[2018-07-29 周日 17:58] => 22:08 CLOCK: [2018-07-24 周二 15:44]--[2018-07-25 周三 10:50] => 19:06 CLOCK: [2018-07-24 周二 15:42]--[2018-07-24 周二 15:43] => 0:01 CLOCK: [2018-07-24 周二 15:40]--[2018-07-24 周二 15:41] => 0:01 @@ -1423,8 +1425,8 @@ DEADLINE: <2018-08-01 周三> ***** PIV实验[%] -*** TODO [#A] 工程热物理初稿 <2018-06-27 周三 15:38> [60%] :学术: -DEADLINE: <2018-07-04 周三> +*** DONE [#A] 工程热物理初稿 <2018-06-27 周三 15:38> [100%] :学术: +CLOSED: [2018-07-31 周二 16:19] DEADLINE: <2018-07-04 周三> :PROPERTIES: :Effort: 10:00 :END: @@ -1437,13 +1439,37 @@ DEADLINE: <2018-07-04 周三> 1. [X] 引言 2. [X] 方法 -3. [ ] 结果和分析 -4. [ ] 结论 +3. [X] 结果和分析 +4. [X] 结论 5. [X] 摘要 LINK:info:org:Top LINK:info:markdown:Top +** TODO [#C] 取工程热物理发票 <2018-07-31 周二 16:05> :@NCEPU: +DEADLINE: <2018-08-08 周三> + :PROPERTIES: + :Effort: 0:30 + :END: + :LOGBOOK: + CLOCK: [2018-07-31 周二 16:06]--[2018-07-31 周二 16:06] => 0:00 + CLOCK: [2018-07-31 周二 16:05]--[2018-07-31 周二 16:06] => 0:01 + :END: + +一般挂号信 学校一个月之内退回 - - - +通过建行快速查找你的付款日期 +** TODO [#C] 取邮局版面费 <2018-07-31 周二 16:06> :@NCEPU: +DEADLINE: <2018-10-01 周一> + :PROPERTIES: + :Effort: 0:30 + :END: + :LOGBOOK: + CLOCK: [2018-07-31 周二 16:06]--[2018-07-31 周二 16:06] => 0:00 + :END: + + 一般3个月期限,比如0529== 0728过期! +** TODO [#C] 校医院取外敷药 <2018-07-31 周二 16:17> +DEADLINE: <2018-08-01 周三> SCHEDULED:<2018-07-31 周二> +:LOGBOOK: +CLOCK: [2018-07-31 周二 16:17]--[2018-07-31 周二 16:18] => 0:01 +:END: diff --git "a/GTD/org_Brain/\350\203\214\346\231\257.org" "b/GTD/org_Brain/\350\203\214\346\231\257.org" index cc0189b..8fa9f0b 100644 --- "a/GTD/org_Brain/\350\203\214\346\231\257.org" +++ "b/GTD/org_Brain/\350\203\214\346\231\257.org" @@ -704,3 +704,8 @@ Most important to least important conclusions you make about the text. :ID: 49820ca3-c343-4c50-a890-6d2ba964f5f5 :END: + +(df sdf) + +"dfds gsdf sdfs +df" diff --git a/README.md b/README.md index 3bbda8c..93a144f 100644 --- a/README.md +++ b/README.md @@ -307,6 +307,13 @@ M-x package-install markdown-mode+ 在init.el的my-package list 增加markdown-mode+,这样每次打开markdown的md后缀结尾的后缀名就会自动渲染,这也是emacs的[mode][18]的一种运用. +1. `shift+tab`切换overview视图(标题间的outline模式)(第一步:Shift-tab多次,进入outline模式) +2. `M-x markdown-cycle` 可以逐步children化,这样你就可以只工作在某一级别下(第二步:`M-x markdown-cycle` 不断进入子目录 +3. `Alt-n|p`上下移动标题 + +当然说到底还是emacs的shift+tab切换效率高些! 参考标题139 + +![markdown-shifft][358] ### 11. server+clinet emacs经常地使用方式是 @@ -892,9 +899,9 @@ M-h M-x comment-with-box 注释一个区域 #### 函数 -1. projectile-find-file 快捷键C-c p f +1. projectile-find-file 快捷键`C-c C-p f` <2018-07-31 00:03>改成这种风格了(升级之后有所改变) -你可以使用 M-x projectile 进入projectile模式 +你可以使用 M-x projectile-mode 进入projectile模式(默认进入) 在vim中有一个类似的软件叫做[Ctrl-space][52],[projectile][51]会把git或者其他代码管理软件,亦或者你的lein,maven,budler等 相关的文件夹当作一个project,如果啥都没有创建一个.projectile,那么该文件夹也会被识别为project @@ -903,7 +910,7 @@ M-h M-x comment-with-box 注释一个区域 基本查找项目文件内的file(C-c是保留的快捷键) -`C-c p f` +`C-c c-p f` ![projectile][55] ### 34. Web-mode介绍 @@ -6635,6 +6642,52 @@ different folders into one folder, then let you find the file you specified with 5. `{` 6. text + +### 139. org-doing record what you are doing and done + + +[org-doing][356]源自[doing][357]---a command line tool, 用于记录你正在做 + +1. now(doing now "..."): add an entry +2. later(doing later "...") : add an item to the later section +3. done(doing done ..) : Add an completed item with @done(date) +4. meanwhile: Finish any @meanwhile tasks and optionally create a new one + + + +想法不错,但是org-agenda已经够好. 可以`C-c a T`输入`TODO`或者`DONE`或者其他,来快速找到你的任务状态 + +#### 伟大的project outline thinking + +我又回看了Sachac的[baby-steps-org-todo][49], 学到了关于project outline的工作流 + +1. 新建一个project二级标题,(不要让过多的任务压死你,分成项目去做_ +2. 在该标题下,建立TOOD三级标题,可以有多个TOOO + 1. 贴任务标签(`C-c q`) + 2. 指派(`C-c C-s`):不会忘记了deadline(不要太多,委托别人delegate,推迟postpone,去除eliminate + 3. 设置截止日期(`C-c C-d`) + 4. Clock in(`C-c C-x C-i`) Clock-out (`C-c C-x C-o`) ... + 5. 设置任务状态(`C-c C-t`) + + 拟合一下工作过程 + 1. Tags + 2. Schedule + 3. Clock + 4. Job Status + 5. Tab +在这种工作流模式,怕多,所以得把任务紧密围绕你的project!这点很重要! 通过标题,所以可以使用`Tab`不断切换(父子标题间切换,go through different level of visibility ,hide the detail and then edit the detail)overview状态,可以指定某个project为当前你要工作的project +(然后设置任务状态`doing`;`waiting`做了一些,合伙人还没做完中间,等待做;待做叫做`TODO`,这是任务的最后一个状态,做完重做叫`pending`) + +在这种工作流模式下,一个task不要超过7个词语! + +于是你也可以在你的org-agenda(`C-c a a`)设置任务状态( `t` ), 也可以设置日期( `C-c C-s`或者 `C-c C-d`), 也可以进行查看`Enter`进去. +`C-f`向后一周看agenda状态,`C-b`往前看一周 + +![Org-shifft][359] +markdown-mode参考标题10. + + + ---------- ---------- @@ -6996,4 +7049,7 @@ different folders into one folder, then let you find the file you specified with [353]: https://github.com/Pranshu258/emacsdoctor [354]: https://github.com/howardabrams/dot-files/blob/master/emacs.org#multiple-cursors [355]: https://github.com/howardabrams/dot-files/blob/master/emacs.org#block-wrappers -[356]: +[356]: https://github.com/rudolfolah/org-doing +[357]: https://github.com/ttscoff/doing/ +[358]:https://github.com/jueqingsizhe66/ranEmacs.d/blob/develop/customizations/img/shift.png +[359]:https://github.com/jueqingsizhe66/ranEmacs.d/blob/develop/customizations/img/shift1.png diff --git a/bookmarks b/bookmarks index a107ad2..2bbb0c7 100644 --- a/bookmarks +++ b/bookmarks @@ -44,10 +44,10 @@ (rear-context-string . "5-03 Sun 21:38]\n") (position . 499)) ("org-capture-last-stored" - (filename . "~/.emacs.d/GTD/orgBoss/Note/notes.org") - (front-context-string . "** Dynamic Stall") - (rear-context-string . "ODO keywords). \n") - (position . 29375)) + (filename . "~/.emacs.d/GTD/orgBoss/newgtd.org") + (front-context-string . "** TODO [#C] 校医院") + (rear-context-string . "如0529== 0728过期!\n") + (position . 54783)) #1=(#("org-remember-last-stored" 0 24 (bmkp-full-record #1#)) (annotation) diff --git a/customizations/doom-todo-ivy.el b/customizations/doom-todo-ivy.el new file mode 100644 index 0000000..30afb9a --- /dev/null +++ b/customizations/doom-todo-ivy.el @@ -0,0 +1,112 @@ +;;; doom-todo-ivy.el --- Display TODO, FIXME, etc in an Ivy buffer. -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Justin Smestad + +;; Author: Justin Smestad +;; Homepage: https://github.com/jsmestad/doom-todo-ivy +;; Version: 0.1.0 +;; Package-Requires: ((emacs "25.1") (projectile "0.10.0") (ivy)) +;; Keywords: + +;;; Commentary: +;;; +;;; This is a straight port of the version supplied with Doom Emacs. + +;;; Code: + +(require 'projectile) +(require 'ivy) + +(defvar doom/ivy-buffer-icons nil + "If non-nil, show buffer mode icons in `ivy-switch-buffer' and the like.") + +(defvar doom/ivy-task-tags + '(("TODO" . warning) + ("FIXME" . error)) + "An list of tags for `doom/ivy-tasks' to search for.") + + +(defun doom/ivy--tasks-candidates (tasks) + "Generate a list of task candidates from TASKS." + (let* ((max-type-width + (cl-loop for task in doom/ivy-task-tags maximize (length (car task)))) + (max-desc-width + (cl-loop for task in tasks maximize (length (cl-cdadr task)))) + (max-width (max (- (frame-width) (1+ max-type-width) max-desc-width) + 25))) + (cl-loop + with fmt = (format "%%-%ds %%-%ds%%s%%s:%%s" max-type-width max-width) + for alist in tasks + collect + (let-alist alist + (format fmt + (propertize .type 'face (cdr (assoc .type doom/ivy-task-tags))) + (substring .desc 0 (min max-desc-width (length .desc))) + (propertize " | " 'face 'font-lock-comment-face) + (propertize (abbreviate-file-name .file) 'face 'font-lock-keyword-face) + (propertize .line 'face 'font-lock-constant-face)))))) + +(defun doom/ivy--tasks (target) + "Search TARGET for a list of tasks." + (let* (case-fold-search + (task-tags (mapcar #'car doom/ivy-task-tags)) + (cmd + (format "%s -H -S --no-heading -- %s %s" + (or (when-let* ((bin (executable-find "rg"))) + (concat bin " --line-number")) + (when-let* ((bin (executable-find "ag"))) + (concat bin " --numbers")) + (error "Cannot find executables: ripgrep or the_silver_searcher")) + (shell-quote-argument + (concat "\\s(" + (string-join task-tags "|") + ")([\\s:]|\\([^)]+\\):?)")) + target))) + (save-match-data + (cl-loop with out = (shell-command-to-string cmd) + for x in (and out (split-string out "\n" t)) + when (condition-case-unless-debug ex + (string-match + (concat "^\\([^:]+\\):\\([0-9]+\\):.+\\(" + (string-join task-tags "\\|") + "\\):?\\s-*\\(.+\\)") + x) + (error + (message! (red "Error matching task in file: (%s) %s" + (error-message-string ex) + (car (split-string x ":")))) + nil)) + collect `((type . ,(match-string 3 x)) + (desc . ,(match-string 4 x)) + (file . ,(match-string 1 x)) + (line . ,(match-string 2 x))))))) + +(defun doom/ivy--tasks-open-action (x) + "Jump to the file X and line of the current task." + (let ((location (cadr (split-string x " | "))) + (type (car (split-string x " ")))) + (cl-destructuring-bind (file line) (split-string location ":") + (with-ivy-window + (find-file (expand-file-name file (projectile-project-root))) + (goto-char (point-min)) + (forward-line (1- (string-to-number line))) + (search-forward type (line-end-position) t) + (backward-char (length type)) + (recenter))))) + +;;;###autoload +(defun doom/ivy-tasks (&optional arg) + "Search through all TODO/FIXME tags in the current project. Optional ARG will search only that file." + (interactive "P") + (ivy-read (format "Tasks (%s): " + (if arg + (concat "in: " (file-relative-name buffer-file-name)) + "project")) + (doom/ivy--tasks-candidates + (doom/ivy--tasks (if arg buffer-file-name (projectile-project-root)))) + :action #'doom/ivy--tasks-open-action + :caller 'doom/ivy-tasks)) + +(provide 'doom-todo-ivy) + +;;; doom-todo-ivy.el ends here diff --git a/customizations/editing.el b/customizations/editing.el index d31d32b..9148d17 100644 --- a/customizations/editing.el +++ b/customizations/editing.el @@ -344,3 +344,10 @@ This function also supports some `org-mode' wrappers: (surround (region-beginning) (region-end) text) (surround nil nil text))))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (use-package doom-todo-ivy ;; +;; :ensure t ;; +;; :hook (after-init . doom-todo-ivy)) ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(require 'doom-todo-ivy) diff --git a/customizations/img/shift.png b/customizations/img/shift.png new file mode 100644 index 0000000..4699188 Binary files /dev/null and b/customizations/img/shift.png differ diff --git a/customizations/img/shift2.png b/customizations/img/shift2.png new file mode 100644 index 0000000..bc1b538 Binary files /dev/null and b/customizations/img/shift2.png differ diff --git a/elpa/0blayout-20161007.2307/0blayout-pkg.el b/elpa/0blayout-20161007.2307/0blayout-pkg.el deleted file mode 100644 index d0c30d8..0000000 --- a/elpa/0blayout-20161007.2307/0blayout-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "0blayout" "20161007.2307" "Layout grouping with ease" 'nil :commit "873732ddb99a3ec18845a37467ee06bce4e61d87" :url "https://github.com/etu/0blayout" :keywords '("convenience" "window-management")) diff --git a/elpa/0blayout-20161007.2307/0blayout-autoloads.el b/elpa/0blayout-20161008.607/0blayout-autoloads.el similarity index 84% rename from elpa/0blayout-20161007.2307/0blayout-autoloads.el rename to elpa/0blayout-20161008.607/0blayout-autoloads.el index 19c25ab..2229854 100644 --- a/elpa/0blayout-20161007.2307/0blayout-autoloads.el +++ b/elpa/0blayout-20161008.607/0blayout-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "0blayout" "0blayout.el" (22958 19004 0 0)) +;;;### (autoloads nil "0blayout" "0blayout.el" (23392 1964 0 0)) ;;; Generated autoloads from 0blayout.el (autoload '0blayout-add-keybindings-with-prefix "0blayout" "\ @@ -23,10 +23,6 @@ Handle layouts with ease \(fn &optional ARG)" t nil) -;;;*** - -;;;### (autoloads nil nil ("0blayout-pkg.el") (22958 18980 0 0)) - ;;;*** ;; Local Variables: diff --git a/elpa/0blayout-20161008.607/0blayout-pkg.el b/elpa/0blayout-20161008.607/0blayout-pkg.el new file mode 100644 index 0000000..b4aa6bb --- /dev/null +++ b/elpa/0blayout-20161008.607/0blayout-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "0blayout" "20161008.607" "Layout grouping with ease" 'nil :commit "873732ddb99a3ec18845a37467ee06bce4e61d87" :keywords '("convenience" "window-management") :authors '(("Elis \"etu\" Axelsson")) :maintainer '("Elis \"etu\" Axelsson") :url "https://github.com/etu/0blayout") diff --git a/elpa/0blayout-20161007.2307/0blayout.el b/elpa/0blayout-20161008.607/0blayout.el similarity index 99% rename from elpa/0blayout-20161007.2307/0blayout.el rename to elpa/0blayout-20161008.607/0blayout.el index dab0ee5..16e2fc9 100644 --- a/elpa/0blayout-20161007.2307/0blayout.el +++ b/elpa/0blayout-20161008.607/0blayout.el @@ -4,7 +4,7 @@ ;; Author: Elis "etu" Axelsson ;; URL: https://github.com/etu/0blayout -;; Package-Version: 20161007.2307 +;; Package-Version: 20161008.607 ;; Package-X-Original-Version: 20160918.0 ;; Version: 1.0.2 ;; Keywords: convenience, window-management diff --git a/elpa/0blayout-20161007.2307/0blayout.elc b/elpa/0blayout-20161008.607/0blayout.elc similarity index 99% rename from elpa/0blayout-20161007.2307/0blayout.elc rename to elpa/0blayout-20161008.607/0blayout.elc index 18dfb5f..d348778 100644 Binary files a/elpa/0blayout-20161007.2307/0blayout.elc and b/elpa/0blayout-20161008.607/0blayout.elc differ diff --git a/elpa/0xc-20170125.1953/0xc-pkg.el b/elpa/0xc-20170125.1953/0xc-pkg.el deleted file mode 100644 index 42f3a81..0000000 --- a/elpa/0xc-20170125.1953/0xc-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "0xc" "20170125.1953" "Base conversion made easy" '((emacs "24.4") (s "1.11.0")) :commit "31890af88234e4e098f1c340a5990515b934c7f7" :url "http://github.com/AdamNiederer/0xc" :keywords '("base" "conversion")) diff --git a/elpa/0xc-20170125.1953/0xc-autoloads.el b/elpa/0xc-20170126.353/0xc-autoloads.el similarity index 92% rename from elpa/0xc-20170125.1953/0xc-autoloads.el rename to elpa/0xc-20170126.353/0xc-autoloads.el index 3fee5a3..c437e4c 100644 --- a/elpa/0xc-20170125.1953/0xc-autoloads.el +++ b/elpa/0xc-20170126.353/0xc-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "0xc" "0xc.el" (22967 62232 0 0)) +;;;### (autoloads nil "0xc" "0xc.el" (23392 1963 0 0)) ;;; Generated autoloads from 0xc.el (autoload '0xc-convert "0xc" "\ diff --git a/elpa/0xc-20170126.353/0xc-pkg.el b/elpa/0xc-20170126.353/0xc-pkg.el new file mode 100644 index 0000000..7745170 --- /dev/null +++ b/elpa/0xc-20170126.353/0xc-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "0xc" "20170126.353" "Base conversion made easy" '((emacs "24.4") (s "1.11.0")) :commit "12c2c6118c062a49594965c69e6a17bb46339eb2" :keywords '("base" "conversion") :authors '(("Adam Niederer" . "adam.niederer@gmail.com")) :maintainer '("Adam Niederer" . "adam.niederer@gmail.com") :url "http://github.com/AdamNiederer/0xc") diff --git a/elpa/0xc-20170125.1953/0xc.el b/elpa/0xc-20170126.353/0xc.el similarity index 99% rename from elpa/0xc-20170125.1953/0xc.el rename to elpa/0xc-20170126.353/0xc.el index bdccb1e..70cbd4a 100644 --- a/elpa/0xc-20170125.1953/0xc.el +++ b/elpa/0xc-20170126.353/0xc.el @@ -4,7 +4,7 @@ ;; Author: Adam Niederer ;; URL: http://github.com/AdamNiederer/0xc -;; Package-Version: 20170125.1953 +;; Package-Version: 20170126.353 ;; Version: 0.1 ;; Keywords: base conversion ;; Package-Requires: ((emacs "24.4") (s "1.11.0")) diff --git a/elpa/0xc-20170125.1953/0xc.elc b/elpa/0xc-20170126.353/0xc.elc similarity index 99% rename from elpa/0xc-20170125.1953/0xc.elc rename to elpa/0xc-20170126.353/0xc.elc index 7a4f241..169660a 100644 Binary files a/elpa/0xc-20170125.1953/0xc.elc and b/elpa/0xc-20170126.353/0xc.elc differ diff --git a/elpa/2048-game-20151026.1233/2048-game-pkg.el b/elpa/2048-game-20151026.1233/2048-game-pkg.el deleted file mode 100644 index 9612e99..0000000 --- a/elpa/2048-game-20151026.1233/2048-game-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "2048-game" "20151026.1233" "play 2048 in Emacs" 'nil :url "https://bitbucket.org/zck/2048.el") diff --git a/elpa/2048-game-20151026.1233/2048-game-autoloads.el b/elpa/2048-game-20151026.1933/2048-game-autoloads.el similarity index 87% rename from elpa/2048-game-20151026.1233/2048-game-autoloads.el rename to elpa/2048-game-20151026.1933/2048-game-autoloads.el index 329987a..f950432 100644 --- a/elpa/2048-game-20151026.1233/2048-game-autoloads.el +++ b/elpa/2048-game-20151026.1933/2048-game-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "2048-game" "2048-game.el" (22968 7052 0 0)) +;;;### (autoloads nil "2048-game" "2048-game.el" (23392 1961 0 0)) ;;; Generated autoloads from 2048-game.el (autoload '2048-game "2048-game" "\ diff --git a/elpa/2048-game-20151026.1933/2048-game-pkg.el b/elpa/2048-game-20151026.1933/2048-game-pkg.el new file mode 100644 index 0000000..b65a793 --- /dev/null +++ b/elpa/2048-game-20151026.1933/2048-game-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "2048-game" "20151026.1933" "play 2048 in Emacs" 'nil :authors '(("Zachary Kanfer" . "zkanfer@gmail.com")) :maintainer '("Zachary Kanfer" . "zkanfer@gmail.com") :url "https://bitbucket.org/zck/2048.el") diff --git a/elpa/2048-game-20151026.1233/2048-game.el b/elpa/2048-game-20151026.1933/2048-game.el similarity index 99% rename from elpa/2048-game-20151026.1233/2048-game.el rename to elpa/2048-game-20151026.1933/2048-game.el index 6a146a9..dc00053 100644 --- a/elpa/2048-game-20151026.1233/2048-game.el +++ b/elpa/2048-game-20151026.1933/2048-game.el @@ -4,7 +4,7 @@ ;; Author: Zachary Kanfer ;; Version: 2014.03.27 -;; Package-Version: 20151026.1233 +;; Package-Version: 20151026.1933 ;; URL: https://bitbucket.org/zck/2048.el ;; This file is not part of GNU Emacs diff --git a/elpa/2048-game-20151026.1233/2048-game.elc b/elpa/2048-game-20151026.1933/2048-game.elc similarity index 99% rename from elpa/2048-game-20151026.1233/2048-game.elc rename to elpa/2048-game-20151026.1933/2048-game.elc index c147ca8..ab415fb 100644 Binary files a/elpa/2048-game-20151026.1233/2048-game.elc and b/elpa/2048-game-20151026.1933/2048-game.elc differ diff --git a/elpa/4clojure-20131014.1507/4clojure-pkg.el b/elpa/4clojure-20131014.1507/4clojure-pkg.el deleted file mode 100644 index eb2e384..0000000 --- a/elpa/4clojure-20131014.1507/4clojure-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "4clojure" "20131014.1507" "Open and evaluate 4clojure.com questions" '((json "1.2") (request "0.2.0"))) diff --git a/elpa/4clojure-20131014.1507/4clojure-autoloads.el b/elpa/4clojure-20131014.2207/4clojure-autoloads.el similarity index 93% rename from elpa/4clojure-20131014.1507/4clojure-autoloads.el rename to elpa/4clojure-20131014.2207/4clojure-autoloads.el index b76a7ca..191cf7c 100644 --- a/elpa/4clojure-20131014.1507/4clojure-autoloads.el +++ b/elpa/4clojure-20131014.2207/4clojure-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "4clojure" "4clojure.el" (23359 4549 0 0)) +;;;### (autoloads nil "4clojure" "4clojure.el" (23392 1960 0 0)) ;;; Generated autoloads from 4clojure.el (autoload '4clojure-open-question "4clojure" "\ diff --git a/elpa/4clojure-20131014.2207/4clojure-pkg.el b/elpa/4clojure-20131014.2207/4clojure-pkg.el new file mode 100644 index 0000000..6da5601 --- /dev/null +++ b/elpa/4clojure-20131014.2207/4clojure-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "4clojure" "20131014.2207" "Open and evaluate 4clojure.com questions" '((json "1.2") (request "0.2.0")) :commit "3cdfd356c24cd3518397d29ae833f56a4d20b4ca" :keywords '("languages" "data") :authors '(("Joshua Hoff")) :maintainer '("Joshua Hoff")) diff --git a/elpa/4clojure-20131014.1507/4clojure.el b/elpa/4clojure-20131014.2207/4clojure.el similarity index 97% rename from elpa/4clojure-20131014.1507/4clojure.el rename to elpa/4clojure-20131014.2207/4clojure.el index c7e422e..aa162ee 100644 --- a/elpa/4clojure-20131014.1507/4clojure.el +++ b/elpa/4clojure-20131014.2207/4clojure.el @@ -4,7 +4,7 @@ ;; Author: Joshua Hoff ;; Keywords: languages, data -;; Package-Version: 20131014.1507 +;; Package-Version: 20131014.2207 ;; Version: 0.1.1 ;; Package-Requires: ((json "1.2") (request "0.2.0")) diff --git a/elpa/4clojure-20131014.2207/4clojure.elc b/elpa/4clojure-20131014.2207/4clojure.elc new file mode 100644 index 0000000..a4e9273 Binary files /dev/null and b/elpa/4clojure-20131014.2207/4clojure.elc differ diff --git a/elpa/abyss-theme-20170808.645/abyss-theme-autoloads.el b/elpa/abyss-theme-20170808.1345/abyss-theme-autoloads.el similarity index 89% rename from elpa/abyss-theme-20170808.645/abyss-theme-autoloads.el rename to elpa/abyss-theme-20170808.1345/abyss-theme-autoloads.el index a0462d8..4906e9f 100644 --- a/elpa/abyss-theme-20170808.645/abyss-theme-autoloads.el +++ b/elpa/abyss-theme-20170808.1345/abyss-theme-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "abyss-theme" "abyss-theme.el" (23355 30461 +;;;### (autoloads nil "abyss-theme" "abyss-theme.el" (23392 1959 ;;;;;; 0 0)) ;;; Generated autoloads from abyss-theme.el diff --git a/elpa/abyss-theme-20170808.1345/abyss-theme-pkg.el b/elpa/abyss-theme-20170808.1345/abyss-theme-pkg.el new file mode 100644 index 0000000..ea4b9dd --- /dev/null +++ b/elpa/abyss-theme-20170808.1345/abyss-theme-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "abyss-theme" "20170808.1345" "A dark theme with contrasting colours." '((emacs "24")) :commit "18791c6e8d9cc2b4815c9f08627a2e94fc0eeb14" :keywords '("theme" "dark" "contrasting colours") :authors '(("Matt Russell" . "matt@mgrbyte.co.uk")) :maintainer '("Matt Russell" . "matt@mgrbyte.co.uk") :url "https://github.com/mgrbyte/emacs-abyss-theme") diff --git a/elpa/abyss-theme-20170808.645/abyss-theme.el b/elpa/abyss-theme-20170808.1345/abyss-theme.el similarity index 99% rename from elpa/abyss-theme-20170808.645/abyss-theme.el rename to elpa/abyss-theme-20170808.1345/abyss-theme.el index 4c9142d..e4004d5 100644 --- a/elpa/abyss-theme-20170808.645/abyss-theme.el +++ b/elpa/abyss-theme-20170808.1345/abyss-theme.el @@ -2,7 +2,7 @@ ;; Author: Matt Russell ;; Version: 0.7 -;; Package-Version: 20170808.645 +;; Package-Version: 20170808.1345 ;; Filename: abyss-theme.el ;; Package-Requires: ((emacs "24")) ;; Keywords: theme, dark, contrasting colours diff --git a/elpa/abyss-theme-20170808.645/abyss-theme.elc b/elpa/abyss-theme-20170808.1345/abyss-theme.elc similarity index 100% rename from elpa/abyss-theme-20170808.645/abyss-theme.elc rename to elpa/abyss-theme-20170808.1345/abyss-theme.elc diff --git a/elpa/abyss-theme-20170808.645/abyss-theme-pkg.el b/elpa/abyss-theme-20170808.645/abyss-theme-pkg.el deleted file mode 100644 index c7d0a64..0000000 --- a/elpa/abyss-theme-20170808.645/abyss-theme-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "abyss-theme" "20170808.645" "A dark theme with contrasting colours." '((emacs "24"))) diff --git a/elpa/ac-geiser-20130928.2347/ac-geiser-pkg.el b/elpa/ac-geiser-20130928.2347/ac-geiser-pkg.el deleted file mode 100644 index 09dbdd4..0000000 --- a/elpa/ac-geiser-20130928.2347/ac-geiser-pkg.el +++ /dev/null @@ -1,6 +0,0 @@ -(define-package "ac-geiser" "20130928.2347" "Auto-complete backend for geiser" - '((geiser "0.5") - (auto-complete "1.4"))) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/ac-geiser-20130928.2347/ac-geiser-autoloads.el b/elpa/ac-geiser-20130929.647/ac-geiser-autoloads.el similarity index 83% rename from elpa/ac-geiser-20130928.2347/ac-geiser-autoloads.el rename to elpa/ac-geiser-20130929.647/ac-geiser-autoloads.el index b118f35..9419913 100644 --- a/elpa/ac-geiser-20130928.2347/ac-geiser-autoloads.el +++ b/elpa/ac-geiser-20130929.647/ac-geiser-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "ac-geiser" "ac-geiser.el" (23356 35276 0 0)) +;;;### (autoloads nil "ac-geiser" "ac-geiser.el" (23392 1957 0 0)) ;;; Generated autoloads from ac-geiser.el (defvar ac-source-geiser '((candidates . ac-source-geiser-candidates) (symbol . "g") (document . ac-geiser-documentation)) "\ @@ -17,7 +17,7 @@ This affects only the current buffer. ;;;*** -;;;### (autoloads nil nil ("ac-geiser-pkg.el") (23356 35276 0 0)) +;;;### (autoloads nil nil ("ac-geiser-pkg.el") (23392 1957 0 0)) ;;;*** diff --git a/elpa/ac-geiser-20130929.647/ac-geiser-pkg.el b/elpa/ac-geiser-20130929.647/ac-geiser-pkg.el new file mode 100644 index 0000000..98dd33e --- /dev/null +++ b/elpa/ac-geiser-20130929.647/ac-geiser-pkg.el @@ -0,0 +1,6 @@ +(define-package "ac-geiser" "20130929.647" "Auto-complete backend for geiser" + '((geiser "0.5") + (auto-complete "1.4"))) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/ac-geiser-20130928.2347/ac-geiser.el b/elpa/ac-geiser-20130929.647/ac-geiser.el similarity index 100% rename from elpa/ac-geiser-20130928.2347/ac-geiser.el rename to elpa/ac-geiser-20130929.647/ac-geiser.el diff --git a/elpa/ac-geiser-20130928.2347/ac-geiser.elc b/elpa/ac-geiser-20130929.647/ac-geiser.elc similarity index 100% rename from elpa/ac-geiser-20130928.2347/ac-geiser.elc rename to elpa/ac-geiser-20130929.647/ac-geiser.elc diff --git a/elpa/ace-jump-mode-20140616.115/ace-jump-mode-pkg.el b/elpa/ace-jump-mode-20140616.115/ace-jump-mode-pkg.el deleted file mode 100644 index f8c20da..0000000 --- a/elpa/ace-jump-mode-20140616.115/ace-jump-mode-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "ace-jump-mode" "20140616.115" "a quick cursor location minor mode for emacs" 'nil :commit "8351e2df4fbbeb2a4003f2fb39f46d33803f3dac" :url "https://github.com/winterTTr/ace-jump-mode/" :keywords '("motion" "location" "cursor")) diff --git a/elpa/ace-jump-mode-20140616.115/ace-jump-mode-autoloads.el b/elpa/ace-jump-mode-20140616.815/ace-jump-mode-autoloads.el similarity index 95% rename from elpa/ace-jump-mode-20140616.115/ace-jump-mode-autoloads.el rename to elpa/ace-jump-mode-20140616.815/ace-jump-mode-autoloads.el index 400ef75..82ec5c9 100644 --- a/elpa/ace-jump-mode-20140616.115/ace-jump-mode-autoloads.el +++ b/elpa/ace-jump-mode-20140616.815/ace-jump-mode-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "ace-jump-mode" "ace-jump-mode.el" (22985 57838 +;;;### (autoloads nil "ace-jump-mode" "ace-jump-mode.el" (23392 1955 ;;;;;; 0 0)) ;;; Generated autoloads from ace-jump-mode.el diff --git a/elpa/ace-jump-mode-20140616.815/ace-jump-mode-pkg.el b/elpa/ace-jump-mode-20140616.815/ace-jump-mode-pkg.el new file mode 100644 index 0000000..dbd519b --- /dev/null +++ b/elpa/ace-jump-mode-20140616.815/ace-jump-mode-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "ace-jump-mode" "20140616.815" "a quick cursor location minor mode for emacs" 'nil :commit "8351e2df4fbbeb2a4003f2fb39f46d33803f3dac" :keywords '("motion" "location" "cursor") :authors '(("winterTTr" . "winterTTr@gmail.com")) :maintainer '("winterTTr" . "winterTTr@gmail.com") :url "https://github.com/winterTTr/ace-jump-mode/") diff --git a/elpa/ace-jump-mode-20140616.115/ace-jump-mode.el b/elpa/ace-jump-mode-20140616.815/ace-jump-mode.el similarity index 99% rename from elpa/ace-jump-mode-20140616.115/ace-jump-mode.el rename to elpa/ace-jump-mode-20140616.815/ace-jump-mode.el index 768ffba..73310d3 100644 --- a/elpa/ace-jump-mode-20140616.115/ace-jump-mode.el +++ b/elpa/ace-jump-mode-20140616.815/ace-jump-mode.el @@ -4,7 +4,7 @@ ;; Author : winterTTr ;; URL : https://github.com/winterTTr/ace-jump-mode/ -;; Package-Version: 20140616.115 +;; Package-Version: 20140616.815 ;; Version : 2.0.RC ;; Keywords : motion, location, cursor diff --git a/elpa/ace-jump-mode-20140616.115/ace-jump-mode.elc b/elpa/ace-jump-mode-20140616.815/ace-jump-mode.elc similarity index 94% rename from elpa/ace-jump-mode-20140616.115/ace-jump-mode.elc rename to elpa/ace-jump-mode-20140616.815/ace-jump-mode.elc index 9c14187..e2b0805 100644 Binary files a/elpa/ace-jump-mode-20140616.115/ace-jump-mode.elc and b/elpa/ace-jump-mode-20140616.815/ace-jump-mode.elc differ diff --git a/elpa/ace-link-20180308.100/ace-link-pkg.el b/elpa/ace-link-20180308.100/ace-link-pkg.el deleted file mode 100644 index 5798b30..0000000 --- a/elpa/ace-link-20180308.100/ace-link-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "ace-link" "20180308.100" "Quickly follow links" '((avy "0.4.0"))) diff --git a/elpa/ace-link-20180308.100/ace-link-autoloads.el b/elpa/ace-link-20180308.900/ace-link-autoloads.el similarity index 96% rename from elpa/ace-link-20180308.100/ace-link-autoloads.el rename to elpa/ace-link-20180308.900/ace-link-autoloads.el index cf2c18f..fcc9823 100644 --- a/elpa/ace-link-20180308.100/ace-link-autoloads.el +++ b/elpa/ace-link-20180308.900/ace-link-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "ace-link" "ace-link.el" (23363 22551 0 0)) +;;;### (autoloads nil "ace-link" "ace-link.el" (23392 1954 0 0)) ;;; Generated autoloads from ace-link.el (autoload 'ace-link "ace-link" "\ diff --git a/elpa/ace-link-20180308.900/ace-link-pkg.el b/elpa/ace-link-20180308.900/ace-link-pkg.el new file mode 100644 index 0000000..ff645e5 --- /dev/null +++ b/elpa/ace-link-20180308.900/ace-link-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "ace-link" "20180308.900" "Quickly follow links" '((avy "0.4.0")) :commit "fae5d508ff519ba1fab21c51f46c0906fd82229f" :keywords '("convenience" "links" "avy") :authors '(("Oleh Krehel" . "ohwoeowho@gmail.com")) :maintainer '("Oleh Krehel" . "ohwoeowho@gmail.com") :url "https://github.com/abo-abo/ace-link") diff --git a/elpa/ace-link-20180308.100/ace-link.el b/elpa/ace-link-20180308.900/ace-link.el similarity index 99% rename from elpa/ace-link-20180308.100/ace-link.el rename to elpa/ace-link-20180308.900/ace-link.el index dd305b1..03dffbc 100644 --- a/elpa/ace-link-20180308.100/ace-link.el +++ b/elpa/ace-link-20180308.900/ace-link.el @@ -4,7 +4,7 @@ ;; Author: Oleh Krehel ;; URL: https://github.com/abo-abo/ace-link -;; Package-Version: 20180308.100 +;; Package-Version: 20180308.900 ;; Version: 0.5.0 ;; Package-Requires: ((avy "0.4.0")) ;; Keywords: convenience, links, avy diff --git a/elpa/ace-link-20180308.100/ace-link.elc b/elpa/ace-link-20180308.900/ace-link.elc similarity index 100% rename from elpa/ace-link-20180308.100/ace-link.elc rename to elpa/ace-link-20180308.900/ace-link.elc diff --git a/elpa/ace-window-20180123.1111/ace-window-autoloads.el b/elpa/ace-window-20180123.1111/ace-window-autoloads.el deleted file mode 100644 index f8e4fad..0000000 --- a/elpa/ace-window-20180123.1111/ace-window-autoloads.el +++ /dev/null @@ -1,68 +0,0 @@ -;;; ace-window-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "ace-window" "ace-window.el" (23163 15951 0 -;;;;;; 0)) -;;; Generated autoloads from ace-window.el - -(autoload 'ace-select-window "ace-window" "\ -Ace select window. - -\(fn)" t nil) - -(autoload 'ace-delete-window "ace-window" "\ -Ace delete window. - -\(fn)" t nil) - -(autoload 'ace-swap-window "ace-window" "\ -Ace swap window. - -\(fn)" t nil) - -(autoload 'ace-delete-other-windows "ace-window" "\ -Ace delete other windows. - -\(fn)" t nil) - -(autoload 'ace-window "ace-window" "\ -Select a window. -Perform an action based on ARG described below. - -By default, behaves like extended `other-window'. - -Prefixed with one \\[universal-argument], does a swap between the -selected window and the current window, so that the selected -buffer moves to current window (and current buffer moves to -selected window). - -Prefixed with two \\[universal-argument]'s, deletes the selected -window. - -\(fn ARG)" t nil) - -(defvar ace-window-display-mode nil "\ -Non-nil if Ace-Window-Display mode is enabled. -See the `ace-window-display-mode' command -for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `ace-window-display-mode'.") - -(custom-autoload 'ace-window-display-mode "ace-window" nil) - -(autoload 'ace-window-display-mode "ace-window" "\ -Minor mode for showing the ace window key in the mode line. - -\(fn &optional ARG)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; ace-window-autoloads.el ends here diff --git a/elpa/ace-window-20180123.1111/ace-window-pkg.el b/elpa/ace-window-20180123.1111/ace-window-pkg.el deleted file mode 100644 index c02a3f1..0000000 --- a/elpa/ace-window-20180123.1111/ace-window-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "ace-window" "20180123.1111" "Quickly switch windows." '((avy "0.2.0")) :commit "208ea2a4e809f0c91caf3354b44a8f4a4f1cbb73" :url "https://github.com/abo-abo/ace-window" :keywords '("window" "location")) diff --git a/elpa/ace-window-20180123.1111/ace-window.el b/elpa/ace-window-20180123.1111/ace-window.el deleted file mode 100644 index 7b46a5e..0000000 --- a/elpa/ace-window-20180123.1111/ace-window.el +++ /dev/null @@ -1,768 +0,0 @@ -;;; ace-window.el --- Quickly switch windows. -*- lexical-binding: t -*- - -;; Copyright (C) 2015 Free Software Foundation, Inc. - -;; Author: Oleh Krehel -;; Maintainer: Oleh Krehel -;; URL: https://github.com/abo-abo/ace-window -;; Package-Version: 20180123.1111 -;; Version: 0.9.0 -;; Package-Requires: ((avy "0.2.0")) -;; Keywords: window, location - -;; This file is part of GNU Emacs. - -;; This file 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. - -;; For a full copy of the GNU General Public License -;; see . - -;;; Commentary: -;; -;; The main function, `ace-window' is meant to replace `other-window' -;; by assigning each window a short, unique label. When there are only -;; two windows present, `other-window' is called (unless -;; aw-dispatch-always is set non-nil). If there are more, each -;; window will have its first label character highlighted. Once a -;; unique label is typed, ace-window will switch to that window. -;; -;; To setup this package, just add to your .emacs: -;; -;; (global-set-key (kbd "M-o") 'ace-window) -;; -;; replacing "M-o" with an appropriate shortcut. -;; -;; By default, ace-window uses numbers for window labels so the window -;; labeling is intuitively ordered. But if you prefer to type keys on -;; your home row for quicker access, use this setting: -;; -;; (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)) -;; -;; Whenever ace-window prompts for a window selection, it grays out -;; all the window characters, highlighting window labels in red. To -;; disable this behavior, set this: -;; -;; (setq aw-background nil) -;; -;; If you want to know the selection characters ahead of time, turn on -;; `ace-window-display-mode'. -;; -;; When prefixed with one `universal-argument', instead of switching -;; to the selected window, the selected window is swapped with the -;; current one. -;; -;; When prefixed with two `universal-argument', the selected window is -;; deleted instead. - -;;; Code: -(require 'avy) -(require 'ring) -(require 'subr-x) - -;;* Customization -(defgroup ace-window nil - "Quickly switch current window." - :group 'convenience - :prefix "aw-") - -(defcustom aw-keys '(?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9) - "Keys for selecting window." - :type '(repeat character)) - -(defcustom aw-scope 'global - "The scope used by `ace-window'." - :type '(choice - (const :tag "visible frames" visible) - (const :tag "global" global) - (const :tag "frame" frame))) - -(defcustom aw-minibuffer-flag nil - "When non-nil, also display `ace-window-mode' string in the minibuffer when ace-window is active." - :type 'boolean) - -(defcustom aw-ignored-buffers '("*Calc Trail*" "*LV*") - "List of buffers and major-modes to ignore when choosing a window from the window list. -Active only when `aw-ignore-on' is non-nil. Windows displaying these -buffers can still be chosen by typing their specific labels." - :type '(repeat string)) - -(defcustom aw-ignore-on t - "When t, `ace-window' will ignore buffers and major-modes in `aw-ignored-buffers'. -Use M-0 `ace-window' to toggle this value." - :type 'boolean) - -(defcustom aw-ignore-current nil - "When t, `ace-window' will ignore `selected-window'." - :type 'boolean) - -(defcustom aw-background t - "When t, `ace-window' will dim out all buffers temporarily when used." - :type 'boolean) - -(defcustom aw-leading-char-style 'char - "Style of the leading char overlay." - :type '(choice - (const :tag "single char" 'char) - (const :tag "full path" 'path))) - -(defcustom aw-dispatch-always nil - "When non-nil, `ace-window' will issue a `read-char' even for one window. -This will make `ace-window' act different from `other-window' for - one or two windows." - :type 'boolean) - -(defcustom aw-dispatch-when-more-than 2 - "If the number of windows is more than this, activate ace-window-ness." - :type 'integer) - -(defcustom aw-reverse-frame-list nil - "When non-nil `ace-window' will order frames for selection in -the reverse of `frame-list'" - :type 'boolean) - -(defcustom aw-frame-offset '(13 . 23) - "Increase in pixel offset for new ace-window frames relative to the selected frame. -Its value is an (x-offset . y-offset) pair in pixels." - :type '(cons integer integer)) - -(defcustom aw-frame-size nil - "Frame size to make new ace-window frames. -Its value is a (width . height) pair in pixels or nil for the default frame size. -(0 . 0) is special and means make the frame size the same as the last selected frame size." - :type '(cons integer integer)) - -;; Must be defined before `aw-make-frame-char' since its :set function references this. -(defvar aw-dispatch-alist - '((?x aw-delete-window "Delete Window") - (?m aw-swap-window "Swap Windows") - (?M aw-move-window "Move Window") - (?j aw-switch-buffer-in-window "Select Buffer") - (?n aw-flip-window) - (?u aw-switch-buffer-other-window "Switch Buffer Other Window") - (?c aw-split-window-fair "Split Fair Window") - (?v aw-split-window-vert "Split Vert Window") - (?b aw-split-window-horz "Split Horz Window") - (?o delete-other-windows "Delete Other Windows") - (?? aw-show-dispatch-help)) - "List of actions for `aw-dispatch-default'. -Each action is a list of either: - (char function description) where function takes a single window argument -or - (char function) where function takes no argument and the description is omitted.") - -(defun aw-set-make-frame-char (option value) - ;; Signal an error if `aw-make-frame-char' is ever set to an invalid - ;; or conflicting value. - (when value - (cond ((not (characterp value)) - (user-error "`aw-make-frame-char' must be a character, not `%s'" value)) - ((memq value aw-keys) - (user-error "`aw-make-frame-char' is `%c'; this conflicts with the same character in `aw-keys'" value)) - ((assq value aw-dispatch-alist) - (user-error "`aw-make-frame-char' is `%c'; this conflicts with the same character in `aw-dispatch-alist'" value)))) - (set option value)) - -(defcustom aw-make-frame-char ?z - "Non-existing ace window label character that triggers creation of a new single-window frame for display." - :set 'aw-set-make-frame-char - :type 'character) - -(defface aw-leading-char-face - '((((class color)) (:foreground "red")) - (((background dark)) (:foreground "gray100")) - (((background light)) (:foreground "gray0")) - (t (:foreground "gray100" :underline nil))) - "Face for each window's leading char.") - -(defface aw-background-face - '((t (:foreground "gray40"))) - "Face for whole window background during selection.") - -(defface aw-mode-line-face - '((t (:inherit mode-line-buffer-id))) - "Face used for displaying the ace window key in the mode-line.") - -(defface aw-key-face - '((t :inherit font-lock-builtin-face)) - "Face used by `aw-show-dispatch-help'.") - -;;* Implementation -(defun aw-ignored-p (window) - "Return t if WINDOW should be ignored when choosing from the window list." - (or (and aw-ignore-on - ;; Ignore major-modes and buffer-names in `aw-ignored-buffers'. - (or (memq (buffer-local-value 'major-mode (window-buffer window)) - aw-ignored-buffers) - (member (buffer-name (window-buffer window)) aw-ignored-buffers))) - ;; Ignore selected window if `aw-ignore-current' is non-nil. - (and aw-ignore-current - (equal window (selected-window))) - ;; When `ignore-window-parameters' is nil, ignore windows whose - ;; `no-other-window’ or `no-delete-other-windows' parameter is non-nil. - (unless ignore-window-parameters - (cl-case this-command - (ace-select-window (window-parameter window 'no-other-window)) - (ace-delete-window (window-parameter window 'no-delete-other-windows)) - (ace-delete-other-windows (window-parameter - window 'no-delete-other-windows)))))) - -(defun aw-window-list () - "Return the list of interesting windows." - (sort - (cl-remove-if - (lambda (w) - (let ((f (window-frame w))) - (or (not (and (frame-live-p f) - (frame-visible-p f))) - (string= "initial_terminal" (terminal-name f)) - (aw-ignored-p w)))) - (cl-case aw-scope - (visible - (cl-mapcan #'window-list (visible-frame-list))) - (global - (cl-mapcan #'window-list (frame-list))) - (frame - (window-list)) - (t - (error "Invalid `aw-scope': %S" aw-scope)))) - 'aw-window<)) - -(defvar aw-overlays-back nil - "Hold overlays for when `aw-background' is t.") - -(defvar ace-window-mode nil - "Minor mode during the selection process.") - -;; register minor mode -(or (assq 'ace-window-mode minor-mode-alist) - (nconc minor-mode-alist - (list '(ace-window-mode ace-window-mode)))) - -(defvar aw-empty-buffers-list nil - "Store the read-only empty buffers which had to be modified. -Modify them back eventually.") - -(defun aw--done () - "Clean up mode line and overlays." - ;; mode line - (aw-set-mode-line nil) - ;; background - (mapc #'delete-overlay aw-overlays-back) - (setq aw-overlays-back nil) - (avy--remove-leading-chars) - (dolist (b aw-empty-buffers-list) - (with-current-buffer b - (when (string= (buffer-string) " ") - (let ((inhibit-read-only t)) - (delete-region (point-min) (point-max)))))) - (setq aw-empty-buffers-list nil)) - -(defun aw--lead-overlay (path leaf) - "Create an overlay using PATH at LEAF. -LEAF is (PT . WND)." - (let ((wnd (cdr leaf))) - (with-selected-window wnd - (when (= 0 (buffer-size)) - (push (current-buffer) aw-empty-buffers-list) - (let ((inhibit-read-only t)) - (insert " "))) - (let* ((pt (car leaf)) - (ol (make-overlay pt (1+ pt) (window-buffer wnd))) - (old-str (or - (ignore-errors - (with-selected-window wnd - (buffer-substring pt (1+ pt)))) - "")) - (new-str - (concat - (cl-case aw-leading-char-style - (char - (string (avy--key-to-char (car (last path))))) - (path - (mapconcat - (lambda (x) (string (avy--key-to-char x))) - (reverse path) - "")) - (t - (error "Bad `aw-leading-char-style': %S" - aw-leading-char-style))) - (cond ((string-equal old-str "\t") - (make-string (1- tab-width) ?\ )) - ((string-equal old-str "\n") - "\n") - (t - (make-string - (max 0 (1- (string-width old-str))) - ?\ )))))) - (overlay-put ol 'face 'aw-leading-char-face) - (overlay-put ol 'window wnd) - (overlay-put ol 'display new-str) - (push ol avy--overlays-lead))))) - -(defun aw--make-backgrounds (wnd-list) - "Create a dim background overlay for each window on WND-LIST." - (when aw-background - (setq aw-overlays-back - (mapcar (lambda (w) - (let ((ol (make-overlay - (window-start w) - (window-end w) - (window-buffer w)))) - (overlay-put ol 'face 'aw-background-face) - ol)) - wnd-list)))) - -(define-obsolete-variable-alias - 'aw-flip-keys 'aw--flip-keys "0.1.0" - "Use `aw-dispatch-alist' instead.") - -(defvar aw-dispatch-function 'aw-dispatch-default - "Function to call when a character not in `aw-keys' is pressed.") - -(defvar aw-action nil - "Function to call at the end of `aw-select'.") - -(defun aw-set-mode-line (str) - "Set mode line indicator to STR." - (setq ace-window-mode str) - (when (and aw-minibuffer-flag ace-window-mode) - (message "%s" (string-trim-left str))) - (force-mode-line-update)) - -(defun aw--dispatch-action (char) - "Return item from `aw-dispatch-alist' matching CHAR." - (assoc char aw-dispatch-alist)) - -(defun aw-make-frame () - "Make a new Emacs frame using the values of `aw-frame-size' and `aw-frame-offset'." - (make-frame - (delq nil - (list - ;; This first parameter is important because an - ;; aw-dispatch-alist command may not want to leave this - ;; frame with input focus. If it is given focus, the - ;; command may not be able to return focus to a different - ;; frame since this is done asynchronously by the window - ;; manager. - '(no-focus-on-map . t) - (when aw-frame-size - (cons 'width - (if (zerop (car aw-frame-size)) - (frame-width) - (car aw-frame-size)))) - (when aw-frame-size - (cons 'height - (if (zerop (cdr aw-frame-size)) - (frame-height) - (car aw-frame-size)))) - (cons 'left (+ (car aw-frame-offset) - (car (frame-position)))) - (cons 'top (+ (cdr aw-frame-offset) - (cdr (frame-position)))))))) - -(defun aw-use-frame (window) - "Create a new frame using the contents of WINDOW. - -The new frame is set to the same size as the previous frame, offset by -`aw-frame-offset' (x . y) pixels." - (aw-switch-to-window window) - (aw-make-frame)) - -(defun aw-clean-up-avy-current-path () - "Edit `avy-current-path' so only window label characters remain." - ;; Remove any possible ace-window command char that may - ;; precede the last specified window label, so - ;; functions can use `avy-current-path' as the chosen - ;; window label. - (when (and (> (length avy-current-path) 0) - (assq (aref avy-current-path 0) aw-dispatch-alist)) - (setq avy-current-path (substring avy-current-path 1)))) - -(defun aw-dispatch-default (char) - "Perform an action depending on CHAR." - (cond ((and (fboundp 'avy-mouse-event-window) - (avy-mouse-event-window char))) - ((= char (aref (kbd "C-g") 0)) - (throw 'done 'exit)) - ((= char aw-make-frame-char) - ;; Make a new frame and perform any action on its window. - (let ((start-win (selected-window)) - (end-win (frame-selected-window (aw-make-frame)))) - (if aw-action - ;; Action must be called from the start-win. The action - ;; determines which window to leave selected. - (progn (select-frame-set-input-focus (window-frame start-win)) - (funcall aw-action end-win)) - ;; Select end-win when no action - (aw-switch-to-window end-win))) - (throw 'done 'exit)) - (t - (let ((action (aw--dispatch-action char))) - (if action - (cl-destructuring-bind (_key fn &optional description) action - (if (and fn description) - (prog1 (setq aw-action fn) - (aw-set-mode-line (format " Ace - %s" description))) - (funcall fn) - (throw 'done 'exit))) - (aw-clean-up-avy-current-path) - ;; Prevent any char from triggering an avy dispatch command. - (let ((avy-dispatch-alist)) - (avy-handler-default char))))))) - -(defun aw-select (mode-line &optional action) - "Return a selected other window. -Amend MODE-LINE to the mode line for the duration of the selection." - (setq aw-action action) - (let ((start-window (selected-window)) - (next-window-scope (cl-case aw-scope - ('visible 'visible) - ('global 'visible) - ('frame 'frame))) - (wnd-list (aw-window-list)) - window) - (setq window - (cond ((<= (length wnd-list) 1) - (when aw-dispatch-always - (setq aw-action - (unwind-protect - (catch 'done - (funcall aw-dispatch-function (read-char))) - (aw--done))) - (when (eq aw-action 'exit) - (setq aw-action nil))) - (or (car wnd-list) start-window)) - ((and (<= (length wnd-list) aw-dispatch-when-more-than) - (not aw-dispatch-always) - (not aw-ignore-current)) - (let ((wnd (next-window nil nil next-window-scope))) - (while (and (or (not (memq wnd wnd-list)) - (aw-ignored-p wnd)) - (not (equal wnd start-window))) - (setq wnd (next-window wnd nil next-window-scope))) - wnd)) - (t - (let ((candidate-list - (mapcar (lambda (wnd) - (cons (aw-offset wnd) wnd)) - wnd-list))) - (aw--make-backgrounds wnd-list) - (aw-set-mode-line mode-line) - ;; turn off helm transient map - (remove-hook 'post-command-hook 'helm--maybe-update-keymap) - (unwind-protect - (let* ((avy-handler-function aw-dispatch-function) - (avy-translate-char-function #'identity) - (res (avy-read (avy-tree candidate-list aw-keys) - #'aw--lead-overlay - #'avy--remove-leading-chars))) - (if (eq res 'exit) - (setq aw-action nil) - (or (cdr res) - start-window))) - (aw--done)))))) - (if aw-action - (funcall aw-action window) - window))) - -;;* Interactive -;;;###autoload -(defun ace-select-window () - "Ace select window." - (interactive) - (aw-select " Ace - Window" - #'aw-switch-to-window)) - -;;;###autoload -(defun ace-delete-window () - "Ace delete window." - (interactive) - (aw-select " Ace - Delete Window" - #'aw-delete-window)) - -;;;###autoload -(defun ace-swap-window () - "Ace swap window." - (interactive) - (aw-select " Ace - Swap Window" - #'aw-swap-window)) - -;;;###autoload -(defun ace-delete-other-windows () - "Ace delete other windows." - (interactive) - (aw-select " Ace - Delete Other Windows" - #'delete-other-windows)) - -(define-obsolete-function-alias - 'ace-maximize-window 'ace-delete-other-windows "0.10.0") - -;;;###autoload -(defun ace-window (arg) - "Select a window. -Perform an action based on ARG described below. - -By default, behaves like extended `other-window'. - -Prefixed with one \\[universal-argument], does a swap between the -selected window and the current window, so that the selected -buffer moves to current window (and current buffer moves to -selected window). - -Prefixed with two \\[universal-argument]'s, deletes the selected -window." - (interactive "p") - (cl-case arg - (0 - (setq aw-ignore-on - (not aw-ignore-on)) - (ace-select-window)) - (4 (ace-swap-window)) - (16 (ace-delete-window)) - (t (ace-select-window)))) - -;;* Utility -(defun aw-window< (wnd1 wnd2) - "Return true if WND1 is less than WND2. -This is determined by their respective window coordinates. -Windows are numbered top down, left to right." - (let ((f1 (window-frame wnd1)) - (f2 (window-frame wnd2)) - (e1 (window-edges wnd1)) - (e2 (window-edges wnd2))) - (cond ((string< (frame-parameter f1 'window-id) - (frame-parameter f2 'window-id)) - aw-reverse-frame-list) - ((< (car e1) (car e2)) - t) - ((> (car e1) (car e2)) - nil) - ((< (cadr e1) (cadr e2)) - t)))) - -(defvar aw--window-ring (make-ring 10) - "Hold the window switching history.") - -(defun aw--push-window (window) - "Store WINDOW to `aw--window-ring'." - (when (or (zerop (ring-length aw--window-ring)) - (not (equal - (ring-ref aw--window-ring 0) - window))) - (ring-insert aw--window-ring (selected-window)))) - -(defun aw--pop-window () - "Return the removed top of `aw--window-ring'." - (let (res) - (condition-case nil - (while (or (not (window-live-p - (setq res (ring-remove aw--window-ring 0)))) - (equal res (selected-window)))) - (error - (if (= (length (aw-window-list)) 2) - (progn - (other-window 1) - (setq res (selected-window))) - (error "No previous windows stored")))) - res)) - -(defun aw-switch-to-window (window) - "Switch to the window WINDOW." - (let ((frame (window-frame window))) - (aw--push-window (selected-window)) - (when (and (frame-live-p frame) - (not (eq frame (selected-frame)))) - (select-frame-set-input-focus frame)) - (if (window-live-p window) - (select-window window) - (error "Got a dead window %S" window)))) - -(defun aw-flip-window () - "Switch to the window you were previously in." - (interactive) - (aw-switch-to-window (aw--pop-window))) - -(defun aw-show-dispatch-help () - "Display action shortucts in echo area." - (interactive) - (message "%s" (mapconcat - (lambda (action) - (cl-destructuring-bind (key fn &optional description) action - (format "%s: %s" - (propertize - (char-to-string key) - 'face 'aw-key-face) - (or description fn)))) - aw-dispatch-alist - "\n")) - ;; Prevent this from replacing any help display - ;; in the minibuffer. - (let (aw-minibuffer-flag) - (mapc #'delete-overlay aw-overlays-back) - (call-interactively 'ace-window))) - -(defun aw-delete-window (window) - "Delete window WINDOW." - (let ((frame (window-frame window))) - (when (and (frame-live-p frame) - (not (eq frame (selected-frame)))) - (select-frame-set-input-focus (window-frame window))) - (if (= 1 (length (window-list))) - (delete-frame frame) - (if (window-live-p window) - (delete-window window) - (error "Got a dead window %S" window))))) - -(defun aw-switch-buffer-in-window (window) - "Select buffer in WINDOW." - (aw-switch-to-window window) - (aw--switch-buffer)) - -(declare-function ivy-switch-buffer "ext:ivy") - -(defun aw--switch-buffer () - (cond ((bound-and-true-p ivy-mode) - (ivy-switch-buffer)) - ((bound-and-true-p ido-mode) - (ido-switch-buffer)) - (t - (call-interactively 'switch-to-buffer)))) - -(defcustom aw-swap-invert nil - "When non-nil, the other of the two swapped windows gets the point." - :type 'boolean) - -(defun aw-swap-window (window) - "Swap buffers of current window and WINDOW." - (cl-labels ((swap-windows (window1 window2) - "Swap the buffers of WINDOW1 and WINDOW2." - (let ((buffer1 (window-buffer window1)) - (buffer2 (window-buffer window2))) - (set-window-buffer window1 buffer2) - (set-window-buffer window2 buffer1) - (select-window window2)))) - (let ((frame (window-frame window)) - (this-window (selected-window))) - (when (and (frame-live-p frame) - (not (eq frame (selected-frame)))) - (select-frame-set-input-focus (window-frame window))) - (when (and (window-live-p window) - (not (eq window this-window))) - (aw--push-window this-window) - (if aw-swap-invert - (swap-windows window this-window) - (swap-windows this-window window)))))) - -(defun aw-move-window (window) - "Move the current buffer to WINDOW. -Switch the current window to the previous buffer." - (let ((buffer (current-buffer))) - (switch-to-buffer (other-buffer)) - (aw-switch-to-window window) - (switch-to-buffer buffer))) - -(defun aw-split-window-vert (window) - "Split WINDOW vertically." - (select-window window) - (split-window-vertically)) - -(defun aw-split-window-horz (window) - "Split WINDOW horizontally." - (select-window window) - (split-window-horizontally)) - -(defcustom aw-fair-aspect-ratio 2 - "The aspect ratio to aim for when splitting windows. -Sizes are based on the number of characters, not pixels. -Increase to prefer wider windows, or decrease for taller windows." - :type 'number) - -(defun aw-split-window-fair (window) - "Split WINDOW vertically or horizontally, based on its current dimensions. -Modify `aw-fair-aspect-ratio' to tweak behavior." - (let ((w (window-body-width window)) - (h (window-body-height window))) - (if (< (* h aw-fair-aspect-ratio) w) - (aw-split-window-horz window) - (aw-split-window-vert window)))) - -(defun aw-switch-buffer-other-window (window) - "Switch buffer in WINDOW without selecting WINDOW." - (aw-switch-to-window window) - (aw--switch-buffer) - (aw-flip-window)) - -(defun aw-offset (window) - "Return point in WINDOW that's closest to top left corner. -The point is writable, i.e. it's not part of space after newline." - (let ((h (window-hscroll window)) - (beg (window-start window)) - (end (window-end window)) - (inhibit-field-text-motion t)) - (with-current-buffer - (window-buffer window) - (save-excursion - (goto-char beg) - (while (and (< (point) end) - (< (- (line-end-position) - (line-beginning-position)) - h)) - (forward-line)) - (+ (point) h))))) - -;;* Mode line -;;;###autoload -(define-minor-mode ace-window-display-mode - "Minor mode for showing the ace window key in the mode line." - :global t - (if ace-window-display-mode - (progn - (aw-update) - (set-default - 'mode-line-format - `((ace-window-display-mode - (:eval (window-parameter (selected-window) 'ace-window-path))) - ,@(assq-delete-all - 'ace-window-display-mode - (default-value 'mode-line-format)))) - (force-mode-line-update t) - (add-hook 'window-configuration-change-hook 'aw-update) - ;; Add at the end so does not precede select-frame call. - (add-hook 'after-make-frame-functions (lambda (_) (aw-update)) t)) - (set-default - 'mode-line-format - (assq-delete-all - 'ace-window-display-mode - (default-value 'mode-line-format))) - (remove-hook 'window-configuration-change-hook 'aw-update) - (remove-hook 'after-make-frame-functions 'aw-update))) - -(defun aw-update () - "Update ace-window-path window parameter for all windows. - -Ensure all windows are labeled so the user can select a specific -one, even from the set of windows typically ignored when making a -window list." - (let ((aw-ignore-on) - (aw-ignore-current) - (ignore-window-parameters t)) - (avy-traverse - (avy-tree (aw-window-list) aw-keys) - (lambda (path leaf) - (set-window-parameter - leaf 'ace-window-path - (propertize - (apply #'string (reverse path)) - 'face 'aw-mode-line-face)))))) - -(provide 'ace-window) - -;;; ace-window.el ends here diff --git a/elpa/ace-window-20180123.1111/ace-window.elc b/elpa/ace-window-20180123.1111/ace-window.elc deleted file mode 100644 index 4161179..0000000 Binary files a/elpa/ace-window-20180123.1111/ace-window.elc and /dev/null differ diff --git a/elpa/ace-window-20180607.1223/ace-window-autoloads.el b/elpa/ace-window-20180607.1223/ace-window-autoloads.el deleted file mode 100644 index ae90935..0000000 --- a/elpa/ace-window-20180607.1223/ace-window-autoloads.el +++ /dev/null @@ -1,68 +0,0 @@ -;;; ace-window-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "ace-window" "ace-window.el" (23330 6283 0 -;;;;;; 0)) -;;; Generated autoloads from ace-window.el - -(autoload 'ace-select-window "ace-window" "\ -Ace select window. - -\(fn)" t nil) - -(autoload 'ace-delete-window "ace-window" "\ -Ace delete window. - -\(fn)" t nil) - -(autoload 'ace-swap-window "ace-window" "\ -Ace swap window. - -\(fn)" t nil) - -(autoload 'ace-delete-other-windows "ace-window" "\ -Ace delete other windows. - -\(fn)" t nil) - -(autoload 'ace-window "ace-window" "\ -Select a window. -Perform an action based on ARG described below. - -By default, behaves like extended `other-window'. - -Prefixed with one \\[universal-argument], does a swap between the -selected window and the current window, so that the selected -buffer moves to current window (and current buffer moves to -selected window). - -Prefixed with two \\[universal-argument]'s, deletes the selected -window. - -\(fn ARG)" t nil) - -(defvar ace-window-display-mode nil "\ -Non-nil if Ace-Window-Display mode is enabled. -See the `ace-window-display-mode' command -for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `ace-window-display-mode'.") - -(custom-autoload 'ace-window-display-mode "ace-window" nil) - -(autoload 'ace-window-display-mode "ace-window" "\ -Minor mode for showing the ace window key in the mode line. - -\(fn &optional ARG)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; ace-window-autoloads.el ends here diff --git a/elpa/ace-window-20180607.1223/ace-window-pkg.el b/elpa/ace-window-20180607.1223/ace-window-pkg.el deleted file mode 100644 index 7b324bc..0000000 --- a/elpa/ace-window-20180607.1223/ace-window-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "ace-window" "20180607.1223" "Quickly switch windows." '((avy "0.2.0")) :commit "92d20e7e75dbb2ba0b879d3aedb8bed51fcee6a7" :keywords '("window" "location") :url "https://github.com/abo-abo/ace-window") diff --git a/elpa/ace-window-20180607.1223/ace-window.el b/elpa/ace-window-20180607.1223/ace-window.el deleted file mode 100644 index b6759c4..0000000 --- a/elpa/ace-window-20180607.1223/ace-window.el +++ /dev/null @@ -1,802 +0,0 @@ -;;; ace-window.el --- Quickly switch windows. -*- lexical-binding: t -*- - -;; Copyright (C) 2015 Free Software Foundation, Inc. - -;; Author: Oleh Krehel -;; Maintainer: Oleh Krehel -;; URL: https://github.com/abo-abo/ace-window -;; Package-Version: 20180607.1223 -;; Version: 0.9.0 -;; Package-Requires: ((avy "0.2.0")) -;; Keywords: window, location - -;; This file is part of GNU Emacs. - -;; This file 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. - -;; For a full copy of the GNU General Public License -;; see . - -;;; Commentary: -;; -;; The main function, `ace-window' is meant to replace `other-window' -;; by assigning each window a short, unique label. When there are only -;; two windows present, `other-window' is called (unless -;; aw-dispatch-always is set non-nil). If there are more, each -;; window will have its first label character highlighted. Once a -;; unique label is typed, ace-window will switch to that window. -;; -;; To setup this package, just add to your .emacs: -;; -;; (global-set-key (kbd "M-o") 'ace-window) -;; -;; replacing "M-o" with an appropriate shortcut. -;; -;; By default, ace-window uses numbers for window labels so the window -;; labeling is intuitively ordered. But if you prefer to type keys on -;; your home row for quicker access, use this setting: -;; -;; (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)) -;; -;; Whenever ace-window prompts for a window selection, it grays out -;; all the window characters, highlighting window labels in red. To -;; disable this behavior, set this: -;; -;; (setq aw-background nil) -;; -;; If you want to know the selection characters ahead of time, turn on -;; `ace-window-display-mode'. -;; -;; When prefixed with one `universal-argument', instead of switching -;; to the selected window, the selected window is swapped with the -;; current one. -;; -;; When prefixed with two `universal-argument', the selected window is -;; deleted instead. - -;;; Code: -(require 'avy) -(require 'ring) -(require 'subr-x) - -;;* Customization -(defgroup ace-window nil - "Quickly switch current window." - :group 'convenience - :prefix "aw-") - -(defcustom aw-keys '(?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9) - "Keys for selecting window." - :type '(repeat character)) - -(defcustom aw-scope 'global - "The scope used by `ace-window'." - :type '(choice - (const :tag "visible frames" visible) - (const :tag "global" global) - (const :tag "frame" frame))) - -(defcustom aw-minibuffer-flag nil - "When non-nil, also display `ace-window-mode' string in the minibuffer when ace-window is active." - :type 'boolean) - -(defcustom aw-ignored-buffers '("*Calc Trail*" "*LV*") - "List of buffers and major-modes to ignore when choosing a window from the window list. -Active only when `aw-ignore-on' is non-nil. Windows displaying these -buffers can still be chosen by typing their specific labels." - :type '(repeat string)) - -(defcustom aw-ignore-on t - "When t, `ace-window' will ignore buffers and major-modes in `aw-ignored-buffers'. -Use M-0 `ace-window' to toggle this value." - :type 'boolean) - -(defcustom aw-ignore-current nil - "When t, `ace-window' will ignore `selected-window'." - :type 'boolean) - -(defcustom aw-background t - "When t, `ace-window' will dim out all buffers temporarily when used." - :type 'boolean) - -(defcustom aw-leading-char-style 'char - "Style of the leading char overlay." - :type '(choice - (const :tag "single char" 'char) - (const :tag "full path" 'path))) - -(defcustom aw-dispatch-always nil - "When non-nil, `ace-window' will issue a `read-char' even for one window. -This will make `ace-window' act different from `other-window' for - one or two windows." - :type 'boolean) - -(defcustom aw-dispatch-when-more-than 2 - "If the number of windows is more than this, activate ace-window-ness." - :type 'integer) - -(defcustom aw-reverse-frame-list nil - "When non-nil `ace-window' will order frames for selection in -the reverse of `frame-list'" - :type 'boolean) - -(defcustom aw-frame-offset '(13 . 23) - "Increase in pixel offset for new ace-window frames relative to the selected frame. -Its value is an (x-offset . y-offset) pair in pixels." - :type '(cons integer integer)) - -(defcustom aw-frame-size nil - "Frame size to make new ace-window frames. -Its value is a (width . height) pair in pixels or nil for the default frame size. -(0 . 0) is special and means make the frame size the same as the last selected frame size." - :type '(cons integer integer)) - -(defcustom aw-char-position 'top-left - "Window positions of the character overlay. -Consider changing this if the overlay tends to overlap with other things." - :type '(choice - (const :tag "top left corner only" 'top-left) - (const :tag "both left corners" 'left))) - -;; Must be defined before `aw-make-frame-char' since its :set function references this. -(defvar aw-dispatch-alist - '((?x aw-delete-window "Delete Window") - (?m aw-swap-window "Swap Windows") - (?M aw-move-window "Move Window") - (?j aw-switch-buffer-in-window "Select Buffer") - (?n aw-flip-window) - (?u aw-switch-buffer-other-window "Switch Buffer Other Window") - (?c aw-split-window-fair "Split Fair Window") - (?v aw-split-window-vert "Split Vert Window") - (?b aw-split-window-horz "Split Horz Window") - (?o delete-other-windows "Delete Other Windows") - (?? aw-show-dispatch-help)) - "List of actions for `aw-dispatch-default'. -Each action is a list of either: - (char function description) where function takes a single window argument -or - (char function) where function takes no argument and the description is omitted.") - -(defun aw-set-make-frame-char (option value) - ;; Signal an error if `aw-make-frame-char' is ever set to an invalid - ;; or conflicting value. - (when value - (cond ((not (characterp value)) - (user-error "`aw-make-frame-char' must be a character, not `%s'" value)) - ((memq value aw-keys) - (user-error "`aw-make-frame-char' is `%c'; this conflicts with the same character in `aw-keys'" value)) - ((assq value aw-dispatch-alist) - (user-error "`aw-make-frame-char' is `%c'; this conflicts with the same character in `aw-dispatch-alist'" value)))) - (set option value)) - -(defcustom aw-make-frame-char ?z - "Non-existing ace window label character that triggers creation of a new single-window frame for display." - :set 'aw-set-make-frame-char - :type 'character) - -(defface aw-leading-char-face - '((((class color)) (:foreground "red")) - (((background dark)) (:foreground "gray100")) - (((background light)) (:foreground "gray0")) - (t (:foreground "gray100" :underline nil))) - "Face for each window's leading char.") - -(defface aw-background-face - '((t (:foreground "gray40"))) - "Face for whole window background during selection.") - -(defface aw-mode-line-face - '((t (:inherit mode-line-buffer-id))) - "Face used for displaying the ace window key in the mode-line.") - -(defface aw-key-face - '((t :inherit font-lock-builtin-face)) - "Face used by `aw-show-dispatch-help'.") - -;;* Implementation -(defun aw-ignored-p (window) - "Return t if WINDOW should be ignored when choosing from the window list." - (or (and aw-ignore-on - ;; Ignore major-modes and buffer-names in `aw-ignored-buffers'. - (or (memq (buffer-local-value 'major-mode (window-buffer window)) - aw-ignored-buffers) - (member (buffer-name (window-buffer window)) aw-ignored-buffers))) - ;; Ignore selected window if `aw-ignore-current' is non-nil. - (and aw-ignore-current - (equal window (selected-window))) - ;; When `ignore-window-parameters' is nil, ignore windows whose - ;; `no-other-window’ or `no-delete-other-windows' parameter is non-nil. - (unless ignore-window-parameters - (cl-case this-command - (ace-select-window (window-parameter window 'no-other-window)) - (ace-delete-window (window-parameter window 'no-delete-other-windows)) - (ace-delete-other-windows (window-parameter - window 'no-delete-other-windows)))))) - -(defun aw-window-list () - "Return the list of interesting windows." - (sort - (cl-remove-if - (lambda (w) - (let ((f (window-frame w))) - (or (not (and (frame-live-p f) - (frame-visible-p f))) - (string= "initial_terminal" (terminal-name f)) - (aw-ignored-p w)))) - (cl-case aw-scope - (visible - (cl-mapcan #'window-list (visible-frame-list))) - (global - (cl-mapcan #'window-list (frame-list))) - (frame - (window-list)) - (t - (error "Invalid `aw-scope': %S" aw-scope)))) - 'aw-window<)) - -(defvar aw-overlays-back nil - "Hold overlays for when `aw-background' is t.") - -(defvar ace-window-mode nil - "Minor mode during the selection process.") - -;; register minor mode -(or (assq 'ace-window-mode minor-mode-alist) - (nconc minor-mode-alist - (list '(ace-window-mode ace-window-mode)))) - -(defvar aw-empty-buffers-list nil - "Store the read-only empty buffers which had to be modified. -Modify them back eventually.") - -(defun aw--done () - "Clean up mode line and overlays." - ;; mode line - (aw-set-mode-line nil) - ;; background - (mapc #'delete-overlay aw-overlays-back) - (setq aw-overlays-back nil) - (avy--remove-leading-chars) - (dolist (b aw-empty-buffers-list) - (with-current-buffer b - (when (string= (buffer-string) " ") - (let ((inhibit-read-only t)) - (delete-region (point-min) (point-max)))))) - (setq aw-empty-buffers-list nil)) - -(defun aw--overlay-str (wnd pos path) - "Return the replacement text for an overlay in WND at POS, -accessible by typing PATH." - (let ((old-str (or - (ignore-errors - (with-selected-window wnd - (buffer-substring pos (1+ pos)))) - ""))) - (concat - (cl-case aw-leading-char-style - (char - (string (avy--key-to-char (car (last path))))) - (path - (mapconcat - (lambda (x) (string (avy--key-to-char x))) - (reverse path) - "")) - (t - (error "Bad `aw-leading-char-style': %S" - aw-leading-char-style))) - (cond ((string-equal old-str "\t") - (make-string (1- tab-width) ?\ )) - ((string-equal old-str "\n") - "\n") - (t - (make-string - (max 0 (1- (string-width old-str))) - ?\ )))))) - -(defun aw--lead-overlay (path leaf) - "Create an overlay using PATH at LEAF. -LEAF is (PT . WND)." - (let ((wnd (cdr leaf))) - (with-selected-window wnd - (when (= 0 (buffer-size)) - (push (current-buffer) aw-empty-buffers-list) - (let ((inhibit-read-only t)) - (insert " "))) - - (let* ((pt (car leaf)) - (ol (make-overlay pt (1+ pt) (window-buffer wnd)))) - (overlay-put ol 'display (aw--overlay-str wnd pt path)) - (overlay-put ol 'face 'aw-leading-char-face) - (overlay-put ol 'window wnd) - (push ol avy--overlays-lead)) - - (when (eq aw-char-position 'left) - (let* ((pt - (save-excursion - ;; Move to the start of the last visible line in the buffer. - (move-to-window-line -1) - (move-beginning-of-line nil) - ;; If this line is empty, use the previous line so we - ;; have space for the overlay. - (when (equal (point) (point-max)) - (forward-line -1)) - (point))) - (ol (make-overlay pt (1+ pt) (window-buffer wnd)))) - (overlay-put ol 'display (aw--overlay-str wnd pt path)) - (overlay-put ol 'face 'aw-leading-char-face) - (overlay-put ol 'window wnd) - (push ol avy--overlays-lead)))))) - -(defun aw--make-backgrounds (wnd-list) - "Create a dim background overlay for each window on WND-LIST." - (when aw-background - (setq aw-overlays-back - (mapcar (lambda (w) - (let ((ol (make-overlay - (window-start w) - (window-end w) - (window-buffer w)))) - (overlay-put ol 'face 'aw-background-face) - ol)) - wnd-list)))) - -(define-obsolete-variable-alias - 'aw-flip-keys 'aw--flip-keys "0.1.0" - "Use `aw-dispatch-alist' instead.") - -(defvar aw-dispatch-function 'aw-dispatch-default - "Function to call when a character not in `aw-keys' is pressed.") - -(defvar aw-action nil - "Function to call at the end of `aw-select'.") - -(defun aw-set-mode-line (str) - "Set mode line indicator to STR." - (setq ace-window-mode str) - (when (and aw-minibuffer-flag ace-window-mode) - (message "%s" (string-trim-left str))) - (force-mode-line-update)) - -(defun aw--dispatch-action (char) - "Return item from `aw-dispatch-alist' matching CHAR." - (assoc char aw-dispatch-alist)) - -(defun aw-make-frame () - "Make a new Emacs frame using the values of `aw-frame-size' and `aw-frame-offset'." - (make-frame - (delq nil - (list - ;; This first parameter is important because an - ;; aw-dispatch-alist command may not want to leave this - ;; frame with input focus. If it is given focus, the - ;; command may not be able to return focus to a different - ;; frame since this is done asynchronously by the window - ;; manager. - '(no-focus-on-map . t) - (when aw-frame-size - (cons 'width - (if (zerop (car aw-frame-size)) - (frame-width) - (car aw-frame-size)))) - (when aw-frame-size - (cons 'height - (if (zerop (cdr aw-frame-size)) - (frame-height) - (car aw-frame-size)))) - (cons 'left (+ (car aw-frame-offset) - (car (frame-position)))) - (cons 'top (+ (cdr aw-frame-offset) - (cdr (frame-position)))))))) - -(defun aw-use-frame (window) - "Create a new frame using the contents of WINDOW. - -The new frame is set to the same size as the previous frame, offset by -`aw-frame-offset' (x . y) pixels." - (aw-switch-to-window window) - (aw-make-frame)) - -(defun aw-clean-up-avy-current-path () - "Edit `avy-current-path' so only window label characters remain." - ;; Remove any possible ace-window command char that may - ;; precede the last specified window label, so - ;; functions can use `avy-current-path' as the chosen - ;; window label. - (when (and (> (length avy-current-path) 0) - (assq (aref avy-current-path 0) aw-dispatch-alist)) - (setq avy-current-path (substring avy-current-path 1)))) - -(defun aw-dispatch-default (char) - "Perform an action depending on CHAR." - (cond ((and (fboundp 'avy-mouse-event-window) - (avy-mouse-event-window char))) - ((= char (aref (kbd "C-g") 0)) - (throw 'done 'exit)) - ((= char aw-make-frame-char) - ;; Make a new frame and perform any action on its window. - (let ((start-win (selected-window)) - (end-win (frame-selected-window (aw-make-frame)))) - (if aw-action - ;; Action must be called from the start-win. The action - ;; determines which window to leave selected. - (progn (select-frame-set-input-focus (window-frame start-win)) - (funcall aw-action end-win)) - ;; Select end-win when no action - (aw-switch-to-window end-win))) - (throw 'done 'exit)) - (t - (let ((action (aw--dispatch-action char))) - (if action - (cl-destructuring-bind (_key fn &optional description) action - (if (and fn description) - (prog1 (setq aw-action fn) - (aw-set-mode-line (format " Ace - %s" description))) - (funcall fn) - (throw 'done 'exit))) - (aw-clean-up-avy-current-path) - ;; Prevent any char from triggering an avy dispatch command. - (let ((avy-dispatch-alist)) - (avy-handler-default char))))))) - -(defun aw-select (mode-line &optional action) - "Return a selected other window. -Amend MODE-LINE to the mode line for the duration of the selection." - (setq aw-action action) - (let ((start-window (selected-window)) - (next-window-scope (cl-case aw-scope - ('visible 'visible) - ('global 'visible) - ('frame 'frame))) - (wnd-list (aw-window-list)) - window) - (setq window - (cond ((<= (length wnd-list) 1) - (when aw-dispatch-always - (setq aw-action - (unwind-protect - (catch 'done - (funcall aw-dispatch-function (read-char))) - (aw--done))) - (when (eq aw-action 'exit) - (setq aw-action nil))) - (or (car wnd-list) start-window)) - ((and (<= (length wnd-list) aw-dispatch-when-more-than) - (not aw-dispatch-always) - (not aw-ignore-current)) - (let ((wnd (next-window nil nil next-window-scope))) - (while (and (or (not (memq wnd wnd-list)) - (aw-ignored-p wnd)) - (not (equal wnd start-window))) - (setq wnd (next-window wnd nil next-window-scope))) - wnd)) - (t - (let ((candidate-list - (mapcar (lambda (wnd) - (cons (aw-offset wnd) wnd)) - wnd-list))) - (aw--make-backgrounds wnd-list) - (aw-set-mode-line mode-line) - ;; turn off helm transient map - (remove-hook 'post-command-hook 'helm--maybe-update-keymap) - (unwind-protect - (let* ((avy-handler-function aw-dispatch-function) - (avy-translate-char-function #'identity) - (res (avy-read (avy-tree candidate-list aw-keys) - #'aw--lead-overlay - #'avy--remove-leading-chars))) - (if (eq res 'exit) - (setq aw-action nil) - (or (cdr res) - start-window))) - (aw--done)))))) - (if aw-action - (funcall aw-action window) - window))) - -;;* Interactive -;;;###autoload -(defun ace-select-window () - "Ace select window." - (interactive) - (aw-select " Ace - Window" - #'aw-switch-to-window)) - -;;;###autoload -(defun ace-delete-window () - "Ace delete window." - (interactive) - (aw-select " Ace - Delete Window" - #'aw-delete-window)) - -;;;###autoload -(defun ace-swap-window () - "Ace swap window." - (interactive) - (aw-select " Ace - Swap Window" - #'aw-swap-window)) - -;;;###autoload -(defun ace-delete-other-windows () - "Ace delete other windows." - (interactive) - (aw-select " Ace - Delete Other Windows" - #'delete-other-windows)) - -(define-obsolete-function-alias - 'ace-maximize-window 'ace-delete-other-windows "0.10.0") - -;;;###autoload -(defun ace-window (arg) - "Select a window. -Perform an action based on ARG described below. - -By default, behaves like extended `other-window'. - -Prefixed with one \\[universal-argument], does a swap between the -selected window and the current window, so that the selected -buffer moves to current window (and current buffer moves to -selected window). - -Prefixed with two \\[universal-argument]'s, deletes the selected -window." - (interactive "p") - (cl-case arg - (0 - (setq aw-ignore-on - (not aw-ignore-on)) - (ace-select-window)) - (4 (ace-swap-window)) - (16 (ace-delete-window)) - (t (ace-select-window)))) - -;;* Utility -(unless (fboundp 'frame-position) - (defun frame-position (&optional frame) - (cons (frame-parameter frame 'left) - (frame-parameter frame 'top)))) - -(defun aw-window< (wnd1 wnd2) - "Return true if WND1 is less than WND2. -This is determined by their respective window coordinates. -Windows are numbered top down, left to right." - (let ((f1 (window-frame wnd1)) - (f2 (window-frame wnd2)) - (e1 (window-edges wnd1)) - (e2 (window-edges wnd2))) - (cond ((< (car (frame-position f1)) (car (frame-position f2))) - (not aw-reverse-frame-list)) - ((> (car (frame-position f1)) (car (frame-position f2))) - aw-reverse-frame-list) - ((< (car e1) (car e2)) - t) - ((> (car e1) (car e2)) - nil) - ((< (cadr e1) (cadr e2)) - t)))) - -(defvar aw--window-ring (make-ring 10) - "Hold the window switching history.") - -(defun aw--push-window (window) - "Store WINDOW to `aw--window-ring'." - (when (or (zerop (ring-length aw--window-ring)) - (not (equal - (ring-ref aw--window-ring 0) - window))) - (ring-insert aw--window-ring (selected-window)))) - -(defun aw--pop-window () - "Return the removed top of `aw--window-ring'." - (let (res) - (condition-case nil - (while (or (not (window-live-p - (setq res (ring-remove aw--window-ring 0)))) - (equal res (selected-window)))) - (error - (if (= (length (aw-window-list)) 2) - (progn - (other-window 1) - (setq res (selected-window))) - (error "No previous windows stored")))) - res)) - -(defun aw-switch-to-window (window) - "Switch to the window WINDOW." - (let ((frame (window-frame window))) - (aw--push-window (selected-window)) - (when (and (frame-live-p frame) - (not (eq frame (selected-frame)))) - (select-frame-set-input-focus frame)) - (if (window-live-p window) - (select-window window) - (error "Got a dead window %S" window)))) - -(defun aw-flip-window () - "Switch to the window you were previously in." - (interactive) - (aw-switch-to-window (aw--pop-window))) - -(defun aw-show-dispatch-help () - "Display action shortucts in echo area." - (interactive) - (message "%s" (mapconcat - (lambda (action) - (cl-destructuring-bind (key fn &optional description) action - (format "%s: %s" - (propertize - (char-to-string key) - 'face 'aw-key-face) - (or description fn)))) - aw-dispatch-alist - "\n")) - ;; Prevent this from replacing any help display - ;; in the minibuffer. - (let (aw-minibuffer-flag) - (mapc #'delete-overlay aw-overlays-back) - (call-interactively 'ace-window))) - -(defun aw-delete-window (window) - "Delete window WINDOW." - (let ((frame (window-frame window))) - (when (and (frame-live-p frame) - (not (eq frame (selected-frame)))) - (select-frame-set-input-focus (window-frame window))) - (if (= 1 (length (window-list))) - (delete-frame frame) - (if (window-live-p window) - (delete-window window) - (error "Got a dead window %S" window))))) - -(defun aw-switch-buffer-in-window (window) - "Select buffer in WINDOW." - (aw-switch-to-window window) - (aw--switch-buffer)) - -(declare-function ivy-switch-buffer "ext:ivy") - -(defun aw--switch-buffer () - (cond ((bound-and-true-p ivy-mode) - (ivy-switch-buffer)) - ((bound-and-true-p ido-mode) - (ido-switch-buffer)) - (t - (call-interactively 'switch-to-buffer)))) - -(defcustom aw-swap-invert nil - "When non-nil, the other of the two swapped windows gets the point." - :type 'boolean) - -(defun aw-swap-window (window) - "Swap buffers of current window and WINDOW." - (cl-labels ((swap-windows (window1 window2) - "Swap the buffers of WINDOW1 and WINDOW2." - (let ((buffer1 (window-buffer window1)) - (buffer2 (window-buffer window2))) - (set-window-buffer window1 buffer2) - (set-window-buffer window2 buffer1) - (select-window window2)))) - (let ((frame (window-frame window)) - (this-window (selected-window))) - (when (and (frame-live-p frame) - (not (eq frame (selected-frame)))) - (select-frame-set-input-focus (window-frame window))) - (when (and (window-live-p window) - (not (eq window this-window))) - (aw--push-window this-window) - (if aw-swap-invert - (swap-windows window this-window) - (swap-windows this-window window)))))) - -(defun aw-move-window (window) - "Move the current buffer to WINDOW. -Switch the current window to the previous buffer." - (let ((buffer (current-buffer))) - (switch-to-buffer (other-buffer)) - (aw-switch-to-window window) - (switch-to-buffer buffer))) - -(defun aw-split-window-vert (window) - "Split WINDOW vertically." - (select-window window) - (split-window-vertically)) - -(defun aw-split-window-horz (window) - "Split WINDOW horizontally." - (select-window window) - (split-window-horizontally)) - -(defcustom aw-fair-aspect-ratio 2 - "The aspect ratio to aim for when splitting windows. -Sizes are based on the number of characters, not pixels. -Increase to prefer wider windows, or decrease for taller windows." - :type 'number) - -(defun aw-split-window-fair (window) - "Split WINDOW vertically or horizontally, based on its current dimensions. -Modify `aw-fair-aspect-ratio' to tweak behavior." - (let ((w (window-body-width window)) - (h (window-body-height window))) - (if (< (* h aw-fair-aspect-ratio) w) - (aw-split-window-horz window) - (aw-split-window-vert window)))) - -(defun aw-switch-buffer-other-window (window) - "Switch buffer in WINDOW without selecting WINDOW." - (aw-switch-to-window window) - (aw--switch-buffer) - (aw-flip-window)) - -(defun aw-offset (window) - "Return point in WINDOW that's closest to top left corner. -The point is writable, i.e. it's not part of space after newline." - (let ((h (window-hscroll window)) - (beg (window-start window)) - (end (window-end window)) - (inhibit-field-text-motion t)) - (with-current-buffer - (window-buffer window) - (save-excursion - (goto-char beg) - (while (and (< (point) end) - (< (- (line-end-position) - (line-beginning-position)) - h)) - (forward-line)) - (+ (point) h))))) - -;;* Mode line -;;;###autoload -(define-minor-mode ace-window-display-mode - "Minor mode for showing the ace window key in the mode line." - :global t - (if ace-window-display-mode - (progn - (aw-update) - (set-default - 'mode-line-format - `((ace-window-display-mode - (:eval (window-parameter (selected-window) 'ace-window-path))) - ,@(assq-delete-all - 'ace-window-display-mode - (default-value 'mode-line-format)))) - (force-mode-line-update t) - (add-hook 'window-configuration-change-hook 'aw-update) - ;; Add at the end so does not precede select-frame call. - (add-hook 'after-make-frame-functions (lambda (_) (aw-update)) t)) - (set-default - 'mode-line-format - (assq-delete-all - 'ace-window-display-mode - (default-value 'mode-line-format))) - (remove-hook 'window-configuration-change-hook 'aw-update) - (remove-hook 'after-make-frame-functions 'aw-update))) - -(defun aw-update () - "Update ace-window-path window parameter for all windows. - -Ensure all windows are labeled so the user can select a specific -one, even from the set of windows typically ignored when making a -window list." - (let ((aw-ignore-on) - (aw-ignore-current) - (ignore-window-parameters t)) - (avy-traverse - (avy-tree (aw-window-list) aw-keys) - (lambda (path leaf) - (set-window-parameter - leaf 'ace-window-path - (propertize - (apply #'string (reverse path)) - 'face 'aw-mode-line-face)))))) - -(provide 'ace-window) - -;;; ace-window.el ends here diff --git a/elpa/ace-window-20180607.1923/ace-window-autoloads.el b/elpa/ace-window-20180607.1923/ace-window-autoloads.el new file mode 100644 index 0000000..b7a54e3 --- /dev/null +++ b/elpa/ace-window-20180607.1923/ace-window-autoloads.el @@ -0,0 +1,68 @@ +;;; ace-window-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "ace-window" "ace-window.el" (23392 1953 0 +;;;;;; 0)) +;;; Generated autoloads from ace-window.el + +(autoload 'ace-select-window "ace-window" "\ +Ace select window. + +\(fn)" t nil) + +(autoload 'ace-delete-window "ace-window" "\ +Ace delete window. + +\(fn)" t nil) + +(autoload 'ace-swap-window "ace-window" "\ +Ace swap window. + +\(fn)" t nil) + +(autoload 'ace-delete-other-windows "ace-window" "\ +Ace delete other windows. + +\(fn)" t nil) + +(autoload 'ace-window "ace-window" "\ +Select a window. +Perform an action based on ARG described below. + +By default, behaves like extended `other-window'. + +Prefixed with one \\[universal-argument], does a swap between the +selected window and the current window, so that the selected +buffer moves to current window (and current buffer moves to +selected window). + +Prefixed with two \\[universal-argument]'s, deletes the selected +window. + +\(fn ARG)" t nil) + +(defvar ace-window-display-mode nil "\ +Non-nil if Ace-Window-Display mode is enabled. +See the `ace-window-display-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `ace-window-display-mode'.") + +(custom-autoload 'ace-window-display-mode "ace-window" nil) + +(autoload 'ace-window-display-mode "ace-window" "\ +Minor mode for showing the ace window key in the mode line. + +\(fn &optional ARG)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; ace-window-autoloads.el ends here diff --git a/elpa/ace-window-20180607.1923/ace-window-pkg.el b/elpa/ace-window-20180607.1923/ace-window-pkg.el new file mode 100644 index 0000000..1246c01 --- /dev/null +++ b/elpa/ace-window-20180607.1923/ace-window-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "ace-window" "20180607.1923" "Quickly switch windows." '((avy "0.2.0")) :commit "92d20e7e75dbb2ba0b879d3aedb8bed51fcee6a7" :keywords '("window" "location") :authors '(("Oleh Krehel" . "ohwoeowho@gmail.com")) :maintainer '("Oleh Krehel" . "ohwoeowho@gmail.com") :url "https://github.com/abo-abo/ace-window") diff --git a/elpa/ace-window-20180607.1923/ace-window.el b/elpa/ace-window-20180607.1923/ace-window.el new file mode 100644 index 0000000..950b8b1 --- /dev/null +++ b/elpa/ace-window-20180607.1923/ace-window.el @@ -0,0 +1,802 @@ +;;; ace-window.el --- Quickly switch windows. -*- lexical-binding: t -*- + +;; Copyright (C) 2015 Free Software Foundation, Inc. + +;; Author: Oleh Krehel +;; Maintainer: Oleh Krehel +;; URL: https://github.com/abo-abo/ace-window +;; Package-Version: 20180607.1923 +;; Version: 0.9.0 +;; Package-Requires: ((avy "0.2.0")) +;; Keywords: window, location + +;; This file is part of GNU Emacs. + +;; This file 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. + +;; For a full copy of the GNU General Public License +;; see . + +;;; Commentary: +;; +;; The main function, `ace-window' is meant to replace `other-window' +;; by assigning each window a short, unique label. When there are only +;; two windows present, `other-window' is called (unless +;; aw-dispatch-always is set non-nil). If there are more, each +;; window will have its first label character highlighted. Once a +;; unique label is typed, ace-window will switch to that window. +;; +;; To setup this package, just add to your .emacs: +;; +;; (global-set-key (kbd "M-o") 'ace-window) +;; +;; replacing "M-o" with an appropriate shortcut. +;; +;; By default, ace-window uses numbers for window labels so the window +;; labeling is intuitively ordered. But if you prefer to type keys on +;; your home row for quicker access, use this setting: +;; +;; (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)) +;; +;; Whenever ace-window prompts for a window selection, it grays out +;; all the window characters, highlighting window labels in red. To +;; disable this behavior, set this: +;; +;; (setq aw-background nil) +;; +;; If you want to know the selection characters ahead of time, turn on +;; `ace-window-display-mode'. +;; +;; When prefixed with one `universal-argument', instead of switching +;; to the selected window, the selected window is swapped with the +;; current one. +;; +;; When prefixed with two `universal-argument', the selected window is +;; deleted instead. + +;;; Code: +(require 'avy) +(require 'ring) +(require 'subr-x) + +;;* Customization +(defgroup ace-window nil + "Quickly switch current window." + :group 'convenience + :prefix "aw-") + +(defcustom aw-keys '(?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9) + "Keys for selecting window." + :type '(repeat character)) + +(defcustom aw-scope 'global + "The scope used by `ace-window'." + :type '(choice + (const :tag "visible frames" visible) + (const :tag "global" global) + (const :tag "frame" frame))) + +(defcustom aw-minibuffer-flag nil + "When non-nil, also display `ace-window-mode' string in the minibuffer when ace-window is active." + :type 'boolean) + +(defcustom aw-ignored-buffers '("*Calc Trail*" "*LV*") + "List of buffers and major-modes to ignore when choosing a window from the window list. +Active only when `aw-ignore-on' is non-nil. Windows displaying these +buffers can still be chosen by typing their specific labels." + :type '(repeat string)) + +(defcustom aw-ignore-on t + "When t, `ace-window' will ignore buffers and major-modes in `aw-ignored-buffers'. +Use M-0 `ace-window' to toggle this value." + :type 'boolean) + +(defcustom aw-ignore-current nil + "When t, `ace-window' will ignore `selected-window'." + :type 'boolean) + +(defcustom aw-background t + "When t, `ace-window' will dim out all buffers temporarily when used." + :type 'boolean) + +(defcustom aw-leading-char-style 'char + "Style of the leading char overlay." + :type '(choice + (const :tag "single char" 'char) + (const :tag "full path" 'path))) + +(defcustom aw-dispatch-always nil + "When non-nil, `ace-window' will issue a `read-char' even for one window. +This will make `ace-window' act different from `other-window' for + one or two windows." + :type 'boolean) + +(defcustom aw-dispatch-when-more-than 2 + "If the number of windows is more than this, activate ace-window-ness." + :type 'integer) + +(defcustom aw-reverse-frame-list nil + "When non-nil `ace-window' will order frames for selection in +the reverse of `frame-list'" + :type 'boolean) + +(defcustom aw-frame-offset '(13 . 23) + "Increase in pixel offset for new ace-window frames relative to the selected frame. +Its value is an (x-offset . y-offset) pair in pixels." + :type '(cons integer integer)) + +(defcustom aw-frame-size nil + "Frame size to make new ace-window frames. +Its value is a (width . height) pair in pixels or nil for the default frame size. +(0 . 0) is special and means make the frame size the same as the last selected frame size." + :type '(cons integer integer)) + +(defcustom aw-char-position 'top-left + "Window positions of the character overlay. +Consider changing this if the overlay tends to overlap with other things." + :type '(choice + (const :tag "top left corner only" 'top-left) + (const :tag "both left corners" 'left))) + +;; Must be defined before `aw-make-frame-char' since its :set function references this. +(defvar aw-dispatch-alist + '((?x aw-delete-window "Delete Window") + (?m aw-swap-window "Swap Windows") + (?M aw-move-window "Move Window") + (?j aw-switch-buffer-in-window "Select Buffer") + (?n aw-flip-window) + (?u aw-switch-buffer-other-window "Switch Buffer Other Window") + (?c aw-split-window-fair "Split Fair Window") + (?v aw-split-window-vert "Split Vert Window") + (?b aw-split-window-horz "Split Horz Window") + (?o delete-other-windows "Delete Other Windows") + (?? aw-show-dispatch-help)) + "List of actions for `aw-dispatch-default'. +Each action is a list of either: + (char function description) where function takes a single window argument +or + (char function) where function takes no argument and the description is omitted.") + +(defun aw-set-make-frame-char (option value) + ;; Signal an error if `aw-make-frame-char' is ever set to an invalid + ;; or conflicting value. + (when value + (cond ((not (characterp value)) + (user-error "`aw-make-frame-char' must be a character, not `%s'" value)) + ((memq value aw-keys) + (user-error "`aw-make-frame-char' is `%c'; this conflicts with the same character in `aw-keys'" value)) + ((assq value aw-dispatch-alist) + (user-error "`aw-make-frame-char' is `%c'; this conflicts with the same character in `aw-dispatch-alist'" value)))) + (set option value)) + +(defcustom aw-make-frame-char ?z + "Non-existing ace window label character that triggers creation of a new single-window frame for display." + :set 'aw-set-make-frame-char + :type 'character) + +(defface aw-leading-char-face + '((((class color)) (:foreground "red")) + (((background dark)) (:foreground "gray100")) + (((background light)) (:foreground "gray0")) + (t (:foreground "gray100" :underline nil))) + "Face for each window's leading char.") + +(defface aw-background-face + '((t (:foreground "gray40"))) + "Face for whole window background during selection.") + +(defface aw-mode-line-face + '((t (:inherit mode-line-buffer-id))) + "Face used for displaying the ace window key in the mode-line.") + +(defface aw-key-face + '((t :inherit font-lock-builtin-face)) + "Face used by `aw-show-dispatch-help'.") + +;;* Implementation +(defun aw-ignored-p (window) + "Return t if WINDOW should be ignored when choosing from the window list." + (or (and aw-ignore-on + ;; Ignore major-modes and buffer-names in `aw-ignored-buffers'. + (or (memq (buffer-local-value 'major-mode (window-buffer window)) + aw-ignored-buffers) + (member (buffer-name (window-buffer window)) aw-ignored-buffers))) + ;; Ignore selected window if `aw-ignore-current' is non-nil. + (and aw-ignore-current + (equal window (selected-window))) + ;; When `ignore-window-parameters' is nil, ignore windows whose + ;; `no-other-window’ or `no-delete-other-windows' parameter is non-nil. + (unless ignore-window-parameters + (cl-case this-command + (ace-select-window (window-parameter window 'no-other-window)) + (ace-delete-window (window-parameter window 'no-delete-other-windows)) + (ace-delete-other-windows (window-parameter + window 'no-delete-other-windows)))))) + +(defun aw-window-list () + "Return the list of interesting windows." + (sort + (cl-remove-if + (lambda (w) + (let ((f (window-frame w))) + (or (not (and (frame-live-p f) + (frame-visible-p f))) + (string= "initial_terminal" (terminal-name f)) + (aw-ignored-p w)))) + (cl-case aw-scope + (visible + (cl-mapcan #'window-list (visible-frame-list))) + (global + (cl-mapcan #'window-list (frame-list))) + (frame + (window-list)) + (t + (error "Invalid `aw-scope': %S" aw-scope)))) + 'aw-window<)) + +(defvar aw-overlays-back nil + "Hold overlays for when `aw-background' is t.") + +(defvar ace-window-mode nil + "Minor mode during the selection process.") + +;; register minor mode +(or (assq 'ace-window-mode minor-mode-alist) + (nconc minor-mode-alist + (list '(ace-window-mode ace-window-mode)))) + +(defvar aw-empty-buffers-list nil + "Store the read-only empty buffers which had to be modified. +Modify them back eventually.") + +(defun aw--done () + "Clean up mode line and overlays." + ;; mode line + (aw-set-mode-line nil) + ;; background + (mapc #'delete-overlay aw-overlays-back) + (setq aw-overlays-back nil) + (avy--remove-leading-chars) + (dolist (b aw-empty-buffers-list) + (with-current-buffer b + (when (string= (buffer-string) " ") + (let ((inhibit-read-only t)) + (delete-region (point-min) (point-max)))))) + (setq aw-empty-buffers-list nil)) + +(defun aw--overlay-str (wnd pos path) + "Return the replacement text for an overlay in WND at POS, +accessible by typing PATH." + (let ((old-str (or + (ignore-errors + (with-selected-window wnd + (buffer-substring pos (1+ pos)))) + ""))) + (concat + (cl-case aw-leading-char-style + (char + (string (avy--key-to-char (car (last path))))) + (path + (mapconcat + (lambda (x) (string (avy--key-to-char x))) + (reverse path) + "")) + (t + (error "Bad `aw-leading-char-style': %S" + aw-leading-char-style))) + (cond ((string-equal old-str "\t") + (make-string (1- tab-width) ?\ )) + ((string-equal old-str "\n") + "\n") + (t + (make-string + (max 0 (1- (string-width old-str))) + ?\ )))))) + +(defun aw--lead-overlay (path leaf) + "Create an overlay using PATH at LEAF. +LEAF is (PT . WND)." + (let ((wnd (cdr leaf))) + (with-selected-window wnd + (when (= 0 (buffer-size)) + (push (current-buffer) aw-empty-buffers-list) + (let ((inhibit-read-only t)) + (insert " "))) + + (let* ((pt (car leaf)) + (ol (make-overlay pt (1+ pt) (window-buffer wnd)))) + (overlay-put ol 'display (aw--overlay-str wnd pt path)) + (overlay-put ol 'face 'aw-leading-char-face) + (overlay-put ol 'window wnd) + (push ol avy--overlays-lead)) + + (when (eq aw-char-position 'left) + (let* ((pt + (save-excursion + ;; Move to the start of the last visible line in the buffer. + (move-to-window-line -1) + (move-beginning-of-line nil) + ;; If this line is empty, use the previous line so we + ;; have space for the overlay. + (when (equal (point) (point-max)) + (forward-line -1)) + (point))) + (ol (make-overlay pt (1+ pt) (window-buffer wnd)))) + (overlay-put ol 'display (aw--overlay-str wnd pt path)) + (overlay-put ol 'face 'aw-leading-char-face) + (overlay-put ol 'window wnd) + (push ol avy--overlays-lead)))))) + +(defun aw--make-backgrounds (wnd-list) + "Create a dim background overlay for each window on WND-LIST." + (when aw-background + (setq aw-overlays-back + (mapcar (lambda (w) + (let ((ol (make-overlay + (window-start w) + (window-end w) + (window-buffer w)))) + (overlay-put ol 'face 'aw-background-face) + ol)) + wnd-list)))) + +(define-obsolete-variable-alias + 'aw-flip-keys 'aw--flip-keys "0.1.0" + "Use `aw-dispatch-alist' instead.") + +(defvar aw-dispatch-function 'aw-dispatch-default + "Function to call when a character not in `aw-keys' is pressed.") + +(defvar aw-action nil + "Function to call at the end of `aw-select'.") + +(defun aw-set-mode-line (str) + "Set mode line indicator to STR." + (setq ace-window-mode str) + (when (and aw-minibuffer-flag ace-window-mode) + (message "%s" (string-trim-left str))) + (force-mode-line-update)) + +(defun aw--dispatch-action (char) + "Return item from `aw-dispatch-alist' matching CHAR." + (assoc char aw-dispatch-alist)) + +(defun aw-make-frame () + "Make a new Emacs frame using the values of `aw-frame-size' and `aw-frame-offset'." + (make-frame + (delq nil + (list + ;; This first parameter is important because an + ;; aw-dispatch-alist command may not want to leave this + ;; frame with input focus. If it is given focus, the + ;; command may not be able to return focus to a different + ;; frame since this is done asynchronously by the window + ;; manager. + '(no-focus-on-map . t) + (when aw-frame-size + (cons 'width + (if (zerop (car aw-frame-size)) + (frame-width) + (car aw-frame-size)))) + (when aw-frame-size + (cons 'height + (if (zerop (cdr aw-frame-size)) + (frame-height) + (car aw-frame-size)))) + (cons 'left (+ (car aw-frame-offset) + (car (frame-position)))) + (cons 'top (+ (cdr aw-frame-offset) + (cdr (frame-position)))))))) + +(defun aw-use-frame (window) + "Create a new frame using the contents of WINDOW. + +The new frame is set to the same size as the previous frame, offset by +`aw-frame-offset' (x . y) pixels." + (aw-switch-to-window window) + (aw-make-frame)) + +(defun aw-clean-up-avy-current-path () + "Edit `avy-current-path' so only window label characters remain." + ;; Remove any possible ace-window command char that may + ;; precede the last specified window label, so + ;; functions can use `avy-current-path' as the chosen + ;; window label. + (when (and (> (length avy-current-path) 0) + (assq (aref avy-current-path 0) aw-dispatch-alist)) + (setq avy-current-path (substring avy-current-path 1)))) + +(defun aw-dispatch-default (char) + "Perform an action depending on CHAR." + (cond ((and (fboundp 'avy-mouse-event-window) + (avy-mouse-event-window char))) + ((= char (aref (kbd "C-g") 0)) + (throw 'done 'exit)) + ((= char aw-make-frame-char) + ;; Make a new frame and perform any action on its window. + (let ((start-win (selected-window)) + (end-win (frame-selected-window (aw-make-frame)))) + (if aw-action + ;; Action must be called from the start-win. The action + ;; determines which window to leave selected. + (progn (select-frame-set-input-focus (window-frame start-win)) + (funcall aw-action end-win)) + ;; Select end-win when no action + (aw-switch-to-window end-win))) + (throw 'done 'exit)) + (t + (let ((action (aw--dispatch-action char))) + (if action + (cl-destructuring-bind (_key fn &optional description) action + (if (and fn description) + (prog1 (setq aw-action fn) + (aw-set-mode-line (format " Ace - %s" description))) + (funcall fn) + (throw 'done 'exit))) + (aw-clean-up-avy-current-path) + ;; Prevent any char from triggering an avy dispatch command. + (let ((avy-dispatch-alist)) + (avy-handler-default char))))))) + +(defun aw-select (mode-line &optional action) + "Return a selected other window. +Amend MODE-LINE to the mode line for the duration of the selection." + (setq aw-action action) + (let ((start-window (selected-window)) + (next-window-scope (cl-case aw-scope + ('visible 'visible) + ('global 'visible) + ('frame 'frame))) + (wnd-list (aw-window-list)) + window) + (setq window + (cond ((<= (length wnd-list) 1) + (when aw-dispatch-always + (setq aw-action + (unwind-protect + (catch 'done + (funcall aw-dispatch-function (read-char))) + (aw--done))) + (when (eq aw-action 'exit) + (setq aw-action nil))) + (or (car wnd-list) start-window)) + ((and (<= (length wnd-list) aw-dispatch-when-more-than) + (not aw-dispatch-always) + (not aw-ignore-current)) + (let ((wnd (next-window nil nil next-window-scope))) + (while (and (or (not (memq wnd wnd-list)) + (aw-ignored-p wnd)) + (not (equal wnd start-window))) + (setq wnd (next-window wnd nil next-window-scope))) + wnd)) + (t + (let ((candidate-list + (mapcar (lambda (wnd) + (cons (aw-offset wnd) wnd)) + wnd-list))) + (aw--make-backgrounds wnd-list) + (aw-set-mode-line mode-line) + ;; turn off helm transient map + (remove-hook 'post-command-hook 'helm--maybe-update-keymap) + (unwind-protect + (let* ((avy-handler-function aw-dispatch-function) + (avy-translate-char-function #'identity) + (res (avy-read (avy-tree candidate-list aw-keys) + #'aw--lead-overlay + #'avy--remove-leading-chars))) + (if (eq res 'exit) + (setq aw-action nil) + (or (cdr res) + start-window))) + (aw--done)))))) + (if aw-action + (funcall aw-action window) + window))) + +;;* Interactive +;;;###autoload +(defun ace-select-window () + "Ace select window." + (interactive) + (aw-select " Ace - Window" + #'aw-switch-to-window)) + +;;;###autoload +(defun ace-delete-window () + "Ace delete window." + (interactive) + (aw-select " Ace - Delete Window" + #'aw-delete-window)) + +;;;###autoload +(defun ace-swap-window () + "Ace swap window." + (interactive) + (aw-select " Ace - Swap Window" + #'aw-swap-window)) + +;;;###autoload +(defun ace-delete-other-windows () + "Ace delete other windows." + (interactive) + (aw-select " Ace - Delete Other Windows" + #'delete-other-windows)) + +(define-obsolete-function-alias + 'ace-maximize-window 'ace-delete-other-windows "0.10.0") + +;;;###autoload +(defun ace-window (arg) + "Select a window. +Perform an action based on ARG described below. + +By default, behaves like extended `other-window'. + +Prefixed with one \\[universal-argument], does a swap between the +selected window and the current window, so that the selected +buffer moves to current window (and current buffer moves to +selected window). + +Prefixed with two \\[universal-argument]'s, deletes the selected +window." + (interactive "p") + (cl-case arg + (0 + (setq aw-ignore-on + (not aw-ignore-on)) + (ace-select-window)) + (4 (ace-swap-window)) + (16 (ace-delete-window)) + (t (ace-select-window)))) + +;;* Utility +(unless (fboundp 'frame-position) + (defun frame-position (&optional frame) + (cons (frame-parameter frame 'left) + (frame-parameter frame 'top)))) + +(defun aw-window< (wnd1 wnd2) + "Return true if WND1 is less than WND2. +This is determined by their respective window coordinates. +Windows are numbered top down, left to right." + (let ((f1 (window-frame wnd1)) + (f2 (window-frame wnd2)) + (e1 (window-edges wnd1)) + (e2 (window-edges wnd2))) + (cond ((< (car (frame-position f1)) (car (frame-position f2))) + (not aw-reverse-frame-list)) + ((> (car (frame-position f1)) (car (frame-position f2))) + aw-reverse-frame-list) + ((< (car e1) (car e2)) + t) + ((> (car e1) (car e2)) + nil) + ((< (cadr e1) (cadr e2)) + t)))) + +(defvar aw--window-ring (make-ring 10) + "Hold the window switching history.") + +(defun aw--push-window (window) + "Store WINDOW to `aw--window-ring'." + (when (or (zerop (ring-length aw--window-ring)) + (not (equal + (ring-ref aw--window-ring 0) + window))) + (ring-insert aw--window-ring (selected-window)))) + +(defun aw--pop-window () + "Return the removed top of `aw--window-ring'." + (let (res) + (condition-case nil + (while (or (not (window-live-p + (setq res (ring-remove aw--window-ring 0)))) + (equal res (selected-window)))) + (error + (if (= (length (aw-window-list)) 2) + (progn + (other-window 1) + (setq res (selected-window))) + (error "No previous windows stored")))) + res)) + +(defun aw-switch-to-window (window) + "Switch to the window WINDOW." + (let ((frame (window-frame window))) + (aw--push-window (selected-window)) + (when (and (frame-live-p frame) + (not (eq frame (selected-frame)))) + (select-frame-set-input-focus frame)) + (if (window-live-p window) + (select-window window) + (error "Got a dead window %S" window)))) + +(defun aw-flip-window () + "Switch to the window you were previously in." + (interactive) + (aw-switch-to-window (aw--pop-window))) + +(defun aw-show-dispatch-help () + "Display action shortucts in echo area." + (interactive) + (message "%s" (mapconcat + (lambda (action) + (cl-destructuring-bind (key fn &optional description) action + (format "%s: %s" + (propertize + (char-to-string key) + 'face 'aw-key-face) + (or description fn)))) + aw-dispatch-alist + "\n")) + ;; Prevent this from replacing any help display + ;; in the minibuffer. + (let (aw-minibuffer-flag) + (mapc #'delete-overlay aw-overlays-back) + (call-interactively 'ace-window))) + +(defun aw-delete-window (window) + "Delete window WINDOW." + (let ((frame (window-frame window))) + (when (and (frame-live-p frame) + (not (eq frame (selected-frame)))) + (select-frame-set-input-focus (window-frame window))) + (if (= 1 (length (window-list))) + (delete-frame frame) + (if (window-live-p window) + (delete-window window) + (error "Got a dead window %S" window))))) + +(defun aw-switch-buffer-in-window (window) + "Select buffer in WINDOW." + (aw-switch-to-window window) + (aw--switch-buffer)) + +(declare-function ivy-switch-buffer "ext:ivy") + +(defun aw--switch-buffer () + (cond ((bound-and-true-p ivy-mode) + (ivy-switch-buffer)) + ((bound-and-true-p ido-mode) + (ido-switch-buffer)) + (t + (call-interactively 'switch-to-buffer)))) + +(defcustom aw-swap-invert nil + "When non-nil, the other of the two swapped windows gets the point." + :type 'boolean) + +(defun aw-swap-window (window) + "Swap buffers of current window and WINDOW." + (cl-labels ((swap-windows (window1 window2) + "Swap the buffers of WINDOW1 and WINDOW2." + (let ((buffer1 (window-buffer window1)) + (buffer2 (window-buffer window2))) + (set-window-buffer window1 buffer2) + (set-window-buffer window2 buffer1) + (select-window window2)))) + (let ((frame (window-frame window)) + (this-window (selected-window))) + (when (and (frame-live-p frame) + (not (eq frame (selected-frame)))) + (select-frame-set-input-focus (window-frame window))) + (when (and (window-live-p window) + (not (eq window this-window))) + (aw--push-window this-window) + (if aw-swap-invert + (swap-windows window this-window) + (swap-windows this-window window)))))) + +(defun aw-move-window (window) + "Move the current buffer to WINDOW. +Switch the current window to the previous buffer." + (let ((buffer (current-buffer))) + (switch-to-buffer (other-buffer)) + (aw-switch-to-window window) + (switch-to-buffer buffer))) + +(defun aw-split-window-vert (window) + "Split WINDOW vertically." + (select-window window) + (split-window-vertically)) + +(defun aw-split-window-horz (window) + "Split WINDOW horizontally." + (select-window window) + (split-window-horizontally)) + +(defcustom aw-fair-aspect-ratio 2 + "The aspect ratio to aim for when splitting windows. +Sizes are based on the number of characters, not pixels. +Increase to prefer wider windows, or decrease for taller windows." + :type 'number) + +(defun aw-split-window-fair (window) + "Split WINDOW vertically or horizontally, based on its current dimensions. +Modify `aw-fair-aspect-ratio' to tweak behavior." + (let ((w (window-body-width window)) + (h (window-body-height window))) + (if (< (* h aw-fair-aspect-ratio) w) + (aw-split-window-horz window) + (aw-split-window-vert window)))) + +(defun aw-switch-buffer-other-window (window) + "Switch buffer in WINDOW without selecting WINDOW." + (aw-switch-to-window window) + (aw--switch-buffer) + (aw-flip-window)) + +(defun aw-offset (window) + "Return point in WINDOW that's closest to top left corner. +The point is writable, i.e. it's not part of space after newline." + (let ((h (window-hscroll window)) + (beg (window-start window)) + (end (window-end window)) + (inhibit-field-text-motion t)) + (with-current-buffer + (window-buffer window) + (save-excursion + (goto-char beg) + (while (and (< (point) end) + (< (- (line-end-position) + (line-beginning-position)) + h)) + (forward-line)) + (+ (point) h))))) + +;;* Mode line +;;;###autoload +(define-minor-mode ace-window-display-mode + "Minor mode for showing the ace window key in the mode line." + :global t + (if ace-window-display-mode + (progn + (aw-update) + (set-default + 'mode-line-format + `((ace-window-display-mode + (:eval (window-parameter (selected-window) 'ace-window-path))) + ,@(assq-delete-all + 'ace-window-display-mode + (default-value 'mode-line-format)))) + (force-mode-line-update t) + (add-hook 'window-configuration-change-hook 'aw-update) + ;; Add at the end so does not precede select-frame call. + (add-hook 'after-make-frame-functions (lambda (_) (aw-update)) t)) + (set-default + 'mode-line-format + (assq-delete-all + 'ace-window-display-mode + (default-value 'mode-line-format))) + (remove-hook 'window-configuration-change-hook 'aw-update) + (remove-hook 'after-make-frame-functions 'aw-update))) + +(defun aw-update () + "Update ace-window-path window parameter for all windows. + +Ensure all windows are labeled so the user can select a specific +one, even from the set of windows typically ignored when making a +window list." + (let ((aw-ignore-on) + (aw-ignore-current) + (ignore-window-parameters t)) + (avy-traverse + (avy-tree (aw-window-list) aw-keys) + (lambda (path leaf) + (set-window-parameter + leaf 'ace-window-path + (propertize + (apply #'string (reverse path)) + 'face 'aw-mode-line-face)))))) + +(provide 'ace-window) + +;;; ace-window.el ends here diff --git a/elpa/ace-window-20180607.1223/ace-window.elc b/elpa/ace-window-20180607.1923/ace-window.elc similarity index 100% rename from elpa/ace-window-20180607.1223/ace-window.elc rename to elpa/ace-window-20180607.1923/ace-window.elc diff --git a/elpa/ag-20180102.1441/ag-autoloads.el b/elpa/ag-20180102.1441/ag-autoloads.el deleted file mode 100644 index 08b8563..0000000 --- a/elpa/ag-20180102.1441/ag-autoloads.el +++ /dev/null @@ -1,122 +0,0 @@ -;;; ag-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "ag" "ag.el" (23163 15949 0 0)) -;;; Generated autoloads from ag.el - -(autoload 'ag "ag" "\ -Search using ag in a given DIRECTORY for a given literal search STRING, -with STRING defaulting to the symbol under point. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn STRING DIRECTORY)" t nil) - -(autoload 'ag-files "ag" "\ -Search using ag in a given DIRECTORY for a given literal search STRING, -limited to files that match FILE-TYPE. STRING defaults to the -symbol under point. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn STRING FILE-TYPE DIRECTORY)" t nil) - -(autoload 'ag-regexp "ag" "\ -Search using ag in a given directory for a given regexp. -The regexp should be in PCRE syntax, not Emacs regexp syntax. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn STRING DIRECTORY)" t nil) - -(autoload 'ag-project "ag" "\ -Guess the root of the current project and search it with ag -for the given literal search STRING. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn STRING)" t nil) - -(autoload 'ag-project-files "ag" "\ -Search using ag for a given literal search STRING, -limited to files that match FILE-TYPE. STRING defaults to the -symbol under point. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn STRING FILE-TYPE)" t nil) - -(autoload 'ag-project-regexp "ag" "\ -Guess the root of the current project and search it with ag -for the given regexp. The regexp should be in PCRE syntax, not -Emacs regexp syntax. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn REGEXP)" t nil) - -(defalias 'ag-project-at-point 'ag-project) - -(defalias 'ag-regexp-project-at-point 'ag-project-regexp) - -(autoload 'ag-dired "ag" "\ -Recursively find files in DIR matching literal search STRING. - -The PATTERN is matched against the full path to the file, not -only against the file name. - -The results are presented as a `dired-mode' buffer with -`default-directory' being DIR. - -See also `ag-dired-regexp'. - -\(fn DIR STRING)" t nil) - -(autoload 'ag-dired-regexp "ag" "\ -Recursively find files in DIR matching REGEXP. -REGEXP should be in PCRE syntax, not Emacs regexp syntax. - -The REGEXP is matched against the full path to the file, not -only against the file name. - -Results are presented as a `dired-mode' buffer with -`default-directory' being DIR. - -See also `find-dired'. - -\(fn DIR REGEXP)" t nil) - -(autoload 'ag-project-dired "ag" "\ -Recursively find files in current project matching PATTERN. - -See also `ag-dired'. - -\(fn PATTERN)" t nil) - -(autoload 'ag-project-dired-regexp "ag" "\ -Recursively find files in current project matching REGEXP. - -See also `ag-dired-regexp'. - -\(fn REGEXP)" t nil) - -(autoload 'ag-kill-buffers "ag" "\ -Kill all `ag-mode' buffers. - -\(fn)" t nil) - -(autoload 'ag-kill-other-buffers "ag" "\ -Kill all `ag-mode' buffers other than the current buffer. - -\(fn)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; ag-autoloads.el ends here diff --git a/elpa/ag-20180102.1441/ag-pkg.el b/elpa/ag-20180102.1441/ag-pkg.el deleted file mode 100644 index 881a4d3..0000000 --- a/elpa/ag-20180102.1441/ag-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "ag" "20180102.1441" "A front-end for ag ('the silver searcher'), the C ack replacement." '((dash "2.8.0") (s "1.9.0") (cl-lib "0.5")) :commit "d00aa65ec2da6944f1ed81da440ad7a9024cfbf0") diff --git a/elpa/ag-20180102.1441/ag.el b/elpa/ag-20180102.1441/ag.el deleted file mode 100644 index 7f74b13..0000000 --- a/elpa/ag-20180102.1441/ag.el +++ /dev/null @@ -1,682 +0,0 @@ -;;; ag.el --- A front-end for ag ('the silver searcher'), the C ack replacement. - -;; Copyright (C) 2013-2014 Wilfred Hughes -;; -;; Author: Wilfred Hughes -;; Created: 11 January 2013 -;; Version: 0.48 -;; Package-Version: 20180102.1441 -;; Package-Requires: ((dash "2.8.0") (s "1.9.0") (cl-lib "0.5")) -;;; Commentary: - -;; Please see README.md for documentation, or read it online at -;; https://github.com/Wilfred/ag.el/#agel - -;;; License: - -;; This file is not part of GNU Emacs. -;; However, it is distributed under the same license. - -;; GNU Emacs 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. - -;; GNU Emacs 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., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. - -;;; Code: -(require 'cl-lib) ;; cl-letf, cl-defun -(require 'dired) ;; dired-sort-inhibit -(require 'dash) -(require 's) -(require 'find-dired) ;; find-dired-filter - -(defgroup ag nil - "A front-end for ag - The Silver Searcher." - :group 'tools - :group 'matching) - -(defcustom ag-executable - "ag" - "Name of the ag executable to use." - :type 'string - :group 'ag) - -(defcustom ag-arguments - (list "--smart-case" "--stats") - "Additional arguments passed to ag. - -Ag.el internally uses --column, --line-number and --color -options (with specific colors) to match groups, so options -specified here should not conflict. - ---line-number is required on Windows, as otherwise ag will not -print line numbers when the input is a stream." - :type '(repeat (string)) - :group 'ag) - -(defcustom ag-dired-arguments - (list "--nocolor" "-S") - "Additional arguments passed to ag-dired." - :type '(repeat (string)) - :group 'ag) - -(defcustom ag-context-lines nil - "Number of context lines to include before and after a matching line." - :type 'integer - :group 'ag) - -(defcustom ag-group-matches t - "Group matches in the same file together. - -If nil, the file name is repeated at the beginning of every match line." - :type 'boolean - :group 'ag) - -(defcustom ag-highlight-search nil - "Non-nil means we highlight the current search term in results. - -This requires the ag command to support --color-match, which is only in v0.14+" - :type 'boolean - :group 'ag) - -(defcustom ag-reuse-buffers nil - "Non-nil means we reuse the existing search results buffer or -dired results buffer, rather than creating one buffer per unique -search." - :type 'boolean - :group 'ag) - -(defcustom ag-reuse-window nil - "Non-nil means we open search results in the same window, -hiding the results buffer." - :type 'boolean - :group 'ag) - -(defcustom ag-project-root-function nil - "A function to determine the project root for `ag-project'. - -If set to a function, call this function with the name of the -file or directory for which to determine the project root -directory. - -If set to nil, fall back to finding VCS root directories." - :type '(choice (const :tag "Default (VCS root)" nil) - (function :tag "Function")) - :group 'ag) - -(defcustom ag-ignore-list nil - "A list of patterns for files/directories to ignore when searching." - :type '(repeat (string)) - :group 'ag) -(make-variable-buffer-local 'ag-ignore-list) -(put 'ag-ignore-list 'safe-local-variable #'listp) - -(require 'compile) - -;; Although ag results aren't exactly errors, we treat them as errors -;; so `next-error' and `previous-error' work. However, we ensure our -;; face inherits from `compilation-info-face' so the results are -;; styled appropriately. -(defface ag-hit-face '((t :inherit compilation-info)) - "Face name to use for ag matches." - :group 'ag) - -(defface ag-match-face '((t :inherit match)) - "Face name to use for ag matches." - :group 'ag) - -(defvar ag-search-finished-hook nil - "Hook run when ag completes a search in a buffer.") - -(defun ag/run-finished-hook (buffer how-finished) - "Run the ag hook to signal that the search has completed." - (with-current-buffer buffer - (run-hooks 'ag-search-finished-hook))) - -(defmacro ag/with-patch-function (fun-name fun-args fun-body &rest body) - "Temporarily override the definition of FUN-NAME whilst BODY is executed. - -Assumes FUNCTION is already defined (see http://emacs.stackexchange.com/a/3452/304)." - `(cl-letf (((symbol-function ,fun-name) - (lambda ,fun-args ,fun-body))) - ,@body)) - -(defun ag/next-error-function (n &optional reset) - "Open the search result at point in the current window or a -different window, according to `ag-reuse-window'." - (if ag-reuse-window - ;; prevent changing the window - (ag/with-patch-function - 'pop-to-buffer (buffer &rest args) (switch-to-buffer buffer) - (compilation-next-error-function n reset)) - - ;; just navigate to the results as normal - (compilation-next-error-function n reset))) - -;; Note that we want to use as tight a regexp as we can to try and -;; handle weird file names (with colons in them) as well as possible. -;; E.g. we use [1-9][0-9]* rather than [0-9]+ so as to accept ":034:" -;; in file names. -(defvar ag/file-column-pattern-nogroup - "^\\(.+?\\):\\([1-9][0-9]*\\):\\([1-9][0-9]*\\):" - "A regexp pattern that groups output into filename, line number and column number.") - -(defvar ag/file-column-pattern-group - "^\\([[:digit:]]+\\):\\([[:digit:]]+\\):" - "A regexp pattern to match line number and column number with grouped output.") - -(defun ag/compilation-match-grouped-filename () - "Match filename backwards when a line/column match is found in grouped output mode." - (save-match-data - (save-excursion - (when (re-search-backward "^File: \\(.*\\)$" (point-min) t) - (list (match-string 1)))))) - -(define-compilation-mode ag-mode "Ag" - "Ag results compilation mode" - (set (make-local-variable 'compilation-error-regexp-alist) - '(compilation-ag-nogroup compilation-ag-group)) - (set (make-local-variable 'compilation-error-regexp-alist-alist) - (list (cons 'compilation-ag-nogroup (list ag/file-column-pattern-nogroup 1 2 3)) - (cons 'compilation-ag-group (list ag/file-column-pattern-group - 'ag/compilation-match-grouped-filename 1 2)))) - (set (make-local-variable 'compilation-error-face) 'ag-hit-face) - (set (make-local-variable 'next-error-function) #'ag/next-error-function) - (set (make-local-variable 'compilation-finish-functions) - #'ag/run-finished-hook) - (add-hook 'compilation-filter-hook 'ag-filter nil t)) - -(define-key ag-mode-map (kbd "p") #'compilation-previous-error) -(define-key ag-mode-map (kbd "n") #'compilation-next-error) -(define-key ag-mode-map (kbd "k") '(lambda () (interactive) - (let (kill-buffer-query-functions) (kill-buffer)))) - -(defun ag/buffer-name (search-string directory regexp) - "Return a buffer name formatted according to ag.el conventions." - (cond - (ag-reuse-buffers "*ag search*") - (regexp (format "*ag search regexp:%s dir:%s*" search-string directory)) - (:else (format "*ag search text:%s dir:%s*" search-string directory)))) - -(defun ag/format-ignore (ignores) - "Prepend '--ignore' to every item in IGNORES." - (apply #'append - (mapcar (lambda (item) (list "--ignore" item)) ignores))) - -(cl-defun ag/search (string directory - &key (regexp nil) (file-regex nil) (file-type nil)) - "Run ag searching for the STRING given in DIRECTORY. -If REGEXP is non-nil, treat STRING as a regular expression." - (let ((default-directory (file-name-as-directory directory)) - (arguments ag-arguments) - (shell-command-switch "-c")) - ;; Add double dashes at the end of command line if not specified in - ;; ag-arguments. - (unless (equal (car (last arguments)) "--") - (setq arguments (append arguments '("--")))) - (setq arguments - (append '("--line-number" "--column" "--color" "--color-match" "30;43" - "--color-path" "1;32") - arguments)) - (if ag-group-matches - (setq arguments (cons "--group" arguments)) - (setq arguments (cons "--nogroup" arguments))) - (unless regexp - (setq arguments (cons "--literal" arguments))) - (when (or (eq system-type 'windows-nt) (eq system-type 'cygwin)) - ;; Use --vimgrep to work around issue #97 on Windows. - (setq arguments (cons "--vimgrep" arguments))) - (when (char-or-string-p file-regex) - (setq arguments (append `("--file-search-regex" ,file-regex) arguments))) - (when file-type - (setq arguments (cons (format "--%s" file-type) arguments))) - (if (integerp current-prefix-arg) - (setq arguments (cons (format "--context=%d" (abs current-prefix-arg)) arguments)) - (when ag-context-lines - (setq arguments (cons (format "--context=%d" ag-context-lines) arguments)))) - (when ag-ignore-list - (setq arguments (append (ag/format-ignore ag-ignore-list) arguments))) - (unless (file-exists-p default-directory) - (error "No such directory %s" default-directory)) - (let ((command-string - (mapconcat #'shell-quote-argument - (append (list ag-executable) arguments (list string ".")) - " "))) - ;; If we're called with a prefix, let the user modify the command before - ;; running it. Typically this means they want to pass additional arguments. - ;; The numeric value is used for context lines: positive is just context - ;; number (no modification), negative allows further modification. - (when (and current-prefix-arg (not (and (integerp current-prefix-arg) (> current-prefix-arg 0)))) - ;; Make a space in the command-string for the user to enter more arguments. - (setq command-string (ag/replace-first command-string " -- " " -- ")) - ;; Prompt for the command. - (let ((adjusted-point (- (length command-string) (length string) 5))) - (setq command-string - (read-from-minibuffer "ag command: " - (cons command-string adjusted-point))))) - ;; Call ag. - (compilation-start - command-string - #'ag-mode - `(lambda (mode-name) ,(ag/buffer-name string directory regexp)))))) - -(defun ag/dwim-at-point () - "If there's an active selection, return that. -Otherwise, get the symbol at point, as a string." - (cond ((use-region-p) - (buffer-substring-no-properties (region-beginning) (region-end))) - ((symbol-at-point) - (substring-no-properties - (symbol-name (symbol-at-point)))))) - -(defun ag/buffer-extension-regex () - "If the current buffer has an extension, return -a PCRE pattern that matches files with that extension. -Returns an empty string otherwise." - (let ((file-name (buffer-file-name))) - (if (stringp file-name) - (format "\\.%s$" (ag/escape-pcre (file-name-extension file-name))) - ""))) - -(defun ag/longest-string (&rest strings) - "Given a list of strings and nils, return the longest string." - (let ((longest-string nil)) - (dolist (string (-non-nil strings)) - (when (< (length longest-string) - (length string)) - (setq longest-string string))) - longest-string)) - -(defun ag/replace-first (string before after) - "Replace the first occurrence of BEFORE in STRING with AFTER." - (replace-regexp-in-string - (concat "\\(" (regexp-quote before) "\\)" ".*\\'") - after string - nil nil 1)) - -(autoload 'vc-git-root "vc-git") - -(require 'vc-svn) -;; Emacs 23.4 doesn't provide vc-svn-root. -(unless (functionp 'vc-svn-root) - (defun vc-svn-root (file) - (vc-find-root file vc-svn-admin-directory))) - -(autoload 'vc-hg-root "vc-hg") - -(autoload 'vc-bzr-root "vc-bzr") - -(defun ag/project-root (file-path) - "Guess the project root of the given FILE-PATH. - -Use `ag-project-root-function' if set, or fall back to VCS -roots." - (if ag-project-root-function - (funcall ag-project-root-function file-path) - (or (ag/longest-string - (vc-git-root file-path) - (vc-svn-root file-path) - (vc-hg-root file-path) - (vc-bzr-root file-path)) - file-path))) - -(defun ag/dired-align-size-column () - (beginning-of-line) - (when (looking-at "^ ") - (forward-char 2) - (search-forward " " nil t 4) - (let* ((size-start (point)) - (size-end (search-forward " " nil t)) - (width (and size-end (- size-end size-start)))) - (when (and size-end - (< width 12) - (> width 1)) - (goto-char size-start) - (insert (make-string (- 12 width) ? )))))) - -(defun ag/dired-filter (proc string) - "Filter the output of ag to make it suitable for `dired-mode'." - (let ((buf (process-buffer proc)) - (inhibit-read-only t)) - (if (buffer-name buf) - (with-current-buffer buf - (save-excursion - (save-restriction - (widen) - (let ((beg (point-max))) - (goto-char beg) - (insert string) - (goto-char beg) - (or (looking-at "^") - (progn - (ag/dired-align-size-column) - (forward-line 1))) - (while (looking-at "^") - (insert " ") - (ag/dired-align-size-column) - (forward-line 1)) - (goto-char beg) - (beginning-of-line) - - ;; Remove occurrences of default-directory. - (while (search-forward (concat " " default-directory) nil t) - (replace-match " " nil t)) - - (goto-char (point-max)) - (if (search-backward "\n" (process-mark proc) t) - (progn - (dired-insert-set-properties (process-mark proc) - (1+ (point))) - (move-marker (process-mark proc) (1+ (point))))))))) - (delete-process proc)))) - -(defun ag/dired-sentinel (proc state) - "Update the status/modeline after the process finishes." - (let ((buf (process-buffer proc)) - (inhibit-read-only t)) - (if (buffer-name buf) - (with-current-buffer buf - (let ((buffer-read-only nil)) - (save-excursion - (goto-char (point-max)) - (insert "\n ag " state) - (forward-char -1) ;Back up before \n at end of STATE. - (insert " at " (substring (current-time-string) 0 19)) - (forward-char 1) - (setq mode-line-process - (concat ":" (symbol-name (process-status proc)))) - ;; Since the buffer and mode line will show that the - ;; process is dead, we can delete it now. Otherwise it - ;; will stay around until M-x list-processes. - (delete-process proc) - (force-mode-line-update))) - (run-hooks 'dired-after-readin-hook) - (message "%s finished." (current-buffer)))))) - -(defun ag/kill-process () - "Kill the `ag' process running in the current buffer." - (interactive) - (let ((ag (get-buffer-process (current-buffer)))) - (and ag (eq (process-status ag) 'run) - (eq (process-filter ag) (function find-dired-filter)) - (condition-case nil - (delete-process ag) - (error nil))))) - -(defun ag/escape-pcre (regexp) - "Escape the PCRE-special characters in REGEXP so that it is -matched literally." - (let ((alphanum "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")) - (apply #'concat - (mapcar - (lambda (c) - (cond - ((not (string-match-p (regexp-quote c) alphanum)) - (concat "\\" c)) - (t c))) - (mapcar #'char-to-string (string-to-list regexp)))))) - -;;;###autoload -(defun ag (string directory) - "Search using ag in a given DIRECTORY for a given literal search STRING, -with STRING defaulting to the symbol under point. - -If called with a prefix, prompts for flags to pass to ag." - (interactive (list (ag/read-from-minibuffer "Search string") - (read-directory-name "Directory: "))) - (ag/search string directory)) - -;;;###autoload -(defun ag-files (string file-type directory) - "Search using ag in a given DIRECTORY for a given literal search STRING, -limited to files that match FILE-TYPE. STRING defaults to the -symbol under point. - -If called with a prefix, prompts for flags to pass to ag." - (interactive (list (ag/read-from-minibuffer "Search string") - (ag/read-file-type) - (read-directory-name "Directory: "))) - (apply #'ag/search string directory file-type)) - -;;;###autoload -(defun ag-regexp (string directory) - "Search using ag in a given directory for a given regexp. -The regexp should be in PCRE syntax, not Emacs regexp syntax. - -If called with a prefix, prompts for flags to pass to ag." - (interactive "sSearch regexp: \nDDirectory: ") - (ag/search string directory :regexp t)) - -;;;###autoload -(defun ag-project (string) - "Guess the root of the current project and search it with ag -for the given literal search STRING. - -If called with a prefix, prompts for flags to pass to ag." - (interactive (list (ag/read-from-minibuffer "Search string"))) - (ag/search string (ag/project-root default-directory))) - -;;;###autoload -(defun ag-project-files (string file-type) - "Search using ag for a given literal search STRING, -limited to files that match FILE-TYPE. STRING defaults to the -symbol under point. - -If called with a prefix, prompts for flags to pass to ag." - (interactive (list (ag/read-from-minibuffer "Search string") - (ag/read-file-type))) - (apply 'ag/search string (ag/project-root default-directory) file-type)) - -(defun ag/read-from-minibuffer (prompt) - "Read a value from the minibuffer with PROMPT. -If there's a string at point, offer that as a default." - (let* ((suggested (ag/dwim-at-point)) - (final-prompt - (if suggested - (format "%s (default %s): " prompt suggested) - (format "%s: " prompt))) - ;; Ask the user for input, but add `suggested' to the history - ;; so they can use M-n if they want to modify it. - (user-input (read-from-minibuffer - final-prompt - nil nil nil nil suggested))) - ;; Return the input provided by the user, or use `suggested' if - ;; the input was empty. - (if (> (length user-input) 0) - user-input - suggested))) - -;;;###autoload -(defun ag-project-regexp (regexp) - "Guess the root of the current project and search it with ag -for the given regexp. The regexp should be in PCRE syntax, not -Emacs regexp syntax. - -If called with a prefix, prompts for flags to pass to ag." - (interactive (list (ag/read-from-minibuffer "Search regexp"))) - (ag/search regexp (ag/project-root default-directory) :regexp t)) - -(autoload 'symbol-at-point "thingatpt") - -;;;###autoload -(defalias 'ag-project-at-point 'ag-project) -(make-obsolete 'ag-project-at-point 'ag-project "0.19") - -;;;###autoload -(defalias 'ag-regexp-project-at-point 'ag-project-regexp) -(make-obsolete 'ag-regexp-project-at-point 'ag-project-regexp "0.46") - -;;;###autoload -(defun ag-dired (dir string) - "Recursively find files in DIR matching literal search STRING. - -The PATTERN is matched against the full path to the file, not -only against the file name. - -The results are presented as a `dired-mode' buffer with -`default-directory' being DIR. - -See also `ag-dired-regexp'." - (interactive "DDirectory: \nsFile pattern: ") - (ag-dired-regexp dir (ag/escape-pcre string))) - -;;;###autoload -(defun ag-dired-regexp (dir regexp) - "Recursively find files in DIR matching REGEXP. -REGEXP should be in PCRE syntax, not Emacs regexp syntax. - -The REGEXP is matched against the full path to the file, not -only against the file name. - -Results are presented as a `dired-mode' buffer with -`default-directory' being DIR. - -See also `find-dired'." - (interactive "DDirectory: \nsFile regexp: ") - (let* ((dired-buffers dired-buffers) ;; do not mess with regular dired buffers - (orig-dir dir) - (dir (file-name-as-directory (expand-file-name dir))) - (buffer-name (if ag-reuse-buffers - "*ag dired*" - (format "*ag dired pattern:%s dir:%s*" regexp dir))) - (cmd (concat ag-executable " " (combine-and-quote-strings ag-dired-arguments " ") " -g '" regexp "' " - (shell-quote-argument dir) - " | grep -v '^$' | sed s/\\'/\\\\\\\\\\'/ | xargs -I '{}' " - insert-directory-program " " - dired-listing-switches " '{}' &"))) - (with-current-buffer (get-buffer-create buffer-name) - (switch-to-buffer (current-buffer)) - (widen) - (kill-all-local-variables) - (if (fboundp 'read-only-mode) - (read-only-mode -1) - (setq buffer-read-only nil)) - (let ((inhibit-read-only t)) (erase-buffer)) - (setq default-directory dir) - (run-hooks 'dired-before-readin-hook) - (shell-command cmd (current-buffer)) - (insert " " dir ":\n") - (insert " " cmd "\n") - (dired-mode dir) - (let ((map (make-sparse-keymap))) - (set-keymap-parent map (current-local-map)) - (define-key map "\C-c\C-k" 'ag/kill-process) - (use-local-map map)) - (set (make-local-variable 'dired-sort-inhibit) t) - (set (make-local-variable 'revert-buffer-function) - `(lambda (ignore-auto noconfirm) - (ag-dired-regexp ,orig-dir ,regexp))) - (if (fboundp 'dired-simple-subdir-alist) - (dired-simple-subdir-alist) - (set (make-local-variable 'dired-subdir-alist) - (list (cons default-directory (point-min-marker))))) - (let ((proc (get-buffer-process (current-buffer)))) - (set-process-filter proc #'ag/dired-filter) - (set-process-sentinel proc #'ag/dired-sentinel) - ;; Initialize the process marker; it is used by the filter. - (move-marker (process-mark proc) 1 (current-buffer))) - (setq mode-line-process '(":%s"))))) - -;;;###autoload -(defun ag-project-dired (pattern) - "Recursively find files in current project matching PATTERN. - -See also `ag-dired'." - (interactive "sFile pattern: ") - (ag-dired-regexp (ag/project-root default-directory) (ag/escape-pcre pattern))) - -;;;###autoload -(defun ag-project-dired-regexp (regexp) - "Recursively find files in current project matching REGEXP. - -See also `ag-dired-regexp'." - (interactive "sFile regexp: ") - (ag-dired-regexp (ag/project-root default-directory) regexp)) - -;;;###autoload -(defun ag-kill-buffers () - "Kill all `ag-mode' buffers." - (interactive) - (dolist (buffer (buffer-list)) - (when (eq (buffer-local-value 'major-mode buffer) 'ag-mode) - (kill-buffer buffer)))) - -;;;###autoload -(defun ag-kill-other-buffers () - "Kill all `ag-mode' buffers other than the current buffer." - (interactive) - (let ((current-buffer (current-buffer))) - (dolist (buffer (buffer-list)) - (when (and - (eq (buffer-local-value 'major-mode buffer) 'ag-mode) - (not (eq buffer current-buffer))) - (kill-buffer buffer))))) - -;; Based on grep-filter. -(defun ag-filter () - "Handle escape sequences inserted by the ag process. -This function is called from `compilation-filter-hook'." - (save-excursion - (forward-line 0) - (let ((end (point)) beg) - (goto-char compilation-filter-start) - (forward-line 0) - (setq beg (point)) - ;; Only operate on whole lines so we don't get caught with part of an - ;; escape sequence in one chunk and the rest in another. - (when (< (point) end) - (setq end (copy-marker end)) - (when ag-highlight-search - ;; Highlight ag matches and delete marking sequences. - (while (re-search-forward "\033\\[30;43m\\(.*?\\)\033\\[0m\033\\[K" end 1) - (replace-match (propertize (match-string 1) - 'face nil 'font-lock-face 'ag-match-face) - t t))) - ;; Add marker at start of line for files. This is used by the match - ;; in `compilation-error-regexp-alist' to extract the file name. - (when ag-group-matches - (goto-char beg) - (while (re-search-forward "\033\\[1;32m\\(.*\\)\033\\[0m\033\\[K" end 1) - (replace-match - (concat "File: " (propertize (match-string 1) 'face nil 'font-lock-face - 'compilation-info)) - t t))) - ;; Delete all remaining escape sequences - (goto-char beg) - (while (re-search-forward "\033\\[[0-9;]*[mK]" end 1) - (replace-match "" t t)))))) - -(defun ag/get-supported-types () - "Query the ag executable for which file types it recognises." - (let* ((ag-output (shell-command-to-string (format "%s --list-file-types" ag-executable))) - (lines (-map #'s-trim (s-lines ag-output))) - (types (--keep (when (s-starts-with? "--" it) (s-chop-prefix "--" it )) lines)) - (extensions (--map (s-split " " it) (--filter (s-starts-with? "." it) lines)))) - (-zip types extensions))) - -(defun ag/read-file-type () - "Prompt the user for a known file type, or let them specify a PCRE regex." - (let* ((all-types-with-extensions (ag/get-supported-types)) - (all-types (mapcar 'car all-types-with-extensions)) - (file-type - (completing-read "Select file type: " - (append '("custom (provide a PCRE regex)") all-types))) - (file-type-extensions - (cdr (assoc file-type all-types-with-extensions)))) - (if file-type-extensions - (list :file-type file-type) - (list :file-regex - (read-from-minibuffer "Filenames which match PCRE: " - (ag/buffer-extension-regex)))))) - -(provide 'ag) -;;; ag.el ends here diff --git a/elpa/ag-20180102.1441/ag.elc b/elpa/ag-20180102.1441/ag.elc deleted file mode 100644 index 1fc2a6d..0000000 Binary files a/elpa/ag-20180102.1441/ag.elc and /dev/null differ diff --git a/elpa/ag-20180225.1040/ag-autoloads.el b/elpa/ag-20180225.1040/ag-autoloads.el new file mode 100644 index 0000000..db19589 --- /dev/null +++ b/elpa/ag-20180225.1040/ag-autoloads.el @@ -0,0 +1,122 @@ +;;; ag-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "ag" "ag.el" (23392 1950 0 0)) +;;; Generated autoloads from ag.el + +(autoload 'ag "ag" "\ +Search using ag in a given DIRECTORY for a given literal search STRING, +with STRING defaulting to the symbol under point. + +If called with a prefix, prompts for flags to pass to ag. + +\(fn STRING DIRECTORY)" t nil) + +(autoload 'ag-files "ag" "\ +Search using ag in a given DIRECTORY for a given literal search STRING, +limited to files that match FILE-TYPE. STRING defaults to the +symbol under point. + +If called with a prefix, prompts for flags to pass to ag. + +\(fn STRING FILE-TYPE DIRECTORY)" t nil) + +(autoload 'ag-regexp "ag" "\ +Search using ag in a given directory for a given regexp. +The regexp should be in PCRE syntax, not Emacs regexp syntax. + +If called with a prefix, prompts for flags to pass to ag. + +\(fn STRING DIRECTORY)" t nil) + +(autoload 'ag-project "ag" "\ +Guess the root of the current project and search it with ag +for the given literal search STRING. + +If called with a prefix, prompts for flags to pass to ag. + +\(fn STRING)" t nil) + +(autoload 'ag-project-files "ag" "\ +Search using ag for a given literal search STRING, +limited to files that match FILE-TYPE. STRING defaults to the +symbol under point. + +If called with a prefix, prompts for flags to pass to ag. + +\(fn STRING FILE-TYPE)" t nil) + +(autoload 'ag-project-regexp "ag" "\ +Guess the root of the current project and search it with ag +for the given regexp. The regexp should be in PCRE syntax, not +Emacs regexp syntax. + +If called with a prefix, prompts for flags to pass to ag. + +\(fn REGEXP)" t nil) + +(defalias 'ag-project-at-point 'ag-project) + +(defalias 'ag-regexp-project-at-point 'ag-project-regexp) + +(autoload 'ag-dired "ag" "\ +Recursively find files in DIR matching literal search STRING. + +The PATTERN is matched against the full path to the file, not +only against the file name. + +The results are presented as a `dired-mode' buffer with +`default-directory' being DIR. + +See also `ag-dired-regexp'. + +\(fn DIR STRING)" t nil) + +(autoload 'ag-dired-regexp "ag" "\ +Recursively find files in DIR matching REGEXP. +REGEXP should be in PCRE syntax, not Emacs regexp syntax. + +The REGEXP is matched against the full path to the file, not +only against the file name. + +Results are presented as a `dired-mode' buffer with +`default-directory' being DIR. + +See also `find-dired'. + +\(fn DIR REGEXP)" t nil) + +(autoload 'ag-project-dired "ag" "\ +Recursively find files in current project matching PATTERN. + +See also `ag-dired'. + +\(fn PATTERN)" t nil) + +(autoload 'ag-project-dired-regexp "ag" "\ +Recursively find files in current project matching REGEXP. + +See also `ag-dired-regexp'. + +\(fn REGEXP)" t nil) + +(autoload 'ag-kill-buffers "ag" "\ +Kill all `ag-mode' buffers. + +\(fn)" t nil) + +(autoload 'ag-kill-other-buffers "ag" "\ +Kill all `ag-mode' buffers other than the current buffer. + +\(fn)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; ag-autoloads.el ends here diff --git a/elpa/ag-20180225.1040/ag-pkg.el b/elpa/ag-20180225.1040/ag-pkg.el new file mode 100644 index 0000000..9d1c8f0 --- /dev/null +++ b/elpa/ag-20180225.1040/ag-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "ag" "20180225.1040" "A front-end for ag ('the silver searcher'), the C ack replacement." '((dash "2.8.0") (s "1.9.0") (cl-lib "0.5")) :commit "77b4f50c5372bf219da496567b2b867261f0d354" :authors '(("Wilfred Hughes" . "me@wilfred.me.uk")) :maintainer '("Wilfred Hughes" . "me@wilfred.me.uk")) diff --git a/elpa/ag-20180225.1040/ag.el b/elpa/ag-20180225.1040/ag.el new file mode 100644 index 0000000..da256ca --- /dev/null +++ b/elpa/ag-20180225.1040/ag.el @@ -0,0 +1,688 @@ +;;; ag.el --- A front-end for ag ('the silver searcher'), the C ack replacement. + +;; Copyright (C) 2013-2014 Wilfred Hughes +;; +;; Author: Wilfred Hughes +;; Created: 11 January 2013 +;; Version: 0.48 +;; Package-Version: 20180225.1040 +;; Package-Requires: ((dash "2.8.0") (s "1.9.0") (cl-lib "0.5")) +;;; Commentary: + +;; Please see README.md for documentation, or read it online at +;; https://github.com/Wilfred/ag.el/#agel + +;;; License: + +;; This file is not part of GNU Emacs. +;; However, it is distributed under the same license. + +;; GNU Emacs 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. + +;; GNU Emacs 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., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: +(require 'cl-lib) ;; cl-letf, cl-defun +(require 'dired) ;; dired-sort-inhibit +(require 'dash) +(require 's) +(require 'find-dired) ;; find-dired-filter + +(defgroup ag nil + "A front-end for ag - The Silver Searcher." + :group 'tools + :group 'matching) + +(defcustom ag-executable + "ag" + "Name of the ag executable to use." + :type 'string + :group 'ag) + +(defcustom ag-arguments + (list "--smart-case" "--stats") + "Additional arguments passed to ag. + +Ag.el internally uses --column, --line-number and --color +options (with specific colors) to match groups, so options +specified here should not conflict. + +--line-number is required on Windows, as otherwise ag will not +print line numbers when the input is a stream." + :type '(repeat (string)) + :group 'ag) + +(defcustom ag-dired-arguments + (list "--nocolor" "-S") + "Additional arguments passed to ag-dired." + :type '(repeat (string)) + :group 'ag) + +(defcustom ag-context-lines nil + "Number of context lines to include before and after a matching line." + :type 'integer + :group 'ag) + +(defcustom ag-group-matches t + "Group matches in the same file together. + +If nil, the file name is repeated at the beginning of every match line." + :type 'boolean + :group 'ag) + +(defcustom ag-highlight-search nil + "Non-nil means we highlight the current search term in results. + +This requires the ag command to support --color-match, which is only in v0.14+" + :type 'boolean + :group 'ag) + +(defcustom ag-reuse-buffers nil + "Non-nil means we reuse the existing search results buffer or +dired results buffer, rather than creating one buffer per unique +search." + :type 'boolean + :group 'ag) + +(defcustom ag-reuse-window nil + "Non-nil means we open search results in the same window, +hiding the results buffer." + :type 'boolean + :group 'ag) + +(defcustom ag-project-root-function nil + "A function to determine the project root for `ag-project'. + +If set to a function, call this function with the name of the +file or directory for which to determine the project root +directory. + +If set to nil, fall back to finding VCS root directories." + :type '(choice (const :tag "Default (VCS root)" nil) + (function :tag "Function")) + :group 'ag) + +(defcustom ag-ignore-list nil + "A list of patterns for files/directories to ignore when searching." + :type '(repeat (string)) + :group 'ag) +(make-variable-buffer-local 'ag-ignore-list) +(put 'ag-ignore-list 'safe-local-variable #'listp) + +(require 'compile) + +;; Although ag results aren't exactly errors, we treat them as errors +;; so `next-error' and `previous-error' work. However, we ensure our +;; face inherits from `compilation-info-face' so the results are +;; styled appropriately. +(defface ag-hit-face '((t :inherit compilation-info)) + "Face name to use for ag matches." + :group 'ag) + +(defface ag-match-face '((t :inherit match)) + "Face name to use for ag matches." + :group 'ag) + +(defvar ag-search-finished-hook nil + "Hook run when ag completes a search in a buffer.") + +(defun ag/run-finished-hook (buffer how-finished) + "Run the ag hook to signal that the search has completed." + (with-current-buffer buffer + (run-hooks 'ag-search-finished-hook))) + +(defmacro ag/with-patch-function (fun-name fun-args fun-body &rest body) + "Temporarily override the definition of FUN-NAME whilst BODY is executed. + +Assumes FUNCTION is already defined (see http://emacs.stackexchange.com/a/3452/304)." + `(cl-letf (((symbol-function ,fun-name) + (lambda ,fun-args ,fun-body))) + ,@body)) + +(defun ag/next-error-function (n &optional reset) + "Open the search result at point in the current window or a +different window, according to `ag-reuse-window'." + (if ag-reuse-window + ;; prevent changing the window + (ag/with-patch-function + 'pop-to-buffer (buffer &rest args) (switch-to-buffer buffer) + (compilation-next-error-function n reset)) + + ;; just navigate to the results as normal + (compilation-next-error-function n reset))) + +;; Note that we want to use as tight a regexp as we can to try and +;; handle weird file names (with colons in them) as well as possible. +;; E.g. we use [1-9][0-9]* rather than [0-9]+ so as to accept ":034:" +;; in file names. +(defvar ag/file-column-pattern-nogroup + "^\\(.+?\\):\\([1-9][0-9]*\\):\\([1-9][0-9]*\\):" + "A regexp pattern that groups output into filename, line number and column number.") + +(defvar ag/file-column-pattern-group + "^\\([[:digit:]]+\\):\\([[:digit:]]+\\):" + "A regexp pattern to match line number and column number with grouped output.") + +(defun ag/compilation-match-grouped-filename () + "Match filename backwards when a line/column match is found in grouped output mode." + (save-match-data + (save-excursion + (when (re-search-backward "^File: \\(.*\\)$" (point-min) t) + (list (match-string 1)))))) + +(define-compilation-mode ag-mode "Ag" + "Ag results compilation mode" + (set (make-local-variable 'compilation-error-regexp-alist) + '(compilation-ag-nogroup compilation-ag-group)) + (set (make-local-variable 'compilation-error-regexp-alist-alist) + (list (cons 'compilation-ag-nogroup (list ag/file-column-pattern-nogroup 1 2 3)) + (cons 'compilation-ag-group (list ag/file-column-pattern-group + 'ag/compilation-match-grouped-filename 1 2)))) + (set (make-local-variable 'compilation-error-face) 'ag-hit-face) + (set (make-local-variable 'next-error-function) #'ag/next-error-function) + (set (make-local-variable 'compilation-finish-functions) + #'ag/run-finished-hook) + (add-hook 'compilation-filter-hook 'ag-filter nil t)) + +(define-key ag-mode-map (kbd "p") #'compilation-previous-error) +(define-key ag-mode-map (kbd "n") #'compilation-next-error) +(define-key ag-mode-map (kbd "k") '(lambda () (interactive) + (let (kill-buffer-query-functions) (kill-buffer)))) + +(defun ag/buffer-name (search-string directory regexp) + "Return a buffer name formatted according to ag.el conventions." + (cond + (ag-reuse-buffers "*ag search*") + (regexp (format "*ag search regexp:%s dir:%s*" search-string directory)) + (:else (format "*ag search text:%s dir:%s*" search-string directory)))) + +(defun ag/format-ignore (ignores) + "Prepend '--ignore' to every item in IGNORES." + (apply #'append + (mapcar (lambda (item) (list "--ignore" item)) ignores))) + +(cl-defun ag/search (string directory + &key (regexp nil) (file-regex nil) (file-type nil)) + "Run ag searching for the STRING given in DIRECTORY. +If REGEXP is non-nil, treat STRING as a regular expression." + (let ((default-directory (file-name-as-directory directory)) + (arguments ag-arguments) + (shell-command-switch "-c")) + ;; Add double dashes at the end of command line if not specified in + ;; ag-arguments. + (unless (equal (car (last arguments)) "--") + (setq arguments (append arguments '("--")))) + (setq arguments + (append '("--line-number" "--column" "--color" "--color-match" "30;43" + "--color-path" "1;32") + arguments)) + (if ag-group-matches + (setq arguments (cons "--group" arguments)) + (setq arguments (cons "--nogroup" arguments))) + (unless regexp + (setq arguments (cons "--literal" arguments))) + (when (or (eq system-type 'windows-nt) (eq system-type 'cygwin)) + ;; Use --vimgrep to work around issue #97 on Windows. + (setq arguments (cons "--vimgrep" arguments))) + (when (char-or-string-p file-regex) + (setq arguments (append `("--file-search-regex" ,file-regex) arguments))) + (when file-type + (setq arguments (cons (format "--%s" file-type) arguments))) + (if (integerp current-prefix-arg) + (setq arguments (cons (format "--context=%d" (abs current-prefix-arg)) arguments)) + (when ag-context-lines + (setq arguments (cons (format "--context=%d" ag-context-lines) arguments)))) + (when ag-ignore-list + (setq arguments (append (ag/format-ignore ag-ignore-list) arguments))) + (unless (file-exists-p default-directory) + (error "No such directory %s" default-directory)) + (let ((command-string + (mapconcat #'shell-quote-argument + (append (list ag-executable) arguments (list string ".")) + " "))) + ;; If we're called with a prefix, let the user modify the command before + ;; running it. Typically this means they want to pass additional arguments. + ;; The numeric value is used for context lines: positive is just context + ;; number (no modification), negative allows further modification. + (when (and current-prefix-arg (not (and (integerp current-prefix-arg) (> current-prefix-arg 0)))) + ;; Make a space in the command-string for the user to enter more arguments. + (setq command-string (ag/replace-first command-string " -- " " -- ")) + ;; Prompt for the command. + (let ((adjusted-point (- (length command-string) (length string) 5))) + (setq command-string + (read-from-minibuffer "ag command: " + (cons command-string adjusted-point))))) + ;; Call ag. + (compilation-start + command-string + #'ag-mode + `(lambda (mode-name) ,(ag/buffer-name string directory regexp)))))) + +(defun ag/dwim-at-point () + "If there's an active selection, return that. +Otherwise, get the symbol at point, as a string." + (cond ((use-region-p) + (buffer-substring-no-properties (region-beginning) (region-end))) + ((symbol-at-point) + (substring-no-properties + (symbol-name (symbol-at-point)))))) + +(defun ag/buffer-extension-regex () + "If the current buffer has an extension, return +a PCRE pattern that matches files with that extension. +Returns an empty string otherwise." + (let ((file-name (buffer-file-name))) + (if (stringp file-name) + (format "\\.%s$" (ag/escape-pcre (file-name-extension file-name))) + ""))) + +(defun ag/longest-string (&rest strings) + "Given a list of strings and nils, return the longest string." + (let ((longest-string nil)) + (dolist (string (-non-nil strings)) + (when (< (length longest-string) + (length string)) + (setq longest-string string))) + longest-string)) + +(defun ag/replace-first (string before after) + "Replace the first occurrence of BEFORE in STRING with AFTER." + (replace-regexp-in-string + (concat "\\(" (regexp-quote before) "\\)" ".*\\'") + after string + nil nil 1)) + +(autoload 'vc-git-root "vc-git") + +(require 'vc-svn) +;; Emacs 23.4 doesn't provide vc-svn-root. +(unless (functionp 'vc-svn-root) + (defun vc-svn-root (file) + (vc-find-root file vc-svn-admin-directory))) + +(autoload 'vc-hg-root "vc-hg") + +(autoload 'vc-bzr-root "vc-bzr") + +(defun ag/project-root (file-path) + "Guess the project root of the given FILE-PATH. + +Use `ag-project-root-function' if set, or fall back to VCS +roots." + (if ag-project-root-function + (funcall ag-project-root-function file-path) + (or (ag/longest-string + (vc-git-root file-path) + (vc-svn-root file-path) + (vc-hg-root file-path) + (vc-bzr-root file-path)) + file-path))) + +(defun ag/dired-align-size-column () + (beginning-of-line) + (when (looking-at "^ ") + (forward-char 2) + (search-forward " " nil t 4) + (let* ((size-start (point)) + (size-end (search-forward " " nil t)) + (width (and size-end (- size-end size-start)))) + (when (and size-end + (< width 12) + (> width 1)) + (goto-char size-start) + (insert (make-string (- 12 width) ? )))))) + +(defun ag/dired-filter (proc string) + "Filter the output of ag to make it suitable for `dired-mode'." + (let ((buf (process-buffer proc)) + (inhibit-read-only t)) + (if (buffer-name buf) + (with-current-buffer buf + (save-excursion + (save-restriction + (widen) + (let ((beg (point-max))) + (goto-char beg) + (insert string) + (goto-char beg) + (or (looking-at "^") + (progn + (ag/dired-align-size-column) + (forward-line 1))) + (while (looking-at "^") + (insert " ") + (ag/dired-align-size-column) + (forward-line 1)) + (goto-char beg) + (beginning-of-line) + + ;; Remove occurrences of default-directory. + (while (search-forward (concat " " default-directory) nil t) + (replace-match " " nil t)) + + (goto-char (point-max)) + (if (search-backward "\n" (process-mark proc) t) + (progn + (dired-insert-set-properties (process-mark proc) + (1+ (point))) + (move-marker (process-mark proc) (1+ (point))))))))) + (delete-process proc)))) + +(defun ag/dired-sentinel (proc state) + "Update the status/modeline after the process finishes." + (let ((buf (process-buffer proc)) + (inhibit-read-only t)) + (if (buffer-name buf) + (with-current-buffer buf + (let ((buffer-read-only nil)) + (save-excursion + (goto-char (point-max)) + (insert "\n ag " state) + (forward-char -1) ;Back up before \n at end of STATE. + (insert " at " (substring (current-time-string) 0 19)) + (forward-char 1) + (setq mode-line-process + (concat ":" (symbol-name (process-status proc)))) + ;; Since the buffer and mode line will show that the + ;; process is dead, we can delete it now. Otherwise it + ;; will stay around until M-x list-processes. + (delete-process proc) + (force-mode-line-update))) + (run-hooks 'dired-after-readin-hook) + (message "%s finished." (current-buffer)))))) + +(defun ag/kill-process () + "Kill the `ag' process running in the current buffer." + (interactive) + (let ((ag (get-buffer-process (current-buffer)))) + (and ag (eq (process-status ag) 'run) + (eq (process-filter ag) (function find-dired-filter)) + (condition-case nil + (delete-process ag) + (error nil))))) + +(defun ag/escape-pcre (regexp) + "Escape the PCRE-special characters in REGEXP so that it is +matched literally." + (let ((alphanum "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")) + (apply #'concat + (mapcar + (lambda (c) + (cond + ((not (string-match-p (regexp-quote c) alphanum)) + (concat "\\" c)) + (t c))) + (mapcar #'char-to-string (string-to-list regexp)))))) + +;;;###autoload +(defun ag (string directory) + "Search using ag in a given DIRECTORY for a given literal search STRING, +with STRING defaulting to the symbol under point. + +If called with a prefix, prompts for flags to pass to ag." + (interactive (list (ag/read-from-minibuffer "Search string") + (read-directory-name "Directory: "))) + (ag/search string directory)) + +;;;###autoload +(defun ag-files (string file-type directory) + "Search using ag in a given DIRECTORY for a given literal search STRING, +limited to files that match FILE-TYPE. STRING defaults to the +symbol under point. + +If called with a prefix, prompts for flags to pass to ag." + (interactive (list (ag/read-from-minibuffer "Search string") + (ag/read-file-type) + (read-directory-name "Directory: "))) + (apply #'ag/search string directory file-type)) + +;;;###autoload +(defun ag-regexp (string directory) + "Search using ag in a given directory for a given regexp. +The regexp should be in PCRE syntax, not Emacs regexp syntax. + +If called with a prefix, prompts for flags to pass to ag." + (interactive "sSearch regexp: \nDDirectory: ") + (ag/search string directory :regexp t)) + +;;;###autoload +(defun ag-project (string) + "Guess the root of the current project and search it with ag +for the given literal search STRING. + +If called with a prefix, prompts for flags to pass to ag." + (interactive (list (ag/read-from-minibuffer "Search string"))) + (ag/search string (ag/project-root default-directory))) + +;;;###autoload +(defun ag-project-files (string file-type) + "Search using ag for a given literal search STRING, +limited to files that match FILE-TYPE. STRING defaults to the +symbol under point. + +If called with a prefix, prompts for flags to pass to ag." + (interactive (list (ag/read-from-minibuffer "Search string") + (ag/read-file-type))) + (apply 'ag/search string (ag/project-root default-directory) file-type)) + +(defun ag/read-from-minibuffer (prompt) + "Read a value from the minibuffer with PROMPT. +If there's a string at point, offer that as a default." + (let* ((suggested (ag/dwim-at-point)) + (final-prompt + (if suggested + (format "%s (default %s): " prompt suggested) + (format "%s: " prompt))) + ;; Ask the user for input, but add `suggested' to the history + ;; so they can use M-n if they want to modify it. + (user-input (read-from-minibuffer + final-prompt + nil nil nil nil suggested))) + ;; Return the input provided by the user, or use `suggested' if + ;; the input was empty. + (if (> (length user-input) 0) + user-input + suggested))) + +;;;###autoload +(defun ag-project-regexp (regexp) + "Guess the root of the current project and search it with ag +for the given regexp. The regexp should be in PCRE syntax, not +Emacs regexp syntax. + +If called with a prefix, prompts for flags to pass to ag." + (interactive (list (ag/read-from-minibuffer "Search regexp"))) + (ag/search regexp (ag/project-root default-directory) :regexp t)) + +(autoload 'symbol-at-point "thingatpt") + +;;;###autoload +(defalias 'ag-project-at-point 'ag-project) +(make-obsolete 'ag-project-at-point 'ag-project "0.19") + +;;;###autoload +(defalias 'ag-regexp-project-at-point 'ag-project-regexp) +(make-obsolete 'ag-regexp-project-at-point 'ag-project-regexp "0.46") + +;;;###autoload +(defun ag-dired (dir string) + "Recursively find files in DIR matching literal search STRING. + +The PATTERN is matched against the full path to the file, not +only against the file name. + +The results are presented as a `dired-mode' buffer with +`default-directory' being DIR. + +See also `ag-dired-regexp'." + (interactive "DDirectory: \nsFile pattern: ") + (ag-dired-regexp dir (ag/escape-pcre string))) + +;;;###autoload +(defun ag-dired-regexp (dir regexp) + "Recursively find files in DIR matching REGEXP. +REGEXP should be in PCRE syntax, not Emacs regexp syntax. + +The REGEXP is matched against the full path to the file, not +only against the file name. + +Results are presented as a `dired-mode' buffer with +`default-directory' being DIR. + +See also `find-dired'." + (interactive "DDirectory: \nsFile regexp: ") + (let* ((dired-buffers dired-buffers) ;; do not mess with regular dired buffers + (orig-dir dir) + (dir (file-name-as-directory (expand-file-name dir))) + (buffer-name (if ag-reuse-buffers + "*ag dired*" + (format "*ag dired pattern:%s dir:%s*" regexp dir))) + (cmd (if (string= system-type "windows-nt") + (concat ag-executable " " (combine-and-quote-strings ag-dired-arguments " ") " -g \"" regexp "\" " + (shell-quote-argument dir) + " | grep -v \"^$\" | sed \"s/'/\\\\\\\\'/g\" | xargs -I '{}' " + insert-directory-program " " + dired-listing-switches " '{}' &") + (concat ag-executable " " (combine-and-quote-strings ag-dired-arguments " ") " -g '" regexp "' " + (shell-quote-argument dir) + " | grep -v '^$' | sed s/\\'/\\\\\\\\\\'/g | xargs -I '{}' " + insert-directory-program " " + dired-listing-switches " '{}' &")))) + (with-current-buffer (get-buffer-create buffer-name) + (switch-to-buffer (current-buffer)) + (widen) + (kill-all-local-variables) + (if (fboundp 'read-only-mode) + (read-only-mode -1) + (setq buffer-read-only nil)) + (let ((inhibit-read-only t)) (erase-buffer)) + (setq default-directory dir) + (run-hooks 'dired-before-readin-hook) + (shell-command cmd (current-buffer)) + (insert " " dir ":\n") + (insert " " cmd "\n") + (dired-mode dir) + (let ((map (make-sparse-keymap))) + (set-keymap-parent map (current-local-map)) + (define-key map "\C-c\C-k" 'ag/kill-process) + (use-local-map map)) + (set (make-local-variable 'dired-sort-inhibit) t) + (set (make-local-variable 'revert-buffer-function) + `(lambda (ignore-auto noconfirm) + (ag-dired-regexp ,orig-dir ,regexp))) + (if (fboundp 'dired-simple-subdir-alist) + (dired-simple-subdir-alist) + (set (make-local-variable 'dired-subdir-alist) + (list (cons default-directory (point-min-marker))))) + (let ((proc (get-buffer-process (current-buffer)))) + (set-process-filter proc #'ag/dired-filter) + (set-process-sentinel proc #'ag/dired-sentinel) + ;; Initialize the process marker; it is used by the filter. + (move-marker (process-mark proc) 1 (current-buffer))) + (setq mode-line-process '(":%s"))))) + +;;;###autoload +(defun ag-project-dired (pattern) + "Recursively find files in current project matching PATTERN. + +See also `ag-dired'." + (interactive "sFile pattern: ") + (ag-dired-regexp (ag/project-root default-directory) (ag/escape-pcre pattern))) + +;;;###autoload +(defun ag-project-dired-regexp (regexp) + "Recursively find files in current project matching REGEXP. + +See also `ag-dired-regexp'." + (interactive "sFile regexp: ") + (ag-dired-regexp (ag/project-root default-directory) regexp)) + +;;;###autoload +(defun ag-kill-buffers () + "Kill all `ag-mode' buffers." + (interactive) + (dolist (buffer (buffer-list)) + (when (eq (buffer-local-value 'major-mode buffer) 'ag-mode) + (kill-buffer buffer)))) + +;;;###autoload +(defun ag-kill-other-buffers () + "Kill all `ag-mode' buffers other than the current buffer." + (interactive) + (let ((current-buffer (current-buffer))) + (dolist (buffer (buffer-list)) + (when (and + (eq (buffer-local-value 'major-mode buffer) 'ag-mode) + (not (eq buffer current-buffer))) + (kill-buffer buffer))))) + +;; Based on grep-filter. +(defun ag-filter () + "Handle escape sequences inserted by the ag process. +This function is called from `compilation-filter-hook'." + (save-excursion + (forward-line 0) + (let ((end (point)) beg) + (goto-char compilation-filter-start) + (forward-line 0) + (setq beg (point)) + ;; Only operate on whole lines so we don't get caught with part of an + ;; escape sequence in one chunk and the rest in another. + (when (< (point) end) + (setq end (copy-marker end)) + (when ag-highlight-search + ;; Highlight ag matches and delete marking sequences. + (while (re-search-forward "\033\\[30;43m\\(.*?\\)\033\\[0m\033\\[K" end 1) + (replace-match (propertize (match-string 1) + 'face nil 'font-lock-face 'ag-match-face) + t t))) + ;; Add marker at start of line for files. This is used by the match + ;; in `compilation-error-regexp-alist' to extract the file name. + (when ag-group-matches + (goto-char beg) + (while (re-search-forward "\033\\[1;32m\\(.*\\)\033\\[0m\033\\[K" end 1) + (replace-match + (concat "File: " (propertize (match-string 1) 'face nil 'font-lock-face + 'compilation-info)) + t t))) + ;; Delete all remaining escape sequences + (goto-char beg) + (while (re-search-forward "\033\\[[0-9;]*[mK]" end 1) + (replace-match "" t t)))))) + +(defun ag/get-supported-types () + "Query the ag executable for which file types it recognises." + (let* ((ag-output (shell-command-to-string (format "%s --list-file-types" ag-executable))) + (lines (-map #'s-trim (s-lines ag-output))) + (types (--keep (when (s-starts-with? "--" it) (s-chop-prefix "--" it )) lines)) + (extensions (--map (s-split " " it) (--filter (s-starts-with? "." it) lines)))) + (-zip types extensions))) + +(defun ag/read-file-type () + "Prompt the user for a known file type, or let them specify a PCRE regex." + (let* ((all-types-with-extensions (ag/get-supported-types)) + (all-types (mapcar 'car all-types-with-extensions)) + (file-type + (completing-read "Select file type: " + (append '("custom (provide a PCRE regex)") all-types))) + (file-type-extensions + (cdr (assoc file-type all-types-with-extensions)))) + (if file-type-extensions + (list :file-type file-type) + (list :file-regex + (read-from-minibuffer "Filenames which match PCRE: " + (ag/buffer-extension-regex)))))) + +(provide 'ag) +;;; ag.el ends here diff --git a/elpa/ag-20180225.240/ag.elc b/elpa/ag-20180225.1040/ag.elc similarity index 100% rename from elpa/ag-20180225.240/ag.elc rename to elpa/ag-20180225.1040/ag.elc diff --git a/elpa/ag-20180225.240/ag-autoloads.el b/elpa/ag-20180225.240/ag-autoloads.el deleted file mode 100644 index ee6068e..0000000 --- a/elpa/ag-20180225.240/ag-autoloads.el +++ /dev/null @@ -1,122 +0,0 @@ -;;; ag-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "ag" "ag.el" (23243 33697 0 0)) -;;; Generated autoloads from ag.el - -(autoload 'ag "ag" "\ -Search using ag in a given DIRECTORY for a given literal search STRING, -with STRING defaulting to the symbol under point. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn STRING DIRECTORY)" t nil) - -(autoload 'ag-files "ag" "\ -Search using ag in a given DIRECTORY for a given literal search STRING, -limited to files that match FILE-TYPE. STRING defaults to the -symbol under point. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn STRING FILE-TYPE DIRECTORY)" t nil) - -(autoload 'ag-regexp "ag" "\ -Search using ag in a given directory for a given regexp. -The regexp should be in PCRE syntax, not Emacs regexp syntax. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn STRING DIRECTORY)" t nil) - -(autoload 'ag-project "ag" "\ -Guess the root of the current project and search it with ag -for the given literal search STRING. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn STRING)" t nil) - -(autoload 'ag-project-files "ag" "\ -Search using ag for a given literal search STRING, -limited to files that match FILE-TYPE. STRING defaults to the -symbol under point. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn STRING FILE-TYPE)" t nil) - -(autoload 'ag-project-regexp "ag" "\ -Guess the root of the current project and search it with ag -for the given regexp. The regexp should be in PCRE syntax, not -Emacs regexp syntax. - -If called with a prefix, prompts for flags to pass to ag. - -\(fn REGEXP)" t nil) - -(defalias 'ag-project-at-point 'ag-project) - -(defalias 'ag-regexp-project-at-point 'ag-project-regexp) - -(autoload 'ag-dired "ag" "\ -Recursively find files in DIR matching literal search STRING. - -The PATTERN is matched against the full path to the file, not -only against the file name. - -The results are presented as a `dired-mode' buffer with -`default-directory' being DIR. - -See also `ag-dired-regexp'. - -\(fn DIR STRING)" t nil) - -(autoload 'ag-dired-regexp "ag" "\ -Recursively find files in DIR matching REGEXP. -REGEXP should be in PCRE syntax, not Emacs regexp syntax. - -The REGEXP is matched against the full path to the file, not -only against the file name. - -Results are presented as a `dired-mode' buffer with -`default-directory' being DIR. - -See also `find-dired'. - -\(fn DIR REGEXP)" t nil) - -(autoload 'ag-project-dired "ag" "\ -Recursively find files in current project matching PATTERN. - -See also `ag-dired'. - -\(fn PATTERN)" t nil) - -(autoload 'ag-project-dired-regexp "ag" "\ -Recursively find files in current project matching REGEXP. - -See also `ag-dired-regexp'. - -\(fn REGEXP)" t nil) - -(autoload 'ag-kill-buffers "ag" "\ -Kill all `ag-mode' buffers. - -\(fn)" t nil) - -(autoload 'ag-kill-other-buffers "ag" "\ -Kill all `ag-mode' buffers other than the current buffer. - -\(fn)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; ag-autoloads.el ends here diff --git a/elpa/ag-20180225.240/ag-pkg.el b/elpa/ag-20180225.240/ag-pkg.el deleted file mode 100644 index 29949aa..0000000 --- a/elpa/ag-20180225.240/ag-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "ag" "20180225.240" "A front-end for ag ('the silver searcher'), the C ack replacement." '((dash "2.8.0") (s "1.9.0") (cl-lib "0.5")) :commit "77b4f50c5372bf219da496567b2b867261f0d354") diff --git a/elpa/ag-20180225.240/ag.el b/elpa/ag-20180225.240/ag.el deleted file mode 100644 index eeada8d..0000000 --- a/elpa/ag-20180225.240/ag.el +++ /dev/null @@ -1,688 +0,0 @@ -;;; ag.el --- A front-end for ag ('the silver searcher'), the C ack replacement. - -;; Copyright (C) 2013-2014 Wilfred Hughes -;; -;; Author: Wilfred Hughes -;; Created: 11 January 2013 -;; Version: 0.48 -;; Package-Version: 20180225.240 -;; Package-Requires: ((dash "2.8.0") (s "1.9.0") (cl-lib "0.5")) -;;; Commentary: - -;; Please see README.md for documentation, or read it online at -;; https://github.com/Wilfred/ag.el/#agel - -;;; License: - -;; This file is not part of GNU Emacs. -;; However, it is distributed under the same license. - -;; GNU Emacs 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. - -;; GNU Emacs 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., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. - -;;; Code: -(require 'cl-lib) ;; cl-letf, cl-defun -(require 'dired) ;; dired-sort-inhibit -(require 'dash) -(require 's) -(require 'find-dired) ;; find-dired-filter - -(defgroup ag nil - "A front-end for ag - The Silver Searcher." - :group 'tools - :group 'matching) - -(defcustom ag-executable - "ag" - "Name of the ag executable to use." - :type 'string - :group 'ag) - -(defcustom ag-arguments - (list "--smart-case" "--stats") - "Additional arguments passed to ag. - -Ag.el internally uses --column, --line-number and --color -options (with specific colors) to match groups, so options -specified here should not conflict. - ---line-number is required on Windows, as otherwise ag will not -print line numbers when the input is a stream." - :type '(repeat (string)) - :group 'ag) - -(defcustom ag-dired-arguments - (list "--nocolor" "-S") - "Additional arguments passed to ag-dired." - :type '(repeat (string)) - :group 'ag) - -(defcustom ag-context-lines nil - "Number of context lines to include before and after a matching line." - :type 'integer - :group 'ag) - -(defcustom ag-group-matches t - "Group matches in the same file together. - -If nil, the file name is repeated at the beginning of every match line." - :type 'boolean - :group 'ag) - -(defcustom ag-highlight-search nil - "Non-nil means we highlight the current search term in results. - -This requires the ag command to support --color-match, which is only in v0.14+" - :type 'boolean - :group 'ag) - -(defcustom ag-reuse-buffers nil - "Non-nil means we reuse the existing search results buffer or -dired results buffer, rather than creating one buffer per unique -search." - :type 'boolean - :group 'ag) - -(defcustom ag-reuse-window nil - "Non-nil means we open search results in the same window, -hiding the results buffer." - :type 'boolean - :group 'ag) - -(defcustom ag-project-root-function nil - "A function to determine the project root for `ag-project'. - -If set to a function, call this function with the name of the -file or directory for which to determine the project root -directory. - -If set to nil, fall back to finding VCS root directories." - :type '(choice (const :tag "Default (VCS root)" nil) - (function :tag "Function")) - :group 'ag) - -(defcustom ag-ignore-list nil - "A list of patterns for files/directories to ignore when searching." - :type '(repeat (string)) - :group 'ag) -(make-variable-buffer-local 'ag-ignore-list) -(put 'ag-ignore-list 'safe-local-variable #'listp) - -(require 'compile) - -;; Although ag results aren't exactly errors, we treat them as errors -;; so `next-error' and `previous-error' work. However, we ensure our -;; face inherits from `compilation-info-face' so the results are -;; styled appropriately. -(defface ag-hit-face '((t :inherit compilation-info)) - "Face name to use for ag matches." - :group 'ag) - -(defface ag-match-face '((t :inherit match)) - "Face name to use for ag matches." - :group 'ag) - -(defvar ag-search-finished-hook nil - "Hook run when ag completes a search in a buffer.") - -(defun ag/run-finished-hook (buffer how-finished) - "Run the ag hook to signal that the search has completed." - (with-current-buffer buffer - (run-hooks 'ag-search-finished-hook))) - -(defmacro ag/with-patch-function (fun-name fun-args fun-body &rest body) - "Temporarily override the definition of FUN-NAME whilst BODY is executed. - -Assumes FUNCTION is already defined (see http://emacs.stackexchange.com/a/3452/304)." - `(cl-letf (((symbol-function ,fun-name) - (lambda ,fun-args ,fun-body))) - ,@body)) - -(defun ag/next-error-function (n &optional reset) - "Open the search result at point in the current window or a -different window, according to `ag-reuse-window'." - (if ag-reuse-window - ;; prevent changing the window - (ag/with-patch-function - 'pop-to-buffer (buffer &rest args) (switch-to-buffer buffer) - (compilation-next-error-function n reset)) - - ;; just navigate to the results as normal - (compilation-next-error-function n reset))) - -;; Note that we want to use as tight a regexp as we can to try and -;; handle weird file names (with colons in them) as well as possible. -;; E.g. we use [1-9][0-9]* rather than [0-9]+ so as to accept ":034:" -;; in file names. -(defvar ag/file-column-pattern-nogroup - "^\\(.+?\\):\\([1-9][0-9]*\\):\\([1-9][0-9]*\\):" - "A regexp pattern that groups output into filename, line number and column number.") - -(defvar ag/file-column-pattern-group - "^\\([[:digit:]]+\\):\\([[:digit:]]+\\):" - "A regexp pattern to match line number and column number with grouped output.") - -(defun ag/compilation-match-grouped-filename () - "Match filename backwards when a line/column match is found in grouped output mode." - (save-match-data - (save-excursion - (when (re-search-backward "^File: \\(.*\\)$" (point-min) t) - (list (match-string 1)))))) - -(define-compilation-mode ag-mode "Ag" - "Ag results compilation mode" - (set (make-local-variable 'compilation-error-regexp-alist) - '(compilation-ag-nogroup compilation-ag-group)) - (set (make-local-variable 'compilation-error-regexp-alist-alist) - (list (cons 'compilation-ag-nogroup (list ag/file-column-pattern-nogroup 1 2 3)) - (cons 'compilation-ag-group (list ag/file-column-pattern-group - 'ag/compilation-match-grouped-filename 1 2)))) - (set (make-local-variable 'compilation-error-face) 'ag-hit-face) - (set (make-local-variable 'next-error-function) #'ag/next-error-function) - (set (make-local-variable 'compilation-finish-functions) - #'ag/run-finished-hook) - (add-hook 'compilation-filter-hook 'ag-filter nil t)) - -(define-key ag-mode-map (kbd "p") #'compilation-previous-error) -(define-key ag-mode-map (kbd "n") #'compilation-next-error) -(define-key ag-mode-map (kbd "k") '(lambda () (interactive) - (let (kill-buffer-query-functions) (kill-buffer)))) - -(defun ag/buffer-name (search-string directory regexp) - "Return a buffer name formatted according to ag.el conventions." - (cond - (ag-reuse-buffers "*ag search*") - (regexp (format "*ag search regexp:%s dir:%s*" search-string directory)) - (:else (format "*ag search text:%s dir:%s*" search-string directory)))) - -(defun ag/format-ignore (ignores) - "Prepend '--ignore' to every item in IGNORES." - (apply #'append - (mapcar (lambda (item) (list "--ignore" item)) ignores))) - -(cl-defun ag/search (string directory - &key (regexp nil) (file-regex nil) (file-type nil)) - "Run ag searching for the STRING given in DIRECTORY. -If REGEXP is non-nil, treat STRING as a regular expression." - (let ((default-directory (file-name-as-directory directory)) - (arguments ag-arguments) - (shell-command-switch "-c")) - ;; Add double dashes at the end of command line if not specified in - ;; ag-arguments. - (unless (equal (car (last arguments)) "--") - (setq arguments (append arguments '("--")))) - (setq arguments - (append '("--line-number" "--column" "--color" "--color-match" "30;43" - "--color-path" "1;32") - arguments)) - (if ag-group-matches - (setq arguments (cons "--group" arguments)) - (setq arguments (cons "--nogroup" arguments))) - (unless regexp - (setq arguments (cons "--literal" arguments))) - (when (or (eq system-type 'windows-nt) (eq system-type 'cygwin)) - ;; Use --vimgrep to work around issue #97 on Windows. - (setq arguments (cons "--vimgrep" arguments))) - (when (char-or-string-p file-regex) - (setq arguments (append `("--file-search-regex" ,file-regex) arguments))) - (when file-type - (setq arguments (cons (format "--%s" file-type) arguments))) - (if (integerp current-prefix-arg) - (setq arguments (cons (format "--context=%d" (abs current-prefix-arg)) arguments)) - (when ag-context-lines - (setq arguments (cons (format "--context=%d" ag-context-lines) arguments)))) - (when ag-ignore-list - (setq arguments (append (ag/format-ignore ag-ignore-list) arguments))) - (unless (file-exists-p default-directory) - (error "No such directory %s" default-directory)) - (let ((command-string - (mapconcat #'shell-quote-argument - (append (list ag-executable) arguments (list string ".")) - " "))) - ;; If we're called with a prefix, let the user modify the command before - ;; running it. Typically this means they want to pass additional arguments. - ;; The numeric value is used for context lines: positive is just context - ;; number (no modification), negative allows further modification. - (when (and current-prefix-arg (not (and (integerp current-prefix-arg) (> current-prefix-arg 0)))) - ;; Make a space in the command-string for the user to enter more arguments. - (setq command-string (ag/replace-first command-string " -- " " -- ")) - ;; Prompt for the command. - (let ((adjusted-point (- (length command-string) (length string) 5))) - (setq command-string - (read-from-minibuffer "ag command: " - (cons command-string adjusted-point))))) - ;; Call ag. - (compilation-start - command-string - #'ag-mode - `(lambda (mode-name) ,(ag/buffer-name string directory regexp)))))) - -(defun ag/dwim-at-point () - "If there's an active selection, return that. -Otherwise, get the symbol at point, as a string." - (cond ((use-region-p) - (buffer-substring-no-properties (region-beginning) (region-end))) - ((symbol-at-point) - (substring-no-properties - (symbol-name (symbol-at-point)))))) - -(defun ag/buffer-extension-regex () - "If the current buffer has an extension, return -a PCRE pattern that matches files with that extension. -Returns an empty string otherwise." - (let ((file-name (buffer-file-name))) - (if (stringp file-name) - (format "\\.%s$" (ag/escape-pcre (file-name-extension file-name))) - ""))) - -(defun ag/longest-string (&rest strings) - "Given a list of strings and nils, return the longest string." - (let ((longest-string nil)) - (dolist (string (-non-nil strings)) - (when (< (length longest-string) - (length string)) - (setq longest-string string))) - longest-string)) - -(defun ag/replace-first (string before after) - "Replace the first occurrence of BEFORE in STRING with AFTER." - (replace-regexp-in-string - (concat "\\(" (regexp-quote before) "\\)" ".*\\'") - after string - nil nil 1)) - -(autoload 'vc-git-root "vc-git") - -(require 'vc-svn) -;; Emacs 23.4 doesn't provide vc-svn-root. -(unless (functionp 'vc-svn-root) - (defun vc-svn-root (file) - (vc-find-root file vc-svn-admin-directory))) - -(autoload 'vc-hg-root "vc-hg") - -(autoload 'vc-bzr-root "vc-bzr") - -(defun ag/project-root (file-path) - "Guess the project root of the given FILE-PATH. - -Use `ag-project-root-function' if set, or fall back to VCS -roots." - (if ag-project-root-function - (funcall ag-project-root-function file-path) - (or (ag/longest-string - (vc-git-root file-path) - (vc-svn-root file-path) - (vc-hg-root file-path) - (vc-bzr-root file-path)) - file-path))) - -(defun ag/dired-align-size-column () - (beginning-of-line) - (when (looking-at "^ ") - (forward-char 2) - (search-forward " " nil t 4) - (let* ((size-start (point)) - (size-end (search-forward " " nil t)) - (width (and size-end (- size-end size-start)))) - (when (and size-end - (< width 12) - (> width 1)) - (goto-char size-start) - (insert (make-string (- 12 width) ? )))))) - -(defun ag/dired-filter (proc string) - "Filter the output of ag to make it suitable for `dired-mode'." - (let ((buf (process-buffer proc)) - (inhibit-read-only t)) - (if (buffer-name buf) - (with-current-buffer buf - (save-excursion - (save-restriction - (widen) - (let ((beg (point-max))) - (goto-char beg) - (insert string) - (goto-char beg) - (or (looking-at "^") - (progn - (ag/dired-align-size-column) - (forward-line 1))) - (while (looking-at "^") - (insert " ") - (ag/dired-align-size-column) - (forward-line 1)) - (goto-char beg) - (beginning-of-line) - - ;; Remove occurrences of default-directory. - (while (search-forward (concat " " default-directory) nil t) - (replace-match " " nil t)) - - (goto-char (point-max)) - (if (search-backward "\n" (process-mark proc) t) - (progn - (dired-insert-set-properties (process-mark proc) - (1+ (point))) - (move-marker (process-mark proc) (1+ (point))))))))) - (delete-process proc)))) - -(defun ag/dired-sentinel (proc state) - "Update the status/modeline after the process finishes." - (let ((buf (process-buffer proc)) - (inhibit-read-only t)) - (if (buffer-name buf) - (with-current-buffer buf - (let ((buffer-read-only nil)) - (save-excursion - (goto-char (point-max)) - (insert "\n ag " state) - (forward-char -1) ;Back up before \n at end of STATE. - (insert " at " (substring (current-time-string) 0 19)) - (forward-char 1) - (setq mode-line-process - (concat ":" (symbol-name (process-status proc)))) - ;; Since the buffer and mode line will show that the - ;; process is dead, we can delete it now. Otherwise it - ;; will stay around until M-x list-processes. - (delete-process proc) - (force-mode-line-update))) - (run-hooks 'dired-after-readin-hook) - (message "%s finished." (current-buffer)))))) - -(defun ag/kill-process () - "Kill the `ag' process running in the current buffer." - (interactive) - (let ((ag (get-buffer-process (current-buffer)))) - (and ag (eq (process-status ag) 'run) - (eq (process-filter ag) (function find-dired-filter)) - (condition-case nil - (delete-process ag) - (error nil))))) - -(defun ag/escape-pcre (regexp) - "Escape the PCRE-special characters in REGEXP so that it is -matched literally." - (let ((alphanum "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")) - (apply #'concat - (mapcar - (lambda (c) - (cond - ((not (string-match-p (regexp-quote c) alphanum)) - (concat "\\" c)) - (t c))) - (mapcar #'char-to-string (string-to-list regexp)))))) - -;;;###autoload -(defun ag (string directory) - "Search using ag in a given DIRECTORY for a given literal search STRING, -with STRING defaulting to the symbol under point. - -If called with a prefix, prompts for flags to pass to ag." - (interactive (list (ag/read-from-minibuffer "Search string") - (read-directory-name "Directory: "))) - (ag/search string directory)) - -;;;###autoload -(defun ag-files (string file-type directory) - "Search using ag in a given DIRECTORY for a given literal search STRING, -limited to files that match FILE-TYPE. STRING defaults to the -symbol under point. - -If called with a prefix, prompts for flags to pass to ag." - (interactive (list (ag/read-from-minibuffer "Search string") - (ag/read-file-type) - (read-directory-name "Directory: "))) - (apply #'ag/search string directory file-type)) - -;;;###autoload -(defun ag-regexp (string directory) - "Search using ag in a given directory for a given regexp. -The regexp should be in PCRE syntax, not Emacs regexp syntax. - -If called with a prefix, prompts for flags to pass to ag." - (interactive "sSearch regexp: \nDDirectory: ") - (ag/search string directory :regexp t)) - -;;;###autoload -(defun ag-project (string) - "Guess the root of the current project and search it with ag -for the given literal search STRING. - -If called with a prefix, prompts for flags to pass to ag." - (interactive (list (ag/read-from-minibuffer "Search string"))) - (ag/search string (ag/project-root default-directory))) - -;;;###autoload -(defun ag-project-files (string file-type) - "Search using ag for a given literal search STRING, -limited to files that match FILE-TYPE. STRING defaults to the -symbol under point. - -If called with a prefix, prompts for flags to pass to ag." - (interactive (list (ag/read-from-minibuffer "Search string") - (ag/read-file-type))) - (apply 'ag/search string (ag/project-root default-directory) file-type)) - -(defun ag/read-from-minibuffer (prompt) - "Read a value from the minibuffer with PROMPT. -If there's a string at point, offer that as a default." - (let* ((suggested (ag/dwim-at-point)) - (final-prompt - (if suggested - (format "%s (default %s): " prompt suggested) - (format "%s: " prompt))) - ;; Ask the user for input, but add `suggested' to the history - ;; so they can use M-n if they want to modify it. - (user-input (read-from-minibuffer - final-prompt - nil nil nil nil suggested))) - ;; Return the input provided by the user, or use `suggested' if - ;; the input was empty. - (if (> (length user-input) 0) - user-input - suggested))) - -;;;###autoload -(defun ag-project-regexp (regexp) - "Guess the root of the current project and search it with ag -for the given regexp. The regexp should be in PCRE syntax, not -Emacs regexp syntax. - -If called with a prefix, prompts for flags to pass to ag." - (interactive (list (ag/read-from-minibuffer "Search regexp"))) - (ag/search regexp (ag/project-root default-directory) :regexp t)) - -(autoload 'symbol-at-point "thingatpt") - -;;;###autoload -(defalias 'ag-project-at-point 'ag-project) -(make-obsolete 'ag-project-at-point 'ag-project "0.19") - -;;;###autoload -(defalias 'ag-regexp-project-at-point 'ag-project-regexp) -(make-obsolete 'ag-regexp-project-at-point 'ag-project-regexp "0.46") - -;;;###autoload -(defun ag-dired (dir string) - "Recursively find files in DIR matching literal search STRING. - -The PATTERN is matched against the full path to the file, not -only against the file name. - -The results are presented as a `dired-mode' buffer with -`default-directory' being DIR. - -See also `ag-dired-regexp'." - (interactive "DDirectory: \nsFile pattern: ") - (ag-dired-regexp dir (ag/escape-pcre string))) - -;;;###autoload -(defun ag-dired-regexp (dir regexp) - "Recursively find files in DIR matching REGEXP. -REGEXP should be in PCRE syntax, not Emacs regexp syntax. - -The REGEXP is matched against the full path to the file, not -only against the file name. - -Results are presented as a `dired-mode' buffer with -`default-directory' being DIR. - -See also `find-dired'." - (interactive "DDirectory: \nsFile regexp: ") - (let* ((dired-buffers dired-buffers) ;; do not mess with regular dired buffers - (orig-dir dir) - (dir (file-name-as-directory (expand-file-name dir))) - (buffer-name (if ag-reuse-buffers - "*ag dired*" - (format "*ag dired pattern:%s dir:%s*" regexp dir))) - (cmd (if (string= system-type "windows-nt") - (concat ag-executable " " (combine-and-quote-strings ag-dired-arguments " ") " -g \"" regexp "\" " - (shell-quote-argument dir) - " | grep -v \"^$\" | sed \"s/'/\\\\\\\\'/g\" | xargs -I '{}' " - insert-directory-program " " - dired-listing-switches " '{}' &") - (concat ag-executable " " (combine-and-quote-strings ag-dired-arguments " ") " -g '" regexp "' " - (shell-quote-argument dir) - " | grep -v '^$' | sed s/\\'/\\\\\\\\\\'/g | xargs -I '{}' " - insert-directory-program " " - dired-listing-switches " '{}' &")))) - (with-current-buffer (get-buffer-create buffer-name) - (switch-to-buffer (current-buffer)) - (widen) - (kill-all-local-variables) - (if (fboundp 'read-only-mode) - (read-only-mode -1) - (setq buffer-read-only nil)) - (let ((inhibit-read-only t)) (erase-buffer)) - (setq default-directory dir) - (run-hooks 'dired-before-readin-hook) - (shell-command cmd (current-buffer)) - (insert " " dir ":\n") - (insert " " cmd "\n") - (dired-mode dir) - (let ((map (make-sparse-keymap))) - (set-keymap-parent map (current-local-map)) - (define-key map "\C-c\C-k" 'ag/kill-process) - (use-local-map map)) - (set (make-local-variable 'dired-sort-inhibit) t) - (set (make-local-variable 'revert-buffer-function) - `(lambda (ignore-auto noconfirm) - (ag-dired-regexp ,orig-dir ,regexp))) - (if (fboundp 'dired-simple-subdir-alist) - (dired-simple-subdir-alist) - (set (make-local-variable 'dired-subdir-alist) - (list (cons default-directory (point-min-marker))))) - (let ((proc (get-buffer-process (current-buffer)))) - (set-process-filter proc #'ag/dired-filter) - (set-process-sentinel proc #'ag/dired-sentinel) - ;; Initialize the process marker; it is used by the filter. - (move-marker (process-mark proc) 1 (current-buffer))) - (setq mode-line-process '(":%s"))))) - -;;;###autoload -(defun ag-project-dired (pattern) - "Recursively find files in current project matching PATTERN. - -See also `ag-dired'." - (interactive "sFile pattern: ") - (ag-dired-regexp (ag/project-root default-directory) (ag/escape-pcre pattern))) - -;;;###autoload -(defun ag-project-dired-regexp (regexp) - "Recursively find files in current project matching REGEXP. - -See also `ag-dired-regexp'." - (interactive "sFile regexp: ") - (ag-dired-regexp (ag/project-root default-directory) regexp)) - -;;;###autoload -(defun ag-kill-buffers () - "Kill all `ag-mode' buffers." - (interactive) - (dolist (buffer (buffer-list)) - (when (eq (buffer-local-value 'major-mode buffer) 'ag-mode) - (kill-buffer buffer)))) - -;;;###autoload -(defun ag-kill-other-buffers () - "Kill all `ag-mode' buffers other than the current buffer." - (interactive) - (let ((current-buffer (current-buffer))) - (dolist (buffer (buffer-list)) - (when (and - (eq (buffer-local-value 'major-mode buffer) 'ag-mode) - (not (eq buffer current-buffer))) - (kill-buffer buffer))))) - -;; Based on grep-filter. -(defun ag-filter () - "Handle escape sequences inserted by the ag process. -This function is called from `compilation-filter-hook'." - (save-excursion - (forward-line 0) - (let ((end (point)) beg) - (goto-char compilation-filter-start) - (forward-line 0) - (setq beg (point)) - ;; Only operate on whole lines so we don't get caught with part of an - ;; escape sequence in one chunk and the rest in another. - (when (< (point) end) - (setq end (copy-marker end)) - (when ag-highlight-search - ;; Highlight ag matches and delete marking sequences. - (while (re-search-forward "\033\\[30;43m\\(.*?\\)\033\\[0m\033\\[K" end 1) - (replace-match (propertize (match-string 1) - 'face nil 'font-lock-face 'ag-match-face) - t t))) - ;; Add marker at start of line for files. This is used by the match - ;; in `compilation-error-regexp-alist' to extract the file name. - (when ag-group-matches - (goto-char beg) - (while (re-search-forward "\033\\[1;32m\\(.*\\)\033\\[0m\033\\[K" end 1) - (replace-match - (concat "File: " (propertize (match-string 1) 'face nil 'font-lock-face - 'compilation-info)) - t t))) - ;; Delete all remaining escape sequences - (goto-char beg) - (while (re-search-forward "\033\\[[0-9;]*[mK]" end 1) - (replace-match "" t t)))))) - -(defun ag/get-supported-types () - "Query the ag executable for which file types it recognises." - (let* ((ag-output (shell-command-to-string (format "%s --list-file-types" ag-executable))) - (lines (-map #'s-trim (s-lines ag-output))) - (types (--keep (when (s-starts-with? "--" it) (s-chop-prefix "--" it )) lines)) - (extensions (--map (s-split " " it) (--filter (s-starts-with? "." it) lines)))) - (-zip types extensions))) - -(defun ag/read-file-type () - "Prompt the user for a known file type, or let them specify a PCRE regex." - (let* ((all-types-with-extensions (ag/get-supported-types)) - (all-types (mapcar 'car all-types-with-extensions)) - (file-type - (completing-read "Select file type: " - (append '("custom (provide a PCRE regex)") all-types))) - (file-type-extensions - (cdr (assoc file-type all-types-with-extensions)))) - (if file-type-extensions - (list :file-type file-type) - (list :file-regex - (read-from-minibuffer "Filenames which match PCRE: " - (ag/buffer-extension-regex)))))) - -(provide 'ag) -;;; ag.el ends here diff --git a/elpa/alert-20180122.1242/alert-autoloads.el b/elpa/alert-20180122.1242/alert-autoloads.el deleted file mode 100644 index b8a2ea6..0000000 --- a/elpa/alert-20180122.1242/alert-autoloads.el +++ /dev/null @@ -1,94 +0,0 @@ -;;; alert-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "alert" "alert.el" (23163 15947 0 0)) -;;; Generated autoloads from alert.el - -(autoload 'alert-add-rule "alert" "\ -Programmatically add an alert configuration rule. - -Normally, users should custoimze `alert-user-configuration'. -This facility is for module writers and users that need to do -things the Lisp way. - -Here is a rule the author currently uses with ERC, so that the -fringe gets colored whenever people chat on BitlBee: - -\(alert-add-rule :status \\='(buried visible idle) - :severity \\='(moderate high urgent) - :mode \\='erc-mode - :predicate - #\\='(lambda (info) - (string-match (concat \"\\\\`[^&].*@BitlBee\\\\\\='\") - (erc-format-target-and/or-network))) - :persistent - #\\='(lambda (info) - ;; If the buffer is buried, or the user has been - ;; idle for `alert-reveal-idle-time' seconds, - ;; make this alert persistent. Normally, alerts - ;; become persistent after - ;; `alert-persist-idle-time' seconds. - (memq (plist-get info :status) \\='(buried idle))) - :style \\='fringe - :continue t) - -\(fn &key SEVERITY STATUS MODE CATEGORY TITLE MESSAGE PREDICATE ICON (style alert-default-style) PERSISTENT CONTINUE NEVER-PERSIST APPEND)" nil nil) - -(autoload 'alert "alert" "\ -Alert the user that something has happened. -MESSAGE is what the user will see. You may also use keyword -arguments to specify additional details. Here is a full example: - -\(alert \"This is a message\" - :severity \\='high ;; The default severity is `normal' - :title \"Title\" ;; An optional title - :category \\='example ;; A symbol to identify the message - :mode \\='text-mode ;; Normally determined automatically - :buffer (current-buffer) ;; This is the default - :data nil ;; Unused by alert.el itself - :persistent nil ;; Force the alert to be persistent; - ;; it is best not to use this - :never-persist nil ;; Force this alert to never persist - :id \\='my-id) ;; Used to replace previous message of - ;; the same id in styles that support it - :style \\='fringe) ;; Force a given style to be used; - ;; this is only for debugging! - -If no :title is given, the buffer-name of :buffer is used. If -:buffer is nil, it is the current buffer at the point of call. - -:data is an opaque value which modules can pass through to their -own styles if they wish. - -Here are some more typical examples of usage: - - ;; This is the most basic form usage - (alert \"This is an alert\") - - ;; You can adjust the severity for more important messages - (alert \"This is an alert\" :severity \\='high) - - ;; Or decrease it for purely informative ones - (alert \"This is an alert\" :severity \\='trivial) - - ;; Alerts can have optional titles. Otherwise, the title is the - ;; buffer-name of the (current-buffer) where the alert originated. - (alert \"This is an alert\" :title \"My Alert\") - - ;; Further, alerts can have categories. This allows users to - ;; selectively filter on them. - (alert \"This is an alert\" :title \"My Alert\" - :category \\='some-category-or-other) - -\(fn MESSAGE &key (severity (quote normal)) TITLE ICON CATEGORY BUFFER MODE DATA STYLE PERSISTENT NEVER-PERSIST ID)" nil nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; alert-autoloads.el ends here diff --git a/elpa/alert-20180122.1242/alert-pkg.el b/elpa/alert-20180122.1242/alert-pkg.el deleted file mode 100644 index 3ecec07..0000000 --- a/elpa/alert-20180122.1242/alert-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "alert" "20180122.1242" "Growl-style notification system for Emacs" '((gntp "0.1") (log4e "0.3.0")) :commit "103d34c83fe77e46a6976dcaba3db678199e0c9c" :url "https://github.com/jwiegley/alert" :keywords '("notification" "emacs" "message")) diff --git a/elpa/alert-20180122.1242/alert.el b/elpa/alert-20180122.1242/alert.el deleted file mode 100644 index 9355e44..0000000 --- a/elpa/alert-20180122.1242/alert.el +++ /dev/null @@ -1,1156 +0,0 @@ -;;; alert.el --- Growl-style notification system for Emacs - -;; Copyright (C) 2011-2013 John Wiegley - -;; Author: John Wiegley -;; Created: 24 Aug 2011 -;; Updated: 16 Mar 2015 -;; Version: 1.2 -;; Package-Version: 20180122.1242 -;; Package-Requires: ((gntp "0.1") (log4e "0.3.0")) -;; Keywords: notification emacs message -;; X-URL: https://github.com/jwiegley/alert - -;; 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 2, 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: - -;; Alert is a Growl-workalike for Emacs which uses a common notification -;; interface and multiple, selectable "styles", whose use is fully -;; customizable by the user. -;; -;; * For module writers -;; -;; Just use `alert' instead of `message' as follows: -;; -;; (require 'alert) -;; -;; ;; This is the most basic form usage -;; (alert "This is an alert") -;; -;; ;; You can adjust the severity for more important messages -;; (alert "This is an alert" :severity 'high) -;; -;; ;; Or decrease it for purely informative ones -;; (alert "This is an alert" :severity 'trivial) -;; -;; ;; Alerts can have optional titles. Otherwise, the title is the -;; ;; buffer-name of the (current-buffer) where the alert originated. -;; (alert "This is an alert" :title "My Alert") -;; -;; ;; Further, alerts can have categories. This allows users to -;; ;; selectively filter on them. -;; (alert "This is an alert" :title "My Alert" :category 'debug) -;; -;; * For users -;; -;; For the user, there are several variables to control when and how alerts -;; are presented. By default, they appear in the minibuffer much the same -;; as a normal Emacs message. But there are many more possibilities: -;; -;; `alert-fade-time' -;; Normally alerts disappear after this many seconds, if the style -;; supports it. The default is 5 seconds. -;; -;; `alert-default-style' -;; Pick the style to use if no other config rule matches. The -;; default is `message', but `growl' works well too. -;; -;; `alert-reveal-idle-time' -;; If a config rule choose to match on `idle', this is how many -;; seconds idle the user has to be. Defaults to 5 so that users -;; don't miss any alerts, but 120 is also good. -;; -;; `alert-persist-idle-time' -;; After this many idle seconds, alerts will become sticky, and not -;; fade away more. The default is 15 minutes. -;; -;; `alert-log-messages' -;; By default, all alerts are logged to *Alerts* (and to *Messages*, -;; if the `message' style is being used). Set to nil to disable. -;; -;; `alert-hide-all-notifications' -;; Want alerts off entirely? They still get logged, however, unless -;; you've turned that off too. -;; -;; `alert-user-configuration' -;; This variable lets you control exactly how and when a particular -;; alert, a class of alerts, or all alerts, get reported -- or if at -;; all. Use this to make some alerts use Growl, while others are -;; completely silent. -;; -;; * Programmatically adding rules -;; -;; Users can also programmatically add configuration rules, in addition to -;; customizing `alert-user-configuration'. Here is one that the author -;; currently uses with ERC, so that the fringe gets colored whenever people -;; chat on BitlBee: -;; -;; (alert-add-rule :status '(buried visible idle) -;; :severity '(moderate high urgent) -;; :mode 'erc-mode -;; :predicate -;; #'(lambda (info) -;; (string-match (concat "\\`[^&].*@BitlBee\\'") -;; (erc-format-target-and/or-network))) -;; :persistent -;; #'(lambda (info) -;; ;; If the buffer is buried, or the user has been -;; ;; idle for `alert-reveal-idle-time' seconds, -;; ;; make this alert persistent. Normally, alerts -;; ;; become persistent after -;; ;; `alert-persist-idle-time' seconds. -;; (memq (plist-get info :status) '(buried idle))) -;; :style 'fringe -;; :continue t) -;; -;; * Builtin alert styles -;; -;; There are several builtin styles, and it is trivial to create new ones. -;; The builtins are: -;; -;; fringe - Changes the current frame's fringe background color -;; mode-line - Changes the current frame's mode-line background color -;; gntp - Uses gntp, it requires gntp.el (see https://github.com/tekai/gntp.el) -;; growl - Uses Growl on OS X, if growlnotify is on the PATH -;; ignore - Ignores the alert entirely -;; libnotify - Uses libnotify if notify-send is on the PATH -;; log - Logs the alert text to *Alerts*, with a timestamp -;; message - Uses the Emacs `message' facility -;; momentary - Uses the Emacs `momentary-string-display' facility -;; notifications - Uses notifications library via D-Bus -;; notifier - Uses terminal-notifier on OS X, if it is on the PATH -;; osx-notifier - Native OSX notifier using AppleScript -;; toaster - Use the toast notification system -;; x11 - - Changes the urgency property of the window in the X Window System -;; -;; * Defining new styles -;; -;; To create a new style, you need to at least write a "notifier", which is -;; a function that receives the details of the alert. These details are -;; given in a plist which uses various keyword to identify the parts of the -;; alert. Here is a prototypical style definition: -;; -;; (alert-define-style 'style-name :title "My Style's title" -;; :notifier -;; (lambda (info) -;; ;; The message text is :message -;; (plist-get info :message) -;; ;; The :title of the alert -;; (plist-get info :title) -;; ;; The :category of the alert -;; (plist-get info :category) -;; ;; The major-mode this alert relates to -;; (plist-get info :mode) -;; ;; The buffer the alert relates to -;; (plist-get info :buffer) -;; ;; Severity of the alert. It is one of: -;; ;; `urgent' -;; ;; `high' -;; ;; `moderate' -;; ;; `normal' -;; ;; `low' -;; ;; `trivial' -;; (plist-get info :severity) -;; ;; Whether this alert should persist, or fade away -;; (plist-get info :persistent) -;; ;; Data which was passed to `alert'. Can be -;; ;; anything. -;; (plist-get info :data)) -;; -;; ;; Removers are optional. Their job is to remove -;; ;; the visual or auditory effect of the alert. -;; :remover -;; (lambda (info) -;; ;; It is the same property list that was passed to -;; ;; the notifier function. -;; )) -;; -;; You can test a specific style with something like this: -;; -;; (let ((alert-user-configuration '((((:severity high)) momentary nil)))) -;; (alert "Same buffer momentary alert" :title "My Alert" :severity 'high) -;; (alert "This is a momentary alert in another visible buffer" :title "My Alert" -;; :severity 'high :buffer (other-buffer (current-buffer) t))) - -;;; Code: - -(eval-when-compile - (require 'cl)) -(require 'gntp nil t) -(eval-when-compile - ;; if not available, silence the byte compiler - (defvar gntp-server)) -(declare-function gntp-notify "gntp") -(require 'notifications nil t) -(require 'log4e nil t) - -;; shut up the byte compiler -(declare-function alert-gntp-notify "alert") -(declare-function alert-notifications-notify "alert") - -(defgroup alert nil - "Notification system for Emacs similar to Growl" - :group 'emacs) - -(defcustom alert-severity-faces - '((urgent . alert-urgent-face) - (high . alert-high-face) - (moderate . alert-moderate-face) - (normal . alert-normal-face) - (low . alert-low-face) - (trivial . alert-trivial-face)) - "Faces associated by default with alert severities." - :type '(alist :key-type symbol :value-type color) - :group 'alert) - -(defcustom alert-severity-colors - '((urgent . "red") - (high . "orange") - (moderate . "yellow") - (normal . "green") - (low . "blue") - (trivial . "purple")) - "Colors associated by default with alert severities. -This is used by styles external to Emacs that don't understand faces." - :type '(alist :key-type symbol :value-type color) - :group 'alert) - -(defcustom alert-log-severity-functions - '((urgent . alert--log-fatal) - (high . alert--log-error) - (moderate . alert--log-warn) - (normal . alert--log-info) - (low . alert--log-debug) - (trivial . alert--log-trace)) - "Log4e logging functions" - :type '(alist :key-type symbol :value-type color) - :group 'alert) - -(defcustom alert-log-level - 'normal - "Minimum level of messages to log" - :type 'symbol - :group 'alert) - -(defcustom alert-reveal-idle-time 15 - "If idle this many seconds, rules will match the `idle' property." - :type 'integer - :group 'alert) - -(defcustom alert-persist-idle-time 900 - "If idle this many seconds, all alerts become persistent. -This can be overriden with the Never Persist option (:never-persist)." - :type 'integer - :group 'alert) - -(defcustom alert-fade-time 5 - "If not idle, alerts disappear after this many seconds. -The amount of idle time is governed by `alert-persist-idle-time'." - :type 'integer - :group 'alert) - -(defcustom alert-hide-all-notifications nil - "If non-nil, no alerts are ever shown to the user." - :type 'boolean - :group 'alert) - -(defcustom alert-log-messages t - "If non-nil, all alerts are logged to the *Alerts* buffer." - :type 'boolean - :group 'alert) - -(defcustom alert-default-icon - (concat data-directory - "images/icons/hicolor/scalable/apps/emacs.svg") - "Filename of default icon to show for libnotify-alerts." - :type 'string - :group 'alert) - -(defvar alert-styles nil) - -(defun alert-styles-radio-type (widget-name) - (append - (list widget-name :tag "Style") - (mapcar #'(lambda (style) - (list 'const - :tag (or (plist-get (cdr style) :title) - (symbol-name (car style))) - (car style))) - (setq alert-styles - (sort alert-styles - #'(lambda (l r) - (string< (symbol-name (car l)) - (symbol-name (car r))))))))) - -(defcustom alert-default-style 'message - "The style to use if no rules match in the current configuration. -If a configured rule does match an alert, this style is not used; -it is strictly a fallback." - :type (alert-styles-radio-type 'radio) - :group 'alert) - -(defun alert-configuration-type () - (list 'repeat - (list - 'list :tag "Select style if alert matches selector" - '(repeat - :tag "Selector" - (choice - (cons :tag "Severity" - (const :format "" :severity) - (set (const :tag "Urgent" urgent) - (const :tag "High" high) - (const :tag "Moderate" moderate) - (const :tag "Normal" normal) - (const :tag "Low" low) - (const :tag "Trivial" trivial))) - (cons :tag "User Status" - (const :format "" :status) - (set (const :tag "Buffer not visible" buried) - (const :tag "Buffer visible" visible) - (const :tag "Buffer selected" selected) - (const :tag "Buffer selected, user idle" idle))) - (cons :tag "Major Mode" - (const :format "" :mode) - regexp) - (cons :tag "Category" - (const :format "" :category) - regexp) - (cons :tag "Title" - (const :format "" :title) - regexp) - (cons :tag "Message" - (const :format "" :message) - regexp) - (cons :tag "Predicate" - (const :format "" :predicate) - function) - (cons :tag "Icon" - (const :format "" :icon) - regexp))) - (alert-styles-radio-type 'choice) - '(set :tag "Options" - (cons :tag "Make alert persistent" - (const :format "" :persistent) - (choice :value t (const :tag "Yes" t) - (function :tag "Predicate"))) - (cons :tag "Never persist" - (const :format "" :never-persist) - (choice :value t (const :tag "Yes" t) - (function :tag "Predicate"))) - (cons :tag "Continue to next rule" - (const :format "" :continue) - (choice :value t (const :tag "Yes" t) - (function :tag "Predicate"))) - ;;(list :tag "Change Severity" - ;; (radio :tag "From" - ;; (const :tag "Urgent" urgent) - ;; (const :tag "High" high) - ;; (const :tag "Moderate" moderate) - ;; (const :tag "Normal" normal) - ;; (const :tag "Low" low) - ;; (const :tag "Trivial" trivial)) - ;; (radio :tag "To" - ;; (const :tag "Urgent" urgent) - ;; (const :tag "High" high) - ;; (const :tag "Moderate" moderate) - ;; (const :tag "Normal" normal) - ;; (const :tag "Low" low) - ;; (const :tag "Trivial" trivial))) - )))) - -(defcustom alert-user-configuration nil - "Rules that determine how and when alerts get displayed." - :type (alert-configuration-type) - :group 'alert) - -(defvar alert-internal-configuration nil - "Rules added by `alert-add-rule'. -For user customization, see `alert-user-configuration'.") - -(defface alert-urgent-face - '((t (:foreground "Red" :bold t))) - "Urgent alert face." - :group 'alert) - -(defface alert-high-face - '((t (:foreground "Dark Orange" :bold t))) - "High alert face." - :group 'alert) - -(defface alert-moderate-face - '((t (:foreground "Gold" :bold t))) - "Moderate alert face." - :group 'alert) - -(defface alert-normal-face - '((t)) - "Normal alert face." - :group 'alert) - -(defface alert-low-face - '((t (:foreground "Dark Blue"))) - "Low alert face." - :group 'alert) - -(defface alert-trivial-face - '((t (:foreground "Dark Purple"))) - "Trivial alert face." - :group 'alert) - -(defun alert-define-style (name &rest plist) - "Define a new style for notifying the user of alert messages. -To create a new style, you need to at least write a \"notifier\", -which is a function that receives the details of the alert. -These details are given in a plist which uses various keyword to -identify the parts of the alert. Here is a prototypical style -definition: - -\(alert-define-style 'style-name :title \"My Style's title\" - :notifier - (lambda (info) - ;; The message text is :message - (plist-get info :message) - ;; The :title of the alert - (plist-get info :title) - ;; The :category of the alert - (plist-get info :category) - ;; The major-mode this alert relates to - (plist-get info :mode) - ;; The buffer the alert relates to - (plist-get info :buffer) - ;; Severity of the alert. It is one of: - ;; `urgent' - ;; `high' - ;; `moderate' - ;; `normal' - ;; `low' - ;; `trivial' - (plist-get info :severity) - ;; Whether this alert should persist, or fade away - (plist-get info :persistent) - ;; Data which was passed to `alert'. Can be - ;; anything. - (plist-get info :data)) - - ;; Removers are optional. Their job is to remove - ;; the visual or auditory effect of the alert. - :remover - (lambda (info) - ;; It is the same property list that was passed to - ;; the notifier function. - ))" - (add-to-list 'alert-styles (cons name plist)) - (put 'alert-user-configuration 'custom-type (alert-configuration-type)) - (put 'alert-define-style 'custom-type (alert-styles-radio-type 'radio))) - -(alert-define-style 'ignore :title "Ignore Alert" - :notifier #'ignore - :remover #'ignore) - -;;;###autoload -(defun* alert-add-rule (&key severity status mode category title - message predicate icon (style alert-default-style) - persistent continue never-persist append) - "Programmatically add an alert configuration rule. - -Normally, users should custoimze `alert-user-configuration'. -This facility is for module writers and users that need to do -things the Lisp way. - -Here is a rule the author currently uses with ERC, so that the -fringe gets colored whenever people chat on BitlBee: - -\(alert-add-rule :status \\='(buried visible idle) - :severity \\='(moderate high urgent) - :mode \\='erc-mode - :predicate - #\\='(lambda (info) - (string-match (concat \"\\\\`[^&].*@BitlBee\\\\\\='\") - (erc-format-target-and/or-network))) - :persistent - #\\='(lambda (info) - ;; If the buffer is buried, or the user has been - ;; idle for `alert-reveal-idle-time' seconds, - ;; make this alert persistent. Normally, alerts - ;; become persistent after - ;; `alert-persist-idle-time' seconds. - (memq (plist-get info :status) \\='(buried idle))) - :style \\='fringe - :continue t)" - (let ((rule (list (list t) style (list t)))) - (if severity - (nconc (nth 0 rule) - (list (cons :severity - (if (listp severity) - severity - (list severity)))))) - (if status - (nconc (nth 0 rule) - (list (cons :status - (if (listp status) - status - (list status)))))) - (if mode - (nconc (nth 0 rule) - (list (cons :mode - (if (stringp mode) - mode - (concat "\\`" (symbol-name mode) - "\\'")))))) - (if category - (nconc (nth 0 rule) (list (cons :category category)))) - (if title - (nconc (nth 0 rule) (list (cons :title title)))) - (if message - (nconc (nth 0 rule) (list (cons :message message)))) - (if predicate - (nconc (nth 0 rule) (list (cons :predicate predicate)))) - (if icon - (nconc (nth 0 rule) (list (cons :icon icon)))) - (setcar rule (cdr (nth 0 rule))) - - (if persistent - (nconc (nth 2 rule) (list (cons :persistent persistent)))) - (if never-persist - (nconc (nth 2 rule) (list (cons :never-persist never-persist)))) - (if continue - (nconc (nth 2 rule) (list (cons :continue continue)))) - (setcdr (cdr rule) (list (cdr (nth 2 rule)))) - - (if (null alert-internal-configuration) - (setq alert-internal-configuration (list rule)) - (if append - (nconc alert-internal-configuration (list rule)) - (setq alert-internal-configuration - (cons rule alert-internal-configuration)))) - - rule)) - -(alert-define-style 'ignore :title "Don't display alerts") - -(defun alert-log-notify (info) - (let* ((mes (plist-get info :message)) - (sev (plist-get info :severity)) - (len (length mes)) - (func (cdr (assoc sev alert-log-severity-functions)))) - (if (not (featurep 'log4e)) - (alert-legacy-log-notify mes sev len) - ;; when we get here you better be using log4e or have your logging - ;; functions defined - (if (fboundp func) - (apply func (list mes)) - (when (fboundp 'log4e:deflogger) - (log4e:deflogger "alert" "%t [%l] %m" "%H:%M:%S") - (when (functionp 'alert--log-set-level) - (alert--log-set-level alert-log-level))))))) - -(defun alert-legacy-log-notify (mes sev len) - (with-current-buffer - (get-buffer-create "*Alerts*") - (goto-char (point-max)) - (insert (format-time-string "%H:%M %p - ")) - (insert mes) - (set-text-properties (- (point) len) (point) - (list 'face (cdr (assq sev - alert-severity-faces)))) - (insert ?\n))) - -(defun alert-log-clear (info) - (if (functionp 'alert--log-clear-log) - (alert--log-clear-log) - (if (bufferp "*Alerts*") - (with-current-buffer - (get-buffer-create "*Alerts*") - (goto-char (point-max)) - (insert (format-time-string "%H:%M %p - ") - "Clear: " (plist-get info :message) - ?\n))))) - -(alert-define-style 'log :title "Log to *Alerts* buffer" - :notifier #'alert-log-notify - ;;:remover #'alert-log-clear - ) - -(defun alert-message-notify (info) - ;; the message text might contain `%' and we don't want them to be - ;; interpreted as format specifiers: - (message "%s" (plist-get info :message)) - ;;(if (memq (plist-get info :severity) '(high urgency)) - ;; (ding)) - ) - -(defun alert-message-remove (info) - (message "")) - -(alert-define-style 'message :title "Display message in minibuffer" - :notifier #'alert-message-notify - :remover #'alert-message-remove) - -(defun alert-momentary-notify (info) - (save-excursion - (with-current-buffer (or (plist-get info :buffer) (current-buffer)) - (momentary-string-display - (format "%s: %s (%s/%s/%s)" - (or (plist-get info :title) "untitled") - (or (plist-get info :message) "no message") - (or (plist-get info :severity) "no priority") - (or (plist-get info :category) "no category") - (or (plist-get info :mode) "no mode")) - (progn - (beginning-of-line) - (point)))))) - -(alert-define-style 'momentary :title "Display message momentarily in buffer" - :notifier #'alert-momentary-notify - ;; explicitly, we don't need a remover - :remover #'ignore) - -(copy-face 'fringe 'alert-saved-fringe-face) - -(defun alert-fringe-notify (info) - (set-face-background 'fringe (cdr (assq (plist-get info :severity) - alert-severity-colors)))) - -(defun alert-fringe-restore (info) - (copy-face 'alert-saved-fringe-face 'fringe)) - -(alert-define-style 'fringe :title "Change the fringe color" - :notifier #'alert-fringe-notify - :remover #'alert-fringe-restore) - - -(defun alert-mode-line-notify (info) - (copy-face 'mode-line 'alert-saved-mode-line-face) - (set-face-background 'mode-line (cdr (assq (plist-get info :severity) - alert-severity-colors))) - (set-face-foreground 'mode-line "white")) - -(defun alert-mode-line-restore (info) - (copy-face 'alert-saved-mode-line-face 'mode-line)) - -(alert-define-style 'mode-line :title "Change the mode-line color" - :notifier #'alert-mode-line-notify - :remover #'alert-mode-line-restore) - - - -(defcustom alert-growl-command (executable-find "growlnotify") - "Path to the growlnotify command. -This is found in the Growl Extras: http://growl.info/extras.php." - :type 'file - :group 'alert) - -(defcustom alert-growl-priorities - '((urgent . 2) - (high . 2) - (moderate . 1) - (normal . 0) - (low . -1) - (trivial . -2)) - "A mapping of alert severities onto Growl priority values." - :type '(alist :key-type symbol :value-type integer) - :group 'alert) - -(defsubst alert-encode-string (str) - (encode-coding-string str (keyboard-coding-system))) - -(defun alert-growl-notify (info) - (if alert-growl-command - (let ((args - (list "--appIcon" "Emacs" - "--name" "Emacs" - "--title" (alert-encode-string (plist-get info :title)) - "--message" (alert-encode-string (plist-get info :message)) - "--priority" (number-to-string - (cdr (assq (plist-get info :severity) - alert-growl-priorities)))))) - (if (and (plist-get info :persistent) - (not (plist-get info :never-persist))) - (nconc args (list "--sticky"))) - (apply #'call-process alert-growl-command nil nil nil args)) - (alert-message-notify info))) - -(alert-define-style 'growl :title "Notify using Growl" - :notifier #'alert-growl-notify) - - -(defcustom alert-libnotify-command (executable-find "notify-send") - "Path to the notify-send command. -This is found in the libnotify-bin package in Debian based -systems." - :type 'file - :group 'alert) - -(defcustom alert-libnotify-additional-args - nil - "Additional args to pass to notify-send. -Must be a list of strings." - :type '(repeat string) - :group 'alert) - -(defcustom alert-libnotify-priorities - '((urgent . critical) - (high . critical) - (moderate . normal) - (normal . normal) - (low . low) - (trivial . low)) - "A mapping of alert severities onto libnotify priority values." - :type '(alist :key-type symbol :value-type symbol) - :group 'alert) - -(defun alert-libnotify-notify (info) - "Send INFO using notify-send. -Handles :ICON, :CATEGORY, :SEVERITY, :PERSISTENT, :NEVER-PERSIST, :TITLE -and :MESSAGE keywords from the INFO plist. :CATEGORY can be -passed as a single symbol, a string or a list of symbols or -strings." - (if alert-libnotify-command - (let* ((args - (append - (list "--icon" (or (plist-get info :icon) - alert-default-icon) - "--app-name" "Emacs" - "--urgency" (let ((urgency (cdr (assq - (plist-get info :severity) - alert-libnotify-priorities)))) - (if urgency - (symbol-name urgency) - "normal"))) - alert-libnotify-additional-args)) - (category (plist-get info :category))) - (if (and (plist-get info :persistent) - (not (plist-get info :never-persist))) - (nconc args (list "--expire-time 0"))) - (when category - (nconc args - (list "--category" - (cond ((symbolp category) - (symbol-name category)) - ((stringp category) category) - ((listp category) - (mapconcat (if (symbolp (car category)) - #'symbol-name - #'identity) - category ",")))))) - (nconc args (list - (alert-encode-string (plist-get info :title)) - (alert-encode-string (plist-get info :message)))) - (apply #'call-process alert-libnotify-command nil - (list (get-buffer-create " *libnotify output*") t) nil args)) - (alert-message-notify info))) - -(alert-define-style 'libnotify :title "Notify using libnotify" - :notifier #'alert-libnotify-notify) - - -(defcustom alert-gntp-icon - "http://cvs.savannah.gnu.org/viewvc/*checkout*/emacs/emacs/etc/images/icons/hicolor/48x48/apps/emacs.png" - "Icon file using gntp." - :type 'string - :group 'alert) - -(when (featurep 'gntp) -(defun alert-gntp-notify (info) - (gntp-notify 'alert - (alert-encode-string (plist-get info :title)) - (alert-encode-string (plist-get info :message)) - gntp-server nil - (number-to-string - (cdr (assq (plist-get info :severity) - alert-growl-priorities))) - (if (eq (plist-get info :icon) nil) - alert-gntp-icon - (plist-get info :icon))) - (alert-message-notify info)) - -(alert-define-style 'gntp :title "Notify using gntp" - :notifier #'alert-gntp-notify)) - - -(defcustom alert-notifications-priorities - '((urgent . critical) - (high . critical) - (moderate . normal) - (normal . normal) - (low . low) - (trivial . low)) - "A mapping of alert severities onto Growl priority values." - :type '(alist :key-type symbol :value-type integer) - :group 'alert) - -(defvar alert-notifications-ids (make-hash-table :test #'equal) - "Internal store of notification ids returned by the `notifications' backend. -Used for replacing notifications with the same id. The key is -the value of the :id keyword to `alert'. An id is only stored -here if there `alert' was called ith an :id keyword and handled -by the `notifications' style.") - -(when (featurep 'notifications) -(defun alert-notifications-notify (info) - "Show the alert defined by INFO with `notifications-notify'." - (let ((id (notifications-notify :title (plist-get info :title) - :body (plist-get info :message) - :app-icon (plist-get info :icon) - :timeout (if (plist-get info :persistent) 0 -1) - :replaces-id (gethash (plist-get info :id) alert-notifications-ids) - :urgency (cdr (assq (plist-get info :severity) - alert-notifications-priorities))))) - (when (plist-get info :id) - (puthash (plist-get info :id) id alert-notifications-ids))) - (alert-message-notify info)) - -(defun alert-notifications-remove (info) - "Remove the `notifications-notify' message based on INFO :id." - (let ((id (and (plist-get info :id) - (gethash (plist-get info :id) alert-notifications-ids)))) - (when id - (notifications-close-notification id) - (remhash (plist-get info :id) alert-notifications-ids)))) - -(alert-define-style 'notifications :title "Notify using notifications" - :notifier #'alert-notifications-notify)) - - -(defcustom alert-notifier-command (executable-find "terminal-notifier") - "Path to the terminal-notifier command. -From https://github.com/julienXX/terminal-notifier." - :type 'file - :group 'alert) - -(defcustom alert-notifier-default-icon - (concat data-directory - "images/icons/hicolor/128x128/apps/emacs.png") - "Filename of default icon to show for terminal-notifier alerts." - :type 'string - :group 'alert) - -(defun alert-notifier-notify (info) - (if alert-notifier-command - (let ((args - (list "-title" (alert-encode-string (plist-get info :title)) - "-appIcon" (or (plist-get info :icon) alert-notifier-default-icon) - "-message" (alert-encode-string (plist-get info :message))))) - (apply #'call-process alert-notifier-command nil nil nil args)) - (alert-message-notify info))) - -(alert-define-style 'notifier :title "Notify using terminal-notifier" - :notifier #'alert-notifier-notify) - -(defun alert-osx-notifier-notify (info) - (apply #'call-process "osascript" nil nil nil "-e" (list (format "display notification %S with title %S" - (alert-encode-string (plist-get info :message)) - (alert-encode-string (plist-get info :title))))) - (alert-message-notify info)) - -(alert-define-style 'osx-notifier :title "Notify using native OSX notification" :notifier #'alert-osx-notifier-notify) - -(defun alert-frame-notify (info) - (let ((buf (plist-get info :buffer))) - (if (eq (alert-buffer-status buf) 'buried) - (let ((current-frame (selected-frame))) - (with-selected-frame - (make-frame '((width . 80) - (height . 20) - (top . -1) - (left . 0) - (left-fringe . 0) - (right-fringe . 0) - (tool-bar-lines . nil) - (menu-bar-lines . nil) - (vertical-scroll-bars . nil) - (unsplittable . t) - (has-modeline-p . nil) - (minibuffer . nil))) - (switch-to-buffer buf) - ;;(set (make-local-variable 'mode-line-format) nil) - (nconc info (list :frame (selected-frame)))) - (select-frame current-frame))))) - -(defun alert-frame-remove (info) - (unless (eq this-command 'handle-switch-frame) - (delete-frame (plist-get info :frame) t))) - -; This code was kindly borrowed from Arne Babenhauserheide: -; http://www.draketo.de/proj/babcore/#sec-3-14-2 -(defun x-urgency-hint (frame arg &optional source) - "Set the x-urgency hint for the frame to arg: - -- If arg is nil, unset the urgency. -- If arg is any other value, set the urgency. - -If you unset the urgency, you still have to visit the frame to make the urgency -setting disappear (at least in KDE)." - (let* ((wm-hints (append (x-window-property - "WM_HINTS" frame "WM_HINTS" - source nil t) nil)) - (flags (car wm-hints))) - (setcar wm-hints - (if arg - (logior flags #x00000100) - (logand flags #x1ffffeff))) - (x-change-window-property "WM_HINTS" wm-hints frame "WM_HINTS" 32 t))) - -(defun x-urgent (&optional arg) - "Mark the current emacs frame as requiring urgent attention. - -With a prefix argument which does not equal a boolean value of nil, -remove the urgency flag (which might or might not change display, depending on -the window manager)." - (interactive "P") - (let (frame (car (car (cdr (current-frame-configuration))))) - (x-urgency-hint frame (not arg)))) - -(defun alert-x11-notify (info) - (x-urgent)) - -(alert-define-style 'x11 :title "Set the X11 window property" - :notifier #'alert-x11-notify) - - -(defcustom alert-toaster-default-icon - (let ((exec-bin (executable-find "emacs.exe"))) - (cond (exec-bin - (concat (file-name-directory exec-bin) "../share/icons/hicolor/128x128/apps/emacs.png")) - (t nil))) - "Icon file using toaster." - :type 'string - :group 'alert - ) - -(defcustom alert-toaster-command (executable-find "toast") - "Path to the toast command. -This is found at https://github.com/nels-o/toaster." - :type 'file - :group 'alert - ) - -(defun alert-toaster-notify (info) - (if alert-toaster-command - (let ((args (list - "-t" (alert-encode-string (plist-get info :title)) - "-m" (alert-encode-string (plist-get info :message)) - "-p" (expand-file-name (or (plist-get info :icon) alert-toaster-default-icon)) - ))) - (apply #'call-process alert-toaster-command nil nil nil args)) - (alert-message-notify info))) - -(alert-define-style 'toaster :title "Notify using Toaster" - :notifier #'alert-toaster-notify) - -;; jww (2011-08-25): Not quite working yet -;;(alert-define-style 'frame :title "Popup buffer in a frame" -;; :notifier #'alert-frame-notify -;; :remover #'alert-frame-remove) - -(defun alert-buffer-status (&optional buffer) - (with-current-buffer (or buffer (current-buffer)) - (let ((wind (get-buffer-window))) - (if wind - (if (eq wind (selected-window)) - (if (and (current-idle-time) - (> (float-time (current-idle-time)) - alert-reveal-idle-time)) - 'idle - 'selected) - 'visible) - 'buried)))) - -(defvar alert-active-alerts nil) - -(defun alert-remove-when-active (remover info) - (let ((idle-time (and (current-idle-time) - (float-time (current-idle-time))))) - (cond - ((and idle-time (> idle-time alert-persist-idle-time))) - ((and idle-time (> idle-time alert-reveal-idle-time)) - (run-with-timer alert-fade-time nil - #'alert-remove-when-active remover info)) - (t - (funcall remover info))))) - -(defun alert-remove-on-command () - (let (to-delete) - (dolist (alert alert-active-alerts) - (when (eq (current-buffer) (nth 0 alert)) - (push alert to-delete) - (if (nth 2 alert) - (funcall (nth 2 alert) (nth 1 alert))))) - (dolist (alert to-delete) - (setq alert-active-alerts (delq alert alert-active-alerts))))) - -(defun alert-send-notification - (alert-buffer info style-def &optional persist never-per) - (let ((notifier (plist-get style-def :notifier))) - (if notifier - (funcall notifier info))) - (let ((remover (plist-get style-def :remover))) - (add-to-list 'alert-active-alerts (list alert-buffer info remover)) - (with-current-buffer alert-buffer - (add-hook 'post-command-hook #'alert-remove-on-command nil t)) - (if (and remover (or (not persist) never-per)) - (run-with-timer alert-fade-time nil - #'alert-remove-when-active - remover info)))) - -;;;###autoload -(defun* alert (message &key (severity 'normal) title icon category - buffer mode data style persistent never-persist - id) - "Alert the user that something has happened. -MESSAGE is what the user will see. You may also use keyword -arguments to specify additional details. Here is a full example: - -\(alert \"This is a message\" - :severity \\='high ;; The default severity is `normal' - :title \"Title\" ;; An optional title - :category \\='example ;; A symbol to identify the message - :mode \\='text-mode ;; Normally determined automatically - :buffer (current-buffer) ;; This is the default - :data nil ;; Unused by alert.el itself - :persistent nil ;; Force the alert to be persistent; - ;; it is best not to use this - :never-persist nil ;; Force this alert to never persist - :id \\='my-id) ;; Used to replace previous message of - ;; the same id in styles that support it - :style \\='fringe) ;; Force a given style to be used; - ;; this is only for debugging! - -If no :title is given, the buffer-name of :buffer is used. If -:buffer is nil, it is the current buffer at the point of call. - -:data is an opaque value which modules can pass through to their -own styles if they wish. - -Here are some more typical examples of usage: - - ;; This is the most basic form usage - (alert \"This is an alert\") - - ;; You can adjust the severity for more important messages - (alert \"This is an alert\" :severity \\='high) - - ;; Or decrease it for purely informative ones - (alert \"This is an alert\" :severity \\='trivial) - - ;; Alerts can have optional titles. Otherwise, the title is the - ;; buffer-name of the (current-buffer) where the alert originated. - (alert \"This is an alert\" :title \"My Alert\") - - ;; Further, alerts can have categories. This allows users to - ;; selectively filter on them. - (alert \"This is an alert\" :title \"My Alert\" - :category \\='some-category-or-other)" - (destructuring-bind - (alert-buffer current-major-mode current-buffer-status - current-buffer-name) - (with-current-buffer (or buffer (current-buffer)) - (list (current-buffer) - (or mode major-mode) - (alert-buffer-status) - (buffer-name))) - - (let ((base-info (list :message message - :title (or title current-buffer-name) - :icon icon - :severity severity - :category category - :buffer alert-buffer - :mode current-major-mode - :id id - :data data)) - matched) - - (if alert-log-messages - (alert-log-notify base-info)) - - (unless alert-hide-all-notifications - (catch 'finish - (dolist (config (append alert-user-configuration - alert-internal-configuration)) - (let* ((style-def (cdr (assq (or style (nth 1 config)) - alert-styles))) - (options (nth 2 config)) - (persist-p (or persistent - (cdr (assq :persistent options)))) - (persist (if (functionp persist-p) - (funcall persist-p base-info) - persist-p)) - (never-persist-p - (or never-persist - (cdr (assq :never-persist options)))) - (never-per (if (functionp never-persist-p) - (funcall never-persist-p base-info) - never-persist-p)) - (continue (cdr (assq :continue options))) - info) - (setq info (if (not (memq :persistent base-info)) - (append base-info (list :persistent persist)) - base-info) - info (if (not (memq :never-persist info)) - (append info (list :never-persist never-per)) - info)) - (when - (or style ; :style always "matches", for testing - (not - (memq - nil - (mapcar - #'(lambda (condition) - (case (car condition) - (:severity - (memq severity (cdr condition))) - (:status - (memq current-buffer-status (cdr condition))) - (:mode - (string-match - (cdr condition) - (symbol-name current-major-mode))) - (:category - (and category (string-match - (cdr condition) - (if (stringp category) - category - (symbol-name category))))) - (:title - (and title - (string-match (cdr condition) title))) - (:message - (string-match (cdr condition) message)) - (:predicate - (funcall (cdr condition) info)) - (:icon - (string-match (cdr condition) icon)))) - (nth 0 config))))) - - (alert-send-notification alert-buffer info style-def - persist never-per) - (setq matched t) - (if (or style (not (if (functionp continue) - (funcall continue info) - continue))) - (throw 'finish t))))))) - - (if (and (not matched) alert-default-style) - (alert-send-notification alert-buffer base-info - (cdr (assq alert-default-style - alert-styles))))))) - -(provide 'alert) - -;;; alert.el ends here diff --git a/elpa/alert-20180122.1242/alert.elc b/elpa/alert-20180122.1242/alert.elc deleted file mode 100644 index 31f0496..0000000 Binary files a/elpa/alert-20180122.1242/alert.elc and /dev/null differ diff --git a/elpa/alert-20180403.38/alert-autoloads.el b/elpa/alert-20180403.38/alert-autoloads.el deleted file mode 100644 index ce4e7f8..0000000 --- a/elpa/alert-20180403.38/alert-autoloads.el +++ /dev/null @@ -1,94 +0,0 @@ -;;; alert-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "alert" "alert.el" (23243 33696 0 0)) -;;; Generated autoloads from alert.el - -(autoload 'alert-add-rule "alert" "\ -Programmatically add an alert configuration rule. - -Normally, users should custoimze `alert-user-configuration'. -This facility is for module writers and users that need to do -things the Lisp way. - -Here is a rule the author currently uses with ERC, so that the -fringe gets colored whenever people chat on BitlBee: - -\(alert-add-rule :status \\='(buried visible idle) - :severity \\='(moderate high urgent) - :mode \\='erc-mode - :predicate - #\\='(lambda (info) - (string-match (concat \"\\\\`[^&].*@BitlBee\\\\\\='\") - (erc-format-target-and/or-network))) - :persistent - #\\='(lambda (info) - ;; If the buffer is buried, or the user has been - ;; idle for `alert-reveal-idle-time' seconds, - ;; make this alert persistent. Normally, alerts - ;; become persistent after - ;; `alert-persist-idle-time' seconds. - (memq (plist-get info :status) \\='(buried idle))) - :style \\='fringe - :continue t) - -\(fn &key SEVERITY STATUS MODE CATEGORY TITLE MESSAGE PREDICATE ICON (style alert-default-style) PERSISTENT CONTINUE NEVER-PERSIST APPEND)" nil nil) - -(autoload 'alert "alert" "\ -Alert the user that something has happened. -MESSAGE is what the user will see. You may also use keyword -arguments to specify additional details. Here is a full example: - -\(alert \"This is a message\" - :severity \\='high ;; The default severity is `normal' - :title \"Title\" ;; An optional title - :category \\='example ;; A symbol to identify the message - :mode \\='text-mode ;; Normally determined automatically - :buffer (current-buffer) ;; This is the default - :data nil ;; Unused by alert.el itself - :persistent nil ;; Force the alert to be persistent; - ;; it is best not to use this - :never-persist nil ;; Force this alert to never persist - :id \\='my-id) ;; Used to replace previous message of - ;; the same id in styles that support it - :style \\='fringe) ;; Force a given style to be used; - ;; this is only for debugging! - -If no :title is given, the buffer-name of :buffer is used. If -:buffer is nil, it is the current buffer at the point of call. - -:data is an opaque value which modules can pass through to their -own styles if they wish. - -Here are some more typical examples of usage: - - ;; This is the most basic form usage - (alert \"This is an alert\") - - ;; You can adjust the severity for more important messages - (alert \"This is an alert\" :severity \\='high) - - ;; Or decrease it for purely informative ones - (alert \"This is an alert\" :severity \\='trivial) - - ;; Alerts can have optional titles. Otherwise, the title is the - ;; buffer-name of the (current-buffer) where the alert originated. - (alert \"This is an alert\" :title \"My Alert\") - - ;; Further, alerts can have categories. This allows users to - ;; selectively filter on them. - (alert \"This is an alert\" :title \"My Alert\" - :category \\='some-category-or-other) - -\(fn MESSAGE &key (severity (quote normal)) TITLE ICON CATEGORY BUFFER MODE DATA STYLE PERSISTENT NEVER-PERSIST ID)" nil nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; alert-autoloads.el ends here diff --git a/elpa/alert-20180403.38/alert-pkg.el b/elpa/alert-20180403.38/alert-pkg.el deleted file mode 100644 index bc90b81..0000000 --- a/elpa/alert-20180403.38/alert-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "alert" "20180403.38" "Growl-style notification system for Emacs" '((gntp "0.1") (log4e "0.3.0")) :commit "667d9c7848c723eb392ab9bacae07966da3e3504" :keywords '("notification" "emacs" "message") :url "https://github.com/jwiegley/alert") diff --git a/elpa/alert-20180403.38/alert.el b/elpa/alert-20180403.38/alert.el deleted file mode 100644 index 0741f54..0000000 --- a/elpa/alert-20180403.38/alert.el +++ /dev/null @@ -1,1161 +0,0 @@ -;;; alert.el --- Growl-style notification system for Emacs - -;; Copyright (C) 2011-2013 John Wiegley - -;; Author: John Wiegley -;; Created: 24 Aug 2011 -;; Updated: 16 Mar 2015 -;; Version: 1.2 -;; Package-Version: 20180403.38 -;; Package-Requires: ((gntp "0.1") (log4e "0.3.0")) -;; Keywords: notification emacs message -;; X-URL: https://github.com/jwiegley/alert - -;; 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 2, 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: - -;; Alert is a Growl-workalike for Emacs which uses a common notification -;; interface and multiple, selectable "styles", whose use is fully -;; customizable by the user. -;; -;; * For module writers -;; -;; Just use `alert' instead of `message' as follows: -;; -;; (require 'alert) -;; -;; ;; This is the most basic form usage -;; (alert "This is an alert") -;; -;; ;; You can adjust the severity for more important messages -;; (alert "This is an alert" :severity 'high) -;; -;; ;; Or decrease it for purely informative ones -;; (alert "This is an alert" :severity 'trivial) -;; -;; ;; Alerts can have optional titles. Otherwise, the title is the -;; ;; buffer-name of the (current-buffer) where the alert originated. -;; (alert "This is an alert" :title "My Alert") -;; -;; ;; Further, alerts can have categories. This allows users to -;; ;; selectively filter on them. -;; (alert "This is an alert" :title "My Alert" :category 'debug) -;; -;; * For users -;; -;; For the user, there are several variables to control when and how alerts -;; are presented. By default, they appear in the minibuffer much the same -;; as a normal Emacs message. But there are many more possibilities: -;; -;; `alert-fade-time' -;; Normally alerts disappear after this many seconds, if the style -;; supports it. The default is 5 seconds. -;; -;; `alert-default-style' -;; Pick the style to use if no other config rule matches. The -;; default is `message', but `growl' works well too. -;; -;; `alert-reveal-idle-time' -;; If a config rule choose to match on `idle', this is how many -;; seconds idle the user has to be. Defaults to 5 so that users -;; don't miss any alerts, but 120 is also good. -;; -;; `alert-persist-idle-time' -;; After this many idle seconds, alerts will become sticky, and not -;; fade away more. The default is 15 minutes. -;; -;; `alert-log-messages' -;; By default, all alerts are logged to *Alerts* (and to *Messages*, -;; if the `message' style is being used). Set to nil to disable. -;; -;; `alert-hide-all-notifications' -;; Want alerts off entirely? They still get logged, however, unless -;; you've turned that off too. -;; -;; `alert-user-configuration' -;; This variable lets you control exactly how and when a particular -;; alert, a class of alerts, or all alerts, get reported -- or if at -;; all. Use this to make some alerts use Growl, while others are -;; completely silent. -;; -;; * Programmatically adding rules -;; -;; Users can also programmatically add configuration rules, in addition to -;; customizing `alert-user-configuration'. Here is one that the author -;; currently uses with ERC, so that the fringe gets colored whenever people -;; chat on BitlBee: -;; -;; (alert-add-rule :status '(buried visible idle) -;; :severity '(moderate high urgent) -;; :mode 'erc-mode -;; :predicate -;; #'(lambda (info) -;; (string-match (concat "\\`[^&].*@BitlBee\\'") -;; (erc-format-target-and/or-network))) -;; :persistent -;; #'(lambda (info) -;; ;; If the buffer is buried, or the user has been -;; ;; idle for `alert-reveal-idle-time' seconds, -;; ;; make this alert persistent. Normally, alerts -;; ;; become persistent after -;; ;; `alert-persist-idle-time' seconds. -;; (memq (plist-get info :status) '(buried idle))) -;; :style 'fringe -;; :continue t) -;; -;; * Builtin alert styles -;; -;; There are several builtin styles, and it is trivial to create new ones. -;; The builtins are: -;; -;; fringe - Changes the current frame's fringe background color -;; mode-line - Changes the current frame's mode-line background color -;; gntp - Uses gntp, it requires gntp.el (see https://github.com/tekai/gntp.el) -;; growl - Uses Growl on OS X, if growlnotify is on the PATH -;; ignore - Ignores the alert entirely -;; libnotify - Uses libnotify if notify-send is on the PATH -;; log - Logs the alert text to *Alerts*, with a timestamp -;; message - Uses the Emacs `message' facility -;; momentary - Uses the Emacs `momentary-string-display' facility -;; notifications - Uses notifications library via D-Bus -;; notifier - Uses terminal-notifier on OS X, if it is on the PATH -;; osx-notifier - Native OSX notifier using AppleScript -;; toaster - Use the toast notification system -;; x11 - - Changes the urgency property of the window in the X Window System -;; -;; * Defining new styles -;; -;; To create a new style, you need to at least write a "notifier", which is -;; a function that receives the details of the alert. These details are -;; given in a plist which uses various keyword to identify the parts of the -;; alert. Here is a prototypical style definition: -;; -;; (alert-define-style 'style-name :title "My Style's title" -;; :notifier -;; (lambda (info) -;; ;; The message text is :message -;; (plist-get info :message) -;; ;; The :title of the alert -;; (plist-get info :title) -;; ;; The :category of the alert -;; (plist-get info :category) -;; ;; The major-mode this alert relates to -;; (plist-get info :mode) -;; ;; The buffer the alert relates to -;; (plist-get info :buffer) -;; ;; Severity of the alert. It is one of: -;; ;; `urgent' -;; ;; `high' -;; ;; `moderate' -;; ;; `normal' -;; ;; `low' -;; ;; `trivial' -;; (plist-get info :severity) -;; ;; Whether this alert should persist, or fade away -;; (plist-get info :persistent) -;; ;; Data which was passed to `alert'. Can be -;; ;; anything. -;; (plist-get info :data)) -;; -;; ;; Removers are optional. Their job is to remove -;; ;; the visual or auditory effect of the alert. -;; :remover -;; (lambda (info) -;; ;; It is the same property list that was passed to -;; ;; the notifier function. -;; )) -;; -;; You can test a specific style with something like this: -;; -;; (let ((alert-user-configuration '((((:severity high)) momentary nil)))) -;; (alert "Same buffer momentary alert" :title "My Alert" :severity 'high) -;; (alert "This is a momentary alert in another visible buffer" :title "My Alert" -;; :severity 'high :buffer (other-buffer (current-buffer) t))) - -;;; Code: - -(eval-when-compile - (require 'cl)) -(require 'gntp nil t) -(eval-when-compile - ;; if not available, silence the byte compiler - (defvar gntp-server)) -(declare-function gntp-notify "gntp") -(require 'notifications nil t) -(require 'log4e nil t) - -;; shut up the byte compiler -(declare-function alert-gntp-notify "alert") -(declare-function alert-notifications-notify "alert") - -(defgroup alert nil - "Notification system for Emacs similar to Growl" - :group 'emacs) - -(defcustom alert-severity-faces - '((urgent . alert-urgent-face) - (high . alert-high-face) - (moderate . alert-moderate-face) - (normal . alert-normal-face) - (low . alert-low-face) - (trivial . alert-trivial-face)) - "Faces associated by default with alert severities." - :type '(alist :key-type symbol :value-type color) - :group 'alert) - -(defcustom alert-severity-colors - '((urgent . "red") - (high . "orange") - (moderate . "yellow") - (normal . "green") - (low . "blue") - (trivial . "purple")) - "Colors associated by default with alert severities. -This is used by styles external to Emacs that don't understand faces." - :type '(alist :key-type symbol :value-type color) - :group 'alert) - -(defcustom alert-log-severity-functions - '((urgent . alert--log-fatal) - (high . alert--log-error) - (moderate . alert--log-warn) - (normal . alert--log-info) - (low . alert--log-debug) - (trivial . alert--log-trace)) - "Log4e logging functions" - :type '(alist :key-type symbol :value-type color) - :group 'alert) - -(defcustom alert-log-level - 'normal - "Minimum level of messages to log" - :type 'symbol - :group 'alert) - -(defcustom alert-reveal-idle-time 15 - "If idle this many seconds, rules will match the `idle' property." - :type 'integer - :group 'alert) - -(defcustom alert-persist-idle-time 900 - "If idle this many seconds, all alerts become persistent. -This can be overriden with the Never Persist option (:never-persist)." - :type 'integer - :group 'alert) - -(defcustom alert-fade-time 5 - "If not idle, alerts disappear after this many seconds. -The amount of idle time is governed by `alert-persist-idle-time'." - :type 'integer - :group 'alert) - -(defcustom alert-hide-all-notifications nil - "If non-nil, no alerts are ever shown to the user." - :type 'boolean - :group 'alert) - -(defcustom alert-log-messages t - "If non-nil, all alerts are logged to the *Alerts* buffer." - :type 'boolean - :group 'alert) - -(defcustom alert-default-icon - (concat data-directory - "images/icons/hicolor/scalable/apps/emacs.svg") - "Filename of default icon to show for libnotify-alerts." - :type 'string - :group 'alert) - -(defvar alert-styles nil) - -(defun alert-styles-radio-type (widget-name) - (append - (list widget-name :tag "Style") - (mapcar #'(lambda (style) - (list 'const - :tag (or (plist-get (cdr style) :title) - (symbol-name (car style))) - (car style))) - (setq alert-styles - (sort alert-styles - #'(lambda (l r) - (string< (symbol-name (car l)) - (symbol-name (car r))))))))) - -(defcustom alert-default-style 'message - "The style to use if no rules match in the current configuration. -If a configured rule does match an alert, this style is not used; -it is strictly a fallback." - :type (alert-styles-radio-type 'radio) - :group 'alert) - -(defun alert-configuration-type () - (list 'repeat - (list - 'list :tag "Select style if alert matches selector" - '(repeat - :tag "Selector" - (choice - (cons :tag "Severity" - (const :format "" :severity) - (set (const :tag "Urgent" urgent) - (const :tag "High" high) - (const :tag "Moderate" moderate) - (const :tag "Normal" normal) - (const :tag "Low" low) - (const :tag "Trivial" trivial))) - (cons :tag "User Status" - (const :format "" :status) - (set (const :tag "Buffer not visible" buried) - (const :tag "Buffer visible" visible) - (const :tag "Buffer selected" selected) - (const :tag "Buffer selected, user idle" idle))) - (cons :tag "Major Mode" - (const :format "" :mode) - regexp) - (cons :tag "Category" - (const :format "" :category) - regexp) - (cons :tag "Title" - (const :format "" :title) - regexp) - (cons :tag "Message" - (const :format "" :message) - regexp) - (cons :tag "Predicate" - (const :format "" :predicate) - function) - (cons :tag "Icon" - (const :format "" :icon) - regexp))) - (alert-styles-radio-type 'choice) - '(set :tag "Options" - (cons :tag "Make alert persistent" - (const :format "" :persistent) - (choice :value t (const :tag "Yes" t) - (function :tag "Predicate"))) - (cons :tag "Never persist" - (const :format "" :never-persist) - (choice :value t (const :tag "Yes" t) - (function :tag "Predicate"))) - (cons :tag "Continue to next rule" - (const :format "" :continue) - (choice :value t (const :tag "Yes" t) - (function :tag "Predicate"))) - ;;(list :tag "Change Severity" - ;; (radio :tag "From" - ;; (const :tag "Urgent" urgent) - ;; (const :tag "High" high) - ;; (const :tag "Moderate" moderate) - ;; (const :tag "Normal" normal) - ;; (const :tag "Low" low) - ;; (const :tag "Trivial" trivial)) - ;; (radio :tag "To" - ;; (const :tag "Urgent" urgent) - ;; (const :tag "High" high) - ;; (const :tag "Moderate" moderate) - ;; (const :tag "Normal" normal) - ;; (const :tag "Low" low) - ;; (const :tag "Trivial" trivial))) - )))) - -(defcustom alert-user-configuration nil - "Rules that determine how and when alerts get displayed." - :type (alert-configuration-type) - :group 'alert) - -(defvar alert-internal-configuration nil - "Rules added by `alert-add-rule'. -For user customization, see `alert-user-configuration'.") - -(defface alert-urgent-face - '((t (:foreground "Red" :bold t))) - "Urgent alert face." - :group 'alert) - -(defface alert-high-face - '((t (:foreground "Dark Orange" :bold t))) - "High alert face." - :group 'alert) - -(defface alert-moderate-face - '((t (:foreground "Gold" :bold t))) - "Moderate alert face." - :group 'alert) - -(defface alert-normal-face - '((t)) - "Normal alert face." - :group 'alert) - -(defface alert-low-face - '((t (:foreground "Dark Blue"))) - "Low alert face." - :group 'alert) - -(defface alert-trivial-face - '((t (:foreground "Dark Purple"))) - "Trivial alert face." - :group 'alert) - -(defun alert-define-style (name &rest plist) - "Define a new style for notifying the user of alert messages. -To create a new style, you need to at least write a \"notifier\", -which is a function that receives the details of the alert. -These details are given in a plist which uses various keyword to -identify the parts of the alert. Here is a prototypical style -definition: - -\(alert-define-style 'style-name :title \"My Style's title\" - :notifier - (lambda (info) - ;; The message text is :message - (plist-get info :message) - ;; The :title of the alert - (plist-get info :title) - ;; The :category of the alert - (plist-get info :category) - ;; The major-mode this alert relates to - (plist-get info :mode) - ;; The buffer the alert relates to - (plist-get info :buffer) - ;; Severity of the alert. It is one of: - ;; `urgent' - ;; `high' - ;; `moderate' - ;; `normal' - ;; `low' - ;; `trivial' - (plist-get info :severity) - ;; Whether this alert should persist, or fade away - (plist-get info :persistent) - ;; Data which was passed to `alert'. Can be - ;; anything. - (plist-get info :data)) - - ;; Removers are optional. Their job is to remove - ;; the visual or auditory effect of the alert. - :remover - (lambda (info) - ;; It is the same property list that was passed to - ;; the notifier function. - ))" - (add-to-list 'alert-styles (cons name plist)) - (put 'alert-user-configuration 'custom-type (alert-configuration-type)) - (put 'alert-define-style 'custom-type (alert-styles-radio-type 'radio))) - -(alert-define-style 'ignore :title "Ignore Alert" - :notifier #'ignore - :remover #'ignore) - -;;;###autoload -(defun* alert-add-rule (&key severity status mode category title - message predicate icon (style alert-default-style) - persistent continue never-persist append) - "Programmatically add an alert configuration rule. - -Normally, users should custoimze `alert-user-configuration'. -This facility is for module writers and users that need to do -things the Lisp way. - -Here is a rule the author currently uses with ERC, so that the -fringe gets colored whenever people chat on BitlBee: - -\(alert-add-rule :status \\='(buried visible idle) - :severity \\='(moderate high urgent) - :mode \\='erc-mode - :predicate - #\\='(lambda (info) - (string-match (concat \"\\\\`[^&].*@BitlBee\\\\\\='\") - (erc-format-target-and/or-network))) - :persistent - #\\='(lambda (info) - ;; If the buffer is buried, or the user has been - ;; idle for `alert-reveal-idle-time' seconds, - ;; make this alert persistent. Normally, alerts - ;; become persistent after - ;; `alert-persist-idle-time' seconds. - (memq (plist-get info :status) \\='(buried idle))) - :style \\='fringe - :continue t)" - (let ((rule (list (list t) style (list t)))) - (if severity - (nconc (nth 0 rule) - (list (cons :severity - (if (listp severity) - severity - (list severity)))))) - (if status - (nconc (nth 0 rule) - (list (cons :status - (if (listp status) - status - (list status)))))) - (if mode - (nconc (nth 0 rule) - (list (cons :mode - (if (stringp mode) - mode - (concat "\\`" (symbol-name mode) - "\\'")))))) - (if category - (nconc (nth 0 rule) (list (cons :category category)))) - (if title - (nconc (nth 0 rule) (list (cons :title title)))) - (if message - (nconc (nth 0 rule) (list (cons :message message)))) - (if predicate - (nconc (nth 0 rule) (list (cons :predicate predicate)))) - (if icon - (nconc (nth 0 rule) (list (cons :icon icon)))) - (setcar rule (cdr (nth 0 rule))) - - (if persistent - (nconc (nth 2 rule) (list (cons :persistent persistent)))) - (if never-persist - (nconc (nth 2 rule) (list (cons :never-persist never-persist)))) - (if continue - (nconc (nth 2 rule) (list (cons :continue continue)))) - (setcdr (cdr rule) (list (cdr (nth 2 rule)))) - - (if (null alert-internal-configuration) - (setq alert-internal-configuration (list rule)) - (if append - (nconc alert-internal-configuration (list rule)) - (setq alert-internal-configuration - (cons rule alert-internal-configuration)))) - - rule)) - -(alert-define-style 'ignore :title "Don't display alerts") - -(defun alert-log-notify (info) - (let* ((mes (plist-get info :message)) - (sev (plist-get info :severity)) - (len (length mes)) - (func (cdr (assoc sev alert-log-severity-functions)))) - (if (not (featurep 'log4e)) - (alert-legacy-log-notify mes sev len) - ;; when we get here you better be using log4e or have your logging - ;; functions defined - (if (fboundp func) - (apply func (list mes)) - (when (fboundp 'log4e:deflogger) - (log4e:deflogger "alert" "%t [%l] %m" "%H:%M:%S") - (when (functionp 'alert--log-set-level) - (alert--log-set-level alert-log-level))))))) - -(defun alert-legacy-log-notify (mes sev len) - (with-current-buffer - (get-buffer-create "*Alerts*") - (goto-char (point-max)) - (insert (format-time-string "%H:%M %p - ")) - (insert mes) - (set-text-properties (- (point) len) (point) - (list 'face (cdr (assq sev - alert-severity-faces)))) - (insert ?\n))) - -(defun alert-log-clear (info) - (if (functionp 'alert--log-clear-log) - (alert--log-clear-log) - (if (bufferp "*Alerts*") - (with-current-buffer - (get-buffer-create "*Alerts*") - (goto-char (point-max)) - (insert (format-time-string "%H:%M %p - ") - "Clear: " (plist-get info :message) - ?\n))))) - -(alert-define-style 'log :title "Log to *Alerts* buffer" - :notifier #'alert-log-notify - ;;:remover #'alert-log-clear - ) - -(defun alert-message-notify (info) - ;; the message text might contain `%' and we don't want them to be - ;; interpreted as format specifiers: - (message "%s" (plist-get info :message)) - ;;(if (memq (plist-get info :severity) '(high urgency)) - ;; (ding)) - ) - -(defun alert-message-remove (info) - (message "")) - -(alert-define-style 'message :title "Display message in minibuffer" - :notifier #'alert-message-notify - :remover #'alert-message-remove) - -(defun alert-momentary-notify (info) - (save-excursion - (with-current-buffer (or (plist-get info :buffer) (current-buffer)) - (momentary-string-display - (format "%s: %s (%s/%s/%s)" - (or (plist-get info :title) "untitled") - (or (plist-get info :message) "no message") - (or (plist-get info :severity) "no priority") - (or (plist-get info :category) "no category") - (or (plist-get info :mode) "no mode")) - (progn - (beginning-of-line) - (point)))))) - -(alert-define-style 'momentary :title "Display message momentarily in buffer" - :notifier #'alert-momentary-notify - ;; explicitly, we don't need a remover - :remover #'ignore) - -(copy-face 'fringe 'alert-saved-fringe-face) - -(defun alert-fringe-notify (info) - (set-face-background 'fringe (cdr (assq (plist-get info :severity) - alert-severity-colors)))) - -(defun alert-fringe-restore (info) - (copy-face 'alert-saved-fringe-face 'fringe)) - -(alert-define-style 'fringe :title "Change the fringe color" - :notifier #'alert-fringe-notify - :remover #'alert-fringe-restore) - - -(defun alert-mode-line-notify (info) - (copy-face 'mode-line 'alert-saved-mode-line-face) - (set-face-background 'mode-line (cdr (assq (plist-get info :severity) - alert-severity-colors))) - (set-face-foreground 'mode-line "white")) - -(defun alert-mode-line-restore (info) - (copy-face 'alert-saved-mode-line-face 'mode-line)) - -(alert-define-style 'mode-line :title "Change the mode-line color" - :notifier #'alert-mode-line-notify - :remover #'alert-mode-line-restore) - - - -(defcustom alert-growl-command (executable-find "growlnotify") - "Path to the growlnotify command. -This is found in the Growl Extras: http://growl.info/extras.php." - :type 'file - :group 'alert) - -(defcustom alert-growl-priorities - '((urgent . 2) - (high . 2) - (moderate . 1) - (normal . 0) - (low . -1) - (trivial . -2)) - "A mapping of alert severities onto Growl priority values." - :type '(alist :key-type symbol :value-type integer) - :group 'alert) - -(defsubst alert-encode-string (str) - (encode-coding-string str (keyboard-coding-system))) - -(defun alert-growl-notify (info) - (if alert-growl-command - (let ((args - (list "--appIcon" "Emacs" - "--name" "Emacs" - "--title" (alert-encode-string (plist-get info :title)) - "--message" (alert-encode-string (plist-get info :message)) - "--priority" (number-to-string - (cdr (assq (plist-get info :severity) - alert-growl-priorities)))))) - (if (and (plist-get info :persistent) - (not (plist-get info :never-persist))) - (nconc args (list "--sticky"))) - (apply #'call-process alert-growl-command nil nil nil args)) - (alert-message-notify info))) - -(alert-define-style 'growl :title "Notify using Growl" - :notifier #'alert-growl-notify) - - -(defcustom alert-libnotify-command (executable-find "notify-send") - "Path to the notify-send command. -This is found in the libnotify-bin package in Debian based -systems." - :type 'file - :group 'alert) - -(defcustom alert-libnotify-additional-args - nil - "Additional args to pass to notify-send. -Must be a list of strings." - :type '(repeat string) - :group 'alert) - -(defcustom alert-libnotify-priorities - '((urgent . critical) - (high . critical) - (moderate . normal) - (normal . normal) - (low . low) - (trivial . low)) - "A mapping of alert severities onto libnotify priority values." - :type '(alist :key-type symbol :value-type symbol) - :group 'alert) - -(defun alert-libnotify-notify (info) - "Send INFO using notify-send. -Handles :ICON, :CATEGORY, :SEVERITY, :PERSISTENT, :NEVER-PERSIST, :TITLE -and :MESSAGE keywords from the INFO plist. :CATEGORY can be -passed as a single symbol, a string or a list of symbols or -strings." - (if alert-libnotify-command - (let* ((args - (append - (list "--icon" (or (plist-get info :icon) - alert-default-icon) - "--app-name" "Emacs" - "--urgency" (let ((urgency (cdr (assq - (plist-get info :severity) - alert-libnotify-priorities)))) - (if urgency - (symbol-name urgency) - "normal"))) - alert-libnotify-additional-args)) - (category (plist-get info :category))) - (nconc args - (list "--expire-time" - (number-to-string - (* 1000 ; notify-send takes msecs - (if (and (plist-get info :persistent) - (not (plist-get info :never-persist))) - 0 ; 0 indicates persistence - alert-fade-time))))) - (when category - (nconc args - (list "--category" - (cond ((symbolp category) - (symbol-name category)) - ((stringp category) category) - ((listp category) - (mapconcat (if (symbolp (car category)) - #'symbol-name - #'identity) - category ",")))))) - (nconc args (list - (alert-encode-string (plist-get info :title)) - (alert-encode-string (plist-get info :message)))) - (apply #'call-process alert-libnotify-command nil - (list (get-buffer-create " *libnotify output*") t) nil args)) - (alert-message-notify info))) - -(alert-define-style 'libnotify :title "Notify using libnotify" - :notifier #'alert-libnotify-notify) - - -(defcustom alert-gntp-icon - "http://cvs.savannah.gnu.org/viewvc/*checkout*/emacs/emacs/etc/images/icons/hicolor/48x48/apps/emacs.png" - "Icon file using gntp." - :type 'string - :group 'alert) - -(when (featurep 'gntp) -(defun alert-gntp-notify (info) - (gntp-notify 'alert - (alert-encode-string (plist-get info :title)) - (alert-encode-string (plist-get info :message)) - gntp-server nil - (number-to-string - (cdr (assq (plist-get info :severity) - alert-growl-priorities))) - (if (eq (plist-get info :icon) nil) - alert-gntp-icon - (plist-get info :icon))) - (alert-message-notify info)) - -(alert-define-style 'gntp :title "Notify using gntp" - :notifier #'alert-gntp-notify)) - - -(defcustom alert-notifications-priorities - '((urgent . critical) - (high . critical) - (moderate . normal) - (normal . normal) - (low . low) - (trivial . low)) - "A mapping of alert severities onto Growl priority values." - :type '(alist :key-type symbol :value-type integer) - :group 'alert) - -(defvar alert-notifications-ids (make-hash-table :test #'equal) - "Internal store of notification ids returned by the `notifications' backend. -Used for replacing notifications with the same id. The key is -the value of the :id keyword to `alert'. An id is only stored -here if there `alert' was called ith an :id keyword and handled -by the `notifications' style.") - -(when (featurep 'notifications) -(defun alert-notifications-notify (info) - "Show the alert defined by INFO with `notifications-notify'." - (let ((id (notifications-notify :title (plist-get info :title) - :body (plist-get info :message) - :app-icon (plist-get info :icon) - :timeout (if (plist-get info :persistent) 0 -1) - :replaces-id (gethash (plist-get info :id) alert-notifications-ids) - :urgency (cdr (assq (plist-get info :severity) - alert-notifications-priorities))))) - (when (plist-get info :id) - (puthash (plist-get info :id) id alert-notifications-ids))) - (alert-message-notify info)) - -(defun alert-notifications-remove (info) - "Remove the `notifications-notify' message based on INFO :id." - (let ((id (and (plist-get info :id) - (gethash (plist-get info :id) alert-notifications-ids)))) - (when id - (notifications-close-notification id) - (remhash (plist-get info :id) alert-notifications-ids)))) - -(alert-define-style 'notifications :title "Notify using notifications" - :notifier #'alert-notifications-notify)) - - -(defcustom alert-notifier-command (executable-find "terminal-notifier") - "Path to the terminal-notifier command. -From https://github.com/julienXX/terminal-notifier." - :type 'file - :group 'alert) - -(defcustom alert-notifier-default-icon - (concat data-directory - "images/icons/hicolor/128x128/apps/emacs.png") - "Filename of default icon to show for terminal-notifier alerts." - :type 'string - :group 'alert) - -(defun alert-notifier-notify (info) - (if alert-notifier-command - (let ((args - (list "-title" (alert-encode-string (plist-get info :title)) - "-appIcon" (or (plist-get info :icon) alert-notifier-default-icon) - "-message" (alert-encode-string (plist-get info :message))))) - (apply #'call-process alert-notifier-command nil nil nil args)) - (alert-message-notify info))) - -(alert-define-style 'notifier :title "Notify using terminal-notifier" - :notifier #'alert-notifier-notify) - -(defun alert-osx-notifier-notify (info) - (apply #'call-process "osascript" nil nil nil "-e" (list (format "display notification %S with title %S" - (alert-encode-string (plist-get info :message)) - (alert-encode-string (plist-get info :title))))) - (alert-message-notify info)) - -(alert-define-style 'osx-notifier :title "Notify using native OSX notification" :notifier #'alert-osx-notifier-notify) - -(defun alert-frame-notify (info) - (let ((buf (plist-get info :buffer))) - (if (eq (alert-buffer-status buf) 'buried) - (let ((current-frame (selected-frame))) - (with-selected-frame - (make-frame '((width . 80) - (height . 20) - (top . -1) - (left . 0) - (left-fringe . 0) - (right-fringe . 0) - (tool-bar-lines . nil) - (menu-bar-lines . nil) - (vertical-scroll-bars . nil) - (unsplittable . t) - (has-modeline-p . nil) - (minibuffer . nil))) - (switch-to-buffer buf) - ;;(set (make-local-variable 'mode-line-format) nil) - (nconc info (list :frame (selected-frame)))) - (select-frame current-frame))))) - -(defun alert-frame-remove (info) - (unless (eq this-command 'handle-switch-frame) - (delete-frame (plist-get info :frame) t))) - -; This code was kindly borrowed from Arne Babenhauserheide: -; http://www.draketo.de/proj/babcore/#sec-3-14-2 -(defun x-urgency-hint (frame arg &optional source) - "Set the x-urgency hint for the frame to arg: - -- If arg is nil, unset the urgency. -- If arg is any other value, set the urgency. - -If you unset the urgency, you still have to visit the frame to make the urgency -setting disappear (at least in KDE)." - (let* ((wm-hints (append (x-window-property - "WM_HINTS" frame "WM_HINTS" - source nil t) nil)) - (flags (car wm-hints))) - (setcar wm-hints - (if arg - (logior flags #x00000100) - (logand flags #x1ffffeff))) - (x-change-window-property "WM_HINTS" wm-hints frame "WM_HINTS" 32 t))) - -(defun x-urgent (&optional arg) - "Mark the current emacs frame as requiring urgent attention. - -With a prefix argument which does not equal a boolean value of nil, -remove the urgency flag (which might or might not change display, depending on -the window manager)." - (interactive "P") - (let (frame (car (car (cdr (current-frame-configuration))))) - (x-urgency-hint frame (not arg)))) - -(defun alert-x11-notify (info) - (x-urgent)) - -(alert-define-style 'x11 :title "Set the X11 window property" - :notifier #'alert-x11-notify) - - -(defcustom alert-toaster-default-icon - (let ((exec-bin (executable-find "emacs.exe"))) - (cond (exec-bin - (concat (file-name-directory exec-bin) "../share/icons/hicolor/128x128/apps/emacs.png")) - (t nil))) - "Icon file using toaster." - :type 'string - :group 'alert - ) - -(defcustom alert-toaster-command (executable-find "toast") - "Path to the toast command. -This is found at https://github.com/nels-o/toaster." - :type 'file - :group 'alert - ) - -(defun alert-toaster-notify (info) - (if alert-toaster-command - (let ((args (list - "-t" (alert-encode-string (plist-get info :title)) - "-m" (alert-encode-string (plist-get info :message)) - "-p" (expand-file-name (or (plist-get info :icon) alert-toaster-default-icon)) - ))) - (apply #'call-process alert-toaster-command nil nil nil args)) - (alert-message-notify info))) - -(alert-define-style 'toaster :title "Notify using Toaster" - :notifier #'alert-toaster-notify) - -;; jww (2011-08-25): Not quite working yet -;;(alert-define-style 'frame :title "Popup buffer in a frame" -;; :notifier #'alert-frame-notify -;; :remover #'alert-frame-remove) - -(defun alert-buffer-status (&optional buffer) - (with-current-buffer (or buffer (current-buffer)) - (let ((wind (get-buffer-window))) - (if wind - (if (eq wind (selected-window)) - (if (and (current-idle-time) - (> (float-time (current-idle-time)) - alert-reveal-idle-time)) - 'idle - 'selected) - 'visible) - 'buried)))) - -(defvar alert-active-alerts nil) - -(defun alert-remove-when-active (remover info) - (let ((idle-time (and (current-idle-time) - (float-time (current-idle-time))))) - (cond - ((and idle-time (> idle-time alert-persist-idle-time))) - ((and idle-time (> idle-time alert-reveal-idle-time)) - (run-with-timer alert-fade-time nil - #'alert-remove-when-active remover info)) - (t - (funcall remover info))))) - -(defun alert-remove-on-command () - (let (to-delete) - (dolist (alert alert-active-alerts) - (when (eq (current-buffer) (nth 0 alert)) - (push alert to-delete) - (if (nth 2 alert) - (funcall (nth 2 alert) (nth 1 alert))))) - (dolist (alert to-delete) - (setq alert-active-alerts (delq alert alert-active-alerts))))) - -(defun alert-send-notification - (alert-buffer info style-def &optional persist never-per) - (let ((notifier (plist-get style-def :notifier))) - (if notifier - (funcall notifier info))) - (let ((remover (plist-get style-def :remover))) - (add-to-list 'alert-active-alerts (list alert-buffer info remover)) - (with-current-buffer alert-buffer - (add-hook 'post-command-hook #'alert-remove-on-command nil t)) - (if (and remover (or (not persist) never-per)) - (run-with-timer alert-fade-time nil - #'alert-remove-when-active - remover info)))) - -;;;###autoload -(defun* alert (message &key (severity 'normal) title icon category - buffer mode data style persistent never-persist - id) - "Alert the user that something has happened. -MESSAGE is what the user will see. You may also use keyword -arguments to specify additional details. Here is a full example: - -\(alert \"This is a message\" - :severity \\='high ;; The default severity is `normal' - :title \"Title\" ;; An optional title - :category \\='example ;; A symbol to identify the message - :mode \\='text-mode ;; Normally determined automatically - :buffer (current-buffer) ;; This is the default - :data nil ;; Unused by alert.el itself - :persistent nil ;; Force the alert to be persistent; - ;; it is best not to use this - :never-persist nil ;; Force this alert to never persist - :id \\='my-id) ;; Used to replace previous message of - ;; the same id in styles that support it - :style \\='fringe) ;; Force a given style to be used; - ;; this is only for debugging! - -If no :title is given, the buffer-name of :buffer is used. If -:buffer is nil, it is the current buffer at the point of call. - -:data is an opaque value which modules can pass through to their -own styles if they wish. - -Here are some more typical examples of usage: - - ;; This is the most basic form usage - (alert \"This is an alert\") - - ;; You can adjust the severity for more important messages - (alert \"This is an alert\" :severity \\='high) - - ;; Or decrease it for purely informative ones - (alert \"This is an alert\" :severity \\='trivial) - - ;; Alerts can have optional titles. Otherwise, the title is the - ;; buffer-name of the (current-buffer) where the alert originated. - (alert \"This is an alert\" :title \"My Alert\") - - ;; Further, alerts can have categories. This allows users to - ;; selectively filter on them. - (alert \"This is an alert\" :title \"My Alert\" - :category \\='some-category-or-other)" - (destructuring-bind - (alert-buffer current-major-mode current-buffer-status - current-buffer-name) - (with-current-buffer (or buffer (current-buffer)) - (list (current-buffer) - (or mode major-mode) - (alert-buffer-status) - (buffer-name))) - - (let ((base-info (list :message message - :title (or title current-buffer-name) - :icon icon - :severity severity - :category category - :buffer alert-buffer - :mode current-major-mode - :id id - :data data)) - matched) - - (if alert-log-messages - (alert-log-notify base-info)) - - (unless alert-hide-all-notifications - (catch 'finish - (dolist (config (append alert-user-configuration - alert-internal-configuration)) - (let* ((style-def (cdr (assq (or style (nth 1 config)) - alert-styles))) - (options (nth 2 config)) - (persist-p (or persistent - (cdr (assq :persistent options)))) - (persist (if (functionp persist-p) - (funcall persist-p base-info) - persist-p)) - (never-persist-p - (or never-persist - (cdr (assq :never-persist options)))) - (never-per (if (functionp never-persist-p) - (funcall never-persist-p base-info) - never-persist-p)) - (continue (cdr (assq :continue options))) - info) - (setq info (if (not (memq :persistent base-info)) - (append base-info (list :persistent persist)) - base-info) - info (if (not (memq :never-persist info)) - (append info (list :never-persist never-per)) - info)) - (when - (or style ; :style always "matches", for testing - (not - (memq - nil - (mapcar - #'(lambda (condition) - (case (car condition) - (:severity - (memq severity (cdr condition))) - (:status - (memq current-buffer-status (cdr condition))) - (:mode - (string-match - (cdr condition) - (symbol-name current-major-mode))) - (:category - (and category (string-match - (cdr condition) - (if (stringp category) - category - (symbol-name category))))) - (:title - (and title - (string-match (cdr condition) title))) - (:message - (string-match (cdr condition) message)) - (:predicate - (funcall (cdr condition) info)) - (:icon - (string-match (cdr condition) icon)))) - (nth 0 config))))) - - (alert-send-notification alert-buffer info style-def - persist never-per) - (setq matched t) - (if (or style (not (if (functionp continue) - (funcall continue info) - continue))) - (throw 'finish t))))))) - - (if (and (not matched) alert-default-style) - (alert-send-notification alert-buffer base-info - (cdr (assq alert-default-style - alert-styles))))))) - -(provide 'alert) - -;;; alert.el ends here diff --git a/elpa/alert-20180403.738/alert-autoloads.el b/elpa/alert-20180403.738/alert-autoloads.el new file mode 100644 index 0000000..ed36585 --- /dev/null +++ b/elpa/alert-20180403.738/alert-autoloads.el @@ -0,0 +1,94 @@ +;;; alert-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "alert" "alert.el" (23392 1949 0 0)) +;;; Generated autoloads from alert.el + +(autoload 'alert-add-rule "alert" "\ +Programmatically add an alert configuration rule. + +Normally, users should custoimze `alert-user-configuration'. +This facility is for module writers and users that need to do +things the Lisp way. + +Here is a rule the author currently uses with ERC, so that the +fringe gets colored whenever people chat on BitlBee: + +\(alert-add-rule :status \\='(buried visible idle) + :severity \\='(moderate high urgent) + :mode \\='erc-mode + :predicate + #\\='(lambda (info) + (string-match (concat \"\\\\`[^&].*@BitlBee\\\\\\='\") + (erc-format-target-and/or-network))) + :persistent + #\\='(lambda (info) + ;; If the buffer is buried, or the user has been + ;; idle for `alert-reveal-idle-time' seconds, + ;; make this alert persistent. Normally, alerts + ;; become persistent after + ;; `alert-persist-idle-time' seconds. + (memq (plist-get info :status) \\='(buried idle))) + :style \\='fringe + :continue t) + +\(fn &key SEVERITY STATUS MODE CATEGORY TITLE MESSAGE PREDICATE ICON (style alert-default-style) PERSISTENT CONTINUE NEVER-PERSIST APPEND)" nil nil) + +(autoload 'alert "alert" "\ +Alert the user that something has happened. +MESSAGE is what the user will see. You may also use keyword +arguments to specify additional details. Here is a full example: + +\(alert \"This is a message\" + :severity \\='high ;; The default severity is `normal' + :title \"Title\" ;; An optional title + :category \\='example ;; A symbol to identify the message + :mode \\='text-mode ;; Normally determined automatically + :buffer (current-buffer) ;; This is the default + :data nil ;; Unused by alert.el itself + :persistent nil ;; Force the alert to be persistent; + ;; it is best not to use this + :never-persist nil ;; Force this alert to never persist + :id \\='my-id) ;; Used to replace previous message of + ;; the same id in styles that support it + :style \\='fringe) ;; Force a given style to be used; + ;; this is only for debugging! + +If no :title is given, the buffer-name of :buffer is used. If +:buffer is nil, it is the current buffer at the point of call. + +:data is an opaque value which modules can pass through to their +own styles if they wish. + +Here are some more typical examples of usage: + + ;; This is the most basic form usage + (alert \"This is an alert\") + + ;; You can adjust the severity for more important messages + (alert \"This is an alert\" :severity \\='high) + + ;; Or decrease it for purely informative ones + (alert \"This is an alert\" :severity \\='trivial) + + ;; Alerts can have optional titles. Otherwise, the title is the + ;; buffer-name of the (current-buffer) where the alert originated. + (alert \"This is an alert\" :title \"My Alert\") + + ;; Further, alerts can have categories. This allows users to + ;; selectively filter on them. + (alert \"This is an alert\" :title \"My Alert\" + :category \\='some-category-or-other) + +\(fn MESSAGE &key (severity (quote normal)) TITLE ICON CATEGORY BUFFER MODE DATA STYLE PERSISTENT NEVER-PERSIST ID)" nil nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; alert-autoloads.el ends here diff --git a/elpa/alert-20180403.738/alert-pkg.el b/elpa/alert-20180403.738/alert-pkg.el new file mode 100644 index 0000000..5ef9e69 --- /dev/null +++ b/elpa/alert-20180403.738/alert-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "alert" "20180403.738" "Growl-style notification system for Emacs" '((gntp "0.1") (log4e "0.3.0")) :commit "667d9c7848c723eb392ab9bacae07966da3e3504" :keywords '("notification" "emacs" "message") :authors '(("John Wiegley" . "jwiegley@gmail.com")) :maintainer '("John Wiegley" . "jwiegley@gmail.com") :url "https://github.com/jwiegley/alert") diff --git a/elpa/alert-20180403.738/alert.el b/elpa/alert-20180403.738/alert.el new file mode 100644 index 0000000..304834c --- /dev/null +++ b/elpa/alert-20180403.738/alert.el @@ -0,0 +1,1161 @@ +;;; alert.el --- Growl-style notification system for Emacs + +;; Copyright (C) 2011-2013 John Wiegley + +;; Author: John Wiegley +;; Created: 24 Aug 2011 +;; Updated: 16 Mar 2015 +;; Version: 1.2 +;; Package-Version: 20180403.738 +;; Package-Requires: ((gntp "0.1") (log4e "0.3.0")) +;; Keywords: notification emacs message +;; X-URL: https://github.com/jwiegley/alert + +;; 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 2, 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: + +;; Alert is a Growl-workalike for Emacs which uses a common notification +;; interface and multiple, selectable "styles", whose use is fully +;; customizable by the user. +;; +;; * For module writers +;; +;; Just use `alert' instead of `message' as follows: +;; +;; (require 'alert) +;; +;; ;; This is the most basic form usage +;; (alert "This is an alert") +;; +;; ;; You can adjust the severity for more important messages +;; (alert "This is an alert" :severity 'high) +;; +;; ;; Or decrease it for purely informative ones +;; (alert "This is an alert" :severity 'trivial) +;; +;; ;; Alerts can have optional titles. Otherwise, the title is the +;; ;; buffer-name of the (current-buffer) where the alert originated. +;; (alert "This is an alert" :title "My Alert") +;; +;; ;; Further, alerts can have categories. This allows users to +;; ;; selectively filter on them. +;; (alert "This is an alert" :title "My Alert" :category 'debug) +;; +;; * For users +;; +;; For the user, there are several variables to control when and how alerts +;; are presented. By default, they appear in the minibuffer much the same +;; as a normal Emacs message. But there are many more possibilities: +;; +;; `alert-fade-time' +;; Normally alerts disappear after this many seconds, if the style +;; supports it. The default is 5 seconds. +;; +;; `alert-default-style' +;; Pick the style to use if no other config rule matches. The +;; default is `message', but `growl' works well too. +;; +;; `alert-reveal-idle-time' +;; If a config rule choose to match on `idle', this is how many +;; seconds idle the user has to be. Defaults to 5 so that users +;; don't miss any alerts, but 120 is also good. +;; +;; `alert-persist-idle-time' +;; After this many idle seconds, alerts will become sticky, and not +;; fade away more. The default is 15 minutes. +;; +;; `alert-log-messages' +;; By default, all alerts are logged to *Alerts* (and to *Messages*, +;; if the `message' style is being used). Set to nil to disable. +;; +;; `alert-hide-all-notifications' +;; Want alerts off entirely? They still get logged, however, unless +;; you've turned that off too. +;; +;; `alert-user-configuration' +;; This variable lets you control exactly how and when a particular +;; alert, a class of alerts, or all alerts, get reported -- or if at +;; all. Use this to make some alerts use Growl, while others are +;; completely silent. +;; +;; * Programmatically adding rules +;; +;; Users can also programmatically add configuration rules, in addition to +;; customizing `alert-user-configuration'. Here is one that the author +;; currently uses with ERC, so that the fringe gets colored whenever people +;; chat on BitlBee: +;; +;; (alert-add-rule :status '(buried visible idle) +;; :severity '(moderate high urgent) +;; :mode 'erc-mode +;; :predicate +;; #'(lambda (info) +;; (string-match (concat "\\`[^&].*@BitlBee\\'") +;; (erc-format-target-and/or-network))) +;; :persistent +;; #'(lambda (info) +;; ;; If the buffer is buried, or the user has been +;; ;; idle for `alert-reveal-idle-time' seconds, +;; ;; make this alert persistent. Normally, alerts +;; ;; become persistent after +;; ;; `alert-persist-idle-time' seconds. +;; (memq (plist-get info :status) '(buried idle))) +;; :style 'fringe +;; :continue t) +;; +;; * Builtin alert styles +;; +;; There are several builtin styles, and it is trivial to create new ones. +;; The builtins are: +;; +;; fringe - Changes the current frame's fringe background color +;; mode-line - Changes the current frame's mode-line background color +;; gntp - Uses gntp, it requires gntp.el (see https://github.com/tekai/gntp.el) +;; growl - Uses Growl on OS X, if growlnotify is on the PATH +;; ignore - Ignores the alert entirely +;; libnotify - Uses libnotify if notify-send is on the PATH +;; log - Logs the alert text to *Alerts*, with a timestamp +;; message - Uses the Emacs `message' facility +;; momentary - Uses the Emacs `momentary-string-display' facility +;; notifications - Uses notifications library via D-Bus +;; notifier - Uses terminal-notifier on OS X, if it is on the PATH +;; osx-notifier - Native OSX notifier using AppleScript +;; toaster - Use the toast notification system +;; x11 - - Changes the urgency property of the window in the X Window System +;; +;; * Defining new styles +;; +;; To create a new style, you need to at least write a "notifier", which is +;; a function that receives the details of the alert. These details are +;; given in a plist which uses various keyword to identify the parts of the +;; alert. Here is a prototypical style definition: +;; +;; (alert-define-style 'style-name :title "My Style's title" +;; :notifier +;; (lambda (info) +;; ;; The message text is :message +;; (plist-get info :message) +;; ;; The :title of the alert +;; (plist-get info :title) +;; ;; The :category of the alert +;; (plist-get info :category) +;; ;; The major-mode this alert relates to +;; (plist-get info :mode) +;; ;; The buffer the alert relates to +;; (plist-get info :buffer) +;; ;; Severity of the alert. It is one of: +;; ;; `urgent' +;; ;; `high' +;; ;; `moderate' +;; ;; `normal' +;; ;; `low' +;; ;; `trivial' +;; (plist-get info :severity) +;; ;; Whether this alert should persist, or fade away +;; (plist-get info :persistent) +;; ;; Data which was passed to `alert'. Can be +;; ;; anything. +;; (plist-get info :data)) +;; +;; ;; Removers are optional. Their job is to remove +;; ;; the visual or auditory effect of the alert. +;; :remover +;; (lambda (info) +;; ;; It is the same property list that was passed to +;; ;; the notifier function. +;; )) +;; +;; You can test a specific style with something like this: +;; +;; (let ((alert-user-configuration '((((:severity high)) momentary nil)))) +;; (alert "Same buffer momentary alert" :title "My Alert" :severity 'high) +;; (alert "This is a momentary alert in another visible buffer" :title "My Alert" +;; :severity 'high :buffer (other-buffer (current-buffer) t))) + +;;; Code: + +(eval-when-compile + (require 'cl)) +(require 'gntp nil t) +(eval-when-compile + ;; if not available, silence the byte compiler + (defvar gntp-server)) +(declare-function gntp-notify "gntp") +(require 'notifications nil t) +(require 'log4e nil t) + +;; shut up the byte compiler +(declare-function alert-gntp-notify "alert") +(declare-function alert-notifications-notify "alert") + +(defgroup alert nil + "Notification system for Emacs similar to Growl" + :group 'emacs) + +(defcustom alert-severity-faces + '((urgent . alert-urgent-face) + (high . alert-high-face) + (moderate . alert-moderate-face) + (normal . alert-normal-face) + (low . alert-low-face) + (trivial . alert-trivial-face)) + "Faces associated by default with alert severities." + :type '(alist :key-type symbol :value-type color) + :group 'alert) + +(defcustom alert-severity-colors + '((urgent . "red") + (high . "orange") + (moderate . "yellow") + (normal . "green") + (low . "blue") + (trivial . "purple")) + "Colors associated by default with alert severities. +This is used by styles external to Emacs that don't understand faces." + :type '(alist :key-type symbol :value-type color) + :group 'alert) + +(defcustom alert-log-severity-functions + '((urgent . alert--log-fatal) + (high . alert--log-error) + (moderate . alert--log-warn) + (normal . alert--log-info) + (low . alert--log-debug) + (trivial . alert--log-trace)) + "Log4e logging functions" + :type '(alist :key-type symbol :value-type color) + :group 'alert) + +(defcustom alert-log-level + 'normal + "Minimum level of messages to log" + :type 'symbol + :group 'alert) + +(defcustom alert-reveal-idle-time 15 + "If idle this many seconds, rules will match the `idle' property." + :type 'integer + :group 'alert) + +(defcustom alert-persist-idle-time 900 + "If idle this many seconds, all alerts become persistent. +This can be overriden with the Never Persist option (:never-persist)." + :type 'integer + :group 'alert) + +(defcustom alert-fade-time 5 + "If not idle, alerts disappear after this many seconds. +The amount of idle time is governed by `alert-persist-idle-time'." + :type 'integer + :group 'alert) + +(defcustom alert-hide-all-notifications nil + "If non-nil, no alerts are ever shown to the user." + :type 'boolean + :group 'alert) + +(defcustom alert-log-messages t + "If non-nil, all alerts are logged to the *Alerts* buffer." + :type 'boolean + :group 'alert) + +(defcustom alert-default-icon + (concat data-directory + "images/icons/hicolor/scalable/apps/emacs.svg") + "Filename of default icon to show for libnotify-alerts." + :type 'string + :group 'alert) + +(defvar alert-styles nil) + +(defun alert-styles-radio-type (widget-name) + (append + (list widget-name :tag "Style") + (mapcar #'(lambda (style) + (list 'const + :tag (or (plist-get (cdr style) :title) + (symbol-name (car style))) + (car style))) + (setq alert-styles + (sort alert-styles + #'(lambda (l r) + (string< (symbol-name (car l)) + (symbol-name (car r))))))))) + +(defcustom alert-default-style 'message + "The style to use if no rules match in the current configuration. +If a configured rule does match an alert, this style is not used; +it is strictly a fallback." + :type (alert-styles-radio-type 'radio) + :group 'alert) + +(defun alert-configuration-type () + (list 'repeat + (list + 'list :tag "Select style if alert matches selector" + '(repeat + :tag "Selector" + (choice + (cons :tag "Severity" + (const :format "" :severity) + (set (const :tag "Urgent" urgent) + (const :tag "High" high) + (const :tag "Moderate" moderate) + (const :tag "Normal" normal) + (const :tag "Low" low) + (const :tag "Trivial" trivial))) + (cons :tag "User Status" + (const :format "" :status) + (set (const :tag "Buffer not visible" buried) + (const :tag "Buffer visible" visible) + (const :tag "Buffer selected" selected) + (const :tag "Buffer selected, user idle" idle))) + (cons :tag "Major Mode" + (const :format "" :mode) + regexp) + (cons :tag "Category" + (const :format "" :category) + regexp) + (cons :tag "Title" + (const :format "" :title) + regexp) + (cons :tag "Message" + (const :format "" :message) + regexp) + (cons :tag "Predicate" + (const :format "" :predicate) + function) + (cons :tag "Icon" + (const :format "" :icon) + regexp))) + (alert-styles-radio-type 'choice) + '(set :tag "Options" + (cons :tag "Make alert persistent" + (const :format "" :persistent) + (choice :value t (const :tag "Yes" t) + (function :tag "Predicate"))) + (cons :tag "Never persist" + (const :format "" :never-persist) + (choice :value t (const :tag "Yes" t) + (function :tag "Predicate"))) + (cons :tag "Continue to next rule" + (const :format "" :continue) + (choice :value t (const :tag "Yes" t) + (function :tag "Predicate"))) + ;;(list :tag "Change Severity" + ;; (radio :tag "From" + ;; (const :tag "Urgent" urgent) + ;; (const :tag "High" high) + ;; (const :tag "Moderate" moderate) + ;; (const :tag "Normal" normal) + ;; (const :tag "Low" low) + ;; (const :tag "Trivial" trivial)) + ;; (radio :tag "To" + ;; (const :tag "Urgent" urgent) + ;; (const :tag "High" high) + ;; (const :tag "Moderate" moderate) + ;; (const :tag "Normal" normal) + ;; (const :tag "Low" low) + ;; (const :tag "Trivial" trivial))) + )))) + +(defcustom alert-user-configuration nil + "Rules that determine how and when alerts get displayed." + :type (alert-configuration-type) + :group 'alert) + +(defvar alert-internal-configuration nil + "Rules added by `alert-add-rule'. +For user customization, see `alert-user-configuration'.") + +(defface alert-urgent-face + '((t (:foreground "Red" :bold t))) + "Urgent alert face." + :group 'alert) + +(defface alert-high-face + '((t (:foreground "Dark Orange" :bold t))) + "High alert face." + :group 'alert) + +(defface alert-moderate-face + '((t (:foreground "Gold" :bold t))) + "Moderate alert face." + :group 'alert) + +(defface alert-normal-face + '((t)) + "Normal alert face." + :group 'alert) + +(defface alert-low-face + '((t (:foreground "Dark Blue"))) + "Low alert face." + :group 'alert) + +(defface alert-trivial-face + '((t (:foreground "Dark Purple"))) + "Trivial alert face." + :group 'alert) + +(defun alert-define-style (name &rest plist) + "Define a new style for notifying the user of alert messages. +To create a new style, you need to at least write a \"notifier\", +which is a function that receives the details of the alert. +These details are given in a plist which uses various keyword to +identify the parts of the alert. Here is a prototypical style +definition: + +\(alert-define-style 'style-name :title \"My Style's title\" + :notifier + (lambda (info) + ;; The message text is :message + (plist-get info :message) + ;; The :title of the alert + (plist-get info :title) + ;; The :category of the alert + (plist-get info :category) + ;; The major-mode this alert relates to + (plist-get info :mode) + ;; The buffer the alert relates to + (plist-get info :buffer) + ;; Severity of the alert. It is one of: + ;; `urgent' + ;; `high' + ;; `moderate' + ;; `normal' + ;; `low' + ;; `trivial' + (plist-get info :severity) + ;; Whether this alert should persist, or fade away + (plist-get info :persistent) + ;; Data which was passed to `alert'. Can be + ;; anything. + (plist-get info :data)) + + ;; Removers are optional. Their job is to remove + ;; the visual or auditory effect of the alert. + :remover + (lambda (info) + ;; It is the same property list that was passed to + ;; the notifier function. + ))" + (add-to-list 'alert-styles (cons name plist)) + (put 'alert-user-configuration 'custom-type (alert-configuration-type)) + (put 'alert-define-style 'custom-type (alert-styles-radio-type 'radio))) + +(alert-define-style 'ignore :title "Ignore Alert" + :notifier #'ignore + :remover #'ignore) + +;;;###autoload +(defun* alert-add-rule (&key severity status mode category title + message predicate icon (style alert-default-style) + persistent continue never-persist append) + "Programmatically add an alert configuration rule. + +Normally, users should custoimze `alert-user-configuration'. +This facility is for module writers and users that need to do +things the Lisp way. + +Here is a rule the author currently uses with ERC, so that the +fringe gets colored whenever people chat on BitlBee: + +\(alert-add-rule :status \\='(buried visible idle) + :severity \\='(moderate high urgent) + :mode \\='erc-mode + :predicate + #\\='(lambda (info) + (string-match (concat \"\\\\`[^&].*@BitlBee\\\\\\='\") + (erc-format-target-and/or-network))) + :persistent + #\\='(lambda (info) + ;; If the buffer is buried, or the user has been + ;; idle for `alert-reveal-idle-time' seconds, + ;; make this alert persistent. Normally, alerts + ;; become persistent after + ;; `alert-persist-idle-time' seconds. + (memq (plist-get info :status) \\='(buried idle))) + :style \\='fringe + :continue t)" + (let ((rule (list (list t) style (list t)))) + (if severity + (nconc (nth 0 rule) + (list (cons :severity + (if (listp severity) + severity + (list severity)))))) + (if status + (nconc (nth 0 rule) + (list (cons :status + (if (listp status) + status + (list status)))))) + (if mode + (nconc (nth 0 rule) + (list (cons :mode + (if (stringp mode) + mode + (concat "\\`" (symbol-name mode) + "\\'")))))) + (if category + (nconc (nth 0 rule) (list (cons :category category)))) + (if title + (nconc (nth 0 rule) (list (cons :title title)))) + (if message + (nconc (nth 0 rule) (list (cons :message message)))) + (if predicate + (nconc (nth 0 rule) (list (cons :predicate predicate)))) + (if icon + (nconc (nth 0 rule) (list (cons :icon icon)))) + (setcar rule (cdr (nth 0 rule))) + + (if persistent + (nconc (nth 2 rule) (list (cons :persistent persistent)))) + (if never-persist + (nconc (nth 2 rule) (list (cons :never-persist never-persist)))) + (if continue + (nconc (nth 2 rule) (list (cons :continue continue)))) + (setcdr (cdr rule) (list (cdr (nth 2 rule)))) + + (if (null alert-internal-configuration) + (setq alert-internal-configuration (list rule)) + (if append + (nconc alert-internal-configuration (list rule)) + (setq alert-internal-configuration + (cons rule alert-internal-configuration)))) + + rule)) + +(alert-define-style 'ignore :title "Don't display alerts") + +(defun alert-log-notify (info) + (let* ((mes (plist-get info :message)) + (sev (plist-get info :severity)) + (len (length mes)) + (func (cdr (assoc sev alert-log-severity-functions)))) + (if (not (featurep 'log4e)) + (alert-legacy-log-notify mes sev len) + ;; when we get here you better be using log4e or have your logging + ;; functions defined + (if (fboundp func) + (apply func (list mes)) + (when (fboundp 'log4e:deflogger) + (log4e:deflogger "alert" "%t [%l] %m" "%H:%M:%S") + (when (functionp 'alert--log-set-level) + (alert--log-set-level alert-log-level))))))) + +(defun alert-legacy-log-notify (mes sev len) + (with-current-buffer + (get-buffer-create "*Alerts*") + (goto-char (point-max)) + (insert (format-time-string "%H:%M %p - ")) + (insert mes) + (set-text-properties (- (point) len) (point) + (list 'face (cdr (assq sev + alert-severity-faces)))) + (insert ?\n))) + +(defun alert-log-clear (info) + (if (functionp 'alert--log-clear-log) + (alert--log-clear-log) + (if (bufferp "*Alerts*") + (with-current-buffer + (get-buffer-create "*Alerts*") + (goto-char (point-max)) + (insert (format-time-string "%H:%M %p - ") + "Clear: " (plist-get info :message) + ?\n))))) + +(alert-define-style 'log :title "Log to *Alerts* buffer" + :notifier #'alert-log-notify + ;;:remover #'alert-log-clear + ) + +(defun alert-message-notify (info) + ;; the message text might contain `%' and we don't want them to be + ;; interpreted as format specifiers: + (message "%s" (plist-get info :message)) + ;;(if (memq (plist-get info :severity) '(high urgency)) + ;; (ding)) + ) + +(defun alert-message-remove (info) + (message "")) + +(alert-define-style 'message :title "Display message in minibuffer" + :notifier #'alert-message-notify + :remover #'alert-message-remove) + +(defun alert-momentary-notify (info) + (save-excursion + (with-current-buffer (or (plist-get info :buffer) (current-buffer)) + (momentary-string-display + (format "%s: %s (%s/%s/%s)" + (or (plist-get info :title) "untitled") + (or (plist-get info :message) "no message") + (or (plist-get info :severity) "no priority") + (or (plist-get info :category) "no category") + (or (plist-get info :mode) "no mode")) + (progn + (beginning-of-line) + (point)))))) + +(alert-define-style 'momentary :title "Display message momentarily in buffer" + :notifier #'alert-momentary-notify + ;; explicitly, we don't need a remover + :remover #'ignore) + +(copy-face 'fringe 'alert-saved-fringe-face) + +(defun alert-fringe-notify (info) + (set-face-background 'fringe (cdr (assq (plist-get info :severity) + alert-severity-colors)))) + +(defun alert-fringe-restore (info) + (copy-face 'alert-saved-fringe-face 'fringe)) + +(alert-define-style 'fringe :title "Change the fringe color" + :notifier #'alert-fringe-notify + :remover #'alert-fringe-restore) + + +(defun alert-mode-line-notify (info) + (copy-face 'mode-line 'alert-saved-mode-line-face) + (set-face-background 'mode-line (cdr (assq (plist-get info :severity) + alert-severity-colors))) + (set-face-foreground 'mode-line "white")) + +(defun alert-mode-line-restore (info) + (copy-face 'alert-saved-mode-line-face 'mode-line)) + +(alert-define-style 'mode-line :title "Change the mode-line color" + :notifier #'alert-mode-line-notify + :remover #'alert-mode-line-restore) + + + +(defcustom alert-growl-command (executable-find "growlnotify") + "Path to the growlnotify command. +This is found in the Growl Extras: http://growl.info/extras.php." + :type 'file + :group 'alert) + +(defcustom alert-growl-priorities + '((urgent . 2) + (high . 2) + (moderate . 1) + (normal . 0) + (low . -1) + (trivial . -2)) + "A mapping of alert severities onto Growl priority values." + :type '(alist :key-type symbol :value-type integer) + :group 'alert) + +(defsubst alert-encode-string (str) + (encode-coding-string str (keyboard-coding-system))) + +(defun alert-growl-notify (info) + (if alert-growl-command + (let ((args + (list "--appIcon" "Emacs" + "--name" "Emacs" + "--title" (alert-encode-string (plist-get info :title)) + "--message" (alert-encode-string (plist-get info :message)) + "--priority" (number-to-string + (cdr (assq (plist-get info :severity) + alert-growl-priorities)))))) + (if (and (plist-get info :persistent) + (not (plist-get info :never-persist))) + (nconc args (list "--sticky"))) + (apply #'call-process alert-growl-command nil nil nil args)) + (alert-message-notify info))) + +(alert-define-style 'growl :title "Notify using Growl" + :notifier #'alert-growl-notify) + + +(defcustom alert-libnotify-command (executable-find "notify-send") + "Path to the notify-send command. +This is found in the libnotify-bin package in Debian based +systems." + :type 'file + :group 'alert) + +(defcustom alert-libnotify-additional-args + nil + "Additional args to pass to notify-send. +Must be a list of strings." + :type '(repeat string) + :group 'alert) + +(defcustom alert-libnotify-priorities + '((urgent . critical) + (high . critical) + (moderate . normal) + (normal . normal) + (low . low) + (trivial . low)) + "A mapping of alert severities onto libnotify priority values." + :type '(alist :key-type symbol :value-type symbol) + :group 'alert) + +(defun alert-libnotify-notify (info) + "Send INFO using notify-send. +Handles :ICON, :CATEGORY, :SEVERITY, :PERSISTENT, :NEVER-PERSIST, :TITLE +and :MESSAGE keywords from the INFO plist. :CATEGORY can be +passed as a single symbol, a string or a list of symbols or +strings." + (if alert-libnotify-command + (let* ((args + (append + (list "--icon" (or (plist-get info :icon) + alert-default-icon) + "--app-name" "Emacs" + "--urgency" (let ((urgency (cdr (assq + (plist-get info :severity) + alert-libnotify-priorities)))) + (if urgency + (symbol-name urgency) + "normal"))) + alert-libnotify-additional-args)) + (category (plist-get info :category))) + (nconc args + (list "--expire-time" + (number-to-string + (* 1000 ; notify-send takes msecs + (if (and (plist-get info :persistent) + (not (plist-get info :never-persist))) + 0 ; 0 indicates persistence + alert-fade-time))))) + (when category + (nconc args + (list "--category" + (cond ((symbolp category) + (symbol-name category)) + ((stringp category) category) + ((listp category) + (mapconcat (if (symbolp (car category)) + #'symbol-name + #'identity) + category ",")))))) + (nconc args (list + (alert-encode-string (plist-get info :title)) + (alert-encode-string (plist-get info :message)))) + (apply #'call-process alert-libnotify-command nil + (list (get-buffer-create " *libnotify output*") t) nil args)) + (alert-message-notify info))) + +(alert-define-style 'libnotify :title "Notify using libnotify" + :notifier #'alert-libnotify-notify) + + +(defcustom alert-gntp-icon + "http://cvs.savannah.gnu.org/viewvc/*checkout*/emacs/emacs/etc/images/icons/hicolor/48x48/apps/emacs.png" + "Icon file using gntp." + :type 'string + :group 'alert) + +(when (featurep 'gntp) +(defun alert-gntp-notify (info) + (gntp-notify 'alert + (alert-encode-string (plist-get info :title)) + (alert-encode-string (plist-get info :message)) + gntp-server nil + (number-to-string + (cdr (assq (plist-get info :severity) + alert-growl-priorities))) + (if (eq (plist-get info :icon) nil) + alert-gntp-icon + (plist-get info :icon))) + (alert-message-notify info)) + +(alert-define-style 'gntp :title "Notify using gntp" + :notifier #'alert-gntp-notify)) + + +(defcustom alert-notifications-priorities + '((urgent . critical) + (high . critical) + (moderate . normal) + (normal . normal) + (low . low) + (trivial . low)) + "A mapping of alert severities onto Growl priority values." + :type '(alist :key-type symbol :value-type integer) + :group 'alert) + +(defvar alert-notifications-ids (make-hash-table :test #'equal) + "Internal store of notification ids returned by the `notifications' backend. +Used for replacing notifications with the same id. The key is +the value of the :id keyword to `alert'. An id is only stored +here if there `alert' was called ith an :id keyword and handled +by the `notifications' style.") + +(when (featurep 'notifications) +(defun alert-notifications-notify (info) + "Show the alert defined by INFO with `notifications-notify'." + (let ((id (notifications-notify :title (plist-get info :title) + :body (plist-get info :message) + :app-icon (plist-get info :icon) + :timeout (if (plist-get info :persistent) 0 -1) + :replaces-id (gethash (plist-get info :id) alert-notifications-ids) + :urgency (cdr (assq (plist-get info :severity) + alert-notifications-priorities))))) + (when (plist-get info :id) + (puthash (plist-get info :id) id alert-notifications-ids))) + (alert-message-notify info)) + +(defun alert-notifications-remove (info) + "Remove the `notifications-notify' message based on INFO :id." + (let ((id (and (plist-get info :id) + (gethash (plist-get info :id) alert-notifications-ids)))) + (when id + (notifications-close-notification id) + (remhash (plist-get info :id) alert-notifications-ids)))) + +(alert-define-style 'notifications :title "Notify using notifications" + :notifier #'alert-notifications-notify)) + + +(defcustom alert-notifier-command (executable-find "terminal-notifier") + "Path to the terminal-notifier command. +From https://github.com/julienXX/terminal-notifier." + :type 'file + :group 'alert) + +(defcustom alert-notifier-default-icon + (concat data-directory + "images/icons/hicolor/128x128/apps/emacs.png") + "Filename of default icon to show for terminal-notifier alerts." + :type 'string + :group 'alert) + +(defun alert-notifier-notify (info) + (if alert-notifier-command + (let ((args + (list "-title" (alert-encode-string (plist-get info :title)) + "-appIcon" (or (plist-get info :icon) alert-notifier-default-icon) + "-message" (alert-encode-string (plist-get info :message))))) + (apply #'call-process alert-notifier-command nil nil nil args)) + (alert-message-notify info))) + +(alert-define-style 'notifier :title "Notify using terminal-notifier" + :notifier #'alert-notifier-notify) + +(defun alert-osx-notifier-notify (info) + (apply #'call-process "osascript" nil nil nil "-e" (list (format "display notification %S with title %S" + (alert-encode-string (plist-get info :message)) + (alert-encode-string (plist-get info :title))))) + (alert-message-notify info)) + +(alert-define-style 'osx-notifier :title "Notify using native OSX notification" :notifier #'alert-osx-notifier-notify) + +(defun alert-frame-notify (info) + (let ((buf (plist-get info :buffer))) + (if (eq (alert-buffer-status buf) 'buried) + (let ((current-frame (selected-frame))) + (with-selected-frame + (make-frame '((width . 80) + (height . 20) + (top . -1) + (left . 0) + (left-fringe . 0) + (right-fringe . 0) + (tool-bar-lines . nil) + (menu-bar-lines . nil) + (vertical-scroll-bars . nil) + (unsplittable . t) + (has-modeline-p . nil) + (minibuffer . nil))) + (switch-to-buffer buf) + ;;(set (make-local-variable 'mode-line-format) nil) + (nconc info (list :frame (selected-frame)))) + (select-frame current-frame))))) + +(defun alert-frame-remove (info) + (unless (eq this-command 'handle-switch-frame) + (delete-frame (plist-get info :frame) t))) + +; This code was kindly borrowed from Arne Babenhauserheide: +; http://www.draketo.de/proj/babcore/#sec-3-14-2 +(defun x-urgency-hint (frame arg &optional source) + "Set the x-urgency hint for the frame to arg: + +- If arg is nil, unset the urgency. +- If arg is any other value, set the urgency. + +If you unset the urgency, you still have to visit the frame to make the urgency +setting disappear (at least in KDE)." + (let* ((wm-hints (append (x-window-property + "WM_HINTS" frame "WM_HINTS" + source nil t) nil)) + (flags (car wm-hints))) + (setcar wm-hints + (if arg + (logior flags #x00000100) + (logand flags #x1ffffeff))) + (x-change-window-property "WM_HINTS" wm-hints frame "WM_HINTS" 32 t))) + +(defun x-urgent (&optional arg) + "Mark the current emacs frame as requiring urgent attention. + +With a prefix argument which does not equal a boolean value of nil, +remove the urgency flag (which might or might not change display, depending on +the window manager)." + (interactive "P") + (let (frame (car (car (cdr (current-frame-configuration))))) + (x-urgency-hint frame (not arg)))) + +(defun alert-x11-notify (info) + (x-urgent)) + +(alert-define-style 'x11 :title "Set the X11 window property" + :notifier #'alert-x11-notify) + + +(defcustom alert-toaster-default-icon + (let ((exec-bin (executable-find "emacs.exe"))) + (cond (exec-bin + (concat (file-name-directory exec-bin) "../share/icons/hicolor/128x128/apps/emacs.png")) + (t nil))) + "Icon file using toaster." + :type 'string + :group 'alert + ) + +(defcustom alert-toaster-command (executable-find "toast") + "Path to the toast command. +This is found at https://github.com/nels-o/toaster." + :type 'file + :group 'alert + ) + +(defun alert-toaster-notify (info) + (if alert-toaster-command + (let ((args (list + "-t" (alert-encode-string (plist-get info :title)) + "-m" (alert-encode-string (plist-get info :message)) + "-p" (expand-file-name (or (plist-get info :icon) alert-toaster-default-icon)) + ))) + (apply #'call-process alert-toaster-command nil nil nil args)) + (alert-message-notify info))) + +(alert-define-style 'toaster :title "Notify using Toaster" + :notifier #'alert-toaster-notify) + +;; jww (2011-08-25): Not quite working yet +;;(alert-define-style 'frame :title "Popup buffer in a frame" +;; :notifier #'alert-frame-notify +;; :remover #'alert-frame-remove) + +(defun alert-buffer-status (&optional buffer) + (with-current-buffer (or buffer (current-buffer)) + (let ((wind (get-buffer-window))) + (if wind + (if (eq wind (selected-window)) + (if (and (current-idle-time) + (> (float-time (current-idle-time)) + alert-reveal-idle-time)) + 'idle + 'selected) + 'visible) + 'buried)))) + +(defvar alert-active-alerts nil) + +(defun alert-remove-when-active (remover info) + (let ((idle-time (and (current-idle-time) + (float-time (current-idle-time))))) + (cond + ((and idle-time (> idle-time alert-persist-idle-time))) + ((and idle-time (> idle-time alert-reveal-idle-time)) + (run-with-timer alert-fade-time nil + #'alert-remove-when-active remover info)) + (t + (funcall remover info))))) + +(defun alert-remove-on-command () + (let (to-delete) + (dolist (alert alert-active-alerts) + (when (eq (current-buffer) (nth 0 alert)) + (push alert to-delete) + (if (nth 2 alert) + (funcall (nth 2 alert) (nth 1 alert))))) + (dolist (alert to-delete) + (setq alert-active-alerts (delq alert alert-active-alerts))))) + +(defun alert-send-notification + (alert-buffer info style-def &optional persist never-per) + (let ((notifier (plist-get style-def :notifier))) + (if notifier + (funcall notifier info))) + (let ((remover (plist-get style-def :remover))) + (add-to-list 'alert-active-alerts (list alert-buffer info remover)) + (with-current-buffer alert-buffer + (add-hook 'post-command-hook #'alert-remove-on-command nil t)) + (if (and remover (or (not persist) never-per)) + (run-with-timer alert-fade-time nil + #'alert-remove-when-active + remover info)))) + +;;;###autoload +(defun* alert (message &key (severity 'normal) title icon category + buffer mode data style persistent never-persist + id) + "Alert the user that something has happened. +MESSAGE is what the user will see. You may also use keyword +arguments to specify additional details. Here is a full example: + +\(alert \"This is a message\" + :severity \\='high ;; The default severity is `normal' + :title \"Title\" ;; An optional title + :category \\='example ;; A symbol to identify the message + :mode \\='text-mode ;; Normally determined automatically + :buffer (current-buffer) ;; This is the default + :data nil ;; Unused by alert.el itself + :persistent nil ;; Force the alert to be persistent; + ;; it is best not to use this + :never-persist nil ;; Force this alert to never persist + :id \\='my-id) ;; Used to replace previous message of + ;; the same id in styles that support it + :style \\='fringe) ;; Force a given style to be used; + ;; this is only for debugging! + +If no :title is given, the buffer-name of :buffer is used. If +:buffer is nil, it is the current buffer at the point of call. + +:data is an opaque value which modules can pass through to their +own styles if they wish. + +Here are some more typical examples of usage: + + ;; This is the most basic form usage + (alert \"This is an alert\") + + ;; You can adjust the severity for more important messages + (alert \"This is an alert\" :severity \\='high) + + ;; Or decrease it for purely informative ones + (alert \"This is an alert\" :severity \\='trivial) + + ;; Alerts can have optional titles. Otherwise, the title is the + ;; buffer-name of the (current-buffer) where the alert originated. + (alert \"This is an alert\" :title \"My Alert\") + + ;; Further, alerts can have categories. This allows users to + ;; selectively filter on them. + (alert \"This is an alert\" :title \"My Alert\" + :category \\='some-category-or-other)" + (destructuring-bind + (alert-buffer current-major-mode current-buffer-status + current-buffer-name) + (with-current-buffer (or buffer (current-buffer)) + (list (current-buffer) + (or mode major-mode) + (alert-buffer-status) + (buffer-name))) + + (let ((base-info (list :message message + :title (or title current-buffer-name) + :icon icon + :severity severity + :category category + :buffer alert-buffer + :mode current-major-mode + :id id + :data data)) + matched) + + (if alert-log-messages + (alert-log-notify base-info)) + + (unless alert-hide-all-notifications + (catch 'finish + (dolist (config (append alert-user-configuration + alert-internal-configuration)) + (let* ((style-def (cdr (assq (or style (nth 1 config)) + alert-styles))) + (options (nth 2 config)) + (persist-p (or persistent + (cdr (assq :persistent options)))) + (persist (if (functionp persist-p) + (funcall persist-p base-info) + persist-p)) + (never-persist-p + (or never-persist + (cdr (assq :never-persist options)))) + (never-per (if (functionp never-persist-p) + (funcall never-persist-p base-info) + never-persist-p)) + (continue (cdr (assq :continue options))) + info) + (setq info (if (not (memq :persistent base-info)) + (append base-info (list :persistent persist)) + base-info) + info (if (not (memq :never-persist info)) + (append info (list :never-persist never-per)) + info)) + (when + (or style ; :style always "matches", for testing + (not + (memq + nil + (mapcar + #'(lambda (condition) + (case (car condition) + (:severity + (memq severity (cdr condition))) + (:status + (memq current-buffer-status (cdr condition))) + (:mode + (string-match + (cdr condition) + (symbol-name current-major-mode))) + (:category + (and category (string-match + (cdr condition) + (if (stringp category) + category + (symbol-name category))))) + (:title + (and title + (string-match (cdr condition) title))) + (:message + (string-match (cdr condition) message)) + (:predicate + (funcall (cdr condition) info)) + (:icon + (string-match (cdr condition) icon)))) + (nth 0 config))))) + + (alert-send-notification alert-buffer info style-def + persist never-per) + (setq matched t) + (if (or style (not (if (functionp continue) + (funcall continue info) + continue))) + (throw 'finish t))))))) + + (if (and (not matched) alert-default-style) + (alert-send-notification alert-buffer base-info + (cdr (assq alert-default-style + alert-styles))))))) + +(provide 'alert) + +;;; alert.el ends here diff --git a/elpa/alert-20180403.38/alert.elc b/elpa/alert-20180403.738/alert.elc similarity index 100% rename from elpa/alert-20180403.38/alert.elc rename to elpa/alert-20180403.738/alert.elc diff --git a/elpa/all-the-icons-20180125.757/all-the-icons-autoloads.el b/elpa/all-the-icons-20180125.1557/all-the-icons-autoloads.el similarity index 94% rename from elpa/all-the-icons-20180125.757/all-the-icons-autoloads.el rename to elpa/all-the-icons-20180125.1557/all-the-icons-autoloads.el index a5aa3e8..bf29b4d 100644 --- a/elpa/all-the-icons-20180125.757/all-the-icons-autoloads.el +++ b/elpa/all-the-icons-20180125.1557/all-the-icons-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "all-the-icons" "all-the-icons.el" (23163 15942 +;;;### (autoloads nil "all-the-icons" "all-the-icons.el" (23392 1946 ;;;;;; 0 0)) ;;; Generated autoloads from all-the-icons.el @@ -47,7 +47,7 @@ When FAMILY is non-nil, limit the candidates to the icon set matching it. ;;;*** ;;;### (autoloads nil nil ("all-the-icons-faces.el" "all-the-icons-pkg.el") -;;;;;; (23163 15943 0 0)) +;;;;;; (23392 1946 0 0)) ;;;*** diff --git a/elpa/all-the-icons-20180125.757/all-the-icons-faces.el b/elpa/all-the-icons-20180125.1557/all-the-icons-faces.el similarity index 100% rename from elpa/all-the-icons-20180125.757/all-the-icons-faces.el rename to elpa/all-the-icons-20180125.1557/all-the-icons-faces.el diff --git a/elpa/all-the-icons-20180125.757/all-the-icons-faces.elc b/elpa/all-the-icons-20180125.1557/all-the-icons-faces.elc similarity index 100% rename from elpa/all-the-icons-20180125.757/all-the-icons-faces.elc rename to elpa/all-the-icons-20180125.1557/all-the-icons-faces.elc diff --git a/elpa/all-the-icons-20180125.1557/all-the-icons-pkg.el b/elpa/all-the-icons-20180125.1557/all-the-icons-pkg.el new file mode 100644 index 0000000..7b1dd90 --- /dev/null +++ b/elpa/all-the-icons-20180125.1557/all-the-icons-pkg.el @@ -0,0 +1,13 @@ +(define-package "all-the-icons" "20180125.1557" "A library for inserting Developer icons" + '((emacs "24.3") + (memoize "1.0.1")) + :keywords + '("convenient" "lisp") + :authors + '(("Dominic Charlesworth" . "dgc336@gmail.com")) + :maintainer + '("Dominic Charlesworth" . "dgc336@gmail.com") + :url "https://github.com/domtronn/all-the-icons.el") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/all-the-icons-20180125.757/all-the-icons.el b/elpa/all-the-icons-20180125.1557/all-the-icons.el similarity index 100% rename from elpa/all-the-icons-20180125.757/all-the-icons.el rename to elpa/all-the-icons-20180125.1557/all-the-icons.el diff --git a/elpa/all-the-icons-20180125.757/all-the-icons.elc b/elpa/all-the-icons-20180125.1557/all-the-icons.elc similarity index 100% rename from elpa/all-the-icons-20180125.757/all-the-icons.elc rename to elpa/all-the-icons-20180125.1557/all-the-icons.elc diff --git a/elpa/all-the-icons-20180125.757/data/data-alltheicons.el b/elpa/all-the-icons-20180125.1557/data/data-alltheicons.el similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-alltheicons.el rename to elpa/all-the-icons-20180125.1557/data/data-alltheicons.el diff --git a/elpa/all-the-icons-20180125.757/data/data-alltheicons.elc b/elpa/all-the-icons-20180125.1557/data/data-alltheicons.elc similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-alltheicons.elc rename to elpa/all-the-icons-20180125.1557/data/data-alltheicons.elc diff --git a/elpa/all-the-icons-20180125.757/data/data-faicons.el b/elpa/all-the-icons-20180125.1557/data/data-faicons.el similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-faicons.el rename to elpa/all-the-icons-20180125.1557/data/data-faicons.el diff --git a/elpa/all-the-icons-20180125.757/data/data-faicons.elc b/elpa/all-the-icons-20180125.1557/data/data-faicons.elc similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-faicons.elc rename to elpa/all-the-icons-20180125.1557/data/data-faicons.elc diff --git a/elpa/all-the-icons-20180125.757/data/data-fileicons.el b/elpa/all-the-icons-20180125.1557/data/data-fileicons.el similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-fileicons.el rename to elpa/all-the-icons-20180125.1557/data/data-fileicons.el diff --git a/elpa/all-the-icons-20180125.757/data/data-fileicons.elc b/elpa/all-the-icons-20180125.1557/data/data-fileicons.elc similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-fileicons.elc rename to elpa/all-the-icons-20180125.1557/data/data-fileicons.elc diff --git a/elpa/all-the-icons-20180125.757/data/data-material.el b/elpa/all-the-icons-20180125.1557/data/data-material.el similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-material.el rename to elpa/all-the-icons-20180125.1557/data/data-material.el diff --git a/elpa/all-the-icons-20180125.757/data/data-material.elc b/elpa/all-the-icons-20180125.1557/data/data-material.elc similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-material.elc rename to elpa/all-the-icons-20180125.1557/data/data-material.elc diff --git a/elpa/all-the-icons-20180125.757/data/data-octicons.el b/elpa/all-the-icons-20180125.1557/data/data-octicons.el similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-octicons.el rename to elpa/all-the-icons-20180125.1557/data/data-octicons.el diff --git a/elpa/all-the-icons-20180125.757/data/data-octicons.elc b/elpa/all-the-icons-20180125.1557/data/data-octicons.elc similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-octicons.elc rename to elpa/all-the-icons-20180125.1557/data/data-octicons.elc diff --git a/elpa/all-the-icons-20180125.757/data/data-weathericons.el b/elpa/all-the-icons-20180125.1557/data/data-weathericons.el similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-weathericons.el rename to elpa/all-the-icons-20180125.1557/data/data-weathericons.el diff --git a/elpa/all-the-icons-20180125.757/data/data-weathericons.elc b/elpa/all-the-icons-20180125.1557/data/data-weathericons.elc similarity index 100% rename from elpa/all-the-icons-20180125.757/data/data-weathericons.elc rename to elpa/all-the-icons-20180125.1557/data/data-weathericons.elc diff --git a/elpa/all-the-icons-20180125.757/all-the-icons-pkg.el b/elpa/all-the-icons-20180125.757/all-the-icons-pkg.el deleted file mode 100644 index 4d3348d..0000000 --- a/elpa/all-the-icons-20180125.757/all-the-icons-pkg.el +++ /dev/null @@ -1,8 +0,0 @@ -(define-package "all-the-icons" "20180125.757" "A library for inserting Developer icons" - '((emacs "24.3") - (memoize "1.0.1")) - :url "https://github.com/domtronn/all-the-icons.el" :keywords - '("convenient" "lisp")) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired-pkg.el b/elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired-pkg.el deleted file mode 100644 index b314a41..0000000 --- a/elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "all-the-icons-dired" "20170418.1431" "Shows icons for each file in dired mode" '((emacs "24.4") (all-the-icons "2.2.0")) :commit "980b7747d6c4a7992a1ec56afad908956db0a519" :keywords '("files" "icons" "dired")) diff --git a/elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired-autoloads.el b/elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired-autoloads.el similarity index 95% rename from elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired-autoloads.el rename to elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired-autoloads.el index 88e36d5..6e43027 100644 --- a/elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired-autoloads.el +++ b/elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired-autoloads.el @@ -4,7 +4,7 @@ (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) ;;;### (autoloads nil "all-the-icons-dired" "all-the-icons-dired.el" -;;;;;; (22967 40644 0 0)) +;;;;;; (23392 1944 0 0)) ;;; Generated autoloads from all-the-icons-dired.el (autoload 'all-the-icons-dired-mode "all-the-icons-dired" "\ diff --git a/elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired-pkg.el b/elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired-pkg.el new file mode 100644 index 0000000..a227d06 --- /dev/null +++ b/elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "all-the-icons-dired" "20170418.2131" "Shows icons for each file in dired mode" '((emacs "24.4") (all-the-icons "2.2.0")) :commit "980b7747d6c4a7992a1ec56afad908956db0a519" :keywords '("files" "icons" "dired") :authors '(("jtbm37")) :maintainer '("jtbm37")) diff --git a/elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired.el b/elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired.el similarity index 99% rename from elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired.el rename to elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired.el index dc4b75a..2f70815 100644 --- a/elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired.el +++ b/elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired.el @@ -4,7 +4,7 @@ ;; Author: jtbm37 ;; Version: 1.0 -;; Package-Version: 20170418.1431 +;; Package-Version: 20170418.2131 ;; Keywords: files icons dired ;; Package-Requires: ((emacs "24.4") (all-the-icons "2.2.0")) diff --git a/elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired.elc b/elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired.elc similarity index 99% rename from elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired.elc rename to elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired.elc index ed75cb4..78d220c 100644 Binary files a/elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired.elc and b/elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired.elc differ diff --git a/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy-autoloads.el b/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy-autoloads.el deleted file mode 100644 index 6e20602..0000000 --- a/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy-autoloads.el +++ /dev/null @@ -1,22 +0,0 @@ -;;; all-the-icons-ivy-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "all-the-icons-ivy" "all-the-icons-ivy.el" -;;;;;; (22967 40656 0 0)) -;;; Generated autoloads from all-the-icons-ivy.el - -(autoload 'all-the-icons-ivy-setup "all-the-icons-ivy" "\ -Set ivy's display transformers to show relevant icons next to the candidates. - -\(fn)" nil nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; all-the-icons-ivy-autoloads.el ends here diff --git a/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy-pkg.el b/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy-pkg.el deleted file mode 100644 index 1e7bfbf..0000000 --- a/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "all-the-icons-ivy" "20170508.25" "Shows icons while using ivy and counsel" '((emacs "24.4") (all-the-icons "2.4.0") (ivy "0.8.0")) :commit "aa791d6b0055bce3ac68970a8ef6abf0726edf0f" :keywords '("faces")) diff --git a/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy.el b/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy.el deleted file mode 100644 index 5a2bac7..0000000 --- a/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy.el +++ /dev/null @@ -1,92 +0,0 @@ -;;; all-the-icons-ivy.el --- Shows icons while using ivy and counsel -*- lexical-binding: t; -*- - -;; Copyright (C) 2017 asok - -;; Author: asok -;; Version: 0.1.2 -;; Package-Version: 20170508.25 -;; Keywords: faces -;; Package-Requires: ((emacs "24.4") (all-the-icons "2.4.0") (ivy "0.8.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 . - -;;; Commentary: -;; To use this package, do -;; -;; (all-the-icons-ivy-setup) -;; -;; Or if you prefer to only set transformers -;; for a subset of ivy commands: -;; -;; (require 'all-the-icons-ivy) -;; (ivy-set-display-transformer 'ivy-switch-buffer 'all-the-icons-ivy-buffer-transformer) - -;;; Code: - -(require 'all-the-icons) -(require 'ivy) - -(defun all-the-icons-ivy--buffer-propertize (b s) - "If buffer B is modified apply `ivy-modified-buffer' face on string S." - (if (and (buffer-file-name b) - (buffer-modified-p b)) - (propertize s 'face 'ivy-modified-buffer) - s)) - -(defun all-the-icons-ivy--icon-for-mode (mode) - "Apply `all-the-icons-for-mode' on MODE but either return an icon or nil." - (let ((icon (all-the-icons-icon-for-mode mode))) - (unless (symbolp icon) - icon))) - -(defun all-the-icons-ivy--buffer-transformer (b s) - "Return a candidate string for buffer B named S preceded by an icon. -Try to find the icon for the buffer's B `major-mode'. -If that fails look for an icon for the mode that the `major-mode' is derived from." - (let ((mode (buffer-local-value 'major-mode b))) - (format "%s\t%s" - (propertize "\t" 'display (or - (all-the-icons-ivy--icon-for-mode mode) - (all-the-icons-ivy--icon-for-mode (get mode 'derived-mode-parent)))) - (all-the-icons-ivy--buffer-propertize b s)))) - -(defun all-the-icons-ivy-file-transformer (s) - "Return a candidate string for filename S preceded by an icon." - (format "%s\t%s" - (propertize "\t" 'display (all-the-icons-icon-for-file s)) - s)) - -(defun all-the-icons-ivy-buffer-transformer (s) - "Return a candidate string for buffer named S. -Assume that sometimes the buffer named S might not exists. -That can happen if `ivy-switch-buffer' does not find the buffer and it -falls back to `ivy-recentf' and the same transformer is used." - (let ((b (get-buffer s))) - (if b - (all-the-icons-ivy--buffer-transformer b s) - (all-the-icons-ivy-file-transformer s)))) - -;;;###autoload -(defun all-the-icons-ivy-setup () - "Set ivy's display transformers to show relevant icons next to the candidates." - (ivy-set-display-transformer 'ivy-switch-buffer 'all-the-icons-ivy-buffer-transformer) - (ivy-set-display-transformer 'ivy-switch-buffer-other-window 'all-the-icons-ivy-buffer-transformer) - (ivy-set-display-transformer 'counsel-find-file 'all-the-icons-ivy-file-transformer) - (ivy-set-display-transformer 'counsel-projectile-find-file 'all-the-icons-ivy-file-transformer) - (ivy-set-display-transformer 'counsel-projectile-switch-to-buffer 'all-the-icons-ivy-file-transformer) - (ivy-set-display-transformer 'counsel-projectile-find-dir 'all-the-icons-ivy-file-transformer)) - -(provide 'all-the-icons-ivy) - -;;; all-the-icons-ivy.el ends here diff --git a/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy.elc b/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy.elc deleted file mode 100644 index 20f15c8..0000000 Binary files a/elpa/all-the-icons-ivy-20170508.25/all-the-icons-ivy.elc and /dev/null differ diff --git a/elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy-autoloads.el b/elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy-autoloads.el new file mode 100644 index 0000000..502a89b --- /dev/null +++ b/elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy-autoloads.el @@ -0,0 +1,22 @@ +;;; all-the-icons-ivy-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "all-the-icons-ivy" "all-the-icons-ivy.el" +;;;;;; (23392 1942 0 0)) +;;; Generated autoloads from all-the-icons-ivy.el + +(autoload 'all-the-icons-ivy-setup "all-the-icons-ivy" "\ +Set ivy's display transformers to show relevant icons next to the candidates. + +\(fn)" nil nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; all-the-icons-ivy-autoloads.el ends here diff --git a/elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy-pkg.el b/elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy-pkg.el new file mode 100644 index 0000000..358ff7c --- /dev/null +++ b/elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "all-the-icons-ivy" "20180225.1430" "Shows icons while using ivy and counsel" '((emacs "24.4") (all-the-icons "2.4.0") (ivy "0.8.0")) :commit "52b3f4a8a4a038998943afaffb5ff25054f65af4" :keywords '("faces") :authors '(("asok")) :maintainer '("asok")) diff --git a/elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy.el b/elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy.el new file mode 100644 index 0000000..0e89f0d --- /dev/null +++ b/elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy.el @@ -0,0 +1,107 @@ +;;; all-the-icons-ivy.el --- Shows icons while using ivy and counsel -*- lexical-binding: t; -*- + +;; Copyright (C) 2017 asok + +;; Author: asok +;; Version: 0.2.0 +;; Package-Version: 20180225.1430 +;; Keywords: faces +;; Package-Requires: ((emacs "24.4") (all-the-icons "2.4.0") (ivy "0.8.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 . + +;;; Commentary: +;; To use this package, do +;; +;; (all-the-icons-ivy-setup) +;; +;; Or if you prefer to only set transformers +;; for a subset of ivy commands: +;; +;; (require 'all-the-icons-ivy) +;; (ivy-set-display-transformer 'ivy-switch-buffer 'all-the-icons-ivy-buffer-transformer) + +;;; Code: + +(require 'all-the-icons) +(require 'ivy) + +(defgroup all-the-icons-ivy nil + "Shows icons while using ivy and counsel." + :group 'ivy) + +(defcustom all-the-icons-ivy-buffer-commands + '(ivy-switch-buffer ivy-switch-buffer-other-window counsel-projectile-switch-to-buffer) + "Commands to use with `all-the-icons-ivy-buffer-transformer'." + :type '(repeat function) + :group 'all-the-icons-ivy) + + +(defcustom all-the-icons-ivy-file-commands + '(counsel-find-file counsel-projectile-find-file counsel-projectile-find-dir) + "Commands to use with `all-the-icons-ivy-file-transformer'." + :type '(repeat function) + :group 'all-the-icons-ivy) + +(defun all-the-icons-ivy--buffer-propertize (b s) + "If buffer B is modified apply `ivy-modified-buffer' face on string S." + (if (and (buffer-file-name b) + (buffer-modified-p b)) + (propertize s 'face 'ivy-modified-buffer) + s)) + +(defun all-the-icons-ivy--icon-for-mode (mode) + "Apply `all-the-icons-for-mode' on MODE but either return an icon or nil." + (let ((icon (all-the-icons-icon-for-mode mode))) + (unless (symbolp icon) + icon))) + +(defun all-the-icons-ivy--buffer-transformer (b s) + "Return a candidate string for buffer B named S preceded by an icon. +Try to find the icon for the buffer's B `major-mode'. +If that fails look for an icon for the mode that the `major-mode' is derived from." + (let ((mode (buffer-local-value 'major-mode b))) + (format "%s\t%s" + (propertize "\t" 'display (or + (all-the-icons-ivy--icon-for-mode mode) + (all-the-icons-ivy--icon-for-mode (get mode 'derived-mode-parent)))) + (all-the-icons-ivy--buffer-propertize b s)))) + +(defun all-the-icons-ivy-file-transformer (s) + "Return a candidate string for filename S preceded by an icon." + (format "%s\t%s" + (propertize "\t" 'display (all-the-icons-icon-for-file s)) + s)) + +(defun all-the-icons-ivy-buffer-transformer (s) + "Return a candidate string for buffer named S. +Assume that sometimes the buffer named S might not exists. +That can happen if `ivy-switch-buffer' does not find the buffer and it +falls back to `ivy-recentf' and the same transformer is used." + (let ((b (get-buffer s))) + (if b + (all-the-icons-ivy--buffer-transformer b s) + (all-the-icons-ivy-file-transformer s)))) + +;;;###autoload +(defun all-the-icons-ivy-setup () + "Set ivy's display transformers to show relevant icons next to the candidates." + (dolist (cmd all-the-icons-ivy-buffer-commands) + (ivy-set-display-transformer cmd 'all-the-icons-ivy-buffer-transformer)) + (dolist (cmd all-the-icons-ivy-file-commands) + (ivy-set-display-transformer cmd 'all-the-icons-ivy-file-transformer))) + +(provide 'all-the-icons-ivy) + +;;; all-the-icons-ivy.el ends here diff --git a/elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy.elc b/elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy.elc similarity index 100% rename from elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy.elc rename to elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy.elc diff --git a/elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy-autoloads.el b/elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy-autoloads.el deleted file mode 100644 index 86a75c7..0000000 --- a/elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy-autoloads.el +++ /dev/null @@ -1,22 +0,0 @@ -;;; all-the-icons-ivy-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "all-the-icons-ivy" "all-the-icons-ivy.el" -;;;;;; (23243 33694 0 0)) -;;; Generated autoloads from all-the-icons-ivy.el - -(autoload 'all-the-icons-ivy-setup "all-the-icons-ivy" "\ -Set ivy's display transformers to show relevant icons next to the candidates. - -\(fn)" nil nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; all-the-icons-ivy-autoloads.el ends here diff --git a/elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy-pkg.el b/elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy-pkg.el deleted file mode 100644 index 53c38a4..0000000 --- a/elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "all-the-icons-ivy" "20180225.630" "Shows icons while using ivy and counsel" '((emacs "24.4") (all-the-icons "2.4.0") (ivy "0.8.0")) :commit "52b3f4a8a4a038998943afaffb5ff25054f65af4" :keywords '("faces")) diff --git a/elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy.el b/elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy.el deleted file mode 100644 index 7bba6bd..0000000 --- a/elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy.el +++ /dev/null @@ -1,107 +0,0 @@ -;;; all-the-icons-ivy.el --- Shows icons while using ivy and counsel -*- lexical-binding: t; -*- - -;; Copyright (C) 2017 asok - -;; Author: asok -;; Version: 0.2.0 -;; Package-Version: 20180225.630 -;; Keywords: faces -;; Package-Requires: ((emacs "24.4") (all-the-icons "2.4.0") (ivy "0.8.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 . - -;;; Commentary: -;; To use this package, do -;; -;; (all-the-icons-ivy-setup) -;; -;; Or if you prefer to only set transformers -;; for a subset of ivy commands: -;; -;; (require 'all-the-icons-ivy) -;; (ivy-set-display-transformer 'ivy-switch-buffer 'all-the-icons-ivy-buffer-transformer) - -;;; Code: - -(require 'all-the-icons) -(require 'ivy) - -(defgroup all-the-icons-ivy nil - "Shows icons while using ivy and counsel." - :group 'ivy) - -(defcustom all-the-icons-ivy-buffer-commands - '(ivy-switch-buffer ivy-switch-buffer-other-window counsel-projectile-switch-to-buffer) - "Commands to use with `all-the-icons-ivy-buffer-transformer'." - :type '(repeat function) - :group 'all-the-icons-ivy) - - -(defcustom all-the-icons-ivy-file-commands - '(counsel-find-file counsel-projectile-find-file counsel-projectile-find-dir) - "Commands to use with `all-the-icons-ivy-file-transformer'." - :type '(repeat function) - :group 'all-the-icons-ivy) - -(defun all-the-icons-ivy--buffer-propertize (b s) - "If buffer B is modified apply `ivy-modified-buffer' face on string S." - (if (and (buffer-file-name b) - (buffer-modified-p b)) - (propertize s 'face 'ivy-modified-buffer) - s)) - -(defun all-the-icons-ivy--icon-for-mode (mode) - "Apply `all-the-icons-for-mode' on MODE but either return an icon or nil." - (let ((icon (all-the-icons-icon-for-mode mode))) - (unless (symbolp icon) - icon))) - -(defun all-the-icons-ivy--buffer-transformer (b s) - "Return a candidate string for buffer B named S preceded by an icon. -Try to find the icon for the buffer's B `major-mode'. -If that fails look for an icon for the mode that the `major-mode' is derived from." - (let ((mode (buffer-local-value 'major-mode b))) - (format "%s\t%s" - (propertize "\t" 'display (or - (all-the-icons-ivy--icon-for-mode mode) - (all-the-icons-ivy--icon-for-mode (get mode 'derived-mode-parent)))) - (all-the-icons-ivy--buffer-propertize b s)))) - -(defun all-the-icons-ivy-file-transformer (s) - "Return a candidate string for filename S preceded by an icon." - (format "%s\t%s" - (propertize "\t" 'display (all-the-icons-icon-for-file s)) - s)) - -(defun all-the-icons-ivy-buffer-transformer (s) - "Return a candidate string for buffer named S. -Assume that sometimes the buffer named S might not exists. -That can happen if `ivy-switch-buffer' does not find the buffer and it -falls back to `ivy-recentf' and the same transformer is used." - (let ((b (get-buffer s))) - (if b - (all-the-icons-ivy--buffer-transformer b s) - (all-the-icons-ivy-file-transformer s)))) - -;;;###autoload -(defun all-the-icons-ivy-setup () - "Set ivy's display transformers to show relevant icons next to the candidates." - (dolist (cmd all-the-icons-ivy-buffer-commands) - (ivy-set-display-transformer cmd 'all-the-icons-ivy-buffer-transformer)) - (dolist (cmd all-the-icons-ivy-file-commands) - (ivy-set-display-transformer cmd 'all-the-icons-ivy-file-transformer))) - -(provide 'all-the-icons-ivy) - -;;; all-the-icons-ivy.el ends here diff --git a/elpa/angular-snippets-20140513.2223/angular-snippets-autoloads.el b/elpa/angular-snippets-20140513.2223/angular-snippets-autoloads.el deleted file mode 100644 index 786623e..0000000 --- a/elpa/angular-snippets-20140513.2223/angular-snippets-autoloads.el +++ /dev/null @@ -1,34 +0,0 @@ -;;; angular-snippets-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "angular-snippets" "angular-snippets.el" (22993 -;;;;;; 41868 0 0)) -;;; Generated autoloads from angular-snippets.el - -(autoload 'ng-snip-show-docs-at-point "angular-snippets" "\ - - -\(fn)" t nil) - -(autoload 'angular-snippets-initialize "angular-snippets" "\ - - -\(fn)" nil nil) - -(eval-after-load "yasnippet" '(angular-snippets-initialize)) - -;;;*** - -;;;### (autoloads nil nil ("angular-snippets-pkg.el") (22993 41868 -;;;;;; 0 0)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; angular-snippets-autoloads.el ends here diff --git a/elpa/angular-snippets-20140513.2223/angular-snippets-pkg.el b/elpa/angular-snippets-20140513.2223/angular-snippets-pkg.el deleted file mode 100644 index bbc0fae..0000000 --- a/elpa/angular-snippets-20140513.2223/angular-snippets-pkg.el +++ /dev/null @@ -1,6 +0,0 @@ -(define-package "angular-snippets" "20140513.2223" "Yasnippets for AngularJS" - '((s "1.4.0") - (dash "1.2.0"))) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/angular-snippets-20140513.2223/angular-snippets.el b/elpa/angular-snippets-20140513.2223/angular-snippets.el deleted file mode 100644 index efc37f2..0000000 --- a/elpa/angular-snippets-20140513.2223/angular-snippets.el +++ /dev/null @@ -1,153 +0,0 @@ -;;; angular-snippets.el --- Yasnippets for AngularJS - -;; Copyright (C) 2013 Magnar Sveen - -;; Author: Magnar Sveen -;; Keywords: snippets -;; Version: 0.2.3 -;; Package-Requires: ((s "1.4.0") (dash "1.2.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 . - -;;; Commentary: - -;; Yasnippets for [AngularJS](http://angularjs.org/). - -;;; Code: - -(require 'yasnippet) -(require 'dash) -(require 's) - -;;;###autoload -(defun ng-snip-show-docs-at-point () - (interactive) - (ng-snip/show-or-browse-docs (ng-snip/closest-ng-identifer))) - -(defvar ng-directive-docstrings - '(("ng-app" . "Auto-bootstraps an application, with optional module to load.") - ("ng-bind" . "Replace text content of element with value of given expression.") - ("ng-bind-html-unsafe" . "Set innerHTML of element to unsanitized value of given expression.") - ("ng-bind-template" . "Replace text content of element with given template.") - ("ng-change" . "Eval the given expression when user changes the input. Requires ng-model.") - ("ng-checked" . "Uses given expression to determine checked-state of checkbox.") - ("ng-class" . "Sets class names on element based on given expression.") - ("ng-class-even" . "Like ng-class, but only on even rows. Requires ng-repeat.") - ("ng-class-odd" . "Like ng-class, but only on odd rows. Requires ng-repeat.") - ("ng-click" . "Eval the given expression when element is clicked.") - ("ng-cloak" . "Hides the element contents until compiled by angular.") - ("ng-controller" . "Assign controller to this element, along with a new scope.") - ("ng-csp" . "Enables Content Security Policy support. Should be on same element as ng-app.") - ("ng-dblclick" . "Eval the given expression when element is double clicked.") - ("ng-disabled" . "Uses given expression to determine disabled-state of element.") - ("ng-form" . "Nestable alias of the form directive.") - ("ng-hide" . "Hides the element if the expression is truthy.") - ("ng-href" . "Avoids bad URLs on links that are clicked before angular compiles them.") - ("ng-include" . "Fetches, compiles and includes an external HTML fragment.") - ("ng-init" . "Evals expression before executing template during bootstrap.") - ("ng-list" . "Text input that converts between comma-separated string and an array of strings.") - ("ng-model" . "Sets up two-way data binding. Works with input, select and textarea.") - ("ng-mousedown" . "Eval the given expression on mousedown.") - ("ng-mouseenter" . "Eval the given expression on mouseenter.") - ("ng-mouseleave" . "Eval the given expression on mouseleave.") - ("ng-mousemove" . "Eval the given expression on mousemove.") - ("ng-mouseover" . "Eval the given expression on mouseover.") - ("ng-mouseup" . "Eval the given expression on mouseup.") - ("ng-multiple" . "Uses given expression to determine multiple-state of select element.") - ("ng-non-bindable" . "Makes angular ignore {{bindings}} inside element.") - ("ng-options" . "Populates select options from a list or object.") - ("ng-pluralize" . "Helps change wording based on a number.") - ("ng-readonly" . "Uses given expression to determine readonly-state of element.") - ("ng-repeat" . "Repeats template for every item in a list.") - ("ng-selected" . "Uses given expression to determine selected-state of option element.") - ("ng-show" . "Hides the element if the expression is falsy.") - ("ng-src" . "Stops browser from fetching images with {{templates}} in the URL.") - ("ng-style" . "Sets style attributes from an object of DOM style properties. ") - ("ng-submit" . "Eval the given expression when form is submitted, and prevent default.") - ("ng-switch" . "Switch on given expression to conditionally change DOM structure.") - ("ng-switch-when" . "Include this element if value matches ng-switch on expression.") - ("ng-transclude" . "Signifies where to insert transcluded DOM.") - ("ng-view" . "Signifies where route views are shown."))) - -(defvar ng-snip/docs-indirection - '(("ng-options" . "select") - ("ng-switch-when" . "ng-switch"))) - -(defvar ng-snip/directive-root-url - "http://docs.angularjs.org/api/ng.directive:") - -(defun -aget (alist key) - (cdr (assoc key alist))) - -(defun ng-snip/directive-to-docs (directive) - (let ((name (car directive)) - (docstring (cdr directive))) - (list name - :docstring docstring - :docurl (s-with (or (-aget ng-snip/docs-indirection name) name) - (s-lower-camel-case) - (concat ng-snip/directive-root-url))))) - -(setq ng-docs (-map 'ng-snip/directive-to-docs ng-directive-docstrings)) - -(defun ng-snip/docs-value (id prop) - (plist-get (-aget ng-docs id) prop)) - -(defvar ng-snip/last-docs-message nil) - -(defun ng-snip/forget-last-docs-message () - (setq ng-snip/last-docs-message nil)) - -(defun ng-snip/docs (id) - (message (ng-snip/docs-value id :docstring)) - (setq ng-snip/last-docs-message id) - (run-with-timer 10.0 nil 'ng-snip/forget-last-docs-message) - nil) - -(defun ng-snip/show-or-browse-docs (id) - (if (s-equals? ng-snip/last-docs-message id) - (ng-snip/browse-docs id) - (ng-snip/docs id))) - -(defun ng-snip/browse-docs (id) - (browse-url (ng-snip/docs-value id :docurl))) - -(defun ng-snip/maybe-space-after-attr () - (unless (looking-at "[ />]\\|$") - (insert " "))) - -(defun ng-snip/closest-ng-identifer () - (save-excursion - (forward-char 3) - (search-backward "ng-") - (unless (looking-at "ng-[a-z\-]+") - (error "No angular identifier at point")) - (match-string 0))) - -(setq angular-snippets-root (file-name-directory (or load-file-name - (buffer-file-name)))) - -;;;###autoload -(defun angular-snippets-initialize () - (let ((snip-dir (expand-file-name "snippets" angular-snippets-root))) - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs snip-dir t)) - (yas-load-directory snip-dir))) - -;;;###autoload -(eval-after-load "yasnippet" - '(angular-snippets-initialize)) - -(provide 'angular-snippets) -;;; angular-snippets.el ends here diff --git a/elpa/angular-snippets-20140513.2223/angular-snippets.elc b/elpa/angular-snippets-20140513.2223/angular-snippets.elc deleted file mode 100644 index 4a908c9..0000000 Binary files a/elpa/angular-snippets-20140513.2223/angular-snippets.elc and /dev/null differ diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-app.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-app.yasnippet deleted file mode 100644 index 9d21598..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-app.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-app -# key: ng -# -- -ng-app${1:="${2:module}"}$0` -(ng-snip/docs "ng-app") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind-html-unsafe.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind-html-unsafe.yasnippet deleted file mode 100644 index e8434b7..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind-html-unsafe.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-bind-html-unsafe -# key: ng -# -- -ng-bind-html-unsafe="$0"` -(ng-snip/docs "ng-bind-html-unsafe") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind-template.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind-template.yasnippet deleted file mode 100644 index 355512f..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind-template.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-bind-template -# key: ng -# -- -ng-bind-template="$0"` -(ng-snip/docs "ng-bind-template") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind.yasnippet deleted file mode 100644 index 5dd30c3..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-bind -# key: ng -# -- -ng-bind="$0"` -(ng-snip/docs "ng-bind") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-change.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-change.yasnippet deleted file mode 100644 index b90bfe0..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-change.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-change -# key: ng -# -- -ng-change="$0"` -(ng-snip/docs "ng-change") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-checked.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-checked.yasnippet deleted file mode 100644 index 9799265..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-checked.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-checked -# key: ng -# -- -ng-checked="$0"` -(ng-snip/docs "ng-checked") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class-even.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class-even.yasnippet deleted file mode 100644 index ef390ab..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class-even.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-class-even -# key: ng -# -- -ng-class-even="$0"` -(ng-snip/docs "ng-class-even") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class-odd.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class-odd.yasnippet deleted file mode 100644 index fb15982..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class-odd.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-class-odd -# key: ng -# -- -ng-class-odd="$0"` -(ng-snip/docs "ng-class-odd") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class.yasnippet deleted file mode 100644 index 919af53..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-class -# key: ng -# -- -ng-class="{'${1:class}': ${2:condition}$0}"` -(ng-snip/docs "ng-class") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-click.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-click.yasnippet deleted file mode 100644 index 08aee12..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-click.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-click -# key: ng -# -- -ng-click="$0"` -(ng-snip/docs "ng-click") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-cloak.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-cloak.yasnippet deleted file mode 100644 index 279edd0..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-cloak.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-cloak -# key: ng -# -- -ng-cloak` -(ng-snip/docs "ng-cloak") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-controller.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-controller.yasnippet deleted file mode 100644 index 19bdcd2..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-controller.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-controller -# key: ng -# -- -ng-controller="$0"` -(ng-snip/docs "ng-controller") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-csp.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-csp.yasnippet deleted file mode 100644 index d0656b1..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-csp.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-csp -# key: ng -# -- -ng-csp` -(ng-snip/docs "ng-csp") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-dblclick.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-dblclick.yasnippet deleted file mode 100644 index 3a60dd2..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-dblclick.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-dblclick -# key: ng -# -- -ng-dblclick="$0"` -(ng-snip/docs "ng-dblclick") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-disabled.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-disabled.yasnippet deleted file mode 100644 index 6e39c75..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-disabled.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-disabled -# key: ng -# -- -ng-disabled="$0"` -(ng-snip/docs "ng-disabled") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-form.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-form.yasnippet deleted file mode 100644 index 4f81b1c..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-form.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-form -# key: ng -# -- -ng-form` -(ng-snip/docs "ng-form") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-hide.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-hide.yasnippet deleted file mode 100644 index 61444b6..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-hide.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-hide -# key: ng -# -- -ng-hide="$0"` -(ng-snip/docs "ng-hide") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-href.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-href.yasnippet deleted file mode 100644 index b4733be..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-href.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-href -# key: ng -# -- -ng-href="$0"` -(ng-snip/docs "ng-href") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-include.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-include.yasnippet deleted file mode 100644 index 4839bd7..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-include.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-include -# key: ng -# -- -ng-include="'$0'"` -(ng-snip/docs "ng-include") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-init.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-init.yasnippet deleted file mode 100644 index e68203e..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-init.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-init -# key: ng -# -- -ng-init="$0"` -(ng-snip/docs "ng-init") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-list.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-list.yasnippet deleted file mode 100644 index 9608f7b..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-list.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-list -# key: ng -# -- -ng-list` -(ng-snip/docs "ng-list") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-model.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-model.yasnippet deleted file mode 100644 index 086ac42..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-model.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-model -# key: ng -# -- -ng-model="$0"` -(ng-snip/docs "ng-model") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mousedown.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mousedown.yasnippet deleted file mode 100644 index eafcfbd..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mousedown.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-mousedown -# key: ng -# -- -ng-mousedown="$0"` -(ng-snip/docs "ng-mousedown") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseenter.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseenter.yasnippet deleted file mode 100644 index 3540ca6..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseenter.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-mouseenter -# key: ng -# -- -ng-mouseenter="$0"` -(ng-snip/docs "ng-mouseenter") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseleave.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseleave.yasnippet deleted file mode 100644 index 8f5ef51..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseleave.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-mouseleave -# key: ng -# -- -ng-mouseleave="$0"` -(ng-snip/docs "ng-mouseleave") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mousemove.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mousemove.yasnippet deleted file mode 100644 index b8de400..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mousemove.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-mousemove -# key: ng -# -- -ng-mousemove="$0"` -(ng-snip/docs "ng-mousemove") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseover.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseover.yasnippet deleted file mode 100644 index e446b97..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseover.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-mouseover -# key: ng -# -- -ng-mouseover="$0"` -(ng-snip/docs "ng-mouseover") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseup.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseup.yasnippet deleted file mode 100644 index f0a2805..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseup.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-mouseup -# key: ng -# -- -ng-mouseup="$0"` -(ng-snip/docs "ng-mouseup") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-multiple.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-multiple.yasnippet deleted file mode 100644 index 2d6ddb7..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-multiple.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-multiple -# key: ng -# -- -ng-multiple="$0"` -(ng-snip/docs "ng-multiple") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-non-bindable.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-non-bindable.yasnippet deleted file mode 100644 index ae6ad67..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-non-bindable.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-non-bindable -# key: ng -# -- -ng-non-bindable="$0"` -(ng-snip/docs "ng-non-bindable") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-options.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-options.yasnippet deleted file mode 100644 index 2e3e304..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-options.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-options -# key: ng -# -- -ng-options="${1:${2:item}.${3:value} as $2.${4:label} for $2 in ${5:$2s}}"` -(ng-snip/docs "ng-options") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-pluralize.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-pluralize.yasnippet deleted file mode 100644 index b2b7a5f..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-pluralize.yasnippet +++ /dev/null @@ -1,11 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-pluralize -# key: ng -# -- -ng-pluralize count="${1:model}" when="{ - '0': '${2:none}', - 'one': '${3:one}', - 'other': '{} $0' -}"` -(ng-snip/docs "ng-pluralize") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-readonly.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-readonly.yasnippet deleted file mode 100644 index 0b10a34..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-readonly.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-readonly -# key: ng -# -- -ng-readonly` -(ng-snip/docs "ng-readonly") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-repeat.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-repeat.yasnippet deleted file mode 100644 index 7b27676..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-repeat.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-repeat -# key: ng -# -- -ng-repeat="${1:thing} in ${2:$1s}"` -(ng-snip/docs "ng-repeat") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-selected.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-selected.yasnippet deleted file mode 100644 index fd76e7f..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-selected.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-selected -# key: ng -# -- -ng-selected="$0"` -(ng-snip/docs "ng-selected") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-show.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-show.yasnippet deleted file mode 100644 index 5a00741..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-show.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-show -# key: ng -# -- -ng-show="$0"` -(ng-snip/docs "ng-show") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-src.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-src.yasnippet deleted file mode 100644 index c754871..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-src.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-src -# key: ng -# -- -ng-src="$0"` -(ng-snip/docs "ng-src") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-style.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-style.yasnippet deleted file mode 100644 index fe3fe0e..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-style.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-style -# key: ng -# -- -ng-style="$0"` -(ng-snip/docs "ng-style") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-submit.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-submit.yasnippet deleted file mode 100644 index 7169aca..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-submit.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-submit -# key: ng -# -- -ng-submit="$0"` -(ng-snip/docs "ng-submit") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-switch.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-switch.yasnippet deleted file mode 100644 index 0f51b7f..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-switch.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-switch -# key: ng -# -- -ng-switch="$0"` -(ng-snip/docs "ng-switch") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-transclude.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-transclude.yasnippet deleted file mode 100644 index bde694c..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-transclude.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-transclude -# key: ng -# -- -ng-transclude` -(ng-snip/docs "ng-transclude") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-view.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-view.yasnippet deleted file mode 100644 index b31eb74..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-view.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ng-view -# key: ng -# -- -ng-view` -(ng-snip/docs "ng-view") -(ng-snip/maybe-space-after-attr)` \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$b.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/$b.yasnippet deleted file mode 100644 index 0484368..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$b.yasnippet +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: $b -# key: $b -# -- -$scope.$broadcast("$1", $2); -$0 \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$e.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/$e.yasnippet deleted file mode 100644 index 258fbdc..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$e.yasnippet +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: $e -# key: $e -# -- -$scope.$emit("$1", $2); -$0 \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$f.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/$f.yasnippet deleted file mode 100644 index 25d8116..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$f.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: $f -# key: $f -# -- -$scope.$1 = function ($2) { - $0 -}; diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$on.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/$on.yasnippet deleted file mode 100644 index ad2bdfd..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$on.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: $on -# key: $on -# -- -$scope.$on("$1", function (event, $2) { - $0 -}); \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$v.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/$v.yasnippet deleted file mode 100644 index e08c0df..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$v.yasnippet +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: $v -# key: $v -# -- -$scope.$1 = $2; -$0 \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$va.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/$va.yasnippet deleted file mode 100644 index dbb562f..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$va.yasnippet +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: $va -# key: $va -# -- -$scope.$1 = $1; -$0 \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$w.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/$w.yasnippet deleted file mode 100644 index 4fea53f..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/$w.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: $w -# key: $w -# -- -$scope.$watch("$1", function (newValue, oldValue) { - $0 -}); \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngc.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngc.yasnippet deleted file mode 100644 index 4bd2de6..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngc.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ngc -# key: ngc -# -- -controller('$1', function ($scope, $2) { - $0 -}); \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngd.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngd.yasnippet deleted file mode 100644 index bbd9b24..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngd.yasnippet +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: ngd -# key: ngd -# -- -directive('$1', function ($2) { - return function (scope, element, attrs$4) { - $3 - }; -}); diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngfa.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngfa.yasnippet deleted file mode 100644 index 1a72769..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngfa.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ngfa -# key: ngfa -# -- -factory("$1", function ($2) { - $3 -}) diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngfi.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngfi.yasnippet deleted file mode 100644 index 1594b24..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngfi.yasnippet +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: ngfi -# key: ngfi -# -- -filter("$1", function ($2) { - return function (input, $3) { - $3 - }; -}); diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngm.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngm.yasnippet deleted file mode 100644 index bd95e70..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngm.yasnippet +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: ngm -# key: ngm -# -- -angular.module("$1", [$2]); diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngro.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngro.yasnippet deleted file mode 100644 index 263f17a..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngro.yasnippet +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: ngro -# key: ngro -# -- -$routeProvider.otherwise({redirectTo: "$1"}); -$0 \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngrw.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngrw.yasnippet deleted file mode 100644 index edbfe85..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngrw.yasnippet +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: ngrw -# key: ngrw -# -- -$routeProvider.when("$1", { - templateUrl: "$2", - controller: "$3" -}); -$0 \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngrwr.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngrwr.yasnippet deleted file mode 100644 index 58e7de2..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngrwr.yasnippet +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -# name: ngrwr -# key: ngrwr -# -- -$routeProvider.when("$1", { - templateUrl: "$2", - controller: "$3", - resolve: {$0 - } -}); diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngs.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngs.yasnippet deleted file mode 100644 index d61a6fe..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngs.yasnippet +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: ngs -# key: ngs -# -- -service("$1", function () { - $3 -}); diff --git a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngw.yasnippet b/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngw.yasnippet deleted file mode 100644 index 6a4f86e..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js-mode/ngw.yasnippet +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: ngw -# key: ngw -# -- -when("/$1", { - templateUrl: "$2", - controller: "$0" -}) \ No newline at end of file diff --git a/elpa/angular-snippets-20140513.2223/snippets/js2-mode/.yas-parents b/elpa/angular-snippets-20140513.2223/snippets/js2-mode/.yas-parents deleted file mode 100644 index 27dab30..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/js2-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -js-mode diff --git a/elpa/angular-snippets-20140513.2223/snippets/web-mode/.yas-parents b/elpa/angular-snippets-20140513.2223/snippets/web-mode/.yas-parents deleted file mode 100644 index 8a11383..0000000 --- a/elpa/angular-snippets-20140513.2223/snippets/web-mode/.yas-parents +++ /dev/null @@ -1 +0,0 @@ -html-mode diff --git a/elpa/archives/gnu/archive-contents b/elpa/archives/gnu/archive-contents index d741374..61d0fd9 100644 --- a/elpa/archives/gnu/archive-contents +++ b/elpa/archives/gnu/archive-contents @@ -341,7 +341,7 @@ ((:keywords "killing" "convenience") (:url . "https://github.com/leoliu/easy-kill"))]) (ebdb . - [(0 5 4) + [(0 6) ((emacs (25 1)) (cl-lib @@ -384,7 +384,7 @@ ((:keywords "convenience" "languages") (:url . "https://github.com/joaotavora/eglot"))]) (el-search . - [(1 7 3) + [(1 7 4) ((emacs (25)) (stream @@ -481,7 +481,7 @@ ((:url . "http://elpa.gnu.org/packages/fsm.html") (:keywords "extensions"))]) (ggtags . - [(0 8 12) + [(0 8 13) ((emacs (24)) (cl-lib @@ -852,7 +852,7 @@ ((:url . "http://elpa.gnu.org/packages/osc.html") (:keywords "comm" "processes" "multimedia"))]) (other-frame-window . - [(1 0 4) + [(1 0 5) ((emacs (24 4))) "Minor mode to enable global prefix keys for other frame/window buffer placement" single diff --git a/elpa/archives/gnu/archive-contents.signed b/elpa/archives/gnu/archive-contents.signed index 2749c46..c362f5e 100644 --- a/elpa/archives/gnu/archive-contents.signed +++ b/elpa/archives/gnu/archive-contents.signed @@ -1,2 +1,2 @@ Good signature from 474F05837FBDEF9B GNU ELPA Signing Agent - (trust undefined) created at 2018-07-24T05:10:02+0800 using DSA \ No newline at end of file + (trust undefined) created at 2018-07-31T05:05:03+0800 using DSA \ No newline at end of file diff --git a/elpa/archives/melpa/archive-contents b/elpa/archives/melpa/archive-contents index 0379574..a236d71 100644 --- a/elpa/archives/melpa/archive-contents +++ b/elpa/archives/melpa/archive-contents @@ -1,2 +1,2 @@ -(1 (zzz-to-char . [(20171231 2219) ((emacs (24 4)) (cl-lib (0 5)) (avy (0 3 0))) "Fancy version of `zap-to-char' command" single]) (zygospore . [(20140703 152) nil "reversible C-x 1 (delete-other-windows)" single]) (zweilight-theme . [(20170112 2205) nil "A dark color theme for Emacs." single]) (ztree . [(20180512 1150) ((cl-lib (0))) "Text mode directory tree" tar]) (zpresent . [(20180604 2138) ((emacs (25 1)) (org-parser (0 4)) (dash (2 12 0)) (request (0 3 0))) "Simple presentation mode based on org files." single]) (zoutline . [(20180314 1059) nil "Simple outline library." single]) (zotxt . [(20180517 1847) ((request-deferred (0 2 0))) "Tools to integrate emacs with Zotero via the zotxt plugin." tar]) (zotelo . [(20160602 249) ((cl-lib (0 5))) "Manage Zotero collections from emacs" single]) (zossima . [(20121123 1635) ((inf-ruby (2 2 3))) "Ruby from Emacs" tar]) (zop-to-char . [(20160212 754) ((cl-lib (0 5))) "A replacement of zap-to-char." single]) (zoom-window . [(20170302 27) ((emacs (24 3))) "Zoom window like tmux" single]) (zoom . [(20180310 421) ((emacs (24 4))) "Fixed and automatic balanced window layout" single]) (zone-sl . [(20160201 410) ((emacs (24 3))) "Zone out with steam locomotives." single]) (zone-select . [(20160118 619) ((emacs (24 3)) (dash (2 8))) "Select zone programs." single]) (zone-rainbow . [(20160120 534) ((emacs (24 3))) "Zone out with rainbow." single]) (zone-nyan . [(20170818 944) ((esxml (0 3 1))) "Zone out with nyan cat" single]) (zombie-trellys-mode . [(20150304 648) ((emacs (24)) (cl-lib (0 5)) (haskell-mode (1 5))) "A minor mode for interaction with Zombie Trellys" single]) (zombie . [(20141222 816) nil "major mode for editing ZOMBIE programs" single]) (znc . [(20160627 1332) ((cl-lib (0 2))) "ZNC + ERC" single]) (zlc . [(20151010 1857) nil "Provides zsh like completion system to Emacs" single]) (zig-mode . [(20180309 1458) ((emacs (24))) "A major mode for the Zig programming language" single]) (zerodark-theme . [(20180528 26) ((all-the-icons (2 0 0)) (magit (2 8 0)) (flycheck (29))) "A dark, medium contrast theme for Emacs" single]) (zephir-mode . [(20170917 2125) ((cl-lib (0 5)) (pkg-info (0 4)) (emacs (24 3))) "Major mode for editing Zephir code" single]) (zenity-color-picker . [(20160302 354) ((emacs (24 4))) "Insert and adjust colors using Zenity" single]) (zencoding-mode . [(20140213 22) nil "Unfold CSS-selector-like expressions to markup" single]) (zenburn-theme . [(20180531 902) nil "A low contrast color theme for Emacs." single]) (zen-and-art-theme . [(20120622 737) nil "zen and art color theme for GNU Emacs 24" single]) (zel . [(20171014 132) ((emacs (25)) (frecency (0 1))) "Access frecent files easily" single]) (zeal-at-point . [(20180131 1554) nil "Search the word at point with Zeal" single]) (z3-mode . [(20151120 1455) ((flycheck (0 23)) (emacs (24))) "A z3/SMTLIBv2 interactive development environment" single]) (youdao-dictionary . [(20180713 2114) ((popup (0 5 0)) (pos-tip (0 4 6)) (chinese-word-at-point (0 2)) (names (0 5)) (emacs (24))) "Youdao Dictionary interface for Emacs" single]) (yoshi-theme . [(20170330 0) nil "Theme named after my cat" single]) (yoficator . [(20180129 1252) nil "Interactively yoficate Russian texts" tar]) (yesql-ghosts . [(20150220 437) ((s (1 9 0)) (dash (2 10 0)) (cider (0 8 0))) "Display ghostly yesql defqueries inline" single]) (ydk-mode . [(20170113 121) nil "Language support for Yu-Gi-Oh! deck files" single]) (ycmd . [(20180520 353) ((emacs (24 4)) (dash (2 13 0)) (s (1 11 0)) (deferred (0 5 1)) (cl-lib (0 6 1)) (let-alist (1 0 5)) (request (0 3 0)) (request-deferred (0 3 0)) (pkg-info (0 6))) "emacs bindings to the ycmd completion server" tar]) (ycm . [(20150822 1136) nil "Emacs client for the YouCompleteMe auto-completion server." single]) (yaxception . [(20150105 652) nil "Provide framework about exception like Java for Elisp" single]) (yatex . [(20180601 2357) nil "Yet Another tex-mode for emacs //野鳥//" tar]) (yatemplate . [(20180617 252) ((yasnippet (0 8 1)) (emacs (24 3))) "File templates with yasnippet" tar]) (yasnippet-snippets . [(20180714 622) ((yasnippet (0 8 0))) "Collection of yasnippet snippets" tar]) (yasnippet . [(20180620 1750) ((cl-lib (0 5))) "Yet another snippet extension for Emacs." single]) (yascroll . [(20170315 1206) ((cl-lib (0 3))) "Yet Another Scroll Bar Mode" single]) (yarn-mode . [(20170709 1237) ((emacs (24 3))) "Major mode for yarn.lock files." single]) (yari . [(20151127 2339) nil "Yet Another RI interface for Emacs" single]) (yard-mode . [(20170817 537) nil "Minor mode for Ruby YARD comments" single]) (yara-mode . [(20170719 2351) ((emacs (24))) "Major mode for editing yara rule file" single]) (yapfify . [(20180105 1447) nil "(automatically) format python buffers using YAPF." single]) (yankpad . [(20180624 1615) ((emacs (24))) "Paste snippets from an org-mode file" single]) (yang-mode . [(20180306 407) nil "major mode for editing YANG files" single]) (yandex-weather . [(20160311 1237) nil "Fetch Yandex Weather forecasts." tar]) (yaml-tomato . [(20151122 2353) ((s (1 9))) "copy or show the yaml path currently under cursor." single]) (yaml-mode . [(20180408 2307) ((emacs (24 1))) "Major mode for editing YAML files" single]) (yalinum . [(20130217 243) nil "yet another display line numbers." single]) (yahtzee . [(20171022 712) ((emacs (24 3))) "The yahtzee game" single]) (yahoo-weather . [(20170822 1544) ((emacs (24))) "Displays weather information in mode-line" single]) (yagist . [(20160417 2208) ((cl-lib (0 3))) "Yet Another Emacs integration for gist.github.com" single]) (yafolding . [(20170304 1917) nil "Yet another folding extension for Emacs" single]) (yabin . [(20140205 1951) nil "Yet Another Bignum package (A thin wrapper of calc.el)." single]) (xwidgete . [(20171118 1316) ((emacs (25))) "enhances usability of current xwidget browser" single]) (xtest . [(20141214 906) ((cl-lib (0 5))) "Simple Testing with Emacs & ERT" single]) (xterm-keybinder . [(20160522 1756) ((emacs (24 3)) (cl-lib (0 5)) (let-alist (1 0 1))) "Let you extra keybinds in xterm/urxvt" tar]) (xterm-color . [(20180202 1518) ((cl-lib (0 5))) "ANSI & XTERM 256 color support" single]) (xresources-theme . [(20160331 702) nil "Use your .Xresources as your emacs theme" single]) (xref-js2 . [(20170530 126) ((emacs (25)) (js2-mode (20150909))) "Jump to references/definitions using ag & js2-mode's AST" single]) (xquery-tool . [(20170605 126) nil "A simple interface to saxonb's xquery." single]) (xquery-mode . [(20170214 319) ((cl-lib (0 5))) "A simple mode for editing xquery programs" single]) (xo . [(20160402 2346) nil "XO linter integration with compilation mode" single]) (xmlunicode . [(20160319 912) nil "Unicode support for XML" tar]) (xmlgen . [(20170411 617) nil "A DSL for generating XML." single]) (xml-rpc . [(20160430 1458) nil "An elisp implementation of clientside XML-RPC" single]) (xml-quotes . [(20151230 1449) nil "read quotations from an XML document" tar]) (xml+ . [(20170727 1651) ((emacs (24 4)) (dash (2 12 0))) "Utilities for xml and html trees" single]) (xkcd . [(20160419 430) ((json (1 3))) "View xkcd from Emacs" single]) (xcscope . [(20180426 12) nil "cscope interface for (X)Emacs" single]) (xcode-project . [(20180509 1218) ((emacs (25))) "A package for reading Xcode project files." tar]) (xcode-mode . [(20160907 508) ((emacs (24 4)) (s (1 10 0)) (dash (2 11 0)) (multiple-cursors (1 0 0))) "A minor mode for emacs to perform Xcode like actions." single]) (xbm-life . [(20160103 217) nil "A XBM version of Conway's Game of Life" single]) (xahk-mode . [(20170821 407) ((emacs (24 1))) "Major mode for editing AutoHotkey scripts." single]) (xah-replace-pairs . [(20180507 1949) ((emacs (24 1))) "emacs lisp functions for multi-pair find/replace." single]) (xah-reformat-code . [(20170821 411) nil "commands to reformat source code." single]) (xah-math-input . [(20180709 2228) ((emacs (24 1))) "a minor mode for inputting math and Unicode symbols." single]) (xah-lookup . [(20171108 241) ((emacs (24 1))) "look up word on internet." single]) (xah-get-thing . [(20170821 353) ((emacs (24 1))) "get thing or selection at point." single]) (xah-fly-keys . [(20180702 1521) ((emacs (24 1))) "ergonomic modal keybinding minor mode." single]) (xah-find . [(20180310 450) ((emacs (24 1))) "find replace in pure emacs lisp. Purpose similar to grep/sed." single]) (xah-elisp-mode . [(20180710 124) ((emacs (24 3))) "Major mode for editing emacs lisp." single]) (xah-css-mode . [(20180629 107) ((emacs (24 3))) "Major mode for editing CSS code." single]) (x86-lookup . [(20180528 935) ((emacs (24 3)) (cl-lib (0 3))) "jump to x86 instruction documentation" single]) (x509-mode . [(20180702 36) ((emacs (24 1)) (cl-lib (0 5))) "View certificates, CRLs and keys using OpenSSL." tar]) (x-path-walker . [(20160922 1135) ((helm-core (1 9 2))) "Navigation feature for JSON/XML/HTML based on path (imenu like)" tar]) (www-synonyms . [(20170128 1451) ((request (0 2 0)) (cl-lib (0 5))) "insert synonym for a word" single]) (wwtime . [(20151122 810) nil "Insert a time of day with appropriate world-wide localization" single]) (wttrin . [(20170614 506) ((emacs (24 4)) (xterm-color (1 0))) "Emacs frontend for weather web service wttr.in" single]) (wsd-mode . [(20170731 837) nil "Emacs major-mode for www.websequencediagrams.com" tar]) (ws-butler . [(20170111 1534) nil "Unobtrusively remove trailing whitespace." single]) (writeroom-mode . [(20170623 327) ((emacs (24 1)) (visual-fill-column (1 9))) "Minor mode for distraction-free writing" tar]) (writegood-mode . [(20180525 643) nil "Polish up poor writing on the fly" single]) (wrap-region . [(20140116 2320) ((dash (1 0 3))) "Wrap text with punctation or tag" single]) (wotd . [(20170328 1248) ((emacs (24 4)) (org (8 2 10))) "Fetch word-of-the-day from multiple online sources" single]) (world-time-mode . [(20140627 107) nil "show whole days of world-time diffs" single]) (workgroups2 . [(20141102 1122) ((cl-lib (0 4)) (dash (2 8 0)) (anaphora (1 0 0)) (f (0 17))) "New workspaces for Emacs" single]) (workgroups . [(20110726 941) nil "workgroups for windows (for Emacs)" single]) (worf . [(20180620 1011) ((swiper (0 7 0)) (ace-link (0 1 0)) (hydra (0 13 0)) (zoutline (0 1 0))) "A warrior does not press so many keys! (in org-mode)" tar]) (wordsmith-mode . [(20171025 730) nil "Syntax analysis and NLP text-processing in Emacs (OSX-only)" single]) (wordnut . [(20180312 2143) ((emacs (24 4))) "Major mode interface to WordNet" tar]) (wordgen . [(20170803 1120) ((emacs (24)) (cl-lib (0 5))) "Random word generator" single]) (wonderland . [(20130912 1819) ((dash (2 0 0)) (dash-functional (1 0 0)) (multi (2 0 0)) (emacs (24))) "declarative configuration for Emacsen" single]) (wolfram-mode . [(20180306 1613) ((emacs (24 3))) "Mathematica editing and inferior mode." single]) (wolfram . [(20170122 2356) nil "Wolfram Alpha Integration" single]) (wn-mode . [(20151109 2152) ((emacs (24))) "numeric window switching shortcuts" single]) (with-simulated-input . [(20170820 2317) ((emacs (24 4)) (seq (2 0)) (s (0))) "A macro to simulate user input non-interactively" single]) (with-namespace . [(20130407 1122) ((dash (1 1 0)) (loop (1 1))) "interoperable elisp namespaces" single]) (with-editor . [(20180618 1602) ((emacs (24 4)) (async (1 9))) "Use the Emacsclient as $EDITOR" tar]) (wispjs-mode . [(20170720 1219) ((clojure-mode (0))) "Major mode for Wisp code." single]) (wisp-mode . [(20180520 58) nil "Tools for wisp: the Whitespace-to-Lisp preprocessor" tar]) (winum . [(20171028 702) ((cl-lib (0 5)) (dash (2 13 0))) "Navigate windows and frames using numbers." single]) (winring . [(20180529 1718) nil "Window configuration rings" single]) (winpoint . [(20131023 1013) nil "Remember buffer positions per-window, not per buffer" single]) (winnow . [(20170903 506) ((emacs (24))) "winnow ag/grep results by matching/excluding lines" single]) (windwow . [(20170815 1848) ((dash (2 11 0)) (cl-lib (0 6 1)) (emacs (24))) "simple workspace management" single]) (windsize . [(20151121 540) nil "Simple, intuitive window resizing" single]) (window-purpose . [(20180531 1336) ((emacs (24)) (cl-lib (0 5)) (let-alist (1 0 3)) (imenu-list (0 1))) "Purpose-based window management for Emacs" tar]) (window-numbering . [(20160809 1110) nil "Numbered window shortcuts" single]) (window-number . [(20170731 1851) nil "Select windows by numbers." single]) (window-layout . [(20170214 1633) nil "window layout manager" single]) (window-jump . [(20170809 1508) nil "Move left/right/up/down through your windows." single]) (window-end-visible . [(20140508 1341) nil "Find the last visible point in a window" single]) (windata . [(20090830 340) nil "convert window configuration to list" single]) (win-switch . [(20161009 927) nil "fast, dynamic bindings for window-switching/resizing" single]) (wilt . [(20180220 54) ((emacs (24 3)) (dash (2 12 0)) (s (1 10 0))) "An extensions for calculating WILT in a buffer." single]) (wiki-summary . [(20150408 1422) ((emacs (24))) "View Wikipedia summaries in Emacs easily." single]) (wiki-nav . [(20150223 554) ((button-lock (1 0 2)) (nav-flash (1 0 0))) "Simple file navigation using [[WikiStrings]]" single]) (widgetjs . [(20160719 804) ((makey (0 3)) (js2-mode (20140114)) (js2-refactor (0 6 1)) (s (1 9 0))) "Widgetjs mode" single]) (widget-mvc . [(20150101 2006) nil "MVC framework for the emacs widgets" single]) (wide-column . [(20170925 913) nil "Calls functions dependant on column position." single]) (whole-line-or-region . [(20180324 2119) nil "operate on current line if region undefined" single]) (whizzml-mode . [(20180711 910) ((emacs (24 4))) "Programming mode for editing WhizzML files" tar]) (whitespace-cleanup-mode . [(20170505 1923) nil "Intelligently call whitespace-cleanup on save" single]) (white-theme . [(20160917 1043) ((emacs (24))) "Minimalistic light color theme inspired by basic-theme" single]) (white-sand-theme . [(20151117 848) ((emacs (24))) "Emacs theme with a light background." single]) (whitaker . [(20150814 422) ((dash (2 10 0))) "Comint interface for Whitaker's Words" single]) (which-key . [(20180621 1238) ((emacs (24 4))) "Display available keybindings in popup" single]) (what-the-commit . [(20150901 616) nil "Random commit message generator" single]) (wgrep-pt . [(20140510 1531) ((wgrep (2 1 5))) "Writable pt buffer and apply the changes to files" single]) (wgrep-helm . [(20170510 1539) ((wgrep (2 1 1))) "Writable helm-grep-mode buffer and apply the changes to files" single]) (wgrep-ag . [(20160923 403) ((wgrep (2 1 5)) (cl-lib (0 5))) "Writable ag buffer and apply the changes to files" single]) (wgrep-ack . [(20141012 311) ((wgrep (2 1 1))) "Writable ack-and-a-half buffer and apply the changes to files" single]) (wgrep . [(20180710 2326) nil "Writable grep buffer and apply the changes to files" single]) (weibo . [(20150307 1442) ((cl-lib (0 5))) "Weibo client for Emacs" tar]) (weechat-alert . [(20160416 548) ((weechat (0 3 1)) (cl-lib (0 5)) (alert (1 2))) "Weechat notifier using alerts" single]) (weechat . [(20180513 310) ((s (1 3 1)) (cl-lib (0 2)) (emacs (24)) (tracking (1 2))) "Chat via WeeChat's relay protocol in Emacs" tar]) (wedge-ws . [(20140714 1449) nil "Wedge whitespace between columns in text" single]) (websocket . [(20180422 1716) ((cl-lib (0 5))) "Emacs WebSocket client and server" single]) (webpaste . [(20180127 1434) ((emacs (24 4)) (request (0 2 0)) (cl-lib (0 5))) "Paste to pastebin-like services" single]) (weblogger . [(20110926 918) ((xml-rpc (1 6 8))) "Weblog maintenance via XML-RPC APIs" single]) (webkit-color-picker . [(20180325 36) ((emacs (26 0)) (posframe (0 1 0))) "Insert and adjust colors using Webkit Widgets" tar]) (web-server . [(20140905 1706) ((emacs (24 3))) "Emacs Web Server" tar]) (web-search . [(20170911 1246) ((emacs (24 3))) "Open a web search" tar]) (web-narrow-mode . [(20170406 1910) ((web-mode (14 0 27))) "quick narrow code block in web-mode" single]) (web-mode-edit-element . [(20161114 954) ((emacs (24 4)) (web-mode (14))) "Helper-functions for attribute- and element-handling" tar]) (web-mode . [(20180628 422) ((emacs (23 1))) "major mode for editing web templates" single]) (web-completion-data . [(20160318 148) nil "Shared completion data for ac-html and company-web" tar]) (web-beautify . [(20161115 1447) nil "Format HTML, CSS and JavaScript/JSON" single]) (web . [(20141231 1201) ((dash (2 9 0)) (s (1 5 0))) "useful HTTP client" single]) (weather-metno . [(20150831 1807) ((emacs (24)) (cl-lib (0 3))) "Weather data from met.no in Emacs" tar]) (wcheck-mode . [(20180126 416) nil "General interface for text checkers" tar]) (wc-mode . [(20170126 2029) nil "Running word count with goals (minor mode)" single]) (wc-goal-mode . [(20140829 659) nil "Running word count with goals (minor mode)" single]) (wavefront-obj-mode . [(20170808 1016) nil "Major mode for Wavefront obj files" single]) (watch-buffer . [(20120331 1344) nil "run a shell command when saving a buffer" single]) (warm-night-theme . [(20161101 728) ((emacs (24))) "Emacs 24 theme with a dark background." single]) (wanderlust . [(20180605 631) ((semi (1 14 7))) "Yet Another Message Interface on Emacsen" tar]) (wandbox . [(20170603 531) ((emacs (24)) (request (0 3 0)) (s (1 10 0))) "Wandbox client" tar]) (wand . [(20180112 454) ((dash (20161121 55)) (s (20160928 636))) "Magic wand for Emacs - Select and execute" tar]) (wakib-keys . [(20180610 1952) ((emacs (24 4))) "Minor Mode for Modern Keybindings" single]) (wakatime-mode . [(20170517 2053) nil "Automatic time tracking extension for WakaTime" single]) (waher-theme . [(20141115 430) ((emacs (24 1))) "Emacs 24 theme based on waher for st2 by dduckster" single]) (waf-mode . [(20170403 1240) nil "Waf integration for Emacs" single]) (wacspace . [(20180311 1650) ((dash (1 2 0)) (cl-lib (0 2))) "The WACky WorkSPACE manager for emACS" tar]) (w3m . [(20180404 2220) nil "an Emacs interface to w3m" tar]) (w32-browser . [(20170101 1154) nil "Run Windows application associated with a file." single]) (vyper-mode . [(20180707 1235) ((emacs (24 3))) "Major mode for the Vyper programming language" single]) (vue-mode . [(20180515 2012) ((mmm-mode (0 5 5)) (vue-html-mode (0 2)) (ssass-mode (0 2)) (edit-indirect (0 1 4))) "Major mode for vue component based on mmm-mode" single]) (vue-html-mode . [(20180428 1335) nil "Major mode for editing Vue.js templates" single]) (volume . [(20150718 1309) nil "tweak your sound card volume from Emacs" single]) (volatile-highlights . [(20160611 1855) nil "Minor mode for visual feedback on some operations." single]) (voca-builder . [(20161101 945) ((popup (0 5 2))) "Helps you build up your vocabulary" single]) (vmd-mode . [(20180223 556) ((emacs (24 3))) "Fast Github-flavored Markdown preview using a vmd subprocess." single]) (vlf . [(20180201 1454) nil "View Large Files" tar]) (visual-regexp-steroids . [(20170221 1853) ((visual-regexp (1 1))) "Extends visual-regexp to support other regexp engines" tar]) (visual-regexp . [(20170228 1716) ((cl-lib (0 2))) "A regexp/replace command for Emacs with interactive visual feedback" single]) (visual-fill-column . [(20180511 211) ((emacs (24 3))) "fill-column for visual-line-mode" single]) (visual-ascii-mode . [(20150129 246) nil "Visualize ascii code (small integer) on buffer." single]) (visible-mark . [(20150623 2150) nil "Make marks visible." single]) (virtualenvwrapper . [(20180211 1744) ((dash (1 5 0)) (s (1 6 1))) "a featureful virtualenv tool for Emacs" single]) (virtualenv . [(20140220 1501) nil "Virtualenv for Python" single]) (vimrc-mode . [(20170814 1837) nil "Major mode for vimrc files" single]) (vimish-fold . [(20171231 2212) ((emacs (24 4)) (cl-lib (0 5)) (f (0 18 0))) "Fold text like in Vim" single]) (vim-region . [(20140329 924) ((expand-region (20140127))) "Select region as vim" single]) (vim-empty-lines-mode . [(20150110 2026) ((emacs (23))) "Vim-like empty line indicator at end of files." single]) (viking-mode . [(20160705 1327) nil "kill first, ask later" single]) (viewer . [(20170106 1802) nil "View-mode extension" single]) (vi-tilde-fringe . [(20141027 1942) ((emacs (24))) "Displays tildes in the fringe on empty lines a la Vi." single]) (vhdl-tools . [(20180610 958) ((ggtags (0 8 12)) (emacs (26 1)) (outshine (2 0)) (helm (2 9 6))) "Utilities for navigating vhdl sources." single]) (vhdl-capf . [(20160221 934) nil "Completion at point function (capf) for vhdl-mode." single]) (vertigo . [(20180408 920) ((dash (2 11 0))) "Jump across lines using the home row." single]) (vertica-snippets . [(20180208 154) ((yasnippet (0 6 1))) "Yasnippets for Vertica" tar]) (vertica . [(20131217 711) ((sql (3 0))) "Vertica SQL mode extension" single]) (verify-url . [(20160426 528) ((cl-lib (0 5))) "find out invalid urls in the buffer or region" single]) (vector-utils . [(20140508 1341) nil "Vector-manipulation utility functions" single]) (vdirel . [(20170605 43) ((emacs (24 4)) (org-vcard (0 1 0)) (helm (1 7 0)) (seq (1 11))) "Manipulate vdir (i.e., vCard) repositories" single]) (vdiff-magit . [(20180719 1401) ((emacs (24 4)) (vdiff (0 3)) (magit (2 10 0))) "magit integration for vdiff" single]) (vdiff . [(20180719 1327) ((emacs (24 4)) (hydra (0 13 0))) "A diff tool similar to vimdiff" single]) (vcomp . [(20140906 1508) nil "compare version strings" single]) (vcl-mode . [(20170119 1251) nil "Syntax highlighting for Varnish Command Language" single]) (vc-osc . [(20161119 1155) nil "non-resident support for osc version-control" single]) (vc-msg . [(20180604 1758) ((emacs (24 3)) (popup (0 5 0))) "Show commit information of current line" tar]) (vc-fossil . [(20180215 835) nil "VC backend for the fossil sofware configuraiton management system" tar]) (vc-darcs . [(20170904 2020) ((emacs (24))) "a VC backend for darcs" single]) (vc-check-status . [(20170107 534) nil "Warn you when quitting emacs and leaving repo dirty." tar]) (vc-auto-commit . [(20170107 533) nil "Auto-committing feature for your repository" tar]) (vbasense . [(20140221 1553) ((auto-complete (1 4 0)) (log4e (0 2 0)) (yaxception (0 1))) "provide a environment like Visual Basic Editor." tar]) (vala-snippets . [(20150428 2052) ((yasnippet (0 8 0))) "Yasnippets for Vala" tar]) (vala-mode . [(20150324 1525) nil "Vala mode derived mode" single]) (vagrant-tramp . [(20160427 1632) ((dash (2 12 0))) "Vagrant method for TRAMP" tar]) (vagrant . [(20170301 1406) nil "Manage a vagrant box from emacs" single]) (v2ex-mode . [(20160719 2045) ((cl-lib (0 5)) (request (0 2)) (let-alist (1 0 3))) "Major mode for visit http://v2ex.com/ site." single]) (uuidgen . [(20140918 1601) nil "Provides various UUID generating functions" single]) (uuid . [(20120910 151) nil "UUID's for EmacsLisp" single]) (utop . [(20180706 1549) ((emacs (24))) "Universal toplevel for OCaml" single]) (usql . [(20180305 1523) ((emacs (25 1))) "U-SQL support for sql-mode" single]) (use-ttf . [(20180608 2252) ((emacs (24 4)) (s (1 12 0))) "Use the same font cross OS." single]) (use-package-ensure-system-package . [(20180710 29) ((use-package (2 1)) (system-packages (1 0 4))) "auto install system packages" single]) (use-package-el-get . [(20180130 2105) ((use-package (1 0))) "el-get support for use package" single]) (use-package-chords . [(20180703 1258) ((use-package (2 1)) (bind-key (1 0)) (bind-chord (0 2)) (key-chord (0 6))) "key-chord keyword for use-package" single]) (use-package . [(20180715 1101) ((emacs (24 3)) (bind-key (2 4))) "A configuration macro for simplifying your .emacs" tar]) (usage-memo . [(20170925 1737) nil "integration of Emacs help system and memo" single]) (urlenc . [(20140116 656) nil "URL encoding/decoding utility for Emacs." single]) (url-shortener . [(20170804 1942) nil "shorten long url and expand tinyurl" single]) (uptimes . [(20180416 623) ((cl-lib (0 5)) (emacs (24))) "Track and display emacs session uptimes." single]) (upbo . [(20180422 122) ((dash (2 12 0)) (emacs (24 4))) "Karma Test Runner Integration" single]) (untitled-new-buffer . [(20161212 708) ((emacs (24 4)) (magic-filetype (0 2 0))) "Open untitled new buffer like other text editors." single]) (unkillable-scratch . [(20160504 1903) nil "Disallow buffers from being killed by regexp -- default is *scratch* buffer" single]) (universal-emotions-emoticons . [(20171209 1820) ((emacs (24 4))) "Emoticons For The Six Universal Expressions" single]) (unison-mode . [(20160513 801) nil "Syntax highlighting for unison file synchronization program" single]) (unison . [(20160704 40) ((emacs (24 1))) "sync with Unison" single]) (unipoint . [(20140113 1424) nil "a simple way to insert unicode characters by TeX name" single]) (unify-opening . [(20171122 1212) ((emacs (24 4))) "Unify the mechanism to open files" single]) (unidecode . [(20180312 1226) nil "Transliterate Unicode to ASCII" tar]) (unicode-whitespace . [(20140508 1341) ((ucs-utils (0 7 6)) (list-utils (0 4 2)) (persistent-soft (0 8 8)) (pcache (0 2 3))) "teach whitespace-mode about fancy characters" single]) (unicode-troll-stopper . [(20151023 1831) nil "Minor mode for Highlighting Unicode homoglyphs" single]) (unicode-progress-reporter . [(20140508 1341) ((emacs (24 1 0)) (ucs-utils (0 7 6)) (list-utils (0 4 2)) (persistent-soft (0 8 8)) (pcache (0 2 3))) "Progress-reporter with fancy characters" single]) (unicode-input . [(20141218 2320) nil "Support for unicode character input" single]) (unicode-fonts . [(20150826 1532) ((font-utils (0 7 8)) (ucs-utils (0 8 2)) (list-utils (0 4 2)) (persistent-soft (0 8 10)) (pcache (0 3 1))) "Configure Unicode fonts" single]) (unicode-escape . [(20160614 534) ((emacs (24)) (names (20151201 0)) (dash (2 12 1))) "Escape/Unescape unicode notations" single]) (unicode-enbox . [(20140508 1341) ((string-utils (0 3 2)) (ucs-utils (0 7 6)) (list-utils (0 4 2)) (persistent-soft (0 8 8)) (pcache (0 2 3))) "Surround a string with box-drawing characters" single]) (unicode-emoticons . [(20150204 308) nil "Shortcuts for common unicode emoticons" single]) (unfill . [(20170722 1846) nil "Unfill paragraphs or regions, and toggle between filled & unfilled" single]) (undohist . [(20150315 542) ((cl-lib (1 0))) "Persistent undo history for GNU Emacs" single]) (underwater-theme . [(20131117 1602) nil "A gentle, deep blue color theme" single]) (underline-with-char . [(20170814 223) ((emacs (24))) "Underline with a char" single]) (undercover . [(20180403 752) ((emacs (24)) (dash (2 0 0)) (shut-up (0 3 2))) "Test coverage library for Emacs Lisp" single]) (uncrustify-mode . [(20130707 659) nil "Minor mode to automatically uncrustify." single]) (ukrainian-holidays . [(20130720 649) nil "Ukrainian holidays for Emacs calendar." single]) (ujelly-theme . [(20180214 824) nil "Ujelly theme for GNU Emacs 24 (deftheme)" single]) (uimage . [(20160901 521) nil "An iimage like mode with the ability to display url images" single]) (ucs-utils . [(20150826 714) ((persistent-soft (0 8 8)) (pcache (0 2 3)) (list-utils (0 4 2))) "Utilities for Unicode characters" tar]) (ubuntu-theme . [(20150805 806) nil "A theme inspired by the default terminal colors in Ubuntu" single]) (typoscript-mode . [(20170126 112) ((emacs (24 4)) (use-package (0))) "mode for TypoScript files" single]) (typo . [(20171209 223) nil "Minor mode for typographic editing" single]) (typit . [(20180317 107) ((emacs (24 4)) (f (0 18)) (mmt (0 1 1))) "Typing game similar to tests on 10 fast fingers" tar]) (typing-game . [(20160426 520) nil "a simple typing game" single]) (typing . [(20171115 2331) nil "The Typing Of Emacs" single]) (typescript-mode . [(20180708 1003) nil "Major mode for editing typescript" single]) (typed-clojure-mode . [(20151003 1122) ((clojure-mode (2 1 1)) (cider (0 10 0 -4))) "Typed Clojure minor mode for Emacs" tar]) (twittering-mode . [(20180507 721) nil "Major mode for Twitter" single]) (twilight-theme . [(20120412 603) nil "Twilight theme for GNU Emacs 24 (deftheme)" single]) (twilight-bright-theme . [(20130605 143) nil "A Emacs 24 faces port of the TextMate theme" single]) (twilight-anti-bright-theme . [(20160622 148) nil "A soothing Emacs 24 light-on-dark theme" single]) (twig-mode . [(20130220 1050) nil "A major mode for twig" single]) (turnip . [(20150308 2329) ((dash (2 6 0)) (s (1 9 0))) "Interacting with tmux from Emacs" single]) (turkish . [(20170910 811) nil "Convert to Turkish characters on-the-fly" single]) (turing-machine . [(20180221 2038) ((emacs (24 4))) "Single-tape Turing machine simulator" single]) (tup-mode . [(20140410 914) nil "Major mode for editing files for Tup" single]) (tumblesocks . [(20140215 1247) ((htmlize (1 39)) (oauth (1 0 3)) (markdown-mode (1 8 1))) "An Emacs tumblr client." tar]) (tumble . [(20160111 2329) ((http-post-simple (0)) (cl-lib (0 5))) "an Tumblr mode for Emacs" single]) (tuareg . [(20180512 1306) ((caml (3 12 0 1))) "OCaml mode for Emacs." tar]) (ttl-mode . [(20160505 132) nil "mode for Turtle (and Notation 3)" single]) (tt-mode . [(20130804 410) nil "Emacs major mode for editing Template Toolkit files." single]) (tss . [(20150913 708) ((auto-complete (1 4 0)) (json-mode (1 1 0)) (log4e (0 2 0)) (yaxception (0 1))) "provide a interface for auto-complete.el/flymake.el on typescript-mode." tar]) (ts-comint . [(20171105 2247) nil "Run a Typescript interpreter in an inferior process window." single]) (try . [(20170226 805) ((emacs (24))) "Try out Emacs packages." single]) (truthy . [(20140508 1341) ((list-utils (0 4 2))) "Test the content of a value" single]) (trr . [(20170221 42) nil "a type-writing training program on GNU Emacs." tar]) (trident-mode . [(20130726 1207) ((emacs (24)) (slime (20130526)) (skewer-mode (1 5 0)) (dash (1 0 3))) "Live Parenscript interaction" single]) (treepy . [(20180722 538) ((emacs (25 1))) "Generic tree traversal tools" single]) (treemacs-projectile . [(20180614 1021) ((projectile (0 14 0)) (treemacs (0))) "Projectile integration for treemacs" single]) (treemacs-evil . [(20180622 426) ((evil (1 2 12)) (treemacs (0))) "Evil mode integration for treemacs" single]) (treemacs . [(20180722 503) ((emacs (25 2)) (cl-lib (0 5)) (dash (2 11 0)) (s (1 10 0)) (f (0 11 0)) (ace-window (0 9 0)) (pfuture (1 2)) (hydra (0 13 2)) (ht (2 2))) "A tree style file explorer package" tar]) (tree-mode . [(20151104 531) nil "A mode to manage tree widgets" single]) (travis . [(20150825 438) ((s (1 9 0)) (dash (2 9 0)) (pkg-info (0 5 0)) (request (0 1 0))) "Emacs client for Travis" tar]) (transpose-mark . [(20150405 16) nil "Transpose data using the Emacs mark" single]) (transpose-frame . [(20151126 626) nil "Transpose windows arrangement in a frame" single]) (transmission . [(20180610 1653) ((emacs (24 4)) (let-alist (1 0 5))) "Interface to a Transmission session" single]) (transfer-sh . [(20180603 731) ((async (1 0))) "Simple interface for sending buffer contents to transfer.sh" single]) (tramp-term . [(20180223 727) nil "Automatic setup of directory tracking in ssh sessions." single]) (tramp-hdfs . [(20170821 620) ((emacs (24 4))) "Tramp extension to access hadoop/hdfs file system in Emacs" single]) (tracwiki-mode . [(20150119 821) ((xml-rpc (1 6 8))) "Emacs Major mode for working with Trac" single]) (tracking . [(20171210 1302) nil "Buffer modification tracking" tar]) (traad . [(20180720 512) ((dash (2 13 0)) (deferred (0 3 2)) (popup (0 5 0)) (request (0 2 0)) (request-deferred (0 2 0)) (virtualenvwrapper (20151123)) (f (0 20 0))) "emacs interface to the traad refactoring server." single]) (tql-mode . [(20170723 1954) ((emacs (24))) "TQL mode" single]) (toxi-theme . [(20160424 1426) ((emacs (24))) "A dark color theme by toxi" single]) (tox . [(20160810 855) nil "Launch current python test with tox" single]) (totd . [(20150519 740) ((s (1 9 0)) (cl-lib (0 5))) "Display a random daily emacs command." single]) (total-lines . [(20171227 439) ((emacs (24 3))) "Keep track of a buffer's total number of lines" single]) (tornado-template-mode . [(20141128 208) nil "A major mode for editing tornado templates" single]) (tommyh-theme . [(20131004 1630) nil "A bright, bold-colored theme for emacs" single]) (toml-mode . [(20161107 1000) ((emacs (24)) (cl-lib (0 5))) "Major mode for editing TOML files" single]) (toml . [(20130903 555) nil "TOML (Tom's Obvious, Minimal Language) parser" single]) (tomatinho . [(20180621 1048) nil "Simple and beautiful pomodoro timer" tar]) (toggle-window . [(20141207 748) nil "toggle current window size between half and full" single]) (toggle-test . [(20140722 2237) nil "Toggle between source and test files in various programming languages" single]) (toggle-quotes . [(20140710 226) nil "Toggle between single and double quoted string" single]) (toggle . [(20180315 1703) ((cl-lib (0 5))) "quickly open corresponding file (eg test vs impl)." single]) (togetherly . [(20170425 2316) ((cl-lib (0 3))) "allow multiple clients to edit a single buffer online" single]) (todotxt-mode . [(20150424 704) nil "Major mode for editing todo.txt files" single]) (todotxt . [(20180626 1530) nil "A major mode for editing todo.txt files" single]) (toc-org . [(20180613 840) nil "add table of contents to org-mode files (formerly, org-toc)" single]) (tmmofl . [(20121025 401) nil "Calls functions dependant on font lock highlighting at point" single]) (tldr . [(20180122 312) ((emacs (24 3))) "tldr client for Emacs" single]) (tj3-mode . [(20180519 528) nil "major mode for editing TaskJuggler 3 files" single]) (tinysegmenter . [(20141124 213) ((cl-lib (0 5))) "Super compact Japanese tokenizer in Javascript ported to emacs lisp" single]) (tiny-menu . [(20161213 435) ((emacs (24 4))) "Display tiny menus." single]) (tiny . [(20170903 249) nil "Quickly generate linear ranges in Emacs" single]) (tinkerer . [(20170906 524) ((s (1 2 0))) "Elisp wrapper for Tinkerer Blogging Engine." single]) (timp . [(20160618 103) ((emacs (24 4)) (cl-lib (0 5)) (fifo-class (1 0)) (signal (1 0))) "Multithreading library" tar]) (timonier . [(20170411 100) ((emacs (24 4)) (s (1 11 0)) (f (0 19 0)) (dash (2 12 0)) (pkg-info (0 5 0)) (hydra (0 13 6)) (request (0 2 0)) (all-the-icons (2 0 0))) "Manage Kubernetes Applications" tar]) (timesheet . [(20160530 1445) ((s (1)) (org (7)) (auctex (11))) "Timesheet management add-on for org-mode" tar]) (timer-revert . [(20150122 1232) nil "minor mode to revert buffer for a given time interval." tar]) (timecop . [(20160520 352) ((cl-lib (0 5)) (datetime-format (0 0 1))) "Freeze Time for testing" single]) (time-ext . [(20170126 415) nil "more function for time/date" single]) (tile . [(20161224 1957) ((emacs (25 1)) (s (1 9 0)) (dash (2 12 0)) (stream (2 2 3))) "Tile windows with layouts" single]) (tide . [(20180713 30) ((dash (2 10 0)) (s (1 11 0)) (flycheck (27)) (typescript-mode (0 1)) (cl-lib (0 5))) "Typescript Interactive Development Environment" tar]) (tidal . [(20180410 1245) ((haskell-mode (16)) (emacs (24))) "Interact with TidalCycles for live coding patterns" single]) (tickscript-mode . [(20171218 1803) ((emacs (24 1))) "A major mode for Tickscript files" single]) (thumb-through . [(20120118 2134) nil "Plain text reader of HTML documents" single]) (thrift . [(20140312 1348) nil "Major mode for Apache Thrift files" single]) (threes . [(20160820 542) ((emacs (24)) (seq (1 11))) "A clone of Threes (a tiny puzzle game)" single]) (thread-dump . [(20170816 1150) nil "Java thread dump viewer" single]) (thinks . [(20170802 428) ((cl-lib (0 5))) "Insert text in a think bubble." single]) (thingopt . [(20160520 1618) nil "Thing at Point optional utilities" single]) (therapy . [(20151113 1153) ((emacs (24))) "Hooks for managing multiple Python major versions" single]) (theme-looper . [(20170425 606) ((cl-lib (0 5))) "Loop thru the available color-themes" single]) (theme-changer . [(20171221 1127) nil "Sunrise/Sunset Theme Changer for Emacs" single]) (tfsmacs . [(20180723 1659) ((emacs (25)) (tablist (0 70))) "MS TFS source control interaction." single]) (tf2-conf-mode . [(20161209 820) nil "TF2 Configuration files syntax highlighting" single]) (textx-mode . [(20170516 211) ((emacs (24 3))) "Major mode for editing TextX files" single]) (textmate-to-yas . [(20160409 1008) nil "Import Textmate macros into yasnippet syntax" tar]) (textmate . [(20110816 1446) nil "TextMate minor mode for Emacs" single]) (textile-mode . [(20170304 916) nil "Textile markup editing major mode" single]) (texfrag . [(20180318 1647) ((emacs (25)) (auctex (11 90 2))) "preview LaTeX fragments in alien major modes" single]) (tex-smart-umlauts . [(20160427 58) nil "Smart umlaut conversion for TeX." single]) (test-simple . [(20170527 832) ((cl-lib (0))) "Simple Unit Test Framework for Emacs Lisp" single]) (test-kitchen . [(20171129 1235) nil "Run test-kitchen inside of emacs" single]) (test-case-mode . [(20130525 734) ((fringe-helper (0 1 1))) "unit test front-end" single]) (test-c . [(20180423 1020) ((emacs (24 3))) "quickly test c code" single]) (terraform-mode . [(20170111 2117) ((emacs (24 3)) (hcl-mode (0 3))) "Major mode for terraform configuration file" single]) (tern-django . [(20160221 1123) ((emacs (24)) (tern (0 0 1)) (f (0 17 1))) "Create tern projects for django applications." tar]) (tern-context-coloring . [(20161217 2347) ((emacs (24 3)) (context-coloring (8 1 0)) (tern (0 0 1))) "Use Tern for context coloring" single]) (tern-auto-complete . [(20170521 1235) ((tern (0 0 1)) (auto-complete (1 4)) (cl-lib (0 5)) (emacs (24))) "Tern Completion by auto-complete.el" single]) (tern . [(20170925 1333) ((json (1 2)) (cl-lib (0 5)) (emacs (24))) "Tern-powered JavaScript integration" single]) (terminal-here . [(20180513 133) ((emacs (24)) (cl-lib (0 5))) "Run an external terminal in current directory" single]) (termbright-theme . [(20151030 1935) ((emacs (24 1))) "a more usable theme for white-on-black terminals" single]) (term-run . [(20151228 105) nil "Run arbitrary command in terminal buffer" single]) (term-projectile . [(20170421 105) ((emacs (24)) (term-manager (0 1 0)) (projectile (0 13 0))) "projectile terminal management" single]) (term-manager . [(20171020 141) ((dash (2 12 0)) (emacs (24 4))) "Contextual terminal management" tar]) (term-cmd . [(20160517 345) ((emacs (24 0)) (dash (2 12 0)) (f (0 18 2))) "Send commands from programs running in term.el." tar]) (term-alert . [(20161119 145) ((emacs (24 0)) (term-cmd (1 1)) (alert (1 1)) (f (0 18 2))) "Notifications when commands complete in term.el." tar]) (term+mux . [(20140210 2349) ((term+ (0 1)) (tab-group (0 1))) "term+ terminal multiplexer and session management" single]) (term+key-intercept . [(20140210 2350) ((term+ (0 1)) (key-intercept (0 1))) "term+ intercept key mapping" single]) (term+ . [(20170508 1717) ((emacs (24)) (cl-lib (0 5))) "term-mode enhancement" tar]) (ten-hundred-mode . [(20161028 1536) ((cl-lib (0 5))) "use only the ten hundred most usual words" tar]) (temporary-persistent . [(20161210 333) ((emacs (24 3)) (names (20151201 0)) (dash (2 12 1)) (s (1 10 0))) "Keep temp notes buffers persistent -*- lexical-binding: t" single]) (template-overlays . [(20180706 432) ((emacs (24 4)) (ov (1 0 6))) "Display template regions using overlays" single]) (telephone-line . [(20180601 1943) ((emacs (24 4)) (cl-lib (0 5)) (cl-generic (0 2)) (seq (1 8))) "Rewrite of Powerline" tar]) (telepathy . [(20131209 458) nil "Access Telepathy from Emacs" single]) (tea-time . [(20120331 120) nil "Simple timer package, useful to make perfect tea." single]) (tdd-status-mode-line . [(20131123 916) nil "TDD status on the mode-line" single]) (tco . [(20160810 1712) ((dash (1 2 0)) (emacs (24))) "tail-call optimisation for Emacs lisp" single]) (tc . [(20180715 6) nil "a Japanese input method with T-Code on Emacs" tar]) (tbx2org . [(20140224 759) ((dash (2 5 0)) (s (1 8 0)) (cl-lib (0 4))) "Tinderbox to org-mode conversion" single]) (tblui . [(20161007 1212) ((dash (2 12 1)) (magit-popup (2 6 0)) (tablist (0 70)) (cl-lib (0 5))) "Define tabulated list UI easily" single]) (tawny-mode . [(20170422 1502) ((cider (0 12)) (emacs (25))) "Ontology Editing with Tawny-OWL" single]) (taskpaper-mode . [(20180710 158) nil "Major mode for working with TaskPaper files" tar]) (tao-theme . [(20171221 1001) nil "This package provides two parametrized uncoloured color themes for Emacs: tao-yin and tao-yang." tar]) (tangotango-theme . [(20170924 809) nil "Tango Palette color theme for Emacs 24." single]) (tango-plus-theme . [(20170214 908) nil "A color theme based on the tango palette" single]) (tango-2-theme . [(20120312 1325) nil "Tango 2 color theme for GNU Emacs 24" single]) (take-off . [(20140531 217) ((emacs (24 3)) (web-server (0 1 0))) "Emacs remote web access" tar]) (tagedit . [(20161121 55) ((s (1 3 1)) (dash (1 0 3))) "Some paredit-like features for html-mode" single]) (tabula-rasa . [(20141215 2147) ((emacs (24 4))) "Distraction free writing mode" single]) (tablist . [(20170219 1935) ((emacs (24 3))) "Extended tabulated-list-mode" tar]) (tabbar-ruler . [(20160801 2007) ((tabbar (2 0 1)) (powerline (2 3)) (mode-icons (0 4 0)) (cl-lib (0 5))) "Pretty tabbar, autohide, use both tabbar/ruler" tar]) (tabbar . [(20160524 1401) nil "Display a tab bar in the header line" tar]) (tab-jump-out . [(20151005 1830) ((dash (2 10)) (emacs (24 4))) "Use tab to jump out of delimiter pairs." single]) (tab-group . [(20140306 650) nil "Grouped tabs and their tabbar" single]) (ta . [(20160619 945) ((emacs (24 3)) (cl-lib (0 5))) "A tool to deal with Chinese homophonic characters" single]) (systemtap-mode . [(20151122 1140) nil "A mode for SystemTap" single]) (systemd . [(20180629 1406) ((emacs (24 4))) "Major mode for editing systemd units" tar]) (system-specific-settings . [(20140818 757) nil "Apply settings only on certain systems" single]) (system-packages . [(20180516 1450) ((emacs (24 3))) "functions to manage system packages" single]) (syntax-subword . [(20160519 1205) nil "make operations on words more fine-grained" single]) (syntactic-sugar . [(20140508 1341) nil "Effect-free forms such as if/then/else" single]) (syntactic-close . [(20180722 935) ((emacs (24)) (cl-lib (0 5))) "Insert closing delimiter" single]) (synquid . [(20160930 850) ((flycheck (27)) (emacs (24 3))) "Major mode for editing Synquid files" single]) (synosaurus . [(20180125 1034) ((cl-lib (0 5))) "An extensible thesaurus supporting lookup and substitution." tar]) (synonymous . [(20180325 1117) ((emacs (24)) (cl-lib (0 5)) (request (0 2 0))) "A thesaurus at your fingertips" single]) (syndicate . [(20160603 823) ((evil (1 0))) "evil keybindings for org-mode" single]) (sync-recentf . [(20160326 1301) nil "Synchronize the recent files list between Emacs instances" single]) (symon-lingr . [(20150719 642) ((symon (1 1 2)) (cl-lib (0 5))) "A notification-based Lingr client powered by symon.el" single]) (symon . [(20170224 33) nil "tiny graphical system monitor" single]) (symbolword-mode . [(20180401 727) ((emacs (24)) (f (0 19 0))) "modify word split" single]) (symbol-overlay . [(20180412 339) ((emacs (24 3))) "Highlight symbols with keymap-enabled overlays" single]) (sx . [(20180606 36) ((emacs (24 1)) (cl-lib (0 5)) (json (1 3)) (markdown-mode (2 0)) (let-alist (1 0 3))) "StackExchange client. Ask and answer questions on Stack Overflow, Super User, and the likes" tar]) (sws-mode . [(20150317 1245) nil "(S)ignificant (W)hite(S)pace mode" single]) (swoop . [(20160120 915) ((ht (2 0)) (pcre2el (1 5)) (async (1 1)) (emacs (24))) "Peculiar buffer navigation for Emacs" tar]) (switch-window . [(20180623 1115) ((emacs (24))) "A *visual* way to switch window" tar]) (switch-buffer-functions . [(20171011 1004) nil "Hook run when current buffer changed" single]) (swiper-helm . [(20180131 944) ((emacs (24 1)) (swiper (0 1 0)) (helm (1 5 3))) "Helm version of Swiper." single]) (swiper . [(20180713 946) ((emacs (24 1)) (ivy (0 9 0))) "Isearch with an overview. Oh, man!" single]) (swift3-mode . [(20160918 550) ((emacs (24 4))) "Major-mode for Apple's Swift programming language." tar]) (swift-mode . [(20180721 35) ((emacs (24 4)) (seq (2 3))) "Major-mode for Apple's Swift programming language." tar]) (sweetgreen . [(20180604 2035) ((dash (2 12 1)) (helm (1 5 6)) (request (0 2 0)) (cl-lib (0 5))) "Order Salads from sweetgreen.com" single]) (swap-regions . [(20180116 253) ((emacs (24 3))) "Swap text in two regions" single]) (swap-buffers . [(20150506 1439) nil "The quickest way to swap buffers between windows. Based on switch-window package." single]) (swagger-to-org . [(20160610 1756) ((emacs (24)) (cl-lib (0 5)) (json (1 4))) "Convert a swagger.json file into an org-mode file" single]) (svnwrapper . [(20180414 1143) ((e2ansi (0 1 1))) "Highlighting and paging for shell command `svn'" tar]) (svg-mode-line-themes . [(20150425 1306) ((xmlgen (0 4))) "SVG-based themes for mode-line" tar]) (suscolors-theme . [(20161109 1215) nil "Colorful theme, inspired by Gruvbox." single]) (supergenpass . [(20130328 2248) nil "SuperGenPass for Emacs" single]) (super-save . [(20171008 3) ((emacs (24 4))) "Auto-save buffers, based on your activity." single]) (suomalainen-kalenteri . [(20170801 126) nil "Finnish national and Christian holidays for calendar" tar]) (sunshine . [(20180325 548) ((cl-lib (0 5))) "Provide weather and forecast information." single]) (sunny-day-theme . [(20140413 1425) nil "Emacs24 theme with a light background." single]) (sunburn-theme . [(20180602 1229) ((emacs (24))) "A low contrast color theme" single]) (suggestion-box . [(20170830 107) ((emacs (25 1)) (popup (0 5 3))) "show tooltip on the cursor" single]) (suggest . [(20180722 350) ((emacs (24 4)) (loop (1 3)) (dash (2 13 0)) (s (1 11 0)) (f (0 18 2)) (spinner (1 7 3))) "suggest elisp functions that give the output requested" tar]) (sudoku . [(20161110 2306) ((emacs (24 4))) "Simple sudoku game, can download puzzles" single]) (sudo-ext . [(20170126 414) nil "sudo support" single]) (sudo-edit . [(20180608 911) ((emacs (24)) (cl-lib (0 5))) "Open files as another user" single]) (sudden-death . [(20180216 1623) nil "Totsuzen-no-Shi" single]) (sublimity . [(20170820 827) ((cl-lib (0 3))) "smooth-scrolling, minimap and distraction-free mode" tar]) (sublime-themes . [(20170606 1144) nil "A collection of themes based on Sublime Text" tar]) (subemacs . [(20170401 234) nil "Evaluating expressions in a fresh Emacs subprocess" single]) (subatomic256-theme . [(20130620 1910) nil "Fork of subatomic-theme for terminals." single]) (subatomic-theme . [(20160126 738) nil "Low contrast bluish color theme" single]) (stylus-mode . [(20150313 812) ((sws-mode (0))) "Major mode for editing .jade files" single]) (stylefmt . [(20161025 124) nil "Stylefmt interface" single]) (stupid-indent-mode . [(20170525 417) nil "Plain stupid indentation minor mode" single]) (stumpwm-mode . [(20140130 1816) nil "special lisp mode for evaluating code into running stumpwm" single]) (stripe-buffer . [(20141208 708) ((cl-lib (1 0))) "Use a different background for even and odd lines" single]) (string-utils . [(20140508 1341) ((list-utils (0 4 2))) "String-manipulation utilities" single]) (string-inflection . [(20180722 2141) nil "underscore -> UPCASE -> CamelCase -> lowerCamelCase conversion of names" single]) (string-edit . [(20160410 2356) ((dash (1 2 0))) "Avoid escape nightmares by editing string in separate buffer" single]) (strie . [(20160211 1422) ((cl-lib (0 5))) "A simple trie data structure implementation" single]) (strace-mode . [(20171116 1239) nil "strace output syntax highlighting" single]) (stock-ticker . [(20150204 252) ((s (1 9 0)) (request (0 2 0))) "Show stock prices in mode line" single]) (stickyfunc-enhance . [(20150429 1114) ((emacs (24 3))) "An enhancement to stock `semantic-stickyfunc-mode'" single]) (sticky . [(20170925 1736) nil "Sticky key for capital letters" single]) (stgit . [(20171130 759) nil "major mode for StGit interaction" single]) (stem-english . [(20180108 1958) ((emacs (24 3))) "- routines for stemming English word" single]) (stem . [(20131102 409) nil "Routines for stemming" single]) (steam . [(20171108 1613) ((cl-lib (0 5))) "Organize and launch Steam games" single]) (status . [(20151230 608) nil "This package adds support for status icons to Emacs." tar]) (state . [(20180627 1256) ((emacs (24))) "Quick navigation between workspaces" single]) (stash . [(20151117 627) nil "lightweight persistent caching" single]) (start-menu . [(20160426 525) ((cl-lib (0 5)) (config-parser (0 1))) "start-menu for executing external program like in windows" single]) (standoff-mode . [(20171115 931) nil "Create stand-off markup, also called external markup." tar]) (stan-snippets . [(20161023 1958) ((stan-mode (9 2 0)) (yasnippet (0 8 0))) "Yasnippets for Stan" tar]) (stan-mode . [(20180110 1441) nil "Major mode for editing Stan files" tar]) (stack-mode . [(20150923 823) ((haskell-mode (13 14)) (cl-lib (0 5)) (flycheck (0 23))) "A minor mode enabling various features based on stack-ide." tar]) (ssh-tunnels . [(20180703 1327) ((cl-lib (0 5)) (emacs (24))) "Manage SSH tunnels" single]) (ssh-deploy . [(20180713 650) ((emacs (24))) "Deployment via TRAMP, global or per directory." tar]) (ssh-config-mode . [(20180609 251) nil "Mode for fontification of ~/.ssh/config" tar]) (ssh-agency . [(20180507 1726) ((emacs (24 4)) (dash (2 10 0))) "manage ssh-agent from Emacs" single]) (ssh . [(20120904 1342) nil "Support for remote logins using ssh." single]) (ssass-mode . [(20180428 1339) ((emacs (24 3))) "Edit Sass without a Turing Machine" single]) (srefactor . [(20180703 1110) ((emacs (24 4))) "A refactoring tool based on Semantic parser framework" tar]) (srcery-theme . [(20180623 619) ((emacs (24))) "Dark color theme." single]) (sr-speedbar . [(20161025 131) nil "Same frame speedbar" single]) (sqlup-mode . [(20170610 837) nil "Upcase SQL words for you" single]) (sqlite . [(20180708 1011) nil "use sqlite via elisp" single]) (sql-indent . [(20170112 1507) nil "indentation of SQL statements" single]) (sql-impala . [(20160427 1658) nil "comint support for Cloudera Impala" single]) (sql-clickhouse . [(20180302 755) ((emacs (24))) "support ClickHouse as SQL interpreter" single]) (spu . [(20161213 1924) ((emacs (24 4)) (signal (1 0)) (timp (1 2 0))) "Silently upgrade package in the background" tar]) (sprunge . [(20160229 1843) ((request (0 2 0)) (cl-lib (0 5))) "Upload pastes to sprunge.us" single]) (sproto-mode . [(20151115 1005) nil "Major mode for editing sproto." single]) (sprintly-mode . [(20121005 2234) ((furl (0 0 2))) "Major mode for dealing with sprint.ly" single]) (springboard . [(20170105 2355) ((helm (1 6 9))) "Temporarily change default-directory for one command" single]) (spray . [(20160304 1420) nil "a speed reading mode" single]) (spotlight . [(20150929 55) ((emacs (24 1)) (swiper (0 6 0)) (counsel (0 6 0))) "search files with Mac OS X spotlight" single]) (spotify . [(20170302 2229) ((cl-lib (0 5))) "Control the spotify application from emacs" single]) (splitter . [(20170809 1508) nil "Manage window splits" single]) (splitjoin . [(20150505 732) ((cl-lib (0 5))) "Transition between multiline and single-line code" single]) (spiral . [(20180223 340) ((emacs (25 1)) (a (0 1 0 -3 4)) (avy (0 4 0)) (clojure-mode (5 6 0)) (highlight (0)) (treepy (1 0 0))) "Clojure IDE based on UNREPL" tar]) (spice-mode . [(20171027 2343) ((emacs (24 3))) "Major mode for SPICE" single]) (sphinx-mode . [(20180620 215) ((f (0 20 0)) (dash (2 14 1))) "Minor mode providing sphinx support." tar]) (sphinx-frontend . [(20161025 58) nil "Launch build process for rst documents via sphinx." single]) (sphinx-doc . [(20160116 317) ((s (1 9 0)) (cl-lib (0 5)) (dash (2 10 0))) "Sphinx friendly docstrings for Python functions" single]) (speeddating . [(20180319 23) ((emacs (25))) "Increase date and time at point" single]) (speed-type . [(20171230 847) ((emacs (24 3)) (cl-lib (0 3))) "Practice touch and speed typing" single]) (speechd-el . [(20180105 1217) nil "Client to speech synthesizers and Braille displays." tar]) (speech-tagger . [(20170728 1129) ((cl-lib (0 5))) "tag parts of speech using coreNLP" tar]) (sparql-mode . [(20180320 1102) ((cl-lib (0 5)) (emacs (24 3))) "Edit and interactively evaluate SPARQL queries." tar]) (sparkline . [(20150101 519) ((cl-lib (0 3))) "Make sparkline images from a list of numbers" single]) (spark . [(20160414 1901) ((emacs (24 3))) "sparkline generation" single]) (spaces . [(20170809 1508) nil "Create and switch between named window configurations." single]) (spacemacs-theme . [(20180618 1129) nil "Color theme with a dark and light versions" tar]) (spaceline-all-the-icons . [(20170829 120) ((emacs (24 4)) (all-the-icons (2 6 0)) (spaceline (2 0 0)) (memoize (1 0 1))) "A Spaceline theme using All The Icons" tar]) (spaceline . [(20180628 46) ((emacs (24 4)) (cl-lib (0 5)) (powerline (2 3)) (dash (2 11 0)) (s (1 10 0))) "Modeline configuration library for powerline" tar]) (spacegray-theme . [(20150719 1231) ((emacs (24 1))) "A Hyperminimal UI Theme" single]) (sourcetrail . [(20170410 1437) ((emacs (24 4))) "Communication with Sourcetrail" single]) (sourcerer-theme . [(20161014 925) nil "A version of sourcerer by xero" single]) (sourcemap . [(20161215 2140) ((emacs (24 3))) "Sourcemap parser" single]) (sourcekit . [(20180101 34) ((emacs (24 3)) (dash (2 12 1)) (dash-functional (1 2 0)) (request (0 2 0))) "Library to interact with sourcekittendaemon" single]) (soundklaus . [(20160314 531) ((dash (2 12 1)) (emacs (24)) (emms (4 0)) (s (1 11 0)) (pkg-info (0 4)) (cl-lib (0 5)) (request (0 2 0))) "Play music on SoundCloud with Emacs via EMMS" tar]) (soundcloud . [(20150501 2026) ((emms (20131016)) (json (1 2)) (deferred (0 3 1)) (string-utils (0 3 2)) (request (20140316 417)) (request-deferred (20130526 1015))) "a SoundCloud client for Emacs" single]) (sound-wav . [(20160725 724) ((deferred (0 3 1)) (cl-lib (0 5))) "Play wav file" single]) (sotlisp . [(20180706 1049) ((emacs (24 1))) "Write lisp at the speed of thought." single]) (sotclojure . [(20170921 1708) ((emacs (24 1)) (clojure-mode (4 0 0)) (cider (0 8)) (sotlisp (1 3))) "Write clojure at the speed of thought." tar]) (sos . [(20141214 2003) ((org (7))) "StackOverflow Search" single]) (sort-words . [(20160929 635) nil "Sort words in a selected region" single]) (soothe-theme . [(20141027 741) ((emacs (24 1))) "a dark colorful theme for Emacs24." single]) (sonic-pi . [(20171205 405) ((cl-lib (0 5)) (osc (0 1)) (dash (2 2 0)) (emacs (24)) (highlight (0))) "A Emacs client for SonicPi" tar]) (solidity-mode . [(20180721 1614) nil "Major mode for ethereum's solidity language" tar]) (solarized-theme . [(20180621 1407) ((emacs (24 1)) (cl-lib (0 5)) (dash (2 6 0))) "The Solarized color theme, ported to Emacs." tar]) (solaire-mode . [(20180521 235) ((emacs (24 4)) (cl-lib (0 5))) "make certain buffers grossly incandescent" single]) (soft-stone-theme . [(20140614 135) ((emacs (24))) "Emacs 24 theme with a light background." single]) (soft-morning-theme . [(20150918 1341) nil "Emacs24 theme with a light background." single]) (soft-charcoal-theme . [(20140420 943) nil "Dark charcoal theme with soft colors" single]) (socyl . [(20170211 2242) ((s (1 11 0)) (dash (2 12 0)) (pkg-info (0 5 0)) (cl-lib (0 5))) "Frontend for several search tools" tar]) (snoopy . [(20171008 1304) ((emacs (24)) (cl-lib (0 6))) "minor mode for number row unshifted character insertion" single]) (snippet . [(20130210 1515) nil "Insert snippets of text into a buffer" single]) (snazzy-theme . [(20170823 1132) ((emacs (24)) (base16-theme (2 1))) "An elegant syntax theme with bright colors" single]) (snapshot-timemachine-rsnapshot . [(20170324 513) ((snapshot-timemachine (20160222 132)) (seq (2 19))) "rsnapshot backend for snapshot-timemachine" single]) (snapshot-timemachine . [(20161221 129) ((emacs (24 4))) "Step through (Btrfs, ZFS, ...) snapshots of files" single]) (snakemake-mode . [(20180519 1739) ((emacs (24)) (cl-lib (0 5)) (magit-popup (2 4 0))) "Major mode for editing Snakemake files" tar]) (smyx-theme . [(20141127 28) nil "smyx Color Theme" single]) (smtpmail-multi . [(20160218 1549) nil "Use different smtp servers for sending mail" single]) (smotitah . [(20150218 230) nil "Modular emacs configuration framework" tar]) (smooth-scrolling . [(20161002 1249) nil "Make emacs scroll smoothly" single]) (smooth-scroll . [(20130321 2114) nil "Minor mode for smooth scrolling and in-place scrolling." single]) (smmry . [(20161024 201) nil "SMMRY client" single]) (sml-modeline . [(20170614 1411) nil "Show position in a scrollbar like way in mode-line" single]) (smiles-mode . [(20160717 420) nil "Major mode for SMILES." single]) (smex . [(20151212 1409) ((emacs (24))) "M-x interface with Ido-style fuzzy matching." single]) (smeargle . [(20161212 1558) ((emacs (24 3))) "Highlighting region by last updated time" single]) (smblog . [(20170419 321) ((emacs (24 3))) "samba log viewer" single]) (smbc . [(20171229 1008) nil "View SMBC from Emacs" single]) (smarty-mode . [(20100703 458) nil "major mode for editing smarty templates" single]) (smartscan . [(20170211 1233) nil "Jumps between other symbols found at point" single]) (smartrep . [(20150508 1930) nil "Support sequential operation which omitted prefix keys." single]) (smartparens . [(20180717 335) ((dash (2 13 0)) (cl-lib (0 3))) "Automatic insertion, wrapping and paredit-like navigation with user defined pairs." tar]) (smart-window . [(20160716 1830) ((cl-lib (0 5))) "vim-like window controlling plugin" single]) (smart-tabs-mode . [(20160629 752) nil "Intelligently indent with tabs, align with spaces!" single]) (smart-tab . [(20170902 1407) nil "Intelligent tab completion and indentation." single]) (smart-shift . [(20150202 2325) nil "Smart shift text left/right." single]) (smart-semicolon . [(20171007 1833) ((emacs (25))) "Insert semicolon smartly" single]) (smart-region . [(20150903 703) ((emacs (24 4)) (expand-region (0 10 0)) (multiple-cursors (1 3 0)) (cl-lib (0 5))) "Smartly select region, rectangle, multi cursors" single]) (smart-newline . [(20131207 1940) nil "Provide smart newline for one keybind." single]) (smart-mode-line-powerline-theme . [(20160705 1738) ((emacs (24 3)) (powerline (2 2)) (smart-mode-line (2 5))) "smart-mode-line theme that mimics the powerline appearance." tar]) (smart-mode-line . [(20180422 1459) ((emacs (24 3)) (rich-minority (0 1 1))) "A color coded smart mode-line." tar]) (smart-mark . [(20150911 1910) nil "Restore point after C-g when mark" single]) (smart-jump . [(20180709 2205) ((emacs (25 1)) (dumb-jump (0 5 1))) "Smart go to definition." tar]) (smart-indent-rigidly . [(20141205 1615) nil "Smart rigid indenting" single]) (smart-hungry-delete . [(20170412 643) ((emacs (24 3))) "smart hungry deletion of whitespace" single]) (smart-forward . [(20140430 13) ((expand-region (0 8 0))) "Semantic navigation" single]) (smart-dash . [(20110130 1916) nil "Smart-Dash minor mode" single]) (smart-cursor-color . [(20141124 919) nil "Change cursor color dynamically" single]) (smart-compile . [(20180315 2030) nil "an interface to `compile'" single]) (smart-comment . [(20160322 1139) nil "smarter commenting" single]) (smart-backspace . [(20171013 2226) nil "intellj like backspace" single]) (sly-repl-ansi-color . [(20171020 816) ((sly (0)) (cl-lib (0 5))) "Add ANSI colors support to the sly mrepl." single]) (sly-quicklisp . [(20170112 135) ((sly (1 0 0 -2 2))) "Quicklisp support for SLY" tar]) (sly-named-readtables . [(20150817 816) ((sly (1 0 0 -2 2))) "Support named readtables in Common Lisp files" tar]) (sly-macrostep . [(20160119 434) ((sly (1 0 0 -2 2)) (macrostep (0 9))) "fancy macro-expansion via macrostep.el" tar]) (sly-hello-world . [(20160119 636) ((sly (1 0 0 -2 2))) "A template SLY contrib" tar]) (sly . [(20180722 1611) ((emacs (24 3))) "Sylvester the Cat's Common Lisp IDE" tar]) (slstats . [(20170823 149) ((cl-lib (0 5)) (emacs (24))) "Acquire and display stats about Second Life" single]) (slovak-holidays . [(20150418 155) nil "Adds a list of slovak holidays to Emacs calendar" single]) (slirm . [(20160201 625) ((emacs (24 4))) "Systematic Literature Review Mode for Emacs." single]) (slime-volleyball . [(20140717 2141) nil "An SVG Slime Volleyball Game" tar]) (slime-theme . [(20170808 622) ((emacs (24 0))) "an Emacs 24 theme based on Slime (tmTheme)" single]) (slime-docker . [(20171004 1151) ((emacs (24)) (slime (2 16)) (docker-tramp (0 1)) (cl-lib (0 5))) "Integration of SLIME with Docker containers." tar]) (slime-company . [(20180119 1043) ((emacs (24 4)) (slime (2 13)) (company (0 9 0))) "slime completion backend for company mode" single]) (slime . [(20180719 1821) ((cl-lib (0 5)) (macrostep (0 9))) "Superior Lisp Interaction Mode for Emacs" tar]) (slim-mode . [(20170728 648) nil "Major mode for editing Slim files" single]) (slideview . [(20150324 1540) ((cl-lib (0 3))) "File slideshow" single]) (slack . [(20180712 2222) ((websocket (1 8)) (request (0 2 0)) (oauth2 (0 10)) (circe (2 2)) (alert (1 2)) (emojify (0 2))) "Slack client for Emacs" tar]) (sl . [(20161217 604) ((cl-lib (0 5))) "An Emacs clone of sl(1)" tar]) (skype . [(20160711 124) nil "skype UI for emacs users.." tar]) (skewer-reload-stylesheets . [(20160725 520) ((skewer-mode (1 5 3))) "live-edit CSS, SCSS, Less, and friends." tar]) (skewer-mode . [(20180706 1107) ((simple-httpd (1 4 0)) (js2-mode (20090723)) (emacs (24))) "live browser JavaScript, CSS, and HTML interaction" tar]) (skewer-less . [(20160828 1321) ((skewer-mode (1 5 3))) "Skewer support for live LESS stylesheet updates" single]) (skeletor . [(20170616 1746) ((s (1 7 0)) (f (0 14 0)) (dash (2 2 0)) (cl-lib (0 3)) (let-alist (1 0 3)) (emacs (24 1))) "Provides project skeletons for Emacs" tar]) (simplezen . [(20130421 300) ((s (1 4 0)) (dash (1 1 0))) "A simple subset of zencoding-mode for Emacs." single]) (simplenote2 . [(20171201 1806) ((request-deferred (0 2 0))) "Interact with app.simplenote.com" tar]) (simplenote . [(20141118 640) nil "Interact with simple-note.appspot.com" single]) (simpleclip . [(20170803 540) nil "Simplified access to the system clipboard" single]) (simple-screen . [(20161009 220) nil "Simple screen configuration manager" single]) (simple-rtm . [(20160222 734) ((rtm (0 1)) (dash (2 0 0))) "Interactive Emacs mode for Remember The Milk" single]) (simple-paren . [(20180427 218) ((emacs (24)) (cl-lib (0 5))) "Insert paired delimiter, wrap" single]) (simple-mpc . [(20180715 1829) ((s (1 10 0))) "provides a simple interface to mpc" tar]) (simple-httpd . [(20180528 903) ((cl-lib (0 3))) "pure elisp HTTP server" single]) (simple-call-tree . [(20180224 1256) ((emacs (24 3)) (anaphora (1 0 0))) "analyze source code based on font-lock text-properties" single]) (simple-bookmarks . [(20160804 701) ((cl-lib (0 5))) "Bookmark / functioncall manager" tar]) (simp . [(20180606 1954) nil "Simple project definition, chiefly for file finding, and grepping" tar]) (silkworm-theme . [(20180301 637) ((emacs (24))) "Light theme with pleasant, low contrast colors." single]) (signature . [(20140730 1249) nil "Signature Survey" tar]) (signal . [(20160816 738) ((emacs (24)) (cl-lib (0 5))) "Advanced hook" single]) (sift . [(20160107 215) nil "Front-end for sift, a fast and powerful grep alternative" single]) (side-notes . [(20180523 2328) ((emacs (24 5))) "Easy access to a directory notes file" single]) (sicp . [(20171028 1523) nil "Structure and Interpretation of Computer Programs in info format" tar]) (sibilant-mode . [(20151119 1345) nil "Support for the Sibilant programming language" single]) (shx . [(20180528 1408) ((emacs (24 4))) "\"Extras\" for the (comint-mode) shell" single]) (shut-up . [(20180628 1130) ((cl-lib (0 3)) (emacs (24))) "Shut up would you!" single]) (shrink-whitespace . [(20150916 1215) nil "Whitespace removal DWIM key" single]) (shrink-path . [(20170812 1947) ((emacs (24)) (s (1 6 1)) (dash (1 8 0)) (f (0 10 0))) "fish-style path" single]) (shr-tag-pre-highlight . [(20171113 114) ((emacs (25 1)) (language-detection (0 1 0))) "Syntax highlighting code block in HTML" single]) (shpec-mode . [(20150530 222) nil "Minor mode for shpec specification" single]) (showtip . [(20090830 340) nil "Show tip at cursor" single]) (show-marks . [(20130805 749) ((fm (1 0))) "Navigate and visualize the mark-ring" single]) (show-css . [(20160210 608) ((doom (1 3)) (s (1 10 0))) "Show the css of the html attribute the cursor is on" tar]) (shoulda . [(20140616 1133) ((cl-lib (0 5))) "Shoulda test support for ruby" single]) (shm . [(20180326 1757) nil "Structured Haskell Mode" tar]) (shimbun . [(20180325 2048) nil "interfacing with web newspapers" tar]) (shift-text . [(20130831 955) ((cl-lib (1 0)) (es-lib (0 3))) "Move the region in 4 directions, in a way similar to Eclipse's" single]) (shift-number . [(20170301 659) nil "Increase/decrease the number at point" single]) (shen-elisp . [(20170427 1502) ((emacs (24 4))) "Shen implementation in Elisp" tar]) (shelltest-mode . [(20180430 1841) nil "Major mode for shelltestrunner" single]) (shelldoc . [(20151114 1925) ((cl-lib (0 3)) (s (1 9 0))) "shell command editing support with man page." single]) (shell-toggle . [(20150226 611) nil "Toggle to and from the shell buffer" single]) (shell-switcher . [(20161028 2252) ((emacs (24))) "Provide fast switching between shell buffers." tar]) (shell-split-string . [(20151224 208) nil "Split strings using shell-like syntax" single]) (shell-pop . [(20170304 616) ((emacs (24)) (cl-lib (0 5))) "helps you to use shell easily on Emacs. Only one key action to work." single]) (shell-history . [(20100505 139) nil "integration with shell history" single]) (shell-here . [(20150728 1004) nil "Open a shell relative to the working directory" single]) (shell-current-directory . [(20140101 1554) nil "create new shell based on buffer directory" single]) (shell-command . [(20090830 340) nil "enables tab-completion for `shell-command'" single]) (shampoo . [(20131230 219) nil "A remote Smalltalk development mode" tar]) (shakespeare-mode . [(20180704 1438) nil "A major mode for editing Shakespearean templates." single]) (shader-mode . [(20180518 457) ((emacs (24))) "Major mode for shader" single]) (shadchen . [(20141102 1039) nil "pattern matching for elisp" single]) (shackle . [(20171209 1401) ((cl-lib (0 5))) "Enforce rules for popups" single]) (sexy-monochrome-theme . [(20180526 108) nil "A sexy dark Emacs >= 24 theme for your sexy code" single]) (sexp-move . [(20150915 1030) nil "Improved S-Expression Movement" single]) (seti-theme . [(20161208 836) nil "A dark colored theme, inspired by Seti Atom Theme" single]) (session . [(20120510 1700) nil "use variables, registers and buffer places across sessions" single]) (sesman . [(20180719 213) ((emacs (25))) "Generic Session Manager" single]) (services . [(20170802 430) ((cl-lib (0 5))) "Services database access functions." single]) (serverspec . [(20150623 455) ((dash (2 6 0)) (s (1 9 0)) (f (0 16 2)) (helm (1 6 1))) "Serverspec minor mode" tar]) (servant . [(20140216 419) ((s (1 8 0)) (dash (2 2 0)) (f (0 11 0)) (ansi (0 3 0)) (commander (0 5 0)) (epl (0 2)) (shut-up (0 2 1)) (web-server (0 0 1))) "ELPA server written in Emacs Lisp" tar]) (sequential-command . [(20170925 1740) nil "Many commands into one command" tar]) (sequences . [(20170818 552) ((emacs (24))) "Ports of some Clojure sequence functions." single]) (seoul256-theme . [(20180505 57) ((emacs (24 3))) "Low-contrast color scheme based on Seoul Colors." single]) (sentence-navigation . [(20180408 919) ((ample-regexps (0 1)) (cl-lib (0 5)) (emacs (24 4))) "Commands to navigate one-spaced sentences." single]) (sensitive . [(20170818 551) ((emacs (24)) (sequences (0 1 0))) "A dead simple way to load sensitive information" single]) (sendto . [(20160425 550) ((emacs (24 4))) "send the region content to a function" single]) (semi . [(20180204 1448) ((flim (1 14 9))) "A library to provide MIME features." tar]) (selectric-mode . [(20170216 311) nil "IBM Selectric mode for Emacs" tar]) (selected . [(20170222 34) nil "Keymap for when region is active" single]) (select-themes . [(20160220 1706) nil "Color theme selection with completing-read" single]) (sekka . [(20170803 547) ((cl-lib (0 3)) (concurrent (0 3 1)) (popup (0 5 2))) "A client for Sekka IME server" single]) (seethru . [(20150218 1029) ((shadchen (1 4))) "Easily change Emacs' transparency" single]) (seeing-is-believing . [(20170214 520) nil "minor mode for running the seeing-is-believing ruby gem" single]) (see-mode . [(20180510 1741) ((emacs (24 4)) (language-detection (0 1 0))) "Edit string in a separate buffer" single]) (secretaria . [(20180104 720) ((emacs (24 4)) (alert (1 2)) (s (1 12)) (f (0 19 0))) "A personal assistant based on org-mode" tar]) (seclusion-mode . [(20121118 1553) nil "Edit in seclusion. A Dark Room mode." single]) (searchq . [(20150829 511) ((emacs (24 3))) "Framework of queued search tasks using GREP, ACK, AG and more." tar]) (search-web . [(20150312 403) nil "Post web search queries using `browse-url'." single]) (sdlang-mode . [(20161130 2311) ((emacs (24 3))) "Major mode for Simple Declarative Language files." single]) (sdcv . [(20180211 833) ((emacs (24 3)) (popup (0 5 3)) (showtip (0 1)) (pos-tip (0 4 6)) (cl-lib (0 3))) "Interface for sdcv (StartDict console version)." single]) (scss-mode . [(20180123 908) nil "Major mode for editing SCSS files" single]) (scrooge . [(20180630 322) ((emacs (24)) (cl-lib (0 5)) (dash (2 13 0)) (thrift (0 9 3))) "Major mode for Twitter Scrooge files" single]) (scribble-mode . [(20160124 1528) ((emacs (24))) "Major mode for editing Scribble documents" single]) (scratches . [(20151005 2116) ((dash (2 11 0)) (f (0 17 0))) "Multiple scratches in any language" single]) (scratch-pop . [(20170510 758) ((popwin (0 7 0 -3))) "Generate, popup (& optionally backup) scratch buffer(s)." single]) (scratch-palette . [(20150225 42) ((popwin (0 7 0 -3))) "make scratch buffer for each files" single]) (scratch-message . [(20170107 536) nil "Changing message in your scratch buffer" single]) (scratch-log . [(20141114 2343) nil "Utility for *scratch* buffer." single]) (scratch-ext . [(20140103 2116) nil "Extensions for *scratch*" single]) (scratch . [(20170614 1401) nil "Mode-specific scratch buffers" single]) (scpaste . [(20171101 922) ((htmlize (1 39))) "Paste to the web via scp." single]) (scp . [(20171203 1851) ((emacs (25 1)) (cl-lib (0 5))) "Use the SCP command to transfer files with the remote server" single]) (sclang-snippets . [(20130513 51) ((yasnippet (0 8 0))) "Snippets for the SuperCollider Emacs mode" tar]) (sclang-extensions . [(20160508 2038) ((auto-complete (1 4 0)) (s (1 3 1)) (dash (1 2 0)) (emacs (24 1))) "Extensions for the SuperCollider Emacs mode." tar]) (scion . [(20130315 555) nil "Haskell Minor Mode for Interacting with the Scion Library" single]) (schrute . [(20170521 1140) ((emacs (24 3))) "Help you remember there is a better way to do something." single]) (scheme-here . [(20141028 18) nil "cmuscheme extension for multiple inferior processes" single]) (scheme-complete . [(20170824 713) nil "Smart auto completion for Scheme in Emacs" single]) (scf-mode . [(20151121 1848) nil "shorten file-names in compilation type buffers" single]) (scala-mode . [(20170802 432) nil "Major mode for editing Scala" tar]) (scad-preview . [(20160206 536) ((scad-mode (91 0))) "Preview SCAD models in real-time within Emacs" single]) (scad-mode . [(20180108 1809) nil "A major mode for editing OpenSCAD code" single]) (sbt-mode . [(20180511 922) ((emacs (24 4))) "Interactive support for sbt projects" tar]) (sayid . [(20180404 1139) ((cider (0 14 0))) "sayid nREPL middleware client" single]) (say-what-im-doing . [(20160706 1231) nil "dictate what you're doing with text to speech" single]) (savekill . [(20140417 1929) nil "Save kill ring to disk" single]) (save-visited-files . [(20170228 2250) nil "save opened files across sessions" single]) (save-load-path . [(20140206 414) nil "save load-path and reuse it to test" single]) (sauron . [(20171105 247) nil "Track (erc/org/dbus/...) events and react to them." tar]) (sass-mode . [(20161006 2326) ((haml-mode (3 0 15)) (cl-lib (0 5))) "Major mode for editing Sass files" single]) (sane-term . [(20160620 647) ((emacs (24 1))) "Multi Term is crazy. This is not." single]) (salt-mode . [(20180118 1754) ((emacs (24 4)) (yaml-mode (0 0 12)) (mmm-mode (0 5 4)) (mmm-jinja2 (0 1))) "Major mode for Salt States" single]) (salesforce-utils . [(20160813 1854) ((cl-lib (0 5))) "simple utilities for Salesforce" single]) (sailfish-scratchbox . [(20171202 532) nil "Sailfish OS scratchbox inside the emacs." single]) (sage-shell-mode . [(20180215 35) ((cl-lib (0 6 1)) (emacs (24 4)) (let-alist (1 0 5)) (deferred (0 5 1))) "A front-end for Sage Math" tar]) (sackspace . [(20130719 256) nil "A better backspace" single]) (s3ed . [(20180204 549) ((emacs (24 4)) (seq (0)) (dash (0))) "Tramp-like access to s3" tar]) (s12cpuv2-mode . [(20171013 1351) ((emacs (24 3))) "Major-mode for S12CPUV2 assembly" single]) (s-buffer . [(20130605 1424) ((s (1 6 0)) (noflet (0 0 3))) "s operations for buffers" single]) (s . [(20180406 108) nil "The long lost Emacs string manipulation library." single]) (ryo-modal . [(20180331 118) ((emacs (24 4))) "Roll your own modal mode" single]) (rvm . [(20150402 742) nil "Emacs integration for rvm" single]) (rustic . [(20180723 1503) ((emacs (25 3)) (xterm-color (1 6)) (dash (2 13 0)) (s (1 10 0)) (f (0 18 2)) (projectile (0 14 0)) (markdown-mode (2 3))) "A major emacs mode for editing Rust source code" tar]) (rust-playground . [(20180507 1032) ((emacs (24 3)) (rust-mode (0 3 0))) "Local Rust playground for short code snippets." single]) (rust-mode . [(20180626 1512) ((emacs (24 0))) "A major emacs mode for editing Rust source code" single]) (russian-holidays . [(20170109 1340) nil "Russian holidays for the calendar" single]) (runtests . [(20150807 131) nil "Run unit tests from Emacs" single]) (runner . [(20160524 43) nil "Improved \"open with\" suggestions for dired" single]) (run-stuff . [(20180208 2348) ((emacs (24 4))) "context based command execution" single]) (rum-mode . [(20180126 1622) ((emacs (24))) "Major mode for Rum programming language" single]) (rufo . [(20170718 716) ((emacs (24 3))) "use rufo to automatically format ruby files" single]) (ruby-tools . [(20151209 815) nil "Collection of handy functions for ruby-mode." tar]) (ruby-test-mode . [(20171016 931) ((ruby-mode (1 0)) (pcre2el (1 8))) "Minor mode for Behaviour and Test Driven" single]) (ruby-refactor . [(20160214 850) ((ruby-mode (1 2))) "A minor mode which presents various Ruby refactoring helpers." single]) (ruby-interpolation . [(20131112 852) nil "Ruby string interpolation helpers" single]) (ruby-hash-syntax . [(20180323 1909) nil "Toggle ruby hash syntax between classic and 1.9 styles" single]) (ruby-factory . [(20160101 2321) ((inflections (1 1))) "Minor mode for Ruby test object generation libraries" tar]) (ruby-extra-highlight . [(20171106 1133) nil "Highlight Ruby parameters." single]) (ruby-end . [(20141215 423) nil "Automatic insertion of end blocks for Ruby" single]) (ruby-electric . [(20170810 430) nil "Minor mode for electrically editing ruby code" single]) (ruby-compilation . [(20150708 2340) ((inf-ruby (2 2 1))) "run a ruby process in a compilation buffer" single]) (ruby-additional . [(20180316 1937) ((emacs (24 3)) (ruby-mode (1 2))) "ruby-mode extensions yet to be merged into Emacs" tar]) (rubocopfmt . [(20180519 748) ((cl-lib (0 5))) "Minor-mode to format Ruby code with RuboCop on save" single]) (rubocop . [(20170311 2211) ((emacs (24))) "An Emacs interface for RuboCop" single]) (rubik . [(20180222 1214) ((cl-lib (1 0)) (emacs (25 3))) "Rubik's Cube" single]) (rtm . [(20180329 808) ((cl-lib (1 0))) "An elisp implementation of the Remember The Milk API" single]) (rtags . [(20180619 823) nil "A front-end for rtags" single]) (rspec-mode . [(20180614 448) ((ruby-mode (1 0)) (cl-lib (0 4))) "Enhance ruby-mode for RSpec" tar]) (rsense . [(20100510 2105) nil "RSense client for Emacs" single]) (rpn-calc . [(20170522 1842) ((popup (0 4))) "quick RPN calculator for hackers" single]) (rpm-spec-mode . [(20160710 436) nil "RPM spec file editing commands for Emacs/XEmacs" single]) (roy-mode . [(20121208 358) nil "Roy major mode" single]) (rotate . [(20160909 136) nil "Rotate the layout of emacs" single]) (rope-read-mode . [(20171003 719) nil "Rearrange lines to read text smoothly" single]) (roguel-ike . [(20160119 1902) ((popup (0 5 0))) "A coffee-break roguelike" tar]) (robots-txt-mode . [(20170908 642) nil "Major mode for editing robots.txt" single]) (robe . [(20171116 1249) ((inf-ruby (2 5 1)) (emacs (24 4))) "Code navigation, documentation lookup and completion for Ruby" tar]) (rjsx-mode . [(20180624 1758) ((emacs (24 4)) (js2-mode (20170504))) "Real support for JSX" single]) (riscv-mode . [(20170804 821) ((emacs (24 4))) "Major-mode for RISC V assembly" single]) (ripgrep . [(20180323 920) nil "Front-end for ripgrep, a command line search tool" single]) (rings . [(20160531 1327) nil "Buffer rings. Like tabs, but better." single]) (rinari . [(20150708 2340) ((ruby-mode (1 0)) (inf-ruby (2 2 5)) (ruby-compilation (0 16)) (jump (2 0))) "Rinari Is Not A Rails IDE" single]) (rimero-theme . [(20180630 515) ((emacs (24))) "Theme with a dark background suitable for UI and terminal usage." single]) (rigid-tabs . [(20170903 859) ((emacs (24 3))) "Fix TAB alignment in diff buffers" single]) (rich-minority . [(20170813 622) ((cl-lib (0 5))) "Clean-up and Beautify the list of minor-modes." single]) (rib-mode . [(20170726 748) ((emacs (24))) "RenderMan® Interface Bytestream (RIB) Major Mode" single]) (rhtml-mode . [(20130422 611) nil "major mode for editing RHTML files" tar]) (rg . [(20180626 1041) ((cl-lib (0 5)) (emacs (24 3)) (s (1 10 0))) "A search tool based on ripgrep." tar]) (reykjavik-theme . [(20160109 0) ((emacs (24))) "Theme with a dark background." single]) (review-mode . [(20180312 535) nil "major mode for ReVIEW" single]) (reverse-theme . [(20141204 1745) nil "Reverse theme for Emacs" single]) (reverse-im . [(20180213 525) ((emacs (24 4))) "Reverse mapping for keyboard layouts other than english." single]) (reveal-in-osx-finder . [(20150802 957) nil "Reveal file associated with buffer in OS X Finder" single]) (restclient-test . [(20180106 1246) ((emacs (24 4)) (restclient (0))) "Run tests with restclient.el" single]) (restclient-helm . [(20170314 854) ((restclient (0)) (helm (1 9 4))) "helm interface for restclient.el" single]) (restclient . [(20180316 851) nil "An interactive HTTP client for Emacs" single]) (restart-emacs . [(20180601 331) nil "Restart emacs from within emacs" single]) (resize-window . [(20170704 2212) ((emacs (24)) (cl-lib (0 5))) "easily resize windows" single]) (requirejs-mode . [(20130215 1304) nil "Improved AMD module management" single]) (requirejs . [(20151203 2319) ((js2-mode (20150713)) (popup (0 5 3)) (s (1 9 0)) (cl-lib (0 5)) (yasnippet (20151011 1823))) "Requirejs import manipulation and source traversal." tar]) (request-deferred . [(20160419 1605) ((deferred (0 3 1)) (request (0 2 0))) "Wrap request.el by deferred" single]) (request . [(20170131 1747) ((emacs (24 4))) "Compatible layer for URL request in Emacs" single]) (req-package . [(20180506 2350) ((use-package (1 0)) (dash (2 7 0)) (log4e (0 2 0)) (ht (0))) "A use-package wrapper for package runtime dependencies management" tar]) (repo . [(20170213 139) ((emacs (24 3))) "Running repo from Emacs" single]) (replace-with-inflections . [(20170911 245) ((cl-lib (0 5)) (string-inflection (1 0 5)) (inflections (1 1))) "Inflection aware `query-replace'" single]) (replace-symbol . [(20160517 1712) nil "Rename symbols in expressions or buffers" single]) (replace-pairs . [(20160207 451) ((emacs (24 4))) "Query-replace pairs of things" single]) (replace-from-region . [(20170227 1516) nil "Replace commands whose query is from region" single]) (repl-toggle . [(20180501 328) ((fullframe (0 0 5))) "Switch to/from repl buffer for current major-mode" single]) (repeater . [(20180418 512) ((emacs (24 4))) "Repeat recent repeated commands" single]) (repeatable-motion . [(20170620 1148) ((emacs (24))) "Make repeatable versions of motions" tar]) (remember-last-theme . [(20170619 1433) ((emacs (24 4))) "Remember the last used theme between sessions." single]) (remark-mode . [(20171217 2356) ((emacs (25 1)) (markdown-mode (2 0))) "Major mode for the remark slideshow tool" tar]) (relax . [(20131029 1434) ((json (1 2))) "For browsing and interacting with CouchDB" single]) (relative-buffers . [(20160221 1123) ((cl-lib (0 5)) (dash (2 6 0)) (s (1 9 0)) (f (0 16 2))) "Emacs buffers naming convention" single]) (related . [(20161002 2310) ((cl-lib (0 5))) "Switch back and forth between similarly named buffers." single]) (register-channel . [(20150513 2059) nil "Jump around fast using registers" single]) (region-state . [(20151128 238) nil "Show the number of chars/lines or rows/columns in the region" single]) (region-convert . [(20161118 1859) nil "Convert string in region by Lisp function" single]) (region-bindings-mode . [(20140407 1514) nil "Enable custom bindings when mark is active." single]) (regex-tool . [(20170104 1118) nil "A regular expression evaluation tool for programmers" single]) (regex-dsl . [(20100124 228) nil "lisp syntax for regexps" single]) (refine . [(20180315 1528) ((emacs (24 3)) (s (1 11 0)) (dash (2 12 0)) (list-utils (0 4 4)) (loop (1 2))) "interactive value editing" single]) (redtick . [(20180424 1436) ((emacs (24 4))) "Smallest pomodoro timer (1 char)" tar]) (redshank . [(20180128 1348) ((paredit (21))) "Common Lisp Editing Extensions" tar]) (redprl . [(20180418 734) ((emacs (24 3))) "Major mode for editing RedPRL proofs and interacting with RedPRL" single]) (redpen-paragraph . [(20160625 350) ((emacs (24)) (cl-lib (0 5)) (json (1 4))) "RedPen interface." single]) (redis . [(20150531 1248) ((emacs (24)) (cl-lib (0 5))) "Redis integration" single]) (recursive-narrow . [(20140902 1027) nil "narrow-to-region that operates recursively" single]) (rectangle-utils . [(20160914 2108) ((emacs (24)) (cl-lib (0 5))) "Some useful rectangle functions." single]) (rect+ . [(20150620 1744) nil "Extensions to rect.el" single]) (recover-buffers . [(20171008 2137) nil "revisit all buffers from an auto-save file" tar]) (recompile-on-save . [(20151126 646) ((dash (1 1 0)) (cl-lib (0 5))) "Trigger recompilation on file save." single]) (recentf-remove-sudo-tramp-prefix . [(20180204 2156) ((emacs (24 4))) "Normalise recentf history" single]) (recentf-ext . [(20170925 1735) nil "Recentf extensions" single]) (rebox2 . [(20121113 500) nil "Handling of comment boxes in various styles." single]) (rebecca-theme . [(20180324 121) ((emacs (24))) "Rebecca Purple Theme" single]) (reason-mode . [(20180722 437) ((emacs (24 3))) "A major mode for editing ReasonML" tar]) (realgud-rdb2 . [(20160303 43) ((realgud (1 3))) "realgud front-end for interacting with Ruby debugger2" tar]) (realgud-pry . [(20160805 745) ((realgud (1 4 3)) (cl-lib (0 5)) (emacs (24))) "realgud front-end to the Ruby pry debugger" tar]) (realgud-old-debuggers . [(20170316 31) ((realgud (1 4 3)) (cl-lib (0 5)) (emacs (24))) "realgud front-end to older lesser-used debuggers" tar]) (realgud-byebug . [(20180308 1923) ((realgud (1 4 3)) (cl-lib (0 5)) (emacs (24))) "realgud front-end to the Ruby byebug debugger" tar]) (realgud . [(20180710 1953) ((load-relative (1 2)) (loc-changes (1 2)) (test-simple (1 2 0)) (cl-lib (0 5)) (emacs (24))) "A modular front-end for interacting with external debuggers" tar]) (real-auto-save . [(20180107 1850) nil "Automatically save your all your buffers/files at regular intervals." single]) (readline-complete . [(20150708 737) nil "offers completions in shell mode" single]) (readability . [(20140715 1727) ((oauth (1 4)) (ov (1 0)) (emacs (24 3))) "Read articles from Readability in Emacs" single]) (read-aloud . [(20160922 2200) ((emacs (24 4))) "A simple interface to TTS engines" single]) (react-snippets . [(20170803 1550) ((yasnippet (0 7 0))) "Yasnippets for React" tar]) (rdxmk . [(20170629 1834) nil "A small set of tools for redox developments" tar]) (rdp . [(20120928 1854) nil "Recursive Descent Parser library" single]) (rdf-prefix . [(20180127 1006) nil "Prefix lookup for RDF" single]) (rcirc-styles . [(20160206 1850) ((cl-lib (0 5))) "support mIRC-style color and attribute codes" single]) (rcirc-notify . [(20150219 1404) nil "libnotify popups" single]) (rcirc-groups . [(20170731 1401) nil "an emacs buffer in rcirc-groups major mode" single]) (rcirc-alertify . [(20140406 1819) ((alert (20140406 1353))) "Cross platform notifications for rcirc" single]) (rcirc-alert . [(20141127 247) nil "Configurable alert messages on top of RCIRC" tar]) (rc-mode . [(20160913 1218) nil "Major mode for the Plan9 rc shell" single]) (rbt . [(20170202 1502) ((popup (0 5 3)) (magit (20160128 1201))) "Integrate reviewboard with emacs." single]) (rbenv . [(20141119 2349) nil "Emacs integration for rbenv" single]) (rats . [(20170818 313) ((s (1 10 0)) (go-mode (1 3 1)) (cl-lib (0 5))) "Rapid testing suite for Go" single]) (rase . [(20120928 1345) nil "Run At Sun Event daemon" single]) (ranger . [(20170817 857) ((emacs (24 4))) "Make dired more like ranger" single]) (random-splash-image . [(20151002 1830) nil "Randomly sets splash image to *GNU Emacs* buffer on startup." single]) (rand-theme . [(20151219 1535) ((cl-lib (0 5))) "Random Emacs theme at start-up!" single]) (rally-mode . [(20161113 1954) ((popwin (1 0 0))) "a mode to interact with the Rally Software web site." single]) (rake . [(20180212 208) ((f (0 13 0)) (dash (1 5 0)) (cl-lib (0 5))) "Run rake commands" single]) (rainbow-identifiers . [(20141102 726) ((emacs (24))) "Highlight identifiers according to their names" single]) (rainbow-delimiters . [(20170929 432) nil "Highlight brackets according to their depth" single]) (rainbow-blocks . [(20171025 738) nil "Block syntax highlighting for lisp code" single]) (railscasts-theme . [(20150219 725) nil "Railscasts color theme for GNU Emacs." single]) (railscasts-reloaded-theme . [(20180131 2246) nil "Railscasts Reloaded color theme" single]) (rails-log-mode . [(20140407 2125) nil "Major mode for viewing Rails log files" single]) (racket-mode . [(20180719 854) ((emacs (24 3)) (faceup (0 0 2)) (s (1 9 0))) "Major mode for Racket language." tar]) (racer . [(20180708 2325) ((emacs (24 3)) (rust-mode (0 2 0)) (dash (2 13 0)) (s (1 10 0)) (f (0 18 2)) (pos-tip (0 4 6))) "code completion, goto-definition and docs browsing for Rust via racer" single]) (r-autoyas . [(20140101 710) ((ess (0)) (yasnippet (0 8 0))) "Provides automatically created yasnippets for R function argument lists." tar]) (quiz . [(20170818 415) ((cl-lib (0 5)) (emacs (25))) "Multiple choice quiz game" single]) (quiet . [(20160508 556) nil "disconnect from the online world for a while" single]) (quickrun . [(20170222 1715) ((emacs (24 3))) "Run commands quickly" single]) (quickref . [(20170817 532) ((dash (1 0 3)) (s (1 0 0))) "Display relevant notes-to-self in the echo area" single]) (quick-shell-keybind . [(20171022 2313) ((emacs (24))) "Interactively bind a key to shell commands" single]) (quick-preview . [(20150828 2139) nil "quick preview using GNOME sushi, gloobus or quick look" single]) (quick-peek . [(20180525 711) ((emacs (24 3))) "Inline quick-peek windows" single]) (quick-buffer-switch . [(20151007 1508) nil "Quick switch to file or dir buffers." single]) (quelpa-use-package . [(20180617 2356) ((emacs (24 3)) (quelpa (0)) (use-package (2))) "quelpa handler for use-package" single]) (quelpa . [(20180711 1338) ((emacs (24 3))) "Emacs Lisp packages built directly from source" tar]) (quasi-monochrome-theme . [(20180516 813) nil "Quasi Monochrome theme" tar]) (qt-pro-mode . [(20170604 1141) ((emacs (24))) "Qt Pro/Pri major mode" single]) (qml-mode . [(20161015 1731) nil "Major mode for editing QT Declarative (QML) code." single]) (ql . [(20180418 1320) ((emacs (24))) "Control Quod Libet" single]) (qiita . [(20140118 44) ((helm (1 5 9)) (markdown-mode (2 0))) "Qiita API Library for emacs" single]) (pyvenv . [(20180720 214) nil "Python virtual environment interface" single]) (pythonic . [(20180624 2212) ((emacs (25)) (s (1 9)) (f (0 17 2))) "Utility functions for writing pythonic emacs package." single]) (python-x . [(20180218 1447) ((python (0 24)) (folding (0)) (cl-lib (0 5))) "python.el extras for interactive evaluation" tar]) (python-test . [(20171112 2137) ((emacs (25 1))) "Python testing integration" single]) (python-switch-quotes . [(20161228 9) ((emacs (24 3))) "cycle between ' and \" quotes in python strings" single]) (python-pytest . [(20180614 253) ((emacs (24 4)) (dash (2 12 0)) (dash-functional (2 12 0)) (magit-popup (2 12 0)) (projectile (0 14 0)) (s (1 12 0))) "helpers to run pytest" single]) (python-mode . [(20180721 1147) nil "Python major mode" tar]) (python-info . [(20151228 1052) nil "Python info manual for Emacs" tar]) (python-environment . [(20150310 153) ((deferred (0 3 1))) "virtualenv API for Emacs Lisp" tar]) (python-docstring . [(20170508 156) nil "Smart Python docstring formatting" tar]) (python-django . [(20150821 2104) nil "A Jazzy package for managing Django projects" single]) (python-cell . [(20131029 1616) nil "Support for MATLAB-like cells in python mode" single]) (pytest . [(20170614 745) ((s (1 9 0))) "Easy Python test running in Emacs" single]) (pyramid . [(20180718 1420) ((emacs (25 2)) (pythonic (0 1 1)) (tablist (0 70))) "Minor mode for working with pyramid projects" tar]) (pynt . [(20180710 26) ((emacs (24 4)) (ein (0 13 1)) (epc (0 1 1)) (deferred (0 5 1))) "Generate and scroll EIN buffers from python code" single]) (pylint . [(20170402 555) nil "minor mode for running `pylint'" single]) (pyimpsort . [(20160129 2053) ((emacs (24 3))) "Sort python imports." tar]) (pyimport . [(20180308 952) ((dash (2 8 0)) (s (1 9 0)) (shut-up (0 3 2))) "Manage Python imports!" single]) (pyim-wbdict . [(20170724 1527) ((pyim (1 0))) "Some wubi dicts for pyim" tar]) (pyim-cangjie5dict . [(20170729 1946) ((pyim (1 0))) "Some cangjie5 dicts for pyim" tar]) (pyim-basedict . [(20170726 1959) nil "The default pinyin dict of pyim" tar]) (pyim . [(20180712 640) ((emacs (24 4)) (popup (0 1)) (async (1 6)) (pyim-basedict (0 1))) "A Chinese input method support quanpin, shuangpin, wubi and cangjie." tar]) (pygen . [(20161120 2106) ((elpy (1 12 0)) (python-mode (6 2 2)) (dash (2 13 0))) "Python code generation using Elpy and Python-mode." single]) (pyfmt . [(20150521 1356) nil "Emacs interface to pyfmt" single]) (pyenv-mode-auto . [(20180620 552) ((pyenv-mode (0 1 0)) (s (1 11 0)) (f (0 17 0))) "Automatically activates pyenv version if .python-version file exists." single]) (pyenv-mode . [(20170801 1648) ((pythonic (0 1 0))) "Integrate pyenv with python-mode" single]) (pydoc-info . [(20110301 34) nil "Better Python support for info-lookup-symbol." tar]) (pydoc . [(20180509 1519) nil "functional, syntax highlighted pydoc navigation" single]) (pycoverage . [(20160324 1812) ((emacs (24 3))) "Support for coverage stats on Python 2.X and 3" tar]) (pycarddavel . [(20150831 516) ((helm (1 7 0)) (emacs (24 0))) "Integrate pycarddav" single]) (py-yapf . [(20160925 422) nil "Use yapf to beautify a Python buffer" single]) (py-test . [(20151116 2222) ((dash (2 9 0)) (f (0 17)) (emacs (24 4))) "A test runner for Python code." single]) (py-smart-operator . [(20170531 509) ((s (1 9 0))) "smart-operator for python-mode" single]) (py-isort . [(20160925 318) nil "Use isort to sort the imports in a Python buffer" single]) (py-import-check . [(20130802 411) nil "Finds the unused python imports using importchecker" single]) (py-gnitset . [(20170821 1032) nil "Run your Python tests any way you'd like" single]) (py-autopep8 . [(20160925 352) nil "Use autopep8 to beautify a Python buffer" single]) (px . [(20170317 1630) nil "preview inline latex in any mode" single]) (pushover . [(20170818 1403) ((cl-lib (0 5))) "Pushover API Access" single]) (pushbullet . [(20140809 532) ((grapnel (0 5 2)) (json (1 2))) "Emacs client for the PushBullet Android app" single]) (purty-mode . [(20131004 1559) nil "Safely pretty-print greek letters, mathematical symbols, or anything else." single]) (purple-haze-theme . [(20141014 1929) ((emacs (24 0))) "an overtly purple color theme for Emacs24." single]) (purescript-mode . [(20180120 709) nil "A PureScript editing mode" tar]) (puppet-mode . [(20171220 2249) ((emacs (24 1)) (pkg-info (0 4))) "Major mode for Puppet manifests" single]) (punpun-theme . [(20161103 147) nil "A bleak theme" tar]) (pungi . [(20150222 446) ((jedi (0 2 0 -3 2)) (pyvenv (1 5))) "Integrates jedi with virtualenv and buildout python environments" single]) (punctuality-logger . [(20141120 1231) nil "Punctuality logger for Emacs" single]) (pulseaudio-control . [(20180627 450) nil "Use `pactl' to manage PulseAudio volumes." single]) (pug-mode . [(20180513 1426) ((emacs (24 4)) (cl-lib (0 5))) "Major mode for jade/pug template files" single]) (pt . [(20161226 1159) nil "A front-end for pt, The Platinum Searcher." single]) (psysh . [(20171022 2229) ((emacs (24 3)) (s (1 9 0)) (f (0 17))) "PsySH, PHP interactive shell (REPL)" single]) (psession . [(20180423 2159) ((emacs (24)) (cl-lib (0 5)) (async (1 9 3))) "Persistent save of elisp objects." single]) (psci . [(20180418 533) ((purescript-mode (13 10)) (dash (2 9 0)) (s (1 9 0)) (f (0 17 1))) "Major mode for purescript repl psci" tar]) (psc-ide . [(20180605 302) ((dash (2 13 0)) (dash-functional (1 2 0)) (company (0 8 7)) (cl-lib (0 5)) (s (1 10 0)) (emacs (24 4)) (flycheck (0 24)) (let-alist (1 0 4)) (seq (1 11))) "Minor mode for PureScript's psc-ide tool." tar]) (proxy-mode . [(20180520 2030) ((emacs (25))) "A minor mode to toggle proxy." single]) (protocols . [(20170802 432) ((cl-lib (0 5))) "Protocol database access functions." single]) (protobuf-mode . [(20170526 950) nil "major mode for editing protocol buffers." single]) (prosjekt . [(20151127 616) ((dash (2 8 0))) "a software project tool for emacs" tar]) (proportional . [(20171025 1637) ((emacs (25 1))) "use a proportional font everywhere" single]) (propfont-mixed . [(20150113 1411) ((emacs (24)) (cl-lib (0 5))) "Use proportional fonts with space-based indentation." single]) (prop-menu . [(20150728 418) ((emacs (24 3)) (cl-lib (0 5))) "Create and display a context menu based on text and overlay properties" single]) (prompts . [(20160916 341) ((dash (2 13 0))) "utilities for working with text prompts." single]) (prompt-text . [(20160106 609) nil "Various information in minibuffer prompt" single]) (promise . [(20180409 252) ((emacs (25)) (async (1 9))) "Promises/A+" tar]) (projmake-mode . [(20161031 1015) ((dash (20150611 922)) (indicators (20130217 1405))) "Project oriented automatic builder and error highlighter, flymake for projects" tar]) (projekt . [(20150324 148) ((emacs (24))) "some kind of staging for CVS" single]) (projector . [(20180712 1549) ((alert (1 1)) (projectile (0 11 0)) (cl-lib (0 5))) "Lightweight library for managing project-aware shell and command buffers" single]) (projectile-variable . [(20170208 918) ((emacs (24)) (cl-lib (0 5))) "Store project local variables." single]) (projectile-trailblazer . [(20170928 924) ((emacs (24 4)) (projectile (0 12 0)) (inflections (1 1)) (inf-ruby (2 2 6)) (f (0 13 0)) (rake (0 3 2))) "Minor mode for Rails projects using trailblazer" single]) (projectile-speedbar . [(20170516 1943) ((projectile (0 11 0)) (sr-speedbar (0))) "projectile integration for speedbar" single]) (projectile-sift . [(20160107 215) ((sift (0 2 0)) (projectile (0 13 0))) "Run a sift with Projectile" single]) (projectile-ripgrep . [(20180301 651) ((ripgrep (0 3 0)) (projectile (0 14 0))) "Run ripgrep with Projectile" single]) (projectile-rails . [(20180718 55) ((emacs (24 3)) (projectile (0 12 0)) (inflections (1 1)) (inf-ruby (2 2 6)) (f (0 13 0)) (rake (0 3 2))) "Minor mode for Rails projects based on projectile-mode" single]) (projectile-hanami . [(20160505 611) ((emacs (24 3)) (projectile (0 12 0)) (rake (0 3 2)) (inf-ruby (2 2 6))) "Minor mode for Hanami projects based on projectile" single]) (projectile-git-autofetch . [(20180418 1636) ((projectile (0 14 0)) (alert (1 2))) "automatically fetch git repositories" single]) (projectile-direnv . [(20160305 1738) ((emacs (24)) (s (1 11 0)) (dash (2 12 0)) (projectile (0 13 0))) "Set environment variables from .envrc" single]) (projectile-codesearch . [(20180508 822) ((codesearch (20171122 431)) (projectile (20150405 126))) "Integration of codesearch into projectile" single]) (projectile . [(20180721 352) ((emacs (25 1)) (pkg-info (0 4))) "Manage and navigate projects in Emacs easily" single]) (project-shells . [(20171107 51) ((emacs (24 3)) (seq (2 19))) "Manage the shell buffers of each project" single]) (project-root . [(20110206 1230) nil "Define a project root and take actions based upon it." single]) (project-persist-drawer . [(20151108 422) ((project-persist (0 3))) "Use a project drawer with project-persist." tar]) (project-persist . [(20150519 1324) nil "A minor mode to allow loading and saving of project settings." tar]) (project-explorer . [(20150503 1714) ((cl-lib (0 3)) (es-lib (0 3)) (es-windows (0 1)) (emacs (24))) "A project explorer sidebar" single]) (project-abbrev . [(20180705 1954) ((emacs (24 4))) "Customize abbreviation expansion in the project." single]) (programmer-dvorak . [(20150426 1837) nil "Input method for Programmer Dvorak." single]) (prognth . [(20130920 1059) nil "Extend prog1 to arbitrary index" single]) (prog-fill . [(20180606 1832) ((emacs (25 1)) (cl-lib (0 6 1))) "Smartly format lines to use vertical space." single]) (professional-theme . [(20150315 400) nil "Emacs port of Vim's professional theme" single]) (prodigy . [(20180511 238) ((s (1 8 0)) (dash (2 4 0)) (f (0 14 0)) (emacs (24))) "Manage external services from within Emacs" single]) (processing-snippets . [(20140426 728) ((yasnippet (0 8 0))) "Snippets for processing-mode" tar]) (processing-mode . [(20171022 1602) nil "Major mode for Processing 2.0" single]) (proc-net . [(20130321 1712) nil "network process tools" single]) (private-diary . [(20151216 857) ((emacs (24 0))) "maintain a private diary in Emacs" single]) (private . [(20150121 1757) ((aes (0 6))) "take care of your private configuration files." single]) (pretty-symbols . [(20140814 259) nil "Draw tokens as Unicode glyphs." single]) (pretty-sha-path . [(20141105 1026) nil "Prettify Guix/Nix store paths" single]) (pretty-mode . [(20160614 1146) nil "Redisplay parts of the buffer as pretty Unicode symbols." single]) (prettify-greek . [(20160603 208) nil "Greek letters for prettify-symbols" single]) (prettier-js . [(20180108 2326) nil "Minor mode to format JS code on file save" single]) (presentation . [(20180426 1924) ((emacs (24 4)) (cl-lib (0 5))) "Display large character for presentation" single]) (preseed-generic-mode . [(20180209 2100) nil "Debian preseed file major mode" single]) (prescient . [(20180702 1140) ((emacs (25 1))) "Better sorting and filtering." single]) (preproc-font-lock . [(20151107 1218) nil "Highlight C-style preprocessor directives." single]) (prassee-theme . [(20180709 304) ((emacs (24))) "A high contrast color theme for Emacs." single]) (ppd-sr-speedbar . [(20151108 424) ((sr-speedbar (20140914 2339)) (project-persist-drawer (0 0 4))) "Sr Speedbar adaptor for project-persist-drawer." tar]) (powerthesaurus . [(20180719 208) ((emacs (24)) (request (0 3 0)) (s (1 12 0))) "Powerthesaurus integration" single]) (powershell . [(20180616 2328) ((emacs (24))) "Mode for editing Powershell scripts" single]) (powerline-evil . [(20151112 710) ((evil (1 0 8)) (powerline (2 3))) "Utilities for better Evil support for Powerline" tar]) (powerline . [(20180321 1948) ((cl-lib (0 2))) "Rewrite of Powerline" tar]) (pow . [(20140420 106) ((emacs (24)) (cl-lib (0 5))) "pow (http://pow.cx/) manager for emacs" tar]) (pov-mode . [(20161114 2343) nil "Major mode for editing POV-Ray scene files." tar]) (postcss-sorting . [(20180211 156) ((emacs (24))) "postcss-sorting interface" single]) (posframe . [(20180708 702) ((emacs (26))) "Pop a posframe (just a frame) at point" single]) (pos-tip . [(20150318 813) nil "Show tooltip at point" single]) (portage-navi . [(20141208 555) ((concurrent (0 3 1)) (ctable (0 1 2))) "portage viewer" single]) (popwin . [(20150315 600) nil "Popup Window Manager." single]) (popup-switcher . [(20171205 51) ((cl-lib (0 3)) (popup (0 5 3))) "switch to other buffers and files via popup." single]) (popup-kill-ring . [(20131020 1154) ((popup (0 4)) (pos-tip (0 4))) "interactively insert item from kill-ring" single]) (popup-imenu . [(20170326 340) ((dash (2 12 1)) (popup (0 5 3)) (flx-ido (0 6 1))) "imenu index popup" single]) (popup-edit-menu . [(20170404 725) ((emacs (24))) "a popup context edit menu package" single]) (popup-complete . [(20141108 1908) ((popup (0 5 0))) "completion with popup" single]) (popup . [(20160709 729) ((cl-lib (0 5))) "Visual Popup User Interface" single]) (poporg . [(20170403 51) nil "Pop a comment or string to an empty buffer for text editing" single]) (pophint . [(20170917 1948) ((log4e (0 2 0)) (yaxception (0 3))) "Provide navigation using pop-up tips, like Firefox's Vimperator Hint Mode" tar]) (ponylang-mode . [(20171028 1356) ((dash (2 10 0))) "Major mode for Pony code" single]) (pony-snippets . [(20160204 2011) ((yasnippet (0 8 0))) "Yasnippets for Pony" tar]) (pony-mode . [(20170807 822) nil "Minor mode for working with Django Projects" tar]) (pomodoro . [(20150716 1046) nil "A timer for the Pomodoro Technique" single]) (pomidor . [(20180614 128) ((emacs (24 3)) (alert (1 2))) "Simple and cool pomodoro timer" tar]) (polymode . [(20170307 322) ((emacs (24))) "Versatile multiple modes with extensive literate programming support" tar]) (poly-ruby . [(20170802 648) ((emacs (24 3)) (polymode (1 0))) "Provides poly-ruby-mode" single]) (pollen-mode . [(20180404 612) ((emacs (24 3)) (cl-lib (0 5))) "major mode for editing pollen files" single]) (pointback . [(20100210 752) nil "Restore window points when returning to buffers" single]) (point-stack . [(20170808 958) nil "Back and forward navigation through buffer locations" single]) (point-pos . [(20170421 932) nil "Save and restore point positions" single]) (poet-theme . [(20180603 1523) nil "A prose friendly theme." single]) (podcaster . [(20161020 835) ((cl-lib (0 5))) "Podcast client" single]) (pocket-reader . [(20180719 1453) ((emacs (25 1)) (dash (2 13 0)) (kv (0 0 19)) (pocket-lib (0 1)) (s (1 10)) (ov (1 0 6)) (rainbow-identifiers (0 2 2)) (org-web-tools (0 1)) (ht (2 2))) "Client for Pocket reading list" single]) (pocket-mode . [(20171201 515) ((emacs (24 4)) (pocket-api (0 1))) "Manage your pocket" single]) (pocket-lib . [(20180711 1723) ((emacs (25 1)) (request (0 2)) (dash (2 13 0)) (kv (0 0 19)) (s (1 12 0))) "Library for accessing getpocket.com API" single]) (pocket-api . [(20180402 1809) ((emacs (24 4)) (request (0 2))) "another pocket api" single]) (po-mode . [(20180505 415) nil "major mode for GNU gettext PO files" single]) (pmdm . [(20151109 1036) nil "poor man's desktop-mode alternative." single]) (plur . [(20160504 224) ((emacs (24 4))) "Easily search and replace multiple variants of a word" single]) (plsense-direx . [(20140520 1308) ((direx (0 1 -3)) (plsense (0 3 2)) (log4e (0 2 0)) (yaxception (0 3 2))) "Perl Package Explorer" single]) (plsense . [(20151104 645) ((auto-complete (1 4 0)) (log4e (0 2 0)) (yaxception (0 2 0))) "provide interface for PlSense that is a development tool for Perl." single]) (plim-mode . [(20140812 1713) nil "Major mode for editing Plim files" single]) (plenv . [(20130706 2316) nil "A plenv wrapper for Emacs" single]) (playground . [(20180623 2026) ((emacs (24 4))) "Manage sandboxes for alternative configurations" single]) (playerctl . [(20180301 554) nil "Control your music player (e.g. Spotify) with playerctl" single]) (play-routes-mode . [(20170426 33) nil "Play Framework Routes File Support" single]) (play-crystal . [(20180114 224) ((emacs (24 4)) (dash (2 12 0)) (request (0 2 0))) "https://play.crystal-lang.org integration." single]) (platformio-mode . [(20161210 539) ((projectile (0 13 0))) "PlatformIO integration" single]) (plaster . [(20180127 1250) ((emacs (24 3))) "Pasting to a plaster host with buffers." single]) (plantuml-mode . [(20170819 1033) nil "Major mode for PlantUML" single]) (planet-theme . [(20161030 1917) ((emacs (24))) "A dark theme inspired by Gmail's 'Planets' theme of yore" single]) (plan9-theme . [(20180606 2035) nil "A color theme for Emacs based on Plan9" single]) (plain-theme . [(20171123 2010) ((emacs (24))) "Plain theme without syntax highlighting" single]) (pkgbuild-mode . [(20180723 747) ((emacs (25 1))) "Interface to the ArchLinux package manager" single]) (pkg-info . [(20150517 443) ((epl (0 8))) "Information about packages" single]) (pixiv-novel-mode . [(20160220 621) nil "Major mode for pixiv novel" single]) (pixie-mode . [(20180625 2241) ((clojure-mode (3 0 1)) (inf-clojure (1 0 0))) "Major mode for Pixie-lang" single]) (pivotal-tracker . [(20170720 816) nil "Interact with Pivotal Tracker through its API" single]) (pippel . [(20180710 156) ((emacs (25 1)) (s (1 11 0)) (dash (2 12 0))) "Frontend to python package manager pip" tar]) (pipenv . [(20180718 2247) ((emacs (25 1)) (f (0 19 0)) (s (1 12 0))) "A Pipenv porcelain." single]) (pip-requirements . [(20180602 1034) ((dash (2 8 0))) "A major mode for editing pip requirements files." single]) (pinyinlib . [(20170827 1442) nil "Convert first letter of Pinyin to Simplified/Traditional Chinese characters" single]) (pinyin-search . [(20160514 2058) ((pinyinlib (0 1 0))) "Search Chinese by Pinyin" single]) (pinyin . [(20180620 541) ((cl-lib (0 5)) (emacs (24))) "Convert Hanzi to Pinyin (汉字转拼音)" tar]) (pinot . [(20140211 1226) nil "Emacs interface to pinot-search" tar]) (pinboard-popular . [(20180511 1026) ((loop (1 4))) "Displays links from the pinboard.in popular page." single]) (pinboard-api . [(20140324 448) nil "Rudimentary http://pinboard.in integration" single]) (pillar . [(20141112 1011) ((makey (0 3))) "Major mode for editing Pillar files" tar]) (pig-snippets . [(20130912 2324) ((yasnippet (0 8 0))) "Snippets for pig-mode" tar]) (pig-mode . [(20180520 700) nil "Major mode for Pig files" single]) (picpocket . [(20180610 359) ((emacs (24 4))) "Image viewer" single]) (picolisp-mode . [(20150516 155) nil "Major mode for PicoLisp programming." single]) (pickle . [(20180627 1937) ((emacs (25 1)) (cl-lib (0 6 1))) "Major mode for editing cucumber gherkin files." single]) (pianobar . [(20180416 1804) nil "thin wrapper for Pianobar, a Pandora Radio client" single]) (phpunit . [(20171127 301) ((s (1 9 0)) (f (0 16 0)) (pkg-info (0 5)) (cl-lib (0 5)) (emacs (24 3))) "Launch PHP unit tests using phpunit" tar]) (phpstan . [(20180721 1235) ((emacs (24 3))) "Interface to PHPStan." single]) (phpcbf . [(20180519 138) ((s (1 9 0))) "Format PHP code in Emacs using PHP_CodeSniffer's phpcbf" single]) (phpactor . [(20180721 1022) ((emacs (24 3)) (cl-lib (0 5)) (f (0 17))) "Interface to Phpactor" tar]) (php-scratch . [(20161103 1517) ((emacs (24 3)) (s (1 11 0)) (php-mode (1 17 0))) "A scratch buffer to interactively evaluate php code" single]) (php-runtime . [(20180110 934) ((emacs (25)) (cl-lib (0 5))) "Language binding bridge to PHP" single]) (php-refactor-mode . [(20171123 2235) nil "Minor mode to quickly and safely perform common refactorings" single]) (php-mode . [(20180608 250) ((emacs (24 3)) (cl-lib (0 5))) "Major mode for editing PHP code" tar]) (php-eldoc . [(20140202 1141) nil "eldoc backend for php" tar]) (php-cs-fixer . [(20170506 1133) ((cl-lib (0 5))) "php-cs-fixer wrapper." single]) (php-boris-minor-mode . [(20140209 1035) ((php-boris (0 0 1)) (highlight (0))) "a minor mode to evaluate PHP code in the Boris repl" single]) (php-boris . [(20130527 121) nil "Run boris php REPL" single]) (php-auto-yasnippets . [(20170330 1814) ((php-mode (1 11)) (yasnippet (0 8 0))) "Creates snippets for PHP functions" tar]) (phoenix-dark-pink-theme . [(20170729 703) nil "Originally a port of the Sublime Text 2 theme" single]) (phoenix-dark-mono-theme . [(20170729 706) nil "Monochromatic version of the Phoenix theme" single]) (phi-search-migemo . [(20170618 221) ((phi-search (2 2 0)) (migemo (1 9 1))) "migemo extension for phi-search" single]) (phi-search-mc . [(20160324 803) ((phi-search (2 0 0)) (multiple-cursors (1 2 1))) "multiple-cursors extension for phi-search" single]) (phi-search-dired . [(20150405 14) ((phi-search (2 2 0))) "interactive filtering for dired powered by phi-search" single]) (phi-search . [(20180321 1829) nil "another incremental search & replace, compatible with \"multiple-cursors\"" tar]) (phi-rectangle . [(20151207 2254) nil "another rectangle-mark command (rewrite of rect-mark)" single]) (phi-grep . [(20170606 107) ((cl-lib (0 1))) "Interactively-editable recursive grep implementation in elisp" single]) (phi-autopair . [(20170216 1953) ((paredit (20))) "another simple-minded autopair implementation" single]) (phan . [(20180527 2039) ((emacs (24)) (composer (0 0 8)) (f (0 17))) "Utility functions for Phan (PHP static analizer)" single]) (phabricator . [(20160510 725) ((emacs (24 4)) (dash (1 0)) (projectile (0 13 0)) (s (1 10 0)) (f (0 17 2))) "Phabricator/Arcanist helpers for Emacs." single]) (ph . [(20161029 822) ((emacs (24 3))) "A global minor mode for managing multiple projects." tar]) (pgdevenv . [(20150105 1436) nil "Manage your PostgreSQL development envs" tar]) (pg . [(20130731 1442) nil "Emacs Lisp interface to the PostgreSQL RDBMS" single]) (pfuture . [(20180715 524) ((emacs (25 2))) "a simple wrapper around asynchronous processes" single]) (perspeen . [(20171203 221) ((emacs (25 0)) (powerline (2 4))) "An package for multi-workspace" tar]) (perspective . [(20180717 1403) ((cl-lib (0 5))) "switch between named \"perspectives\" of the editor" single]) (persp-projectile . [(20180616 1244) ((perspective (1 9)) (projectile (0 11 0)) (cl-lib (0 3))) "Perspective integration with Projectile" single]) (persp-mode-projectile-bridge . [(20170315 420) ((persp-mode (2 9)) (projectile (0 13 0)) (cl-lib (0 5))) "persp-mode + projectile integration." single]) (persp-mode . [(20180604 1018) nil "windows/buffers sets shared among frames + save/load." single]) (persp-fr . [(20180103 642) ((emacs (25 0)) (persp-mode (2 9 6)) (dash (2 13 0))) "In persp-mode, show perspective list in the GUI window title" single]) (persistent-soft . [(20150223 1053) ((pcache (0 3 1)) (list-utils (0 4 2))) "Persistent storage, returning nil on failure" single]) (persistent-scratch . [(20180425 1811) ((emacs (24))) "Preserve the scratch buffer across Emacs sessions" single]) (persistent-overlays . [(20161127 2300) nil "Minor mode to store selected overlays to be loaded later" tar]) (perlbrew . [(20161108 2309) nil "A perlbrew wrapper for Emacs" single]) (perl6-mode . [(20180619 459) ((emacs (24 4)) (pkg-info (0 1))) "Major mode for editing Perl 6 code" tar]) (per-buffer-theme . [(20160318 1501) ((cl-lib (0 5))) "Change theme according to buffer name or major mode." single]) (pelican-mode . [(20180604 1507) ((emacs (25))) "Minor mode for editing Pelican sites" single]) (peg . [(20150707 2341) nil "Parsing Expression Grammars in Emacs Lisp" single]) (peep-dired . [(20160321 1537) nil "Peep at files in another window from dired buffers" single]) (peek-mode . [(20130620 1246) ((elnode (0 9 8 1))) "Serve buffers live over HTTP with elnode backend" tar]) (peacock-theme . [(20170808 620) ((emacs (24 0))) "an Emacs 24 theme based on Peacock (tmTheme)" single]) (pdf-tools . [(20180428 827) ((emacs (24 3)) (tablist (0 70)) (let-alist (1 0 4))) "Support library for PDF documents." tar]) (pdb-mode . [(20150128 951) nil "Major mode for editing Protein Data Bank files" single]) (pcsv . [(20150220 331) nil "Parser of csv" single]) (pcre2el . [(20161120 1303) ((emacs (24)) (cl-lib (0 3))) "regexp syntax converter" single]) (pcomplete-extension . [(20180706 2155) ((emacs (24)) (cl-lib (0 5))) "additional completion for pcomplete" single]) (pcmpl-pip . [(20171201 33) ((s (1 12 0)) (f (0 19 0)) (seq (2 15))) "pcomplete for pip" single]) (pcmpl-homebrew . [(20170110 1609) nil "pcomplete for homebrew" single]) (pcmpl-git . [(20170120 1659) nil "pcomplete for git" tar]) (pcmpl-args . [(20120911 2224) nil "Enhanced shell command completion" single]) (pcap-mode . [(20161025 748) ((emacs (24 3))) "Major mode for working with PCAP files" single]) (pcache . [(20170105 1414) ((eieio (1 3))) "persistent caching for Emacs." single]) (pc-bufsw . [(20180107 1040) nil "PC style quick buffer switcher" single]) (pbcopy . [(20150224 2059) nil "Emacs Interface to pbcopy" single]) (paxedit . [(20160730 1027) ((cl-lib (0 5)) (paredit (23))) "Structured, Context Driven LISP Editing and Refactoring" single]) (pathify . [(20160423 146) nil "Symlink your scripts into a PATH directory" single]) (path-headerline-mode . [(20140423 632) nil "Displaying file path on headerline." single]) (pastery . [(20171113 1949) ((emacs (24 4)) (request (0 2 0))) "paste snippets to pastery.net." tar]) (pastelmac-theme . [(20151030 1936) ((emacs (24 1))) "a soothing theme with a pastel color palette" single]) (pastehub . [(20140614 2320) nil "A client for the PasteHub cloud service" single]) (pastebin . [(20101125 1202) nil "A simple interface to the www.pastebin.com webservice" single]) (paste-of-code . [(20170709 1655) ((emacs (24 3)) (request (0 2 0))) "paste code on https://paste.ofcode.org" single]) (password-vault . [(20160126 1020) ((cl-lib (0 2)) (emacs (24))) "A Password manager for Emacs." single]) (password-store-otp . [(20170928 18) ((emacs (25)) (s (1 9 0)) (password-store (0 1))) "Password store (pass) OTP extension support" single]) (password-store . [(20170829 1633) ((emacs (24)) (f (0 11 0)) (s (1 9 0)) (with-editor (2 5 11))) "Password store (pass) support" single]) (password-mode . [(20170411 2329) nil "Hide password text using overlays" single]) (password-generator . [(20150222 1240) nil "Password generator for humans. Good, Bad, Phonetic passwords included." single]) (passthword . [(20141201 123) ((cl-lib (0 5))) "Simple password manager" single]) (passmm . [(20180622 1626) ((emacs (24 4)) (password-store (0))) "A minor mode for pass (Password Store)." single]) (pass . [(20180201 451) ((emacs (24 3)) (password-store (0 1)) (password-store-otp (0 1 5)) (f (0 17))) "Major mode for password-store.el" single]) (pasp-mode . [(20180404 1000) ((emacs (24 3))) "- A major mode for editing Answer Set Programs." single]) (parseclj . [(20180602 1306) ((emacs (25)) (a (0 1 0 -3 4))) "Clojure/EDN parser" tar]) (parsec . [(20171202 2031) ((emacs (24)) (cl-lib (0 5))) "Parser combinator library" single]) (parsebib . [(20180116 627) ((emacs (24 3))) "A library for parsing bib files" single]) (parse-csv . [(20160512 1023) nil "Parse strings with CSV fields into s-expressions" single]) (parinfer . [(20180718 16) ((dash (2 13 0)) (cl-lib (0 5))) "Simpler Lisp editing" tar]) (parent-mode . [(20150824 1600) nil "get major mode's parent modes" single]) (paren-face . [(20180318 1325) nil "a face for parentheses in lisp modes" single]) (paren-completer . [(20160501 352) ((emacs (24 3))) "Automatically, language agnostically, fill in delimiters." single]) (paredit-menu . [(20160128 933) ((paredit (25))) "Adds a menu to paredit.el as memory aid" single]) (paredit-everywhere . [(20180506 149) ((paredit (22))) "Enable some paredit features in non-lisp buffers" single]) (paredit . [(20171126 1805) nil "minor mode for editing parentheses" single]) (paradox . [(20180216 334) ((emacs (24 4)) (seq (1 7)) (let-alist (1 0 3)) (spinner (1 7 3)) (hydra (0 13 2))) "A modern Packages Menu. Colored, with package ratings, and customizable." tar]) (paperless . [(20180224 445) ((emacs (24 4)) (f (0 11 0)) (s (1 10 0)) (cl-lib (0 6 1))) "A major mode for sorting and filing PDF documents." tar]) (paper-theme . [(20180429 1515) ((emacs (24))) "A minimal Emacs colour theme." single]) (pangu-spacing . [(20170317 157) nil "Minor-mode to add space between Chinese and English characters." single]) (pandoc-mode . [(20180710 746) ((hydra (0 10 0)) (dash (2 10 0))) "Minor mode for interacting with Pandoc" tar]) (pandoc . [(20161128 357) ((emacs (24 4))) "Pandoc interface" single]) (panda-theme . [(20180203 2318) ((emacs (24))) "Panda Theme" single]) (pamparam . [(20180415 48) ((emacs (24 3)) (lispy (0 26 0)) (worf (0 1 0)) (hydra (0 13 4))) "Simple and fast flashcards." single]) (pallet . [(20150512 2) ((dash (2 10 0)) (s (1 9 0)) (f (0 17 1)) (cask (0 7))) "A package management tool for Emacs, using Cask." tar]) (palimpsest . [(20170119 1232) nil "Various deletion strategies when editing" single]) (pager-default-keybindings . [(20130719 1357) ((pager (1 0))) "Add the default keybindings suggested for pager.el" single]) (pager . [(20151201 1720) nil "windows-scroll commands" single]) (page-break-lines . [(20171210 31) ((emacs (24 4))) "Display ^L page breaks as tidy horizontal lines" single]) (paganini-theme . [(20180710 821) ((emacs (24 0))) "A colorful, dark and warm theme." single]) (pacmacs . [(20160131 32) ((emacs (24 4)) (dash (2 11 0)) (dash-functional (1 2 0)) (cl-lib (0 5)) (f (0 18 0))) "Pacman for Emacs" tar]) (packed . [(20180318 1029) ((emacs (24 3))) "package manager agnostic Emacs Lisp package utilities" single]) (package-utils . [(20180514 715) ((restart-emacs (0 1 1))) "Extensions for package.el" single]) (package-safe-delete . [(20150116 807) ((emacs (24)) (epl (0 7 -4))) "Safely delete package.el packages" single]) (package-lint . [(20180608 2119) ((cl-lib (0 5)) (emacs (24))) "A linting library for elisp package authors" tar]) (package-filter . [(20161121 2319) nil "package archive whitelist and blacklist" single]) (package-build . [(20180628 2221) ((cl-lib (0 5))) "Tools for assembling a package archive" tar]) (package+ . [(20170815 1956) nil "Extensions for the package library." single]) (pabbrev . [(20160320 1401) nil "Predictive abbreviation expansion" single]) (p4 . [(20150721 1237) nil "Simple Perforce-Emacs Integration" single]) (ox-twiki . [(20170803 1339) ((org (8)) (cl-lib (0 5))) "org Twiki and Foswiki export" single]) (ox-twbs . [(20161103 1316) nil "Bootstrap compatible HTML Back-End for Org" single]) (ox-tufte . [(20160926 907) ((org (8 2)) (emacs (24))) "Tufte HTML org-mode export backend" single]) (ox-trac . [(20171026 1123) ((org (9 0))) "Org Export Backend to Trac WikiFormat" single]) (ox-tiddly . [(20180626 1352) ((org (8)) (cl-lib (0 5))) "org TiddlyWiki exporter" single]) (ox-textile . [(20180502 247) ((org (8 1))) "Textile Back-End for Org Export Engine" single]) (ox-rst . [(20180314 1713) ((emacs (24 4)) (org (8 2 4))) "Export reStructuredText using org-mode." single]) (ox-reveal . [(20161027 226) ((org (20150330))) "reveal.js Presentation Back-End for Org Export Engine" single]) (ox-qmd . [(20170402 957) ((org (8 0))) "Qiita Markdown Back-End for Org Export Engine" single]) (ox-pukiwiki . [(20150124 916) ((org (8 1))) "Pukiwiki Back-End for Org Export Engine" single]) (ox-pandoc . [(20180510 638) ((org (8 2)) (emacs (24)) (dash (2 8)) (ht (2 0)) (cl-lib (0 5))) "org exporter for pandoc." single]) (ox-nikola . [(20151114 316) ((emacs (24 4)) (org (8 2 4)) (ox-rst (0 2))) "Export Nikola articles using org-mode." single]) (ox-minutes . [(20180202 934) ((emacs (24 4))) "Plain text backend for Org for Meeting Minutes" single]) (ox-mediawiki . [(20180105 1354) ((cl-lib (0 5)) (s (1 9 0))) "Mediawiki Back-End for Org Export Engine" single]) (ox-jira . [(20171001 216) ((org (8 3))) "JIRA Backend for Org Export Engine" single]) (ox-ioslide . [(20161015 638) ((emacs (24 1)) (org (8 0)) (cl-lib (0 5)) (f (0 17 2)) (makey (0 3))) "Export org-mode to Google I/O HTML5 slide." tar]) (ox-impress-js . [(20150412 1016) ((org (8))) "impress.js Back-End for Org Export Engine" tar]) (ox-hugo . [(20180723 1139) ((emacs (24 4)) (org (9 0))) "Hugo Markdown Back-End for Org Export Engine" tar]) (ox-html5slide . [(20131227 2206) ((org (8 0))) "Export org-mode to HTML5 slide." single]) (ox-gfm . [(20170628 1402) nil "Github Flavored Markdown Back-End for Org Export Engine" single]) (ox-epub . [(20171202 1713) ((emacs (24 3)) (org (9))) "Export org mode projects to EPUB" single]) (ox-clip . [(20180305 1940) ((org (8 2)) (htmlize (0))) "Cross-platform formatted copying for org-mode" single]) (ox-bibtex-chinese . [(20170722 2009) ((emacs (24 4))) "Let ox-bibtex work well for Chinese users" tar]) (ox-asciidoc . [(20171111 354) ((org (8 1))) "AsciiDoc Back-End for Org Export Engine" single]) (owdriver . [(20170401 612) ((smartrep (0 0 3)) (log4e (0 2 0)) (yaxception (0 2 0))) "Quickly perform various actions on other windows" single]) (overseer . [(20180225 2219) ((emacs (24)) (dash (2 10 0)) (pkg-info (0 4)) (f (0 18 1))) "Ert-runner Integration Into Emacs" single]) (overcast-theme . [(20180315 1243) ((emacs (24))) "A dark but vibrant color theme for Emacs" single]) (ov . [(20150311 2228) ((emacs (24 3))) "Overlay library for Emacs Lisp" single]) (outshine . [(20180625 1259) ((outorg (2 0)) (cl-lib (0 5))) "outline with outshine outshines outline" tar]) (outrespace . [(20180711 732) ((emacs (24 4))) "c++ namespace utility functions" single]) (outorg . [(20170414 1215) ((emacs (24 4))) "Org-style comment editing" single]) (outlook . [(20180428 730) ((emacs (24 4))) "send emails in MS Outlook style" tar]) (outlined-elisp-mode . [(20131108 327) nil "outline-minor-mode settings for emacs lisp" single]) (outline-toc . [(20170730 430) nil "Sidebar showing a \"table of contents\"." single]) (outline-magic . [(20180619 1119) nil "outline mode extensions for Emacs" single]) (other-emacs-eval . [(20180408 648) ((emacs (25 1)) (async (1 9 2))) "Evaluate the Emacs Lisp expression in other Emacs" single]) (otama . [(20160404 332) nil "Org-table Manipulator" single]) (osx-trash . [(20160520 600) ((emacs (24 1))) "System trash for OS X" tar]) (osx-pseudo-daemon . [(20170721 2307) nil "Daemon mode that plays nice with OSX." single]) (osx-org-clock-menubar . [(20150205 1311) nil "simple menubar integration for org-clock" tar]) (osx-location . [(20150613 217) nil "Watch and respond to changes in geographical location on OS X" tar]) (osx-lib . [(20160919 1700) ((emacs (24 4))) "Basic function for Apple/OSX." single]) (osx-dictionary . [(20171026 34) ((cl-lib (0 5))) "Interface for OSX Dictionary.app" tar]) (osx-clipboard . [(20141012 17) nil "Use the OS X clipboard from terminal Emacs" single]) (osx-browse . [(20140508 1341) ((string-utils (0 3 2)) (browse-url-dwim (0 6 6))) "Web browsing helpers for OS X" single]) (origami . [(20180101 753) ((s (1 9 0)) (dash (2 5 0)) (emacs (24)) (cl-lib (0 5))) "Flexible text folding" tar]) (orgtbl-show-header . [(20141023 137) nil "Show the header of the current column in the minibuffer" single]) (orgtbl-join . [(20150121 1446) ((cl-lib (0 5))) "join columns from another table" tar]) (orgtbl-ascii-plot . [(20151215 1351) nil "ascii-art bar plots in org-mode tables" single]) (orgtbl-aggregate . [(20180620 1043) nil "Create an aggregated Org table from another one" tar]) (orgnav . [(20170608 1013) ((helm (2 7 0)) (s (1 11 0)) (dash (1 11 0)) (emacs (24))) "Org tree navigation using helm" tar]) (orglue . [(20171220 426) ((org (8 1)) (epic (0 2))) "more functionality to org-mode." tar]) (orglink . [(20180318 1323) ((emacs (24 3)) (dash (2 12 1)) (org (8 3))) "use Org Mode links in other modes" single]) (orgit . [(20180318 1301) ((emacs (24 4)) (dash (2 13 0)) (magit (2 10 0)) (org (8 3 3))) "support for Org links to Magit buffers" single]) (orgbox . [(20140528 1826) ((org (8 0)) (cl-lib (0 5))) "Mailbox-like task scheduling Org." single]) (organize-imports-java . [(20180623 1209) ((emacs (26)) (f (0 20 0)) (s (1 12 0)) (cl-lib (0 6))) "Mimic Eclipse's Organize Imports functionality." single]) (organic-green-theme . [(20180522 920) nil "Low-contrast green color theme." single]) (org2web . [(20171005 1617) ((cl-lib (1 0)) (ht (1 5)) (mustache (0 22)) (htmlize (1 47)) (org (8 0)) (dash (2 0 0)) (el2org (0 10)) (simple-httpd (0 1))) "A static site generator based on org mode." tar]) (org2jekyll . [(20170225 115) ((dash-functional (2 11 0)) (s (1 9 0)) (deferred (0 3 1)) (kv (0 0 19))) "Minor mode to publish org-mode post to jekyll without specific yaml" tar]) (org2issue . [(20160426 1818) ((org (8 0)) (emacs (24 4)) (ox-gfm (0 1)) (gh (0 1)) (s (20160405 920))) "export org to github issue" single]) (org2elcomment . [(20170324 245) ((org (8 3 4))) "Convert Org file to Elisp comments" single]) (org2ctex . [(20171016 2343) ((emacs (24 4))) "Export org to ctex (a latex macro for Chinese)" single]) (org2blog . [(20171218 1911) ((org (8 3)) (xml-rpc (1 6 12)) (metaweblog (1 0 1)) (htmlize (1 51))) "Blog from Org mode to wordpress" tar]) (org-wunderlist . [(20150817 1913) ((request-deferred (0 2 0)) (alert (1 1)) (emacs (24)) (cl-lib (0 5)) (org (8 2 4)) (s (1 9 0))) "Org sync with Wunderlist" single]) (org-wild-notifier . [(20180221 2025) ((alert (1 2)) (dash (2 13 0)) (emacs (24 4))) "Customizable org-agenda notifications" single]) (org-web-tools . [(20180531 1808) ((emacs (25 1)) (org (9 0)) (dash (2 12)) (esxml (0 3 4)) (s (1 10 0))) "Display and capture web content with Org-mode" single]) (org-wc . [(20180609 1953) nil "Count words in org mode trees." single]) (org-vcard . [(20170929 410) nil "org-mode support for vCard export and import." tar]) (org-variable-pitch . [(20180429 1515) ((emacs (25))) "Minor mode for variable pitch text in org mode." single]) (org-trello . [(20180330 2331) ((request-deferred (0 2 0)) (deferred (0 4 0)) (s (1 11 0)) (dash-functional (2 12 1)) (dash (2 12 1))) "Minor mode to synchronize org-mode buffer and trello board" tar]) (org-tree-slide . [(20180424 1636) nil "A presentation tool for org-mode" single]) (org-transform-tree-table . [(20150110 633) ((dash (2 10 0)) (s (1 3 0))) "Transform org-mode tree with properties to a table, and the other way around" single]) (org-tracktable . [(20161118 529) ((emacs (24)) (cl-lib (0 5))) "Track your writing progress in an org-table" single]) (org-toodledo . [(20150301 313) ((request-deferred (0 2 0)) (emacs (24)) (cl-lib (0 5))) "Toodledo integration for Emacs Org mode" tar]) (org-time-budgets . [(20151111 1) ((alert (0 5 10)) (cl-lib (0 5))) "Define time budgets and display clocked time." single]) (org-themis . [(20160121 2004) ((cl-lib (0 4))) "Experimental project management mode for org-mode" single]) (org-tfl . [(20170923 518) ((org (0 16 2)) (cl-lib (0 5)) (emacs (24 1))) "Transport for London meets Orgmode" tar]) (org-table-sticky-header . [(20170408 1814) ((org (8 2 10)) (emacs (24 4))) "Sticky header for org-mode tables" single]) (org-table-comment . [(20120209 1051) nil "Org table comment modes." single]) (org-sync-snippets . [(20170824 1128) ((org (8 3 5)) (emacs (24 3)) (f (0 17 3))) "Export snippets to org-mode and vice versa" single]) (org-sync . [(20180221 1127) ((cl-lib (0 5)) (org (8 2)) (emacs (24))) "Synchronize Org documents with External Issue Trackers" tar]) (org-super-agenda . [(20180714 1348) ((emacs (25 1)) (s (1 10 0)) (dash (2 13)) (org (9 0)) (ht (2 2))) "Supercharge your agenda" single]) (org-sticky-header . [(20170422 2135) ((emacs (24 4)) (org (8 3 5))) "Show off-screen Org heading at top of window" single]) (org-static-blog . [(20180527 2348) ((emacs (24 3))) "a simple org-mode based static blog generator" single]) (org-send-ebook . [(20180401 1015) ((emacs (25)) (cl-lib (0 5)) (seq (2 20))) "Send org link file to ebook reader." single]) (org-seek . [(20161216 2102) ((emacs (24 3)) (ag (0 48))) "Searching Org-mode files with search tools." single]) (org-rtm . [(20160214 436) ((rtm (0 1))) "Simple import/export from rememberthemilk to org-mode" single]) (org-rich-yank . [(20180430 644) ((emacs (24 4))) "paste with org-mode markup and link to source" single]) (org-review . [(20160906 2237) nil "schedule reviews for Org entries" single]) (org-repo-todo . [(20171227 1719) nil "Simple repository todo management with org-mode" single]) (org-ref . [(20180706 614) ((dash (2 11 0)) (htmlize (1 51)) (helm (1 5 5)) (helm-bibtex (2 0 0)) (ivy (0 8 0)) (hydra (0 13 2)) (key-chord (0)) (s (1 10 0)) (f (0 18 0)) (emacs (24 4)) (pdf-tools (0 7))) "citations, cross-references and bibliographies in org-mode" tar]) (org-redmine . [(20160711 414) nil "Redmine tools using Emacs OrgMode" single]) (org-recent-headings . [(20170907 2129) ((emacs (25 1)) (org (9 0 5)) (dash (2 13 0)) (frecency (0 1))) "Jump to recently used Org headings" single]) (org-readme . [(20151204 417) ((http-post-simple (1 0)) (yaoddmuse (0 1 1)) (header2 (21 0)) (lib-requires (21 0)) (cl-lib (0 5))) "Integrates Readme.org and Commentary/Change-logs." tar]) (org-randomnote . [(20171210 557) ((f (0 19 0)) (dash (2 12 0))) "Find a random note in your Org-Mode files" single]) (org-random-todo . [(20180312 104) ((emacs (24 3)) (alert (1 2))) "show a random TODO (with alert) every so often" single]) (org-radiobutton . [(20180612 328) ((dash (2 13 0)) (emacs (24))) "Radiobutton for org-mode lists." single]) (org-protocol-jekyll . [(20170328 939) ((cl-lib (0 5))) "Jekyll's handler for org-protocol" single]) (org-projectile-helm . [(20180601 1122) ((org-projectile (1 0 0)) (helm (2 3 1)) (emacs (25))) "helm functions for org-projectile" single]) (org-projectile . [(20180531 1942) ((projectile (0 11 0)) (dash (2 10 0)) (emacs (24)) (s (1 9 0)) (org-category-capture (0 0 0))) "Repository todo management for org-mode" single]) (org-preview-html . [(20180624 2319) ((org (8 0)) (emacs (24 4))) "automatically use eww to preview the current org file on save" single]) (org-present . [(20180303 1530) ((org (7))) "Minimalist presentation minor-mode for Emacs org-mode." single]) (org-pomodoro . [(20171108 1314) ((alert (0 5 10)) (cl-lib (0 5))) "Pomodoro implementation for org-mode." tar]) (org-pdfview . [(20180225 206) ((org (8 2 10)) (pdf-tools (0 80))) "Support for links to documents in pdfview mode" single]) (org-password-manager . [(20180227 1010) ((org (8 2 10)) (s (1 9 0)) (dash (2 13 0))) "Password manager for Org Mode." single]) (org-parser . [(20171002 2136) ((emacs (25 1)) (dash (2 12 0)) (ht (2 1))) "parse org files into structured datatypes." single]) (org-page . [(20170806 1924) ((ht (1 5)) (simple-httpd (1 4 6)) (mustache (0 22)) (htmlize (1 47)) (org (8 0)) (dash (2 0 0)) (cl-lib (0 5)) (git (0 1 1))) "a static site generator based on org mode" tar]) (org-outlook . [(20160705 638) nil "Outlook org" tar]) (org-outline-numbering . [(20180705 801) ((emacs (24)) (org (8 3)) (cl-lib (0 6)) (ov (1 0 6))) "Show outline numbering as overlays in org-mode" single]) (org-onenote . [(20171007 2200) ((oauth2 (0 11)) (request (0 2 0)) (org (8 2 10))) "export org-mode document to onenote." single]) (org-octopress . [(20170820 2115) ((org (9 0)) (orglue (0 1)) (ctable (0 1 1))) "Compose octopress articles using org-mode." tar]) (org-noter . [(20180723 1804) ((emacs (24 4)) (cl-lib (0 6)) (org (9 0))) "A synchronized, Org-mode, document annotator" single]) (org-notebook . [(20170321 2152) ((emacs (24)) (org (8)) (cl-lib (0 5))) "Ease the use of org-mode as a notebook" single]) (org-multiple-keymap . [(20150328 1806) ((org (8 2 4)) (emacs (24)) (cl-lib (0 5))) "Set keymap to elements, such as timestamp and priority." single]) (org-mru-clock . [(20180419 606) ((emacs (24 3))) "clock in/out of tasks with completion and persistent history" single]) (org-mobile-sync . [(20180605 2224) ((emacs (24 3 50)) (org (8 0))) "automatically sync org-mobile on changes" single]) (org-mind-map . [(20180614 1352) ((emacs (24)) (dash (1 8 0)) (org (8 2 10))) "Creates a directed graph from org-mode files" single]) (org-mime . [(20180607 2350) ((emacs (24 4)) (cl-lib (0 5))) "org html export for text/html MIME emails" single]) (org-make-toc . [(20180614 1959) ((emacs (25 1)) (dash (2 12)) (s (1 10 0)) (org (9 0))) "Automatic tables of contents for Org files" single]) (org-listcruncher . [(20180630 1326) ((cl-lib (0 5)) (seq (2 3)) (emacs (24 4))) "Parse Org mode list contents into table" single]) (org-linkany . [(20160206 2011) ((log4e (0 2 0)) (yaxception (0 1))) "Insert link using anything.el/helm.el on org-mode" single]) (org-link-travis . [(20140405 1627) ((org (7))) "Insert/Export the link of Travis CI on org-mode" single]) (org-link-minor-mode . [(20170805 1152) ((org (8))) "Enable org-mode links in non-org modes" single]) (org-kanban . [(20180722 2301) ((dash (2 13 0)) (emacs (24 4)) (org (9 1))) "kanban dynamic block for org-mode." single]) (org-journal . [(20180723 57) ((emacs (25 1))) "a simple org-mode based journaling mode" single]) (org-jira . [(20180625 2111) ((emacs (24 5)) (cl-lib (0 5)) (request (0 2 0)) (s (0 0 0))) "Syncing between Jira and Org-mode." tar]) (org-iv . [(20171001 322) ((impatient-mode (1 0 0)) (org (8 0)) (cl-lib (0 5))) "a tool used to view html (in browser) generated by org-file once the org-file changes" tar]) (org-index . [(20180723 842) ((emacs (24 4))) "A personal adaptive index for org" single]) (org-if . [(20150920 813) nil "Interactive Fiction Authoring System for Org-Mode." tar]) (org-grep . [(20151202 429) ((cl-lib (0 5))) "Kind of M-x rgrep adapted for Org mode." single]) (org-gnome . [(20150614 757) ((alert (1 2)) (telepathy (0 1)) (gnome-calendar (0 1))) "Orgmode integration with the GNOME desktop" single]) (org-gcal . [(20170420 1401) ((request-deferred (0 2 0)) (alert (1 1)) (emacs (24)) (cl-lib (0 5)) (org (8 2 4))) "Org sync with Google Calendar" single]) (org-fancy-priorities . [(20180328 1631) nil "Display org priorities as custom strings" single]) (org-evil . [(20180620 817) ((dash (2 13 0)) (evil (0)) (monitor (0)) (org (0))) "Evil extensions for Org." tar]) (org-emms . [(20180720 659) ((emacs (24))) "Play multimedia files from org-mode" single]) (org-elisp-help . [(20161121 1655) ((cl-lib (0 5)) (org (9 0))) "org links to emacs-lisp documentation" single]) (org-ehtml . [(20150506 1658) ((web-server (20140109 2200)) (emacs (24 3))) "Export Org-mode files as editable web pages" tar]) (org-edit-latex . [(20170908 822) ((emacs (24 4)) (auctex (11 90))) "Edit embedded LaTeX in a dedicated buffer" single]) (org-easy-img-insert . [(20160915 1308) ((emacs (24 4))) "An easier way to add images from the web in org mode" single]) (org-dropbox . [(20150113 2109) ((dash (2 2)) (names (20150000)) (emacs (24))) "move Dropbox notes from phone into org-mode datetree" single]) (org-drill-table . [(20180115 209) ((s (1 7 0)) (dash (2 2 0)) (cl-lib (0 3)) (org (8 2)) (emacs (24 1))) "Generate drill cards from org tables" single]) (org-dp . [(20180311 123) ((cl-lib (0 5))) "Declarative Local Programming with Org Elements" tar]) (org-download . [(20180625 842) ((async (1 2))) "Image drag-and-drop for Emacs org-mode" single]) (org-dotemacs . [(20151119 1022) ((org (7 9 3)) (cl-lib (1 0))) "Store your emacs config as an org file, and choose which bits to load." single]) (org-doing . [(20161017 920) nil "Keep track of what you're doing" tar]) (org-dashboard . [(20171223 1124) ((cl-lib (0 5))) "Visually summarize progress in org files" single]) (org-cua-dwim . [(20120202 2134) nil "Org-mode and Cua mode compatibility layer" single]) (org-context . [(20170107 537) nil "Contextual capture and agenda commands for Org-mode" single]) (org-commentary . [(20160801 2337) ((dash (2 0)) (emacs (24 4)) (org (8 0))) "generate or update conventional library headers using Org mode files" tar]) (org-clock-today . [(20161014 220) ((emacs (25))) "Show the total clocked time of the current day in the mode line" single]) (org-clock-csv . [(20180313 1957) ((org (8 3)) (s (1 0))) "Export `org-mode' clock entries to CSV format." single]) (org-clock-convenience . [(20160830 1156) ((cl-lib (0 5)) (org (8)) (emacs (24 3))) "convenience functions for org time tracking" single]) (org-cliplink . [(20180717 408) ((emacs (24 4))) "insert org-mode links from the clipboard" tar]) (org-chef . [(20180706 1835) ((org (0)) (emacs (24))) "Cookbook and recipe management with org-mode." tar]) (org-category-capture . [(20180531 1942) ((org (9 0 0)) (emacs (24))) "Contextualy capture of org-mode TODOs." single]) (org-capture-pop-frame . [(20160518 308) ((emacs (24 4))) "Run org-capture in a new pop frame" single]) (org-caldav . [(20180403 1336) ((org (7))) "Sync org files with external calendar through CalDAV" single]) (org-bullets . [(20171127 526) nil "Show bullets in org-mode as UTF-8 characters" single]) (org-brain . [(20180712 1410) ((emacs (25)) (org (9))) "Org-mode concept mapping" single]) (org-bookmark-heading . [(20170510 1008) ((emacs (24 4))) "Emacs bookmark support for org-mode" single]) (org-board . [(20180530 1120) nil "bookmarking and web archival system for Org mode." single]) (org-beautify-theme . [(20170908 1518) nil "A sub-theme to make org-mode more beautiful." single]) (org-babel-eval-in-repl . [(20170511 514) ((eval-in-repl (0 9 2)) (matlab-mode (3 3 6)) (ess (16 10)) (emacs (24))) "Eval org-mode babel code blocks in various REPLs." tar]) (org-autolist . [(20170924 1201) nil "Improved list management in org-mode" single]) (org-attach-screenshot . [(20180419 2225) nil "screenshots integrated with org attachment dirs" single]) (org-alert . [(20180523 1833) ((s (1 10 0)) (dash (2 11 0)) (alert (1 2))) "Notify org deadlines via notify-send" single]) (org-agenda-property . [(20140626 1416) ((emacs (24 2))) "Display org properties in the agenda buffer." single]) (org-ac . [(20170401 607) ((auto-complete-pcmp (0 0 1)) (log4e (0 2 0)) (yaxception (0 1))) "Some auto-complete sources for org-mode" single]) (orca . [(20171030 1216) ((emacs (24 3))) "Org Capture" single]) (operate-on-number . [(20150706 2323) nil "Operate on number at point with arithmetic functions" single]) (openwith . [(20120531 1436) nil "Open files with external programs" single]) (openstack-cgit-browse-file . [(20130819 227) nil "Browse the current file in OpenStack cgit" single]) (opensource . [(20160926 916) ((s (1 11 0)) (dash (2 12 1)) (pkg-info (0 6 0)) (request (0 2 0))) "Client for Opensource API" tar]) (opener . [(20161207 1010) ((request (0 2 0)) (emacs (24)) (cl-lib (0 5))) "opening urls as buffers" tar]) (opencl-mode . [(20170816 549) nil "Syntax coloring for opencl kernels" single]) (opencc . [(20170722 116) ((emacs (24 4))) "中文简繁转换 <-> 中文簡繁轉換 (Convert Chinese with OpenCC)" single]) (open-junk-file . [(20161210 314) nil "Open a junk (memo) file to try-and-error" single]) (open-in-msvs . [(20170123 1428) nil "Open current file:line:column in Microsoft Visual Studio" tar]) (opam . [(20150719 520) ((emacs (24 1))) "OPAM tools" single]) (one-time-pad-encrypt . [(20160329 813) nil "One time pad encryption within file" single]) (one-themes . [(20180507 1008) ((emacs (24))) "One Colorscheme" tar]) (on-screen . [(20160302 150) ((cl-lib (0))) "guide your eyes while scrolling" single]) (on-parens . [(20180202 1441) ((dash (2 10 0)) (emacs (24)) (evil (1 1 6)) (smartparens (1 6 3))) "smartparens wrapper to fit with evil-mode/vim normal-state" single]) (omtose-phellack-theme . [(20161111 1320) nil "A dark theme, with cold bluish touch." tar]) (omnisharp . [(20180606 318) ((emacs (24 4)) (flycheck (30)) (dash (2 12 0)) (auto-complete (1 4)) (popup (0 5 1)) (csharp-mode (0 8 7)) (cl-lib (0 5)) (s (1 10 0)) (shut-up (0 3 2)) (f (0 19 0))) "Omnicompletion (intellisense) and more for C#" tar]) (omnibox . [(20180422 1749) ((emacs (26 1)) (dash (2 13)) (frame-local (0 0 1))) "Selection package" single]) (omni-tags . [(20170426 1409) ((pcre2el (1 7)) (cl-lib (0 5))) "Highlight and Actions for 'Tags'" tar]) (omni-scratch . [(20171009 1451) nil "Easy and mode-specific draft buffers" single]) (omni-quotes . [(20170425 1132) ((dash (2 8)) (omni-log (0 3 3)) (f (0 19 0)) (s (1 11 0)) (ht (2 1))) "Random quotes displayer" tar]) (omni-log . [(20170930 535) ((emacs (24)) (ht (2 0)) (s (1 6 1)) (dash (2 13 0))) "Logging utilities" tar]) (omni-kill . [(20171016 1440) nil "Kill all the things" single]) (om-mode . [(20140915 1410) nil "Insert Om component template with life cycle." single]) (olivetti . [(20180531 37) ((emacs (24 4))) "Minor mode for a nice writing environment" single]) (oldlace-theme . [(20150705 600) ((emacs (24))) "Emacs 24 theme with an 'oldlace' background." single]) (old-norse-input . [(20170816 1142) ((emacs (24))) "An input method for Old Norse" single]) (offlineimap . [(20150916 458) nil "Run OfflineIMAP from Emacs" single]) (octopress . [(20170813 615) nil "A lightweight wrapper for Jekyll and Octopress." tar]) (octo-mode . [(20161008 529) ((emacs (24))) "Major mode for Octo assembly language" single]) (octicons . [(20151031 2040) ((cl-lib (0 5))) "octicons utility" tar]) (ocp-indent . [(20180417 849) nil "automatic indentation with ocp-indent" single]) (ocodo-svg-modelines . [(20150516 719) ((svg-mode-line-themes (0))) "A collection of beautiful SVG modelines" tar]) (oceanic-theme . [(20161015 119) nil "Oceanic theme." single]) (occur-x . [(20130610 643) nil "Extra functionality for occur" single]) (occur-context-resize . [(20170904 1609) nil "dynamically resize context around matches in occur-mode" single]) (occidental-theme . [(20130312 1258) nil "Custom theme for faces based on Adwaita" single]) (obsidian-theme . [(20170719 248) nil "port of the eclipse obsidian theme" single]) (objc-font-lock . [(20141021 1122) nil "Highlight Objective-C method calls." single]) (obfusurl . [(20170809 824) ((cl-lib (0 5))) "Obfuscate URLs so they aren't spoilers" single]) (oberon . [(20120715 209) nil "Major mode for editing Oberon/Oberon-2 program texts" single]) (ob-uart . [(20170521 158) nil "org-babel support for UART communication" single]) (ob-typescript . [(20150804 530) ((emacs (24)) (org (8 0))) "org-babel functions for typescript evaluation" single]) (ob-translate . [(20170720 1219) ((google-translate (0 11)) (org (8))) "Translation of text blocks in org-mode." single]) (ob-swift . [(20170921 625) ((org (8))) "org-babel functions for swift evaluation" single]) (ob-sql-mode . [(20180426 1211) ((emacs (24 4))) "SQL code blocks evaluated by sql-mode" single]) (ob-sml . [(20130829 1143) ((sml-mode (6 4))) "org-babel functions for template evaluation" single]) (ob-sagemath . [(20170130 1833) ((sage-shell-mode (0 0 8)) (s (1 8 0)) (emacs (24))) "org-babel functions for SageMath evaluation" tar]) (ob-rust . [(20180606 1646) nil "Org-babel functions for Rust" tar]) (ob-restclient . [(20180703 902) ((restclient (0))) "org-babel functions for restclient-mode" single]) (ob-prolog . [(20180720 344) nil "org-babel functions for prolog evaluation." single]) (ob-nim . [(20170809 1130) ((cl-lib (0 5))) "Babel Functions for nim" single]) (ob-mongo . [(20170720 1219) ((org (8))) "Execute mongodb queries within org-mode blocks." single]) (ob-ml-marklogic . [(20170622 1133) nil "org-babel functions for MarkLogic evaluation" tar]) (ob-mermaid . [(20180522 959) nil "org-babel support for mermaid evaluation" single]) (ob-lfe . [(20170725 720) ((org (8))) "org-babel functions for lfe evaluation" single]) (ob-kotlin . [(20170725 718) ((org (8))) "org-babel functions for kotlin evaluation" single]) (ob-ipython . [(20180224 153) ((s (1 9 0)) (dash (2 10 0)) (dash-functional (1 2 0)) (f (0 17 2)) (emacs (24))) "org-babel functions for IPython evaluation" tar]) (ob-hy . [(20180701 2240) ((emacs (24 4))) "org-babel functions for Hy-lang evaluation" tar]) (ob-http . [(20180707 748) ((s (1 9 0)) (cl-lib (0 5))) "http request in org-mode babel" tar]) (ob-go . [(20170731 1057) nil "org-babel functions for go evaluation" tar]) (ob-fsharp . [(20170618 729) ((emacs (25)) (fsharp-mode (1 9 8))) "Org-Babel F#" single]) (ob-elvish . [(20180427 1200) nil "org-babel functions for Elvish shell" single]) (ob-elixir . [(20170725 719) ((org (8))) "org-babel functions for elixir evaluation" single]) (ob-diagrams . [(20160407 537) nil "org-babel functions for diagrams evaluation" single]) (ob-dart . [(20170106 824) nil "org-babel functions for Dart evaluation" single]) (ob-dao . [(20170816 858) ((org (8))) "Org Babel Functions for Dao" single]) (ob-cypher . [(20170725 720) ((s (1 9 0)) (cypher-mode (0 0 6)) (dash (2 10 0)) (dash-functional (1 2 0))) "query neo4j using cypher in org-mode blocks" single]) (ob-crystal . [(20180125 2318) ((emacs (24 3))) "org-babel functions for Crystal evaluation" tar]) (ob-coffeescript . [(20180125 2319) ((emacs (24 4))) "org-babel functions for coffee-script evaluation, and fully implementation!" single]) (ob-coffee . [(20170725 724) ((org (8))) "org-babel functions for coffee-script evaluation" tar]) (ob-clojurescript . [(20180406 1128) ((emacs (24 4)) (org (9 0))) "org-babel functions for ClojureScript evaluation" single]) (ob-cfengine3 . [(20180102 1012) nil "Org Babel functions for CFEngine 3" single]) (ob-browser . [(20170720 1218) ((org (8))) "Render HTML in org-mode blocks." tar]) (ob-blockdiag . [(20170727 1801) nil "org-babel functions for blockdiag evaluation" single]) (ob-axiom . [(20171103 1548) ((emacs (24 2)) (axiom-environment (20171021))) "An org-babel backend for the axiom-environment system" single]) (ob-async . [(20180624 1553) ((async (1 9)) (org (9 0 1)) (emacs (24 4)) (dash (2 14 1))) "Asynchronous org-babel src block execution" single]) (ob-applescript . [(20160914 1327) nil "org-babel functions for template evaluation" single]) (oauth . [(20130127 1751) nil "Oauth library." tar]) (o-blog . [(20151202 1539) nil "Standalone orgmode blog exporter" tar]) (nyx-theme . [(20170910 607) ((emacs (24))) "Dark theme" single]) (nyan-mode . [(20170423 40) nil "Nyan Cat shows position in current buffer in mode-line." tar]) (nvm . [(20171217 836) ((s (1 8 0)) (dash (2 4 0)) (f (0 14 0)) (dash-functional (2 4 0))) "Manage Node versions within Emacs" single]) (nv-delete-back . [(20170224 449) ((emacs (24))) "backward delete like modern text editors" single]) (nummm-mode . [(20131117 214) nil "Display the number of minor modes instead of their names" single]) (numbers . [(20170802 434) ((emacs (24))) "Display information and trivia about numbers" single]) (number-lock . [(20160829 1900) nil "Enter symbols on your number keys without pressing shift" single]) (number . [(20170901 612) nil "Working with numbers at point." single]) (nubox . [(20170619 210) nil "Nubox color theme (dark, light and tty versions)" tar]) (nu-mode . [(20180619 1428) ((undo-tree (0 6 5)) (ace-window (0)) (avy (0)) (which-key (0)) (transpose-frame (0))) "Modern Emacs Prompts Based Keybinding." tar]) (nsis-mode . [(20180718 2008) nil "NSIS-mode" tar]) (nrepl-sync . [(20140807 854) ((cider (0 6))) "connect to nrepl port and eval .sync.clj." single]) (nrepl-eval-sexp-fu . [(20140311 341) ((highlight (0 0 0)) (smartparens (0 0 0)) (thingatpt (0 0 0))) "Tiny functionality enhancements for evaluating sexps." single]) (npm-mode . [(20180720 1001) ((emacs (24 1))) "minor mode for working with npm projects" single]) (noxml-fold . [(20170823 657) nil "Fold away XML things." single]) (nova-theme . [(20180530 801) ((emacs (24 3))) "A dark, pastel color theme" single]) (nov . [(20180617 1444) ((dash (2 12 0)) (esxml (0 3 3)) (emacs (24 4))) "Featureful EPUB reader mode" single]) (notmuch-labeler . [(20131230 919) ((notmuch (0))) "Improve notmuch way of displaying labels" tar]) (notmuch . [(20180503 1659) nil "run notmuch within emacs" tar]) (nose . [(20140520 948) nil "Easy Python test running in Emacs" single]) (northcode-theme . [(20180423 949) ((emacs (24))) "A dark theme focused on blue and orange colors." single]) (nordless-theme . [(20180613 50) nil "A mostly colorless theme" single]) (nord-theme . [(20180102 1001) ((emacs (24))) "An arctic, north-bluish clean and elegant theme" single]) (nofrils-acme-theme . [(20180620 548) ((emacs (24))) "Port of \"No Frils Acme\" Vim theme." tar]) (noflet . [(20141102 654) nil "locally override functions" single]) (nodemcu-mode . [(20180501 1525) ((emacs (25))) "Minor mode for NodeMCU" single]) (nodejs-repl . [(20170722 443) nil "Run Node.js REPL" single]) (node-resolver . [(20140930 1023) ((cl-lib (0 5))) "hook to install node modules in background" single]) (noctilux-theme . [(20161113 642) ((emacs (24))) "Dark theme inspired by LightTable" single]) (nocomments-mode . [(20170213 1237) nil "Minor mode that makes comments invisible." single]) (noccur . [(20150514 1420) nil "Run multi-occur on project/dired files" single]) (noaa . [(20180419 1133) ((request (0 2 0)) (cl-lib (0 5)) (emacs (24))) "Get NOAA weather data" single]) (no-littering . [(20180723 1440) ((cl-lib (0 5))) "help keeping ~/.emacs.d clean" single]) (no-emoji . [(20180515 1137) ((emacs (24))) "Show :emoji-name: instead of emoji characters" single]) (nnir-est . [(20180710 1403) nil "Gnus nnir interface for HyperEstraier" single]) (nm . [(20151110 1110) ((notmuch (0 21)) (peg (0 6)) (company (0)) (emacs (24 3))) "NEVERMORE: an email interface for Notmuch" tar]) (nlinum-relative . [(20160526 8) ((emacs (24 4)) (nlinum (1 5))) "Relative line number with nlinum" single]) (nlinum-hl . [(20170613 1748) ((emacs (24 4)) (nlinum (1 7)) (cl-lib (0 5))) "heal nlinum's line numbers" single]) (nixos-options . [(20160209 1041) ((emacs (24))) "Interface for browsing and completing NixOS options." single]) (nix-update . [(20180424 1748) ((emacs (25))) "Update \"fetch\" blocks in .nix expressions" single]) (nix-sandbox . [(20171004 1006) ((dash (2 12 1)) (s (1 10 0))) "Utility functions to work with nix-shell sandboxes" single]) (nix-mode . [(20180629 1501) ((emacs (24 3))) "Major mode for editing .nix files" tar]) (nix-buffer . [(20180212 718) ((f (0 17 3)) (emacs (24 4))) "Set up buffer environments with nix" single]) (ninja-mode . [(20141203 2159) ((emacs (24))) "Major mode for editing .ninja files" single]) (nimbus-theme . [(20180606 1936) nil "An awesome dark theme" single]) (nim-mode . [(20180516 1309) ((emacs (24 4)) (epc (0 1 1)) (let-alist (1 0 1)) (commenter (0 5 1)) (flycheck-nimsuggest (0 8 1))) "A major mode for the Nim programming language" tar]) (nikola . [(20170703 1321) ((async (1 5)) (emacs (24 3))) "Simple wrapper for nikola" single]) (night-owl-theme . [(20180630 1431) ((emacs (24))) "A color theme for the night owls out there" single]) (niconama . [(20170910 801) ((emacs (24)) (request (20170131 1747)) (cl-lib (0 5))) "Tools for Niconico Live Broadcast" single]) (niceify-info . [(20160416 544) nil "improve usability of Info pages" single]) (nginx-mode . [(20170611 2137) nil "major mode for editing nginx config files" single]) (ng2-mode . [(20180520 1731) ((typescript-mode (0 1))) "Major modes for editing Angular 2" tar]) (nexus . [(20140114 505) nil "REST Client for Nexus Maven Repository servers" tar]) (newlisp-mode . [(20160226 745) nil "newLISP editing mode for Emacs" single]) (never-comment . [(20140104 1407) nil "Never blocks are comment" single]) (network-watch . [(20171123 346) ((emacs (24 3))) "Support for intermittent network connectivity" single]) (netrunner . [(20160910 1632) ((popup (0 5 3)) (company (0 9 0)) (helm (1 9 5))) "Create Android: Netrunner decklists using Company, Helm and org-mode" single]) (netherlands-holidays . [(20150202 817) nil "Netherlands holidays for Emacs calendar." single]) (netease-music . [(20180429 1822) ((names (0 5)) (emacs (25))) "listen netease music" single]) (nerdtab . [(20180527 408) ((emacs (24 5))) "Keyboard-oriented tabs" single]) (neotree . [(20180616 903) ((cl-lib (0 5))) "A tree plugin like NerdTree for Vim" tar]) (neon-mode . [(20180406 456) nil "Simple major mode for editing neon files" single]) (nemerle . [(20161029 1323) nil "major mode for editing nemerle programs" single]) (neato-graph-bar . [(20171230 1753) ((emacs (24 3))) "Neat-o graph bars CPU/memory etc." single]) (nclip . [(20130617 1315) nil "Network (HTTP) Clipboard" tar]) (ncl-mode . [(20180128 2303) ((emacs (24))) "Major Mode for editing NCL scripts and other goodies" tar]) (navorski . [(20141203 1024) ((s (1 9 0)) (dash (1 5 0)) (multi-term (0 8 14))) "Helping you live in the terminal, like Viktor did." single]) (navi2ch . [(20150329 1916) nil "Navigator for 2ch for Emacsen" tar]) (navi-mode . [(20180515 1948) ((outshine (2 0)) (outorg (2 0))) "major-mode for easy buffer-navigation" single]) (nav-flash . [(20140508 1341) nil "Briefly highlight the current line" single]) (nav . [(20120507 7) nil "Emacs mode for filesystem navigation" tar]) (nasm-mode . [(20180711 1209) ((emacs (24 3))) "NASM x86 assembly major mode" single]) (nash-mode . [(20160830 512) nil "Nash major mode" single]) (narrowed-page-navigation . [(20150108 2119) ((emacs (24)) (cl-lib (0 5))) "A minor mode for showing one page at a time" single]) (narrow-reindent . [(20150722 1206) ((emacs (24 4))) "Defines a minor mode to left-align narrowed regions." single]) (naquadah-theme . [(20180212 440) nil "A theme based on Tango color set" single]) (nanowrimo . [(20151104 1828) nil "Track progress for nanowrimo" single]) (nand2tetris-assembler . [(20171201 1013) ((nand2tetris (1 1 0))) "Assembler For the Nand2tetris Course" single]) (nand2tetris . [(20171201 1013) ((emacs (24))) "Major mode for HDL files in the nand2tetris course" tar]) (namespaces . [(20130326 1550) nil "An implementation of namespaces for Elisp, with an emphasis on immutabilty." single]) (names . [(20180321 455) ((emacs (24 1)) (cl-lib (0 5))) "Namespaces for emacs-lisp. Avoid name clobbering without hiding symbols." tar]) (nameless . [(20180215 1421) ((emacs (24 4))) "Hide package namespace in your emacs-lisp code" single]) (nameframe-projectile . [(20160927 2103) ((nameframe (0 4 1 -2)) (projectile (0 13 0))) "Nameframe integration with Projectile" single]) (nameframe-perspective . [(20170405 1819) ((nameframe (0 4 1 -2)) (perspective (1 12))) "Nameframe integration with perspective.el" single]) (nameframe . [(20171106 1656) nil "Manage frames by name." single]) (name-this-color . [(20151014 1330) ((emacs (24)) (cl-lib (0 5)) (dash (2 11 0))) "Match RGB codes to names easily and precisely" single]) (n4js . [(20150713 1931) ((emacs (24)) (cypher-mode (0))) "Neo4j Shell" single]) (myterminal-controls . [(20170425 1936) ((emacs (24)) (cl-lib (0 5))) "Quick toggle controls at a key-stroke" single]) (mysql2sqlite . [(20170725 1516) nil "Convert mysql databases into sqlite databases." single]) (mysql-to-org . [(20180123 714) ((emacs (24 3)) (s (1 11 0))) "Minor mode to output the results of mysql queries to org tables" single]) (mynt-mode . [(20150512 1349) ((virtualenvwrapper (20131514))) "Minor mode to work with the mynt static site generator" single]) (mykie . [(20150808 1505) ((emacs (24 3)) (cl-lib (0 5))) "Command multiplexer: Register multiple functions to a keybind" tar]) (myanmar-input-methods . [(20160106 737) nil "Emacs Input Method for Myanmar" single]) (mxf-view . [(20180501 40) ((emacs (25))) "Simple MXF viewer" single]) (mwim . [(20180227 852) nil "Switch between the beginning/end of line or code" single]) (mw-thesaurus . [(20180628 2225) ((emacs (25))) "Merriam-Webster Thesaurus" single]) (mvn . [(20160211 743) nil "helpers for compiling with maven" single]) (mutant . [(20160124 553) ((emacs (24 4)) (dash (2 1 0))) "An interface for the Mutant testing tool" single]) (mustard-theme . [(20170808 619) ((emacs (24 0))) "an Emacs 24 theme based on Mustard (tmTheme)" single]) (mustang-theme . [(20170719 246) nil "port of vim's mustang theme" single]) (mustache-mode . [(20141024 732) nil "A major mode for editing Mustache files." single]) (mustache . [(20170923 533) ((ht (0 9)) (s (1 3 0)) (dash (1 2 0))) "a mustache templating library in emacs lisp" tar]) (multitran . [(20180320 956) ((emacs (24)) (cl-lib (0 5))) "Interface to multitran" single]) (multiple-cursors . [(20180615 518) ((cl-lib (0 5))) "Multiple cursors for Emacs." tar]) (multifiles . [(20130615 1433) nil "View and edit parts of multiple files in one buffer" single]) (multicolumn . [(20150202 1451) nil "Creating and managing multiple side-by-side windows." single]) (multi-web-mode . [(20130823 2054) nil "multiple major mode support for web editing" tar]) (multi-term . [(20160619 233) nil "Managing multiple terminal buffers in Emacs." single]) (multi-run . [(20180122 709) ((emacs (24)) (window-layout (1 4))) "Manage multiple terminals and run commands on them" single]) (multi-project . [(20171217 1211) ((emacs (25))) "Find files, compile, search, and switch between" single]) (multi-line . [(20170821 1926) ((emacs (24 3)) (s (1 9 0)) (cl-lib (0 5)) (dash (2 12 0)) (shut-up (0 3 2))) "multi-line statements" tar]) (multi-compile . [(20160306 1423) ((emacs (24)) (dash (2 12 1))) "Multi target interface to compile." single]) (multi . [(20131013 844) ((emacs (24))) "Clojure-style multi-methods for emacs lisp" single]) (muban . [(20180415 519) ((emacs (25))) "Lightweight template expansion tool" single]) (mu4e-query-fragments . [(20170923 622) ((emacs (24 4))) "mu4e query fragments extension" single]) (mu4e-maildirs-extension . [(20180606 112) ((dash (0 0 0))) "Show mu4e maildirs summary in mu4e-main-view" single]) (mu4e-jump-to-list . [(20180425 1132) ((emacs (24 4)) (cl-lib (0 5))) "mu4e jump-to-list extension" single]) (mu4e-conversation . [(20180722 159) ((emacs (25 1))) "Show a complete thread in a single buffer" single]) (mu4e-alert . [(20180304 2246) ((alert (1 2)) (s (1 10 0)) (ht (2 0)) (emacs (24 3))) "Desktop notification for mu4e" single]) (mu-cite . [(20160130 300) ((flim (1 14 9))) "A library to provide MIME features." tar]) (mtg-deck-mode . [(20180613 1310) ((emacs (25 1))) "Major mode to edit MTG decks" tar]) (msvc . [(20171225 738) ((emacs (24)) (cl-lib (0 5)) (cedet (1 0)) (ac-clang (2 0 0))) "Microsoft Visual C/C++ mode" tar]) (mqtt-mode . [(20180605 1031) ((emacs (25)) (dash (2 12 0))) "client for interaction with MQTT servers" single]) (mqr . [(20180527 504) ((emacs (24 4))) "Multi-dimensional query and replace" single]) (mpv . [(20180602 314) ((cl-lib (0 5)) (emacs (24)) (json (1 3)) (org (8 0))) "control mpv for easy note-taking" single]) (mpmc-queue . [(20180303 1229) ((emacs (26 0)) (queue (0 2 0))) "a multiple-producer-multiple-consumer queue" single]) (mpdel . [(20180606 512) ((emacs (25 1)) (libmpdel (0 7 0))) "Play and control your MPD music" tar]) (mpages . [(20150710 704) nil "An Emacs buffer for quickly writing your Morning Pages" single]) (mozc-temp . [(20160228 40) ((emacs (24)) (dash (2 10 0)) (mozc (0))) "Use mozc temporarily" single]) (mozc-popup . [(20150223 1634) ((popup (0 5 2)) (mozc (0))) "Mozc with popup" single]) (mozc-im . [(20160411 1722) ((mozc (0))) "Mozc with input-method-function interface." single]) (mozc . [(20180101 0) nil "minor mode to input Japanese with Mozc" single]) (moz-controller . [(20151208 1806) ((moz (0))) "Control Firefox from Emacs" single]) (moz . [(20150805 1006) nil "Lets current buffer interact with inferior mozilla." single]) (mowedline . [(20161121 1835) nil "elisp utilities for using mowedline" single]) (move-text . [(20170908 2030) nil "Move current line or region with M-up or M-down." single]) (move-dup . [(20180531 537) nil "Eclipse-like moving and duplicating lines or rectangles." single]) (mouse-slider-mode . [(20161021 1214) ((emacs (24 3)) (cl-lib (0 3))) "scale numbers dragged under the mouse" single]) (motion-mode . [(20140919 1856) ((flymake-easy (0 7)) (flymake-cursor (1 0 2))) "major mode for RubyMotion enviroment" tar]) (mote-mode . [(20160122 1629) ((ruby-mode (1 1))) "Mote minor mode" single]) (mosey . [(20180614 949) ((emacs (24 4))) "Mosey around your buffers" single]) (morlock . [(20180318 1323) nil "more font-lock keywords for elisp" single]) (morganey-mode . [(20170118 134) ((emacs (24 4))) "Major mode for editing Morganey files" single]) (moonscript . [(20170831 1526) ((cl-lib (0 5)) (emacs (24))) "Major mode for editing MoonScript code" tar]) (moom . [(20180618 1245) ((emacs (25 1))) "Commands to control frame position and size" tar]) (moody . [(20180403 549) ((emacs (25 3))) "Tabs and ribbons for the mode line" single]) (monroe . [(20180703 1046) nil "Yet another client for nREPL" single]) (monotropic-theme . [(20180218 357) ((emacs (24))) "Monotropic Theme" single]) (monokai-theme . [(20180402 221) nil "A fruity color theme for Emacs." single]) (monokai-alt-theme . [(20170630 1348) ((emacs (24))) "Theme with a dark background. Based on sublime monokai theme." single]) (monochrome-theme . [(20140326 350) nil "A dark Emacs 24 theme for your focused hacking sessions" tar]) (monky . [(20180716 720) nil "Control Hg from Emacs." tar]) (monitor . [(20161018 444) ((dash (2 13 0))) "Utilities for monitoring expressions." tar]) (mongo . [(20150315 519) nil "MongoDB driver for Emacs Lisp" tar]) (molokai-theme . [(20151016 845) nil "molokai theme with Emacs theme engine" single]) (molecule . [(20180527 43) ((emacs (25 1))) "Simple wrapper for molecule" single]) (moe-theme . [(20180616 1900) nil "A colorful eye-candy theme. Moe, moe, kyun!" tar]) (modtime-skip-mode . [(20140128 1401) nil "Minor mode for disabling modtime and supersession checks on files." single]) (modern-cpp-font-lock . [(20180110 1231) nil "Font-locking for \"Modern C++\"" single]) (mode-line-debug . [(20180318 1525) nil "show status of `debug-on-error' in the mode-line" single]) (mode-line-bell . [(20171231 1939) nil "Flash the mode line instead of ringing the bell" single]) (mode-icons . [(20170216 620) ((emacs (24)) (cl-lib (0 5))) "Show icons for modes" tar]) (modalka . [(20171231 2213) ((emacs (24 4))) "Easily introduce native modal editing of your own design" single]) (mocker . [(20150916 1854) ((eieio (1 3)) (el-x (0 2 4))) "mocking framework for emacs" single]) (mocha-snippets . [(20170103 2127) ((yasnippet (0 8 0))) "Yasnippets for the Mocha JS Testing Framework" tar]) (mocha . [(20180321 1622) ((js2-mode (20150909)) (f (0 18))) "Run Mocha or Jasmine tests" single]) (mobdebug-mode . [(20140109 1946) ((lua-mode (20130419)) (emacs (24))) "Major mode for MobDebug" single]) (mo-vi-ment-mode . [(20131028 2333) nil "Provide vi-like cursor movement that's easy on the fingers" single]) (mo-git-blame . [(20160129 959) nil "An interactive, iterative 'git blame' mode for Emacs" single]) (mmt . [(20171231 2219) ((emacs (24 1)) (cl-lib (0 3))) "Missing macro tools for Emacs Lisp" single]) (mmm-mako . [(20121019 2351) ((mmm-mode (0 4 8))) "MMM submode class for Mako Templates" single]) (mmm-jinja2 . [(20170313 720) ((mmm-mode (0 5 4))) "MMM submode class for Jinja2 Templates" single]) (mkdown . [(20140517 718) ((markdown-mode (2 0))) "Pretty Markdown previews based on mkdown.com" tar]) (mixed-pitch . [(20180410 917) ((emacs (24 3))) "Use a variable pitch, keeping fixed pitch where it's sensible" single]) (mips-mode . [(20180502 757) nil "Major-mode for MIPS assembly" single]) (mip-mode . [(20151126 2217) nil "virtual projects for emacs." single]) (minor-mode-hack . [(20170925 1734) nil "Change priority of minor-mode keymaps" single]) (minizinc-mode . [(20180201 650) ((emacs (24 1))) "Major mode for MiniZinc code" single]) (minitest . [(20160628 1120) ((dash (1 0 0))) "An Emacs mode for ruby minitest files" tar]) (minions . [(20180709 1012) ((emacs (25 3)) (dash (2 13 0))) "A minor-mode menu for the mode line" single]) (minimal-theme . [(20160608 322) nil "A light/dark minimalistic Emacs 24 theme." tar]) (minimal-session-saver . [(20140508 1341) nil "Very lean session saver" single]) (miniedit . [(20100419 1045) nil "Enhanced editing for minibuffer fields." single]) (minibuffer-cua . [(20130906 434) nil "Make CUA mode's S-up/S-down work in minibuffer" single]) (minibuffer-complete-cycle . [(20130813 945) nil "Cycle through the *Completions* buffer" single]) (minibuf-isearch . [(20151226 1143) nil "incremental search on minibuffer history" single]) (mini-header-line . [(20170621 521) ((emacs (24 4))) "a minimal header-line" single]) (mingus . [(20180712 2336) ((libmpdee (2 1))) "MPD Interface" tar]) (minesweeper . [(20150413 2222) nil "play minesweeper in Emacs" single]) (milkode . [(20140926 2229) nil "Command line search and direct jump with Milkode" single]) (migemo . [(20160924 741) ((cl-lib (0 5))) "Japanese incremental search through dynamic pattern expansion" single]) (midje-mode . [(20170808 2103) ((cider (0 1 4)) (clojure-mode (1 0))) "Minor mode for running Midje tests in emacs" tar]) (micgoline . [(20160414 2026) ((emacs (24 3)) (powerline (2 3))) "powerline mode, color schemes from microsoft and google's logo." single]) (mic-paren . [(20170731 1207) nil "advanced highlighting of matching parentheses" single]) (mhc . [(20180717 2009) ((calfw (20150703))) "Message Harmonized Calendaring system." tar]) (mgmtconfig-mode . [(20180222 1257) ((emacs (24 3))) "mgmt configuration management language" single]) (mexican-holidays . [(20160109 1342) nil "Mexico holidays for Emacs calendar." single]) (mew . [(20180709 1817) nil "Messaging in the Emacs World" tar]) (metaweblog . [(20171216 1840) ((xml-rpc (1 6 8))) "An emacs library to access metaweblog based weblogs" tar]) (metascript-mode . [(20150708 1757) ((emacs (24 3))) "Major mode for the Metascript programming language" single]) (metalheart-theme . [(20160709 2341) ((emacs (24))) "Low-contrast theme with a dark blue-green background." single]) (meta-presenter . [(20170425 1934) nil "A simple multi-file presentation tool for Emacs" single]) (messages-are-flowing . [(20170218 1720) nil "visible indication when composing \"flowed\" emails" single]) (meson-mode . [(20170901 1135) ((emacs (24 3))) "Major mode for the Meson build system files" single]) (merlin-eldoc . [(20180630 1026) ((emacs (24 4)) (merlin (3 0))) "eldoc for OCaml and Reason" single]) (merlin . [(20180214 242) nil "Mode for Merlin, an assistant for OCaml." tar]) (mentor . [(20170105 221) ((xml-rpc (1 6 9)) (seq (1 11)) (cl-lib (0 5))) "Frontend for the rTorrent bittorrent client" tar]) (memolist . [(20150804 1021) ((markdown-mode (22 0)) (ag (0 45))) "memolist.el is Emacs port of memolist.vim." single]) (memoize . [(20180614 1230) nil "Memoization functions" single]) (melpa-upstream-visit . [(20130720 333) ((s (1 6 0))) "A set of kludges to visit a melpa-hosted package's homepage" single]) (mellow-theme . [(20170808 617) ((emacs (24 0))) "an Emacs 24 theme based on Mellow (tmTheme)" single]) (melancholy-theme . [(20170220 1248) nil "A dark theme for dark minds" single]) (meghanada . [(20180717 1810) ((emacs (24 3)) (yasnippet (0 6 1)) (company (0 9 0)) (flycheck (0 23))) "A better java development mode" tar]) (mediawiki . [(20170812 2255) nil "mediawiki frontend" single]) (md4rd . [(20180625 2236) ((emacs (25 1)) (hierarchy (0 7 0)) (request (0 3 0)) (cl-lib (0 6 1)) (dash (2 12 0)) (s (1 12 0)) (tree-mode (1 0 0))) "Mode for reddit (browse it)." single]) (md-readme . [(20160811 946) nil "Markdown-formatted READMEs for your ELisp" tar]) (mc-extras . [(20180519 2139) ((multiple-cursors (1 2 1))) "Extra functions for multiple-cursors mode." tar]) (mbsync . [(20180530 33) nil "run mbsync to fetch mails" single]) (mbo70s-theme . [(20170808 615) ((emacs (24 0))) "70s style palette, with similarities to mbo theme" single]) (mbe . [(20151126 334) ((emacs (24)) (cl-lib (0 5))) "Macros by Example" single]) (mb-url . [(20161224 1806) ((cl-lib (0))) "Multiple Backends for Emacs URL package." tar]) (maxframe . [(20170120 905) nil "maximize the emacs frame based on display size" single]) (maven-test-mode . [(20141219 2157) ((s (1 9)) (emacs (24))) "Utilities for navigating test files and running maven test tasks." single]) (maude-mode . [(20160222 807) nil "Emacs mode for the programming language Maude" single]) (matlab-mode . [(20180125 1010) nil "Major mode for MATLAB(R) dot-m files" tar]) (math-symbols . [(20170818 759) ((helm (1 0))) "Math Symbol Input methods and conversion tools" tar]) (math-symbol-lists . [(20170221 553) nil "Lists of Unicode math symbols and latex commands" tar]) (material-theme . [(20171123 1040) ((emacs (24 1))) "A Theme based on the colors of the Google Material Design" tar]) (mastodon . [(20180305 1909) ((emacs (24 4))) "Client for Mastodon" tar]) (maruo-macro-mode . [(20160616 649) ((emacs (24 3))) "Major mode for editing Hidemaru/Maruo macro script" single]) (marshal . [(20180124 439) ((eieio (1 4)) (json (1 3)) (ht (2 1))) "eieio extension for automatic (un)marshalling" single]) (marmalade-client . [(20141231 1207) ((web (0 5 2)) (kv (0 0 19)) (gh (0 8 0))) "client for marmalade API from emacs" tar]) (markup-faces . [(20141110 17) nil "collection of faces for markup language modes" single]) (markup . [(20170420 429) ((cl-lib (0 5))) "Simple markup generation helpers." single]) (markdownfmt . [(20160609 541) ((emacs (24))) "Format markdown using markdownfmt" single]) (markdown-toc . [(20170711 1249) ((s (1 9 0)) (dash (2 11 0)) (markdown-mode (2 1))) "A simple TOC generator for markdown file" tar]) (markdown-preview-mode . [(20171121 2323) ((emacs (24 3)) (websocket (1 6)) (markdown-mode (2 0)) (cl-lib (0 5)) (web-server (0 1 1)) (uuidgen (0 3))) "markdown realtime preview minor mode." tar]) (markdown-preview-eww . [(20160111 702) ((emacs (24 4))) "Realtime preview by eww" single]) (markdown-mode . [(20180707 555) ((emacs (24 4)) (cl-lib (0 5))) "Major mode for Markdown-formatted text" single]) (markdown-mode+ . [(20170320 1404) ((markdown-mode (20111229))) "extra functions for markdown-mode" tar]) (mark-tools . [(20130614 325) nil "Some simple tools to access the mark-ring in Emacs" single]) (mark-multiple . [(20121118 754) nil "Sorta lets you mark several regions at once." tar]) (marcopolo . [(20160421 304) ((s (1 9 0)) (dash (2 9 0)) (pkg-info (0 5 0)) (request (0 1 0))) "Emacs client to the Docker HUB/Registry API" tar]) (map-regexp . [(20130522 1403) ((cl-lib (0 2))) "map over matches of a regular expression" single]) (map-progress . [(20140310 1432) nil "mapping macros that report progress" single]) (mandoku-tls . [(20171117 1840) ((emacs (24 4)) (mandoku (20170301)) (github-clone (0 2)) (hydra (0 13 6)) (helm (1 7 0)) (org (9 0)) (helm-charinfo (20170601))) "A tool to access the TLS database" single]) (mandoku . [(20180403 406) ((org (8 0)) (magit (20151028)) (github-clone (20150705)) (git (20140128))) "A tool to access repositories of premodern Chinese texts" tar]) (mandm-theme . [(20170925 321) nil "An M&M color theme." single]) (manage-minor-mode . [(20140310 900) ((emacs (24 3))) "Manage your minor-modes easily" single]) (man-commands . [(20151221 1421) ((cl-lib (0 5))) "Add interactive commands for every manpages installed in your computer." single]) (malyon . [(20161208 1325) ((cl-lib (0 5))) "mode to execute Z-code files version 3, 5, 8" single]) (mallard-snippets . [(20131023 1151) ((yasnippet (0 8 0)) (mallard-mode (0 1 1))) "Yasnippets for Mallard" tar]) (mallard-mode . [(20131203 2025) nil "Major mode for editing Mallard files" tar]) (malinka . [(20171202 221) ((s (1 9 0)) (dash (2 4 0)) (f (0 11 0)) (cl-lib (0 3)) (rtags (0 0)) (projectile (0 11 0))) "A C/C++ project configuration package for Emacs" single]) (makey . [(20131231 630) ((cl-lib (0 2))) "interactive commandline mode" single]) (makefile-executor . [(20180720 132) ((emacs (24 3)) (dash (2 11 0)) (f (0 11 0)) (s (1 10 0))) "Commands for conveniently running makefile targets" single]) (make-it-so . [(20180128 1307) ((swiper (0 8 0)) (emacs (24))) "Transform files with Makefile recipes." tar]) (make-color . [(20140625 450) nil "Alternative to picking color - update fg/bg color by pressing r/g/b/... keys" single]) (major-mode-icons . [(20170228 2314) ((emacs (24 3)) (powerline (2 4)) (all-the-icons (2 3 0))) "display icon for major-mode on mode-line." tar]) (majapahit-theme . [(20160817 1148) nil "Color theme with a dark and light versions" tar]) (magnatune . [(20151030 1235) ((dash (2 9 0)) (s (1 9 0))) "browse magnatune's music catalog" tar]) (magma-mode . [(20180413 727) ((cl-lib (0 3)) (dash (2 6 0)) (f (0 17 1))) "Magma mode for Emacs" tar]) (magithub . [(20180625 2104) ((emacs (25)) (magit (2 12)) (s (1 12 0)) (ghub+ (0 3)) (git-commit (2 12)) (markdown-mode (2 3))) "Magit interfaces for GitHub" tar]) (magit-topgit . [(20160313 1254) ((emacs (24 4)) (magit (2 1 0))) "TopGit extension for Magit" single]) (magit-todos . [(20180716 2339) ((emacs (25 2)) (a (0 1 0)) (anaphora (1 0 0)) (async (1 9 2)) (dash (2 13 0)) (f (0 17 2)) (hl-todo (1 9 0)) (magit (2 13 0)) (pcre2el (1 8)) (s (1 12 0))) "Show source file TODOs in Magit" single]) (magit-tbdiff . [(20180527 652) ((emacs (24 4)) (magit (2 10 0))) "Magit extension for git-tbdiff" single]) (magit-svn . [(20170213 433) ((emacs (24 4)) (magit (2 1 0))) "Git-Svn extension for Magit" single]) (magit-stgit . [(20180522 542) ((emacs (24 4)) (magit (2 1 0))) "StGit extension for Magit" single]) (magit-popup . [(20180618 1602) ((emacs (24 4)) (async (1 9 2)) (dash (2 13 0))) "Define prefix-infix-suffix command combos" tar]) (magit-p4 . [(20170414 546) ((magit (2 1)) (magit-popup (2 1)) (p4 (12 0)) (cl-lib (0 5))) "git-p4 plug-in for Magit" single]) (magit-org-todos . [(20180709 1250) ((magit (2 0 0)) (emacs (24))) "Add local todo items to the magit status buffer" single]) (magit-lfs . [(20170312 1524) ((emacs (24 4)) (magit (2 10 3)) (dash (2 13 0))) "Magit plugin for Git LFS" single]) (magit-imerge . [(20180609 858) ((emacs (24 4)) (magit (2 10 0))) "Magit extension for git-imerge" single]) (magit-gitflow . [(20170929 124) ((magit (2 1 0)) (magit-popup (2 2 0))) "gitflow extension for magit" single]) (magit-gh-pulls . [(20180716 936) ((emacs (24 4)) (gh (0 9 1)) (magit (2 12 0)) (pcache (0 2 3)) (s (1 6 1))) "GitHub pull requests extension for Magit" single]) (magit-gerrit . [(20160226 130) ((magit (2 3 1))) "Magit plugin for Gerrit Code Review" single]) (magit-find-file . [(20150702 130) ((magit (2 1 0)) (dash (2 8 0))) "completing-read over all files in Git" single]) (magit-filenotify . [(20151116 1540) ((magit (1 3 0)) (emacs (24 4))) "Refresh status buffer when git tree changes" single]) (magit-annex . [(20180715 1812) ((cl-lib (0 3)) (magit (2 12 0))) "Control git-annex from Magit" single]) (magit . [(20180723 1158) ((emacs (25 1)) (async (20180527)) (dash (20180413)) (ghub (20180417)) (git-commit (20180602)) (magit-popup (20180509)) (with-editor (20180414))) "A Git porcelain inside Emacs." tar]) (magic-latex-buffer . [(20170530 1705) ((cl-lib (0 5)) (emacs (24 3))) "Magically enhance LaTeX-mode font-locking for semi-WYSIWYG editing" single]) (magic-filetype . [(20180219 752) ((emacs (24)) (s (1 9 0))) "Enhance filetype major mode" single]) (mag-menu . [(20150505 1150) ((splitter (0 1 0))) "Intuitive keyboard-centric menu system" single]) (madhat2r-theme . [(20170202 1630) ((emacs (24))) "dark color theme that is easy on the eyes" single]) (macrostep . [(20161120 1306) ((cl-lib (0 5))) "interactive macro expander" tar]) (macro-math . [(20130328 904) nil "in-buffer mathematical operations" single]) (maces-game . [(20170903 851) ((dash (2 12 0)) (cl-lib (0 5)) (emacs (24))) "another anagram game." tar]) (mac-pseudo-daemon . [(20170728 1240) ((cl-lib (0 1))) "Daemon mode that plays nice with Mac OS." single]) (m-buffer . [(20170407 1441) ((seq (2 14))) "List-Oriented, Functional Buffer Manipulation" tar]) (lyrics . [(20180123 2004) ((emacs (25 1)) (seq (2 15))) "Show lyrics" single]) (lxc-tramp . [(20180523 1324) ((emacs (24)) (cl-lib (0 6))) "TRAMP integration for LXC containers" single]) (lxc . [(20140410 1322) nil "lxc integration with Emacs" single]) (lv . [(20160912 756) nil "Other echo area" single]) (lusty-explorer . [(20180628 646) nil "Dynamic filesystem explorer and buffer switcher" single]) (lush-theme . [(20141107 806) ((emacs (24))) "A dark theme with strong colors" single]) (luarocks . [(20170430 1605) ((emacs (24)) (cl-lib (0 5))) "luarocks tools" single]) (lua-mode . [(20180323 321) nil "a major-mode for editing Lua scripts" tar]) (lsp-vue . [(20180628 15) ((emacs (25 1)) (lsp-mode (3 0))) "Vue support for lsp-mode" single]) (lsp-ui . [(20180618 1951) ((emacs (25 1)) (dash (2 13)) (dash-functional (1 2 0)) (flycheck (31)) (lsp-mode (4 0)) (markdown-mode (2 3))) "UI modules for lsp-mode" tar]) (lsp-typescript . [(20180614 1311) ((lsp-mode (3 0)) (typescript-mode (0 1)) (emacs (25 1))) "Javascript/Typescript support for lsp-mode" single]) (lsp-rust . [(20180305 508) ((emacs (25)) (lsp-mode (3 0)) (rust-mode (0 3 0)) (dash (1 0)) (markdown-mode (2 3))) "Rust support for lsp-mode" single]) (lsp-python . [(20180609 16) ((lsp-mode (3 0))) "Python support for lsp-mode" single]) (lsp-php . [(20180331 944) ((emacs (25 1)) (lsp-mode (3 4))) "PHP support for lsp-mode" single]) (lsp-ocaml . [(20180610 1154) ((emacs (25 1)) (lsp-mode (3 0))) "OCaml support for lsp-mode" single]) (lsp-mode . [(20180708 1914) ((emacs (25 1))) "Minor mode for interacting with Language Servers" tar]) (lsp-javascript-typescript . [(20180614 1311) ((lsp-mode (3 0)) (typescript-mode (0 1)) (emacs (25 1))) "Javascript/Typescript support for lsp-mode" single]) (lsp-javascript-flow . [(20180612 2208) ((lsp-mode (3 0)) (emacs (25 1))) "Javascript/Flow support for lsp-mode" single]) (lsp-javacomp . [(20180218 2334) ((emacs (25 1)) (lsp-mode (3 0)) (s (1 2 0))) "Provide Java IDE features powered by JavaComp." single]) (lsp-java . [(20180701 111) ((emacs (25 1)) (lsp-mode (3 0))) "Java support for lsp-mode" single]) (lsp-intellij . [(20180621 1131) ((emacs (25 1)) (lsp-mode (4 1))) "intellij lsp client" single]) (lsp-html . [(20180629 25) ((lsp-mode (4 2))) "HTML support for lsp-mode" single]) (lsp-haskell . [(20180131 459) ((lsp-mode (3 0)) (haskell-mode (1 0))) "Haskell support for lsp-mode" single]) (lsp-hack . [(20180703 1837) ((lsp-mode (4 2))) "lsp-mode client for hacklang" single]) (lsp-go . [(20180630 1101) ((lsp-mode (3 0))) "Go support for lsp-mode" single]) (lsp-css . [(20180627 1251) ((lsp-mode (3 0)) (emacs (25 1))) "CSS/LESS/SASS support for lsp-mode" single]) (lsp-clangd . [(20180630 1834) ((lsp-mode (3 0)) (emacs (24 3))) "clangd support for lsp-mode" single]) (love-minor-mode . [(20170726 2236) ((lua-mode (20130419))) "Minor mode for working on LÖVE projects" single]) (lorem-ipsum . [(20140911 1408) nil "Insert dummy pseudo Latin text." single]) (loop . [(20160813 707) nil "friendly imperative loop structures" single]) (look-mode . [(20151211 1026) nil "quick file viewer for image and text file browsing" single]) (look-dired . [(20160729 1623) ((look-mode (1 0))) "Extensions to look-mode for dired buffers" single]) (lolcode-mode . [(20111002 147) nil "Major mode for editing LOLCODE" single]) (logview . [(20180522 1054) ((emacs (24 4)) (datetime (0 3))) "Major mode for viewing log files" single]) (logstash-conf . [(20170524 1229) nil "basic mode for editing logstash configuration" single]) (logpad . [(20180607 1215) nil "Simulate Windows Notepad for logging." single]) (lognav-mode . [(20180708 322) ((emacs (24 3))) "Navigate Log Error Messages" single]) (logito . [(20120225 1255) ((eieio (1 3))) "logging library for Emacs" single]) (logalimacs . [(20131021 1129) ((popwin (0 6 2)) (popup (0 5 0)) (stem (20130120))) "Front-end to logaling-command for Ruby gems" single]) (log4j-mode . [(20160108 1118) nil "major mode for viewing log files" single]) (log4e . [(20170401 604) nil "provide logging framework for elisp" single]) (lodgeit . [(20150312 649) nil "Paste to a lodgeit powered pastebin" single]) (lockfile-mode . [(20170624 2207) nil "Major mode for .lock files" single]) (loccur . [(20161227 251) ((emacs (24 3))) "Perform an occur-like folding in current buffer" single]) (loc-changes . [(20160801 1008) nil "keep track of positions even after buffer changes" single]) (load-theme-buffer-local . [(20120702 1336) nil "Install emacs24 color themes by buffer." single]) (load-relative . [(20170526 310) nil "relative file load (within a multi-file Emacs package)" tar]) (load-env-vars . [(20180511 1510) ((emacs (24))) "Load environment variables from files" single]) (lms . [(20170804 922) ((emacs (25 1))) "Squeezebox / Logitech Media Server frontend" single]) (livid-mode . [(20131116 544) ((skewer-mode (1 5 3)) (s (1 8 0))) "Live browser eval of JavaScript every time a buffer changes" single]) (livescript-mode . [(20140612 2121) nil "Major mode for editing LiveScript files" single]) (livereload . [(20170628 2350) ((emacs (25)) (websocket (1 8))) "Livereload server" tar]) (lively . [(20171005 54) nil "interactively updating text" single]) (live-py-mode . [(20180330 1758) ((emacs (24 3))) "Live Coding in Python" tar]) (live-code-talks . [(20150115 1423) ((emacs (24)) (cl-lib (0 5)) (narrowed-page-navigation (0 1))) "Support for slides with live code in them" single]) (literate-starter-kit . [(20150730 1154) ((emacs (24 3))) "A literate starter kit to configure Emacs using Org-mode files." tar]) (literate-coffee-mode . [(20170211 715) ((coffee-mode (0 5 0))) "major-mode for Literate CoffeeScript" single]) (literal-string . [(20170301 730) ((markdown-mode (2 0)) (emacs (25))) "edit string literals in a dedicated buffer" single]) (litecoin-ticker . [(20160611 1711) ((json (1 2))) "litecoin price in modeline" single]) (litable . [(20160922 859) ((dash (2 6 0))) "dynamic evaluation replacement with emacs" single]) (lit-mode . [(20141123 936) nil "Major mode for lit" single]) (list-utils . [(20160414 702) nil "List-manipulation utility functions" single]) (list-unicode-display . [(20150219 101) ((cl-lib (0 5))) "Search for and list unicode characters by name" single]) (list-packages-ext . [(20151115 916) ((s (1 6 0)) (ht (1 5 0)) (persistent-soft (0 8 6))) "Extras for list-packages" single]) (list-environment . [(20151226 1856) nil "A tabulated process environment editor" single]) (lispyville . [(20180704 458) ((lispy (0)) (evil (1 2 12)) (cl-lib (0 5)) (emacs (24 4))) "A minor mode for integrating evil with lispy." single]) (lispyscript-mode . [(20170720 1217) nil "Major mode for LispyScript code." single]) (lispy . [(20180723 858) ((emacs (24 1)) (ace-window (0 9 0)) (iedit (0 9 9)) (swiper (0 7 0)) (hydra (0 13 4)) (zoutline (0 1 0))) "vi-like Paredit" tar]) (lispxmp . [(20170925 1723) nil "Automagic emacs lisp code annotation" single]) (lisp-extra-font-lock . [(20160930 1227) nil "Highlight bound variables and quoted exprs." single]) (liso-theme . [(20160410 1329) nil "Eclectic Dark Theme for GNU Emacs" single]) (liquid-types . [(20151201 2335) ((flycheck (0 13)) (dash (1 2)) (emacs (24 1)) (popup (0 5 2)) (pos-tip (0 5 0)) (flycheck-liquidhs (0 0 1)) (button-lock (1 0 2))) "show inferred liquid-types" single]) (linum-relative . [(20180124 247) nil "display relative line number in emacs." single]) (linum-off . [(20160217 1337) nil "Provides an interface for turning line-numbering off" single]) (linphone . [(20130524 409) nil "Emacs interface to Linphone" tar]) (link-hint . [(20180519 1430) ((avy (0 4 0)) (emacs (24 1)) (cl-lib (0 5))) "Use avy to open, copy, etc. visible links." single]) (link . [(20140717 2029) nil "Hypertext links in text buffers" single]) (lingr . [(20100807 1031) nil "Lingr Client for GNU Emacs" single]) (lines-at-once . [(20180421 1947) ((emacs (25))) "Insert and edit multiple lines at once" single]) (line-up-words . [(20180219 224) nil "Align words in an intelligent way" single]) (line-reminder . [(20180602 2252) ((emacs (24 4)) (cl-lib (0 6))) "Remind current line status by current buffer." single]) (light-soap-theme . [(20150607 745) ((emacs (24))) "Emacs 24 theme with a light background." single]) (lice . [(20170220 143) nil "License And Header Template" tar]) (libmpdel . [(20180606 453) ((emacs (25 1))) "Communication with an MPD server" single]) (libmpdee . [(20160117 1501) nil "Client end library for mpd, a music playing daemon" single]) (libgit . [(20180624 2359) ((emacs (25 1))) "Thin bindings to libgit2." tar]) (libelcouch . [(20180604 53) ((emacs (25 1)) (request (0 3 0))) "Communication with CouchDB" single]) (lfe-mode . [(20170121 454) nil "Lisp Flavoured Erlang mode" tar]) (lexbind-mode . [(20141027 729) nil "Puts the value of lexical-binding in the mode line" single]) (levenshtein . [(20090830 340) nil "Edit distance between two strings." single]) (leuven-theme . [(20170919 252) nil "Awesome Emacs color theme on white background" tar]) (letterbox-mode . [(20170701 1825) ((emacs (24 3))) "hide sensitive text on a buffer" single]) (letcheck . [(20160202 1148) nil "Check the erroneous assignments in let forms" single]) (less-css-mode . [(20160930 2153) nil "Major mode for editing LESS CSS files (lesscss.org)" single]) (lentic-server . [(20160717 1352) ((lentic (0 8)) (web-server (0 1 1))) "Web Server for Emacs Literate Source" single]) (lentic . [(20161202 1352) ((emacs (24 4)) (m-buffer (0 13)) (dash (2 5 0)) (f (0 17 2)) (s (1 9 0))) "One buffer as a view of another" tar]) (lenlen-theme . [(20170328 1945) ((color-theme-solarized (20150110))) "a solarized-based kawaii light theme" single]) (lemon-mode . [(20130216 504) nil "A major mode for editing lemon grammar files" single]) (legalese . [(20150820 1024) nil "Add legalese to your program files" single]) (leerzeichen . [(20170422 613) nil "Minor mode to display whitespace characters." single]) (ledger-mode . [(20180705 138) ((emacs (24 3))) "Helper code for use with the \"ledger\" command-line tool" tar]) (leanote . [(20161222 1739) ((emacs (24 4)) (cl-lib (0 5)) (request (0 2)) (let-alist (1 0 3)) (pcache (0 4 0)) (s (1 10 0)) (async (1 9))) "A minor mode writing markdown leanote" single]) (lean-mode . [(20180712 57) ((emacs (24 3)) (dash (2 12 0)) (dash-functional (1 2 0)) (s (1 10 0)) (f (0 19 0)) (flycheck (30))) "A major mode for the Lean language" tar]) (lcr . [(20180414 1256) ((dash (2 12 0)) (emacs (25 1))) "lightweight coroutines" single]) (lcb-mode . [(20160815 2240) ((emacs (24))) "LiveCode Builder major mode" single]) (lavender-theme . [(20170808 613) ((emacs (24 0))) "an Emacs 24 theme based on Lavender (tmTheme)" single]) (launchctl . [(20150518 609) ((emacs (24 1))) "Interface to launchctl on Mac OS X." single]) (launch-mode . [(20170105 2112) ((emacs (24 4))) "Major mode for launch-formatted text" tar]) (launch . [(20130619 1504) nil "launch files with OS-standard associated applications." single]) (latexdiff . [(20180521 1532) ((emacs (24 4))) "Latexdiff integration in Emacs" single]) (latex-unicode-math-mode . [(20170123 1016) nil "Input method for Unicode math symbols" tar]) (latex-preview-pane . [(20180222 951) nil "Makes LaTeX editing less painful by providing a updatable preview pane" tar]) (latex-pretty-symbols . [(20151112 244) nil "Display many latex symbols as their unicode counterparts" single]) (latex-math-preview . [(20170522 1455) nil "preview LaTeX mathematical expressions." single]) (latex-extra . [(20170816 1847) ((auctex (11 86 1)) (cl-lib (0 5))) "Adds several useful functionalities to LaTeX-mode." single]) (lastpass . [(20171208 216) ((emacs (24 4)) (seq (1 9)) (cl-lib (0 5))) "LastPass command wrapper" single]) (language-detection . [(20161123 1013) ((emacs (24)) (cl-lib (0 5))) "Automatic language detection from code snippets" single]) (langtool . [(20180409 316) ((cl-lib (0 3))) "Grammar check utility using LanguageTool" single]) (langdoc . [(20150217 2245) ((cl-lib (0 2))) "Help to define help document mode for various languages" single]) (lang-refactor-perl . [(20131122 1327) nil "Simple refactorings, primarily for Perl" single]) (labburn-theme . [(20170502 207) nil "A lab color space zenburn theme." single]) (kwin . [(20150308 1112) nil "communicatewith the KWin window manager" single]) (kv . [(20140108 734) nil "key/value data structure functions" single]) (kurecolor . [(20180401 521) ((emacs (24 1)) (s (1 0))) "color editing goodies for Emacs" single]) (kubernetes-tramp . [(20171026 922) ((emacs (24)) (cl-lib (0 5))) "TRAMP integration for kubernetes containers" single]) (kubernetes-evil . [(20171122 1819) ((kubernetes (0 12 0)) (evil (1 2 12))) "Kubernetes keybindings for evil-mode." single]) (kubernetes . [(20180706 520) ((emacs (25 1)) (dash (2 12 0)) (magit (2 8 0))) "Magit-like porcelain for Kubernetes." tar]) (ksp-cfg-mode . [(20180608 2247) ((cl-lib (0 5))) "major mode for editing KSP CFG files" single]) (kroman . [(20150827 1640) nil "Korean hangul romanization" single]) (kpm-list . [(20170924 652) nil "An emacs buffer list that tries to intelligently group together buffers." single]) (kotlin-mode . [(20180219 853) ((emacs (24 3))) "Major mode for kotlin" single]) (kosmos-theme . [(20170502 1150) ((emacs (24))) "Black and lightgray theme with not so much syntax highlighting." single]) (korean-holidays . [(20170228 2045) nil "Korean holidays for calendar." single]) (kooten-theme . [(20161023 205) ((emacs (24 1))) "Dark color theme" single]) (kolon-mode . [(20140122 334) nil "Syntax highlighting for Text::Xslate's Kolon syntax" single]) (kodi-remote . [(20180609 1654) ((request (0 2 0)) (let-alist (1 0 4)) (json (1 4)) (elnode (20140203 1506))) "Remote Control for Kodi" single]) (know-your-http-well . [(20160208 1504) nil "Look up the meaning of HTTP headers, methods, relations, status codes" tar]) (klere-theme . [(20180415 1123) ((emacs (24))) "A dark theme with lambent color highlights and incremental grays" single]) (kixtart-mode . [(20150611 904) ((emacs (24))) "major mode for Kixtart scripting files" single]) (kiwix . [(20170927 120) ((emacs (24 4)) (cl-lib (0 5))) "Kiwix interface and support." single]) (kivy-mode . [(20180702 1329) nil "Emacs major mode for editing Kivy files" single]) (kite-mini . [(20160508 406) ((dash (2 11 0)) (websocket (1 5))) "Remotely evaluate JavaScript in the WebKit debugger" tar]) (kite . [(20130201 1138) ((json (1 2)) (websocket (0 93 1))) "WebKit inspector front-end" tar]) (killer . [(20120808 422) nil "kill and delete text" single]) (kill-ring-search . [(20140422 855) nil "incremental search for the kill ring" single]) (kill-or-bury-alive . [(20171231 2218) ((emacs (24 4)) (cl-lib (0 5))) "Precise control over buffer killing in Emacs" single]) (kibit-helper . [(20150508 833) ((s (0 8)) (emacs (24))) "Conveniently use the Kibit Leiningen plugin from Emacs" single]) (keyword-search . [(20180424 402) nil "browser keyword search from Emacs" tar]) (keyswap . [(20160813 257) ((emacs (24 3))) "swap bindings between key pairs" single]) (keyset . [(20150219 2130) ((dash (2 8 0)) (cl-lib (0 5))) "A small library for structuring key bindings." single]) (keymap-utils . [(20180318 1537) ((cl-lib (0 3))) "keymap utilities" single]) (keyfreq . [(20160516 716) ((cl-lib (0 5))) "track command frequencies" single]) (keydef . [(20090428 1231) nil "a simpler way to define keys, with kbd syntax" single]) (keychain-environment . [(20180318 1523) nil "load keychain environment variables" single]) (keycast . [(20180318 1321) ((emacs (25 3))) "Show current command and its key in the mode line" single]) (key-seq . [(20150907 56) ((key-chord (0 6))) "map pairs of sequentially pressed keys to commands" single]) (key-leap . [(20160831 747) ((emacs (24 3))) "Leap between lines by typing keywords" single]) (key-intercept . [(20140210 2349) nil "Intercept prefix keys" single]) (key-combo . [(20150324 739) nil "map key sequence to commands" single]) (key-chord . [(20160227 438) nil "map pairs of simultaneously pressed keys to commands" single]) (kerl . [(20150424 1305) nil "Emacs integration for kerl" single]) (kdeconnect . [(20180126 1540) nil "An interface for KDE Connect" single]) (karma . [(20160220 445) ((pkg-info (0 4)) (emacs (24))) "Karma Test Runner Emacs Integration" single]) (kaomoji . [(20171226 2040) ((emacs (24 3)) (helm-core (1 9 1))) "Input kaomoji superb easily" tar]) (kaolin-themes . [(20180722 1037) ((emacs (25 1)) (autothemer (0 2 2)) (cl-lib (0 6))) "A set of eye pleasing themes" tar]) (kanji-mode . [(20160826 439) nil "View stroke order for kanji characters at cursor" tar]) (kanban . [(20170418 110) nil "Parse org-todo headlines to use org-tables as Kanban tables" single]) (kaleidoscope-evil-state-flash . [(20170728 320) ((evil (1 2 12)) (kaleidoscope (0 1 0)) (s (1 11 0))) "Flash keyboard LEDs when changing Evil state" single]) (kaleidoscope . [(20170808 117) ((s (1 11 0))) "Controlling Kaleidoscope-powered devices." single]) (kakapo-mode . [(20171003 2151) ((cl-lib (0 5))) "TABS (hard or soft) for indentation (leading whitespace), and SPACES for alignment." single]) (kaesar-mode . [(20160128 208) ((kaesar (0 1 4)) (cl-lib (0 3))) "Encrypt/Decrypt buffer by AES with password." single]) (kaesar-file . [(20160128 208) ((kaesar (0 1 1))) "Encrypt/Decrypt file by AES with password." single]) (kaesar . [(20160128 208) ((cl-lib (0 3))) "Another AES algorithm encrypt/decrypt string with password." single]) (jvm-mode . [(20150422 8) ((dash (2 6 0)) (emacs (24))) "Monitor and manage your JVMs" single]) (jumplist . [(20151119 1945) ((cl-lib (0 5))) "Jump like vim jumplist or ex jumplist" single]) (jump-tree . [(20171014 851) nil "Treat position history as a tree" tar]) (jump-to-line . [(20130122 853) nil "Jump to line number at point." single]) (jump-char . [(20180601 648) nil "navigation by char" single]) (jump . [(20161126 1728) ((findr (0 7)) (inflections (2 4)) (cl-lib (0 5))) "build functions which contextually jump between files" single]) (jumblr . [(20170727 1343) ((s (1 8 0)) (dash (2 2 0))) "an anagram game for emacs" tar]) (julia-shell . [(20161125 1110) ((julia-mode (0 3))) "Major mode for an inferior Julia shell" tar]) (julia-repl . [(20171116 46) ((emacs (25))) "A minor mode for a Julia REPL" single]) (julia-mode . [(20171116 642) nil "Major mode for editing Julia source code" single]) (jtags . [(20160211 1229) nil "enhanced tags functionality for Java development" tar]) (jsx-mode . [(20130908 1024) nil "major mode for JSX" single]) (jst . [(20150604 438) ((s (1 9)) (f (0 17)) (dash (2 10)) (pcache (0 3)) (emacs (24 4))) "JS test mode" single]) (jss . [(20130508 723) ((emacs (24 1)) (websocket (0)) (js2-mode (0))) "An emacs interface to webkit and mozilla debuggers" tar]) (jsonnet-mode . [(20180310 2256) ((emacs (24))) "Major mode for editing jsonnet files" single]) (json-snatcher . [(20150511 2047) ((emacs (24))) "Grabs the path to JSON values in a JSON file" single]) (json-rpc . [(20180104 728) ((emacs (24 1)) (cl-lib (0 5))) "JSON-RPC library" single]) (json-reformat . [(20160212 53) nil "Reformatting tool for JSON" single]) (json-navigator . [(20171220 19) ((emacs (24 3)) (hierarchy (0 6 0))) "View and navigate JSON structures" single]) (json-mode . [(20180718 109) ((json-reformat (0 0 5)) (json-snatcher (1 0 0))) "Major mode for editing JSON files." single]) (jsfmt . [(20150727 1525) nil "Interface to jsfmt command for javascript files" single]) (jscs . [(20151015 1049) ((emacs (24 1)) (cl-lib (0 5))) "Consistent JavaScript editing using JSCS" single]) (js3-mode . [(20160515 850) nil "An improved JavaScript editing mode" tar]) (js2-refactor . [(20180502 342) ((js2-mode (20101228)) (s (1 9 0)) (multiple-cursors (1 0 0)) (dash (1 0 0)) (s (1 0 0)) (yasnippet (0 9 0 1))) "A JavaScript refactoring library for emacs." tar]) (js2-mode . [(20180627 744) ((emacs (24 1)) (cl-lib (0 5))) "Improved JavaScript editing mode" tar]) (js2-highlight-vars . [(20170418 1129) ((emacs (24 4)) (js2-mode (20150908))) "highlight occurrences of the variable under cursor" single]) (js2-closure . [(20170816 1218) ((js2-mode (20150909))) "Google Closure dependency manager" single]) (js-import . [(20170115 853) ((emacs (24 4)) (f (0 19 0)) (projectile (0 14 0)) (dash (2 13 0))) "Import Javascript files from your current project or dependencies" single]) (js-format . [(20170118 1702) ((emacs (24 1)) (js2-mode (20101228))) "Format or transform code style using NodeJS server with different javascript formatter" tar]) (js-doc . [(20160714 2134) nil "Insert JsDoc style comment easily" single]) (js-comint . [(20171129 2056) ((emacs (24 3))) "JavaScript interpreter in window." single]) (js-codemod . [(20171104 454) ((emacs (24 4))) "Run js-codemod on current line or selected region" tar]) (js-auto-format-mode . [(20180123 830) ((emacs (24))) "Minor mode for auto-formatting JavaScript code" single]) (js-auto-beautify . [(20161030 2209) ((web-beautify (0 3 1)) (web-mode (14 0 27))) "auto format you js/jsx file" single]) (jquery-doc . [(20150812 58) nil "jQuery api documentation interface for emacs" tar]) (jq-mode . [(20180407 1048) ((emacs (25 1))) "Edit jq scripts." tar]) (jpop . [(20170410 550) ((emacs (24)) (dash (2 11 0)) (cl-lib (0 5))) "Lightweight project caching and navigation framework" tar]) (jonprl-mode . [(20160818 1759) ((emacs (24 3)) (cl-lib (0 5)) (yasnippet (0 8 0))) "A major mode for editing JonPRL files" tar]) (jknav . [(20121006 1325) nil "Automatically enable j/k keys for line-based navigation" single]) (jist . [(20161229 921) ((emacs (24 4)) (dash (2 12 0)) (seq (1 11)) (let-alist (1 0 4)) (magit (2 1 0)) (request (0 2 0))) "Gist integration" single]) (jira-markup-mode . [(20150601 1409) nil "Emacs Major mode for JIRA-markup-formatted text files" single]) (jinja2-mode . [(20141128 207) nil "A major mode for jinja2" single]) (jg-quicknav . [(20170808 1830) ((s (1 9 0)) (cl-lib (0 5))) "Quickly navigate the file system to find a file." single]) (jetbrains . [(20180228 2102) ((emacs (24 3)) (cl-lib (0 5)) (f (0 17))) "JetBrains IDE bridge" single]) (jenkins-watch . [(20121004 1626) nil "Watch continuous integration build status" single]) (jenkins . [(20170721 236) ((dash (2 12)) (emacs (24 3)) (json (1 4))) "Minimalistic Jenkins client for Emacs" single]) (jemdoc-mode . [(20170704 1327) ((emacs (24 3))) "Major mode for editing jemdoc files" single]) (jekyll-modes . [(20141117 514) ((polymode (0 2))) "Major modes (markdown and HTML) for authoring Jekyll content" single]) (jedi-direx . [(20140310 236) ((jedi (0 1 2)) (direx (0 1 -3))) "Tree style source code viewer for Python buffer" single]) (jedi-core . [(20170121 610) ((emacs (24)) (epc (0 1 0)) (python-environment (0 0 2)) (cl-lib (0 5))) "Common code of jedi.el and company-jedi.el" tar]) (jedi . [(20160425 2156) ((emacs (24)) (jedi-core (0 2 2)) (auto-complete (1 4))) "a Python auto-completion for Emacs" single]) (jdee . [(20180711 1336) ((emacs (24 3)) (flycheck (30)) (memoize (1 0 1)) (dash (2 13 0)) (s (1 12 0))) "Java Development Environment for Emacs" tar]) (jdecomp . [(20170224 1400) ((emacs (24 5))) "Interface to Java decompilers" single]) (jbeans-theme . [(20180309 825) ((emacs (24))) "Jbeans theme for GNU Emacs 24 (deftheme)" single]) (jazz-theme . [(20170411 711) nil "A warm color theme for Emacs 24+." single]) (jaword . [(20170425 2327) ((tinysegmenter (0 1))) "Minor-mode for handling Japanese words better" single]) (javap-mode . [(20120223 1408) nil "Javap major mode" single]) (javadoc-lookup . [(20160213 1631) ((cl-lib (0 3))) "Javadoc Emacs integration with Maven" tar]) (java-snippets . [(20160626 1952) ((yasnippet (0 8 0))) "Yasnippets for Java" tar]) (java-imports . [(20170913 710) ((emacs (24 4)) (s (1 10 0)) (pcache (0 3 2))) "Code for dealing with Java imports" single]) (jastadd-ast-mode . [(20161219 126) ((emacs (24))) "Major mode for editing JastAdd AST files" single]) (jasminejs-mode . [(20150526 1705) nil "A minor mode for manipulating jasmine test files" tar]) (jar-manifest-mode . [(20160430 1726) nil "Major mode to edit JAR manifest files" single]) (jape-mode . [(20140903 806) nil "An Emacs editing mode mode for GATE's JAPE files" single]) (japanlaw . [(20160129 20) ((cl-lib (0 5))) "Japan law from law.e-gov.go.jp" single]) (japanese-holidays . [(20160927 2318) ((cl-lib (0 3))) "calendar functions for the Japanese calendar" single]) (jammer . [(20160310 59) nil "Punish yourself for using Emacs inefficiently" single]) (jade-mode . [(20160525 741) nil "Major mode for editing .jade files" single]) (jack-connect . [(20141207 407) nil "Manage jack connections within Emacs" single]) (jabber-otr . [(20150918 444) ((emacs (24)) (jabber (0 8 92))) "Off-The-Record messaging for jabber.el" tar]) (jabber . [(20170423 513) ((fsm (0 2))) "A Jabber client for Emacs." tar]) (j-mode . [(20171224 1056) nil "Major mode for editing J programs" tar]) (iy-go-to-char . [(20141029 846) nil "Go to next CHAR which is similar to \"f\" and \"t\" in vim" single]) (ix . [(20131027 929) ((grapnel (0 5 3))) "Emacs client for http://ix.io pastebin" single]) (ivy-youtube . [(20171112 732) ((request (0 2 0)) (ivy (0 8 0)) (cl-lib (0 5))) "Query YouTube and play videos in your browser" single]) (ivy-yasnippet . [(20180620 2336) ((emacs (24)) (ivy (0 10 0)) (yasnippet (0 12 2)) (dash (2 14 1))) "Preview yasnippets with ivy" single]) (ivy-xref . [(20180701 2117) ((emacs (25 1)) (ivy (0 10 0))) "Ivy interface for xref results" single]) (ivy-xcdoc . [(20160917 355) ((ivy (0 8 0)) (emacs (24 4))) "Search Xcode documents with ivy interface." single]) (ivy-todo . [(20171208 809) ((ivy (0 8 0)) (emacs (24 3))) "Manage org-mode TODOs with ivy" single]) (ivy-rtags . [(20170522 2154) ((ivy (0 7 0)) (rtags (2 10))) "RTags completion back-end for ivy" single]) (ivy-rich . [(20180704 1845) ((emacs (24 4)) (ivy (0 8 0))) "More friendly display transformer for ivy." single]) (ivy-purpose . [(20160724 303) ((emacs (24)) (ivy (0 8)) (window-purpose (1 5))) "Ivy Interface for Purpose" single]) (ivy-prescient . [(20180716 907) ((emacs (25 1)) (prescient (2 0)) (ivy (0 10 0))) "prescient.el + Ivy" single]) (ivy-posframe . [(20180707 2016) ((emacs (26 0)) (posframe (0 1 0)) (ivy (0 10 0))) "Using posframe to show Ivy" single]) (ivy-phpunit . [(20180219 115) ((ivy (0 10 0)) (phpunit (0 7 0)) (emacs (25))) "Ivy integration for phpunit.el" single]) (ivy-pass . [(20170812 1255) ((emacs (24)) (ivy (0 8 0)) (password-store (1 6 5))) "ivy interface for pass" single]) (ivy-pages . [(20160728 1220) ((emacs (24 1)) (ivy (0 8 0))) "Complete current buffer's pages with Ivy" single]) (ivy-mpdel . [(20180502 1148) ((emacs (25 1)) (ivy (0 10 0)) (libmpdel (0 5 0)) (mpdel (0 4 0))) "Ivy interface to navigate MPD" single]) (ivy-lobsters . [(20171202 1241) ((ivy (0 8 0)) (cl-lib (0 5))) "Browse lobste.rs stories with ivy." single]) (ivy-hydra . [(20180614 1500) ((emacs (24 1)) (ivy (0 9 0)) (hydra (0 13 4))) "Additional key bindings for Ivy" single]) (ivy-historian . [(20170715 2120) ((emacs (24 4)) (historian (20170111)) (ivy (0 8 0)) (flx (0 6 1))) "Persistently store selected minibuffer candidates" single]) (ivy-gitlab . [(20180312 947) ((s (1 9 0)) (dash (2 9 0)) (ivy (0 8 0)) (gitlab (0 8))) "Ivy interface to Gitlab" single]) (ivy-feedwrangler . [(20180618 822) nil "No description available." single]) (ivy-erlang-complete . [(20180715 2144) ((async (1 9)) (counsel (0 8 0)) (ivy (0 8 0)) (erlang (19 2)) (emacs (24 4))) "Erlang context sensitive completion at point using ivy. It also support xref and eldoc." tar]) (ivy-dired-history . [(20170625 2256) ((ivy (0 9 0)) (counsel (0 9 0)) (cl-lib (0 5))) "use ivy to open recent directories" single]) (ivy-bibtex . [(20180612 619) ((swiper (0 7 0)) (parsebib (1 0)) (s (1 9 0)) (dash (2 6 0)) (f (0 16 2)) (cl-lib (0 5)) (biblio (0 2))) "A bibliography manager based on Ivy" tar]) (ivy . [(20180723 846) ((emacs (24 1))) "Incremental Vertical completYon" tar]) (ivs-edit . [(20170818 741) ((emacs (24 3)) (dash (2 6 0)) (cl-lib (1 0))) "IVS (Ideographic Variation Sequence) editing tool" tar]) (ivariants . [(20170822 1924) ((emacs (24 3)) (ivs-edit (1 0))) "Ideographic variants editor and browser" tar]) (iterator . [(20170207 38) ((emacs (24)) (cl-lib (0 5))) "A library to create and use elisp iterators objects." single]) (iter2 . [(20180510 633) ((emacs (25 1))) "Reimplementation of Elisp generators" single]) (itasca . [(20170601 922) ((emacs (24 3))) "Major modes for Itasca software data files." tar]) (itail . [(20171112 4) nil "An interactive tail mode" single]) (iss-mode . [(20141001 1213) nil "Mode for InnoSetup install scripts" single]) (isortify . [(20180612 622) ((emacs (25)) (pythonic (0 1 0))) "(automatically) format python buffers using isort." single]) (isgd . [(20150414 236) nil "Shorten URLs using the isgd.com shortener service" single]) (isend-mode . [(20171118 745) nil "Interactively send parts of an Emacs buffer to an interpreter" single]) (isearch-symbol-at-point . [(20130728 1521) nil "Use isearch to search for the symbol at point" single]) (isearch-dabbrev . [(20141223 2222) ((cl-lib (0 5))) "Use dabbrev in isearch" single]) (irony-eldoc . [(20170502 1208) ((emacs (24)) (cl-lib (0 5)) (irony (0 1))) "irony-mode support for eldoc-mode" single]) (irony . [(20180703 1040) ((cl-lib (0 5)) (json (1 2))) "C/C++ minor mode powered by libclang" tar]) (iregister . [(20150515 1407) nil "Interactive register commands for Emacs." tar]) (ir-black-theme . [(20130302 2355) nil "Port of ir-black theme" single]) (iqa . [(20170722 834) ((emacs (24 3))) "Init file(and directory) Quick Access." single]) (ipython-shell-send . [(20171212 318) ((emacs (24))) "Send code (including magics) to ipython shell" single]) (ipretty . [(20180605 2222) nil "Interactive Emacs Lisp pretty-printing" single]) (iplayer . [(20161120 1320) nil "Browse and download BBC TV/radio shows" single]) (ipcalc . [(20170926 105) ((cl-lib (0 5))) "IP subnet calculator" single]) (iodine-theme . [(20151031 939) ((emacs (24))) "A light emacs color theme" single]) (ioccur . [(20130821 2248) nil "Incremental occur" single]) (io-mode-inf . [(20140128 1134) nil "Interaction with an Io interpreter." single]) (io-mode . [(20161004 56) nil "Major mode to edit Io language files in Emacs" single]) (inverse-acme-theme . [(20170822 1954) ((autothemer (0 2)) (cl-lib (0 5))) "A theme that looks like an inverse of Acme's color scheme." single]) (interval-tree . [(20130325 707) ((dash (1 1 0))) "Interval tree data structure for 1D range queries" single]) (interval-list . [(20150327 1018) ((dash (2 4 0)) (cl-lib (0 5)) (emacs (24 4))) "Interval list data structure for 1D selections" single]) (intero . [(20180703 18) ((flycheck (0 25)) (company (0 8)) (emacs (24 4)) (haskell-mode (13 0))) "Complete development mode for Haskell" single]) (interleave . [(20171003 2324) nil "Interleaving text books since 2015" single]) (interaction-log . [(20160305 501) ((cl-lib (0))) "exhaustive log of interactions with Emacs" single]) (intellij-theme . [(20171017 715) nil "Inspired by IntelliJ's default theme" single]) (intel-hex-mode . [(20180422 1731) nil "Mode for Intel Hex files." single]) (instapaper . [(20130104 621) nil "add URLs to instapaper from emacs" single]) (insfactor . [(20141116 1602) nil "Client for a Clojure project with insfactor in it" single]) (insert-shebang . [(20180403 514) nil "Insert shebang line automatically." single]) (inlineR . [(20120520 732) nil "insert Tag for inline image of R graphics" single]) (inline-docs . [(20170522 2150) ((emacs (24 3))) "Show inline contextual docs." single]) (inline-crypt . [(20170824 200) nil "Simple inline encryption via openssl" tar]) (inkpot-theme . [(20171217 144) nil "port of vim's inkpot theme" single]) (ink-mode . [(20160814 416) ((emacs (24 3))) "Major mode for writing interactive fiction in Ink" single]) (initsplit . [(20160919 1118) nil "code to split customizations into different files" single]) (init-open-recentf . [(20161206 645) ((emacs (24 4))) "Open recentf immediately after Emacs is started" single]) (init-loader . [(20160528 615) nil "Loader for configuration files" single]) (ini-mode . [(20170424 209) nil "Major mode for Windows-style ini files." single]) (inherit-local . [(20170409 949) ((emacs (24 3))) "Inherited buffer-local variables" single]) (info-colors . [(20180205 350) ((emacs (24)) (cl-lib (0 5))) "Extra colors for Info-mode" single]) (info-buffer . [(20170112 622) nil "Display info topics in separate buffers" single]) (info-beamer . [(20180604 1422) ((emacs (24 4))) "Utilities for working with info-beamer" single]) (inflections . [(20170913 216) ((cl-lib (0 5)) (emacs (24))) "convert english words between singular and plural" single]) (inferior-spim . [(20160826 646) nil "inferior mode for spim." single]) (inf-ruby . [(20180521 648) nil "Run a Ruby process in a buffer" single]) (inf-mongo . [(20180408 638) nil "Run a MongoDB shell process in a buffer" single]) (inf-crystal . [(20180118 1811) ((emacs (24 3)) (crystal-mode (0 1 0))) "Run a Inferior-Crystal process in a buffer" single]) (inf-clojure . [(20180402 1403) ((emacs (24 4)) (clojure-mode (5 6))) "Run an external Clojure process in an Emacs buffer" single]) (indy . [(20150610 1006) nil "A minor mode and EDSL to manage your mode's indentation rules." single]) (indium . [(20180521 1355) ((emacs (25)) (seq (2 16)) (js2-mode (20140114)) (company (0 9 0)) (websocket (1 6))) "JavaScript Awesome Development Environment" tar]) (indicators . [(20161211 326) ((dash (2 13 0)) (cl-lib (0 5 0))) "Display the buffer relative location of line in the fringe." single]) (indent-tools . [(20180124 408) ((s (0)) (hydra (0)) (yafolding (0))) "Indent, navigate (and more) by blocks of indentation: yaml, python etc." tar]) (indent-info . [(20180423 1212) nil "show indentation information in status bar" single]) (indent-guide . [(20170221 327) nil "show vertical lines to guide indentation" single]) (importmagic . [(20180519 2003) ((f (0 11 0)) (epc (0 1 0)) (emacs (24 3))) "Fix Python imports using importmagic." tar]) (import-popwin . [(20170218 607) ((emacs (24 3)) (popwin (0 6))) "popwin buffer near by import statements with popwin" single]) (import-js . [(20180709 1133) ((grizzl (0 1 0)) (emacs (24))) "Import Javascript dependencies" single]) (impatient-mode . [(20180528 916) ((cl-lib (0 3)) (simple-httpd (1 4 0)) (htmlize (1 40))) "Serve buffers live over HTTP" tar]) (immutant-server . [(20140311 1508) nil "Run your Immutant server in Emacs" single]) (immortal-scratch . [(20160517 1418) nil "respawn the scratch buffer when it's killed" single]) (imgbb . [(20180609 949) ((emacs (24)) (request (0 3 0))) "Simple image upload client for imgbb.com" single]) (imenus . [(20180505 1017) ((cl-lib (0 5))) "Imenu for multiple buffers and without subgroups" single]) (imenu-list . [(20180601 702) ((cl-lib (0 5))) "Show imenu entries in a separate buffer" single]) (imenu-anywhere . [(20170805 1155) ((cl-lib (0 5))) "ido/ivy/helm imenu across same mode/project/etc buffers" single]) (imapfilter . [(20180318 1327) nil "run the imapfilter executable" single]) (imake . [(20180318 1559) ((emacs (24 3))) "Simple, opinionated make target runner" single]) (imakado . [(20141024 223) nil "imakado's usefull macros and functions" single]) (image-dired+ . [(20150429 2244) ((cl-lib (0 3))) "Image-dired extensions" single]) (image-archive . [(20150620 1832) ((emacs (24)) (cl-lib (0 5))) "Image thumbnails in archive file with non-blocking" single]) (image+ . [(20150707 916) ((cl-lib (0 3))) "Image manipulate extensions for Emacs" single]) (igv . [(20141210 427) nil "Control Integrative Genomic Viewer within Emacs" single]) (ignoramus . [(20160414 709) nil "Ignore backups, build files, et al." single]) (iflipb . [(20171113 1244) nil "interactively flip between recently visited buffers" single]) (ietf-docs . [(20150928 257) nil "Fetch, Cache and Load IETF documents" single]) (iedit . [(20180207 219) nil "Edit multiple regions in the same way simultaneously." tar]) (ids-edit . [(20170818 802) ((emacs (24 3))) "IDS (Ideographic Description Sequence) editing tool" tar]) (idris-mode . [(20180416 2245) ((emacs (24)) (prop-menu (0 1)) (cl-lib (0 5))) "Major mode for editing Idris code" tar]) (idomenu . [(20141123 1320) nil "imenu tag selection a la ido" single]) (ido-yes-or-no . [(20161108 1551) ((ido-completing-read+ (0))) "Use Ido to answer yes-or-no questions" single]) (ido-vertical-mode . [(20180618 1401) nil "Makes ido-mode display vertically." single]) (ido-springboard . [(20170105 2355) nil "Temporarily change default-directory for one command" single]) (ido-sort-mtime . [(20171121 59) nil "Sort Ido's file list by modification time" single]) (ido-skk . [(20151111 150) ((emacs (24 4)) (ddskk (20150912 1820))) "ido interface for skk henkan" single]) (ido-select-window . [(20131220 1247) ((emacs (24 1))) "Select a window using ido and buffer names" single]) (ido-occur . [(20160820 740) ((dash (2 13 0))) "Yet another `occur' with `ido'." single]) (ido-occasional . [(20150214 448) ((emacs (24 1))) "Use ido where you choose." single]) (ido-migemo . [(20150921 1544) ((migemo (1 9 1))) "Migemo plug-in for Ido" single]) (ido-load-library . [(20140611 900) ((persistent-soft (0 8 8)) (pcache (0 2 3))) "Load-library alternative using ido-completing-read" single]) (ido-hacks . [(20150331 1209) nil "Put more IDO in your IDO" single]) (ido-grid-mode . [(20160122 339) ((emacs (24 4))) "Display ido-prospects in the minibuffer in a grid." single]) (ido-gnus . [(20140216 846) ((gnus (5 13))) "Access gnus groups or servers using ido" single]) (ido-flex-with-migemo . [(20180323 456) ((flx-ido (0 6 1)) (migemo (1 9 1)) (emacs (24 4))) "use ido with flex and migemo" single]) (ido-exit-target . [(20170717 1151) ((emacs (24 4))) "Commands and keys for selecting other window and frame targets within ido" single]) (ido-describe-bindings . [(20161023 402) ((dash (2 13 0))) "Yet another `describe-bindings' with `ido'." single]) (ido-completing-read+ . [(20180627 1944) ((emacs (24 4)) (cl-lib (0 5)) (s (0 1)) (memoize (1 1))) "A completing-read-function using ido" single]) (ido-complete-space-or-hyphen . [(20130228 208) nil "Complete SPACE or HYPHEN when type SPACE in ido" single]) (ido-clever-match . [(20151011 1026) ((emacs (24 4)) (cl-lib (0 5))) "Alternative matcher for ido." single]) (ido-at-point . [(20151021 57) ((emacs (24))) "ido-style completion-at-point" single]) (idle-require . [(20090715 1503) nil "load elisp libraries while Emacs is idle" single]) (idle-highlight-mode . [(20120920 948) nil "highlight the word the point is on" single]) (identica-mode . [(20130204 1453) nil "Major mode API client for status.net open microblogging" tar]) (idea-darkula-theme . [(20160416 1603) ((emacs (24 1))) "Color theme based on IntelliJ IDEA Darkula color theme" single]) (id-manager . [(20170320 546) nil "id-password management" single]) (ibuffer-vc . [(20171106 2341) ((cl-lib (0 2))) "Group ibuffer's list by VC project, or show VC status" single]) (ibuffer-tramp . [(20151118 939) nil "Group ibuffer's list by TRAMP connection" single]) (ibuffer-sidebar . [(20180218 1731) ((emacs (25 1))) "Sidebar for `ibuffer'" single]) (ibuffer-rcirc . [(20150215 1318) ((cl-lib (0 2))) "Ibuffer integration for rcirc" single]) (ibuffer-projectile . [(20180324 2025) ((projectile (0 11 0))) "Group ibuffer's list by projectile root" single]) (ibuffer-git . [(20110508 31) nil "show git status in ibuffer column" single]) (iasm-mode . [(20171023 722) nil "interactive assembly major mode." single]) (ialign . [(20180705 453) ((emacs (24 4))) "visual align-regexp" single]) (i3wm . [(20170822 738) nil "i3wm integration library" single]) (i2b2-mode . [(20140709 1804) nil "Highlights corresponding PHI data in the text portion of an i2b2 XML Document." single]) (hydra . [(20180703 802) ((cl-lib (0 5))) "Make bindings that stick around." tar]) (hyde . [(20160507 2008) nil "Major mode to help create and manage Jekyll blogs" tar]) (hydandata-light-theme . [(20160815 2118) nil "A light color theme that is easy on your eyes" single]) (hyai . [(20170301 647) ((cl-lib (0 5)) (emacs (24))) "Haskell Yet Another Indentation" single]) (hy-mode . [(20180702 1240) ((dash (2 13 0)) (dash-functional (1 2 0)) (s (1 11 0)) (emacs (24))) "Major mode for Hylang" single]) (hungry-delete . [(20170411 1802) nil "hungry delete minor mode" single]) (hungarian-holidays . [(20161020 438) nil "Adds a list of Hungarian public holidays to Emacs calendar" single]) (hugsql-ghosts . [(20180425 429) ((s (1 9 0)) (dash (2 10 0)) (cider (0 14 0))) "Display hugsql defqueries in clojure code as an overlay." single]) (httprepl . [(20141101 1034) ((s (1 9 0)) (dash (2 5 0)) (emacs (24))) "An HTTP REPL" single]) (httpcode . [(20121001 2045) nil "explains the meaning of an HTTP status code" single]) (http-twiddle . [(20160801 1211) nil "send & twiddle & resend HTTP requests" single]) (http-post-simple . [(20170715 240) nil "HTTP POST requests using the url library" single]) (http . [(20170906 1111) ((emacs (24 4)) (request (0 2 0)) (edit-indirect (0 1 4))) "Yet another HTTP client" single]) (htmlize . [(20180412 1244) nil "Convert buffer text and decorations to HTML." single]) (html2org . [(20170417 2201) ((emacs (24 4))) "Convert html to org format text" single]) (html-to-markdown . [(20151105 40) ((cl-lib (0 5))) "HTML to Markdown converter written in Emacs-lisp." single]) (html-to-hiccup . [(20161028 701) ((emacs (25 1)) (dash (2 13 0)) (s (1 10 0))) "Convert HTML to Hiccup syntax" single]) (html-script-src . [(20120403 1115) nil "Insert ") - (put places 'head-end (point-marker)) - (insert "\n ") - (put places 'body-start (point-marker)) - (insert (htmlize-method body-tag face-map) - "\n ") - (put places 'content-start (point-marker)) - (insert (htmlize-method pre-tag face-map) "\n")) - (let ((text-markup - ;; Get the inserter method, so we can funcall it inside - ;; the loop. Not calling `htmlize-method' in the loop - ;; body yields a measurable speed increase. - (htmlize-method-function 'text-markup)) - ;; Declare variables used in loop body outside the loop - ;; because it's faster to establish `let' bindings only - ;; once. - next-change text face-list trailing-ellipsis - fstruct-list last-fstruct-list - (close-markup (lambda ()))) - ;; This loop traverses and reads the source buffer, appending - ;; the resulting HTML to HTMLBUF. This method is fast - ;; because: 1) it doesn't require examining the text - ;; properties char by char (htmlize-next-face-change is used - ;; to move between runs with the same face), and 2) it doesn't - ;; require frequent buffer switches, which are slow because - ;; they rebind all buffer-local vars. - (goto-char (point-min)) - (while (not (eobp)) - (setq next-change (htmlize-next-face-change (point))) - ;; Get faces in use between (point) and NEXT-CHANGE, and - ;; convert them to fstructs. - (setq face-list (htmlize-faces-at-point) - fstruct-list (delq nil (mapcar (lambda (f) - (gethash f face-map)) - face-list))) - (multiple-value-setq (text trailing-ellipsis) - (htmlize-extract-text (point) next-change trailing-ellipsis)) - ;; Don't bother writing anything if there's no text (this - ;; happens in invisible regions). - (when (> (length text) 0) - ;; Open the new markup if necessary and insert the text. - (when (not (equalp fstruct-list last-fstruct-list)) - (funcall close-markup) - (setq last-fstruct-list fstruct-list - close-markup (funcall text-markup fstruct-list htmlbuf))) - (princ text htmlbuf)) - (goto-char next-change)) - - ;; We've gone through the buffer; close the markup from - ;; the last run, if any. - (funcall close-markup)) - - ;; Insert the epilog and post-process the buffer. - (with-current-buffer htmlbuf - (insert "") - (put places 'content-end (point-marker)) - (insert "\n ") - (put places 'body-end (point-marker)) - (insert "\n\n") - (htmlize-defang-local-variables) - (goto-char (point-min)) - (when htmlize-html-major-mode - ;; What sucks about this is that the minor modes, most notably - ;; font-lock-mode, won't be initialized. Oh well. - (funcall htmlize-html-major-mode)) - (set (make-local-variable 'htmlize-buffer-places) - (symbol-plist places)) - (run-hooks 'htmlize-after-hook) - (buffer-enable-undo)) - (setq completed t) - htmlbuf) - - (when (not completed) - (kill-buffer htmlbuf)) - (htmlize-delete-tmp-overlays))))) - -;; Utility functions. - -(defmacro htmlize-with-fontify-message (&rest body) - ;; When forcing fontification of large buffers in - ;; htmlize-ensure-fontified, inform the user that he is waiting for - ;; font-lock, not for htmlize to finish. - `(progn - (if (> (buffer-size) 65536) - (message "Forcing fontification of %s..." - (buffer-name (current-buffer)))) - ,@body - (if (> (buffer-size) 65536) - (message "Forcing fontification of %s...done" - (buffer-name (current-buffer)))))) - -(defun htmlize-ensure-fontified () - ;; If font-lock is being used, ensure that the "support" modes - ;; actually fontify the buffer. If font-lock is not in use, we - ;; don't care because, except in htmlize-file, we don't force - ;; font-lock on the user. - (when (and (boundp 'font-lock-mode) - font-lock-mode) - ;; In part taken from ps-print-ensure-fontified in GNU Emacs 21. - (cond - ((and (boundp 'jit-lock-mode) - (symbol-value 'jit-lock-mode)) - (htmlize-with-fontify-message - (jit-lock-fontify-now (point-min) (point-max)))) - ((and (boundp 'lazy-lock-mode) - (symbol-value 'lazy-lock-mode)) - (htmlize-with-fontify-message - (lazy-lock-fontify-region (point-min) (point-max)))) - ((and (boundp 'lazy-shot-mode) - (symbol-value 'lazy-shot-mode)) - (htmlize-with-fontify-message - ;; lazy-shot is amazing in that it must *refontify* the region, - ;; even if the whole buffer has already been fontified. - (lazy-shot-fontify-region (point-min) (point-max)))) - ;; There's also fast-lock, but we don't need to handle specially, - ;; I think. fast-lock doesn't really defer fontification, it - ;; just saves it to an external cache so it's not done twice. - ))) - - -;;;###autoload -(defun htmlize-buffer (&optional buffer) - "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." - (interactive) - (let ((htmlbuf (with-current-buffer (or buffer (current-buffer)) - (htmlize-buffer-1)))) - (when (interactive-p) - (switch-to-buffer htmlbuf)) - htmlbuf)) - -;;;###autoload -(defun htmlize-region (beg end) - "Convert the region to HTML, preserving colors and decorations. -See `htmlize-buffer' for details." - (interactive "r") - ;; Don't let zmacs region highlighting end up in HTML. - (when (fboundp 'zmacs-deactivate-region) - (zmacs-deactivate-region)) - (let ((htmlbuf (save-restriction - (narrow-to-region beg end) - (htmlize-buffer-1)))) - (when (interactive-p) - (switch-to-buffer htmlbuf)) - htmlbuf)) - -(defun htmlize-region-for-paste (beg end) - "Htmlize the region and return just the HTML as a string. -This forces the `inline-css' style and only returns the HTML body, -but without the BODY tag. This should make it useful for inserting -the text to another HTML buffer." - (let* ((htmlize-output-type 'inline-css) - (htmlbuf (htmlize-region beg end))) - (unwind-protect - (with-current-buffer htmlbuf - (buffer-substring (plist-get htmlize-buffer-places 'content-start) - (plist-get htmlize-buffer-places 'content-end))) - (kill-buffer htmlbuf)))) - -(defun htmlize-region-save-screenshot (beg end) - "Save the htmlized (see `htmlize-region-for-paste') region in -the kill ring. Uses `inline-css', with style information in -`
' tags, so that the rendering of the marked up text
-approximates the buffer as closely as possible."
-  (interactive "r")
-  (let ((htmlize-pre-style t))
-    (kill-new (htmlize-region-for-paste beg end)))
-  (deactivate-mark))
-
-(defun htmlize-make-file-name (file)
-  "Make an HTML file name from FILE.
-
-In its default implementation, this simply appends `.html' to FILE.
-This function is called by htmlize to create the buffer file name, and
-by `htmlize-file' to create the target file name.
-
-More elaborate transformations are conceivable, such as changing FILE's
-extension to `.html' (\"file.c\" -> \"file.html\").  If you want them,
-overload this function to do it and htmlize will comply."
-  (concat file ".html"))
-
-;; Older implementation of htmlize-make-file-name that changes FILE's
-;; extension to ".html".
-;(defun htmlize-make-file-name (file)
-;  (let ((extension (file-name-extension file))
-;	(sans-extension (file-name-sans-extension file)))
-;    (if (or (equal extension "html")
-;	    (equal extension "htm")
-;	    (equal sans-extension ""))
-;	(concat file ".html")
-;      (concat sans-extension ".html"))))
-
-;;;###autoload
-(defun htmlize-file (file &optional target)
-  "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."
-  (interactive (list (read-file-name
-		      "HTML-ize file: "
-		      nil nil nil (and (buffer-file-name)
-				       (file-name-nondirectory
-					(buffer-file-name))))))
-  (let ((output-file (if (and target (not (file-directory-p target)))
-			 target
-		       (expand-file-name
-			(htmlize-make-file-name (file-name-nondirectory file))
-			(or target (file-name-directory file)))))
-	;; Try to prevent `find-file-noselect' from triggering
-	;; font-lock because we'll fontify explicitly below.
-	(font-lock-mode nil)
-	(font-lock-auto-fontify nil)
-	(global-font-lock-mode nil)
-	;; Ignore the size limit for the purposes of htmlization.
-	(font-lock-maximum-size nil)
-	;; Disable font-lock support modes.  This will only work in
-	;; more recent Emacs versions, so htmlize-buffer-1 still needs
-	;; to call htmlize-ensure-fontified.
-	(font-lock-support-mode nil))
-    (with-temp-buffer
-      ;; Insert FILE into the temporary buffer.
-      (insert-file-contents file)
-      ;; Set the file name so normal-mode and htmlize-buffer-1 pick it
-      ;; up.  Restore it afterwards so with-temp-buffer's kill-buffer
-      ;; doesn't complain about killing a modified buffer.
-      (let ((buffer-file-name file))
-	;; Set the major mode for the sake of font-lock.
-	(normal-mode)
-	(font-lock-mode 1)
-	(unless font-lock-mode
-	  ;; In GNU Emacs (font-lock-mode 1) doesn't force font-lock,
-	  ;; contrary to the documentation.  This seems to work.
-	  (font-lock-fontify-buffer))
-	;; htmlize the buffer and save the HTML.
-	(with-current-buffer (htmlize-buffer-1)
-	  (unwind-protect
-	      (progn
-		(run-hooks 'htmlize-file-hook)
-		(write-region (point-min) (point-max) output-file))
-	    (kill-buffer (current-buffer)))))))
-  ;; I haven't decided on a useful return value yet, so just return
-  ;; nil.
-  nil)
-
-;;;###autoload
-(defun htmlize-many-files (files &optional target-directory)
-  "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."
-  (interactive
-   (list
-    (let (list file)
-      ;; Use empty string as DEFAULT because setting DEFAULT to nil
-      ;; defaults to the directory name, which is not what we want.
-      (while (not (equal (setq file (read-file-name
-				     "HTML-ize file (RET to finish): "
-				     (and list (file-name-directory
-						(car list)))
-				     "" t))
-			 ""))
-	(push file list))
-      (nreverse list))))
-  ;; Verify that TARGET-DIRECTORY is indeed a directory.  If it's a
-  ;; file, htmlize-file will use it as target, and that doesn't make
-  ;; sense.
-  (and target-directory
-       (not (file-directory-p target-directory))
-       (error "target-directory must name a directory: %s" target-directory))
-  (dolist (file files)
-    (htmlize-file file target-directory)))
-
-;;;###autoload
-(defun htmlize-many-files-dired (arg &optional target-directory)
-  "HTMLize dired-marked files."
-  (interactive "P")
-  (htmlize-many-files (dired-get-marked-files nil arg) target-directory))
-
-(provide 'htmlize)
-
-;; Local Variables:
-;; byte-compile-warnings: (not cl-functions lexical unresolved obsolete)
-;; End:
-
-;;; htmlize.el ends here
diff --git a/elpa/htmlize-20171017.141/htmlize.elc b/elpa/htmlize-20171017.141/htmlize.elc
deleted file mode 100644
index 6ade214..0000000
Binary files a/elpa/htmlize-20171017.141/htmlize.elc and /dev/null differ
diff --git a/elpa/htmlize-20180412.1244/htmlize-autoloads.el b/elpa/htmlize-20180412.1244/htmlize-autoloads.el
deleted file mode 100644
index 85495ef..0000000
--- a/elpa/htmlize-20180412.1244/htmlize-autoloads.el
+++ /dev/null
@@ -1,76 +0,0 @@
-;;; 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" (23330 6099 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)
-
-;;;***
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; htmlize-autoloads.el ends here
diff --git a/elpa/htmlize-20180412.1244/htmlize-pkg.el b/elpa/htmlize-20180412.1244/htmlize-pkg.el
deleted file mode 100644
index afdd166..0000000
--- a/elpa/htmlize-20180412.1244/htmlize-pkg.el
+++ /dev/null
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "htmlize" "20180412.1244" "Convert buffer text and decorations to HTML." 'nil :commit "315a8f23cfd3e87642ff9e30ae3300c7a84244d5" :keywords '("hypermedia" "extensions"))
diff --git a/elpa/htmlize-20180412.1244/htmlize.el b/elpa/htmlize-20180412.1244/htmlize.el
deleted file mode 100644
index 37396d6..0000000
--- a/elpa/htmlize-20180412.1244/htmlize.el
+++ /dev/null
@@ -1,1903 +0,0 @@
-;;; htmlize.el --- Convert buffer text and decorations to HTML. -*- lexical-binding: t -*-
-
-;; Copyright (C) 1997-2003,2005,2006,2009,2011,2012,2014,2017,2018 Hrvoje Niksic
-
-;; Author: Hrvoje Niksic 
-;; Keywords: hypermedia, extensions
-;; Package-Version: 20180412.1244
-;; Version: 1.54
-
-;; 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 2, 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; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-
-;; This package converts the buffer text and the associated
-;; decorations to HTML.  Mail to  to discuss
-;; features and additions.  All suggestions are more than welcome.
-
-;; To use it, just switch to the buffer you want HTML-ized and type
-;; `M-x htmlize-buffer'.  You will be switched to a new buffer that
-;; contains the resulting HTML code.  You can edit and inspect this
-;; buffer, or you can just save it with C-x C-w.  `M-x htmlize-file'
-;; will find a file, fontify it, and save the HTML version in
-;; FILE.html, without any additional intervention.  `M-x
-;; htmlize-many-files' allows you to htmlize any number of files in
-;; the same manner.  `M-x htmlize-many-files-dired' does the same for
-;; files marked in a dired buffer.
-
-;; htmlize supports three types of HTML output, selected by setting
-;; `htmlize-output-type': `css', `inline-css', and `font'.  In `css'
-;; mode, htmlize uses cascading style sheets to specify colors; it
-;; generates classes that correspond to Emacs faces and uses ... to color parts of text.  In this mode, the
-;; produced HTML is valid under the 4.01 strict DTD, as confirmed by
-;; the W3C validator.  `inline-css' is like `css', except the CSS is
-;; put directly in the STYLE attribute of the SPAN element, making it
-;; possible to paste the generated HTML into existing HTML documents.
-;; In `font' mode, htmlize uses ... to
-;; colorize HTML, which is not standard-compliant, but works better in
-;; older browsers.  `css' mode is the default.
-
-;; You can also use htmlize from your Emacs Lisp code.  When called
-;; non-interactively, `htmlize-buffer' and `htmlize-region' will
-;; return the resulting HTML buffer, but will not change current
-;; buffer or move the point.  htmlize will do its best to work on
-;; non-windowing Emacs sessions but the result will be limited to
-;; colors supported by the terminal.
-
-;; htmlize aims for compatibility with older Emacs versions.  Please
-;; let me know if it doesn't work on the version of GNU Emacs that you
-;; are using.  The package relies on the presence of CL extensions;
-;; please don't try to remove that dependency.  I see no practical
-;; problems with using the full power of the CL extensions, except
-;; that one might learn to like them too much.
-
-;; The latest version is available at:
-;;
-;;        
-;;
-
-;; Thanks go to the many people who have sent reports and contributed
-;; comments, suggestions, and fixes.  They include Ron Gut, Bob
-;; Weiner, Toni Drabik, Peter Breton, Ville Skytta, Thomas Vogels,
-;; Juri Linkov, Maciek Pasternacki, and many others.
-
-;; User quotes: "You sir, are a sick, sick, _sick_ person. :)"
-;;                  -- Bill Perry, author of Emacs/W3
-
-
-;;; Code:
-
-(require 'cl)
-(eval-when-compile
-  (defvar unresolved)
-  (defvar font-lock-auto-fontify)
-  (defvar font-lock-support-mode)
-  (defvar global-font-lock-mode))
-
-(defconst htmlize-version "1.54")
-
-(defgroup htmlize nil
-  "Convert buffer text and faces to HTML."
-  :group 'hypermedia)
-
-(defcustom htmlize-head-tags ""
-  "Additional tags to insert within HEAD of the generated document."
-  :type 'string
-  :group 'htmlize)
-
-(defcustom htmlize-output-type 'css
-  "Output type of generated HTML, one of `css', `inline-css', or `font'.
-When set to `css' (the default), htmlize will generate a style sheet
-with description of faces, and use it in the HTML document, specifying
-the faces in the actual text with .
-
-When set to `inline-css', the style will be generated as above, but
-placed directly in the STYLE attribute of the span ELEMENT: .  This makes it easier to paste the resulting HTML to
-other documents.
-
-When set to `font', the properties will be set using layout tags
-, , , , and .
-
-`css' output is normally preferred, but `font' is still useful for
-supporting old, pre-CSS browsers, and both `inline-css' and `font' for
-easier embedding of colorized text in foreign HTML documents (no style
-sheet to carry around)."
-  :type '(choice (const css) (const inline-css) (const font))
-  :group 'htmlize)
-
-(defcustom htmlize-use-images t
-  "Whether htmlize generates `img' for images attached to buffer contents."
-  :type 'boolean
-  :group 'htmlize)
-
-(defcustom htmlize-force-inline-images nil
-  "Non-nil means generate all images inline using data URLs.
-Normally htmlize converts image descriptors with :file properties to
-relative URIs, and those with :data properties to data URIs.  With this
-flag set, the images specified as a file name are loaded into memory and
-embedded in the HTML as data URIs."
-  :type 'boolean
-  :group 'htmlize)
-
-(defcustom htmlize-max-alt-text 100
-  "Maximum size of text to use as ALT text in images.
-
-Normally when htmlize encounters text covered by the `display' property
-that specifies an image, it generates an `alt' attribute containing the
-original text.  If the text is larger than `htmlize-max-alt-text' characters,
-this will not be done."
-  :type 'integer
-  :group 'htmlize)
-
-(defcustom htmlize-transform-image 'htmlize-default-transform-image
-  "Function called to modify the image descriptor.
-
-The function is called with the image descriptor found in the buffer and
-the text the image is supposed to replace.  It should return a (possibly
-different) image descriptor property list or a replacement string to use
-instead of of the original buffer text.
-
-Returning nil is the same as returning the original text."
-  :type 'boolean
-  :group 'htmlize)
-
-(defcustom htmlize-generate-hyperlinks t
-  "Non-nil means auto-generate the links from URLs and mail addresses in buffer.
-
-This is on by default; set it to nil if you don't want htmlize to
-autogenerate such links.  Note that this option only turns off automatic
-search for contents that looks like URLs and converting them to links.
-It has no effect on whether htmlize respects the `htmlize-link' property."
-  :type 'boolean
-  :group 'htmlize)
-
-(defcustom htmlize-hyperlink-style "
-      a {
-        color: inherit;
-        background-color: inherit;
-        font: inherit;
-        text-decoration: inherit;
-      }
-      a:hover {
-        text-decoration: underline;
-      }
-"
-  "The CSS style used for hyperlinks when in CSS mode."
-  :type 'string
-  :group 'htmlize)
-
-(defcustom htmlize-replace-form-feeds t
-  "Non-nil means replace form feeds in source code with HTML separators.
-Form feeds are the ^L characters at line beginnings that are sometimes
-used to separate sections of source code.  If this variable is set to
-`t', form feed characters are replaced with the 
separator. If this -is a string, it specifies the replacement to use. Note that
 is
-temporarily closed before the separator is inserted, so the default
-replacement is effectively \"

\".  If you specify
-another replacement, don't forget to close and reopen the 
 if you
-want the output to remain valid HTML.
-
-If you need more elaborate processing, set this to nil and use
-htmlize-after-hook."
-  :type 'boolean
-  :group 'htmlize)
-
-(defcustom htmlize-html-charset nil
-  "The charset declared by the resulting HTML documents.
-When non-nil, causes htmlize to insert the following in the HEAD section
-of the generated HTML:
-
-  
-
-where CHARSET is the value you've set for htmlize-html-charset.  Valid
-charsets are defined by MIME and include strings like \"iso-8859-1\",
-\"iso-8859-15\", \"utf-8\", etc.
-
-If you are using non-Latin-1 charsets, you might need to set this for
-your documents to render correctly.  Also, the W3C validator requires
-submitted HTML documents to declare a charset.  So if you care about
-validation, you can use this to prevent the validator from bitching.
-
-Needless to say, if you set this, you should actually make sure that
-the buffer is in the encoding you're claiming it is in.  (This is
-normally achieved by using the correct file coding system for the
-buffer.)  If you don't understand what that means, you should probably
-leave this option in its default setting."
-  :type '(choice (const :tag "Unset" nil)
-		 string)
-  :group 'htmlize)
-
-(defcustom htmlize-convert-nonascii-to-entities t
-  "Whether non-ASCII characters should be converted to HTML entities.
-
-When this is non-nil, characters with codes in the 128-255 range will be
-considered Latin 1 and rewritten as \"&#CODE;\".  Characters with codes
-above 255 will be converted to \"&#UCS;\", where UCS denotes the Unicode
-code point of the character.  If the code point cannot be determined,
-the character will be copied unchanged, as would be the case if the
-option were nil.
-
-When the option is nil, the non-ASCII characters are copied to HTML
-without modification.  In that case, the web server and/or the browser
-must be set to understand the encoding that was used when saving the
-buffer.  (You might also want to specify it by setting
-`htmlize-html-charset'.)
-
-Note that in an HTML entity \"&#CODE;\", CODE is always a UCS code point,
-which has nothing to do with the charset the page is in.  For example,
-\"©\" *always* refers to the copyright symbol, regardless of charset
-specified by the META tag or the charset sent by the HTTP server.  In
-other words, \"©\" is exactly equivalent to \"©\".
-
-For most people htmlize will work fine with this option left at the
-default setting; don't change it unless you know what you're doing."
-  :type 'sexp
-  :group 'htmlize)
-
-(defcustom htmlize-ignore-face-size 'absolute
-  "Whether face size should be ignored when generating HTML.
-If this is nil, face sizes are used.  If set to t, sizes are ignored
-If set to `absolute', only absolute size specifications are ignored.
-Please note that font sizes only work with CSS-based output types."
-  :type '(choice (const :tag "Don't ignore" nil)
-		 (const :tag "Ignore all" t)
-		 (const :tag "Ignore absolute" absolute))
-  :group 'htmlize)
-
-(defcustom htmlize-css-name-prefix ""
-  "The prefix used for CSS names.
-The CSS names that htmlize generates from face names are often too
-generic for CSS files; for example, `font-lock-type-face' is transformed
-to `type'.  Use this variable to add a prefix to the generated names.
-The string \"htmlize-\" is an example of a reasonable prefix."
-  :type 'string
-  :group 'htmlize)
-
-(defcustom htmlize-use-rgb-txt t
-  "Whether `rgb.txt' should be used to convert color names to RGB.
-
-This conversion means determining, for instance, that the color
-\"IndianRed\" corresponds to the (205, 92, 92) RGB triple.  `rgb.txt'
-is the X color database that maps hundreds of color names to such RGB
-triples.  When this variable is non-nil, `htmlize' uses `rgb.txt' to
-look up color names.
-
-If this variable is nil, htmlize queries Emacs for RGB components of
-colors using `color-instance-rgb-components' and `color-values'.
-This can yield incorrect results on non-true-color displays.
-
-If the `rgb.txt' file is not found (which will be the case if you're
-running Emacs on non-X11 systems), this option is ignored."
-  :type 'boolean
-  :group 'htmlize)
-
-(defvar htmlize-face-overrides nil
-  "Overrides for face definitions.
-
-Normally face definitions are taken from Emacs settings for fonts
-in the current frame.  For faces present in this plist, the
-definitions will be used instead.  Keys in the plist are symbols
-naming the face and values are the overriding definitions.  For
-example:
-
-  (setq htmlize-face-overrides
-        '(font-lock-warning-face \"black\"
-          font-lock-function-name-face \"red\"
-          font-lock-comment-face \"blue\"
-          default (:foreground \"dark-green\" :background \"yellow\")))
-
-This variable can be also be `let' bound when running `htmlize-buffer'.")
-
-(defcustom htmlize-html-major-mode nil
-  "The mode the newly created HTML buffer will be put in.
-Set this to nil if you prefer the default (fundamental) mode."
-  :type '(radio (const :tag "No mode (fundamental)" nil)
-		 (function-item html-mode)
-		 (function :tag "User-defined major mode"))
-  :group 'htmlize)
-
-(defcustom htmlize-pre-style nil
-  "When non-nil, `
' tags will be decorated with style
-information in `font' and `inline-css' modes. This allows a
-consistent background for captures of regions."
-  :type 'boolean
-  :group 'htmlize)
-
-(defvar htmlize-before-hook nil
-  "Hook run before htmlizing a buffer.
-The hook functions are run in the source buffer (not the resulting HTML
-buffer).")
-
-(defvar htmlize-after-hook nil
-  "Hook run after htmlizing a buffer.
-Unlike `htmlize-before-hook', these functions are run in the generated
-HTML buffer.  You may use them to modify the outlook of the final HTML
-output.")
-
-(defvar htmlize-file-hook nil
-  "Hook run by `htmlize-file' after htmlizing a file, but before saving it.")
-
-(defvar htmlize-buffer-places)
-
-;;; Some cross-Emacs compatibility.
-
-;; We need a function that efficiently finds the next change of a
-;; property regardless of whether the change occurred because of a
-;; text property or an extent/overlay.
-(defun htmlize-next-change (pos prop &optional limit)
-  (if prop
-      (next-single-char-property-change pos prop nil limit)
-    (next-char-property-change pos limit)))
-
-(defun htmlize-overlay-faces-at (pos)
-  (delq nil (mapcar (lambda (o) (overlay-get o 'face)) (overlays-at pos))))
-
-(defun htmlize-next-face-change (pos &optional limit)
-  ;; (htmlize-next-change pos 'face limit) would skip over entire
-  ;; overlays that specify the `face' property, even when they
-  ;; contain smaller text properties that also specify `face'.
-  ;; Emacs display engine merges those faces, and so must we.
-  (or limit
-      (setq limit (point-max)))
-  (let ((next-prop (next-single-property-change pos 'face nil limit))
-        (overlay-faces (htmlize-overlay-faces-at pos)))
-    (while (progn
-             (setq pos (next-overlay-change pos))
-             (and (< pos next-prop)
-                  (equal overlay-faces (htmlize-overlay-faces-at pos)))))
-    (setq pos (min pos next-prop))
-    ;; Additionally, we include the entire region that specifies the
-    ;; `display' property.
-    (when (get-char-property pos 'display)
-      (setq pos (next-single-char-property-change pos 'display nil limit)))
-    pos))
-
-(defmacro htmlize-lexlet (&rest letforms)
-  (declare (indent 1) (debug let))
-  (if (and (boundp 'lexical-binding)
-           lexical-binding)
-      `(let ,@letforms)
-    ;; cl extensions have a macro implementing lexical let
-    `(lexical-let ,@letforms)))
-
-
-;;; Transformation of buffer text: HTML escapes, untabification, etc.
-
-(defvar htmlize-basic-character-table
-  ;; Map characters in the 0-127 range to either one-character strings
-  ;; or to numeric entities.
-  (let ((table (make-vector 128 ?\0)))
-    ;; Map characters in the 32-126 range to themselves, others to
-    ;; &#CODE entities;
-    (dotimes (i 128)
-      (setf (aref table i) (if (and (>= i 32) (<= i 126))
-			       (char-to-string i)
-			     (format "&#%d;" i))))
-    ;; Set exceptions manually.
-    (setf
-     ;; Don't escape newline, carriage return, and TAB.
-     (aref table ?\n) "\n"
-     (aref table ?\r) "\r"
-     (aref table ?\t) "\t"
-     ;; Escape &, <, and >.
-     (aref table ?&) "&"
-     (aref table ?<) "<"
-     (aref table ?>) ">"
-     ;; Not escaping '"' buys us a measurable speedup.  It's only
-     ;; necessary to quote it for strings used in attribute values,
-     ;; which htmlize doesn't typically do.
-     ;(aref table ?\") """
-     )
-    table))
-
-;; A cache of HTML representation of non-ASCII characters.  Depending
-;; on the setting of `htmlize-convert-nonascii-to-entities', this maps
-;; non-ASCII characters to either "&#;" or "" (mapconcat's
-;; mapper must always return strings).  It's only filled as characters
-;; are encountered, so that in a buffer with e.g. French text, it will
-;; only ever contain French accented characters as keys.  It's cleared
-;; on each entry to htmlize-buffer-1 to allow modifications of
-;; `htmlize-convert-nonascii-to-entities' to take effect.
-(defvar htmlize-extended-character-cache (make-hash-table :test 'eq))
-
-(defun htmlize-protect-string (string)
-  "HTML-protect string, escaping HTML metacharacters and I18N chars."
-  ;; Only protecting strings that actually contain unsafe or non-ASCII
-  ;; chars removes a lot of unnecessary funcalls and consing.
-  (if (not (string-match "[^\r\n\t -%'-;=?-~]" string))
-      string
-    (mapconcat (lambda (char)
-		 (cond
-		  ((< char 128)
-		   ;; ASCII: use htmlize-basic-character-table.
-		   (aref htmlize-basic-character-table char))
-		  ((gethash char htmlize-extended-character-cache)
-		   ;; We've already seen this char; return the cached
-		   ;; string.
-		   )
-		  ((not htmlize-convert-nonascii-to-entities)
-		   ;; If conversion to entities is not desired, always
-		   ;; copy the char literally.
-		   (setf (gethash char htmlize-extended-character-cache)
-			 (char-to-string char)))
-		  ((< char 256)
-		   ;; Latin 1: no need to call encode-char.
-		   (setf (gethash char htmlize-extended-character-cache)
-			 (format "&#%d;" char)))
-		  ((encode-char char 'ucs)
-                   ;; Must check if encode-char works for CHAR;
-                   ;; it fails for Arabic and possibly elsewhere.
-		   (setf (gethash char htmlize-extended-character-cache)
-			 (format "&#%d;" (encode-char char 'ucs))))
-		  (t
-		   ;; encode-char doesn't work for this char.  Copy it
-		   ;; unchanged and hope for the best.
-		   (setf (gethash char htmlize-extended-character-cache)
-			 (char-to-string char)))))
-	       string "")))
-
-(defun htmlize-attr-escape (string)
-  ;; Like htmlize-protect-string, but also escapes double-quoted
-  ;; strings to make it usable in attribute values.
-  (setq string (htmlize-protect-string string))
-  (if (not (string-match "\"" string))
-      string
-    (mapconcat (lambda (char)
-                 (if (eql char ?\")
-                     """
-                   (char-to-string char)))
-               string "")))
-
-(defsubst htmlize-concat (list)
-  (if (and (consp list) (null (cdr list)))
-      ;; Don't create a new string in the common case where the list only
-      ;; consists of one element.
-      (car list)
-    (apply #'concat list)))
-
-(defun htmlize-format-link (linkprops text)
-  (let ((uri (if (stringp linkprops)
-                 linkprops
-               (plist-get linkprops :uri)))
-        (escaped-text (htmlize-protect-string text)))
-    (if uri
-        (format "%s" (htmlize-attr-escape uri) escaped-text)
-      escaped-text)))
-
-(defun htmlize-escape-or-link (string)
-  ;; Escape STRING and/or add hyperlinks.  STRING comes from a
-  ;; `display' property.
-  (let ((pos 0) (end (length string)) outlist)
-    (while (< pos end)
-      (let* ((link (get-char-property pos 'htmlize-link string))
-             (next-link-change (next-single-property-change
-                                pos 'htmlize-link string end))
-             (chunk (substring string pos next-link-change)))
-        (push
-         (cond (link
-                (htmlize-format-link link chunk))
-               ((get-char-property 0 'htmlize-literal chunk)
-                chunk)
-               (t
-                (htmlize-protect-string chunk)))
-         outlist)
-        (setq pos next-link-change)))
-    (htmlize-concat (nreverse outlist))))
-
-(defun htmlize-display-prop-to-html (display text)
-  (let (desc)
-    (cond ((stringp display)
-           ;; Emacs ignores recursive display properties.
-           (htmlize-escape-or-link display))
-          ((not (eq (car-safe display) 'image))
-           (htmlize-protect-string text))
-          ((null (setq desc (funcall htmlize-transform-image
-                                     (cdr display) text)))
-           (htmlize-escape-or-link text))
-          ((stringp desc)
-           (htmlize-escape-or-link desc))
-          (t
-           (htmlize-generate-image desc text)))))
-
-(defun htmlize-string-to-html (string)
-  ;; Convert the string to HTML, including images attached as
-  ;; `display' property and links as `htmlize-link' property.  In a
-  ;; string without images or links, this is equivalent to
-  ;; `htmlize-protect-string'.
-  (let ((pos 0) (end (length string)) outlist)
-    (while (< pos end)
-      (let* ((display (get-char-property pos 'display string))
-             (next-display-change (next-single-property-change
-                                   pos 'display string end))
-             (chunk (substring string pos next-display-change)))
-        (push
-         (if display
-             (htmlize-display-prop-to-html display chunk)
-           (htmlize-escape-or-link chunk))
-         outlist)
-        (setq pos next-display-change)))
-    (htmlize-concat (nreverse outlist))))
-
-(defun htmlize-default-transform-image (imgprops _text)
-  "Default transformation of image descriptor to something usable in HTML.
-
-If `htmlize-use-images' is nil, the function always returns nil, meaning
-use original text.  Otherwise, it tries to find the image for images that
-specify a file name.  If `htmlize-force-inline-images' is non-nil, it also
-converts the :file attribute to :data and returns the modified property
-list."
-  (when htmlize-use-images
-    (when (plist-get imgprops :file)
-      (let ((location (plist-get (cdr (find-image (list imgprops))) :file)))
-        (when location
-          (setq imgprops (plist-put (copy-list imgprops) :file location)))))
-    (if htmlize-force-inline-images
-        (let ((location (plist-get imgprops :file))
-              data)
-          (when location
-            (with-temp-buffer
-              (condition-case nil
-                  (progn
-                    (insert-file-contents-literally location)
-                    (setq data (buffer-string)))
-                (error nil))))
-          ;; if successful, return the new plist, otherwise return
-          ;; nil, which will use the original text
-          (and data
-               (plist-put (plist-put imgprops :file nil)
-                          :data data)))
-      imgprops)))
-
-(defun htmlize-alt-text (_imgprops origtext)
-  (and (/= (length origtext) 0)
-       (<= (length origtext) htmlize-max-alt-text)
-       (not (string-match "[\0-\x1f]" origtext))
-       origtext))
-
-(defun htmlize-generate-image (imgprops origtext)
-  (let* ((alt-text (htmlize-alt-text imgprops origtext))
-         (alt-attr (if alt-text
-                       (format " alt=\"%s\"" (htmlize-attr-escape alt-text))
-                     "")))
-    (cond ((plist-get imgprops :file)
-           ;; Try to find the image in image-load-path
-           (let* ((found-props (cdr (find-image (list imgprops))))
-                  (file (or (plist-get found-props :file)
-                            (plist-get imgprops :file))))
-             (format ""
-                     (htmlize-attr-escape (file-relative-name file))
-                     alt-attr)))
-          ((plist-get imgprops :data)
-           (format ""
-                   (or (plist-get imgprops :type) "")
-                   (base64-encode-string (plist-get imgprops :data))
-                   alt-attr)))))
-
-(defconst htmlize-ellipsis "...")
-(put-text-property 0 (length htmlize-ellipsis) 'htmlize-ellipsis t htmlize-ellipsis)
-
-(defun htmlize-match-inv-spec (inv)
-  (member* inv buffer-invisibility-spec
-           :key (lambda (i)
-                  (if (symbolp i) i (car i)))))
-
-(defun htmlize-decode-invisibility-spec (invisible)
-  ;; Return t, nil, or `ellipsis', depending on how invisible text should be inserted.
-
-  (if (not (listp buffer-invisibility-spec))
-      ;; If buffer-invisibility-spec is not a list, then all
-      ;; characters with non-nil `invisible' property are visible.
-      (not invisible)
-
-    ;; Otherwise, the value of a non-nil `invisible' property can be:
-    ;; 1. a symbol -- make the text invisible if it matches
-    ;;    buffer-invisibility-spec.
-    ;; 2. a list of symbols -- make the text invisible if
-    ;;    any symbol in the list matches
-    ;;    buffer-invisibility-spec.
-    ;; If the match of buffer-invisibility-spec has a non-nil
-    ;; CDR, replace the invisible text with an ellipsis.
-    (let ((match (if (symbolp invisible)
-                     (htmlize-match-inv-spec invisible)
-                   (some #'htmlize-match-inv-spec invisible))))
-      (cond ((null match) t)
-            ((cdr-safe (car match)) 'ellipsis)
-            (t nil)))))
-
-(defun htmlize-add-before-after-strings (beg end text)
-  ;; Find overlays specifying before-string and after-string in [beg,
-  ;; pos).  If any are found, splice them into TEXT and return the new
-  ;; text.
-  (let (additions)
-    (dolist (overlay (overlays-in beg end))
-      (let ((before (overlay-get overlay 'before-string))
-            (after (overlay-get overlay 'after-string)))
-        (when after
-          (push (cons (- (overlay-end overlay) beg)
-                      after)
-                additions))
-        (when before
-          (push (cons (- (overlay-start overlay) beg)
-                      before)
-                additions))))
-    (if additions
-        (let ((textlist nil)
-              (strpos 0))
-          (dolist (add (stable-sort additions #'< :key #'car))
-            (let ((addpos (car add))
-                  (addtext (cdr add)))
-              (push (substring text strpos addpos) textlist)
-              (push addtext textlist)
-              (setq strpos addpos)))
-          (push (substring text strpos) textlist)
-          (apply #'concat (nreverse textlist)))
-      text)))
-
-(defun htmlize-copy-prop (prop beg end string)
-  ;; Copy the specified property from the specified region of the
-  ;; buffer to the target string.  We cannot rely on Emacs to copy the
-  ;; property because we want to handle properties coming from both
-  ;; text properties and overlays.
-  (let ((pos beg))
-    (while (< pos end)
-      (let ((value (get-char-property pos prop))
-            (next-change (htmlize-next-change pos prop end)))
-        (when value
-          (put-text-property (- pos beg) (- next-change beg)
-                             prop value string))
-        (setq pos next-change)))))
-
-(defun htmlize-get-text-with-display (beg end)
-  ;; Like buffer-substring-no-properties, except it copies the
-  ;; `display' property from the buffer, if found.
-  (let ((text (buffer-substring-no-properties beg end)))
-    (htmlize-copy-prop 'display beg end text)
-    (htmlize-copy-prop 'htmlize-link beg end text)
-    (setq text (htmlize-add-before-after-strings beg end text))
-    text))
-
-(defun htmlize-buffer-substring-no-invisible (beg end)
-  ;; Like buffer-substring-no-properties, but don't copy invisible
-  ;; parts of the region.  Where buffer-substring-no-properties
-  ;; mandates an ellipsis to be shown, htmlize-ellipsis is inserted.
-  (let ((pos beg)
-	visible-list invisible show last-show next-change)
-    ;; Iterate over the changes in the `invisible' property and filter
-    ;; out the portions where it's non-nil, i.e. where the text is
-    ;; invisible.
-    (while (< pos end)
-      (setq invisible (get-char-property pos 'invisible)
-	    next-change (htmlize-next-change pos 'invisible end)
-            show (htmlize-decode-invisibility-spec invisible))
-      (cond ((eq show t)
-	     (push (htmlize-get-text-with-display pos next-change)
-                   visible-list))
-            ((and (eq show 'ellipsis)
-                  (not (eq last-show 'ellipsis))
-                  ;; Conflate successive ellipses.
-                  (push htmlize-ellipsis visible-list))))
-      (setq pos next-change last-show show))
-    (htmlize-concat (nreverse visible-list))))
-
-(defun htmlize-trim-ellipsis (text)
-  ;; Remove htmlize-ellipses ("...") from the beginning of TEXT if it
-  ;; starts with it.  It checks for the special property of the
-  ;; ellipsis so it doesn't work on ordinary text that begins with
-  ;; "...".
-  (if (get-text-property 0 'htmlize-ellipsis text)
-      (substring text (length htmlize-ellipsis))
-    text))
-
-(defconst htmlize-tab-spaces
-  ;; A table of strings with spaces.  (aref htmlize-tab-spaces 5) is
-  ;; like (make-string 5 ?\ ), except it doesn't cons.
-  (let ((v (make-vector 32 nil)))
-    (dotimes (i (length v))
-      (setf (aref v i) (make-string i ?\ )))
-    v))
-
-(defun htmlize-untabify (text start-column)
-  "Untabify TEXT, assuming it starts at START-COLUMN."
-  (let ((column start-column)
-	(last-match 0)
-	(chunk-start 0)
-	chunks match-pos tab-size)
-    (while (string-match "[\t\n]" text last-match)
-      (setq match-pos (match-beginning 0))
-      (cond ((eq (aref text match-pos) ?\t)
-	     ;; Encountered a tab: create a chunk of text followed by
-	     ;; the expanded tab.
-	     (push (substring text chunk-start match-pos) chunks)
-	     ;; Increase COLUMN by the length of the text we've
-	     ;; skipped since last tab or newline.  (Encountering
-	     ;; newline resets it.)
-	     (incf column (- match-pos last-match))
-	     ;; Calculate tab size based on tab-width and COLUMN.
-	     (setq tab-size (- tab-width (% column tab-width)))
-	     ;; Expand the tab, carefully recreating the `display'
-	     ;; property if one was on the TAB.
-             (let ((display (get-text-property match-pos 'display text))
-                   (expanded-tab (aref htmlize-tab-spaces tab-size)))
-               (when display
-                 (put-text-property 0 tab-size 'display display expanded-tab))
-               (push expanded-tab chunks))
-	     (incf column tab-size)
-	     (setq chunk-start (1+ match-pos)))
-	    (t
-	     ;; Reset COLUMN at beginning of line.
-	     (setq column 0)))
-      (setq last-match (1+ match-pos)))
-    ;; If no chunks have been allocated, it means there have been no
-    ;; tabs to expand.  Return TEXT unmodified.
-    (if (null chunks)
-	text
-      (when (< chunk-start (length text))
-	;; Push the remaining chunk.
-	(push (substring text chunk-start) chunks))
-      ;; Generate the output from the available chunks.
-      (htmlize-concat (nreverse chunks)))))
-
-(defun htmlize-extract-text (beg end trailing-ellipsis)
-  ;; Extract buffer text, sans the invisible parts.  Then
-  ;; untabify it and escape the HTML metacharacters.
-  (let ((text (htmlize-buffer-substring-no-invisible beg end)))
-    (when trailing-ellipsis
-      (setq text (htmlize-trim-ellipsis text)))
-    ;; If TEXT ends up empty, don't change trailing-ellipsis.
-    (when (> (length text) 0)
-      (setq trailing-ellipsis
-            (get-text-property (1- (length text))
-                               'htmlize-ellipsis text)))
-    (setq text (htmlize-untabify text (current-column)))
-    (setq text (htmlize-string-to-html text))
-    (values text trailing-ellipsis)))
-
-(defun htmlize-despam-address (string)
-  "Replace every occurrence of '@' in STRING with %40.
-This is used to protect mailto links without modifying their meaning."
-  ;; Suggested by Ville Skytta.
-  (while (string-match "@" string)
-    (setq string (replace-match "%40" nil t string)))
-  string)
-
-(defun htmlize-make-tmp-overlay (beg end props)
-  (let ((overlay (make-overlay beg end)))
-    (overlay-put overlay 'htmlize-tmp-overlay t)
-    (while props
-      (overlay-put overlay (pop props) (pop props)))
-    overlay))
-
-(defun htmlize-delete-tmp-overlays ()
-  (dolist (overlay (overlays-in (point-min) (point-max)))
-    (when (overlay-get overlay 'htmlize-tmp-overlay)
-      (delete-overlay overlay))))
-
-(defun htmlize-make-link-overlay (beg end uri)
-  (htmlize-make-tmp-overlay beg end `(htmlize-link (:uri ,uri))))
-
-(defun htmlize-create-auto-links ()
-  "Add `htmlize-link' property to all mailto links in the buffer."
-  (save-excursion
-    (goto-char (point-min))
-    (while (re-search-forward
-            "<\\(\\(mailto:\\)?\\([-=+_.a-zA-Z0-9]+@[-_.a-zA-Z0-9]+\\)\\)>"
-            nil t)
-      (let* ((address (match-string 3))
-             (beg (match-beginning 0)) (end (match-end 0))
-             (uri (concat "mailto:" (htmlize-despam-address address))))
-        (htmlize-make-link-overlay beg end uri)))
-    (goto-char (point-min))
-    (while (re-search-forward "<\\(\\(URL:\\)?\\([a-zA-Z]+://[^;]+\\)\\)>"
-                              nil t)
-      (htmlize-make-link-overlay
-       (match-beginning 0) (match-end 0) (match-string 3)))))
-
-;; Tests for htmlize-create-auto-links:
-
-;; 
-;; 
-;; 
-;; 
-;; 
-;; 
-
-(defun htmlize-shadow-form-feeds ()
-  (let ((s "\n
")) - (put-text-property 0 (length s) 'htmlize-literal t s) - (let ((disp `(display ,s))) - (while (re-search-forward "\n\^L" nil t) - (htmlize-make-tmp-overlay (match-beginning 0) (match-end 0) disp))))) - -(defun htmlize-defang-local-variables () - ;; Juri Linkov reports that an HTML-ized "Local variables" can lead - ;; visiting the HTML to fail with "Local variables list is not - ;; properly terminated". He suggested changing the phrase to - ;; syntactically equivalent HTML that Emacs doesn't recognize. - (goto-char (point-min)) - (while (search-forward "Local Variables:" nil t) - (replace-match "Local Variables:" nil t))) - - -;;; Color handling. - -(defvar htmlize-x-library-search-path - `(,data-directory - "/etc/X11/rgb.txt" - "/usr/share/X11/rgb.txt" - ;; the remainder of this list really belongs in a museum - "/usr/X11R6/lib/X11/" - "/usr/X11R5/lib/X11/" - "/usr/lib/X11R6/X11/" - "/usr/lib/X11R5/X11/" - "/usr/local/X11R6/lib/X11/" - "/usr/local/X11R5/lib/X11/" - "/usr/local/lib/X11R6/X11/" - "/usr/local/lib/X11R5/X11/" - "/usr/X11/lib/X11/" - "/usr/lib/X11/" - "/usr/local/lib/X11/" - "/usr/X386/lib/X11/" - "/usr/x386/lib/X11/" - "/usr/XFree86/lib/X11/" - "/usr/unsupported/lib/X11/" - "/usr/athena/lib/X11/" - "/usr/local/x11r5/lib/X11/" - "/usr/lpp/Xamples/lib/X11/" - "/usr/openwin/lib/X11/" - "/usr/openwin/share/lib/X11/")) - -(defun htmlize-get-color-rgb-hash (&optional rgb-file) - "Return a hash table mapping X color names to RGB values. -The keys in the hash table are X11 color names, and the values are the -#rrggbb RGB specifications, extracted from `rgb.txt'. - -If RGB-FILE is nil, the function will try hard to find a suitable file -in the system directories. - -If no rgb.txt file is found, return nil." - (let ((rgb-file (or rgb-file (locate-file - "rgb.txt" - htmlize-x-library-search-path))) - (hash nil)) - (when rgb-file - (with-temp-buffer - (insert-file-contents rgb-file) - (setq hash (make-hash-table :test 'equal)) - (while (not (eobp)) - (cond ((looking-at "^\\s-*\\([!#]\\|$\\)") - ;; Skip comments and empty lines. - ) - ((looking-at - "[ \t]*\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\(.*\\)") - (setf (gethash (downcase (match-string 4)) hash) - (format "#%02x%02x%02x" - (string-to-number (match-string 1)) - (string-to-number (match-string 2)) - (string-to-number (match-string 3))))) - (t - (error - "Unrecognized line in %s: %s" - rgb-file - (buffer-substring (point) (progn (end-of-line) (point)))))) - (forward-line 1)))) - hash)) - -;; Compile the RGB map when loaded. On systems where rgb.txt is -;; missing, the value of the variable will be nil, and rgb.txt will -;; not be used. -(defvar htmlize-color-rgb-hash (htmlize-get-color-rgb-hash)) - -;;; Face handling. - -(defun htmlize-face-specifies-property (face prop) - ;; Return t if face specifies PROP, as opposed to it being inherited - ;; from the default face. The problem with e.g. - ;; `face-foreground-instance' is that it returns an instance for - ;; EVERY face because every face inherits from the default face. - ;; However, we'd like htmlize-face-{fore,back}ground to return nil - ;; when called with a face that doesn't specify its own foreground - ;; or background. - (or (eq face 'default) - (assq 'global (specifier-spec-list (face-property face prop))))) - -(defun htmlize-face-color-internal (face fg) - ;; Used only under GNU Emacs. Return the color of FACE, but don't - ;; return "unspecified-fg" or "unspecified-bg". If the face is - ;; `default' and the color is unspecified, look up the color in - ;; frame parameters. - (let* ((function (if fg #'face-foreground #'face-background)) - (color (funcall function face nil t))) - (when (and (eq face 'default) (null color)) - (setq color (cdr (assq (if fg 'foreground-color 'background-color) - (frame-parameters))))) - (when (or (eq color 'unspecified) - (equal color "unspecified-fg") - (equal color "unspecified-bg")) - (setq color nil)) - (when (and (eq face 'default) - (null color)) - ;; Assuming black on white doesn't seem right, but I can't think - ;; of anything better to do. - (setq color (if fg "black" "white"))) - color)) - -(defun htmlize-face-foreground (face) - ;; Return the name of the foreground color of FACE. If FACE does - ;; not specify a foreground color, return nil. - (htmlize-face-color-internal face t)) - -(defun htmlize-face-background (face) - ;; Return the name of the background color of FACE. If FACE does - ;; not specify a background color, return nil. - ;; GNU Emacs. - (htmlize-face-color-internal face nil)) - -;; Convert COLOR to the #RRGGBB string. If COLOR is already in that -;; format, it's left unchanged. - -(defun htmlize-color-to-rgb (color) - (let ((rgb-string nil)) - (cond ((null color) - ;; Ignore nil COLOR because it means that the face is not - ;; specifying any color. Hence (htmlize-color-to-rgb nil) - ;; returns nil. - ) - ((string-match "\\`#" color) - ;; The color is already in #rrggbb format. - (setq rgb-string color)) - ((and htmlize-use-rgb-txt - htmlize-color-rgb-hash) - ;; Use of rgb.txt is requested, and it's available on the - ;; system. Use it. - (setq rgb-string (gethash (downcase color) htmlize-color-rgb-hash))) - (t - ;; We're getting the RGB components from Emacs. - (let ((rgb - (if (fboundp 'color-instance-rgb-components) - (mapcar (lambda (arg) - (/ arg 256)) - (color-instance-rgb-components - (make-color-instance color))) - (mapcar (lambda (arg) - (/ arg 256)) - (color-values color))))) - (when rgb - (setq rgb-string (apply #'format "#%02x%02x%02x" rgb)))))) - ;; If RGB-STRING is still nil, it means the color cannot be found, - ;; for whatever reason. In that case just punt and return COLOR. - ;; Most browsers support a decent set of color names anyway. - (or rgb-string color))) - -;; We store the face properties we care about into an -;; `htmlize-fstruct' type. That way we only have to analyze face -;; properties, which can be time consuming, once per each face. The -;; mapping between Emacs faces and htmlize-fstructs is established by -;; htmlize-make-face-map. The name "fstruct" refers to variables of -;; type `htmlize-fstruct', while the term "face" is reserved for Emacs -;; faces. - -(defstruct htmlize-fstruct - foreground ; foreground color, #rrggbb - background ; background color, #rrggbb - size ; size - boldp ; whether face is bold - italicp ; whether face is italic - underlinep ; whether face is underlined - overlinep ; whether face is overlined - strikep ; whether face is struck through - css-name ; CSS name of face - ) - -(defun htmlize-face-set-from-keyword-attr (fstruct attr value) - ;; For ATTR and VALUE, set the equivalent value in FSTRUCT. - (case attr - (:foreground - (setf (htmlize-fstruct-foreground fstruct) (htmlize-color-to-rgb value))) - (:background - (setf (htmlize-fstruct-background fstruct) (htmlize-color-to-rgb value))) - (:height - (setf (htmlize-fstruct-size fstruct) value)) - (:weight - (when (string-match (symbol-name value) "bold") - (setf (htmlize-fstruct-boldp fstruct) t))) - (:slant - (setf (htmlize-fstruct-italicp fstruct) (or (eq value 'italic) - (eq value 'oblique)))) - (:bold - (setf (htmlize-fstruct-boldp fstruct) value)) - (:italic - (setf (htmlize-fstruct-italicp fstruct) value)) - (:underline - (setf (htmlize-fstruct-underlinep fstruct) value)) - (:overline - (setf (htmlize-fstruct-overlinep fstruct) value)) - (:strike-through - (setf (htmlize-fstruct-strikep fstruct) value)))) - -(defun htmlize-face-size (face) - ;; The size (height) of FACE, taking inheritance into account. - ;; Only works in Emacs 21 and later. - (let* ((face-list (list face)) - (head face-list) - (tail face-list)) - (while head - (let ((inherit (face-attribute (car head) :inherit))) - (cond ((listp inherit) - (setcdr tail (copy-list inherit)) - (setq tail (last tail))) - ((eq inherit 'unspecified)) - (t - (setcdr tail (list inherit)) - (setq tail (cdr tail))))) - (pop head)) - (let ((size-list - (loop - for f in face-list - for h = (face-attribute f :height) - collect (if (eq h 'unspecified) nil h)))) - (reduce 'htmlize-merge-size (cons nil size-list))))) - -(defun htmlize-face-css-name (face) - ;; Generate the css-name property for the given face. Emacs places - ;; no restrictions on the names of symbols that represent faces -- - ;; any characters may be in the name, even control chars. We try - ;; hard to beat the face name into shape, both esthetically and - ;; according to CSS1 specs. - (let ((name (downcase (symbol-name face)))) - (when (string-match "\\`font-lock-" name) - ;; font-lock-FOO-face -> FOO. - (setq name (replace-match "" t t name))) - (when (string-match "-face\\'" name) - ;; Drop the redundant "-face" suffix. - (setq name (replace-match "" t t name))) - (while (string-match "[^-a-zA-Z0-9]" name) - ;; Drop the non-alphanumerics. - (setq name (replace-match "X" t t name))) - (when (string-match "\\`[-0-9]" name) - ;; CSS identifiers may not start with a digit. - (setq name (concat "X" name))) - ;; After these transformations, the face could come out empty. - (when (equal name "") - (setq name "face")) - ;; Apply the prefix. - (concat htmlize-css-name-prefix name))) - -(defun htmlize-face-to-fstruct-1 (face) - "Convert Emacs face FACE to fstruct, internal." - (let ((fstruct (make-htmlize-fstruct - :foreground (htmlize-color-to-rgb - (htmlize-face-foreground face)) - :background (htmlize-color-to-rgb - (htmlize-face-background face))))) - ;; GNU Emacs - (dolist (attr '(:weight :slant :underline :overline :strike-through)) - (let ((value (face-attribute face attr nil t))) - (when (and value (not (eq value 'unspecified))) - (htmlize-face-set-from-keyword-attr fstruct attr value)))) - (let ((size (htmlize-face-size face))) - (unless (eql size 1.0) ; ignore non-spec - (setf (htmlize-fstruct-size fstruct) size))) - (setf (htmlize-fstruct-css-name fstruct) (htmlize-face-css-name face)) - fstruct)) - -(defun htmlize-face-to-fstruct (face) - (let* ((face-list (or (and (symbolp face) - (cdr (assq face face-remapping-alist))) - (list face))) - (fstruct (htmlize-merge-faces - (mapcar (lambda (face) - (if (symbolp face) - (or (htmlize-get-override-fstruct face) - (htmlize-face-to-fstruct-1 face)) - (htmlize-attrlist-to-fstruct face))) - (nreverse face-list))))) - (when (symbolp face) - (setf (htmlize-fstruct-css-name fstruct) (htmlize-face-css-name face))) - fstruct)) - -(defmacro htmlize-copy-attr-if-set (attr-list dest source) - ;; Generate code with the following pattern: - ;; (progn - ;; (when (htmlize-fstruct-ATTR source) - ;; (setf (htmlize-fstruct-ATTR dest) (htmlize-fstruct-ATTR source))) - ;; ...) - ;; for the given list of boolean attributes. - (cons 'progn - (loop for attr in attr-list - for attr-sym = (intern (format "htmlize-fstruct-%s" attr)) - collect `(when (,attr-sym ,source) - (setf (,attr-sym ,dest) (,attr-sym ,source)))))) - -(defun htmlize-merge-size (merged next) - ;; Calculate the size of the merge of MERGED and NEXT. - (cond ((null merged) next) - ((integerp next) next) - ((null next) merged) - ((floatp merged) (* merged next)) - ((integerp merged) (round (* merged next))))) - -(defun htmlize-merge-two-faces (merged next) - (htmlize-copy-attr-if-set - (foreground background boldp italicp underlinep overlinep strikep) - merged next) - (setf (htmlize-fstruct-size merged) - (htmlize-merge-size (htmlize-fstruct-size merged) - (htmlize-fstruct-size next))) - merged) - -(defun htmlize-merge-faces (fstruct-list) - (cond ((null fstruct-list) - ;; Nothing to do, return a dummy face. - (make-htmlize-fstruct)) - ((null (cdr fstruct-list)) - ;; Optimize for the common case of a single face, simply - ;; return it. - (car fstruct-list)) - (t - (reduce #'htmlize-merge-two-faces - (cons (make-htmlize-fstruct) fstruct-list))))) - -;; GNU Emacs 20+ supports attribute lists in `face' properties. For -;; example, you can use `(:foreground "red" :weight bold)' as an -;; overlay's "face", or you can even use a list of such lists, etc. -;; We call those "attrlists". -;; -;; htmlize supports attrlist by converting them to fstructs, the same -;; as with regular faces. - -(defun htmlize-attrlist-to-fstruct (attrlist &optional name) - ;; Like htmlize-face-to-fstruct, but accepts an ATTRLIST as input. - (let ((fstruct (make-htmlize-fstruct))) - (cond ((eq (car attrlist) 'foreground-color) - ;; ATTRLIST is (foreground-color . COLOR) - (setf (htmlize-fstruct-foreground fstruct) - (htmlize-color-to-rgb (cdr attrlist)))) - ((eq (car attrlist) 'background-color) - ;; ATTRLIST is (background-color . COLOR) - (setf (htmlize-fstruct-background fstruct) - (htmlize-color-to-rgb (cdr attrlist)))) - (t - ;; ATTRLIST is a plist. - (while attrlist - (let ((attr (pop attrlist)) - (value (pop attrlist))) - (when (and value (not (eq value 'unspecified))) - (htmlize-face-set-from-keyword-attr fstruct attr value)))))) - (setf (htmlize-fstruct-css-name fstruct) (or name "custom")) - fstruct)) - -(defun htmlize-decode-face-prop (prop) - "Turn face property PROP into a list of face-like objects." - ;; PROP can be a symbol naming a face, a string naming such a - ;; symbol, a cons (foreground-color . COLOR) or (background-color - ;; COLOR), a property list (:attr1 val1 :attr2 val2 ...), or a list - ;; of any of those. - ;; - ;; (htmlize-decode-face-prop 'face) -> (face) - ;; (htmlize-decode-face-prop '(face1 face2)) -> (face1 face2) - ;; (htmlize-decode-face-prop '(:attr "val")) -> ((:attr "val")) - ;; (htmlize-decode-face-prop '((:attr "val") face (foreground-color "red"))) - ;; -> ((:attr "val") face (foreground-color "red")) - ;; - ;; Unrecognized atoms or non-face symbols/strings are silently - ;; stripped away. - (cond ((null prop) - nil) - ((symbolp prop) - (and (facep prop) - (list prop))) - ((stringp prop) - (and (facep (intern-soft prop)) - (list prop))) - ((atom prop) - nil) - ((and (symbolp (car prop)) - (eq ?: (aref (symbol-name (car prop)) 0))) - (list prop)) - ((or (eq (car prop) 'foreground-color) - (eq (car prop) 'background-color)) - (list prop)) - (t - (apply #'nconc (mapcar #'htmlize-decode-face-prop prop))))) - -(defun htmlize-get-override-fstruct (face) - (let* ((raw-def (plist-get htmlize-face-overrides face)) - (def (cond ((stringp raw-def) (list :foreground raw-def)) - ((listp raw-def) raw-def) - (t - (error (format (concat "face override must be an " - "attribute list or string, got %s") - raw-def)))))) - (and def - (htmlize-attrlist-to-fstruct def (symbol-name face))))) - -(defun htmlize-make-face-map (faces) - ;; Return a hash table mapping Emacs faces to htmlize's fstructs. - ;; The keys are either face symbols or attrlists, so the test - ;; function must be `equal'. - (let ((face-map (make-hash-table :test 'equal)) - css-names) - (dolist (face faces) - (unless (gethash face face-map) - ;; Haven't seen FACE yet; convert it to an fstruct and cache - ;; it. - (let ((fstruct (htmlize-face-to-fstruct face))) - (setf (gethash face face-map) fstruct) - (let* ((css-name (htmlize-fstruct-css-name fstruct)) - (new-name css-name) - (i 0)) - ;; Uniquify the face's css-name by using NAME-1, NAME-2, - ;; etc. - (while (member new-name css-names) - (setq new-name (format "%s-%s" css-name (incf i)))) - (unless (equal new-name css-name) - (setf (htmlize-fstruct-css-name fstruct) new-name)) - (push new-name css-names))))) - face-map)) - -(defun htmlize-unstringify-face (face) - "If FACE is a string, return it interned, otherwise return it unchanged." - (if (stringp face) - (intern face) - face)) - -(defun htmlize-faces-in-buffer () - "Return a list of faces used in the current buffer. -This is the set of faces specified by the `face' text property and by buffer -overlays that specify `face'." - (let (faces) - ;; Faces used by text properties. - (let ((pos (point-min)) face-prop next) - (while (< pos (point-max)) - (setq face-prop (get-text-property pos 'face) - next (or (next-single-property-change pos 'face) (point-max))) - (setq faces (nunion (htmlize-decode-face-prop face-prop) - faces :test 'equal)) - (setq pos next))) - ;; Faces used by overlays. - (dolist (overlay (overlays-in (point-min) (point-max))) - (let ((face-prop (overlay-get overlay 'face))) - (setq faces (nunion (htmlize-decode-face-prop face-prop) - faces :test 'equal)))) - faces)) - -(if (>= emacs-major-version 25) - (defun htmlize-sorted-overlays-at (pos) - (overlays-at pos t)) - - (defun htmlize-sorted-overlays-at (pos) - ;; Like OVERLAYS-AT with the SORTED argument, for older Emacsen. - (let ((overlays (overlays-at pos))) - (setq overlays (sort* overlays #'< - :key (lambda (o) - (- (overlay-end o) (overlay-start o))))) - (setq overlays - (stable-sort overlays #'< - :key (lambda (o) - (let ((prio (overlay-get o 'priority))) - (if (numberp prio) prio 0))))) - (nreverse overlays)))) - - -;; htmlize-faces-at-point returns the faces in use at point. The -;; faces are sorted by increasing priority, i.e. the last face takes -;; precedence. -;; -;; This returns all the faces in the `face' property and all the faces -;; in the overlays at point. - -(defun htmlize-faces-at-point () - (let (all-faces) - ;; Faces from text properties. - (let ((face-prop (get-text-property (point) 'face))) - ;; we need to reverse the `face' prop because we want - ;; more specific faces to come later - (setq all-faces (nreverse (htmlize-decode-face-prop face-prop)))) - ;; Faces from overlays. - (let ((overlays - ;; Collect overlays at point that specify `face'. - (delete-if-not (lambda (o) - (overlay-get o 'face)) - (nreverse (htmlize-sorted-overlays-at (point))))) - list face-prop) - (dolist (overlay overlays) - (setq face-prop (overlay-get overlay 'face) - list (nconc (htmlize-decode-face-prop face-prop) list))) - ;; Under "Merging Faces" the manual explicitly states - ;; that faces specified by overlays take precedence over - ;; faces specified by text properties. - (setq all-faces (nconc all-faces list))) - all-faces)) - -;; htmlize supports generating HTML in several flavors, some of which -;; use CSS, and others the element. We take an OO approach and -;; define "methods" that indirect to the functions that depend on -;; `htmlize-output-type'. The currently used methods are `doctype', -;; `insert-head', `body-tag', `pre-tag', and `text-markup'. Not all -;; output types define all methods. -;; -;; Methods are called either with (htmlize-method METHOD ARGS...) -;; special form, or by accessing the function with -;; (htmlize-method-function 'METHOD) and calling (funcall FUNCTION). -;; The latter form is useful in tight loops because `htmlize-method' -;; conses. - -(defmacro htmlize-method (method &rest args) - ;; Expand to (htmlize-TYPE-METHOD ...ARGS...). TYPE is the value of - ;; `htmlize-output-type' at run time. - `(funcall (htmlize-method-function ',method) ,@args)) - -(defun htmlize-method-function (method) - ;; Return METHOD's function definition for the current output type. - ;; The returned object can be safely funcalled. - (let ((sym (intern (format "htmlize-%s-%s" htmlize-output-type method)))) - (indirect-function (if (fboundp sym) - sym - (let ((default (intern (concat "htmlize-default-" - (symbol-name method))))) - (if (fboundp default) - default - 'ignore)))))) - -(defvar htmlize-memoization-table (make-hash-table :test 'equal)) - -(defmacro htmlize-memoize (key generator) - "Return the value of GENERATOR, memoized as KEY. -That means that GENERATOR will be evaluated and returned the first time -it's called with the same value of KEY. All other times, the cached -\(memoized) value will be returned." - (let ((value (gensym))) - `(let ((,value (gethash ,key htmlize-memoization-table))) - (unless ,value - (setq ,value ,generator) - (setf (gethash ,key htmlize-memoization-table) ,value)) - ,value))) - -;;; Default methods. - -(defun htmlize-default-doctype () - nil ; no doc-string - ;; Note that the `font' output is technically invalid under this DTD - ;; because the DTD doesn't allow embedding in
.
-  ""
-  )
-
-(defun htmlize-default-body-tag (face-map)
-  nil					; no doc-string
-  face-map ; shut up the byte-compiler
-  "")
-
-(defun htmlize-default-pre-tag (face-map)
-  nil					; no doc-string
-  face-map ; shut up the byte-compiler
-  "
")
-
-
-;;; CSS based output support.
-
-;; Internal function; not a method.
-(defun htmlize-css-specs (fstruct)
-  (let (result)
-    (when (htmlize-fstruct-foreground fstruct)
-      (push (format "color: %s;" (htmlize-fstruct-foreground fstruct))
-	    result))
-    (when (htmlize-fstruct-background fstruct)
-      (push (format "background-color: %s;"
-		    (htmlize-fstruct-background fstruct))
-	    result))
-    (let ((size (htmlize-fstruct-size fstruct)))
-      (when (and size (not (eq htmlize-ignore-face-size t)))
-	(cond ((floatp size)
-	       (push (format "font-size: %d%%;" (* 100 size)) result))
-	      ((not (eq htmlize-ignore-face-size 'absolute))
-	       (push (format "font-size: %spt;" (/ size 10.0)) result)))))
-    (when (htmlize-fstruct-boldp fstruct)
-      (push "font-weight: bold;" result))
-    (when (htmlize-fstruct-italicp fstruct)
-      (push "font-style: italic;" result))
-    (when (htmlize-fstruct-underlinep fstruct)
-      (push "text-decoration: underline;" result))
-    (when (htmlize-fstruct-overlinep fstruct)
-      (push "text-decoration: overline;" result))
-    (when (htmlize-fstruct-strikep fstruct)
-      (push "text-decoration: line-through;" result))
-    (nreverse result)))
-
-(defun htmlize-css-insert-head (buffer-faces face-map)
-  (insert "    \n"))
-
-(defun htmlize-css-text-markup (fstruct-list buffer)
-  ;; Open the markup needed to insert text colored with FACES into
-  ;; BUFFER.  Return the function that closes the markup.
-
-  ;; In CSS mode, this is easy: just nest the text in one  tag for each face in FSTRUCT-LIST.
-  (dolist (fstruct fstruct-list)
-    (princ "" buffer))
-  (htmlize-lexlet ((fstruct-list fstruct-list) (buffer buffer))
-    (lambda ()
-      (dolist (fstruct fstruct-list)
-        (ignore fstruct)                ; shut up the byte-compiler
-        (princ "" buffer)))))
-
-;; `inline-css' output support.
-
-(defun htmlize-inline-css-body-tag (face-map)
-  (format ""
-	  (mapconcat #'identity (htmlize-css-specs (gethash 'default face-map))
-		     " ")))
-
-(defun htmlize-inline-css-pre-tag (face-map)
-  (if htmlize-pre-style
-      (format "
"
-              (mapconcat #'identity (htmlize-css-specs (gethash 'default face-map))
-                         " "))
-    (format "
")))
-
-(defun htmlize-inline-css-text-markup (fstruct-list buffer)
-  (let* ((merged (htmlize-merge-faces fstruct-list))
-	 (style (htmlize-memoize
-		 merged
-		 (let ((specs (htmlize-css-specs merged)))
-		   (and specs
-			(mapconcat #'identity (htmlize-css-specs merged) " "))))))
-    (when style
-      (princ "" buffer))
-    (htmlize-lexlet ((style style) (buffer buffer))
-      (lambda ()
-        (when style
-          (princ "" buffer))))))
-
-;;; `font' tag based output support.
-
-(defun htmlize-font-body-tag (face-map)
-  (let ((fstruct (gethash 'default face-map)))
-    (format ""
-	    (htmlize-fstruct-foreground fstruct)
-	    (htmlize-fstruct-background fstruct))))
-
-(defun htmlize-font-pre-tag (face-map)
-  (if htmlize-pre-style
-      (let ((fstruct (gethash 'default face-map)))
-        (format "
"
-                (htmlize-fstruct-foreground fstruct)
-                (htmlize-fstruct-background fstruct)))
-    (format "
")))
-       
-(defun htmlize-font-text-markup (fstruct-list buffer)
-  ;; In `font' mode, we use the traditional HTML means of altering
-  ;; presentation:  tag for colors,  for bold,  for
-  ;; underline, and  for strike-through.
-  (let* ((merged (htmlize-merge-faces fstruct-list))
-	 (markup (htmlize-memoize
-		  merged
-		  (cons (concat
-			 (and (htmlize-fstruct-foreground merged)
-			      (format "" (htmlize-fstruct-foreground merged)))
-			 (and (htmlize-fstruct-boldp merged)      "")
-			 (and (htmlize-fstruct-italicp merged)    "")
-			 (and (htmlize-fstruct-underlinep merged) "")
-			 (and (htmlize-fstruct-strikep merged)    ""))
-			(concat
-			 (and (htmlize-fstruct-strikep merged)    "")
-			 (and (htmlize-fstruct-underlinep merged) "")
-			 (and (htmlize-fstruct-italicp merged)    "")
-			 (and (htmlize-fstruct-boldp merged)      "")
-			 (and (htmlize-fstruct-foreground merged) ""))))))
-    (princ (car markup) buffer)
-    (htmlize-lexlet ((markup markup) (buffer buffer))
-      (lambda ()
-        (princ (cdr markup) buffer)))))
-
-(defun htmlize-buffer-1 ()
-  ;; Internal function; don't call it from outside this file.  Htmlize
-  ;; current buffer, writing the resulting HTML to a new buffer, and
-  ;; return it.  Unlike htmlize-buffer, this doesn't change current
-  ;; buffer or use switch-to-buffer.
-  (save-excursion
-    ;; Protect against the hook changing the current buffer.
-    (save-excursion
-      (run-hooks 'htmlize-before-hook))
-    ;; Convince font-lock support modes to fontify the entire buffer
-    ;; in advance.
-    (htmlize-ensure-fontified)
-    (clrhash htmlize-extended-character-cache)
-    (clrhash htmlize-memoization-table)
-    ;; It's important that the new buffer inherits default-directory
-    ;; from the current buffer.
-    (let ((htmlbuf (generate-new-buffer (if (buffer-file-name)
-                                            (htmlize-make-file-name
-                                             (file-name-nondirectory
-                                              (buffer-file-name)))
-                                          "*html*")))
-          (completed nil))
-      (unwind-protect
-          (let* ((buffer-faces (htmlize-faces-in-buffer))
-                 (face-map (htmlize-make-face-map (adjoin 'default buffer-faces)))
-                 (places (gensym))
-                 (title (if (buffer-file-name)
-                            (file-name-nondirectory (buffer-file-name))
-                          (buffer-name))))
-            (when htmlize-generate-hyperlinks
-              (htmlize-create-auto-links))
-            (when htmlize-replace-form-feeds
-              (htmlize-shadow-form-feeds))
-
-            ;; Initialize HTMLBUF and insert the HTML prolog.
-            (with-current-buffer htmlbuf
-              (buffer-disable-undo)
-              (insert (htmlize-method doctype) ?\n
-                      (format "\n"
-                              htmlize-version htmlize-output-type)
-                      "\n  ")
-              (put places 'head-start (point-marker))
-              (insert "\n"
-                      "    " (htmlize-protect-string title) "\n"
-                      (if htmlize-html-charset
-                          (format (concat "    \n")
-                                  htmlize-html-charset)
-                        "")
-                      htmlize-head-tags)
-              (htmlize-method insert-head buffer-faces face-map)
-              (insert "          
         
 ")
-              (put places 'head-end (point-marker))
-              (insert "\n  ")
-              (put places 'body-start (point-marker))
-              (insert (htmlize-method body-tag face-map)
-                      "\n    ")
-              (put places 'content-start (point-marker))
-              (insert (htmlize-method pre-tag face-map) "\n"))
-            (let ((text-markup
-                   ;; Get the inserter method, so we can funcall it inside
-                   ;; the loop.  Not calling `htmlize-method' in the loop
-                   ;; body yields a measurable speed increase.
-                   (htmlize-method-function 'text-markup))
-                  ;; Declare variables used in loop body outside the loop
-                  ;; because it's faster to establish `let' bindings only
-                  ;; once.
-                  next-change text face-list trailing-ellipsis
-                  fstruct-list last-fstruct-list
-                  (close-markup (lambda ())))
-              ;; This loop traverses and reads the source buffer, appending
-              ;; the resulting HTML to HTMLBUF.  This method is fast
-              ;; because: 1) it doesn't require examining the text
-              ;; properties char by char (htmlize-next-face-change is used
-              ;; to move between runs with the same face), and 2) it doesn't
-              ;; require frequent buffer switches, which are slow because
-              ;; they rebind all buffer-local vars.
-              (goto-char (point-min))
-              (while (not (eobp))
-                (setq next-change (htmlize-next-face-change (point)))
-                ;; Get faces in use between (point) and NEXT-CHANGE, and
-                ;; convert them to fstructs.
-                (setq face-list (htmlize-faces-at-point)
-                      fstruct-list (delq nil (mapcar (lambda (f)
-                                                       (gethash f face-map))
-                                                     face-list)))
-                (multiple-value-setq (text trailing-ellipsis)
-                  (htmlize-extract-text (point) next-change trailing-ellipsis))
-                ;; Don't bother writing anything if there's no text (this
-                ;; happens in invisible regions).
-                (when (> (length text) 0)
-                  ;; Open the new markup if necessary and insert the text.
-                  (when (not (equalp fstruct-list last-fstruct-list))
-                    (funcall close-markup)
-                    (setq last-fstruct-list fstruct-list
-                          close-markup (funcall text-markup fstruct-list htmlbuf)))
-                  (princ text htmlbuf))
-                (goto-char next-change))
-
-              ;; We've gone through the buffer; close the markup from
-              ;; the last run, if any.
-              (funcall close-markup))
-
-            ;; Insert the epilog and post-process the buffer.
-            (with-current-buffer htmlbuf
-              (insert "
") - (put places 'content-end (point-marker)) - (insert "\n ") - (put places 'body-end (point-marker)) - (insert "\n\n") - (htmlize-defang-local-variables) - (goto-char (point-min)) - (when htmlize-html-major-mode - ;; What sucks about this is that the minor modes, most notably - ;; font-lock-mode, won't be initialized. Oh well. - (funcall htmlize-html-major-mode)) - (set (make-local-variable 'htmlize-buffer-places) - (symbol-plist places)) - (run-hooks 'htmlize-after-hook) - (buffer-enable-undo)) - (setq completed t) - htmlbuf) - - (when (not completed) - (kill-buffer htmlbuf)) - (htmlize-delete-tmp-overlays))))) - -;; Utility functions. - -(defmacro htmlize-with-fontify-message (&rest body) - ;; When forcing fontification of large buffers in - ;; htmlize-ensure-fontified, inform the user that he is waiting for - ;; font-lock, not for htmlize to finish. - `(progn - (if (> (buffer-size) 65536) - (message "Forcing fontification of %s..." - (buffer-name (current-buffer)))) - ,@body - (if (> (buffer-size) 65536) - (message "Forcing fontification of %s...done" - (buffer-name (current-buffer)))))) - -(defun htmlize-ensure-fontified () - ;; If font-lock is being used, ensure that the "support" modes - ;; actually fontify the buffer. If font-lock is not in use, we - ;; don't care because, except in htmlize-file, we don't force - ;; font-lock on the user. - (when (and (boundp 'font-lock-mode) - font-lock-mode) - ;; In part taken from ps-print-ensure-fontified in GNU Emacs 21. - (cond - ((and (boundp 'jit-lock-mode) - (symbol-value 'jit-lock-mode)) - (htmlize-with-fontify-message - (jit-lock-fontify-now (point-min) (point-max)))) - ((and (boundp 'lazy-lock-mode) - (symbol-value 'lazy-lock-mode)) - (htmlize-with-fontify-message - (lazy-lock-fontify-region (point-min) (point-max)))) - ((and (boundp 'lazy-shot-mode) - (symbol-value 'lazy-shot-mode)) - (htmlize-with-fontify-message - ;; lazy-shot is amazing in that it must *refontify* the region, - ;; even if the whole buffer has already been fontified. - (lazy-shot-fontify-region (point-min) (point-max)))) - ;; There's also fast-lock, but we don't need to handle specially, - ;; I think. fast-lock doesn't really defer fontification, it - ;; just saves it to an external cache so it's not done twice. - ))) - - -;;;###autoload -(defun htmlize-buffer (&optional buffer) - "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." - (interactive) - (let ((htmlbuf (with-current-buffer (or buffer (current-buffer)) - (htmlize-buffer-1)))) - (when (interactive-p) - (switch-to-buffer htmlbuf)) - htmlbuf)) - -;;;###autoload -(defun htmlize-region (beg end) - "Convert the region to HTML, preserving colors and decorations. -See `htmlize-buffer' for details." - (interactive "r") - ;; Don't let zmacs region highlighting end up in HTML. - (when (fboundp 'zmacs-deactivate-region) - (zmacs-deactivate-region)) - (let ((htmlbuf (save-restriction - (narrow-to-region beg end) - (htmlize-buffer-1)))) - (when (interactive-p) - (switch-to-buffer htmlbuf)) - htmlbuf)) - -(defun htmlize-region-for-paste (beg end) - "Htmlize the region and return just the HTML as a string. -This forces the `inline-css' style and only returns the HTML body, -but without the BODY tag. This should make it useful for inserting -the text to another HTML buffer." - (let* ((htmlize-output-type 'inline-css) - (htmlbuf (htmlize-region beg end))) - (unwind-protect - (with-current-buffer htmlbuf - (buffer-substring (plist-get htmlize-buffer-places 'content-start) - (plist-get htmlize-buffer-places 'content-end))) - (kill-buffer htmlbuf)))) - -(defun htmlize-region-save-screenshot (beg end) - "Save the htmlized (see `htmlize-region-for-paste') region in -the kill ring. Uses `inline-css', with style information in -`
' tags, so that the rendering of the marked up text
-approximates the buffer as closely as possible."
-  (interactive "r")
-  (let ((htmlize-pre-style t))
-    (kill-new (htmlize-region-for-paste beg end)))
-  (deactivate-mark))
-
-(defun htmlize-make-file-name (file)
-  "Make an HTML file name from FILE.
-
-In its default implementation, this simply appends `.html' to FILE.
-This function is called by htmlize to create the buffer file name, and
-by `htmlize-file' to create the target file name.
-
-More elaborate transformations are conceivable, such as changing FILE's
-extension to `.html' (\"file.c\" -> \"file.html\").  If you want them,
-overload this function to do it and htmlize will comply."
-  (concat file ".html"))
-
-;; Older implementation of htmlize-make-file-name that changes FILE's
-;; extension to ".html".
-;(defun htmlize-make-file-name (file)
-;  (let ((extension (file-name-extension file))
-;	(sans-extension (file-name-sans-extension file)))
-;    (if (or (equal extension "html")
-;	    (equal extension "htm")
-;	    (equal sans-extension ""))
-;	(concat file ".html")
-;      (concat sans-extension ".html"))))
-
-;;;###autoload
-(defun htmlize-file (file &optional target)
-  "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."
-  (interactive (list (read-file-name
-		      "HTML-ize file: "
-		      nil nil nil (and (buffer-file-name)
-				       (file-name-nondirectory
-					(buffer-file-name))))))
-  (let ((output-file (if (and target (not (file-directory-p target)))
-			 target
-		       (expand-file-name
-			(htmlize-make-file-name (file-name-nondirectory file))
-			(or target (file-name-directory file)))))
-	;; Try to prevent `find-file-noselect' from triggering
-	;; font-lock because we'll fontify explicitly below.
-	(font-lock-mode nil)
-	(font-lock-auto-fontify nil)
-	(global-font-lock-mode nil)
-	;; Ignore the size limit for the purposes of htmlization.
-	(font-lock-maximum-size nil)
-	;; Disable font-lock support modes.  This will only work in
-	;; more recent Emacs versions, so htmlize-buffer-1 still needs
-	;; to call htmlize-ensure-fontified.
-	(font-lock-support-mode nil))
-    (with-temp-buffer
-      ;; Insert FILE into the temporary buffer.
-      (insert-file-contents file)
-      ;; Set the file name so normal-mode and htmlize-buffer-1 pick it
-      ;; up.  Restore it afterwards so with-temp-buffer's kill-buffer
-      ;; doesn't complain about killing a modified buffer.
-      (let ((buffer-file-name file))
-	;; Set the major mode for the sake of font-lock.
-	(normal-mode)
-        (if (fboundp 'font-lock-ensure)
-            (font-lock-ensure)
-          ;; Emacs prior to 25.1
-          (font-lock-mode 1)
-	  (font-lock-fontify-buffer))
-	;; htmlize the buffer and save the HTML.
-	(with-current-buffer (htmlize-buffer-1)
-	  (unwind-protect
-	      (progn
-		(run-hooks 'htmlize-file-hook)
-		(write-region (point-min) (point-max) output-file))
-	    (kill-buffer (current-buffer)))))))
-  ;; I haven't decided on a useful return value yet, so just return
-  ;; nil.
-  nil)
-
-;;;###autoload
-(defun htmlize-many-files (files &optional target-directory)
-  "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."
-  (interactive
-   (list
-    (let (list file)
-      ;; Use empty string as DEFAULT because setting DEFAULT to nil
-      ;; defaults to the directory name, which is not what we want.
-      (while (not (equal (setq file (read-file-name
-				     "HTML-ize file (RET to finish): "
-				     (and list (file-name-directory
-						(car list)))
-				     "" t))
-			 ""))
-	(push file list))
-      (nreverse list))))
-  ;; Verify that TARGET-DIRECTORY is indeed a directory.  If it's a
-  ;; file, htmlize-file will use it as target, and that doesn't make
-  ;; sense.
-  (and target-directory
-       (not (file-directory-p target-directory))
-       (error "target-directory must name a directory: %s" target-directory))
-  (dolist (file files)
-    (htmlize-file file target-directory)))
-
-;;;###autoload
-(defun htmlize-many-files-dired (arg &optional target-directory)
-  "HTMLize dired-marked files."
-  (interactive "P")
-  (htmlize-many-files (dired-get-marked-files nil arg) target-directory))
-
-(provide 'htmlize)
-
-;; Local Variables:
-;; byte-compile-warnings: (not cl-functions lexical unresolved obsolete)
-;; End:
-
-;;; htmlize.el ends here
diff --git a/elpa/htmlize-20180412.1244/htmlize.elc b/elpa/htmlize-20180412.1244/htmlize.elc
deleted file mode 100644
index 9d3e53a..0000000
Binary files a/elpa/htmlize-20180412.1244/htmlize.elc and /dev/null differ
diff --git a/elpa/hydra-20180703.802/hydra-autoloads.el b/elpa/hydra-20180703.1502/hydra-autoloads.el
similarity index 96%
rename from elpa/hydra-20180703.802/hydra-autoloads.el
rename to elpa/hydra-20180703.1502/hydra-autoloads.el
index 836698c..d483264 100644
--- a/elpa/hydra-20180703.802/hydra-autoloads.el
+++ b/elpa/hydra-20180703.1502/hydra-autoloads.el
@@ -3,7 +3,7 @@
 ;;; Code:
 (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
 
-;;;### (autoloads nil "hydra" "hydra.el" (23368 15447 0 0))
+;;;### (autoloads nil "hydra" "hydra.el" (23392 2165 0 0))
 ;;; Generated autoloads from hydra.el
 
 (autoload 'defhydra "hydra" "\
@@ -65,7 +65,7 @@ result of `defhydra'.
 ;;;***
 
 ;;;### (autoloads nil nil ("hydra-examples.el" "hydra-ox.el" "hydra-pkg.el"
-;;;;;;  "lv.el") (23368 15447 0 0))
+;;;;;;  "lv.el") (23392 2165 0 0))
 
 ;;;***
 
diff --git a/elpa/hydra-20180703.802/hydra-examples.el b/elpa/hydra-20180703.1502/hydra-examples.el
similarity index 100%
rename from elpa/hydra-20180703.802/hydra-examples.el
rename to elpa/hydra-20180703.1502/hydra-examples.el
diff --git a/elpa/hydra-20180703.802/hydra-ox.el b/elpa/hydra-20180703.1502/hydra-ox.el
similarity index 100%
rename from elpa/hydra-20180703.802/hydra-ox.el
rename to elpa/hydra-20180703.1502/hydra-ox.el
diff --git a/elpa/hydra-20180703.802/hydra-ox.elc b/elpa/hydra-20180703.1502/hydra-ox.elc
similarity index 100%
rename from elpa/hydra-20180703.802/hydra-ox.elc
rename to elpa/hydra-20180703.1502/hydra-ox.elc
diff --git a/elpa/hydra-20180703.1502/hydra-pkg.el b/elpa/hydra-20180703.1502/hydra-pkg.el
new file mode 100644
index 0000000..cbef1e0
--- /dev/null
+++ b/elpa/hydra-20180703.1502/hydra-pkg.el
@@ -0,0 +1,12 @@
+(define-package "hydra" "20180703.1502" "Make bindings that stick around."
+  '((cl-lib "0.5"))
+  :keywords
+  '("bindings")
+  :authors
+  '(("Oleh Krehel" . "ohwoeowho@gmail.com"))
+  :maintainer
+  '("Oleh Krehel" . "ohwoeowho@gmail.com")
+  :url "https://github.com/abo-abo/hydra")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/hydra-20180703.802/hydra.el b/elpa/hydra-20180703.1502/hydra.el
similarity index 100%
rename from elpa/hydra-20180703.802/hydra.el
rename to elpa/hydra-20180703.1502/hydra.el
diff --git a/elpa/hydra-20180703.802/hydra.elc b/elpa/hydra-20180703.1502/hydra.elc
similarity index 100%
rename from elpa/hydra-20180703.802/hydra.elc
rename to elpa/hydra-20180703.1502/hydra.elc
diff --git a/elpa/hydra-20180703.802/lv.el b/elpa/hydra-20180703.1502/lv.el
similarity index 100%
rename from elpa/hydra-20180703.802/lv.el
rename to elpa/hydra-20180703.1502/lv.el
diff --git a/elpa/hydra-20180703.802/lv.elc b/elpa/hydra-20180703.1502/lv.elc
similarity index 100%
rename from elpa/hydra-20180703.802/lv.elc
rename to elpa/hydra-20180703.1502/lv.elc
diff --git a/elpa/hydra-20180703.802/hydra-pkg.el b/elpa/hydra-20180703.802/hydra-pkg.el
deleted file mode 100644
index cdf91c7..0000000
--- a/elpa/hydra-20180703.802/hydra-pkg.el
+++ /dev/null
@@ -1,8 +0,0 @@
-(define-package "hydra" "20180703.802" "Make bindings that stick around."
-  '((cl-lib "0.5"))
-  :keywords
-  '("bindings")
-  :url "https://github.com/abo-abo/hydra")
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
diff --git a/elpa/ido-completing-read+-20180122.1340/ido-completing-read+-pkg.el b/elpa/ido-completing-read+-20180122.1340/ido-completing-read+-pkg.el
deleted file mode 100644
index 1752f98..0000000
--- a/elpa/ido-completing-read+-20180122.1340/ido-completing-read+-pkg.el
+++ /dev/null
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "ido-completing-read+" "20180122.1340" "A completing-read-function using ido" '((emacs "24.4") (cl-lib "0.5") (s "0.1") (memoize "1.1")) :commit "51861afe385f59f3262ee40acbe772ccb3dd52e7" :url "https://github.com/DarwinAwardWinner/ido-completing-read-plus" :keywords '("ido" "completion" "convenience"))
diff --git a/elpa/ido-completing-read+-20180122.1340/ido-completing-read+.elc b/elpa/ido-completing-read+-20180122.1340/ido-completing-read+.elc
deleted file mode 100644
index 5392be7..0000000
Binary files a/elpa/ido-completing-read+-20180122.1340/ido-completing-read+.elc and /dev/null differ
diff --git a/elpa/ido-completing-read+-20180122.1340/ido-completing-read+-autoloads.el b/elpa/ido-completing-read+-20180628.244/ido-completing-read+-autoloads.el
similarity index 99%
rename from elpa/ido-completing-read+-20180122.1340/ido-completing-read+-autoloads.el
rename to elpa/ido-completing-read+-20180628.244/ido-completing-read+-autoloads.el
index aa9ffbb..2119998 100644
--- a/elpa/ido-completing-read+-20180122.1340/ido-completing-read+-autoloads.el
+++ b/elpa/ido-completing-read+-20180628.244/ido-completing-read+-autoloads.el
@@ -4,7 +4,7 @@
 (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
 
 ;;;### (autoloads nil "ido-completing-read+" "ido-completing-read+.el"
-;;;;;;  (23163 15789 0 0))
+;;;;;;  (23391 65528 0 0))
 ;;; Generated autoloads from ido-completing-read+.el
 
 (defvar ido-cr+-minibuffer-depth -1 "\
diff --git a/elpa/ido-completing-read+-20180628.244/ido-completing-read+-pkg.el b/elpa/ido-completing-read+-20180628.244/ido-completing-read+-pkg.el
new file mode 100644
index 0000000..8600f82
--- /dev/null
+++ b/elpa/ido-completing-read+-20180628.244/ido-completing-read+-pkg.el
@@ -0,0 +1,2 @@
+;;; -*- no-byte-compile: t -*-
+(define-package "ido-completing-read+" "20180628.244" "A completing-read-function using ido" '((emacs "24.4") (cl-lib "0.5") (s "0.1") (memoize "1.1")) :commit "03bdf989a9af88d4eeed4003ae74c98baf58ff72" :keywords '("ido" "completion" "convenience") :authors '(("Ryan Thompson")) :maintainer '("Ryan Thompson") :url "https://github.com/DarwinAwardWinner/ido-completing-read-plus")
diff --git a/elpa/ido-completing-read+-20180122.1340/ido-completing-read+.el b/elpa/ido-completing-read+-20180628.244/ido-completing-read+.el
similarity index 89%
rename from elpa/ido-completing-read+-20180122.1340/ido-completing-read+.el
rename to elpa/ido-completing-read+-20180628.244/ido-completing-read+.el
index 7c43a32..2227756 100644
--- a/elpa/ido-completing-read+-20180122.1340/ido-completing-read+.el
+++ b/elpa/ido-completing-read+-20180628.244/ido-completing-read+.el
@@ -5,8 +5,8 @@
 ;; Filename: ido-completing-read+.el
 ;; Author: Ryan Thompson
 ;; Created: Sat Apr  4 13:41:20 2015 (-0700)
-;; Version: 4.7
-;; Package-Version: 20180122.1340
+;; Version: 4.11
+;; Package-Version: 20180628.244
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5") (s "0.1") (memoize "1.1"))
 ;; URL: https://github.com/DarwinAwardWinner/ido-completing-read-plus
 ;; Keywords: ido, completion, convenience
@@ -78,7 +78,7 @@
 ;;
 ;;; Code:
 
-(defconst ido-completing-read+-version "4.7"
+(defconst ido-completing-read+-version "4.11"
   "Currently running version of ido-completing-read+.
 
 Note that when you update ido-completing-read+, this variable may
@@ -89,7 +89,9 @@ not be updated until you restart Emacs.")
 (require 'cl-lib)
 (require 'cus-edit)
 (require 's)
-(require 'memoize)
+
+;; Optional dependency, only needed for optimization
+(require 'memoize nil t)
 
 ;; Silence some byte-compiler warnings
 (eval-when-compile
@@ -183,6 +185,9 @@ either of those functions directly won't set `this-command'.")
 This allows ido-cr+ to update the set of completion candidates
 dynamically.")
 
+(defvar ido-cr+-last-dynamic-update-text nil
+  "The value of `ido-text' last time a dynamic update occurred.")
+
 (defvar ido-cr+-dynamic-update-idle-time 0.25
   "Time to wait before updating dynamic completion list.")
 
@@ -207,13 +212,13 @@ generally be nil while running an idle timer.")
 
 These are used for falling back to `completing-read-default'.")
 
-(defvar ido-cr+-all-completions-memoized nil
+(defvar ido-cr+-all-completions-memoized 'all-completions
   "Memoized version of `all-completions'.
 
 During completion with dynamic collection, this variable is set
 to a memoized copy of `all-completions'.")
 
-(defvar ido-cr+-all-prefix-completions-memoized nil
+(defvar ido-cr+-all-prefix-completions-memoized 'ido-cr+-all-prefix-completions
   "Memoized version of `ido-cr+-all-prefix-completions'.
 
 During completion with dynamic collection, this variable is set
@@ -290,7 +295,9 @@ disable fallback based on collection size, set this to nil."
     ;; https://github.com/DarwinAwardWinner/ido-completing-read-plus/issues/39
     Info-read-node-name
     ;; https://github.com/DarwinAwardWinner/ido-completing-read-plus/issues/44
-    tmm-prompt)
+    tmm-prompt
+    ;; https://github.com/DarwinAwardWinner/ido-completing-read-plus/issues/156
+    org-tags-completion-function)
   "Functions & commands for which ido-cr+ should be disabled.
 
 Each entry can be either a symbol or a string. A symbol means to
@@ -512,13 +519,14 @@ completion for them."
           (when (and (not ido-cr+-assume-static-collection)
                      (functionp collection))
             collection))
+         (ido-cr+-last-dynamic-update-text nil)
          ;; Only memoize if the collection is dynamic.
          (ido-cr+-all-prefix-completions-memoized
-          (if ido-cr+-dynamic-collection
+          (if (and ido-cr+-dynamic-collection (featurep 'memoize))
               (memoize (indirect-function 'ido-cr+-all-prefix-completions))
             'ido-cr+-all-prefix-completions))
          (ido-cr+-all-completions-memoized
-          (if ido-cr+-dynamic-collection
+          (if (and ido-cr+-dynamic-collection (featurep 'memoize))
               (memoize (indirect-function 'all-completions))
             'all-completions))
          ;; If the whitelist is empty, everything is whitelisted
@@ -829,15 +837,15 @@ not a function, this is equivalent to
     (cl-loop
      for i from 0 upto (length string)
      append (funcall
-             (or ido-cr+-all-completions-memoized
-                 'all-completions)
+             ido-cr+-all-completions-memoized
              (s-left i string)
              collection
              predicate)
      into completion-list
      finally return (delete-dups completion-list)))
-   ;; Otherwise, just call `all-completions' on the empty string to
-   ;; get every possible completions for a static COLLECTION.
+   ;; If COLLECTION is not dynamic, then just call `all-completions'
+   ;; on the empty string, which will already return every possible
+   ;; completion.
    (t
     (all-completions "" collection predicate))))
 
@@ -874,79 +882,98 @@ result."
        (nreverse filtered-collection)
      filtered-collection)))
 
+(defun ido-cr+-cyclicp (x)
+  "Returns non-nill if X is a list containing a circular reference."
+  (cl-loop
+   for tortoise on x
+   for hare on (cdr x) by #'cddr
+   thereis (eq tortoise hare)))
+
 (defun ido-cr+-update-dynamic-collection ()
   "Update the set of completions for a dynamic collection.
 
 This has no effect unless `ido-cr+-dynamic-collection' is non-nil."
-  (when (and (ido-cr+-active)
-             ido-cr+-dynamic-collection)
-    (let ((orig-ido-cur-list ido-cur-list))
-      (condition-case-unless-debug err
-          (let* ((ido-text
-                  (buffer-substring-no-properties (minibuffer-prompt-end)
-                                                  ido-eoinput))
-                 (predicate (nth 2 ido-cr+-orig-completing-read-args))
-                 (first-match (car ido-matches))
-                 (strings-to-check
-                  (cond
-                   ;; If no match, then we only check `ido-text'
-                   ((null first-match)
-                    (list ido-text))
-                   ;; If `ido-text' is a prefix of `first-match', then we
-                   ;; only need to check `first-match'
-                   ((and first-match
-                         (s-prefix? ido-text first-match))
-                    (list first-match))
-                   ;; Otherwise we need to check both
-                   (t
-                    (list ido-text first-match))))
-                 (new-completions
-                  (cl-loop
-                   for string in strings-to-check
-                   nconc
-                   (funcall
-                    (or ido-cr+-all-prefix-completions-memoized
-                        'ido-cr+-all-prefix-completions)
-                    string ido-cr+-dynamic-collection predicate)
-                   into result
-                   finally return result)))
-            ;; Put the previous first match back at the front if possible
-            (when (and new-completions
-                       first-match
-                       (member first-match new-completions))
-              (setq new-completions
-                    (ido-chop new-completions first-match)))
-            (when (not (equal new-completions ido-cur-list))
-              (when (and (bound-and-true-p flx-ido-mode)
-                         (functionp 'flx-ido-reset))
-                ;; Reset flx-ido since the set of completions has changed
-                (funcall 'flx-ido-reset))
-              (setq ido-cur-list (delete-dups new-completions))
-              (when ido-cr+-active-restrictions
-                (setq ido-cur-list (ido-cr+-apply-restrictions
-                                    ido-cur-list
-                                    ido-cr+-active-restrictions)))
-              (ido-cr+--debug-message
-               "Updated completion candidates for dynamic collection because `ido-text' changed to %S. `ido-cur-list' now has %s elements"
-               ido-text (length ido-cur-list))
-              ;; Recompute matches with new completions
-              (setq ido-rescan t)
-              (ido-set-matches)
-              ;; Rebuild the completion display unless ido is already planning
-              ;; to do it anyway
-              (unless ido-cr+-exhibit-pending
-                (ido-tidy)
-                (ido-exhibit))))
-        (error
-         (display-warning 'ido-cr+
-                          (format
-                           "Disabling dynamic update due to error: %S"
-                           err))
-         ;; Reset any variables that might have been modified during
-         ;; the failed update
-         (setq ido-cur-list orig-ido-cur-list)
-         ;; Prevent any further attempts at dynamic updating
-         (setq ido-cr+-dynamic-collection nil)))))
+  (when (and ido-cr+-dynamic-collection
+             (ido-cr+-active))
+    ;; (cl-assert (not (ido-cr+-cyclicp ido-cur-list)))
+    (let ((orig-ido-cur-list ido-cur-list)
+          (ido-text
+           (buffer-substring-no-properties (minibuffer-prompt-end)
+                                           ido-eoinput)))
+      ;; If current `ido-text' is equal to or a prefix of the previous
+      ;; one, a dynamic update is not needed.
+      (when (or (null ido-cr+-last-dynamic-update-text)
+                (not (s-prefix? ido-text ido-cr+-last-dynamic-update-text)))
+        (ido-cr+--debug-message "Doing a dynamic update because `ido-text' changed from %S to %S"
+                                ido-cr+-last-dynamic-update-text ido-text)
+        (setq ido-cr+-last-dynamic-update-text ido-text)
+        (condition-case-unless-debug err
+            (let* ((predicate (nth 2 ido-cr+-orig-completing-read-args))
+                   (first-match (car ido-matches))
+                   (strings-to-check
+                    (cond
+                     ;; If no match, then we only check `ido-text'
+                     ((null first-match)
+                      (list ido-text))
+                     ;; If `ido-text' is a prefix of `first-match', then we
+                     ;; only need to check `first-match'
+                     ((and first-match
+                           (s-prefix? ido-text first-match))
+                      (list first-match))
+                     ;; Otherwise we need to check both
+                     (t
+                      (list ido-text first-match))))
+                   (new-completions
+                    (cl-loop
+                     for string in strings-to-check
+                     append
+                     (funcall
+                      ido-cr+-all-prefix-completions-memoized
+                      string ido-cr+-dynamic-collection predicate)
+                     into result
+                     finally return result)))
+              ;; (cl-assert (not (ido-cr+-cyclicp new-completions)))
+              (if (equal new-completions ido-cur-list)
+                  (ido-cr+--debug-message "Skipping dynamic update because the completion list did not change.")
+                (when (and (bound-and-true-p flx-ido-mode)
+                           (functionp 'flx-ido-reset))
+                  ;; Reset flx-ido since the set of completions has changed
+                  (funcall 'flx-ido-reset))
+                (setq ido-cur-list (delete-dups (append ido-cur-list new-completions)))
+                (when ido-cr+-active-restrictions
+                  (setq ido-cur-list (ido-cr+-apply-restrictions
+                                      ido-cur-list
+                                      ido-cr+-active-restrictions)))
+                (ido-cr+--debug-message
+                 "Updated completion candidates for dynamic collection. `ido-cur-list' now has %s elements"
+                 ido-text (length ido-cur-list))
+                ;; Recompute matches with new completions
+                (let ((ido-rescan t))
+                  (ido-set-matches))
+                (setq ido-rescan nil)
+                ;; Put the pre-update first match (if any) back in
+                ;; front
+                (when (and first-match
+                           (not (equal first-match (car ido-matches)))
+                           (member first-match ido-matches))
+                  (ido-cr+--debug-message "Restoring first match %S after dynamic update" first-match)
+                  (setq ido-matches (ido-chop ido-matches first-match)))
+                ;; Rebuild the completion display unless ido is already planning
+                ;; to do it anyway
+                (unless ido-cr+-exhibit-pending
+                  (ido-tidy)
+                  (let ((ido-rescan nil))
+                    (ido-exhibit)))))
+          (error
+           (display-warning 'ido-cr+
+                            (format
+                             "Disabling dynamic update due to error: %S"
+                             err))
+           ;; Reset any variables that might have been modified during
+           ;; the failed update
+           (setq ido-cur-list orig-ido-cur-list)
+           ;; Prevent any further attempts at dynamic updating
+           (setq ido-cr+-dynamic-collection nil))))))
   ;; Always cancel an active timer when this function is called.
   (when ido-cr+-dynamic-update-timer
     (cancel-timer ido-cr+-dynamic-update-timer)
@@ -960,6 +987,7 @@ This has no effect unless `ido-cr+-dynamic-collection' is non-nil."
     (when ido-cr+-dynamic-update-timer
       (cancel-timer ido-cr+-dynamic-update-timer)
       (setq ido-cr+-dynamic-update-timer nil))
+    (cl-assert (not (ido-cr+-cyclicp ido-cur-list)))
     (if (<= (length ido-matches) 1)
         ;; If we've narrowed it down to zero or one matches, update
         ;; immediately.
@@ -988,6 +1016,8 @@ This has no effect unless `ido-cr+-dynamic-collection' is non-nil."
       (apply oldfun args))
     ;; Update `ido-eoinput'
     (setq ido-eoinput (point-max))
+    ;; Clear this var to force an update
+    (setq ido-cr+-last-dynamic-update-text nil)
     ;; Now do update
     (ido-cr+-update-dynamic-collection))
   ;; After maybe updating the dynamic collection, if there's still
diff --git a/elpa/ido-completing-read+-20180628.244/ido-completing-read+.elc b/elpa/ido-completing-read+-20180628.244/ido-completing-read+.elc
new file mode 100644
index 0000000..1611aa3
Binary files /dev/null and b/elpa/ido-completing-read+-20180628.244/ido-completing-read+.elc differ
diff --git a/elpa/image+-20150707.1616/image+-autoloads.el b/elpa/image+-20150707.1616/image+-autoloads.el
new file mode 100644
index 0000000..8883ecd
--- /dev/null
+++ b/elpa/image+-20150707.1616/image+-autoloads.el
@@ -0,0 +1,60 @@
+;;; image+-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
+
+;;;### (autoloads nil "image+" "image+.el" (23391 65526 0 0))
+;;; Generated autoloads from image+.el
+
+(autoload 'imagex-sticky-mode "image+" "\
+To manipulate Image at point.
+
+\(fn &optional ARG)" t nil)
+
+(defvar imagex-global-sticky-mode nil "\
+Non-nil if Imagex-Global-Sticky mode is enabled.
+See the `imagex-global-sticky-mode' command
+for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `imagex-global-sticky-mode'.")
+
+(custom-autoload 'imagex-global-sticky-mode "image+" nil)
+
+(autoload 'imagex-global-sticky-mode "image+" "\
+Toggle Imagex-Sticky mode in all buffers.
+With prefix ARG, enable Imagex-Global-Sticky mode if ARG is positive;
+otherwise, disable it.  If called from Lisp, enable the mode if
+ARG is omitted or nil.
+
+Imagex-Sticky mode is enabled in all buffers where
+`imagex-sticky-mode-maybe' would do it.
+See `imagex-sticky-mode' for more information on Imagex-Sticky mode.
+
+\(fn &optional ARG)" t nil)
+
+(defvar imagex-auto-adjust-mode nil "\
+Non-nil if Imagex-Auto-Adjust mode is enabled.
+See the `imagex-auto-adjust-mode' command
+for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `imagex-auto-adjust-mode'.")
+
+(custom-autoload 'imagex-auto-adjust-mode "image+" nil)
+
+(autoload 'imagex-auto-adjust-mode "image+" "\
+Adjust image to current frame automatically in `image-mode'.
+
+Type \\[imagex-sticky-restore-original] to restore the original image.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; End:
+;;; image+-autoloads.el ends here
diff --git a/elpa/image+-20150707.1616/image+-pkg.el b/elpa/image+-20150707.1616/image+-pkg.el
new file mode 100644
index 0000000..baee7a7
--- /dev/null
+++ b/elpa/image+-20150707.1616/image+-pkg.el
@@ -0,0 +1,2 @@
+;;; -*- no-byte-compile: t -*-
+(define-package "image+" "20150707.1616" "Image manipulate extensions for Emacs" '((cl-lib "0.3")) :commit "6834d0c09bb4df9ecc0d7a559bd7827fed48fffc" :keywords '("multimedia" "extensions") :authors '(("Masahiro Hayashi" . "mhayashi1120@gmail.com")) :maintainer '("Masahiro Hayashi" . "mhayashi1120@gmail.com") :url "https://github.com/mhayashi1120/Emacs-imagex")
diff --git a/elpa/image+-20150707.1616/image+.el b/elpa/image+-20150707.1616/image+.el
new file mode 100644
index 0000000..09013cb
--- /dev/null
+++ b/elpa/image+-20150707.1616/image+.el
@@ -0,0 +1,572 @@
+;;; image+.el --- Image manipulate extensions for Emacs
+
+;; Author: Masahiro Hayashi 
+;; Keywords: multimedia, extensions
+;; Package-Version: 20150707.1616
+;; URL: https://github.com/mhayashi1120/Emacs-imagex
+;; Emacs: GNU Emacs 22 or later
+;; Version: 0.6.3
+;; Package-Requires: ((cl-lib "0.3"))
+
+;; 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., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; ## Install:
+
+;; Please install the ImageMagick before installing this elisp.
+
+;; Put this file into load-path'ed directory, and byte compile it if
+;; desired. And put the following expression into your ~/.emacs.
+
+;;     (eval-after-load 'image '(require 'image+))
+
+;; ## Usage:
+
+;; * [__Recommended__] Sample Hydra setting. Instead of `imagex-global-sticky-mode' .
+
+;;  https://github.com/abo-abo/hydra
+
+;;     (eval-after-load 'image+
+;;       `(when (require 'hydra nil t)
+;;          (defhydra imagex-sticky-binding (global-map "C-x C-l")
+;;            "Manipulating Image"
+;;            ("+" imagex-sticky-zoom-in "zoom in")
+;;            ("-" imagex-sticky-zoom-out "zoom out")
+;;            ("M" imagex-sticky-maximize "maximize")
+;;            ("O" imagex-sticky-restore-original "restore original")
+;;            ("S" imagex-sticky-save-image "save file")
+;;            ("r" imagex-sticky-rotate-right "rotate right")
+;;            ("l" imagex-sticky-rotate-left "rotate left"))))
+
+;;  Then try to type `C-x C-l +` to zoom-in the current image.
+;;  You can zoom-out with type `-` .
+
+;; * To manipulate a image under cursor.
+
+;;     M-x imagex-sticky-mode
+
+;;  Or to activate globally:
+
+;;     M-x imagex-global-sticky-mode
+
+;;  Or in .emacs:
+
+;;     (eval-after-load 'image+ '(imagex-global-sticky-mode 1))
+
+;; * `C-c +` / `C-c -`: Zoom in/out image.
+;; * `C-c M-m`: Adjust image to current frame size.
+;; * `C-c C-x C-s`: Save current image.
+;; * `C-c M-r` / `C-c M-l`: Rotate image.
+;; * `C-c M-o`: Show image `image+` have not modified.
+
+;; * Adjusted image when open image file.
+
+;;     M-x imagex-auto-adjust-mode
+
+;;   Or in .emacs:
+
+;;     (eval-after-load 'image+ '(imagex-auto-adjust-mode 1))
+
+;; * If you do not want error message in minibuffer:
+
+;;     (setq imagex-quiet-error t)
+
+;;; Code:
+
+(eval-when-compile
+  (require 'easy-mmode))
+
+(require 'cl-lib)
+(require 'image)
+(require 'image-file)
+(require 'advice)
+
+(defgroup image+ ()
+  "Image extensions"
+  :group 'multimedia)
+
+(defcustom imagex-convert-command "convert"
+  "ImageMagick convert command"
+  :group 'image+
+  :type 'file)
+
+(defcustom imagex-identify-command "identify"
+  "ImageMagick identify command"
+  :group 'image+
+  :type 'file)
+
+(defvar this-command)
+(defvar imagex-auto-adjust-mode)
+
+(defcustom imagex-auto-adjust-threshold 3
+  "Maximum magnification when `imagex-auto-adjust-mode' is on."
+  :group 'image+
+  :type 'number)
+
+(defcustom imagex-quiet-error nil
+  "Suppress error message when convert image."
+  :group 'imagex
+  :type 'boolean)
+
+
+(defun imagex--call-convert (image &rest args)
+  (let ((spec (cdr image)))
+    (with-temp-buffer
+      (set-buffer-multibyte nil)
+      (let ((coding-system-for-read 'binary)
+            (coding-system-for-write 'binary)
+            (default-directory
+              (or
+               (and temporary-file-directory
+                    (file-name-as-directory temporary-file-directory))
+               default-directory)))
+        (cond
+         ((plist-get spec :data)
+          (insert (plist-get spec :data))
+          ;; stdin to current-buffer
+          (unless (eq (apply 'call-process-region
+                             (point-min) (point-max) imagex-convert-command
+                             t (current-buffer) nil
+                             `("-" ,@args "-")) 0)
+            (error "Cannot convert image")))
+         ((plist-get spec :file)
+          ;; stdin to current-buffer
+          (unless (eq (apply 'call-process
+                             imagex-convert-command
+                             (plist-get spec :file) t nil
+                             `("-" ,@args "-")) 0)
+            (error "Cannot convert image")))
+         (t
+          (error "Not a supported image")))
+        (let ((img (create-image (buffer-string) nil t)))
+          (plist-put (cdr img) 'imagex-original-image
+                     (or (plist-get (cdr image) 'imagex-original-image)
+                         (copy-sequence image)))
+          img)))))
+
+(defun imagex-image-object-p (object)
+  (and object (consp object)
+       (eq (car object) 'image)))
+
+(defun imagex--replace-textprop-image (start end image)
+  (let ((flag (buffer-modified-p))
+        (inhibit-read-only t))
+    (put-text-property start end 'display image)
+    (set-buffer-modified-p flag)))
+
+(defun imagex--replace-current-image (new-image)
+  (cond
+   ((derived-mode-p 'image-mode)
+    (cl-destructuring-bind (begin end)
+        (imagex--display-region (point-min))
+      (imagex--replace-textprop-image begin end new-image)))
+   ((derived-mode-p 'doc-view-mode)
+    (let ((ov (car (overlays-in (point-min) (point-max)))))
+      (overlay-put ov 'display new-image)))
+   (t
+    (cl-destructuring-bind (begin end)
+        (imagex--display-region (point))
+      (imagex--replace-textprop-image begin end new-image)))))
+
+(declare-function image-get-display-property nil)
+(declare-function doc-view-current-image nil)
+
+(defun imagex--current-image ()
+  (cond
+   ((derived-mode-p 'image-mode)
+    (image-get-display-property))
+   ((derived-mode-p 'doc-view-mode)
+    (doc-view-current-image))
+   (t
+    (let* ((ovs (overlays-at (point)))
+           (disp (get-text-property (point) 'display))
+           (ov (car (cl-remove-if-not
+                     (lambda (ov) (overlay-get ov 'display))
+                     ovs))))
+      (when (and ov (overlay-get ov 'display))
+        (setq disp (overlay-get ov 'display)))
+      ;; only image object (Not sliced image)
+      (and (imagex-image-object-p disp)
+           disp)))))
+
+(defun imagex--display-region (point)
+  (let* ((end (or (next-single-property-change point 'display)
+                  (point-max)))
+         (begin (or (previous-single-property-change end 'display)
+                    (point-min))))
+    (list begin end)))
+
+(defun imagex--zoom (image magnification)
+  (let* ((pixels (image-size image t))
+         (new (imagex--call-convert
+               image
+               "-resize"
+               (format "%sx%s"
+                       (truncate (* (car pixels) magnification))
+                       (truncate (* (cdr pixels) magnification))))))
+    ;; clone source image properties
+    (when (plist-get (cdr image) :margin)
+      (plist-put (cdr new) :margin
+                 (plist-get (cdr image) :margin)))
+    (when (plist-get (cdr image) :relief)
+      (plist-put (cdr new) :relief
+                 (plist-get (cdr image) :relief)))
+    new))
+
+(defun imagex--fit-to-size (image width height &optional max)
+  "Resize IMAGE with preserving magnification."
+  (let* ((pixels (image-size image t))
+         (margin (or (plist-get (cdr image) :margin) 0))
+         (relief (or (plist-get (cdr image) :relief) 0))
+         (mr (+ (* 2 margin) (* 2 relief)))
+         (w (+ (car pixels) mr))
+         (h (+ (cdr pixels) mr))
+         (wr (/ width (ftruncate w)))
+         (hr (/ height (ftruncate h)))
+         (magnification (apply 'min (delq nil (list wr hr max)))))
+    (imagex--zoom image magnification)))
+
+(defun imagex--maximize (image &optional maximum)
+  "Adjust IMAGE to current frame."
+  (let* ((edges (window-inside-pixel-edges))
+         (width (- (nth 2 edges) (nth 0 edges)))
+         (height (- (nth 3 edges) (nth 1 edges))))
+    (imagex--fit-to-size image width height maximum)))
+
+(defun imagex--rotate-degrees (arg)
+  (cond
+   ((numberp arg)
+    arg)
+   ((consp arg)
+    (* (truncate
+        (/ (log (prefix-numeric-value arg) 2) 2)) 90))
+   (t 90)))
+
+(defun imagex-one-image-mode-p ()
+  (memq major-mode '(image-mode doc-view-mode)))
+
+(defun imagex--message (format &rest args)
+  (unless imagex-quiet-error
+    (apply 'message (concat "image+: " format) args)
+    (sit-for 0.5)))
+
+;;
+;; Image+ Minor mode definitions
+;;
+
+(defvar imagex-sticky-mode-map nil)
+
+(unless imagex-sticky-mode-map
+  (let ((map (make-sparse-keymap)))
+
+    (define-key map "\C-c+" 'imagex-sticky-zoom-in)
+    (define-key map "\C-c-" 'imagex-sticky-zoom-out)
+    (define-key map "\C-c\el" 'imagex-sticky-rotate-left)
+    (define-key map "\C-c\er" 'imagex-sticky-rotate-right)
+    (define-key map "\C-c\em" 'imagex-sticky-maximize)
+    (define-key map "\C-c\eo" 'imagex-sticky-restore-original)
+    (define-key map "\C-c\C-x\C-s" 'imagex-sticky-save-image)
+
+    (setq imagex-sticky-mode-map map)))
+
+;;;###autoload
+(define-minor-mode imagex-sticky-mode
+  "To manipulate Image at point."
+  :group 'image+
+  :keymap imagex-sticky-mode-map
+  )
+
+;;;###autoload
+(define-globalized-minor-mode imagex-global-sticky-mode
+  imagex-sticky-mode imagex-sticky-mode-maybe
+  :group 'image+)
+
+(defun imagex-sticky-mode-maybe ()
+  (when (executable-find imagex-convert-command)
+    (unless (minibufferp (current-buffer))
+      (imagex-sticky-mode 1))))
+
+(defun imagex-sticky--current-textprop-display ()
+  (let ((disp (get-text-property (point) 'display)))
+    ;; only image object (Not sliced image)
+    (when (imagex-image-object-p disp)
+      (cl-destructuring-bind (begin end)
+          (imagex--display-region (point))
+        (list disp begin end)))))
+
+(defun imagex-sticky--current-ovprop-display ()
+  (let* ((ovs (overlays-at (point)))
+         (ov (car (cl-remove-if-not
+                   (lambda (ov) (overlay-get ov 'display))
+                   ovs))))
+    (when (and ov (overlay-get ov 'display))
+      (let ((disp (overlay-get ov 'display)))
+        ;; only image object (Not sliced image)
+        (and (imagex-image-object-p disp)
+             (list disp ov))))))
+
+;; fallback to original keybind
+;; if current point doesn't have image.
+(defun imagex-sticky-fallback (&optional except-command)
+  (let ((keys (this-command-keys-vector)))
+    ;; suppress this minor mode to get original command
+    (let* ((imagex-sticky-mode nil)
+           (command (if keys (key-binding keys))))
+      (when (and (commandp command)
+                 (not (eq command except-command)))
+        (setq this-command command)
+        (call-interactively command)))))
+
+(defun imagex-sticky--convert-image (converter)
+  (catch 'done
+    (let (err)
+      (condition-case err1
+          (let ((display (imagex-sticky--current-ovprop-display)))
+            (when display
+              (cl-destructuring-bind (image ov) display
+                (let ((new (funcall converter image)))
+                  (plist-put (cdr new) 'imagex-manual-manipulation t)
+                  (overlay-put ov 'display new))
+                (throw 'done t))))
+        (error
+         (setq err (append err err1))))
+      (condition-case err2
+          (let ((display (imagex-sticky--current-textprop-display)))
+            (when display
+              (cl-destructuring-bind (image begin end) display
+                (let ((new (funcall converter image)))
+                  (plist-put (cdr new) 'imagex-manual-manipulation t)
+                  (imagex--replace-textprop-image begin end new))
+                (throw 'done t))))
+        (error
+         (setq err (append err err2))))
+      (when err
+        (imagex--message "%s" err))
+      (imagex-sticky-fallback this-command))))
+
+(defun imagex-sticky--rotate-image (degrees)
+  (imagex-sticky--convert-image
+   (lambda (image)
+     (imagex--call-convert
+      image "-rotate" (format "%s" degrees)))))
+
+(defun imagex-sticky--zoom (magnification)
+  (imagex-sticky--convert-image
+   (lambda (image)
+     (imagex--zoom image magnification))))
+
+(defun imagex-sticky-zoom-in (&optional arg)
+  "Zoom in image at point.
+If there is no image, fallback to original command."
+  (interactive "p")
+  (imagex-sticky--zoom (* 1.1 arg)))
+
+(defun imagex-sticky-zoom-out (&optional arg)
+  "Zoom out image at point.
+If there is no image, fallback to original command."
+  (interactive "p")
+  (imagex-sticky--zoom (/ 1 1.1 arg)))
+
+(defun imagex-sticky-save-image ()
+  "Save image at point.
+If there is no image, fallback to original command."
+  (interactive)
+  (condition-case nil
+      (cl-destructuring-bind (image . _)
+          (or (imagex-sticky--current-ovprop-display)
+              (imagex-sticky--current-textprop-display))
+        (let ((spec (cdr image)))
+          (cond
+           ((plist-get spec :file)
+            (let* ((src-file (plist-get spec :file))
+                   (ext (concat "." (symbol-name (image-type src-file nil))))
+                   (file (read-file-name "Image File: " nil nil nil ext)))
+              (let ((coding-system-for-write 'binary))
+                (copy-file src-file file t))))
+           ((plist-get spec :data)
+            (let* ((data (plist-get spec :data))
+                   (ext (concat "." (symbol-name (image-type data nil t))))
+                   (file (read-file-name "Image File: " nil nil nil ext)))
+              (let ((coding-system-for-write 'binary))
+                (write-region data nil file))))
+           (t (error "Abort")))))
+    (error
+     (imagex-sticky-fallback this-command))))
+
+(defun imagex-sticky-maximize ()
+  "Maximize the point image to fit the current frame."
+  (interactive)
+  (imagex-sticky--convert-image
+   (lambda (image)
+     (imagex--maximize image))))
+
+(defun imagex-sticky-restore-original ()
+  "Restore the original image if current image has been converted."
+  (interactive)
+  (imagex-sticky--convert-image
+   (lambda (image)
+     (let ((orig (plist-get (cdr image) 'imagex-original-image)))
+       (unless orig
+         (error "No original image here"))
+       orig))))
+
+(defun imagex-sticky-rotate-left (&optional degrees)
+  "Rotate current image left (counter clockwise) 90 degrees.
+Use \\[universal-argument] followed by a number to specify a exactly degree.
+Multiple \\[universal-argument] as argument means to count of type multiply
+by 90 degrees."
+  (interactive "P")
+  (imagex-sticky--rotate-image
+   (- 360 (imagex--rotate-degrees degrees))))
+
+(defun imagex-sticky-rotate-right (&optional degrees)
+  "Rotate current image right (counter clockwise) 90 degrees.
+Use \\[universal-argument] followed by a number to specify a exactly degree.
+Multiple \\[universal-argument] as argument means to count of type multiply
+by 90 degrees."
+  (interactive "P")
+  (imagex-sticky--rotate-image
+   (imagex--rotate-degrees degrees)))
+
+
+
+(defun imagex--activate-advice (flag alist)
+  (cl-loop for (fn adname) in alist
+           do (condition-case nil
+                  (progn
+                    (funcall (if flag
+                                 'ad-enable-advice
+                               'ad-disable-advice)
+                             fn 'around adname)
+                    (ad-activate fn))
+                (error nil))))
+
+;; adjust image fit to window if window has just one image
+;; this function is invoked from `imagex-auto-adjust-mode'
+(defun imagex--adjust-image-to-window ()
+  (when (and (not (minibufferp))
+             imagex-auto-adjust-mode
+             (imagex-one-image-mode-p))
+    (condition-case err
+        (let ((image (imagex--current-image)))
+          (cond
+           ((null image))
+           ;; TODO work around to fix background file modification
+           ((not (verify-visited-file-modtime))
+            (error "Image is modified on the disk"))
+           (t
+            (let ((manualp (plist-get (cdr image) 'imagex-manual-manipulation))
+                  (prev-edges (plist-get (cdr image) 'imagex-auto-adjusted-edges))
+                  (curr-edges (window-edges)))
+              (when (and (not manualp)
+                         (or (null prev-edges)
+                             (not (equal curr-edges prev-edges))))
+                (let* ((orig (plist-get (cdr image) 'imagex-original-image))
+                       (target (or orig image))
+                       (new-image
+                        (imagex--maximize target imagex-auto-adjust-threshold)))
+                  ;; new-image may be nil if original image file was removed
+                  (when new-image
+                    (imagex--replace-current-image new-image)
+                    (plist-put (cdr new-image)
+                               'imagex-auto-adjusted-edges curr-edges))))))))
+      (error
+       (imagex--message "%s" err)))))
+
+
+(defvar imagex-auto-adjust-advices
+  '(
+    insert-image-file
+    image-toggle-display-image
+    doc-view-insert-image
+    ))
+
+(defmacro imagex--auto-adjust-activate (&rest body)
+  "Execute BODY with activating `create-image' advice."
+  `(progn
+     (ad-enable-advice 'create-image 'around 'imagex-create-image)
+     (ad-activate 'create-image)
+     (unwind-protect
+         (progn ,@body)
+       (ad-disable-advice 'create-image 'around 'imagex-create-image)
+       (ad-activate 'create-image))))
+
+;;;###autoload
+(define-minor-mode imagex-auto-adjust-mode
+  "Adjust image to current frame automatically in `image-mode'.
+
+Type \\[imagex-sticky-restore-original] to restore the original image.
+"
+  :global t
+  :group 'image+
+  (let ((alist
+         (mapcar
+          (lambda (fn)
+            (let* ((adname (intern (concat "imagex-" (symbol-name fn) "-ad")))
+                   (advice (ad-make-advice
+                            adname nil nil
+                            `(advice lambda (&rest args)
+                                     (imagex--auto-adjust-activate
+                                      (setq ad-return-value ad-do-it))))))
+              (ad-add-advice fn advice 'around nil)
+              (list fn adname)))
+          imagex-auto-adjust-advices)))
+    (imagex--activate-advice imagex-auto-adjust-mode alist)
+    ;;TODO want make local hook but seems `window-configuration-change-hook'
+    ;; is not working locally.
+    (cond
+     (imagex-auto-adjust-mode
+      (add-hook 'window-configuration-change-hook
+                'imagex--adjust-image-to-window)
+      ;; maybe replace current displaying image
+      (imagex--adjust-image-to-window))
+     (t
+      ;; No need to restore originals
+      (remove-hook 'window-configuration-change-hook
+                   'imagex--adjust-image-to-window)))))
+
+(defun imagex-create-adjusted-image
+    (file-or-data &optional type data-p &rest props)
+  (let ((img
+         (apply (ad-get-orig-definition 'create-image)
+                file-or-data type data-p props)))
+    (cond
+     ((boundp 'imagex-adjusting)
+      (plist-put (cdr img) 'imagex-auto-adjusted-edges (window-edges))
+      img)
+     (t
+      (or
+       (condition-case err
+           ;; suppress eternal recurse
+           (let ((imagex-adjusting t))
+             (imagex--maximize img imagex-auto-adjust-threshold))
+         (error
+          ;; handling error that is caused by ImageMagick unsupported image.
+          (imagex--message "%s" err)
+          nil))
+       img)))))
+
+(defadvice create-image
+    (around imagex-create-image (&rest args) disable)
+  (setq ad-return-value
+        (apply 'imagex-create-adjusted-image args)))
+
+
+
+(provide 'image+)
+
+;;; image+.el ends here
diff --git a/elpa/image+-20150707.1616/image+.elc b/elpa/image+-20150707.1616/image+.elc
new file mode 100644
index 0000000..6c5c15c
Binary files /dev/null and b/elpa/image+-20150707.1616/image+.elc differ
diff --git a/elpa/inflections-20170913.216/inflections-pkg.el b/elpa/inflections-20170913.216/inflections-pkg.el
deleted file mode 100644
index 187994e..0000000
--- a/elpa/inflections-20170913.216/inflections-pkg.el
+++ /dev/null
@@ -1,2 +0,0 @@
-;;; -*- no-byte-compile: t -*-
-(define-package "inflections" "20170913.216" "convert english words between singular and plural" '((cl-lib "0.5") (emacs "24")) :commit "e4f1372cf22e811faca52fc86bdd5d817498a4d8" :url "https://github.com/eschulte/jump.el" :keywords '("languages" "tools" "wp"))
diff --git a/elpa/inflections-20170913.216/inflections-autoloads.el b/elpa/inflections-20170913.916/inflections-autoloads.el
similarity index 92%
rename from elpa/inflections-20170913.216/inflections-autoloads.el
rename to elpa/inflections-20170913.916/inflections-autoloads.el
index 38d31a0..2233ffa 100644
--- a/elpa/inflections-20170913.216/inflections-autoloads.el
+++ b/elpa/inflections-20170913.916/inflections-autoloads.el
@@ -3,7 +3,7 @@
 ;;; Code:
 (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
 
-;;;### (autoloads nil "inflections" "inflections.el" (22993 41348
+;;;### (autoloads nil "inflections" "inflections.el" (23392 2167
 ;;;;;;  0 0))
 ;;; Generated autoloads from inflections.el
 
diff --git a/elpa/inflections-20170913.916/inflections-pkg.el b/elpa/inflections-20170913.916/inflections-pkg.el
new file mode 100644
index 0000000..bfd8931
--- /dev/null
+++ b/elpa/inflections-20170913.916/inflections-pkg.el
@@ -0,0 +1,2 @@
+;;; -*- no-byte-compile: t -*-
+(define-package "inflections" "20170913.916" "convert english words between singular and plural" '((cl-lib "0.5") (emacs "24")) :commit "e4f1372cf22e811faca52fc86bdd5d817498a4d8" :keywords '("languages" "tools" "wp") :authors '(("Dmitry Galinsky, Howard Yeh")) :maintainer '("Dmitry Galinsky, Howard Yeh") :url "https://github.com/eschulte/jump.el")
diff --git a/elpa/inflections-20170913.216/inflections.el b/elpa/inflections-20170913.916/inflections.el
similarity index 99%
rename from elpa/inflections-20170913.216/inflections.el
rename to elpa/inflections-20170913.916/inflections.el
index 38f7a41..e0c6b6b 100644
--- a/elpa/inflections-20170913.216/inflections.el
+++ b/elpa/inflections-20170913.916/inflections.el
@@ -4,7 +4,7 @@
 
 ;; Author: Dmitry Galinsky, Howard Yeh
 ;; URL: https://github.com/eschulte/jump.el
-;; Package-Version: 20170913.216
+;; Package-Version: 20170913.916
 ;; Package-Requires: ((cl-lib "0.5") (emacs "24"))
 ;; Version: 1.1
 ;; Created: 2007-11-02
diff --git a/elpa/inflections-20170913.216/inflections.elc b/elpa/inflections-20170913.916/inflections.elc
similarity index 100%
rename from elpa/inflections-20170913.216/inflections.elc
rename to elpa/inflections-20170913.916/inflections.elc
diff --git a/elpa/ivy-20180727.1527/colir.el b/elpa/ivy-20180727.1527/colir.el
new file mode 100644
index 0000000..b872cfc
--- /dev/null
+++ b/elpa/ivy-20180727.1527/colir.el
@@ -0,0 +1,124 @@
+;;; colir.el --- Color blending library -*- lexical-binding: t -*-
+
+;; Copyright (C) 2015-2018  Free Software Foundation, Inc.
+
+;; Author: Oleh Krehel 
+
+;; This file is part of GNU Emacs.
+
+;; This file 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.
+
+;; For a full copy of the GNU General Public License
+;; see .
+
+;;; Commentary:
+
+;; This package solves the problem of adding a face with a background
+;; to text which may already have a background.  In all conflicting
+;; areas, instead of choosing either the original or the new
+;; background face, their blended sum is used.
+;;
+;; The blend mode functions are taken from URL
+;; `http://en.wikipedia.org/wiki/Blend_modes'.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'color)
+
+(defcustom colir-compose-method #'colir-compose-alpha
+  "Select a method to compose two color channels."
+  :group 'ivy
+  :type '(radio
+          (function-item colir-compose-alpha)
+          (function-item colir-compose-overlay)
+          (function-item colir-compose-soft-light)))
+
+(defun colir-compose-soft-light (a b)
+  "Compose A and B channels."
+  (if (< b 0.5)
+      (+ (* 2 a b) (* a a (- 1 b b)))
+    (+ (* 2 a (- 1 b)) (* (sqrt a) (- (* 2 b) 1)))))
+
+(defun colir-compose-overlay (a b)
+  "Compose A and B channels."
+  (if (< a 0.5)
+      (* 2 a b)
+    (- 1 (* 2 (- 1 a) (- 1 b)))))
+
+(defun colir-compose-alpha (a b &optional alpha gamma)
+  "Compose A and B channels.
+Optional argument ALPHA is a number between 0.0 and 1.0 which corresponds
+to the influence of A on the result.  Default value is 0.5.
+Optional argument GAMMA is used for gamma correction.  Default value is 2.2."
+  (setq alpha (or alpha 0.5))
+  (setq gamma (or gamma 2.2))
+  (+ (* (expt a gamma) alpha) (* (expt b gamma) (- 1 alpha))))
+
+(defun colir-blend (c1 c2)
+  "Blend the two colors C1 and C2 using `colir-compose-method'.
+C1 and C2 are triples of floats in [0.0 1.0] range."
+  (apply #'color-rgb-to-hex
+         (cl-mapcar
+          (if (eq (frame-parameter nil 'background-mode) 'dark)
+              ;; this method works nicely for dark themes
+              'colir-compose-soft-light
+            colir-compose-method)
+          c1 c2)))
+
+(defun colir-color-parse (color)
+  "Convert string COLOR to triple of floats in [0.0 1.0]."
+  (if (string-match "#\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{2\\}\\)" color)
+      (mapcar (lambda (v) (/ (string-to-number v 16) 255.0))
+              (list (match-string 1 color) (match-string 2 color) (match-string 3 color)))
+    ;; does not work properly in terminal (maps color to nearest color
+    ;; from available color palette).
+    (color-name-to-rgb color)))
+
+(defun colir--blend-background (start next prevn face object)
+  (let ((background-prev (face-background prevn)))
+    (progn
+      (put-text-property
+       start next 'face
+       (if background-prev
+           (cons `(background-color
+                   . ,(colir-blend
+                       (colir-color-parse background-prev)
+                       (colir-color-parse (face-background face nil t))))
+                 prevn)
+         (list face prevn))
+       object))))
+
+(defun colir-blend-face-background (start end face &optional object)
+  "Append to the face property of the text from START to END the face FACE.
+When the text already has a face with a non-plain background,
+blend it with the background of FACE.
+Optional argument OBJECT is the string or buffer containing the text.
+See also `font-lock-append-text-property'."
+  (let (next prev prevn)
+    (while (/= start end)
+      (setq next (next-single-property-change start 'face object end))
+      (setq prev (get-text-property start 'face object))
+      (setq prevn (if (listp prev)
+                      (cl-find-if #'atom prev)
+                    prev))
+      (cond
+        ((or (keywordp (car-safe prev)) (consp (car-safe prev)))
+         (put-text-property start next 'face (cons face prev) object))
+        ((facep prevn)
+         (colir--blend-background start next prevn face object))
+        (t
+         (put-text-property start next 'face face object)))
+      (setq start next))))
+
+(provide 'colir)
+
+;;; colir.el ends here
diff --git a/elpa/ivy-20180727.1527/colir.elc b/elpa/ivy-20180727.1527/colir.elc
new file mode 100644
index 0000000..1369e83
Binary files /dev/null and b/elpa/ivy-20180727.1527/colir.elc differ
diff --git a/elpa/ivy-20180727.1527/ivy-autoloads.el b/elpa/ivy-20180727.1527/ivy-autoloads.el
new file mode 100644
index 0000000..fe056e0
--- /dev/null
+++ b/elpa/ivy-20180727.1527/ivy-autoloads.el
@@ -0,0 +1,135 @@
+;;; ivy-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
+
+;;;### (autoloads nil "ivy" "ivy.el" (23391 65521 0 0))
+;;; Generated autoloads from ivy.el
+
+(autoload 'ivy-resume "ivy" "\
+Resume the last completion session.
+
+\(fn)" t nil)
+
+(autoload 'ivy-read "ivy" "\
+Read a string in the minibuffer, with completion.
+
+PROMPT is a format string, normally ending in a colon and a
+space; %d anywhere in the string is replaced by the current
+number of matching candidates.  For the literal % character,
+escape it with %%. See also `ivy-count-format'.
+
+COLLECTION is either a list of strings, a function, an alist, or
+a hash table.
+
+PREDICATE is applied to filter out the COLLECTION immediately.
+This argument is for `completing-read' compat.
+
+When REQUIRE-MATCH is non-nil, only members of COLLECTION can be
+selected, i.e. custom text.
+
+If INITIAL-INPUT is not nil, then insert that input in the
+minibuffer initially.
+
+HISTORY is a name of a variable to hold the completion session
+history.
+
+KEYMAP is composed with `ivy-minibuffer-map'.
+
+If PRESELECT is not nil, then select the corresponding candidate
+out of the ones that match the INITIAL-INPUT.
+
+DEF is for compatibility with `completing-read'.
+
+UPDATE-FN is called each time the current candidate(s) is changed.
+
+When SORT is t, use `ivy-sort-functions-alist' for sorting.
+
+ACTION is a lambda function to call after selecting a result.  It
+takes a single string argument.
+
+UNWIND is a lambda function to call before exiting.
+
+RE-BUILDER is a lambda function to call to transform text into a
+regex pattern.
+
+MATCHER is to override matching.
+
+DYNAMIC-COLLECTION is a boolean to specify if the list of
+candidates is updated after each input by calling COLLECTION.
+
+CALLER is a symbol to uniquely identify the caller to `ivy-read'.
+It is used, along with COLLECTION, to determine which
+customizations apply to the current completion session.
+
+\(fn PROMPT COLLECTION &key PREDICATE REQUIRE-MATCH INITIAL-INPUT HISTORY PRESELECT DEF KEYMAP UPDATE-FN SORT ACTION UNWIND RE-BUILDER MATCHER DYNAMIC-COLLECTION CALLER)" nil nil)
+
+(autoload 'ivy-completing-read "ivy" "\
+Read a string in the minibuffer, with completion.
+
+This interface conforms to `completing-read' and can be used for
+`completing-read-function'.
+
+PROMPT is a string that normally ends in a colon and a space.
+COLLECTION is either a list of strings, an alist, an obarray, or a hash table.
+PREDICATE limits completion to a subset of COLLECTION.
+REQUIRE-MATCH is a boolean value.  See `completing-read'.
+INITIAL-INPUT is a string inserted into the minibuffer initially.
+HISTORY is a list of previously selected inputs.
+DEF is the default value.
+INHERIT-INPUT-METHOD is currently ignored.
+
+\(fn PROMPT COLLECTION &optional PREDICATE REQUIRE-MATCH INITIAL-INPUT HISTORY DEF INHERIT-INPUT-METHOD)" nil nil)
+
+(defvar ivy-mode nil "\
+Non-nil if Ivy mode is enabled.
+See the `ivy-mode' command
+for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `ivy-mode'.")
+
+(custom-autoload 'ivy-mode "ivy" nil)
+
+(autoload 'ivy-mode "ivy" "\
+Toggle Ivy mode on or off.
+Turn Ivy mode on if ARG is positive, off otherwise.
+Turning on Ivy mode sets `completing-read-function' to
+`ivy-completing-read'.
+
+Global bindings:
+\\{ivy-mode-map}
+
+Minibuffer bindings:
+\\{ivy-minibuffer-map}
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'ivy-switch-buffer "ivy" "\
+Switch to another buffer.
+
+\(fn)" t nil)
+
+(autoload 'ivy-switch-view "ivy" "\
+Switch to one of the window views stored by `ivy-push-view'.
+
+\(fn)" t nil)
+
+(autoload 'ivy-switch-buffer-other-window "ivy" "\
+Switch to another buffer in another window.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads nil nil ("colir.el" "ivy-overlay.el" "ivy-pkg.el")
+;;;;;;  (23391 65521 0 0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; End:
+;;; ivy-autoloads.el ends here
diff --git a/elpa/ivy-20180727.1527/ivy-help.org b/elpa/ivy-20180727.1527/ivy-help.org
new file mode 100644
index 0000000..1eb71c7
--- /dev/null
+++ b/elpa/ivy-20180727.1527/ivy-help.org
@@ -0,0 +1,138 @@
+* Ivy Generic Help
+
+=ivy= is an Emacs incremental completion framework.
+
+- Narrow the list by typing some pattern,
+- Multiple patterns are allowed by separating with a space,
+- Select with ~C-n~ and ~C-p~, choose with ~RET~.
+
+** Help
+
+- ~C-h m~ :: Pop to this generic help buffer.
+
+** Basic Operations
+*** Key bindings for navigation
+
+- ~C-n~ (=ivy-next-line=) :: next candidate.
+- ~C-p~ (=ivy-previous-line=) :: previous candidate.
+- ~C-v~ (=ivy-scroll-up-command=) :: next page.
+- ~M-v~ (=ivy-scroll-down-command=) :: previous page.
+- ~M-<~ (=ivy-beginning-of-buffer=) :: first candidate.
+- ~M->~ (=ivy-end-of-buffer=) :: last candidate.
+
+*** Key bindings for single selection
+
+When selecting a candidate, an action is called on it. You can think
+of an action as a function that takes the selected candidate as an
+argument and does something with it.
+
+Ivy can offer several actions from which to choose. This can be
+independently composed with whether you want to end completion when
+the action is called. Depending on this, the short term is either
+"calling an action" or "exiting with action".
+
+~C-m~ or ~RET~ (=ivy-done=) - exit with the current action.
+
+~M-o~ (=ivy-dispatching-done=) - select an action and exit with it.
+
+~C-j~ (=ivy-alt-done=) - when the candidate is a directory, enter
+it. Otherwise, exit with the current action.
+
+~TAB~ (=ivy-partial-or-done=) - attempt partial completion, extending
+the current input as much as possible. ~TAB TAB~ is the same as ~C-j~.
+
+~C-M-j~ (=ivy-immediate-done=) - exit with the current action, calling
+it on the /current input/ instead of the current candidate. This is
+useful especially when creating new files or directories - often the
+input will match an existing file, which you don't want to select.
+
+~C-'~ (=ivy-avy=) - select a candidate from the current page with avy
+and exit with the current action.
+
+** Advanced Operations
+*** Key bindings for multiple selection
+
+For repeatedly applying multiple actions or acting on multiple
+candidates, Ivy does not close the minibuffer between commands. It
+keeps the minibuffer open for applying subsequent actions.
+
+Adding an extra meta key to the normal key chord invokes the special
+version of the regular commands that enables applying multiple
+actions.
+
+~C-M-m~ (=ivy-call=) is the non-exiting version of ~C-m~ (=ivy-done=).
+
+~C-M-n~ (=ivy-next-line-and-call=) combines ~C-n~ and ~C-M-m~.
+
+~C-M-p~ (=ivy-previous-line-and-call=) combines ~C-p~ and ~C-M-m~.
+
+~C-M-o~ (=ivy-dispatching-call=) is a non-exiting version of ~M-o~
+(=ivy-dispatching-done=).
+
+*** Key bindings that alter the minibuffer input
+
+~M-n~ (=ivy-next-history-element=) select the next history element or
+symbol/URL at point.
+
+~M-p~ (=ivy-previous-history-element=) select the previous history
+element.
+
+~C-r~ (=ivy-reverse-i-search=) start a recursive completion session to
+select a history element.
+
+~M-i~ (=ivy-insert-current=) insert the current candidate into the
+minibuffer. Useful for copying and renaming files, for example: ~M-i~
+to insert the original file name string, edit it, and then ~C-m~ to
+complete the renaming.
+
+~M-j~ (=ivy-yank-word=) insert the sub-word at point into the
+minibuffer.
+
+~S-SPC~ (=ivy-restrict-to-matches=) deletes the current input, and
+resets the candidates list to the currently restricted matches. This
+is how Ivy provides narrowing in successive tiers.
+
+*** Other key bindings
+
+~M-w~ (=ivy-kill-ring-save=) copies the selected candidates to the
+kill ring; when the region is active, copies the active region.
+
+*** Saving the current completion session to a buffer
+
+~C-c C-o~ (=ivy-occur=) saves the current candidates to a new buffer;
+the list is active in the new buffer.
+
+~RET~ or ~mouse-1~ in the new buffer calls the appropriate action on
+the selected candidate.
+
+Ivy has no limit on the number of active buffers like these.
+
+Ivy takes care of making these buffer names unique. It applies
+descriptive names, for example: =*ivy-occur counsel-describe-variable
+"function$*=.
+
+*** Global key bindings
+
+=ivy-resume= recalls the state of the completion session just before
+its last exit. Useful after an accidental ~C-m~ (=ivy-done=).
+Recommended global binding: ~C-c C-r~.
+
+*** Hydra in the minibuffer
+
+~C-o~ (=hydra-ivy/body=) invokes Hydra menus with key shortcuts.
+
+When in Hydra, ~C-o~ or ~i~ resumes editing.
+
+Hydra reduces key strokes, for example: ~C-n C-n C-n C-n~ is ~C-o
+jjjj~ in Hydra. Besides certain shorter keys, Hydra shows useful info
+such as case folding and the current action.
+
+Additionally, here are the keys that are otherwise not bound:
+
+- ~<~ and ~>~ adjust the height of the minibuffer.
+- ~c~ (=ivy-toggle-calling=) - toggle calling the current action each
+  time a different candidate is selected.
+- ~m~ (=ivy-rotate-preferred-builders=) - rotate regex matcher.
+- ~w~ and ~s~ scroll the actions list.
+
+Minibuffer editing is disabled when Hydra is active.
diff --git a/elpa/ivy-20180727.1527/ivy-overlay.el b/elpa/ivy-20180727.1527/ivy-overlay.el
new file mode 100644
index 0000000..bf0aa15
--- /dev/null
+++ b/elpa/ivy-20180727.1527/ivy-overlay.el
@@ -0,0 +1,139 @@
+;;; ivy-overlay.el --- Overlay display functions for Ivy  -*- lexical-binding: t -*-
+
+;; Copyright (C) 2016-2018  Free Software Foundation, Inc.
+
+;; Author: Oleh Krehel 
+;; Keywords: convenience
+
+;; 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 .
+
+;;; Commentary:
+
+;; This package allows to setup Ivy's completion at point to actually
+;; show the candidates and the input at point, instead of in the
+;; minibuffer.
+
+;;; Code:
+
+(defface ivy-cursor
+  '((t (:background "black"
+        :foreground "white")))
+  "Cursor face for inline completion."
+  :group 'ivy-faces)
+
+(defvar ivy--old-cursor-type t)
+
+(defvar ivy-overlay-at nil
+  "Overlay variable for `ivy-display-function-overlay'.")
+
+(declare-function ivy--truncate-string "ivy")
+
+(defun ivy-left-pad (str width)
+  "Return STR, but with each line indented by WIDTH spaces.
+Lines are truncated to the window width."
+  (let ((padding (make-string width ?\s)))
+    (mapconcat (lambda (x)
+                 (ivy--truncate-string (concat padding x)
+                                       (1- (+ (window-width)
+                                              (window-hscroll)))))
+               (split-string str "\n")
+               "\n")))
+
+(defun ivy-overlay-cleanup ()
+  "Clean up after `ivy-display-function-overlay'."
+  (when (overlayp ivy-overlay-at)
+    (delete-overlay ivy-overlay-at)
+    (setq ivy-overlay-at nil))
+  (unless cursor-type
+    (setq cursor-type ivy--old-cursor-type))
+  (when (fboundp 'company-abort)
+    (company-abort)))
+
+(defun ivy-overlay-show-after (str)
+  "Display STR in an overlay at point.
+
+First, fill each line of STR with spaces to the current column.
+Then attach the overlay the character before point."
+  (if ivy-overlay-at
+      (progn
+        (move-overlay ivy-overlay-at (1- (point)) (line-end-position))
+        (overlay-put ivy-overlay-at 'invisible nil))
+    (setq ivy-overlay-at (make-overlay (1- (point)) (line-end-position)))
+    (overlay-put ivy-overlay-at 'priority 9999))
+  (overlay-put ivy-overlay-at 'display str)
+  (overlay-put ivy-overlay-at 'after-string ""))
+
+(declare-function org-current-level "org")
+(defvar org-indent-indentation-per-level)
+(defvar ivy-height)
+(defvar ivy-last)
+(defvar ivy-text)
+(defvar ivy-completion-beg)
+(declare-function ivy-add-face-text-property "ivy")
+(declare-function ivy--get-window "ivy")
+(declare-function ivy-state-current "ivy")
+(declare-function ivy-state-window "ivy")
+
+(defun ivy-overlay-impossible-p (str)
+  (or
+   (<= (window-height) (+ ivy-height 3))
+   (= (point) (point-min))
+   (< (- (+ (window-width) (window-hscroll)) (current-column))
+      (apply #'max
+             (mapcar #'string-width
+                     (split-string str "\n"))))))
+
+(defun ivy-display-function-overlay (str)
+  "Called from the minibuffer, display STR in an overlay in Ivy window.
+Hide the minibuffer contents and cursor."
+  (if (save-selected-window
+        (select-window (ivy-state-window ivy-last))
+        (ivy-overlay-impossible-p str))
+      (let ((buffer-undo-list t))
+        (save-excursion
+          (forward-line 1)
+          (insert str)))
+    (ivy-add-face-text-property (minibuffer-prompt-end) (point-max)
+                                '(:foreground "white"))
+    (let ((cursor-pos (1+ (- (point) (minibuffer-prompt-end))))
+          (ivy-window (ivy--get-window ivy-last)))
+      (setq cursor-type nil)
+      (with-selected-window ivy-window
+        (when cursor-type
+          (setq ivy--old-cursor-type cursor-type))
+        (setq cursor-type nil)
+        (let ((overlay-str
+               (concat
+                (buffer-substring (max 1 (1- (point))) (point))
+                ivy-text
+                (if (eolp)
+                    " "
+                  "")
+                (buffer-substring (point) (line-end-position))
+                (ivy-left-pad
+                 str
+                 (+ (if (and (eq major-mode 'org-mode)
+                             (bound-and-true-p org-indent-mode))
+                        (* org-indent-indentation-per-level (org-current-level))
+                      0)
+                    (save-excursion
+                      (goto-char ivy-completion-beg)
+                      (current-column)))))))
+          (ivy-add-face-text-property cursor-pos (1+ cursor-pos)
+                                      'ivy-cursor overlay-str t)
+          (ivy-overlay-show-after overlay-str))))))
+
+(provide 'ivy-overlay)
+
+;;; ivy-overlay.el ends here
diff --git a/elpa/ivy-20180727.1527/ivy-overlay.elc b/elpa/ivy-20180727.1527/ivy-overlay.elc
new file mode 100644
index 0000000..4aae9d7
Binary files /dev/null and b/elpa/ivy-20180727.1527/ivy-overlay.elc differ
diff --git a/elpa/ivy-20180727.1527/ivy-pkg.el b/elpa/ivy-20180727.1527/ivy-pkg.el
new file mode 100644
index 0000000..16fbc35
--- /dev/null
+++ b/elpa/ivy-20180727.1527/ivy-pkg.el
@@ -0,0 +1,12 @@
+(define-package "ivy" "20180727.1527" "Incremental Vertical completYon"
+  '((emacs "24.1"))
+  :keywords
+  '("matching")
+  :authors
+  '(("Oleh Krehel" . "ohwoeowho@gmail.com"))
+  :maintainer
+  '("Oleh Krehel" . "ohwoeowho@gmail.com")
+  :url "https://github.com/abo-abo/swiper")
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/elpa/ivy-20180727.1527/ivy.el b/elpa/ivy-20180727.1527/ivy.el
new file mode 100644
index 0000000..91644c9
--- /dev/null
+++ b/elpa/ivy-20180727.1527/ivy.el
@@ -0,0 +1,4289 @@
+;;; ivy.el --- Incremental Vertical completYon -*- lexical-binding: t -*-
+
+;; Copyright (C) 2015-2018  Free Software Foundation, Inc.
+
+;; Author: Oleh Krehel 
+;; URL: https://github.com/abo-abo/swiper
+;; Version: 0.10.0
+;; Package-Requires: ((emacs "24.1"))
+;; Keywords: matching
+
+;; This file is part of GNU Emacs.
+
+;; This file 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.
+
+;; For a full copy of the GNU General Public License
+;; see .
+
+;;; Commentary:
+
+;; This package provides `ivy-read' as an alternative to
+;; `completing-read' and similar functions.
+;;
+;; There's no intricate code to determine the best candidate.
+;; Instead, the user can navigate to it with `ivy-next-line' and
+;; `ivy-previous-line'.
+;;
+;; The matching is done by splitting the input text by spaces and
+;; re-building it into a regex.
+;; So "for example" is transformed into "\\(for\\).*\\(example\\)".
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ffap)
+(require 'ivy-overlay)
+(require 'colir)
+
+;;* Customization
+(defgroup ivy nil
+  "Incremental vertical completion."
+  :group 'convenience)
+
+(defgroup ivy-faces nil
+  "Font-lock faces for `ivy'."
+  :group 'ivy
+  :group 'faces)
+
+(defface ivy-current-match
+  '((((class color) (background light))
+     :background "#1a4b77" :foreground "white")
+    (((class color) (background dark))
+     :background "#65a7e2" :foreground "black"))
+  "Face used by Ivy for highlighting the current match.")
+
+(defface ivy-minibuffer-match-highlight
+  '((t :inherit highlight))
+  "Face used by Ivy for highlighting the match under the cursor.")
+
+(defface ivy-minibuffer-match-face-1
+  '((((class color) (background light))
+     :background "#d3d3d3")
+    (((class color) (background dark))
+     :background "#555555"))
+  "The background face for `ivy' minibuffer matches.")
+
+(defface ivy-minibuffer-match-face-2
+  '((((class color) (background light))
+     :background "#e99ce8" :weight bold)
+    (((class color) (background dark))
+     :background "#777777" :weight bold))
+  "Face for `ivy' minibuffer matches numbered 1 modulo 3.")
+
+(defface ivy-minibuffer-match-face-3
+  '((((class color) (background light))
+     :background "#bbbbff" :weight bold)
+    (((class color) (background dark))
+     :background "#7777ff" :weight bold))
+  "Face for `ivy' minibuffer matches numbered 2 modulo 3.")
+
+(defface ivy-minibuffer-match-face-4
+  '((((class color) (background light))
+     :background "#ffbbff" :weight bold)
+    (((class color) (background dark))
+     :background "#8a498a" :weight bold))
+  "Face for `ivy' minibuffer matches numbered 3 modulo 3.")
+
+(defface ivy-confirm-face
+  '((t :foreground "ForestGreen" :inherit minibuffer-prompt))
+  "Face used by Ivy for a confirmation prompt.")
+
+(defface ivy-match-required-face
+  '((t :foreground "red" :inherit minibuffer-prompt))
+  "Face used by Ivy for a match required prompt.")
+
+(defface ivy-subdir
+  '((t :inherit dired-directory))
+  "Face used by Ivy for highlighting subdirs in the alternatives.")
+
+(defface ivy-modified-buffer
+  '((t :inherit default))
+  "Face used by Ivy for highlighting modified file visiting buffers.")
+
+(defface ivy-remote
+  '((((class color) (background light))
+     :foreground "#110099")
+    (((class color) (background dark))
+     :foreground "#7B6BFF"))
+  "Face used by Ivy for highlighting remotes in the alternatives.")
+
+(defface ivy-virtual
+  '((t :inherit font-lock-builtin-face))
+  "Face used by Ivy for matching virtual buffer names.")
+
+(defface ivy-action
+  '((t :inherit font-lock-builtin-face))
+  "Face used by Ivy for displaying keys in `ivy-read-action'.")
+
+(defface ivy-highlight-face
+  '((t :inherit highlight))
+  "Face used by Ivy to highlight certain candidates.")
+
+(defface ivy-prompt-match
+  '((t :inherit ivy-current-match))
+  "Face used by Ivy for highlighting the selected prompt line.")
+
+(setcdr (assoc load-file-name custom-current-group-alist) 'ivy)
+
+(defcustom ivy-height 10
+  "Number of lines for the minibuffer window.
+
+See also `ivy-height-alist'."
+  :type 'integer)
+
+(defcustom ivy-count-format "%-4d "
+  "The style to use for displaying the current candidate count for `ivy-read'.
+Set this to \"\" to suppress the count visibility.
+Set this to \"(%d/%d) \" to display both the index and the count."
+  :type '(choice
+          (const :tag "Count disabled" "")
+          (const :tag "Count matches" "%-4d ")
+          (const :tag "Count matches and show current match" "(%d/%d) ")
+          string))
+
+(defcustom ivy-add-newline-after-prompt nil
+  "When non-nil, add a newline after the `ivy-read' prompt."
+  :type 'boolean)
+
+(defcustom ivy-wrap nil
+  "When non-nil, wrap around after the first and the last candidate."
+  :type 'boolean)
+
+(defcustom ivy-display-style (and (fboundp 'add-face-text-property) 'fancy)
+  "The style for formatting the minibuffer.
+
+By default, the matched strings are copied as is.
+
+The fancy display style highlights matching parts of the regexp,
+a behavior similar to `swiper'.
+
+This setting depends on `add-face-text-property' - a C function
+available since Emacs 24.4.  Fancy style will render poorly in
+earlier versions of Emacs."
+  :type '(choice
+          (const :tag "Plain" nil)
+          (const :tag "Fancy" fancy)))
+
+(defcustom ivy-on-del-error-function #'minibuffer-keyboard-quit
+  "Function to call when deletion fails during completion.
+The usual reason for `ivy-backward-delete-char' to fail is when
+there is no text left to delete, i.e., when it is called at the
+beginning of the minibuffer.
+The default setting provides a quick exit from completion."
+  :type '(choice
+          (const :tag "Exit completion" minibuffer-keyboard-quit)
+          (const :tag "Do nothing" ignore)
+          (function :tag "Custom function")))
+
+(defcustom ivy-extra-directories '("../" "./")
+  "Add this to the front of the list when completing file names.
+Only \"./\" and \"../\" apply here.  They appear in reverse order."
+  :type '(repeat :tag "Dirs"
+          (choice
+           (const :tag "Parent Directory" "../")
+           (const :tag "Current Directory" "./"))))
+
+(defcustom ivy-use-virtual-buffers nil
+  "When non-nil, add recent files and bookmarks to `ivy-switch-buffer'."
+  :type 'boolean)
+
+(defcustom ivy-display-function nil
+  "Determine where to display candidates.
+When nil (the default), candidates are shown in the minibuffer.
+Otherwise, this can be set to a function which takes a string
+argument comprising the current matching candidates and displays
+it somewhere.
+
+This user option acts as a global default for Ivy-based
+completion commands.  You can customize the display function on a
+per-command basis via `ivy-display-functions-alist', which see.
+See also URL
+`https://github.com/abo-abo/swiper/wiki/ivy-display-function'."
+  :type '(choice
+          (const :tag "Minibuffer" nil)
+          (const :tag "LV" ivy-display-function-lv)
+          (const :tag "Popup" ivy-display-function-popup)
+          (const :tag "Overlay" ivy-display-function-overlay)))
+
+(defvar ivy-display-functions-props
+  '((ivy-display-function-overlay :cleanup ivy-overlay-cleanup))
+  "Map Ivy display functions to their property lists.
+Examples of properties include associated `:cleanup' functions.")
+
+(defvar ivy-display-functions-alist
+  '((ivy-completion-in-region . ivy-display-function-overlay))
+  "An alist for customizing `ivy-display-function'.")
+
+(defvar ivy-completing-read-dynamic-collection nil
+  "Run `ivy-completing-read' with `:dynamic-collection t`.")
+
+(defcustom ivy-completing-read-handlers-alist
+  '((tmm-menubar . completing-read-default)
+    (tmm-shortcut . completing-read-default)
+    (bbdb-create . ivy-completing-read-with-empty-string-def)
+    (auto-insert . ivy-completing-read-with-empty-string-def)
+    (Info-on-current-buffer . ivy-completing-read-with-empty-string-def)
+    (Info-follow-reference . ivy-completing-read-with-empty-string-def)
+    (Info-menu . ivy-completing-read-with-empty-string-def)
+    (Info-index . ivy-completing-read-with-empty-string-def)
+    (Info-virtual-index . ivy-completing-read-with-empty-string-def)
+    (info-display-manual . ivy-completing-read-with-empty-string-def)
+    (webjump . ivy-completing-read-with-empty-string-def))
+  "An alist of handlers to replace `completing-read' in `ivy-mode'."
+  :type '(alist :key-type function :value-type function))
+
+(defcustom ivy-height-alist nil
+  "An alist to customize `ivy-height'.
+
+It is a list of (CALLER . HEIGHT).  CALLER is a caller of
+`ivy-read' and HEIGHT is the number of lines displayed."
+  :type '(alist :key-type function :value-type integer))
+
+(defvar ivy-completing-read-ignore-handlers-depth -1
+  "Used to avoid infinite recursion.
+
+If `(minibuffer-depth)' equals this, `ivy-completing-read' will
+act as if `ivy-completing-read-handlers-alist' is empty.")
+
+(defvar ivy-highlight-grep-commands nil
+  "List of counsel grep-like commands.")
+
+(defvar ivy--actions-list nil
+  "A list of extra actions per command.")
+
+(defun ivy-set-actions (cmd actions)
+  "Set CMD extra exit points to ACTIONS."
+  (setq ivy--actions-list
+        (plist-put ivy--actions-list cmd actions)))
+
+(defun ivy-add-actions (cmd actions)
+  "Add extra exit points ACTIONS to CMD.
+Existing exit points of CMD are overwritten by those in
+ACTIONS that have the same key."
+  (setq ivy--actions-list
+        (plist-put ivy--actions-list cmd
+                   (cl-delete-duplicates
+                    (append (plist-get ivy--actions-list cmd) actions)
+                    :key #'car :test #'equal))))
+
+(defvar ivy--prompts-list nil)
+
+(defun ivy-set-prompt (caller prompt-fn)
+  "Associate CALLER with PROMPT-FN.
+PROMPT-FN is a function of no arguments that returns a prompt string."
+  (setq ivy--prompts-list
+        (plist-put ivy--prompts-list caller prompt-fn)))
+
+(defvar ivy--display-transformers-list nil
+  "A list of str->str transformers per command.")
+
+(defun ivy-set-display-transformer (cmd transformer)
+  "Set CMD a displayed candidate TRANSFORMER.
+
+It's a lambda that takes a string one of the candidates in the
+collection and returns a string for display, the same candidate
+plus some extra information.
+
+This lambda is called only on the `ivy-height' candidates that
+are about to be displayed, not on the whole collection."
+  (setq ivy--display-transformers-list
+        (plist-put ivy--display-transformers-list cmd transformer)))
+
+(defvar ivy--sources-list nil
+  "A list of extra sources per command.")
+
+(defun ivy-set-sources (cmd sources)
+  "Attach to CMD a list of extra SOURCES.
+
+Each static source is a function that takes no argument and
+returns a list of strings.
+
+The (original-source) determines the position of the original
+dynamic source.
+
+Extra dynamic sources aren't supported yet.
+
+Example:
+
+    (defun small-recentf ()
+      (cl-subseq recentf-list 0 20))
+
+    (ivy-set-sources
+     'counsel-locate
+     '((small-recentf)
+       (original-source)))"
+  (setq ivy--sources-list
+        (plist-put ivy--sources-list cmd sources)))
+
+(defvar ivy-current-prefix-arg nil
+  "Prefix arg to pass to actions.
+This is a global variable that is set by ivy functions for use in
+action functions.")
+
+;;* Keymap
+(require 'delsel)
+(defvar ivy-minibuffer-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "C-m") 'ivy-done)
+    (define-key map [down-mouse-1] 'ignore)
+    (define-key map [mouse-1] 'ivy-mouse-done)
+    (define-key map [mouse-3] 'ivy-mouse-dispatching-done)
+    (define-key map (kbd "C-M-m") 'ivy-call)
+    (define-key map (kbd "C-j") 'ivy-alt-done)
+    (define-key map (kbd "C-M-j") 'ivy-immediate-done)
+    (define-key map (kbd "TAB") 'ivy-partial-or-done)
+    (define-key map [remap next-line] 'ivy-next-line)
+    (define-key map [remap previous-line] 'ivy-previous-line)
+    (define-key map (kbd "C-s") 'ivy-next-line-or-history)
+    (define-key map (kbd "C-r") 'ivy-reverse-i-search)
+    (define-key map (kbd "SPC") 'self-insert-command)
+    (define-key map [remap delete-backward-char] 'ivy-backward-delete-char)
+    (define-key map [remap backward-delete-char-untabify] 'ivy-backward-delete-char)
+    (define-key map [remap backward-kill-word] 'ivy-backward-kill-word)
+    (define-key map [remap delete-char] 'ivy-delete-char)
+    (define-key map [remap forward-char] 'ivy-forward-char)
+    (define-key map (kbd "") 'ivy-forward-char)
+    (define-key map [remap kill-word] 'ivy-kill-word)
+    (define-key map [remap beginning-of-buffer] 'ivy-beginning-of-buffer)
+    (define-key map [remap end-of-buffer] 'ivy-end-of-buffer)
+    (define-key map (kbd "M-n") 'ivy-next-history-element)
+    (define-key map (kbd "M-p") 'ivy-previous-history-element)
+    (define-key map (kbd "C-g") 'minibuffer-keyboard-quit)
+    (define-key map [remap scroll-up-command] 'ivy-scroll-up-command)
+    (define-key map [remap scroll-down-command] 'ivy-scroll-down-command)
+    (define-key map (kbd "") 'ivy-scroll-up-command)
+    (define-key map (kbd "") 'ivy-scroll-down-command)
+    (define-key map (kbd "C-v") 'ivy-scroll-up-command)
+    (define-key map (kbd "M-v") 'ivy-scroll-down-command)
+    (define-key map (kbd "C-M-n") 'ivy-next-line-and-call)
+    (define-key map (kbd "C-M-p") 'ivy-previous-line-and-call)
+    (define-key map (kbd "M-r") 'ivy-toggle-regexp-quote)
+    (define-key map (kbd "M-j") 'ivy-yank-word)
+    (define-key map (kbd "M-i") 'ivy-insert-current)
+    (define-key map (kbd "C-o") 'hydra-ivy/body)
+    (define-key map (kbd "M-o") 'ivy-dispatching-done)
+    (define-key map (kbd "C-M-o") 'ivy-dispatching-call)
+    (define-key map [remap kill-line] 'ivy-kill-line)
+    (define-key map [remap kill-whole-line] 'ivy-kill-whole-line)
+    (define-key map (kbd "S-SPC") 'ivy-restrict-to-matches)
+    (define-key map [remap kill-ring-save] 'ivy-kill-ring-save)
+    (define-key map (kbd "C-'") 'ivy-avy)
+    (define-key map (kbd "C-M-a") 'ivy-read-action)
+    (define-key map (kbd "C-c C-o") 'ivy-occur)
+    (define-key map (kbd "C-c C-a") 'ivy-toggle-ignore)
+    (define-key map (kbd "C-c C-s") 'ivy-rotate-sort)
+    (define-key map [remap describe-mode] 'ivy-help)
+    map)
+  "Keymap used in the minibuffer.")
+(autoload 'hydra-ivy/body "ivy-hydra" "" t)
+
+(defvar ivy-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [remap switch-to-buffer]
+      'ivy-switch-buffer)
+    (define-key map [remap switch-to-buffer-other-window]
+      'ivy-switch-buffer-other-window)
+    map)
+  "Keymap for `ivy-mode'.")
+
+;;* Globals
+(cl-defstruct ivy-state
+  prompt collection
+  predicate require-match initial-input
+  history preselect keymap update-fn sort
+  ;; The frame in which `ivy-read' was called
+  frame
+  ;; The window in which `ivy-read' was called
+  window
+  ;; The buffer in which `ivy-read' was called
+  buffer
+  ;; The value of `ivy-text' to be used by `ivy-occur'
+  text
+  action
+  unwind
+  re-builder
+  matcher
+  ;; When this is non-nil, call it for each input change to get new candidates
+  dynamic-collection
+  ;; A lambda that transforms candidates only for display
+  display-transformer-fn
+  directory
+  caller
+  current
+  def)
+
+(defvar ivy-last (make-ivy-state)
+  "The last parameters passed to `ivy-read'.
+
+This should eventually become a stack so that you could use
+`ivy-read' recursively.")
+
+(defvar ivy-recursive-last nil)
+
+(defvar ivy-recursive-restore t
+  "When non-nil, restore the above state when exiting the minibuffer.
+This variable is let-bound to nil by functions that take care of
+the restoring themselves.")
+
+(defsubst ivy-set-action (action)
+  "Set the current `ivy-last' field to ACTION."
+  (setf (ivy-state-action ivy-last) action))
+
+(defun ivy-thing-at-point ()
+  "Return a string that corresponds to the current thing at point."
+  (substring-no-properties
+   (or
+    (thing-at-point 'url)
+    (and (eq (ivy-state-collection ivy-last) 'read-file-name-internal)
+         (let ((inhibit-message t))
+           (ignore-errors
+             (ffap-file-at-point))))
+    (let (s)
+      (cond ((stringp (setq s (thing-at-point 'symbol)))
+             (if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)
+                 (match-string 1 s)
+               s))
+            ((looking-at "(+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>")
+             (match-string-no-properties 1))
+            (t
+             ""))))))
+
+(defvar ivy-history nil
+  "History list of candidates entered in the minibuffer.
+
+Maximum length of the history list is determined by the value
+of `history-length'.")
+
+(defvar ivy--directory nil
+  "Current directory when completing file names.")
+
+(defvar ivy--length 0
+  "Store the amount of viable candidates.")
+
+(defvar ivy-text ""
+  "Store the user's string as it is typed in.")
+
+(defvar ivy--index 0
+  "Store the index of the current candidate.")
+
+(defvar ivy--window-index 0
+  "Store the index of the current candidate in the minibuffer window.
+
+This means it's between 0 and `ivy-height'.")
+
+(defvar ivy-exit nil
+  "Store `done' if the completion was successfully selected.
+Otherwise, store nil.")
+
+(defvar ivy--all-candidates nil
+  "Store the candidates passed to `ivy-read'.")
+
+(defvar ivy--extra-candidates '((original-source))
+  "Store candidates added by the extra sources.
+
+This is an internal-use alist.  Each key is a function name, or
+original-source (which represents where the current dynamic
+candidates should go).
+
+Each value is an evaluation of the function, in case of static
+sources.  These values will subsequently be filtered on `ivy-text'.
+
+This variable is set by `ivy-read' and used by `ivy--set-candidates'.")
+
+(defcustom ivy-use-ignore-default t
+  "The default policy for user-configured candidate filtering."
+  :type '(choice
+          (const :tag "Ignore ignored always" always)
+          (const :tag "Ignore ignored when others exist" t)
+          (const :tag "Don't ignore" nil)))
+
+(defvar ivy-use-ignore t
+  "Store policy for user-configured candidate filtering.
+This may be changed dynamically by `ivy-toggle-ignore'.
+Use `ivy-use-ignore-default' for a permanent configuration.")
+
+(defvar ivy--default nil
+  "Default initial input.")
+
+(defvar ivy--prompt nil
+  "Store the format-style prompt.
+When non-nil, it should contain at least one %d.")
+
+(defvar ivy--prompt-extra ""
+  "Temporary modifications to the prompt.")
+
+(defvar ivy--old-re nil
+  "Store the old regexp.
+Either a string or a list for `ivy-re-match'.")
+
+(defvar ivy--old-cands nil
+  "Store the candidates matched by `ivy--old-re'.")
+
+(defvar ivy--regex-function 'ivy--regex
+  "Current function for building a regex.")
+
+(defvar ivy--highlight-function 'ivy--highlight-default
+  "Current function for formatting the candidates.")
+
+(defvar ivy--subexps 0
+  "Number of groups in the current `ivy--regex'.")
+
+(defvar ivy--full-length nil
+  "The total amount of candidates when :dynamic-collection is non-nil.")
+
+(defvar ivy--old-text ""
+  "Store old `ivy-text' for dynamic completion.")
+
+(defcustom ivy-case-fold-search-default
+  (if search-upper-case
+      'auto
+    case-fold-search)
+  "The default value for `case-fold-search' in Ivy operations.
+The special value `auto' means case folding is performed so long
+as the entire input string comprises lower-case characters.  This
+corresponds to the default behaviour of most Emacs search
+functionality, e.g. as seen in `isearch'."
+  :link '(info-link "(emacs)Lax Search")
+  :type '(choice
+          (const :tag "Auto" auto)
+          (const :tag "Always" t)
+          (const :tag "Never" nil)))
+
+(defvar ivy-case-fold-search ivy-case-fold-search-default
+  "Store the current overriding `case-fold-search'.")
+
+(defun ivy--case-fold-p (string)
+  "Return nil if STRING should be matched case-sensitively."
+  (if (eq ivy-case-fold-search 'auto)
+      (string= string (downcase string))
+    ivy-case-fold-search))
+
+(defun ivy--case-fold-string= (s1 s2)
+  "Like `string=', but obeys `case-fold-search'."
+  (eq t (compare-strings s1 nil nil s2 nil nil case-fold-search)))
+
+(defvar Info-current-file)
+
+(defun ivy-re-to-str (re)
+  (if (stringp re)
+      re
+    (caar re)))
+
+(eval-and-compile
+  (unless (fboundp 'defvar-local)
+    (defmacro defvar-local (var val &optional docstring)
+      "Define VAR as a buffer-local variable with default value VAL."
+      (declare (debug defvar) (doc-string 3))
+      (list 'progn (list 'defvar var val docstring)
+            (list 'make-variable-buffer-local (list 'quote var)))))
+  (unless (fboundp 'setq-local)
+    (defmacro setq-local (var val)
+      "Set variable VAR to value VAL in current buffer."
+      (list 'set (list 'make-local-variable (list 'quote var)) val))))
+
+(defmacro ivy-quit-and-run (&rest body)
+  "Quit the minibuffer and run BODY afterwards."
+  (declare (indent 0))
+  `(progn
+     (put 'quit 'error-message "")
+     (run-at-time nil nil
+                  (lambda ()
+                    (put 'quit 'error-message "Quit")
+                    (with-demoted-errors "Error: %S"
+                      ,@body)))
+     (abort-recursive-edit)))
+
+(defun ivy-exit-with-action (action)
+  "Quit the minibuffer and call ACTION afterwards."
+  (ivy-set-action
+   `(lambda (x)
+      (funcall ',action x)
+      (ivy-set-action ',(ivy-state-action ivy-last))))
+  (setq ivy-exit 'done)
+  (exit-minibuffer))
+
+(defmacro with-ivy-window (&rest body)
+  "Execute BODY in the window from which `ivy-read' was called."
+  (declare (indent 0)
+           (debug t))
+  `(with-selected-window (ivy--get-window ivy-last)
+     ,@body))
+
+(defun ivy--done (text)
+  "Insert TEXT and exit minibuffer."
+  (insert
+   (setf (ivy-state-current ivy-last)
+         (if (and ivy--directory
+                  (not (eq (ivy-state-history ivy-last) 'grep-files-history)))
+             (expand-file-name text ivy--directory)
+           text)))
+  (setq ivy-exit 'done)
+  (exit-minibuffer))
+
+(defcustom ivy-use-selectable-prompt nil
+  "When non-nil, make the prompt line selectable like a candidate.
+
+The prompt line can be selected by calling `ivy-previous-line' when the first
+regular candidate is selected.  Both actions `ivy-done' and `ivy-alt-done',
+when called on a selected prompt, are forwarded to `ivy-immediate-done', which
+results to the same as calling `ivy-immediate-done' explicitly when a regular
+candidate is selected.
+
+Note that if `ivy-wrap' is set to t, calling `ivy-previous-line' when the
+prompt is selected wraps around to the last candidate, while calling
+`ivy-next-line' on the last candidate wraps around to the first
+candidate, not the prompt."
+  :type 'boolean)
+
+(defun ivy--prompt-selectable-p ()
+  "Return t if the prompt line is selectable."
+  (and ivy-use-selectable-prompt
+       (memq (ivy-state-require-match ivy-last)
+             '(nil confirm confirm-after-completion))))
+
+(defun ivy--prompt-selected-p ()
+  "Return t if the prompt line is selected."
+  (and (ivy--prompt-selectable-p)
+       (= ivy--index -1)))
+
+;;* Commands
+(defun ivy-done ()
+  "Exit the minibuffer with the selected candidate."
+  (interactive)
+  (if (ivy--prompt-selected-p)
+      (ivy-immediate-done)
+    (setq ivy-current-prefix-arg current-prefix-arg)
+    (delete-minibuffer-contents)
+    (cond ((or (> ivy--length 0)
+               ;; the action from `ivy-dispatching-done' may not need a
+               ;; candidate at all
+               (eq this-command 'ivy-dispatching-done))
+           (ivy--done (ivy-state-current ivy-last)))
+          ((memq (ivy-state-collection ivy-last)
+                 '(read-file-name-internal internal-complete-buffer))
+           (if (or (not (eq confirm-nonexistent-file-or-buffer t))
+                   (equal " (confirm)" ivy--prompt-extra))
+               (ivy--done ivy-text)
+             (setq ivy--prompt-extra " (confirm)")
+             (insert ivy-text)
+             (ivy--exhibit)))
+          ((memq (ivy-state-require-match ivy-last)
+                 '(nil confirm confirm-after-completion))
+           (ivy--done ivy-text))
+          (t
+           (setq ivy--prompt-extra " (match required)")
+           (insert ivy-text)
+           (ivy--exhibit)))))
+
+(defvar ivy-mouse-1-tooltip
+  "Exit the minibuffer with the selected candidate."
+  "The doc visible in the tooltip for mouse-1 binding in the minibuffer")
+(defvar ivy-mouse-3-tooltip
+  "Display alternative actions."
+  "The doc visible in the tooltip for mouse-3 binding in the minibuffer")
+
+(defun ivy-mouse-offset (event)
+  "Compute the offset between the candidate at point and the selected one."
+  (if event
+      (let* ((line-number-at-point
+              (max 2
+                   (line-number-at-pos (posn-point (event-start event)))))
+
+             (line-number-candidate ;; convert to 0 based index
+              (- line-number-at-point 2))
+             (offset
+              (- line-number-candidate
+                 ivy--window-index)))
+        offset)
+    nil))
+
+(defun ivy-mouse-done (event)
+  (interactive "@e")
+  (let ((offset (ivy-mouse-offset event)))
+    (when offset
+      (ivy-next-line offset)
+      (ivy--exhibit)
+      (ivy-alt-done))))
+
+(defun ivy-mouse-dispatching-done (event)
+  (interactive "@e")
+  (let ((offset (ivy-mouse-offset event)))
+    (when offset
+      (ivy-next-line offset)
+      (ivy--exhibit)
+      (ivy-dispatching-done))))
+
+(defvar ivy-read-action-format-function 'ivy-read-action-format-default
+  "Function used to transform the actions list into a docstring.")
+
+(defun ivy-read-action-format-default (actions)
+  "Create a docstring from ACTIONS.
+
+ACTIONS is a list.  Each list item is a list of 3 items:
+key (a string), cmd and doc (a string)."
+  (format "%s\n%s\n"
+          (if (eq this-command 'ivy-read-action)
+              "Select action: "
+            (ivy-state-current ivy-last))
+          (mapconcat
+           (lambda (x)
+             (format "%s: %s"
+                     (propertize
+                      (car x)
+                      'face 'ivy-action)
+                     (nth 2 x)))
+           actions
+           "\n")))
+
+(defun ivy-read-action ()
+  "Change the action to one of the available ones.
+
+Return nil for `minibuffer-keyboard-quit' or wrong key during the
+selection, non-nil otherwise."
+  (interactive)
+  (let ((actions (ivy-state-action ivy-last)))
+    (if (not (ivy--actionp actions))
+        t
+      (let* ((hint (funcall ivy-read-action-format-function (cdr actions)))
+             (resize-mini-windows t)
+             (key "")
+             action-idx)
+        (while (and (setq action-idx (cl-position-if
+                                      (lambda (x)
+                                        (string-prefix-p key (car x)))
+                                      (cdr actions)))
+                    (not (string= key (car (nth action-idx (cdr actions))))))
+          (setq key (concat key (string (read-key hint)))))
+        (cond ((member key '("" ""))
+               nil)
+              ((null action-idx)
+               (message "%s is not bound" key)
+               nil)
+              (t
+               (message "")
+               (setcar actions (1+ action-idx))
+               (ivy-set-action actions)))))))
+
+(defun ivy-shrink-after-dispatching ()
+  "Shrink the window after dispatching when action list is too large."
+  (let ((window (selected-window)))
+    (window-resize window (- ivy-height (window-height window)))))
+
+(defun ivy-dispatching-done ()
+  "Select one of the available actions and call `ivy-done'."
+  (interactive)
+  (when (ivy-read-action)
+    (ivy-done))
+  (ivy-shrink-after-dispatching))
+
+(defun ivy-dispatching-call ()
+  "Select one of the available actions and call `ivy-call'."
+  (interactive)
+  (setq ivy-current-prefix-arg current-prefix-arg)
+  (let ((actions (copy-sequence (ivy-state-action ivy-last))))
+    (unwind-protect
+         (when (ivy-read-action)
+           (ivy-call))
+      (ivy-set-action actions)))
+  (ivy-shrink-after-dispatching))
+
+(defun ivy-build-tramp-name (x)
+  "Reconstruct X into a path.
+Is is a cons cell, related to `tramp-get-completion-function'."
+  (let ((user (car x))
+        (domain (cadr x)))
+    (if user
+        (concat user "@" domain)
+      domain)))
+
+(declare-function tramp-get-completion-function "tramp")
+(declare-function Info-find-node "info")
+
+(defun ivy-alt-done (&optional arg)
+  "Exit the minibuffer with the selected candidate.
+When ARG is t, exit with current text, ignoring the candidates."
+  (interactive "P")
+  (setq ivy-current-prefix-arg current-prefix-arg)
+  (cond ((or arg
+             (ivy--prompt-selected-p))
+         (ivy-immediate-done))
+        (ivy--directory
+         (ivy--directory-done))
+        ((eq (ivy-state-collection ivy-last) 'Info-read-node-name-1)
+         (if (member (ivy-state-current ivy-last) '("(./)" "(../)"))
+             (ivy-quit-and-run
+               (ivy-read "Go to file: " 'read-file-name-internal
+                         :action (lambda (x)
+                                   (Info-find-node
+                                    (expand-file-name x ivy--directory)
+                                    "Top"))))
+           (ivy-done)))
+        (t
+         (ivy-done))))
+
+(defvar ivy-auto-select-single-candidate nil
+  "When non-nil, auto-select the candidate if it is the only one.
+When t, it is the same as if the user were prompted and selected the candidate
+by calling the default action.  This variable has no use unless the collection
+contains a single candidate.")
+
+(defun ivy--directory-done ()
+  "Handle exit from the minibuffer when completing file names."
+  (let (dir)
+    (cond
+      ((equal ivy-text "/sudo::")
+       (setq dir (concat ivy-text (expand-file-name ivy--directory)))
+       (ivy--cd dir)
+       (ivy--exhibit))
+      ((and
+        (> ivy--length 0)
+        (not (string= (ivy-state-current ivy-last) "./"))
+        (setq dir (ivy-expand-file-if-directory (ivy-state-current ivy-last))))
+       (ivy--cd dir)
+       (ivy--exhibit))
+      ((unless (string= ivy-text "")
+         (let ((file (expand-file-name
+                      (if (> ivy--length 0) (ivy-state-current ivy-last) ivy-text)
+                      ivy--directory)))
+           (when (ignore-errors (file-exists-p file))
+             (if (file-directory-p file)
+                 (ivy--cd (file-name-as-directory file))
+               (ivy-done))
+             ivy-text))))
+      ((or (and (equal ivy--directory "/")
+                (string-match "\\`[^/]+:.*:.*\\'" ivy-text))
+           (string-match "\\`/[^/]+:.*:.*\\'" ivy-text))
+       (ivy-done))
+      ((or (and (equal ivy--directory "/")
+                (cond ((string-match
+                        "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
+                        ivy-text))
+                      ((string-match
+                        "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
+                        (ivy-state-current ivy-last))
+                       (setq ivy-text (ivy-state-current ivy-last)))))
+           (string-match
+            "\\`/\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
+            ivy-text))
+       (let ((method (match-string 1 ivy-text))
+             (user (match-string 2 ivy-text))
+             (rest (match-string 3 ivy-text))
+             res)
+         (require 'tramp)
+         (dolist (x (tramp-get-completion-function method))
+           (setq res (append res (funcall (car x) (cadr x)))))
+         (setq res (delq nil res))
+         (when user
+           (dolist (x res)
+             (setcar x user)))
+         (setq res (cl-delete-duplicates res :test #'equal))
+         (let* ((old-ivy-last ivy-last)
+                (enable-recursive-minibuffers t)
+                (host (let ((ivy-auto-select-single-candidate nil))
+                        (ivy-read "user@host: "
+                                  (mapcar #'ivy-build-tramp-name res)
+                                  :initial-input rest))))
+           (setq ivy-last old-ivy-last)
+           (when host
+             (setq ivy--directory "/")
+             (ivy--cd (concat "/" method ":" host ":"))))))
+      (t
+       (ivy-done)))))
+
+(defun ivy-expand-file-if-directory (file-name)
+  "Expand FILE-NAME as directory.
+When this directory doesn't exist, return nil."
+  (when (stringp file-name)
+    (let ((full-name
+           ;; Ignore host name must not match method "ssh"
+           (ignore-errors
+             (file-name-as-directory
+              (expand-file-name file-name ivy--directory)))))
+      (when (and full-name (file-directory-p full-name))
+        full-name))))
+
+(defcustom ivy-tab-space nil
+  "When non-nil, `ivy-partial-or-done' should insert a space."
+  :type 'boolean)
+
+(defun ivy-partial-or-done ()
+  "Complete the minibuffer text as much as possible.
+If the text hasn't changed as a result, forward to `ivy-alt-done'."
+  (interactive)
+  (if (and (eq (ivy-state-collection ivy-last) #'read-file-name-internal)
+           (or (and (equal ivy--directory "/")
+                    (string-match "\\`[^/]+:.*\\'" ivy-text))
+               (string-match "\\`/" ivy-text)))
+      (let ((default-directory ivy--directory)
+            dir)
+        (minibuffer-complete)
+        (setq ivy-text (ivy--input))
+        (when (setq dir (ivy-expand-file-if-directory ivy-text))
+          (ivy--cd dir)))
+    (or (ivy-partial)
+        (when (or (eq this-command last-command)
+                  (eq ivy--length 1))
+          (ivy-alt-done)))))
+
+(defun ivy-partial ()
+  "Complete the minibuffer text as much as possible."
+  (interactive)
+  (let* ((parts (or (split-string ivy-text " " t) (list "")))
+         (postfix (car (last parts)))
+         (case-fold-search (ivy--case-fold-p ivy-text))
+         (completion-ignore-case case-fold-search)
+         (startp (string-match "^\\^" postfix))
+         (new (try-completion (if startp
+                                  (substring postfix 1)
+                                postfix)
+                              (if (ivy-state-dynamic-collection ivy-last)
+                                  ivy--all-candidates
+                                (mapcar (lambda (str)
+                                          (let ((i (string-match postfix str)))
+                                            (when i
+                                              (substring str i))))
+                                        ivy--old-cands)))))
+    (cond ((eq new t) nil)
+          ((string= new ivy-text) nil)
+          (new
+           (delete-region (minibuffer-prompt-end) (point-max))
+           (setcar (last parts)
+                   (if startp
+                       (concat "^" new)
+                     new))
+           (insert (mapconcat #'identity parts " ")
+                   (if ivy-tab-space " " ""))
+           t))))
+
+(defvar ivy-completion-beg nil
+  "Completion bounds start.")
+
+(defvar ivy-completion-end nil
+  "Completion bounds end.")
+
+(defun ivy-immediate-done ()
+  "Exit the minibuffer with current input instead of current candidate."
+  (interactive)
+  (delete-minibuffer-contents)
+  (insert (setf (ivy-state-current ivy-last)
+                (if (and ivy--directory
+                         (not (eq (ivy-state-history ivy-last)
+                                  'grep-files-history)))
+                    (expand-file-name ivy-text ivy--directory)
+                  ivy-text)))
+  (setq ivy-completion-beg ivy-completion-end)
+  (setq ivy-exit 'done)
+  (exit-minibuffer))
+
+;;;###autoload
+(defun ivy-resume ()
+  "Resume the last completion session."
+  (interactive)
+  (if (null (ivy-state-action ivy-last))
+      (user-error "The last session isn't compatible with `ivy-resume'")
+    (when (eq (ivy-state-caller ivy-last) 'swiper)
+      (switch-to-buffer (ivy-state-buffer ivy-last)))
+    (with-current-buffer (ivy-state-buffer ivy-last)
+      (let ((default-directory (ivy-state-directory ivy-last)))
+        (ivy-read
+         (ivy-state-prompt ivy-last)
+         (ivy-state-collection ivy-last)
+         :predicate (ivy-state-predicate ivy-last)
+         :require-match (ivy-state-require-match ivy-last)
+         :initial-input ivy-text
+         :history (ivy-state-history ivy-last)
+         :preselect (ivy-state-current ivy-last)
+         :keymap (ivy-state-keymap ivy-last)
+         :update-fn (ivy-state-update-fn ivy-last)
+         :sort (ivy-state-sort ivy-last)
+         :action (ivy-state-action ivy-last)
+         :unwind (ivy-state-unwind ivy-last)
+         :re-builder (ivy-state-re-builder ivy-last)
+         :matcher (ivy-state-matcher ivy-last)
+         :dynamic-collection (ivy-state-dynamic-collection ivy-last)
+         :caller (ivy-state-caller ivy-last))))))
+
+(defvar-local ivy-calling nil
+  "When non-nil, call the current action when `ivy--index' changes.")
+
+(defun ivy-set-index (index)
+  "Set `ivy--index' to INDEX."
+  (setq ivy--index index)
+  (when ivy-calling
+    (ivy--exhibit)
+    (ivy-call)))
+
+(defun ivy-beginning-of-buffer ()
+  "Select the first completion candidate."
+  (interactive)
+  (ivy-set-index 0))
+
+(defun ivy-end-of-buffer ()
+  "Select the last completion candidate."
+  (interactive)
+  (ivy-set-index (1- ivy--length)))
+
+(defun ivy-scroll-up-command ()
+  "Scroll the candidates upward by the minibuffer height."
+  (interactive)
+  (ivy-set-index (min (1- (+ ivy--index ivy-height))
+                      (1- ivy--length))))
+
+(defun ivy-scroll-down-command ()
+  "Scroll the candidates downward by the minibuffer height."
+  (interactive)
+  (ivy-set-index (max (1+ (- ivy--index ivy-height))
+                      0)))
+
+(defun ivy-minibuffer-grow ()
+  "Grow the minibuffer window by 1 line."
+  (interactive)
+  (setq-local max-mini-window-height
+              (cl-incf ivy-height)))
+
+(defun ivy-minibuffer-shrink ()
+  "Shrink the minibuffer window by 1 line."
+  (interactive)
+  (unless (<= ivy-height 2)
+    (setq-local max-mini-window-height
+                (cl-decf ivy-height))
+    (window-resize (selected-window) -1)))
+
+(defun ivy-next-line (&optional arg)
+  "Move cursor vertically down ARG candidates."
+  (interactive "p")
+  (setq arg (or arg 1))
+  (let ((index (+ ivy--index arg)))
+    (if (> index (1- ivy--length))
+        (if ivy-wrap
+            (ivy-beginning-of-buffer)
+          (ivy-set-index (1- ivy--length)))
+      (ivy-set-index index))))
+
+(defun ivy-next-line-or-history (&optional arg)
+  "Move cursor vertically down ARG candidates.
+If the input is empty, select the previous history element instead."
+  (interactive "p")
+  (if (string= ivy-text "")
+      (ivy-previous-history-element 1)
+    (ivy-next-line arg)))
+
+(defun ivy-previous-line (&optional arg)
+  "Move cursor vertically up ARG candidates."
+  (interactive "p")
+  (setq arg (or arg 1))
+  (let ((index (- ivy--index arg))
+        (min-index (or (and (ivy--prompt-selectable-p) -1)
+                       0)))
+    (if (< index min-index)
+        (if ivy-wrap
+            (ivy-end-of-buffer)
+          (ivy-set-index min-index))
+      (ivy-set-index index))))
+
+(defun ivy-previous-line-or-history (arg)
+  "Move cursor vertically up ARG candidates.
+If the input is empty, select the previous history element instead."
+  (interactive "p")
+  (when (and (zerop ivy--index) (string= ivy-text ""))
+    (ivy-previous-history-element 1))
+  (ivy-previous-line arg))
+
+(defun ivy-toggle-calling ()
+  "Flip `ivy-calling'."
+  (interactive)
+  (when (setq ivy-calling (not ivy-calling))
+    (ivy-call)))
+
+(defun ivy-toggle-ignore ()
+  "Toggle user-configured candidate filtering."
+  (interactive)
+  (setq ivy-use-ignore
+        (if ivy-use-ignore
+            nil
+          (or ivy-use-ignore-default t)))
+  ;; invalidate cache
+  (setq ivy--old-cands nil))
+
+(defun ivy--get-action (state)
+  "Get the action function from STATE."
+  (let ((action (ivy-state-action state)))
+    (when action
+      (if (functionp action)
+          action
+        (cadr (nth (car action) action))))))
+
+(defun ivy--get-window (state)
+  "Get the window from STATE."
+  (if (ivy-state-p state)
+      (let ((window (ivy-state-window state)))
+        (if (window-live-p window)
+            window
+          (if (= (length (window-list)) 1)
+              (selected-window)
+            (next-window))))
+    (selected-window)))
+
+(defun ivy--actionp (x)
+  "Return non-nil when X is a list of actions."
+  (and (consp x) (not (memq (car x) '(closure lambda)))))
+
+(defcustom ivy-action-wrap nil
+  "When non-nil, `ivy-next-action' and `ivy-prev-action' wrap."
+  :type 'boolean)
+
+(defun ivy-next-action ()
+  "When the current action is a list, scroll it forwards."
+  (interactive)
+  (let ((action (ivy-state-action ivy-last)))
+    (when (ivy--actionp action)
+      (let ((len (1- (length action)))
+            (idx (car action)))
+        (if (>= idx len)
+            (when ivy-action-wrap
+              (setf (car action) 1))
+          (cl-incf (car action)))))))
+
+(defun ivy-prev-action ()
+  "When the current action is a list, scroll it backwards."
+  (interactive)
+  (let ((action (ivy-state-action ivy-last)))
+    (when (ivy--actionp action)
+      (if (<= (car action) 1)
+          (when ivy-action-wrap
+            (setf (car action) (1- (length action))))
+        (cl-decf (car action))))))
+
+(defun ivy-action-name ()
+  "Return the name associated with the current action."
+  (let ((action (ivy-state-action ivy-last)))
+    (if (ivy--actionp action)
+        (format "[%d/%d] %s"
+                (car action)
+                (1- (length action))
+                (nth 2 (nth (car action) action)))
+      "[1/1] default")))
+
+(defvar ivy-inhibit-action nil
+  "When non-nil, `ivy-call' does nothing.
+
+Example use:
+
+    (let* ((ivy-inhibit-action t)
+          (str (counsel-locate \"lispy.el\")))
+     ;; do whatever with str - the corresponding file will not be opened
+     )")
+
+(defun ivy-recursive-restore ()
+  "Restore the above state when exiting the minibuffer.
+See variable `ivy-recursive-restore' for further information."
+  (when (and ivy-recursive-last
+             ivy-recursive-restore
+             (not (eq ivy-last ivy-recursive-last)))
+    (ivy--reset-state (setq ivy-last ivy-recursive-last))))
+
+(defun ivy-call ()
+  "Call the current action without exiting completion."
+  (interactive)
+  (unless
+      (or
+       ;; this is needed for testing in ivy-with which seems to call ivy-call
+       ;; again, and this-command is nil in that case.
+       (null this-command)
+       (memq this-command '(ivy-done
+                            ivy-alt-done
+                            ivy-dispatching-done)))
+    (setq ivy-current-prefix-arg current-prefix-arg))
+  (unless ivy-inhibit-action
+    (let ((action (ivy--get-action ivy-last)))
+      (when action
+        (let* ((collection (ivy-state-collection ivy-last))
+               (x (cond
+                    ;; Alist type.
+                    ((and (consp collection)
+                          (consp (car collection))
+                          ;; Previously, the cdr of the selected
+                          ;; candidate would be returned.  Now, the
+                          ;; whole candidate is returned.
+                          (let (idx)
+                            (if (setq idx (get-text-property
+                                           0 'idx (ivy-state-current ivy-last)))
+                                (nth idx collection)
+                              (assoc (ivy-state-current ivy-last)
+                                     collection)))))
+                    (ivy--directory
+                     (expand-file-name
+                      (ivy-state-current ivy-last)
+                      ivy--directory))
+                    ((equal (ivy-state-current ivy-last) "")
+                     ivy-text)
+                    (t
+                     (ivy-state-current ivy-last)))))
+          (if (eq action 'identity)
+              (funcall action x)
+            (select-window (ivy--get-window ivy-last))
+            (set-buffer (ivy-state-buffer ivy-last))
+            (prog1 (with-current-buffer (ivy-state-buffer ivy-last)
+                     (unwind-protect (funcall action x)
+                       (ivy-recursive-restore)))
+              (unless (or (eq ivy-exit 'done)
+                          (equal (selected-window)
+                                 (active-minibuffer-window))
+                          (null (active-minibuffer-window)))
+                (select-window (active-minibuffer-window))))))))))
+
+(defun ivy-call-and-recenter ()
+  "Call action and recenter window according to the selected candidate."
+  (interactive)
+  (ivy-call)
+  (with-ivy-window
+    (recenter-top-bottom)))
+
+(defun ivy-next-line-and-call (&optional arg)
+  "Move cursor vertically down ARG candidates.
+Call the permanent action if possible."
+  (interactive "p")
+  (ivy-next-line arg)
+  (ivy--exhibit)
+  (ivy-call))
+
+(defun ivy-previous-line-and-call (&optional arg)
+  "Move cursor vertically down ARG candidates.
+Call the permanent action if possible."
+  (interactive "p")
+  (ivy-previous-line arg)
+  (ivy--exhibit)
+  (ivy-call))
+
+(defun ivy-previous-history-element (arg)
+  "Forward to `previous-history-element' with ARG."
+  (interactive "p")
+  (previous-history-element arg)
+  (ivy--cd-maybe)
+  (move-end-of-line 1)
+  (ivy--maybe-scroll-history))
+
+(defun ivy-next-history-element (arg)
+  "Forward to `next-history-element' with ARG."
+  (interactive "p")
+  (if (and (= minibuffer-history-position 0)
+           (equal ivy-text ""))
+      (progn
+        (insert ivy--default)
+        (when (and (with-ivy-window (derived-mode-p 'prog-mode))
+                   (eq (ivy-state-caller ivy-last) 'swiper)
+                   (not (file-exists-p ivy--default))
+                   (not (ffap-url-p ivy--default))
+                   (not (ivy-state-dynamic-collection ivy-last))
+                   (> (point) (minibuffer-prompt-end)))
+          (undo-boundary)
+          (insert "\\_>")
+          (goto-char (minibuffer-prompt-end))
+          (insert "\\_<")
+          (forward-char (+ 2 (length ivy--default)))))
+    (next-history-element arg))
+  (ivy--cd-maybe)
+  (move-end-of-line 1)
+  (ivy--maybe-scroll-history))
+
+(defvar ivy-ffap-url-functions nil
+  "List of functions that check if the point is on a URL.")
+
+(defun ivy--cd-maybe ()
+  "Check if the current input points to a different directory.
+If so, move to that directory, while keeping only the file name."
+  (when ivy--directory
+    (let ((input (ivy--input))
+          url)
+      (if (setq url (or (ffap-url-p input)
+                        (with-ivy-window
+                          (cl-reduce
+                           (lambda (a b)
+                             (or a (funcall b)))
+                           ivy-ffap-url-functions
+                           :initial-value nil))))
+          (ivy-exit-with-action
+           (lambda (_)
+             (funcall ffap-url-fetcher url)))
+        (setq input (expand-file-name input))
+        (let ((file (file-name-nondirectory input))
+              (dir (expand-file-name (file-name-directory input))))
+          (if (string= dir ivy--directory)
+              (progn
+                (delete-minibuffer-contents)
+                (insert file))
+            (ivy--cd dir)
+            (insert file)))))))
+
+(defun ivy--maybe-scroll-history ()
+  "If the selected history element has an index, scroll there."
+  (let ((idx (ignore-errors
+               (get-text-property
+                (minibuffer-prompt-end)
+                'ivy-index))))
+    (when idx
+      (ivy--exhibit)
+      (ivy-set-index idx))))
+
+(defun ivy--cd (dir)
+  "When completing file names, move to directory DIR."
+  (if (null ivy--directory)
+      (error "Unexpected")
+    (setq ivy--old-cands nil)
+    (setq ivy--old-re nil)
+    (ivy-set-index 0)
+    (setq ivy--all-candidates
+          (ivy--sorted-files (setq ivy--directory dir)))
+    (setq ivy-text "")
+    (setf (ivy-state-directory ivy-last) dir)
+    (delete-minibuffer-contents)))
+
+(defun ivy-backward-delete-char ()
+  "Forward to `delete-backward-char'.
+Call `ivy-on-del-error-function' if an error occurs, usually when
+there is no more text to delete at the beginning of the
+minibuffer."
+  (interactive)
+  (if (and ivy--directory (= (minibuffer-prompt-end) (point)))
+      (progn
+        (ivy--cd (file-name-directory
+                  (directory-file-name
+                   (expand-file-name
+                    ivy--directory))))
+        (ivy--exhibit))
+    (setq prefix-arg current-prefix-arg)
+    (condition-case nil
+        (call-interactively #'delete-backward-char)
+      (error
+       (when ivy-on-del-error-function
+         (funcall ivy-on-del-error-function))))))
+
+(defun ivy-delete-char (arg)
+  "Forward to `delete-char' ARG."
+  (interactive "p")
+  (unless (eolp)
+    (delete-char arg)))
+
+(defun ivy-forward-char (arg)
+  "Forward to `forward-char' ARG."
+  (interactive "p")
+  (unless (eolp)
+    (forward-char arg)))
+
+(defun ivy-kill-word (arg)
+  "Forward to `kill-word' ARG."
+  (interactive "p")
+  (unless (eolp)
+    (kill-word arg)))
+
+(defun ivy-kill-line ()
+  "Forward to `kill-line'."
+  (interactive)
+  (if (eolp)
+      (kill-region (minibuffer-prompt-end) (point))
+    (kill-line)))
+
+(defun ivy-kill-whole-line ()
+  "Forward to `kill-whole-line'."
+  (interactive)
+  (kill-region (minibuffer-prompt-end) (line-end-position)))
+
+(defun ivy-backward-kill-word ()
+  "Forward to `backward-kill-word'."
+  (interactive)
+  (if (and ivy--directory (= (minibuffer-prompt-end) (point)))
+      (progn
+        (ivy--cd (file-name-directory
+                  (directory-file-name
+                   (expand-file-name
+                    ivy--directory))))
+        (ivy--exhibit))
+    (ignore-errors
+      (let ((pt (point)))
+        (forward-word -1)
+        (delete-region (point) pt)))))
+
+(defvar ivy--regexp-quote #'regexp-quote
+  "Store the regexp quoting state.")
+
+(defun ivy-toggle-regexp-quote ()
+  "Toggle the regexp quoting."
+  (interactive)
+  (setq ivy--old-re nil)
+  (cl-rotatef ivy--regex-function ivy--regexp-quote))
+
+(defvar avy-all-windows)
+(defvar avy-action)
+(defvar avy-keys)
+(defvar avy-keys-alist)
+(defvar avy-style)
+(defvar avy-styles-alist)
+(declare-function avy--process "ext:avy")
+(declare-function avy--style-fn "ext:avy")
+
+(defcustom ivy-format-function #'ivy-format-function-default
+  "Function to transform the list of candidates into a string.
+This string is inserted into the minibuffer."
+  :type '(choice
+          (const :tag "Default" ivy-format-function-default)
+          (const :tag "Arrow prefix" ivy-format-function-arrow)
+          (const :tag "Full line" ivy-format-function-line)))
+
+(eval-after-load 'avy
+  '(add-to-list 'avy-styles-alist '(ivy-avy . pre)))
+
+(defun ivy-avy ()
+  "Jump to one of the current ivy candidates."
+  (interactive)
+  (unless (require 'avy nil 'noerror)
+    (error "Package avy isn't installed"))
+  (let* ((avy-all-windows nil)
+         (avy-keys (or (cdr (assq 'ivy-avy avy-keys-alist))
+                       avy-keys))
+         (avy-style (or (cdr (assq 'ivy-avy
+                                   avy-styles-alist))
+                        avy-style))
+         (candidate
+          (let ((candidates))
+            (save-excursion
+              (save-restriction
+                (narrow-to-region
+                 (window-start)
+                 (window-end))
+                (goto-char (point-min))
+                (forward-line)
+                (while (< (point) (point-max))
+                  (push
+                   (cons (point)
+                         (selected-window))
+                   candidates)
+                  (forward-line))))
+            (setq avy-action #'identity)
+            (avy--process
+             (nreverse candidates)
+             (avy--style-fn avy-style)))))
+    (when (number-or-marker-p candidate)
+      (ivy--done
+       (substring-no-properties
+        (nth (- (line-number-at-pos candidate) 2) ivy--old-cands))))))
+
+(defun ivy-sort-file-function-default (x y)
+  "Compare two files X and Y.
+Prioritize directories."
+  (if (get-text-property 0 'dirp x)
+      (if (get-text-property 0 'dirp y)
+          (string< (directory-file-name x) (directory-file-name y))
+        t)
+    (if (get-text-property 0 'dirp y)
+        nil
+      (string< x y))))
+
+(declare-function ido-file-extension-lessp "ido")
+
+(defun ivy-sort-file-function-using-ido (x y)
+  "Compare two files X and Y using `ido-file-extensions-order'.
+
+This function is suitable as a replacement for
+`ivy-sort-file-function-default' in `ivy-sort-functions-alist'."
+  (if (and (bound-and-true-p ido-file-extensions-order))
+      (ido-file-extension-lessp x y)
+    (ivy-sort-file-function-default x y)))
+
+(defun ivy-string< (x y)
+  "Like `string<', but operate on CARs when given cons cells."
+  (if (consp x)
+      (string< (car x) (car y))
+    (string< x y)))
+
+(defcustom ivy-sort-functions-alist
+  '((read-file-name-internal . ivy-sort-file-function-default)
+    (internal-complete-buffer . nil)
+    (ivy-completion-in-region . nil)
+    (counsel-git-grep-function . nil)
+    (Man-goto-section . nil)
+    (org-refile . nil)
+    (t . ivy-string<))
+  "An alist of sorting functions for each collection function.
+Interactive functions that call completion fit in here as well.
+
+Nil means no sorting, which is useful to turn off the sorting for
+functions that have candidates in the natural buffer order, like
+`org-refile' or `Man-goto-section'.
+
+A list can be used to associate multiple sorting functions with a
+collection.  The car of the list is the current sort
+function.  This list can be rotated with `ivy-rotate-sort'.
+
+The entry associated with t is used for all fall-through cases.
+
+See also `ivy-sort-max-size'."
+  :type
+  '(alist
+    :key-type (choice
+               (const :tag "Fall-through" t)
+               (symbol :tag "Collection"))
+    :value-type (choice
+                 (const :tag "Plain sort" string-lessp)
+                 (const :tag "File sort" ivy-sort-file-function-default)
+                 (const :tag "No sort" nil)
+                 (function :tag "Custom function")
+                 (repeat (function :tag "Custom function"))))
+  :group 'ivy)
+
+(defun ivy--sort-function (collection)
+  "Retrieve sort function for COLLECTION from `ivy-sort-functions-alist'."
+  (let ((entry (cdr (or (assq collection ivy-sort-functions-alist)
+                        (assq (ivy-state-caller ivy-last) ivy-sort-functions-alist)
+                        (assq t ivy-sort-functions-alist)))))
+    (and (or (functionp entry)
+             (functionp (setq entry (car-safe entry))))
+         entry)))
+
+(defun ivy-rotate-sort ()
+  "Rotate through sorting functions available for current collection.
+This only has an effect if multiple sorting functions are
+specified for the current collection in
+`ivy-sort-functions-alist'."
+  (interactive)
+  (let ((cell (or (assq (ivy-state-collection ivy-last) ivy-sort-functions-alist)
+                  (assq (ivy-state-caller ivy-last) ivy-sort-functions-alist))))
+    (when (consp (cdr cell))
+      (setcdr cell (nconc (cddr cell) (list (cadr cell))))
+      (ivy--reset-state ivy-last))))
+
+(defvar ivy-index-functions-alist
+  '((swiper . ivy-recompute-index-swiper)
+    (swiper-multi . ivy-recompute-index-swiper)
+    (counsel-git-grep . ivy-recompute-index-swiper)
+    (counsel-grep . ivy-recompute-index-swiper-async)
+    (t . ivy-recompute-index-zero))
+  "An alist of index recomputing functions for each collection function.
+When the input changes, the appropriate function returns an
+integer - the index of the matched candidate that should be
+selected.")
+
+(defvar ivy-re-builders-alist
+  '((t . ivy--regex-plus))
+  "An alist of regex building functions for each collection function.
+
+Each key is (in order of priority):
+1. The actual collection function, e.g. `read-file-name-internal'.
+2. The symbol passed by :caller into `ivy-read'.
+3. `this-command'.
+4. t.
+
+Each value is a function that should take a string and return a
+valid regex or a regex sequence (see below).
+
+Possible choices: `ivy--regex', `regexp-quote',
+`ivy--regex-plus', `ivy--regex-fuzzy', `ivy--regex-ignore-order'.
+
+If a function returns a list, it should format like this:
+'((\"matching-regexp\" . t) (\"non-matching-regexp\") ...).
+
+The matches will be filtered in a sequence, you can mix the
+regexps that should match and that should not match as you
+like.")
+
+(defvar ivy-highlight-functions-alist
+  '((ivy--regex-ignore-order . ivy--highlight-ignore-order)
+    (ivy--regex-fuzzy . ivy--highlight-fuzzy)
+    (ivy--regex-plus . ivy--highlight-default))
+  "An alist of highlighting functions for each regex buidler function.")
+
+(defvar ivy-initial-inputs-alist
+  '((org-refile . "^")
+    (org-agenda-refile . "^")
+    (org-capture-refile . "^")
+    (counsel-M-x . "^")
+    (counsel-describe-function . "^")
+    (counsel-describe-variable . "^")
+    (counsel-org-capture . "^")
+    (Man-completion-table . "^")
+    (woman . "^"))
+  "Command to initial input table.")
+
+(defcustom ivy-sort-max-size 30000
+  "Sorting won't be done for collections larger than this."
+  :type 'integer)
+
+(defalias 'ivy--dirname-p
+    (if (fboundp 'directory-name-p)
+        #'directory-name-p
+      (lambda (name)
+        "Return non-nil if NAME ends with a directory separator."
+        (string-match-p "/\\'" name))))
+
+(defun ivy--sorted-files (dir)
+  "Return the list of files in DIR.
+Directories come first."
+  (let* ((default-directory dir)
+         (predicate (ivy-state-predicate ivy-last))
+         (seq (condition-case nil
+                  (all-completions "" 'read-file-name-internal)
+                (error
+                 (directory-files dir))))
+         sort-fn)
+    (if (equal dir "/")
+        seq
+      (setq seq (delete "./" (delete "../" seq)))
+      (when (eq (setq sort-fn (ivy--sort-function 'read-file-name-internal))
+                #'ivy-sort-file-function-default)
+        (setq seq (mapcar (lambda (x)
+                            (propertize x 'dirp (ivy--dirname-p x)))
+                          seq)))
+      (when sort-fn
+        (setq seq (sort seq sort-fn)))
+      (dolist (dir ivy-extra-directories)
+        (push dir seq))
+      (if predicate
+          (cl-remove-if-not predicate seq)
+        seq))))
+
+(defun ivy-alist-setting (alist &optional key)
+  "Return the value associated with KEY in ALIST, using `assq'.
+KEY defaults to the last caller of `ivy-read'; if no entry is
+found, it falls back to the key t."
+  (cdr (or (let ((caller (or key (ivy-state-caller ivy-last))))
+             (and caller (assq caller alist)))
+           (assq t alist))))
+
+;;** Entry Point
+;;;###autoload
+(cl-defun ivy-read (prompt collection
+                    &key
+                      predicate require-match initial-input
+                      history preselect def keymap update-fn sort
+                      action unwind re-builder matcher
+                      dynamic-collection caller)
+  "Read a string in the minibuffer, with completion.
+
+PROMPT is a format string, normally ending in a colon and a
+space; %d anywhere in the string is replaced by the current
+number of matching candidates.  For the literal % character,
+escape it with %%. See also `ivy-count-format'.
+
+COLLECTION is either a list of strings, a function, an alist, or
+a hash table.
+
+PREDICATE is applied to filter out the COLLECTION immediately.
+This argument is for `completing-read' compat.
+
+When REQUIRE-MATCH is non-nil, only members of COLLECTION can be
+selected, i.e. custom text.
+
+If INITIAL-INPUT is not nil, then insert that input in the
+minibuffer initially.
+
+HISTORY is a name of a variable to hold the completion session
+history.
+
+KEYMAP is composed with `ivy-minibuffer-map'.
+
+If PRESELECT is not nil, then select the corresponding candidate
+out of the ones that match the INITIAL-INPUT.
+
+DEF is for compatibility with `completing-read'.
+
+UPDATE-FN is called each time the current candidate(s) is changed.
+
+When SORT is t, use `ivy-sort-functions-alist' for sorting.
+
+ACTION is a lambda function to call after selecting a result.  It
+takes a single string argument.
+
+UNWIND is a lambda function to call before exiting.
+
+RE-BUILDER is a lambda function to call to transform text into a
+regex pattern.
+
+MATCHER is to override matching.
+
+DYNAMIC-COLLECTION is a boolean to specify if the list of
+candidates is updated after each input by calling COLLECTION.
+
+CALLER is a symbol to uniquely identify the caller to `ivy-read'.
+It is used, along with COLLECTION, to determine which
+customizations apply to the current completion session."
+  (let ((extra-actions (delete-dups
+                        (append (plist-get ivy--actions-list t)
+                                (plist-get ivy--actions-list this-command)
+                                (plist-get ivy--actions-list caller)))))
+    (when extra-actions
+      (setq action
+            (cond ((functionp action)
+                   `(1
+                     ("o" ,action "default")
+                     ,@extra-actions))
+                  ((null action)
+                   `(1
+                     ("o" identity "default")
+                     ,@extra-actions))
+                  (t
+                   (delete-dups (append action extra-actions)))))))
+  (unless caller
+    (setq caller this-command))
+  (let ((extra-sources (plist-get ivy--sources-list caller)))
+    (if extra-sources
+        (progn
+          (setq ivy--extra-candidates nil)
+          (dolist (source extra-sources)
+            (cond ((equal source '(original-source))
+                   (setq ivy--extra-candidates
+                         (cons source ivy--extra-candidates)))
+                  ((null (cdr source))
+                   (setq ivy--extra-candidates
+                         (cons
+                          (list (car source) (funcall (car source)))
+                          ivy--extra-candidates))))))
+      (setq ivy--extra-candidates '((original-source)))))
+  (let ((ivy-recursive-last (and (active-minibuffer-window) ivy-last))
+        (transformer-fn
+         (plist-get ivy--display-transformers-list
+                    (cond (caller)
+                          ((functionp collection)
+                           collection))))
+        (ivy-display-function
+         (unless (window-minibuffer-p)
+           (or ivy-display-function
+               (ivy-alist-setting ivy-display-functions-alist caller))))
+        (height
+         (or (cdr (assq caller ivy-height-alist))
+             ivy-height)))
+    (setq ivy-last
+          (make-ivy-state
+           :prompt prompt
+           :collection collection
+           :predicate predicate
+           :require-match require-match
+           :initial-input initial-input
+           :history history
+           :preselect preselect
+           :keymap keymap
+           :update-fn update-fn
+           :sort sort
+           :action action
+           :frame (selected-frame)
+           :window (selected-window)
+           :buffer (current-buffer)
+           :unwind unwind
+           :re-builder re-builder
+           :matcher matcher
+           :dynamic-collection dynamic-collection
+           :display-transformer-fn transformer-fn
+           :directory default-directory
+           :caller caller
+           :def def))
+    (ivy--reset-state ivy-last)
+    (prog1
+        (unwind-protect
+             (minibuffer-with-setup-hook
+                 #'ivy--minibuffer-setup
+               (let* ((hist (or history 'ivy-history))
+                      (minibuffer-completion-table collection)
+                      (minibuffer-completion-predicate predicate)
+                      (ivy-height height)
+                      (resize-mini-windows
+                       (cond
+                         ((display-graphic-p) nil)
+                         ((null resize-mini-windows) 'grow-only)
+                         (t resize-mini-windows))))
+                 (if (and ivy-auto-select-single-candidate
+                          (= (length ivy--all-candidates) 1))
+                     (progn
+                       (setf (ivy-state-current ivy-last)
+                             (car ivy--all-candidates))
+                       (setq ivy-exit 'done))
+                   (read-from-minibuffer
+                    prompt
+                    (ivy-state-initial-input ivy-last)
+                    (make-composed-keymap keymap ivy-minibuffer-map)
+                    nil
+                    hist))
+                 (when (eq ivy-exit 'done)
+                   (let ((item (if ivy--directory
+                                   (ivy-state-current ivy-last)
+                                 ivy-text)))
+                     (unless (equal item "")
+                       (set hist (cons (propertize item 'ivy-index ivy--index)
+                                       (delete item
+                                               (cdr (symbol-value hist))))))))
+                 (ivy-state-current ivy-last)))
+          ;; Fixes a bug in ESS, #1660
+          (put 'post-command-hook 'permanent-local nil)
+          (remove-hook 'post-command-hook #'ivy--queue-exhibit)
+          (let ((cleanup (ivy--display-function-prop :cleanup)))
+            (when (functionp cleanup)
+              (funcall cleanup)))
+          (when (setq unwind (ivy-state-unwind ivy-last))
+            (funcall unwind))
+          (unless (eq ivy-exit 'done)
+            (ivy-recursive-restore)))
+      (ivy-call)
+      (when (> (length (ivy-state-current ivy-last)) 0)
+        (remove-list-of-text-properties
+         0 1 '(idx) (ivy-state-current ivy-last))))))
+
+(defun ivy--display-function-prop (prop)
+  "Return PROP associated with current `ivy-display-function'."
+  (plist-get (cdr (assq ivy-display-function
+                        ivy-display-functions-props))
+             prop))
+
+(defun ivy--reset-state (state)
+  "Reset the ivy to STATE.
+This is useful for recursive `ivy-read'."
+  (unless (equal (selected-frame) (ivy-state-frame state))
+    (select-window (active-minibuffer-window)))
+  (let* ((prompt (or (ivy-state-prompt state) ""))
+         (collection (ivy-state-collection state))
+         (predicate (ivy-state-predicate state))
+         (history (ivy-state-history state))
+         (preselect (ivy-state-preselect state))
+         (sort (ivy-state-sort state))
+         (re-builder (ivy-state-re-builder state))
+         (dynamic-collection (ivy-state-dynamic-collection state))
+         (require-match (ivy-state-require-match state))
+         (caller (or (ivy-state-caller state) this-command))
+         (initial-input (or (ivy-state-initial-input state)
+                            (cdr (assq caller ivy-initial-inputs-alist))))
+         (def (ivy-state-def state)))
+    (setq ivy--directory nil)
+    (setq ivy-case-fold-search ivy-case-fold-search-default)
+    (setq ivy--regex-function
+          (or re-builder
+              (and (functionp collection)
+                   (cdr (assq collection ivy-re-builders-alist)))
+              (ivy-alist-setting ivy-re-builders-alist)
+              #'ivy--regex))
+    (setq ivy--subexps 0)
+    (setq ivy--regexp-quote #'regexp-quote)
+    (setq ivy--old-text "")
+    (setq ivy--full-length nil)
+    (setq ivy-text "")
+    (setq ivy--index 0)
+    (setq ivy-calling nil)
+    (setq ivy-use-ignore ivy-use-ignore-default)
+    (setq ivy--highlight-function
+          (or (cdr (assq ivy--regex-function ivy-highlight-functions-alist))
+              #'ivy--highlight-default))
+    (let (coll sort-fn)
+      (cond ((eq collection 'Info-read-node-name-1)
+             (if (equal Info-current-file "dir")
+                 (setq coll
+                       (mapcar (lambda (x) (format "(%s)" x))
+                               (cl-delete-duplicates
+                                (all-completions "(" collection predicate)
+                                :test #'equal)))
+               (setq coll (all-completions "" collection predicate))))
+            ((eq collection 'read-file-name-internal)
+             (when (and (equal def initial-input)
+                        (member "./" ivy-extra-directories))
+               (setf (ivy-state-def state) (setq def nil)))
+             (setq ivy--directory default-directory)
+             (when (and initial-input
+                        (not (equal initial-input "")))
+               (cond ((file-directory-p initial-input)
+                      (when (equal (file-name-nondirectory initial-input) "")
+                        (setf (ivy-state-preselect state) (setq preselect nil))
+                        (setf (ivy-state-def state) (setq def nil)))
+                      (setq ivy--directory (file-name-as-directory initial-input))
+                      (setq initial-input nil)
+                      (when preselect
+                        (let ((preselect-directory
+                               (file-name-directory preselect)))
+                          (when (and preselect-directory
+                                     (not (equal
+                                           (expand-file-name
+                                            preselect-directory)
+                                           (expand-file-name ivy--directory))))
+                            (setf (ivy-state-preselect state)
+                                  (setq preselect nil))))))
+                     ((ignore-errors
+                        (file-exists-p (file-name-directory initial-input)))
+                      (setq ivy--directory (file-name-directory initial-input))
+                      (setf (ivy-state-preselect state)
+                            (file-name-nondirectory initial-input)))))
+             (require 'dired)
+             (when preselect
+               (let ((preselect-directory (file-name-directory
+                                           (directory-file-name preselect))))
+                 (unless (or (null preselect-directory)
+                             (string= preselect-directory
+                                      default-directory))
+                   (setq ivy--directory preselect-directory))
+                 (setf
+                  (ivy-state-preselect state)
+                  (setq preselect (file-relative-name preselect
+                                                      preselect-directory)))))
+             (setq coll (ivy--sorted-files ivy--directory))
+             (when initial-input
+               (unless (or require-match
+                           (equal initial-input default-directory)
+                           (equal initial-input ""))
+                 (setq coll (cons initial-input coll)))
+               (unless (and (ivy-state-action ivy-last)
+                            (not (equal (ivy--get-action ivy-last) 'identity)))
+                 (setq initial-input nil))))
+            ((eq collection 'internal-complete-buffer)
+             (setq coll (ivy--buffer-list "" ivy-use-virtual-buffers predicate)))
+            (dynamic-collection
+             (setq coll (funcall collection ivy-text)))
+            ((and (consp collection) (listp (car collection)))
+             (if (and sort (setq sort-fn (ivy--sort-function caller)))
+                 (progn
+                   (setq sort nil)
+                   (setq coll (mapcar #'car
+                                      (setf (ivy-state-collection ivy-last)
+                                            (sort (copy-sequence collection)
+                                                  sort-fn)))))
+               (setq collection
+                     (setf (ivy-state-collection ivy-last)
+                           (cl-remove-if-not predicate collection)))
+               (setq coll (all-completions "" collection)))
+             (let ((i 0))
+               (ignore-errors
+                 ;; cm can be read-only
+                 (dolist (cm coll)
+                   (add-text-properties 0 1 `(idx ,i) cm)
+                   (cl-incf i)))))
+            ((or (functionp collection)
+                 (byte-code-function-p collection)
+                 (vectorp collection)
+                 (hash-table-p collection)
+                 (and (listp collection) (symbolp (car collection))))
+             (setq coll (all-completions "" collection predicate)))
+            (t
+             (setq coll
+                   (if predicate
+                       (cl-remove-if-not predicate collection)
+                     collection))))
+      (unless (ivy-state-dynamic-collection ivy-last)
+        (setq coll (delete "" coll)))
+      (when def
+        (cond ((listp def)
+               (setq coll (cl-union def coll :test 'equal)))
+              ((member def coll))
+              (t
+               (push def coll))))
+      (when sort
+        (if (functionp collection)
+            (when (and (not (eq collection 'read-file-name-internal))
+                       (<= (length coll) ivy-sort-max-size)
+                       (setq sort-fn (ivy--sort-function collection)))
+              (setq coll (sort (copy-sequence coll) sort-fn)))
+          (when (and (not (eq history 'org-refile-history))
+                     (<= (length coll) ivy-sort-max-size)
+                     (setq sort-fn (ivy--sort-function caller)))
+            (setq coll (sort (copy-sequence coll) sort-fn)))))
+      (setq coll (ivy--set-candidates coll))
+      (setq ivy--old-re nil)
+      (setq ivy--old-cands nil)
+      (when (integerp preselect)
+        (setq ivy--old-re "")
+        (ivy-set-index preselect))
+      (when initial-input
+        ;; Needed for anchor to work
+        (setq ivy--old-cands coll)
+        (setq ivy--old-cands (ivy--filter initial-input coll)))
+      (setq ivy--all-candidates coll)
+      (unless (integerp preselect)
+        (ivy-set-index (or
+                        (and dynamic-collection
+                             ivy--index)
+                        (and preselect
+                             (ivy--preselect-index
+                              preselect
+                              (if initial-input
+                                  ivy--old-cands
+                                coll)))
+                        0))))
+    (setq ivy-exit nil)
+    (setq ivy--default
+          (if (region-active-p)
+              (buffer-substring
+               (region-beginning)
+               (region-end))
+            (ivy-thing-at-point)))
+    (setq ivy--prompt (ivy-add-prompt-count prompt))
+    (setf (ivy-state-initial-input ivy-last) initial-input)))
+
+(defun ivy-add-prompt-count (prompt)
+  "Add count information to PROMPT."
+  (cond ((string-match "%.*d" prompt)
+         prompt)
+        ((null ivy-count-format)
+         (error
+          "`ivy-count-format' can't be nil.  Set it to \"\" instead"))
+        ((string-match "%d.*%d" ivy-count-format)
+         (let ((w (length (number-to-string
+                           (length ivy--all-candidates))))
+               (s (copy-sequence ivy-count-format)))
+           (string-match "%d" s)
+           (match-end 0)
+           (string-match "%d" s (match-end 0))
+           (setq s (replace-match (format "%%-%dd" w) nil nil s))
+           (string-match "%d" s)
+           (concat (replace-match (format "%%%dd" w) nil nil s)
+                   prompt)))
+        ((string-match "%.*d" ivy-count-format)
+         (concat ivy-count-format prompt))
+        (ivy--directory
+         prompt)
+        (t
+         prompt)))
+
+;;;###autoload
+(defun ivy-completing-read (prompt collection
+                            &optional predicate require-match initial-input
+                              history def inherit-input-method)
+  "Read a string in the minibuffer, with completion.
+
+This interface conforms to `completing-read' and can be used for
+`completing-read-function'.
+
+PROMPT is a string that normally ends in a colon and a space.
+COLLECTION is either a list of strings, an alist, an obarray, or a hash table.
+PREDICATE limits completion to a subset of COLLECTION.
+REQUIRE-MATCH is a boolean value.  See `completing-read'.
+INITIAL-INPUT is a string inserted into the minibuffer initially.
+HISTORY is a list of previously selected inputs.
+DEF is the default value.
+INHERIT-INPUT-METHOD is currently ignored."
+  (let ((handler
+         (when (< ivy-completing-read-ignore-handlers-depth (minibuffer-depth))
+           (assoc this-command ivy-completing-read-handlers-alist))))
+    (if handler
+        (let ((completion-in-region-function #'completion--in-region)
+              (ivy-completing-read-ignore-handlers-depth (1+ (minibuffer-depth))))
+          (funcall (cdr handler)
+                   prompt collection
+                   predicate require-match
+                   initial-input history
+                   def inherit-input-method))
+      ;; See the doc of `completing-read'.
+      (when (consp history)
+        (when (numberp (cdr history))
+          (setq initial-input (nth (1- (cdr history))
+                                   (symbol-value (car history)))))
+        (setq history (car history)))
+      (ivy-read (replace-regexp-in-string "%" "%%" prompt)
+                collection
+                :predicate predicate
+                :require-match (and collection require-match)
+                :initial-input (cond ((consp initial-input)
+                                      (car initial-input))
+                                     ((and (stringp initial-input)
+                                           (not (eq collection 'read-file-name-internal))
+                                           (string-match "\\+" initial-input))
+                                      (replace-regexp-in-string
+                                       "\\+" "\\\\+" initial-input))
+                                     (t
+                                      initial-input))
+                :preselect (if (listp def) (car def) def)
+                :def (if (listp def) (car def) def)
+                :history history
+                :keymap nil
+                :sort t
+                :dynamic-collection ivy-completing-read-dynamic-collection
+                :caller (cond ((called-interactively-p 'any)
+                               this-command)
+                              ((and collection (symbolp collection))
+                               collection))))))
+
+(defun ivy-completing-read-with-empty-string-def
+    (prompt collection
+     &optional predicate require-match initial-input
+       history def inherit-input-method)
+  "Same as `ivy-completing-read' but with different handling of DEF.
+
+Specifically, if DEF is nil, it is treated the same as if DEF was
+the empty string. This mimics the behavior of
+`completing-read-default'. This function can therefore be used in
+place of `ivy-completing-read' for commands that rely on this
+behavior."
+  (ivy-completing-read
+   prompt collection predicate require-match initial-input
+   history (or def "") inherit-input-method))
+
+(defun ivy-completion-in-region-action (str)
+  "Insert STR, erasing the previous one.
+The previous string is between `ivy-completion-beg' and `ivy-completion-end'."
+  (when (consp str)
+    (setq str (cdr str)))
+  (when (stringp str)
+    (let ((fake-cursors (and (fboundp 'mc/all-fake-cursors)
+                             (mc/all-fake-cursors)))
+          (pt (point))
+          (beg ivy-completion-beg)
+          (end ivy-completion-end))
+      (when beg
+        (delete-region beg end))
+      (setq ivy-completion-beg (point))
+      (insert (substring-no-properties str))
+      (setq ivy-completion-end (point))
+      (save-excursion
+        (dolist (cursor fake-cursors)
+          (goto-char (overlay-start cursor))
+          (delete-region (+ (point) (- beg pt))
+                         (+ (point) (- end pt)))
+          (insert (substring-no-properties str))
+          ;; manually move the fake cursor
+          (move-overlay cursor (point) (1+ (point)))
+          (set-marker (overlay-get cursor 'point) (point))
+          (set-marker (overlay-get cursor 'mark) (point)))))))
+
+(defun ivy-completion-common-length (str)
+  "Return the amount of characters that match in  STR.
+
+`completion-all-completions' computes this and returns the result
+via text properties.
+
+The first non-matching part is propertized:
+- either with: (face (completions-first-difference))
+- or: (font-lock-face completions-first-difference)."
+  (let ((char-property-alias-alist '((face font-lock-face)))
+        (i (1- (length str))))
+    (catch 'done
+      (while (>= i 0)
+        (when (equal (get-text-property i 'face str)
+                     '(completions-first-difference))
+          (throw 'done i))
+        (cl-decf i))
+      (throw 'done (length str)))))
+
+(defun ivy-completion-in-region (start end collection &optional predicate)
+  "An Ivy function suitable for `completion-in-region-function'.
+The function completes the text between START and END using COLLECTION.
+PREDICATE (a function called with no arguments) says when to exit.
+See `completion-in-region' for further information."
+  (let* ((enable-recursive-minibuffers t)
+         (str (buffer-substring-no-properties start end))
+         (completion-ignore-case (ivy--case-fold-p str))
+         (comps
+          (completion-all-completions str collection predicate (- end start)))
+         (ivy--prompts-list (if (window-minibuffer-p)
+                                ivy--prompts-list
+                              (list #'ivy-completion-in-region (lambda ())))))
+    (cond ((null comps)
+           (message "No matches"))
+          ((progn
+             (nconc comps nil)
+             (and (null (cdr comps))
+                  (string= str (car comps))))
+           (message "Sole match"))
+          (t
+           (let* ((len (ivy-completion-common-length (car comps)))
+                  (str-len (length str))
+                  (initial (cond ((= len 0)
+                                  "")
+                                 ((> len str-len)
+                                  (setq len str-len)
+                                  str)
+                                 (t
+                                  (substring str (- len))))))
+             (setq ivy--old-re nil)
+             (unless (ivy--filter initial comps)
+               (setq initial nil))
+             (delete-region (- end len) end)
+             (setq ivy-completion-beg (- end len))
+             (setq ivy-completion-end ivy-completion-beg)
+             (if (null (cdr comps))
+                 (progn
+                   (unless (minibuffer-window-active-p (selected-window))
+                     (setf (ivy-state-window ivy-last) (selected-window)))
+                   (ivy-completion-in-region-action
+                    (substring-no-properties
+                     (car comps))))
+               (let* ((w (1+ (floor (log (length comps) 10))))
+                      (ivy-count-format (if (string= ivy-count-format "")
+                                            ivy-count-format
+                                          (format "%%-%dd " w)))
+                      (prompt (format "(%s): " str)))
+                 (and
+                  (ivy-read (if (string= ivy-count-format "")
+                                prompt
+                              (replace-regexp-in-string "%" "%%" prompt))
+                            ;; remove 'completions-first-difference face
+                            (mapcar
+                             (lambda (s) (remove-text-properties 0 (length s) '(face) s) s)
+                             comps)
+                            ;; predicate was already applied by `completion-all-completions'
+                            :predicate nil
+                            :initial-input initial
+                            :sort t
+                            :action #'ivy-completion-in-region-action
+                            :unwind (lambda ()
+                                      (unless (eq ivy-exit 'done)
+                                        (goto-char ivy-completion-beg)
+                                        (insert initial)))
+                            :caller 'ivy-completion-in-region)
+                  t))))))))
+
+(defcustom ivy-do-completion-in-region t
+  "When non-nil `ivy-mode' will set `completion-in-region-function'."
+  :type 'boolean)
+
+;;;###autoload
+(define-minor-mode ivy-mode
+  "Toggle Ivy mode on or off.
+Turn Ivy mode on if ARG is positive, off otherwise.
+Turning on Ivy mode sets `completing-read-function' to
+`ivy-completing-read'.
+
+Global bindings:
+\\{ivy-mode-map}
+
+Minibuffer bindings:
+\\{ivy-minibuffer-map}"
+  :group 'ivy
+  :global t
+  :keymap ivy-mode-map
+  :lighter " ivy"
+  (if ivy-mode
+      (progn
+        (setq completing-read-function 'ivy-completing-read)
+        (when ivy-do-completion-in-region
+          (setq completion-in-region-function 'ivy-completion-in-region)))
+    (setq completing-read-function 'completing-read-default)
+    (setq completion-in-region-function 'completion--in-region)))
+
+(defun ivy--preselect-index (preselect candidates)
+  "Return the index of PRESELECT in CANDIDATES."
+  (cond ((integerp preselect)
+         preselect)
+        ((cl-position preselect candidates :test #'equal))
+        ((stringp preselect)
+         (let ((re preselect))
+           (cl-position-if
+            (lambda (x)
+              (string-match re x))
+            candidates)))))
+
+;;* Implementation
+;;** Regex
+(defun ivy-re-match (re-seq str)
+  "Return non-nil if RE-SEQ is matched by STR.
+
+RE-SEQ is a list of (RE . MATCH-P).
+
+RE is a regular expression.
+
+MATCH-P is t when RE should match STR and nil when RE should not
+match STR.
+
+Each element of RE-SEQ must match for the function to return true.
+
+This concept is used to generalize regular expressions for
+`ivy--regex-plus' and `ivy--regex-ignore-order'."
+  (let ((res t)
+        re)
+    (while (and res (setq re (pop re-seq)))
+      (setq res
+            (if (cdr re)
+                (string-match-p (car re) str)
+              (not (string-match-p (car re) str)))))
+    res))
+
+(defvar ivy--regex-hash
+  (make-hash-table :test #'equal)
+  "Store pre-computed regex.")
+
+(defun ivy--split (str)
+  "Split STR into list of substrings bounded by spaces.
+Single spaces act as splitting points.  Consecutive spaces
+\"quote\" their preceding spaces, i.e., guard them from being
+split.  This allows the literal interpretation of N spaces by
+inputting N+1 spaces.  Any substring not constituting a valid
+regexp is passed to `regexp-quote'."
+  (let ((len (length str))
+        start0
+        (start1 0)
+        res s
+        match-len)
+    (while (and (string-match " +" str start1)
+                (< start1 len))
+      (if (and (> (match-beginning 0) 2)
+               (string= "[^" (substring
+                              str
+                              (- (match-beginning 0) 2)
+                              (match-beginning 0))))
+          (progn
+            (setq start0 start1)
+            (setq start1 (match-end 0)))
+        (setq match-len (- (match-end 0) (match-beginning 0)))
+        (if (= match-len 1)
+            (progn
+              (when start0
+                (setq start1 start0)
+                (setq start0 nil))
+              (push (substring str start1 (match-beginning 0)) res)
+              (setq start1 (match-end 0)))
+          (setq str (replace-match
+                     (make-string (1- match-len) ?\ )
+                     nil nil str))
+          (setq start0 (or start0 start1))
+          (setq start1 (1- (match-end 0))))))
+    (if start0
+        (push (substring str start0) res)
+      (setq s (substring str start1))
+      (unless (= (length s) 0)
+        (push s res)))
+    (mapcar #'ivy--regex-or-literal (nreverse res))))
+
+(defun ivy--regex (str &optional greedy)
+  "Re-build regex pattern from STR in case it has a space.
+When GREEDY is non-nil, join words in a greedy way."
+  (let ((hashed (unless greedy
+                  (gethash str ivy--regex-hash))))
+    (if hashed
+        (prog1 (cdr hashed)
+          (setq ivy--subexps (car hashed)))
+      (when (string-match "\\([^\\]\\|^\\)\\\\$" str)
+        (setq str (substring str 0 -1)))
+      (cdr (puthash str
+                    (let ((subs (ivy--split str)))
+                      (if (= (length subs) 1)
+                          (cons
+                           (setq ivy--subexps 0)
+                           (car subs))
+                        (cons
+                         (setq ivy--subexps (length subs))
+                         (mapconcat
+                          (lambda (x)
+                            (if (string-match "\\`\\\\([^?].*\\\\)\\'" x)
+                                x
+                              (format "\\(%s\\)" x)))
+                          subs
+                          (if greedy
+                              ".*"
+                            ".*?")))))
+                    ivy--regex-hash)))))
+
+(defun ivy--legal-regex-p (str)
+  "Return t if STR is valid regular expression."
+  (condition-case nil
+      (progn
+        (string-match-p str "")
+        t)
+    (invalid-regexp nil)))
+
+(defun ivy--regex-or-literal (str)
+  "If STR isn't a legal regex, escape it."
+  (if (ivy--legal-regex-p str) str (regexp-quote str)))
+
+(defun ivy--split-negation (str)
+  "Split STR into text before and after ! delimiter.
+Do not split if the delimiter is escaped as \\!.
+
+Assumes there is at most one unescaped delimiter and discards
+text after delimiter if it is empty.  Modifies match data."
+  (unless (string= str "")
+    (let ((delim "\\(?:\\`\\|[^\\]\\)\\(!\\)"))
+      (mapcar (lambda (split)
+                ;; Store "\!" as "!".
+                (replace-regexp-in-string "\\\\!" "!" split t t))
+              (if (string-match delim str)
+                  ;; Ignore everything past first unescaped ! rather than
+                  ;; crashing.  We can't warn or error because the minibuffer is
+                  ;; already active.
+                  (let* ((i (match-beginning 1))
+                         (j (and (string-match delim str (1+ i))
+                                 (match-beginning 1)))
+                         (neg (substring str (1+ i) j)))
+                    (cons (substring str 0 i)
+                          (and (not (string= neg ""))
+                               (list neg))))
+                (list str))))))
+
+(defun ivy--split-spaces (str)
+  "Split STR on spaces, unless they're preceded by \\.
+No unescaped spaces are left in the output.  Any substring not
+constituting a valid regexp is passed to `regexp-quote'."
+  (when str
+    (let ((i 0) ; End of last search.
+          (j 0) ; End of last delimiter.
+          parts)
+      (while (string-match "\\(\\\\ \\)\\| +" str i)
+        (setq i (match-end 0))
+        (if (not (match-beginning 1))
+            ;; Unescaped space(s).
+            (let ((delim (match-beginning 0)))
+              (when (< j delim)
+                (push (substring str j delim) parts))
+              (setq j i))
+          ;; Store "\ " as " ".
+          (setq str (replace-match " " t t str 1))
+          (setq i (1- i))))
+      (when (< j (length str))
+        (push (substring str j) parts))
+      (mapcar #'ivy--regex-or-literal (nreverse parts)))))
+
+(defun ivy--regex-ignore-order (str)
+  "Re-build regex from STR by splitting at spaces and using ! for negation.
+
+Examples:
+foo          -> matches \"foo\"
+foo bar      -> matches if both \"foo\" and \"bar\" match (any order)
+foo !bar     -> matches if \"foo\" matches and \"bar\" does not match
+foo !bar baz -> matches if \"foo\" matches and neither \"bar\" nor \"baz\" match
+foo[a-z]     -> matches \"foo[a-z]\"
+
+Escaping examples:
+foo\!bar -> matches \"foo!bar\"
+foo\ bar -> matches \"foo bar\"
+
+Returns a list suitable for `ivy-re-match'."
+  (let* (regex-parts
+         (raw-parts (ivy--split-negation str)))
+    (dolist (part (ivy--split-spaces (car raw-parts)))
+      (push (cons part t) regex-parts))
+    (when (cdr raw-parts)
+      (dolist (part (ivy--split-spaces (cadr raw-parts)))
+        (push (cons part nil) regex-parts)))
+    (if regex-parts (nreverse regex-parts)
+      "")))
+
+(defun ivy--regex-plus (str)
+  "Build a regex sequence from STR.
+Spaces are wild card characters, everything before \"!\" should
+match.  Everything after \"!\" should not match."
+  (let ((parts (ivy--split-negation str)))
+    (cl-case (length parts)
+      (0
+       "")
+      (1
+       (if (string= (substring str 0 1) "!")
+           (list (cons "" t)
+                 (list (ivy--regex (car parts))))
+         (ivy--regex (car parts))))
+      (2
+       (cons
+        (cons (ivy--regex (car parts)) t)
+        (mapcar #'list (split-string (cadr parts) " " t))))
+      (t (error "Unexpected: use only one !")))))
+
+(defun ivy--regex-fuzzy (str)
+  "Build a regex sequence from STR.
+Insert .* between each char."
+  (if (string-match "\\`\\(\\^?\\)\\(.*?\\)\\(\\$?\\)\\'" str)
+      (prog1
+          (concat (match-string 1 str)
+                  (mapconcat
+                   (lambda (x)
+                     (format "\\(%s\\)" (regexp-quote (string x))))
+                   (string-to-list (match-string 2 str))
+                   ".*?")
+                  (match-string 3 str))
+        (setq ivy--subexps (length (match-string 2 str))))
+    str))
+
+(defcustom ivy-fixed-height-minibuffer nil
+  "When non nil, fix the height of the minibuffer during ivy completion.
+This effectively sets the minimum height at this level to `ivy-height' and
+tries to ensure that it does not change depending on the number of candidates."
+  :group 'ivy
+  :type 'boolean)
+
+;;** Rest
+(defcustom ivy-truncate-lines t
+  "Minibuffer setting for `truncate-lines'."
+  :type 'boolean)
+
+(defun ivy--minibuffer-setup ()
+  "Setup ivy completion in the minibuffer."
+  (setq-local mwheel-scroll-up-function 'ivy-next-line)
+  (setq-local mwheel-scroll-down-function 'ivy-previous-line)
+  (setq-local completion-show-inline-help nil)
+  (setq-local minibuffer-default-add-function
+              (lambda ()
+                (list ivy--default)))
+  (setq-local inhibit-field-text-motion nil)
+  (when (display-graphic-p)
+    (setq truncate-lines ivy-truncate-lines))
+  (setq-local max-mini-window-height ivy-height)
+  (if (and ivy-fixed-height-minibuffer
+           (not (eq (ivy-state-caller ivy-last) 'ivy-completion-in-region)))
+      (set-window-text-height (selected-window)
+                              (+ ivy-height
+                                 (if ivy-add-newline-after-prompt
+                                     1
+                                   0)))
+    (when ivy-add-newline-after-prompt
+      (set-window-text-height (selected-window) 2)))
+  (add-hook 'post-command-hook #'ivy--queue-exhibit nil t)
+  ;; show completions with empty input
+  (ivy--exhibit))
+
+(defun ivy--input ()
+  "Return the current minibuffer input."
+  ;; assume one-line minibuffer input
+  (buffer-substring-no-properties
+   (minibuffer-prompt-end)
+   (line-end-position)))
+
+(defun ivy--cleanup ()
+  "Delete the displayed completion candidates."
+  (save-excursion
+    (goto-char (minibuffer-prompt-end))
+    (delete-region (line-end-position) (point-max))))
+
+(defun ivy-cleanup-string (str)
+  "Remove unwanted text properties from STR."
+  (remove-list-of-text-properties 0 (length str) '(field) str)
+  str)
+
+(defvar ivy-set-prompt-text-properties-function
+  'ivy-set-prompt-text-properties-default
+  "Function to set the text properties of the default ivy prompt.
+Called with two arguments, PROMPT and STD-PROPS.
+The returned value should be the updated PROMPT.")
+
+(defun ivy-set-prompt-text-properties-default (prompt std-props)
+  "Set text properties of PROMPT.
+STD-PROPS is a property list containing the default text properties."
+  (ivy--set-match-props prompt "confirm"
+                        `(face ivy-confirm-face ,@std-props))
+  (ivy--set-match-props prompt "match required"
+                        `(face ivy-match-required-face ,@std-props))
+  prompt)
+
+(defun ivy-prompt ()
+  "Return the current prompt."
+  (let ((fn (plist-get ivy--prompts-list (ivy-state-caller ivy-last))))
+    (if fn
+        (condition-case nil
+            (funcall fn)
+          (error
+           (warn "`counsel-prompt-function' should take 0 args")
+           ;; old behavior
+           (funcall fn (ivy-state-prompt ivy-last))))
+      ivy--prompt)))
+
+(defun ivy--insert-prompt ()
+  "Update the prompt according to `ivy--prompt'."
+  (when (setq ivy--prompt (ivy-prompt))
+    (unless (memq this-command '(ivy-done ivy-alt-done ivy-partial-or-done
+                                 counsel-find-symbol))
+      (setq ivy--prompt-extra ""))
+    (let (head tail)
+      (if (string-match "\\(.*?\\)\\(:? ?\\)\\'" ivy--prompt)
+          (progn
+            (setq head (match-string 1 ivy--prompt))
+            (setq tail (match-string 2 ivy--prompt)))
+        (setq head ivy--prompt)
+        (setq tail ""))
+      (let ((inhibit-read-only t)
+            (std-props '(front-sticky t rear-nonsticky t field t read-only t))
+            (n-str
+             (concat
+              (if (and (bound-and-true-p minibuffer-depth-indicate-mode)
+                       (> (minibuffer-depth) 1))
+                  (format "[%d] " (minibuffer-depth))
+                "")
+              (concat
+               (if (string-match "%d.*%d" ivy-count-format)
+                   (format head
+                           (1+ ivy--index)
+                           (or (and (ivy-state-dynamic-collection ivy-last)
+                                    ivy--full-length)
+                               ivy--length))
+                 (format head
+                         (or (and (ivy-state-dynamic-collection ivy-last)
+                                  ivy--full-length)
+                             ivy--length)))
+               ivy--prompt-extra
+               tail)))
+            (d-str (if ivy--directory
+                       (abbreviate-file-name ivy--directory)
+                     "")))
+        (save-excursion
+          (goto-char (point-min))
+          (delete-region (point-min) (minibuffer-prompt-end))
+          (let ((len-n (length n-str))
+                (len-d (length d-str))
+                (ww (window-width)))
+            (setq n-str
+                  (cond ((> (+ len-n len-d) ww)
+                         (concat n-str "\n" d-str "\n"))
+                        ((> (+ len-n len-d (length ivy-text)) ww)
+                         (concat n-str d-str "\n"))
+                        (t
+                         (concat n-str d-str)))))
+          (when ivy-add-newline-after-prompt
+            (setq n-str (concat n-str "\n")))
+          (let ((regex (format "\\([^\n]\\{%d\\}\\)[^\n]" (window-width))))
+            (while (string-match regex n-str)
+              (setq n-str (replace-match
+                           (concat (match-string 1 n-str) "\n")
+                           nil t n-str 1))))
+          (set-text-properties 0 (length n-str)
+                               `(face minibuffer-prompt ,@std-props)
+                               n-str)
+          (setq n-str (funcall ivy-set-prompt-text-properties-function
+                               n-str std-props))
+          (insert n-str))
+        ;; Mark prompt as selected if the user moves there or it is the only
+        ;; option left.  Since the user input stays put, we have to manually
+        ;; remove the face as well.
+        (when (ivy--prompt-selectable-p)
+          (if (or (= ivy--index -1)
+                  (= ivy--length 0))
+              (ivy-add-face-text-property
+               (minibuffer-prompt-end) (line-end-position) 'ivy-prompt-match)
+            (remove-list-of-text-properties
+             (minibuffer-prompt-end) (line-end-position) '(face))))
+        ;; get out of the prompt area
+        (constrain-to-field nil (point-max))))))
+
+(defun ivy--set-match-props (str match props &optional subexp)
+  "Set text properties of STR that match MATCH to PROPS.
+SUBEXP is a number which specifies the regexp group to use.
+If nil, the text properties are applied to the whole match."
+  (when (null subexp)
+    (setq subexp 0))
+  (when (string-match match str)
+    (set-text-properties
+     (match-beginning subexp)
+     (match-end subexp)
+     props
+     str)))
+
+(defvar inhibit-message)
+
+(defun ivy--sort-maybe (collection)
+  "Sort COLLECTION if needed."
+  (let ((sort (ivy-state-sort ivy-last)))
+    (if (and sort
+             (or (functionp sort)
+                 (functionp (setq sort (ivy--sort-function
+                                        (ivy-state-collection ivy-last))))))
+        (sort (copy-sequence collection) sort)
+      collection)))
+
+(defcustom ivy-magic-slash-non-match-action 'ivy-magic-slash-non-match-cd-selected
+  "Action to take when a slash is added to the end of a non existing directory.
+Possible choices are 'ivy-magic-slash-non-match-cd-selected,
+'ivy-magic-slash-non-match-create, or nil"
+  :type '(choice
+          (const :tag "Use currently selected directory"
+           ivy-magic-slash-non-match-cd-selected)
+          (const :tag "Create and use new directory"
+           ivy-magic-slash-non-match-create)
+          (const :tag "Do nothing"
+           nil)))
+
+(defun ivy--create-and-cd (dir)
+  "When completing file names, create directory DIR and move there."
+  (make-directory dir)
+  (ivy--cd dir))
+
+(defun ivy--magic-file-slash ()
+  "Handle slash when completing file names."
+  (when (or (and (eq this-command 'self-insert-command)
+                 (eolp))
+            (eq this-command 'ivy-partial-or-done))
+    (cond ((member ivy-text ivy--all-candidates)
+           (ivy--cd (expand-file-name ivy-text ivy--directory)))
+          ((string-match "//\\'" ivy-text)
+           (if (and default-directory
+                    (string-match "\\`[[:alpha:]]:/" default-directory))
+               (ivy--cd (match-string 0 default-directory))
+             (ivy--cd "/")))
+          ((string-match "\\`/ssh:" ivy-text)
+           (ivy--cd (file-name-directory ivy-text)))
+          ((string-match "[[:alpha:]]:/\\'" ivy-text)
+           (let ((drive-root (match-string 0 ivy-text)))
+             (when (file-exists-p drive-root)
+               (ivy--cd drive-root))))
+          ((and (file-exists-p ivy-text)
+                (not (string= ivy-text "/"))
+                (file-directory-p ivy-text))
+           (ivy--cd (expand-file-name ivy-text)))
+          ((and (or (> ivy--index 0)
+                    (= ivy--length 1)
+                    (not (string= ivy-text "/")))
+                (let ((default-directory ivy--directory))
+                  (and
+                   (not (equal (ivy-state-current ivy-last) ""))
+                   (file-directory-p (ivy-state-current ivy-last))
+                   (file-exists-p (ivy-state-current ivy-last)))))
+           (when (eq ivy-magic-slash-non-match-action 'ivy-magic-slash-non-match-cd-selected)
+             (ivy--cd
+              (expand-file-name (ivy-state-current ivy-last) ivy--directory)))
+           (when (and (eq ivy-magic-slash-non-match-action 'ivy-magic-slash-non-match-create)
+                      (not (string= ivy-text "/")))
+             (ivy--create-and-cd (expand-file-name ivy-text ivy--directory))))
+          (t
+           (when (and
+                  (eq ivy-magic-slash-non-match-action 'ivy-magic-slash-non-match-create)
+                  (not (string= ivy-text "/")))
+             (ivy--create-and-cd (expand-file-name ivy-text ivy--directory)))))))
+
+(defcustom ivy-magic-tilde t
+  "When non-nil, ~ will move home when selecting files.
+Otherwise, ~/ will move home."
+  :type 'boolean)
+
+(defcustom ivy-dynamic-exhibit-delay-ms 0
+  "Delay in ms before dynamic collections are refreshed"
+  :type 'integer)
+
+(defvar ivy--exhibit-timer nil)
+
+(defun ivy--queue-exhibit ()
+  "Insert Ivy completions display, possibly after a timeout for
+dynamic collections.
+Should be run via minibuffer `post-command-hook'."
+  (if (and (> ivy-dynamic-exhibit-delay-ms 0)
+           (ivy-state-dynamic-collection ivy-last))
+      (progn
+        (when ivy--exhibit-timer (cancel-timer ivy--exhibit-timer))
+        (setq ivy--exhibit-timer
+              (run-with-timer
+               (/ ivy-dynamic-exhibit-delay-ms 1000.0)
+               nil
+               'ivy--exhibit)))
+    (ivy--exhibit)))
+
+(defun ivy--exhibit ()
+  "Insert Ivy completions display.
+Should be run via minibuffer `post-command-hook'."
+  (when (memq 'ivy--queue-exhibit post-command-hook)
+    (let ((inhibit-field-text-motion nil))
+      (constrain-to-field nil (point-max)))
+    (setq ivy-text (ivy--input))
+    (if (ivy-state-dynamic-collection ivy-last)
+        ;; while-no-input would cause annoying
+        ;; "Waiting for process to die...done" message interruptions
+        (let ((inhibit-message t))
+          (unless (equal ivy--old-text ivy-text)
+            (while-no-input
+              (setq ivy--all-candidates
+                    (ivy--sort-maybe
+                     (funcall (ivy-state-collection ivy-last) ivy-text)))
+              (setq ivy--old-text ivy-text)))
+          (when (or ivy--all-candidates
+                    (not (get-process " *counsel*")))
+            (ivy--insert-minibuffer
+             (ivy--format ivy--all-candidates))))
+      (cond (ivy--directory
+             (cond ((or (string= "~/" ivy-text)
+                        (and (string= "~" ivy-text)
+                             ivy-magic-tilde))
+                    (ivy--cd (expand-file-name "~/")))
+                   ((string-match "/\\'" ivy-text)
+                    (ivy--magic-file-slash))))
+            ((eq (ivy-state-collection ivy-last) 'internal-complete-buffer)
+             (when (or (and (string-match "\\` " ivy-text)
+                            (not (string-match "\\` " ivy--old-text)))
+                       (and (string-match "\\` " ivy--old-text)
+                            (not (string-match "\\` " ivy-text))))
+               (setq ivy--all-candidates
+                     (if (and (> (length ivy-text) 0)
+                              (eq (aref ivy-text 0)
+                                  ?\ ))
+                         (ivy--buffer-list " ")
+                       (ivy--buffer-list "" ivy-use-virtual-buffers)))
+               (setq ivy--old-re nil))))
+      (ivy--insert-minibuffer
+       (with-current-buffer (ivy-state-buffer ivy-last)
+         (ivy--format
+          (ivy--filter ivy-text ivy--all-candidates))))
+      (setq ivy--old-text ivy-text))))
+
+(defun ivy-display-function-fallback (str)
+  (let ((buffer-undo-list t))
+    (save-excursion
+      (forward-line 1)
+      (insert str))))
+
+(defun ivy--insert-minibuffer (text)
+  "Insert TEXT into minibuffer with appropriate cleanup."
+  (let ((resize-mini-windows nil)
+        (update-fn (ivy-state-update-fn ivy-last))
+        (old-mark (marker-position (mark-marker)))
+        deactivate-mark)
+    (ivy--cleanup)
+    (when update-fn
+      (funcall update-fn))
+    (ivy--insert-prompt)
+    ;; Do nothing if while-no-input was aborted.
+    (when (stringp text)
+      (if ivy-display-function
+          (funcall ivy-display-function text)
+        (ivy-display-function-fallback text)))
+    (when (display-graphic-p)
+      (ivy--resize-minibuffer-to-fit))
+    ;; prevent region growing due to text remove/add
+    (when (region-active-p)
+      (set-mark old-mark))))
+
+(defun ivy--resize-minibuffer-to-fit ()
+  "Resize the minibuffer window size to fit the text in the minibuffer."
+  (unless (frame-root-window-p (minibuffer-window))
+    (with-selected-window (minibuffer-window)
+      (if (fboundp 'window-text-pixel-size)
+          (let ((text-height (cdr (window-text-pixel-size)))
+                (body-height (window-body-height nil t)))
+            (when (> text-height body-height)
+              ;; Note: the size increment needs to be at least
+              ;; frame-char-height, otherwise resizing won't do
+              ;; anything.
+              (let ((delta (max (- text-height body-height)
+                                (frame-char-height))))
+                (window-resize nil delta nil t t))))
+        (let ((text-height (count-screen-lines))
+              (body-height (window-body-height)))
+          (when (> text-height body-height)
+            (window-resize nil (- text-height body-height) nil t)))))))
+
+(defun ivy--add-face (str face)
+  "Propertize STR with FACE.
+`font-lock-append-text-property' is used, since it's better than
+`propertize' or `add-face-text-property' in this case."
+  (let ((len (length str)))
+    (condition-case nil
+        (progn
+          (colir-blend-face-background 0 len face str)
+          (let ((foreground (face-foreground face)))
+            (when foreground
+              (ivy-add-face-text-property
+               0 len (list :foreground foreground) str))))
+      (error
+       (ignore-errors
+         (font-lock-append-text-property 0 len 'face face str)))))
+  str)
+
+(declare-function flx-make-string-cache "ext:flx")
+(declare-function flx-score "ext:flx")
+
+(defvar ivy--flx-cache nil)
+
+(eval-after-load 'flx
+  '(setq ivy--flx-cache (flx-make-string-cache)))
+
+(defun ivy-toggle-case-fold ()
+  "Toggle `case-fold-search' for Ivy operations.
+
+Instead of modifying `case-fold-search' directly, this command
+toggles `ivy-case-fold-search', which can take on more values
+than the former, between nil and either `auto' or t.  See
+`ivy-case-fold-search-default' for the meaning of these values.
+
+In any Ivy completion session, the case folding starts with
+`ivy-case-fold-search-default'."
+  (interactive)
+  (setq ivy-case-fold-search
+        (and (not ivy-case-fold-search)
+             (or ivy-case-fold-search-default 'auto)))
+  ;; Reset cache so that the candidate list updates.
+  (setq ivy--old-re nil))
+
+(defun ivy--re-filter (re candidates &optional mkpred)
+  "Return all RE matching CANDIDATES.
+RE is a list of cons cells, with a regexp car and a boolean cdr.
+When the cdr is t, the car must match.
+Otherwise, the car must not match."
+  (ignore-errors
+    (dolist (re (if (stringp re) (list (cons re t)) re))
+      (let* ((re-str (car re))
+             (pred
+              (if mkpred
+                  (funcall mkpred re-str)
+                (lambda (x) (string-match re-str x)))))
+        (setq candidates
+              (cl-remove nil candidates
+                         (if (cdr re) :if-not :if)
+                         pred))))
+    candidates))
+
+(defun ivy--filter (name candidates)
+  "Return all items that match NAME in CANDIDATES.
+CANDIDATES are assumed to be static."
+  (let ((re (funcall ivy--regex-function name)))
+    (if (and
+         ivy--old-re
+         ivy--old-cands
+         (equal re ivy--old-re))
+        ;; quick caching for "C-n", "C-p" etc.
+        ivy--old-cands
+      (let* ((re-str (if (listp re) (caar re) re))
+             (matcher (ivy-state-matcher ivy-last))
+             (case-fold-search (ivy--case-fold-p name))
+             (cands (cond
+                      (matcher
+                       (funcall matcher re candidates))
+                      ((and ivy--old-re
+                            (stringp re)
+                            (stringp ivy--old-re)
+                            (not (string-match "\\\\" ivy--old-re))
+                            (not (equal ivy--old-re ""))
+                            (memq (cl-search
+                                   (if (string-match "\\\\)\\'" ivy--old-re)
+                                       (substring ivy--old-re 0 -2)
+                                     ivy--old-re)
+                                   re)
+                                  '(0 2)))
+                       (ignore-errors
+                         (cl-remove-if-not
+                          (lambda (x) (string-match re x))
+                          ivy--old-cands)))
+                      (t
+                       (ivy--re-filter re candidates)))))
+        (if (memq (cdr (assoc (ivy-state-caller ivy-last)
+                              ivy-index-functions-alist))
+                  '(ivy-recompute-index-swiper
+                    ivy-recompute-index-swiper-async))
+            (progn
+              (ivy--recompute-index name re-str cands)
+              (setq ivy--old-cands (ivy--sort name cands)))
+          (setq ivy--old-cands (ivy--sort name cands))
+          (ivy--recompute-index name re-str ivy--old-cands))
+        (setq ivy--old-re re)
+        ivy--old-cands))))
+
+(defun ivy--set-candidates (x)
+  "Update `ivy--all-candidates' with X."
+  (let (res)
+    (dolist (source ivy--extra-candidates)
+      (if (equal source '(original-source))
+          (if (null res)
+              (setq res x)
+            (setq res (append x res)))
+        (setq ivy--old-re nil)
+        (setq res (append
+                   (ivy--filter ivy-text (cadr source))
+                   res))))
+    (setq ivy--all-candidates res)))
+
+(defcustom ivy-sort-matches-functions-alist
+  '((t . nil)
+    (ivy-switch-buffer . ivy-sort-function-buffer))
+  "An alist of functions for sorting matching candidates.
+
+Unlike `ivy-sort-functions-alist', which is used to sort the
+whole collection only once, this alist of functions are used to
+sort only matching candidates after each change in input.
+
+The alist KEY is either a collection function or t to match
+previously unmatched collection functions.
+
+The alist VAL is a sorting function with the signature of
+`ivy--prefix-sort'."
+  :type '(alist
+          :key-type (choice
+                     (const :tag "Fall-through" t)
+                     (symbol :tag "Collection"))
+          :value-type
+          (choice
+           (const :tag "Don't sort" nil)
+           (const :tag "Put prefix matches ahead" ivy--prefix-sort)
+           (function :tag "Custom sort function"))))
+
+(defun ivy--sort-files-by-date (_name candidates)
+  "Re-sort CANDIDATES according to file modification date."
+  (let ((default-directory ivy--directory))
+    (sort (copy-sequence candidates) #'file-newer-than-file-p)))
+
+(defvar ivy--flx-featurep (require 'flx nil 'noerror))
+
+(defun ivy--sort (name candidates)
+  "Re-sort candidates by NAME.
+All CANDIDATES are assumed to match NAME."
+  (let ((key (or (ivy-state-caller ivy-last)
+                 (when (functionp (ivy-state-collection ivy-last))
+                   (ivy-state-collection ivy-last))
+                 this-command))
+        fun)
+    (cond ((and ivy--flx-featurep
+                (eq ivy--regex-function 'ivy--regex-fuzzy))
+           (ivy--flx-sort name candidates))
+          ((setq fun (ivy-alist-setting ivy-sort-matches-functions-alist key))
+           (funcall fun name candidates))
+          (t
+           candidates))))
+
+(defun ivy--prefix-sort (name candidates)
+  "Re-sort candidates by NAME.
+All CANDIDATES are assumed to match NAME.
+Prefix matches to NAME are put ahead of the list."
+  (if (or (string-match "^\\^" name) (string= name ""))
+      candidates
+    (let ((re-prefix (concat "^" (funcall ivy--regex-function name)))
+          res-prefix
+          res-noprefix)
+      (dolist (s candidates)
+        (if (string-match re-prefix s)
+            (push s res-prefix)
+          (push s res-noprefix)))
+      (nconc
+       (nreverse res-prefix)
+       (nreverse res-noprefix)))))
+
+(defvar ivy--virtual-buffers nil
+  "Store the virtual buffers alist.")
+
+(defun ivy-generic-regex-to-str (re)
+  "Transform RE to a string.
+
+Functions like `ivy--regex-ignore-order' return a cons list.
+This function extracts a string from the cons list."
+  (if (consp re) (caar re) re))
+
+(defun ivy-sort-function-buffer (name candidates)
+  "Re-sort candidates by NAME.
+CANDIDATES is a list of buffer names each containing NAME.
+Sort open buffers before virtual buffers, and prefix matches
+before substring matches."
+  (if (or (string-match "^\\^" name) (string= name ""))
+      candidates
+    (let* ((base-re (ivy-generic-regex-to-str (funcall ivy--regex-function name)))
+           (re-prefix (concat "^\\*" base-re))
+           res-prefix
+           res-noprefix
+           res-virtual-prefix
+           res-virtual-noprefix)
+      (unless (cl-find-if (lambda (s) (string-match re-prefix s)) candidates)
+        (setq re-prefix (concat "^" base-re)))
+      (dolist (s candidates)
+        (cond
+          ((and (assoc s ivy--virtual-buffers) (string-match re-prefix s))
+           (push s res-virtual-prefix))
+          ((assoc s ivy--virtual-buffers)
+           (push s res-virtual-noprefix))
+          ((string-match re-prefix s)
+           (push s res-prefix))
+          (t
+           (push s res-noprefix))))
+      (nconc
+       (nreverse res-prefix)
+       (nreverse res-noprefix)
+       (nreverse res-virtual-prefix)
+       (nreverse res-virtual-noprefix)))))
+
+(defun ivy--recompute-index (name re-str cands)
+  "Recompute index of selected candidate matching NAME.
+RE-STR is the regexp, CANDS are the current candidates."
+  (let* ((caller (ivy-state-caller ivy-last))
+         (func (or
+                (ivy-alist-setting ivy-index-functions-alist)
+                #'ivy-recompute-index-zero))
+         (case-fold-search (ivy--case-fold-p name))
+         (preselect (ivy-state-preselect ivy-last))
+         (current (ivy-state-current ivy-last)))
+    (unless (eq this-command 'ivy-resume)
+      (ivy-set-index
+       (or
+        (cl-position (if (and (> (length name) 0)
+                              (eq ?^ (aref name 0)))
+                         (substring name 1)
+                       name)
+                     cands
+                     :test #'ivy--case-fold-string=)
+        (and ivy--directory
+             (cl-position (concat re-str "/")
+                          cands
+                          :test #'ivy--case-fold-string=))
+        (and (eq caller 'ivy-switch-buffer)
+             (> (length name) 0)
+             0)
+        (and (not (string= name ""))
+             (not (and ivy--flx-featurep
+                       (eq ivy--regex-function 'ivy--regex-fuzzy)
+                       (< (length cands) 200)))
+             ;; If there was a preselected candidate, don't try to
+             ;; keep it selected even if the regexp still matches it.
+             ;; See issue #1563.  See also `ivy--preselect-index',
+             ;; which this logic roughly mirrors.
+             (not (or
+                   (and (integerp preselect)
+                        (= ivy--index preselect))
+                   (equal current preselect)
+                   (and (stringp preselect)
+                        (stringp current)
+                        (string-match-p preselect current))))
+             ivy--old-cands
+             (cl-position current cands :test #'equal))
+        (funcall func re-str cands))))
+    (when (or (string= name "")
+              (string= name "^"))
+      (ivy-set-index
+       (or (ivy--preselect-index preselect cands)
+           ivy--index)))))
+
+(defun ivy-recompute-index-swiper (_re-str cands)
+  "Recompute index of selected candidate when using `swiper'.
+CANDS are the current candidates."
+  (condition-case nil
+      (let ((tail (nthcdr ivy--index ivy--old-cands))
+            idx)
+        (if (and tail ivy--old-cands (not (equal "^" ivy--old-re)))
+            (progn
+              (while (and tail (null idx))
+                ;; Compare with eq to handle equal duplicates in cands
+                (setq idx (cl-position (pop tail) cands)))
+              (or
+               idx
+               (1- (length cands))))
+          (if ivy--old-cands
+              ivy--index
+            ;; already in ivy-state-buffer
+            (let ((n (line-number-at-pos))
+                  (res 0)
+                  (i 0))
+              (dolist (c cands)
+                (when (eq n (read (get-text-property 0 'swiper-line-number c)))
+                  (setq res i))
+                (cl-incf i))
+              res))))
+    (error 0)))
+
+(defun ivy-recompute-index-swiper-async (_re-str cands)
+  "Recompute index of selected candidate when using `swiper' asynchronously.
+CANDS are the current candidates."
+  (if (null ivy--old-cands)
+      (let ((ln (with-ivy-window
+                  (line-number-at-pos))))
+        (or
+         ;; closest to current line going forwards
+         (cl-position-if (lambda (x)
+                           (>= (string-to-number x) ln))
+                         cands)
+         ;; closest to current line going backwards
+         (1- (length cands))))
+    (let ((tail (nthcdr ivy--index ivy--old-cands))
+          idx)
+      (if (and tail ivy--old-cands (not (equal "^" ivy--old-re)))
+          (progn
+            (while (and tail (null idx))
+              ;; Compare with `equal', since the collection is re-created
+              ;; each time with `split-string'
+              (setq idx (cl-position (pop tail) cands :test #'equal)))
+            (or idx 0))
+        ivy--index))))
+
+(defun ivy-recompute-index-zero (_re-str _cands)
+  "Recompute index of selected candidate.
+This function serves as a fallback when nothing else is available."
+  0)
+
+(defcustom ivy-minibuffer-faces
+  '(ivy-minibuffer-match-face-1
+    ivy-minibuffer-match-face-2
+    ivy-minibuffer-match-face-3
+    ivy-minibuffer-match-face-4)
+  "List of `ivy' faces for minibuffer group matches."
+  :type '(repeat :tag "Faces"
+          (choice
+           (const ivy-minibuffer-match-face-1)
+           (const ivy-minibuffer-match-face-2)
+           (const ivy-minibuffer-match-face-3)
+           (const ivy-minibuffer-match-face-4)
+           (face :tag "Other face"))))
+
+(defvar ivy-flx-limit 200
+  "Used to conditionally turn off flx sorting.
+
+When the amount of matching candidates exceeds this limit, then
+no sorting is done.")
+
+(defun ivy--flx-propertize (x)
+  "X is (cons (flx-score STR ...) STR)."
+  (let ((str (copy-sequence (cdr x)))
+        (i 0)
+        (last-j -2))
+    (dolist (j (cdar x))
+      (unless (eq j (1+ last-j))
+        (cl-incf i))
+      (setq last-j j)
+      (ivy-add-face-text-property
+       j (1+ j)
+       (nth (1+ (mod (+ i 2) (1- (length ivy-minibuffer-faces))))
+            ivy-minibuffer-faces)
+       str))
+    str))
+
+(defun ivy--flx-sort (name cands)
+  "Sort according to closeness to string NAME the string list CANDS."
+  (condition-case nil
+      (let* ((bolp (= (string-to-char name) ?^))
+             ;; An optimized regex for fuzzy matching
+             ;; "abc" → "^[^a]*a[^b]*b[^c]*c"
+             (fuzzy-regex (concat "^"
+                                  (and bolp (regexp-quote (substring name 1 2)))
+                                  (mapconcat
+                                   (lambda (x)
+                                     (setq x (char-to-string x))
+                                     (concat "[^" x "]*" (regexp-quote x)))
+                                   (if bolp (substring name 2) name)
+                                   "")))
+             ;; Strip off the leading "^" for flx matching
+             (flx-name (if bolp (substring name 1) name))
+             cands-left
+             cands-to-sort)
+
+        ;; Filter out non-matching candidates
+        (dolist (cand cands)
+          (when (string-match-p fuzzy-regex cand)
+            (push cand cands-left)))
+
+        ;; pre-sort the candidates by length before partitioning
+        (setq cands-left (cl-sort cands-left #'< :key #'length))
+
+        ;; partition the candidates into sorted and unsorted groups
+        (dotimes (_ (min (length cands-left) ivy-flx-limit))
+          (push (pop cands-left) cands-to-sort))
+
+        (nconc
+         ;; Compute all of the flx scores in one pass and sort
+         (mapcar #'car
+                 (sort (mapcar
+                        (lambda (cand)
+                          (cons cand
+                                (car (flx-score cand flx-name ivy--flx-cache))))
+                        cands-to-sort)
+                       (lambda (c1 c2)
+                         ;; Break ties by length
+                         (if (/= (cdr c1) (cdr c2))
+                             (> (cdr c1)
+                                (cdr c2))
+                           (< (length (car c1))
+                              (length (car c2)))))))
+
+         ;; Add the unsorted candidates
+         cands-left))
+    (error cands)))
+
+(defun ivy--truncate-string (str width)
+  "Truncate STR to WIDTH."
+  (truncate-string-to-width str width nil nil t))
+
+(defun ivy--format-function-generic (selected-fn other-fn cands separator)
+  "Transform candidates into a string for minibuffer.
+SELECTED-FN is called for the selected candidate, OTHER-FN for the others.
+Both functions take one string argument each.  CANDS is a list of candidates
+and SEPARATOR is used to join them."
+  (let ((i -1))
+    (mapconcat
+     (lambda (str)
+       (let ((curr (eq (cl-incf i) ivy--window-index)))
+         (if curr
+             (funcall selected-fn str)
+           (funcall other-fn str))))
+     cands
+     separator)))
+
+(defun ivy-format-function-default (cands)
+  "Transform CANDS into a string for minibuffer."
+  (ivy--format-function-generic
+   (lambda (str)
+     (ivy--add-face str 'ivy-current-match))
+   #'identity
+   cands
+   "\n"))
+
+(defun ivy-format-function-arrow (cands)
+  "Transform CANDS into a string for minibuffer."
+  (ivy--format-function-generic
+   (lambda (str)
+     (concat "> " (ivy--add-face str 'ivy-current-match)))
+   (lambda (str)
+     (concat "  " str))
+   cands
+   "\n"))
+
+(defun ivy-format-function-line (cands)
+  "Transform CANDS into a string for minibuffer."
+  (ivy--format-function-generic
+   (lambda (str)
+     (ivy--add-face (concat str "\n") 'ivy-current-match))
+   (lambda (str)
+     (concat str "\n"))
+   cands
+   ""))
+
+(defalias 'ivy-add-face-text-property
+  (if (fboundp 'add-face-text-property)
+      (lambda (start end face &optional object append)
+        (add-face-text-property start end face append object))
+    (lambda (start end face &optional object append)
+      (funcall (if append
+                   #'font-lock-append-text-property
+                 #'font-lock-prepend-text-property)
+               start end 'face face object)))
+  "Compatibility shim for `add-face-text-property'.
+Fall back on `font-lock-prepend-text-property' in Emacs versions
+prior to 24.4 (`font-lock-append-text-property' when APPEND is
+non-nil).
+Note: The usual last two arguments are flipped for convenience.")
+
+(defun ivy--highlight-ignore-order (str)
+  "Highlight STR, using the ignore-order method."
+  (when (consp ivy--old-re)
+    (let ((i 1))
+      (dolist (re ivy--old-re)
+        (when (string-match (car re) str)
+          (ivy-add-face-text-property
+           (match-beginning 0) (match-end 0)
+           (nth (1+ (mod (+ i 2) (1- (length ivy-minibuffer-faces))))
+                ivy-minibuffer-faces)
+           str))
+        (cl-incf i))))
+  str)
+
+(defun ivy--highlight-fuzzy (str)
+  "Highlight STR, using the fuzzy method."
+  (if ivy--flx-featurep
+      (let ((flx-name (if (string-match "^\\^" ivy-text)
+                          (substring ivy-text 1)
+                        ivy-text)))
+        (ivy--flx-propertize
+         (cons (flx-score str flx-name ivy--flx-cache) str)))
+    (ivy--highlight-default str)))
+
+(defun ivy--highlight-default (str)
+  "Highlight STR, using the default method."
+  (unless ivy--old-re
+    (setq ivy--old-re (funcall ivy--regex-function ivy-text)))
+  (let ((start
+         (if (and (memq (ivy-state-caller ivy-last) ivy-highlight-grep-commands)
+                  (string-match "^[^:]+:[^:]+:" str))
+             (match-end 0)
+           0))
+        (regexps
+         (if (listp ivy--old-re)
+             (mapcar #'car (cl-remove-if-not #'cdr ivy--old-re))
+           (list ivy--old-re))))
+    (dolist (re regexps)
+      (ignore-errors
+        (while (and (string-match re str start)
+                    (> (- (match-end 0) (match-beginning 0)) 0))
+          (setq start (match-end 0))
+          (let ((i 0))
+            (while (<= i ivy--subexps)
+              (let ((face
+                     (cond ((zerop ivy--subexps)
+                            (cadr ivy-minibuffer-faces))
+                           ((zerop i)
+                            (car ivy-minibuffer-faces))
+                           (t
+                            (nth (1+ (mod (+ i 2)
+                                          (1- (length ivy-minibuffer-faces))))
+                                 ivy-minibuffer-faces)))))
+                (ivy-add-face-text-property
+                 (match-beginning i) (match-end i)
+                 face str))
+              (cl-incf i)))))))
+  str)
+
+(defun ivy--format-minibuffer-line (str)
+  "Format line STR for use in minibuffer."
+  (let* ((str (ivy-cleanup-string str))
+         (str (if (eq ivy-display-style 'fancy)
+                  (funcall ivy--highlight-function (copy-sequence str))
+                (copy-sequence str))))
+    (add-text-properties
+     0 (length str)
+     '(mouse-face
+       ivy-minibuffer-match-highlight
+       help-echo
+       (format
+        (if tooltip-mode
+            "mouse-1: %s\nmouse-3: %s"
+          "mouse-1: %s   mouse-3: %s")
+        ivy-mouse-1-tooltip ivy-mouse-3-tooltip))
+     str)
+    (let ((annotation-function (plist-get completion-extra-properties :annotation-function)))
+      (if annotation-function
+          (concat str (funcall annotation-function str))
+        str))))
+
+(ivy-set-display-transformer
+ 'counsel-find-file 'ivy-read-file-transformer)
+(ivy-set-display-transformer
+ 'read-file-name-internal 'ivy-read-file-transformer)
+
+(defun ivy-read-file-transformer (str)
+  "Transform candidate STR when reading files."
+  (if (ivy--dirname-p str)
+      (propertize str 'face 'ivy-subdir)
+    str))
+
+(defun ivy--format (cands)
+  "Return a string for CANDS suitable for display in the minibuffer.
+CANDS is a list of strings."
+  (setq ivy--length (length cands))
+  (when (>= ivy--index ivy--length)
+    (ivy-set-index (max (1- ivy--length) 0)))
+  (if (null cands)
+      (setf (ivy-state-current ivy-last) "")
+    (setf (ivy-state-current ivy-last) (copy-sequence (nth ivy--index cands)))
+    (let* ((half-height (/ ivy-height 2))
+           (start (max 0 (- ivy--index half-height)))
+           (end (min (+ start (1- ivy-height)) ivy--length))
+           (start (max 0 (min start (- end (1- ivy-height)))))
+           (wnd-cands (cl-subseq cands start end))
+           transformer-fn)
+      (setq ivy--window-index (- ivy--index start))
+      (when (setq transformer-fn (ivy-state-display-transformer-fn ivy-last))
+        (with-ivy-window
+          (with-current-buffer (ivy-state-buffer ivy-last)
+            (setq wnd-cands (mapcar transformer-fn wnd-cands)))))
+      (ivy--wnd-cands-to-str wnd-cands))))
+
+(defun ivy--wnd-cands-to-str (wnd-cands)
+  (let ((str (concat "\n"
+                     (funcall ivy-format-function
+                              (mapcar
+                               #'ivy--format-minibuffer-line
+                               wnd-cands)))))
+    (put-text-property 0 (length str) 'read-only nil str)
+    str))
+
+(defvar recentf-list)
+(defvar bookmark-alist)
+
+(defcustom ivy-virtual-abbreviate 'name
+  "The mode of abbreviation for virtual buffer names."
+  :type '(choice
+          (const :tag "Only name" name)
+          (const :tag "Abbreviated path" abbreviate)
+          (const :tag "Full path" full)
+          ;; eventually, uniquify
+          ))
+(declare-function bookmark-maybe-load-default-file "bookmark")
+(declare-function bookmark-get-filename "bookmark")
+
+(defun ivy--virtual-buffers ()
+  "Adapted from `ido-add-virtual-buffers-to-list'."
+  (require 'bookmark)
+  (unless recentf-mode
+    (recentf-mode 1))
+  (let (virtual-buffers)
+    (bookmark-maybe-load-default-file)
+    (dolist (head (append
+                   (copy-sequence recentf-list)
+                   (delete "   - no file -"
+                           (delq nil (mapcar #'bookmark-get-filename
+                                             (copy-sequence bookmark-alist))))))
+      (let ((file-name (if (stringp head)
+                           head
+                         (cdr head)))
+            name)
+        (setq name
+              (cond ((eq ivy-virtual-abbreviate 'name)
+                     (file-name-nondirectory file-name))
+                    ((eq ivy-virtual-abbreviate 'abbreviate)
+                     (abbreviate-file-name file-name))
+                    (t
+                     (expand-file-name file-name))))
+        (when (equal name "")
+          (if (consp head)
+              (setq name (car head))
+            (setq name (file-name-nondirectory
+                        (directory-file-name file-name)))))
+        (and (not (equal name ""))
+             (null (get-file-buffer file-name))
+             (not (assoc name virtual-buffers))
+             (push (cons name file-name) virtual-buffers))))
+    (when virtual-buffers
+      (dolist (comp virtual-buffers)
+        (put-text-property 0 (length (car comp))
+                           'face 'ivy-virtual
+                           (car comp)))
+      (setq ivy--virtual-buffers (nreverse virtual-buffers))
+      (mapcar #'car ivy--virtual-buffers))))
+
+(defcustom ivy-ignore-buffers '("\\` ")
+  "List of regexps or functions matching buffer names to ignore."
+  :type '(repeat (choice regexp function)))
+
+(defvar ivy-switch-buffer-faces-alist '((dired-mode . ivy-subdir)
+                                        (org-mode . org-level-4))
+  "Store face customizations for `ivy-switch-buffer'.
+Each KEY is `major-mode', each VALUE is a face name.")
+
+(defun ivy--buffer-list (str &optional virtual predicate)
+  "Return the buffers that match STR.
+If VIRTUAL is non-nil, add virtual buffers.
+If optional argument PREDICATE is non-nil, use it to test each
+possible match.  See `all-completions' for further information."
+  (delete-dups
+   (append
+    (mapcar
+     (lambda (x)
+       (if (with-current-buffer x
+             (and default-directory
+                  (file-remote-p
+                   (abbreviate-file-name default-directory))))
+           (propertize x 'face 'ivy-remote)
+         (let ((face (with-current-buffer x
+                       (cdr (assoc major-mode
+                                   ivy-switch-buffer-faces-alist)))))
+           (if face
+               (propertize x 'face face)
+             x))))
+     (all-completions str 'internal-complete-buffer predicate))
+    (and virtual
+         (ivy--virtual-buffers)))))
+
+(defvar ivy-views (and nil
+                       `(("ivy + *scratch* {}"
+                          (vert
+                           (file ,(expand-file-name "ivy.el"))
+                           (buffer "*scratch*")))
+                         ("swiper + *scratch* {}"
+                          (horz
+                           (file ,(expand-file-name "swiper.el"))
+                           (buffer "*scratch*")))))
+  "Store window configurations selectable by `ivy-switch-buffer'.
+
+The default value is given as an example.
+
+Each element is a list of (NAME TREE).  NAME is a string, it's
+recommended to end it with a distinctive snippet e.g. \"{}\" so
+that it's easy to distinguish the window configurations.
+
+TREE is a nested list with the following valid cars:
+- vert: split the window vertically
+- horz: split the window horizontally
+- file: open the specified file
+- buffer: open the specified buffer
+
+TREE can be nested multiple times to have multiple window splits.")
+
+(defun ivy-default-view-name ()
+  "Return default name for new view."
+  (let* ((default-view-name
+          (concat "{} "
+                  (mapconcat #'identity
+                             (sort
+                              (mapcar (lambda (w)
+                                        (let* ((b (window-buffer w))
+                                               (f (buffer-file-name b)))
+                                          (if f
+                                              (file-name-nondirectory f)
+                                            (buffer-name b))))
+                                      (window-list))
+                              #'string-lessp)
+                             " ")))
+         (view-name-re (concat "\\`"
+                               (regexp-quote default-view-name)
+                               " \\([0-9]+\\)"))
+         old-view)
+    (cond ((setq old-view
+                 (cl-find-if
+                  (lambda (x)
+                    (string-match view-name-re (car x)))
+                  ivy-views))
+           (format "%s %d"
+                   default-view-name
+                   (1+ (string-to-number
+                        (match-string 1 (car old-view))))))
+          ((assoc default-view-name ivy-views)
+           (concat default-view-name " 1"))
+          (t
+           default-view-name))))
+
+(defun ivy-push-view ()
+  "Push the current window tree on `ivy-views'.
+Currently, the split configuration (i.e. horizonal or vertical)
+and point positions are saved, but the split positions aren't.
+Use `ivy-pop-view' to delete any item from `ivy-views'."
+  (interactive)
+  (let* ((view (cl-labels
+                   ((ft (tr)
+                      (if (consp tr)
+                          (if (eq (car tr) t)
+                              (cons 'vert
+                                    (mapcar #'ft (cddr tr)))
+                            (cons 'horz
+                                  (mapcar #'ft (cddr tr))))
+                        (with-current-buffer (window-buffer tr)
+                          (cond ((buffer-file-name)
+                                 (list 'file (buffer-file-name) (point)))
+                                ((eq major-mode 'dired-mode)
+                                 (list 'file default-directory (point)))
+                                (t
+                                 (list 'buffer (buffer-name) (point))))))))
+                 (ft (car (window-tree)))))
+         (view-name (ivy-read "Name view: " nil
+                              :initial-input (ivy-default-view-name))))
+    (when view-name
+      (push (list view-name view) ivy-views))))
+
+(defun ivy-pop-view-action (view)
+  "Delete VIEW from `ivy-views'."
+  (setq ivy-views (delete view ivy-views))
+  (setq ivy--all-candidates
+        (delete (car view) ivy--all-candidates))
+  (setq ivy--old-cands nil))
+
+(defun ivy-pop-view ()
+  "Delete a view to delete from `ivy-views'."
+  (interactive)
+  (ivy-read "Pop view: " ivy-views
+            :preselect (caar ivy-views)
+            :action #'ivy-pop-view-action
+            :caller 'ivy-pop-view))
+
+(defun ivy-source-views ()
+  "Return the name of the views saved in `ivy-views'."
+  (mapcar #'car ivy-views))
+
+(ivy-set-sources
+ 'ivy-switch-buffer
+ '((original-source)
+   (ivy-source-views)))
+
+(defun ivy-set-view-recur (view)
+  "Set VIEW recursively."
+  (cond ((eq (car view) 'vert)
+         (let* ((wnd1 (selected-window))
+                (wnd2 (split-window-vertically))
+                (views (cdr view))
+                (v (pop views)))
+           (with-selected-window wnd1
+             (ivy-set-view-recur v))
+           (while (setq v (pop views))
+             (with-selected-window wnd2
+               (ivy-set-view-recur v))
+             (when views
+               (setq wnd2 (split-window-vertically))))))
+        ((eq (car view) 'horz)
+         (let* ((wnd1 (selected-window))
+                (wnd2 (split-window-horizontally))
+                (views (cdr view))
+                (v (pop views)))
+           (with-selected-window wnd1
+             (ivy-set-view-recur v))
+           (while (setq v (pop views))
+             (with-selected-window wnd2
+               (ivy-set-view-recur v))
+             (when views
+               (setq wnd2 (split-window-horizontally))))))
+        ((eq (car view) 'file)
+         (let* ((name (nth 1 view))
+                (virtual (assoc name ivy--virtual-buffers))
+                buffer)
+           (cond ((setq buffer (get-buffer name))
+                  (switch-to-buffer buffer nil 'force-same-window))
+                 (virtual
+                  (find-file (cdr virtual)))
+                 ((file-exists-p name)
+                  (find-file name))))
+         (when (and (> (length view) 2)
+                    (numberp (nth 2 view)))
+           (goto-char (nth 2 view))))
+        ((eq (car view) 'buffer)
+         (switch-to-buffer (nth 1 view))
+         (when (and (> (length view) 2)
+                    (numberp (nth 2 view)))
+           (goto-char (nth 2 view))))
+        ((eq (car view) 'sexp)
+         (eval (nth 1 view)))))
+
+(defun ivy--switch-buffer-action (buffer)
+  "Switch to BUFFER.
+BUFFER may be a string or nil."
+  (with-ivy-window
+    (if (zerop (length buffer))
+        (switch-to-buffer
+         ivy-text nil 'force-same-window)
+      (let ((virtual (assoc buffer ivy--virtual-buffers))
+            (view (assoc buffer ivy-views)))
+        (cond ((and virtual
+                    (not (get-buffer buffer)))
+               (find-file (cdr virtual)))
+              (view
+               (delete-other-windows)
+               (let (
+                     ;; silence "Directory has changed on disk"
+                     (inhibit-message t))
+                 (ivy-set-view-recur (cadr view))))
+              (t
+               (switch-to-buffer
+                buffer nil 'force-same-window)))))))
+
+(defun ivy--switch-buffer-other-window-action (buffer)
+  "Switch to BUFFER in other window.
+BUFFER may be a string or nil."
+  (if (zerop (length buffer))
+      (switch-to-buffer-other-window ivy-text)
+    (let ((virtual (assoc buffer ivy--virtual-buffers)))
+      (if (and virtual
+               (not (get-buffer buffer)))
+          (find-file-other-window (cdr virtual))
+        (switch-to-buffer-other-window buffer)))))
+
+(defun ivy--rename-buffer-action (buffer)
+  "Rename BUFFER."
+  (let ((new-name (read-string "Rename buffer (to new name): ")))
+    (with-current-buffer buffer
+      (rename-buffer new-name))))
+
+(defun ivy--find-file-action (buffer)
+  "Find file from BUFFER's directory."
+  (let* ((b (get-buffer buffer))
+         (default-directory
+          (or (and b (buffer-local-value 'default-directory b))
+              default-directory)))
+    (call-interactively (if (functionp 'counsel-find-file)
+                            #'counsel-find-file
+                          #'find-file))))
+
+(defun ivy--kill-buffer-action (buffer)
+  "Kill BUFFER."
+  (kill-buffer buffer)
+  (unless (buffer-live-p (ivy-state-buffer ivy-last))
+    (setf (ivy-state-buffer ivy-last) (current-buffer)))
+  (setq ivy--index 0)
+  (ivy--reset-state ivy-last))
+
+(defvar ivy-switch-buffer-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "C-c C-k") 'ivy-switch-buffer-kill)
+    map))
+
+(defun ivy-switch-buffer-kill ()
+  "Kill the current buffer in `ivy-switch-buffer'."
+  (interactive)
+  (let ((bn (ivy-state-current ivy-last)))
+    (when (get-buffer bn)
+      (kill-buffer bn))
+    (unless (buffer-live-p (ivy-state-buffer ivy-last))
+      (setf (ivy-state-buffer ivy-last)
+            (with-ivy-window (current-buffer))))
+    (setf (ivy-state-preselect ivy-last) ivy--index)
+    (setq ivy--old-re nil)
+    (setq ivy--all-candidates (delete bn ivy--all-candidates))
+    (ivy--exhibit)))
+
+(ivy-set-actions
+ 'ivy-switch-buffer
+ '(("f"
+    ivy--find-file-action
+    "find file")
+   ("j"
+    ivy--switch-buffer-other-window-action
+    "other window")
+   ("k"
+    ivy--kill-buffer-action
+    "kill")
+   ("r"
+    ivy--rename-buffer-action
+    "rename")))
+
+(ivy-set-actions
+ t
+ `(("i" ,(lambda (x) (insert (if (stringp x) x (car x)))) "insert")
+   ("w" ,(lambda (x) (kill-new (if (stringp x) x (car x)))) "copy")))
+
+(defun ivy--switch-buffer-matcher (regexp candidates)
+  "Return REGEXP matching CANDIDATES.
+Skip buffers that match `ivy-ignore-buffers'."
+  (let ((res (ivy--re-filter regexp candidates)))
+    (if (or (null ivy-use-ignore)
+            (null ivy-ignore-buffers))
+        res
+      (or (cl-remove-if
+           (lambda (buf)
+             (cl-find-if
+              (lambda (f-or-r)
+                (if (functionp f-or-r)
+                    (funcall f-or-r buf)
+                  (string-match-p f-or-r buf)))
+              ivy-ignore-buffers))
+           res)
+          (and (eq ivy-use-ignore t)
+               res)))))
+
+(ivy-set-display-transformer
+ 'ivy-switch-buffer 'ivy-switch-buffer-transformer)
+(ivy-set-display-transformer
+ 'internal-complete-buffer 'ivy-switch-buffer-transformer)
+
+(defun ivy-append-face (str face)
+  "Append to STR the property FACE."
+  (setq str (copy-sequence str))
+  (ivy-add-face-text-property 0 (length str) face str t)
+  str)
+
+(defun ivy-switch-buffer-transformer (str)
+  "Transform candidate STR when switching buffers."
+  (let ((b (get-buffer str)))
+    (if (and b
+             (buffer-file-name b)
+             (buffer-modified-p b))
+        (ivy-append-face str 'ivy-modified-buffer)
+      str)))
+
+(defun ivy-switch-buffer-occur ()
+  "Occur function for `ivy-switch-buffer' using `ibuffer'."
+  (ibuffer nil (buffer-name) (list (cons 'name ivy--old-re))))
+
+;;;###autoload
+(defun ivy-switch-buffer ()
+  "Switch to another buffer."
+  (interactive)
+  (let ((this-command 'ivy-switch-buffer))
+    (ivy-read "Switch to buffer: " 'internal-complete-buffer
+              :matcher #'ivy--switch-buffer-matcher
+              :preselect (buffer-name (other-buffer (current-buffer)))
+              :action #'ivy--switch-buffer-action
+              :keymap ivy-switch-buffer-map
+              :caller 'ivy-switch-buffer)))
+
+;;;###autoload
+(defun ivy-switch-view ()
+  "Switch to one of the window views stored by `ivy-push-view'."
+  (interactive)
+  (let ((ivy-initial-inputs-alist
+         '((ivy-switch-buffer . "{}"))))
+    (ivy-switch-buffer)))
+
+;;;###autoload
+(defun ivy-switch-buffer-other-window ()
+  "Switch to another buffer in another window."
+  (interactive)
+  (ivy-read "Switch to buffer in other window: " 'internal-complete-buffer
+            :matcher #'ivy--switch-buffer-matcher
+            :preselect (buffer-name (other-buffer (current-buffer)))
+            :action #'ivy--switch-buffer-other-window-action
+            :keymap ivy-switch-buffer-map
+            :caller 'ivy-switch-buffer-other-window))
+
+(define-obsolete-function-alias 'ivy-recentf 'counsel-recentf "0.8.0")
+
+(defun ivy--yank-by (fn &rest args)
+  "Pull buffer text from current line into search string.
+The region to extract is determined by the respective values of
+point before and after applying FN to ARGS."
+  (let (text)
+    (with-ivy-window
+      (let ((pos (point))
+            (bol (line-beginning-position))
+            (eol (line-end-position)))
+        (unwind-protect
+             (progn (apply fn args)
+                    (setq text (buffer-substring-no-properties
+                                pos (goto-char (max bol (min (point) eol))))))
+          (unless text
+            (goto-char pos)))))
+    (when text
+      (insert (replace-regexp-in-string "  +" " " text t t)))))
+
+(defun ivy-yank-word (&optional arg)
+  "Pull next word from buffer into search string.
+If optional ARG is non-nil, pull in the next ARG
+words (previous if ARG is negative)."
+  (interactive "p")
+  (ivy--yank-by #'forward-word arg))
+
+(defun ivy-yank-symbol (&optional arg)
+  "Pull next symbol from buffer into search string.
+If optional ARG is non-nil, pull in the next ARG
+symbols (previous if ARG is negative)."
+  (interactive "p")
+  ;; Emacs < 24.4 compatibility
+  (unless (fboundp 'forward-symbol)
+    (require 'thingatpt))
+  (ivy--yank-by #'forward-symbol (or arg 1)))
+
+(defun ivy-yank-char (&optional arg)
+  "Pull next character from buffer into search string.
+If optional ARG is non-nil, pull in the next ARG
+characters (previous if ARG is negative)."
+  (interactive "p")
+  (ivy--yank-by #'forward-char arg))
+
+(defun ivy-kill-ring-save ()
+  "Store the current candidates into the kill ring.
+If the region is active, forward to `kill-ring-save' instead."
+  (interactive)
+  (if (region-active-p)
+      (call-interactively 'kill-ring-save)
+    (kill-new
+     (mapconcat
+      #'identity
+      ivy--old-cands
+      "\n"))))
+
+(defun ivy-insert-current ()
+  "Make the current candidate into current input.
+Don't finish completion."
+  (interactive)
+  (delete-minibuffer-contents)
+  (if (and ivy--directory
+           (string-match "/$" (ivy-state-current ivy-last)))
+      (insert (substring (ivy-state-current ivy-last) 0 -1))
+    (insert (ivy-state-current ivy-last))))
+
+(define-obsolete-variable-alias 'ivy--preferred-re-builders
+    'ivy-preferred-re-builders "0.10.0")
+
+(defcustom ivy-preferred-re-builders
+  '((ivy--regex-plus . "ivy")
+    (ivy--regex-ignore-order . "order")
+    (ivy--regex-fuzzy . "fuzzy"))
+  "Alist of preferred re-builders with display names.
+This list can be rotated with `ivy-rotate-preferred-builders'."
+  :type '(alist :key-type function :value-type string))
+
+(defun ivy-rotate-preferred-builders ()
+  "Switch to the next re builder in `ivy-preferred-re-builders'."
+  (interactive)
+  (when ivy-preferred-re-builders
+    (setq ivy--old-re nil)
+    (setq ivy--regex-function
+          (let ((cell (assq ivy--regex-function ivy-preferred-re-builders)))
+            (car (or (cadr (memq cell ivy-preferred-re-builders))
+                     (car ivy-preferred-re-builders)))))))
+
+(defun ivy-toggle-fuzzy ()
+  "Toggle the re builder between `ivy--regex-fuzzy' and `ivy--regex-plus'."
+  (interactive)
+  (setq ivy--old-re nil)
+  (if (eq ivy--regex-function 'ivy--regex-fuzzy)
+      (setq ivy--regex-function 'ivy--regex-plus)
+    (setq ivy--regex-function 'ivy--regex-fuzzy)))
+
+(defun ivy-reverse-i-search ()
+  "Enter a recursive `ivy-read' session using the current history.
+The selected history element will be inserted into the minibuffer."
+  (interactive)
+  (let ((enable-recursive-minibuffers t)
+        (history (symbol-value (ivy-state-history ivy-last)))
+        (old-last ivy-last)
+        (ivy-recursive-restore nil))
+    (ivy-read "Reverse-i-search: "
+              (delete-dups (copy-sequence history))
+              :action (lambda (x)
+                        (ivy--reset-state
+                         (setq ivy-last old-last))
+                        (delete-minibuffer-contents)
+                        (insert (substring-no-properties x))
+                        (ivy--cd-maybe)))))
+
+(defun ivy-restrict-to-matches ()
+  "Restrict candidates to current input and erase input."
+  (interactive)
+  (delete-minibuffer-contents)
+  (setq ivy--all-candidates
+        (ivy--filter ivy-text ivy--all-candidates)))
+
+;;* Occur
+(defvar-local ivy-occur-last nil
+  "Buffer-local value of `ivy-last'.
+Can't re-use `ivy-last' because using e.g. `swiper' in the same
+buffer would modify `ivy-last'.")
+
+(defvar ivy-occur-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [mouse-1] 'ivy-occur-click)
+    (define-key map (kbd "RET") 'ivy-occur-press-and-switch)
+    (define-key map (kbd "j") 'ivy-occur-next-line)
+    (define-key map (kbd "k") 'ivy-occur-previous-line)
+    (define-key map (kbd "h") 'backward-char)
+    (define-key map (kbd "l") 'forward-char)
+    (define-key map (kbd "f") 'ivy-occur-press)
+    (define-key map (kbd "g") 'ivy-occur-revert-buffer)
+    (define-key map (kbd "a") 'ivy-occur-read-action)
+    (define-key map (kbd "o") 'ivy-occur-dispatch)
+    (define-key map (kbd "c") 'ivy-occur-toggle-calling)
+    (define-key map (kbd "q") 'quit-window)
+    (define-key map (kbd "R") 'read-only-mode)
+    (define-key map (kbd "C-d") 'ivy-occur-delete-candidate)
+    map)
+  "Keymap for Ivy Occur mode.")
+
+(defun ivy-occur-toggle-calling ()
+  "Toggle `ivy-calling'."
+  (interactive)
+  (if (setq ivy-calling (not ivy-calling))
+      (progn
+        (setq mode-name "Ivy-Occur [calling]")
+        (ivy-occur-press))
+    (setq mode-name "Ivy-Occur"))
+  (force-mode-line-update))
+
+(defun ivy-occur-next-line (&optional arg)
+  "Move the cursor down ARG lines.
+When `ivy-calling' isn't nil, call `ivy-occur-press'."
+  (interactive "p")
+  (forward-line arg)
+  (when ivy-calling
+    (ivy-occur-press)))
+
+(defun ivy-occur-previous-line (&optional arg)
+  "Move the cursor up ARG lines.
+When `ivy-calling' isn't nil, call `ivy-occur-press'."
+  (interactive "p")
+  (forward-line (- arg))
+  (when ivy-calling
+    (ivy-occur-press)))
+
+(define-derived-mode ivy-occur-mode fundamental-mode "Ivy-Occur"
+  "Major mode for output from \\[ivy-occur].
+
+\\{ivy-occur-mode-map}"
+  (setq-local view-read-only nil))
+
+(defvar ivy-occur-grep-mode-map
+  (let ((map (copy-keymap ivy-occur-mode-map)))
+    (define-key map (kbd "C-x C-q") 'ivy-wgrep-change-to-wgrep-mode)
+    (define-key map "w" 'ivy-wgrep-change-to-wgrep-mode)
+    map)
+  "Keymap for Ivy Occur Grep mode.")
+
+(defun ivy-occur-delete-candidate ()
+  (interactive)
+  (let ((inhibit-read-only t))
+    (delete-region (line-beginning-position)
+                   (1+ (line-end-position)))))
+
+(define-derived-mode ivy-occur-grep-mode grep-mode "Ivy-Occur"
+  "Major mode for output from \\[ivy-occur].
+
+\\{ivy-occur-grep-mode-map}"
+  (setq-local view-read-only nil)
+  (when (fboundp 'wgrep-setup)
+    (wgrep-setup)))
+
+(defvar ivy--occurs-list nil
+  "A list of custom occur generators per command.")
+
+(defun ivy-set-occur (cmd occur)
+  "Assign CMD a custom OCCUR function."
+  (setq ivy--occurs-list
+        (plist-put ivy--occurs-list cmd occur)))
+
+(ivy-set-occur 'ivy-switch-buffer 'ivy-switch-buffer-occur)
+(ivy-set-occur 'ivy-switch-buffer-other-window 'ivy-switch-buffer-occur)
+
+(defun ivy--occur-insert-lines (cands)
+  "Insert CANDS into `ivy-occur' buffer."
+  (dolist (str cands)
+    (add-text-properties
+     0 (length str)
+     `(mouse-face
+       highlight
+       help-echo "mouse-1: call ivy-action")
+     str)
+    (insert str "\n"))
+  (goto-char (point-min))
+  (forward-line 4))
+
+(defun ivy-occur ()
+  "Stop completion and put the current candidates into a new buffer.
+
+The new buffer remembers current action(s).
+
+While in the *ivy-occur* buffer, selecting a candidate with RET or
+a mouse click will call the appropriate action for that candidate.
+
+There is no limit on the number of *ivy-occur* buffers."
+  (interactive)
+  (if (not (window-minibuffer-p))
+      (user-error "No completion session is active")
+    (let* ((caller (ivy-state-caller ivy-last))
+           (occur-fn (plist-get ivy--occurs-list caller))
+           (buffer
+            (generate-new-buffer
+             (format "*ivy-occur%s \"%s\"*"
+                     (if caller
+                         (concat " " (prin1-to-string caller))
+                       "")
+                     ivy-text))))
+      (with-current-buffer buffer
+        (let ((inhibit-read-only t))
+          (erase-buffer)
+          (if occur-fn
+              (funcall occur-fn)
+            (ivy-occur-mode)
+            (insert (format "%d candidates:\n" (length ivy--old-cands)))
+            (read-only-mode)
+            (ivy--occur-insert-lines
+             (mapcar
+              (lambda (cand) (concat "    " cand))
+              ivy--old-cands))))
+        (setf (ivy-state-text ivy-last) ivy-text)
+        (setq ivy-occur-last ivy-last)
+        (setq-local ivy--directory ivy--directory))
+      (ivy-exit-with-action
+       (lambda (_) (pop-to-buffer buffer))))))
+
+(defun ivy-occur-revert-buffer ()
+  "Refresh the buffer making it up-to date with the collection.
+
+Currently only works for `swiper'.  In that specific case, the
+*ivy-occur* buffer becomes nearly useless as the orignal buffer
+is updated, since the line numbers no longer match.
+
+Calling this function is as if you called `ivy-occur' on the
+updated original buffer."
+  (interactive)
+  (let ((caller (ivy-state-caller ivy-occur-last))
+        (ivy-last ivy-occur-last))
+    (cond ((eq caller 'swiper)
+           (let ((buffer (ivy-state-buffer ivy-occur-last)))
+             (unless (buffer-live-p buffer)
+               (error "Buffer was killed"))
+             (let ((inhibit-read-only t))
+               (erase-buffer)
+               (funcall (plist-get ivy--occurs-list caller) t)
+               (ivy-occur-grep-mode))))
+          ((memq caller '(counsel-git-grep counsel-grep counsel-ag counsel-rg))
+           (let ((inhibit-read-only t))
+             (erase-buffer)
+             (funcall (plist-get ivy--occurs-list caller)))))
+    (setq ivy-occur-last ivy-last)))
+
+(declare-function wgrep-change-to-wgrep-mode "ext:wgrep")
+
+(defun ivy-wgrep-change-to-wgrep-mode ()
+  "Forward to `wgrep-change-to-wgrep-mode'."
+  (interactive)
+  (if (require 'wgrep nil 'noerror)
+      (wgrep-change-to-wgrep-mode)
+    (error "Package wgrep isn't installed")))
+
+(defun ivy-occur-read-action ()
+  "Select one of the available actions as the current one."
+  (interactive)
+  (let ((ivy-last ivy-occur-last))
+    (ivy-read-action)))
+
+(defun ivy-occur-dispatch ()
+  "Call one of the available actions on the current item."
+  (interactive)
+  (let* ((state-action (ivy-state-action ivy-occur-last))
+         (actions (if (symbolp state-action)
+                      state-action
+                    (copy-sequence state-action))))
+    (unwind-protect
+         (progn
+           (ivy-occur-read-action)
+           (ivy-occur-press))
+      (setf (ivy-state-action ivy-occur-last) actions))))
+
+(defun ivy-occur-click (event)
+  "Execute action for the current candidate.
+EVENT gives the mouse position."
+  (interactive "e")
+  (let ((window (posn-window (event-end event)))
+        (pos (posn-point (event-end event))))
+    (with-current-buffer (window-buffer window)
+      (goto-char pos)
+      (ivy-occur-press))))
+
+(declare-function swiper--cleanup "swiper")
+(declare-function swiper--add-overlays "swiper")
+(defvar ivy-occur-timer nil)
+(defvar counsel-grep-last-line)
+
+(defun ivy--occur-press-update-window ()
+  (cl-case (ivy-state-caller ivy-occur-last)
+    ((swiper counsel-git-grep counsel-grep counsel-ag counsel-rg)
+     (let ((window (ivy-state-window ivy-occur-last)))
+       (when (or (null (window-live-p window))
+                 (equal window (selected-window)))
+         (save-selected-window
+           (setf (ivy-state-window ivy-occur-last)
+                 (display-buffer (ivy-state-buffer ivy-occur-last)
+                                 'display-buffer-pop-up-window))))))
+
+    ((counsel-describe-function counsel-describe-variable)
+     (setf (ivy-state-window ivy-occur-last)
+           (selected-window))
+     (selected-window))))
+
+(defun ivy--occur-press-buffer ()
+  (let ((buffer (ivy-state-buffer ivy-last)))
+    (if (buffer-live-p buffer)
+        buffer
+      (current-buffer))))
+
+(defun ivy-occur-press ()
+  "Execute action for the current candidate."
+  (interactive)
+  (ivy--occur-press-update-window)
+  (when (save-excursion
+          (beginning-of-line)
+          (looking-at "\\(?:./\\|    \\)\\(.*\\)$"))
+    (let* ((ivy-last ivy-occur-last)
+           (ivy-text (ivy-state-text ivy-last))
+           (str (buffer-substring
+                 (match-beginning 1)
+                 (match-end 1)))
+           (coll (ivy-state-collection ivy-last))
+           (action (ivy--get-action ivy-last))
+           (ivy-exit 'done))
+      (with-ivy-window
+        (setq counsel-grep-last-line nil)
+        (with-current-buffer (ivy--occur-press-buffer)
+          (funcall action
+                   (if (and (consp coll)
+                            (consp (car coll)))
+                       (assoc str coll)
+                     str)))
+        (if (memq (ivy-state-caller ivy-last)
+                  '(swiper counsel-git-grep counsel-grep counsel-ag counsel-rg))
+            (with-current-buffer (window-buffer (selected-window))
+              (swiper--cleanup)
+              (swiper--add-overlays
+               (ivy--regex ivy-text)
+               (line-beginning-position)
+               (line-end-position)
+               (selected-window))
+              (when (timerp ivy-occur-timer)
+                (cancel-timer ivy-occur-timer))
+              (setq ivy-occur-timer
+                    (run-at-time 1.0 nil 'swiper--cleanup))))))))
+
+(defun ivy-occur-press-and-switch ()
+  "Execute action for the current candidate and switch window."
+  (interactive)
+  (ivy-occur-press)
+  (select-window (ivy--get-window ivy-occur-last)))
+
+(defconst ivy-help-file (let ((default-directory
+                               (if load-file-name
+                                   (file-name-directory load-file-name)
+                                 default-directory)))
+                          (if (file-exists-p "ivy-help.org")
+                              (expand-file-name "ivy-help.org")
+                            (if (file-exists-p "doc/ivy-help.org")
+                                (expand-file-name "doc/ivy-help.org"))))
+  "The file for `ivy-help'.")
+
+(defun ivy-help ()
+  "Help for `ivy'."
+  (interactive)
+  (let ((buf (get-buffer "*Ivy Help*")))
+    (unless buf
+      (setq buf (get-buffer-create "*Ivy Help*"))
+      (with-current-buffer buf
+        (insert-file-contents ivy-help-file)
+        (org-mode)
+        (view-mode)
+        (goto-char (point-min))))
+    (if (eq this-command 'ivy-help)
+        (switch-to-buffer buf)
+      (with-ivy-window
+        (pop-to-buffer buf)))
+    (view-mode)
+    (goto-char (point-min))))
+
+(provide 'ivy)
+
+;;; ivy.el ends here
diff --git a/elpa/ivy-20180727.1527/ivy.elc b/elpa/ivy-20180727.1527/ivy.elc
new file mode 100644
index 0000000..1494af3
Binary files /dev/null and b/elpa/ivy-20180727.1527/ivy.elc differ
diff --git a/elpa/ivy-dired-history-20170626.556/ivy-dired-history-autoloads.el b/elpa/ivy-dired-history-20170626.556/ivy-dired-history-autoloads.el
new file mode 100644
index 0000000..b6e2688
--- /dev/null
+++ b/elpa/ivy-dired-history-20170626.556/ivy-dired-history-autoloads.el
@@ -0,0 +1,16 @@
+;;; ivy-dired-history-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
+
+;;;### (autoloads nil nil ("ivy-dired-history.el") (23391 65517 0
+;;;;;;  0))
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; End:
+;;; ivy-dired-history-autoloads.el ends here
diff --git a/elpa/ivy-dired-history-20170626.556/ivy-dired-history-pkg.el b/elpa/ivy-dired-history-20170626.556/ivy-dired-history-pkg.el
new file mode 100644
index 0000000..218391f
--- /dev/null
+++ b/elpa/ivy-dired-history-20170626.556/ivy-dired-history-pkg.el
@@ -0,0 +1,2 @@
+;;; -*- no-byte-compile: t -*-
+(define-package "ivy-dired-history" "20170626.556" "use ivy to open recent directories" '((ivy "0.9.0") (counsel "0.9.0") (cl-lib "0.5")) :commit "c9c67ea1ee5e68443f0e6006ba162d6c8d868b69" :authors '(("纪秀峰" . "jixiuf@gmail.com")) :maintainer '("纪秀峰" . "jixiuf@gmail.com") :url "https://github.com/jixiuf/ivy-dired-history")
diff --git a/elpa/ivy-dired-history-20170626.556/ivy-dired-history.el b/elpa/ivy-dired-history-20170626.556/ivy-dired-history.el
new file mode 100644
index 0000000..7b96755
--- /dev/null
+++ b/elpa/ivy-dired-history-20170626.556/ivy-dired-history.el
@@ -0,0 +1,271 @@
+;;; ivy-dired-history.el --- use ivy to open recent directories
+
+;; Author: 纪秀峰 
+;; Copyright (C) 2017 纪秀峰, all rights reserved.
+;; Created:  2017-06-14
+;; Version: 1.0
+;; Package-Version: 20170626.556
+;; X-URL:https://github.com/jixiuf/ivy-dired-history
+;; Package-Requires: ((ivy "0.9.0")(counsel "0.9.0")(cl-lib "0.5"))
+;;
+;; Features that might be required by this library:
+;;
+;; `ivy' `counsel'
+;;
+;;; This file is NOT part of GNU Emacs
+
+;;; License
+;;
+;; 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 this program; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+;; Floor, Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+;;
+;; use `ivy' to open recent directories.
+
+;; it is integrated with `dired-do-copy' and `dired-do-rename'.
+;; when you press C (copy) or R (rename) , it is excellent to
+;; allow users to select a directory from the recent dired history .
+
+
+
+;;; Installation:
+
+;; (require 'savehist)
+;; (add-to-list 'savehist-additional-variables 'ivy-dired-history-variable)
+;; (savehist-mode 1)
+
+;; or if you use desktop-save-mode
+;; (add-to-list 'desktop-globals-to-save 'ivy-dired-history-variable)
+
+
+;; (with-eval-after-load 'dired
+;;   (require 'ivy-dired-history)
+;; ;; if you are using ido,you'd better disable ido for dired
+;; ;; (define-key (cdr ido-minor-mode-map-entry) [remap dired] nil) ;in ido-setup-hook
+;;   (define-key dired-mode-map "," 'dired))
+
+
+;;; Code:
+
+(require 'dired)
+(require 'dired-aux)
+(require 'ivy)
+(require 'counsel)
+(require 'cl-lib)
+
+(defgroup ivy-dired-history nil
+  "dired history using Ivy"
+  :group 'ivy)
+
+
+(defcustom ivy-dired-history-max 200
+  "Length of history for ivy-dired-history."
+  :type 'number
+  :group 'ivy-dired-history)
+
+(defcustom ivy-dired-history-ignore-directory '("/")
+  "Length of history for ivy-dired-history."
+  :type '(repeat string)
+  :group 'ivy-dired-history)
+
+
+(defvar ivy-dired-history-variable nil)
+
+(defvar ivy-dired-history--cleanup-p nil)
+(defvar ivy-dired-history--extra-directories nil)
+(defvar ivy-dired-history--default-directory nil)
+
+(defvar ivy-dired-history-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "") 'ivy-done)
+    (define-key map (kbd "")    'ivy-done)
+    ;; (define-key map [remap ivy-alt-done] 'ivy-dired-history-alt-done)
+    map))
+
+(set-keymap-parent ivy-dired-history-map counsel-find-file-map)
+
+(defun ivy-dired-history--update(dir)
+  "Update variable `ivy-dired-history-variable'.
+Argument DIR directory."
+       (setq dir (abbreviate-file-name (expand-file-name dir)))
+       (unless (member dir ivy-dired-history-ignore-directory)
+         (unless ivy-dired-history--cleanup-p
+           (setq ivy-dired-history--cleanup-p t)
+           (let ((tmp-history ))
+             (dolist (d ivy-dired-history-variable)
+               (when (or (file-remote-p d) (file-directory-p d))
+                 (add-to-list 'tmp-history d t)))
+             (setq ivy-dired-history-variable tmp-history)))
+         (setq ivy-dired-history-variable
+               (delete-dups (delete dir ivy-dired-history-variable)))
+         (setq ivy-dired-history-variable
+               (append (list dir) ivy-dired-history-variable))
+         (ivy-dired-history--trim)))
+
+(defun ivy-dired-history-update()
+  "Update variable `ivy-dired-history-variable'."
+  (ivy-dired-history--update (dired-current-directory)))
+
+;;when you open dired buffer ,update `ivy-dired-history-variable'.
+(add-hook 'dired-after-readin-hook 'ivy-dired-history-update)
+
+(defun ivy-dired-history--trim()
+  "Retain only the first `ivy-dired-history-max' items in VALUE."
+  (if (> (length ivy-dired-history-variable) ivy-dired-history-max)
+      (setcdr (nthcdr (1- ivy-dired-history-max) ivy-dired-history-variable) nil)))
+
+
+;; integrating dired history feature into commands like
+;; dired-do-copy and dired-do-rename.
+;;see https://github.com/jixiuf/ivy-dired-history/issues/6
+(defadvice dired-mark-read-file-name(around ivy-dired-history activate)
+  "Wrapper ‘read-file-name’ with idv-dired-history-read-file-name."
+  (cl-letf (((symbol-function 'read-file-name)
+             #'ivy-dired-history--read-file-name))
+    ad-do-it))
+
+(defadvice dired-read-dir-and-switches(around ivy-dired-history activate)
+  "Wrapper ‘read-file-name’ with idv-dired-history-read-file-name."
+  (ivy-dired-history--update (expand-file-name default-directory))
+  (let ((default-directory default-directory))
+    ;; (unless (next-read-file-uses-dialog-p) (setq default-directory "/"))
+    (cl-letf (((symbol-function 'read-file-name)
+               #'ivy-dired-history--read-file-name))
+      ad-do-it)))
+
+(defadvice dired-do-compress-to(around ivy-dired-history activate)
+  "Wrapper ‘read-file-name’ with idv-dired-history-read-file-name."
+  (cl-letf (((symbol-function 'read-file-name)
+             #'ivy-dired-history--read-file-name))
+    ad-do-it))
+
+
+(defun ivy-dired-history--sort (name candidates)
+  "Re-sort candidates by NAME.
+CANDIDATES is a list of directories(with path) each match NAME.
+equal>prefix>substring>other."
+  (if (or (string-match "^\\^" name) (string= name ""))
+      candidates
+    (let* ((base-re (funcall ivy--regex-function name))
+           (base-re (if (consp base-re) (caar base-re) base-re))
+           (base-re-prefix (concat "^\\*" base-re))
+           (re-prefix (concat "^\\*" name))
+           (name-tokens (split-string name))
+           res-prefix
+           res-base-prefix
+           res-equal
+           res-substring
+           res-dirname-match-all-tokens
+           res-fullpath-match-all-tokens
+           res-fullpath-substring
+           res-noprefix
+           dirname)
+      (unless (cl-find-if (lambda (s) (string-match-p base-re-prefix s)) candidates)
+        (setq base-re-prefix (concat "^" base-re)))
+
+      (dolist (s candidates)
+        (setq dirname (file-name-nondirectory
+                       (directory-file-name
+                        (file-name-directory (expand-file-name s)))))
+        (cond
+         ((string= name dirname)
+          (push s res-equal))
+         ((string-match-p re-prefix dirname)
+          (push s res-prefix))
+         ((string-match-p base-re-prefix dirname)
+          (push s res-base-prefix))
+         ((string-match-p name dirname)
+          (push s res-substring))
+         ((cl-every  (lambda(e) (string-match-p e dirname)) name-tokens)
+          (push s res-dirname-match-all-tokens))
+         ((cl-some  (lambda(dir) (cl-every  (lambda(e) (string-match-p e dir)) name-tokens))
+                    (split-string s "/" t ))
+          (push s res-fullpath-match-all-tokens))
+         ((string-match-p name (expand-file-name s))
+          (push s res-fullpath-substring))
+         (t
+          (push s res-noprefix))))
+      (nconc
+       (nreverse res-equal)
+       (nreverse res-prefix)
+       (nreverse res-base-prefix)
+       (nreverse res-substring)
+       (nreverse res-dirname-match-all-tokens)
+       (nreverse res-fullpath-match-all-tokens)
+       (nreverse res-fullpath-substring)
+       (nreverse res-noprefix)))))
+
+;; (defun ivy-dired-history-alt-done(&optional arg)
+;;   "Exit the minibuffer with the selected candidate.
+;; When ARG is t, exit with current text, ignoring the candidates."
+;;   (interactive "P")
+;;   (call-interactively 'ivy-alt-done)
+;;   (let ((idx))
+;;     (cl-loop for cand in ivy--all-candidates
+;;              for i from 0
+;;              if (string= (expand-file-name ivy--directory)(expand-file-name cand))
+;;              return (setq idx i))
+;;     (when idx (ivy-set-index idx))))
+
+(defun ivy-dired-history--read-file-name
+    (prompt &optional dir default-filename mustmatch initial predicate)
+  "Read file name with hisotry as collection.
+Argument PROMPT prompt.
+Optional argument DIR directory.
+Optional argument DEFAULT-FILENAME default.
+Optional argument MUSTMATCH mustmatch.
+Optional argument INITIAL init value.
+Optional argument PREDICATE predicate."
+  (setq ivy-dired-history--extra-directories ivy-extra-directories)
+  (cl-letf (((symbol-function 'read-file-name-internal)
+             #'ivy-dired-history--read-file-name-internal))
+    (let ((ivy-sort-functions-alist nil)
+          (default-directory default-directory)
+          (ivy--flx-featurep nil)
+          (ivy-sort-matches-functions-alist '((t . ivy-dired-history--sort)))
+          (ivy-extra-directories nil))
+      (when dir (setq default-directory dir))
+      (setq ivy-dired-history--default-directory default-directory)
+      (ivy-read prompt
+                'read-file-name-internal
+                :initial-input initial
+                :sort t
+                :matcher #'counsel--find-file-matcher
+                :keymap ivy-dired-history-map
+                :caller 'read-file-name-internal))))
+
+
+(defalias 'ivy-dired-history--old-read-file-name-internal
+  (completion-table-in-turn #'completion--embedded-envvar-table
+                            #'completion--file-name-table)
+  "same as read-file-name-internal")
+
+(defun ivy-dired-history--read-file-name-internal (string pred action)
+  "Merge ivy-directory-history-variables with files in current directory.
+Argument STRING string.
+Argument PRED pred.
+Argument ACTION action."
+  (let ((cands ivy-dired-history-variable))
+    (unless (string= default-directory ivy-dired-history--default-directory)
+      (setq cands (ivy--filter default-directory cands))
+      (setq ivy-extra-directories ivy-dired-history--extra-directories))
+    (append cands
+            (ivy-dired-history--old-read-file-name-internal string pred action))))
+
+
+(provide 'ivy-dired-history)
+
+;;; ivy-dired-history.el ends here
diff --git a/elpa/ivy-dired-history-20170626.556/ivy-dired-history.elc b/elpa/ivy-dired-history-20170626.556/ivy-dired-history.elc
new file mode 100644
index 0000000..986e975
Binary files /dev/null and b/elpa/ivy-dired-history-20170626.556/ivy-dired-history.elc differ
diff --git a/elpa/ivy-rich-20180705.145/ivy-rich-autoloads.el b/elpa/ivy-rich-20180705.145/ivy-rich-autoloads.el
new file mode 100644
index 0000000..452abf4
--- /dev/null
+++ b/elpa/ivy-rich-20180705.145/ivy-rich-autoloads.el
@@ -0,0 +1,40 @@
+;;; ivy-rich-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
+
+;;;### (autoloads nil "ivy-rich" "ivy-rich.el" (23391 65516 0 0))
+;;; Generated autoloads from ivy-rich.el
+
+(autoload 'ivy-rich-switch-buffer-transformer "ivy-rich" "\
+Transform CANDIDATE to more readable format.
+
+Currently the transformed format is
+
+| Buffer name | Buffer indicators | Major mode | Project | Path (Based on project root) |.
+
+\(fn CANDIDATE)" nil nil)
+
+(defvar ivy-rich-mode nil "\
+Non-nil if Ivy-Rich mode is enabled.
+See the `ivy-rich-mode' command
+for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `ivy-rich-mode'.")
+
+(custom-autoload 'ivy-rich-mode "ivy-rich" nil)
+
+(autoload 'ivy-rich-mode "ivy-rich" "\
+Toggle ivy-rich mode globally.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; End:
+;;; ivy-rich-autoloads.el ends here
diff --git a/elpa/ivy-rich-20180705.145/ivy-rich-pkg.el b/elpa/ivy-rich-20180705.145/ivy-rich-pkg.el
new file mode 100644
index 0000000..1c56e69
--- /dev/null
+++ b/elpa/ivy-rich-20180705.145/ivy-rich-pkg.el
@@ -0,0 +1,2 @@
+;;; -*- no-byte-compile: t -*-
+(define-package "ivy-rich" "20180705.145" "More friendly display transformer for ivy." '((emacs "24.4") (ivy "0.8.0")) :commit "5258807e7aac92ab49eda8137a71a9de5489e602" :keywords '("ivy") :authors '(("Yevgnen Koh" . "wherejoystarts@gmail.com")) :maintainer '("Yevgnen Koh" . "wherejoystarts@gmail.com"))
diff --git a/elpa/ivy-rich-20180705.145/ivy-rich.el b/elpa/ivy-rich-20180705.145/ivy-rich.el
new file mode 100644
index 0000000..6a4483d
--- /dev/null
+++ b/elpa/ivy-rich-20180705.145/ivy-rich.el
@@ -0,0 +1,349 @@
+;;; ivy-rich.el --- More friendly display transformer for ivy. -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2016 Yevgnen Koh
+
+;; Author: Yevgnen Koh 
+;; Package-Requires: ((emacs "24.4") (ivy "0.8.0"))
+;; Package-Version: 20180705.145
+;; Version: 0.0.4
+;; Keywords: ivy
+
+;; 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 .
+
+;;; Commentary:
+
+;; More friendly interface (display transformer) for ivy.
+;; Usage:
+;; (require 'ivy-rich)
+;; (ivy-set-display-transformer 'ivy-switch-buffer 'ivy-rich-switch-buffer-transformer)
+;;
+;; See documentation on https://github.com/yevgnen/ivy-rich.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ivy)
+(require 'subr-x)
+
+(declare-function projectile-project-name "projectile")
+(declare-function projectile-project-p "projectile")
+(declare-function projectile-project-root "projectile")
+
+;;; ivy-switch-buffer ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defgroup ivy-rich nil
+  "More friendly interface (display transformer) for ivy."
+  :group 'ivy)
+
+(defcustom ivy-rich-switch-buffer-name-max-length
+  32
+  "Max length of buffer name.
+
+For better user experience, the max length should be set to loose to
+hold the buffer name."
+  :type 'integer)
+
+(defcustom ivy-rich-switch-buffer-mode-max-length
+  18
+  "Max length of mode name.
+
+For better user experience, the max length should be set to loose to
+hold the mode name."
+  :type 'integer)
+(defcustom ivy-rich-switch-buffer-project-max-length
+  15
+  "Max length of project name.
+
+For better user experience, the max length should be set to loose
+to hold the project name."
+  :type 'integer)
+
+(defcustom ivy-rich-switch-buffer-delimiter
+  ""
+  "Delimiter between columns."
+  :type 'string)
+
+(defcustom ivy-rich-switch-buffer-align-virtual-buffer
+  nil
+  "Whether to align virtual buffers just as true buffers or not."
+  :type 'boolean)
+
+(defcustom ivy-rich-path-style
+  'relative
+  "File path style.
+
+When set to 'full or 'absolute, absolute path will be used.
+When set to 'abbrev or 'abbreviate, abbreviated will be used. This
+may not affect remote files since `abbreviate-file-name' does not
+take care of them.
+When set to 'relative or any other value, path relative to project
+home will be used."
+  :type 'symbol)
+
+(defcustom ivy-rich-parse-remote-buffer
+  t
+  "Whether to parse remote files.
+
+When `nil', only basic info of remote buffers, like buffer size,
+major mode, etc. will be parsed, otherwise, all info inculding
+project details, file path will be parsed.
+
+If you have performance issue when accessing tramp files, set
+this to `nil'."
+  :type 'boolean)
+
+(defcustom ivy-rich-parse-remote-file-path
+  nil
+  "Whether `ivy-rich-path-style' should take care of remote file.
+
+When `nil', always show absolute path of remote files,
+otherwise, treat remote files as local files.
+
+Sometimes when you are editing files with same names and same
+directory structures in local and remote machines, setting this
+option to `nil' would make the candidates easier to be
+distinguished.
+
+Note that this variable takes effect only when
+`ivy-rich-parse-remote-buffer' is set to `t'."
+  :type 'boolean)
+
+(defvar ivy-rich-switch-buffer-buffer-size-length 7)
+(defvar ivy-rich-switch-buffer-indicator-length 4)
+
+(defun ivy-rich-empty-p (str)
+  (or (null str)
+      (string-empty-p (string-trim str))))
+
+(defun ivy-rich-pad (str len &optional left)
+  "Use space to pad STR to LEN of length.
+
+When LEFT is not nil, pad from left side."
+  (let ((str-len (string-width str)))
+    (cond ((< str-len len)
+           (if left
+               (concat (make-string (- len str-len) ? ) str)
+             (concat str (make-string (- len str-len) ? ))))
+          ((<= len (- str-len)) "")
+          ((> str-len len)
+           (format "%s…" (substring str 0 (1- len))))
+          (t str))))
+
+(defun ivy-rich-switch-buffer-user-buffer-p (buffer)
+  "Check whether BUFFER-NAME is a user buffer."
+  (let ((buffer-name
+         (if (stringp buffer)
+             buffer
+           (buffer-name buffer))))
+    (not (string-match "^\\*" buffer-name))))
+
+(defun ivy-rich-switch-buffer-excluded-modes-p (modes)
+  "Check whether major mode of current buffer is excluded in MODES."
+  (not (memq major-mode modes)))
+
+(defun ivy-rich-switch-buffer-shorten-path (file len)
+  "Shorten the path of FILE until the length of FILE <= LEN.
+
+For example, a path /a/b/c/d/e/f.el will be shortened to
+   /a/…/c/d/e/f.el
+or /a/…/d/e/f.el
+or /a/…/e/f.el
+or /a/…/f.el."
+  (if (> (length file) len)
+      (let ((new-file (replace-regexp-in-string "\\/?.+?\\/\\(\\(…\\/\\)?.+?\\)\\/.*" "…" file nil nil 1)))
+        (if (string= new-file file)
+            file
+          (ivy-rich-switch-buffer-shorten-path new-file len)))
+    file))
+
+(defun ivy-rich-switch-buffer-format (columns)
+  "Join all the non-nil column of COLUMNS."
+  (mapconcat
+   #'identity
+   (cl-remove-if #'null columns)
+   ivy-rich-switch-buffer-delimiter))
+
+(defun ivy-rich-switch-buffer-indicators (candidate)
+  (let ((modified (if (and (buffer-modified-p)
+                           (ivy-rich-switch-buffer-excluded-modes-p '(dired-mode shell-mode))
+                           (ivy-rich-switch-buffer-user-buffer-p candidate))
+                      "*"
+                    ""))
+        (readonly (if (and buffer-read-only
+                           (ivy-rich-switch-buffer-user-buffer-p candidate))
+                      "!"
+                    ""))
+        (process (if (get-buffer-process (current-buffer))
+                     "&"
+                   ""))
+        (remote (if (file-remote-p (or (buffer-file-name) default-directory))
+                    "@"
+                  "")))
+    (propertize
+     (ivy-rich-pad (format "%s%s%s%s" remote readonly modified process) ivy-rich-switch-buffer-indicator-length)
+     'face
+     'error)))
+
+(defun ivy-rich-switch-buffer-size ()
+  (let ((size (buffer-size)))
+    (ivy-rich-pad
+     (cond
+      ((> size 1000000) (format "%.1fM " (/ size 1000000.0)))
+      ((> size 1000) (format "%.1fk " (/ size 1000.0)))
+      (t (format "%d " size)))
+     ivy-rich-switch-buffer-buffer-size-length t)))
+
+(defun ivy-rich-switch-buffer-buffer-name (candidate)
+  (propertize
+   (ivy-rich-pad candidate ivy-rich-switch-buffer-name-max-length)
+   'face
+   'ivy-modified-buffer))
+
+(defun ivy-rich-switch-buffer-major-mode ()
+  (propertize
+   (ivy-rich-pad
+    (capitalize
+     (replace-regexp-in-string "-" " " (replace-regexp-in-string "-mode" "" (symbol-name major-mode))))
+    ivy-rich-switch-buffer-mode-max-length)
+   'face
+   'warning))
+
+(defun ivy-rich-switch-buffer-project ()
+  (if (or (not (bound-and-true-p projectile-mode))
+          (and (file-remote-p (or (buffer-file-name) default-directory))
+               (not ivy-rich-parse-remote-buffer)))
+      nil
+    (propertize
+     (ivy-rich-pad
+      (if (string= (projectile-project-name) "-")
+          ""
+        (projectile-project-name))
+      ivy-rich-switch-buffer-project-max-length)
+     'face
+     'success)))
+
+(defun ivy-rich-switch-buffer-path (project)
+  (let* ((path-max-length (- (window-width (minibuffer-window))
+                             ivy-rich-switch-buffer-name-max-length
+                             ivy-rich-switch-buffer-indicator-length
+                             ivy-rich-switch-buffer-buffer-size-length
+                             ivy-rich-switch-buffer-mode-max-length
+                             (if project ivy-rich-switch-buffer-project-max-length 0)
+                             (* 4 (length ivy-rich-switch-buffer-delimiter))
+                             (if (eq 'ivy-format-function-arrow ivy-format-function) 2 0)
+                             2)))       ; Fixed the unexpected wrapping in terminal
+    (if (or (and (file-remote-p (or (buffer-file-name) default-directory))
+                 (not ivy-rich-parse-remote-buffer))
+            ;; Workaround for `browse-url-emacs' buffers , it changes
+            ;; `default-directory' to "http://" (#25)
+            (string-match "https?:\\/\\/" default-directory))
+        (ivy-rich-pad "" path-max-length)
+      (let* (;; Find the project root directory or `default-directory'
+             (root (file-truename
+                    (if (or (not project)
+                            (not (projectile-project-p)))
+                        default-directory
+                      (projectile-project-root))))
+             ;; Find the file name or `nil'
+             (filename
+              (if (buffer-file-name)
+                  (if (and (buffer-file-name)
+                           (string-match "^https?:\\/\\/" (buffer-file-name))
+                           (not (file-exists-p (buffer-file-name))))
+                      nil
+                    (file-truename (buffer-file-name)))
+                (if (eq major-mode 'dired-mode)
+                    (file-truename (dired-current-directory))
+                  nil)))
+             (path (cond ((or (memq ivy-rich-path-style '(full absolute))
+                              (and (null ivy-rich-parse-remote-file-path)
+                                   (or (file-remote-p root))))
+                          (expand-file-name (or filename root)))
+                         ((memq ivy-rich-path-style '(abbreviate abbrev))
+                          (abbreviate-file-name (or filename root)))
+                         ((or (eq ivy-rich-path-style 'relative)
+                              t)            ; make 'relative default
+                          (if (and filename root)
+                              (substring-no-properties (string-remove-prefix root filename))
+                            "")))))
+        (ivy-rich-pad
+         (ivy-rich-switch-buffer-shorten-path path path-max-length)
+         path-max-length)))))
+
+(defun ivy-rich-switch-buffer-virtual-buffer (candidate)
+  (let* ((filename (file-name-nondirectory (expand-file-name candidate)))
+         (filename (ivy-rich-pad
+                    filename
+                    (+ ivy-rich-switch-buffer-name-max-length
+                       ivy-rich-switch-buffer-indicator-length
+                       ivy-rich-switch-buffer-buffer-size-length
+                       ivy-rich-switch-buffer-mode-max-length
+                       (if (bound-and-true-p projectile-mode) ivy-rich-switch-buffer-project-max-length 0)
+                       (* 4 (length ivy-rich-switch-buffer-delimiter)))))
+         (filename (propertize filename 'face 'ivy-virtual))
+         (path (file-name-directory candidate))
+         (path (ivy-rich-switch-buffer-shorten-path path (- (window-width (minibuffer-window)) (length filename))))
+         (path (ivy-rich-pad path (- (window-width (minibuffer-window))
+                                     (length filename)
+                                     2)))  ; Fixed the unexpected wrapping in terminal
+         (path (propertize path 'face 'ivy-virtual)))
+    (ivy-rich-switch-buffer-format `(,filename ,path))))
+
+;;;###autoload
+(defun ivy-rich-switch-buffer-transformer (candidate)
+  "Transform CANDIDATE to more readable format.
+
+Currently the transformed format is
+
+| Buffer name | Buffer indicators | Major mode | Project | Path (Based on project root) |."
+  (let ((buf (get-buffer candidate)))
+    (cond (buf (with-current-buffer buf
+                 (let* ((indicator  (ivy-rich-switch-buffer-indicators candidate))
+                        (size       (ivy-rich-switch-buffer-size))
+                        (buf-name   (ivy-rich-switch-buffer-buffer-name candidate))
+                        (mode       (ivy-rich-switch-buffer-major-mode))
+                        (project    (ivy-rich-switch-buffer-project))
+                        (path       (ivy-rich-switch-buffer-path project)))
+                   (ivy-rich-switch-buffer-format `(,buf-name ,size ,indicator ,mode ,project ,path)))))
+          ((and (eq ivy-virtual-abbreviate 'full)
+                ivy-rich-switch-buffer-align-virtual-buffer)
+           (ivy-rich-switch-buffer-virtual-buffer candidate))
+          (t candidate))))
+
+
+;; Utilities for setting and unsetting the transformers
+(defvar ivy-rich--original-display-transformers-list nil)  ; Backup list
+
+(defun ivy-rich-set-display-transformer (cmd transformer)
+  (setq ivy-rich--original-display-transformers-list
+        (plist-put
+         ivy-rich--original-display-transformers-list cmd (plist-get ivy--display-transformers-list cmd)))
+  (ivy-set-display-transformer cmd transformer))
+
+(defun ivy-rich-unset-display-transformer (cmd)
+  (ivy-set-display-transformer
+   cmd
+   (plist-get ivy-rich--original-display-transformers-list cmd)))
+
+;;;###autoload
+(define-minor-mode ivy-rich-mode
+  "Toggle ivy-rich mode globally."
+  :global t
+  (if ivy-rich-mode
+      (ivy-rich-set-display-transformer 'ivy-switch-buffer 'ivy-rich-switch-buffer-transformer)
+    (ivy-rich-unset-display-transformer 'ivy-switch-buffer)
+    (setq ivy-rich--original-display-transformers-list nil)))
+
+(provide 'ivy-rich)
+
+;;; ivy-rich.el ends here
diff --git a/elpa/ivy-rich-20180705.145/ivy-rich.elc b/elpa/ivy-rich-20180705.145/ivy-rich.elc
new file mode 100644
index 0000000..4b37f17
Binary files /dev/null and b/elpa/ivy-rich-20180705.145/ivy-rich.elc differ
diff --git a/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet-autoloads.el b/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet-autoloads.el
new file mode 100644
index 0000000..cef84f7
--- /dev/null
+++ b/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet-autoloads.el
@@ -0,0 +1,30 @@
+;;; ivy-yasnippet-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
+
+;;;### (autoloads nil "ivy-yasnippet" "ivy-yasnippet.el" (23391 65515
+;;;;;;  0 0))
+;;; Generated autoloads from ivy-yasnippet.el
+
+(autoload 'ivy-yasnippet "ivy-yasnippet" "\
+Read a snippet name from the minibuffer and expand it at point.
+The completion is done using `ivy-read'.
+
+In the minibuffer, each time selection changes, the selected
+snippet is temporarily expanded at point for preview.
+
+If text before point matches snippet key of any candidate, that
+candidate will be initially selected, unless variable
+`ivy-yasnippet-expand-keys' is set to nil.
+
+\(fn)" t nil)
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; End:
+;;; ivy-yasnippet-autoloads.el ends here
diff --git a/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet-pkg.el b/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet-pkg.el
new file mode 100644
index 0000000..8fe1930
--- /dev/null
+++ b/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet-pkg.el
@@ -0,0 +1,2 @@
+;;; -*- no-byte-compile: t -*-
+(define-package "ivy-yasnippet" "20180621.636" "Preview yasnippets with ivy" '((emacs "24") (ivy "0.10.0") (yasnippet "0.12.2") (dash "2.14.1")) :commit "817c52a0f74dcd156c7f8c6433dfb6b32753428a" :keywords '("convenience") :authors '(("Michał Kondraciuk" . "k.michal@zoho.com")) :maintainer '("Michał Kondraciuk" . "k.michal@zoho.com") :url "https://github.com/mkcms/ivy-yasnippet")
diff --git a/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet.el b/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet.el
new file mode 100644
index 0000000..70a6692
--- /dev/null
+++ b/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet.el
@@ -0,0 +1,271 @@
+;;; ivy-yasnippet.el --- Preview yasnippets with ivy
+
+;;
+;; Author: Michał Kondraciuk 
+;; URL: https://github.com/mkcms/ivy-yasnippet
+;; Package-Version: 20180621.636
+;; Package-Requires: ((emacs "24") (ivy "0.10.0") (yasnippet "0.12.2") (dash "2.14.1"))
+;; Version: 0.0.1
+;; Keywords: convenience
+
+;; Copyright (C) 2018 Michał Kondraciuk
+
+;; 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 .
+
+;;; Commentary:
+;;
+;; This package allows you to select yasnippet snippets using ivy completion.
+;; When current selection changes in the minibuffer, the snippet contents
+;; are temporarily expanded in the buffer.
+;;
+;; To use it, call M-x ivy-yasnippet (but make sure you have enabled
+;; `yas-minor-mode' first).
+;;
+
+;;; Code:
+
+(require 'ivy)
+(require 'yasnippet)
+(require 'dash)
+
+(defvar ivy-yasnippet--buffer nil)
+(defvar ivy-yasnippet--template-alist nil)
+(defvar ivy-yasnippet--region nil)
+(defvar ivy-yasnippet--region-contents nil)
+(defvar ivy-yasnippet--key nil)
+(defvar ivy-yasnippet--key-deleted nil)
+(defvar ivy-yasnippet--should-delete-key nil)
+
+(defgroup ivy-yasnippet nil
+  "Preview yasnippets with ivy."
+  :group 'ivy
+  :group 'yasnippet)
+
+(defcustom ivy-yasnippet-expand-keys 'smart
+  "Value that says how to expand keys before point.
+If it's nil, never expand keys.
+If it's the symbol `always`, always try to expand keys.
+If it's the symbol `smart`, expand when a matching candidate is selected for
+the first time.  Once a candidate whose key doesn't match whatever is before
+point is selected, behave like nil until the minibuffer exits."
+  :group 'ivy-yasnippet
+  :type '(choice (const :tag "Never" nil)
+		 (const :tag "Always" always)
+		 (const :tag "Expand until a nonexpandable candidate\
+ is selected" smart)))
+
+(defcustom ivy-yasnippet-create-snippet-if-not-matched t
+  "If non-nil, allow exiting the minibuffer without exact match.
+Doing so will pop up a new buffer for writing a snippet."
+  :group 'ivy-yasnippet
+  :type 'boolean)
+
+(defcustom ivy-yasnippet-new-snippet
+  "# name: ${1:`name`}${2:
+# key: ${3:key}}${4:
+# keybinding: ${5:keybinding}}${6:
+# expand-env: (${7:(var val)})}${8:
+# contributor: $9}
+# --
+$0`yas-selected-text`"
+  "Snippet to expand when creating new snippet.
+During expansion, `name` is bound to whatever was returned by `ivy-read'."
+  :group 'ivy-yasnippet
+  :type 'string)
+
+(defface ivy-yasnippet-key
+  '((t . (:inherit font-lock-type-face)))
+  "Face used for keys."
+  :group 'ivy-yasnippet)
+
+(defface ivy-yasnippet-key-matching
+  '((t . (:inherit ivy-yasnippet-key :weight bold)))
+  "Face used for keys that match whatever is before point."
+  :group 'ivy-yasnippet)
+
+(defun ivy-yasnippet--lookup-template (name)
+  (cdr (assoc name ivy-yasnippet--template-alist)))
+
+(defun ivy-yasnippet--revert ()
+  (delete-region (car ivy-yasnippet--region)
+		 (cdr ivy-yasnippet--region))
+  (goto-char (car ivy-yasnippet--region))
+  (when ivy-yasnippet--key-deleted
+    (insert ivy-yasnippet--key)
+    (setq ivy-yasnippet--key-deleted nil))
+  (setcar ivy-yasnippet--region (point))
+  (insert ivy-yasnippet--region-contents)
+  (setcdr ivy-yasnippet--region (point)))
+
+(defun ivy-yasnippet--expand-template (template)
+  (deactivate-mark)
+  (goto-char (car ivy-yasnippet--region))
+  (cond
+   ((not (string-equal "" ivy-yasnippet--region-contents))
+    (push-mark (point))
+    (push-mark (cdr ivy-yasnippet--region) nil t))
+   ((and ivy-yasnippet--should-delete-key
+	 (not ivy-yasnippet--key-deleted)
+	 ivy-yasnippet--key
+	 (string-equal ivy-yasnippet--key (yas--template-key template)))
+    (let ((length (length ivy-yasnippet--key)))
+      (delete-char (- length))
+      (cl-decf (car ivy-yasnippet--region) length)
+      (cl-decf (cdr ivy-yasnippet--region) length)
+      (setq ivy-yasnippet--key-deleted t)))
+   (t
+    (setq ivy-yasnippet--should-delete-key
+	  (eq ivy-yasnippet-expand-keys 'always))))
+  (yas-expand-snippet (yas--template-content template)
+		      nil nil
+		      (yas--template-expand-env template)))
+
+(defun ivy-yasnippet--preview (template)
+  (with-current-buffer ivy-yasnippet--buffer
+    (let ((yas-verbosity 0)
+	  (inhibit-redisplay t)
+	  (inhibit-read-only t)
+	  (orig-offset (- (point-max) (cdr ivy-yasnippet--region)))
+	  (yas-prompt-functions '(yas-no-prompt)))
+      (ivy-yasnippet--revert)
+      (unwind-protect
+	  (ivy-yasnippet--expand-template template)
+	(unwind-protect
+	    (mapc #'yas--commit-snippet
+		  (yas-active-snippets (point-min) (point-max)))
+	  (setcdr ivy-yasnippet--region (- (point-max) orig-offset)))))
+    (redisplay)))
+
+(defun ivy-yasnippet--update-fn ()
+  (let* ((candidate (ivy-state-current ivy-last))
+	 (template (ivy-yasnippet--lookup-template candidate)))
+    (when template
+      (condition-case-unless-debug err
+	  (ivy-yasnippet--preview template)
+	(error (warn "ivy-yasnippet--update-fn: %S" err))))))
+
+(defun ivy-yasnippet--visit-snippet-action (template-name)
+  (let ((inhibit-read-only t))
+    (ivy-yasnippet--revert))
+  (yas--visit-snippet-file-1
+   (ivy-yasnippet--lookup-template template-name)))
+
+;;;###autoload
+(defun ivy-yasnippet ()
+  "Read a snippet name from the minibuffer and expand it at point.
+The completion is done using `ivy-read'.
+
+In the minibuffer, each time selection changes, the selected
+snippet is temporarily expanded at point for preview.
+
+If text before point matches snippet key of any candidate, that
+candidate will be initially selected, unless variable
+`ivy-yasnippet-expand-keys' is set to nil."
+  (interactive)
+  (barf-if-buffer-read-only)
+  (unless yas-minor-mode
+    (error "yas-minor-mode not enabled in current buffer"))
+  (let* ((ivy-yasnippet--buffer (current-buffer))
+
+	 (ivy-yasnippet--region
+	  (if (region-active-p)
+	      (cons (region-beginning) (region-end))
+	    (cons (point) (point))))
+	 (ivy-yasnippet--region-contents
+	  (buffer-substring (car ivy-yasnippet--region)
+			    (cdr ivy-yasnippet--region)))
+
+	 (key-info (yas--templates-for-key-at-point))
+	 (ivy-yasnippet--key
+	  (and key-info
+	       (buffer-substring (cadr key-info) (caddr key-info))))
+	 (templates-for-key-at-point (mapcar #'cdr (car key-info)))
+	 (ivy-yasnippet--key-deleted nil)
+	 (ivy-yasnippet--should-delete-key
+	  (memq ivy-yasnippet-expand-keys '(always smart)))
+
+	 (ivy-yasnippet--template-alist
+	  (mapcar (lambda (template)
+		    (cons (yas--template-name template) template))
+		  (yas--all-templates (yas--get-snippet-tables))))
+
+	 (modified-flag (buffer-modified-p))
+
+	 candidates selection)
+    (let ((buffer-undo-list t))
+      (setq candidates
+	    (-map #'car
+		  (-flatten
+		   (-map (-partial #'-sort (lambda (a b)
+					     (string-lessp (car a) (car b))))
+			 (-separate
+			  (-lambda ((_ . template))
+			    (memq template templates-for-key-at-point))
+			  ivy-yasnippet--template-alist)))))
+
+      (unwind-protect
+	  (let ((buffer-read-only t))
+	    (ivy-read "Choose a snippet: " candidates
+		      :require-match
+		      (not ivy-yasnippet-create-snippet-if-not-matched)
+		      :update-fn #'ivy-yasnippet--update-fn
+		      :action (lambda (candidate) (setq selection candidate))
+		      :preselect
+		      (when ivy-yasnippet--key
+			(-find-index
+			 (lambda (x)
+			   (string-equal
+			    ivy-yasnippet--key
+			    (yas--template-key
+			     (ivy-yasnippet--lookup-template x))))
+			 candidates))
+		      :caller 'ivy-yasnippet))
+	(ivy-yasnippet--revert)
+	(set-buffer-modified-p modified-flag)))
+    (when selection
+      (let ((template (ivy-yasnippet--lookup-template selection)))
+	(if template
+	    (ivy-yasnippet--expand-template template)
+	  (setq template ivy-yasnippet-new-snippet)
+	  (yas-new-snippet t)
+	  (when (derived-mode-p 'snippet-mode)
+	    (yas-expand-snippet
+	     template nil nil
+	     `((name ,selection)
+	       (yas-selected-text
+		,ivy-yasnippet--region-contents)))))))))
+
+(defun ivy-yasnippet-transformer (template-name)
+  (let* ((template (ivy-yasnippet--lookup-template template-name))
+	 (key (yas--template-key template)))
+    (if key
+	(concat template-name
+		" " (propertize (concat "[" key "]")
+			    'face
+			    (if (and (string-equal key ivy-yasnippet--key)
+				     ivy-yasnippet--should-delete-key)
+				'ivy-yasnippet-key-matching
+			      'ivy-yasnippet-key)))
+      template-name)))
+
+(ivy-set-display-transformer 'ivy-yasnippet
+			     #'ivy-yasnippet-transformer)
+
+(ivy-add-actions
+ #'ivy-yasnippet
+ '(("v" ivy-yasnippet--visit-snippet-action "Visit snippet file")))
+
+(provide 'ivy-yasnippet)
+
+;;; ivy-yasnippet.el ends here
diff --git a/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet.elc b/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet.elc
new file mode 100644
index 0000000..2c386de
Binary files /dev/null and b/elpa/ivy-yasnippet-20180621.636/ivy-yasnippet.elc differ
diff --git a/elpa/iy-go-to-char-20141029.1546/iy-go-to-char-autoloads.el b/elpa/iy-go-to-char-20141029.1546/iy-go-to-char-autoloads.el
new file mode 100644
index 0000000..4ab7139
--- /dev/null
+++ b/elpa/iy-go-to-char-20141029.1546/iy-go-to-char-autoloads.el
@@ -0,0 +1,114 @@
+;;; iy-go-to-char-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
+
+;;;### (autoloads nil "iy-go-to-char" "iy-go-to-char.el" (23391 65513
+;;;;;;  0 0))
+;;; Generated autoloads from iy-go-to-char.el
+
+(autoload 'iy-go-to-char "iy-go-to-char" "\
+Move forward to N occurrences of CHAR.
+\\
+
+Typing key of CHAR will move to the next occurence of CHAR.
+
+Typing `iy-go-to-char-key-forward' will move to the next
+occurence of CHAR.
+
+Typing `iy-go-to-char-key-backward', will move to the previous
+occurence of CHAR.
+
+Typing \\[iy-go-to-char-quit] will quit and return to the
+original point.
+
+Typing \\[iy-go-to-char-isearch] or
+\\[iy-go-to-char-isearch-backward]] will start `isearch` using
+CHAR.
+
+Typing \\[iy-go-to-char-kill-region] or
+\\[iy-go-to-char-kill-ring-save] will kill/copy between current
+point and the start point.
+
+Unless quit using \\[iy-go-to-char-quit] or the region is
+activated before searching, the start point is set as mark.
+
+\(fn N CHAR)" t nil)
+
+(autoload 'iy-go-to-char-backward "iy-go-to-char" "\
+Move backward to N occurence of CHAR.
+\\
+
+Typing key of CHAR will move to the previous occurence of CHAR.
+
+Typing `iy-go-to-char-key-forward' moves to the next occurrence
+of CHAR.
+
+Typing `iy-go-to-char-key-backward', moves to the previous
+occurrence of CHAR.
+
+Typing \\[iy-go-to-char-quit] will quit and return to the
+original point.
+
+Typing \\[iy-go-to-char-isearch] or
+\\[iy-go-to-char-isearch-backward]] will start `isearch` using
+CHAR.
+
+\(fn N CHAR)" t nil)
+
+(autoload 'iy-go-up-to-char "iy-go-to-char" "\
+Move forward to N occurrences of CHAR.
+Like `iy-go-to-char' but jump up to the CHAR so it is
+not included in the region between search start position and
+current point.
+
+\(fn N CHAR)" t nil)
+
+(autoload 'iy-go-up-to-char-backward "iy-go-to-char" "\
+Move backward to N occurrences of CHAR.
+Like `iy-go-to-char-backward' but jump up to the CHAR so it is
+not included in the region between search start position and
+current point.
+
+\(fn N CHAR)" t nil)
+
+(autoload 'iy-go-to-or-up-to-continue "iy-go-to-char" "\
+Continue last `iy-go-to-char' or `iy-go-to-char-backward' by N steps.
+Set `STOP-POSITION' to overwrite the last used stop position strategy.
+
+\(fn N &optional STOP-POSITION)" t nil)
+
+(autoload 'iy-go-to-or-up-to-continue-backward "iy-go-to-char" "\
+Continue last `iy-go-to-char' or `iy-go-to-char-backward' by N steps.
+Set `STOP-POSITION' to overwrite the last used stop position strategy.
+
+\(fn N &optional STOP-POSITION)" t nil)
+
+(autoload 'iy-go-to-char-continue "iy-go-to-char" "\
+Continue last `iy-go-to-char' or `iy-go-to-char-backward' by N steps.
+
+\(fn N)" t nil)
+
+(autoload 'iy-go-to-char-continue-backward "iy-go-to-char" "\
+Continue last `iy-go-to-char' or `iy-go-to-char-backward' by N steps.
+
+\(fn N)" t nil)
+
+(autoload 'iy-go-up-to-char-continue "iy-go-to-char" "\
+Continue last `iy-go-up-to-char' or `iy-go-up-to-char-backward' by N steps.
+
+\(fn N)" t nil)
+
+(autoload 'iy-go-up-to-char-continue-backward "iy-go-to-char" "\
+Continue last `iy-go-up-to-char' or `iy-go-up-to-char-backward' by N steps.
+
+\(fn N)" t nil)
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; End:
+;;; iy-go-to-char-autoloads.el ends here
diff --git a/elpa/iy-go-to-char-20141029.1546/iy-go-to-char-pkg.el b/elpa/iy-go-to-char-20141029.1546/iy-go-to-char-pkg.el
new file mode 100644
index 0000000..4578fc3
--- /dev/null
+++ b/elpa/iy-go-to-char-20141029.1546/iy-go-to-char-pkg.el
@@ -0,0 +1,2 @@
+;;; -*- no-byte-compile: t -*-
+(define-package "iy-go-to-char" "20141029.1546" "Go to next CHAR which is similar to \"f\" and \"t\" in vim" 'nil :commit "04ab4f5f3a241cbbc9b8c178a22b412a62f632f9" :keywords '("navigation" "search") :authors '(("Ian Yang ")) :maintainer '("Ian Yang ") :url "https://github.com/doitian/iy-go-to-char")
diff --git a/elpa/iy-go-to-char-20141029.1546/iy-go-to-char.el b/elpa/iy-go-to-char-20141029.1546/iy-go-to-char.el
new file mode 100644
index 0000000..9b0355c
--- /dev/null
+++ b/elpa/iy-go-to-char-20141029.1546/iy-go-to-char.el
@@ -0,0 +1,471 @@
+;;; iy-go-to-char.el --- Go to next CHAR which is similar to "f" and "t" in vim
+;; Copyright (C) 2009 Ian Yang
+
+;; Author: Ian Yang 
+;; Keywords: navigation, search
+;; Package-Version: 20141029.1546
+;; Filename: iy-go-to-char.el
+;; Description: Go to char
+;; Created: 2009-08-23 01:27:34
+;; Version: 3.2.2
+;; Last-Updated: 2014-10-29 22:39:29
+;; URL: https://github.com/doitian/iy-go-to-char
+;; Compatibility: GNU Emacs 23.1.1
+
+;;; License:
+
+;; 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 2, 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; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; This package defines the function `iy-go-to-char' which behaves like "f" in
+;; vim, and `iy-go-up-to-char` like "t" in vim.  It reads a char and go the
+;; next Nth occurence of the char.  User can continue such search using that
+;; char key.
+
+;; To use, make sure this file is on your `load-path' and put the
+;; following in your .emacs file:
+;;
+;;     (require 'iy-go-to-char)
+;;
+;; To make `iy-go-to-char' works better with `multiple-cursors', add
+;; `iy-go-to-char-start-pos' to `mc/cursor-specific-vars' when mc is loaded:
+;;
+;;     (add-to-list 'mc/cursor-specific-vars 'iy-go-to-char-start-pos)
+;;
+;; Then you can bind functions like:
+;;
+;;     (global-set-key (kbd "C-c f") 'iy-go-to-char)
+;;     (global-set-key (kbd "C-c F") 'iy-go-to-char-backward)
+;;     (global-set-key (kbd "C-c ;") 'iy-go-to-or-up-to-continue)
+;;     (global-set-key (kbd "C-c ,") 'iy-go-to-or-up-to-continue-backward)
+;;
+;; Or if you prefer up-to (vim "t") versions:
+;;
+;;     (global-set-key (kbd "C-c f") 'iy-go-up-to-char)
+;;     (global-set-key (kbd "C-c F") 'iy-go-up-to-char-backward)
+;;
+;; You also can bind go-to methods and up-to methods to different keys.
+;;
+;; Except repeating the char key, followings keys are defined before
+;; quitting the search (which can be disabled by setting
+;; `iy-go-to-char-override-local-map' to nil):
+;;
+;;    X   -- where X is the char to be searched. Repeating it will search
+;;           forward the char. Can be disabled through
+;;           `iy-go-to-char-continue-when-repeating'
+;;
+;;    ;   -- search forward the char, customizable:
+;;           `iy-go-to-char-key-forward', `iy-go-to-char-use-key-forward'
+;;
+;;    ,   -- search backward the char, customizable:
+;;           `iy-go-to-char-key-backward', `iy-go-to-char-use-key-backward'
+;;
+;;    C-g -- quit
+;;
+;;    C-s -- start `isearch-forward' using char as initial search
+;;           string
+;;
+;;    C-r -- start `isearch-backward' using char as initial search
+;;           string
+;;
+;;    C-w -- quit and kill region between start and current point.  If region is
+;;           activated before search, then use the original mark instead of the
+;;           start position.
+;;
+;;    M-w -- quit and save region between start and current point.  If region is
+;;           activated before search, use the mark instead of start position.
+;;
+;; All other keys will quit the search.  Then the key event is
+;; intepreted in the original environment before search.
+;;
+;; if the search quits because of error or using "C-g", point is set
+;; back to the start position.  Otherwise, point is not change and the
+;; start position is set as marker.  So you can use "C-x C-x" back to
+;; that position.
+
+;; `iy-go-to-char-backward' search backward by default.  Also the search can
+;; cross lines.  To continue search last char, use `iy-go-to-char-continue' and
+;; `iy-go-to-char-continue-backward'.
+
+;;; Change Log:
+;; 2014-10-29 (3.2.2)
+;;
+;;    - Add options `iy-go-to-char-use-key-forward',
+;;      `iy-go-to-char-use-key-backward' and
+;;      `iy-go-to-char-continue-when-repeating' to toggle the feature that
+;;      continuing search by repeat typing a single key.
+;;    - Add option `iy-go-to-char-override-local-map' to disable the temporary
+;;      map after activate `iy-go-to-char'.
+;;
+;; 2013-04-28 (3.2.1)
+;;
+;;    - Fix documentations.
+;;    - Add up-to versions: `iy-go-up-to-char', `iy-go-up-to-char-backward',
+;;      `iy-go-up-to-char-continue' and `iy-go-up-to-char-continue-backward'.
+;;
+;; 2013-04-28 (3.1)
+;;
+;;    - Better integration with `multiple-cursors'.
+;;    - Refactoring documentations.
+;;
+;; 2013-04-08 (3.0)
+;;
+;;    - When jump is started backward (with negative parameter, or
+;;      `iy-go-to-char-backward'). Repeating continues the search
+;;      backward. Also `iy-go-to-char-key-forward' jumps with the same
+;;      direction when jump is started, and `iy-go-to-char-key-backward' jumps
+;;      to reverse direction.
+;;
+;; 2013-03-25 (2.1)
+;;    - Fix a but that I forget to set `mc--this-command'
+;;
+;; 2013-03-25 (2.0)
+;;    - Use overriding-local-map to setup keymap
+;;    - multiple-cursors compatible
+;;
+;; 2012-04-16 (1.1)
+;;    - fix C-s/C-r to enter isearch
+
+;;; Code:
+
+(defgroup iy-go-to-char nil
+  "go to char like f in vim."
+  :link '(emacs-commentary-link "iy-go-to-char")
+  :prefix "iy-go-to-char-"
+  :group 'matching)
+
+(defcustom iy-go-to-char-key-forward ?\;
+  "Default key used to go to next occurrence of the char."
+  :type 'character
+  :group 'iy-go-to-char)
+(defcustom iy-go-to-char-use-key-forward t
+  "Whether bind `iy-go-to-char-key-forward' to go to next occurrence of the char."
+  :type 'boolean
+  :group 'iy-go-to-char)
+(defcustom iy-go-to-char-key-backward ?\,
+  "Default key used to go to previous occurrence of the char."
+  :type 'character
+  :group 'iy-go-to-char)
+(defcustom iy-go-to-char-use-key-backward t
+  "Whether bind `iy-go-to-char-key-backward' to go to next occurrence of the char."
+  :type 'boolean
+  :group 'iy-go-to-char)
+(defcustom iy-go-to-char-continue-when-repeating t
+  "Whether continue the search by repeating the search char."
+  :type 'boolean
+  :group 'iy-go-to-char)
+(defcustom iy-go-to-char-override-local-map t
+  "Whether use the temporary key bindings following `iy-go-to-char'."
+  :type 'boolean
+  :group 'iy-go-to-char)
+
+(defvar iy-go-to-char-start-pos nil
+  "Position where go to char mode is enabled.")
+
+(defvar iy-go-to-char-start-dir 1
+  "Jump start direction.")
+
+(defvar iy-go-to-char-last-char nil
+  "Last char used in iy-go-to-char.")
+
+(defvar iy-go-to-char-last-step 1
+  "Last jump step used in iy-go-to-char.")
+
+(defvar iy-go-to-char-stop-position 'include
+  "Control where to place the point after found a match.
+Set to `include' so the next matched char is included in the
+region between start search position and current point.
+
+Set to `exclude' so the next matched char is excluded in the region.")
+
+(defvar iy-go-to-char-keymap (let ((map (make-sparse-keymap)))
+                               (define-key map (kbd "C-s") 'iy-go-to-char-isearch)
+                               (define-key map (kbd "C-r") 'iy-go-to-char-isearch-backward)
+                               (define-key map (kbd "C-w") 'iy-go-to-char-kill-region)
+                               (define-key map (kbd "M-w") 'iy-go-to-char-kill-ring-save)
+                               (define-key map (kbd "C-g") 'iy-go-to-char-quit)
+
+                               map)
+  "Keymap used when iy-go-to-char is ongoing.")
+
+
+
+(defun iy-go-to-char--set-mc-command (command)
+  "Set COMMAND as multiple cursors this command."
+  (when (and (boundp 'multiple-cursors-mode) multiple-cursors-mode (boundp 'mc--this-command))
+    (setq mc--this-command command)))
+
+(defun iy-go-to-char--set-mc-specific-vars ()
+  "Add `iy-go-to-char-start-pos' to `mc/cursor-specific-vars'."
+  (when (boundp 'mc/cursor-specific-vars)
+    (add-to-list 'mc/cursor-specific-vars 'iy-go-to-char-start-pos))
+  (remove-hook 'multiple-cursors-mode-hook 'iy-go-to-char--set-mc-specific-vars))
+(add-hook 'multiple-cursors-mode-hook 'iy-go-to-char--set-mc-specific-vars)
+
+(defun iy-go-to-char--isearch-setup ()
+  "Setup jump char as initial string for isearch."
+  (remove-hook 'isearch-mode-hook 'iy-go-to-char--isearch-setup)
+  (setq isearch-string (if iy-go-to-char-last-char (string iy-go-to-char-last-char) ""))
+  (isearch-search-and-update))
+
+(defun iy-go-to-char--override-local-map (char)
+  "Override the local key map for jump char CHAR."
+  (when iy-go-to-char-override-local-map
+   (setq overriding-local-map
+        (let ((map (copy-keymap iy-go-to-char-keymap)))
+
+          (when iy-go-to-char-continue-when-repeating
+            (define-key map (string char) 'iy-go-to-or-up-to-continue))
+          (when iy-go-to-char-use-key-forward
+            (define-key map (string iy-go-to-char-key-forward) 'iy-go-to-or-up-to-continue))
+          (when iy-go-to-char-use-key-backward
+            (define-key map (string iy-go-to-char-key-backward) 'iy-go-to-or-up-to-continue-backward))
+
+          (define-key map [t] 'iy-go-to-char-pass-through)
+
+          map))))
+
+
+
+(defun iy-go-to-char-done ()
+  "Finish iy-go-to-char-mode."
+  (interactive)
+  (push-mark iy-go-to-char-start-pos t)
+  (setq iy-go-to-char-start-pos nil)
+  (setq overriding-local-map nil))
+
+(defun iy-go-to-char-quit ()
+  "Quit iy-go-to-char-mode."
+  (interactive)
+  (goto-char iy-go-to-char-start-pos)
+  (setq iy-go-to-char-start-pos nil)
+  (setq overriding-local-map nil))
+
+(defun iy-go-to-char-pass-through ()
+  "Finish iy-go-to-char-mode and invoke the corresponding command."
+  (interactive)
+  (iy-go-to-char-done)
+  (let* ((keys (progn
+                 (setq unread-command-events
+                       (append (this-single-command-raw-keys)
+                               unread-command-events))
+                 (read-key-sequence-vector "")))
+         (command (and keys (key-binding keys))))
+    (when (commandp command)
+      (setq this-command command
+            this-original-command command)
+      (iy-go-to-char--set-mc-command `(lambda ()
+                                        (interactive)
+                                        (push-mark iy-go-to-char-start-pos t)
+                                        (setq iy-go-to-char-start-pos nil)
+                                        (call-interactively ',command)))
+      (call-interactively command))))
+
+(defun iy-go-to-char-isearch ()
+  "Start isearch using the char."
+  (interactive)
+  (iy-go-to-char-done)
+  (add-hook 'isearch-mode-hook 'iy-go-to-char--isearch-setup)
+  (isearch-forward))
+
+(defun iy-go-to-char-isearch-backward ()
+  "Start isearch backward using the char."
+  (interactive)
+  (iy-go-to-char-done)
+  (add-hook 'isearch-mode-hook 'iy-go-to-char--isearch-setup)
+  (isearch-backward))
+
+(defun iy-go-to-char-kill-region ()
+  "Kill region between jump start position and current position."
+  (interactive)
+  (iy-go-to-char-done)
+  (iy-go-to-char--set-mc-command (lambda ()
+                                   (interactive)
+                                   (kill-region (point) iy-go-to-char-start-pos)
+                                   (setq iy-go-to-char-start-pos nil)))
+  (kill-region (point) (mark)))
+
+(defun iy-go-to-char-kill-ring-save ()
+  "Save region between jump start position and current position."
+  (interactive)
+  (iy-go-to-char-done)
+  (iy-go-to-char--set-mc-command (lambda ()
+                                   (interactive)
+                                   (kill-ring-save (point) iy-go-to-char-start-pos)
+                                   (setq iy-go-to-char-start-pos nil)))
+  (kill-ring-save (point) (mark)))
+
+(defun iy-go-to-char--command ()
+  "Repeatable command to really move cursor."
+  (interactive)
+  (setq iy-go-to-char-start-pos (or iy-go-to-char-start-pos (point)))
+  (let* ((pos (point))
+         (n (if (< iy-go-to-char-start-dir 0)
+                (- iy-go-to-char-last-step)
+              iy-go-to-char-last-step))
+         (dir (if (< n 0) -1 1)))
+    (condition-case err
+        (progn
+          (unless (or (eq iy-go-to-char-stop-position 'include)
+                     (if (< dir 0) (bobp) (eobp)))
+            (forward-char dir))
+          (search-forward (string iy-go-to-char-last-char) nil nil n)
+          (unless (eq iy-go-to-char-stop-position 'include)
+            (forward-char (- dir))))
+      (error (goto-char pos)
+             (signal (car err) (cdr err))))))
+
+(defun iy-go-to-char--internal (n char stop-position)
+  "Store jump step N and jump CHAR for `iy-go-to-char--command'.
+If STOP-POSITION is not `include', jump up to char but excluding the char."
+  (interactive "p\ncGo to char: ")
+  (setq iy-go-to-char-last-step n)
+  (setq iy-go-to-char-last-char char)
+  (setq iy-go-to-char-stop-position stop-position)
+  (unless iy-go-to-char-start-pos
+    (setq iy-go-to-char-start-pos (point))
+    (iy-go-to-char--override-local-map char))
+
+  (setq this-original-command 'iy-go-to-char--command
+        this-command 'iy-go-to-char--command)
+  (iy-go-to-char--set-mc-command 'iy-go-to-char--command)
+  (call-interactively 'iy-go-to-char--command))
+
+;;;###autoload
+(defun iy-go-to-char (n char)
+  "Move forward to N occurrences of CHAR.
+\\
+
+Typing key of CHAR will move to the next occurence of CHAR.
+
+Typing `iy-go-to-char-key-forward' will move to the next
+occurence of CHAR.
+
+Typing `iy-go-to-char-key-backward', will move to the previous
+occurence of CHAR.
+
+Typing \\[iy-go-to-char-quit] will quit and return to the
+original point.
+
+Typing \\[iy-go-to-char-isearch] or
+\\[iy-go-to-char-isearch-backward]] will start `isearch` using
+CHAR.
+
+Typing \\[iy-go-to-char-kill-region] or
+\\[iy-go-to-char-kill-ring-save] will kill/copy between current
+point and the start point.
+
+Unless quit using \\[iy-go-to-char-quit] or the region is
+activated before searching, the start point is set as mark."
+  (interactive "p\ncGo to char: ")
+  (setq iy-go-to-char-start-dir (if (< n 0) -1 1))
+  (iy-go-to-char--internal n char 'include))
+
+;;;###autoload
+(defun iy-go-to-char-backward (n char)
+  "Move backward to N occurence of CHAR.
+\\
+
+Typing key of CHAR will move to the previous occurence of CHAR.
+
+Typing `iy-go-to-char-key-forward' moves to the next occurrence
+of CHAR.
+
+Typing `iy-go-to-char-key-backward', moves to the previous
+occurrence of CHAR.
+
+Typing \\[iy-go-to-char-quit] will quit and return to the
+original point.
+
+Typing \\[iy-go-to-char-isearch] or
+\\[iy-go-to-char-isearch-backward]] will start `isearch` using
+CHAR."
+  (interactive "p\ncGo back to char: ")
+  (setq iy-go-to-char-start-dir (if (< n 0) 1 -1))
+  (iy-go-to-char--internal n char 'include))
+
+;;;###autoload
+(defun iy-go-up-to-char (n char)
+  "Move forward to N occurrences of CHAR.
+Like `iy-go-to-char' but jump up to the CHAR so it is
+not included in the region between search start position and
+current point."
+  (interactive "p\ncGo up to char: ")
+  (setq iy-go-to-char-start-dir (if (< n 0) -1 1))
+  (iy-go-to-char--internal n char 'exclude))
+
+;;;###autoload
+(defun iy-go-up-to-char-backward (n char)
+  "Move backward to N occurrences of CHAR.
+Like `iy-go-to-char-backward' but jump up to the CHAR so it is
+not included in the region between search start position and
+current point."
+  (interactive "p\ncGo back up to char: ")
+  (setq iy-go-to-char-start-dir (if (< n 0) 1 -1))
+  (iy-go-to-char--internal n char 'exclude))
+
+;;;###autoload
+(defun iy-go-to-or-up-to-continue (n &optional stop-position)
+  "Continue last `iy-go-to-char' or `iy-go-to-char-backward' by N steps.
+Set `STOP-POSITION' to overwrite the last used stop position strategy."
+  (interactive "p")
+  (when iy-go-to-char-last-char
+    (iy-go-to-char--internal n iy-go-to-char-last-char (or stop-position
+                                                           iy-go-to-char-stop-position
+                                                           'include))))
+
+;;;###autoload
+(defun iy-go-to-or-up-to-continue-backward (n &optional stop-position)
+  "Continue last `iy-go-to-char' or `iy-go-to-char-backward' by N steps.
+Set `STOP-POSITION' to overwrite the last used stop position strategy."
+  (interactive "p")
+  (when iy-go-to-char-last-char
+    (iy-go-to-char--internal (- n) iy-go-to-char-last-char (or stop-position
+                                                               iy-go-to-char-stop-position
+                                                               'include))))
+
+;;;###autoload
+(defun iy-go-to-char-continue (n)
+  "Continue last `iy-go-to-char' or `iy-go-to-char-backward' by N steps."
+  (interactive "p")
+  (iy-go-to-or-up-to-continue n 'include))
+
+;;;###autoload
+(defun iy-go-to-char-continue-backward (n)
+  "Continue last `iy-go-to-char' or `iy-go-to-char-backward' by N steps."
+  (interactive "p")
+  (iy-go-to-or-up-to-continue-backward n 'include))
+
+;;;###autoload
+(defun iy-go-up-to-char-continue (n)
+  "Continue last `iy-go-up-to-char' or `iy-go-up-to-char-backward' by N steps."
+  (interactive "p")
+  (iy-go-to-or-up-to-continue n 'exclude))
+
+;;;###autoload
+(defun iy-go-up-to-char-continue-backward (n)
+  "Continue last `iy-go-up-to-char' or `iy-go-up-to-char-backward' by N steps."
+  (interactive "p")
+  (iy-go-to-or-up-to-continue-backward n 'exclude))
+
+
+
+(provide 'iy-go-to-char)
+
+;;; iy-go-to-char.el ends here
+
+;;  LocalWords:  customizable
diff --git a/elpa/iy-go-to-char-20141029.1546/iy-go-to-char.elc b/elpa/iy-go-to-char-20141029.1546/iy-go-to-char.elc
new file mode 100644
index 0000000..7ec0fe3
Binary files /dev/null and b/elpa/iy-go-to-char-20141029.1546/iy-go-to-char.elc differ
diff --git a/elpa/js2-mode-20171224.1833/js2-imenu-extras.el b/elpa/js2-mode-20171224.1833/js2-imenu-extras.el
deleted file mode 100644
index dfdedc8..0000000
--- a/elpa/js2-mode-20171224.1833/js2-imenu-extras.el
+++ /dev/null
@@ -1,349 +0,0 @@
-;;; js2-imenu-extras.el --- Imenu support for additional constructs
-
-;; Copyright (C) 2012-2014  Free Software Foundation, Inc.
-
-;; Author:    Dmitry Gutov 
-;; Keywords:  languages, javascript, imenu
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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.  If not, see .
-
-;;; Commentary:
-
-;; This package adds Imenu support for additional framework constructs and
-;; structural patterns to `js2-mode'.
-
-;; Usage:
-
-;; (add-hook 'js2-mode-hook 'js2-imenu-extras-mode)
-
-;; To customize how it works:
-;;   M-x customize-group RET js2-imenu RET
-
-(eval-when-compile
-  (require 'cl))
-
-(require 'js2-mode)
-
-(defvar js2-imenu-extension-styles
-  `((:framework jquery
-     :call-re   "\\_<\\(?:jQuery\\|\\$\\|_\\)\\.extend\\s-*("
-     :recorder  js2-imenu-record-jquery-extend)
-
-    (:framework jquery-ui
-     :call-re   "^\\s-*\\(?:jQuery\\|\\$\\)\\.widget\\s-*("
-     :recorder  js2-imenu-record-string-declare)
-
-    (:framework dojo
-     :call-re   "^\\s-*dojo.declare\\s-*("
-     :recorder  js2-imenu-record-string-declare)
-
-    (:framework backbone
-     :call-re   ,(concat "\\_<" js2-mode-identifier-re "\\.extend\\s-*(")
-     :recorder  js2-imenu-record-backbone-extend)
-
-    (:framework enyo
-     :call-re   "\\_
-;;         mooz 
-;;         Dmitry Gutov 
-;; URL:  https://github.com/mooz/js2-mode/
-;;       http://code.google.com/p/js2-mode/
-;; Version: 20170721
-;; Keywords: languages, javascript
-;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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.  If not, see .
-
-;;; Commentary:
-
-;; This JavaScript editing mode supports:
-
-;;  - strict recognition of the Ecma-262 language standard
-;;  - support for most Rhino and SpiderMonkey extensions from 1.5 and up
-;;  - parsing support for ECMAScript for XML (E4X, ECMA-357)
-;;  - accurate syntax highlighting using a recursive-descent parser
-;;  - on-the-fly reporting of syntax errors and strict-mode warnings
-;;  - undeclared-variable warnings using a configurable externs framework
-;;  - "bouncing" line indentation to choose among alternate indentation points
-;;  - smart line-wrapping within comments and strings
-;;  - code folding:
-;;    - show some or all function bodies as {...}
-;;    - show some or all block comments as /*...*/
-;;  - context-sensitive menu bar and popup menus
-;;  - code browsing using the `imenu' package
-;;  - many customization options
-
-;; Installation:
-;;
-;; To install it as your major mode for JavaScript editing:
-
-;;   (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
-
-;; Alternatively, to install it as a minor mode just for JavaScript linting,
-;; you must add it to the appropriate major-mode hook.  Normally this would be:
-
-;;   (add-hook 'js-mode-hook 'js2-minor-mode)
-
-;; You may also want to hook it in for shell scripts running via node.js:
-
-;;   (add-to-list 'interpreter-mode-alist '("node" . js2-mode))
-
-;; Support for JSX is available via the derived mode `js2-jsx-mode'.  If you
-;; also want JSX support, use that mode instead:
-
-;;   (add-to-list 'auto-mode-alist '("\\.jsx?\\'" . js2-jsx-mode))
-;;   (add-to-list 'interpreter-mode-alist '("node" . js2-jsx-mode))
-
-;; To customize how it works:
-;;   M-x customize-group RET js2-mode RET
-
-;; Notes:
-
-;; This mode includes a port of Mozilla Rhino's scanner, parser and
-;; symbol table.  Ideally it should stay in sync with Rhino, keeping
-;; `js2-mode' current as the EcmaScript language standard evolves.
-
-;; Unlike cc-engine based language modes, js2-mode's line-indentation is not
-;; customizable.  It is a surprising amount of work to support customizable
-;; indentation.  The current compromise is that the tab key lets you cycle among
-;; various likely indentation points, similar to the behavior of python-mode.
-
-;; This mode does not yet work with "multi-mode" modes such as `mmm-mode'
-;; and `mumamo', although it could be made to do so with some effort.
-;; This means that `js2-mode' is currently only useful for editing JavaScript
-;; files, and not for editing JavaScript within 
+"
+               root-path)))))
+
+(defun org-reveal-mathjax-scripts (info)
+  "Return the HTML contents for declaring MathJax scripts"
+  (if (plist-get info :reveal-mathjax)
+      ;; MathJax enabled.
+      (format "\n"
+              (plist-get info :reveal-mathjax-url))))
+
+(defun org-reveal-scripts (info)
+  "Return the necessary scripts for initializing reveal.js using
+custom variable `org-reveal-root'."
+  (let* ((root-path (file-name-as-directory (plist-get info :reveal-root)))
+         (head-min-js (concat root-path "lib/js/head.min.js"))
+         (reveal-js (concat root-path "js/reveal.js"))
+         ;; Local files
+         (local-root-path (org-reveal--file-url-to-path root-path))
+         (local-head-min-js (concat local-root-path "lib/js/head.min.js"))
+         (local-reveal-js (concat local-root-path "js/reveal.js"))
+         (in-single-file (plist-get info :reveal-single-file)))
+    (concat
+     ;; reveal.js/lib/js/head.min.js
+     ;; reveal.js/js/reveal.js
+     (if (and in-single-file
+              (file-readable-p local-head-min-js)
+              (file-readable-p local-reveal-js))
+         ;; Embed scripts into HTML
+         (concat "")
+       ;; Fall-back to extern script links
+       (if in-single-file
+           ;; Tried to embed scripts but failed. Print a message about possible errors.
+           (error (concat "Cannot read "
+                            (mapconcat 'identity
+                                       (delq nil (mapcar (lambda (file) (if (not (file-readable-p file)) file))
+                                                         (list local-head-min-js local-reveal-js)))
+                                       ", "))))
+       (concat
+        "\n"
+        "\n"))
+     ;; plugin headings
+     "
+\n")))
+
+(defun org-reveal-toc (depth info)
+  "Build a slide of table of contents."
+  (let ((toc (org-html-toc depth info)))
+    (if toc
+        (format "
\n%s
\n" + (replace-regexp-in-string "\n%s" org-reveal--last-slide-section-tag "")))) + +(defun org-reveal-parse-keyword-value (value) + "According to the value content, return HTML tags to split slides." + (let ((tokens (mapcar + (lambda (x) (split-string x ":")) + (split-string value)))) + (mapconcat + (lambda (x) (apply 'org-reveal-parse-token x)) + tokens + ""))) + +;; Copied from org-html-format-list-item. Overwrite HTML class +;; attribute when there is attr_html attributes. +(defun org-reveal-format-list-item (contents type checkbox attributes info + &optional term-counter-id + headline) + "Format a list item into HTML." + (let ((attr-html (cond (attributes (format " %s" (org-html--make-attribute-string attributes))) + (checkbox (format " class=\"%s\"" (symbol-name checkbox))) + (t ""))) + (checkbox (concat (org-html-checkbox checkbox info) + (and checkbox " "))) + (br (org-html-close-tag "br" nil info))) + (concat + (case type + (ordered + (let* ((counter term-counter-id) + (extra (if counter (format " value=\"%s\"" counter) ""))) + (concat + (format "" attr-html extra) + (when headline (concat headline br))))) + (unordered + (let* ((id term-counter-id) + (extra (if id (format " id=\"%s\"" id) ""))) + (concat + (format "" attr-html extra) + (when headline (concat headline br))))) + (descriptive + (let* ((term term-counter-id)) + (setq term (or term "(no term)")) + ;; Check-boxes in descriptive lists are associated to tag. + (concat (format "%s" + attr-html (concat checkbox term)) + (format "" attr-html))))) + (unless (eq type 'descriptive) checkbox) + (and contents (org-trim contents)) + (case type + (ordered "") + (unordered "") + (descriptive ""))))) + +;; Copied from org-html-item, changed to call +;; org-reveal-format-list-item. +(defun org-reveal-item (item contents info) + "Transcode an ITEM element from Org to Reveal. +CONTENTS holds the contents of the item. INFO is a plist holding +contextual information." + (let* ((plain-list (org-export-get-parent item)) + (type (org-element-property :type plain-list)) + (counter (org-element-property :counter item)) + (attributes (org-export-read-attribute :attr_html item)) + ; (attributes (org-html--make-attribute-string (org-export-read-attribute :attr_html item))) + (checkbox (org-element-property :checkbox item)) + (tag (let ((tag (org-element-property :tag item))) + (and tag (org-export-data tag info))))) + (org-reveal-format-list-item + contents type checkbox attributes info (or tag counter)))) + +(defun org-reveal-keyword (keyword contents info) + "Transcode a KEYWORD element from Org to Reveal, +and may change custom variables as SIDE EFFECT. +CONTENTS is nil. INFO is a plist holding contextual information." + (let ((key (org-element-property :key keyword)) + (value (org-element-property :value keyword))) + (case (intern key) + (REVEAL (org-reveal-parse-keyword-value value)) + (REVEAL_HTML value) + (HTML value)))) +(defun org-reveal-embedded-svg (path) + "Embed the SVG content into Reveal HTML." + (with-temp-buffer + (insert-file-contents-literally path) + (let ((start (re-search-forward "<[ \t\n]*svg[ \t\n]")) + (end (re-search-forward "<[ \t\n]*/svg[ \t\n]*>"))) + (concat "\n%s\n\n" + (if attrs (concat " " (org-html--make-attribute-string attrs)) "") + (org-html-latex-environment latex-env contents info)))) + +(defun org-reveal-plain-list (plain-list contents info) + "Transcode a PLAIN-LIST element from Org to Reveal. + +CONTENTS is the contents of the list. INFO is a plist holding +contextual information. + +Extract and set `attr_html' to plain-list tag attributes." + (let ((tag (case (org-element-property :type plain-list) + (ordered "ol") + (unordered "ul") + (descriptive "dl"))) + (attrs (org-export-read-attribute :attr_html plain-list))) + (format "%s<%s%s>\n%s\n%s" + (if (string= org-html-checkbox-type 'html) "
" "") + tag + (if attrs (concat " " (org-html--make-attribute-string attrs)) "") + contents + tag + (if (string= org-html-checkbox-type 'html) "
" "")))) + +(defun org-reveal--build-pre/postamble (type info) + "Return document preamble or postamble as a string, or nil." + (let ((section (plist-get info (intern (format ":reveal-%s" type)))) + (spec (org-html-format-spec info))) + (when section + (let ((section-contents + (if (functionp (intern section)) (funcall (intern section) info) + ;; else section is a string. + (format-spec section spec)))) + (when (org-string-nw-p section-contents) + (org-element-normalize-string section-contents)))))) + + +(defun org-reveal-section (section contents info) + "Transcode a SECTION element from Org to Reveal. +CONTENTS holds the contents of the section. INFO is a plist +holding contextual information." + ;; Just return the contents. No "
" tags. + contents) + +(defun org-reveal--using-highlight.js (info) + "Check whether highlight.js plugin is enabled." + (let ((reveal-plugins (condition-case e + (car (read-from-string (plist-get info :reveal-plugins))) + (end-of-file nil) + (wrong-type-argument nil)))) + (memq 'highlight (or (and reveal-plugins (listp reveal-plugins) reveal-plugins) + org-reveal-plugins)))) + +(defun org-reveal-src-block (src-block contents info) + "Transcode a SRC-BLOCK element from Org to Reveal. +CONTENTS holds the contents of the item. INFO is a plist holding +contextual information." + (if (org-export-read-attribute :attr_html src-block :textarea) + (org-html--textarea-block src-block) + (let* ((use-highlight (org-reveal--using-highlight.js info)) + (lang (org-element-property :language src-block)) + (caption (org-export-get-caption src-block)) + (code (if (not use-highlight) + (org-html-format-code src-block info) + (cl-letf (((symbol-function 'org-html-htmlize-region-for-paste) + #'buffer-substring)) + (org-html-format-code src-block info)))) + (frag (org-export-read-attribute :attr_reveal src-block :frag)) + (code-attribs (or (org-export-read-attribute + :attr_reveal src-block :code_attribs) "")) + (label (let ((lbl (org-element-property :name src-block))) + (if (not lbl) "" + (format " id=\"%s\"" lbl))))) + (if (not lang) + (format "
\n%s
" + (or (frag-class frag info) " class=\"example\"") + label + code) + (format + "
\n%s%s\n
" + (if (not caption) "" + (format "" + (org-export-data caption info))) + (if use-highlight + (format "\n%s
" + (or (frag-class frag info) "") + label lang code-attribs code) + (format "\n
%s
" + (or (frag-class frag info) + (format " class=\"src src-%s\"" lang)) + label code))))))) + +(defun org-reveal-quote-block (quote-block contents info) + "Transcode a QUOTE-BLOCK element from Org to Reveal. +CONTENTS holds the contents of the block INFO is a plist holding +contextual information." + (format "
\n%s
" + (frag-class (org-export-read-attribute :attr_reveal quote-block :frag) info) + contents)) + + +(defun org-reveal--auto-title-slide-template (info) + "Generate the automatic title slide template." + (let* ((spec (org-html-format-spec info)) + (title (org-export-data (plist-get info :title) info)) + (author (cdr (assq ?a spec))) + (email (cdr (assq ?e spec))) + (date (cdr (assq ?d spec)))) + (concat + (when (and (plist-get info :with-title) + (org-string-nw-p title)) + (concat "

" title "

")) + (when (and (plist-get info :with-author) + (org-string-nw-p author)) + (concat "

" author "

")) + (when (and (plist-get info :with-email) + (org-string-nw-p email)) + (concat "

" email "

")) + (when (and (plist-get info :with-date) + (org-string-nw-p date)) + (concat "

" date "

")) + (when (plist-get info :time-stamp-file) + (concat "

" + (org-html--translate "Created" info) + ": " + (format-time-string + (plist-get info :html-metadata-timestamp-format)) + "

"))))) + +(defun org-reveal-template (contents info) + "Return complete document string after HTML conversion. +contents is the transcoded contents string. +info is a plist holding export options." + (concat + (format "\n\n\n" + (if-format " lang=\"%s\"" (plist-get info :language))) + "\n" + (if-format "%s\n" (org-export-data (plist-get info :title) info)) + (if-format "\n" (plist-get info :author)) + (if-format "\n" (plist-get info :description)) + (if-format "\n" (plist-get info :keywords)) + (org-reveal-stylesheets info) + (org-reveal-mathjax-scripts info) + (org-reveal--build-pre/postamble 'head-preamble info) + (org-element-normalize-string (plist-get info :html-head)) + (org-element-normalize-string (plist-get info :html-head-extra)) + " +\n" + (org-reveal--build-pre/postamble 'preamble info) + "
+
\n" + ;; Title slides + (let ((title-slide (plist-get info :reveal-title-slide))) + (when (and title-slide (not (plist-get info :reveal-subtree))) + (let ((title-slide-background (plist-get info :reveal-title-slide-background)) + (title-slide-background-size (plist-get info :reveal-title-slide-background-size)) + (title-slide-background-position (plist-get info :reveal-title-slide-background-position)) + (title-slide-background-repeat (plist-get info :reveal-title-slide-background-repeat)) + (title-slide-background-transition (plist-get info :reveal-title-slide-background-transition))) + (concat "
" + (cond ((eq title-slide nil) nil) + ((stringp title-slide) (format-spec title-slide (org-html-format-spec info))) + ((eq title-slide 'auto) (org-reveal--auto-title-slide-template info))) + "\n
\n")))) + contents + "
+
\n" + (org-reveal--build-pre/postamble 'postamble info) + (org-reveal-scripts info) + " +\n")) + +(defun org-reveal-filter-parse-tree (tree backend info) + "Do filtering before parsing TREE. + +Tree is the parse tree being exported. BACKEND is the export +back-end used. INFO is a plist-used as a communication channel. + +Assuming BACKEND is `reveal'. + +Each `attr_reveal' attribute is mapped to corresponding +`attr_html' attributes." + (let ((default-frag-style (plist-get info :reveal-default-frag-style))) + (org-element-map tree (remq 'item org-element-all-elements) + (lambda (elem) (org-reveal-append-frag elem default-frag-style)))) + ;; Return the updated tree. + tree) + +(defun org-reveal--update-attr-html (elem frag default-style &optional frag-index) + "Update ELEM's attr_html atrribute with reveal's +fragment attributes." + (let ((attr-html (org-element-property :attr_html elem))) + (when (and frag (not (string= frag "none"))) + (push (cond ((string= frag t) + (if default-style (format ":class fragment %s" default-style) + ":class fragment")) + (t (format ":class fragment %s" frag))) + attr-html) + (when frag-index + (push (format ":data-fragment-index %s" frag-index) attr-html))) + (org-element-put-property elem :attr_html attr-html))) + +(defun org-reveal-append-frag (elem default-style) + "Read org-reveal's fragment attribute from ELEM and append +transformed fragment attribute to ELEM's attr_html plist." + (let ((frag (org-export-read-attribute :attr_reveal elem :frag)) + (frag-index (org-export-read-attribute :attr_reveal elem :frag_idx))) + (if frag + (cond ((and (string= (org-element-type elem) 'plain-list) + (char-equal (string-to-char frag) ?\()) + (let* ((frag-list (car (read-from-string frag))) + (frag-list (if default-style + (mapcar (lambda (s) + "Replace t with default-style" + (if (string= s t) default-style + s)) + frag-list) + frag-list)) + (items (org-element-contents elem))) + (if frag-index + (mapcar* 'org-reveal--update-attr-html + items frag-list default-style (car (read-from-string frag-index))) + (let* ((last-frag (car (last frag-list))) + (tail-list (mapcar (lambda (a) last-frag) + (number-sequence (+ (length frag-list) 1) + (length items)))) + (default-style-list + (mapcar (lambda (a) default-style) + (number-sequence 1 (length items))))) + (nconc frag-list tail-list) + (mapcar* 'org-reveal--update-attr-html items frag-list default-style-list))))) + (t (org-reveal--update-attr-html elem frag default-style frag-index))) + elem))) + +(defvar client-multiplex nil + "used to cause generation of client html file for multiplex") + +(defun org-reveal-export-to-html + (&optional async subtreep visible-only body-only ext-plist) + "Export current buffer to a reveal.js HTML file." + (interactive) + (let* ((extension (concat "." org-html-extension)) + (file (org-export-output-file-name extension subtreep)) + (clientfile (org-export-output-file-name (concat "_client" extension) subtreep))) + + ; export filename_client HTML file if multiplexing + (setq client-multiplex nil) + (setq retfile (org-export-to-file 'reveal file + async subtreep visible-only body-only ext-plist)) + + ; export the client HTML file if client-multiplex is set true + ; by previous call to org-export-to-file + (if (eq client-multiplex t) + (org-export-to-file 'reveal clientfile + async subtreep visible-only body-only ext-plist)) + (cond (t retfile)))) + +(defun org-reveal-export-to-html-and-browse + (&optional async subtreep visible-only body-only ext-plist) + "Export current buffer to a reveal.js and browse HTML file." + (interactive) + (browse-url-of-file (expand-file-name (org-reveal-export-to-html async subtreep visible-only body-only ext-plist)))) + +(defun org-reveal-export-current-subtree + (&optional async subtreep visible-only body-only ext-plist) + "Export current subtree to a Reveal.js HTML file." + (interactive) + (org-narrow-to-subtree) + (let ((ret (org-reveal-export-to-html async subtreep visible-only body-only (plist-put ext-plist :reveal-subtree t)))) + (widen) + ret)) + +;;;###autoload +(defun org-reveal-publish-to-reveal + (plist filename pub-dir) + "Publish an org file to Html. + +FILENAME is the filename of the Org file to be published. PLIST +is the property list for the given project. PUB-DIR is the +publishing directory. + +Return output file name." + (org-publish-org-to 'reveal filename ".html" plist pub-dir)) + +;; Register auto-completion for speaker notes. +(when org-reveal-note-key-char + (add-to-list 'org-structure-template-alist + (list org-reveal-note-key-char "#+BEGIN_NOTES\n\?\n#+END_NOTES"))) + +(provide 'ox-reveal) + +;;; ox-reveal.el ends here diff --git a/elpa/ox-reveal-20161027.926/ox-reveal.elc b/elpa/ox-reveal-20161027.926/ox-reveal.elc new file mode 100644 index 0000000..4846154 Binary files /dev/null and b/elpa/ox-reveal-20161027.926/ox-reveal.elc differ diff --git a/elpa/page-break-lines-20171210.831/page-break-lines-autoloads.el b/elpa/page-break-lines-20171210.831/page-break-lines-autoloads.el new file mode 100644 index 0000000..972f348 --- /dev/null +++ b/elpa/page-break-lines-20171210.831/page-break-lines-autoloads.el @@ -0,0 +1,77 @@ +;;; page-break-lines-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "page-break-lines" "page-break-lines.el" (23391 +;;;;;; 65295 0 0)) +;;; Generated autoloads from page-break-lines.el + +(defvar page-break-lines-char 9472 "\ +Character used to render page break lines.") + +(custom-autoload 'page-break-lines-char "page-break-lines" t) + +(defvar page-break-lines-lighter " PgLn" "\ +Mode-line indicator for `page-break-lines-mode'.") + +(custom-autoload 'page-break-lines-lighter "page-break-lines" t) + +(defvar page-break-lines-modes '(emacs-lisp-mode lisp-mode scheme-mode compilation-mode outline-mode help-mode) "\ +Modes in which to enable `page-break-lines-mode'.") + +(custom-autoload 'page-break-lines-modes "page-break-lines" t) + +(defface page-break-lines '((t :inherit font-lock-comment-face :bold nil :italic nil)) "\ +Face used to colorize page break lines. +If using :bold or :italic, please ensure `page-break-lines-char' +is available in that variant of your font, otherwise it may be +displayed as a junk character." :group (quote page-break-lines)) + +(autoload 'page-break-lines-mode "page-break-lines" "\ +Toggle Page Break Lines mode. + +In Page Break mode, page breaks (^L characters) are displayed as a +horizontal line of `page-break-string-char' characters. + +\(fn &optional ARG)" t nil) + +(define-obsolete-function-alias 'turn-on-page-break-lines-mode 'page-break-lines-mode) + +(autoload 'page-break-lines-mode-maybe "page-break-lines" "\ +Enable `page-break-lines-mode' in the current buffer if desired. +When `major-mode' is listed in `page-break-lines-modes', then +`page-break-lines-mode' will be enabled. + +\(fn)" nil nil) + +(defvar global-page-break-lines-mode nil "\ +Non-nil if Global Page-Break-Lines mode is enabled. +See the `global-page-break-lines-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `global-page-break-lines-mode'.") + +(custom-autoload 'global-page-break-lines-mode "page-break-lines" nil) + +(autoload 'global-page-break-lines-mode "page-break-lines" "\ +Toggle Page-Break-Lines mode in all buffers. +With prefix ARG, enable Global Page-Break-Lines mode if ARG is positive; +otherwise, disable it. If called from Lisp, enable the mode if +ARG is omitted or nil. + +Page-Break-Lines mode is enabled in all buffers where +`page-break-lines-mode-maybe' would do it. +See `page-break-lines-mode' for more information on Page-Break-Lines mode. + +\(fn &optional ARG)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; page-break-lines-autoloads.el ends here diff --git a/elpa/page-break-lines-20171210.831/page-break-lines-pkg.el b/elpa/page-break-lines-20171210.831/page-break-lines-pkg.el new file mode 100644 index 0000000..2a9bbd3 --- /dev/null +++ b/elpa/page-break-lines-20171210.831/page-break-lines-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "page-break-lines" "20171210.831" "Display ^L page breaks as tidy horizontal lines" '((emacs "24.4")) :commit "fd3b7e38ad8747cd009ead7ef1bb150849ccc693" :keywords '("convenience" "faces") :authors '(("Steve Purcell" . "steve@sanityinc.com")) :maintainer '("Steve Purcell" . "steve@sanityinc.com") :url "https://github.com/purcell/page-break-lines") diff --git a/elpa/page-break-lines-20171210.831/page-break-lines.el b/elpa/page-break-lines-20171210.831/page-break-lines.el new file mode 100644 index 0000000..b78d6f3 --- /dev/null +++ b/elpa/page-break-lines-20171210.831/page-break-lines.el @@ -0,0 +1,175 @@ +;;; page-break-lines.el --- Display ^L page breaks as tidy horizontal lines + +;; Copyright (C) 2012-2015 Steve Purcell + +;; Author: Steve Purcell +;; URL: https://github.com/purcell/page-break-lines +;; Package-Version: 20171210.831 +;; Package-X-Original-Version: 0 +;; Package-Requires: ((emacs "24.4")) +;; Keywords: convenience, faces + +;; 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 . + +;;; Commentary: + +;; This library provides a global mode which displays form feed +;; characters as horizontal rules. + +;; Install from Melpa or Marmalade, or add to `load-path' and use +;; (require 'page-break-lines). + +;; Use `page-break-lines-mode' to enable the mode in specific buffers, +;; or customize `page-break-lines-modes' and enable the mode globally with +;; `global-page-break-lines-mode'. + +;; Issues and limitations: + +;; If `page-break-lines-char' is displayed at a different width to +;; regular characters, the rule may be either too short or too long: +;; rules may then wrap if `truncate-lines' is nil. On some systems, +;; Emacs may erroneously choose a different font for the page break +;; symbol, which choice can be overridden using code such as: + +;; (set-fontset-font "fontset-default" +;; (cons page-break-lines-char page-break-lines-char) +;; (face-attribute 'default :family)) + +;; Use `describe-char' on a page break char to determine whether this +;; is the case. + +;; Additionally, the use of `text-scale-increase' or +;; `text-scale-decrease' will cause the rule width to be incorrect, +;; because the reported window width (in characters) will continue to +;; be the width in the frame's default font, not the scaled font used to +;; display the rule. + +;; Adapted from code http://www.emacswiki.org/emacs/PageBreaks + +;;; Code: + +(defgroup page-break-lines nil + "Display ugly ^L page breaks as tidy horizontal lines." + :prefix "page-break-lines-" + :group 'faces) + +;;;###autoload +(defcustom page-break-lines-char ?─ + "Character used to render page break lines." + :type 'character + :group 'page-break-lines) + +;;;###autoload +(defcustom page-break-lines-lighter " PgLn" + "Mode-line indicator for `page-break-lines-mode'." + :type '(choice (const :tag "No lighter" "") string) + :group 'page-break-lines) + +;;;###autoload +(defcustom page-break-lines-modes + '(emacs-lisp-mode lisp-mode scheme-mode compilation-mode outline-mode help-mode) + "Modes in which to enable `page-break-lines-mode'." + :type '(repeat symbol) + :group 'page-break-lines) + +;;;###autoload +(defface page-break-lines + '((t :inherit font-lock-comment-face :bold nil :italic nil)) + "Face used to colorize page break lines. +If using :bold or :italic, please ensure `page-break-lines-char' +is available in that variant of your font, otherwise it may be +displayed as a junk character." + :group 'page-break-lines) + + + +;;;###autoload +(define-minor-mode page-break-lines-mode + "Toggle Page Break Lines mode. + +In Page Break mode, page breaks (^L characters) are displayed as a +horizontal line of `page-break-string-char' characters." + :lighter page-break-lines-lighter + :group 'page-break-lines + (page-break-lines--update-display-tables)) + +;;;###autoload +(define-obsolete-function-alias 'turn-on-page-break-lines-mode 'page-break-lines-mode) + +(dolist (hook '(window-configuration-change-hook + window-size-change-functions + after-setting-font-hook + display-line-numbers-mode-hook)) + (add-hook hook 'page-break-lines--update-display-tables)) + + + +(defun page-break-lines--update-display-table (window) + "Modify a display-table that displays page-breaks prettily. +If the buffer inside WINDOW has `page-break-lines-mode' enabled, +its display table will be modified as necessary." + (with-current-buffer (window-buffer window) + (with-selected-window window + (if page-break-lines-mode + (progn + (unless buffer-display-table + (setq buffer-display-table (make-display-table))) + (let ((default-height (face-attribute 'default :height nil 'default))) + (set-face-attribute 'page-break-lines nil :height default-height) + (let* ((cwidth (char-width page-break-lines-char)) + (wwidth-pix (- (window-width nil t) + (if (bound-and-true-p display-line-numbers) + (line-number-display-width t) + 0))) + (width (- (/ wwidth-pix (frame-char-width) cwidth) + (if (display-graphic-p) 0 1))) + (glyph (make-glyph-code page-break-lines-char 'page-break-lines)) + (new-display-entry (vconcat (make-list width glyph)))) + (unless (equal new-display-entry (elt buffer-display-table ?\^L)) + (aset buffer-display-table ?\^L new-display-entry))))) + (when (and (member major-mode page-break-lines-modes) + buffer-display-table) + (aset buffer-display-table ?\^L nil)))))) + +(defun page-break-lines--update-display-tables (&optional frame) + "Function called for updating display table in windows of FRAME." + (unless (minibufferp) + (mapc 'page-break-lines--update-display-table (window-list frame 'no-minibuffer)))) + + + +;;;###autoload +(defun page-break-lines-mode-maybe () + "Enable `page-break-lines-mode' in the current buffer if desired. +When `major-mode' is listed in `page-break-lines-modes', then +`page-break-lines-mode' will be enabled." + (if (and (not (minibufferp)) + (apply 'derived-mode-p page-break-lines-modes)) + (page-break-lines-mode 1))) + +;;;###autoload +(define-global-minor-mode global-page-break-lines-mode + page-break-lines-mode page-break-lines-mode-maybe + :require 'page-break-lines + :group 'page-break-lines) + + +(provide 'page-break-lines) + +;; Local Variables: +;; coding: utf-8 +;; checkdoc-minor-mode: t +;; End: + +;;; page-break-lines.el ends here diff --git a/elpa/page-break-lines-20171210.831/page-break-lines.elc b/elpa/page-break-lines-20171210.831/page-break-lines.elc new file mode 100644 index 0000000..5f6ee19 Binary files /dev/null and b/elpa/page-break-lines-20171210.831/page-break-lines.elc differ diff --git a/elpa/paredit-20171127.205/paredit-autoloads.el b/elpa/paredit-20171127.205/paredit-autoloads.el new file mode 100644 index 0000000..b7fe527 --- /dev/null +++ b/elpa/paredit-20171127.205/paredit-autoloads.el @@ -0,0 +1,32 @@ +;;; paredit-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "paredit" "paredit.el" (23391 65294 0 0)) +;;; Generated autoloads from paredit.el + +(autoload 'paredit-mode "paredit" "\ +Minor mode for pseudo-structurally editing Lisp code. +With a prefix argument, enable Paredit Mode even if there are + unbalanced parentheses in the buffer. +Paredit behaves badly if parentheses are unbalanced, so exercise + caution when forcing Paredit Mode to be enabled, and consider + fixing unbalanced parentheses instead. +\\ + +\(fn &optional ARG)" t nil) + +(autoload 'enable-paredit-mode "paredit" "\ +Turn on pseudo-structural editing of Lisp code. + +\(fn)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; paredit-autoloads.el ends here diff --git a/elpa/paredit-20171127.205/paredit-pkg.el b/elpa/paredit-20171127.205/paredit-pkg.el new file mode 100644 index 0000000..2720002 --- /dev/null +++ b/elpa/paredit-20171127.205/paredit-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "paredit" "20171127.205" "minor mode for editing parentheses" 'nil :commit "acbe10fdd85d2e91831adf70b6a828bc7e900da0" :keywords '("lisp") :authors '(("Taylor R. Campbell" . "campbell+paredit@mumble.net")) :maintainer '("Taylor R. Campbell" . "campbell+paredit@mumble.net")) diff --git a/elpa/paredit-20171127.205/paredit.el b/elpa/paredit-20171127.205/paredit.el new file mode 100644 index 0000000..b806866 --- /dev/null +++ b/elpa/paredit-20171127.205/paredit.el @@ -0,0 +1,2929 @@ +;;; paredit.el --- minor mode for editing parentheses -*- Mode: Emacs-Lisp -*- + +;; Copyright (C) 2005--2017 Taylor R. Campbell + +;; Author: Taylor R. Campbell +;; Version: 25beta +;; Package-Version: 20171127.205 +;; Created: 2005-07-31 +;; Keywords: lisp + +;; NOTE: THIS IS A BETA VERSION OF PAREDIT. USE AT YOUR OWN RISK. +;; THIS FILE IS SUBJECT TO CHANGE, AND NOT SUITABLE FOR DISTRIBUTION +;; BY PACKAGE MANAGERS SUCH AS APT, PKGSRC, MACPORTS, &C. + +;; Paredit 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. +;; +;; Paredit 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 paredit. If not, see . + +;;; The currently released version of paredit is available at +;;; . +;;; +;;; The latest beta version of paredit is available at +;;; . +;;; +;;; The Git repository for paredit is available at +;;; +;;; +;;; Release notes are available at +;;; . + +;;; Install paredit by placing `paredit.el' in `/path/to/elisp', a +;;; directory of your choice, and adding to your .emacs file: +;;; +;;; (add-to-list 'load-path "/path/to/elisp") +;;; (autoload 'enable-paredit-mode "paredit" +;;; "Turn on pseudo-structural editing of Lisp code." +;;; t) +;;; +;;; Start Paredit Mode on the fly with `M-x enable-paredit-mode RET', +;;; or always enable it in a major mode `M' (e.g., `lisp') with: +;;; +;;; (add-hook 'M-mode-hook 'enable-paredit-mode) +;;; +;;; Customize paredit using `eval-after-load': +;;; +;;; (eval-after-load 'paredit +;;; '(progn +;;; (define-key paredit-mode-map (kbd "ESC M-A-C-s-)") +;;; 'paredit-dwim))) +;;; +;;; Send questions, bug reports, comments, feature suggestions, &c., +;;; via email to the author's surname at mumble.net. +;;; +;;; Paredit should run in GNU Emacs 21 or later and XEmacs 21.5.28 or +;;; later. + +;;; The paredit minor mode, Paredit Mode, binds common character keys, +;;; such as `(', `)', `"', and `\', to commands that carefully insert +;;; S-expression structures in the buffer: +;;; +;;; ( inserts `()', leaving the point in the middle; +;;; ) moves the point over the next closing delimiter; +;;; " inserts `""' if outside a string, or inserts an escaped +;;; double-quote if in the middle of a string, or moves over the +;;; closing double-quote if at the end of a string; and +;;; \ prompts for the character to escape, to avoid inserting lone +;;; backslashes that may break structure. +;;; +;;; In comments, these keys insert themselves. If necessary, you can +;;; insert these characters literally outside comments by pressing +;;; `C-q' before these keys, in case a mistake has broken the +;;; structure. +;;; +;;; These key bindings are designed so that when typing new code in +;;; Paredit Mode, you can generally type exactly the same sequence of +;;; keys you would have typed without Paredit Mode. +;;; +;;; Paredit Mode also binds common editing keys, such as `DEL', `C-d', +;;; and `C-k', to commands that respect S-expression structures in the +;;; buffer: +;;; +;;; DEL deletes the previous character, unless it is a delimiter: DEL +;;; will move the point backward over a closing delimiter, and +;;; will delete a delimiter pair together if between an open and +;;; closing delimiter; +;;; +;;; C-d deletes the next character in much the same manner; and +;;; +;;; C-k kills all S-expressions that begin anywhere between the point +;;; and the end of the line or the closing delimiter of the +;;; enclosing list, whichever is first. +;;; +;;; If necessary, you can delete a character, kill a line, &c., +;;; irrespective of S-expression structure, by pressing `C-u' before +;;; these keys, in case a mistake has broken the structure. +;;; +;;; Finally, Paredit Mode binds some keys to complex S-expression +;;; editing operations. For example, `C-' makes the enclosing +;;; list slurp up an S-expression to its right (here `|' denotes the +;;; point): +;;; +;;; (foo (bar | baz) quux) C- (foo (bar | baz quux)) +;;; +;;; Some paredit commands automatically reindent code. When they do, +;;; they try to indent as locally as possible, to avoid interfering +;;; with any indentation you might have manually written. Only the +;;; advanced S-expression manipulation commands automatically reindent, +;;; and only the forms that they immediately operated upon (and their +;;; subforms). +;;; +;;; This code is written for clarity, not efficiency. It frequently +;;; walks over S-expressions redundantly. If you have problems with +;;; the time it takes to execute some of the commands, let me know. + +;;; This assumes Unix-style LF line endings. + +(defconst paredit-version 25) +(defconst paredit-beta-p t) + +(eval-and-compile + + (defun paredit-xemacs-p () + ;; No idea where I got this definition from. Edward O'Connor + ;; (hober in #emacs) suggested the current definition. + ;; (and (boundp 'running-xemacs) + ;; running-xemacs) + (featurep 'xemacs)) + + (defun paredit-gnu-emacs-p () + ;++ This could probably be improved. + (not (paredit-xemacs-p))) + + (defmacro xcond (&rest clauses) + "Exhaustive COND. +Signal an error if no clause matches." + `(cond ,@clauses + (t (error "XCOND lost.")))) + + (defalias 'paredit-warn (if (fboundp 'warn) 'warn 'message)) + + (defvar paredit-sexp-error-type + (with-temp-buffer + (insert "(") + (condition-case condition + (backward-sexp) + (error (if (eq (car condition) 'error) + (paredit-warn "%s%s%s%s%s" + "Paredit is unable to discriminate" + " S-expression parse errors from" + " other errors. " + " This may cause obscure problems. " + " Please upgrade Emacs.")) + (car condition))))) + + (defmacro paredit-handle-sexp-errors (body &rest handler) + `(condition-case () + ,body + (,paredit-sexp-error-type ,@handler))) + + (put 'paredit-handle-sexp-errors 'lisp-indent-function 1) + + (defmacro paredit-ignore-sexp-errors (&rest body) + `(paredit-handle-sexp-errors (progn ,@body) + nil)) + + (put 'paredit-ignore-sexp-errors 'lisp-indent-function 0) + + (defmacro paredit-preserving-column (&rest body) + "Evaluate BODY and restore point to former column, relative to code. +Assumes BODY will change only indentation. +If point was on code, it moves with the code. +If point was on indentation, it stays in indentation." + (let ((column (make-symbol "column")) + (indentation (make-symbol "indentation"))) + `(let ((,column (current-column)) + (,indentation (paredit-current-indentation))) + (let ((value (progn ,@body))) + (paredit-restore-column ,column ,indentation) + value)))) + + (put 'paredit-preserving-column 'lisp-indent-function 0) + + nil) + +;;;; Minor Mode Definition + +(defvar paredit-lighter " Paredit" + "Mode line lighter Paredit Mode.") + +(defvar paredit-mode-map (make-sparse-keymap) + "Keymap for the paredit minor mode.") + +(defvar paredit-override-check-parens-function + (lambda (condition) condition nil) + "Function to tell whether unbalanced text should inhibit Paredit Mode.") + +;;;###autoload +(define-minor-mode paredit-mode + "Minor mode for pseudo-structurally editing Lisp code. +With a prefix argument, enable Paredit Mode even if there are + unbalanced parentheses in the buffer. +Paredit behaves badly if parentheses are unbalanced, so exercise + caution when forcing Paredit Mode to be enabled, and consider + fixing unbalanced parentheses instead. +\\" + :lighter paredit-lighter + ;; Setting `paredit-mode' to false here aborts enabling Paredit Mode. + (if (and paredit-mode + (not current-prefix-arg)) + (condition-case condition + (check-parens) + (error + (if (not (funcall paredit-override-check-parens-function condition)) + (progn (setq paredit-mode nil) + (signal (car condition) (cdr condition)))))))) + +(defun paredit-override-check-parens-interactively (condition) + (y-or-n-p (format "Enable Paredit Mode despite condition %S? " condition))) + +;;;###autoload +(defun enable-paredit-mode () + "Turn on pseudo-structural editing of Lisp code." + (interactive) + (paredit-mode +1)) + +(defun disable-paredit-mode () + "Turn off pseudo-structural editing of Lisp code." + (interactive) + (paredit-mode -1)) + +(defvar paredit-backward-delete-key + (xcond ((paredit-xemacs-p) "BS") + ((paredit-gnu-emacs-p) "DEL"))) + +(defvar paredit-forward-delete-keys + (xcond ((paredit-xemacs-p) '("DEL")) + ((paredit-gnu-emacs-p) '("" "")))) + +;;;; Paredit Keys + +;;; Separating the definition and initialization of this variable +;;; simplifies the development of paredit, since re-evaluating DEFVAR +;;; forms doesn't actually do anything. + +(defvar paredit-commands nil + "List of paredit commands with their keys and examples.") + +;;; Each specifier is of the form: +;;; (key[s] function (example-input example-output) ...) +;;; where key[s] is either a single string suitable for passing to KBD +;;; or a list of such strings. Entries in this list may also just be +;;; strings, in which case they are headings for the next entries. + +(progn (setq paredit-commands + `( + "Basic Insertion Commands" + ("(" paredit-open-round + ("(a b |c d)" + "(a b (|) c d)") + ("(foo \"bar |baz\" quux)" + "(foo \"bar (|baz\" quux)")) + (")" paredit-close-round + ("(a b |c )" "(a b c)|") + ("; Hello,| world!" + "; Hello,)| world!")) + ("M-)" paredit-close-round-and-newline + ("(defun f (x| ))" + "(defun f (x)\n |)") + ("; (Foo.|" + "; (Foo.)|")) + ("[" paredit-open-square + ("(a b |c d)" + "(a b [|] c d)") + ("(foo \"bar |baz\" quux)" + "(foo \"bar [|baz\" quux)")) + ("]" paredit-close-square + ("(define-key keymap [frob| ] 'frobnicate)" + "(define-key keymap [frob]| 'frobnicate)") + ("; [Bar.|" + "; [Bar.]|")) + + ("\"" paredit-doublequote + ("(frob grovel |full lexical)" + "(frob grovel \"|\" full lexical)" + "(frob grovel \"\"| full lexical)") + ("(foo \"bar |baz\" quux)" + "(foo \"bar \\\"|baz\" quux)") + ("(frob grovel) ; full |lexical" + "(frob grovel) ; full \"|lexical")) + ("M-\"" paredit-meta-doublequote + ("(foo \"bar |baz\" quux)" + "(foo \"bar baz\"| quux)") + ("(foo |(bar #\\x \"baz \\\\ quux\") zot)" + ,(concat "(foo \"|(bar #\\\\x \\\"baz \\\\" + "\\\\ quux\\\")\" zot)"))) + ("\\" paredit-backslash + ("(string #|)\n ; Character to escape: x" + "(string #\\x|)") + ("\"foo|bar\"\n ; Character to escape: \"" + "\"foo\\\"|bar\"")) + (";" paredit-semicolon + ("|(frob grovel)" + ";|(frob grovel)") + ("(frob |grovel)" + "(frob ;|grovel\n )") + ("(frob |grovel (bloit\n zargh))" + "(frob ;|grovel\n (bloit\n zargh))") + ("(frob grovel) |" + "(frob grovel) ;|")) + ("M-;" paredit-comment-dwim + ("(foo |bar) ; baz" + "(foo bar) ; |baz") + ("(frob grovel)|" + "(frob grovel) ;|") + ("(zot (foo bar)\n|\n (baz quux))" + "(zot (foo bar)\n ;; |\n (baz quux))") + ("(zot (foo bar) |(baz quux))" + "(zot (foo bar)\n ;; |\n (baz quux))") + ("|(defun hello-world ...)" + ";;; |\n(defun hello-world ...)")) + + ("C-j" paredit-newline + ("(let ((n (frobbotz))) |(display (+ n 1)\nport))" + ,(concat "(let ((n (frobbotz)))" + "\n |(display (+ n 1)" + "\n port))"))) + + "Deleting & Killing" + (("C-d" ,@paredit-forward-delete-keys) + paredit-forward-delete + ("(quu|x \"zot\")" "(quu| \"zot\")") + ("(quux |\"zot\")" + "(quux \"|zot\")" + "(quux \"|ot\")") + ("(foo (|) bar)" "(foo | bar)") + ("|(foo bar)" "(|foo bar)")) + (,paredit-backward-delete-key + paredit-backward-delete + ("(\"zot\" q|uux)" "(\"zot\" |uux)") + ("(\"zot\"| quux)" + "(\"zot|\" quux)" + "(\"zo|\" quux)") + ("(foo (|) bar)" "(foo | bar)") + ("(foo bar)|" "(foo bar|)")) + ("C-k" paredit-kill + ("(foo bar)| ; Useless comment!" + "(foo bar)|") + ("(|foo bar) ; Useful comment!" + "(|) ; Useful comment!") + ("|(foo bar) ; Useless line!" + "|") + ("(foo \"|bar baz\"\n quux)" + "(foo \"|\"\n quux)")) + ("M-d" paredit-forward-kill-word + ("|(foo bar) ; baz" + "(| bar) ; baz" + "(|) ; baz" + "() ;|") + (";;;| Frobnicate\n(defun frobnicate ...)" + ";;;|\n(defun frobnicate ...)" + ";;;\n(| frobnicate ...)")) + (,(concat "M-" paredit-backward-delete-key) + paredit-backward-kill-word + ("(foo bar) ; baz\n(quux)|" + "(foo bar) ; baz\n(|)" + "(foo bar) ; |\n()" + "(foo |) ; \n()" + "(|) ; \n()")) + + "Movement & Navigation" + ("C-M-f" paredit-forward + ("(foo |(bar baz) quux)" + "(foo (bar baz)| quux)") + ("(foo (bar)|)" + "(foo (bar))|")) + ("C-M-b" paredit-backward + ("(foo (bar baz)| quux)" + "(foo |(bar baz) quux)") + ("(|(foo) bar)" + "|((foo) bar)")) + ("C-M-u" paredit-backward-up) + ("C-M-d" paredit-forward-down) + ("C-M-p" paredit-backward-down) ; Built-in, these are FORWARD- + ("C-M-n" paredit-forward-up) ; & BACKWARD-LIST, which have + ; no need given C-M-f & C-M-b. + + "Depth-Changing Commands" + ("M-(" paredit-wrap-round + ("(foo |bar baz)" + "(foo (|bar) baz)")) + ("M-s" paredit-splice-sexp + ("(foo (bar| baz) quux)" + "(foo bar| baz quux)")) + (("M-" "ESC ") + paredit-splice-sexp-killing-backward + ("(foo (let ((x 5)) |(sqrt n)) bar)" + "(foo |(sqrt n) bar)")) + (("M-" "ESC ") + paredit-splice-sexp-killing-forward + ("(a (b c| d e) f)" + "(a b c| f)")) + ("M-r" paredit-raise-sexp + ("(dynamic-wind in (lambda () |body) out)" + "(dynamic-wind in |body out)" + "|body")) + ("M-?" paredit-convolute-sexp + ("(let ((x 5) (y 3)) (frob |(zwonk)) (wibblethwop))" + "(frob |(let ((x 5) (y 3)) (zwonk) (wibblethwop)))")) + + "Barfage & Slurpage" + (("C-)" "C-") + paredit-forward-slurp-sexp + ("(foo (bar |baz) quux zot)" + "(foo (bar |baz quux) zot)") + ("(a b ((c| d)) e f)" + "(a b ((c| d) e) f)")) + (("C-}" "C-") + paredit-forward-barf-sexp + ("(foo (bar |baz quux) zot)" + "(foo (bar |baz) quux zot)")) + (("C-(" "C-M-" "ESC C-") + paredit-backward-slurp-sexp + ("(foo bar (baz| quux) zot)" + "(foo (bar baz| quux) zot)") + ("(a b ((c| d)) e f)" + "(a (b (c| d)) e f)")) + (("C-{" "C-M-" "ESC C-") + paredit-backward-barf-sexp + ("(foo (bar baz |quux) zot)" + "(foo bar (baz |quux) zot)")) + + "Miscellaneous Commands" + ("M-S" paredit-split-sexp + ("(hello| world)" + "(hello)| (world)") + ("\"Hello, |world!\"" + "\"Hello, \"| \"world!\"")) + ("M-J" paredit-join-sexps + ("(hello)| (world)" + "(hello| world)") + ("\"Hello, \"| \"world!\"" + "\"Hello, |world!\"") + ("hello-\n| world" + "hello-|world")) + ("C-c C-M-l" paredit-recenter-on-sexp) + ("M-q" paredit-reindent-defun) + )) + nil) ; end of PROGN + +;;;;; Command Examples + +(eval-and-compile + (defmacro paredit-do-commands (vars string-case &rest body) + (let ((spec (nth 0 vars)) + (keys (nth 1 vars)) + (fn (nth 2 vars)) + (examples (nth 3 vars))) + `(dolist (,spec paredit-commands) + (if (stringp ,spec) + ,string-case + (let ((,keys (let ((k (car ,spec))) + (cond ((stringp k) (list k)) + ((listp k) k) + (t (error "Invalid paredit command %s." + ,spec))))) + (,fn (cadr ,spec)) + (,examples (cddr ,spec))) + ,@body))))) + + (put 'paredit-do-commands 'lisp-indent-function 2)) + +(defun paredit-define-keys () + (paredit-do-commands (spec keys fn examples) + nil ; string case + (dolist (key keys) + (define-key paredit-mode-map (read-kbd-macro key) fn)))) + +(defun paredit-function-documentation (fn) + (let ((original-doc (get fn 'paredit-original-documentation)) + (doc (documentation fn 'function-documentation))) + (or original-doc + (progn (put fn 'paredit-original-documentation doc) + doc)))) + +(defun paredit-annotate-mode-with-examples () + (let ((contents + (list (paredit-function-documentation 'paredit-mode)))) + (paredit-do-commands (spec keys fn examples) + (push (concat "\n \n" spec "\n") + contents) + (let ((name (symbol-name fn))) + (if (string-match (symbol-name 'paredit-) name) + (push (concat "\n\n\\[" name "]\t" name + (if examples + (mapconcat (lambda (example) + (concat + "\n" + (mapconcat 'identity + example + "\n --->\n") + "\n")) + examples + "") + "\n (no examples)\n")) + contents)))) + (put 'paredit-mode 'function-documentation + (apply 'concat (reverse contents)))) + ;; PUT returns the huge string we just constructed, which we don't + ;; want it to return. + nil) + +(defun paredit-annotate-functions-with-examples () + (paredit-do-commands (spec keys fn examples) + nil ; string case + (put fn 'function-documentation + (concat (paredit-function-documentation fn) + "\n\n\\\\[" (symbol-name fn) "]\n" + (mapconcat (lambda (example) + (concat "\n" + (mapconcat 'identity + example + "\n ->\n") + "\n")) + examples + ""))))) + +;;;;; HTML Examples + +(defun paredit-insert-html-examples () + "Insert HTML for a paredit quick reference table." + (interactive) + (let ((insert-lines + (lambda (&rest lines) (dolist (line lines) (insert line) (newline)))) + (initp nil)) + (paredit-do-commands (spec keys fn examples) + (progn (if initp + (funcall insert-lines "") + (setq initp t)) + (funcall insert-lines (concat "

" spec "

")) + (funcall insert-lines "")) + (let ((name (symbol-name fn)) + (keys + (mapconcat (lambda (key) + (concat "" (paredit-html-quote key) "")) + keys + ", "))) + (funcall insert-lines "") + (funcall insert-lines (concat " ")) + (funcall insert-lines (concat " ")) + (funcall insert-lines "") + (funcall insert-lines + ""))) + (funcall insert-lines "
" keys "" name "
") + (dolist (example examples) + (let ((prefix "")) + (funcall insert-lines (concat prefix examples suffix)))) + (funcall insert-lines "
" + "" + "
")
+                (examples
+                 (mapconcat 'paredit-html-quote
+                            example
+                            (concat "
")))
+                (suffix "
"))) + +(defun paredit-html-quote (string) + (with-temp-buffer + (dotimes (i (length string)) + (insert (let ((c (elt string i))) + (cond ((eq c ?\<) "<") + ((eq c ?\>) ">") + ((eq c ?\&) "&") + ((eq c ?\') "'") + ((eq c ?\") """) + (t c))))) + (buffer-string))) + +;;;; Delimiter Insertion + +(eval-and-compile + (defun paredit-conc-name (&rest strings) + (intern (apply 'concat strings))) + + (defmacro define-paredit-pair (open close name) + `(progn + (defun ,(paredit-conc-name "paredit-open-" name) (&optional n) + ,(concat "Insert a balanced " name " pair. +With a prefix argument N, put the closing " name " after N + S-expressions forward. +If the region is active, `transient-mark-mode' is enabled, and the + region's start and end fall in the same parenthesis depth, insert a + " name " pair around the region. +If in a string or a comment, insert a single " name ". +If in a character literal, do nothing. This prevents changing what was + in the character literal to a meaningful delimiter unintentionally.") + (interactive "P") + (cond ((or (paredit-in-string-p) + (paredit-in-comment-p)) + (insert ,open)) + ((not (paredit-in-char-p)) + (paredit-insert-pair n ,open ,close 'goto-char) + (save-excursion (backward-up-list) (indent-sexp))))) + (defun ,(paredit-conc-name "paredit-close-" name) () + ,(concat "Move past one closing delimiter and reindent. +\(Agnostic to the specific closing delimiter.) +If in a string or comment, insert a single closing " name ". +If in a character literal, do nothing. This prevents changing what was + in the character literal to a meaningful delimiter unintentionally.") + (interactive) + (paredit-move-past-close ,close)) + (defun ,(paredit-conc-name "paredit-close-" name "-and-newline") () + ,(concat "Move past one closing delimiter, add a newline," + " and reindent. +If there was a margin comment after the closing delimiter, preserve it + on the same line.") + (interactive) + (paredit-move-past-close-and-newline ,close)) + (defun ,(paredit-conc-name "paredit-wrap-" name) + (&optional argument) + ,(concat "Wrap the following S-expression. +See `paredit-wrap-sexp' for more details.") + (interactive "P") + (paredit-wrap-sexp argument ,open ,close)) + (add-to-list 'paredit-wrap-commands + ',(paredit-conc-name "paredit-wrap-" name))))) + +(defvar paredit-wrap-commands '(paredit-wrap-sexp) + "List of paredit commands that wrap S-expressions. +Used by `paredit-yank-pop'; for internal paredit use only.") + +(define-paredit-pair ?\( ?\) "round") +(define-paredit-pair ?\[ ?\] "square") +(define-paredit-pair ?\{ ?\} "curly") +(define-paredit-pair ?\< ?\> "angled") + +;;; Aliases for the old names. + +(defalias 'paredit-open-parenthesis 'paredit-open-round) +(defalias 'paredit-close-parenthesis 'paredit-close-round) +(defalias 'paredit-close-parenthesis-and-newline + 'paredit-close-round-and-newline) + +(defalias 'paredit-open-bracket 'paredit-open-square) +(defalias 'paredit-close-bracket 'paredit-close-square) +(defalias 'paredit-close-bracket-and-newline + 'paredit-close-square-and-newline) + +(defun paredit-move-past-close (close) + (paredit-move-past-close-and close + (lambda () + (paredit-blink-paren-match nil)))) + +(defun paredit-move-past-close-and-newline (close) + (paredit-move-past-close-and close + (lambda () + (let ((comment.point (paredit-find-comment-on-line))) + (newline) + (if comment.point + (save-excursion + (forward-line -1) + (end-of-line) + (indent-to (cdr comment.point)) + (insert (car comment.point))))) + (lisp-indent-line) + (paredit-ignore-sexp-errors (indent-sexp)) + (paredit-blink-paren-match t)))) + +(defun paredit-move-past-close-and (close if-moved) + (if (or (paredit-in-string-p) + (paredit-in-comment-p)) + (insert close) + (if (paredit-in-char-p) (forward-char)) + (paredit-move-past-close-and-reindent close) + (funcall if-moved))) + +(defun paredit-find-comment-on-line () + "Find a margin comment on the current line. +Return nil if there is no such comment or if there is anything but + whitespace until such a comment. +If such a comment exists, delete the comment (including all leading + whitespace) and return a cons whose car is the comment as a string + and whose cdr is the point of the comment's initial semicolon, + relative to the start of the line." + (save-excursion + (paredit-skip-whitespace t (point-at-eol)) + (and (eq ?\; (char-after)) + (not (eq ?\; (char-after (1+ (point))))) + (not (or (paredit-in-string-p) + (paredit-in-char-p))) + (let* ((start ;Move to before the semicolon. + (progn (backward-char) (point))) + (comment + (buffer-substring start (point-at-eol)))) + (paredit-skip-whitespace nil (point-at-bol)) + (delete-region (point) (point-at-eol)) + (cons comment (- start (point-at-bol))))))) + +(defun paredit-insert-pair (n open close forward) + (let* ((regionp + (and (paredit-region-active-p) + (paredit-region-safe-for-insert-p))) + (end + (and regionp + (not n) + (prog1 (region-end) (goto-char (region-beginning)))))) + (let ((spacep (paredit-space-for-delimiter-p nil open))) + (if spacep (insert " ")) + (insert open) + (save-excursion + ;; Move past the desired region. + (cond (n + (funcall forward + (paredit-scan-sexps-hack (point) + (prefix-numeric-value n)))) + (regionp + (funcall forward (+ end (if spacep 2 1))))) + ;; The string case can happen if we are inserting string + ;; delimiters. The comment case may happen by moving to the + ;; end of a buffer that has a comment with no trailing newline. + (if (and (not (paredit-in-string-p)) + (paredit-in-comment-p)) + (newline)) + (insert close) + (if (paredit-space-for-delimiter-p t close) + (insert " ")))))) + +;++ This needs a better name... + +(defun paredit-scan-sexps-hack (point n) + (save-excursion + (goto-char point) + (let ((direction (if (< 0 n) +1 -1)) + (magnitude (abs n)) + (count 0)) + (catch 'exit + (while (< count magnitude) + (let ((p + (paredit-handle-sexp-errors (scan-sexps (point) direction) + nil))) + (if (not p) (throw 'exit nil)) + (goto-char p)) + (setq count (+ count 1))))) + (point))) + +(defun paredit-region-safe-for-insert-p () + (save-excursion + (let ((beginning (region-beginning)) + (end (region-end))) + (goto-char beginning) + (let* ((beginning-state (paredit-current-parse-state)) + (end-state + (parse-partial-sexp beginning end nil nil beginning-state))) + (and (= (nth 0 beginning-state) ; 0. depth in parens + (nth 0 end-state)) + (eq (nth 3 beginning-state) ; 3. non-nil if inside a + (nth 3 end-state)) ; string + (eq (nth 4 beginning-state) ; 4. comment status, yada + (nth 4 end-state)) + (eq (nth 5 beginning-state) ; 5. t if following char + (nth 5 end-state))))))) ; quote + +(defvar paredit-space-for-delimiter-predicates nil + "List of predicates for whether to put space by delimiter at point. +Each predicate is a function that is is applied to two arguments, ENDP + and DELIMITER, and that returns a boolean saying whether to put a + space next to the delimiter -- before/after the delimiter if ENDP is + false/true, respectively. +If any predicate returns false, no space is inserted: every predicate + has veto power. +Each predicate may assume that the point is not at the beginning/end of + the buffer, and that the point is preceded/followed by a word + constituent, symbol constituent, string quote, or delimiter matching + DELIMITER, if ENDP is false/true, respectively. +Each predicate should examine only text before/after the point if ENDP is + false/true, respectively.") + +(defun paredit-space-for-delimiter-p (endp delimiter) + ;; If at the buffer limit, don't insert a space. If there is a word, + ;; symbol, other quote, or non-matching parenthesis delimiter (i.e. a + ;; close when want an open the string or an open when we want to + ;; close the string), do insert a space. + (and (not (if endp (eobp) (bobp))) + (memq (char-syntax (if endp (char-after) (char-before))) + (list ?w ?_ ?\" + (let ((matching (matching-paren delimiter))) + (and matching (char-syntax matching))) + (and (not endp) + (eq ?\" (char-syntax delimiter)) + ?\) ))) + (catch 'exit + (dolist (predicate paredit-space-for-delimiter-predicates) + (if (not (funcall predicate endp delimiter)) + (throw 'exit nil))) + t))) + +(defun paredit-move-past-close-and-reindent (close) + (let ((open (paredit-missing-close))) + (if open + (if (eq close (matching-paren open)) + (save-excursion + (message "Missing closing delimiter: %c" close) + (insert close)) + (error "Mismatched missing closing delimiter: %c ... %c" + open close)))) + (up-list) + (if (catch 'return ; This CATCH returns T if it + (while t ; should delete leading spaces + (save-excursion ; and NIL if not. + (let ((before-paren (1- (point)))) + (back-to-indentation) + (cond ((not (eq (point) before-paren)) + ;; Can't call PAREDIT-DELETE-LEADING-WHITESPACE + ;; here -- we must return from SAVE-EXCURSION + ;; first. + (throw 'return t)) + ((save-excursion (forward-line -1) + (end-of-line) + (paredit-in-comment-p)) + ;; Moving the closing delimiter any further + ;; would put it into a comment, so we just + ;; indent the closing delimiter where it is and + ;; abort the loop, telling its continuation that + ;; no leading whitespace should be deleted. + (lisp-indent-line) + (throw 'return nil)) + (t (delete-indentation))))))) + (paredit-delete-leading-whitespace))) + +(defun paredit-missing-close () + (save-excursion + (paredit-handle-sexp-errors (backward-up-list) + (error "Not inside a list.")) + (let ((open (char-after))) + (paredit-handle-sexp-errors (progn (forward-sexp) nil) + open)))) + +(defun paredit-delete-leading-whitespace () + ;; This assumes that we're on the closing delimiter already. + (save-excursion + (backward-char) + (while (let ((syn (char-syntax (char-before)))) + (and (or (eq syn ?\ ) (eq syn ?-)) ; whitespace syntax + ;; The above line is a perfect example of why the + ;; following test is necessary. + (not (paredit-in-char-p (1- (point)))))) + (delete-char -1)))) + +(defun paredit-blink-paren-match (another-line-p) + (if (and blink-matching-paren + (or (not show-paren-mode) another-line-p)) + (paredit-ignore-sexp-errors + (save-excursion + (backward-sexp) + (forward-sexp) + ;; SHOW-PAREN-MODE inhibits any blinking, so we disable it + ;; locally here. + (let ((show-paren-mode nil)) + (blink-matching-open)))))) + +(defun paredit-doublequote (&optional n) + "Insert a pair of double-quotes. +With a prefix argument N, wrap the following N S-expressions in + double-quotes, escaping intermediate characters if necessary. +If the region is active, `transient-mark-mode' is enabled, and the + region's start and end fall in the same parenthesis depth, insert a + pair of double-quotes around the region, again escaping intermediate + characters if necessary. +Inside a comment, insert a literal double-quote. +At the end of a string, move past the closing double-quote. +In the middle of a string, insert a backslash-escaped double-quote. +If in a character literal, do nothing. This prevents accidentally + changing a what was in the character literal to become a meaningful + delimiter unintentionally." + (interactive "P") + (cond ((paredit-in-string-p) + (if (eq (point) (- (paredit-enclosing-string-end) 1)) + (forward-char) ; Just move past the closing quote. + ;; Don't split a \x into an escaped backslash and a string end. + (if (paredit-in-string-escape-p) (forward-char)) + (insert ?\\ ?\" ))) + ((paredit-in-comment-p) + (insert ?\" )) + ((not (paredit-in-char-p)) + (paredit-insert-pair n ?\" ?\" 'paredit-forward-for-quote)))) + +(defun paredit-meta-doublequote (&optional n) + "Move to the end of the string. +If not in a string, act as `paredit-doublequote'; if not prefix argument + is specified and the region is not active or `transient-mark-mode' is + disabled, the default is to wrap one S-expression, however, not zero." + (interactive "P") + (if (not (paredit-in-string-p)) + (paredit-doublequote (or n (and (not (paredit-region-active-p)) 1))) + (goto-char (paredit-enclosing-string-end)))) + +(defun paredit-meta-doublequote-and-newline (&optional n) + "Move to the end of the string, insert a newline, and indent. +If not in a string, act as `paredit-doublequote'; if not prefix argument + is specified and the region is not active or `transient-mark-mode' is + disabled, the default is to wrap one S-expression, however, not zero." + (interactive "P") + (if (not (paredit-in-string-p)) + (paredit-doublequote (or n (and (not (paredit-region-active-p)) 1))) + (progn (goto-char (paredit-enclosing-string-end)) + (newline) + (lisp-indent-line) + (paredit-ignore-sexp-errors (indent-sexp))))) + +(defun paredit-forward-for-quote (end) + (let ((state (paredit-current-parse-state))) + (while (< (point) end) + (let ((new-state (parse-partial-sexp (point) (1+ (point)) + nil nil state))) + (if (paredit-in-string-p new-state) + (if (not (paredit-in-string-escape-p)) + (setq state new-state) + ;; Escape character: turn it into an escaped escape + ;; character by appending another backslash. + (insert ?\\ ) + ;; Now the point is after both escapes, and we want to + ;; rescan from before the first one to after the second + ;; one. + (setq state + (parse-partial-sexp (- (point) 2) (point) + nil nil state)) + ;; Advance the end point, since we just inserted a new + ;; character. + (setq end (1+ end))) + ;; String: escape by inserting a backslash before the quote. + (backward-char) + (insert ?\\ ) + ;; The point is now between the escape and the quote, and we + ;; want to rescan from before the escape to after the quote. + (setq state + (parse-partial-sexp (1- (point)) (1+ (point)) + nil nil state)) + ;; Advance the end point for the same reason as above. + (setq end (1+ end))))))) + +;;;; Escape Insertion + +(defun paredit-backslash () + "Insert a backslash followed by a character to escape." + (interactive) + (cond ((paredit-in-string-p) (paredit-backslash-interactive)) + ((paredit-in-comment-p) (insert ?\\)) + ((paredit-in-char-p) (forward-char) (paredit-backslash-interactive)) + (t (paredit-backslash-interactive)))) + +(defun paredit-backslash-interactive () + (insert ?\\ ) + ;; Read a character to insert after the backslash. If anything + ;; goes wrong -- the user hits delete (entering the rubout + ;; `character'), aborts with C-g, or enters non-character input + ;; -- then delete the backslash to avoid a dangling escape. + (let ((delete-p t)) + (unwind-protect + (let ((char (read-char "Character to escape: " t))) + (if (not (eq char ?\^?)) + (progn (message "Character to escape: %c" char) + (insert char) + (setq delete-p nil)))) + (if delete-p + (progn (message "Deleting escape.") + (delete-char -1)))))) + +(defun paredit-newline () + "Insert a newline and indent it. +This is like `newline-and-indent', but it not only indents the line + that the point is on but also the S-expression following the point, + if there is one. +Move forward one character first if on an escaped character. +If in a string, just insert a literal newline. +If in a comment and if followed by invalid structure, call + `indent-new-comment-line' to keep the invalid structure in a + comment." + (interactive) + (cond ((paredit-in-string-p) + (newline)) + ((paredit-in-comment-p) + (if (paredit-region-ok-p (point) (point-at-eol)) + (progn (newline-and-indent) + (paredit-ignore-sexp-errors (indent-sexp))) + (indent-new-comment-line))) + (t + (if (paredit-in-char-p) + (forward-char)) + (newline-and-indent) + ;; Indent the following S-expression, but don't signal an + ;; error if there's only a closing delimiter after the point. + (paredit-ignore-sexp-errors (indent-sexp))))) + +(defun paredit-reindent-defun (&optional argument) + "Reindent the definition that the point is on. +If the point is in a string or a comment, fill the paragraph instead, + and with a prefix argument, justify as well." + (interactive "P") + (if (or (paredit-in-string-p) + (paredit-in-comment-p)) + (lisp-fill-paragraph argument) + (paredit-preserving-column + (save-excursion + (end-of-defun) + (beginning-of-defun) + (indent-sexp))))) + +;;;; Comment Insertion + +(defun paredit-semicolon (&optional n) + "Insert a semicolon. +With a prefix argument N, insert N semicolons. +If in a string, do just that and nothing else. +If in a character literal, move to the beginning of the character + literal before inserting the semicolon. +If the enclosing list ends on the line after the point, break the line + after the last S-expression following the point. +If a list begins on the line after the point but ends on a different + line, break the line after the last S-expression following the point + before the list." + (interactive "p") + (if (or (paredit-in-string-p) (paredit-in-comment-p)) + (insert (make-string (or n 1) ?\; )) + (if (paredit-in-char-p) + (backward-char 2)) + (let ((line-break-point (paredit-semicolon-find-line-break-point))) + (if line-break-point + (paredit-semicolon-with-line-break line-break-point (or n 1)) + (insert (make-string (or n 1) ?\; )))))) + +(defun paredit-semicolon-find-line-break-point () + (and (not (eolp)) ;Implies (not (eobp)). + (let ((eol (point-at-eol))) + (save-excursion + (catch 'exit + (while t + (let ((line-break-point (point))) + (cond ((paredit-handle-sexp-errors (progn (forward-sexp) t) + nil) + ;; Successfully advanced by an S-expression. + ;; If that S-expression started on this line + ;; and ended on another one, break here. + (cond ((not (eq eol (point-at-eol))) + (throw 'exit + (and (save-excursion + (backward-sexp) + (eq eol (point-at-eol))) + line-break-point))) + ((eobp) + (throw 'exit nil)))) + ((save-excursion + (paredit-skip-whitespace t (point-at-eol)) + (or (eolp) (eobp) (eq (char-after) ?\;))) + ;; Can't move further, but there's no closing + ;; delimiter we're about to clobber -- either + ;; it's on the next line or we're at the end of + ;; the buffer. Don't break the line. + (throw 'exit nil)) + (t + ;; Can't move because we hit a delimiter at the + ;; end of this line. Break here. + (throw 'exit line-break-point)))))))))) + +(defun paredit-semicolon-with-line-break (line-break-point n) + (let ((line-break-marker (make-marker))) + (set-marker line-break-marker line-break-point) + (set-marker-insertion-type line-break-marker t) + (insert (make-string (or n 1) ?\; )) + (save-excursion + (goto-char line-break-marker) + (set-marker line-break-marker nil) + (newline) + (lisp-indent-line) + ;; This step is redundant if we are inside a list, but even if we + ;; are at the top level, we want at least to indent whatever we + ;; bumped off the line. + (paredit-ignore-sexp-errors (indent-sexp)) + (paredit-indent-sexps)))) + +;;; This is all a horrible, horrible hack, primarily for GNU Emacs 21, +;;; in which there is no `comment-or-uncomment-region'. + +(autoload 'comment-forward "newcomment") +(autoload 'comment-normalize-vars "newcomment") +(autoload 'comment-region "newcomment") +(autoload 'comment-search-forward "newcomment") +(autoload 'uncomment-region "newcomment") + +(defun paredit-initialize-comment-dwim () + (require 'newcomment) + (if (not (fboundp 'comment-or-uncomment-region)) + (defalias 'comment-or-uncomment-region + (lambda (beginning end &optional argument) + (interactive "*r\nP") + (if (save-excursion (goto-char beginning) + (comment-forward (point-max)) + (<= end (point))) + (uncomment-region beginning end argument) + (comment-region beginning end argument))))) + (defalias 'paredit-initialize-comment-dwim 'comment-normalize-vars) + (comment-normalize-vars)) + +(defun paredit-comment-dwim (&optional argument) + "Call the Lisp comment command you want (Do What I Mean). +This is like `comment-dwim', but it is specialized for Lisp editing. +If transient mark mode is enabled and the mark is active, comment or + uncomment the selected region, depending on whether it was entirely + commented not not already. +If there is already a comment on the current line, with no prefix + argument, indent to that comment; with a prefix argument, kill that + comment. +Otherwise, insert a comment appropriate for the context and ensure that + any code following the comment is moved to the next line. +At the top level, where indentation is calculated to be at column 0, + insert a triple-semicolon comment; within code, where the indentation + is calculated to be non-zero, and on the line there is either no code + at all or code after the point, insert a double-semicolon comment; + and if the point is after all code on the line, insert a single- + semicolon margin comment at `comment-column'." + (interactive "*P") + (paredit-initialize-comment-dwim) + (cond ((paredit-region-active-p) + (comment-or-uncomment-region (region-beginning) + (region-end) + argument)) + ((paredit-comment-on-line-p) + (if argument + (comment-kill (if (integerp argument) argument nil)) + (comment-indent))) + (t (paredit-insert-comment)))) + +(defun paredit-comment-on-line-p () + "True if there is a comment on the line following point. +This is expected to be called only in `paredit-comment-dwim'; do not + call it elsewhere." + (save-excursion + (beginning-of-line) + (let ((comment-p nil)) + ;; Search forward for a comment beginning. If there is one, set + ;; COMMENT-P to true; if not, it will be nil. + (while (progn + (setq comment-p ;t -> no error + (comment-search-forward (point-at-eol) t)) + (and comment-p + (or (paredit-in-string-p) + (paredit-in-char-p (1- (point)))))) + (forward-char)) + comment-p))) + +(defun paredit-insert-comment () + (let ((code-after-p + (save-excursion (paredit-skip-whitespace t (point-at-eol)) + (not (eolp)))) + (code-before-p + (save-excursion (paredit-skip-whitespace nil (point-at-bol)) + (not (bolp))))) + (cond ((and (bolp) + (let ((indent + (let ((indent (calculate-lisp-indent))) + (if (consp indent) (car indent) indent)))) + (and indent (zerop indent)))) + ;; Top-level comment + (if code-after-p (save-excursion (newline))) + (insert ";;; ")) + ((or code-after-p (not code-before-p)) + ;; Code comment + (if code-before-p + (newline-and-indent) + (lisp-indent-line)) + (insert ";; ") + (if code-after-p + (save-excursion + (newline) + (lisp-indent-line) + (paredit-indent-sexps)))) + (t + ;; Margin comment + (indent-to comment-column 1) ; 1 -> force one leading space + (insert ?\; ))))) + +;;;; Character Deletion + +(defun paredit-forward-delete (&optional argument) + "Delete a character forward or move forward over a delimiter. +If on an opening S-expression delimiter, move forward into the + S-expression. +If on a closing S-expression delimiter, refuse to delete unless the + S-expression is empty, in which case delete the whole S-expression. +With a numeric prefix argument N, delete N characters forward. +With a `C-u' prefix argument, simply delete a character forward, + without regard for delimiter balancing." + (interactive "P") + (cond ((or (consp argument) (eobp)) + (delete-char +1)) + ((integerp argument) + (if (< argument 0) + (paredit-backward-delete argument) + (while (> argument 0) + (paredit-forward-delete) + (setq argument (- argument 1))))) + ((paredit-in-string-p) + (paredit-forward-delete-in-string)) + ((paredit-in-comment-p) + (paredit-forward-delete-in-comment)) + ((paredit-in-char-p) ; Escape -- delete both chars. + (delete-char -1) + (delete-char +1)) + ((eq (char-after) ?\\ ) ; ditto + (delete-char +2)) + ((let ((syn (char-syntax (char-after)))) + (or (eq syn ?\( ) + (eq syn ?\" ))) + (if (save-excursion + (paredit-handle-sexp-errors (progn (forward-sexp) t) + nil)) + (forward-char) + (message "Deleting spurious opening delimiter.") + (delete-char +1))) + ((and (not (paredit-in-char-p (1- (point)))) + (eq (char-syntax (char-after)) ?\) ) + (eq (char-before) (matching-paren (char-after)))) + (delete-char -1) ; Empty list -- delete both + (delete-char +1)) ; delimiters. + ((eq ?\; (char-after)) + (paredit-forward-delete-comment-start)) + ((eq (char-syntax (char-after)) ?\) ) + (if (paredit-handle-sexp-errors + (save-excursion (forward-char) (backward-sexp) t) + nil) + (message "End of list!") + (progn + (message "Deleting spurious closing delimiter.") + (delete-char +1)))) + ;; Just delete a single character, if it's not a closing + ;; delimiter. (The character literal case is already handled + ;; by now.) + (t (delete-char +1)))) + +(defun paredit-forward-delete-in-string () + (let ((start+end (paredit-string-start+end-points))) + (cond ((not (eq (point) (cdr start+end))) + ;; If it's not the close-quote, it's safe to delete. But + ;; first handle the case that we're in a string escape. + (cond ((paredit-in-string-escape-p) + ;; We're right after the backslash, so backward + ;; delete it before deleting the escaped character. + (delete-char -1)) + ((eq (char-after) ?\\ ) + ;; If we're not in a string escape, but we are on a + ;; backslash, it must start the escape for the next + ;; character, so delete the backslash before deleting + ;; the next character. + (delete-char +1))) + (delete-char +1)) + ((eq (1- (point)) (car start+end)) + ;; If it is the close-quote, delete only if we're also right + ;; past the open-quote (i.e. it's empty), and then delete + ;; both quotes. Otherwise we refuse to delete it. + (delete-char -1) + (delete-char +1))))) + +(defun paredit-check-forward-delete-in-comment () + ;; Point is in a comment, possibly at eol. We are about to delete + ;; some characters forward; if we are at eol, we are about to delete + ;; the line break. Refuse to do so if if moving the next line into + ;; the comment would break structure. + (if (eolp) + (let ((next-line-start (point-at-bol 2)) + (next-line-end (point-at-eol 2))) + (paredit-check-region next-line-start next-line-end)))) + +(defun paredit-forward-delete-in-comment () + (paredit-check-forward-delete-in-comment) + (delete-char +1)) + +(defun paredit-forward-delete-comment-start () + ;; Point precedes a comment start (not at eol). Refuse to delete a + ;; comment start if the comment contains unbalanced junk. + (paredit-check-region (+ (point) 1) (point-at-eol)) + (delete-char +1)) + +(defun paredit-backward-delete (&optional argument) + "Delete a character backward or move backward over a delimiter. +If on a closing S-expression delimiter, move backward into the + S-expression. +If on an opening S-expression delimiter, refuse to delete unless the + S-expression is empty, in which case delete the whole S-expression. +With a numeric prefix argument N, delete N characters backward. +With a `C-u' prefix argument, simply delete a character backward, + without regard for delimiter balancing." + (interactive "P") + (cond ((or (consp argument) (bobp)) + ;++ Should this untabify? + (delete-char -1)) + ((integerp argument) + (if (< argument 0) + (paredit-forward-delete (- 0 argument)) + (while (> argument 0) + (paredit-backward-delete) + (setq argument (- argument 1))))) + ((paredit-in-string-p) + (paredit-backward-delete-in-string)) + ((paredit-in-comment-p) + (paredit-backward-delete-in-comment)) + ((paredit-in-char-p) ; Escape -- delete both chars. + (delete-char -1) + (delete-char +1)) + ((paredit-in-char-p (1- (point))) + (delete-char -2)) ; ditto + ((let ((syn (char-syntax (char-before)))) + (or (eq syn ?\) ) + (eq syn ?\" ))) + (if (save-excursion + (paredit-handle-sexp-errors (progn (backward-sexp) t) + nil)) + (backward-char) + (message "Deleting spurious closing delimiter.") + (delete-char -1))) + ((and (eq (char-syntax (char-before)) ?\( ) + (eq (char-after) (matching-paren (char-before)))) + (delete-char -1) ; Empty list -- delete both + (delete-char +1)) ; delimiters. + ((bolp) + (paredit-backward-delete-maybe-comment-end)) + ((eq (char-syntax (char-before)) ?\( ) + (if (paredit-handle-sexp-errors + (save-excursion (backward-char) (forward-sexp) t) + nil) + (message "Beginning of list!") + (progn + (message "Deleting spurious closing delimiter.") + (delete-char -1)))) + ;; Delete it, unless it's an opening delimiter. The case of + ;; character literals is already handled by now. + (t + ;; Turn off the @#&*&!^&(%^ botch in GNU Emacs 24 that changed + ;; `backward-delete-char' and `backward-delete-char-untabify' + ;; semantically so that they delete the region in transient + ;; mark mode. + (let ((delete-active-region nil)) + (backward-delete-char-untabify +1))))) + +(defun paredit-backward-delete-in-string () + (let ((start+end (paredit-string-start+end-points))) + (cond ((not (eq (1- (point)) (car start+end))) + ;; If it's not the open-quote, it's safe to delete. + (if (paredit-in-string-escape-p) + ;; If we're on a string escape, since we're about to + ;; delete the backslash, we must first delete the + ;; escaped char. + (delete-char +1)) + (delete-char -1) + (if (paredit-in-string-escape-p) + ;; If, after deleting a character, we find ourselves in + ;; a string escape, we must have deleted the escaped + ;; character, and the backslash is behind the point, so + ;; backward delete it. + (delete-char -1))) + ((eq (point) (cdr start+end)) + ;; If it is the open-quote, delete only if we're also right + ;; past the close-quote (i.e. it's empty), and then delete + ;; both quotes. Otherwise we refuse to delete it. + (delete-char -1) + (delete-char +1))))) + +(defun paredit-backward-delete-in-comment () + ;; Point is in a comment, possibly just after the comment start. + ;; Refuse to delete a comment start if the comment contains + ;; unbalanced junk. + (if (save-excursion + (backward-char) + ;; Must call `paredit-in-string-p' before + ;; `paredit-in-comment-p'. + (not (or (paredit-in-string-p) (paredit-in-comment-p)))) + (paredit-check-region (point) (point-at-eol))) + (backward-delete-char-untabify +1)) + +(defun paredit-backward-delete-maybe-comment-end () + ;; Point is at bol, possibly just after a comment end (i.e., the + ;; previous line may have had a line comment). Refuse to delete a + ;; comment end if moving the current line into the previous line's + ;; comment would break structure. + (if (save-excursion + (backward-char) + (and (not (paredit-in-string-p)) (paredit-in-comment-p))) + (paredit-check-region (point-at-eol) (point-at-bol))) + (delete-char -1)) + +;;;; Killing + +(defun paredit-kill (&optional argument) + "Kill a line as if with `kill-line', but respecting delimiters. +In a string, act exactly as `kill-line' but do not kill past the + closing string delimiter. +On a line with no S-expressions on it starting after the point or + within a comment, act exactly as `kill-line'. +Otherwise, kill all S-expressions that start after the point. +With a `C-u' prefix argument, just do the standard `kill-line'. +With a numeric prefix argument N, do `kill-line' that many times." + (interactive "P") + (cond (argument + (kill-line (if (integerp argument) argument 1))) + ((paredit-in-string-p) + (paredit-kill-line-in-string)) + ((paredit-in-comment-p) + (paredit-kill-line-in-comment)) + ((save-excursion (paredit-skip-whitespace t (point-at-eol)) + (or (eolp) (eq (char-after) ?\; ))) + ;** Be careful about trailing backslashes. + (if (paredit-in-char-p) + (backward-char)) + (kill-line)) + (t (paredit-kill-sexps-on-line)))) + +(defun paredit-kill-line-in-string () + (if (save-excursion (paredit-skip-whitespace t (point-at-eol)) + (eolp)) + (kill-line) + (save-excursion + ;; Be careful not to split an escape sequence. + (if (paredit-in-string-escape-p) + (backward-char)) + (kill-region (point) + (min (point-at-eol) + (cdr (paredit-string-start+end-points))))))) + +(defun paredit-kill-line-in-comment () + ;; The variable `kill-whole-line' is not relevant: the point is in a + ;; comment, and hence not at the beginning of the line. + (paredit-check-forward-delete-in-comment) + (kill-line)) + +(defun paredit-kill-sexps-on-line () + (if (paredit-in-char-p) ; Move past the \ and prefix. + (backward-char 2)) ; (# in Scheme/CL, ? in elisp) + (let ((beginning (point)) + (eol (point-at-eol))) + (let ((end-of-list-p (paredit-forward-sexps-to-kill beginning eol))) + ;; If we got to the end of the list and it's on the same line, + ;; move backward past the closing delimiter before killing. (This + ;; allows something like killing the whitespace in ( ).) + (if end-of-list-p (progn (up-list) (backward-char))) + (if kill-whole-line + (paredit-kill-sexps-on-whole-line beginning) + (kill-region beginning + ;; If all of the S-expressions were on one line, + ;; i.e. we're still on that line after moving past + ;; the last one, kill the whole line, including + ;; any comments; otherwise just kill to the end of + ;; the last S-expression we found. Be sure, + ;; though, not to kill any closing parentheses. + (if (and (not end-of-list-p) + (eq (point-at-eol) eol)) + eol + (point))))))) + +;;; Please do not try to understand this code unless you have a VERY +;;; good reason to do so. I gave up trying to figure it out well +;;; enough to explain it, long ago. + +(defun paredit-forward-sexps-to-kill (beginning eol) + (let ((end-of-list-p nil) + (firstp t)) + ;; Move to the end of the last S-expression that started on this + ;; line, or to the closing delimiter if the last S-expression in + ;; this list is on the line. + (catch 'return + (while t + ;; This and the `kill-whole-line' business below fix a bug that + ;; inhibited any S-expression at the very end of the buffer + ;; (with no trailing newline) from being deleted. It's a + ;; bizarre fix that I ought to document at some point, but I am + ;; too busy at the moment to do so. + (if (and kill-whole-line (eobp)) (throw 'return nil)) + (save-excursion + (paredit-handle-sexp-errors (forward-sexp) + (up-list) + (setq end-of-list-p (eq (point-at-eol) eol)) + (throw 'return nil)) + (if (or (and (not firstp) + (not kill-whole-line) + (eobp)) + (paredit-handle-sexp-errors + (progn (backward-sexp) nil) + t) + (not (eq (point-at-eol) eol))) + (throw 'return nil))) + (forward-sexp) + (if (and firstp + (not kill-whole-line) + (eobp)) + (throw 'return nil)) + (setq firstp nil))) + end-of-list-p)) + +(defun paredit-kill-sexps-on-whole-line (beginning) + (kill-region beginning + (or (save-excursion ; Delete trailing indentation... + (paredit-skip-whitespace t) + (and (not (eq (char-after) ?\; )) + (point))) + ;; ...or just use the point past the newline, if + ;; we encounter a comment. + (point-at-eol))) + (cond ((save-excursion (paredit-skip-whitespace nil (point-at-bol)) + (bolp)) + ;; Nothing but indentation before the point, so indent it. + (lisp-indent-line)) + ((eobp) nil) ; Protect the CHAR-SYNTAX below against NIL. + ;; Insert a space to avoid invalid joining if necessary. + ((let ((syn-before (char-syntax (char-before))) + (syn-after (char-syntax (char-after)))) + (or (and (eq syn-before ?\) ) ; Separate opposing + (eq syn-after ?\( )) ; parentheses, + (and (eq syn-before ?\" ) ; string delimiter + (eq syn-after ?\" )) ; pairs, + (and (memq syn-before '(?_ ?w)) ; or word or symbol + (memq syn-after '(?_ ?w))))) ; constituents. + (insert " ")))) + +;;;;; Killing Words + +;;; This is tricky and asymmetrical because backward parsing is +;;; extraordinarily difficult or impossible, so we have to implement +;;; killing in both directions by parsing forward. + +(defun paredit-forward-kill-word () + "Kill a word forward, skipping over intervening delimiters." + (interactive) + (let ((beginning (point))) + (skip-syntax-forward " -") + (let* ((parse-state (paredit-current-parse-state)) + (state (paredit-kill-word-state parse-state 'char-after))) + (while (not (or (eobp) + (eq ?w (char-syntax (char-after))))) + (setq parse-state + (progn (forward-char 1) (paredit-current-parse-state)) +;; (parse-partial-sexp (point) (1+ (point)) +;; nil nil parse-state) + ) + (let* ((old-state state) + (new-state + (paredit-kill-word-state parse-state 'char-after))) + (cond ((not (eq old-state new-state)) + (setq parse-state + (paredit-kill-word-hack old-state + new-state + parse-state)) + (setq state + (paredit-kill-word-state parse-state + 'char-after)) + (setq beginning (point))))))) + (goto-char beginning) + (kill-word 1))) + +(defun paredit-backward-kill-word () + "Kill a word backward, skipping over any intervening delimiters." + (interactive) + (if (not (or (bobp) + (eq (char-syntax (char-before)) ?w))) + (let ((end (point))) + (backward-word 1) + (forward-word 1) + (goto-char (min end (point))) + (let* ((parse-state (paredit-current-parse-state)) + (state + (paredit-kill-word-state parse-state 'char-before))) + (while (and (< (point) end) + (progn + (setq parse-state + (parse-partial-sexp (point) (1+ (point)) + nil nil parse-state)) + (or (eq state + (paredit-kill-word-state parse-state + 'char-before)) + (progn (backward-char 1) nil))))) + (if (and (eq state 'comment) + (eq ?\# (char-after (point))) + (eq ?\| (char-before (point)))) + (backward-char 1))))) + (backward-kill-word 1)) + +;;;;;; Word-Killing Auxiliaries + +(defun paredit-kill-word-state (parse-state adjacent-char-fn) + (cond ((paredit-in-comment-p parse-state) 'comment) + ((paredit-in-string-p parse-state) 'string) + ((memq (char-syntax (funcall adjacent-char-fn)) + '(?\( ?\) )) + 'delimiter) + (t 'other))) + +;;; This optionally advances the point past any comment delimiters that +;;; should probably not be touched, based on the last state change and +;;; the characters around the point. It returns a new parse state, +;;; starting from the PARSE-STATE parameter. + +(defun paredit-kill-word-hack (old-state new-state parse-state) + (cond ((and (not (eq old-state 'comment)) + (not (eq new-state 'comment)) + (not (paredit-in-string-escape-p)) + (eq ?\# (char-before)) + (eq ?\| (char-after))) + (forward-char 1) + (paredit-current-parse-state) +;; (parse-partial-sexp (point) (1+ (point)) +;; nil nil parse-state) + ) + ((and (not (eq old-state 'comment)) + (eq new-state 'comment) + (eq ?\; (char-before))) + (skip-chars-forward ";") + (paredit-current-parse-state) +;; (parse-partial-sexp (point) (save-excursion +;; (skip-chars-forward ";")) +;; nil nil parse-state) + ) + (t parse-state))) + +(defun paredit-copy-as-kill () + "Save in the kill ring the region that `paredit-kill' would kill." + (interactive) + (cond ((paredit-in-string-p) + (paredit-copy-as-kill-in-string)) + ((paredit-in-comment-p) + (copy-region-as-kill (point) (point-at-eol))) + ((save-excursion (paredit-skip-whitespace t (point-at-eol)) + (or (eolp) (eq (char-after) ?\; ))) + ;** Be careful about trailing backslashes. + (save-excursion + (if (paredit-in-char-p) + (backward-char)) + (copy-region-as-kill (point) (point-at-eol)))) + (t (paredit-copy-sexps-as-kill)))) + +(defun paredit-copy-as-kill-in-string () + (save-excursion + (if (paredit-in-string-escape-p) + (backward-char)) + (copy-region-as-kill (point) + (min (point-at-eol) + (cdr (paredit-string-start+end-points)))))) + +(defun paredit-copy-sexps-as-kill () + (save-excursion + (if (paredit-in-char-p) + (backward-char 2)) + (let ((beginning (point)) + (eol (point-at-eol))) + (let ((end-of-list-p (paredit-forward-sexps-to-kill beginning eol))) + (if end-of-list-p (progn (up-list) (backward-char))) + (copy-region-as-kill beginning + (cond (kill-whole-line + (or (save-excursion + (paredit-skip-whitespace t) + (and (not (eq (char-after) ?\; )) + (point))) + (point-at-eol))) + ((and (not end-of-list-p) + (eq (point-at-eol) eol)) + eol) + (t + (point)))))))) + +;;;; Deleting Regions + +(defun paredit-delete-region (start end) + "Delete the text between point and mark, like `delete-region'. +If that text is unbalanced, signal an error instead. +With a prefix argument, skip the balance check." + (interactive "r") + (if (and start end (not current-prefix-arg)) + (paredit-check-region-for-delete start end)) + (setq this-command 'delete-region) + (delete-region start end)) + +(defun paredit-kill-region (start end) + "Kill the text between point and mark, like `kill-region'. +If that text is unbalanced, signal an error instead. +With a prefix argument, skip the balance check." + (interactive "r") + (if (and start end (not current-prefix-arg)) + (paredit-check-region-for-delete start end)) + (setq this-command 'kill-region) + (kill-region start end)) + +(defun paredit-check-region-for-delete (start end) + "Signal an error deleting text between START and END is unsafe." + (save-excursion + (goto-char start) + (let* ((start-state (paredit-current-parse-state)) + (end-state (parse-partial-sexp start end nil nil start-state))) + (paredit-check-region-for-delete:depth start start-state end end-state) + (paredit-check-region-for-delete:string start start-state end end-state) + (paredit-check-region-for-delete:comment start start-state end end-state) + (paredit-check-region-for-delete:char-quote start start-state + end end-state)))) + +(defun paredit-check-region-for-delete:depth (start start-state end end-state) + (let ((start-depth (nth 0 start-state)) + (end-depth (nth 0 end-state))) + (if (not (= start-depth end-depth)) + (error "Mismatched parenthesis depth: %S at start, %S at end." + start-depth + end-depth)))) + +(defun paredit-check-region-for-delete:string (start start-state end end-state) + (let ((start-string-p (nth 3 start-state)) + (end-string-p (nth 3 end-state))) + (if (not (eq start-string-p end-string-p)) + (error "Mismatched string state: start %sin string, end %sin string." + (if start-string-p "" "not ") + (if end-string-p "" "not "))))) + +(defun paredit-check-region-for-delete:comment + (start start-state end end-state) + (let ((start-comment-state (nth 4 start-state)) + (end-comment-state (nth 4 end-state))) + (if (not (or (eq start-comment-state end-comment-state) + ;; If we are moving text into or out of a line + ;; comment, make sure that the text is balanced. (The + ;; comment state may be a number, not t or nil at all, + ;; for nestable comments, which are not handled by + ;; this heuristic (or any of paredit, really).) + (and (or (and (eq start-comment-state nil) + (eq end-comment-state t)) + (and (eq start-comment-state t) + (eq end-comment-state nil))) + (save-excursion + (goto-char end) + (paredit-region-ok-p (point) (point-at-eol)))))) + (error "Mismatched comment state: %s" + (cond ((and (integerp start-comment-state) + (integerp end-comment-state)) + (format "depth %S at start, depth %S at end." + start-comment-state + end-comment-state)) + ((integerp start-comment-state) + "start in nested comment, end otherwise.") + ((integerp end-comment-state) + "end in nested comment, start otherwise.") + (start-comment-state + "start in comment, end not in comment.") + (end-comment-state + "end in comment, start not in comment.") + (t + (format "start %S, end %S." + start-comment-state + end-comment-state))))))) + +(defun paredit-check-region-for-delete:char-quote + (start start-state end end-state) + (let ((start-char-quote (nth 5 start-state)) + (end-char-quote (nth 5 end-state))) + (if (not (eq start-char-quote end-char-quote)) + (let ((phrase "character quotation")) + (error "Mismatched %s: start %sin %s, end %sin %s." + phrase + (if start-char-quote "" "not ") + phrase + (if end-char-quote "" "not ") + phrase))))) + +;;;; Point Motion + +(eval-and-compile + (defmacro defun-motion (name bvl doc &rest body) + `(defun ,name ,bvl + ,doc + ,(xcond ((paredit-xemacs-p) + '(interactive "_")) + ((paredit-gnu-emacs-p) + ;++ Not sure this is sufficient for the `^'. + (if (fboundp 'handle-shift-selection) + '(interactive "^p") + '(interactive "p")))) + ,@body))) + +(defun-motion paredit-forward (&optional arg) + "Move forward an S-expression, or up an S-expression forward. +If there are no more S-expressions in this one before the closing + delimiter, move past that closing delimiter; otherwise, move forward + past the S-expression following the point." + (let ((n (or arg 1))) + (cond ((< 0 n) (dotimes (i n) (paredit-move-forward))) + ((< n 0) (dotimes (i (- n)) (paredit-move-backward)))))) + +(defun-motion paredit-backward (&optional arg) + "Move backward an S-expression, or up an S-expression backward. +If there are no more S-expressions in this one before the opening + delimiter, move past that opening delimiter backward; otherwise, move + move backward past the S-expression preceding the point." + (let ((n (or arg 1))) + (cond ((< 0 n) (dotimes (i n) (paredit-move-backward))) + ((< n 0) (dotimes (i (- n)) (paredit-move-forward)))))) + +(defun paredit-move-forward () + (cond ((paredit-in-string-p) + (let ((end (paredit-enclosing-string-end))) + ;; `forward-sexp' and `up-list' may move into the next string + ;; in the buffer. Don't do that; move out of the current one. + (if (paredit-handle-sexp-errors + (progn (paredit-handle-sexp-errors (forward-sexp) + (up-list)) + (<= end (point))) + t) + (goto-char end)))) + ((paredit-in-char-p) + (forward-char)) + (t + (paredit-handle-sexp-errors (forward-sexp) + (up-list))))) + +(defun paredit-move-backward () + (cond ((paredit-in-string-p) + (let ((start (paredit-enclosing-string-start))) + (if (paredit-handle-sexp-errors + (progn (paredit-handle-sexp-errors (backward-sexp) + (backward-up-list)) + (<= (point) start)) + t) + (goto-char start)))) + ((paredit-in-char-p) + ;++ Corner case: a buffer of `\|x'. What to do? + (backward-char 2)) + (t + (paredit-handle-sexp-errors (backward-sexp) + (backward-up-list))))) + +;;;; Window Positioning + +(defalias 'paredit-recentre-on-sexp 'paredit-recenter-on-sexp) + +(defun paredit-recenter-on-sexp (&optional n) + "Recenter the screen on the S-expression following the point. +With a prefix argument N, encompass all N S-expressions forward." + (interactive "P") + (let* ((p (point)) + (end-point (progn (forward-sexp n) (point))) + (start-point (progn (goto-char end-point) (backward-sexp n) (point)))) + ;; Point is at beginning of first S-expression. + (let ((p-visible nil) (start-visible nil)) + (save-excursion + (forward-line (/ (count-lines start-point end-point) 2)) + (recenter) + (setq p-visible (pos-visible-in-window-p p)) + (setq start-visible (pos-visible-in-window-p start-point))) + (cond ((not start-visible) + ;; Implies (not p-visible). Put the start at the top of + ;; the screen. + (recenter 0)) + (p-visible + ;; Go back to p if we can. + (goto-char p)))))) + +(defun paredit-recenter-on-defun () + "Recenter the screen on the definition at point." + (interactive) + (save-excursion + (beginning-of-defun) + (paredit-recenter-on-sexp))) + +(defun paredit-focus-on-defun () + "Moves display to the top of the definition at point." + (interactive) + (beginning-of-defun) + (recenter 0)) + +;;;; Generalized Upward/Downward Motion + +(defun paredit-up/down (n vertical-direction) + (let ((horizontal-direction (if (< 0 n) +1 -1))) + (while (/= n 0) + (goto-char + (paredit-next-up/down-point horizontal-direction vertical-direction)) + (setq n (- n horizontal-direction))))) + +(defun paredit-next-up/down-point (horizontal-direction vertical-direction) + (let ((state (paredit-current-parse-state)) + (scan-lists + (lambda () + (scan-lists (point) horizontal-direction vertical-direction)))) + (cond ((paredit-in-string-p state) + (let ((start+end (paredit-string-start+end-points state))) + (if (< 0 vertical-direction) + (if (< 0 horizontal-direction) + (+ 1 (cdr start+end)) + (car start+end)) + ;; We could let the user try to descend into lists + ;; within the string, but that would be asymmetric + ;; with the up case, which rises out of the whole + ;; string and not just out of a list within the + ;; string, so this case will just be an error. + (error "Can't descend further into string.")))) + ((< 0 vertical-direction) + ;; When moving up, just try to rise up out of the list. + (or (funcall scan-lists) + (buffer-end horizontal-direction))) + ((< vertical-direction 0) + ;; When moving down, look for a string closer than a list, + ;; and use that if we find it. + (let* ((list-start + (paredit-handle-sexp-errors (funcall scan-lists) nil)) + (string-start + (paredit-find-next-string-start horizontal-direction + list-start))) + (if (and string-start list-start) + (if (< 0 horizontal-direction) + (min string-start list-start) + (max string-start list-start)) + (or string-start + ;; Scan again: this is a kludgey way to report the + ;; error if there really was one. + (funcall scan-lists) + (buffer-end horizontal-direction))))) + (t + (error "Vertical direction must be nonzero in `%s'." + 'paredit-up/down))))) + +(defun paredit-find-next-string-start (horizontal-direction limit) + (let ((buffer-limit-p (if (< 0 horizontal-direction) 'eobp 'bobp)) + (next-char (if (< 0 horizontal-direction) 'char-after 'char-before)) + (pastp (if (< 0 horizontal-direction) '> '<))) + (paredit-handle-sexp-errors + (save-excursion + (catch 'exit + (while t + (if (or (funcall buffer-limit-p) + (and limit (funcall pastp (point) limit))) + (throw 'exit nil)) + (forward-sexp horizontal-direction) + (save-excursion + (backward-sexp horizontal-direction) + (if (eq ?\" (char-syntax (funcall next-char))) + (throw 'exit (+ (point) horizontal-direction))))))) + nil))) + +(defun-motion paredit-forward-down (&optional argument) + "Move forward down into a list. +With a positive argument, move forward down that many levels. +With a negative argument, move backward down that many levels." + (paredit-up/down (or argument +1) -1)) + +(defun-motion paredit-backward-up (&optional argument) + "Move backward up out of the enclosing list. +With a positive argument, move backward up that many levels. +With a negative argument, move forward up that many levels. +If in a string initially, that counts as one level." + (paredit-up/down (- 0 (or argument +1)) +1)) + +(defun-motion paredit-forward-up (&optional argument) + "Move forward up out of the enclosing list. +With a positive argument, move forward up that many levels. +With a negative argument, move backward up that many levels. +If in a string initially, that counts as one level." + (paredit-up/down (or argument +1) +1)) + +(defun-motion paredit-backward-down (&optional argument) + "Move backward down into a list. +With a positive argument, move backward down that many levels. +With a negative argument, move forward down that many levels." + (paredit-up/down (- 0 (or argument +1)) -1)) + +;;;; Depth-Changing Commands: Wrapping, Splicing, & Raising + +(defun paredit-wrap-sexp (&optional argument open close) + "Wrap the following S-expression. +If a `C-u' prefix argument is given, wrap all S-expressions following + the point until the end of the buffer or of the enclosing list. +If a numeric prefix argument N is given, wrap N S-expressions. +Automatically indent the newly wrapped S-expression. +As a special case, if the point is at the end of a list, simply insert + a parenthesis pair, rather than inserting a lone opening delimiter + and then signalling an error, in the interest of preserving + structure. +By default OPEN and CLOSE are round delimiters." + (interactive "P") + (paredit-lose-if-not-in-sexp 'paredit-wrap-sexp) + (let ((open (or open ?\( )) + (close (or close ?\) ))) + (paredit-handle-sexp-errors + ((lambda (n) (paredit-insert-pair n open close 'goto-char)) + (cond ((integerp argument) argument) + ((consp argument) (paredit-count-sexps-forward)) + ((paredit-region-active-p) nil) + (t 1))) + (insert close) + (backward-char))) + (save-excursion (backward-up-list) (indent-sexp))) + +(defun paredit-yank-pop (&optional argument) + "Replace just-yanked text with the next item in the kill ring. +If this command follows a `yank', just run `yank-pop'. +If this command follows a `paredit-wrap-sexp', or any other paredit + wrapping command (see `paredit-wrap-commands'), run `yank' and + reindent the enclosing S-expression. +If this command is repeated, run `yank-pop' and reindent the enclosing + S-expression. + +The argument is passed on to `yank' or `yank-pop'; see their + documentation for details." + (interactive "*p") + (cond ((eq last-command 'yank) + (yank-pop argument)) + ((memq last-command paredit-wrap-commands) + (yank argument) + ;; `yank' futzes with `this-command'. + (setq this-command 'paredit-yank-pop) + (save-excursion (backward-up-list) (indent-sexp))) + ((eq last-command 'paredit-yank-pop) + ;; Pretend we just did a `yank', so that we can use + ;; `yank-pop' without duplicating its definition. + (setq last-command 'yank) + (yank-pop argument) + ;; Return to our original state. + (setq last-command 'paredit-yank-pop) + (setq this-command 'paredit-yank-pop) + (save-excursion (backward-up-list) (indent-sexp))) + (t (error "Last command was not a yank or a wrap: %s" last-command)))) + +(defun paredit-splice-sexp (&optional argument) + "Splice the list that the point is on by removing its delimiters. +With a prefix argument as in `C-u', kill all S-expressions backward in + the current list before splicing all S-expressions forward into the + enclosing list. +With two prefix arguments as in `C-u C-u', kill all S-expressions + forward in the current list before splicing all S-expressions + backward into the enclosing list. +With a numerical prefix argument N, kill N S-expressions backward in + the current list before splicing the remaining S-expressions into the + enclosing list. If N is negative, kill forward. +Inside a string, unescape all backslashes, or signal an error if doing + so would invalidate the buffer's structure." + (interactive "P") + (if (paredit-in-string-p) + (paredit-splice-string argument) + (if (paredit-in-comment-p) + (error "Can't splice comment.")) + (paredit-handle-sexp-errors (paredit-enclosing-list-start) + (error "Can't splice top level.")) + (paredit-kill-surrounding-sexps-for-splice argument) + (let ((delete-start (paredit-enclosing-list-start)) + (delete-end + (let ((limit + (save-excursion + (paredit-ignore-sexp-errors (forward-sexp) (backward-sexp)) + (point)))) + (save-excursion + (backward-up-list) + (forward-char +1) + (paredit-skip-whitespace t limit) + (point))))) + (let ((end-marker (make-marker))) + (save-excursion + (up-list) + (delete-char -1) + (set-marker end-marker (point))) + (delete-region delete-start delete-end) + (paredit-splice-reindent delete-start (marker-position end-marker)))))) + +(defun paredit-splice-reindent (start end) + (paredit-preserving-column + ;; If we changed the first subform of the enclosing list, we must + ;; reindent the whole enclosing list. + (if (paredit-handle-sexp-errors + (save-excursion + (backward-up-list) + (down-list) + (paredit-ignore-sexp-errors (forward-sexp)) + (< start (point))) + nil) + (save-excursion (backward-up-list) (indent-sexp)) + (paredit-indent-region start end)))) + +(defun paredit-kill-surrounding-sexps-for-splice (argument) + (cond ((or (paredit-in-string-p) + (paredit-in-comment-p)) + (error "Invalid context for splicing S-expressions.")) + ((or (not argument) (eq argument 0)) nil) + ((or (numberp argument) (eq argument '-)) + ;; Kill S-expressions before/after the point by saving the + ;; point, moving across them, and killing the region. + (let* ((argument (if (eq argument '-) -1 argument)) + (saved (paredit-point-at-sexp-boundary (- argument)))) + (goto-char saved) + (paredit-ignore-sexp-errors (backward-sexp argument)) + (paredit-hack-kill-region saved (point)))) + ((consp argument) + (let ((v (car argument))) + (if (= v 4) ;One `C-u'. + ;; Move backward until we hit the open paren; then + ;; kill that selected region. + (let ((end (point))) + (paredit-ignore-sexp-errors + (while (not (bobp)) + (backward-sexp))) + (paredit-hack-kill-region (point) end)) + ;; Move forward until we hit the close paren; then + ;; kill that selected region. + (let ((beginning (point))) + (paredit-ignore-sexp-errors + (while (not (eobp)) + (forward-sexp))) + (paredit-hack-kill-region beginning (point)))))) + (t (error "Bizarre prefix argument `%s'." argument)))) + +(defun paredit-splice-sexp-killing-backward (&optional n) + "Splice the list the point is on by removing its delimiters, and + also kill all S-expressions before the point in the current list. +With a prefix argument N, kill only the preceding N S-expressions." + (interactive "P") + (paredit-splice-sexp (if n + (prefix-numeric-value n) + '(4)))) + +(defun paredit-splice-sexp-killing-forward (&optional n) + "Splice the list the point is on by removing its delimiters, and + also kill all S-expressions after the point in the current list. +With a prefix argument N, kill only the following N S-expressions." + (interactive "P") + (paredit-splice-sexp (if n + (- (prefix-numeric-value n)) + '(16)))) + +(defun paredit-raise-sexp (&optional argument) + "Raise the following S-expression in a tree, deleting its siblings. +With a prefix argument N, raise the following N S-expressions. If N + is negative, raise the preceding N S-expressions. +If the point is on an S-expression, such as a string or a symbol, not + between them, that S-expression is considered to follow the point." + (interactive "P") + (save-excursion + (cond ((paredit-in-string-p) + (goto-char (car (paredit-string-start+end-points)))) + ((paredit-in-char-p) + (backward-sexp)) + ((paredit-in-comment-p) + (error "No S-expression to raise in comment."))) + ;; Select the S-expressions we want to raise in a buffer substring. + (let* ((n (prefix-numeric-value argument)) + (bound (scan-sexps (point) n)) + (sexps + (if (< n 0) + (buffer-substring bound (paredit-point-at-sexp-end)) + (buffer-substring (paredit-point-at-sexp-start) bound)))) + ;; Move up to the list we're raising those S-expressions out of and + ;; delete it. + (backward-up-list) + (delete-region (point) (scan-sexps (point) 1)) + (let* ((indent-start (point)) + (indent-end (save-excursion (insert sexps) (point)))) + ;; If the expression spans multiple lines, its indentation is + ;; probably broken, so reindent it -- but don't reindent + ;; anything that we didn't touch outside the expression. + ;; + ;; XXX What if the *column* of the starting point was preserved + ;; too? Should we avoid reindenting in that case? + (if (not (eq (save-excursion (goto-char indent-start) (point-at-eol)) + (save-excursion (goto-char indent-end) (point-at-eol)))) + (indent-region indent-start indent-end nil)))))) + +;;; The effects of convolution on the surrounding whitespace are pretty +;;; random. If you have better suggestions, please let me know. + +(defun paredit-convolute-sexp (&optional n) + "Convolute S-expressions. +Save the S-expressions preceding point and delete them. +Splice the S-expressions following point. +Wrap the enclosing list in a new list prefixed by the saved text. +With a prefix argument N, move up N lists before wrapping." + (interactive "p") + (paredit-lose-if-not-in-sexp 'paredit-convolute-sexp) + ;; Make sure we can move up before destroying anything. + (save-excursion (backward-up-list n) (backward-up-list)) + (let (open close) ;++ Is this a good idea? + (let ((prefix + (let ((end (point))) + (paredit-ignore-sexp-errors + (while (not (bobp)) (backward-sexp))) + (prog1 (buffer-substring (point) end) + (backward-up-list) + (save-excursion (forward-sexp) + (setq close (char-before)) + (delete-char -1)) + (setq open (char-after)) + (delete-region (point) end) + ;; I'm not sure this makes sense... + (if (not (eolp)) (just-one-space)))))) + (backward-up-list n) + (paredit-insert-pair 1 open close 'goto-char) + (insert prefix) + ;; I'm not sure this makes sense either... + (if (not (eolp)) (just-one-space)) + (save-excursion + (backward-up-list) + (paredit-ignore-sexp-errors (indent-sexp)))))) + +(defun paredit-splice-string (argument) + (let ((original-point (point)) + (start+end (paredit-string-start+end-points))) + (let ((start (car start+end)) + (end (cdr start+end))) + ;; START and END both lie before the respective quote + ;; characters, which we want to delete; thus we increment START + ;; by one to extract the string, and we increment END by one to + ;; delete the string. + (let* ((escaped-string + (cond ((not (consp argument)) + (buffer-substring (1+ start) end)) + ((= 4 (car argument)) + (buffer-substring original-point end)) + (t + (buffer-substring (1+ start) original-point)))) + (unescaped-string + (paredit-unescape-string escaped-string))) + (if (not unescaped-string) + (error "Unspliceable string.") + (save-excursion + (goto-char start) + (delete-region start (1+ end)) + (insert unescaped-string)) + (if (not (and (consp argument) + (= 4 (car argument)))) + (goto-char (- original-point 1)))))))) + +(defun paredit-unescape-string (string) + (with-temp-buffer + (insert string) + (goto-char (point-min)) + (while (and (not (eobp)) + ;; nil -> no bound; t -> no errors. + (search-forward "\\" nil t)) + (delete-char -1) + (forward-char)) + (paredit-handle-sexp-errors + (progn (scan-sexps (point-min) (point-max)) + (buffer-string)) + nil))) + +;;;; Slurpage & Barfage + +(defun paredit-forward-slurp-sexp (&optional argument) + "Add the S-expression following the current list into that list + by moving the closing delimiter. +Automatically reindent the newly slurped S-expression with respect to + its new enclosing form. +If in a string, move the opening double-quote forward by one + S-expression and escape any intervening characters as necessary, + without altering any indentation or formatting." + (interactive "P") + (save-excursion + (cond ((paredit-in-comment-p) + (error "Invalid context for slurping S-expressions.")) + ((numberp argument) + (if (< argument 0) + (paredit-forward-barf-sexp (- 0 argument)) + (while (< 0 argument) + (paredit-forward-slurp-sexp) + (setq argument (- argument 1))))) + ((paredit-in-string-p) + ;; If there is anything to slurp into the string, take that. + ;; Otherwise, try to slurp into the enclosing list. + (if (save-excursion + (goto-char (paredit-enclosing-string-end)) + (paredit-handle-sexp-errors (progn (forward-sexp) nil) + t)) + (progn + (goto-char (paredit-enclosing-string-end)) + (paredit-forward-slurp-into-list argument)) + (paredit-forward-slurp-into-string argument))) + (t + (paredit-forward-slurp-into-list argument))))) + +(defun paredit-forward-slurp-into-list (&optional argument) + (let ((nestedp nil)) + (save-excursion + (up-list) ; Up to the end of the list to + (let ((close (char-before))) ; save and delete the closing + (delete-char -1) ; delimiter. + (let ((start (point))) + (catch 'return ; Go to the end of the desired + (while t ; S-expression, going up a + (paredit-handle-sexp-errors ; list if it's not in this, + (progn (forward-sexp) + (if argument + (paredit-ignore-sexp-errors + (while (not (eobp)) + (forward-sexp)))) + (throw 'return nil)) + (setq nestedp t) + (up-list) + (setq close ; adjusting for mixed + (prog1 (char-before) ; delimiters as necessary, + (delete-char -1) + (insert close)))))) + (insert close) ; to insert that delimiter. + (indent-region start (point) nil)))) + (if (and (not nestedp) + (eq (save-excursion (paredit-skip-whitespace nil) (point)) + (save-excursion (backward-up-list) (forward-char) (point))) + (eq (save-excursion (forward-sexp) (backward-sexp) (point)) + (save-excursion (paredit-skip-whitespace t) (point)))) + (delete-region (save-excursion (paredit-skip-whitespace nil) (point)) + (save-excursion (paredit-skip-whitespace t) (point)))))) + +(defun paredit-forward-slurp-into-string (&optional argument) + (let ((start (paredit-enclosing-string-start)) + (end (paredit-enclosing-string-end))) + (goto-char end) + ;; Signal any errors that we might get first, before mucking with + ;; the buffer's contents. + (save-excursion (forward-sexp)) + (let ((close (char-before))) + ;; Skip intervening whitespace if we're slurping into an empty + ;; string. XXX What about nonempty strings? + (if (and (= (+ start 2) end) + (eq (save-excursion (paredit-skip-whitespace t) (point)) + (save-excursion (forward-sexp) (backward-sexp) (point)))) + (delete-region (- (point) 1) + (save-excursion (paredit-skip-whitespace t) (point))) + (delete-char -1)) + (paredit-forward-for-quote + (save-excursion + (forward-sexp) + (if argument + (while (paredit-handle-sexp-errors (progn (forward-sexp) t) nil))) + (point))) + (insert close)))) + +(defun paredit-forward-barf-sexp (&optional argument) + "Remove the last S-expression in the current list from that list + by moving the closing delimiter. +Automatically reindent the newly barfed S-expression with respect to + its new enclosing form." + (interactive "P") + (paredit-lose-if-not-in-sexp 'paredit-forward-barf-sexp) + (if (and (numberp argument) (< argument 0)) + (paredit-forward-slurp-sexp (- 0 argument)) + (let ((start (point)) (end nil)) + (save-excursion + (up-list) ; Up to the end of the list to + (let ((close (char-before))) ; save and delete the closing + (delete-char -1) ; delimiter. + (setq end (point)) + (paredit-ignore-sexp-errors ; Go back to where we want to + (if (or (not argument) ; insert the delimiter. + (numberp argument)) + (backward-sexp argument) + (while (paredit-handle-sexp-errors + (save-excursion (backward-sexp) (<= start (point))) + nil) + (backward-sexp)))) + (paredit-skip-whitespace nil) ; Skip leading whitespace. + (cond ((bobp) + ;++ We'll have deleted the close, but there's no open. + ;++ Is that OK? + (error "Barfing all subexpressions with no open-paren?")) + ((paredit-in-comment-p) ; Don't put the close-paren in + (newline))) ; a comment. + (insert close)) + ;; Reindent all of the newly barfed S-expressions. Start at the + ;; start of the first barfed S-expression, not at the close we + ;; just inserted. + (forward-sexp) + (backward-sexp) + (if (or (not argument) (numberp argument)) + (paredit-forward-and-indent argument) + (indent-region (point) end)))))) + +(defun paredit-backward-slurp-sexp (&optional argument) + "Add the S-expression preceding the current list into that list + by moving the closing delimiter. +Automatically reindent the whole form into which new S-expression was + slurped. +If in a string, move the opening double-quote backward by one + S-expression and escape any intervening characters as necessary, + without altering any indentation or formatting." + (interactive "P") + (save-excursion + (cond ((paredit-in-comment-p) + (error "Invalid context for slurping S-expressions.")) + ((numberp argument) + (if (< argument 0) + (paredit-backward-barf-sexp (- 0 argument)) + (while (< 0 argument) + (paredit-backward-slurp-sexp) + (setq argument (- argument 1))))) + ((paredit-in-string-p) + ;; If there is anything to slurp into the string, take that. + ;; Otherwise, try to slurp into the enclosing list. + (if (save-excursion + (goto-char (paredit-enclosing-string-start)) + (paredit-handle-sexp-errors (progn (backward-sexp) nil) + t)) + (progn + (goto-char (paredit-enclosing-string-start)) + (paredit-backward-slurp-into-list argument)) + (paredit-backward-slurp-into-string argument))) + (t + (paredit-backward-slurp-into-list argument))))) + +(defun paredit-backward-slurp-into-list (&optional argument) + (let ((nestedp nil)) + (save-excursion + (backward-up-list) + (let ((open (char-after))) + (delete-char +1) + (catch 'return + (while t + (paredit-handle-sexp-errors + (progn (backward-sexp) + (if argument + (paredit-ignore-sexp-errors + (while (not (bobp)) + (backward-sexp)))) + (throw 'return nil)) + (setq nestedp t) + (backward-up-list) + (setq open + (prog1 (char-after) + (save-excursion (insert open) (delete-char +1))))))) + (insert open)) + ;; Reindent the line at the beginning of wherever we inserted the + ;; opening delimiter, and then indent the whole S-expression. + (backward-up-list) + (lisp-indent-line) + (indent-sexp)) + ;; If we slurped into an empty list, don't leave dangling space: + ;; (foo |). + (if (and (not nestedp) + (eq (save-excursion (paredit-skip-whitespace nil) (point)) + (save-excursion (backward-sexp) (forward-sexp) (point))) + (eq (save-excursion (up-list) (backward-char) (point)) + (save-excursion (paredit-skip-whitespace t) (point)))) + (delete-region (save-excursion (paredit-skip-whitespace nil) (point)) + (save-excursion (paredit-skip-whitespace t) (point)))))) + +(defun paredit-backward-slurp-into-string (&optional argument) + (let ((start (paredit-enclosing-string-start)) + (end (paredit-enclosing-string-end))) + (goto-char start) + ;; Signal any errors that we might get first, before mucking with + ;; the buffer's contents. + (save-excursion (backward-sexp)) + (let ((open (char-after)) + (target (point))) + ;; Skip intervening whitespace if we're slurping into an empty + ;; string. XXX What about nonempty strings? + (if (and (= (+ start 2) end) + (eq (save-excursion (paredit-skip-whitespace nil) (point)) + (save-excursion (backward-sexp) (forward-sexp) (point)))) + (delete-region (save-excursion (paredit-skip-whitespace nil) (point)) + (+ (point) 1)) + (delete-char +1)) + (backward-sexp) + (if argument + (paredit-ignore-sexp-errors + (while (not (bobp)) + (backward-sexp)))) + (insert open) + (paredit-forward-for-quote target)))) + +(defun paredit-backward-barf-sexp (&optional argument) + "Remove the first S-expression in the current list from that list + by moving the closing delimiter. +Automatically reindent the barfed S-expression and the form from which + it was barfed." + (interactive "P") + (paredit-lose-if-not-in-sexp 'paredit-backward-barf-sexp) + (if (and (numberp argument) (< argument 0)) + (paredit-backward-slurp-sexp (- 0 argument)) + (let ((end (make-marker))) + (set-marker end (point)) + (save-excursion + (backward-up-list) + (let ((open (char-after))) + (delete-char +1) + (paredit-ignore-sexp-errors + (paredit-forward-and-indent + (if (or (not argument) (numberp argument)) + argument + (let ((n 0)) + (save-excursion + (while (paredit-handle-sexp-errors + (save-excursion + (forward-sexp) + (<= (point) end)) + nil) + (forward-sexp) + (setq n (+ n 1)))) + n)))) + (while (progn (paredit-skip-whitespace t) (eq (char-after) ?\; )) + (forward-line 1)) + (if (eobp) + ;++ We'll have deleted the close, but there's no open. + ;++ Is that OK? + (error "Barfing all subexpressions with no close-paren?")) + ;** Don't use `insert' here. Consider, e.g., barfing from + ;** (foo|) + ;** and how `save-excursion' works. + (insert-before-markers open)) + (backward-up-list) + (lisp-indent-line) + (indent-sexp))))) + +;;;; Splitting & Joining + +(defun paredit-split-sexp () + "Split the list or string the point is on into two." + (interactive) + (cond ((paredit-in-string-p) + (insert "\"") + (save-excursion (insert " \""))) + ((or (paredit-in-comment-p) + (paredit-in-char-p)) + (error "Invalid context for splitting S-expression.")) + (t + (let ((open (save-excursion (backward-up-list) (char-after))) + (close (save-excursion (up-list) (char-before)))) + (delete-horizontal-space) + (insert close) + (save-excursion + (insert ?\ ) + (insert open) + (backward-char) + (indent-sexp)))))) + +(defun paredit-join-sexps () + "Join the S-expressions adjacent on either side of the point. +Both must be lists, strings, or atoms; error if there is a mismatch." + (interactive) + (cond ((paredit-in-comment-p) (error "Can't join S-expressions in comment.")) + ((paredit-in-string-p) (error "Nothing to join in a string.")) + ((paredit-in-char-p) (error "Can't join characters."))) + (let ((left-point (paredit-point-at-sexp-end)) + (right-point (paredit-point-at-sexp-start))) + (let ((left-char (char-before left-point)) + (right-char (char-after right-point))) + (let ((left-syntax (char-syntax left-char)) + (right-syntax (char-syntax right-char))) + (cond ((< right-point left-point) + (error "Can't join a datum with itself.")) + ((and (eq left-syntax ?\) ) + (eq right-syntax ?\( ) + (eq left-char (matching-paren right-char)) + (eq right-char (matching-paren left-char))) + (paredit-join-lists-internal left-point right-point) + (paredit-preserving-column + (save-excursion + (backward-up-list) + (indent-sexp)))) + ((and (eq left-syntax ?\" ) + (eq right-syntax ?\" )) + ;; Delete any intermediate formatting. + (delete-region (1- left-point) (1+ right-point))) + ((and (memq left-syntax '(?w ?_)) ; Word or symbol + (memq right-syntax '(?w ?_))) + (delete-region left-point right-point)) + (t (error "Mismatched S-expressions to join."))))))) + +(defun paredit-join-lists-internal (left-point right-point) + (save-excursion + ;; Leave intermediate formatting alone. + (goto-char right-point) + (delete-char +1) + (goto-char left-point) + (delete-char -1) + ;; Kludge: Add an extra space in several conditions. + (if (or + ;; (foo)| ;x\n(bar) => (foo | ;x\nbar), not (foo| ;x\nbar). + (and (not (eolp)) + (save-excursion + (paredit-skip-whitespace t (point-at-eol)) + (eq (char-after) ?\;))) + ;; (foo)|(bar) => (foo| bar), not (foo|bar). + (and (= left-point right-point) + (not (or (eq ?\ (char-syntax (char-before))) + (eq ?\ (char-syntax (char-after))))))) + (insert ?\ )))) + +;++ How ought paredit-join to handle comments intervening symbols or strings? +;++ Idea: +;++ +;++ "foo" | ;bar +;++ "baz" ;quux +;++ +;++ => +;++ +;++ "foo|baz" ;bar +;++ ;quux +;++ +;++ The point should stay where it is relative to the comments, and the +;++ the comments' columns should all be preserved, perhaps. Hmmmm... +;++ What about this? +;++ +;++ "foo" ;bar +;++ | ;baz +;++ "quux" ;zot + +;++ Should rename: +;++ paredit-point-at-sexp-start -> paredit-start-of-sexp-after-point +;++ paredit-point-at-sexp-end -> paredit-end-of-sexp-before-point + +;;;; Variations on the Lurid Theme + +;;; I haven't the imagination to concoct clever names for these. + +(defun paredit-add-to-previous-list () + "Add the S-expression following point to the list preceding point." + (interactive) + (paredit-lose-if-not-in-sexp 'paredit-add-to-previous-list) + (save-excursion + (down-list -1) ;++ backward-down-list... + (paredit-forward-slurp-sexp))) + +(defun paredit-add-to-next-list () + "Add the S-expression preceding point to the list following point. +If no S-expression precedes point, move up the tree until one does." + (interactive) + (paredit-lose-if-not-in-sexp 'paredit-add-to-next-list) + (save-excursion + (down-list) + (paredit-backward-slurp-sexp))) + +(defun paredit-join-with-previous-list () + "Join the list the point is on with the previous list in the buffer." + (interactive) + (paredit-lose-if-not-in-sexp 'paredit-join-with-previous-list) + (save-excursion + (while (paredit-handle-sexp-errors (save-excursion (backward-sexp) nil) + (backward-up-list) + t)) + (paredit-join-sexps))) + +(defun paredit-join-with-next-list () + "Join the list the point is on with the next list in the buffer." + (interactive) + (paredit-lose-if-not-in-sexp 'paredit-join-with-next-list) + (save-excursion + (while (paredit-handle-sexp-errors (save-excursion (forward-sexp) nil) + (up-list) + t)) + (paredit-join-sexps))) + +;;;; Utilities + +(defun paredit-in-string-escape-p () + "True if the point is on a character escape of a string. +This is true only if the character is preceded by an odd number of + backslashes. +This assumes that `paredit-in-string-p' has already returned true." + (let ((oddp nil)) + (save-excursion + (while (eq (char-before) ?\\ ) + (setq oddp (not oddp)) + (backward-char))) + oddp)) + +(defun paredit-in-char-p (&optional position) + "True if point is on a character escape outside a string." + (save-excursion + (goto-char (or position (point))) + (paredit-in-string-escape-p))) + +(defun paredit-skip-whitespace (trailing-p &optional limit) + "Skip past any whitespace, or until the point LIMIT is reached. +If TRAILING-P is nil, skip leading whitespace; otherwise, skip trailing + whitespace." + (funcall (if trailing-p 'skip-chars-forward 'skip-chars-backward) + " \t\n " ; This should skip using the syntax table, but LF + limit)) ; is a comment end, not newline, in Lisp mode. + +(defalias 'paredit-region-active-p + (xcond ((paredit-xemacs-p) 'region-active-p) + ((paredit-gnu-emacs-p) + (lambda () + (and mark-active transient-mark-mode))))) + +(defun paredit-hack-kill-region (start end) + "Kill the region between START and END. +Do not append to any current kill, and + do not let the next kill append to this one." + (interactive "r") ;Eh, why not? + ;; KILL-REGION sets THIS-COMMAND to tell the next kill that the last + ;; command was a kill. It also checks LAST-COMMAND to see whether it + ;; should append. If we bind these locally, any modifications to + ;; THIS-COMMAND will be masked, and it will not see LAST-COMMAND to + ;; indicate that it should append. + (let ((this-command nil) + (last-command nil)) + (kill-region start end))) + +;;;;; Reindentation utilities + +;++ Should `paredit-indent-sexps' and `paredit-forward-and-indent' use +;++ `paredit-indent-region' rather than `indent-region'? + +(defun paredit-indent-sexps () + "If in a list, indent all following S-expressions in the list." + (let* ((start (point)) + (end (paredit-handle-sexp-errors (progn (up-list) (point)) nil))) + (if end + (indent-region start end nil)))) + +(defun paredit-forward-and-indent (&optional n) + "Move forward by N S-expressions, indenting them with `indent-region'." + (let ((start (point))) + (forward-sexp n) + (indent-region start (point) nil))) + +(defun paredit-indent-region (start end) + "Indent the region from START to END. +Don't reindent the line starting at START, however." + (if (not (<= start end)) + (error "Incorrectly related points: %S, %S" start end)) + (save-excursion + (goto-char start) + (let ((bol (point-at-bol))) + ;; Skip all S-expressions that end on the starting line, but + ;; don't go past `end'. + (if (and (save-excursion (goto-char end) (not (eq bol (point-at-bol)))) + (paredit-handle-sexp-errors + (catch 'exit + (while t + (save-excursion + (forward-sexp) + (if (not (eq bol (point-at-bol))) + (throw 'exit t)) + (if (not (< (point) end)) + (throw 'exit nil))) + (forward-sexp))) + nil)) + (progn + ;; Point is still on the same line, but precedes an + ;; S-expression that ends on a different line. + (if (not (eq bol (point-at-bol))) + (error "Internal error -- we moved forward a line!")) + (goto-char (+ 1 (point-at-eol))) + (if (not (<= (point) end)) + (error "Internal error -- we frobnitzed the garfnut!")) + (indent-region (point) end nil)))))) + +;;;;; S-expression Parsing Utilities + +;++ These routines redundantly traverse S-expressions a great deal. +;++ If performance issues arise, this whole section will probably have +;++ to be refactored to preserve the state longer, like paredit.scm +;++ does, rather than to traverse the definition N times for every key +;++ stroke as it presently does. + +(defun paredit-current-parse-state () + "Return parse state of point from beginning of defun." + (let ((point (point))) + (beginning-of-defun) + ;; Calling PARSE-PARTIAL-SEXP will advance the point to its second + ;; argument (unless parsing stops due to an error, but we assume it + ;; won't in paredit-mode). + (parse-partial-sexp (point) point))) + +(defun paredit-in-string-p (&optional state) + "True if the parse state is within a double-quote-delimited string. +If no parse state is supplied, compute one from the beginning of the + defun to the point." + ;; 3. non-nil if inside a string (the terminator character, really) + (and (nth 3 (or state (paredit-current-parse-state))) + t)) + +(defun paredit-string-start+end-points (&optional state) + "Return a cons of the points of open and close quotes of the string. +The string is determined from the parse state STATE, or the parse state + from the beginning of the defun to the point. +This assumes that `paredit-in-string-p' has already returned true, i.e. + that the point is already within a string." + (save-excursion + ;; 8. character address of start of comment or string; nil if not + ;; in one + (let ((start (nth 8 (or state (paredit-current-parse-state))))) + (goto-char start) + (forward-sexp 1) + (cons start (1- (point)))))) + +(defun paredit-enclosing-string-start () + (car (paredit-string-start+end-points))) + +(defun paredit-enclosing-string-end () + (+ 1 (cdr (paredit-string-start+end-points)))) + +(defun paredit-enclosing-list-start () + (save-excursion + (backward-up-list) + (point))) + +(defun paredit-enclosing-list-end () + (save-excursion + (up-list) + (point))) + +(defun paredit-in-comment-p (&optional state) + "True if parse state STATE is within a comment. +If no parse state is supplied, compute one from the beginning of the + defun to the point." + ;; 4. nil if outside a comment, t if inside a non-nestable comment, + ;; else an integer (the current comment nesting) + (and (nth 4 (or state (paredit-current-parse-state))) + t)) + +(defun paredit-prefix-numeric-value (argument) + ;++ Kludgerific. + (cond ((integerp argument) argument) + ((eq argument '-) -1) + ((consp argument) + (cond ((equal argument '(4)) (paredit-count-sexps-forward)) ;C-u + ((equal argument '(16)) (paredit-count-sexps-backward)) ;C-u C-u + (t (error "Invalid prefix argument: %S" argument)))) + ((paredit-region-active-p) + (save-excursion + (save-restriction + (narrow-to-region (region-beginning) (region-end)) + (cond ((= (point) (point-min)) (paredit-count-sexps-forward)) + ((= (point) (point-max)) (paredit-count-sexps-backward)) + (t + (error "Point %S is not start or end of region: %S..%S" + (point) (region-beginning) (region-end))))))) + (t 1))) + +(defun paredit-count-sexps-forward () + (save-excursion + (let ((n 0) (p nil)) ;hurk + (paredit-ignore-sexp-errors + (while (setq p (scan-sexps (point) +1)) + (goto-char p) + (setq n (+ n 1)))) + n))) + +(defun paredit-count-sexps-backward () + (save-excursion + (let ((n 0) (p nil)) ;hurk + (paredit-ignore-sexp-errors + (while (setq p (scan-sexps (point) -1)) + (goto-char p) + (setq n (+ n 1)))) + n))) + +(defun paredit-point-at-sexp-boundary (n) + (cond ((< n 0) (paredit-point-at-sexp-start)) + ((= n 0) (point)) + ((> n 0) (paredit-point-at-sexp-end)))) + +(defun paredit-point-at-sexp-start () + (save-excursion + (forward-sexp) + (backward-sexp) + (point))) + +(defun paredit-point-at-sexp-end () + (save-excursion + (backward-sexp) + (forward-sexp) + (point))) + +(defun paredit-lose-if-not-in-sexp (command) + (if (or (paredit-in-string-p) + (paredit-in-comment-p) + (paredit-in-char-p)) + (error "Invalid context for command `%s'." command))) + +(defun paredit-check-region (start end) + "Signal an error if text between `start' and `end' is unbalanced." + ;; `narrow-to-region' will move the point, so avoid calling it if we + ;; don't need to. We don't want to use `save-excursion' because we + ;; want the point to move if `check-parens' reports an error. + (if (not (paredit-region-ok-p start end)) + (save-restriction + (narrow-to-region start end) + (check-parens)))) + +(defun paredit-region-ok-p (start end) + "Return true iff the region between `start' and `end' is balanced. +This is independent of context -- it doesn't check what state the + text at `start' is in." + (save-excursion + (paredit-handle-sexp-errors + (progn + (save-restriction + (narrow-to-region start end) + (scan-sexps (point-min) (point-max))) + t) + nil))) + +(defun paredit-current-indentation () + (save-excursion + (back-to-indentation) + (current-column))) + +(defun paredit-restore-column (column indentation) + ;; Preserve the point's position either in the indentation or in the + ;; code: if on code, move with the code; if in indentation, leave it + ;; in the indentation, either where it was (if still on indentation) + ;; or at the end of the indentation (if the code moved far enough + ;; left). + (let ((indentation* (paredit-current-indentation))) + (goto-char + (+ (point-at-bol) + (cond ((not (< column indentation)) + (+ column (- indentation* indentation))) + ((<= indentation* column) indentation*) + (t column)))))) + +;;;; Initialization + +(paredit-define-keys) +(paredit-annotate-mode-with-examples) +(paredit-annotate-functions-with-examples) + +(provide 'paredit) + +;;; Local Variables: +;;; outline-regexp: " \n;;;;+" +;;; End: + +;;; paredit.el ends here diff --git a/elpa/paredit-20171127.205/paredit.elc b/elpa/paredit-20171127.205/paredit.elc new file mode 100644 index 0000000..d7a26a9 Binary files /dev/null and b/elpa/paredit-20171127.205/paredit.elc differ diff --git a/elpa/paredit-menu-20160128.1733/paredit-menu-autoloads.el b/elpa/paredit-menu-20160128.1733/paredit-menu-autoloads.el new file mode 100644 index 0000000..e294a59 --- /dev/null +++ b/elpa/paredit-menu-20160128.1733/paredit-menu-autoloads.el @@ -0,0 +1,15 @@ +;;; paredit-menu-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil nil ("paredit-menu.el") (23391 65293 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; paredit-menu-autoloads.el ends here diff --git a/elpa/paredit-menu-20160128.1733/paredit-menu-pkg.el b/elpa/paredit-menu-20160128.1733/paredit-menu-pkg.el new file mode 100644 index 0000000..ef6bc64 --- /dev/null +++ b/elpa/paredit-menu-20160128.1733/paredit-menu-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "paredit-menu" "20160128.1733" "Adds a menu to paredit.el as memory aid" '((paredit "25")) :commit "cc0ae85bd819f9ebfa4f2a419ab3b2d70e39c9c8" :keywords '("paredit") :authors '(("Phillip Lord" . "phillip.lord@newcastle.ac.uk")) :maintainer '("Phillip Lord" . "phillip.lord@newcastle.ac.uk")) diff --git a/elpa/paredit-menu-20160128.1733/paredit-menu.el b/elpa/paredit-menu-20160128.1733/paredit-menu.el new file mode 100644 index 0000000..f585d6d --- /dev/null +++ b/elpa/paredit-menu-20160128.1733/paredit-menu.el @@ -0,0 +1,126 @@ +;;; paredit-menu.el --- Adds a menu to paredit.el as memory aid + +;; This file is not part of Emacs + +;; Author: Phillip Lord +;; Maintainer: Phillip Lord +;; Keywords: paredit +;; Package-Version: 20160128.1733 +;; Version: 1.0 +;; Package-Requires: ((paredit "25")) + +;; COPYRIGHT NOTICE +;; +;; 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 2, 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; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: +;; +;; Paredit mode provides structured editing for Lisp. It achieves this by +;; ensuring that code is always well-formed while editing. While it is very +;; helpful, sometimes it leaves the less experienced user (such as the myself) +;; scratching their head over how to achieve a simple editing task. + +;; One solution is to use the cheatsheet +;; (http://emacswiki.org/emacs/PareditCheatsheet). However, this is outside +;; Emacs and does not scale well. This file provides a second solution, which +;; is a menu. While slower than using the equivalent key-presses, it provides +;; an easy mechanism to look up the relevant commands. Tooltips are also +;; provided showing the examples of use. + +;; Documentation and examples come directly from paredit, so the menu should +;; automatically stay in sync, regardless of changes to paredit. + +;;; Installation: +;; +;; Add (require 'paredit-menu) to your .emacs. This will also force loading of +;; paredit. If you autoload paredit, then +;; +;; (eval-after-load "paredit.el" +;; '(require 'paredit-menu)) +;; +;; will achieve the same effect. + + +(require 'paredit) + +;;; Code: + +(defun paredit-menu-build-menu () + "Builds the menu from `paredit-commands'." + (cons "Paredit" + (paredit-menu-build-menu-1 paredit-commands nil nil))) + +(defun paredit-menu-build-menu-1 (commands menu submenu) + "Really builds the menu. + +COMMANDS is the list of commands remaining to add +MENU is the current menu +SUBMENU is the current submenu" + (let ((first (car commands)) + (rest (cdr commands))) + ;; drop last submenu in place and complete + (if (not first) + (append menu (list submenu)) + ;; is a submenu title + (if (stringp first) + ;; start a new submenu + (paredit-menu-build-menu-1 + rest + ;; appending the last submenu if it exists + (if submenu + (append menu (list submenu)) + menu) + (list first)) + ;; we have a command + (paredit-menu-build-menu-1 + rest menu + (append submenu + (list (vector (paredit-menu-symbol-name + (symbol-name (nth 1 first))) + (nth 1 first) + :help (paredit-menu-help-string first))))))))) + + +(defun paredit-menu-symbol-name (name) + "Generate display name from symbol name. + +No point putting \"paredit\" on the front of everything, so chop +this off. + +NAME is the symbol name." + (substring name 8)) + +(defun paredit-menu-help-string (command) + "Generate help string for command. + +COMMAND is the command" + (let ((string + (mapconcat + (lambda (x) + (format "%s -> \n\t%s" (nth 0 x) (nth 1 x)) + ) + (cddr command) "\n\n"))) + (if (eq "" string) + "No Example" + string))) + + +(easy-menu-define menubar-paredit paredit-mode-map "paredit" + (paredit-menu-build-menu)) + +(provide 'paredit-menu) + +;;; paredit-menu.el ends here diff --git a/elpa/paredit-menu-20160128.1733/paredit-menu.elc b/elpa/paredit-menu-20160128.1733/paredit-menu.elc new file mode 100644 index 0000000..7e42069 Binary files /dev/null and b/elpa/paredit-menu-20160128.1733/paredit-menu.elc differ diff --git a/elpa/peg-20150707.2341/peg-pkg.el b/elpa/peg-20150707.2341/peg-pkg.el deleted file mode 100644 index e2d7d47..0000000 --- a/elpa/peg-20150707.2341/peg-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "peg" "20150707.2341" "Parsing Expression Grammars in Emacs Lisp" 'nil :commit "081efeca91d790c7fbc90871ac22c40935f4833b") diff --git a/elpa/peg-20150707.2341/peg-autoloads.el b/elpa/peg-20150708.641/peg-autoloads.el similarity index 84% rename from elpa/peg-20150707.2341/peg-autoloads.el rename to elpa/peg-20150708.641/peg-autoloads.el index 50b7916..0ee8687 100644 --- a/elpa/peg-20150707.2341/peg-autoloads.el +++ b/elpa/peg-20150708.641/peg-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil nil ("peg.el") (22993 41350 0 0)) +;;;### (autoloads nil nil ("peg.el") (23392 2169 0 0)) ;;;*** diff --git a/elpa/peg-20150708.641/peg-pkg.el b/elpa/peg-20150708.641/peg-pkg.el new file mode 100644 index 0000000..7841070 --- /dev/null +++ b/elpa/peg-20150708.641/peg-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "peg" "20150708.641" "Parsing Expression Grammars in Emacs Lisp" 'nil :commit "081efeca91d790c7fbc90871ac22c40935f4833b") diff --git a/elpa/peg-20150707.2341/peg.el b/elpa/peg-20150708.641/peg.el similarity index 99% rename from elpa/peg-20150707.2341/peg.el rename to elpa/peg-20150708.641/peg.el index 9539f66..86f8f60 100644 --- a/elpa/peg-20150707.2341/peg.el +++ b/elpa/peg-20150708.641/peg.el @@ -3,7 +3,7 @@ ;; Copyright 2008 Helmut Eller . ;; ;; Version: 0.6 (2009-Nov-04) -;; Package-Version: 20150707.2341 +;; Package-Version: 20150708.641 ;; ;; 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 diff --git a/elpa/peg-20150707.2341/peg.elc b/elpa/peg-20150708.641/peg.elc similarity index 100% rename from elpa/peg-20150707.2341/peg.elc rename to elpa/peg-20150708.641/peg.elc diff --git a/elpa/pkg-info-20150517.1143/pkg-info-autoloads.el b/elpa/pkg-info-20150517.1143/pkg-info-autoloads.el new file mode 100644 index 0000000..a023704 --- /dev/null +++ b/elpa/pkg-info-20150517.1143/pkg-info-autoloads.el @@ -0,0 +1,121 @@ +;;; pkg-info-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "pkg-info" "pkg-info.el" (23391 65291 0 0)) +;;; Generated autoloads from pkg-info.el + +(autoload 'pkg-info-library-original-version "pkg-info" "\ +Get the original version in the header of LIBRARY. + +The original version is stored in the X-Original-Version header. +This header is added by the MELPA package archive to preserve +upstream version numbers. + +LIBRARY is either a symbol denoting a named feature, or a library +name as string. + +If SHOW is non-nil, show the version in the minibuffer. + +Return the version from the header of LIBRARY as list. Signal an +error if the LIBRARY was not found or had no X-Original-Version +header. + +See Info node `(elisp)Library Headers' for more information +about library headers. + +\(fn LIBRARY &optional SHOW)" t nil) + +(autoload 'pkg-info-library-version "pkg-info" "\ +Get the version in the header of LIBRARY. + +LIBRARY is either a symbol denoting a named feature, or a library +name as string. + +If SHOW is non-nil, show the version in the minibuffer. + +Return the version from the header of LIBRARY as list. Signal an +error if the LIBRARY was not found or had no proper header. + +See Info node `(elisp)Library Headers' for more information +about library headers. + +\(fn LIBRARY &optional SHOW)" t nil) + +(autoload 'pkg-info-defining-library-original-version "pkg-info" "\ +Get the original version of the library defining FUNCTION. + +The original version is stored in the X-Original-Version header. +This header is added by the MELPA package archive to preserve +upstream version numbers. + +If SHOW is non-nil, show the version in mini-buffer. + +This function is mainly intended to find the version of a major +or minor mode, i.e. + + (pkg-info-defining-library-version 'flycheck-mode) + +Return the version of the library defining FUNCTION. Signal an +error if FUNCTION is not a valid function, if its defining +library was not found, or if the library had no proper version +header. + +\(fn FUNCTION &optional SHOW)" t nil) + +(autoload 'pkg-info-defining-library-version "pkg-info" "\ +Get the version of the library defining FUNCTION. + +If SHOW is non-nil, show the version in mini-buffer. + +This function is mainly intended to find the version of a major +or minor mode, i.e. + + (pkg-info-defining-library-version 'flycheck-mode) + +Return the version of the library defining FUNCTION. Signal an +error if FUNCTION is not a valid function, if its defining +library was not found, or if the library had no proper version +header. + +\(fn FUNCTION &optional SHOW)" t nil) + +(autoload 'pkg-info-package-version "pkg-info" "\ +Get the version of an installed PACKAGE. + +If SHOW is non-nil, show the version in the minibuffer. + +Return the version as list, or nil if PACKAGE is not installed. + +\(fn PACKAGE &optional SHOW)" t nil) + +(autoload 'pkg-info-version-info "pkg-info" "\ +Obtain complete version info for LIBRARY and PACKAGE. + +LIBRARY is a symbol denoting a named feature, or a library name +as string. PACKAGE is a symbol denoting an ELPA package. If +omitted or nil, default to LIBRARY. + +If SHOW is non-nil, show the version in the minibuffer. + +When called interactively, prompt for LIBRARY. When called +interactively with prefix argument, prompt for PACKAGE as well. + +Return a string with complete version information for LIBRARY. +This version information contains the version from the headers of +LIBRARY, and the version of the installed PACKAGE, the LIBRARY is +part of. If PACKAGE is not installed, or if the PACKAGE version +is the same as the LIBRARY version, do not include a package +version. + +\(fn LIBRARY &optional PACKAGE SHOW)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; pkg-info-autoloads.el ends here diff --git a/elpa/pkg-info-20150517.1143/pkg-info-pkg.el b/elpa/pkg-info-20150517.1143/pkg-info-pkg.el new file mode 100644 index 0000000..d4b90e1 --- /dev/null +++ b/elpa/pkg-info-20150517.1143/pkg-info-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "pkg-info" "20150517.1143" "Information about packages" '((epl "0.8")) :commit "76ba7415480687d05a4353b27fea2ae02b8d9d61" :keywords '("convenience") :authors '(("Sebastian Wiesner" . "swiesner@lunaryorn.com")) :maintainer '("Sebastian Wiesner" . "swiesner@lunaryorn.com") :url "https://github.com/lunaryorn/pkg-info.el") diff --git a/elpa/pkg-info-20150517.1143/pkg-info.el b/elpa/pkg-info-20150517.1143/pkg-info.el new file mode 100644 index 0000000..e6a03a1 --- /dev/null +++ b/elpa/pkg-info-20150517.1143/pkg-info.el @@ -0,0 +1,331 @@ +;;; pkg-info.el --- Information about packages -*- lexical-binding: t; -*- + +;; Copyright (C) 2013-2015 Sebastian Wiesner + +;; Author: Sebastian Wiesner +;; URL: https://github.com/lunaryorn/pkg-info.el +;; Package-Version: 20150517.1143 +;; Keywords: convenience +;; Version: 0.7-cvs +;; Package-Requires: ((epl "0.8")) + +;; 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. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This library extracts information from installed packages. + +;;;; Functions: + +;; `pkg-info-library-version' extracts the version from the header of a library. +;; +;; `pkg-info-defining-library-version' extracts the version from the header of a +;; library defining a function. +;; +;; `pkg-info-package-version' gets the version of an installed package. +;; +;; `pkg-info-format-version' formats a version list as human readable string. +;; +;; `pkg-info-version-info' returns complete version information for a specific +;; package. +;; +;; `pkg-info-get-melpa-recipe' gets the MELPA recipe for a package. +;; +;; `pkg-info-get-melpa-fetcher' gets the fetcher used to build a package on +;; MELPA. +;; +;; `pkg-info-wiki-package-p' determines whether a package was build from +;; EmacsWiki on MELPA. + +;;; Code: + +(require 'epl) + +(require 'lisp-mnt) +(require 'find-func) +(require 'json) ; `json-read' +(require 'url-http) ; `url-http-parse-response' + +(defvar url-http-end-of-headers) + + +;;; Version information +(defun pkg-info-format-version (version) + "Format VERSION as human-readable string. + +Return a human-readable string representing VERSION." + ;; XXX: Find a better, more flexible way of formatting? + (package-version-join version)) + +(defsubst pkg-info--show-version-and-return (version show) + "Show and return VERSION. + +When SHOW is non-nil, show VERSION in minibuffer. + +Return VERSION." + (when show + (message (if (listp version) (pkg-info-format-version version) version))) + version) + +(defun pkg-info--read-library () + "Read a library from minibuffer." + (completing-read "Load library: " + (apply-partially 'locate-file-completion-table + load-path + (get-load-suffixes)))) + +(defun pkg-info--read-function () + "Read a function name from minibuffer." + (let ((input (completing-read "Function: " obarray #'boundp :require-match))) + (if (string= input "") nil (intern input)))) + +(defun pkg-info--read-package () + "Read a package name from minibuffer." + (let* ((installed (epl-installed-packages)) + (names (sort (mapcar (lambda (pkg) + (symbol-name (epl-package-name pkg))) + installed) + #'string<)) + (default (car names))) + (completing-read "Installed package: " names nil 'require-match + nil nil default))) + +(defun pkg-info-library-source (library) + "Get the source file of LIBRARY. + +LIBRARY is either a symbol denoting a named feature, or a library +name as string. + +Return the source file of LIBRARY as string." + (find-library-name (if (symbolp library) (symbol-name library) library))) + +(defun pkg-info-defining-library (function) + "Get the source file of the library defining FUNCTION. + +FUNCTION is a function symbol. + +Return the file name of the library as string. Signal an error +if the library does not exist, or if the definition of FUNCTION +was not found." + (unless (functionp function) + (signal 'wrong-type-argument (list 'functionp function))) + (let ((library (symbol-file function 'defun))) + (unless library + (error "Can't find definition of %s" function)) + library)) + +(defun pkg-info-x-original-version (file) + "Read the X-Original-Version header from FILE. + +Return the value as version list, or return nil if FILE lacks +this header. Signal an error, if the value of the header is not +a valid version." + (let ((version-str (with-temp-buffer + (insert-file-contents file) + (lm-header "X-Original-Version")))) + (when version-str + (version-to-list version-str)))) + +;;;###autoload +(defun pkg-info-library-original-version (library &optional show) + "Get the original version in the header of LIBRARY. + +The original version is stored in the X-Original-Version header. +This header is added by the MELPA package archive to preserve +upstream version numbers. + +LIBRARY is either a symbol denoting a named feature, or a library +name as string. + +If SHOW is non-nil, show the version in the minibuffer. + +Return the version from the header of LIBRARY as list. Signal an +error if the LIBRARY was not found or had no X-Original-Version +header. + +See Info node `(elisp)Library Headers' for more information +about library headers." + (interactive (list (pkg-info--read-library) t)) + (let ((version (pkg-info-x-original-version + (pkg-info-library-source library)))) + (if version + (pkg-info--show-version-and-return version show) + (error "Library %s has no original version" library)))) + +;;;###autoload +(defun pkg-info-library-version (library &optional show) + "Get the version in the header of LIBRARY. + +LIBRARY is either a symbol denoting a named feature, or a library +name as string. + +If SHOW is non-nil, show the version in the minibuffer. + +Return the version from the header of LIBRARY as list. Signal an +error if the LIBRARY was not found or had no proper header. + +See Info node `(elisp)Library Headers' for more information +about library headers." + (interactive (list (pkg-info--read-library) t)) + (let* ((source (pkg-info-library-source library)) + (version (epl-package-version (epl-package-from-file source)))) + (pkg-info--show-version-and-return version show))) + +;;;###autoload +(defun pkg-info-defining-library-original-version (function &optional show) + "Get the original version of the library defining FUNCTION. + +The original version is stored in the X-Original-Version header. +This header is added by the MELPA package archive to preserve +upstream version numbers. + +If SHOW is non-nil, show the version in mini-buffer. + +This function is mainly intended to find the version of a major +or minor mode, i.e. + + (pkg-info-defining-library-version 'flycheck-mode) + +Return the version of the library defining FUNCTION. Signal an +error if FUNCTION is not a valid function, if its defining +library was not found, or if the library had no proper version +header." + (interactive (list (pkg-info--read-function) t)) + (pkg-info-library-original-version (pkg-info-defining-library function) show)) + +;;;###autoload +(defun pkg-info-defining-library-version (function &optional show) + "Get the version of the library defining FUNCTION. + +If SHOW is non-nil, show the version in mini-buffer. + +This function is mainly intended to find the version of a major +or minor mode, i.e. + + (pkg-info-defining-library-version 'flycheck-mode) + +Return the version of the library defining FUNCTION. Signal an +error if FUNCTION is not a valid function, if its defining +library was not found, or if the library had no proper version +header." + (interactive (list (pkg-info--read-function) t)) + (pkg-info-library-version (pkg-info-defining-library function) show)) + +;;;###autoload +(defun pkg-info-package-version (package &optional show) + "Get the version of an installed PACKAGE. + +If SHOW is non-nil, show the version in the minibuffer. + +Return the version as list, or nil if PACKAGE is not installed." + (interactive (list (pkg-info--read-package) t)) + (let* ((name (if (stringp package) (intern package) package)) + (package (car (epl-find-installed-packages name)))) + (unless package + (error "Can't find installed package %s" name)) + (pkg-info--show-version-and-return (epl-package-version package) show))) + +;;;###autoload +(defun pkg-info-version-info (library &optional package show) + "Obtain complete version info for LIBRARY and PACKAGE. + +LIBRARY is a symbol denoting a named feature, or a library name +as string. PACKAGE is a symbol denoting an ELPA package. If +omitted or nil, default to LIBRARY. + +If SHOW is non-nil, show the version in the minibuffer. + +When called interactively, prompt for LIBRARY. When called +interactively with prefix argument, prompt for PACKAGE as well. + +Return a string with complete version information for LIBRARY. +This version information contains the version from the headers of +LIBRARY, and the version of the installed PACKAGE, the LIBRARY is +part of. If PACKAGE is not installed, or if the PACKAGE version +is the same as the LIBRARY version, do not include a package +version." + (interactive (list (pkg-info--read-library) + (when current-prefix-arg + (pkg-info--read-package)) + t)) + (let* ((package (or package (if (stringp library) (intern library) library))) + (orig-version (condition-case nil + (pkg-info-library-original-version library) + (error nil))) + ;; If we have X-Original-Version, we assume that MELPA replaced the + ;; library version with its generated version, so we use the + ;; X-Original-Version header instead, and ignore the library version + ;; header + (lib-version (or orig-version (pkg-info-library-version library))) + (pkg-version (condition-case nil + (pkg-info-package-version package) + (error nil))) + (version (if (and pkg-version + (not (version-list-= lib-version pkg-version))) + (format "%s (package: %s)" + (pkg-info-format-version lib-version) + (pkg-info-format-version pkg-version)) + (pkg-info-format-version lib-version)))) + (pkg-info--show-version-and-return version show))) + +(defconst pkg-info-melpa-recipe-url "http://melpa.org/recipes.json" + "The URL from which to fetch MELPA recipes.") + +(defvar pkg-info-melpa-recipes nil + "An alist of MELPA recipes.") + +(defun pkg-info-retrieve-melpa-recipes () + "Retrieve MELPA recipes from MELPA archive." + (let ((buffer (url-retrieve-synchronously pkg-info-melpa-recipe-url))) + (with-current-buffer buffer + (unwind-protect + (let ((response-code (url-http-parse-response))) + (unless (equal response-code 200) + (error "Failed to retrieve MELPA recipes from %s (code %s)" + pkg-info-melpa-recipe-url response-code)) + (goto-char url-http-end-of-headers) + (json-read)) + (when (and buffer (buffer-live-p buffer)) + (kill-buffer buffer)))))) + +(defun pkg-info-get-melpa-recipes () + "Get MELPA recipes." + (setq pkg-info-melpa-recipes + (or pkg-info-melpa-recipes + (pkg-info-retrieve-melpa-recipes)))) + +(defun pkg-info-get-melpa-recipe (package) + "Get the MELPA recipe for PACKAGE. + +Return nil if PACKAGE is not on MELPA." + (cdr (assq package (pkg-info-get-melpa-recipes)))) + +(defun pkg-info-get-melpa-fetcher (package) + "Get the MELPA fetcher for PACKAGE." + (cdr (assq 'fetcher (pkg-info-get-melpa-recipe package)))) + +(defun pkg-info-wiki-package-p (package) + "Determine whether PACKAGE is build from the EmacsWiki." + (equal (pkg-info-get-melpa-fetcher package) "wiki")) + +(provide 'pkg-info) + +;; Local Variables: +;; indent-tabs-mode: nil +;; coding: utf-8 +;; End: + +;;; pkg-info.el ends here diff --git a/elpa/pkg-info-20150517.1143/pkg-info.elc b/elpa/pkg-info-20150517.1143/pkg-info.elc new file mode 100644 index 0000000..ba375af Binary files /dev/null and b/elpa/pkg-info-20150517.1143/pkg-info.elc differ diff --git a/elpa/poporg-20170403.751/poporg-autoloads.el b/elpa/poporg-20170403.751/poporg-autoloads.el new file mode 100644 index 0000000..6a03318 --- /dev/null +++ b/elpa/poporg-20170403.751/poporg-autoloads.el @@ -0,0 +1,47 @@ +;;; poporg-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "poporg" "poporg.el" (23391 65290 0 0)) +;;; Generated autoloads from poporg.el + +(autoload 'poporg-dwim "poporg" "\ +Single overall command for poporg (a single keybinding may do it all). + +If the current buffer is an edit buffer, run `poporg-edit-exit'. + +If the region is active, edit it in an empty buffer. Otherwise, find a nearby +string or comment using `poporg-find-string-or-comment' and edit that in an +empty buffer. If there is an active edit nearby, pop to its other buffer and +edit that instead. + +\(fn)" t nil) + +(autoload 'poporg-update "poporg" "\ +Update the contents of the original buffer. + +If prefix argument WITH-SAVE is non-nil, save the original buffer too. + +Also update the overlay. + +\(fn WITH-SAVE)" t nil) + +(autoload 'poporg-update-and-save "poporg" "\ +Update and save the original buffer; update the region. + +\(fn)" t nil) + +(autoload 'poporg-edit-exit "poporg" "\ +Exit the edit buffer, replacing the original region. + +\(fn)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; poporg-autoloads.el ends here diff --git a/elpa/poporg-20170403.751/poporg-pkg.el b/elpa/poporg-20170403.751/poporg-pkg.el new file mode 100644 index 0000000..cf8f1ac --- /dev/null +++ b/elpa/poporg-20170403.751/poporg-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "poporg" "20170403.751" "Pop a comment or string to an empty buffer for text editing" 'nil :commit "2c58d68c81ecca4140bf179f19ed153ec804b65a" :keywords '("outlines" "tools") :authors '(("François Pinard" . "pinard@iro.umontreal.ca") ("Joseph Rabinoff" . "rabinoff@post.harvard.edu")) :maintainer '("Joseph Rabinoff" . "rabinoff@post.harvard.edu") :url "https://github.com/QBobWatson/poporg") diff --git a/elpa/poporg-20170403.751/poporg.el b/elpa/poporg-20170403.751/poporg.el new file mode 100644 index 0000000..a97d108 --- /dev/null +++ b/elpa/poporg-20170403.751/poporg.el @@ -0,0 +1,825 @@ +;;; poporg.el --- Pop a comment or string to an empty buffer for text editing + +;; Copyright © 2014 Joseph Rabinoff. +;; Copyright © 2013 Ubity inc. + +;; Author: François Pinard +;; Joseph Rabinoff +;; Maintainer: Joseph Rabinoff +;; Keywords: outlines, tools +;; Package-Version: 20170403.751 +;; URL: https://github.com/QBobWatson/poporg + +;; 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 . + +;;; Commentary: + +;; poporg is a small Emacs Lisp project to help editing program strings and +;; comments using Org mode (or any other major mode). This can be useful as it +;; is often more convenient to edit large pieces of text, like Emacs Lisp or +;; Python docstrings, in an org-mode buffer instead of in a comment or a string. + +;; See the README.org file located at https://github.com/QBobWatson/poporg for +;; detailed usage information. + +;;; Code: + +(eval-when-compile + (require 'cl)) + +;; * Customs +;; ** Group + +(defgroup poporg nil + "Edit strings and comments in text buffers." + :prefix "poporg-" + :group 'lisp) + +;; ** defcustom's + +(defcustom poporg-adjust-fill-column t + "Whether to adjust the fill column in the edit buffer. + +If non-nil, in the edit buffer decrement `fill-column' by the prefix length." + :group 'poporg + :type 'boolean) + +(defcustom poporg-delete-trailing-whitespace t + "Whether to delete trailing whitespace from the prefix. + +If t, when inserting a blank line from the edit buffer back into the source +buffer, remove trailing whitespace from the prefix. This is very useful when +editing docstrings in python, for instance. If equal to the symbol 'all, don't +insert the prefix at all for blank lines." + :group 'poporg + :type '(choice + (const :tag "Do not delete trailing whitespace" nil) + (const :tag "Delete trailing whitespace" t) + (const :tag "Delete the entire prefix" all))) + +(defcustom poporg-buffer-name "*poporg: %s*" + "Template for poporg buffer names. + +The tag %s is replaced by the original buffer name." + :group 'poporg + :type 'string) + +(defcustom poporg-comment-skip-regexp "[[:space:]*]*" + "Ignore these additional characters at the beginning of a commented line. + +Characters not matched by this regexp will not be included in the common prefix +for comments. This is matched after `comment-start'. By default this matches +whitespace and the * character; the latter is useful in C-style comments. This +should not match newlines." + :group 'poporg + :type 'regexp) + +(defcustom poporg-edit-hook '(org-mode) + "List of hooks to run once a new editing buffer has been filled. + +In the absence of any hooks here, the poporg editing buffer is in +`fundamental-mode', so you should probably use this hook to set the major mode. +By default this hook enables `org-mode'." + :group 'poporg + :type 'hook) + +(defcustom poporg-edit-exit-hook nil + "List of hooks to run prior to moving back an editing buffer." + :group 'poporg + :type 'hook) + +(defvar poporg-mode-map + (let ((map (make-sparse-keymap))) + (define-key map [remap save-buffer] 'poporg-edit-exit) + (define-key map (kbd "C-c C-c") 'poporg-update) + (define-key map (kbd "C-c C-s") 'poporg-update-and-save) + map) + "Keys used in `poporg-mode' buffers.") + +;; ** Face + +(defface poporg-edited-face + '((((class color) (background light)) + (:foreground "gray")) + (((class color) (background dark)) + (:foreground "gray"))) + "Face for a region while it is being edited." + :group 'poporg) + +;; * Internal variables + +(defvar poporg-data nil + "List of (BUFFER OVERLAY PREFIX TYPE) lists. + +For each edit BUFFER, there is an OVERLAY graying out the edited block comment +or string in the original buffer, and a PREFIX that was removed from all lines +in the edit buffer and which is going to be prepended to these lines before +returning them the original buffer. TYPE is either 'string, 'comment, or +'region.") + +(defvar poporg-orig-point nil + "Keeps track of the value of point in the calling buffer. +Dynamically bound variable.") + +(defvar poporg-new-point nil + "Keeps track of the value of point in the new buffer. +Dynamically bound variable.") + +(defvar poporg-pre-window-configuration nil + "Variable to store the original window configuration.") + +;; * Functions + +;; ** utility + +(defun poporg-chomp (str) + "Chomp leading and trailing whitespace from STR." + (while (string-match + "\\`\n+\\|^\\s-+\\|\\s-+$\\|\n+\\'" + str) + (setq str (replace-match "" t t str))) + str) + +(defun poporg-chomp-end (str) + "Chomp trailing whitespace from STR." + (while (string-match "\\s-+$\\|\n+\\'" str) + (setq str (replace-match "" t t str))) + str) + +(defun poporg-check-already-edited (beg end) + "Check if there is an already edited region overlapping BEG to END. +If yes, pop the editing buffer for the first one and return t." + (let ((overlays (overlays-in beg end))) + (catch 'found + (while overlays + (let ((entry (overlay-get (pop overlays) 'poporg-overlay))) + (when entry + (pop-to-buffer (car entry)) + (throw 'found entry)))) + nil))) + +(defun poporg-make-buffer () + "Make a poporg buffer." + (generate-new-buffer (format poporg-buffer-name (buffer-name)))) + +(defun poporg-fc (arg) + "Like `forward-char' on ARG but won't throw an error." + (condition-case nil (forward-char arg) (error nil))) + +(defun poporg-orig-buffer () + "If this is an edit buffer, find the originating buffer." + (let* ((entry (assq (current-buffer) poporg-data)) + (overlay (cadr entry))) + (when overlay (overlay-buffer overlay)))) + +;; *** skip past comments + +(defun poporg-skip-past-comment-start () + "Skip whitespace, `comment-start', and comment syntax chars." + (skip-syntax-forward " ") + (let ((com-start (if comment-start (poporg-chomp comment-start) ""))) + (when (looking-at (regexp-quote com-start)) + (goto-char (match-end 0)))) + (skip-syntax-forward "<")) + +(defun poporg-skip-past-comment-end () + "Skip whitespace and `comment-end'." + (skip-syntax-forward " ") + (let ((com-end (if comment-end (poporg-chomp comment-end) ""))) + (when (looking-at (regexp-quote com-end)) + (goto-char (match-end 0))))) + +;; *** check whitespace + +(defun poporg-whitespace-before-p (pos) + "Return t if there is only whitespace before POS on its line." + (save-excursion + (goto-char pos) + (forward-line 0) + (skip-syntax-forward " ") + (equal pos (if (markerp pos) (point-marker) (point))))) + +(defun poporg-whitespace-after-p (pos) + "Return t if there is only whitespace after POS on its line." + (save-excursion + (goto-char pos) + (skip-syntax-forward " ") + (eolp))) + +;; ** find and insert + +;; *** insert into other buffer + +(defun poporg-insert-substring (buf start end) + "Call `insert-buffer-substring-no-properties' on BUF START END. + +Keep track of where the point is using `poporg-orig-point' +and `poporg-new-point'." + (let ((starting (point))) + (insert-buffer-substring-no-properties buf start end) + (cond + ((>= poporg-orig-point end) + (setq poporg-new-point (point))) + ((>= poporg-orig-point start) + (setq poporg-new-point (+ starting (- poporg-orig-point start))))))) + +(defun poporg-insert-without-prefix (buf prefix start end) + "Insert lines into BUF after removing PREFIX. + +Start at START in current buffer and end at END. On lines that do not start +with prefix, or contain only whitespace after the prefix, just insert a +newline. Respects the value of `poporg-delete-trailing-whitespace'." + (let ((prefix-re (regexp-quote prefix)) + (cur-buf (current-buffer))) + (save-excursion + (goto-char start) + (while (< (point) end) + (if (looking-at prefix-re) + (progn + (goto-char (match-end 0)) + (if (and poporg-delete-trailing-whitespace + (poporg-whitespace-after-p (point))) + (with-current-buffer buf (insert "\n")) ; uninteresting + ;; interesting + (let ((s (point)) + (e (save-excursion (forward-line 1) (point)))) + (with-current-buffer buf + (poporg-insert-substring cur-buf s e))))) + ;; uninteresting + (with-current-buffer buf (insert "\n"))) + (forward-line 1))))) + +(defun poporg-insert-with-prefix (buf start end prefix &optional no-first) + "Use the contents of BUF to replace the region from START to END. + +Prepend PREFIX onto each line. If NO-FIRST is non-nil, do not prepend PREFIX +onto the first line. Delete trailing whitespace from blank lines if +`poporg-delete-trailing-whitespace' is set." + (delete-region start end) + (goto-char start) + (let ((cur-buf (current-buffer)) + (prefix-no-ws (poporg-chomp-end prefix))) + (with-current-buffer buf + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (let* ((s (point)) + (char-at (char-after s)) + e) + (forward-line 1) + (setq e (point)) + (with-current-buffer cur-buf + (if no-first + (setq no-first nil) + (if (and poporg-delete-trailing-whitespace + (or (null char-at) (= char-at ?\n))) + ;; strip whitespace from prefix for blank lines + (unless (eq poporg-delete-trailing-whitespace 'all) + (insert prefix-no-ws)) + (insert prefix))) + (poporg-insert-substring buf s e)))))))) + +;; *** find string or comment + +(defun poporg-find-string-or-comment () + "Return the start and end positions of the nearest string or comment. + +If the point is in a string or comment, this returns the extents of the current +string or comment. If the point is immediately before (resp. after) a string +or comment, returns the extents of the following (resp. preceding) string or +comment. This function uses the current buffer's syntax tables for its +searches. + +If a string or comment was found, return a list + + (TYPE START END) + +where TYPE is either 'string or 'comment and START and END are markers. The +enclosed region includes the delimiters. + +If a comment was found, the region between START and END is a number of complete +lines (including trailing newlines) containing only comments. This means that +comments not on their own line are ignored. There may also be blank lines in +this region. + +If a string was found, the region from START to END bounds the string with its +delimiters. There will only be whitespace before the start of the string. This +means that a string with non-whitespace before it is ignored. + +If no string or comment was found satisfying the above criteria, return nil." + (save-excursion + (let ((ppss (syntax-ppss)) + (search-start (point))) + (unless (nth 8 ppss) + ;; We're not in a string or comment. Skip past whitespace and search + ;; one character at a time until we are. Sometimes stupidest algorithm + ;; is the most reliable. First search forward. + (skip-syntax-forward " >") + (catch 'foundit + (dotimes (i 10) + (setq ppss (syntax-ppss)) + (when (nth 8 ppss) + (throw 'foundit nil)) + (poporg-fc 1)) + ;; now search backward + (goto-char search-start) + (skip-syntax-backward " >") + (dotimes (i 10) + (setq ppss (syntax-ppss)) + (when (nth 8 ppss) + (throw 'foundit nil)) + (poporg-fc -1)))) + ;; done searching + (let ((in-string (nth 3 ppss)) + (in-comment (nth 4 ppss)) + (start-pos (nth 8 ppss)) + start end) + (when start-pos + ;; in string or comment + (if in-string + (progn + (setq start (set-marker (make-marker) start-pos)) + ;; find end of string + (parse-partial-sexp (point) (buffer-size) + nil nil ppss 'syntax-table) + (setq end (point-marker)) + (when (poporg-whitespace-before-p start) + (list 'string start end))) + (when in-comment ; should be true at this point + (goto-char start-pos) + ;; skip backward over comments and whitespace + (forward-comment (- (buffer-size))) + ;; skip forward to beginning of first comment + (skip-syntax-forward " >") + (if (not (poporg-whitespace-before-p (point))) + (forward-line 1) ; it's not on its own line + (forward-line 0)) + ;; beginning of line of first comment + (setq start (point-marker)) + ;; skip forward over comments and whitespace + (forward-comment (buffer-size)) + ;; skip back to end of last comment + (skip-syntax-backward " >") + (save-excursion (forward-line 1) + (setq end (point-marker))) + (when (and (> end start) + (poporg-whitespace-after-p (point))) + (list 'comment start end))))))))) + +;; *** insert from comment + +(defun poporg-get-comment-lines (buf start end) + "Parse a comment and insert it, with common prefix removed, into BUF. + +START and END are positions as returned by `poporg-find-string-or-comment'. + +At the beginning of every line, ignore whitespace, `comment-end', +`comment-start', comment syntax characters, and `poporg-comment-skip-regexp', in +that order. This is what is used to calculate the common prefix. If there is +anything left, that line is considered interesting. This skips over +uninteresting lines in the beginning and end. For instance, in the C-style +comment: + + /* + * Only this line will be extracted, not the lines above and below. + */ + +The prefix will be \" \" or \" * \", depending on whether +`poporg-comment-skip-regexp' matches the star character. If there are no +interesting lines, extract the second comment line, if there is one; otherwise +use the unique comment line. + +Return a list (START END PREFIX), where START is the beginning of the first +interesting line, END is the end of the last interesting line (including the +newline), and PREFIX is the common prefix of all interesting lines. START and +END are markers." + (let (start2 end2 line-start line-end prefix) + (save-excursion + (goto-char start) + (forward-line 0) + ;; make a list of interesting lines + (while (< (point) end) + (setq line-start (point)) + (poporg-skip-past-comment-end) + (poporg-skip-past-comment-start) + (when (looking-at poporg-comment-skip-regexp) + (goto-char (match-end 0))) + (when (not (eolp)) + ;; this is an interesting line + (setq line-end (save-excursion (forward-line 1) (point))) + ;; update prefix + (let ((beg (buffer-substring-no-properties line-start (point)))) + (if prefix + (setq prefix (or (fill-common-string-prefix beg prefix) "")) + (setq prefix beg))) + (unless start2 (setq start2 line-start)) + (setq end2 line-end)) + (forward-line 1))) + (if prefix + ;; insert interesting lines into buf + (poporg-insert-without-prefix buf prefix start2 end2) + ;; Make a blank buffer; insert over second comment line, or first if there + ;; is none. This way one can compose blank comments. + (save-excursion + (goto-char start) + (forward-line 0) + (setq start2 (point)) + (forward-line 1) + (if (< (point) end) + ;; use the second line + (setq start2 (point)) + (goto-char start2)) + (skip-syntax-forward "^>") + (setq prefix (buffer-substring-no-properties + start2 (point))) + (forward-line 1) + (setq end2 (point)) + (with-current-buffer buf (insert "\n")))) + (list (set-marker (make-marker) start2) + (set-marker (make-marker) end2) + prefix))) + +(defun poporg-insert-comment-lines (buf start end prefix overlay) + "Insert the contents of BUF as comments in the current buffer. + +Replace the region from START to END and prepend PREFIX onto each line. Append +a trailing newline if necessary. Uses `poporg-insert-with-prefix' to do the +work. Move OVERLAY to the newly-inserted region." + (poporg-insert-with-prefix buf start end prefix) + ;; For our purposes, comments always comprise entire lines, so insert a + ;; trailing newline if necessary. + (when (with-current-buffer buf + (save-excursion + (goto-char (point-max)) + (and (char-before) (not (= (char-before) ?\n))))) + (insert "\n")) + (move-overlay overlay start (point))) + +;; *** insert from string + +(defun poporg-get-string-lines (buf start end) + "Parse a string and insert it, with common indentation removed, into BUF. + +START and END are positions as returned by `poporg-find-string-or-comment'. + +This function does not insert the start and end string delimiters. Lines that +are not composed entirely of whitespace count toward determining the +indentation. The indentation of the first line is the indentation before the +opening string delimiter. + +This function refuses to edit empty strings, since there is no reliable way to +decide which are the starting and ending delimiters if there is nothing between +them. + +Return (START END PREFIX) as in `poporg-get-comment-lines'. The returned values +of START and END agree with the passed arguments. (They are included so that +this function has the same usage as `poporg-get-comment-lines')." + (let* ((beg-last-line (save-excursion + (goto-char end) (forward-line 0) (point))) + (end-last-line (save-excursion + (goto-char end) (skip-syntax-backward "\"|") (point))) + (one-line-p (<= beg-last-line start)) + (cur-buf (current-buffer)) + prefix line-start start2) + (when (<= end-last-line start) + (user-error "Refusing to edit empty string")) + (save-excursion + (goto-char start) + ;; starting prefix is whitespace before opening delimiter + (setq prefix (buffer-substring-no-properties + (save-excursion (forward-line 0) (point)) start)) + (forward-line 1) + ;; loop over lines with no delimiters + (while (< (point) beg-last-line) + (setq line-start (point)) + (skip-syntax-forward " ") + (unless (eolp) + (setq prefix (or (fill-common-string-prefix + (buffer-substring-no-properties + line-start (point)) + prefix) + ""))) + (forward-line 1)) + (unless one-line-p + ;; handle last line + (setq line-start (point)) + (skip-syntax-forward " ") + (setq prefix (or (fill-common-string-prefix + (buffer-substring-no-properties + line-start (point)) + prefix) "")))) + ;; insert into buf + (save-excursion + (goto-char start) + (skip-syntax-forward "\"|") + (setq start2 (point)) + (if one-line-p + (with-current-buffer buf + (poporg-insert-substring cur-buf start2 end-last-line)) + (forward-line 1) + (let ((end2 (point))) + (with-current-buffer buf + (poporg-insert-substring cur-buf start2 end2))) + (poporg-insert-without-prefix buf prefix (point) beg-last-line) + (goto-char beg-last-line) + ;; the last line by definition starts with prefix + (forward-char (length prefix)) + (setq start2 (point)) + (with-current-buffer buf + (poporg-insert-substring cur-buf start2 end-last-line)))) + (list (set-marker (make-marker) start) + (set-marker (make-marker) end) + prefix))) + +(defun poporg-insert-string-lines (buf start end prefix overlay) + "Insert the contents of BUF into a string in the current buffer. + +Replace the string between START and END and prepend PREFIX onto each interior +line. Skip delimiters on both sides. Uses `poporg-insert-with-prefix' to do +the work. Move OVERLAY to the newly-inserted region." + (let ((start-mark (set-marker (make-marker) start)) + (end-mark (set-marker (make-marker) end))) + (save-excursion + (goto-char start) + (skip-syntax-forward "\"|") + (setq start (point))) + (save-excursion + (goto-char end) + (skip-syntax-backward "\"|") + (setq end (point))) + (poporg-insert-with-prefix buf start end prefix 'no-first-line) + ;; if the buffer is terminated by a newline, need to prepend the prefix before + ;; the closing delimiter + (when (with-current-buffer buf + (save-excursion + (goto-char (point-max)) + (= (char-before) ?\n))) + (insert prefix)) + (move-overlay overlay + (marker-position start-mark) + (marker-position end-mark)))) + +;; *** insert from region + +(defun poporg-get-region-lines (buf start end) + "Insert lines into BUF between START and END with common prefix removed. + +This narrows the buffer before doing any parsing. The common prefix is +calculated naively, as the literal common prefixes of all lines in the region +\(after narrowing). + +Return (START END PREFIX) as in `poporg-get-comment-lines'. The returned START +and END are the same as the passed arguments." + (save-restriction + (narrow-to-region start end) + (save-excursion + (goto-char (point-min)) + (let (line-start prefix) + (while (< (point) (point-max)) + (setq line-start (point)) + (skip-syntax-forward " ") + (unless (eolp) + ;; use the whole line to determine prefix + (let ((line (buffer-substring-no-properties + line-start + (save-excursion (skip-chars-forward "^\n") + (point))))) + (if prefix + (setq prefix (or (fill-common-string-prefix line prefix) + "")) + (setq prefix line)))) + (forward-line 1)) + (unless prefix (setq prefix "")) + (poporg-insert-without-prefix buf prefix (point-min) (point-max)) + (list (set-marker (make-marker) start) + (set-marker (make-marker) end) + prefix))))) + +(defun poporg-insert-region-lines (buf start end prefix overlay) + "Insert the contents of BUF into the current buffer. + +Replace the region between START and END and prepend PREFIX onto each line. +This simply runs `poporg-insert-with-prefix'. Move OVERLAY to the +newly-inserted region." + ;; don't have to do anything special + (poporg-insert-with-prefix buf start end prefix) + (move-overlay overlay start (point))) + +;; ** make text mode buffer + +(defun poporg-edit-thing (start end type) + "Edit the region from START to END in an empty buffer. + +Use the function `poporg-get-TYPE-lines' associated to TYPE to extract the +region. Install the protection overlay on the extracted region. If there is an +active editing overlay overlapping the region from START to END, pop to its edit +buffer instead." + (unless (poporg-check-already-edited start end) + (let* ((edit-buffer (poporg-make-buffer)) + (f-c fill-column) + (poporg-orig-point (point)) + (poporg-new-point 1) + (inserter (intern (concat "poporg-get-" (symbol-name type) "-lines"))) + (reg (funcall inserter edit-buffer start end)) + (start (nth 0 reg)) + (end (nth 1 reg)) + (prefix (nth 2 reg)) + (overlay (make-overlay start end))) + (setq poporg-pre-window-configuration (current-window-configuration)) + ;; Dim and protect the original text. + (overlay-put overlay 'face 'poporg-edited-face) + (overlay-put overlay 'intangible t) + (overlay-put overlay 'read-only t) + ;; Initialize a popup edit buffer. + (pop-to-buffer edit-buffer) + (goto-char poporg-new-point) + ;; Don't allow undoing the initial buffer insertions. + (buffer-disable-undo) + (buffer-enable-undo) + ;; Save buffer contents to a temporary file so the undo command knows + ;; whether the contents have modified or not. This could potentially have + ;; other uses later on. + (let ((buf-name (buffer-name))) + (set-visited-file-name (make-temp-file "poporg-")) + (rename-buffer buf-name t)) + (let ((require-final-newline nil)) (save-buffer)) + ;; This is mainly to hide the `save-buffer' message + (message + (substitute-command-keys + "poporg: type \\\\[poporg-edit-exit] when done")) + ;;(set-buffer-modified-p nil) + ;; Save data and possibly activate hooks. + (unless poporg-data + (push 'poporg-kill-buffer-query kill-buffer-query-functions) + (add-hook 'kill-buffer-hook 'poporg-kill-buffer-routine)) + (push (list edit-buffer overlay prefix type) poporg-data) + (overlay-put overlay 'poporg-overlay (car poporg-data)) + ;; All set up for editing. + (with-demoted-errors "Edit hook error: %S" (run-hooks 'poporg-edit-hook)) + (poporg-mode +1) + ;; Adjust fill column after running the hooks and setting the mode since + ;; org-mode sets the fill column. + (when poporg-adjust-fill-column + (setq fill-column (max 0 (- f-c (length prefix)))))))) + +;; ** buffer kill hook functions + +(defun poporg-kill-buffer-query () + "Warn when killing an edit buffer or a source buffer with active edit buffers." + (let ((entry (assq (current-buffer) poporg-data))) + (if entry + (or (not (buffer-modified-p)) + (yes-or-no-p "Really abandon this edit? ")) + (let ((data poporg-data) + (value t)) + (while data + (let ((buffer (overlay-buffer (cadar data)))) + (if (not (eq buffer (current-buffer))) + (setq data (cdr data)) + (pop-to-buffer (caar data)) + (message "First, either complete or kill this edit.") + (setq data nil + value nil)))) + value)))) + +(defun poporg-kill-buffer-routine () + "Cleanup an edit buffer whenever killed." + ;; Delete the temporary file + (let ((entry (assq (current-buffer) poporg-data))) + (when entry + (let* ((overlay (cadr entry)) + (buffer (overlay-buffer overlay))) + (when buffer + (ignore-errors (set-buffer-modified-p nil) + (delete-file (buffer-file-name))) + (delete-overlay overlay) + (setq poporg-data (delq entry poporg-data)) + (unless poporg-data + (setq kill-buffer-query-functions + (delq 'poporg-kill-buffer-query kill-buffer-query-functions)) + (remove-hook 'kill-buffer-hook 'poporg-kill-buffer-routine)) + ;; switch back if we're killing the buffer in the selected window + (when (equal (current-buffer) (window-buffer)) + (unless (one-window-p) (delete-window)) + (switch-to-buffer buffer))))))) + +;; * Commands + +;;;###autoload +(defun poporg-dwim () + "Single overall command for poporg (a single keybinding may do it all). + +If the current buffer is an edit buffer, run `poporg-edit-exit'. + +If the region is active, edit it in an empty buffer. Otherwise, find a nearby +string or comment using `poporg-find-string-or-comment' and edit that in an +empty buffer. If there is an active edit nearby, pop to its other buffer and +edit that instead." + (interactive) + (let ((inhibit-point-motion-hooks t)) + (cond + ((assq (current-buffer) poporg-data) (poporg-edit-exit)) + ((use-region-p) + (poporg-edit-thing (region-beginning) (region-end) 'region)) + (t + (let ((reg (poporg-find-string-or-comment))) + (cond + ((eq (car reg) 'string) + (poporg-edit-thing (nth 1 reg) (nth 2 reg) 'string)) + ((eq (car reg) 'comment) + (poporg-edit-thing (nth 1 reg) (nth 2 reg) 'comment)) + (t + (user-error "Nothing to edit!")))))))) + +;;;###autoload +(defun poporg-update (with-save) + "Update the contents of the original buffer. + +If prefix argument WITH-SAVE is non-nil, save the original buffer too. + +Also update the overlay." + (interactive "P") + (let* ((edit-buffer (current-buffer)) + (entry (assq edit-buffer poporg-data)) + (overlay (cadr entry)) + (buffer (when overlay (overlay-buffer overlay))) + (prefix (caddr entry)) + (type (nth 3 entry)) + (poporg-orig-point (point)) + (inserter (intern (concat "poporg-insert-" + (symbol-name type) "-lines")))) + (unless buffer + (error "Not an edit buffer or original buffer vanished")) + (when (buffer-modified-p) + ;; Move everything back in place. + ;; Allow the inserter to edit the region. + (overlay-put overlay 'intangible nil) + (overlay-put overlay 'read-only nil) + (let* ((start (overlay-start overlay)) + (end (overlay-end overlay))) + (with-current-buffer buffer + ;; This updates the overlay + (funcall inserter edit-buffer start end prefix overlay)) + ;; This is only used to mark the buffer as saved at this tamestamp, so + ;; undo knows at what stage the buffer is unmodified + (let ((require-final-newline nil)) (save-buffer)) + ;; This is manily to hide the `save-buffer' message + (message "poporg: original buffer updated")) + (overlay-put overlay 'intangible t) + (overlay-put overlay 'read-only t)) + (with-current-buffer buffer (undo-boundary)) + (when with-save (with-current-buffer buffer (save-buffer))))) + +;;;###autoload +(defun poporg-update-and-save () + "Update and save the original buffer; update the region." + (interactive) + (poporg-update t)) + +;;;###autoload +(defun poporg-edit-exit () + "Exit the edit buffer, replacing the original region." + (interactive) + (let* ((edit-buffer (current-buffer)) + (entry (assq edit-buffer poporg-data)) + (overlay (cadr entry)) + (buffer (when overlay (overlay-buffer overlay))) + poporg-new-point) + (unless buffer + (error "Not an edit buffer or original buffer vanished")) + (poporg-update nil) + (with-demoted-errors "Edit hook error: %S" + (run-hooks 'poporg-edit-exit-hook)) + ;; Killing the buffer triggers a cleanup through the kill hook. + (kill-buffer edit-buffer) + (set-window-configuration poporg-pre-window-configuration) + (with-current-buffer buffer + (let ((inhibit-point-motion-hooks t)) + (when poporg-new-point ; unset if unmodified or aborted + (goto-char poporg-new-point)))))) + +;; ** mode + +(define-minor-mode poporg-mode + "Install keybindings for a poporg edit buffer." + nil " pop" poporg-mode-map) + + +(provide 'poporg) + +;; Local Variables: +;; coding: utf-8 +;; End: + +;;; poporg.el ends here diff --git a/elpa/poporg-20170403.751/poporg.elc b/elpa/poporg-20170403.751/poporg.elc new file mode 100644 index 0000000..3958f04 Binary files /dev/null and b/elpa/poporg-20170403.751/poporg.elc differ diff --git a/elpa/popup-20160709.1429/popup-autoloads.el b/elpa/popup-20160709.1429/popup-autoloads.el new file mode 100644 index 0000000..62a7f05 --- /dev/null +++ b/elpa/popup-20160709.1429/popup-autoloads.el @@ -0,0 +1,15 @@ +;;; popup-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil nil ("popup.el") (23391 65288 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; popup-autoloads.el ends here diff --git a/elpa/popup-20160709.1429/popup-pkg.el b/elpa/popup-20160709.1429/popup-pkg.el new file mode 100644 index 0000000..f2c937f --- /dev/null +++ b/elpa/popup-20160709.1429/popup-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "popup" "20160709.1429" "Visual Popup User Interface" '((cl-lib "0.5")) :commit "80829dd46381754639fb764da11c67235fe63282" :keywords '("lisp") :authors '(("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) :maintainer '("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) diff --git a/elpa/popup-20160709.1429/popup.el b/elpa/popup-20160709.1429/popup.el new file mode 100644 index 0000000..f112cba --- /dev/null +++ b/elpa/popup-20160709.1429/popup.el @@ -0,0 +1,1432 @@ +;;; popup.el --- Visual Popup User Interface + +;; Copyright (C) 2009-2015 Tomohiro Matsuyama + +;; Author: Tomohiro Matsuyama +;; Keywords: lisp +;; Package-Version: 20160709.1429 +;; Version: 0.5.3 +;; Package-Requires: ((cl-lib "0.5")) + +;; 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 . + +;;; Commentary: + +;; popup.el is a visual popup user interface library for Emacs. This +;; provides a basic API and common UI widgets such as popup tooltips +;; and popup menus. +;; See README.markdown for more information. + +;;; Code: + +(require 'cl-lib) + +(defconst popup-version "0.5.3") + + + +;;; Utilities + +(defun popup-calculate-max-width (max-width) + "Determines whether the width desired is +character or window proportion based, And returns the result." + (cl-typecase max-width + (integer max-width) + (float (* (ceiling (/ (round (* max-width (window-width))) 10.0)) 10)))) + +(defvar popup-use-optimized-column-computation t + "Use the optimized column computation routine. +If there is a problem, please set it nil.") + +(defmacro popup-aif (test then &rest else) + "Anaphoric if." + (declare (indent 2)) + `(let ((it ,test)) + (if it ,then ,@else))) + +(defmacro popup-awhen (test &rest body) + "Anaphoric when." + (declare (indent 1)) + `(let ((it ,test)) + (when it ,@body))) + +(defun popup-x-to-string (x) + "Convert any object to string effeciently. +This is faster than `prin1-to-string' in many cases." + (cl-typecase x + (string x) + (symbol (symbol-name x)) + (integer (number-to-string x)) + (float (number-to-string x)) + (t (format "%s" x)))) + +(defun popup-substring-by-width (string width) + "Return a cons cell of substring and remaining string by +splitting with WIDTH." + ;; Expand tabs into 4 spaces + (setq string (replace-regexp-in-string "\t" " " string)) + (cl-loop with len = (length string) + with w = 0 + for l from 0 + for c in (append string nil) + while (<= (cl-incf w (char-width c)) width) + finally return + (if (< l len) + (cons (substring string 0 l) (substring string l)) + (list string)))) + +(defun popup-fill-string (string &optional width max-width justify squeeze) + "Split STRING into fixed width strings and return a cons cell +like \(WIDTH . ROWS). Here, the car WIDTH indicates the actual +maxim width of ROWS. + +The argument WIDTH specifies the width of filling each +paragraph. WIDTH nil means don't perform any justification and +word wrap. Note that this function doesn't add any padding +characters at the end of each row. + +MAX-WIDTH, if WIDTH is nil, specifies the maximum number of +columns. + +The optional fourth argument JUSTIFY specifies which kind of +justification to do: `full', `left', `right', `center', or +`none' (equivalent to nil). A value of t means handle each +paragraph as specified by its text properties. + +SQUEEZE nil means leave whitespaces other than line breaks +untouched." + (if (eq width 0) + (error "Can't fill string with 0 width")) + (if width + (setq max-width width)) + (with-temp-buffer + (let ((tab-width 4) + (fill-column width) + (left-margin 0) + (kinsoku-limit 1) + indent-tabs-mode + row rows) + (insert string) + (untabify (point-min) (point-max)) + (if width + (fill-region (point-min) (point-max) justify (not squeeze))) + (goto-char (point-min)) + (setq width 0) + (while (prog2 + (let ((line (buffer-substring + (point) (progn (end-of-line) (point))))) + (if max-width + (while (progn + (setq row (truncate-string-to-width line max-width) + width (max width (string-width row))) + (push row rows) + (if (not (= (length row) (length line))) + (setq line (substring line (length row)))))) + (setq width (max width (string-width line))) + (push line rows))) + (< (point) (point-max)) + (beginning-of-line 2))) + (cons width (nreverse rows))))) + +(defmacro popup-save-buffer-state (&rest body) + (declare (indent 0)) + `(save-excursion + (let ((buffer-undo-list t) + (inhibit-read-only t) + (modified (buffer-modified-p))) + (unwind-protect + (progn ,@body) + (set-buffer-modified-p modified))))) + +(defun popup-vertical-motion (column direction) + "A portable version of `vertical-motion'." + (if (>= emacs-major-version 23) + (vertical-motion (cons column direction)) + (vertical-motion direction) + (move-to-column (+ (current-column) column)))) + +(defun popup-last-line-of-buffer-p () + "Return non-nil if the cursor is at the last line of the +buffer." + (save-excursion (end-of-line) (/= (forward-line) 0))) + +(defun popup-lookup-key-by-event (function event) + (or (funcall function (vector event)) + (if (symbolp event) + (popup-aif (get event 'event-symbol-element-mask) + (funcall function + (vector (logior (or (get (car it) 'ascii-character) + 0) + (cadr it)))))))) + + + +;;; Core + +(defgroup popup nil + "Visual Popup User Interface" + :group 'lisp + :prefix "popup-") + +(defface popup-face + '((t (:inherit default :background "lightgray" :foreground "black"))) + "Face for popup." + :group 'popup) + +(defface popup-summary-face + '((t (:inherit popup-face :foreground "dimgray"))) + "Face for popup summary." + :group 'popup) + +(defface popup-scroll-bar-foreground-face + '((t (:background "black"))) + "Foreground face for scroll-bar." + :group 'popup) + +(defface popup-scroll-bar-background-face + '((t (:background "gray"))) + "Background face for scroll-bar." + :group 'popup) + +(defvar popup-instances nil + "Popup instances.") + +(defvar popup-scroll-bar-foreground-char + (propertize " " 'face 'popup-scroll-bar-foreground-face) + "Foreground character for scroll-bar.") + +(defvar popup-scroll-bar-background-char + (propertize " " 'face 'popup-scroll-bar-background-face) + "Background character for scroll-bar.") + +(cl-defstruct popup + point row column width height min-height direction overlays keymap + parent depth + face mouse-face selection-face summary-face + margin-left margin-right margin-left-cancel scroll-bar symbol + cursor offset scroll-top current-height list newlines + pattern original-list invis-overlays) + +(defun popup-item-propertize (item &rest properties) + "Same as `propertize' except that this avoids overriding +existed value with `nil' property." + (cl-loop for (k v) on properties by 'cddr + if v append (list k v) into props + finally return + (apply 'propertize + (popup-x-to-string item) + props))) + +(defun popup-item-property (item property) + "Same as `get-text-property' except that this returns nil if +ITEM is not string." + (if (stringp item) + (get-text-property 0 property item))) + +(cl-defun popup-make-item (name + &key + value + face + mouse-face + selection-face + sublist + document + symbol + summary) + "Utility function to make popup item. See also +`popup-item-propertize'." + (popup-item-propertize name + 'value value + 'popup-face face + 'popup-mouse-face mouse-face + 'selection-face selection-face + 'document document + 'symbol symbol + 'summary summary + 'sublist sublist)) + +(defsubst popup-item-value (item) (popup-item-property item 'value)) +(defsubst popup-item-value-or-self (item) (or (popup-item-value item) item)) +(defsubst popup-item-face (item) (popup-item-property item 'popup-face)) +(defsubst popup-item-mouse-face (item) (popup-item-property item 'popup-mouse-face)) +(defsubst popup-item-selection-face (item) (popup-item-property item 'selection-face)) +(defsubst popup-item-document (item) (popup-item-property item 'document)) +(defsubst popup-item-summary (item) (popup-item-property item 'summary)) +(defsubst popup-item-symbol (item) (popup-item-property item 'symbol)) +(defsubst popup-item-sublist (item) (popup-item-property item 'sublist)) + +(defun popup-item-documentation (item) + (let ((doc (popup-item-document item))) + (if (functionp doc) + (setq doc (funcall doc (popup-item-value-or-self item)))) + doc)) + +(defun popup-item-show-help-1 (item) + (let ((doc (popup-item-documentation item))) + (when doc + (with-current-buffer (get-buffer-create " *Popup Help*") + (erase-buffer) + (insert doc) + (goto-char (point-min)) + (display-buffer (current-buffer))) + t))) + +(defun popup-item-show-help-with-event-loop (item) + (save-window-excursion + (when (popup-item-show-help-1 item) + (cl-loop do (clear-this-command-keys) + for key = (read-key-sequence-vector nil) + do + (cl-case (key-binding key) + (scroll-other-window + (scroll-other-window)) + (scroll-other-window-down + (scroll-other-window-down nil)) + (otherwise + (setq unread-command-events (append key unread-command-events)) + (cl-return))))))) + +(defun popup-item-show-help (item &optional persist) + "Display the documentation of ITEM with `display-buffer'. If +PERSIST is nil, the documentation buffer will be closed +automatically, meaning interal event loop ensures the buffer to +be closed. Otherwise, the buffer will be just displayed as +usual." + (when item + (if (not persist) + (popup-item-show-help-with-event-loop item) + (popup-item-show-help-1 item)))) + +(defun popup-set-list (popup list) + (popup-set-filtered-list popup list) + (setf (popup-pattern popup) nil) + (setf (popup-original-list popup) list)) + +(defun popup-set-filtered-list (popup list) + (let ((offset + (if (> (popup-direction popup) 0) + 0 + (max (- (popup-height popup) (length list)) 0)))) + (setf (popup-list popup) list + (popup-offset popup) offset))) + +(defun popup-selected-item (popup) + (nth (popup-cursor popup) (popup-list popup))) + +(defun popup-selected-line (popup) + (- (popup-cursor popup) (popup-scroll-top popup))) + +(defun popup-line-overlay (popup line) + (aref (popup-overlays popup) line)) + +(defun popup-selected-line-overlay (popup) + (popup-line-overlay popup (popup-selected-line popup))) + +(defun popup-hide-line (popup line) + (let ((overlay (popup-line-overlay popup line))) + (overlay-put overlay 'display nil) + (overlay-put overlay 'after-string nil))) + +(defun popup-line-hidden-p (popup line) + (let ((overlay (popup-line-overlay popup line))) + (and (eq (overlay-get overlay 'display) nil) + (eq (overlay-get overlay 'after-string) nil)))) + +(cl-defun popup-set-line-item (popup + line + &key + item + face + mouse-face + margin-left + margin-right + scroll-bar-char + symbol + summary + summary-face + keymap) + (let* ((overlay (popup-line-overlay popup line)) + (content (popup-create-line-string popup (popup-x-to-string item) + :margin-left margin-left + :margin-right margin-right + :symbol symbol + :summary summary + :summary-face summary-face)) + (start 0) + (prefix (overlay-get overlay 'prefix)) + (postfix (overlay-get overlay 'postfix)) + end) + (put-text-property 0 (length content) 'popup-item item content) + (put-text-property 0 (length content) 'keymap keymap content) + ;; Overlap face properties + (when (get-text-property start 'face content) + (setq start (next-single-property-change start 'face content))) + (while (and start (setq end (next-single-property-change start 'face content))) + (put-text-property start end 'face face content) + (setq start (next-single-property-change end 'face content))) + (when start + (put-text-property start (length content) 'face face content)) + (when mouse-face + (put-text-property 0 (length content) 'mouse-face mouse-face content)) + (let ((prop (if (overlay-get overlay 'dangle) + 'after-string + 'display))) + (overlay-put overlay + prop + (concat prefix + content + scroll-bar-char + postfix))))) + +(cl-defun popup-create-line-string (popup + string + &key + margin-left + margin-right + symbol + summary + summary-face) + (let* ((popup-width (popup-width popup)) + (summary-width (string-width summary)) + (content-width (max + (min popup-width (string-width string)) + (- popup-width + (if (> summary-width 0) + (+ summary-width 2) + 0)))) + (string (car (popup-substring-by-width string content-width))) + (string-width (string-width string)) + (spacing (max (- popup-width string-width summary-width) + (if (> popup-width string-width) 1 0))) + (truncated-summary + (car (popup-substring-by-width + summary (max (- popup-width string-width spacing) 0))))) + (when summary-face + (put-text-property 0 (length truncated-summary) + 'face summary-face truncated-summary)) + (concat margin-left + string + (make-string spacing ? ) + truncated-summary + symbol + margin-right))) + +(defun popup-live-p (popup) + "Return non-nil if POPUP is alive." + (and popup (popup-overlays popup) t)) + +(defun popup-child-point (popup &optional offset) + (overlay-end + (popup-line-overlay + popup + (or offset + (popup-selected-line popup))))) + +(defun popup-calculate-direction (height row) + "Return a proper direction when displaying a popup on this +window. HEIGHT is the a height of the popup, and ROW is a line +number at the point." + (let* ((remaining-rows (- (max 1 (- (window-height) + (if mode-line-format 1 0) + (if header-line-format 1 0))) + (count-lines (window-start) (point)))) + (enough-space-above (> row height)) + (enough-space-below (<= height remaining-rows))) + (if (and enough-space-above + (not enough-space-below)) + -1 + 1))) + +(cl-defun popup-create (point + width + height + &key + min-height + max-width + around + (face 'popup-face) + mouse-face + (selection-face face) + (summary-face 'popup-summary-face) + scroll-bar + margin-left + margin-right + symbol + parent + parent-offset + keymap) + "Create a popup instance at POINT with WIDTH and HEIGHT. + +MIN-HEIGHT is a minimal height of the popup. The default value is +0. + +MAX-WIDTH is the maximum width of the popup. The default value is +nil (no limit). If a floating point, the value refers to the ratio of +the window. If an integer, limit is in characters. + +If AROUND is non-nil, the popup will be displayed around the +point but not at the point. + +FACE is a background face of the popup. The default value is POPUP-FACE. + +SELECTION-FACE is a foreground (selection) face of the popup The +default value is POPUP-FACE. + +If SCROLL-BAR is non-nil, the popup will have a scroll bar at the +right. + +If MARGIN-LEFT is non-nil, the popup will have a margin at the +left. + +If MARGIN-RIGHT is non-nil, the popup will have a margin at the +right. + +SYMBOL is a single character which indicates a kind of the item. + +PARENT is a parent popup instance. If PARENT is omitted, the +popup will be a root instance. + +PARENT-OFFSET is a row offset from the parent popup. + +KEYMAP is a keymap that will be put on the popup contents." + (or margin-left (setq margin-left 0)) + (or margin-right (setq margin-right 0)) + (unless point + (setq point + (if parent (popup-child-point parent parent-offset) (point)))) + (when max-width + (setq width (min width (popup-calculate-max-width max-width)))) + (save-excursion + (goto-char point) + (let* ((col-row (posn-col-row (posn-at-point))) + (row (cdr col-row)) + (column (car col-row)) + (overlays (make-vector height nil)) + (popup-width (+ width + (if scroll-bar 1 0) + margin-left + margin-right + (if symbol 2 0))) + margin-left-cancel + (window (selected-window)) + (window-start (window-start)) + (window-hscroll (window-hscroll)) + (window-width (window-width)) + (right (+ column popup-width)) + (overflow (and (> right window-width) + (>= right popup-width))) + (foldable (and (null parent) + (>= column popup-width))) + (direction (or + ;; Currently the direction of cascade popup won't be changed + (and parent (popup-direction parent)) + + ;; Calculate direction + (popup-calculate-direction height row))) + (depth (if parent (1+ (popup-depth parent)) 0)) + (newlines (max 0 (+ (- height (count-lines point (point-max))) (if around 1 0)))) + invis-overlays + current-column) + ;; Case: no newlines at the end of the buffer + (when (> newlines 0) + (popup-save-buffer-state + (goto-char (point-max)) + (insert (make-string newlines ?\n)))) + + ;; Case: the popup overflows + (if overflow + (if foldable + (progn + (cl-decf column (- popup-width margin-left margin-right)) + (unless around (move-to-column column))) + (when (not truncate-lines) + ;; Truncate. + (let ((d (1+ (- popup-width (- window-width column))))) + (cl-decf popup-width d) + (cl-decf width d))) + (cl-decf column margin-left)) + (cl-decf column margin-left)) + + ;; Case: no space at the left + (when (and (null parent) + (< column 0)) + ;; Cancel margin left + (setq column 0) + (cl-decf popup-width margin-left) + (setq margin-left-cancel t)) + + (dotimes (i height) + (let (overlay begin w (dangle t) (prefix "") (postfix "")) + (when around + (popup-vertical-motion column direction)) + (cl-loop for ov in (overlays-in (save-excursion + (beginning-of-visual-line) + (point)) + (save-excursion + (end-of-visual-line) + (point))) + when (and (not (overlay-get ov 'popup)) + (not (overlay-get ov 'popup-item)) + (or (overlay-get ov 'invisible) + (overlay-get ov 'display))) + do (progn + (push (list ov (overlay-get ov 'display)) invis-overlays) + (overlay-put ov 'display ""))) + (setq around t) + (setq current-column (car (posn-col-row (posn-at-point)))) + + (when (< current-column column) + ;; Extend short buffer lines by popup prefix (line of spaces) + (setq prefix (make-string + (+ (if (= current-column 0) + (- window-hscroll current-column) + 0) + (- column current-column)) + ? ))) + + (setq begin (point)) + (setq w (+ popup-width (length prefix))) + (while (and (not (eolp)) (> w 0)) + (setq dangle nil) + (cl-decf w (char-width (char-after))) + (forward-char)) + (if (< w 0) + (setq postfix (make-string (- w) ? ))) + + (setq overlay (make-overlay begin (point))) + (overlay-put overlay 'popup t) + (overlay-put overlay 'window window) + (overlay-put overlay 'dangle dangle) + (overlay-put overlay 'prefix prefix) + (overlay-put overlay 'postfix postfix) + (overlay-put overlay 'width width) + (aset overlays + (if (> direction 0) i (- height i 1)) + overlay))) + (cl-loop for p from (- 10000 (* depth 1000)) + for overlay in (nreverse (append overlays nil)) + do (overlay-put overlay 'priority p)) + (let ((it (make-popup :point point + :row row + :column column + :width width + :height height + :min-height min-height + :direction direction + :parent parent + :depth depth + :face face + :mouse-face mouse-face + :selection-face selection-face + :summary-face summary-face + :margin-left margin-left + :margin-right margin-right + :margin-left-cancel margin-left-cancel + :scroll-bar scroll-bar + :symbol symbol + :cursor 0 + :offset 0 + :scroll-top 0 + :current-height 0 + :list nil + :newlines newlines + :overlays overlays + :invis-overlays invis-overlays + :keymap keymap))) + (push it popup-instances) + it)))) + +(defun popup-delete (popup) + "Delete POPUP instance." + (when (popup-live-p popup) + (popup-hide popup) + (mapc 'delete-overlay (popup-overlays popup)) + (setf (popup-overlays popup) nil) + (setq popup-instances (delq popup popup-instances)) + ;; Restore newlines state + (let ((newlines (popup-newlines popup))) + (when (> newlines 0) + (popup-save-buffer-state + (goto-char (point-max)) + (dotimes (i newlines) + (if (and (char-before) + (= (char-before) ?\n)) + (delete-char -1))))))) + nil) + +(defun popup-draw (popup) + "Draw POPUP." + (cl-loop for (ov olddisplay) in (popup-invis-overlays popup) + do (overlay-put ov 'display "")) + + (cl-loop with height = (popup-height popup) + with min-height = (popup-min-height popup) + with popup-face = (popup-face popup) + with mouse-face = (popup-mouse-face popup) + with selection-face = (popup-selection-face popup) + with summary-face-0 = (popup-summary-face popup) + with list = (popup-list popup) + with length = (length list) + with thum-size = (max (/ (* height height) (max length 1)) 1) + with page-size = (/ (+ 0.0 (max length 1)) height) + with scroll-bar = (popup-scroll-bar popup) + with margin-left = (make-string (if (popup-margin-left-cancel popup) 0 (popup-margin-left popup)) ? ) + with margin-right = (make-string (popup-margin-right popup) ? ) + with symbol = (popup-symbol popup) + with cursor = (popup-cursor popup) + with scroll-top = (popup-scroll-top popup) + with offset = (popup-offset popup) + with keymap = (popup-keymap popup) + for o from offset + for i from scroll-top + while (< o height) + for item in (nthcdr scroll-top list) + for page-index = (* thum-size (/ o thum-size)) + for face = (if (= i cursor) + (or (popup-item-selection-face item) selection-face) + (or (popup-item-face item) popup-face)) + for summary-face = (unless (= i cursor) summary-face-0) + for empty-char = (propertize " " 'face face) + for scroll-bar-char = (if scroll-bar + (cond + ((and (not (eq scroll-bar :always)) + (<= page-size 1)) + empty-char) + ((and (> page-size 1) + (>= cursor (* page-index page-size)) + (< cursor (* (+ page-index thum-size) page-size))) + popup-scroll-bar-foreground-char) + (t + popup-scroll-bar-background-char)) + "") + for sym = (if symbol + (concat " " (or (popup-item-symbol item) " ")) + "") + for summary = (or (popup-item-summary item) "") + + do + ;; Show line and set item to the line + (popup-set-line-item popup o + :item item + :face face + :mouse-face mouse-face + :margin-left margin-left + :margin-right margin-right + :scroll-bar-char scroll-bar-char + :symbol sym + :summary summary + :summary-face summary-face + :keymap keymap) + + finally + ;; Remember current height + (setf (popup-current-height popup) (- o offset)) + + ;; Hide remaining lines + (let ((scroll-bar-char (if scroll-bar (propertize " " 'face popup-face) "")) + (symbol (if symbol " " ""))) + (if (> (popup-direction popup) 0) + (progn + (when min-height + (while (< o min-height) + (popup-set-line-item popup o + :item "" + :face popup-face + :margin-left margin-left + :margin-right margin-right + :scroll-bar-char scroll-bar-char + :symbol symbol + :summary "") + (cl-incf o))) + (while (< o height) + (popup-hide-line popup o) + (cl-incf o))) + (cl-loop with h = (if min-height (- height min-height) offset) + for o from 0 below offset + if (< o h) + do (popup-hide-line popup o) + if (>= o h) + do (popup-set-line-item popup o + :item "" + :face popup-face + :margin-left margin-left + :margin-right margin-right + :scroll-bar-char scroll-bar-char + :symbol symbol + :summary "")))))) + +(defun popup-hide (popup) + "Hide POPUP." + (cl-loop for (ov olddisplay) in (popup-invis-overlays popup) + do (overlay-put ov 'display olddisplay)) + (dotimes (i (popup-height popup)) + (popup-hide-line popup i))) + +(defun popup-hidden-p (popup) + "Return non-nil if POPUP is hidden." + (let ((hidden t)) + (when (popup-live-p popup) + (dotimes (i (popup-height popup)) + (unless (popup-line-hidden-p popup i) + (setq hidden nil)))) + hidden)) + +(defun popup-jump (popup cursor) + "Jump to a position specified by CURSOR of POPUP and draw." + (let ((scroll-top (popup-scroll-top popup))) + ;; Do not change page as much as possible. + (unless (and (<= scroll-top cursor) + (< cursor (+ scroll-top (popup-height popup)))) + (setf (popup-scroll-top popup) cursor)) + (setf (popup-cursor popup) cursor) + (popup-draw popup))) + +(defun popup-select (popup i) + "Select the item at I of POPUP and draw." + (setq i (+ i (popup-offset popup))) + (when (and (<= 0 i) (< i (popup-height popup))) + (setf (popup-cursor popup) i) + (popup-draw popup) + t)) + +(defun popup-next (popup) + "Select the next item of POPUP and draw." + (let ((height (popup-height popup)) + (cursor (1+ (popup-cursor popup))) + (scroll-top (popup-scroll-top popup)) + (length (length (popup-list popup)))) + (cond + ((>= cursor length) + ;; Back to first page + (setq cursor 0 + scroll-top 0)) + ((= cursor (+ scroll-top height)) + ;; Go to next page + (setq scroll-top (min (1+ scroll-top) (max (- length height) 0))))) + (setf (popup-cursor popup) cursor + (popup-scroll-top popup) scroll-top) + (popup-draw popup))) + +(defun popup-previous (popup) + "Select the previous item of POPUP and draw." + (let ((height (popup-height popup)) + (cursor (1- (popup-cursor popup))) + (scroll-top (popup-scroll-top popup)) + (length (length (popup-list popup)))) + (cond + ((< cursor 0) + ;; Go to last page + (setq cursor (1- length) + scroll-top (max (- length height) 0))) + ((= cursor (1- scroll-top)) + ;; Go to previous page + (cl-decf scroll-top))) + (setf (popup-cursor popup) cursor + (popup-scroll-top popup) scroll-top) + (popup-draw popup))) + +(defun popup-page-next (popup) + "Select next item of POPUP per `popup-height' range. +Pages down through POPUP." + (dotimes (counter (1- (popup-height popup))) + (popup-next popup))) + +(defun popup-page-previous (popup) + "Select previous item of POPUP per `popup-height' range. +Pages up through POPUP." + (dotimes (counter (1- (popup-height popup))) + (popup-previous popup))) + +(defun popup-scroll-down (popup &optional n) + "Scroll down N of POPUP and draw." + (let ((scroll-top (min (+ (popup-scroll-top popup) (or n 1)) + (- (length (popup-list popup)) (popup-height popup))))) + (setf (popup-cursor popup) scroll-top + (popup-scroll-top popup) scroll-top) + (popup-draw popup))) + +(defun popup-scroll-up (popup &optional n) + "Scroll up N of POPUP and draw." + (let ((scroll-top (max (- (popup-scroll-top popup) (or n 1)) + 0))) + (setf (popup-cursor popup) scroll-top + (popup-scroll-top popup) scroll-top) + (popup-draw popup))) + + + +;;; Popup Incremental Search + +(defface popup-isearch-match + '((t (:inherit default :background "sky blue"))) + "Popup isearch match face." + :group 'popup) + +(defvar popup-isearch-cursor-color "blue") + +(defvar popup-isearch-keymap + (let ((map (make-sparse-keymap))) + ;(define-key map "\r" 'popup-isearch-done) + (define-key map "\C-g" 'popup-isearch-cancel) + (define-key map "\C-b" 'popup-isearch-close) + (define-key map [left] 'popup-isearch-close) + (define-key map "\C-h" 'popup-isearch-delete) + (define-key map (kbd "DEL") 'popup-isearch-delete) + (define-key map (kbd "C-y") 'popup-isearch-yank) + map)) + +(defvar popup-menu-show-quick-help-function 'popup-menu-show-quick-help + "Function used for showing quick help by `popup-menu*'.") + +(defcustom popup-isearch-regexp-builder-function #'regexp-quote + "Function used to construct a regexp from a pattern. You may for instance + provide a function that replaces spaces by '.+' if you like helm or ivy style + of completion." + :type 'function) + +(defsubst popup-isearch-char-p (char) + (and (integerp char) + (<= 32 char) + (<= char 126))) + +(defun popup-isearch-filter-list (pattern list) + (cl-loop with regexp = (funcall popup-isearch-regexp-builder-function pattern) + for item in list + do + (unless (stringp item) + (setq item (popup-item-propertize (popup-x-to-string item) + 'value item))) + if (string-match regexp item) + collect + (let ((beg (match-beginning 0)) + (end (match-end 0))) + (alter-text-property 0 (length item) 'face + (lambda (prop) + (unless (eq prop 'popup-isearch-match) + prop)) + item) + (put-text-property beg end + 'face 'popup-isearch-match + item) + item))) + +(defun popup-isearch-prompt (popup pattern) + (format "Pattern: %s" (if (= (length (popup-list popup)) 0) + (propertize pattern 'face 'isearch-fail) + pattern))) + +(defun popup-isearch-update (popup filter pattern &optional callback) + (setf (popup-cursor popup) 0 + (popup-scroll-top popup) 0 + (popup-pattern popup) pattern) + (let ((list (funcall filter pattern (popup-original-list popup)))) + (popup-set-filtered-list popup list) + (if callback + (funcall callback list))) + (popup-draw popup)) + +(cl-defun popup-isearch (popup + &key + (filter 'popup-isearch-filter-list) + (cursor-color popup-isearch-cursor-color) + (keymap popup-isearch-keymap) + callback + help-delay) + "Start isearch on POPUP. This function is synchronized, meaning +event loop waits for quiting of isearch. + +FILTER is function with two argumenst to perform popup items filtering. + +CURSOR-COLOR is a cursor color during isearch. The default value +is `popup-isearch-cursor-color'. + +KEYMAP is a keymap which is used when processing events during +event loop. The default value is `popup-isearch-keymap'. + +CALLBACK is a function taking one argument. `popup-isearch' calls +CALLBACK, if specified, after isearch finished or isearch +canceled. The arguments is whole filtered list of items. + +HELP-DELAY is a delay of displaying helps." + (let ((list (popup-original-list popup)) + (pattern (or (popup-pattern popup) "")) + (old-cursor-color (frame-parameter (selected-frame) 'cursor-color)) + prompt key binding) + (unwind-protect + (cl-block nil + (if cursor-color + (set-cursor-color cursor-color)) + (while t + (setq prompt (popup-isearch-prompt popup pattern)) + (setq key (popup-menu-read-key-sequence keymap prompt help-delay)) + (if (null key) + (unless (funcall popup-menu-show-quick-help-function popup nil :prompt prompt) + (clear-this-command-keys) + (push (read-event prompt) unread-command-events)) + (setq binding (lookup-key keymap key)) + (cond + ((and (stringp key) + (popup-isearch-char-p (aref key 0))) + (setq pattern (concat pattern key))) + ((eq binding 'popup-isearch-done) + (cl-return nil)) + ((eq binding 'popup-isearch-cancel) + (popup-isearch-update popup filter "" callback) + (cl-return t)) + ((eq binding 'popup-isearch-close) + (popup-isearch-update popup filter "" callback) + (setq unread-command-events + (append (listify-key-sequence key) unread-command-events)) + (cl-return nil)) + ((eq binding 'popup-isearch-delete) + (if (> (length pattern) 0) + (setq pattern (substring pattern 0 (1- (length pattern)))))) + ((eq binding 'popup-isearch-yank) + (popup-isearch-update popup filter (car kill-ring) callback) + (cl-return nil)) + (t + (setq unread-command-events + (append (listify-key-sequence key) unread-command-events)) + (cl-return nil))) + (popup-isearch-update popup filter pattern callback)))) + (if old-cursor-color + (set-cursor-color old-cursor-color))))) + + + +;;; Popup Tip + +(defface popup-tip-face + '((t (:background "khaki1" :foreground "black"))) + "Face for popup tip." + :group 'popup) + +(defvar popup-tip-max-width 80) + +(cl-defun popup-tip (string + &key + point + (around t) + width + (height 15) + min-height + max-width + truncate + margin + margin-left + margin-right + scroll-bar + parent + parent-offset + nowait + nostrip + prompt + &aux tip lines) + "Show a tooltip of STRING at POINT. This function is +synchronized unless NOWAIT specified. Almost all arguments are +the same as in `popup-create', except for TRUNCATE, NOWAIT, and +PROMPT. + +If TRUNCATE is non-nil, the tooltip can be truncated. + +If NOWAIT is non-nil, this function immediately returns the +tooltip instance without entering event loop. + +If `NOSTRIP` is non-nil, `STRING` properties are not stripped. + +PROMPT is a prompt string when reading events during event loop." + (if (bufferp string) + (setq string (with-current-buffer string (buffer-string)))) + + (unless nostrip + ;; TODO strip text (mainly face) properties + (setq string (substring-no-properties string))) + + (and (eq margin t) (setq margin 1)) + (or margin-left (setq margin-left margin)) + (or margin-right (setq margin-right margin)) + + (let ((it (popup-fill-string string width popup-tip-max-width))) + (setq width (car it) + lines (cdr it))) + + (setq tip (popup-create point width height + :min-height min-height + :max-width max-width + :around around + :margin-left margin-left + :margin-right margin-right + :scroll-bar scroll-bar + :face 'popup-tip-face + :parent parent + :parent-offset parent-offset)) + + (unwind-protect + (when (> (popup-width tip) 0) ; not to be corrupted + (when (and (not (eq width (popup-width tip))) ; truncated + (not truncate)) + ;; Refill once again to lines be fitted to popup width + (setq width (popup-width tip)) + (setq lines (cdr (popup-fill-string string width width)))) + + (popup-set-list tip lines) + (popup-draw tip) + (if nowait + tip + (clear-this-command-keys) + (push (read-event prompt) unread-command-events) + t)) + (unless nowait + (popup-delete tip)))) + + + +;;; Popup Menu + +(defface popup-menu-face + '((t (:inherit popup-face))) + "Face for popup menu." + :group 'popup) + +(defface popup-menu-mouse-face + '((t (:background "blue" :foreground "white"))) + "Face for popup menu." + :group 'popup) + +(defface popup-menu-selection-face + '((t (:inherit default :background "steelblue" :foreground "white"))) + "Face for popup menu selection." + :group 'popup) + +(defface popup-menu-summary-face + '((t (:inherit popup-summary-face))) + "Face for popup summary." + :group 'popup) + +(defvar popup-menu-show-tip-function 'popup-tip + "Function used for showing tooltip by `popup-menu-show-quick-help'.") + +(defun popup-menu-show-help (menu &optional persist item) + (popup-item-show-help (or item (popup-selected-item menu)) persist)) + +(defun popup-menu-documentation (menu &optional item) + (popup-item-documentation (or item (popup-selected-item menu)))) + +(defun popup-menu-show-quick-help (menu &optional item &rest args) + (let* ((point (plist-get args :point)) + (height (or (plist-get args :height) (popup-height menu))) + (min-height (min height (popup-current-height menu))) + (around nil) + (parent-offset (popup-offset menu)) + (doc (popup-menu-documentation menu item))) + (when (stringp doc) + (if (popup-hidden-p menu) + (setq around t + menu nil + parent-offset nil) + (setq point nil)) + (let ((popup-use-optimized-column-computation nil)) ; To avoid wrong positioning + (apply popup-menu-show-tip-function + doc + :point point + :height height + :min-height min-height + :around around + :parent menu + :parent-offset parent-offset + args))))) + +(defun popup-menu-item-of-mouse-event (event) + (when (and (consp event) + (memq (cl-first event) '(mouse-1 mouse-2 mouse-3 mouse-4 mouse-5))) + (let* ((position (cl-second event)) + (object (elt position 4))) + (when (consp object) + (get-text-property (cdr object) 'popup-item (car object)))))) + +(defun popup-menu-read-key-sequence (keymap &optional prompt timeout) + (catch 'timeout + (let ((timer (and timeout + (run-with-timer timeout nil + (lambda () + (if (zerop (length (this-command-keys))) + (throw 'timeout nil)))))) + (old-global-map (current-global-map)) + (temp-global-map (make-sparse-keymap)) + (overriding-terminal-local-map (make-sparse-keymap))) + (substitute-key-definition 'keyboard-quit 'keyboard-quit + temp-global-map old-global-map) + (define-key temp-global-map [menu-bar] (lookup-key old-global-map [menu-bar])) + (define-key temp-global-map [tool-bar] (lookup-key old-global-map [tool-bar])) + (set-keymap-parent overriding-terminal-local-map keymap) + (if (current-local-map) + (define-key overriding-terminal-local-map [menu-bar] + (lookup-key (current-local-map) [menu-bar]))) + (unwind-protect + (progn + (use-global-map temp-global-map) + (clear-this-command-keys) + (with-temp-message prompt + (read-key-sequence nil))) + (use-global-map old-global-map) + (if timer (cancel-timer timer)))))) + +(defun popup-menu-fallback (event default)) + +(cl-defun popup-menu-event-loop (menu + keymap + fallback + &key + prompt + help-delay + isearch + isearch-filter + isearch-cursor-color + isearch-keymap + isearch-callback + &aux key binding) + (cl-block nil + (while (popup-live-p menu) + (and isearch + (popup-isearch menu + :filter isearch-filter + :cursor-color isearch-cursor-color + :keymap isearch-keymap + :callback isearch-callback + :help-delay help-delay) + (keyboard-quit)) + (setq key (popup-menu-read-key-sequence keymap prompt help-delay)) + (setq binding (and key (lookup-key keymap key))) + (cond + ((or (null key) (zerop (length key))) + (unless (funcall popup-menu-show-quick-help-function menu nil :prompt prompt) + (clear-this-command-keys) + (push (read-event prompt) unread-command-events))) + ((eq (lookup-key (current-global-map) key) 'keyboard-quit) + (keyboard-quit) + (cl-return)) + ((eq binding 'popup-close) + (if (popup-parent menu) + (cl-return))) + ((memq binding '(popup-select popup-open)) + (let* ((item (or (popup-menu-item-of-mouse-event (elt key 0)) + (popup-selected-item menu))) + (index (cl-position item (popup-list menu))) + (sublist (popup-item-sublist item))) + (unless index (cl-return)) + (if sublist + (popup-aif (let (popup-use-optimized-column-computation) + (popup-cascade-menu sublist + :around nil + :margin-left (popup-margin-left menu) + :margin-right (popup-margin-right menu) + :scroll-bar (popup-scroll-bar menu) + :parent menu + :parent-offset index + :help-delay help-delay + :isearch isearch + :isearch-filter isearch-filter + :isearch-cursor-color isearch-cursor-color + :isearch-keymap isearch-keymap + :isearch-callback isearch-callback)) + (and it (cl-return it))) + (if (eq binding 'popup-select) + (cl-return (popup-item-value-or-self item)))))) + ((eq binding 'popup-next) + (popup-next menu)) + ((eq binding 'popup-previous) + (popup-previous menu)) + ((eq binding 'popup-page-next) + (popup-page-next menu)) + ((eq binding 'popup-page-previous) + (popup-page-previous menu)) + ((eq binding 'popup-help) + (popup-menu-show-help menu)) + ((eq binding 'popup-isearch) + (popup-isearch menu + :filter isearch-filter + :cursor-color isearch-cursor-color + :keymap isearch-keymap + :callback isearch-callback + :help-delay help-delay)) + ((commandp binding) + (call-interactively binding)) + (t + (funcall fallback key (key-binding key))))))) + +(defun popup-preferred-width (list) + "Return the preferred width to show LIST beautifully." + (cl-loop with tab-width = 4 + for item in list + for summary = (popup-item-summary item) + maximize (string-width (popup-x-to-string item)) into width + if (stringp summary) + maximize (+ (string-width summary) 2) into summary-width + finally return + (let ((total (+ (or width 0) (or summary-width 0)))) + (* (ceiling (/ total 10.0)) 10)))) + +(defvar popup-menu-keymap + (let ((map (make-sparse-keymap))) + (define-key map "\r" 'popup-select) + (define-key map "\C-f" 'popup-open) + (define-key map [right] 'popup-open) + (define-key map "\C-b" 'popup-close) + (define-key map [left] 'popup-close) + + (define-key map "\C-n" 'popup-next) + (define-key map [down] 'popup-next) + (define-key map "\C-p" 'popup-previous) + (define-key map [up] 'popup-previous) + + (define-key map [next] 'popup-page-next) + (define-key map [prior] 'popup-page-previous) + + (define-key map [f1] 'popup-help) + (define-key map (kbd "\C-?") 'popup-help) + + (define-key map "\C-s" 'popup-isearch) + + (define-key map [mouse-1] 'popup-select) + (define-key map [mouse-4] 'popup-previous) + (define-key map [mouse-5] 'popup-next) + map)) + +(cl-defun popup-menu* (list + &key + point + (around t) + (width (popup-preferred-width list)) + (height 15) + max-width + margin + margin-left + margin-right + scroll-bar + symbol + parent + parent-offset + cursor + (keymap popup-menu-keymap) + (fallback 'popup-menu-fallback) + help-delay + nowait + prompt + isearch + (isearch-filter 'popup-isearch-filter-list) + (isearch-cursor-color popup-isearch-cursor-color) + (isearch-keymap popup-isearch-keymap) + isearch-callback + initial-index + &aux menu event) + "Show a popup menu of LIST at POINT. This function returns a +value of the selected item. Almost all arguments are the same as in +`popup-create', except for KEYMAP, FALLBACK, HELP-DELAY, PROMPT, +ISEARCH, ISEARCH-FILTER, ISEARCH-CURSOR-COLOR, ISEARCH-KEYMAP, and +ISEARCH-CALLBACK. + +If KEYMAP is a keymap which is used when processing events during +event loop. + +If FALLBACK is a function taking two arguments; a key and a +command. FALLBACK is called when no special operation is found on +the key. The default value is `popup-menu-fallback', which does +nothing. + +HELP-DELAY is a delay of displaying helps. + +If NOWAIT is non-nil, this function immediately returns the menu +instance without entering event loop. + +PROMPT is a prompt string when reading events during event loop. + +If ISEARCH is non-nil, do isearch as soon as displaying the popup +menu. + +ISEARCH-FILTER is a filtering function taking two arguments: +search pattern and list of items. Returns a list of matching items. + +ISEARCH-CURSOR-COLOR is a cursor color during isearch. The +default value is `popup-isearch-cursor-color'. + +ISEARCH-KEYMAP is a keymap which is used when processing events +during event loop. The default value is `popup-isearch-keymap'. + +ISEARCH-CALLBACK is a function taking one argument. `popup-menu' +calls ISEARCH-CALLBACK, if specified, after isearch finished or +isearch canceled. The arguments is whole filtered list of items. + +If `INITIAL-INDEX' is non-nil, this is an initial index value for +`popup-select'. Only positive integer is valid." + (and (eq margin t) (setq margin 1)) + (or margin-left (setq margin-left margin)) + (or margin-right (setq margin-right margin)) + (if (and scroll-bar + (integerp margin-right) + (> margin-right 0)) + ;; Make scroll-bar space as margin-right + (cl-decf margin-right)) + (setq menu (popup-create point width height + :max-width max-width + :around around + :face 'popup-menu-face + :mouse-face 'popup-menu-mouse-face + :selection-face 'popup-menu-selection-face + :summary-face 'popup-menu-summary-face + :margin-left margin-left + :margin-right margin-right + :scroll-bar scroll-bar + :symbol symbol + :parent parent + :parent-offset parent-offset)) + (unwind-protect + (progn + (popup-set-list menu list) + (if cursor + (popup-jump menu cursor) + (popup-draw menu)) + (when initial-index + (dotimes (_i (min (- (length list) 1) initial-index)) + (popup-next menu))) + (if nowait + menu + (popup-menu-event-loop menu keymap fallback + :prompt prompt + :help-delay help-delay + :isearch isearch + :isearch-filter isearch-filter + :isearch-cursor-color isearch-cursor-color + :isearch-keymap isearch-keymap + :isearch-callback isearch-callback))) + (unless nowait + (popup-delete menu)))) + +(defun popup-cascade-menu (list &rest args) + "Same as `popup-menu' except that an element of LIST can be +also a sub-menu if the element is a cons cell formed (ITEM +. SUBLIST) where ITEM is an usual item and SUBLIST is a list of +the sub menu." + (apply 'popup-menu* + (mapcar (lambda (item) + (if (consp item) + (popup-make-item (car item) + :sublist (cdr item) + :symbol ">") + item)) + list) + :symbol t + args)) + +(provide 'popup) +;;; popup.el ends here diff --git a/elpa/popup-20160709.1429/popup.elc b/elpa/popup-20160709.1429/popup.elc new file mode 100644 index 0000000..8ab4f42 Binary files /dev/null and b/elpa/popup-20160709.1429/popup.elc differ diff --git a/elpa/pos-tip-20150318.1513/pos-tip-autoloads.el b/elpa/pos-tip-20150318.1513/pos-tip-autoloads.el new file mode 100644 index 0000000..dc49e7b --- /dev/null +++ b/elpa/pos-tip-20150318.1513/pos-tip-autoloads.el @@ -0,0 +1,15 @@ +;;; pos-tip-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil nil ("pos-tip.el") (23391 65287 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; pos-tip-autoloads.el ends here diff --git a/elpa/pos-tip-20150318.1513/pos-tip-pkg.el b/elpa/pos-tip-20150318.1513/pos-tip-pkg.el new file mode 100644 index 0000000..8ce8ca8 --- /dev/null +++ b/elpa/pos-tip-20150318.1513/pos-tip-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "pos-tip" "20150318.1513" "Show tooltip at point" 'nil :commit "051e08fec5cf30b7574bdf439f79fef7d42d689d" :keywords '("tooltip") :authors '(("S. Irie")) :maintainer '("S. Irie")) diff --git a/elpa/pos-tip-20150318.1513/pos-tip.el b/elpa/pos-tip-20150318.1513/pos-tip.el new file mode 100644 index 0000000..0052b51 --- /dev/null +++ b/elpa/pos-tip-20150318.1513/pos-tip.el @@ -0,0 +1,980 @@ +;;; pos-tip.el --- Show tooltip at point -*- coding: utf-8 -*- + +;; Copyright (C) 2010 S. Irie + +;; Author: S. Irie +;; Maintainer: S. Irie +;; Keywords: Tooltip +;; Package-Version: 20150318.1513 + +(defconst pos-tip-version "0.4.6") + +;; 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 2, or +;; (at your option) any later version. + +;; It 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, write to the Free +;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +;; MA 02110-1301 USA + +;;; Commentary: + +;; The standard library tooltip.el provides the function for displaying +;; a tooltip at mouse position which allows users to easily show it. +;; However, locating tooltip at arbitrary buffer position in window +;; is not easy. This program provides such function to be used by other +;; frontend programs. + +;; This program is tested on GNU Emacs 22, 23 under X window system and +;; Emacs 23 for MS-Windows. + +;; +;; Installation: +;; +;; First, save this file as pos-tip.el and byte-compile in +;; a directory that is listed in load-path. +;; +;; Put the following in your .emacs file: +;; +;; (require 'pos-tip) +;; +;; To use the full features of this program on MS-Windows, +;; put the additional setting in .emacs file: +;; +;; (pos-tip-w32-max-width-height) ; Maximize frame temporarily +;; +;; or +;; +;; (pos-tip-w32-max-width-height t) ; Keep frame maximized + +;; +;; Examples: +;; +;; We can display a tooltip at the current position by the following: +;; +;; (pos-tip-show "foo bar") +;; +;; If you'd like to specify the tooltip color, use an expression as: +;; +;; (pos-tip-show "foo bar" '("white" . "red")) +;; +;; Here, "white" and "red" are the foreground color and background +;; color, respectively. + + +;;; History: +;; 2013-07-16 P. Kalinowski +;; * Adjusted `pos-tip-show' to correctly set tooltip text foreground +;; color when using custom color themes. +;; * Version 0.4.6 +;; +;; 2010-09-27 S. Irie +;; * Simplified implementation of `pos-tip-window-system' +;; * Version 0.4.5 +;; +;; 2010-08-20 S. Irie +;; * Changed to use `window-line-height' to calculate tooltip position +;; * Changed `pos-tip-string-width-height' to ignore last empty line +;; * Version 0.4.4 +;; +;; 2010-07-25 S. Irie +;; * Bug fix +;; * Version 0.4.3 +;; +;; 2010-06-09 S. Irie +;; * Bug fix +;; * Version 0.4.2 +;; +;; 2010-06-04 S. Irie +;; * Added support for text-scale-mode +;; * Version 0.4.1 +;; +;; 2010-05-04 S. Irie +;; * Added functions: +;; `pos-tip-x-display-width', `pos-tip-x-display-height' +;; `pos-tip-normalize-natnum', `pos-tip-frame-relative-position' +;; * Fixed the supports for multi-displays and multi-frames +;; * Version 0.4.0 +;; +;; 2010-04-29 S. Irie +;; * Modified to avoid byte-compile warning +;; * Bug fix +;; * Version 0.3.6 +;; +;; 2010-04-29 S. Irie +;; * Renamed argument MAX-HEIGHT of `pos-tip-fill-string' to MAX-ROWS +;; * Modified old FSF address +;; * Version 0.3.5 +;; +;; 2010-04-29 S. Irie +;; * Modified `pos-tip-show' to truncate string exceeding display size +;; * Added function `pos-tip-truncate-string' +;; * Added optional argument MAX-ROWS to `pos-tip-split-string' +;; * Added optional argument MAX-HEIGHT to `pos-tip-fill-string' +;; * Version 0.3.4 +;; +;; 2010-04-16 S. Irie +;; * Changed `pos-tip-show' not to fill paragraph unless exceeding WIDTH +;; * Version 0.3.3 +;; +;; 2010-04-08 S. Irie +;; * Bug fix +;; * Version 0.3.2 +;; +;; 2010-03-31 S. Irie +;; * Bug fix +;; * Version 0.3.1 +;; +;; 2010-03-30 S. Irie +;; * Added support for MS-Windows +;; * Added option `pos-tip-use-relative-coordinates' +;; * Bug fixes +;; * Version 0.3.0 +;; +;; 2010-03-23 S. Irie +;; * Changed argument WORD-WRAP to JUSTIFY +;; * Added optional argument SQUEEZE +;; * Added function `pos-tip-fill-string' +;; * Added option `pos-tip-tab-width' used to expand tab characters +;; * Bug fixes +;; * Version 0.2.0 +;; +;; 2010-03-22 S. Irie +;; * Added optional argument WORD-WRAP to `pos-tip-split-string' +;; * Changed `pos-tip-show' to perform word wrap or kinsoku shori +;; * Version 0.1.8 +;; +;; 2010-03-20 S. Irie +;; * Added optional argument DY +;; * Bug fix +;; * Modified docstrings +;; * Version 0.1.7 +;; +;; 2010-03-18 S. Irie +;; * Added/modifed docstrings +;; * Changed working buffer name to " *xwininfo*" +;; * Version 0.1.6 +;; +;; 2010-03-17 S. Irie +;; * Fixed typos in docstrings +;; * Version 0.1.5 +;; +;; 2010-03-16 S. Irie +;; * Added support for multi-display environment +;; * Bug fix +;; * Version 0.1.4 +;; +;; 2010-03-16 S. Irie +;; * Bug fix +;; * Changed calculation for `x-max-tooltip-size' +;; * Modified docstring +;; * Version 0.1.3 +;; +;; 2010-03-11 S. Irie +;; * Modified commentary +;; * Version 0.1.2 +;; +;; 2010-03-11 S. Irie +;; * Re-implemented `pos-tip-string-width-height' +;; * Added indicator variable `pos-tip-upperside-p' +;; * Version 0.1.1 +;; +;; 2010-03-09 S. Irie +;; * Re-implemented `pos-tip-show' (*incompatibly changed*) +;; - Use frame default font +;; - Automatically calculate tooltip pixel size +;; - Added optional arguments: TIP-COLOR, MAX-WIDTH +;; * Added utility functions: +;; `pos-tip-split-string', `pos-tip-string-width-height' +;; * Bug fixes +;; * Version 0.1.0 +;; +;; 2010-03-08 S. Irie +;; * Added optional argument DX +;; * Version 0.0.4 +;; +;; 2010-03-08 S. Irie +;; * Bug fix +;; * Version 0.0.3 +;; +;; 2010-03-08 S. Irie +;; * Modified to move out mouse pointer +;; * Version 0.0.2 +;; +;; 2010-03-07 S. Irie +;; * First release +;; * Version 0.0.1 + +;; ToDo: + +;;; Code: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Settings +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defgroup pos-tip nil + "Show tooltip at point" + :group 'faces + :prefix "pos-tip-") + +(defcustom pos-tip-border-width 1 + "Outer border width of pos-tip's tooltip." + :type 'integer + :group 'pos-tip) + +(defcustom pos-tip-internal-border-width 2 + "Text margin of pos-tip's tooltip." + :type 'integer + :group 'pos-tip) + +(defcustom pos-tip-foreground-color nil + "Default foreground color of pos-tip's tooltip. +When `nil', look up the foreground color of the `tooltip' face." + :type '(choice (const :tag "Default" nil) + string) + :group 'pos-tip) + +(defcustom pos-tip-background-color nil + "Default background color of pos-tip's tooltip. +When `nil', look up the background color of the `tooltip' face." + :type '(choice (const :tag "Default" nil) + string) + :group 'pos-tip) + +(defcustom pos-tip-tab-width nil + "Tab width used for `pos-tip-split-string' and `pos-tip-fill-string' +to expand tab characters. nil means use default value of `tab-width'." + :type '(choice (const :tag "Default" nil) + integer) + :group 'pos-tip) + +(defcustom pos-tip-use-relative-coordinates nil + "Non-nil means tooltip location is calculated as a coordinates +relative to the top left corner of frame. In this case the tooltip +will always be displayed within the frame. + +Note that this variable is automatically set to non-nil if absolute +coordinates can't be obtained by `pos-tip-compute-pixel-position'." + :type 'boolean + :group 'pos-tip) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Functions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun pos-tip-window-system (&optional frame) + "The name of the window system that FRAME is displaying through. +The value is a symbol---for instance, 'x' for X windows. +The value is nil if Emacs is using a text-only terminal. + +FRAME defaults to the currently selected frame." + (let ((type (framep (or frame (selected-frame))))) + (if type + (and (not (eq type t)) + type) + (signal 'wrong-type-argument (list 'framep frame))))) + +(defun pos-tip-normalize-natnum (object &optional n) + "Return a Nth power of 2 if OBJECT is a positive integer. +Otherwise return 0. Omitting N means return 1 for a positive integer." + (ash (if (and (natnump object) (> object 0)) 1 0) + (or n 0))) + +(defvar pos-tip-saved-frame-coordinates '(0 . 0) + "The latest result of `pos-tip-frame-top-left-coordinates'.") + +(defvar pos-tip-frame-offset nil + "The latest result of `pos-tip-calibrate-frame-offset'. This value +is used for non-X graphical environment.") + +(defvar pos-tip-frame-offset-array [nil nil nil nil] + "Array of the results of `pos-tip-calibrate-frame-offset'. They are +recorded only when `pos-tip-frame-top-left-coordinates' is called for a +non-X but graphical frame. + +The 2nd and 4th elements are the values for frames having a menu bar. +The 3rd and 4th elements are the values for frames having a tool bar.") + +(defun pos-tip-frame-top-left-coordinates (&optional frame) + "Return the pixel coordinates of FRAME as a cons cell (LEFT . TOP), +which are relative to top left corner of screen. + +Return nil if failing to acquire the coordinates. + +If FRAME is omitted, use selected-frame. + +Users can also get the frame coordinates by referring the variable +`pos-tip-saved-frame-coordinates' just after calling this function." + (let ((winsys (pos-tip-window-system frame))) + (cond + ((null winsys) + (error "text-only frame: %S" frame)) + ((eq winsys 'x) + (condition-case nil + (with-current-buffer (get-buffer-create " *xwininfo*") + (let ((case-fold-search nil)) + (buffer-disable-undo) + (erase-buffer) + (call-process shell-file-name nil t nil shell-command-switch + (format "xwininfo -display %s -id %s" + (frame-parameter frame 'display) + (frame-parameter frame 'window-id))) + (goto-char (point-min)) + (search-forward "\n Absolute") + (setq pos-tip-saved-frame-coordinates + (cons (string-to-number (buffer-substring-no-properties + (search-forward "X: ") + (line-end-position))) + (string-to-number (buffer-substring-no-properties + (search-forward "Y: ") + (line-end-position))))))) + (error nil))) + (t + (let* ((index (+ (pos-tip-normalize-natnum + (frame-parameter frame 'menu-bar-lines) 0) + (pos-tip-normalize-natnum + (frame-parameter frame 'tool-bar-lines) 1))) + (offset (or (aref pos-tip-frame-offset-array index) + (aset pos-tip-frame-offset-array index + (pos-tip-calibrate-frame-offset frame))))) + (if offset + (setq pos-tip-saved-frame-coordinates + (cons (+ (eval (frame-parameter frame 'left)) + (car offset)) + (+ (eval (frame-parameter frame 'top)) + (cdr offset)))))))))) + +(defun pos-tip-frame-relative-position + (frame1 frame2 &optional w32-frame frame-coord1 frame-coord2) + "Return the pixel coordinates of FRAME1 relative to FRAME2 +as a cons cell (LEFT . TOP). + +W32-FRAME non-nil means both of frames are under `w32' window system. + +FRAME-COORD1 and FRAME-COORD2, if given, specify the absolute +coordinates of FRAME1 and FRAME2, respectively, which make the +calculations faster if the frames have different heights of menu bars +and tool bars." + (if (and (eq (pos-tip-normalize-natnum + (frame-parameter frame1 'menu-bar-lines)) + (pos-tip-normalize-natnum + (frame-parameter frame2 'menu-bar-lines))) + (or w32-frame + (eq (pos-tip-normalize-natnum + (frame-parameter frame1 'tool-bar-lines)) + (pos-tip-normalize-natnum + (frame-parameter frame2 'tool-bar-lines))))) + (cons (- (eval (frame-parameter frame1 'left)) + (eval (frame-parameter frame2 'left))) + (- (eval (frame-parameter frame1 'top)) + (eval (frame-parameter frame2 'top)))) + (unless frame-coord1 + (setq frame-coord1 (let (pos-tip-saved-frame-coordinates) + (pos-tip-frame-top-left-coordinates frame1)))) + (unless frame-coord2 + (setq frame-coord2 (let (pos-tip-saved-frame-coordinates) + (pos-tip-frame-top-left-coordinates frame2)))) + (cons (- (car frame-coord1) (car frame-coord2)) + (- (cdr frame-coord1) (cdr frame-coord2))))) + +(defvar pos-tip-upperside-p nil + "Non-nil indicates the latest result of `pos-tip-compute-pixel-position' +was upper than the location specified by the arguments.") + +(defvar pos-tip-w32-saved-max-width-height nil + "Display pixel size effective for showing tooltip in MS-Windows desktop. +This doesn't include the taskbar area, so isn't same as actual display size.") + +(defun pos-tip-compute-pixel-position + (&optional pos window pixel-width pixel-height frame-coordinates dx dy) + "Return pixel position of POS in WINDOW like (X . Y), which indicates +the absolute or relative coordinates of bottom left corner of the object. + +Omitting POS and WINDOW means use current position and selected window, +respectively. + +If PIXEL-WIDTH and PIXEL-HEIGHT are given, this function assumes these +values as the size of small window like tooltip which is located around the +object at POS. These values are used to adjust the location in order that +the tooltip won't disappear by sticking out of the display. By referring +the variable `pos-tip-upperside-p' after calling this function, user can +examine whether the tooltip will be located above the specified position. + +If FRAME-COORDINATES is omitted or nil, automatically obtain the absolute +coordinates of the top left corner of frame which WINDOW is on. Here, +`top left corner of frame' represents the origin of `window-pixel-edges' +and its coordinates are essential for calculating the return value as +absolute coordinates. If a cons cell like (LEFT . TOP), specifies the +frame absolute location and makes the calculation slightly faster, but can +be used only when it's clear that frame is in the specified position. Users +can get the latest values of frame coordinates for using in the next call +by referring the variable `pos-tip-saved-frame-coordinates' just after +calling this function. Otherwise, FRAME-COORDINATES `relative' means return +pixel coordinates of the object relative to the top left corner of the frame. +This is the same effect as `pos-tip-use-relative-coordinates' is non-nil. + +DX specifies horizontal offset in pixel. + +DY specifies vertical offset in pixel. This makes the calculations done +without considering the height of object at POS, so the object might be +hidden by the tooltip." + (let* ((frame (window-frame (or window (selected-window)))) + (w32-frame (eq (pos-tip-window-system frame) 'w32)) + (relative (or pos-tip-use-relative-coordinates + (eq frame-coordinates 'relative) + (and w32-frame + (null pos-tip-w32-saved-max-width-height)))) + (frame-coord (or (and relative '(0 . 0)) + frame-coordinates + (pos-tip-frame-top-left-coordinates frame) + (progn + (setq relative t + pos-tip-use-relative-coordinates t) + '(0 . 0)))) + (posn (posn-at-point (or pos (window-point window)) window)) + (line (cdr (posn-actual-col-row posn))) + (line-height (and line + (or (window-line-height line window) + (and (redisplay t) + (window-line-height line window))))) + (x-y (or (posn-x-y posn) + (let ((geom (pos-visible-in-window-p + (or pos (window-point window)) window t))) + (and geom (cons (car geom) (cadr geom)))) + '(0 . 0))) + (x (+ (car frame-coord) + (car (window-inside-pixel-edges window)) + (car x-y) + (or dx 0))) + (y0 (+ (cdr frame-coord) + (cadr (window-pixel-edges window)) + (or (nth 2 line-height) (cdr x-y)))) + (y (+ y0 + (or dy + (car line-height) + (with-current-buffer (window-buffer window) + (cond + ;; `posn-object-width-height' returns an incorrect value + ;; when the header line is displayed (Emacs bug #4426). + ((and posn + (null header-line-format)) + (cdr (posn-object-width-height posn))) + ((and (bound-and-true-p text-scale-mode) + (not (zerop (with-no-warnings + text-scale-mode-amount)))) + (round (* (frame-char-height frame) + (with-no-warnings + (expt text-scale-mode-step + text-scale-mode-amount))))) + (t + (frame-char-height frame))))))) + xmax ymax) + (cond + (relative + (setq xmax (frame-pixel-width frame) + ymax (frame-pixel-height frame))) + (w32-frame + (setq xmax (car pos-tip-w32-saved-max-width-height) + ymax (cdr pos-tip-w32-saved-max-width-height))) + (t + (setq xmax (x-display-pixel-width frame) + ymax (x-display-pixel-height frame)))) + (setq pos-tip-upperside-p (> (+ y (or pixel-height 0)) + ymax)) + (cons (max 0 (min x (- xmax (or pixel-width 0)))) + (max 0 (if pos-tip-upperside-p + (- (if dy ymax y0) (or pixel-height 0)) + y))))) + +(defun pos-tip-cancel-timer () + "Cancel timeout of tooltip." + (mapc (lambda (timer) + (if (eq (aref timer 5) 'x-hide-tip) + (cancel-timer timer))) + timer-list)) + +(defun pos-tip-avoid-mouse (left right top bottom &optional frame) + "Move out mouse pointer if it is inside region (LEFT RIGHT TOP BOTTOM) +in FRAME. Return new mouse position like (FRAME . (X . Y))." + (unless frame + (setq frame (selected-frame))) + (let* ((mpos (with-selected-window (frame-selected-window frame) + (mouse-pixel-position))) + (mframe (pop mpos)) + (mx (car mpos)) + (my (cdr mpos))) + (when (and (eq mframe frame) + (numberp mx)) + (let* ((large-number (+ (frame-pixel-width frame) (frame-pixel-height frame))) + (dl (if (> left 2) + (1+ (- mx left)) + large-number)) + (dr (if (< (1+ right) (frame-pixel-width frame)) + (- right mx) + large-number)) + (dt (if (> top 2) + (1+ (- my top)) + large-number)) + (db (if (< (1+ bottom) (frame-pixel-height frame)) + (- bottom my) + large-number)) + (d (min dl dr dt db))) + (when (> d -2) + (cond + ((= d dl) + (setq mx (- left 2))) + ((= d dr) + (setq mx (1+ right))) + ((= d dt) + (setq my (- top 2))) + (t + (setq my (1+ bottom)))) + (set-mouse-pixel-position frame mx my) + (sit-for 0.0001)))) + (cons mframe (and mpos (cons mx my))))) + +(defun pos-tip-compute-foreground-color (tip-color) + "Compute the foreground color to use for tooltip. + +TIP-COLOR is a face or a cons cell like (FOREGROUND-COLOR . BACKGROUND-COLOR). +If it is nil, use `pos-tip-foreground-color' or the foreground color of the +`tooltip' face." + (or (and (facep tip-color) + (face-attribute tip-color :foreground)) + (car-safe tip-color) + pos-tip-foreground-color + (face-foreground 'tooltip))) + +(defun pos-tip-compute-background-color (tip-color) + "Compute the background color to use for tooltip. + +TIP-COLOR is a face or a cons cell like (FOREGROUND-COLOR . BACKGROUND-COLOR). +If it is nil, use `pos-tip-background-color' or the background color of the +`tooltip' face." + (or (and (facep tip-color) + (face-attribute tip-color :background)) + (cdr-safe tip-color) + pos-tip-background-color + (face-background 'tooltip))) + +(defun pos-tip-show-no-propertize + (string &optional tip-color pos window timeout pixel-width pixel-height frame-coordinates dx dy) + "Show STRING in a tooltip at POS in WINDOW. +Analogous to `pos-tip-show' except don't propertize STRING by `pos-tip' face. + +PIXEL-WIDTH and PIXEL-HEIGHT specify the size of tooltip, if given. These +are used to adjust the tooltip position in order that it doesn't disappear by +sticking out of the display, and also used to prevent it from vanishing by +overlapping with mouse pointer. + +Note that this function itself doesn't calculate tooltip size because the +character width and height specified by faces are unknown. So users should +calculate PIXEL-WIDTH and PIXEL-HEIGHT by using `pos-tip-tooltip-width' and +`pos-tip-tooltip-height', or use `pos-tip-show' instead, which can +automatically calculate tooltip size. + +See `pos-tip-show' for details. + +Example: + +\(defface my-tooltip + '((t + :background \"gray85\" + :foreground \"black\" + :inherit variable-pitch)) + \"Face for my tooltip.\") + +\(defface my-tooltip-highlight + '((t + :background \"blue\" + :foreground \"white\" + :inherit my-tooltip)) + \"Face for my tooltip highlighted.\") + +\(let ((str (propertize \" foo \\n bar \\n baz \" 'face 'my-tooltip))) + (put-text-property 6 11 'face 'my-tooltip-highlight str) + (pos-tip-show-no-propertize str 'my-tooltip))" + (unless window + (setq window (selected-window))) + (let* ((frame (window-frame window)) + (winsys (pos-tip-window-system frame)) + (x-frame (eq winsys 'x)) + (w32-frame (eq winsys 'w32)) + (relative (or pos-tip-use-relative-coordinates + (eq frame-coordinates 'relative) + (and w32-frame + (null pos-tip-w32-saved-max-width-height)))) + (x-y (prog1 + (pos-tip-compute-pixel-position pos window + pixel-width pixel-height + frame-coordinates dx dy) + (if pos-tip-use-relative-coordinates + (setq relative t)))) + (ax (car x-y)) + (ay (cdr x-y)) + (rx (if relative ax (- ax (car pos-tip-saved-frame-coordinates)))) + (ry (if relative ay (- ay (cdr pos-tip-saved-frame-coordinates)))) + (retval (cons rx ry)) + (fg (pos-tip-compute-foreground-color tip-color)) + (bg (pos-tip-compute-background-color tip-color)) + (use-dxdy (or relative + (not x-frame))) + (spacing (frame-parameter frame 'line-spacing)) + (border (ash (+ pos-tip-border-width + pos-tip-internal-border-width) + 1)) + (x-max-tooltip-size + (cons (+ (if x-frame 1 0) + (/ (- (or pixel-width + (cond + (relative + (frame-pixel-width frame)) + (w32-frame + (car pos-tip-w32-saved-max-width-height)) + (t + (x-display-pixel-width frame)))) + border) + (frame-char-width frame))) + (/ (- (or pixel-height + (x-display-pixel-height frame)) + border) + (frame-char-height frame)))) + (mpos (with-selected-window window (mouse-pixel-position))) + (mframe (car mpos)) + default-frame-alist) + (if (or relative + (and use-dxdy + (null (cadr mpos)))) + (unless (and (cadr mpos) + (eq mframe frame)) + (let* ((edges (window-inside-pixel-edges (cadr (window-list frame)))) + (mx (ash (+ (pop edges) (cadr edges)) -1)) + (my (ash (+ (pop edges) (cadr edges)) -1))) + (setq mframe frame) + (set-mouse-pixel-position mframe mx my) + (sit-for 0.0001))) + (when (and (cadr mpos) + (not (eq mframe frame))) + (let ((rel-coord (pos-tip-frame-relative-position frame mframe w32-frame + frame-coordinates))) + (setq rx (+ rx (car rel-coord)) + ry (+ ry (cdr rel-coord)))))) + (and pixel-width pixel-height + (setq mpos (pos-tip-avoid-mouse rx (+ rx pixel-width + (if w32-frame 3 0)) + ry (+ ry pixel-height) + mframe))) + (x-show-tip string mframe + `((border-width . ,pos-tip-border-width) + (internal-border-width . ,pos-tip-internal-border-width) + ,@(and (not use-dxdy) `((left . ,ax) + (top . ,ay))) + (font . ,(frame-parameter frame 'font)) + ,@(and spacing `((line-spacing . ,spacing))) + ,@(and (stringp fg) `((foreground-color . ,fg))) + ,@(and (stringp bg) `((background-color . ,bg)))) + (and timeout (> timeout 0) timeout) + (and use-dxdy (- rx (cadr mpos))) + (and use-dxdy (- ry (cddr mpos)))) + (if (and timeout (<= timeout 0)) + (pos-tip-cancel-timer)) + retval)) + +(defun pos-tip-split-string (string &optional width margin justify squeeze max-rows) + "Split STRING into fixed width strings. Return a list of these strings. + +WIDTH specifies the width of filling each paragraph. WIDTH nil means use +the width of currently selected frame. Note that this function doesn't add any +padding characters at the end of each row. + +MARGIN, if non-nil, specifies left margin width which is the number of spece +characters to add at the beginning of each row. + +The optional fourth argument JUSTIFY specifies which kind of justification +to do: `full', `left', `right', `center', or `none'. A value of t means handle +each paragraph as specified by its text properties. Omitting JUSTIFY means +don't perform justification, word wrap and kinsoku shori (禁則処理). + +SQUEEZE nil means leave whitespaces other than line breaks untouched. + +MAX-ROWS, if given, specifies maximum number of elements of return value. +The elements exceeding this number are discarded." + (with-temp-buffer + (let* ((tab-width (or pos-tip-tab-width tab-width)) + (fill-column (or width (frame-width))) + (left-margin (or margin 0)) + (kinsoku-limit 1) + indent-tabs-mode + row rows) + (insert string) + (untabify (point-min) (point-max)) + (if justify + (fill-region (point-min) (point-max) justify (not squeeze)) + (setq margin (make-string left-margin ?\s))) + (goto-char (point-min)) + (while (prog2 + (let ((line (buffer-substring + (point) (progn (end-of-line) (point))))) + (if justify + (push line rows) + (while (progn + (setq line (concat margin line) + row (truncate-string-to-width line fill-column)) + (push row rows) + (if (not (= (length row) (length line))) + (setq line (substring line (length row)))))))) + (< (point) (point-max)) + (beginning-of-line 2))) + (nreverse (if max-rows + (last rows max-rows) + rows))))) + +(defun pos-tip-fill-string (string &optional width margin justify squeeze max-rows) + "Fill each of the paragraphs in STRING. + +WIDTH specifies the width of filling each paragraph. WIDTH nil means use +the width of currently selected frame. Note that this function doesn't add any +padding characters at the end of each row. + +MARGIN, if non-nil, specifies left margin width which is the number of spece +characters to add at the beginning of each row. + +The optional fourth argument JUSTIFY specifies which kind of justification +to do: `full', `left', `right', `center', or `none'. A value of t means handle +each paragraph as specified by its text properties. Omitting JUSTIFY means +don't perform justification, word wrap and kinsoku shori (禁則処理). + +SQUEEZE nil means leave whitespaces other than line breaks untouched. + +MAX-ROWS, if given, specifies maximum number of rows. The rows exceeding +this number are discarded." + (if justify + (with-temp-buffer + (let* ((tab-width (or pos-tip-tab-width tab-width)) + (fill-column (or width (frame-width))) + (left-margin (or margin 0)) + (kinsoku-limit 1) + indent-tabs-mode) + (insert string) + (untabify (point-min) (point-max)) + (fill-region (point-min) (point-max) justify (not squeeze)) + (if max-rows + (buffer-substring (goto-char (point-min)) + (line-end-position max-rows)) + (buffer-string)))) + (mapconcat 'identity + (pos-tip-split-string string width margin nil nil max-rows) + "\n"))) + +(defun pos-tip-truncate-string (string width height) + "Truncate each line of STRING to WIDTH and discard lines exceeding HEIGHT." + (with-temp-buffer + (insert string) + (goto-char (point-min)) + (let ((nrow 0) + rows) + (while (and (< nrow height) + (prog2 + (push (truncate-string-to-width + (buffer-substring (point) (progn (end-of-line) (point))) + width) + rows) + (< (point) (point-max)) + (beginning-of-line 2) + (setq nrow (1+ nrow))))) + (mapconcat 'identity (nreverse rows) "\n")))) + +(defun pos-tip-string-width-height (string) + "Count columns and rows of STRING. Return a cons cell like (WIDTH . HEIGHT). +The last empty line of STRING is ignored. + +Example: + +\(pos-tip-string-width-height \"abc\\nあいう\\n123\") +;; => (6 . 3)" + (with-temp-buffer + (insert string) + (goto-char (point-min)) + (end-of-line) + (let ((width (current-column)) + (height (if (eq (char-before (point-max)) ?\n) 0 1))) + (while (< (point) (point-max)) + (end-of-line 2) + (setq width (max (current-column) width) + height (1+ height))) + (cons width height)))) + +(defun pos-tip-x-display-width (&optional frame) + "Return maximum column number in tooltip which occupies the full width +of display. Omitting FRAME means use display that selected frame is in." + (1+ (/ (x-display-pixel-width frame) (frame-char-width frame)))) + +(defun pos-tip-x-display-height (&optional frame) + "Return maximum row number in tooltip which occupies the full height +of display. Omitting FRAME means use display that selected frame is in." + (1+ (/ (x-display-pixel-height frame) (frame-char-height frame)))) + +(defun pos-tip-tooltip-width (width char-width) + "Calculate tooltip pixel width." + (+ (* width char-width) + (ash (+ pos-tip-border-width + pos-tip-internal-border-width) + 1))) + +(defun pos-tip-tooltip-height (height char-height &optional frame) + "Calculate tooltip pixel height." + (let ((spacing (or (default-value 'line-spacing) + (frame-parameter frame 'line-spacing)))) + (+ (* height (+ char-height + (cond + ((integerp spacing) + spacing) + ((floatp spacing) + (truncate (* (frame-char-height frame) + spacing))) + (t 0)))) + (ash (+ pos-tip-border-width + pos-tip-internal-border-width) + 1)))) + +(defun pos-tip-show + (string &optional tip-color pos window timeout width frame-coordinates dx dy) + "Show STRING in a tooltip, which is a small X window, at POS in WINDOW +using frame's default font with TIP-COLOR. + +Return pixel position of tooltip relative to top left corner of frame as +a cons cell like (X . Y). + +TIP-COLOR is a face or a cons cell like (FOREGROUND-COLOR . BACKGROUND-COLOR) +used to specify *only* foreground-color and background-color of tooltip. If +omitted, use `pos-tip-foreground-color' and `pos-tip-background-color' or the +foreground and background color of the `tooltip' face instead. + +Omitting POS and WINDOW means use current position and selected window, +respectively. + +Automatically hide the tooltip after TIMEOUT seconds. Omitting TIMEOUT means +use the default timeout of 5 seconds. Non-positive TIMEOUT means don't hide +tooltip automatically. + +WIDTH, if non-nil, specifies the width of filling each paragraph. + +If FRAME-COORDINATES is omitted or nil, automatically obtain the absolute +coordinates of the top left corner of frame which WINDOW is on. Here, +`top left corner of frame' represents the origin of `window-pixel-edges' +and its coordinates are essential for calculating the absolute coordinates +of the tooltip. If a cons cell like (LEFT . TOP), specifies the frame +absolute location and makes the calculation slightly faster, but can be +used only when it's clear that frame is in the specified position. Users +can get the latest values of frame coordinates for using in the next call +by referring the variable `pos-tip-saved-frame-coordinates' just after +calling this function. Otherwise, FRAME-COORDINATES `relative' means use +the pixel coordinates relative to the top left corner of the frame for +displaying the tooltip. This is the same effect as +`pos-tip-use-relative-coordinates' is non-nil. + +DX specifies horizontal offset in pixel. + +DY specifies vertical offset in pixel. This makes the calculations done +without considering the height of object at POS, so the object might be +hidden by the tooltip. + +See also `pos-tip-show-no-propertize'." + (unless window + (setq window (selected-window))) + (let* ((frame (window-frame window)) + (max-width (pos-tip-x-display-width frame)) + (max-height (pos-tip-x-display-height frame)) + (w-h (pos-tip-string-width-height string)) + (fg (pos-tip-compute-foreground-color tip-color)) + (bg (pos-tip-compute-background-color tip-color)) + (frame-font (find-font (font-spec :name (frame-parameter frame 'font)))) + (tip-face-attrs (list :font frame-font :foreground fg :background bg))) + (cond + ((and width + (> (car w-h) width)) + (setq string (pos-tip-fill-string string width nil 'none nil max-height) + w-h (pos-tip-string-width-height string))) + ((or (> (car w-h) max-width) + (> (cdr w-h) max-height)) + (setq string (pos-tip-truncate-string string max-width max-height) + w-h (pos-tip-string-width-height string)))) + (pos-tip-show-no-propertize + (propertize string 'face tip-face-attrs) + tip-color pos window timeout + (pos-tip-tooltip-width (car w-h) (frame-char-width frame)) + (pos-tip-tooltip-height (cdr w-h) (frame-char-height frame) frame) + frame-coordinates dx dy))) + +(defalias 'pos-tip-hide 'x-hide-tip + "Hide pos-tip's tooltip.") + +(defun pos-tip-calibrate-frame-offset (&optional frame) + "Return coordinates of FRAME orign relative to the top left corner of +the FRAME extent, like (LEFT . TOP). The return value is recorded to +`pos-tip-frame-offset'. + +Note that this function does't correctly work for X frame and Emacs 22." + (setq pos-tip-frame-offset nil) + (let* ((window (frame-first-window frame)) + (delete-frame-functions + '((lambda (frame) + (if (equal (frame-parameter frame 'name) "tooltip") + (setq pos-tip-frame-offset + (cons (eval (frame-parameter frame 'left)) + (eval (frame-parameter frame 'top)))))))) + (pos-tip-border-width 0) + (pos-tip-internal-border-width 1) + (rpos (pos-tip-show "" + `(nil . ,(frame-parameter frame 'background-color)) + (window-start window) window + nil nil 'relative nil 0))) + (sit-for 0) + (pos-tip-hide) + (and pos-tip-frame-offset + (setq pos-tip-frame-offset + (cons (- (car pos-tip-frame-offset) + (car rpos) + (eval (frame-parameter frame 'left))) + (- (cdr pos-tip-frame-offset) + (cdr rpos) + (eval (frame-parameter frame 'top)))))))) + +(defun pos-tip-w32-max-width-height (&optional keep-maximize) + "Maximize the currently selected frame temporarily and set +`pos-tip-w32-saved-max-width-height' the effective display size in order +to become possible to calculate the absolute location of tooltip. + +KEEP-MAXIMIZE non-nil means leave the frame maximized. + +Note that this function is usable only in Emacs 23 for MS-Windows." + (interactive) + (unless (eq window-system 'w32) + (error "`pos-tip-w32-max-width-height' can be used only in w32 frame.")) + ;; Maximize frame + (with-no-warnings (w32-send-sys-command 61488)) + (sit-for 0) + (let ((offset (pos-tip-calibrate-frame-offset))) + (prog1 + (setq pos-tip-w32-saved-max-width-height + (cons (frame-pixel-width) + (+ (frame-pixel-height) + (- (cdr offset) (car offset))))) + (if (called-interactively-p 'interactive) + (message "%S" pos-tip-w32-saved-max-width-height)) + (unless keep-maximize + ;; Restore frame + (with-no-warnings (w32-send-sys-command 61728)))))) + + +(provide 'pos-tip) + +;;; +;;; pos-tip.el ends here diff --git a/elpa/pos-tip-20150318.1513/pos-tip.elc b/elpa/pos-tip-20150318.1513/pos-tip.elc new file mode 100644 index 0000000..3387c7b Binary files /dev/null and b/elpa/pos-tip-20150318.1513/pos-tip.elc differ diff --git a/elpa/pretty-symbols-20140814.959/pretty-symbols-autoloads.el b/elpa/pretty-symbols-20140814.959/pretty-symbols-autoloads.el new file mode 100644 index 0000000..2943900 --- /dev/null +++ b/elpa/pretty-symbols-20140814.959/pretty-symbols-autoloads.el @@ -0,0 +1,67 @@ +;;; pretty-symbols-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "pretty-symbols" "pretty-symbols.el" (23391 +;;;;;; 65287 0 0)) +;;; Generated autoloads from pretty-symbols.el + +(autoload 'pretty-symbols-mode "pretty-symbols" "\ +Draw multi-character tokens as Unicode glyphs. +For example, in lisp modes draw λ instead of the characters +l a m b d a. The on-disk file keeps the original characters. + +This may sound like a neat trick, but be extra careful: it +changes the line length and can thus lead to surprises with +respect to alignment and layout. + +To enable, add to the hooks of the major modes you want pretty +symbols in: (add-hook 'emacs-lisp-mode-hook 'pretty-symbols-mode). + +\(fn &optional ARG)" t nil) + +(defvar pretty-symbol-patterns (let ((lisps '(emacs-lisp-mode inferior-lisp-mode inferior-emacs-lisp-mode lisp-mode scheme-mode)) (c-like '(c-mode c++-mode go-mode java-mode js-mode perl-mode cperl-mode ruby-mode python-mode inferior-python-mode))) `((955 lambda "\\" (,@lisps python-mode inferior-python-mode)) (402 lambda "\\" (js-mode)) (8800 relational "!=" (,@c-like)) (8800 relational "/=" (,@lisps)) (8805 relational ">=" (,@c-like ,@lisps)) (8804 relational "<=" (,@c-like ,@lisps)) (8743 logical "&&" (,@c-like)) (8743 logical "\\" (,@lisps)) (8744 logical "||" (,@c-like)) (8744 logical "\\" (,@lisps)) (172 logical "\\" (,@lisps)) (8709 nil "\\" (,@lisps)))) "\ +A list of ((character category pattern major-modes) ...). +For each entry in the list, if the buffer's major mode (or one of +its parent modes) is listed in MAJOR-MODES, occurrences of +PATTERN will be shown as CHARACTER instead. + +The replacement will only happen if CATEGORY is present in +`pretty-symbol-categories' before this mode is enabled. + +Note that a major mode's presence in this list doesn't turn on +pretty-symbols-mode; you have to do so in the major mode's hook.") + +(custom-autoload 'pretty-symbol-patterns "pretty-symbols" t) + +(defvar pretty-symbol-categories (list 'lambda) "\ +A list of the categories in `pretty-symbol-patterns' to enable. + +By default, only lambdas (and the equivalents in other languages) +are prettified, so that users can use this minor mode to add their +own patterns, without being saddled with a whole lot of confusing +symbols. + +This must be set before `pretty-symbols-mode' is enabled. + +The available symbols are: + +lambda Prettify the keyword for lambdas (anonymous functions). +relational Relational operators: ≠ ≤ ≥ +logical Logical operators: ∧ ∨ ¬ + +To set this list from your init file: +\(setq pretty-symbol-categories '(lambda relational logical)) +") + +(custom-autoload 'pretty-symbol-categories "pretty-symbols" t) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; pretty-symbols-autoloads.el ends here diff --git a/elpa/pretty-symbols-20140814.959/pretty-symbols-pkg.el b/elpa/pretty-symbols-20140814.959/pretty-symbols-pkg.el new file mode 100644 index 0000000..4799ac7 --- /dev/null +++ b/elpa/pretty-symbols-20140814.959/pretty-symbols-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "pretty-symbols" "20140814.959" "Draw tokens as Unicode glyphs." 'nil :commit "582cbe51ecfe1cc0a5b185bc06113c8a661e3956" :keywords '("faces") :authors '(("David Röthlisberger" . "david@rothlis.net")) :maintainer '("David Röthlisberger" . "david@rothlis.net") :url "http://github.com/drothlis/pretty-symbols") diff --git a/elpa/pretty-symbols-20140814.959/pretty-symbols.el b/elpa/pretty-symbols-20140814.959/pretty-symbols.el new file mode 100644 index 0000000..e41e3c1 --- /dev/null +++ b/elpa/pretty-symbols-20140814.959/pretty-symbols.el @@ -0,0 +1,195 @@ +;;; pretty-symbols.el --- Draw tokens as Unicode glyphs. + +;; Copyright (C) 2012 David Röthlisberger + +;; Author: David Röthlisberger +;; URL: http://github.com/drothlis/pretty-symbols +;; Package-Version: 20140814.959 +;; Version: 2.0 +;; Keywords: faces + +;; 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. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Minor mode for drawing multi-character tokens as Unicode glyphs +;; (lambda -> λ). +;; +;; Only works when `font-lock-mode' is enabled. +;; +;; This mode is heavily inspired by Trent Buck's pretty-symbols-mode[1] +;; and Arthur Danskin's pretty-mode[2]; but aims to replace those modes, and +;; the many others scattered on emacswiki.org, with: +;; +;; * A simple framework that others can use to define their own symbol +;; replacements, +;; * that doesn't turn on all sorts of crazy mathematical symbols by default, +;; * is a self-contained project under source control, open to contributions, +;; * available from the MELPA package repository[4]. +;; +;; You probably won't want to use this with haskell-mode which has its own much +;; fancier fontification[3]. Eventually it would be nice if this package grew +;; in power and became part of Emacs, so other packages could use it instead of +;; rolling their own. +;; +;; Add your own custom symbol replacements to the list +;; `pretty-symbol-patterns'. +;; +;; Only tested with GNU Emacs 24. +;; +;; [1] http://paste.lisp.org/display/42335/raw +;; [2] http://www.emacswiki.org/emacs/pretty-mode.el +;; [3] https://github.com/haskell/haskell-mode/blob/master/haskell-font-lock.el +;; [4] http://melpa.milkbox.net/ + +;;; Code: + +;;;###autoload +(define-minor-mode pretty-symbols-mode + "Draw multi-character tokens as Unicode glyphs. +For example, in lisp modes draw λ instead of the characters +l a m b d a. The on-disk file keeps the original characters. + +This may sound like a neat trick, but be extra careful: it +changes the line length and can thus lead to surprises with +respect to alignment and layout. + +To enable, add to the hooks of the major modes you want pretty +symbols in: (add-hook 'emacs-lisp-mode-hook 'pretty-symbols-mode)." + nil " λ" nil + (if pretty-symbols-mode + (font-lock-add-keywords nil (pretty-symbol-keywords) t) + (font-lock-remove-keywords nil (pretty-symbol-keywords)) + ;; TODO: Disabling the mode doesn't decompose existing symbols. + ;; Is the following safe to do -- what else uses composition? + ;; (remove-text-properties (point-min) (point-max) '(composition nil)) + )) + + +;; User options + +(defgroup pretty-symbols nil + "Draw multi-character tokens as Unicode glyphs." + :group 'font-lock) + +;;;###autoload +(defcustom pretty-symbol-patterns + (let ((lisps '(emacs-lisp-mode inferior-lisp-mode inferior-emacs-lisp-mode + lisp-mode scheme-mode)) + (c-like '(c-mode c++-mode go-mode java-mode js-mode + perl-mode cperl-mode ruby-mode + python-mode inferior-python-mode))) + `( + ;; Basic symbols, enabled by default + (?λ lambda "\\" (,@lisps python-mode inferior-python-mode)) + (?ƒ lambda "\\" (js-mode)) + ;; Relational operators -- + ;; enable by adding 'relational to `pretty-symbol-categories' + (?≠ relational "!=" (,@c-like)) + (?≠ relational "/=" (,@lisps)) + (?≥ relational ">=" (,@c-like ,@lisps)) + (?≤ relational "<=" (,@c-like ,@lisps)) + ;; Logical operators + (?∧ logical "&&" (,@c-like)) + (?∧ logical "\\" (,@lisps)) + (?∨ logical "||" (,@c-like)) + (?∨ logical "\\" (,@lisps)) + ;;(?¬ logical "\\" (,@c-like)) ; TODO: Fix regex so that ! matches + ; but != doesn't. (\< and \> don't work + ; because ! isn't considered part of + ; a word). This will require support + ; for subgroups and not replacing the + ; whole match. + (?¬ logical "\\" (,@lisps)) + (?∅ nil "\\" (,@lisps)) + )) + "A list of ((character category pattern major-modes) ...). +For each entry in the list, if the buffer's major mode (or one of +its parent modes) is listed in MAJOR-MODES, occurrences of +PATTERN will be shown as CHARACTER instead. + +The replacement will only happen if CATEGORY is present in +`pretty-symbol-categories' before this mode is enabled. + +Note that a major mode's presence in this list doesn't turn on +pretty-symbols-mode; you have to do so in the major mode's hook." + :group 'pretty-symbols + :type '(repeat + (list (character :tag "Pretty character") + (symbol :tag "Category") + (regexp :tag "Pattern to replace") + (repeat :tag "Enable in major modes" + (symbol :tag "Mode"))))) + +;;;###autoload +(defcustom pretty-symbol-categories (list 'lambda) + "A list of the categories in `pretty-symbol-patterns' to enable. + +By default, only lambdas (and the equivalents in other languages) +are prettified, so that users can use this minor mode to add their +own patterns, without being saddled with a whole lot of confusing +symbols. + +This must be set before `pretty-symbols-mode' is enabled. + +The available symbols are: + +lambda Prettify the keyword for lambdas (anonymous functions). +relational Relational operators: ≠ ≤ ≥ +logical Logical operators: ∧ ∨ ¬ + +To set this list from your init file: +\(setq pretty-symbol-categories '(lambda relational logical)) +" + :group 'pretty-symbols + :type '(list + (set :tag "Standard Categories" + :inline t + (const lambda) + (const relational) + (const logical) + (const nil)) + (repeat :tag "Additional Categories" + :inline t + (symbol :tag "Category")))) + + +;; Internal functions + +(defun pretty-symbol-keywords () + "Return the pretty font-lock keywords for the current major mode." + (delq nil (mapcar (lambda (x) (apply 'pretty-symbol-pattern-to-keyword x)) + pretty-symbol-patterns))) + +(defun pretty-symbol-pattern-to-keyword (char category pattern modes &optional idx) + "For a single entry in `pretty-symbol-patterns' return a list +suitable as a single entry in `font-lock-keywords'." + (let ((idx (or idx 0))) + (if (and (memq category pretty-symbol-categories) + (apply 'derived-mode-p modes)) + `(,pattern (,idx (progn (compose-region (match-beginning ,idx) (match-end ,idx) + ,char 'decompose-region) + nil)))))) + + +(provide 'pretty-symbols) + +;; Local Variables: +;; coding: utf-8 +;; eval: (if (fboundp 'pretty-symbols-mode) (pretty-symbols-mode -1)) +;; End: + +;;; pretty-symbols.el ends here diff --git a/elpa/pretty-symbols-20140814.959/pretty-symbols.elc b/elpa/pretty-symbols-20140814.959/pretty-symbols.elc new file mode 100644 index 0000000..28bb853 Binary files /dev/null and b/elpa/pretty-symbols-20140814.959/pretty-symbols.elc differ diff --git a/elpa/projectile-20180728.1457/projectile-autoloads.el b/elpa/projectile-20180728.1457/projectile-autoloads.el new file mode 100644 index 0000000..fa9fc57 --- /dev/null +++ b/elpa/projectile-20180728.1457/projectile-autoloads.el @@ -0,0 +1,534 @@ +;;; projectile-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "projectile" "projectile.el" (23391 65285 0 +;;;;;; 0)) +;;; Generated autoloads from projectile.el + +(autoload 'projectile-version "projectile" "\ +Get the Projectile version as string. + +If called interactively or if SHOW-VERSION is non-nil, show the +version in the echo area and the messages buffer. + +The returned string includes both, the version from package.el +and the library version, if both a present and different. + +If the version number could not be determined, signal an error, +if called interactively, or if SHOW-VERSION is non-nil, otherwise +just return nil. + +\(fn &optional SHOW-VERSION)" t nil) + +(autoload 'projectile-invalidate-cache "projectile" "\ +Remove the current project's files from `projectile-projects-cache'. + +With a prefix argument ARG prompts for the name of the project whose cache +to invalidate. + +\(fn ARG)" t nil) + +(autoload 'projectile-purge-file-from-cache "projectile" "\ +Purge FILE from the cache of the current project. + +\(fn FILE)" t nil) + +(autoload 'projectile-purge-dir-from-cache "projectile" "\ +Purge DIR from the cache of the current project. + +\(fn DIR)" t nil) + +(autoload 'projectile-cache-current-file "projectile" "\ +Add the currently visited file to the cache. + +\(fn)" t nil) + +(autoload 'projectile-discover-projects-in-directory "projectile" "\ +Discover any projects in DIRECTORY and add them to the projectile cache. +This function is not recursive and only adds projects with roots +at the top level of DIRECTORY. + +\(fn DIRECTORY)" t nil) + +(autoload 'projectile-switch-to-buffer "projectile" "\ +Switch to a project buffer. + +\(fn)" t nil) + +(autoload 'projectile-switch-to-buffer-other-window "projectile" "\ +Switch to a project buffer and show it in another window. + +\(fn)" t nil) + +(autoload 'projectile-switch-to-buffer-other-frame "projectile" "\ +Switch to a project buffer and show it in another window. + +\(fn)" t nil) + +(autoload 'projectile-display-buffer "projectile" "\ +Display a project buffer in another window without selecting it. + +\(fn)" t nil) + +(autoload 'projectile-project-buffers-other-buffer "projectile" "\ +Switch to the most recently selected buffer project buffer. +Only buffers not visible in windows are returned. + +\(fn)" t nil) + +(autoload 'projectile-multi-occur "projectile" "\ +Do a `multi-occur' in the project's buffers. +With a prefix argument, show NLINES of context. + +\(fn &optional NLINES)" t nil) + +(autoload 'projectile-find-other-file "projectile" "\ +Switch between files with the same name but different extensions. +With FLEX-MATCHING, match any file that contains the base name of current file. +Other file extensions can be customized with the variable `projectile-other-file-alist'. + +\(fn &optional FLEX-MATCHING)" t nil) + +(autoload 'projectile-find-other-file-other-window "projectile" "\ +Switch between files with the same name but different extensions in other window. +With FLEX-MATCHING, match any file that contains the base name of current file. +Other file extensions can be customized with the variable `projectile-other-file-alist'. + +\(fn &optional FLEX-MATCHING)" t nil) + +(autoload 'projectile-find-other-file-other-frame "projectile" "\ +Switch between files with the same name but different extensions in other window. +With FLEX-MATCHING, match any file that contains the base name of current file. +Other file extensions can be customized with the variable `projectile-other-file-alist'. + +\(fn &optional FLEX-MATCHING)" t nil) + +(autoload 'projectile-find-file-dwim "projectile" "\ +Jump to a project's files using completion based on context. + +With a prefix ARG invalidates the cache first. + +If point is on a filename, Projectile first tries to search for that +file in project: + +- If it finds just a file, it switches to that file instantly. This works even +if the filename is incomplete, but there's only a single file in the current project +that matches the filename at point. For example, if there's only a single file named +\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete), +`projectile-find-file-dwim' still switches to \"projectile/projectile.el\" immediately + because this is the only filename that matches. + +- If it finds a list of files, the list is displayed for selecting. A list of +files is displayed when a filename appears more than one in the project or the +filename at point is a prefix of more than two files in a project. For example, +if `projectile-find-file-dwim' is executed on a filepath like \"projectile/\", it lists +the content of that directory. If it is executed on a partial filename like + \"projectile/a\", a list of files with character 'a' in that directory is presented. + +- If it finds nothing, display a list of all files in project for selecting. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-find-file-dwim-other-window "projectile" "\ +Jump to a project's files using completion based on context in other window. + +With a prefix ARG invalidates the cache first. + +If point is on a filename, Projectile first tries to search for that +file in project: + +- If it finds just a file, it switches to that file instantly. This works even +if the filename is incomplete, but there's only a single file in the current project +that matches the filename at point. For example, if there's only a single file named +\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete), +`projectile-find-file-dwim-other-window' still switches to \"projectile/projectile.el\" +immediately because this is the only filename that matches. + +- If it finds a list of files, the list is displayed for selecting. A list of +files is displayed when a filename appears more than one in the project or the +filename at point is a prefix of more than two files in a project. For example, +if `projectile-find-file-dwim-other-window' is executed on a filepath like \"projectile/\", it lists +the content of that directory. If it is executed on a partial filename +like \"projectile/a\", a list of files with character 'a' in that directory +is presented. + +- If it finds nothing, display a list of all files in project for selecting. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-find-file-dwim-other-frame "projectile" "\ +Jump to a project's files using completion based on context in other frame. + +With a prefix ARG invalidates the cache first. + +If point is on a filename, Projectile first tries to search for that +file in project: + +- If it finds just a file, it switches to that file instantly. This works even +if the filename is incomplete, but there's only a single file in the current project +that matches the filename at point. For example, if there's only a single file named +\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete), +`projectile-find-file-dwim-other-frame' still switches to \"projectile/projectile.el\" +immediately because this is the only filename that matches. + +- If it finds a list of files, the list is displayed for selecting. A list of +files is displayed when a filename appears more than one in the project or the +filename at point is a prefix of more than two files in a project. For example, +if `projectile-find-file-dwim-other-frame' is executed on a filepath like \"projectile/\", it lists +the content of that directory. If it is executed on a partial filename +like \"projectile/a\", a list of files with character 'a' in that directory +is presented. + +- If it finds nothing, display a list of all files in project for selecting. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-find-file "projectile" "\ +Jump to a project's file using completion. +With a prefix ARG invalidates the cache first. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-find-file-other-window "projectile" "\ +Jump to a project's file using completion and show it in another window. + +With a prefix ARG invalidates the cache first. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-find-file-other-frame "projectile" "\ +Jump to a project's file using completion and show it in another frame. + +With a prefix ARG invalidates the cache first. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-find-dir "projectile" "\ +Jump to a project's directory using completion. + +With a prefix ARG invalidates the cache first. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-find-dir-other-window "projectile" "\ +Jump to a project's directory in other window using completion. + +With a prefix ARG invalidates the cache first. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-find-dir-other-frame "projectile" "\ +Jump to a project's directory in other window using completion. + +With a prefix ARG invalidates the cache first. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-find-test-file "projectile" "\ +Jump to a project's test file using completion. + +With a prefix ARG invalidates the cache first. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-project-info "projectile" "\ +Display info for current project. + +\(fn)" t nil) + +(autoload 'projectile-find-implementation-or-test-other-window "projectile" "\ +Open matching implementation or test file in other window. + +\(fn)" t nil) + +(autoload 'projectile-find-implementation-or-test-other-frame "projectile" "\ +Open matching implementation or test file in other frame. + +\(fn)" t nil) + +(autoload 'projectile-toggle-between-implementation-and-test "projectile" "\ +Toggle between an implementation file and its test file. + +\(fn)" t nil) + +(autoload 'projectile-grep "projectile" "\ +Perform rgrep in the project. + +With a prefix ARG asks for files (globbing-aware) which to grep in. +With prefix ARG of `-' (such as `M--'), default the files (without prompt), +to `projectile-grep-default-files'. + +With REGEXP given, don't query the user for a regexp. + +\(fn &optional REGEXP ARG)" t nil) + +(autoload 'projectile-ag "projectile" "\ +Run an ag search with SEARCH-TERM in the project. + +With an optional prefix argument ARG SEARCH-TERM is interpreted as a +regular expression. + +\(fn SEARCH-TERM &optional ARG)" t nil) + +(autoload 'projectile-ripgrep "projectile" "\ +Run a Ripgrep search with `SEARCH-TERM' at current project root. + +SEARCH-TERM is a regexp. + +\(fn SEARCH-TERM)" t nil) + +(autoload 'projectile-regenerate-tags "projectile" "\ +Regenerate the project's [e|g]tags. + +\(fn)" t nil) + +(autoload 'projectile-find-tag "projectile" "\ +Find tag in project. + +\(fn)" t nil) + +(autoload 'projectile-run-command-in-root "projectile" "\ +Invoke `execute-extended-command' in the project's root. + +\(fn)" t nil) + +(autoload 'projectile-run-shell-command-in-root "projectile" "\ +Invoke `shell-command' in the project's root. + +\(fn)" t nil) + +(autoload 'projectile-run-async-shell-command-in-root "projectile" "\ +Invoke `async-shell-command' in the project's root. + +\(fn)" t nil) + +(autoload 'projectile-run-shell "projectile" "\ +Invoke `shell' in the project's root. + +Switch to the project specific shell buffer if it already exists. + +\(fn)" t nil) + +(autoload 'projectile-run-eshell "projectile" "\ +Invoke `eshell' in the project's root. + +Switch to the project specific eshell buffer if it already exists. + +\(fn)" t nil) + +(autoload 'projectile-run-ielm "projectile" "\ +Invoke `ielm' in the project's root. + +Switch to the project specific ielm buffer if it already exists. + +\(fn)" t nil) + +(autoload 'projectile-run-term "projectile" "\ +Invoke `term' in the project's root. + +Switch to the project specific term buffer if it already exists. + +\(fn PROGRAM)" t nil) + +(autoload 'projectile-replace "projectile" "\ +Replace literal string in project using non-regexp `tags-query-replace'. + +With a prefix argument ARG prompts you for a directory on which +to run the replacement. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-replace-regexp "projectile" "\ +Replace a regexp in the project using `tags-query-replace'. + +With a prefix argument ARG prompts you for a directory on which +to run the replacement. + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-kill-buffers "projectile" "\ +Kill all project buffers. + +\(fn)" t nil) + +(autoload 'projectile-save-project-buffers "projectile" "\ +Save all project buffers. + +\(fn)" t nil) + +(autoload 'projectile-dired "projectile" "\ +Open `dired' at the root of the project. + +\(fn)" t nil) + +(autoload 'projectile-dired-other-window "projectile" "\ +Open `dired' at the root of the project in another window. + +\(fn)" t nil) + +(autoload 'projectile-dired-other-frame "projectile" "\ +Open `dired' at the root of the project in another frame. + +\(fn)" t nil) + +(autoload 'projectile-vc "projectile" "\ +Open `vc-dir' at the root of the project. + +For git projects `magit-status-internal' is used if available. +For hg projects `monky-status' is used if available. + +If PROJECT-ROOT is given, it is opened instead of the project +root directory of the current buffer file. If interactively +called with a prefix argument, the user is prompted for a project +directory to open. + +\(fn &optional PROJECT-ROOT)" t nil) + +(autoload 'projectile-recentf "projectile" "\ +Show a list of recently visited files in a project. + +\(fn)" t nil) + +(autoload 'projectile-configure-project "projectile" "\ +Run project configure command. + +Normally you'll be prompted for a compilation command, unless +variable `compilation-read-command'. You can force the prompt +with a prefix ARG. + +\(fn ARG)" t nil) + +(autoload 'projectile-compile-project "projectile" "\ +Run project compilation command. + +Normally you'll be prompted for a compilation command, unless +variable `compilation-read-command'. You can force the prompt +with a prefix ARG. + +\(fn ARG)" t nil) + +(autoload 'projectile-test-project "projectile" "\ +Run project test command. + +Normally you'll be prompted for a compilation command, unless +variable `compilation-read-command'. You can force the prompt +with a prefix ARG. + +\(fn ARG)" t nil) + +(autoload 'projectile-run-project "projectile" "\ +Run project run command. + +Normally you'll be prompted for a compilation command, unless +variable `compilation-read-command'. You can force the prompt +with a prefix ARG. + +\(fn ARG)" t nil) + +(autoload 'projectile-switch-project "projectile" "\ +Switch to a project we have visited before. +Invokes the command referenced by `projectile-switch-project-action' on switch. +With a prefix ARG invokes `projectile-commander' instead of +`projectile-switch-project-action.' + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-switch-open-project "projectile" "\ +Switch to a project we have currently opened. +Invokes the command referenced by `projectile-switch-project-action' on switch. +With a prefix ARG invokes `projectile-commander' instead of +`projectile-switch-project-action.' + +\(fn &optional ARG)" t nil) + +(autoload 'projectile-find-file-in-directory "projectile" "\ +Jump to a file in a (maybe regular) DIRECTORY. + +This command will first prompt for the directory the file is in. + +\(fn &optional DIRECTORY)" t nil) + +(autoload 'projectile-find-file-in-known-projects "projectile" "\ +Jump to a file in any of the known projects. + +\(fn)" t nil) + +(autoload 'projectile-cleanup-known-projects "projectile" "\ +Remove known projects that don't exist anymore. + +\(fn)" t nil) + +(autoload 'projectile-clear-known-projects "projectile" "\ +Clear both `projectile-known-projects' and `projectile-known-projects-file'. + +\(fn)" t nil) + +(autoload 'projectile-remove-known-project "projectile" "\ +Remove PROJECT from the list of known projects. + +\(fn &optional PROJECT)" t nil) + +(autoload 'projectile-remove-current-project-from-known-projects "projectile" "\ +Remove the current project from the list of known projects. + +\(fn)" t nil) + +(autoload 'projectile-ibuffer "projectile" "\ +Open an IBuffer window showing all buffers in the current project. + +Let user choose another project when PREFIX is supplied. + +\(fn PREFIX)" t nil) + +(autoload 'projectile-commander "projectile" "\ +Execute a Projectile command with a single letter. +The user is prompted for a single character indicating the action to invoke. +The `?' character describes then +available actions. + +See `def-projectile-commander-method' for defining new methods. + +\(fn)" t nil) + +(autoload 'projectile-edit-dir-locals "projectile" "\ +Edit or create a .dir-locals.el file of the project. + +\(fn)" t nil) + +(defvar projectile-mode nil "\ +Non-nil if Projectile mode is enabled. +See the `projectile-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `projectile-mode'.") + +(custom-autoload 'projectile-mode "projectile" nil) + +(autoload 'projectile-mode "projectile" "\ +Minor mode to assist project management and navigation. + +When called interactively, toggle `projectile-mode'. With prefix +ARG, enable `projectile-mode' if ARG is positive, otherwise disable +it. + +When called from Lisp, enable `projectile-mode' if ARG is omitted, +nil or positive. If ARG is `toggle', toggle `projectile-mode'. +Otherwise behave as if called interactively. + +\\{projectile-mode-map} + +\(fn &optional ARG)" t nil) + +(define-obsolete-function-alias 'projectile-global-mode 'projectile-mode "1.0") + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; projectile-autoloads.el ends here diff --git a/elpa/projectile-20180728.1457/projectile-pkg.el b/elpa/projectile-20180728.1457/projectile-pkg.el new file mode 100644 index 0000000..91eff51 --- /dev/null +++ b/elpa/projectile-20180728.1457/projectile-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "projectile" "20180728.1457" "Manage and navigate projects in Emacs easily" '((emacs "25.1") (pkg-info "0.4")) :commit "d2b808b1c5d3b895a48575093e7546d5637de17f" :keywords '("project" "convenience") :authors '(("Bozhidar Batsov" . "bozhidar@batsov.com")) :maintainer '("Bozhidar Batsov" . "bozhidar@batsov.com") :url "https://github.com/bbatsov/projectile") diff --git a/elpa/projectile-20180728.1457/projectile.el b/elpa/projectile-20180728.1457/projectile.el new file mode 100644 index 0000000..e63d426 --- /dev/null +++ b/elpa/projectile-20180728.1457/projectile.el @@ -0,0 +1,4090 @@ +;;; projectile.el --- Manage and navigate projects in Emacs easily -*- lexical-binding: t -*- + +;; Copyright © 2011-2018 Bozhidar Batsov + +;; Author: Bozhidar Batsov +;; URL: https://github.com/bbatsov/projectile +;; Package-Version: 20180728.1457 +;; Keywords: project, convenience +;; Version: 1.1.0-snapshot +;; Package-Requires: ((emacs "25.1") (pkg-info "0.4")) + +;; 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, 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., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: +;; +;; This library provides easy project management and navigation. The +;; concept of a project is pretty basic - just a folder containing +;; special file. Currently git, mercurial and bazaar repos are +;; considered projects by default. If you want to mark a folder +;; manually as a project just create an empty .projectile file in +;; it. See the README for more details. +;; +;;; Code: + +(require 'cl-lib) +(require 'thingatpt) +(require 'ibuffer) +(require 'ibuf-ext) +(require 'compile) +(require 'grep) +(require 'subr-x) + +(eval-when-compile + (defvar ag-ignore-list) + (defvar ggtags-completion-table) + (defvar tags-completion-table) + (defvar tags-loop-scan) + (defvar tags-loop-operate) + (defvar eshell-buffer-name) + (defvar explicit-shell-file-name)) + +(declare-function ggtags-ensure-project "ggtags") +(declare-function ggtags-update-tags "ggtags") +(declare-function pkg-info-version-info "pkg-info") +(declare-function tags-completion-table "etags") +(declare-function make-term "term") +(declare-function term-mode "term") +(declare-function term-char-mode "term") + +(defvar grep-files-aliases) +(defvar grep-find-ignored-directories) +(defvar grep-find-ignored-files) + + +;;; Customization +(defgroup projectile nil + "Manage and navigate projects easily." + :group 'tools + :group 'convenience + :link '(url-link :tag "GitHub" "https://github.com/bbatsov/projectile") + :link '(url-link :tag "Online Manual" "https://projectile.readthedocs.io/") + :link '(emacs-commentary-link :tag "Commentary" "projectile")) + +(defcustom projectile-indexing-method (if (eq system-type 'windows-nt) 'native 'alien) + "Specifies the indexing method used by Projectile. + +There are two indexing methods - native and alien. + +The native method is implemented in Emacs Lisp (therefore it is +native to Emacs). Its advantage is that it is portable and will +work everywhere that Emacs does. Its disadvantage is that it is a +bit slow (especially for large projects). Generally it's a good +idea to pair the native indexing method with caching. + +The alien indexing method uses external tools (e.g. git, find, +etc) to speed up the indexing process. The disadvantage of this +method is that it's not well supported on Windows systems. + +By default alien indexing is the default on all operating +systems, except Windows." + :group 'projectile + :type '(radio + (const :tag "Native" native) + (const :tag "Alien" alien))) + +(defcustom projectile-enable-caching (eq projectile-indexing-method 'native) + "When t enables project files caching. + +Project caching is automatically enabled by default if you're +using the native indexing method." + :group 'projectile + :type 'boolean) + +(defcustom projectile-file-exists-local-cache-expire nil + "Number of seconds before file existence cache expires for a +file on a local file system. + + A value of nil disables this cache." + + :group 'projectile + :type '(choice (const :tag "Disabled" nil) + (integer :tag "Seconds"))) + +(defcustom projectile-file-exists-remote-cache-expire (* 5 60) + "Number of seconds before file existence cache expires for a +file on a remote file system such as tramp. + + A value of nil disables this cache." + :group 'projectile + :type '(choice (const :tag "Disabled" nil) + (integer :tag "Seconds"))) + +(defcustom projectile-files-cache-expire nil + "Number of seconds before files list cache expires. + + A value of nil means the cache never expires." + :group 'projectile + :type '(choice (const :tag "Disabled" nil) + (integer :tag "Seconds"))) + +(defcustom projectile-require-project-root t + "Require the presence of a project root to operate when true. +Otherwise consider the current directory the project root." + :group 'projectile + :type 'boolean) + +(defcustom projectile-completion-system 'ido + "The completion system to be used by Projectile." + :group 'projectile + :type '(radio + (const :tag "Ido" ido) + (const :tag "Helm" helm) + (const :tag "Ivy" ivy) + (const :tag "Default" default) + (function :tag "Custom function"))) + +(defcustom projectile-keymap-prefix (kbd "C-c C-p") + "Projectile keymap prefix." + :group 'projectile + :type 'string) + +(defcustom projectile-cache-file + (expand-file-name "projectile.cache" user-emacs-directory) + "The name of Projectile's cache file." + :group 'projectile + :type 'string) + +(defcustom projectile-tags-file-name "TAGS" + "The tags filename Projectile's going to use." + :group 'projectile + :type 'string) + +(defcustom projectile-tags-command "ctags -Re -f \"%s\" %s" + "The command Projectile's going to use to generate a TAGS file." + :group 'projectile + :type 'string) + +(defcustom projectile-tags-backend 'auto + "The tag backend that Projectile should use. + +If set to 'auto', `projectile-find-tag' will automatically choose +which backend to use. Preference order is ggtags -> xref +-> etags-select -> `find-tag'. Variable can also be set to specify which +backend to use. If selected backend is unavailable, fall back to +`find-tag'. + +If this variable is set to 'auto' and ggtags is available, or if +set to 'ggtags', then ggtags will be used for +`projectile-regenerate-tags'. For all other settings +`projectile-tags-command' will be used." + :group 'projectile + :type '(radio + (const :tag "auto" auto) + (const :tag "xref" xref) + (const :tag "ggtags" ggtags) + (const :tag "etags" etags-select) + (const :tag "standard" find-tag)) + :package-version '(projectile . "0.14.0")) + +(defcustom projectile-sort-order 'default + "The sort order used for a project's files." + :group 'projectile + :type '(radio + (const :tag "default" default) + (const :tag "recentf" recentf) + (const :tag "recently active" recently-active) + (const :tag "access time" access-time) + (const :tag "modification time" modification-time))) + +(defcustom projectile-verbose t + "Echo messages that are not errors." + :group 'projectile + :type 'boolean) + +(defcustom projectile-buffers-filter-function nil + "A function used to filter the buffers in `projectile-project-buffers'. + +The function should accept and return a list of Emacs buffers. +Two example filter functions are shipped by default - +`projectile-buffers-with-file' and +`projectile-buffers-with-file-or-process'." + :group 'projectile + :type 'function) + +(defcustom projectile-project-name nil + "If this value is non-nil, it will be used as project name. + +It has precedence over function `projectile-project-name-function'." + :group 'projectile + :type 'string + :package-version '(projectile . "0.14.0")) + +(defcustom projectile-project-name-function 'projectile-default-project-name + "A function that receives the project-root and returns the project name. + +If variable `projectile-project-name' is non-nil, this function will not be used." + :group 'projectile + :type 'function + :package-version '(projectile . "0.14.0")) + +(defcustom projectile-project-root-files + '("rebar.config" ; Rebar project file + "project.clj" ; Leiningen project file + "build.boot" ; Boot-clj project file + "deps.edn" ; Clojure CLI project file + "SConstruct" ; Scons project file + "pom.xml" ; Maven project file + "build.sbt" ; SBT project file + "gradlew" ; Gradle wrapper script + "build.gradle" ; Gradle project file + ".ensime" ; Ensime configuration file + "Gemfile" ; Bundler file + "requirements.txt" ; Pip file + "setup.py" ; Setuptools file + "tox.ini" ; Tox file + "composer.json" ; Composer project file + "Cargo.toml" ; Cargo project file + "mix.exs" ; Elixir mix project file + "stack.yaml" ; Haskell's stack tool based project + "info.rkt" ; Racket package description file + "DESCRIPTION" ; R package description file + "TAGS" ; etags/ctags are usually in the root of project + "GTAGS" ; GNU Global tags + "configure.in" ; autoconf old style + "configure.ac" ; autoconf new style + "cscope.out" ; cscope + ) + "A list of files considered to mark the root of a project. +The topmost match has precedence." + :group 'projectile + :type '(repeat string)) + +(defcustom projectile-project-root-files-bottom-up + '(".projectile" ; projectile project marker + ".git" ; Git VCS root dir + ".hg" ; Mercurial VCS root dir + ".fslckout" ; Fossil VCS root dir + "_FOSSIL_" ; Fossil VCS root DB on Windows + ".bzr" ; Bazaar VCS root dir + "_darcs" ; Darcs VCS root dir + ) + "A list of files considered to mark the root of a project. +The bottommost (parentmost) match has precedence." + :group 'projectile + :type '(repeat string)) + +(defcustom projectile-project-root-files-top-down-recurring + '(".svn" ; Svn VCS root dir + "CVS" ; Csv VCS root dir + "Makefile") + "A list of files considered to mark the root of a project. +The search starts at the top and descends down till a directory +that contains a match file but its parent does not. Thus, it's a +bottommost match in the topmost sequence of directories +containing a root file." + :group 'projectile + :type '(repeat string)) + +(defcustom projectile-project-root-files-functions + '(projectile-root-local + projectile-root-bottom-up + projectile-root-top-down + projectile-root-top-down-recurring) + "A list of functions for finding project roots." + :group 'projectile + :type '(repeat function)) + +(defcustom projectile-globally-ignored-files + (list projectile-tags-file-name) + "A list of files globally ignored by projectile." + :group 'projectile + :type '(repeat string)) + +(defcustom projectile-globally-unignored-files nil + "A list of files globally unignored by projectile. + +Regular expressions can be used." + :group 'projectile + :type '(repeat string) + :package-version '(projectile . "0.14.0")) + +(defcustom projectile-globally-ignored-file-suffixes + nil + "A list of file suffixes globally ignored by projectile." + :group 'projectile + :type '(repeat string)) + +(defcustom projectile-globally-ignored-directories + '(".idea" + ".ensime_cache" + ".eunit" + ".git" + ".hg" + ".fslckout" + "_FOSSIL_" + ".bzr" + "_darcs" + ".tox" + ".svn" + ".stack-work") + "A list of directories globally ignored by projectile. + +Regular expressions can be used." + :safe (lambda (x) (not (remq t (mapcar #'stringp x)))) + :group 'projectile + :type '(repeat string)) + +(defcustom projectile-globally-unignored-directories nil + "A list of directories globally unignored by projectile." + :group 'projectile + :type '(repeat string) + :package-version '(projectile . "0.14.0")) + +(defcustom projectile-globally-ignored-modes + '("erc-mode" + "help-mode" + "completion-list-mode" + "Buffer-menu-mode" + "gnus-.*-mode" + "occur-mode") + "A list of regular expressions for major modes ignored by projectile. + +If a buffer is using a given major mode, projectile will ignore +it for functions working with buffers." + :group 'projectile + :type '(repeat string)) + +(defcustom projectile-globally-ignored-buffers nil + "A list of buffer-names ignored by projectile. + +If a buffer is in the list projectile will ignore it for +functions working with buffers. Regular expressions can be used." + :group 'projectile + :type '(repeat string) + :package-version '(projectile . "0.12.0")) + +(defcustom projectile-find-file-hook nil + "Hooks run when a file is opened with `projectile-find-file'." + :group 'projectile + :type 'hook) + +(defcustom projectile-find-dir-hook nil + "Hooks run when a directory is opened with `projectile-find-dir'." + :group 'projectile + :type 'hook) + +(defcustom projectile-switch-project-action 'projectile-find-file + "Action invoked after switching projects with `projectile-switch-project'. + +Any function that does not take arguments will do." + :group 'projectile + :type 'function) + +(defcustom projectile-find-dir-includes-top-level nil + "If true, add top-level dir to options offered by `projectile-find-dir'." + :group 'projectile + :type 'boolean) + +(defcustom projectile-use-git-grep nil + "If true, use `vc-git-grep' in git projects." + :group 'projectile + :type 'boolean) + +(defcustom projectile-grep-finished-hook nil + "Hooks run when `projectile-grep' finishes." + :group 'projectile + :type 'hook + :package-version '(projectile . "0.14.0")) + +(defcustom projectile-test-prefix-function 'projectile-test-prefix + "Function to find test files prefix based on PROJECT-TYPE." + :group 'projectile + :type 'function) + +(defcustom projectile-test-suffix-function 'projectile-test-suffix + "Function to find test files suffix based on PROJECT-TYPE." + :group 'projectile + :type 'function) + + +;;; Idle Timer +(defvar projectile-idle-timer nil + "The timer object created when `projectile-enable-idle-timer' is non-nil.") + +(defcustom projectile-idle-timer-seconds 30 + "The idle period to use when `projectile-enable-idle-timer' is non-nil." + :group 'projectile + :type 'number) + +(defcustom projectile-idle-timer-hook '(projectile-regenerate-tags) + "The hook run when `projectile-enable-idle-timer' is non-nil." + :group 'projectile + :type '(repeat symbol)) + +(defcustom projectile-enable-idle-timer nil + "Enables idle timer hook `projectile-idle-timer-functions'. + +When `projectile-enable-idle-timer' is non-nil, the hook +`projectile-idle-timer-hook' is run each time Emacs has been idle +for `projectile-idle-timer-seconds' seconds and we're in a +project." + :group 'projectile + :set (lambda (symbol value) + (set symbol value) + (when projectile-idle-timer + (cancel-timer projectile-idle-timer)) + (setq projectile-idle-timer nil) + (when projectile-enable-idle-timer + (setq projectile-idle-timer (run-with-idle-timer + projectile-idle-timer-seconds t + (lambda () + (when (projectile-project-p) + (run-hooks 'projectile-idle-timer-hook))))))) + :type 'boolean) + +;;; Serialization +(defun projectile-serialize (data filename) + "Serialize DATA to FILENAME. + +The saved data can be restored with `projectile-unserialize'." + (when (file-writable-p filename) + (with-temp-file filename + (insert (let (print-length) (prin1-to-string data)))))) + +(defun projectile-unserialize (filename) + "Read data serialized by `projectile-serialize' from FILENAME." + (with-demoted-errors + "Error during file deserialization: %S" + (when (file-exists-p filename) + (with-temp-buffer + (insert-file-contents filename) + ;; this will blow up if the contents of the file aren't + ;; lisp data structures + (read (buffer-string)))))) + +(defvar projectile-projects-cache nil + "A hashmap used to cache project file names to speed up related operations.") + +(defvar projectile-projects-cache-time nil + "A hashmap used to record when we populated `projectile-projects-cache'.") + +(defvar projectile-project-root-cache (make-hash-table :test 'equal) + "Cached value of function `projectile-project-root`.") + +(defvar projectile-project-type-cache (make-hash-table :test 'equal) + "A hashmap used to cache project type to speed up related operations.") + +(defvar projectile-known-projects nil + "List of locations where we have previously seen projects. +The list of projects is ordered by the time they have been accessed. + +See also `projectile-remove-known-project', +`projectile-cleanup-known-projects' and `projectile-clear-known-projects'.") + +(defvar projectile-known-projects-on-file nil + "List of known projects reference point. + +Contains a copy of `projectile-known-projects' when it was last +synchronized with `projectile-known-projects-file'.") + +(defcustom projectile-known-projects-file + (expand-file-name "projectile-bookmarks.eld" + user-emacs-directory) + "Name and location of the Projectile's known projects file." + :group 'projectile + :type 'string) + +(defcustom projectile-ignored-projects nil + "A list of projects not to be added to `projectile-known-projects'." + :group 'projectile + :type '(repeat :tag "Project list" directory) + :package-version '(projectile . "0.11.0")) + +(defcustom projectile-ignored-project-function nil + "Function to decide if a project is added to `projectile-known-projects'. + +Can be either nil, or a function that takes the truename of the +project root as argument and returns non-nil if the project is to +be ignored or nil otherwise. + +This function is only called if the project is not listed in +`projectile-ignored-projects'. + +A suitable candidate would be `file-remote-p' to ignore remote +projects." + :group 'projectile + :type '(choice + (const :tag "Nothing" nil) + (const :tag "Remote files" file-remote-p) + function) + :package-version '(projectile . "0.13.0")) + +(defcustom projectile-track-known-projects-automatically t + "Controls whether Projectile will automatically register known projects. + +When set to nil you'll have always add projects explicitly with +`projectile-add-known-project'." + :group 'projectile + :type 'boolean + :package-version '(projectile . "1.0.0")) + +(defcustom projectile-project-search-path nil + "List of folders where projectile is automatically going to look for projects. +You can think of something like $PATH, but for projects instead of executables. +Examples of such paths might be ~/projects, ~/work, etc." + :group 'projectile + :type 'list + :package-version '(projectile . "1.0.0")) + + +;;; Version information + +;;;###autoload +(defun projectile-version (&optional show-version) + "Get the Projectile version as string. + +If called interactively or if SHOW-VERSION is non-nil, show the +version in the echo area and the messages buffer. + +The returned string includes both, the version from package.el +and the library version, if both a present and different. + +If the version number could not be determined, signal an error, +if called interactively, or if SHOW-VERSION is non-nil, otherwise +just return nil." + (interactive (list t)) + (if (require 'pkg-info nil t) + (let ((version (pkg-info-version-info 'projectile))) + (when show-version + (message "Projectile %s" version)) + version) + (error "Cannot determine version without package pkg-info"))) + + +;;; Caching +(defvar projectile-file-exists-cache + (make-hash-table :test 'equal) + "Cached `projectile-file-exists-p' results.") + +(defvar projectile-file-exists-cache-timer nil + "Timer for scheduling`projectile-file-exists-cache-cleanup'.") + +(defun projectile-file-exists-cache-cleanup () + "Removed timed out cache entries and reschedules or remove the +timer if no more items are in the cache." + (let ((now (current-time))) + (maphash (lambda (key value) + (if (time-less-p (cdr value) now) + (remhash key projectile-file-exists-cache))) + projectile-file-exists-cache) + (setq projectile-file-exists-cache-timer + (if (> (hash-table-count projectile-file-exists-cache) 0) + (run-with-timer 10 nil 'projectile-file-exists-cache-cleanup))))) + +(defun projectile-file-exists-p (filename) + "Return t if file FILENAME exist. +A wrapper around `file-exists-p' with additional caching support." + (let* ((file-remote (file-remote-p filename)) + (expire-seconds + (if file-remote + (and projectile-file-exists-remote-cache-expire + (> projectile-file-exists-remote-cache-expire 0) + projectile-file-exists-remote-cache-expire) + (and projectile-file-exists-local-cache-expire + (> projectile-file-exists-local-cache-expire 0) + projectile-file-exists-local-cache-expire))) + (remote-file-name-inhibit-cache (if expire-seconds + expire-seconds + remote-file-name-inhibit-cache))) + (if (not expire-seconds) + (file-exists-p filename) + (let* ((current-time (current-time)) + (cached (gethash filename projectile-file-exists-cache)) + (cached-value (if cached (car cached))) + (cached-expire (if cached (cdr cached))) + (cached-expired (if cached (time-less-p cached-expire current-time) t)) + (value (or (and (not cached-expired) cached-value) + (if (file-exists-p filename) 'found 'notfound)))) + (when (or (not cached) cached-expired) + (puthash filename + (cons value (time-add current-time (seconds-to-time expire-seconds))) + projectile-file-exists-cache)) + (unless projectile-file-exists-cache-timer + (setq projectile-file-exists-cache-timer + (run-with-timer 10 nil 'projectile-file-exists-cache-cleanup))) + (equal value 'found))))) + +;;;###autoload +(defun projectile-invalidate-cache (arg) + "Remove the current project's files from `projectile-projects-cache'. + +With a prefix argument ARG prompts for the name of the project whose cache +to invalidate." + (interactive "P") + (let ((project-root + (if arg + (completing-read "Remove cache for: " + (projectile-hash-keys projectile-projects-cache)) + (projectile-project-root)))) + (setq projectile-project-root-cache (make-hash-table :test 'equal)) + (remhash project-root projectile-project-type-cache) + (remhash project-root projectile-projects-cache) + (remhash project-root projectile-projects-cache-time) + (projectile-serialize-cache) + (when projectile-verbose + (message "Invalidated Projectile cache for %s." + (propertize project-root 'face 'font-lock-keyword-face)))) + (when (fboundp 'recentf-cleanup) + (recentf-cleanup))) + +(defun projectile-time-seconds () + "Return the number of seconds since the unix epoch." + (cl-destructuring-bind (high low _usec _psec) (current-time) + (+ (lsh high 16) low))) + +(defun projectile-cache-project (project files) + "Cache PROJECTs FILES. +The cache is created both in memory and on the hard drive." + (when projectile-enable-caching + (puthash project files projectile-projects-cache) + (puthash project (projectile-time-seconds) projectile-projects-cache-time) + (projectile-serialize-cache))) + +;;;###autoload +(defun projectile-purge-file-from-cache (file) + "Purge FILE from the cache of the current project." + (interactive + (list (projectile-completing-read + "Remove file from cache: " + (projectile-current-project-files)))) + (let* ((project-root (projectile-project-root)) + (project-cache (gethash project-root projectile-projects-cache))) + (if (projectile-file-cached-p file project-root) + (progn + (puthash project-root (remove file project-cache) projectile-projects-cache) + (projectile-serialize-cache) + (when projectile-verbose + (message "%s removed from cache" file))) + (error "%s is not in the cache" file)))) + +;;;###autoload +(defun projectile-purge-dir-from-cache (dir) + "Purge DIR from the cache of the current project." + (interactive + (list (projectile-completing-read + "Remove directory from cache: " + (projectile-current-project-dirs)))) + (let* ((project-root (projectile-project-root)) + (project-cache (gethash project-root projectile-projects-cache))) + (puthash project-root + (cl-remove-if (lambda (str) (string-prefix-p dir str)) project-cache) + projectile-projects-cache))) + +(defun projectile-file-cached-p (file project) + "Check if FILE is already in PROJECT cache." + (member file (gethash project projectile-projects-cache))) + +;;;###autoload +(defun projectile-cache-current-file () + "Add the currently visited file to the cache." + (interactive) + (let ((current-project (projectile-project-root))) + (when (and (buffer-file-name) (gethash (projectile-project-root) projectile-projects-cache)) + (let* ((abs-current-file (file-truename (buffer-file-name))) + (current-file (file-relative-name abs-current-file current-project))) + (unless (or (projectile-file-cached-p current-file current-project) + (projectile-ignored-directory-p (file-name-directory abs-current-file)) + (projectile-ignored-file-p abs-current-file)) + (puthash current-project + (cons current-file (gethash current-project projectile-projects-cache)) + projectile-projects-cache) + (projectile-serialize-cache) + (message "File %s added to project %s cache." + (propertize current-file 'face 'font-lock-keyword-face) + (propertize current-project 'face 'font-lock-keyword-face))))))) + +;; cache opened files automatically to reduce the need for cache invalidation +(defun projectile-cache-files-find-file-hook () + "Function for caching files with `find-file-hook'." + (let ((project-root (projectile-project-p))) + (when (and projectile-enable-caching + project-root + (not (projectile-ignored-project-p project-root))) + (projectile-cache-current-file)))) + +(defun projectile-track-known-projects-find-file-hook () + "Function for caching projects with `find-file-hook'." + (when (and projectile-track-known-projects-automatically (projectile-project-p)) + (let ((known-projects (and (sequencep projectile-known-projects) + (copy-sequence projectile-known-projects)))) + (projectile-add-known-project (projectile-project-root)) + (unless (equal known-projects projectile-known-projects) + (projectile-merge-known-projects))))) + + +(defun projectile-maybe-invalidate-cache (force) + "Invalidate if FORCE or project's dirconfig newer than cache." + (when (or force (file-newer-than-file-p (projectile-dirconfig-file) + projectile-cache-file)) + (projectile-invalidate-cache nil))) + +;;;###autoload +(defun projectile-discover-projects-in-directory (directory) + "Discover any projects in DIRECTORY and add them to the projectile cache. +This function is not recursive and only adds projects with roots +at the top level of DIRECTORY." + (interactive + (list (read-directory-name "Starting directory: "))) + (let ((subdirs (directory-files directory t))) + (mapcar + (lambda (dir) + (when (and (file-directory-p dir) + (not (member (file-name-nondirectory dir) '(".." ".")))) + (let ((default-directory dir) + (projectile-cached-project-root dir)) + (when (projectile-project-p) + (projectile-add-known-project (projectile-project-root)))))) + subdirs))) + +(defun projectile-discover-projects-in-search-path () + "Discover projects in `projectile-project-search-path'. +Invoked automatically when `projectile-mode' is enabled." + (interactive) + (mapcar #'projectile-discover-projects-in-directory projectile-project-search-path)) + + +(defadvice delete-file (before purge-from-projectile-cache (filename &optional trash)) + (if (and projectile-enable-caching (projectile-project-p)) + (let* ((project-root (projectile-project-root)) + (true-filename (file-truename filename)) + (relative-filename (file-relative-name true-filename project-root))) + (if (projectile-file-cached-p relative-filename project-root) + (projectile-purge-file-from-cache relative-filename))))) + + +;;; Project root related utilities +(defun projectile-parent (path) + "Return the parent directory of PATH. +PATH may be a file or directory and directory paths may end with a slash." + (directory-file-name (file-name-directory (directory-file-name (expand-file-name path))))) + +(defun projectile-locate-dominating-file (file name) + "Look up the directory hierarchy from FILE for a directory containing NAME. +Stop at the first parent directory containing a file NAME, +and return the directory. Return nil if not found. +Instead of a string, NAME can also be a predicate taking one argument +\(a directory) and returning a non-nil value if that directory is the one for +which we're looking." + ;; copied from files.el (stripped comments) emacs-24 bzr branch 2014-03-28 10:20 + (setq file (abbreviate-file-name file)) + (let ((root nil) + try) + (while (not (or root + (null file) + (string-match locate-dominating-stop-dir-regexp file))) + (setq try (if (stringp name) + (projectile-file-exists-p (expand-file-name name file)) + (funcall name file))) + (cond (try (setq root file)) + ((equal file (setq file (file-name-directory + (directory-file-name file)))) + (setq file nil)))) + (and root (expand-file-name (file-name-as-directory root))))) + +(defvar-local projectile-project-root nil + "Defines a custom Projectile project root. +This is intended to be used as a file local variable.") + +(defun projectile-root-local (_dir) + "A simple wrapper around `projectile-project-root'." + projectile-project-root) + +(defun projectile-root-top-down (dir &optional list) + "Identify a project root in DIR by top-down search for files in LIST. +If LIST is nil, use `projectile-project-root-files' instead. +Return the first (topmost) matched directory or nil if not found." + (projectile-locate-dominating-file + dir + (lambda (dir) + (cl-find-if (lambda (f) (projectile-file-exists-p (expand-file-name f dir))) + (or list projectile-project-root-files))))) + +(defun projectile-root-bottom-up (dir &optional list) + "Identify a project root in DIR by bottom-up search for files in LIST. +If LIST is nil, use `projectile-project-root-files-bottom-up' instead. +Return the first (bottommost) matched directory or nil if not found." + (cl-some (lambda (name) (projectile-locate-dominating-file dir name)) + (or list projectile-project-root-files-bottom-up))) + +(defun projectile-root-top-down-recurring (dir &optional list) + "Identify a project root in DIR by recurring top-down search for files in LIST. +If LIST is nil, use `projectile-project-root-files-top-down-recurring' +instead. Return the last (bottommost) matched directory in the +topmost sequence of matched directories. Nil otherwise." + (cl-some + (lambda (f) + (projectile-locate-dominating-file + dir + (lambda (dir) + (and (projectile-file-exists-p (expand-file-name f dir)) + (or (string-match locate-dominating-stop-dir-regexp (projectile-parent dir)) + (not (projectile-file-exists-p (expand-file-name f (projectile-parent dir))))))))) + (or list projectile-project-root-files-top-down-recurring))) + +(defvar-local projectile-cached-project-root nil + "Cached root of the current Projectile project. If non-nil, it +is used as the return value of `projectile-project-root' for +performance (unless the variable `projectile-project-root' is +also set). If nil, it is recalculated the next time +`projectile-project-root' is called. + +This variable is reset automatically when Projectile detects that +the `buffer-file-name' has changed. It can also be reset manually +by calling `projectile-reset-cached-project-root'.") + +(defvar-local projectile-cached-buffer-file-name nil + "The last known value of `buffer-file-name' for the current +buffer. This is used to detect a change in `buffer-file-name', +which triggers a reset of `projectile-cached-project-root' and +`projectile-cached-project-name'.") + +(defun projectile-project-root () + "Retrieves the root directory of a project if available. +The current directory is assumed to be the project's root otherwise. + +When not in project the behaviour of the function is controlled by +`projectile-require-project-root'. If it's set to nil the function +will return the current directory, otherwise it'd raise an error." + ;; the cached value will be 'none in the case of no project root (this is to + ;; ensure it is not reevaluated each time when not inside a project) so use + ;; cl-subst to replace this 'none value with nil so a nil value is used + ;; instead + (or (cl-subst nil 'none + (or (and projectile-cached-buffer-file-name + (equal projectile-cached-buffer-file-name (or buffer-file-name 'none)) + projectile-cached-project-root) + (progn + (setq projectile-cached-buffer-file-name (or buffer-file-name 'none)) + (setq projectile-cached-project-root + ;; The `is-local' and `is-connected' variables are + ;; used to fix the behavior where Emacs hangs + ;; because of Projectile when you open a file over + ;; TRAMP. It basically prevents Projectile from + ;; trying to find information about files for which + ;; it's not possible to get that information right + ;; now. + (or (let* ((dir default-directory) + (is-local (not (file-remote-p dir))) ;; `true' if the file is local + (is-connected (file-remote-p dir nil t))) ;; `true' if the file is remote AND we are connected to the remote + (when (or is-local is-connected) + (cl-some + (lambda (func) + (let* ((cache-key (format "%s-%s" func dir)) + (cache-value (gethash cache-key projectile-project-root-cache))) + (if (and cache-value (file-exists-p cache-value)) + cache-value + (let ((value (funcall func (file-truename dir)))) + (puthash cache-key value projectile-project-root-cache) + value)))) + projectile-project-root-files-functions))) + ;; set cached to none so is non-nil so we don't try + ;; and look it up again + 'none))))) + (if projectile-require-project-root + (error "You're not in a project") + default-directory))) + +(defun projectile-file-truename (file-name) + "Return the truename of FILE-NAME. +A thin wrapper around `file-truename' that handles nil." + (when file-name + (file-truename file-name))) + +(defun projectile-project-p () + "Check if we're in a project." + (condition-case nil + (projectile-project-root) + (error nil))) + +(defun projectile-default-project-name (project-root) + "Default function used create project name to be displayed based on the value of PROJECT-ROOT." + (file-name-nondirectory (directory-file-name project-root))) + +(defvar-local projectile-cached-project-name nil + "Cached name of the current Projectile project. If non-nil, it +is used as the return value of `projectile-project-name' for +performance (unless the variable `projectile-project-name' is +also set). If nil, it is recalculated the next time +`projectile-project-name' is called. + +This variable is reset automatically when Projectile detects that +the `buffer-file-name' has changed. It can also be reset manually +by calling `projectile-reset-cached-project-name'.") + +(defun projectile-reset-cached-project-root () + "Reset the value of `projectile-cached-project-root' to nil. + +This means that it is automatically recalculated the next time +function `projectile-project-root' is called." + (interactive) + (setq projectile-cached-project-root nil)) + +(defun projectile-reset-cached-project-name () + "Reset the value of `projectile-cached-project-name' to nil. + +This means that it is automatically recalculated the next time +function `projectile-project-name' is called." + (interactive) + (setq projectile-cached-project-name nil)) + +(defun projectile-project-name () + "Return project name." + (or projectile-project-name + (and projectile-cached-buffer-file-name + (equal projectile-cached-buffer-file-name buffer-file-name) + projectile-cached-project-name) + (progn + (setq projectile-cached-buffer-file-name buffer-file-name) + (setq projectile-cached-project-name + (let ((project-root + (condition-case nil + (projectile-project-root) + (error nil)))) + (if project-root + (funcall projectile-project-name-function project-root) + "-")))))) + + +;;; Project indexing +(defun projectile-get-project-directories () + "Get the list of project directories that are of interest to the user." + (mapcar (lambda (subdir) (concat (projectile-project-root) subdir)) + (or (nth 0 (projectile-parse-dirconfig-file)) '("")))) + +(defun projectile-dir-files (directory) + "List the files in DIRECTORY and in its sub-directories. +Files are returned as relative paths to the project root." + ;; check for a cache hit first if caching is enabled + (let ((files-list (and projectile-enable-caching + (gethash directory projectile-projects-cache))) + (root (projectile-project-root))) + ;; cache disabled or cache miss + (or files-list + (if (eq projectile-indexing-method 'native) + (projectile-dir-files-native root directory) + ;; use external tools to get the project files + (projectile-adjust-files (projectile-dir-files-external root directory)))))) + +(defun projectile-dir-files-native (root directory) + "Get the files for ROOT under DIRECTORY using just Emacs Lisp." + (let ((progress-reporter + (make-progress-reporter + (format "Projectile is indexing %s" + (propertize directory 'face 'font-lock-keyword-face))))) + ;; we need the files with paths relative to the project root + (mapcar (lambda (file) (file-relative-name file root)) + (projectile-index-directory directory (projectile-filtering-patterns) + progress-reporter)))) + +(defun projectile-dir-files-external (root directory) + "Get the files for ROOT under DIRECTORY using external tools." + (let ((default-directory directory)) + (mapcar (lambda (file) + (file-relative-name (expand-file-name file directory) root)) + (projectile-get-repo-files)))) + +(defcustom projectile-git-command "git ls-files -zco --exclude-standard" + "Command used by projectile to get the files in a git project." + :group 'projectile + :type 'string) + +(defcustom projectile-git-submodule-command "git submodule --quiet foreach 'echo $path' | tr '\\n' '\\0'" + "Command used by projectile to list submodules of a given git repository. +Set to nil to disable listing submodules contents." + :group 'projectile + :type 'string) + +(defcustom projectile-git-ignored-command "git ls-files -zcoi --exclude-standard" + "Command used by projectile to get the ignored files in a git project." + :group 'projectile + :type 'string + :package-version '(projectile . "0.14.0")) + +(defcustom projectile-hg-command "hg locate -f -0 -I ." + "Command used by projectile to get the files in a hg project." + :group 'projectile + :type 'string) + +(defcustom projectile-fossil-command (concat "fossil ls | " + (when (string-equal system-type + "windows-nt") + "dos2unix | ") + "tr '\\n' '\\0'") + "Command used by projectile to get the files in a fossil project." + :group 'projectile + :type 'string) + +(defcustom projectile-bzr-command "bzr ls -R --versioned -0" + "Command used by projectile to get the files in a bazaar project." + :group 'projectile + :type 'string) + +(defcustom projectile-darcs-command "darcs show files -0 . " + "Command used by projectile to get the files in a darcs project." + :group 'projectile + :type 'string) + +(defcustom projectile-svn-command "svn list -R . | grep -v '$/' | tr '\\n' '\\0'" + "Command used by projectile to get the files in a svn project." + :group 'projectile + :type 'string) + +(defcustom projectile-generic-command "find . -type f -print0" + "Command used by projectile to get the files in a generic project." + :group 'projectile + :type 'string) + +(defcustom projectile-vcs-dirty-state '("edited" "unregistered" "needs-update" "needs-merge" "unlocked-changes" "conflict") + "List of states checked by `projectile-browse-dirty-projects'. +Possible checked states are: +\"edited\", \"unregistered\", \"needs-update\", \"needs-merge\", +\"unlocked-changes\" and \"conflict\", +as defined in `vc.el'." + :group 'projectile + :type '(repeat (string)) + :package-version '(projectile . "1.0.0")) + +(defun projectile-get-ext-command () + "Determine which external command to invoke based on the project's VCS." + (let ((vcs (projectile-project-vcs))) + (cond + ((eq vcs 'git) projectile-git-command) + ((eq vcs 'hg) projectile-hg-command) + ((eq vcs 'fossil) projectile-fossil-command) + ((eq vcs 'bzr) projectile-bzr-command) + ((eq vcs 'darcs) projectile-darcs-command) + ((eq vcs 'svn) projectile-svn-command) + (t projectile-generic-command)))) + +(defun projectile-get-sub-projects-command () + (let ((vcs (projectile-project-vcs))) + (cond + ((eq vcs 'git) projectile-git-submodule-command) + (t "")))) + +(defun projectile-get-ext-ignored-command () + "Determine which external command to invoke based on the project's VCS." + (let ((vcs (projectile-project-vcs))) + (cond + ((eq vcs 'git) projectile-git-ignored-command) + ;; TODO: Add support for other VCS + (t nil)))) + +(defun projectile-flatten (lst) + "Take a nested list LST and return its contents as a single, flat list." + (if (and (listp lst) (listp (cdr lst))) + (cl-mapcan 'projectile-flatten lst) + (list lst))) + +(defun projectile-get-all-sub-projects (project) + "Get all sub-projects for a given project. + +PROJECT is base directory to start search recursively." + (let ((submodules (projectile-get-immediate-sub-projects project))) + (cond + ((null submodules) + nil) + (t + (nconc submodules (projectile-flatten + ;; recursively get sub-projects of each sub-project + (mapcar (lambda (s) + (projectile-get-all-sub-projects s)) submodules))))))) + +(defun projectile-get-immediate-sub-projects (path) + "Get immediate sub-projects for a given project without recursing. + +PATH is the vcs root or project root from which to start +searching, and should end with an appropriate path delimiter, such as +'/' or a '\\'. + +If the vcs get-sub-projects query returns results outside of path, +they are excluded from the results of this function." + (let* ((default-directory path) + ;; search for sub-projects under current project `project' + (submodules (mapcar + (lambda (s) + (file-name-as-directory (expand-file-name s default-directory))) + (projectile-files-via-ext-command (projectile-get-sub-projects-command)))) + (project-child-folder-regex + (concat "\\`" + (regexp-quote path)))) + + ;; If project root is inside of an VCS folder, but not actually an + ;; VCS root itself, submodules external to the project will be + ;; included in the VCS get sub-projects result. Let's remove them. + (cl-remove-if-not + (lambda (submodule) + (string-match-p project-child-folder-regex + submodule)) + submodules))) + +(defun projectile-get-sub-projects-files () + "Get files from sub-projects recursively." + (projectile-flatten + (mapcar (lambda (s) + (let ((default-directory s)) + (mapcar (lambda (f) + (concat s f)) + (projectile-files-via-ext-command projectile-git-command)))) + (condition-case nil + (projectile-get-all-sub-projects (projectile-project-root)) + (error nil))))) + +(defun projectile-get-repo-files () + "Get a list of the files in the project, including sub-projects." + (cond + ((eq (projectile-project-vcs) 'git) + (nconc (projectile-files-via-ext-command (projectile-get-ext-command)) + (projectile-get-sub-projects-files))) + (t (projectile-files-via-ext-command (projectile-get-ext-command))))) + +(defun projectile-get-repo-ignored-files () + "Get a list of the files ignored in the project." + (let ((cmd (projectile-get-ext-ignored-command))) + (when cmd + (projectile-files-via-ext-command cmd)))) + +(defun projectile-get-repo-ignored-directory (dir) + "Get a list of the files ignored in the project in the directory DIR." + (let ((cmd (projectile-get-ext-ignored-command))) + (when cmd + (projectile-files-via-ext-command (concat cmd " " dir))))) + +(defun projectile-call-process-to-string (program &rest args) + "Invoke the executable PROGRAM with ARGS and return the output as a string." + (with-temp-buffer + (apply 'call-process program nil (current-buffer) nil args) + (buffer-string))) + +(defun projectile-shell-command-to-string (command) + "Try to run COMMAND without actually using a shell and return the output. + +The function `eshell-search-path' will be used to search the PATH +environment variable for an appropriate executable using the text +occuring before the first space. If no executable is found, +fallback to `shell-command-to-string'." + (cl-destructuring-bind + (the-command . args) (split-string command " ") + (let ((binary-path (eshell-search-path the-command))) + (if binary-path + (apply 'projectile-call-process-to-string binary-path args) + (shell-command-to-string command))))) + +(defun projectile-check-vcs-status (&optional PROJECT-PATH) + "Check the status of the current project. +If PROJECT-PATH is a project, check this one instead." + (let* ((PROJECT-PATH (or PROJECT-PATH (projectile-project-root))) + (project-status nil)) + (save-excursion + (vc-dir PROJECT-PATH) + ;; wait until vc-dir is done + (while (vc-dir-busy) (sleep-for 0 100)) + ;; check for status + (save-excursion + (save-match-data + (dolist (check projectile-vcs-dirty-state) + (goto-char (point-min)) + (when (search-forward check nil t) + (setq project-status (cons check project-status)))))) + (kill-buffer) + project-status))) + +(defvar projectile-cached-dirty-projects-status nil + "Cache of the last dirty projects check.") + +(defun projectile-check-vcs-status-of-known-projects () + "Return the list of dirty projects. +The list is composed of sublists~: (project-path, project-status). +Raise an error if their is no dirty project." + (save-window-excursion + (message "Checking for modifications in known projects...") + (let ((projects projectile-known-projects) + (status ())) + (dolist (project projects) + (when (and (projectile-keep-project-p project) (not (string= 'none (projectile-project-vcs project)))) + (let ((tmp-status (projectile-check-vcs-status project))) + (when tmp-status + (setq status (cons (list project tmp-status) status)))))) + (when (= (length status) 0) + (message "No dirty projects have been found")) + (setq projectile-cached-dirty-projects-status status) + status))) + +(defun projectile-browse-dirty-projects (&optional cached) + "Browse dirty version controlled projects. + +With a prefix argument, or if CACHED is non-nil, try to use the cached +dirty project list." + (interactive "P") + (let ((status (if (and cached projectile-cached-dirty-projects-status) + projectile-cached-dirty-projects-status + (projectile-check-vcs-status-of-known-projects))) + (mod-proj nil)) + (while (not (= (length status) 0)) + (setq mod-proj (cons (car (pop status)) mod-proj))) + (projectile-completing-read "Select project: " mod-proj + :action 'projectile-vc))) + +(defun projectile-files-via-ext-command (command) + "Get a list of relative file names in the project root by executing COMMAND." + (split-string (shell-command-to-string command) "\0" t)) + +(defun projectile-index-directory (directory patterns progress-reporter) + "Index DIRECTORY taking into account PATTERNS. +The function calls itself recursively until all sub-directories +have been indexed. The PROGRESS-REPORTER is updated while the +function is executing." + (apply 'append + (mapcar + (lambda (f) + (unless (or (and patterns (projectile-ignored-rel-p f directory patterns)) + (member (file-name-nondirectory (directory-file-name f)) + '("." ".." ".svn" ".cvs"))) + (progress-reporter-update progress-reporter) + (if (file-directory-p f) + (unless (projectile-ignored-directory-p + (file-name-as-directory f)) + (projectile-index-directory f patterns progress-reporter)) + (unless (projectile-ignored-file-p f) + (list f))))) + (directory-files directory t)))) + +(defun projectile-adjust-files (files) + "First remove ignored files from FILES, then add back unignored files." + (projectile-add-unignored (projectile-remove-ignored files))) + +(defun projectile-remove-ignored (files) + "Remove ignored files and folders from FILES. + +If ignored directory prefixed with '*', then ignore all +directories/subdirectories with matching filename, +otherwise operates relative to project root." + (let ((ignored-files (projectile-ignored-files-rel)) + (ignored-dirs (projectile-ignored-directories-rel))) + (cl-remove-if + (lambda (file) + (or (cl-some + (lambda (f) + (string= f (file-name-nondirectory file))) + ignored-files) + (cl-some + (lambda (dir) + ;; if the directory is prefixed with '*' then ignore all directories matching that name + (if (string-prefix-p "*" dir) + ;; remove '*' and trailing slash from ignored directory name + (let ((d (substring dir 1 (if (equal (substring dir -1) "/") -1 nil)))) + (cl-some + (lambda (p) + (string= d p)) + ;; split path by '/', remove empty strings, and check if any subdirs match name 'd' + (delete "" (split-string (or (file-name-directory file) "") "/")))) + (string-prefix-p dir file))) + ignored-dirs) + (cl-some + (lambda (suf) + (string-suffix-p suf file t)) + projectile-globally-ignored-file-suffixes))) + files))) + +(defun projectile-keep-ignored-files (files) + "Filter FILES to retain only those that are ignored." + (when files + (cl-remove-if-not + (lambda (file) + (cl-some (lambda (f) (string-prefix-p f file)) files)) + (projectile-get-repo-ignored-files)))) + +(defun projectile-keep-ignored-directories (directories) + "Get ignored files within each of DIRECTORIES." + (when directories + (let (result) + (dolist (dir directories result) + (setq result (append result + (projectile-get-repo-ignored-directory dir)))) + result))) + +(defun projectile-add-unignored (files) + "This adds unignored files to FILES. + +Useful because the VCS may not return ignored files at all. In +this case unignored files will be absent from FILES." + (let ((unignored-files (projectile-keep-ignored-files + (projectile-unignored-files-rel))) + (unignored-paths (projectile-remove-ignored + (projectile-keep-ignored-directories + (projectile-unignored-directories-rel))))) + (append files unignored-files unignored-paths))) + +(defun projectile-buffers-with-file (buffers) + "Return only those BUFFERS backed by files." + (cl-remove-if-not (lambda (b) (buffer-file-name b)) buffers)) + +(defun projectile-buffers-with-file-or-process (buffers) + "Return only those BUFFERS backed by files or processes." + (cl-remove-if-not (lambda (b) (or (buffer-file-name b) + (get-buffer-process b))) buffers)) + +(defun projectile-project-buffers () + "Get a list of project buffers." + (let* ((project-root (projectile-project-root)) + (all-buffers (cl-remove-if-not + (lambda (buffer) + (projectile-project-buffer-p buffer project-root)) + (buffer-list)))) + (if projectile-buffers-filter-function + (funcall projectile-buffers-filter-function all-buffers) + all-buffers))) + +(defun projectile-process-current-project-buffers (action) + "Process the current project's buffers using ACTION." + (let ((project-buffers (projectile-project-buffers))) + (dolist (buffer project-buffers) + (funcall action buffer)))) + +(defun projectile-project-buffer-files () + "Get a list of project buffer files." + (let ((project-root (projectile-project-root))) + (mapcar + (lambda (buffer) + (file-relative-name + (buffer-file-name buffer) + project-root)) + (projectile-buffers-with-file + (projectile-project-buffers))))) + +(defun projectile-project-buffer-p (buffer project-root) + "Check if BUFFER is under PROJECT-ROOT." + (with-current-buffer buffer + (and (not (string-prefix-p " " (buffer-name buffer))) + (not (projectile-ignored-buffer-p buffer)) + (string-equal (file-remote-p default-directory) + (file-remote-p project-root)) + (not (string-match-p "^http\\(s\\)?://" default-directory)) + (string-prefix-p project-root (file-truename default-directory) (eq system-type 'windows-nt))))) + +(defun projectile-ignored-buffer-p (buffer) + "Check if BUFFER should be ignored. + +Regular expressions can be use." + (or + (with-current-buffer buffer + (cl-some + (lambda (name) + (string-match-p name (buffer-name))) + projectile-globally-ignored-buffers)) + (with-current-buffer buffer + (cl-some + (lambda (mode) + (string-match-p (concat "^" mode "$") + (symbol-name major-mode))) + projectile-globally-ignored-modes)))) + +(defun projectile-difference (list1 list2) + (cl-remove-if + (lambda (x) (member x list2)) + list1)) + +(defun projectile-recently-active-files () + "Get list of recently active files. + +Files are ordered by recently active buffers, and then recently +opened through use of recentf." + (let ((project-buffer-files (projectile-project-buffer-files))) + (append project-buffer-files + (projectile-difference + (projectile-recentf-files) + project-buffer-files)))) + +(defun projectile-project-buffer-names () + "Get a list of project buffer names." + (mapcar #'buffer-name (projectile-project-buffers))) + +(defun projectile-prepend-project-name (string) + "Prepend the current project's name to STRING." + (format "[%s] %s" (projectile-project-name) string)) + +(defun projectile-read-buffer-to-switch (prompt) + "Read the name of a buffer to switch to, prompting with PROMPT. + +This function excludes the current buffer from the offered +choices." + (projectile-completing-read + prompt + (delete (buffer-name (current-buffer)) + (projectile-project-buffer-names)))) + +;;;###autoload +(defun projectile-switch-to-buffer () + "Switch to a project buffer." + (interactive) + (switch-to-buffer + (projectile-read-buffer-to-switch "Switch to buffer: "))) + +;;;###autoload +(defun projectile-switch-to-buffer-other-window () + "Switch to a project buffer and show it in another window." + (interactive) + (switch-to-buffer-other-window + (projectile-read-buffer-to-switch "Switch to buffer: "))) + +;;;###autoload +(defun projectile-switch-to-buffer-other-frame () + "Switch to a project buffer and show it in another window." + (interactive) + (switch-to-buffer-other-frame + (projectile-read-buffer-to-switch "Switch to buffer: "))) + +;;;###autoload +(defun projectile-display-buffer () + "Display a project buffer in another window without selecting it." + (interactive) + (display-buffer + (projectile-completing-read + "Display buffer: " + (projectile-project-buffer-names)))) + +;;;###autoload +(defun projectile-project-buffers-other-buffer () + "Switch to the most recently selected buffer project buffer. +Only buffers not visible in windows are returned." + (interactive) + (switch-to-buffer (car (projectile-project-buffers-non-visible))) nil t) + +(defun projectile-project-buffers-non-visible () + "Get a list of non visible project buffers." + (cl-remove-if-not + (lambda (buffer) + (not (get-buffer-window buffer 'visible))) + (projectile-project-buffers))) + +;;;###autoload +(defun projectile-multi-occur (&optional nlines) + "Do a `multi-occur' in the project's buffers. +With a prefix argument, show NLINES of context." + (interactive "P") + (multi-occur (projectile-project-buffers) + (car (occur-read-primary-args)) + nlines)) + +(defun projectile-normalise-paths (patterns) + "Remove leading `/' from the elements of PATTERNS." + (delq nil (mapcar (lambda (pat) (and (string-prefix-p "/" pat) + ;; remove the leading / + (substring pat 1))) + patterns))) + +(defun projectile-expand-paths (paths) + "Expand the elements of PATHS. + +Elements containing wildcards are expanded and spliced into the +resulting paths. The returned PATHS are absolute, based on the +projectile project root." + (let ((default-directory (projectile-project-root))) + (projectile-flatten (mapcar + (lambda (pattern) + (or (file-expand-wildcards pattern t) + (projectile-expand-root pattern))) + paths)))) + +(defun projectile-normalise-patterns (patterns) + "Remove paths from PATTERNS." + (cl-remove-if (lambda (pat) (string-prefix-p "/" pat)) patterns)) + +(defun projectile-make-relative-to-root (files) + "Make FILES relative to the project root." + (let ((project-root (projectile-project-root))) + (mapcar (lambda (f) (file-relative-name f project-root)) files))) + +(defun projectile-ignored-directory-p (directory) + "Check if DIRECTORY should be ignored. + +Regular expressions can be use." + (cl-some + (lambda (name) + (string-match-p name directory)) + (projectile-ignored-directories))) + +(defun projectile-ignored-file-p (file) + "Check if FILE should be ignored. + +Regular expressions can be use." + (cl-some + (lambda (name) + (string-match-p name file)) + (projectile-ignored-files))) + +(defun projectile-check-pattern-p (file pattern) + "Check if FILE meets PATTERN." + (or (string-suffix-p (directory-file-name pattern) + (directory-file-name file)) + (member file (file-expand-wildcards pattern t)))) + +(defun projectile-ignored-rel-p (file directory patterns) + "Check if FILE should be ignored relative to DIRECTORY +according to PATTERNS: (ignored . unignored)" + (let ((default-directory directory)) + (and (cl-some + (lambda (pat) (projectile-check-pattern-p file pat)) + (car patterns)) + (cl-notany + (lambda (pat) (projectile-check-pattern-p file pat)) + (cdr patterns))))) + +(defun projectile-ignored-files () + "Return list of ignored files." + (projectile-difference + (mapcar + #'projectile-expand-root + (append + projectile-globally-ignored-files + (projectile-project-ignored-files))) + (projectile-unignored-files))) + +(defun projectile-ignored-directories () + "Return list of ignored directories." + (projectile-difference + (mapcar + #'file-name-as-directory + (mapcar + #'projectile-expand-root + (append + projectile-globally-ignored-directories + (projectile-project-ignored-directories)))) + (projectile-unignored-directories))) + +(defun projectile-ignored-directories-rel () + "Return list of ignored directories, relative to the root." + (projectile-make-relative-to-root (projectile-ignored-directories))) + +(defun projectile-ignored-files-rel () + "Return list of ignored files, relative to the root." + (projectile-make-relative-to-root (projectile-ignored-files))) + +(defun projectile-project-ignored-files () + "Return list of project ignored files. +Unignored files are not included." + (cl-remove-if 'file-directory-p (projectile-project-ignored))) + +(defun projectile-project-ignored-directories () + "Return list of project ignored directories. +Unignored directories are not included." + (cl-remove-if-not 'file-directory-p (projectile-project-ignored))) + +(defun projectile-paths-to-ignore () + "Return a list of ignored project paths." + (projectile-normalise-paths (nth 1 (projectile-parse-dirconfig-file)))) + +(defun projectile-patterns-to-ignore () + "Return a list of relative file patterns." + (projectile-normalise-patterns (nth 1 (projectile-parse-dirconfig-file)))) + +(defun projectile-project-ignored () + "Return list of project ignored files/directories. +Unignored files/directories are not included." + (let ((paths (projectile-paths-to-ignore))) + (projectile-expand-paths paths))) + +(defun projectile-unignored-files () + "Return list of unignored files." + (mapcar + #'projectile-expand-root + (append + projectile-globally-unignored-files + (projectile-project-unignored-files)))) + +(defun projectile-unignored-directories () + "Return list of unignored directories." + (mapcar + #'file-name-as-directory + (mapcar + #'projectile-expand-root + (append + projectile-globally-unignored-directories + (projectile-project-unignored-directories))))) + +(defun projectile-unignored-directories-rel () + "Return list of unignored directories, relative to the root." + (projectile-make-relative-to-root (projectile-unignored-directories))) + +(defun projectile-unignored-files-rel () + "Return list of unignored files, relative to the root." + (projectile-make-relative-to-root (projectile-unignored-files))) + +(defun projectile-project-unignored-files () + "Return list of project unignored files." + (cl-remove-if 'file-directory-p (projectile-project-unignored))) + +(defun projectile-project-unignored-directories () + "Return list of project unignored directories." + (cl-remove-if-not 'file-directory-p (projectile-project-unignored))) + +(defun projectile-paths-to-ensure () + "Return a list of unignored project paths." + (projectile-normalise-paths (nth 2 (projectile-parse-dirconfig-file)))) + +(defun projectile-files-to-ensure () + (projectile-flatten (mapcar (lambda (pat) (file-expand-wildcards pat t)) + (projectile-patterns-to-ensure)))) + +(defun projectile-patterns-to-ensure () + "Return a list of relative file patterns." + (projectile-normalise-patterns (nth 2 (projectile-parse-dirconfig-file)))) + +(defun projectile-filtering-patterns () + (cons (projectile-patterns-to-ignore) + (projectile-patterns-to-ensure))) + +(defun projectile-project-unignored () + "Return list of project ignored files/directories." + (delete-dups (append (projectile-expand-paths (projectile-paths-to-ensure)) + (projectile-expand-paths (projectile-files-to-ensure))))) + + +(defun projectile-dirconfig-file () + "Return the absolute path to the project's dirconfig file." + (expand-file-name ".projectile" (projectile-project-root))) + +(defun projectile-parse-dirconfig-file () + "Parse project ignore file and return directories to ignore and keep. + +The return value will be a list of three elements, the car being +the list of directories to keep, the cadr being the list of files +or directories to ignore, and the caddr being the list of files +or directories to ensure. + +Strings starting with + will be added to the list of directories +to keep, and strings starting with - will be added to the list of +directories to ignore. For backward compatibility, without a +prefix the string will be assumed to be an ignore string." + (let (keep ignore ensure (dirconfig (projectile-dirconfig-file))) + (when (projectile-file-exists-p dirconfig) + (with-temp-buffer + (insert-file-contents dirconfig) + (while (not (eobp)) + (pcase (char-after) + (?+ (push (buffer-substring (1+ (point)) (line-end-position)) keep)) + (?- (push (buffer-substring (1+ (point)) (line-end-position)) ignore)) + (?! (push (buffer-substring (1+ (point)) (line-end-position)) ensure)) + (_ (push (buffer-substring (point) (line-end-position)) ignore))) + (forward-line))) + (list (mapcar (lambda (f) (file-name-as-directory (string-trim f))) + (delete "" (reverse keep))) + (mapcar #'string-trim + (delete "" (reverse ignore))) + (mapcar #'string-trim + (delete "" (reverse ensure))))))) + +(defun projectile-expand-root (name) + "Expand NAME to project root. + +Never use on many files since it's going to recalculate the +project-root for every file." + (expand-file-name name (projectile-project-root))) + +(cl-defun projectile-completing-read (prompt choices &key initial-input action) + "Present a project tailored PROMPT with CHOICES." + (let ((prompt (projectile-prepend-project-name prompt)) + res) + (setq res + (cond + ((eq projectile-completion-system 'ido) + (ido-completing-read prompt choices nil nil initial-input)) + ((eq projectile-completion-system 'default) + (completing-read prompt choices nil nil initial-input)) + ((eq projectile-completion-system 'helm) + (if (and (fboundp 'helm) + (fboundp 'helm-make-source)) + (helm :sources + (helm-make-source "Projectile" 'helm-source-sync + :candidates choices + :action (if action + (prog1 action + (setq action nil)) + #'identity)) + :prompt prompt + :input initial-input + :buffer "*helm-projectile*") + (user-error "Please install helm from \ +https://github.com/emacs-helm/helm"))) + ((eq projectile-completion-system 'ivy) + (if (fboundp 'ivy-read) + (ivy-read prompt choices + :initial-input initial-input + :action (prog1 action + (setq action nil)) + :caller 'projectile-completing-read) + (user-error "Please install ivy from \ +https://github.com/abo-abo/swiper"))) + (t (funcall projectile-completion-system prompt choices)))) + (if action + (funcall action res) + res))) + +(defun projectile-current-project-files () + "Return a list of files for the current project." + (let (files) + ;; If the cache is too stale, don't use it. + (when projectile-files-cache-expire + (let ((cache-time + (gethash (projectile-project-root) projectile-projects-cache-time))) + (when (or (null cache-time) + (< (+ cache-time projectile-files-cache-expire) + (projectile-time-seconds))) + (remhash (projectile-project-root) projectile-projects-cache) + (remhash (projectile-project-root) projectile-projects-cache-time)))) + + ;; Use the cache, if requested and available. + (when projectile-enable-caching + (setq files (gethash (projectile-project-root) projectile-projects-cache))) + + ;; Calculate the list of files. + (when (null files) + (when projectile-enable-caching + (message "Projectile is initializing cache...")) + (setq files (cl-mapcan + #'projectile-dir-files + (projectile-get-project-directories))) + + ;; Save the cached list. + (when projectile-enable-caching + (projectile-cache-project (projectile-project-root) files))) + + (projectile-sort-files files))) + +(defun projectile-process-current-project-files (action) + "Process the current project's files using ACTION." + (let ((project-files (projectile-current-project-files)) + (default-directory (projectile-project-root))) + (dolist (filename project-files) + (funcall action filename)))) + +(defun projectile-current-project-dirs () + "Return a list of dirs for the current project." + (delete-dups + (delq nil + (mapcar #'file-name-directory + (projectile-current-project-files))))) + +(defun projectile-hash-keys (hash) + "Return a list of all HASH keys." + (let (allkeys) + (maphash (lambda (k _v) (setq allkeys (cons k allkeys))) hash) + allkeys)) + + +;;; Interactive commands +(defcustom projectile-other-file-alist + '( ;; handle C/C++ extensions + ("cpp" . ("h" "hpp" "ipp")) + ("ipp" . ("h" "hpp" "cpp")) + ("hpp" . ("h" "ipp" "cpp" "cc")) + ("cxx" . ("h" "hxx" "ixx")) + ("ixx" . ("h" "hxx" "cxx")) + ("hxx" . ("h" "ixx" "cxx")) + ("c" . ("h")) + ("m" . ("h")) + ("mm" . ("h")) + ("h" . ("c" "cc" "cpp" "ipp" "hpp" "cxx" "ixx" "hxx" "m" "mm")) + ("cc" . ("h" "hh" "hpp")) + ("hh" . ("cc")) + + ;; vertex shader and fragment shader extensions in glsl + ("vert" . ("frag")) + ("frag" . ("vert")) + + ;; handle files with no extension + (nil . ("lock" "gpg")) + ("lock" . ("")) + ("gpg" . ("")) + ) + "Alist of extensions for switching to file with the same name, + using other extensions based on the extension of current + file." + :type 'alist) + +(defun projectile--find-other-file (&optional flex-matching ff-variant) + "Switch between files with the same name but different extensions. +With FLEX-MATCHING, match any file that contains the base name of current file. +Other file extensions can be customized with the variable +`projectile-other-file-alist'. With FF-VARIANT set to a defun, use that +instead of `find-file'. A typical example of such a defun would be +`find-file-other-window' or `find-file-other-frame'" + (let ((ff (or ff-variant #'find-file)) + (other-files (projectile-get-other-files + (buffer-file-name) + (projectile-current-project-files) + flex-matching))) + (if other-files + (let ((file-name (if (= (length other-files) 1) + (car other-files) + (projectile-completing-read "Switch to: " + other-files)))) + (funcall ff (expand-file-name file-name + (projectile-project-root)))) + (error "No other file found")))) + +;;;###autoload +(defun projectile-find-other-file (&optional flex-matching) + "Switch between files with the same name but different extensions. +With FLEX-MATCHING, match any file that contains the base name of current file. +Other file extensions can be customized with the variable `projectile-other-file-alist'." + (interactive "P") + (projectile--find-other-file flex-matching)) + +;;;###autoload +(defun projectile-find-other-file-other-window (&optional flex-matching) + "Switch between files with the same name but different extensions in other window. +With FLEX-MATCHING, match any file that contains the base name of current file. +Other file extensions can be customized with the variable `projectile-other-file-alist'." + (interactive "P") + (projectile--find-other-file flex-matching + #'find-file-other-window)) + +;;;###autoload +(defun projectile-find-other-file-other-frame (&optional flex-matching) + "Switch between files with the same name but different extensions in other window. +With FLEX-MATCHING, match any file that contains the base name of current file. +Other file extensions can be customized with the variable `projectile-other-file-alist'." + (interactive "P") + (projectile--find-other-file flex-matching + #'find-file-other-frame)) + +(defun projectile--file-name-sans-extensions (file-name) + "Return FILE-NAME sans any extensions. +The extensions, in a filename, are what follows the first '.', with the exception of a leading '.'" + (setq file-name (file-name-nondirectory file-name)) + (substring file-name 0 (string-match "\\..*" file-name 1))) + +(defun projectile--file-name-extensions (file-name) + "Return FILE-NAME's extensions. +The extensions, in a filename, are what follows the first '.', with the exception of a leading '.'" + ;;would it make sense to return nil instead of an empty string if no extensions are found? + (setq file-name (file-name-nondirectory file-name)) + (let (extensions-start) + (substring file-name + (if (setq extensions-start (string-match "\\..*" file-name 1)) + (1+ extensions-start) + (length file-name))))) + +(defun projectile-associated-file-name-extensions (file-name) + "Return projectile-other-file-extensions associated to FILE-NAME's extensions. +If no associated other-file-extensions for the complete (nested) extension are found, remove subextensions from FILENAME's extensions until a match is found." + (let ((current-extensions (projectile--file-name-extensions (file-name-nondirectory file-name))) + associated-extensions) + (catch 'break + (while (not (string= "" current-extensions)) + (if (setq associated-extensions (cdr (assoc current-extensions projectile-other-file-alist))) + (throw 'break associated-extensions)) + (setq current-extensions (projectile--file-name-extensions current-extensions)))))) + +(defun projectile-get-other-files (current-file project-file-list &optional flex-matching) + "Narrow to files with the same names but different extensions. +Returns a list of possible files for users to choose. + +With FLEX-MATCHING, match any file that contains the base name of current file" + (let* ((file-ext-list (projectile-associated-file-name-extensions current-file)) + (fulldirname (if (file-name-directory current-file) + (file-name-directory current-file) "./")) + (dirname (file-name-nondirectory (directory-file-name fulldirname))) + (filename (projectile--file-name-sans-extensions current-file)) + (file-list (mapcar (lambda (ext) + (if flex-matching + (concat ".*" filename ".*" "\." ext "\\'") + (concat "^" filename + (unless (equal ext "") + (concat "\." ext)) + "\\'"))) + file-ext-list)) + (candidates (cl-remove-if-not + (lambda (project-file) + (string-match filename project-file)) + project-file-list)) + (candidates + (projectile-flatten (mapcar + (lambda (file) + (cl-remove-if-not + (lambda (project-file) + (string-match file + (concat (file-name-base project-file) + (unless (equal (file-name-extension project-file) nil) + (concat "\." (file-name-extension project-file)))))) + candidates)) + file-list))) + (candidates + (cl-remove-if-not (lambda (file) (not (backup-file-name-p file))) candidates)) + (candidates + (cl-sort (copy-sequence candidates) + (lambda (file _) + (let ((candidate-dirname (file-name-nondirectory (directory-file-name (file-name-directory file))))) + (unless (equal fulldirname (file-name-directory file)) + (equal dirname candidate-dirname))))))) + candidates)) + +(defun projectile-select-files (project-files &optional arg) + "Select a list of files based on filename at point. + +With a prefix ARG invalidates the cache first." + (projectile-maybe-invalidate-cache arg) + (let* ((file (if (region-active-p) + (buffer-substring (region-beginning) (region-end)) + (or (thing-at-point 'filename) ""))) + (file (if (string-match "\\.?\\./" file) + (file-relative-name (file-truename file) (projectile-project-root)) + file)) + (files (if file + (cl-remove-if-not + (lambda (project-file) + (string-match file project-file)) + project-files) + nil))) + files)) + +(defun projectile--find-file-dwim (invalidate-cache &optional ff-variant) + "Jump to a project's files using completion based on context. + +With a INVALIDATE-CACHE invalidates the cache first. + +With FF-VARIANT set to a defun, use that instead of `find-file'. +A typical example of such a defun would be `find-file-other-window' or +`find-file-other-frame' + +Subroutine for `projectile-find-file-dwim' and +`projectile-find-file-dwim-other-window'" + (let* ((project-files (projectile-current-project-files)) + (files (projectile-select-files project-files invalidate-cache)) + (file (cond ((= (length files) 1) + (car files)) + ((> (length files) 1) + (projectile-completing-read "Switch to: " files)) + (t + (projectile-completing-read "Switch to: " project-files)))) + (ff (or ff-variant #'find-file))) + (funcall ff (expand-file-name file (projectile-project-root))) + (run-hooks 'projectile-find-file-hook))) + +;;;###autoload +(defun projectile-find-file-dwim (&optional arg) + "Jump to a project's files using completion based on context. + +With a prefix ARG invalidates the cache first. + +If point is on a filename, Projectile first tries to search for that +file in project: + +- If it finds just a file, it switches to that file instantly. This works even +if the filename is incomplete, but there's only a single file in the current project +that matches the filename at point. For example, if there's only a single file named +\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete), +`projectile-find-file-dwim' still switches to \"projectile/projectile.el\" immediately + because this is the only filename that matches. + +- If it finds a list of files, the list is displayed for selecting. A list of +files is displayed when a filename appears more than one in the project or the +filename at point is a prefix of more than two files in a project. For example, +if `projectile-find-file-dwim' is executed on a filepath like \"projectile/\", it lists +the content of that directory. If it is executed on a partial filename like + \"projectile/a\", a list of files with character 'a' in that directory is presented. + +- If it finds nothing, display a list of all files in project for selecting." + (interactive "P") + (projectile--find-file-dwim arg)) + +;;;###autoload +(defun projectile-find-file-dwim-other-window (&optional arg) + "Jump to a project's files using completion based on context in other window. + +With a prefix ARG invalidates the cache first. + +If point is on a filename, Projectile first tries to search for that +file in project: + +- If it finds just a file, it switches to that file instantly. This works even +if the filename is incomplete, but there's only a single file in the current project +that matches the filename at point. For example, if there's only a single file named +\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete), +`projectile-find-file-dwim-other-window' still switches to \"projectile/projectile.el\" +immediately because this is the only filename that matches. + +- If it finds a list of files, the list is displayed for selecting. A list of +files is displayed when a filename appears more than one in the project or the +filename at point is a prefix of more than two files in a project. For example, +if `projectile-find-file-dwim-other-window' is executed on a filepath like \"projectile/\", it lists +the content of that directory. If it is executed on a partial filename +like \"projectile/a\", a list of files with character 'a' in that directory +is presented. + +- If it finds nothing, display a list of all files in project for selecting." + (interactive "P") + (projectile--find-file-dwim arg #'find-file-other-window)) + +;;;###autoload +(defun projectile-find-file-dwim-other-frame (&optional arg) + "Jump to a project's files using completion based on context in other frame. + +With a prefix ARG invalidates the cache first. + +If point is on a filename, Projectile first tries to search for that +file in project: + +- If it finds just a file, it switches to that file instantly. This works even +if the filename is incomplete, but there's only a single file in the current project +that matches the filename at point. For example, if there's only a single file named +\"projectile/projectile.el\" but the current filename is \"projectile/proj\" (incomplete), +`projectile-find-file-dwim-other-frame' still switches to \"projectile/projectile.el\" +immediately because this is the only filename that matches. + +- If it finds a list of files, the list is displayed for selecting. A list of +files is displayed when a filename appears more than one in the project or the +filename at point is a prefix of more than two files in a project. For example, +if `projectile-find-file-dwim-other-frame' is executed on a filepath like \"projectile/\", it lists +the content of that directory. If it is executed on a partial filename +like \"projectile/a\", a list of files with character 'a' in that directory +is presented. + +- If it finds nothing, display a list of all files in project for selecting." + (interactive "P") + (projectile--find-file-dwim arg #'find-file-other-frame)) + +(defun projectile--find-file (invalidate-cache &optional ff-variant) + "Jump to a project's file using completion. +With INVALIDATE-CACHE invalidates the cache first. With FF-VARIANT set to a +defun, use that instead of `find-file'. A typical example of such a defun +would be `find-file-other-window' or `find-file-other-frame'" + (interactive "P") + (projectile-maybe-invalidate-cache invalidate-cache) + (let ((file (projectile-completing-read "Find file: " + (projectile-current-project-files))) + (ff (or ff-variant #'find-file))) + (funcall ff (expand-file-name file (projectile-project-root))) + (run-hooks 'projectile-find-file-hook))) + +;;;###autoload +(defun projectile-find-file (&optional arg) + "Jump to a project's file using completion. +With a prefix ARG invalidates the cache first." + (interactive "P") + (projectile--find-file arg)) + +;;;###autoload +(defun projectile-find-file-other-window (&optional arg) + "Jump to a project's file using completion and show it in another window. + +With a prefix ARG invalidates the cache first." + (interactive "P") + (projectile--find-file arg #'find-file-other-window)) + +;;;###autoload +(defun projectile-find-file-other-frame (&optional arg) + "Jump to a project's file using completion and show it in another frame. + +With a prefix ARG invalidates the cache first." + (interactive "P") + (projectile--find-file arg #'find-file-other-frame)) + +(defun projectile-sort-files (files) + "Sort FILES according to `projectile-sort-order'." + (cl-case projectile-sort-order + (default files) + (recentf (projectile-sort-by-recentf-first files)) + (recently-active (projectile-sort-by-recently-active-first files)) + (modification-time (projectile-sort-by-modification-time files)) + (access-time (projectile-sort-by-access-time files)))) + +(defun projectile-sort-by-recentf-first (files) + "Sort FILES by a recent first scheme." + (let ((project-recentf-files (projectile-recentf-files))) + (append project-recentf-files + (projectile-difference files project-recentf-files)))) + +(defun projectile-sort-by-recently-active-first (files) + "Sort FILES by most recently active buffers or opened files." + (let ((project-recently-active-files (projectile-recently-active-files))) + (append project-recently-active-files + (projectile-difference files project-recently-active-files)))) + +(defun projectile-sort-by-modification-time (files) + "Sort FILES by modification time." + (let ((default-directory (projectile-project-root))) + (cl-sort + (copy-sequence files) + (lambda (file1 file2) + (let ((file1-mtime (nth 5 (file-attributes file1))) + (file2-mtime (nth 5 (file-attributes file2)))) + (not (time-less-p file1-mtime file2-mtime))))))) + +(defun projectile-sort-by-access-time (files) + "Sort FILES by access time." + (let ((default-directory (projectile-project-root))) + (cl-sort + (copy-sequence files) + (lambda (file1 file2) + (let ((file1-atime (nth 4 (file-attributes file1))) + (file2-atime (nth 4 (file-attributes file2)))) + (not (time-less-p file1-atime file2-atime))))))) + +(defun projectile--find-dir (invalidate-cache &optional dired-variant) + "Jump to a project's directory using completion. + +With INVALIDATE-CACHE invalidates the cache first. With DIRED-VARIANT set to a +defun, use that instead of `dired'. A typical example of such a defun would be +`dired-other-window' or `dired-other-frame'" + (projectile-maybe-invalidate-cache invalidate-cache) + (let ((dir (projectile-complete-dir)) + (dired-v (or dired-variant #'dired))) + (funcall dired-v (expand-file-name dir (projectile-project-root))) + (run-hooks 'projectile-find-dir-hook))) + +;;;###autoload +(defun projectile-find-dir (&optional arg) + "Jump to a project's directory using completion. + +With a prefix ARG invalidates the cache first." + (interactive "P") + (projectile--find-dir arg)) + +;;;###autoload +(defun projectile-find-dir-other-window (&optional arg) + "Jump to a project's directory in other window using completion. + +With a prefix ARG invalidates the cache first." + (interactive "P") + (projectile--find-dir arg #'dired-other-window)) + +;;;###autoload +(defun projectile-find-dir-other-frame (&optional arg) + "Jump to a project's directory in other window using completion. + +With a prefix ARG invalidates the cache first." + (interactive "P") + (projectile--find-dir arg #'dired-other-frame)) + +(defun projectile-complete-dir () + (projectile-completing-read + "Find dir: " + (if projectile-find-dir-includes-top-level + (append '("./") (projectile-current-project-dirs)) + (projectile-current-project-dirs)))) + +;;;###autoload +(defun projectile-find-test-file (&optional arg) + "Jump to a project's test file using completion. + +With a prefix ARG invalidates the cache first." + (interactive "P") + (projectile-maybe-invalidate-cache arg) + (let ((file (projectile-completing-read "Find test file: " + (projectile-current-project-test-files)))) + (find-file (expand-file-name file (projectile-project-root))))) + +(defun projectile-test-files (files) + "Return only the test FILES." + (cl-remove-if-not 'projectile-test-file-p files)) + +(defun projectile-test-file-p (file) + "Check if FILE is a test file." + (or (cl-some (lambda (pat) (string-prefix-p pat (file-name-nondirectory file))) + (delq nil (list (funcall projectile-test-prefix-function (projectile-project-type))))) + (cl-some (lambda (pat) (string-suffix-p pat (file-name-sans-extension (file-name-nondirectory file)))) + (delq nil (list (funcall projectile-test-suffix-function (projectile-project-type))))))) + +(defun projectile-current-project-test-files () + "Return a list of test files for the current project." + (projectile-test-files (projectile-current-project-files))) + +(defvar projectile-project-types (make-hash-table) + "A hash table holding all project types that are known to Projectile.") + +(cl-defun projectile-register-project-type + (project-type marker-files &key compilation-dir configure compile test run test-suffix test-prefix src-dir test-dir) + "Register a project type with projectile. + +A project type is defined by PROJECT-TYPE, a set of MARKER-FILES, +and optional keyword arguments: +COMPILATION-DIR the directory to run the tests- and compilations in, +CONFIGURE which specifies a command that configures the project + `%s' in the command will be substituted with (projectile-project-root) + before the command is run, +COMPILE which specifies a command that builds the project, +TEST which specified a command that tests the project, +RUN which specifies a command that runs the project, +TEST-SUFFIX which specifies test file suffix, and +TEST-PREFIX which specifies test file prefix. +SRC-DIR which specifies the path to the source relative to the project root. +TEST-DIR which specifies the path to the tests relative to the project root." + (let ((project-plist (list 'marker-files marker-files + 'compilation-dir compilation-dir + 'configure-command configure + 'compile-command compile + 'test-command test + 'run-command run))) + ;; There is no way for the function to distinguish between an + ;; explicit argument of nil and an omitted argument. However, the + ;; body of the function is free to consider nil an abbreviation + ;; for some other meaningful value + (when test-suffix + (plist-put project-plist 'test-suffix test-suffix)) + (when test-prefix + (plist-put project-plist 'test-prefix test-prefix)) + (when src-dir + (plist-put project-plist 'src-dir src-dir)) + (when test-dir + (plist-put project-plist 'test-dir test-dir)) + (puthash project-type project-plist + projectile-project-types))) + +(defun projectile-cabal-project-p () + "Check if a project contains *.cabal files but no stack.yaml file." + (and (projectile-verify-file-wildcard "*.cabal") + (not (projectile-verify-file "stack.yaml")))) + +(defun projectile-go-project-p () + "Check if a project contains Go source files." + (cl-some + (lambda (file) + (string= (file-name-extension file) "go")) + (projectile-current-project-files))) + +(defcustom projectile-go-project-test-function #'projectile-go-project-p + "Function to determine if project's type is go." + :group 'projectile + :type 'function) + +(define-obsolete-variable-alias 'projectile-go-function 'projectile-go-project-test-function "1.0.0") + +;;; Project type registration +;; +;; Project type detection happens in a reverse order with respect to +;; project type registration (invocations of `projectile-register-project-type'). +;; +;; As function-based project type detection is pretty slow, so it +;; should be tried at the end if everything else failed (meaning here +;; it should be listed first). +;; +;; Ideally common project types should be checked earlier than exotic ones. + +;; Function-based detection project type +(projectile-register-project-type 'haskell-cabal #'projectile-cabal-project-p + :compile "cabal build" + :test "cabal test" + :test-suffix "Spec") +(projectile-register-project-type 'go projectile-go-project-test-function + :compile "go build ./..." + :test "go test ./..." + :test-suffix "_test") +;; File-based detection project types +(projectile-register-project-type 'emacs-cask '("Cask") + :compile "cask install" + :test-prefix "test-" + :test-suffix "-test") +(projectile-register-project-type 'r '("DESCRIPTION") + :compile "R CMD INSTALL --with-keep.source ." + :test (concat "R CMD check -o " temporary-file-directory " .")) +(projectile-register-project-type 'haskell-stack '("stack.yaml") + :compile "stack build" + :test "stack build --test" + :test-suffix "Spec") +(projectile-register-project-type 'rust-cargo '("Cargo.toml") + :compile "cargo build" + :test "cargo test") +(projectile-register-project-type 'racket '("info.rkt") + :test "raco test .") +;; Universal +(projectile-register-project-type 'scons '("SConstruct") + :compile "scons" + :test "scons test" + :test-suffix "test") +(projectile-register-project-type 'meson '("meson.build") + :compilation-dir "build" + :configure "meson %s" + :compile "ninja" + :test "ninja test") +(projectile-register-project-type 'nix '("default.nix") + :compile "nix-build" + :test "nix-build") +;; Make & CMake +(projectile-register-project-type 'make '("Makefile") + :compile "make" + :test "make test") +(projectile-register-project-type 'cmake '("CMakeLists.txt") + :configure "cmake %s" + :compile "cmake --build ." + :test "ctest") +;; PHP +(projectile-register-project-type 'php-symfony '("composer.json" "app" "src" "vendor") + :compile "app/console server:run" + :test "phpunit -c app " + :test-suffix "Test") +;; Erlang & Elixir +(projectile-register-project-type 'rebar '("rebar.config") + :compile "rebar" + :test "rebar eunit" + :test-suffix "_SUITE") +(projectile-register-project-type 'elixir '("mix.exs") + :compile "mix compile" + :src-dir "lib/" + :test "mix test" + :test-suffix "_test") +;; JavaScript +(projectile-register-project-type 'grunt '("Gruntfile.js") + :compile "grunt" + :test "grunt test") +(projectile-register-project-type 'gulp '("gulpfile.js") + :compile "gulp" + :test "gulp test") +(projectile-register-project-type 'npm '("package.json") + :compile "npm install" + :test "npm test") +;; Angular +(projectile-register-project-type 'angular '("angular.json" ".angular-cli.json") + :compile "ng build" + :run "ng serve" + :test "ng test") +;; Python +(projectile-register-project-type 'django '("manage.py") + :compile "python manage.py runserver" + :test "python manage.py test" + :test-prefix "test_") +(projectile-register-project-type 'python-pip '("requirements.txt") + :compile "python setup.by build" + :test "python -m unittest discover" + :test-prefix "test_") +(projectile-register-project-type 'python-pkg '("setup.py") + :compile "python setup.py build" + :test "python -m unittest discover" + :test-prefix "test_") +(projectile-register-project-type 'python-tox '("tox.ini") + :compile "tox -r --notest" + :test "tox" + :test-prefix "test_") +;; Java & friends +(projectile-register-project-type 'maven '("pom.xml") + :compile "mvn clean install" + :test "mvn test" + :test-suffix "Test" + :src-dir "main/src/" + :test-dir "main/test/") +(projectile-register-project-type 'gradle '("build.gradle") + :compile "gradle build" + :test "gradle test" + :test-suffix "Spec") +(projectile-register-project-type 'gradlew '("gradlew") + :compile "./gradlew build" + :test "./gradlew test" + :test-suffix "Spec") +(projectile-register-project-type 'grails '("application.properties" "grails-app") + :compile "grails package" + :test "grails test-app" + :test-suffix "Spec") +(projectile-register-project-type 'sbt '("build.sbt") + :compile "sbt compile" + :test "sbt test" + :test-suffix "Spec") +(projectile-register-project-type 'lein-test '("project.clj") + :compile "lein compile" + :test "lein test" + :test-suffix "_test") +(projectile-register-project-type 'lein-midje '("project.clj" ".midje.clj") + :compile "lein compile" + :test "lein midje" + :test-prefix "t_") +(projectile-register-project-type 'boot-clj '("build.boot") + :compile "boot aot" + :test "boot test" + :test-suffix "_test") +(projectile-register-project-type 'clojure-cli '("deps.edn") + :test-suffix "_test") +;; Ruby +(projectile-register-project-type 'ruby-rspec '("Gemfile" "lib" "spec") + :compile "bundle exec rake" + :src-dir "lib/" + :test "bundle exec rspec" + :test-dir "spec/" + :test-suffix "_spec") +(projectile-register-project-type 'ruby-test '("Gemfile" "lib" "test") + :compile"bundle exec rake" + :src-dir "lib/" + :test "bundle exec rake test" + :test-suffix "_test") +;; Rails needs to be registered after npm, otherwise `package.json` makes it `npm`. +;; https://github.com/bbatsov/projectile/pull/1191 +(projectile-register-project-type 'rails-test '("Gemfile" "app" "lib" "db" "config" "test") + :compile "bundle exec rails server" + :src-dir "lib/" + :test "bundle exec rake test" + :test-suffix "_test") +(projectile-register-project-type 'rails-rspec '("Gemfile" "app" "lib" "db" "config" "spec") + :compile "bundle exec rails server" + :src-dir "lib/" + :test "bundle exec rspec" + :test-dir "spec/" + :test-suffix "_spec") + +(defvar-local projectile-project-type nil + "Buffer local var for overriding the auto-detected project type. +Normally you'd set this from .dir-locals.el.") +(put 'projectile-project-type 'safe-local-variable #'symbolp) + +(defun projectile-detect-project-type () + "Detect the type of the current project. +Fallsback to a generic project type when the type can't be determined." + (let ((project-type (or (cl-find-if + (lambda (project-type) + (let ((marker (plist-get (gethash project-type projectile-project-types) 'marker-files))) + (if (listp marker) + (and (projectile-verify-files marker) project-type) + (and (funcall marker) project-type)))) + (projectile-hash-keys projectile-project-types)) + 'generic))) + (puthash (projectile-project-root) project-type projectile-project-type-cache) + project-type)) + +(defun projectile-project-type () + "Determine the project's type based on its structure. + +The project type is cached for improved performance." + (if projectile-project-type + projectile-project-type + (let ((project-root (ignore-errors (projectile-project-root)))) + (if project-root + (or (gethash project-root projectile-project-type-cache) + (projectile-detect-project-type)) + ;; if we're not in a project we just return nil + nil)))) + +;;;###autoload +(defun projectile-project-info () + "Display info for current project." + (interactive) + (message "Project dir: %s ## Project VCS: %s ## Project type: %s" + (projectile-project-root) + (projectile-project-vcs) + (projectile-project-type))) + +(defun projectile-verify-files (files) + "Check whether all FILES exist in the current project." + (cl-every #'projectile-verify-file files)) + +(defun projectile-verify-file (file) + "Check whether FILE exists in the current project." + (file-exists-p (projectile-expand-root file))) + +(defun projectile-verify-file-wildcard (file) + "Check whether FILE exists in the current project. +Expands wildcards using `file-expand-wildcards' before checking." + (file-expand-wildcards (projectile-expand-root file))) + +(defun projectile-project-vcs (&optional project-root) + "Determine the VCS used by the project if any. +PROJECT-ROOT is the targeted directory. If nil, use +`projectile-project-root'." + (or project-root (setq project-root (projectile-project-root))) + (cond + ((projectile-file-exists-p (expand-file-name ".git" project-root)) 'git) + ((projectile-file-exists-p (expand-file-name ".hg" project-root)) 'hg) + ((projectile-file-exists-p (expand-file-name ".fslckout" project-root)) 'fossil) + ((projectile-file-exists-p (expand-file-name "_FOSSIL_" project-root)) 'fossil) + ((projectile-file-exists-p (expand-file-name ".bzr" project-root)) 'bzr) + ((projectile-file-exists-p (expand-file-name "_darcs" project-root)) 'darcs) + ((projectile-file-exists-p (expand-file-name ".svn" project-root)) 'svn) + ((projectile-locate-dominating-file project-root ".git") 'git) + ((projectile-locate-dominating-file project-root ".hg") 'hg) + ((projectile-locate-dominating-file project-root ".fslckout") 'fossil) + ((projectile-locate-dominating-file project-root "_FOSSIL_") 'fossil) + ((projectile-locate-dominating-file project-root ".bzr") 'bzr) + ((projectile-locate-dominating-file project-root "_darcs") 'darcs) + ((projectile-locate-dominating-file project-root ".svn") 'svn) + (t 'none))) + +(defun projectile--test-name-for-impl-name (impl-file-path) + "Determine the name of the test file for IMPL-FILE-PATH." + (let* ((project-type (projectile-project-type)) + (impl-file-name (file-name-sans-extension (file-name-nondirectory impl-file-path))) + (impl-file-ext (file-name-extension impl-file-path)) + (test-prefix (funcall projectile-test-prefix-function project-type)) + (test-suffix (funcall projectile-test-suffix-function project-type))) + (cond + (test-prefix (concat test-prefix impl-file-name "." impl-file-ext)) + (test-suffix (concat impl-file-name test-suffix "." impl-file-ext)) + (t (error "Project type `%s' not supported!" project-type))))) + +(defun projectile-create-test-file-for (impl-file-path) + "Create a test file for IMPL-FILE-PATH." + (let* ((test-file (projectile--test-name-for-impl-name impl-file-path)) + (project-root (projectile-project-root)) + (relative-dir (file-name-directory (file-relative-name impl-file-path project-root))) + (src-dir-name (projectile-src-directory (projectile-project-type))) + (test-dir-name (projectile-test-directory (projectile-project-type))) + (test-dir (expand-file-name (replace-regexp-in-string src-dir-name test-dir-name relative-dir) project-root)) + (test-path (expand-file-name test-file test-dir))) + (unless (file-exists-p test-path) + (progn (unless (file-exists-p test-dir) + (make-directory test-dir :create-parents)) + test-path)))) + +(defcustom projectile-create-missing-test-files nil + "During toggling, if non-nil enables creating test files if not found. + +When not-nil, every call to projectile-find-implementation-or-test-* +creates test files if not found on the file system. Defaults to nil. +It assumes the test/ folder is at the same level as src/." + :group 'projectile + :type 'boolean) + +(defun projectile-find-implementation-or-test (file-name) + "Given a FILE-NAME return the matching implementation or test filename. + +If `projectile-create-missing-test-files' is non-nil, create the missing +test file." + (unless file-name (error "The current buffer is not visiting a file")) + (if (projectile-test-file-p file-name) + ;; find the matching impl file + (let ((impl-file (projectile-find-matching-file file-name))) + (if impl-file + (projectile-expand-root impl-file) + (error + "No matching source file found for project type `%s'" + (projectile-project-type)))) + ;; find the matching test file + (let ((test-file (projectile-find-matching-test file-name))) + (if test-file + (projectile-expand-root test-file) + (if projectile-create-missing-test-files + (projectile-create-test-file-for file-name) + (error "No matching test file found for project type `%s'" + (projectile-project-type))))))) + +;;;###autoload +(defun projectile-find-implementation-or-test-other-window () + "Open matching implementation or test file in other window." + (interactive) + (find-file-other-window + (projectile-find-implementation-or-test (buffer-file-name)))) + +;;;###autoload +(defun projectile-find-implementation-or-test-other-frame () + "Open matching implementation or test file in other frame." + (interactive) + (find-file-other-frame + (projectile-find-implementation-or-test (buffer-file-name)))) + +;;;###autoload +(defun projectile-toggle-between-implementation-and-test () + "Toggle between an implementation file and its test file." + (interactive) + (find-file + (projectile-find-implementation-or-test (buffer-file-name)))) + + +(defun projectile-project-type-attribute (project-type key &optional default-value) + "Return the value of some PROJECT-TYPE attribute identified by KEY. +Fallback to DEFAULT-VALUE for missing attributes." + (let ((project (gethash project-type projectile-project-types))) + (if (and project (plist-member project key)) + (plist-get project key) + default-value))) + +(defun projectile-test-prefix (project-type) + "Find default test files prefix based on PROJECT-TYPE." + (projectile-project-type-attribute project-type 'test-prefix)) + +(defun projectile-test-suffix (project-type) + "Find default test files suffix based on PROJECT-TYPE." + (projectile-project-type-attribute project-type 'test-suffix)) + +(defun projectile-src-directory (project-type) + "Find default src directory based on PROJECT-TYPE." + (projectile-project-type-attribute project-type 'src-dir "src/")) + +(defun projectile-test-directory (project-type) + "Find default test directory based on PROJECT-TYPE." + (projectile-project-type-attribute project-type 'test-dir "test/")) + +(defun projectile-dirname-matching-count (a b) + "Count matching dirnames ascending file paths." + (setq a (reverse (split-string (or (file-name-directory a) "") "/" t)) + b (reverse (split-string (or (file-name-directory b) "") "/" t))) + (let ((common 0)) + (while (and a b (string-equal (pop a) (pop b))) + (setq common (1+ common))) + common)) + +(defun projectile-group-file-candidates (file candidates) + "Group file candidates by dirname matching count." + (cl-sort (copy-sequence + (let (value result) + (while (setq value (pop candidates)) + (let* ((key (projectile-dirname-matching-count file value)) + (kv (assoc key result))) + (if kv + (setcdr kv (cons value (cdr kv))) + (push (list key value) result)))) + (mapcar (lambda (x) + (cons (car x) (nreverse (cdr x)))) + (nreverse result)))) + (lambda (a b) (> (car a) (car b))))) + +(defun projectile-find-matching-test (file) + "Compute the name of the test matching FILE." + (let* ((basename (file-name-nondirectory (file-name-sans-extension file))) + (test-prefix (funcall projectile-test-prefix-function (projectile-project-type))) + (test-suffix (funcall projectile-test-suffix-function (projectile-project-type))) + (candidates + (cl-remove-if-not + (lambda (current-file) + (let ((name (file-name-nondirectory + (file-name-sans-extension current-file)))) + (or (when test-prefix + (string-equal name (concat test-prefix basename))) + (when test-suffix + (string-equal name (concat basename test-suffix)))))) + (projectile-current-project-files)))) + (cond + ((null candidates) nil) + ((= (length candidates) 1) (car candidates)) + (t (let ((grouped-candidates (projectile-group-file-candidates file candidates))) + (if (= (length (car grouped-candidates)) 2) + (car (last (car grouped-candidates))) + (projectile-completing-read + "Switch to: " + (apply 'append (mapcar 'cdr grouped-candidates))))))))) + +(defun projectile-find-matching-file (test-file) + "Compute the name of a file matching TEST-FILE." + (let* ((basename (file-name-nondirectory (file-name-sans-extension test-file))) + (test-prefix (funcall projectile-test-prefix-function (projectile-project-type))) + (test-suffix (funcall projectile-test-suffix-function (projectile-project-type))) + (candidates + (cl-remove-if-not + (lambda (current-file) + (let ((name (file-name-nondirectory + (file-name-sans-extension current-file)))) + (or (when test-prefix + (string-equal (concat test-prefix name) basename)) + (when test-suffix + (string-equal (concat name test-suffix) basename))))) + (projectile-current-project-files)))) + (cond + ((null candidates) nil) + ((= (length candidates) 1) (car candidates)) + (t (let ((grouped-candidates (projectile-group-file-candidates test-file candidates))) + (if (= (length (car grouped-candidates)) 2) + (car (last (car grouped-candidates))) + (projectile-completing-read + "Switch to: " + (apply 'append (mapcar 'cdr grouped-candidates))))))))) + +(defun projectile-grep-default-files () + "Try to find a default pattern for `projectile-grep'. +This is a subset of `grep-read-files', where either a matching entry from +`grep-files-aliases' or file name extension pattern is returned." + (when buffer-file-name + (let* ((fn (file-name-nondirectory buffer-file-name)) + (default-alias + (let ((aliases (remove (assoc "all" grep-files-aliases) + grep-files-aliases)) + alias) + (while aliases + (setq alias (car aliases) + aliases (cdr aliases)) + (if (string-match (mapconcat + #'wildcard-to-regexp + (split-string (cdr alias) nil t) + "\\|") + fn) + (setq aliases nil) + (setq alias nil))) + (cdr alias))) + (default-extension + (let ((ext (file-name-extension fn))) + (and ext (concat "*." ext))))) + (or default-alias default-extension)))) + +(defun projectile--globally-ignored-file-suffixes-glob () + "Return ignored file suffixes as a list of glob patterns." + (mapcar (lambda (pat) (concat "*" pat)) projectile-globally-ignored-file-suffixes)) + +(defun projectile--read-search-string-with-default (prefix-label) + (let* ((prefix-label (projectile-prepend-project-name prefix-label)) + (default-value (projectile-symbol-or-selection-at-point)) + (default-label (if (or (not default-value) + (string= default-value "")) + "" + (format " (default %s)" default-value)))) + (read-string (format "%s%s: " prefix-label default-label) nil nil default-value))) + +;;;###autoload +(defun projectile-grep (&optional regexp arg) + "Perform rgrep in the project. + +With a prefix ARG asks for files (globbing-aware) which to grep in. +With prefix ARG of `-' (such as `M--'), default the files (without prompt), +to `projectile-grep-default-files'. + +With REGEXP given, don't query the user for a regexp." + (interactive "i\nP") + (require 'grep) ;; for `rgrep' + (let* ((roots (projectile-get-project-directories)) + (search-regexp (or regexp + (projectile--read-search-string-with-default "Grep for"))) + (files (and arg (or (and (equal current-prefix-arg '-) + (projectile-grep-default-files)) + (read-string (projectile-prepend-project-name "Grep in: ") + (projectile-grep-default-files)))))) + (dolist (root-dir roots) + (require 'vc-git) ;; for `vc-git-grep' + ;; in git projects users have the option to use `vc-git-grep' instead of `rgrep' + (if (and (eq (projectile-project-vcs) 'git) + projectile-use-git-grep + (fboundp 'vc-git-grep)) + (vc-git-grep search-regexp (or files "") root-dir) + ;; paths for find-grep should relative and without trailing / + (let ((grep-find-ignored-directories + (cl-union (mapcar (lambda (f) (directory-file-name (file-relative-name f root-dir))) + (projectile-ignored-directories)) + grep-find-ignored-directories)) + (grep-find-ignored-files + (cl-union (append (mapcar (lambda (file) + (file-relative-name file root-dir)) + (projectile-ignored-files)) + (projectile--globally-ignored-file-suffixes-glob)) + grep-find-ignored-files))) + (grep-compute-defaults) + (rgrep search-regexp (or files "* .*") root-dir)))) + (run-hooks 'projectile-grep-finished-hook))) + +;;;###autoload +(defun projectile-ag (search-term &optional arg) + "Run an ag search with SEARCH-TERM in the project. + +With an optional prefix argument ARG SEARCH-TERM is interpreted as a +regular expression." + (interactive + (list (projectile--read-search-string-with-default + (format "Ag %ssearch for" (if current-prefix-arg "regexp " ""))) + current-prefix-arg)) + (if (require 'ag nil 'noerror) + (let ((ag-command (if arg 'ag-regexp 'ag)) + (ag-ignore-list (delq nil + (delete-dups + (append + ag-ignore-list + (projectile--globally-ignored-file-suffixes-glob) + ;; ag supports git ignore files directly + (unless (eq (projectile-project-vcs) 'git) + (append (projectile-ignored-files-rel) + (projectile-ignored-directories-rel) + grep-find-ignored-files + grep-find-ignored-directories + '())))))) + ;; reset the prefix arg, otherwise it will affect the ag-command + (current-prefix-arg nil)) + (funcall ag-command search-term (projectile-project-root))) + (error "Package 'ag' is not available"))) + +;;;###autoload +(defun projectile-ripgrep (search-term) + "Run a Ripgrep search with `SEARCH-TERM' at current project root. + +SEARCH-TERM is a regexp." + (interactive (list (projectile--read-search-string-with-default + "Ripgrep search for"))) + (if (require 'ripgrep nil 'noerror) + (let ((args (mapcar (lambda (val) (concat "--glob !" val)) + (append projectile-globally-ignored-files + projectile-globally-ignored-directories)))) + (ripgrep-regexp search-term + (projectile-project-root) + (if current-prefix-arg + args + (cons "--fixed-strings" args)))) + (error "Package `ripgrep' is not available"))) + +(defun projectile-tags-exclude-patterns () + "Return a string with exclude patterns for ctags." + (mapconcat (lambda (pattern) (format "--exclude=\"%s\"" + (directory-file-name pattern))) + (projectile-ignored-directories-rel) " ")) + +;;;###autoload +(defun projectile-regenerate-tags () + "Regenerate the project's [e|g]tags." + (interactive) + (if (and (boundp 'ggtags-mode) + (memq projectile-tags-backend '(auto ggtags))) + (progn + (let* ((ggtags-project-root (projectile-project-root)) + (default-directory ggtags-project-root)) + (ggtags-ensure-project) + (ggtags-update-tags t))) + (let* ((project-root (projectile-project-root)) + (tags-exclude (projectile-tags-exclude-patterns)) + (default-directory project-root) + (tags-file (expand-file-name projectile-tags-file-name)) + (command (format projectile-tags-command tags-file tags-exclude)) + shell-output exit-code) + (with-temp-buffer + (setq exit-code + (call-process-shell-command command nil (current-buffer)) + shell-output (string-trim + (buffer-substring (point-min) (point-max))))) + (unless (zerop exit-code) + (error shell-output)) + (visit-tags-table tags-file) + (message "Regenerated %s" tags-file)))) + +(defun projectile-visit-project-tags-table () + "Visit the current project's tags table." + (when (projectile-project-p) + (let ((tags-file (projectile-expand-root projectile-tags-file-name))) + (when (file-exists-p tags-file) + (with-demoted-errors "Error loading tags-file: %s" + (visit-tags-table tags-file t)))))) + +(defun projectile-determine-find-tag-fn () + "Determine which function to use for a call to `projectile-find-tag'." + (or + (cond + ((eq projectile-tags-backend 'auto) + (cond + ((fboundp 'ggtags-find-tag-dwim) + 'ggtags-find-tag-dwim) + ((fboundp 'xref-find-definitions) + 'xref-find-definitions) + ((fboundp 'etags-select-find-tag) + 'etags-select-find-tag))) + ((eq projectile-tags-backend 'xref) + (when (fboundp 'xref-find-definitions) + 'xref-find-definitions)) + ((eq projectile-tags-backend 'ggtags) + (when (fboundp 'ggtags-find-tag-dwim) + 'ggtags-find-tag-dwim)) + ((eq projectile-tags-backend 'etags-select) + (when (fboundp 'etags-select-find-tag) + 'etags-select-find-tag))) + 'find-tag)) + +;;;###autoload +(defun projectile-find-tag () + "Find tag in project." + (interactive) + (projectile-visit-project-tags-table) + ;; Auto-discover the user's preference for tags + (let ((find-tag-fn (projectile-determine-find-tag-fn))) + (call-interactively find-tag-fn))) + +(defmacro projectile-with-default-dir (dir &rest body) + "Invoke in DIR the BODY." + (declare (debug t) (indent 1)) + `(let ((default-directory ,dir) + (projectile-cached-project-root nil)) + ,@body)) + +;;;###autoload +(defun projectile-run-command-in-root () + "Invoke `execute-extended-command' in the project's root." + (interactive) + (projectile-with-default-dir (projectile-project-root) + (call-interactively 'execute-extended-command))) + +;;;###autoload +(defun projectile-run-shell-command-in-root () + "Invoke `shell-command' in the project's root." + (interactive) + (projectile-with-default-dir (projectile-project-root) + (call-interactively 'shell-command))) + +;;;###autoload +(defun projectile-run-async-shell-command-in-root () + "Invoke `async-shell-command' in the project's root." + (interactive) + (projectile-with-default-dir (projectile-project-root) + (call-interactively 'async-shell-command))) + +;;;###autoload +(defun projectile-run-shell () + "Invoke `shell' in the project's root. + +Switch to the project specific shell buffer if it already exists." + (interactive) + (projectile-with-default-dir (projectile-project-root) + (shell (concat "*shell " (projectile-project-name) "*")))) + +;;;###autoload +(defun projectile-run-eshell () + "Invoke `eshell' in the project's root. + +Switch to the project specific eshell buffer if it already exists." + (interactive) + (let ((eshell-buffer-name (concat "*eshell " (projectile-project-name) "*"))) + (projectile-with-default-dir (projectile-project-root) + (eshell)))) + +;;;###autoload +(defun projectile-run-ielm () + "Invoke `ielm' in the project's root. + +Switch to the project specific ielm buffer if it already exists." + (interactive) + (let ((ielm-buffer-name (format "*ielm %s*" (projectile-project-name)))) + (if (get-buffer ielm-buffer-name) + (switch-to-buffer ielm-buffer-name) + (projectile-with-default-dir (projectile-project-root) + (ielm)) + ;; ielm's buffer name is hardcoded, so we have to rename it after creation + (rename-buffer ielm-buffer-name)))) + +;;;###autoload +(defun projectile-run-term (program) + "Invoke `term' in the project's root. + +Switch to the project specific term buffer if it already exists." + (interactive (list nil)) + (let* ((term (concat "term " (projectile-project-name))) + (buffer (concat "*" term "*"))) + (unless (get-buffer buffer) + (require 'term) + (let ((program (or program + (read-from-minibuffer "Run program: " + (or explicit-shell-file-name + (getenv "ESHELL") + (getenv "SHELL") + "/bin/sh"))))) + (projectile-with-default-dir (projectile-project-root) + (set-buffer (make-term term program)) + (term-mode) + (term-char-mode)))) + (switch-to-buffer buffer))) + +(defun projectile-files-in-project-directory (directory) + "Return a list of files in DIRECTORY." + (let ((dir (file-relative-name (expand-file-name directory) + (projectile-project-root)))) + (cl-remove-if-not + (lambda (f) (string-prefix-p dir f)) + (projectile-current-project-files)))) + +(defun projectile-unixy-system-p () + "Check to see if unixy text utilities are installed." + (cl-every + (lambda (x) (executable-find x)) + '("grep" "cut" "uniq"))) + +(defun projectile-files-from-cmd (cmd directory) + "Use a grep-like CMD to search for files within DIRECTORY. + +CMD should include the necessary search params and should output +equivalently to grep -HlI (only unique matching filenames). +Returns a list of expanded filenames." + (let ((default-directory directory)) + (mapcar (lambda (str) + (concat directory + (if (string-prefix-p "./" str) + (substring str 2) + str))) + (split-string + (string-trim (shell-command-to-string cmd)) + "\n+" + t)))) + +(defun projectile-files-with-string (string directory) + "Return a list of all files containing STRING in DIRECTORY. + +Tries to use ag, ack, git-grep, and grep in that order. If those +are impossible (for instance on Windows), returns a list of all +files in the project." + (if (projectile-unixy-system-p) + (let* ((search-term (shell-quote-argument string)) + (cmd (cond ((executable-find "ag") + (concat "ag --literal --nocolor --noheading -l -- " + search-term)) + ((executable-find "ack") + (concat "ack --literal --noheading --nocolor -l -- " + search-term)) + ((and (executable-find "git") + (eq (projectile-project-vcs) 'git)) + (concat "git grep -HlI " search-term)) + (t + ;; -r: recursive + ;; -H: show filename for each match + ;; -l: show only file names with matches + ;; -I: no binary files + (format "grep -rHlI %s ." search-term))))) + (projectile-files-from-cmd cmd directory)) + ;; we have to reject directories as a workaround to work with git submodules + (cl-remove-if + #'file-directory-p + (mapcar #'projectile-expand-root (projectile-dir-files directory))))) + +;;;###autoload +(defun projectile-replace (&optional arg) + "Replace literal string in project using non-regexp `tags-query-replace'. + +With a prefix argument ARG prompts you for a directory on which +to run the replacement." + (interactive "P") + (let* ((old-text (read-string + (projectile-prepend-project-name "Replace: ") + (projectile-symbol-or-selection-at-point))) + (new-text (read-string + (projectile-prepend-project-name + (format "Replace %s with: " old-text)))) + (directory (if arg + (file-name-as-directory + (read-directory-name "Replace in directory: ")) + (projectile-project-root))) + (files (projectile-files-with-string old-text directory))) + ;; Adapted from `tags-query-replace' for literal strings (not regexp) + (setq tags-loop-scan `(let ,(unless (equal old-text (downcase old-text)) + '((case-fold-search nil))) + (if (search-forward ',old-text nil t) + ;; When we find a match, move back to + ;; the beginning of it so + ;; perform-replace will see it. + (goto-char (match-beginning 0)))) + tags-loop-operate `(perform-replace ',old-text ',new-text t nil nil + nil multi-query-replace-map)) + (tags-loop-continue (or (cons 'list files) t)))) + +;;;###autoload +(defun projectile-replace-regexp (&optional arg) + "Replace a regexp in the project using `tags-query-replace'. + +With a prefix argument ARG prompts you for a directory on which +to run the replacement." + (interactive "P") + (let* ((old-text (read-string + (projectile-prepend-project-name "Replace regexp: ") + (projectile-symbol-or-selection-at-point))) + (new-text (read-string + (projectile-prepend-project-name + (format "Replace regexp %s with: " old-text)))) + (directory (if arg + (file-name-as-directory + (read-directory-name "Replace regexp in directory: ")) + (projectile-project-root))) + (files + ;; We have to reject directories as a workaround to work with git submodules. + ;; + ;; We can't narrow the list of files with + ;; `projectile-files-with-string' because those regexp tools + ;; don't support Emacs regular expressions. + (cl-remove-if + #'file-directory-p + (mapcar #'projectile-expand-root (projectile-dir-files directory))))) + (tags-query-replace old-text new-text nil (cons 'list files)))) + +(defun projectile-symbol-or-selection-at-point () + "Get the symbol or selected text at point." + (if (use-region-p) + (buffer-substring-no-properties (region-beginning) (region-end)) + (projectile-symbol-at-point))) + +(defun projectile-symbol-at-point () + "Get the symbol at point and strip its properties." + (substring-no-properties (or (thing-at-point 'symbol) ""))) + +;;;###autoload +(defun projectile-kill-buffers () + "Kill all project buffers." + (interactive) + (let ((name (projectile-project-name)) + (buffers (projectile-project-buffers))) + (if (yes-or-no-p + (format "Are you sure you want to kill %d buffer(s) for '%s'? " + (length buffers) name)) + ;; we take care not to kill indirect buffers directly + ;; as we might encounter them after their base buffers are killed + (mapc #'kill-buffer (cl-remove-if 'buffer-base-buffer buffers))))) + +;;;###autoload +(defun projectile-save-project-buffers () + "Save all project buffers." + (interactive) + (dolist (buf (projectile-project-buffers)) + (with-current-buffer buf + (when buffer-file-name + (save-buffer))))) + +;;;###autoload +(defun projectile-dired () + "Open `dired' at the root of the project." + (interactive) + (dired (projectile-project-root))) + +;;;###autoload +(defun projectile-dired-other-window () + "Open `dired' at the root of the project in another window." + (interactive) + (dired-other-window (projectile-project-root))) + +;;;###autoload +(defun projectile-dired-other-frame () + "Open `dired' at the root of the project in another frame." + (interactive) + (dired-other-frame (projectile-project-root))) + +;;;###autoload +(defun projectile-vc (&optional project-root) + "Open `vc-dir' at the root of the project. + +For git projects `magit-status-internal' is used if available. +For hg projects `monky-status' is used if available. + +If PROJECT-ROOT is given, it is opened instead of the project +root directory of the current buffer file. If interactively +called with a prefix argument, the user is prompted for a project +directory to open." + (interactive (and current-prefix-arg + (list + (projectile-completing-read + "Open project VC in: " + projectile-known-projects)))) + (or project-root (setq project-root (projectile-project-root))) + (let ((vcs (projectile-project-vcs project-root))) + (cl-case vcs + (git + (cond ((fboundp 'magit-status-internal) + (magit-status-internal project-root)) + ((fboundp 'magit-status) + (with-no-warnings (magit-status project-root))) + (t + (vc-dir project-root)))) + (hg + (if (fboundp 'monky-status) + (monky-status project-root) + (vc-dir project-root))) + (t (vc-dir project-root))))) + +;;;###autoload +(defun projectile-recentf () + "Show a list of recently visited files in a project." + (interactive) + (if (boundp 'recentf-list) + (find-file (projectile-expand-root + (projectile-completing-read + "Recently visited files: " + (projectile-recentf-files)))) + (message "recentf is not enabled"))) + +(defun projectile-recentf-files () + "Return a list of recently visited files in a project." + (and (boundp 'recentf-list) + (let ((project-root (projectile-project-root))) + (mapcar + (lambda (f) (file-relative-name f project-root)) + (cl-remove-if-not + (lambda (f) (string-prefix-p project-root f)) + recentf-list))))) + +(defun projectile-serialize-cache () + "Serializes the memory cache to the hard drive." + (projectile-serialize projectile-projects-cache projectile-cache-file)) + +(defvar projectile-configure-cmd-map + (make-hash-table :test 'equal) + "A mapping between projects and the last configure command used on them.") + +(defvar projectile-compilation-cmd-map + (make-hash-table :test 'equal) + "A mapping between projects and the last compilation command used on them.") + +(defvar projectile-test-cmd-map + (make-hash-table :test 'equal) + "A mapping between projects and the last test command used on them.") + +(defvar projectile-run-cmd-map + (make-hash-table :test 'equal) + "A mapping between projects and the last run command used on them.") + +(defvar projectile-project-configure-cmd nil + "The command to use with `projectile-configure-project'. +It takes precedence over the default command for the project type when set. +Should be set via .dir-locals.el.") + +(defvar projectile-project-compilation-cmd nil + "The command to use with `projectile-compile-project'. +It takes precedence over the default command for the project type when set. +Should be set via .dir-locals.el.") + +(defvar projectile-project-compilation-dir nil + "The directory to use with `projectile-compile-project'. +The directory path is relative to the project root. +Should be set via .dir-locals.el.") + +(defvar projectile-project-test-cmd nil + "The command to use with `projectile-test-project'. +It takes precedence over the default command for the project type when set. +Should be set via .dir-locals.el.") + +(defvar projectile-project-run-cmd nil + "The command to use with `projectile-run-project'. +It takes precedence over the default command for the project type when set. +Should be set via .dir-locals.el.") + +(defun projectile-default-configure-command (project-type) + "Retrieve default configure command for PROJECT-TYPE." + (plist-get (gethash project-type projectile-project-types) 'configure-command)) + +(defun projectile-default-compilation-command (project-type) + "Retrieve default compilation command for PROJECT-TYPE." + (plist-get (gethash project-type projectile-project-types) 'compile-command)) + +(defun projectile-default-compilation-dir (project-type) + "Retrieve default compilation directory for PROJECT-TYPE." + (plist-get (gethash project-type projectile-project-types) 'compilation-dir)) + +(defun projectile-default-test-command (project-type) + "Retrieve default test command for PROJECT-TYPE." + (plist-get (gethash project-type projectile-project-types) 'test-command)) + +(defun projectile-default-run-command (project-type) + "Retrieve default run command for PROJECT-TYPE." + (plist-get (gethash project-type projectile-project-types) 'run-command)) + +(defun projectile-configure-command (compile-dir) + "Retrieve the configure command for COMPILE-DIR. + +The command is determined like this: + +- first we check `projectile-configure-cmd-map' for the last +configure command that was invoked on the project + +- then we check for `projectile-project-configure-cmd' supplied +via .dir-locals.el + +- finally we check for the default configure command for a +project of that type" + (or (gethash compile-dir projectile-configure-cmd-map) + projectile-project-configure-cmd + (let ((cmd-format-string (projectile-default-configure-command (projectile-project-type)))) + (when cmd-format-string + (format cmd-format-string (projectile-project-root)))))) + +(defun projectile-compilation-command (compile-dir) + "Retrieve the compilation command for COMPILE-DIR. + +The command is determined like this: + +- first we check `projectile-compilation-cmd-map' for the last +compile command that was invoked on the project + +- then we check for `projectile-project-compilation-cmd' supplied +via .dir-locals.el + +- finally we check for the default compilation command for a +project of that type" + (or (gethash compile-dir projectile-compilation-cmd-map) + projectile-project-compilation-cmd + (projectile-default-compilation-command (projectile-project-type)))) + +(defun projectile-test-command (compile-dir) + "Retrieve the test command for COMPILE-DIR. + +The command is determined like this: + +- first we check `projectile-test-cmd-map' for the last +test command that was invoked on the project + +- then we check for `projectile-project-test-cmd' supplied +via .dir-locals.el + +- finally we check for the default test command for a +project of that type" + (or (gethash compile-dir projectile-test-cmd-map) + projectile-project-test-cmd + (projectile-default-test-command (projectile-project-type)))) + +(defun projectile-run-command (compile-dir) + "Retrieve the run command for COMPILE-DIR. + +The command is determined like this: + +- first we check `projectile-run-cmd-map' for the last +run command that was invoked on the project + +- then we check for `projectile-project-run-cmd' supplied +via .dir-locals.el + +- finally we check for the default run command for a +project of that type" + (or (gethash compile-dir projectile-run-cmd-map) + projectile-project-run-cmd + (projectile-default-run-command (projectile-project-type)))) + +(defun projectile-read-command (prompt command) + "Adapted from `compilation-read-command'." + (read-shell-command prompt command + (if (equal (car compile-history) command) + '(compile-history . 1) + 'compile-history))) + +(defun projectile-compilation-dir () + "Retrieve the compilation directory for this project." + (let* ((type (projectile-project-type)) + (directory (or projectile-project-compilation-dir + (projectile-default-compilation-dir type)))) + (if directory + (file-truename + (concat (file-name-as-directory (projectile-project-root)) + (file-name-as-directory directory))) + (projectile-project-root)))) + +(defun projectile-maybe-read-command (arg default-cmd prompt) + "Prompt user for command unless DEFAULT-CMD is an Elisp function." + (if (and (or (stringp default-cmd) (null default-cmd)) + (or compilation-read-command arg)) + (projectile-read-command prompt default-cmd) + default-cmd)) + +(defun projectile-run-compilation (cmd) + "Run external or Elisp compilation command CMD." + (if (functionp cmd) + (funcall cmd) + (compile cmd))) + +(cl-defun projectile--run-project-cmd + (command command-map &key show-prompt prompt-prefix save-buffers) + "Run a project COMMAND, typically a test- or compile command. + +Cache the COMMAND for later use inside the hash-table COMMAND-MAP. + +Normally you'll be prompted for a compilation command, unless +variable `compilation-read-command'. You can force the prompt +by setting SHOW-PROMPT. The prompt will be prefixed with PROMPT-PREFIX. + +If SAVE-BUFFERS is non-nil save all projectile buffers before +running the command." + (let* ((project-root (projectile-project-root)) + (default-directory (projectile-compilation-dir)) + (command (projectile-maybe-read-command show-prompt + command + prompt-prefix))) + (puthash default-directory command command-map) + (when save-buffers + (save-some-buffers (not compilation-ask-about-save) + (lambda () + (projectile-project-buffer-p (current-buffer) + project-root)))) + (unless (file-directory-p default-directory) + (mkdir default-directory)) + (projectile-run-compilation command))) + +;;;###autoload +(defun projectile-configure-project (arg) + "Run project configure command. + +Normally you'll be prompted for a compilation command, unless +variable `compilation-read-command'. You can force the prompt +with a prefix ARG." + (interactive "P") + (let ((command (projectile-configure-command (projectile-compilation-dir)))) + (projectile--run-project-cmd command projectile-configure-cmd-map + :show-prompt arg + :prompt-prefix "Configure command: " + :save-buffers t))) + +;;;###autoload +(defun projectile-compile-project (arg) + "Run project compilation command. + +Normally you'll be prompted for a compilation command, unless +variable `compilation-read-command'. You can force the prompt +with a prefix ARG." + (interactive "P") + (let ((command (projectile-compilation-command (projectile-compilation-dir)))) + (projectile--run-project-cmd command projectile-compilation-cmd-map + :show-prompt arg + :prompt-prefix "Compile command: " + :save-buffers t))) + +;;;###autoload +(defun projectile-test-project (arg) + "Run project test command. + +Normally you'll be prompted for a compilation command, unless +variable `compilation-read-command'. You can force the prompt +with a prefix ARG." + (interactive "P") + (let ((command (projectile-test-command (projectile-compilation-dir)))) + (projectile--run-project-cmd command projectile-test-cmd-map + :show-prompt arg + :prompt-prefix "Test command: " + :save-buffers t))) + +;;;###autoload +(defun projectile-run-project (arg) + "Run project run command. + +Normally you'll be prompted for a compilation command, unless +variable `compilation-read-command'. You can force the prompt +with a prefix ARG." + (interactive "P") + (let ((command (projectile-run-command (projectile-compilation-dir)))) + (projectile--run-project-cmd command projectile-run-cmd-map + :show-prompt arg + :prompt-prefix "Run command: "))) + +(defadvice compilation-find-file (around projectile-compilation-find-file) + "Try to find a buffer for FILENAME, if we cannot find it, +fallback to the original function." + (let ((filename (ad-get-arg 1)) + full-filename) + (ad-set-arg 1 + (or + (if (file-exists-p (expand-file-name filename)) + filename) + ;; Try to find the filename using projectile + (and (projectile-project-p) + (let ((root (projectile-project-root)) + (dirs (cons "" (projectile-current-project-dirs)))) + (when (setq full-filename + (car (cl-remove-if-not + #'file-exists-p + (mapcar + (lambda (f) + (expand-file-name + filename + (expand-file-name f root))) + dirs)))) + full-filename))) + ;; Fall back to the old argument + filename)) + ad-do-it)) + +(defun projectile-open-projects () + "Return a list of all open projects. +An open project is a project with any open buffers." + (delete-dups + (delq nil + (mapcar (lambda (buffer) + (with-current-buffer buffer + (when (projectile-project-p) + (abbreviate-file-name (projectile-project-root))))) + (buffer-list))))) + +(defun projectile--remove-current-project (projects) + "Remove the current project (if any) from the list of PROJECTS." + (if (projectile-project-p) + (projectile-difference projects + (list (abbreviate-file-name (projectile-project-root)))) + projects)) + +(defun projectile-relevant-known-projects () + "Return a list of known projects except the current one (if present)." + (projectile--remove-current-project projectile-known-projects)) + +(defun projectile-relevant-open-projects () + "Return a list of open projects except the current one (if present)." + (projectile--remove-current-project (projectile-open-projects))) + +;;;###autoload +(defun projectile-switch-project (&optional arg) + "Switch to a project we have visited before. +Invokes the command referenced by `projectile-switch-project-action' on switch. +With a prefix ARG invokes `projectile-commander' instead of +`projectile-switch-project-action.'" + (interactive "P") + (let ((projects (projectile-relevant-known-projects))) + (if projects + (projectile-completing-read + "Switch to project: " projects + :action (lambda (project) + (projectile-switch-project-by-name project arg))) + (user-error "There are no known projects")))) + +;;;###autoload +(defun projectile-switch-open-project (&optional arg) + "Switch to a project we have currently opened. +Invokes the command referenced by `projectile-switch-project-action' on switch. +With a prefix ARG invokes `projectile-commander' instead of +`projectile-switch-project-action.'" + (interactive "P") + (let ((projects (projectile-relevant-open-projects))) + (if projects + (projectile-switch-project-by-name + (projectile-completing-read "Switch to open project: " projects) + arg) + (user-error "There are no open projects")))) + +(defun projectile-switch-project-by-name (project-to-switch &optional arg) + "Switch to project by project name PROJECT-TO-SWITCH. +Invokes the command referenced by `projectile-switch-project-action' on switch. +With a prefix ARG invokes `projectile-commander' instead of +`projectile-switch-project-action.'" + (let ((switch-project-action (if arg + 'projectile-commander + projectile-switch-project-action))) + (run-hooks 'projectile-before-switch-project-hook) + (let ((default-directory project-to-switch)) + ;; use a temporary buffer to load PROJECT-TO-SWITCH's dir-locals before calling SWITCH-PROJECT-ACTION + (with-temp-buffer + (hack-dir-local-variables-non-file-buffer)) + ;; Normally the project name is determined from the current + ;; buffer. However, when we're switching projects, we want to + ;; show the name of the project being switched to, rather than + ;; the current project, in the minibuffer. This is a simple hack + ;; to tell the `projectile-project-name' function to ignore the + ;; current buffer and the caching mechanism, and just return the + ;; value of the `projectile-project-name' variable. We also + ;; need to ignore the cached project-root value otherwise we end + ;; up still showing files from the current project rather than + ;; the new project + (let ((projectile-cached-project-root nil) + (projectile-project-name (funcall projectile-project-name-function + project-to-switch))) + (funcall switch-project-action))) + (run-hooks 'projectile-after-switch-project-hook))) + +;;;###autoload +(defun projectile-find-file-in-directory (&optional directory) + "Jump to a file in a (maybe regular) DIRECTORY. + +This command will first prompt for the directory the file is in." + (interactive "DFind file in directory: ") + (let ((default-directory directory) + (projectile-require-project-root nil)) + (if (projectile-project-p) + ;; target directory is in a project + (let ((file (projectile-completing-read "Find file: " + (projectile-dir-files directory)))) + (find-file (expand-file-name file (projectile-project-root))) + (run-hooks 'projectile-find-file-hook)) + ;; target directory is not in a project + (projectile-find-file)))) + +(defun projectile-all-project-files () + "Get a list of all files in all projects." + (cl-mapcan + (lambda (project) + (when (file-exists-p project) + (let ((default-directory project) + (projectile-cached-project-root nil)) + (mapcar (lambda (file) + (expand-file-name file project)) + (projectile-current-project-files))))) + projectile-known-projects)) + +;;;###autoload +(defun projectile-find-file-in-known-projects () + "Jump to a file in any of the known projects." + (interactive) + (let ((projectile-require-project-root nil)) + (find-file (projectile-completing-read "Find file in projects: " (projectile-all-project-files))))) + +(defcustom projectile-after-switch-project-hook nil + "Hooks run right after project is switched." + :group 'projectile + :type 'hook) + +(defcustom projectile-before-switch-project-hook nil + "Hooks run when right before project is switched." + :group 'projectile + :type 'hook) + +(defun projectile-keep-project-p (project) + "Determine whether we should cleanup (remove) PROJECT or not. + +It handles the case of remote projects as well. +See `projectile--cleanup-known-projects'." + ;; Taken from from `recentf-keep-default-predicate' + (cond + ((file-remote-p project nil t) (file-readable-p project)) + ((file-remote-p project)) + ((file-readable-p project)))) + +(defun projectile--cleanup-known-projects () + "Remove known projects that don't exist anymore and return a list of projects removed." + (projectile-merge-known-projects) + (let ((projects-kept (cl-remove-if-not #'projectile-keep-project-p projectile-known-projects)) + (projects-removed (cl-remove-if #'projectile-keep-project-p projectile-known-projects))) + (setq projectile-known-projects projects-kept) + (projectile-merge-known-projects) + projects-removed)) + +;;;###autoload +(defun projectile-cleanup-known-projects () + "Remove known projects that don't exist anymore." + (interactive) + (if-let ((projects-removed (projectile--cleanup-known-projects))) + (message "Projects removed: %s" + (mapconcat #'identity projects-removed ", ")) + (message "No projects needed to be removed."))) + +;;;###autoload +(defun projectile-clear-known-projects () + "Clear both `projectile-known-projects' and `projectile-known-projects-file'." + (interactive) + (setq projectile-known-projects nil) + (projectile-save-known-projects)) + +;;;###autoload +(defun projectile-remove-known-project (&optional project) + "Remove PROJECT from the list of known projects." + (interactive (list (projectile-completing-read + "Remove from known projects: " projectile-known-projects + :action 'projectile-remove-known-project))) + (unless (called-interactively-p 'any) + (setq projectile-known-projects + (cl-remove-if + (lambda (proj) (string= project proj)) + projectile-known-projects)) + (projectile-merge-known-projects) + (when projectile-verbose + (message "Project %s removed from the list of known projects." project)))) + +;;;###autoload +(defun projectile-remove-current-project-from-known-projects () + "Remove the current project from the list of known projects." + (interactive) + (projectile-remove-known-project (abbreviate-file-name (projectile-project-root)))) + +(defun projectile-ignored-projects () + "A list of projects that should not be save in `projectile-known-projects'." + (mapcar #'file-truename projectile-ignored-projects)) + +(defun projectile-ignored-project-p (project-root) + "Return t if PROJECT-ROOT should not be added to `projectile-known-projects'." + (or (member project-root (projectile-ignored-projects)) + (and (functionp projectile-ignored-project-function) + (funcall projectile-ignored-project-function project-root)))) + +(defun projectile-add-known-project (project-root) + "Add PROJECT-ROOT to the list of known projects." + (interactive (list (read-directory-name "Add to known projects: "))) + (unless (projectile-ignored-project-p project-root) + (setq projectile-known-projects + (delete-dups + (cons (file-name-as-directory (abbreviate-file-name project-root)) + projectile-known-projects))))) + +(defun projectile-load-known-projects () + "Load saved projects from `projectile-known-projects-file'. +Also set `projectile-known-projects'." + (setq projectile-known-projects + (projectile-unserialize projectile-known-projects-file)) + (setq projectile-known-projects-on-file + (and (sequencep projectile-known-projects) + (copy-sequence projectile-known-projects)))) + +;; load the known projects +(projectile-load-known-projects) + +(defun projectile-save-known-projects () + "Save PROJECTILE-KNOWN-PROJECTS to PROJECTILE-KNOWN-PROJECTS-FILE." + (projectile-serialize projectile-known-projects + projectile-known-projects-file) + (setq projectile-known-projects-on-file + (and (sequencep projectile-known-projects) + (copy-sequence projectile-known-projects)))) + +(defun projectile-merge-known-projects () + "Merge any change from `projectile-known-projects-file' and save to disk. + +This enables multiple Emacs processes to make changes without +overwriting each other's changes." + (let* ((known-now projectile-known-projects) + (known-on-last-sync projectile-known-projects-on-file) + (known-on-file + (projectile-unserialize projectile-known-projects-file)) + (removed-after-sync (projectile-difference known-on-last-sync known-now)) + (removed-in-other-process + (projectile-difference known-on-last-sync known-on-file)) + (result (delete-dups + (projectile-difference + (append known-now known-on-file) + (append removed-after-sync removed-in-other-process))))) + (setq projectile-known-projects result) + (projectile-save-known-projects))) + +(define-ibuffer-filter projectile-files + "Show Ibuffer with all buffers in the current project." + (:reader (read-directory-name "Project root: " (ignore-errors (projectile-project-root))) + :description nil) + (with-current-buffer buf + (equal (file-name-as-directory (expand-file-name qualifier)) + (ignore-errors (projectile-project-root))))) + +(defun projectile-ibuffer-by-project (project-root) + "Open an IBuffer window showing all buffers in PROJECT-ROOT." + (let ((project-name (funcall projectile-project-name-function project-root))) + (ibuffer nil (format "*%s Buffers*" project-name) + (list (cons 'projectile-files project-root))))) + +;;;###autoload +(defun projectile-ibuffer (prefix) + "Open an IBuffer window showing all buffers in the current project. + +Let user choose another project when PREFIX is supplied." + (interactive "p") + (let ((project-root (if (= prefix 4) + (projectile-completing-read + "Project name: " + (projectile-relevant-known-projects)) + (projectile-project-root)))) + + (projectile-ibuffer-by-project project-root))) + +;;;; projectile-commander + +(defconst projectile-commander-help-buffer "*Commander Help*") + +(defvar projectile-commander-methods nil + "List of file-selection methods for the `projectile-commander' command. +Each element is a list (KEY DESCRIPTION FUNCTION). +DESCRIPTION is a one-line description of what the key selects.") + +;;;###autoload +(defun projectile-commander () + "Execute a Projectile command with a single letter. +The user is prompted for a single character indicating the action to invoke. +The `?' character describes then +available actions. + +See `def-projectile-commander-method' for defining new methods." + (interactive) + (let* ((choices (mapcar #'car projectile-commander-methods)) + (prompt (concat "Commander [" choices "]: ")) + (ch (read-char-choice prompt choices)) + (fn (nth 2 (assq ch projectile-commander-methods)))) + (funcall fn))) + +(defmacro def-projectile-commander-method (key description &rest body) + "Define a new `projectile-commander' method. + +KEY is the key the user will enter to choose this method. + +DESCRIPTION is a one-line sentence describing how the method. + +BODY is a series of forms which are evaluated when the find +is chosen." + (let ((method `(lambda () + ,@body))) + `(setq projectile-commander-methods + (cl-sort (copy-sequence + (cons (list ,key ,description ,method) + (assq-delete-all ,key projectile-commander-methods))) + (lambda (a b) (< (car a) (car b))))))) + +(def-projectile-commander-method ?? "Commander help buffer." + (ignore-errors (kill-buffer projectile-commander-help-buffer)) + (with-current-buffer (get-buffer-create projectile-commander-help-buffer) + (insert "Projectile Commander Methods:\n\n") + (dolist (met projectile-commander-methods) + (insert (format "%c:\t%s\n" (car met) (cadr met)))) + (goto-char (point-min)) + (help-mode) + (display-buffer (current-buffer) t)) + (projectile-commander)) + +(defun projectile-commander-bindings () + (def-projectile-commander-method ?A + "Find ag on project." + (call-interactively 'projectile-ag)) + + (def-projectile-commander-method ?f + "Find file in project." + (projectile-find-file)) + + (def-projectile-commander-method ?T + "Find test file in project." + (projectile-find-test-file)) + + (def-projectile-commander-method ?b + "Switch to project buffer." + (projectile-switch-to-buffer)) + + (def-projectile-commander-method ?d + "Find directory in project." + (projectile-find-dir)) + + (def-projectile-commander-method ?D + "Open project root in dired." + (projectile-dired)) + + (def-projectile-commander-method ?v + "Open project root in vc-dir or magit." + (projectile-vc)) + + (def-projectile-commander-method ?V + "Browse dirty projects" + (projectile-browse-dirty-projects)) + + (def-projectile-commander-method ?r + "Replace a string in the project." + (projectile-replace)) + + (def-projectile-commander-method ?R + "Regenerate the project's [e|g]tags." + (projectile-regenerate-tags)) + + (def-projectile-commander-method ?g + "Run grep on project." + (projectile-grep)) + + (def-projectile-commander-method ?s + "Switch project." + (projectile-switch-project)) + + (def-projectile-commander-method ?o + "Run multi-occur on project buffers." + (projectile-multi-occur)) + + (def-projectile-commander-method ?j + "Find tag in project." + (projectile-find-tag)) + + (def-projectile-commander-method ?k + "Kill all project buffers." + (projectile-kill-buffers)) + + (def-projectile-commander-method ?e + "Find recently visited file in project." + (projectile-recentf))) + +(projectile-commander-bindings) + +(defun projectile-read-variable () + "Prompt for a variable and return its name." + (completing-read "Variable: " + obarray + '(lambda (v) + (and (boundp v) (not (keywordp v)))) + t)) + +(define-skeleton projectile-skel-variable-cons + "Insert a variable-name and a value in a cons-cell." + "Value: " + "(" + (projectile-read-variable) + " . " + str + ")") + +(define-skeleton projectile-skel-dir-locals + "Insert a .dir-locals.el template." + nil + "((nil . (" + ("" '(projectile-skel-variable-cons) \n) + resume: + ")))") + +;;;###autoload +(defun projectile-edit-dir-locals () + "Edit or create a .dir-locals.el file of the project." + (interactive) + (let ((file (expand-file-name ".dir-locals.el" (projectile-project-root)))) + (find-file file) + (when (not (file-exists-p file)) + (unwind-protect + (projectile-skel-dir-locals) + (save-buffer))))) + +;;; Minor mode +(defvar projectile-command-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "4 a") #'projectile-find-other-file-other-window) + (define-key map (kbd "4 b") #'projectile-switch-to-buffer-other-window) + (define-key map (kbd "4 C-o") #'projectile-display-buffer) + (define-key map (kbd "4 d") #'projectile-find-dir-other-window) + (define-key map (kbd "4 D") #'projectile-dired-other-window) + (define-key map (kbd "4 f") #'projectile-find-file-other-window) + (define-key map (kbd "4 g") #'projectile-find-file-dwim-other-window) + (define-key map (kbd "4 t") #'projectile-find-implementation-or-test-other-window) + (define-key map (kbd "5 a") #'projectile-find-other-file-other-frame) + (define-key map (kbd "5 b") #'projectile-switch-to-buffer-other-frame) + (define-key map (kbd "5 d") #'projectile-find-dir-other-frame) + (define-key map (kbd "5 D") #'projectile-dired-other-frame) + (define-key map (kbd "5 f") #'projectile-find-file-other-frame) + (define-key map (kbd "5 g") #'projectile-find-file-dwim-other-frame) + (define-key map (kbd "5 t") #'projectile-find-implementation-or-test-other-frame) + (define-key map (kbd "!") #'projectile-run-shell-command-in-root) + (define-key map (kbd "&") #'projectile-run-async-shell-command-in-root) + (define-key map (kbd "a") #'projectile-find-other-file) + (define-key map (kbd "b") #'projectile-switch-to-buffer) + (define-key map (kbd "C") #'projectile-configure-project) + (define-key map (kbd "c") #'projectile-compile-project) + (define-key map (kbd "d") #'projectile-find-dir) + (define-key map (kbd "D") #'projectile-dired) + (define-key map (kbd "e") #'projectile-recentf) + (define-key map (kbd "E") #'projectile-edit-dir-locals) + (define-key map (kbd "f") #'projectile-find-file) + (define-key map (kbd "g") #'projectile-find-file-dwim) + (define-key map (kbd "F") #'projectile-find-file-in-known-projects) + (define-key map (kbd "i") #'projectile-invalidate-cache) + (define-key map (kbd "I") #'projectile-ibuffer) + (define-key map (kbd "j") #'projectile-find-tag) + (define-key map (kbd "k") #'projectile-kill-buffers) + (define-key map (kbd "l") #'projectile-find-file-in-directory) + (define-key map (kbd "m") #'projectile-commander) + (define-key map (kbd "o") #'projectile-multi-occur) + (define-key map (kbd "p") #'projectile-switch-project) + (define-key map (kbd "q") #'projectile-switch-open-project) + (define-key map (kbd "P") #'projectile-test-project) + (define-key map (kbd "r") #'projectile-replace) + (define-key map (kbd "R") #'projectile-regenerate-tags) + (define-key map (kbd "s g") #'projectile-grep) + (define-key map (kbd "s r") #'projectile-ripgrep) + (define-key map (kbd "s s") #'projectile-ag) + (define-key map (kbd "S") #'projectile-save-project-buffers) + (define-key map (kbd "t") #'projectile-toggle-between-implementation-and-test) + (define-key map (kbd "T") #'projectile-find-test-file) + (define-key map (kbd "u") #'projectile-run-project) + (define-key map (kbd "v") #'projectile-vc) + (define-key map (kbd "V") #'projectile-browse-dirty-projects) + (define-key map (kbd "x e") #'projectile-run-eshell) + (define-key map (kbd "x i") #'projectile-run-ielm) + (define-key map (kbd "x t") #'projectile-run-term) + (define-key map (kbd "x s") #'projectile-run-shell) + (define-key map (kbd "z") #'projectile-cache-current-file) + (define-key map (kbd "ESC") #'projectile-project-buffers-other-buffer) + map) + "Keymap for Projectile commands after `projectile-keymap-prefix'.") +(fset 'projectile-command-map projectile-command-map) + +(defvar projectile-mode-map + (let ((map (make-sparse-keymap))) + (define-key map projectile-keymap-prefix 'projectile-command-map) + map) + "Keymap for Projectile mode.") + +(easy-menu-change + '("Tools") "Projectile" + '(["Find file" projectile-find-file] + ["Find file in known projects" projectile-find-file-in-known-projects] + ["Find test file" projectile-find-test-file] + ["Find directory" projectile-find-dir] + ["Find file in directory" projectile-find-file-in-directory] + ["Find other file" projectile-find-other-file] + ["Switch to buffer" projectile-switch-to-buffer] + ["Jump between implementation file and test file" projectile-toggle-between-implementation-and-test] + ["Kill project buffers" projectile-kill-buffers] + ["Recent files" projectile-recentf] + ["Edit .dir-locals.el" projectile-edit-dir-locals] + "--" + ["Open project in dired" projectile-dired] + ["Switch to project" projectile-switch-project] + ["Switch to open project" projectile-switch-open-project] + ["Discover projects in directory" projectile-discover-projects-in-directory] + ["Search in project (grep)" projectile-grep] + ["Search in project (ag)" projectile-ag] + ["Replace in project" projectile-replace] + ["Multi-occur in project" projectile-multi-occur] + ["Browse dirty projects" projectile-browse-dirty-projects] + "--" + ["Run shell" projectile-run-shell] + ["Run eshell" projectile-run-eshell] + ["Run ielm" projectile-run-ielm] + ["Run term" projectile-run-term] + "--" + ["Cache current file" projectile-cache-current-file] + ["Invalidate cache" projectile-invalidate-cache] + ["Regenerate [e|g]tags" projectile-regenerate-tags] + "--" + ["Configure project" projectile-configure-project] + ["Compile project" projectile-compile-project] + ["Test project" projectile-test-project] + ["Run project" projectile-run-project] + "--" + ["Project info" projectile-project-info] + ["About" projectile-version]) + "Search Files (Grep)...") + +(easy-menu-change '("Tools") "--" nil "Search Files (Grep)...") + +(defcustom projectile-mode-line + '(:eval (format " Projectile[%s]" + (projectile-project-name))) + "Mode line lighter for Projectile. + +The value of this variable is a mode line template as in +`mode-line-format'. See Info Node `(elisp)Mode Line Format' for +details about mode line templates. + +Customize this variable to change how Projectile displays its +status in the mode line. The default value displays the project +name and type. Set this variable to nil to disable the mode line +entirely." + :group 'projectile + :type 'sexp + :risky t + :package-version '(projectile . "0.12.0")) + +(defun projectile-find-file-hook-function () + "Called by `find-file-hook' when `projectile-mode' is on. + +The function does pretty much nothing when triggered on remote files +as all the operations it normally performs are extremely slow over +tramp." + (unless (file-remote-p default-directory) + (projectile-cache-files-find-file-hook) + (projectile-track-known-projects-find-file-hook) + (projectile-visit-project-tags-table))) + +;;;###autoload +(define-minor-mode projectile-mode + "Minor mode to assist project management and navigation. + +When called interactively, toggle `projectile-mode'. With prefix +ARG, enable `projectile-mode' if ARG is positive, otherwise disable +it. + +When called from Lisp, enable `projectile-mode' if ARG is omitted, +nil or positive. If ARG is `toggle', toggle `projectile-mode'. +Otherwise behave as if called interactively. + +\\{projectile-mode-map}" + :lighter projectile-mode-line + :keymap projectile-mode-map + :group 'projectile + :require 'projectile + :global t + (cond + (projectile-mode + ;; initialize the projects cache if needed + (unless projectile-projects-cache + (setq projectile-projects-cache + (or (projectile-unserialize projectile-cache-file) + (make-hash-table :test 'equal)))) + (unless projectile-projects-cache-time + (setq projectile-projects-cache-time + (make-hash-table :test 'equal))) + ;; update the list of known projects + (projectile--cleanup-known-projects) + (projectile-discover-projects-in-search-path) + (add-hook 'find-file-hook 'projectile-find-file-hook-function) + (add-hook 'projectile-find-dir-hook #'projectile-track-known-projects-find-file-hook t) + (add-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook t t) + (ad-activate 'compilation-find-file) + (ad-activate 'delete-file)) + (t + (remove-hook 'find-file-hook #'projectile-find-file-hook-function) + (remove-hook 'dired-before-readin-hook #'projectile-track-known-projects-find-file-hook t) + (ad-deactivate 'compilation-find-file) + (ad-deactivate 'delete-file)))) + +;;;###autoload +(define-obsolete-function-alias 'projectile-global-mode 'projectile-mode "1.0") + +(provide 'projectile) + +;; Local Variables: +;; indent-tabs-mode: nil +;; End: + +;;; projectile.el ends here diff --git a/elpa/projectile-20180728.1457/projectile.elc b/elpa/projectile-20180728.1457/projectile.elc new file mode 100644 index 0000000..6faa4bb Binary files /dev/null and b/elpa/projectile-20180728.1457/projectile.elc differ diff --git a/elpa/python-environment-20150310.853/python-environment-autoloads.el b/elpa/python-environment-20150310.853/python-environment-autoloads.el new file mode 100644 index 0000000..c53be48 --- /dev/null +++ b/elpa/python-environment-20150310.853/python-environment-autoloads.el @@ -0,0 +1,16 @@ +;;; python-environment-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil nil ("python-environment-pkg.el" "python-environment.el" +;;;;;; "test-python-environment.el") (23391 65284 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; python-environment-autoloads.el ends here diff --git a/elpa/python-environment-20150310.853/python-environment-pkg.el b/elpa/python-environment-20150310.853/python-environment-pkg.el new file mode 100644 index 0000000..b10e928 --- /dev/null +++ b/elpa/python-environment-20150310.853/python-environment-pkg.el @@ -0,0 +1,11 @@ +(define-package "python-environment" "20150310.853" "virtualenv API for Emacs Lisp" + '((deferred "0.3.1")) + :keywords + '("applications" "tools") + :authors + '(("Takafumi Arakaki ")) + :maintainer + '("Takafumi Arakaki ")) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/python-environment-20150310.853/python-environment.el b/elpa/python-environment-20150310.853/python-environment.el new file mode 100644 index 0000000..3c304ba --- /dev/null +++ b/elpa/python-environment-20150310.853/python-environment.el @@ -0,0 +1,245 @@ +;;; python-environment.el --- virtualenv API for Emacs Lisp + +;; Copyright (C) 2015 Takafumi Arakaki + +;; Author: Takafumi Arakaki +;; Keywords: applications, tools +;; Version: 0.0.2 +;; Package-Requires: ((deferred "0.3.1")) + +;; This file is NOT part of GNU Emacs. + +;; python-environment.el 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. + +;; python-environment.el 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 python-environment.el. +;; If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'deferred) + +(defconst python-environment-version "0.0.2alpha0") + +(defcustom python-environment-directory + (locate-user-emacs-file ".python-environments") + "Path to directory to store all Python virtual environments. A string. + +If you want to change the location to, say ``~/.python-environments``, +then set it like this in your Emacs setup file:: + + (setq python-environment-directory \"~/.python-environments\")" + :group 'python-environment) + +(defcustom python-environment-default-root-name "default" + "Default Python virtual environment name. A string. + +This is a name of directory relative to `python-environment-directory' +where default virtual environment locates. +Thus, typically the default virtual environment path is +``~/.emacs.d/.python-environments/default``." + :group 'python-environment) + +(defcustom python-environment-virtualenv + (list "virtualenv" "--system-site-packages" "--quiet") + ;; --quiet is required for Windows. Without it, virtualenv raises + ;; UnicodeEncodeError + ;; See: https://github.com/tkf/emacs-jedi/issues/148#issuecomment-38290546 + "``virtualenv`` command to use, including command options. List of strings. + +For example, if you want to use specific Python executable (to +specify Python version), append ``--python`` option like this:: + + (setq python-environment-virtualenv + (append python-environment-virtualenv + '(\"--python\" \"PATH/TO/bin/python\"))) + +I added ``--system-site-packages`` as default, but this is not +mandatory. If you don't like it, removing does not break +anything (well, theoretically). For reason why it is default, +see discussion here: +https://github.com/tkf/emacs-python-environment/issues/3" + :group 'python-environment) + +(defvar python-environment--verbose nil) + +(defun python-environment--deferred-process (msg command) + (message "%s..." msg) + (deferred:$ + (apply #'deferred:process command) + (deferred:watch it + (apply-partially + (lambda (msg output) + (message "%s...Done" msg) + (when python-environment--verbose + (message output))) + msg)))) + +(defun python-environment--blocking-process (msg command) + (message "%s (SYNC)..." msg) + (let (exit-code output) + (with-temp-buffer + (setq exit-code + (apply #'call-process (car command) + nil ; INFILE (no input) + t ; BUFFER (output to this buffer) + nil ; DISPLAY (no refresh is needed) + (cdr command))) + (setq output (buffer-string))) + (when (or python-environment--verbose + (not (= exit-code 0))) + (message output)) + (message "%s (SYNC)...Done" msg) + (unless (= exit-code 0) + (error "Command %S exits with error code %S." command exit-code)))) + + +(defun python-environment-root-path (&optional root) + (expand-file-name (or root python-environment-default-root-name) + python-environment-directory)) + +(defun python-environment--make-with-runner (proc-runner root virtualenv) + (let ((path (convert-standard-filename + (python-environment-root-path root))) + (virtualenv (append (or virtualenv python-environment-virtualenv) + (when python-environment--verbose + (list "--verbose"))))) + (unless (executable-find (car virtualenv)) + (error "Program named %S does not exist." (car virtualenv))) + (funcall proc-runner + (format "Making virtualenv at %s" path) + (append virtualenv (list path))))) + +(defun python-environment-make (&optional root virtualenv) + "Make virtual environment at ROOT asynchronously. + +This function does not wait until ``virtualenv`` finishes. +Instead, it returns a deferred object [#]_. So, if you want to +do some operation after the ``virtualenv`` command finishes, do +something like this:: + + (deferred:$ + (python-environment-make) + (deferred:nextc it (lambda (output) DO-SOMETHING-HERE))) + +If ROOT is specified, it is used instead of +`python-environment-default-root-name'. ROOT can be a relative +path from `python-environment-virtualenv' or an absolute path. + +If VIRTUALENV (list of string) is specified, it is used instead of +`python-environment-virtualenv'. + +.. [#] https://github.com/kiwanami/emacs-deferred" + (python-environment--make-with-runner + #'python-environment--deferred-process + root virtualenv)) + +(defun python-environment-make-block (&optional root virtualenv) + "Blocking version of `python-environment-make'. +I recommend NOT to use this function in interactive commands. +For reason, see `python-environment-run-block'" + (python-environment--make-with-runner + #'python-environment--blocking-process + root virtualenv)) + +(defun python-environment-exists-p (&optional root) + "Return non-`nil' if virtualenv at ROOT exists. +See `python-environment-make' for how ROOT is interpreted." + (let ((bin (python-environment-bin "python" root))) + (and bin (file-exists-p bin)))) + +(defun python-environment--existing (root &rest paths) + (when paths + (let ((full-path (expand-file-name (car paths) + (python-environment-root-path root)))) + (if (file-exists-p full-path) + full-path + (apply #'python-environment--existing root (cdr paths)))))) + +(defun python-environment-bin (path &optional root) + "Return full path to \"ROOT/bin/PATH\" or \"ROOT/Scripts/PATH\" if exists. +``Scripts`` is used instead of ``bin`` in typical Windows case. +In Windows, path with extension \".ext\" may be returned. +See `python-environment-make' for how ROOT is interpreted." + (python-environment--existing root + (concat "bin/" path) + (concat "Scripts/" path) + (concat "Scripts/" path ".exe"))) + +(defun python-environment-lib (path &optional root) + "Return full path to \"ROOT/lib/PATH\" or \"ROOT/Lib/PATH\" if exists. +``Lib`` is used instead of ``lib`` in typical Windows case. +See `python-environment-make' for how ROOT is interpreted." + (python-environment--existing root + (concat "lib/" path) + (concat "Lib/" path))) + +(defun python-environment--run-with-runner (proc-runner command root) + (funcall proc-runner + (format "Running: %s" (mapconcat 'identity command " ")) + (cons (python-environment-bin (car command) root) + (cdr command)))) + +(defun python-environment--run-1 (&optional command root) + (python-environment--run-with-runner + #'python-environment--deferred-process + command root)) + +(defun python-environment--run-block-1 (command root) + (python-environment--run-with-runner + #'python-environment--blocking-process + command root)) + +(defun python-environment-run (command &optional root virtualenv) + "Run COMMAND installed in Python virtualenv located at ROOT +asynchronously. + +Instead of waiting for COMMAND to finish, a deferred object [#]_ +is returned so that you can chain operations. + +See `python-environment-make' for how ROOT and VIRTUALENV are +interpreted and how to work with deferred object. + +Use `python-environment-run-block' if you want to wait until +the command exit (NOT recommended in interactive command). + +.. [#] https://github.com/kiwanami/emacs-deferred" + (if (python-environment-exists-p root) + (python-environment--run-1 command root) + (deferred:$ + (python-environment-make root virtualenv) + (deferred:nextc it + (apply-partially + (lambda (command root _) + (python-environment--run-1 command root)) + command root))))) + +(defun python-environment-run-block (command &optional root virtualenv) + "Blocking version of `python-environment-run'. +I recommend NOT to use this function in interactive commands. +Emacs users have more important things to than waiting for some +command to finish." + (unless (python-environment-exists-p root) + (python-environment-make-block root virtualenv)) + (python-environment--run-block-1 command root)) + +(provide 'python-environment) + +;; Local Variables: +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: + +;;; python-environment.el ends here diff --git a/elpa/python-environment-20150310.853/python-environment.elc b/elpa/python-environment-20150310.853/python-environment.elc new file mode 100644 index 0000000..e527227 Binary files /dev/null and b/elpa/python-environment-20150310.853/python-environment.elc differ diff --git a/elpa/python-environment-20150310.853/test-python-environment.el b/elpa/python-environment-20150310.853/test-python-environment.el new file mode 100644 index 0000000..e6638ca --- /dev/null +++ b/elpa/python-environment-20150310.853/test-python-environment.el @@ -0,0 +1,209 @@ +;;; test-python-environment.el --- Tests for python-environment.el + +;; Copyright (C) 2013 Takafumi Arakaki + +;; Author: Takafumi Arakaki + +;; This file is NOT part of GNU Emacs. + +;; test-python-environment.el 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. + +;; test-python-environment.el 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 test-python-environment.el. +;; If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'ert) +(require 'python-environment) + +(defmacro pye-test-with-temp-env (&rest body) + (declare (debug (&rest form)) + (indent 0)) + (let ((path (make-symbol "path"))) + `(let* ((,path (make-temp-file "pye-test-" t)) + (python-environment-directory ,path)) + (unwind-protect + (progn ,@body) + (delete-directory ,path t))))) + +(defmacro pye-deftest (name args &rest body) + "Customized `ert-deftest'. Bind `python-environment-directory' to a +temporary directory while executing BODY." + (declare (debug (&define :name test + name sexp [&optional stringp] + [&rest keywordp sexp] def-body)) + (doc-string 3) + (indent 2)) + `(ert-deftest ,name ,args + (pye-test-with-temp-env + ,@body))) + +(defmacro pye-with-mixed-environment (environment &rest body) + "Mix-in ENVIRONMENT to `process-environment' while executing `BODY'. +ENVIRONMENT is a list whose element is arguments (i.e., list) to `setenv'." + (declare (debug (sexp &rest form)) + (indent 1)) + `(let ((process-environment (mapcar #'identity process-environment))) + (mapc (lambda (env) (apply #'setenv env)) ,environment) + ,@body)) + +(defun pye-eval-in-subprocess (sexp &optional environment) + "Evaluate SEXP in Emacs launched as subprocess. Additional environment +variable can be given as ENVIRONMENT (see `pye-with-mixed-environment')." + (let ((default-directory (expand-file-name default-directory))) + ;; Resolution of "~/" will be affected by `environment' if it + ;; includes "$HOME". So expand it before + ;; `pye-with-mixed-environment' to avoid the confusion. + (pye-with-mixed-environment environment + (let ((print-length nil) + (print-level nil)) + (with-temp-buffer + (let ((code (call-process + (concat invocation-directory invocation-name) + nil t nil + "-Q" "--batch" + "--eval" (format "(setq load-path (cons %S '%S))" + default-directory load-path) + "--load" (locate-library "test-python-environment") + "--eval" (format "%S" sexp)))) + (unless (eq code 0) + (error "Subprocess terminated with code %S.\nOutput:\n%s" + code (buffer-string))))))))) + +(defmacro pye-test-with-capture-message (&rest form) + (declare (debug (&rest form)) + (indent 0)) + `(let ((start (make-marker)) + (message-buffer (get-buffer "*Messages*"))) + (with-current-buffer message-buffer + (set-marker start (point-max))) + (progn ,@form) + (with-current-buffer message-buffer + (buffer-substring start (point-max))))) + +(ert-deftest pye-test-test-with-capture-message () + (should (equal (pye-test-with-capture-message + (message "test-1") + (message "test-2")) + "test-1\ntest-2\n"))) + +(defun pye-test-proc-runner-output-message (proc-runner desired-output) + (let* ((command '("echo" "DUMMY-ECHO-MESSAGE")) + (python-environment--verbose t) + (message-output + (pye-test-with-capture-message + (funcall proc-runner "DUMMY-MESSAGE" command)))) + (should (equal message-output desired-output)))) + +(ert-deftest pye-test-deferred-process-output-message () + (pye-test-proc-runner-output-message + (lambda (msg command) + (deferred:sync! (python-environment--deferred-process msg command))) "\ +DUMMY-MESSAGE...Done +DUMMY-ECHO-MESSAGE + +")) + +(ert-deftest pye-test-blocking-process-output-message () + (pye-test-proc-runner-output-message + #'python-environment--blocking-process "\ +DUMMY-MESSAGE (SYNC)... +DUMMY-ECHO-MESSAGE + +DUMMY-MESSAGE (SYNC)...Done +")) + +(defun pye-test-deferred-process-should-error () + (let (err) + (deferred:sync! + (deferred:error + (python-environment--deferred-process + "DUMMY-MESSAGE" + '("false")) + (lambda (got) (setq err got)))) + (should err))) + +(ert-deftest pye-test-deferred-process-error-without-verbose () + (let ((python-environment--verbose nil)) + (pye-test-deferred-process-should-error))) + +(ert-deftest pye-test-deferred-process-noerror-without-verbose () + (let ((python-environment--verbose nil)) + (deferred:sync! + (python-environment--deferred-process "DUMMY-MESSAGE" '("true"))))) + +(ert-deftest pye-test-blocking-process-error-without-verbose () + (let ((python-environment--verbose nil)) + (should-error + (python-environment--blocking-process "DUMMY-MESSAGE" '("false"))))) + +(ert-deftest pye-test-blocking-process-noerror-without-verbose () + (let ((python-environment--verbose nil)) + (python-environment--blocking-process "DUMMY-MESSAGE" '("true")))) + +(ert-deftest pye-test-deferred-process-error-with-verbose () + (let ((python-environment--verbose t)) + (pye-test-deferred-process-should-error))) + +(ert-deftest pye-test-deferred-process-noerror-with-verbose () + (let ((python-environment--verbose t)) + (deferred:sync! + (python-environment--deferred-process "DUMMY-MESSAGE" '("true"))))) + +(ert-deftest pye-test-blocking-process-error-with-verbose () + (let ((python-environment--verbose t)) + (should-error + (python-environment--blocking-process "DUMMY-MESSAGE" '("false"))))) + +(ert-deftest pye-test-blocking-process-noerror-with-verbose () + (let ((python-environment--verbose t)) + (python-environment--blocking-process "DUMMY-MESSAGE" '("true")))) + +(pye-deftest pye-test-make-environment-with-non-existing-command () + (should-error (python-environment-make nil '("non-existing-command")))) + +(pye-deftest pye-test-make-environment () + (deferred:sync! (python-environment-make))) + +(pye-deftest pye-test-run () + (deferred:sync! (python-environment-run '("python" "--version")))) + +(pye-deftest pye-test-run-block () + (python-environment-run-block '("python" "--version"))) + +(pye-deftest pye-test-block-error () + (should-error (python-environment-run-block '("python" "-c" "1/0")))) + +(ert-deftest pye-test-eval-in-subprocess () + (pye-eval-in-subprocess '(+ 1 2)) + (should-error (pye-eval-in-subprocess '(error "some error")))) + +(pye-deftest pye-test-bare-make-environment () + (let ((tmp-home python-environment-directory)) + (pye-eval-in-subprocess '(deferred:sync! (python-environment-make)) + `(("HOME" ,tmp-home))) + (should (file-directory-p (expand-file-name + ".emacs.d/.python-environments/default" + tmp-home))))) + +(provide 'test-python-environment) + +;; Local Variables: +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: + +;;; test-python-environment.el ends here diff --git a/elpa/python-environment-20150310.853/test-python-environment.elc b/elpa/python-environment-20150310.853/test-python-environment.elc new file mode 100644 index 0000000..2c3fc04 Binary files /dev/null and b/elpa/python-environment-20150310.853/test-python-environment.elc differ diff --git a/elpa/python-mode-20180721.1847/completion/pycomplete.el b/elpa/python-mode-20180721.1847/completion/pycomplete.el new file mode 100644 index 0000000..9b20372 --- /dev/null +++ b/elpa/python-mode-20180721.1847/completion/pycomplete.el @@ -0,0 +1,436 @@ +;;; Complete symbols at point using Pymacs. + +;; Copyright (C) 2007 Skip Montanaro + +;; Original Author: Skip Montanaro +;; Maintainer: Urs Fleisch +;; Created: Oct 2004 +;; Keywords: python pymacs 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. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: +;; Along with pycomplete.py this file allows programmers to complete Python +;; symbols within the current buffer. See pycomplete.py for the Python side +;; of things and a short description of what to expect. + +;; BAW 2012-09-28: pymacs may not be installed on Debian. +(condition-case nil + (require 'pymacs) + (file-error nil)) + +(eval-when-compile (require 'cl)) + +(pymacs-load "pycomplete") + +(defcustom py-complete-set-keymap-p nil + "If keys shall be defined when calling `py-complete-initialize'. +Default is nil. + +See also `py-complete-set-keymap'" + :type 'boolean + :group 'python-mode) + +(defvar py-complete-variable-index nil + "An alist with mappings of local variable names to types.") +(defvar py-complete-variable-index-position 0 + "The line-beginning-position when py-complete-variable-index was last updated. +This can be used to skip updating the index when still on the same line.") + +(defun py-complete-type-for-value (val) + "Return name of type for variable assignment value. +If the type cannot be deduced, nil is returned." + (let ((firstchar (string-to-char val)) + (case-fold-search nil)) + (cond + ((or (equal 0 firstchar) (string= val "None")) nil) + ((equal ?\[ firstchar) "list") + ((equal ?{ firstchar) "dict") + ((or (equal ?' firstchar) (equal ?\" firstchar)) "str") + ((string-match "^[rR]['\"]" val) "str") + ((string-match "^[uU][rR]?['\"]" val) "unicode") + ((or (string= val "True") (string= val "False")) "bool") + ((string-match "^[+\\-]?[0-9]+$" val) "int") + ((string-match "^[+\\-]?[0-9]+[lL]$" val) "long") + ((string-match "^[+\\-]?[0-9]+\\(?:\\.[0-9]+\\)?" val) "float") + ((string-match "^\\(\\(?:[[:word:]\\.]+\\.\\)?_?[A-Z][A-Za-z0-9]+\\)($" val) + (match-string-no-properties 1 val)) + ((string= "(" (substring-no-properties val -1)) + (concat "_PYCFRT(" (substring-no-properties val 0 -1) ")"))))) + +(defun py-complete-variables-in-def (&optional limit) + "Return an alist with mappings of local variable names to types. +Local variable assignments and parameters of the current function are +parsed. If limit is given, it limits the size of the returned alist." + (let ((pos (point)) + (i 0) + (beg 0) + candidates + (variable-assignment-re (concat "^[ \t]+\\(\\w+\\)[ \t]*\\(?:=\\|+=\\|*=\\|%=\\|&=\\|^=\\|<<=\\|-=\\|/=\\|**=\\||=\\|>>=\\|//=\\)[ \t]*\\([({[]\\|[rRuU]*['\"]\\|[+\\-]?[[:word:].]+(?\\)"))) + (save-excursion + ;; First get the current def and its parameters + (py-backward-def) + (when (looking-at (concat py-def-re " *\\([^( ]+\\) *\\(([^:]+\\) *:")) + (setq beg (match-end 0)) + (let ((params (replace-regexp-in-string + "[ )]+$" "" + (replace-regexp-in-string + "^[ (]+" "" + (match-string-no-properties 3))))) + (dolist (param (split-string params "[ \t\r\n]*,[ \t\r\n]*")) + ;; Transform param into an assignment string + (setq param (concat " " param + (unless (memq ?= (string-to-list param)) + "=None"))) + (if (string-match variable-assignment-re param) + (push `(,(match-string-no-properties 1 param) . + ,(py-complete-type-for-value (match-string-no-properties 2 param))) + candidates))))) + ;; Search backward + (goto-char pos) + (while (and (or (not (integerp limit)) (< i limit)) + (re-search-backward variable-assignment-re nil t) + (> (point) beg)) + (let* ((candidate (match-string-no-properties 1)) + (entry (assoc candidate candidates))) + (cond ((null entry) + (push `(,(match-string-no-properties 1) . + ,(py-complete-type-for-value (match-string-no-properties 2))) + candidates) + (incf i)) + ((not (cdr entry)) + (setcdr entry (py-complete-type-for-value (match-string-no-properties 2))))))) + (nreverse candidates)))) + +(defun py-complete-update-variable-index (&optional limit) + "Update py-complete-variable-index from the local variables of the current +function. An update is only performed if point was on a different line for +the last update. If limit is given, it limits the size of the index." + (unless (local-variable-p 'py-complete-variable-index) + (make-local-variable 'py-complete-variable-index)) + (unless (local-variable-p 'py-complete-variable-index-position) + (make-local-variable 'py-complete-variable-index-position)) + (let ((linebeg (line-beginning-position))) + (unless (eq linebeg py-complete-variable-index-position) + (setq py-complete-variable-index (py-complete-variables-in-def limit)) + (setq py-complete-variable-index-position linebeg)))) + +(defun py-complete-variable-completions-for-symbol (sym) + "Get completions for local variables in current def. +If sym is an empty string, all local variables are returned, +else those starting with sym." + (when (and (stringp sym) (string-match "^\\w*$" sym)) + (py-complete-update-variable-index) + (let ((symlen (length sym))) + (if (zerop symlen) + (mapcar 'car py-complete-variable-index) + (remove-if-not + #'(lambda (s) (and (>= (length s) symlen) (string= sym (substring s 0 symlen)))) + (mapcar 'car py-complete-variable-index)))))) + +(defun py-complete-which-class () + "Return current class name based on point. +If no class name is found, return nil." + (interactive) + (let (classname) + (save-excursion + (save-restriction + (py-backward-class) + (when (looking-at (concat py-class-re " *\\([^( ]+\\)")) + (setq classname (match-string-no-properties 2)) + (if (interactive-p) + (message "%s" classname))))) + classname)) + +(defun py-complete-type-before-dotexpr (&optional pos) + "Get type for expression before dot expression. +The character after pos (point if omitted) must be a dot. +Returns list, str or dict if such an expression is before +the dot, else nil." + (let ((dotchar (char-after pos))) + (if (and dotchar (char-equal ?. dotchar)) + (save-excursion + (if pos + (goto-char pos)) + (cond + ((looking-back "\\(\\[\\|,[^[]*\\)\\]") "list") + ((looking-back "['\"]") "str") + ((looking-back "}") "dict")))))) + +(defun py-complete-substitute-type-for-var (word) + "Substitute the type for the variable starting the dot-expression word. +Returns the word with replaced variable if known, else the unchanged word." + (let* (type + (firstsym (car (split-string word "\\."))) + (firstlen (length firstsym))) + (if (string= firstsym "self") + (setq type (py-complete-which-class)) + (py-complete-update-variable-index) + (setq type (cdr (assoc firstsym py-complete-variable-index)))) + (if (stringp type) + (concat type (substring word firstlen)) + word))) + +(defun py-complete-python-dotexpr-begin nil + (re-search-backward "[^a-zA-Z_0-9\\.]") + (forward-char)) + +(defun py-complete-python-dotexpr-end nil + (re-search-forward "[a-zA-Z_0-9\\.]*")) + +(put 'python-dotexpr 'beginning-op 'py-complete-python-dotexpr-begin) +(put 'python-dotexpr 'end-op 'py-complete-python-dotexpr-end) + +(defun py-complete-enhanced-dotexpr-at-point () + "Enhanced (thing-at-point 'python-dotexpr). +The returned word starts with a type if an expression is found before the dot +or if the dot-expression starts with a variable for which the type is known." + (require 'thingatpt) + (let ((bounds (bounds-of-thing-at-point 'python-dotexpr))) + (if bounds + (let* ((beg (car bounds)) + (end (cdr bounds)) + (word (buffer-substring-no-properties beg end)) + (prefix (py-complete-type-before-dotexpr beg))) + (if prefix + (concat prefix word) + (py-complete-substitute-type-for-var word)))))) + +(defun py-complete-enhanced-symbol-before-point () + "Return the dotted python symbol before point. +The returned word starts with a type if an expression is found before the dot +or if the dot-expression starts with a variable for which the type is known." + (let* (prefix + (word (buffer-substring-no-properties + (save-excursion + (skip-chars-backward "a-zA-Z0-9_.") + (setq prefix (py-complete-type-before-dotexpr)) + (point)) + (point)))) + (if prefix + (concat prefix word) + (py-complete-substitute-type-for-var word)))) + +;; Not used anymore +(defun py-find-global-imports () + "Find Python import statements in buffer." + (save-excursion + (let (first-class-or-def imports) + (goto-char (point-min)) + (setq first-class-or-def + (re-search-forward "^ *\\(def\\|class\\) " nil t)) + (goto-char (point-min)) + (setq imports nil) + (while (re-search-forward + "^\\(import \\|from \\([A-Za-z_\\.][A-Za-z_0-9\\.]*\\) import \\).*" + first-class-or-def t) + (setq imports (cons (buffer-substring-no-properties + (match-beginning 0) + (match-end 0)) + imports))) + (nreverse imports)))) + +(defun py-complete () + "Complete symbol before point using Pymacs. " + (interactive) + (setq py-last-window-configuration + (current-window-configuration)) + (let ((symbol (py-complete-enhanced-symbol-before-point))) + (if (string= "" symbol) + (tab-to-tab-stop) + (let ((completions + (py-complete-completions-for-symbol symbol))) + (if completions + (let* (completion + (lastsym (car (last (split-string symbol "\\.")))) + (lastlen (length lastsym))) + (cond ((null (cdr completions)) + (setq completion (car completions))) + (t + (setq completion (try-completion lastsym completions)) + (message "Making completion list...") + (with-output-to-temp-buffer "*PythonCompletions*" + (display-completion-list completions)) + (message "Making completion list...%s" "done"))) + (when (and (stringp completion) + (> (length completion) lastlen)) + (insert (substring completion lastlen)))) + (message "Can't find completion for \"%s\"" symbol) + (ding)))))) + +(defun py-complete-completions-for-symbol (sym &optional imports) + "Get possible completions for symbol using statements given in imports." + (let ((pymacs-forget-mutability t)) + (append + (py-complete-variable-completions-for-symbol sym) + (pycomplete-pycompletions + sym (buffer-file-name) + imports)))) + +(defun py-complete-docstring-for-symbol (sym &optional imports) + "Get docstring for symbol using statements given in imports." + (let ((pymacs-forget-mutability t)) + (pycomplete-pydocstring + sym (buffer-file-name) + imports))) + +(defun py-complete-completions () + "Get possible completions for current statement." + (py-complete-completions-for-symbol + (py-complete-enhanced-symbol-before-point))) + +(defun py-complete-completion-at-point () + "Return a (start end collection) list, so that this function +can be used as a hook for completion-at-point-functions." + (setq py-last-window-configuration + (current-window-configuration)) + (let ((symbol (py-complete-enhanced-symbol-before-point))) + (when (not (string= "" symbol)) + (let ((completions (py-complete-completions-for-symbol symbol))) + (when completions + (when (> (length completions) 1) + ;; this-command is changed to avoid the following situation: + ;; This function is invoked via indent-for-tab-command (because + ;; tab-always-indent is complete) and there is a "Complete, but + ;; not unique" case (e.g. "for" is completed and the next TAB key + ;; press shall display a list with "for", "format"). In such a + ;; case, py-indent-line would detect a repeated indentation + ;; request and thus change the indentation. The changed + ;; indentation would then prevent indent-for-tab-command + ;; from calling the completion function. + (setq this-command 'py-complete-completion-at-point)) + (list (- (point) (length (car (last (split-string symbol "\\."))))) + (point) + completions)))))) + +(defun py-complete-show (string) + (display-message-or-buffer string "*PythonHelp*")) + +(defun py-complete-help (string) + "get help on a python expression" + (interactive "sHelp: ") + (let* ((pymacs-forget-mutability t) + (help-string + (pycomplete-pyhelp string (buffer-file-name)))) + (if (and help-string (> (length help-string) 300)) + (with-output-to-temp-buffer "*Python Help*" + (princ help-string)) + (py-complete-show help-string)))) + +(defun py-complete-help-thing-at-point nil + (interactive) + (let ((sym (py-complete-enhanced-dotexpr-at-point))) + (if sym + (py-complete-help sym)))) + +(set 'py-complete-current-signature nil) + +(defun py-complete-signature (function) + "get signature of a python function or method" + (let ((pymacs-forget-mutability t)) + (set 'py-complete-current-signature + (pycomplete-pysignature function (buffer-file-name))))) + +(defun py-complete-signature-show nil + (let ((sym (py-complete-enhanced-dotexpr-at-point))) + (if sym + (progn + (py-complete-show (py-complete-signature sym)))))) + +(defun py-complete-signature-expr nil + (interactive) + (let ((dotexpr (read-string "signature on: " + (py-complete-enhanced-dotexpr-at-point)))) + (if dotexpr + (py-complete-show + (py-complete-signature dotexpr))))) + +(defun py-complete-electric-lparen nil + "electricly insert '(', and try to get a signature for the stuff to the left" + (interactive) + (py-complete-signature-show) + (self-insert-command 1)) + +(defun py-complete-electric-comma nil + "electricly insert ',', and redisplay latest signature" + (interactive) + (self-insert-command 1) + (if py-complete-current-signature + (py-complete-show (format "%s" py-complete-current-signature)))) + +(defun py-complete-location (sym) + "Get definition location of sym in cons form (FILE . LINE)." + (let ((location (pycomplete-pylocation sym (buffer-file-name)))) + (when (and location (vectorp location) (= (length location) 2)) + (cons (aref location 0) (aref location 1))))) + +(defun py-complete-goto-definition nil + "Got to definition of Python function." + (interactive) + (let ((sym (py-complete-enhanced-dotexpr-at-point))) + (if sym + (let ((location + (pycomplete-pylocation sym (buffer-file-name)))) + (if (and location (vectorp location) (= (length location) 2)) + (progn + (find-file (aref location 0)) + (goto-line (aref location 1))) + (message "Cannot find the definition!")))))) + +(defun py-complete-parse-source () + "Parse source code of Python file to get imports and completions." + (let ((errstr (pycomplete-pyparse (buffer-file-name) t))) + (if errstr + (message "%s" errstr)))) + +(defun py-complete-set-keymap () + "Define key map with pycomplete functions." + (interactive) + (define-key python-mode-map [C-tab] 'py-complete) + (define-key python-mode-map [f1] 'py-complete-help-thing-at-point) + (define-key python-mode-map "(" 'py-complete-electric-lparen) + (define-key python-mode-map "," 'py-complete-electric-comma) + (define-key python-mode-map [S-f1] 'py-complete-signature-expr) + (define-key python-mode-map [f2] 'py-complete-goto-definition) + (define-key python-mode-map [f3] 'py-complete-help)) + +(defun py-complete-initialize () + "Initialize pycomplete hooks. +Should be called from python-mode-hook. Keys are set when +`py-complete-set-keymap-p' is non-nil." + (interactive) + (when py-set-complete-keymap-p + (py-complete-set-keymap)) + (when py-complete-set-keymap-p + (py-complete-set-keymap)) + ;; Parse source file after it is saved + (add-hook 'after-save-hook 'py-complete-parse-source nil 'local) + ;; Set up auto-complete or company if enabled + (cond + ((fboundp 'auto-complete-mode) + (require 'auto-complete-pycomplete) + (setq ac-sources + (if (boundp 'py-complete-ac-sources) + py-complete-ac-sources + '(ac-source-pycomplete)))) + ((fboundp 'company-mode) + (company-mode t) + (require 'company-pycomplete) + (set (make-local-variable 'company-backends) + '((company-pycomplete)))) + ((or py-set-complete-keymap-p py-complete-set-keymap-p) + (set (make-local-variable 'tab-always-indent) 'complete) + (define-key python-mode-map [tab] 'indent-for-tab-command)))) + +(provide 'pycomplete) diff --git a/elpa/python-mode-20180721.1847/completion/pycomplete.elc b/elpa/python-mode-20180721.1847/completion/pycomplete.elc new file mode 100644 index 0000000..844bbfb Binary files /dev/null and b/elpa/python-mode-20180721.1847/completion/pycomplete.elc differ diff --git a/elpa/python-mode-20180721.1847/completion/pycomplete.py b/elpa/python-mode-20180721.1847/completion/pycomplete.py new file mode 100644 index 0000000..be381c7 --- /dev/null +++ b/elpa/python-mode-20180721.1847/completion/pycomplete.py @@ -0,0 +1,798 @@ +""" +Python dot expression completion using Pymacs. + +This almost certainly needs work, but if you add + + (require 'pycomplete) + +to your init.el file and have Pymacs installed, when you hit M-TAB it will +try to complete the dot expression before point. For example, given this +import at the top of the file: + + import time + +typing "time.cl" then hitting M-TAB should complete "time.clock". + +This is unlikely to be done the way Emacs completion ought to be done, but +it's a start. Perhaps someone with more Emacs mojo can take this stuff and +do it right. + +See pycomplete.el for the Emacs Lisp side of things. + +Most of the public functions in this module have the signature + +(s, fname=None, imports=None) + +where s is the symbol to complete, fname is the file path and imports +the list of import statements to use. The fname parameter is used as a +key to cache the global and local context and the symbols imported or +evaluated so far. The cache for an fname is cleared when its imports +are changed. When not passing a list of imports (or None), the currently +used imports are preserved. The caching should make subsequent operations +(e.g. another completion or signature lookup after a completion) less +expensive. +""" + +# Original Author: Skip Montanaro +# Maintainer: Urs Fleisch +# Created: Oct 2004 +# Keywords: python pymacs emacs + +# This software is provided as-is, without express or implied warranty. +# Permission to use, copy, modify, distribute or sell this software, without +# fee, for any purpose and by any individual or organization, is hereby +# granted, provided that the above copyright notice and this paragraph +# appear in all copies. + +# Along with pycomplete.el this file allows programmers to complete Python +# symbols within the current buffer. + +import sys +import types +import inspect +import keyword +import os +import pydoc +import ast +import re + +if sys.version_info[0] >= 3: # Python 3 + import io +else: # Python 2 + import StringIO + +try: + x = set +except NameError: + from sets import Set as set +else: + del x + + +class _PyCompleteDocument(object): + """Completion data for Python source file.""" + + if sys.version_info[0] >= 3: # Python 3 + _helpout = io.StringIO + @staticmethod + def is_num_or_str(obj): + return isinstance(obj, (int, float, str)) + @staticmethod + def is_class_type(obj): + return type(obj) == type + @staticmethod + def get_unbound_function(unbound): + return unbound + @staticmethod + def get_method_function(meth): + return meth.__func__ + @staticmethod + def get_function_code(func): + return func.__code__ + @staticmethod + def update_with_builtins(keys): + import builtins + keys.update(dir(builtins)) + else: # Python 2 + _helpout = StringIO.StringIO + @staticmethod + def is_num_or_str(obj): + return isinstance(obj, (int, long, float, basestring)) + @staticmethod + def is_class_type(obj): + return type(obj) in (types.ClassType, types.TypeType) + @staticmethod + def get_unbound_function(unbound): + return unbound.im_func + @staticmethod + def get_method_function(meth): + return meth.im_func + @staticmethod + def get_function_code(func): + return func.func_code + @staticmethod + def update_with_builtins(keys): + import __builtin__ + keys.update(dir(__builtin__)) + + _sre_SRE_Pattern = type(re.compile('')) + _sre_SRE_Match = type(re.match('', '')) + + # Class name in CapCase, as suggested by PEP8 Python style guide + _class_name_re = re.compile(r'(?:^|\.)_?[A-Z][A-Za-z0-9]+$') + + _return_type_of_func = { + 'bin': 'str', + 'bytearray': 'bytearray', + 'bytes': 'bytes', + 'compile': 'types.CodeType', + 'complex': 'complex', + 'dict': 'dict', + 'frozenset': 'frozenset', + 'oct': 'str', + 'open': 'io.BufferedIOBase' if sys.version_info[0] >= 3 else 'file', + 'list': 'list', + 'repr': 'str', + 'set': 'set', + 'sorted': 'list', + 'str': 'str', + 'tuple': 'tuple', + 'vars': 'dict', + 're.compile': '_PyCompleteDocument._sre_SRE_Pattern', + 're.escape': 'str', + 're.findall': 'list', + 're.match': '_PyCompleteDocument._sre_SRE_Match', + 're.search': '_PyCompleteDocument._sre_SRE_Match', + 're.split': 'list', + 're.sub': 'str', + 're.subn': 'tuple', + 'datetime.datetime': 'datetime.datetime', + 'datetime.date': 'datetime.date', + 'datetime.time': 'datetime.time', + 'datetime.timedelta': 'datetime.timedelta', + 'sys.exc_info': 'tuple', + 'os.getcwd': 'str', + 'os.getenv': 'str', + 'os.urandom': 'bytes', + 'os.path.abspath': 'str', + 'os.path.basename': 'str', + 'os.path.commonprefix': 'str', + 'os.path.dirname': 'str', + 'os.path.expanduser': 'str', + 'os.path.expandvars': 'str', + 'os.path.join': 'str', + 'os.path.normcase': 'str', + 'os.path.normpath': 'str', + 'os.path.realpath': 'str', + 'os.path.relpath': 'str', + 'os.path.split': 'tuple', + 'os.path.splitdrive': 'tuple', + 'os.path.splitext': 'tuple', + 'collections.defaultdict': 'collections.defaultdict', + 'collections.deque': 'collections.deque', + 'collections.namedtuple': 'collections.namedtuple', + 'socket.socket': 'socket.socket', + 'csv.excel': 'csv.excel', + 'csv.excel_tab': 'csv.excel_tab' + } + + @staticmethod + def _get_type_for_function(funcname): + typename = _PyCompleteDocument._return_type_of_func.get(funcname) + if not typename and \ + _PyCompleteDocument._class_name_re.search(funcname): + typename = funcname + return typename + + @staticmethod + def _replace_pycfrt_with_typename(s): + """Replace _PYCFRT(..) expressions with function return type. + + The names of variables assigned from function calls can be replaced by + _PYCFRT(name.of.function). This function tries to replace such expressions + with the corresponding function return type (PYCFRT = pycomplete function + return type). If no such expression can be found, s is returned unchanged. + If the type cannot be deduced, None is returned, else the substituted + string.""" + pycfrt_re = re.compile(r'_PYCFRT\(([^()]+)\)') + return pycfrt_re.sub(lambda m: _PyCompleteDocument._get_type_for_function(m.group(1)), s) + + class ImportExtractor(ast.NodeVisitor): + """NodeVisitor to extract the top-level import statements from an AST. + + To generate code containing all imports in try-except statements, + call get_import_code(node), where node is a parsed AST. + """ + def visit_FunctionDef(self, node): + # Ignore imports inside functions or methods. + pass + + def visit_ClassDef(self, node): + # Ignore imports inside classes. + pass + + def generic_visit(self, node): + # Store import statement nodes. + if isinstance(node, (ast.Import, ast.ImportFrom)): + self._import_nodes.append(node) + ast.NodeVisitor.generic_visit(self, node) + + def get_import_code(self, node, fname=''): + """Get compiled code of all top-level import statements found in the + AST of node.""" + self._import_nodes = [] + self.visit(node) + body = [] + for imp_node in self._import_nodes: + if isinstance(imp_node, ast.ImportFrom) and \ + imp_node.module == '__future__': + # 'SyntaxError: from __future__ imports must occur at the + # beginning of the file' is raised if a 'from __future__ import' + # is wrapped in try-except, so use only the import statement. + body.append(imp_node) + else: + if sys.version_info[0] >= 3: # Python 3 + body.append(ast.Try(body=[imp_node], handlers=[ + ast.ExceptHandler(type=None, name=None, body=[ast.Pass()])], + orelse=[], finalbody=[])) + else: + body.append(ast.TryExcept(body=[imp_node], handlers=[ + ast.ExceptHandler(type=None, name=None, body=[ast.Pass()])], + orelse=[])) + node = ast.Module(body=body) + ast.fix_missing_locations(node) + code = compile(node, fname, 'exec') + return code + + + class CodeRemover(ast.NodeTransformer): + """NodeTransformer which replaces function statements with 'pass' + and keeps only safe assignments, so that the resulting code can + be used for code completion. + + To reduce the code from the node of a parsed AST, call + get_transformed_code(node). + """ + def visit_FunctionDef(self, node): + # Replace all function statements except doc string by 'pass'. + if node.body: + if isinstance(node.body[0], ast.Expr) and \ + isinstance(node.body[0].value, ast.Str): + # Keep doc string. + first_stmt = node.body[1] if len(node.body) > 1 else node.body[0] + node.body = [node.body[0]] + else: + first_stmt = node.body[0] + node.body = [] + node.body.append(ast.copy_location(ast.Pass(), first_stmt)) + return node + return None + + def visit_Expr(self, node): + # Remove all expressions except strings to keep doc strings. + if isinstance(node.value, ast.Str): + return node + return None + + @staticmethod + def _get_type_node_for_function_node(node): + # Convert node to dot expression + attrs = [] + while isinstance(node, ast.Attribute): + attrs.insert(0, node.attr) + node = node.value + if isinstance(node, ast.Name): + attrs.insert(0, node.id) + funcname = '.'.join(attrs) + typename = _PyCompleteDocument._get_type_for_function(funcname) + if typename: + # Convert dot expression to node + attrs = typename.split('.') + node = None + if attrs: + node = ast.Name(id=attrs.pop(0), ctx=ast.Load()) + while attrs: + node = ast.Attribute(value=node, attr=attrs.pop(0), + ctx=ast.Load()) + return node + return None + + @staticmethod + def replace_unsafe_value(node, replace_self=None): + """Modify value from assignment if unsafe. + + If replace_self is given, only assignments starting with 'self.' are + processed, the assignment node is returned with 'self.' replaced by + the value of replace_self (typically the class name). + For other assignments, None is returned.""" + for i, target in enumerate(node.targets): + if not isinstance(target, (ast.Name, ast.Attribute)): + # Only process assignments to names and attributes, + # not tuples. + return None + if replace_self: + if isinstance(target, ast.Attribute) and \ + isinstance(target.value, ast.Name) and \ + target.value.id == 'self' and \ + isinstance(target.value.ctx, ast.Load): + node.targets[i].value.id = replace_self + if target.attr == '__name__': + node.value = ast.copy_location(ast.Str(s=''), + node.value) + elif target.attr in ('__dict__', '__class__', '__bases__', + '__doc__'): + return None + else: + return None + elif isinstance(target, ast.Name) and \ + isinstance(target.ctx, ast.Store): + if target.id == '__metaclass__': + # Do not modify __metaclass__ assignments + return node + elif target.id == '__slots__': + node.value = ast.copy_location( + ast.List(elts=[], ctx=ast.Load()), node.value) + if isinstance(node.value, (ast.Str, ast.Num)): + pass + elif isinstance(node.value, (ast.List, ast.Tuple)): + node.value.elts = [] + elif isinstance(node.value, ast.Dict): + node.value.keys = [] + node.value.values = [] + elif isinstance(node.value, ast.ListComp): + node.value = ast.copy_location(ast.List(elts=[], ctx=ast.Load()), node.value) + elif isinstance(node.value, ast.Call): + type_node = _PyCompleteDocument.CodeRemover._get_type_node_for_function_node(node.value.func) + if type_node: + # Wrap class lookup in try-except because it is not fail-safe. + node.value = ast.copy_location(type_node, node.value) + if sys.version_info[0] >= 3: # Python 3 + node = ast.copy_location(ast.Try(body=[node], handlers=[ + ast.ExceptHandler(type=None, name=None, body=[ast.Pass()])], + orelse=[], finalbody=[]), node) + else: + node = ast.copy_location(ast.TryExcept(body=[node], handlers=[ + ast.ExceptHandler(type=None, name=None, body=[ast.Pass()])], + orelse=[]), node) + ast.fix_missing_locations(node) + else: + node.value = ast.copy_location( + ast.Name(id='None', ctx=ast.Load()), node.value) + else: + node.value = ast.copy_location(ast.Name(id='None', ctx=ast.Load()), node.value) + return node + + def visit_Assign(self, node): + # Replace unsafe values of assignements by None. + return self.replace_unsafe_value(node) + + def visit_Name(self, node): + # Pass names for bases in ClassDef. + return node + + def visit_Attribute(self, node): + # Pass attributes for bases in ClassDef. + return node + + def visit_ClassDef(self, node): + # Visit nodes of class. + # Store instance member assignments to be added later to generated code. + self_assignments = {} + for child in ast.walk(node): + if isinstance(child, ast.Assign): + new_child = self.replace_unsafe_value(child, + replace_self=node.name) + if new_child: + new_var = child.targets[0].attr + old_assign = self_assignments.get(new_var) + if not old_assign or ( + isinstance(old_assign, ast.Assign) and + isinstance(old_assign.value, ast.Name) and + old_assign.value.id == 'None'): + self_assignments[new_var] = new_child + self._class_assignments.extend(list(self_assignments.values())) + return ast.NodeTransformer.generic_visit(self, node) + + def visit_Module(self, node): + # Visit nodes of module + return ast.NodeTransformer.generic_visit(self, node) + + def generic_visit(self, node): + # Remove everything which is not handled by the methods above + return None + + def get_transformed_code(self, node, fname=''): + """Get compiled code containing only empty functions and methods + and safe assignments found in the AST of node.""" + self._class_assignments = [] + node = self.visit(node) + # The self members are added as attributes to the class objects + # rather than included as class variables inside the class definition + # so that names starting with '__' are not mangled. + node.body.extend(self._class_assignments) + code = compile(node, fname, 'exec') + return code + + _stdout = sys.stdout + + _instances = {} + + def __init__(self, fname=None): + """Constructor for internal use. + The factory method instance() shall be used instead. + """ + self._fname = fname + self._imports = None + self._globald = globals().copy() + self._symnames = [] + self._symobjs = {} + self._parse_source_called = False + + @classmethod + def instance(cls, fname): + """Get _PyCompleteDocument object for fname. + If no object for this file name exists, a new object is created and + registered. + """ + obj = cls._instances.get(fname) + if obj is None: + obj = _PyCompleteDocument(fname) + cls._instances[fname] = obj + return obj + + def _import_modules(self, imports): + """Import modules using the statements in imports. + If the imports are the same as in the last call, the methods + immediately returns, also if imports is None. + """ + if imports is None and not self._parse_source_called: + self.parse_source() + if imports is None or imports == self._imports: + return + # changes to where the file is + if self._fname: + os.chdir(os.path.dirname(self._fname)) + self._globald = globals().copy() + self._symnames = [] + self._symobjs = {} + for stmt in imports: + try: + exec(stmt, self._globald) + except TypeError: + raise TypeError('invalid type: %s' % stmt) + except Exception: + continue + self._imports = imports + + def _collect_symbol_names(self): + """Collect the global, local, builtin symbols in _symnames. + If _symnames is already set, the method immediately returns. + """ + if not self._symnames: + keys = set(keyword.kwlist) + keys.update(list(self._globald.keys())) + self.update_with_builtins(keys) + self._symnames = list(keys) + self._symnames.sort() + + def _get_symbol_object(self, s): + """Get a symbol by evaluating its name or importing a module + or submodule with the name s. + """ + sym = self._symobjs.get(s) + if sym is not None: + return sym + # changes to where the file is + if self._fname: + os.chdir(os.path.dirname(self._fname)) + try: + sym = eval(s, self._globald) + except NameError: + try: + sym = __import__(s, self._globald) + self._globald[s] = sym + except ImportError: + pass + except AttributeError: + try: + sym = __import__(s, self._globald) + except ImportError: + pass + except SyntaxError: + pass + if sym is not None: + self._symobjs[s] = sym + return sym + + def _load_symbol(self, s, strict=False): + """Get a symbol for a dotted expression. + + Returns the last successfully found symbol object in the + dotted chain. If strict is set True, it returns True as + soon as a symbol is not found. Therefore strict=True can + be used to find exactly the symbol for s, otherwise a + symbol for a parent can be returned, which may be enough + if searching for help on symbol. + """ + s = self._replace_pycfrt_with_typename(s) + sym = self._symobjs.get(s) + if sym is not None: + return sym + dots = s.split('.') + if not s or len(dots) == 1: + sym = self._get_symbol_object(s) + else: + for i in range(1, len(dots) + 1): + s = '.'.join(dots[:i]) + if not s: + continue + sym_i = self._get_symbol_object(s) + if sym_i is not None: + sym = sym_i + elif strict: + return None + return sym + + def _get_help(self, s, imports=None): + """Return string printed by help function.""" + if not s: + return '' + if s == 'pydoc.help': + # Prevent pydoc from going into interactive mode + s = 'pydoc.Helper' + obj = None + if not keyword.iskeyword(s): + try: + self._import_modules(imports) + obj = self._load_symbol(s, strict=False) + except Exception as ex: + return '%s' % ex + if not obj: + obj = str(s) + out = self._helpout() + try: + sys.stdout = out + pydoc.help(obj) + finally: + sys.stdout = self._stdout + return out.getvalue() + + @staticmethod + def _find_constructor(class_ob): + """Given a class object, return a function object used for the + constructor (ie, __init__() ) or None if we can't find one.""" + try: + return _PyCompleteDocument.get_unbound_function(class_ob.__init__) + except AttributeError: + for base in class_ob.__bases__: + rc = _PyCompleteDocument._find_constructor(base) + if rc is not None: + return rc + return None + + def get_all_completions(self, s, imports=None): + """Return contextual completion of s (string of >= zero chars). + + If given, imports is a list of import statements to be executed + first. + """ + self._import_modules(imports) + + s = self._replace_pycfrt_with_typename(s) + last_dot_pos = s.rfind('.') + if last_dot_pos == -1: + self._collect_symbol_names() + if s: + return [k for k in self._symnames if k.startswith(s)] + else: + return self._symnames + + sym = self._load_symbol(s[:last_dot_pos], strict=True) + if sym is not None: + s = s[last_dot_pos + 1:] + return [k for k in dir(sym) if k.startswith(s)] + return [] + + def complete(self, s, imports=None): + """Complete symbol if unique, else return list of completions.""" + if not s: + return '' + + completions = self.get_all_completions(s, imports) + if len(completions) == 0: + return None + else: + dots = s.split(".") + prefix = os.path.commonprefix([k for k in completions]) + if len(completions) == 1 or len(prefix) > len(dots[-1]): + return [prefix[len(dots[-1]):]] + return completions + + def help(self, s, imports=None): + """Return help on object.""" + try: + return self._get_help(s, imports) + except Exception as ex: + return '%s' % ex + + def get_docstring(self, s, imports=None): + """Return docstring for symbol s.""" + if s and not keyword.iskeyword(s): + try: + self._import_modules(imports) + obj = self._load_symbol(s, strict=True) + if obj and not self.is_num_or_str(obj): + doc = inspect.getdoc(obj) + if doc: + return doc + except: + pass + return '' + + def get_signature(self, s, imports=None): + """Return info about function parameters.""" + if not s or keyword.iskeyword(s): + return '' + obj = None + sig = "" + + try: + self._import_modules(imports) + obj = self._load_symbol(s, strict=False) + except Exception as ex: + return '%s' % ex + + if self.is_class_type(obj): + # Look for the highest __init__ in the class chain. + ctr = self._find_constructor(obj) + if ctr is not None and type(ctr) in ( + types.MethodType, types.FunctionType, types.LambdaType): + obj = ctr + elif type(obj) == types.MethodType: + # bit of a hack for methods - turn it into a function + # but we drop the "self" param. + obj = self.get_method_function(obj) + + if type(obj) in [types.FunctionType, types.LambdaType]: + try: + (args, varargs, varkw, defaults) = inspect.getargspec(obj) + sig = ('%s: %s' % (obj.__name__, + inspect.formatargspec(args, varargs, varkw, + defaults))) + except ValueError: + try: + (args, varargs, varkw, defaults, kwonlyargs, + kwonlydefaults, annotations) = inspect.getfullargspec(obj) + sig = ('%s: %s' % ( + obj.__name__, inspect.formatargspec( + args, varargs, varkw, defaults, kwonlyargs, + kwonlydefaults, annotations))) + except AttributeError: + pass + + doc = getattr(obj, '__doc__', '') + if doc and not sig: + doc = doc.lstrip() + pos = doc.find('\n') + if pos < 0 or pos > 70: + pos = 70 + sig = doc[:pos] + return sig + + def get_location(self, s, imports=None): + """Return file path and line number of symbol, None if not found.""" + if not s or keyword.iskeyword(s): + return None + try: + self._import_modules(imports) + obj = self._load_symbol(s, strict=False) + if obj is not None: + if self.is_class_type(obj): + obj = obj.__init__ + if type(obj) == types.MethodType: + obj = self.get_method_function(obj) + if type(obj) in [types.FunctionType, types.LambdaType]: + code = self.get_function_code(obj) + return (os.path.abspath(code.co_filename), code.co_firstlineno) + # If not found, try using inspect. + return (inspect.getsourcefile(obj), inspect.getsourcelines(obj)[1]) + except: + pass + return None + + def parse_source(self, only_reload=False): + """Parse source code to get imports and completions. + + If this method is called, the imports parameter for the other methods + must be omitted (or None), so that the imports are taken from the + parsed source code. If only_reload is True, the source is only parsed + if it has been parsed before. + None is returned if OK, else a string describing the error. + """ + if only_reload and not self._parse_source_called: + return None + self._parse_source_called = True + if not self._fname: + return None + + try: + with open(self._fname) as fh: + src = fh.read() + except IOError as ex: + return '%s' % ex + + # changes to where the file is + os.chdir(os.path.dirname(self._fname)) + + try: + node = ast.parse(src, self._fname) + import_code = self.ImportExtractor().get_import_code(node, self._fname) + except (SyntaxError, TypeError) as ex: + return '%s' % ex + + old_globald = self._globald.copy() + self._globald = globals().copy() + try: + exec(import_code, self._globald) + except Exception as ex: + self._globald = old_globald + return '%s' % ex + + self._symnames = [] + self._symobjs = {} + + reduced_code = self.CodeRemover().get_transformed_code(node, self._fname) + try: + exec(reduced_code, self._globald) + except Exception as ex: + return '%s' % ex + return None + +def pycompletions(s, fname=None, imports=None): + """Get a list of possible completions for s. + + The completions extend the expression s after the last dot. + """ + return _PyCompleteDocument.instance(fname).get_all_completions( + s, imports) + +def pycomplete(s, fname=None, imports=None): + """Complete the Python expression s. + + If multiple completions are found, a list of possible completions + (names after the last dot) is returned. + If one completion is found, a list with a string containing the + remaining characters is returned. + If no completion is found, None is returned. + """ + return _PyCompleteDocument.instance(fname).complete(s, imports) + +def pyhelp(s, fname=None, imports=None): + """Return help on object s.""" + return _PyCompleteDocument.instance(fname).help(s, imports) + +def pydocstring(s, fname=None, imports=None): + """Return docstring of symbol.""" + return _PyCompleteDocument.instance(fname).get_docstring(s, imports) + +def pysignature(s, fname=None, imports=None): + """Return info about function parameters.""" + return _PyCompleteDocument.instance(fname).get_signature(s, imports) + +def pylocation(s, fname=None, imports=None): + """Return file path and line number of symbol, None if not found.""" + return _PyCompleteDocument.instance(fname).get_location(s, imports) + +def pyparse(fname, only_reload=False): + """Parse source code to get imports and completions. + + If this function is called, the imports parameter for the other functions + must be omitted (or None), so that the imports are taken from the + parsed source code. If only_reload is True, the source is only parsed if + it has been parsed before. + """ + return _PyCompleteDocument.instance(fname).parse_source(only_reload) + +# Local Variables : +# pymacs-auto-reload : t +# End : diff --git a/elpa/python-mode-20180721.1847/python-mode-autoloads.el b/elpa/python-mode-20180721.1847/python-mode-autoloads.el new file mode 100644 index 0000000..0260202 --- /dev/null +++ b/elpa/python-mode-20180721.1847/python-mode-autoloads.el @@ -0,0 +1,241 @@ +;;; python-mode-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "python-mode" "python-mode.el" (23391 65279 +;;;;;; 0 0)) +;;; Generated autoloads from python-mode.el + +(autoload 'py-backward-class "python-mode" "\ +Go to beginning of ‘class’ according to INDENT. + +If already at beginning, go one ‘class’ backward. +Optional DECORATOR BOL + +Return beginning of ‘class’ if successful, nil otherwise + +\(fn &optional INDENT DECORATOR BOL)" t nil) + +(autoload 'py-backward-def "python-mode" "\ +Go to beginning of ‘def’ according to INDENT. + +If already at beginning, go one ‘def’ backward. +Optional DECORATOR BOL + +Return beginning of ‘def’ if successful, nil otherwise + +\(fn &optional INDENT DECORATOR BOL)" t nil) + +(autoload 'py-backward-def-or-class "python-mode" "\ +Go to beginning of ‘def-or-class’ according to INDENT. + +If already at beginning, go one ‘def-or-class’ backward. +Optional DECORATOR BOL + +Return beginning of ‘def-or-class’ if successful, nil otherwise + +\(fn &optional INDENT DECORATOR BOL)" t nil) + +(autoload 'py-backward-class-bol "python-mode" "\ +Go to beginning of ‘class’ according to INDENT, go to BOL. +Optional DECORATOR BOL + +If already at beginning, go one ‘class’ backward. +Return beginning of ‘class’ if successful, nil otherwise + +\(fn &optional INDENT DECORATOR)" t nil) + +(autoload 'py-backward-def-bol "python-mode" "\ +Go to beginning of ‘def’ according to INDENT, go to BOL. +Optional DECORATOR BOL + +If already at beginning, go one ‘def’ backward. +Return beginning of ‘def’ if successful, nil otherwise + +\(fn &optional INDENT DECORATOR)" t nil) + +(autoload 'py-backward-def-or-class-bol "python-mode" "\ +Go to beginning of ‘def-or-class’ according to INDENT, go to BOL. +Optional DECORATOR BOL + +If already at beginning, go one ‘def-or-class’ backward. +Return beginning of ‘def-or-class’ if successful, nil otherwise + +\(fn &optional INDENT DECORATOR)" t nil) + +(autoload 'py-forward-class "python-mode" "\ +Go to end of class. + +Return end of class if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match. + +\(fn &optional ARG DECORATOR BOL)" t nil) + +(autoload 'py-forward-def-or-class "python-mode" "\ +Go to end of def-or-class. + +Return end of def-or-class if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match. + +\(fn &optional ARG DECORATOR BOL)" t nil) + +(autoload 'py-forward-def "python-mode" "\ +Go to end of def. + +Return end of def if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match. + +\(fn &optional ARG DECORATOR BOL)" t nil) + +(autoload 'py-shell "python-mode" "\ +Start a Python interpreter. + +Interactively, \\[universal-argument] prompts for a new ‘buffer-name’. + \\[universal-argument] 2 prompts for ‘py-python-command-args’. + If ‘default-directory’ is a remote file name, it is also prompted + to change if called with a prefix arg. + Optional ARGPROMPT DEDICATED + Optional string SHELL overrides default ‘py-shell-name’. + Returns py-shell's ‘buffer-name’. + BUFFER allows specifying a name, the Python process is connected to + FAST process not in ‘comint-mode’ buffer + EXCEPTION-BUFFER point to error + Optional SPLIT see var ‘py-split-window-on-execute’ + Optional SWITCH see var ‘py-switch-buffers-on-execute-p’ + Optional INPUT-PROMPT permit command to set prompt + Optional INTERNAL shell will be invisible for users + + \\[describe-mode] in the process buffer provides more info. + +\(fn &optional ARGPROMPT DEDICATED SHELL BUFFER FAST EXCEPTION-BUFFER SPLIT SWITCH INTERNAL)" t nil) + +(autoload 'ipython "python-mode" "\ +Start an IPython interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter. + +\(fn &optional ARGPROMPT BUFFER FAST EXCEPTION-BUFFER SPLIT SWITCH)" t nil) + +(autoload 'ipython2\.7 "python-mode" "\ +Start an IPython2.7 interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter. + +\(fn &optional ARGPROMPT BUFFER FAST EXCEPTION-BUFFER SPLIT SWITCH)" t nil) + +(autoload 'ipython3 "python-mode" "\ +Start an IPython3 interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter. + +\(fn &optional ARGPROMPT BUFFER FAST EXCEPTION-BUFFER SPLIT SWITCH)" t nil) + +(autoload 'jython "python-mode" "\ +Start an Jython interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter. + +\(fn &optional ARGPROMPT BUFFER FAST EXCEPTION-BUFFER SPLIT SWITCH)" t nil) + +(autoload 'python "python-mode" "\ +Start an Python interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter. + +\(fn &optional ARGPROMPT BUFFER FAST EXCEPTION-BUFFER SPLIT SWITCH)" t nil) + +(autoload 'python2 "python-mode" "\ +Start an Python2 interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter. + +\(fn &optional ARGPROMPT BUFFER FAST EXCEPTION-BUFFER SPLIT SWITCH)" t nil) + +(autoload 'python3 "python-mode" "\ +Start an Python3 interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter. + +\(fn &optional ARGPROMPT BUFFER FAST EXCEPTION-BUFFER SPLIT SWITCH)" t nil) + +(autoload 'py-auto-completion-mode "python-mode" "\ +Run auto-completion + +\(fn)" t nil) + +(autoload 'python-mode "python-mode" "\ +Major mode for editing Python files. + +To submit a problem report, enter `\\[py-submit-bug-report]' from a +`python-mode' buffer. Do `\\[py-describe-mode]' for detailed +documentation. To see what version of `python-mode' you are running, +enter `\\[py-version]'. + +This mode knows about Python indentation, tokens, comments and +continuation lines. Paragraphs are separated by blank lines only. + +COMMANDS + +`py-shell' Start an interactive Python interpreter in another window +`py-execute-statement' Send statement at point to Python default interpreter +`py-backward-statement' Go to the initial line of a simple statement + +etc. + +See available commands listed in files commands-python-mode at directory doc + +VARIABLES + +`py-indent-offset' indentation increment +`py-shell-name' shell command to invoke Python interpreter +`py-split-window-on-execute' When non-nil split windows +`py-switch-buffers-on-execute-p' When non-nil switch to the Python output buffer + +See available customizations listed in files variables-python-mode at directory doc + +\\{python-mode-map} + +\(fn)" t nil) + +(autoload 'py-python-shell-mode "python-mode" "\ +Major mode for interacting with a Python process. +A Python process can be started with \\[py-shell]. + +You can send text to the Python process from other buffers +containing Python source. + * \\[py-execute-region] sends the current region to the Python process. + +Sets basic comint variables, see also versions-related stuff in `py-shell'. +\\{py-python-shell-mode-map} + +\(fn)" t nil) + +(autoload 'py-ipython-shell-mode "python-mode" "\ +Major mode for interacting with a (I)Python process. +A Python process can be started with \\[py-shell]. + +You can send text to the (I)Python process from other buffers +containing Python source. + * \\[py-execute-region] sends the current region to the Python process. + +Sets basic comint variables, see also versions-related stuff in `py-shell'. +\\{py-ipython-shell-mode-map} + +\(fn)" t nil) + +;;;*** + +;;;### (autoloads nil nil ("python-mode-pkg.el") (23391 65279 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; python-mode-autoloads.el ends here diff --git a/elpa/python-mode-20180721.1847/python-mode-pkg.el b/elpa/python-mode-20180721.1847/python-mode-pkg.el new file mode 100644 index 0000000..28214ff --- /dev/null +++ b/elpa/python-mode-20180721.1847/python-mode-pkg.el @@ -0,0 +1,4 @@ +(define-package "python-mode" "20180721.1847" "Python major mode" 'nil) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/python-mode-20180721.1847/python-mode.el b/elpa/python-mode-20180721.1847/python-mode.el new file mode 100644 index 0000000..84fe9c8 --- /dev/null +++ b/elpa/python-mode-20180721.1847/python-mode.el @@ -0,0 +1,27137 @@ +;;; python-mode.el --- Edit, debug, develop, run Python programs. -*- lexical-binding: t; -*- + +;; Includes a minor mode for handling a Python/IPython shell, +;; and can take advantage of Pymacs when installed. + +;; This file not shipped as part of GNU Emacs. + +;; Keywords: languages, processes, python, oop + +;; Version: "6.2.3" + +;; URL: https://gitlab.com/groups/python-mode-devs + +;; Package-Requires: (emacs "24") +;; Copyright (C) 1992,1993,1994 Tim Peters + +;; Author: 2015-2018 https://gitlab.com/groups/python-mode-devs +;; 2003-2014 https://launchpad.net/python-mode +;; 1995-2002 Barry A. Warsaw +;; 1992-1994 Tim Peters +;; Maintainer: python-mode@python.org +;; Created: Feb 1992 +;; Keywords: python languages oop + +;; 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 . + +;;; Commentary: + +;; See documentation in README.org, README.DEVEL.org + +;; Please report bugs at +;; https://gitlab.com/python-mode-devs/python-mode/issues + +;; available commands are documented in directory "doc" as +;; commands-python-mode.org + +;; As for `py-add-abbrev': +;; Similar to `add-mode-abbrev', but uses +;; `py-partial-expression' before point for expansion to +;; store, not `word'. Also provides a proposal for new +;; abbrevs. + +;; Proposal for an abbrev is composed from the downcased +;; initials of expansion - provided they are of char-class +;; [:alpha:] +;; +;; For example code below would be recognised as a +;; `py-expression' composed by three +;; py-partial-expressions. +;; +;; OrderedDict.popitem(last=True) +;; +;; Putting the curser at the EOL, M-3 M-x py-add-abbrev +;; +;; would prompt "op" for an abbrev to store, as first +;; `py-partial-expression' beginns with a "(", which is +;; not taken as proposal. + +;;; Code: + + + +(defgroup python-mode nil + "Support for the Python programming language, " + :group 'languages + :prefix "py-") + +(defconst py-version "6.2.3") + +(defvar py-install-directory "") +(defcustom py-install-directory "" + "Directory where python-mode.el and it's subdirectories should be installed. + +Needed for completion and other environment stuff only." + + :type 'string + :tag "py-install-directory" + :group 'python-mode) + +(defcustom py-pythonpath "" + "Define $PYTHONPATH here, if needed. + +Emacs doesn't read .bashrc" + + :type 'string + :tag "py-pythonpath" + :group 'python-mode) + +(when (string= "" py-install-directory) + (setq py-install-directory default-directory)) + +(defcustom python-mode-modeline-display "Py" + "String to display in Emacs modeline." + + :type 'string + :tag "python-mode-modeline-display" + :group 'python-mode) + +(defcustom py-extensions "py-extensions.el" + "File where extensions to python-mode.el should be installed. + +Used by virtualenv support." + + :type 'string + :tag "py-extensions" + :group 'python-mode) + +(defcustom info-lookup-mode "python" + "Which Python documentation should be queried. + +Make sure it's accessible from Emacs by \\ \\[info] ... +See INSTALL-INFO-FILES for help." + + :type 'string + :tag "info-lookup-mode" + :group 'python-mode) + +(defcustom py-fast-process-p nil + "Use `py-fast-process'. + +Commands prefixed \"py-fast-...\" suitable for large output + +See: large output makes Emacs freeze, lp:1253907 + +Results arrive in output buffer, which is not in comint-mode" + + :type 'boolean + :tag "py-fast-process-p" + :group 'python-mode) + +;; credits to python.el +(defcustom py-shell-compilation-regexp-alist + `((,(rx line-start (1+ (any " \t")) "File \"" + (group (1+ (not (any "\"<")))) ; avoid `' &c + "\", line " (group (1+ digit))) + 1 2) + (,(rx " in file " (group (1+ not-newline)) " on line " + (group (1+ digit))) + 1 2) + (,(rx line-start "> " (group (1+ (not (any "(\"<")))) + "(" (group (1+ digit)) ")" (1+ (not (any "("))) "()") + 1 2)) + "`compilation-error-regexp-alist' for py-shell." + :type '(alist string) + :group 'python-mode) + +(defcustom py-shift-require-transient-mark-mode-p t + "If py-shift commands on regions should require variable ‘transient-mark-mode’. + +Default is t" + +:type 'boolean +:group 'python-mode) + +(defvar py-fast-output-buffer "*Py-Fast-Output-Buffer*" + "Default ‘buffer-name’ for fast-processes.") + +(defvar py-this-result nil + "Internally used, store return-value.") + +(defcustom py-comment-auto-fill-p nil + "When non-nil, fill comments. + +Defaut is nil" + + :type 'boolean + :group 'python-mode) + +(defcustom py-sexp-use-expression-p nil + "If non-nil, ‘forward-sexp’ will call ‘py-forward-expression’. + +Respective ‘backward-sexp’ will call ‘py-backward-expression’ +Default is t" + :type 'boolean + :group 'python-mode) + +(defcustom py-session-p t + "If commands would use an existing process. + +See also `py-dedicated-process-p'" + + :type 'boolean + :tag "py-session-p" + :group 'python-mode) + +(defcustom py-max-help-buffer-p nil + "If \"\*Python-Help\*\"-buffer should appear as the only visible. + +Default is nil. In ‘help-buffer’, \"q\" will close it." + + :type 'boolean + :tag "py-max-help-buffer-p" + :group 'python-mode) + +(defcustom py-highlight-error-source-p nil + "Respective code in source-buffer will be highlighted. + +Default is nil. + +\\ `py-remove-overlays-at-point' removes that highlighting." + :type 'boolean + :tag "py-highlight-error-source-p" + :group 'python-mode) + +(defcustom py-set-pager-cat-p nil + "If the shell environment variable $PAGER should set to `cat'. + +Avoids lp:783828, + \"Terminal not fully functional\", for help('COMMAND') in python-shell + +When non-nil, imports module `os'" + + :type 'boolean + :tag "py-set-pager-cat-p" + :group 'python-mode) + +(defcustom py-empty-line-closes-p nil + "When non-nil, dedent after empty line following block. + +if True: + print(\"Part of the if-statement\") + +print(\"Not part of the if-statement\") + +Default is nil" + + :type 'boolean + :tag "py-empty-line-closes-p" + :group 'python-mode) + +(defcustom py-prompt-on-changed-p t + "Ask for save before a changed buffer is sent to interpreter. + +Default is t" + + :type 'boolean + :tag "py-prompt-on-changed-p" + :group 'python-mode) + +(defcustom py-dedicated-process-p nil + "If commands executing code use a dedicated shell. + +Default is nil + +When non-nil and `py-session-p', an existing dedicated process is re-used instead of default - which allows executing stuff in parallel." + :type 'boolean + :tag "py-dedicated-process-p" + :group 'python-mode) + +(defcustom py-store-result-p nil + "Put resulting string of `py-execute-...' into ‘kill-ring’. + +Default is nil" + + :type 'boolean + :tag "py-dedicated-process-p" + :group 'python-mode) + +(defvar py-shell--font-lock-buffer " *PSFLB*" + "May contain the `py-buffer-name' currently fontified." ) + +(defvar py-return-result-p nil + "Internally used. + +When non-nil, return resulting string of `py-execute-...'. +Imports will use it with nil. +Default is nil") + +(defcustom py--execute-use-temp-file-p nil + "Assume execution at a remote machine. + + where write-access is not given." + + :type 'boolean + :group 'python-mode) + +(defvar py--match-paren-forward-p nil + "Internally used by `py-match-paren'.") + +(defvar py-new-session-p t + "Internally used. See lp:1393882. + +Restart ‘py-shell’ once with new Emacs/‘python-mode’.") + +(defcustom py-electric-close-active-p nil + "Close completion buffer if no longer needed. + +Works around a bug in `choose-completion'. +Default is nil" + :type 'boolean + :group 'python-mode) + +(defcustom py-update-gud-pdb-history-p t + "If pdb should provide suggestions WRT file to check and ‘py-pdb-path’. + +Default is t +See lp:963253" + :type 'boolean + :tag "py-update-gud-pdb-history-p" + :group 'python-mode + :tag "py-update-gud-pdb-history-p") + +(defcustom py-pdb-executable nil + "Indicate PATH/TO/pdb. + +Default is nil +See lp:963253" + :type 'string + :tag "py-pdb-executable" + :group 'python-mode + :tag "py-pdb-executable") + +(defcustom py-hide-show-minor-mode-p nil + "If hide-show minor-mode should be on, default is nil." + + :type 'boolean + :tag "py-hide-show-minor-mode-p" + :group 'python-mode) + +(defcustom py-load-skeletons-p nil + "If skeleton definitions should be loaded, default is nil. + +If non-nil and variable ‘abbrev-mode’ on, block-skeletons will inserted. +Pressing \"if\" for example will prompt for the if-condition." + + :type 'boolean + :tag "py-load-skeletons-p" + :group 'python-mode) + +(defcustom py-if-name-main-permission-p t + "Allow execution of code inside blocks started. + +by \"if __name__== '__main__':\". +Default is non-nil" + + :type 'boolean + :tag "py-if-name-main-permission-p" + :group 'python-mode) + +(defcustom py-use-font-lock-doc-face-p nil + "If documention string inside of def or class get `font-lock-doc-face'. + +`font-lock-doc-face' inherits `font-lock-string-face'. +Call \\ \\[customize-face] in order to have a visible effect." + + :type 'boolean + :tag "py-use-font-lock-doc-face-p" + :group 'python-mode) + +(defcustom py-empty-comment-line-separates-paragraph-p t + "Consider paragraph start/end lines with nothing inside but comment sign. + +Default is non-nil" + :type 'boolean + :tag "py-empty-comment-line-separates-paragraph-p" + :group 'python-mode) + +(defcustom py-indent-honors-inline-comment nil + "If non-nil, indents to column of inlined comment start. +Default is nil." + :type 'boolean + :tag "py-indent-honors-inline-comment" + :group 'python-mode) + +(defcustom py-auto-fill-mode nil + "If ‘python-mode’ should set ‘fill-column’. + +according to values +in `py-comment-fill-column' and `py-docstring-fill-column'. +Default is nil" + + :type 'boolean + :tag "py-auto-fill-mode" + :group 'python-mode) + +(defcustom py-error-markup-delay 4 + "Seconds error's are highlighted in exception buffer." + + :type 'integer + :tag "py-error-markup-delay" + :group 'python-mode) + +(defcustom py-fast-completion-delay 0.1 + "Used by ‘py-fast-send-string’." + + :type 'float + :tag "py-fast-completion-delay" + :group 'python-mode) + +(defcustom py-new-shell-delay + (if (eq system-type 'windows-nt) + 2.0 + 1.0) + + "If a new comint buffer is connected to Python, commands like completion might need some delay." + + :type 'float + :tag "py-new-shell-delay" + :group 'python-mode) + +(defcustom py-autofill-timer-delay 1 + "Delay when idle before functions ajusting `py-docstring-fill-column', `py-comment-fill-column' are called." + :type 'integer + :tag "py-autofill-timer-delay" + :group 'python-mode) + +(defcustom py-docstring-fill-column 72 + "Value of `fill-column' to use when filling a docstring. +Any non-integer value means do not use a different value of +`fill-column' when filling docstrings." + :type '(choice (integer) + (const :tag "Use the current `fill-column'" t)) + :tag "py-docstring-fill-column" + :group 'python-mode) + +(defcustom py-comment-fill-column 79 + "Value of `fill-column' to use when filling a comment. +Any non-integer value means do not use a different value of +`fill-column' when filling docstrings." + :type '(choice (integer) + (const :tag "Use the current `fill-column'" t)) + :tag "py-comment-fill-column" + :group 'python-mode) + +(defcustom py-fontify-shell-buffer-p nil + "If code in Python shell should be highlighted as in script buffer. + +Default is nil. + +If t, related vars like `comment-start' will be set too. +Seems convenient when playing with stuff in IPython shell +Might not be TRT when a lot of output arrives" + + :type 'boolean + :tag "py-fontify-shell-buffer-p" + :group 'python-mode) + +(defcustom py-modeline-display-full-path-p nil + "If the full PATH/TO/PYTHON should be displayed in shell modeline. + +Default is nil. Note: when `py-shell-name' is specified with path, it's shown as an acronym in ‘buffer-name’ already." + + :type 'boolean + :tag "py-modeline-display-full-path-p" + :group 'python-mode) + +(defcustom py-modeline-acronym-display-home-p nil + "If the modeline acronym should contain chars indicating the home-directory. + +Default is nil" + :type 'boolean + :tag "py-modeline-acronym-display-home-p" + :group 'python-mode) + +(defun py-autopair-check () + "Check, if ‘autopair-mode’ is available. + +Give some hints, if not." + (interactive) + (if (featurep 'autopair) + 't + (progn + (message "py-autopair-check: %s" "Don't see autopair.el. Make sure, it's installed. If not, maybe see source: URL: http://autopair.googlecode.com") + nil))) + +(defvar highlight-indent-active nil) +(defvar autopair-mode nil) + +(defvar-local py-edit-docstring-orig-pos nil + "Internally used by `py-edit-docstring'.") + +(defvar-local py--docbeg nil + "Internally used by `py-edit-docstring'") + +(defvar-local py--docend nil + "Internally used by `py-edit-docstring'") + +(defvar py--oldbuf nil + "Internally used by `py-edit-docstring'.") + +(defvar py-edit-docstring-buffer "Edit docstring" + "Name of the temporary buffer to use when editing.") + +(defvar py--edit-docstring-register nil) + +(defvar py-result nil + "Internally used. May store result from Python process.") + +(defvar py-error nil + "Internally used. Takes the error-messages from Python process.") + +(defvar py-python-completions "*Python Completions*" + "Buffer name for Python-shell completions, internally used.") + +(defvar py-ipython-completions "*IPython Completions*" + "Buffer name for IPython-shell completions, internally used.") + +(defcustom py-timer-close-completions-p t + "If `py-timer-close-completion-buffer' should run, default is non-nil." + + :type 'boolean + :tag "py-timer-close-completions-p" + :group 'python-mode) + +(defcustom py-autopair-mode nil + "If ‘python-mode’ calls (autopair-mode-on) + +Default is nil +Load `autopair-mode' written by Joao Tavora +URL: http://autopair.googlecode.com" + :type 'boolean + :tag "py-autopair-mode" + :group 'python-mode) + +(defcustom py-indent-no-completion-p nil + "If completion function should insert a TAB when no completion found. + +Default is nil" + :type 'boolean + :tag "py-indent-no-completion-p" + :group 'python-mode) + +(defcustom py-company-pycomplete-p nil + "Load company-pycomplete stuff. Default is nil." + + :type 'boolean + :tag "py-company-pycomplete-p" + :group 'python-mode) + +(defvar py-last-position nil + "Used by ‘py-help-at-point’. + +Avoid repeated call at identic pos.") + +(defvar py-auto-completion-mode-p nil + "Internally used by `py-auto-completion-mode'.") + +(defvar py-complete-last-modified nil + "Internally used by `py-auto-completion-mode'.") + +(defvar py--auto-complete-timer nil + "Internally used by `py-auto-completion-mode'.") + +(defvar py-auto-completion-buffer nil + "Internally used by `py-auto-completion-mode'.") + +(defvar py--auto-complete-timer-delay 1 + "Seconds Emacs must be idle to trigger auto-completion. + +See `py-auto-completion-mode'") + +(defcustom py-auto-complete-p nil + "Run python-mode's built-in auto-completion via ‘py-complete-function’. Default is nil." + + :type 'boolean + :tag "py-auto-complete-p" + :group 'python-mode) +(make-variable-buffer-local 'py-auto-complete-p) + +(defcustom py-tab-shifts-region-p nil + "If t, TAB will indent/cycle the region, not just the current line. + +Default is nil +See also `py-tab-indents-region-p'" + + :type 'boolean + :tag "py-tab-shifts-region-p" + :group 'python-mode) + +(defcustom py-tab-indents-region-p nil + "When t and first TAB doesn't shift, ‘indent-region’ is called. + +Default is nil +See also `py-tab-shifts-region-p'" + + :type 'boolean + :tag "py-tab-indents-region-p" + :group 'python-mode) + +(defcustom py-block-comment-prefix-p t + "If py-comment inserts ‘py-block-comment-prefix’. + +Default is t" + + :type 'boolean + :tag "py-block-comment-prefix-p" + :group 'python-mode) + +(defcustom py-org-cycle-p nil + "When non-nil, command `org-cycle' is available at shift-TAB, . + +Default is nil." + + :type 'boolean + :tag "py-org-cycle-p" + :group 'python-mode) + +(defcustom py-set-complete-keymap-p nil + "If `py-complete-initialize'. + +Sets up enviroment for Pymacs based py-complete. + Should load it's keys into `python-mode-map' +Default is nil. +See also resp. edit `py-complete-set-keymap'" + + :type 'boolean + :tag "py-set-complete-keymap-p" + :group 'python-mode) + +(defcustom py-outline-minor-mode-p t + "If outline minor-mode should be on, default is t." + + :type 'boolean + :tag "py-outline-minor-mode-p" + :group 'python-mode) + +(defcustom py-guess-py-install-directory-p t + "If in cases, `py-install-directory' isn't set, `py-set-load-path'should guess it from variable `buffer-file-name'." + + :type 'boolean + :tag "py-guess-py-install-directory-p" + :group 'python-mode) + +(defcustom py-load-pymacs-p nil + "If Pymacs related stuff should be loaded. + +Default is nil. + +Pymacs has been written by François Pinard and many others. +See original source: http://pymacs.progiciels-bpi.ca" + + :type 'boolean + :tag "py-load-pymacs-p" + :group 'python-mode) + +(defcustom py-verbose-p nil + "If functions should report results. + +Default is nil." + + :type 'boolean + :tag "py-verbose-p" + :group 'python-mode) + +(defcustom py-sexp-function nil + "Called instead of `forward-sexp', `backward-sexp'. + +Default is nil." + + :type '(choice + + (const :tag "default" nil) + (const :tag "py-end-of-partial-expression" py-end-of-partial-expression) + (const :tag "py-end-of-expression" py-end-of-expression)) + :tag "py-sexp-function" + :group 'python-mode) + +(defcustom py-close-provides-newline t + "If a newline is inserted, when line after block isn't empty. + +Default is non-nil. +When non-nil, `py-end-of-def' and related will work faster" + :type 'boolean + :tag "py-close-provides-newline" + :group 'python-mode) + +(defcustom py-dedent-keep-relative-column t + "If point should follow dedent or kind of electric move to end of line. Default is t - keep relative position." + :type 'boolean + :tag "py-dedent-keep-relative-column" + :group 'python-mode) + +(defcustom py-indent-honors-multiline-listing nil + "If t, indents to 1+ column of opening delimiter. If nil, indent adds one level to the beginning of statement. Default is nil." + :type 'boolean + :tag "py-indent-honors-multiline-listing" + :group 'python-mode) + +(defcustom py-indent-paren-spanned-multilines-p t + "If non-nil, indents elements of list to first element. + +def foo(): + if (foo && + baz): + bar() + +If nil line up with first element: + +def foo(): + if (foo && + baz): + bar() + +Default is t" + :type 'boolean + :tag "py-indent-paren-spanned-multilines-p" + :group 'python-mode) + +(defcustom py-closing-list-dedents-bos nil + "When non-nil, indent list's closing delimiter like start-column. + +It will be lined up under the first character of + the line that starts the multi-line construct, as in: + +my_list = [ + 1, 2, 3, + 4, 5, 6 +] + +result = some_function_that_takes_arguments( + 'a', 'b', 'c', + 'd', 'e', 'f' +) + +Default is nil, i.e. + +my_list = [ + 1, 2, 3, + 4, 5, 6 + ] +result = some_function_that_takes_arguments( + 'a', 'b', 'c', + 'd', 'e', 'f' + ) + +Examples from PEP8 +URL: https://www.python.org/dev/peps/pep-0008/#indentation" + + :type 'boolean + :tag "py-closing-list-dedents-bos" + :group 'python-mode) + +(defvar py-imenu-max-items 99) +(defcustom py-imenu-max-items 99 + "Python-mode specific `imenu-max-items'." + +:type 'number +:group 'python-mode) + +(defcustom py-closing-list-space 1 + "Number of chars, closing parenthesis outdent from opening, default is 1." + :type 'number + :tag "py-closing-list-space" + :group 'python-mode) + +(defcustom py-max-specpdl-size 99 + "Heuristic exit. +e +Limiting number of recursive calls by ‘py-forward-statement’ and related. +Default is ‘max-specpdl-size’. + +This threshold is just an approximation. It might set far higher maybe. + +See lp:1235375. In case code is not to navigate due to errors, variable `which-function-mode' and others might make Emacs hang. Rather exit than." + + :type 'number + :tag "py-max-specpdl-size" + :group 'python-mode) + +(defcustom py-closing-list-keeps-space nil + "If non-nil, closing parenthesis dedents onto column of opening plus `py-closing-list-space', default is nil." + :type 'boolean + :tag "py-closing-list-keeps-space" + :group 'python-mode) + +(defcustom py-electric-kill-backward-p nil + "Affects `py-electric-backspace'. Default is nil. + +If behind a delimited form of braces, brackets or parentheses, +backspace will kill it's contents + +With when cursor after +my_string[0:1] +--------------^ + +==> + +my_string[] +----------^ + +In result cursor is insided emptied delimited form." + + :type 'boolean + :tag "py-electric-kill-backward-p" + :group 'python-mode) + +(defcustom py-electric-colon-active-p nil + "`py-electric-colon' feature. + +Default is nil. See lp:837065 for discussions. +See also `py-electric-colon-bobl-only'" + :type 'boolean + :tag "py-electric-colon-active-p" + :group 'python-mode) + +(defcustom py-electric-colon-bobl-only t + + "When inserting a colon, do not indent lines unless at beginning of block. + +See lp:1207405 resp. `py-electric-colon-active-p'" + + :type 'boolean + :tag "py-electric-colon-bobl-only" + :group 'python-mode) + +(defcustom py-electric-yank-active-p nil + "When non-nil, `yank' will be followed by an `indent-according-to-mode'. + +Default is nil" + :type 'boolean + :tag "py-electric-yank-active-p" + :group 'python-mode) + +(defcustom py-electric-colon-greedy-p nil + "If ‘py-electric-colon’ should indent to the outmost reasonable level. + +If nil, default, it will not move from at any reasonable level." + :type 'boolean + :tag "py-electric-colon-greedy-p" + :group 'python-mode) + +(defcustom py-electric-colon-newline-and-indent-p nil + "If non-nil, `py-electric-colon' will call `newline-and-indent'. Default is nil." + :type 'boolean + :tag "py-electric-colon-newline-and-indent-p" + :group 'python-mode) + +(defcustom py-electric-comment-p nil + "If \"#\" should call `py-electric-comment'. Default is nil." + :type 'boolean + :tag "py-electric-comment-p" + :group 'python-mode) + +(defcustom py-electric-comment-add-space-p nil + "If ‘py-electric-comment’ should add a space. Default is nil." + :type 'boolean + :tag "py-electric-comment-add-space-p" + :group 'python-mode) + +(defcustom py-mark-decorators nil + "If ‘py-mark-def-or-class’ functions should mark decorators too. Default is nil." + :type 'boolean + :tag "py-mark-decorators" + :group 'python-mode) + +(defcustom py-defun-use-top-level-p nil + "If ‘beginning-of-defun’, ‘end-of-defun’ calls function ‘top-level’ form. + +Default is nil. + +beginning-of defun, ‘end-of-defun’ forms use +commands `py-beginning-of-top-level', `py-end-of-top-level' + +‘mark-defun’ marks function ‘top-level’ form at point etc." + + :type 'boolean + :tag "py-defun-use-top-level-p" + :group 'python-mode) + +(defcustom py-tab-indent t + "Non-nil means TAB in Python mode calls `py-indent-line'." + :type 'boolean + :tag "py-tab-indent" + :group 'python-mode) + +(defcustom py-return-key 'newline + "Which command should call." + :type '(choice + + (const :tag "default" py-newline-and-indent) + (const :tag "newline" newline) + (const :tag "py-newline-and-indent" py-newline-and-indent) + (const :tag "py-newline-and-dedent" py-newline-and-dedent) + ) + :tag "py-return-key" + :group 'python-mode) + +(defcustom py-complete-function 'py-fast-complete + "When set, enforces function todo completion, default is `py-fast-complete'. + +Might not affect IPython, as `py-shell-complete' is the only known working here. +Normally ‘python-mode’ knows best which function to use." + :type '(choice + + (const :tag "default" nil) + (const :tag "Pymacs and company based py-complete" py-complete) + (const :tag "py-shell-complete" py-shell-complete) + (const :tag "py-indent-or-complete" py-indent-or-complete) + (const :tag "py-fast-complete" py-fast-complete) + ) + :tag "py-complete-function" + :group 'python-mode) + +(defcustom py-encoding-string " # -*- coding: utf-8 -*-" + "Default string specifying encoding of a Python file." + :type 'string + :tag "py-encoding-string" + :group 'python-mode) + +(defcustom py-shebang-startstring "#! /bin/env" + "Detecting the shell in head of file." + :type 'string + :tag "py-shebang-startstring" + :group 'python-mode) + +(defcustom py-flake8-command "" + "Which command to call flake8. + +If empty, ‘python-mode’ will guess some" + :type 'string + :tag "py-flake8-command" + :group 'python-mode) + +(defcustom py-flake8-command-args "" + "Arguments used by flake8. + +Default is the empty string." + :type 'string + :tag "py-flake8-command-args" + :group 'python-mode) + +(defvar py-flake8-history nil + "Used by flake8, resp. ‘py-flake8-command’. + +Default is nil.") + +(defcustom py-message-executing-temporary-file t + "If execute functions using a temporary file should message it. + +Default is t. +Messaging increments the prompt counter of IPython shell." + :type 'boolean + :tag "py-message-executing-temporary-file" + :group 'python-mode) + +(defcustom py-execute-no-temp-p nil + "Seems Emacs-24.3 provided a way executing stuff without temporary files." + :type 'boolean + :tag "py-execute-no-temp-p" + :group 'python-mode) + +(defcustom py-lhs-inbound-indent 1 + "When line starts a multiline-assignment: How many colums indent should be more than opening bracket, brace or parenthesis." + :type 'integer + :tag "py-lhs-inbound-indent" + :group 'python-mode) + +(defcustom py-continuation-offset 2 + "Additional amount of offset to give for some continuation lines. +Continuation lines are those that immediately follow a backslash +terminated line." + :type 'integer + :tag "py-continuation-offset" + :group 'python-mode) + +(defcustom py-indent-tabs-mode nil + "Python-mode starts `indent-tabs-mode' with the value specified here, default is nil." + :type 'boolean + :tag "py-indent-tabs-mode" + :group 'python-mode) + +(defcustom py-smart-indentation nil + "Guess `py-indent-offset'. Default is nil. + +Setting it to t seems useful only in cases where customizing +`py-indent-offset' is no option - for example because the +indentation step is unknown or differs inside the code. + +When this variable is non-nil, `py-indent-offset' is guessed from existing code in the buffer, which might slow down the proceeding." + + :type 'boolean + :tag "py-smart-indentation" + :group 'python-mode) + +(defcustom py-block-comment-prefix "##" + "String used by \\[comment-region] to comment out a block of code. +This should follow the convention for non-indenting comment lines so +that the indentation commands won't get confused (i.e., the string +should be of the form `#x...' where `x' is not a blank or a tab, and + `...' is arbitrary). However, this string should not end in whitespace." + :type 'string + :tag "py-block-comment-prefix" + :group 'python-mode) + +(defcustom py-indent-offset 4 + "Amount of offset per level of indentation. +`\\[py-guess-indent-offset]' can usually guess a good value when +you're editing someone else's Python code." + :type 'integer + :tag "py-indent-offset" + :group 'python-mode) +(make-variable-buffer-local 'py-indent-offset) + +(defcustom py-backslashed-lines-indent-offset 5 + "Amount of offset per level of indentation of backslashed. +No semantic indent, which diff to `py-indent-offset' indicates" + :type 'integer + :tag "py-backslashed-lines-indent-offset" + :group 'python-mode) + +(defcustom py-pdb-path + (if (or (eq system-type 'ms-dos)(eq system-type 'windows-nt)) + (quote c:/python27/python\ -i\ c:/python27/Lib/pdb.py) + '/usr/lib/python2.7/pdb.py) + "Where to find pdb.py. Edit this according to your system. + +If you ignore the location `M-x py-guess-pdb-path' might display it." + :type 'variable + :tag "py-pdb-path" + :group 'python-mode) + +(defvar py-python-ms-pdb-command "" + "MS-systems might use that.") + +(defcustom py-indent-comments t + "When t, comment lines are indented." + :type 'boolean + :tag "py-indent-comments" + :group 'python-mode) + +(defcustom py-uncomment-indents-p nil + "When non-nil, after uncomment indent lines." + :type 'boolean + :tag "py-uncomment-indents-p" + :group 'python-mode) + +(defcustom py-separator-char 47 + "The character, which separates the system file-path components. + +Precedes guessing when not empty, returned by function `py-separator-char'." + :type 'character + :tag "py-separator-char" + :group 'python-mode) + +(and + ;; used as a string finally + ;; kept a character not to break existing customizations + (characterp py-separator-char)(setq py-separator-char (char-to-string py-separator-char))) + +(defcustom py-custom-temp-directory "" + "If set, will take precedence over guessed values from `py-temp-directory'. Default is the empty string." + :type 'string + :tag "py-custom-temp-directory" + :group 'python-mode) + +(defcustom py-beep-if-tab-change t + "Ring the bell if `tab-width' is changed. +If a comment of the form + + \t# vi:set tabsize=: + +is found before the first code line when the file is entered, and the +current value of (the general Emacs variable) `tab-width' does not +equal , `tab-width' is set to , a message saying so is +displayed in the echo area, and if `py-beep-if-tab-change' is non-nil +the Emacs bell is also rung as a warning." + :type 'boolean + :tag "py-beep-if-tab-change" + :group 'python-mode) + +(defcustom py-jump-on-exception t + "Jump to innermost exception frame in Python output buffer. +When this variable is non-nil and an exception occurs when running +Python code synchronously in a subprocess, jump immediately to the +source code of the innermost traceback frame." + :type 'boolean + :tag "py-jump-on-exception" + :group 'python-mode) + +(defcustom py-ask-about-save t + "If not nil, ask about which buffers to save before executing some code. +Otherwise, all modified buffers are saved without asking." + :type 'boolean + :tag "py-ask-about-save" + :group 'python-mode) + +(defcustom py-delete-function 'delete-char + "Function called by `py-electric-delete' when deleting forwards." + :type 'function + :tag "py-delete-function" + :group 'python-mode) + +(defcustom py-pdbtrack-do-tracking-p t + "Controls whether the pdbtrack feature is enabled or not. +When non-nil, pdbtrack is enabled in all comint-based buffers, +e.g. shell buffers and the *Python* buffer. When using pdb to debug a +Python program, pdbtrack notices the pdb prompt and displays the +source file and line that the program is stopped at, much the same way +as ‘gud-mode’ does for debugging C programs with gdb." + :type 'boolean + :tag "py-pdbtrack-do-tracking-p" + :group 'python-mode) +(make-variable-buffer-local 'py-pdbtrack-do-tracking-p) + +(defcustom py-pdbtrack-filename-mapping nil + "Supports mapping file paths when opening file buffers in pdbtrack. +When non-nil this is an alist mapping paths in the Python interpreter +to paths in Emacs." + :type 'alist + :tag "py-pdbtrack-filename-mapping" + :group 'python-mode) + +(defcustom py-pdbtrack-minor-mode-string " PDB" + "String to use in the minor mode list when pdbtrack is enabled." + :type 'string + :tag "py-pdbtrack-minor-mode-string" + :group 'python-mode) + +(defcustom py-import-check-point-max + 20000 + "Max number of characters to search Java-ish import statement. + +When `python-mode' tries to calculate the shell +-- either a CPython or a Jython shell -- +it looks at the so-called `shebang'. +If that's not available, it looks at some of the +file heading imports to see if they look Java-like." + :type 'integer + :tag "py-import-check-point-max +" + :group 'python-mode) + +(defcustom py-jython-packages + '("java" "javax") + "Imported packages that imply `jython-mode'." + :type '(repeat string) + :tag "py-jython-packages +" + :group 'python-mode) + +(defcustom py-current-defun-show t + "If `py-current-defun' should jump to the definition. + +Highlights it while waiting PY-WHICH-FUNC-DELAY seconds. +Afterwards returning to previous position. + +Default is t." + + :type 'boolean + :tag "py-current-defun-show" + :group 'python-mode) + +(defcustom py-current-defun-delay 2 + "When called interactively, `py-current-defun' should wait PY-WHICH-FUNC-DELAY seconds at the definition name found, before returning to previous position." + + :type 'number + :tag "py-current-defun-delay" + :group 'python-mode) + +(defcustom py--delete-temp-file-delay 1 + "Used by `py--delete-temp-file'." + + :type 'number + :tag "py--delete-temp-file-delay" + :group 'python-mode) + +(defcustom py-python-send-delay 5 + "Seconds to wait for output, used by `py--send-...' functions. + +See also ‘py-ipython-send-delay’" + + :type 'number + :tag "py-python-send-delay" + :group 'python-mode) + +(defcustom py-ipython-send-delay 9 + "Seconds to wait for output, used by `py--send-...' functions. + +See also ‘py-python-send-delay’" + + :type 'number + :tag "py-ipython-send-delay" + :group 'python-mode) + +(defcustom py-master-file nil + "Execute the named master file instead of the buffer's file. + +Default is nil. +With relative path variable `default-directory' is prepended. + +Beside you may set this variable in the file's local +variable section, e.g.: + + # Local Variables: + # py-master-file: \"master.py\" + # End:" + :type 'string + :tag "py-master-file" + :group 'python-mode) +(make-variable-buffer-local 'py-master-file) + +(defcustom py-pychecker-command "pychecker" + "Shell command used to run Pychecker." + :type 'string + :tag "py-pychecker-command" + :group 'python-mode) + +(defcustom py-pychecker-command-args "--stdlib" + "String arguments to be passed to pychecker." + :type 'string + :tag "py-pychecker-command-args" + :group 'python-mode) + +(defcustom py-pyflakes-command "pyflakes" + "Shell command used to run Pyflakes." + :type 'string + :tag "py-pyflakes-command" + :group 'python-mode) + +(defcustom py-pyflakes-command-args "" + "String arguments to be passed to pyflakes. + +Default is \"\"" + :type 'string + :tag "py-pyflakes-command-args" + :group 'python-mode) + +(defcustom py-pep8-command "pep8" + "Shell command used to run pep8." + :type 'string + :tag "py-pep8-command" + :group 'python-mode) + +(defcustom py-pep8-command-args "" + "String arguments to be passed to pylint. + +Default is \"\"" + :type 'string + :tag "py-pep8-command-args" + :group 'python-mode) + +(defcustom py-pyflakespep8-command (concat py-install-directory "/pyflakespep8.py") + "Shell command used to run `pyflakespep8'." + :type 'string + :tag "py-pyflakespep8-command" + :group 'python-mode) + +(defcustom py-pyflakespep8-command-args "" + "String arguments to be passed to pyflakespep8. + +Default is \"\"" + :type 'string + :tag "py-pyflakespep8-command-args" + :group 'python-mode) + +(defcustom py-pylint-command "pylint" + "Shell command used to run Pylint." + :type 'string + :tag "py-pylint-command" + :group 'python-mode) + +(defcustom py-pylint-command-args '("--errors-only") + "String arguments to be passed to pylint. + +Default is \"--errors-only\"" + :type '(repeat string) + :tag "py-pylint-command-args" + :group 'python-mode) + +(defcustom py-shell-input-prompt-1-regexp ">>> " + "A regular expression to match the input prompt of the shell." + :type 'regexp + :tag "py-shell-input-prompt-1-regexp" + :group 'python-mode) + +(defcustom py-shell-input-prompt-2-regexp "[.][.][.] " + "A regular expression to match the input prompt. + +Applies to the shell after the first line of input." + :type 'string + :tag "py-shell-input-prompt-2-regexp" + :group 'python-mode) + +(defcustom py-shell-prompt-read-only t + "If non-nil, the python prompt is read only. + +Setting this variable will only effect new shells." + :type 'boolean + :tag "py-shell-prompt-read-only" + :group 'python-mode) + +(defcustom py-honor-IPYTHONDIR-p nil + "When non-nil ipython-history file is constructed by $IPYTHONDIR. + +Default is nil. +Otherwise value of ‘py-ipython-history’ is used." + :type 'boolean + :tag "py-honor-IPYTHONDIR-p" + :group 'python-mode) + +(defcustom py-ipython-history "~/.ipython/history" + "Ipython-history default file. + +Used when ‘py-honor-IPYTHONDIR-p’ is nil - th default" + + :type 'string + :tag "py-ipython-history" + :group 'python-mode) + +(defcustom py-honor-PYTHONHISTORY-p nil + "When non-nil python-history file is set by $PYTHONHISTORY. + +Default is nil. +Otherwise value of ‘py-python-history’ is used." + :type 'boolean + :tag "py-honor-PYTHONHISTORY-p" + :group 'python-mode) + +(defcustom py-python-history "~/.python_history" + "Python-history default file. Used when ‘py-honor-PYTHONHISTORY-p’ is nil (default)." + + :type 'string + :tag "py-python-history" + :group 'python-mode) + +(defcustom py-switch-buffers-on-execute-p nil + "When non-nil switch to the Python output buffer. + +If `py-keep-windows-configuration' is t, this will take precedence over setting here." + + :type 'boolean + :tag "py-switch-buffers-on-execute-p" + :group 'python-mode) + +(defcustom py-split-window-on-execute 'just-two + "When non-nil split windows. + +Default is just-two - when code is send to interpreter. +Splits screen into source-code buffer and current ‘py-shell’ result. +Other buffer will be hidden that way. + +When set to t, ‘python-mode’ tries to reuse existing windows +and will split only if needed. + +With 'always, results will displayed in a new window. + +Both t and `always' is experimental still. + +For the moment: If a multitude of python-shells/buffers should be +visible, open them manually and set `py-keep-windows-configuration' to t. + +See also `py-keep-windows-configuration'" + :type '(choice + + (const :tag "default" just-two) + (const :tag "reuse" t) + (const :tag "no split" nil) + (const :tag "just-two" just-two) + (const :tag "always" always)) + :tag "py-split-window-on-execute" + :group 'python-mode) + +(defcustom py-split-window-on-execute-threshold 3 + "Maximal number of displayed windows. + +Honored, when `py-split-window-on-execute' is t, i.e. \"reuse\". +Don't split when max number of displayed windows is reached." + :type 'number + :tag "py-split-window-on-execute-threshold" + :group 'python-mode) + +(defcustom py-split-windows-on-execute-function 'split-window-vertically + "How window should get splitted to display results of py-execute-... functions." + :type '(choice (const :tag "split-window-vertically" split-window-vertically) + (const :tag "split-window-horizontally" split-window-horizontally) + ) + :tag "py-split-windows-on-execute-function" + :group 'python-mode) + +(defcustom py-shell-fontify-style nil + "Fontify current input resp. output in Python shell. Default is nil. + +INPUT will leave output unfontified. +ALL keeps output fontified. + +At any case only current input gets fontified." + :type '(choice (const :tag "Default" all) + (const :tag "Input" input) + (const :tag "Nil" nil) + ) + :tag "py-shell-fontify-style" + :group 'python-mode) + +(defcustom py-hide-show-keywords + '("class" "def" "elif" "else" "except" + "for" "if" "while" "finally" "try" + "with") + "Keywords composing visible heads." + :type '(repeat string) + :tag "py-hide-show-keywords +" + :group 'python-mode) + +(defcustom py-hide-show-hide-docstrings t + "Controls if doc strings can be hidden by hide-show." + :type 'boolean + :tag "py-hide-show-hide-docstrings" + :group 'python-mode) + +(defcustom py-hide-comments-when-hiding-all t + "Hide the comments too when you do an `hs-hide-all'." + :type 'boolean + :tag "py-hide-comments-when-hiding-all" + :group 'python-mode) + +(defcustom py-outline-mode-keywords + '("class" "def" "elif" "else" "except" + "for" "if" "while" "finally" "try" + "with") + "Keywords composing visible heads." + :type '(repeat string) + :tag "py-outline-mode-keywords +" + :group 'python-mode) + +(defcustom python-mode-hook nil + "Hook run when entering Python mode." + + :type 'hook + :tag "python-mode-hook" + :group 'python-mode + ) + +(defcustom py-shell-name + (if (eq system-type 'windows-nt) + "C:/Python27/python" + ;; "python" + "python") + + "A PATH/TO/EXECUTABLE or default value `py-shell' may look for. + +If no shell is specified by command. + +On Windows default is C:/Python27/python +--there is no garantee it exists, please check your system-- + +Else python" + :type 'string + :tag "py-shell-name +" + :group 'python-mode) + +(defvar py-default-interpreter py-shell-name) + +(defvar py-tempfile nil + "Internally used.") + +(defvar py-named-shells (list 'ipython 'ipython-dedicated 'ipython-no-switch 'ipython-switch 'ipython-switch-dedicated 'ipython2.7 'ipython2.7-dedicated 'ipython2.7-no-switch 'ipython2.7-switch 'ipython2.7-switch-dedicated 'ipython3 'ipython3-dedicated 'ipython3-no-switch 'ipython3-switch 'ipython3-switch-dedicated 'jython 'jython-dedicated 'jython-no-switch 'jython-switch 'jython-switch-dedicated 'python 'python-dedicated 'python-no-switch 'python-switch 'python-switch-dedicated 'python2 'python2-dedicated 'python2-no-switch 'python2-switch 'python2-switch-dedicated 'python3 'python3-dedicated 'python3-no-switch 'python3-switch 'python3-switch-dedicated)) + +(defcustom py-python-command + (if (eq system-type 'windows-nt) + ;; "C:\\Python27\\python.exe" + "python" + ;; "C:/Python33/Lib/site-packages/IPython" + "python") + + "Make sure directory in in the PATH-variable. + +Windows: edit in \"Advanced System Settings/Environment Variables\" +Commonly \"C:\\\\Python27\\\\python.exe\" +With Anaconda for example the following works here: +\"C:\\\\Users\\\\My-User-Name\\\\Anaconda\\\\Scripts\\\\python.exe\" + +Else /usr/bin/python" + + :type 'string + :tag "py-python-command +" + :group 'python-mode) + +(defcustom py-python-command-args '("-i") + "String arguments to be used when starting a Python shell." + :type 'string + :tag "py-python-command-args" + :group 'python-mode) + +(defcustom py-python2-command + (if (eq system-type 'windows-nt) + "C:\\Python27\\python" + ;; "python2" + "python2") + + "Make sure, the directory where python.exe resides in in the PATH-variable. + +Windows: If needed, edit in +\"Advanced System Settings/Environment Variables\" +Commonly +\"C:\\\\Python27\\\\python.exe\" +With Anaconda for example the following works here: +\"C:\\\\Users\\\\My-User-Name\\\\Anaconda\\\\Scripts\\\\python.exe\" + +Else /usr/bin/python" + + :type 'string + :tag "py-python2-command +" + :group 'python-mode) + +(defcustom py-python2-command-args '("-i") + "String arguments to be used when starting a Python shell." + :type '(repeat string) + :tag "py-python2-command-args" + :group 'python-mode) + +;; "/usr/bin/python3" +(defcustom py-python3-command + (if (eq system-type 'windows-nt) + "C:/Python33/python" + "python3") + + "A PATH/TO/EXECUTABLE or default value `py-shell' may look for. + +Unless shell is specified by command. + +On Windows see C:/Python3/python.exe +--there is no garantee it exists, please check your system-- + +At GNU systems see /usr/bin/python3" + + :type 'string + :tag "py-python3-command +" + :group 'python-mode) + +(defcustom py-python3-command-args '("-i") + "String arguments to be used when starting a Python3 shell." + :type '(repeat string) + :tag "py-python3-command-args" + :group 'python-mode) + +(defcustom py-ipython-command + (if (eq system-type 'windows-nt) + ;; "ipython" + "C:\\Python27\\python" + ;; "C:/Python33/Lib/site-packages/IPython" + ;; "/usr/bin/ipython" + "ipython") + + "A PATH/TO/EXECUTABLE or default value. + +`M-x IPython RET' may look for, +Unless IPython-shell is specified by command. + +On Windows default is \"C:\\\\Python27\\\\python.exe\" +While with Anaconda for example the following works here: +\"C:\\\\Users\\\\My-User-Name\\\\Anaconda\\\\Scripts\\\\ipython.exe\" + +Else /usr/bin/ipython" + + :type 'string + :tag "py-ipython-command +" + :group 'python-mode) + +(defcustom py-ipython-command-args + (if (eq system-type 'windows-nt) + "-i C:\\Python27\\Scripts\\ipython-script.py" + "--pylab --automagic") + "String arguments to be used when starting a Python shell. + +At Windows make sure ipython-script.py is PATH. +Also setting PATH/TO/SCRIPT here should work, for example; +C:\\Python27\\Scripts\\ipython-script.py +With Anaconda the following is known to work: +\"C:\\\\Users\\\\My-User-Name\\\\Anaconda\\\\Scripts\\\\ipython-script-py\"" + :type 'string + :tag "py-ipython-command-args +" + :group 'python-mode) + +(defcustom py-jython-command + (if (eq system-type 'windows-nt) + "jython" + "/usr/bin/jython") + + "A PATH/TO/EXECUTABLE or default value. +`M-x Jython RET' may look for, if no Jython-shell is specified by command. + +Not known to work at windows +Default /usr/bin/jython" + + :type 'string + :tag "py-jython-command +" + :group 'python-mode) + +(defcustom py-jython-command-args "" + "String arguments to be used when starting a Python shell." + :type 'string + :tag "py-jython-command-args" + :group 'python-mode) + +(defcustom py-shell-toggle-1 py-python2-command + "A PATH/TO/EXECUTABLE or default value used by `py-toggle-shell'." + :type 'string + :tag "py-shell-toggle-1" + :group 'python-mode) + +(defcustom py-shell-toggle-2 py-python3-command + "A PATH/TO/EXECUTABLE or default value used by `py-toggle-shell'." + :type 'string + :tag "py-shell-toggle-2" + :group 'python-mode) + +(defcustom py--imenu-create-index-p nil + "Non-nil means Python mode creates and displays an index menu of functions and global variables." + :type 'boolean + :tag "py--imenu-create-index-p" + :group 'python-mode) + +(defvar py-history-filter-regexp "\\`\\s-*\\S-?\\S-?\\s-*\\'\\|'''/tmp/" + "Input matching this regexp is not saved on the history list. +Default ignores all inputs of 0, 1, or 2 non-blank characters.") + +(defcustom py-match-paren-mode nil + "Non-nil means, cursor will jump to beginning or end of a block. +This vice versa, to beginning first. +Sets `py-match-paren-key' in ‘python-mode-map’. +Customize `py-match-paren-key' which key to use." + :type 'boolean + :tag "py-match-paren-mode" + :group 'python-mode) + +(defcustom py-match-paren-key "%" + "String used by \\[comment-region] to comment out a block of code. +This should follow the convention for non-indenting comment lines so +that the indentation commands won't get confused (i.e., the string +should be of the form `#x...' where `x' is not a blank or a tab, and + `...' is arbitrary). However, this string should not end in whitespace." + :type 'string + :tag "py-match-paren-key" + :group 'python-mode) + +(defcustom py-kill-empty-line t + "If t, ‘py-indent-forward-line’ kills empty lines." + :type 'boolean + :tag "py-kill-empty-line" + :group 'python-mode) + +(defcustom py-imenu-show-method-args-p nil + "Controls echoing of arguments of functions & methods in the Imenu buffer. +When non-nil, arguments are printed." + :type 'boolean + :tag "py-imenu-show-method-args-p" + :group 'python-mode) + +(defcustom py-use-local-default nil + "If t, ‘py-shell’ will use `py-shell-local-path'. + +Alternative to default Python. + +Making switch between several virtualenv's easier, + `python-mode' should deliver an installer, so named-shells pointing to virtualenv's will be available." + :type 'boolean + :tag "py-use-local-default" + :group 'python-mode) + +(defcustom py-edit-only-p nil + "Don't check for installed Python executables. + +Default is nil. + +See bug report at launchpad, lp:944093." + :type 'boolean + :tag "py-edit-only-p" + :group 'python-mode) + +(defcustom py-force-py-shell-name-p nil + "When t, execution with kind of Python specified in `py-shell-name' is enforced, possibly shebang doesn't take precedence." + + :type 'boolean + :tag "py-force-py-shell-name-p" + :group 'python-mode) + +(defcustom python-mode-v5-behavior-p nil + "Execute region through `shell-command-on-region'. + +As v5 did it - lp:990079. This might fail with certain chars - see UnicodeEncodeError lp:550661" + + :type 'boolean + :tag "python-mode-v5-behavior-p" + :group 'python-mode) + +(defcustom py-trailing-whitespace-smart-delete-p nil + "Default is nil. + +When t, ‘python-mode’ calls +\(add-hook 'before-save-hook 'delete-trailing-whitespace nil 'local) + +Also commands may delete trailing whitespace by the way. +When editing other peoples code, this may produce a larger diff than expected" + :type 'boolean + :tag "py-trailing-whitespace-smart-delete-p" + :group 'python-mode) + +(defcustom py-newline-delete-trailing-whitespace-p t + "Delete trailing whitespace maybe left by `py-newline-and-indent'. + +Default is t. See lp:1100892" + :type 'boolean + :tag "py-newline-delete-trailing-whitespace-p" + :group 'python-mode) + +(defcustom py--warn-tmp-files-left-p nil + "Messages a warning, when `py-temp-directory' contains files susceptible being left by previous Python-mode sessions. See also lp:987534." + :type 'boolean + :tag "py--warn-tmp-files-left-p" + :group 'python-mode) + +(defcustom py-complete-ac-sources '(ac-source-pycomplete) + "List of ‘auto-complete’ sources assigned to `ac-sources'. + +In `py-complete-initialize'. + +Default is known to work an Ubuntu 14.10 - having python- +mode, pymacs and auto-complete-el, with the following minimal +Emacs initialization: + +\(require 'pymacs) +\(require 'auto-complete-config) +\(ac-config-default)" + :type 'hook + :tag "py-complete-ac-sources" + :options '(ac-source-pycomplete ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers) + :group 'python-mode) + +(defcustom py-remove-cwd-from-path t + "Whether to allow loading of Python modules from the current directory. +If this is non-nil, Emacs removes '' from sys.path when starting +a Python process. This is the default, for security +reasons, as it is easy for the Python process to be started +without the user's realization (e.g. to perform completion)." + :type 'boolean + :tag "py-remove-cwd-from-path" + :group 'python-mode) + +(defcustom py-shell-local-path "" + "If `py-use-local-default' is non-nil, `py-shell' will use EXECUTABLE indicated here incl. path." + + :type 'string + :tag "py-shell-local-path" + :group 'python-mode) + +(defcustom py-python-edit-version "" + "When not empty, fontify according to Python version specified. + +Default is the empty string, a useful value \"python3\" maybe. + +When empty, version is guessed via `py-choose-shell'." + + :type 'string + :tag "py-python-edit-version" + :group 'python-mode) + +(defcustom py-ipython-execute-delay 0.3 + "Delay needed by execute functions when no IPython shell is running." + :type 'float + :tag "py-ipython-execute-delay" + :group 'python-mode) + +(defvar py-shell-completion-setup-code + "try: + import readline +except ImportError: + def __COMPLETER_all_completions(text): [] +else: + import rlcompleter + readline.set_completer(rlcompleter.Completer().complete) + def __COMPLETER_all_completions(text): + import sys + completions = [] + try: + i = 0 + while True: + res = readline.get_completer()(text, i) + if not res: break + i += 1 + completions.append(res) + except NameError: + pass + return completions" + "Code used to setup completion in Python processes.") + +(defvar py-shell-module-completion-code "';'.join(__COMPLETER_all_completions('''%s'''))" + "Python code used to get completions separated by semicolons for imports.") + +(defvar py-ipython-module-completion-code + "import IPython +version = IPython.__version__ +if \'0.10\' < version: + from IPython.core.completerlib import module_completion +" + "For IPython v0.11 or greater. +Use the following as the value of this variable: + +';'.join(module_completion('''%s'''))") + +(defvar py-ipython-module-completion-string + "';'.join(module_completion('''%s'''))" + "See also `py-ipython-module-completion-code'.") + +(defcustom py--imenu-create-index-function 'py--imenu-index + "Switch between `py--imenu-create-index-new', which also lists modules variables, and series 5. index-machine." + :type '(choice + (const :tag "'py--imenu-create-index-new, also lists modules variables " py--imenu-create-index-new) + + (const :tag "py--imenu-create-index, series 5. index-machine" py--imenu-create-index) + (const :tag "py--imenu-index, honor type annotations" py--imenu-index) + + ) + :tag "py--imenu-create-index-function" + :group 'python-mode) + +(defvar py-line-re "^" + "Used by generated functions." ) + +(defvar py-input-filter-re "\\`\\s-*\\S-?\\S-?\\s-*\\'" + "Input matching this regexp is not saved on the history list. +Default ignores all inputs of 0, 1, or 2 non-blank characters.") + +(defvar strip-chars-before "\\`[ \t\r\n]*" + "Regexp indicating which chars shall be stripped before STRING - which is defined by `string-chars-preserve'.") + +(defvar strip-chars-after "[ \t\r\n]*\\'" + "Regexp indicating which chars shall be stripped after STRING - which is defined by `string-chars-preserve'.") + +(defcustom py-docstring-style 'pep-257-nn + "Implemented styles: + + are DJANGO, ONETWO, PEP-257, PEP-257-NN,SYMMETRIC, and NIL. + +A value of NIL won't care about quotes +position and will treat docstrings a normal string, any other +value may result in one of the following docstring styles: + +DJANGO: + + \"\"\" + Process foo, return bar. + \"\"\" + + \"\"\" + Process foo, return bar. + + If processing fails throw ProcessingError. + \"\"\" + +ONETWO: + + \"\"\"Process foo, return bar.\"\"\" + + \"\"\" + Process foo, return bar. + + If processing fails throw ProcessingError. + + \"\"\" + +PEP-257: + + \"\"\"Process foo, return bar.\"\"\" + + \"\"\"Process foo, return bar. + + If processing fails throw ProcessingError. + + \"\"\" + +PEP-257-NN: + + \"\"\"Process foo, return bar.\"\"\" + + \"\"\"Process foo, return bar. + + If processing fails throw ProcessingError. + \"\"\" + +SYMMETRIC: + + \"\"\"Process foo, return bar.\"\"\" + + \"\"\" + Process foo, return bar. + + If processing fails throw ProcessingError. + \"\"\"" + :type '(choice + + (const :tag "Don't format docstrings" nil) + (const :tag "Django's coding standards style." django) + (const :tag "One newline and start and Two at end style." onetwo) + (const :tag "PEP-257 with 2 newlines at end of string." pep-257) + (const :tag "PEP-257 with 1 newline at end of string." pep-257-nn) + (const :tag "Symmetric style." symmetric)) + :tag "py-docstring-style" + :group 'python-mode) + +(defcustom py-execute-directory nil + "Stores the file's default directory-name py-execute-... functions act upon. + +Used by Python-shell for output of `py-execute-buffer' and related commands. +See also `py-use-current-dir-when-execute-p'" + :type 'string + :tag "py-execute-directory" + :group 'python-mode) + +(defcustom py-use-current-dir-when-execute-p t + "Current directory used for output. + +See also `py-execute-directory'" + :type 'boolean + :tag "py-use-current-dir-when-execute-p" + :group 'python-mode) + +(defcustom py-keep-shell-dir-when-execute-p nil + "Don't change Python shell's current working directory when sending code. + +See also `py-execute-directory'" + :type 'boolean + :tag "py-keep-shell-dir-when-execute-p" + :group 'python-mode) + +(defcustom py-fileless-buffer-use-default-directory-p t + "When `py-use-current-dir-when-execute-p' is non-nil and no buffer-file exists, value of `default-directory' sets current working directory of Python output shell." + :type 'boolean + :tag "py-fileless-buffer-use-default-directory-p" + :group 'python-mode) + +(defcustom py-check-command "pychecker --stdlib" + "Command used to check a Python file." + :type 'string + :tag "py-check-command" + :group 'python-mode) + +(defvar py-this-abbrevs-changed nil + "Internally used by ‘python-mode-hook’.") + +(defvar py-ffap-p nil) +(defvar py-ffap nil) +(defvar ffap-alist nil) + +(defvar py-buffer-name nil + "Internal use. + +The buffer last output was sent to.") + +(defvar py-orig-buffer-or-file nil + "Internal use.") + +(defun py--set-ffap-form () + (cond ((and py-ffap-p py-ffap) + (eval-after-load "ffap" + '(push '(python-mode . py-module-path) ffap-alist)) + (setq ffap-alist (remove '(python-mode . py-ffap-module-path) ffap-alist)) + (setq ffap-alist (remove '(py-shell-mode . py-ffap-module-path) + ffap-alist))) + (t (setq ffap-alist (remove '(python-mode . py-ffap-module-path) ffap-alist)) + (setq ffap-alist (remove '(py-shell-mode . py-ffap-module-path) + ffap-alist)) + (setq ffap-alist (remove '(python-mode . py-module-path) ffap-alist))))) + +(defcustom py-ffap-p nil + + "Select python-modes way to find file at point. + +Default is nil" + + :type '(choice + + (const :tag "default" nil) + (const :tag "use py-ffap" py-ffap)) + :tag "py-ffap-p" + :set (lambda (symbol value) + (set-default symbol value) + (py--set-ffap-form)) + :group 'python-mode) + +(defcustom py-keep-windows-configuration nil + "Takes precedence over: + + `py-split-window-on-execute' and `py-switch-buffers-on-execute-p'. +See lp:1239498 + +To suppres window-changes due to error-signaling also. +Set `py-keep-windows-configuration' onto 'force + +Default is nil" + + :type '(choice + (const :tag "nil" nil) + (const :tag "t" t) + (const :tag "force" 'force)) + :tag "py-keep-windows-configuration" + :group 'python-mode) + +(defvar py-output-buffer "*Python Output*" + "Currently unused. + +Output buffer is created dynamically according to Python version and kind of process-handling") +(make-variable-buffer-local 'py-output-buffer) + +(defcustom py-force-default-output-buffer-p nil + "Enforce sending output to the default output ‘buffer-name’. + +Set by defvar ‘py-output-buffer’ +Bug #31 - wrong fontification caused by string-delimiters in output" + + :type 'boolean + :tag "py-force-default-output-buffer-p" + :group 'python-mode) + +(defvar py-ffap-string-code + "__FFAP_get_module_path('''%s''')\n" + "Python code used to get a string with the path of a module.") + +(defcustom py-shell-prompt-regexp ">>> " + "Regular Expression matching top\-level input prompt of python shell. +It should not contain a caret (^) at the beginning." + :type 'string + :tag "py-shell-prompt-regexp" + :group 'python-mode) + +(defvar py-ffap-setup-code + "def __FFAP_get_module_path(module): + try: + import os + path = __import__(module).__file__ + if path[-4:] == '.pyc' and os.path.exists(path[0:-1]): + path = path[:-1] + return path + except: + return '' +" + "Python code to get a module path.") + +(defvar py-eldoc-window-configuration nil + "Keeps window-configuration when function ‘eldoc-mode’ is called.") + +(defvar py-eldoc-setup-code + "def __PYDOC_get_help(obj): + try: + import inspect + if hasattr(obj, 'startswith'): + obj = eval(obj, globals()) + doc = inspect.getdoc(obj) + if not doc and callable(obj): + target = None + if inspect.isclass(obj) and hasattr(obj, '__init__'): + target = obj.__init__ + objtype = 'class' + else: + target = obj + objtype = 'def' + if target: + args = inspect.formatargspec( + *inspect.getargspec(target)) + name = obj.__name__ + doc = '{objtype} {name}{args}'.format( + objtype=objtype, name=name, args=args) + else: + doc = doc.splitlines()[0] + except: + doc = '' + try: + exec('print doc') + except SyntaxError: + print(doc)" + "Python code to setup documentation retrieval.") + +(defcustom py-shell-prompt-output-regexp "" + "Regular Expression matching output prompt of python shell. +It should not contain a caret (^) at the beginning." + :type 'string + :tag "py-shell-prompt-output-regexp" + :group 'python-mode) + +(defvar py-underscore-word-syntax-p t + "This is set later by defcustom, only initial value here. + +If underscore chars should be of ‘syntax-class’ `word', not of `symbol'. +Underscores in word-class makes `forward-word'. +Travels the indentifiers. Default is t. +See also command `toggle-py-underscore-word-syntax-p'") + +(defvar py-autofill-timer nil) +(defvar py-fill-column-orig fill-column) + +;; defvared value isn't updated maybe +(defvar python-mode-message-string + (if (or (string= "python-mode.el" (buffer-name)) + (ignore-errors (string-match "python-mode.el" (py--buffer-filename-remote-maybe)))) + "python-mode.el" + "python-components-mode") + "Internally used. Reports the ‘python-mode’ branch.") + +;; defvared value isn't updated maybe +(setq python-mode-message-string + (if (or (string= "python-mode.el" (buffer-name)) + (ignore-errors (string-match "python-mode.el" (py--buffer-filename-remote-maybe)))) + "python-mode.el" + "python-components-mode")) + +(unless (fboundp 'string-to-syntax) + ;; Skip's XE workaround + (defun string-to-syntax (s) + (cond + ((equal s "|") '(15)) + ((equal s "_") '(3)) + (t (error "Unhandled string: %s" s))))) + +(defvar python-mode-syntax-table nil + "Give punctuation syntax to ASCII that normally has symbol. + +Syntax or has word syntax and isn't a letter.") + +(setq python-mode-syntax-table + (let ((table (make-syntax-table))) + ;; Give punctuation syntax to ASCII that normally has symbol + ;; syntax or has word syntax and isn't a letter. + (let ((symbol (string-to-syntax "_")) + (sst (standard-syntax-table))) + (dotimes (i 128) + (unless (= i ?_) + (if (equal symbol (aref sst i)) + (modify-syntax-entry i "." table))))) + (modify-syntax-entry ?$ "." table) + (modify-syntax-entry ?% "." table) + ;; exceptions + (modify-syntax-entry ?# "<" table) + (modify-syntax-entry ?\n ">" table) + (modify-syntax-entry ?' "\"" table) + (modify-syntax-entry ?` "$" table) + (if py-underscore-word-syntax-p + (modify-syntax-entry ?\_ "w" table) + (modify-syntax-entry ?\_ "_" table)) + table)) + +(defvar py-local-command nil + "Returns locally used executable-name.") +(make-variable-buffer-local 'py-local-command) + +(defvar py-local-versioned-command nil + "Returns locally used executable-name including its version.") +(make-variable-buffer-local 'py-local-versioned-command) + +(defvar py-ipython-completion-command-string nil + "Select command according to IPython version. + +Either ‘py-ipython0.10-completion-command-string’ +or ‘py-ipython0.11-completion-command-string’. + +‘py-ipython0.11-completion-command-string’ also covers version 0.12") + +(defvar py-ipython0.10-completion-command-string + "print(';'.join(__IP.Completer.all_completions('%s'))) #PYTHON-MODE SILENT\n" + "The string send to ipython to query for all possible completions.") + +(defvar py-ipython0.11-completion-command-string + "print(';'.join(get_ipython().Completer.all_completions('%s'))) #PYTHON-MODE SILENT\n" + "The string send to ipython to query for all possible completions.") + +(defvar py-encoding-string-re "^[ \t]*#[ \t]*-\\*-[ \t]*coding:.+-\\*-" + "Matches encoding string of a Python file.") + +(defvar py-shebang-regexp "#![ \t]?\\([^ \t\n]+\\)[ \t]*\\([biptj]+ython[^ \t\n]*\\)" + "Detecting the shell in head of file.") +;; (setq py-shebang-regexp "#![ \t]?\\([^ \t\n]+\\)[ \t]*\\([biptj]+ython[^ \t\n]*\\)") + +(defvar py-separator-char "/" + "Values set by defcustom only will not be seen in batch-mode.") + +(defvar py-temp-directory + (let ((ok '(lambda (x) + (and x + (setq x (expand-file-name x)) ; always true + (file-directory-p x) + (file-writable-p x) + x))) + erg) + (or + (and (not (string= "" py-custom-temp-directory)) + (if (funcall ok py-custom-temp-directory) + (setq erg (expand-file-name py-custom-temp-directory)) + (if (file-directory-p (expand-file-name py-custom-temp-directory)) + (error "Py-custom-temp-directory set but not writable") + (error "Py-custom-temp-directory not an existing directory")))) + (and (funcall ok (getenv "TMPDIR")) + (setq erg (getenv "TMPDIR"))) + (and (funcall ok (getenv "TEMP/TMP")) + (setq erg (getenv "TEMP/TMP"))) + (and (funcall ok "/usr/tmp") + (setq erg "/usr/tmp")) + (and (funcall ok "/tmp") + (setq erg "/tmp")) + (and (funcall ok "/var/tmp") + (setq erg "/var/tmp")) + (and (eq system-type 'darwin) + (funcall ok "/var/folders") + (setq erg "/var/folders")) + (and (or (eq system-type 'ms-dos)(eq system-type 'windows-nt)) + (funcall ok (concat "c:" py-separator-char "Users")) + (setq erg (concat "c:" py-separator-char "Users"))) + ;; (funcall ok ".") + (error + "Couldn't find a usable temp directory -- set `py-temp-directory'")) + (when erg (setq py-temp-directory erg))) + "Directory used for temporary files created by a *Python* process. +By default, guesses the first directory from this list that exists and that you +can write into: the value (if any) of the environment variable TMPDIR, + /usr/tmp, /tmp, /var/tmp, or the current directory. + + `py-custom-temp-directory' will take precedence when setq") + +(defcustom py-pdbtrack-stacktrace-info-regexp + "> \\([^\"(<]+\\)(\\([0-9]+\\))\\([?a-zA-Z0-9_<>]+\\)()" + "Regular expression matching stacktrace information. +Used to extract the current line and module being inspected." + :type 'string + :group 'python-mode + :safe 'stringp) + +(defvar py-pdbtrack-input-prompt "^[(<]*[Ii]?[Pp]y?db[>)]+ *" + "Recognize the prompt.") + +(setq py-pdbtrack-input-prompt "^[(< \t]*[Ii]?[Pp]y?db[>)]*.*") + +(defvar py-pydbtrack-input-prompt "^[(]*ipydb[>)]+ " + "Recognize the pydb-prompt.") + +(defvar py-ipython-input-prompt-re "In \\[[0-9]+\\]:\\|^[ ]\\{3\\}[.]\\{3,\\}:" + "A regular expression to match the IPython input prompt.") + +;; prevent ipython.el's setting +(setq py-ipython-input-prompt-re "[IO][un]t? \\[[0-9]+\\]:\\|^[ ]\\{3\\}[.]\\{3,\\}:" ) + +(defvar py-exec-command nil + "Internally used.") + +(defvar py-which-bufname "Python") + +(defvar py-pychecker-history nil) + +(defvar py-pyflakes-history nil) + +(defvar py-pep8-history nil) + +(defvar py-pyflakespep8-history nil) + +(defvar py-pylint-history nil) + +(defvar py-ipython-output-prompt-re "^Out\\[[0-9]+\\]: " + "A regular expression to match the output prompt of IPython.") + +(defvar py-mode-output-map nil + "Keymap used in *Python Output* buffers.") + +(defvar hs-hide-comments-when-hiding-all t + "Defined in hideshow.el, silence compiler warnings here.") + +(defvar py-force-local-shell-p nil + "Used internally, see `toggle-force-local-shell'.") + +(defvar py-shell-complete-debug nil + "For interal use when debugging, stores completions." ) + +(defcustom py-debug-p nil + "When non-nil, keep resp. store information useful for debugging. + +Temporary files are not deleted. Other functions might implement +some logging etc." + :type 'boolean + :tag "py-debug-p" + :group 'python-mode) + +(defcustom py-section-start "# {{" + "Delimit arbitrary chunks of code." + :type 'string + :tag "py-section-start" + :group 'python-mode) + +(defcustom py-section-end "# }}" + "Delimit arbitrary chunks of code." + :type 'string + :tag "py-section-end" + :group 'python-mode) + +(defvar py-section-re py-section-start) + +(defvar py-last-window-configuration nil + "Internal use: restore ‘py-restore-window-configuration’ when completion is done resp. abandoned.") + +(defvar py-exception-buffer nil + "Will be set internally, let-bound, remember source buffer where error might occur.") + +(defvar py-string-delim-re "\\(\"\"\"\\|'''\\|\"\\|'\\)" + "When looking at beginning of string.") + +(defvar py-labelled-re "[ \\t]*:[[:graph:]]+" + "When looking at label.") +;; (setq py-labelled-re "[ \\t]*:[[:graph:]]+") + +(defvar py-expression-skip-regexp "[^ (=:#\t\r\n\f]" + "Py-expression assumes chars indicated possible composing a ‘py-expression’, skip it.") + +(defvar py-expression-skip-chars "^ (=#\t\r\n\f" + "Py-expression assumes chars indicated possible composing a ‘py-expression’, skip it.") + +(setq py-expression-skip-chars "^ [{(=#\t\r\n\f") + +(defvar py-expression-re "[^ =#\t\r\n\f]+" + "Py-expression assumes chars indicated possible composing a ‘py-expression’, when ‘looking-at’ or -back.") + +(defcustom py-paragraph-re paragraph-start + "Allow Python specific ‘paragraph-start’ var." + :type 'string + :tag "py-paragraph-re" + :group 'python-mode) + +(defvar py-not-expression-regexp "[ .=#\t\r\n\f)]+" + "Py-expression assumes chars indicated probably will not compose a ‘py-expression’.") + +(defvar py-not-expression-chars " #\t\r\n\f" + "Py-expression assumes chars indicated probably will not compose a ‘py-expression’.") + +(defvar py-partial-expression-backward-chars "^] .=,\"'()[{}:#\t\r\n\f" + "Py-partial-expression assumes chars indicated possible composing a ‘py-partial-expression’, skip it.") +;; (setq py-partial-expression-backward-chars "^] .=,\"'()[{}:#\t\r\n\f") + +(defvar py-partial-expression-forward-chars "^ .\"')}]:#\t\r\n\f") +;; (setq py-partial-expression-forward-chars "^ .\"')}]:#\t\r\n\f") + +(defvar py-partial-expression-re (concat "[" py-partial-expression-backward-chars (substring py-partial-expression-forward-chars 1) "]+")) +(setq py-partial-expression-re (concat "[" py-partial-expression-backward-chars "]+")) + +(defvar py-statement-re py-partial-expression-re) +(defvar py-indent-re ".+" + "This var is introduced for regularity only.") +(setq py-indent-re ".+") + +(defvar py-operator-re "[ \t]*\\(\\.\\|+\\|-\\|*\\|//\\|//\\|&\\|%\\||\\|\\^\\|>>\\|<<\\|<\\|<=\\|>\\|>=\\|==\\|!=\\|=\\)[ \t]*" + "Matches most of Python syntactical meaningful characters. + +See also `py-assignment-re'") + +;; (setq py-operator-re "[ \t]*\\(\\.\\|+\\|-\\|*\\|//\\|//\\|&\\|%\\||\\|\\^\\|>>\\|<<\\|<\\|<=\\|>\\|>=\\|==\\|!=\\|=\\)[ \t]*") + +(defvar py-assignment-re "[ \t]*=[^=]" + "Matches assignment operator inclusive whitespaces around. + +See also `py-operator-re'") + +(defvar py-delimiter-re "\\(\\.[[:alnum:]]\\|,\\|;\\|:\\)[ \t\n]" + "Delimiting elements of lists or other programming constructs.") + +(defvar py-line-number-offset 0 + "When an exception occurs as a result of ‘py-execute-region’. + +A subsequent ‘py-up-exception’ needs the line number where the region +started, in order to jump to the correct file line. +This variable is set in ‘py-execute-region’ and used in ‘py--jump-to-exception’.") + +(defvar py-match-paren-no-use-syntax-pps nil) + +(defvar py-traceback-line-re + "[ \t]+File \"\\([^\"]+\\)\", line \\([0-9]+\\)" + "Regular expression that describes tracebacks.") + +(defvar py-XXX-tag-face 'py-XXX-tag-face) + +(defvar py-pseudo-keyword-face 'py-pseudo-keyword-face) + +(defvar py-variable-name-face 'py-variable-name-face) + +(defvar py-number-face 'py-number-face) + +(defvar py-decorators-face 'py-decorators-face) + +(defvar py-object-reference-face 'py-object-reference-face) + +(defvar py-builtins-face 'py-builtins-face) + +(defvar py-class-name-face 'py-class-name-face) + +(defvar py-exception-name-face 'py-exception-name-face) + +(defvar py-import-from-face 'py-import-from-face) + +(defvar py-def-class-face 'py-def-class-face) + +(defvar py-try-if-face 'py-try-if-face) + +(defvar py-file-queue nil + "Queue of Python temp files awaiting execution. +Currently-active file is at the head of the list.") + +(defvar jython-mode-hook nil + "Hook called by `jython-mode'. +`jython-mode' also calls `python-mode-hook'.") + +(defvar py-shell-hook nil + "Hook called by `py-shell'.") + +(defvar python-font-lock-keywords nil) + +(defvar py-dotted-expression-syntax-table + (let ((table (make-syntax-table python-mode-syntax-table))) + (modify-syntax-entry ?_ "_" table) + (modify-syntax-entry ?."_" table) + table) + "Syntax table used to identify Python dotted expressions.") + +(defvar python-default-template "if" + "Default template to expand by `python-expand-template'. +Updated on each expansion.") + +(defvar py-already-guessed-indent-offset nil + "Internal use by ‘py-indent-line’. + +When `this-command' is `eq' to `last-command', use the guess already computed.") +(make-variable-buffer-local 'py-already-guessed-indent-offset) + +(defvar py-shell-template " +\(defun NAME (&optional argprompt) + \"Start an DOCNAME interpreter in another window. + +With optional \\\\[universal-argument] user is prompted +for options to pass to the DOCNAME interpreter. \" + (interactive \"P\") + (let\* ((py-shell-name \"FULLNAME\")) + (py-shell argprompt) + (when (called-interactively-p 'any) (switch-to-buffer (current-buffer)) + (goto-char (point-max))))) +") + +(defvar py-fast-filter-re (concat "\\(" + (mapconcat 'identity + (delq nil (list py-shell-input-prompt-1-regexp py-shell-input-prompt-2-regexp py-ipython-input-prompt-re py-ipython-output-prompt-re py-pdbtrack-input-prompt py-pydbtrack-input-prompt "[.]\\{3,\\}:? *")) + "\\|") + "\\)") + "Internally used by `py-fast-filter'. +‘ansi-color-filter-apply’ might return +Result: \"\\nIn [10]: ....: ....: ....: 1\\n\\nIn [11]: \"") + +;; Constants +(defconst py-block-closing-keywords-re + "[ \t]*\\_<\\(return\\|raise\\|break\\|continue\\|pass\\)\\_>[ \n\t]" + "Matches the beginning of a class, method or compound statement.") + +(setq py-block-closing-keywords-re + "[ \t]*\\_<\\(return\\|raise\\|break\\|continue\\|pass\\)\\_>[ \n\t]") + +(defconst py-finally-re + "[ \t]*\\_[: \n\t]" + "Regular expression matching keyword which closes a try-block.") + +(defconst py-except-re + "[ \t]*\\_[:( \n\t]*" + "Regular expression matching keyword which composes a try-block.") + +(defconst py-return-re + ".*:?[ \t]*\\_<\\(return\\)\\_>[ \n\t]*" + "Regular expression matching keyword which typically closes a function.") + +(defconst py-decorator-re + "[ \t]*@[^ ]+\\_>[ \n\t]*" + "Regular expression matching keyword which typically closes a function.") + +(defcustom py-outdent-re-raw + (list + "async def" + "async for" + "async with" + "class" + "def" + "elif" + "else" + "except" + "for" + "if" + "try" + "while" + "with") + "Used by ‘py-outdent-re’." + :type '(repeat string) + :tag "py-outdent-re-raw" + :group 'python-mode + ) + +(defconst py-outdent-re + (concat + "[ \t]*\\_<" + (regexp-opt py-outdent-re-raw) + "\\_>[)\t]*") + "Regular expression matching lines not to augment indent after. + +See ‘py-no-outdent-re-raw’ for better readable content") + +(defcustom py-no-outdent-re-raw + (list + "break" + "continue" + "import" + "pass" + "raise" + "return") + "Uused by o‘py-no-outdent-re’." + :type '(repeat string) + :tag "py-no-outdent-re-raw" + :group 'python-mode) + +(defconst py-no-outdent-re + (concat + "[ \t]*\\_<" + (regexp-opt py-no-outdent-re-raw) + "\\_>[)\t]*$") + "Regular expression matching lines not to augment indent after. + +See ‘py-no-outdent-re-raw’ for better readable content") + +(defconst py-assignment-re "\\_<\\w+\\_>[ \t]*\\(=\\|+=\\|*=\\|%=\\|&=\\|^=\\|<<=\\|-=\\|/=\\|**=\\||=\\|>>=\\|//=\\)" + "If looking at the beginning of an assignment.") + +(defconst py-block-re "[ \t]*\\_<\\(class\\|def\\|async def\\|async for\\|for\\|if\\|try\\|while\\|with\\|async with\\)\\_>[:( \n\t]*" + "Matches the beginning of a compound statement.") + +(defconst py-minor-block-re "[ \t]*\\_<\\(for\\|async for\\|if\\|try\\|with\\|async with\\|except\\)\\_>[:( \n\t]*" + "Matches the beginning of an `for', `if', `try', `except' or `with' block.") + +(defconst py-try-block-re "[ \t]*\\_[: \n\t]" + "Matches the beginning of a `try' block.") + +(defconst py-except-block-re "[ \t]*\\_ *a?s? *[[:print:]]*[: \n\t]" + "Matches the beginning of a `except' block.") + +(defconst py-for-block-re "[ \t]*\\_<\\(for\\|async for\\)\\_> +[[:alpha:]_][[:alnum:]_]* +in +[[:alpha:]_][[:alnum:]_()]* *[: \n\t]" + "Matches the beginning of a `try' block.") + +(defconst py-if-block-re "[ \t]*\\_ +[[:alpha:]_][[:alnum:]_]* *[: \n\t]" + "Matches the beginning of an `if' block.") + +(defconst py-else-block-re "[ \t]*\\_ +[[:alpha:]_][[:alnum:]_]* *[: \n\t]" + "Matches the beginning of an `elif' block.") + +(defconst py-class-re "[ \t]*\\_<\\(class\\)\\_>[ \n\t]" + "Matches the beginning of a class definition.") + +(defconst py-def-or-class-re "[ \t]*\\_<\\(async def\\|class\\|def\\)\\_>[ \n\t]+\\([[:alnum:]_]*\\)" + "Matches the beginning of a class- or functions definition. + +Second group grabs the name") + +;; (setq py-def-or-class-re "[ \t]*\\_<\\(async def\\|class\\|def\\)\\_>[ \n\t]") + +;; (defconst py-def-re "[ \t]*\\_<\\(async def\\|def\\)\\_>[ \n\t]" +(defconst py-def-re "[ \t]*\\_<\\(def\\|async def\\)\\_>[ \n\t]" + "Matches the beginning of a functions definition.") + +(defcustom py-block-or-clause-re-raw + (list + "async for" + "async with" + "async def" + "async class" + "class" + "def" + "elif" + "else" + "except" + "finally" + "for" + "if" + "try" + "while" + "with" + ) + "Matches the beginning of a compound statement or it's clause." + :type '(repeat string) + :tag "py-block-or-clause-re-raw" + :group 'python-mode) + +(defvar py-block-or-clause-re + (concat + "[ \t]*\\_<\\(" + (regexp-opt py-block-or-clause-re-raw) + "\\)\\_>[( \t]*.*:?") + "See ‘py-block-or-clause-re-raw’, which it reads.") + +;; (setq py-block-or-clause-re +;; (concat +;; "[ \t]*\\_<\\(" +;; (regexp-opt py-block-or-clause-re-raw) +;; "\\)\\_>[( \t]*.*:?")) + + +(defcustom py-block-re-raw + (list + "except" + "for" + "if" + "try" + "while" + "with") + "Matches the beginning of a compound statement but not it's clause." + :type '(repeat string) + :tag "py-block-re-raw" + :group 'python-mode) + +(defvar py-block-re + (concat + "[ \t]*\\_<\\(" + (regexp-opt py-block-re-raw) + "\\)\\_>[( \t]*.*:?") + "See ‘py-block-or-clause-re-raw’, which it reads.") + +(defconst py-clause-re + (concat + "[ \t]*\\_<\\(" + (mapconcat 'identity + (list + "elif" + "else" + "except" + "finally") + "\\|") + "\\)\\_>[( \t]*.*:?") + "Regular expression matching lines not to augment indent after.") + +(defcustom py-extended-block-or-clause-re-raw + (list + "async def" + "async for" + "async with" + "class" + "def" + "elif" + "else" + "except" + "finally" + "for" + "if" + "try" + "while" + "with") + "Matches the beginning of a compound statement or it's clause." + :type '(repeat string) + :tag "py-extended-block-or-clause-re-raw" + :group 'python-mode) + +(defconst py-extended-block-or-clause-re + (concat + "[ \t]*\\_<\\(" + (regexp-opt py-extended-block-or-clause-re-raw) + "\\)\\_>[( \t]*.*:?") + "See ‘py-block-or-clause-re-raw’, which it reads.") + +(defcustom py-top-level-re + (concat + "^\\_<[a-zA-Z_]\\|^\\_<\\(" + (regexp-opt py-extended-block-or-clause-re-raw) + "\\)\\_>[( \t]*.*:?") + "A form which starts at zero indent level, but is not a comment." + :type '(regexp) + :tag "py-top-level-re" + :group 'python-mode + ) + +(defvar py-comment-re comment-start + "Needed for normalized processing.") + +(defconst py-block-keywords + (concat + "\\_<\\(" + (regexp-opt py-block-or-clause-re-raw) + "\\)\\_>") + "Matches known keywords opening a block. + +Customizing `py-block-or-clause-re-raw' will change values here") + +(defcustom py-clause-re-raw + (list + "elif" + "else" + "except" + "finally" + ) + "Matches the beginning of a clause." + :type '(repeat string) + :tag "py-clause-re-raw" + :group 'python-mode) + +(defconst py-clause-re + (concat + "[ \t]*\\_<\\(" + (regexp-opt py-clause-re-raw) + "\\)\\_>[( \t]*.*:?") + "See ‘py-clause-re-raw’, which it reads.") + +(defconst py-elif-re "[ \t]*\\_<\\elif\\_>[:( \n\t]*" + "Matches the beginning of a compound if-statement's clause exclusively.") + +(defconst py-try-clause-re + (concat + "[ \t]*\\_<\\(" + (mapconcat 'identity + (list + "else" + "except" + "finally") + "\\|") + "\\)\\_>[( \t]*.*:") + "Matches the beginning of a compound try-statement's clause.") + +(defconst py-if-re "[ \t]*\\_[( \n\t]*" + "Matches the beginning of a compound statement saying `if'.") + +(defconst py-try-re "[ \t]*\\_[:( \n\t]*" + "Matches the beginning of a compound statement saying `try'." ) + +(defcustom py-compilation-regexp-alist + `((,(rx line-start (1+ (any " \t")) "File \"" + (group (1+ (not (any "\"<")))) ; avoid `' &c + "\", line " (group (1+ digit))) + 1 2) + (,(rx " in file " (group (1+ not-newline)) " on line " + (group (1+ digit))) + 1 2) + (,(rx line-start "> " (group (1+ (not (any "(\"<")))) + "(" (group (1+ digit)) ")" (1+ (not (any "("))) "()") + 1 2)) + "Fetch errors from Py-shell. +hooked into `compilation-error-regexp-alist'" + :type '(alist string) + :tag "py-compilation-regexp-alist" + :group 'python-mode) + +(defun py--quote-syntax (n) + "Put `syntax-table' property correctly on triple quote. +Used for syntactic keywords. N is the match number (1, 2 or 3)." + ;; Given a triple quote, we have to check the context to know + ;; whether this is an opening or closing triple or whether it's + ;; quoted anyhow, and should be ignored. (For that we need to do + ;; the same job as `syntax-ppss' to be correct and it seems to be OK + ;; to use it here despite initial worries.) We also have to sort + ;; out a possible prefix -- well, we don't _have_ to, but I think it + ;; should be treated as part of the string. + + ;; Test cases: + ;; ur"""ar""" x='"' # """ + ;; x = ''' """ ' a + ;; ''' + ;; x '"""' x """ \"""" x + (save-excursion + (goto-char (match-beginning 0)) + (cond + ;; Consider property for the last char if in a fenced string. + ((= n 3) + (let* ((font-lock-syntactic-keywords nil) + (syntax (parse-partial-sexp (point-min) (point)))) + (when (eq t (nth 3 syntax)) ; after unclosed fence + (goto-char (nth 8 syntax)) ; fence position + ;; (skip-chars-forward "uUrR") ; skip any prefix + ;; Is it a matching sequence? + (if (eq (char-after) (char-after (match-beginning 2))) + (eval-when-compile (string-to-syntax "|")))))) + ;; Consider property for initial char, accounting for prefixes. + ((or (and (= n 2) ; leading quote (not prefix) + (not (match-end 1))) ; prefix is null + (and (= n 1) ; prefix + (match-end 1))) ; non-empty + (let ((font-lock-syntactic-keywords nil)) + (unless (eq 'string (syntax-ppss-context (parse-partial-sexp (point-min) (point)))) + (eval-when-compile (string-to-syntax "|"))))) + ;; Otherwise (we're in a non-matching string) the property is + ;; nil, which is OK. + ))) + +(defconst py-font-lock-syntactic-keywords + ;; Make outer chars of matching triple-quote sequences into generic + ;; string delimiters. Fixme: Is there a better way? + ;; First avoid a sequence preceded by an odd number of backslashes. + `((,(concat "\\(?:^\\|[^\\]\\(?:\\\\.\\)*\\)" ;Prefix. + "\\(?1:\"\\)\\(?2:\"\\)\\(?3:\"\\)\\(?4:\"\\)\\(?5:\"\\)\\(?6:\"\\)\\|\\(?1:\"\\)\\(?2:\"\\)\\(?3:\"\\)\\|\\(?1:'\\)\\(?2:'\\)\\(?3:'\\)\\(?4:'\\)\\(?5:'\\)\\(?6:'\\)\\|\\(?1:'\\)\\(?2:'\\)\\(?3:'\\)\\(?4:'\\)\\(?5:'\\)\\(?6:'\\)\\|\\(?1:'\\)\\(?2:'\\)\\(?3:'\\)") + (1 (py--quote-syntax 1) t t) + (2 (py--quote-syntax 2) t t) + (3 (py--quote-syntax 3) t t) + (6 (py--quote-syntax 1) t t)))) + +(defconst py-windows-config-register 313465889 + "Internal used.") + +(defvar py-windows-config nil + "Completion stores ‘py-windows-config-register’ here.") + +(put 'py-indent-offset 'safe-local-variable 'integerp) + +;; testing +(defvar py-ert-test-default-executables + (list "python" "python3" "ipython") + "Serialize tests employing dolist.") + +(defvar py--shell-unfontify nil + "Internally used by `py--run-unfontify-timer'.") +(make-variable-buffer-local 'py--shell-unfontify) + +(defvar py--timer nil + "Used by `py--run-unfontify-timer'.") +(make-variable-buffer-local 'py--timer) + +(defvar py--timer-delay nil + "Used by `py--run-unfontify-timer'.") +(make-variable-buffer-local 'py--timer-delay) + +(defcustom py-shell-unfontify-p t + "Run `py--run-unfontify-timer' unfontifying the shell banner-text. + +Default is nil" + + :type 'boolean + :tag "py-shell-unfontify-p" + :group 'python-mode) + +(defun py--unfontify-banner-intern (buffer) + "Internal use, unfontify BUFFER." + (save-excursion + (goto-char (point-min)) + (let ((erg (or (ignore-errors (car-safe comint-last-prompt)) + (and + (re-search-forward py-fast-filter-re nil t 1) + (match-beginning 0)) + (progn + (forward-paragraph) + (point))))) + ;; (sit-for 1 t) + (if erg + (progn + (font-lock-unfontify-region (point-min) erg) + (goto-char (point-max))) + (progn (and py-debug-p (message "%s" (concat "py--unfontify-banner: Don't see a prompt in buffer " (buffer-name buffer))))))))) + +(defun py--unfontify-banner (&optional buffer) + "Unfontify the shell banner-text. + +Cancels `py--timer' +Expects being called by `py--run-unfontify-timer' +Optional argument BUFFER which select." + (interactive) + (let ((buffer (or buffer (current-buffer)))) + (if (ignore-errors (buffer-live-p (get-buffer buffer))) + (with-current-buffer buffer + (py--unfontify-banner-intern buffer) + (and (timerp py--timer)(cancel-timer py--timer))) + (and (timerp py--timer)(cancel-timer py--timer))))) + +(defun py--run-unfontify-timer (&optional buffer) + "Unfontify the shell banner-text. +Optional argument BUFFER select buffer." + (when py--shell-unfontify + (let ((buffer (or buffer (current-buffer)))) + (if (and + (buffer-live-p buffer) + (or + (eq major-mode 'py-python-shell-mode) + (eq major-mode 'py-ipython-shell-mode))) + (unless py--timer + (setq py--timer + (run-with-idle-timer + (if py--timer-delay (setq py--timer-delay 3) + (setq py--timer-delay 0.1)) + nil + #'py--unfontify-banner buffer))) + (cancel-timer py--timer))))) + +(defsubst py-keep-region-active () + "Keep the region active in XEmacs." + (and (boundp 'zmacs-region-stays) + (setq zmacs-region-stays t))) + + ;; GNU's syntax-ppss-context +(unless (functionp 'syntax-ppss-context) + (defsubst syntax-ppss-context (ppss) + (cond + ((nth 3 ppss) 'string) + ((nth 4 ppss) 'comment) + (t nil)))) + +(defface py-XXX-tag-face + '((t (:inherit font-lock-string-face))) + "XXX\\|TODO\\|FIXME " + :tag "py-XXX-tag-face" + :group 'python-mode) + +(defface py-pseudo-keyword-face + '((t (:inherit font-lock-keyword-face))) + "Face for pseudo keywords in Python mode, like self, True, False, + Ellipsis. + +See also `py-object-reference-face'" + :tag "py-pseudo-keyword-face" + :group 'python-mode) + +(defface py-object-reference-face + '((t (:inherit py-pseudo-keyword-face))) + "Face when referencing object members from its class resp. method., commonly \"cls\" and \"self\"" + :tag "py-object-reference-face" + :group 'python-mode) + +(defface py-variable-name-face + '((t (:inherit default))) + "Face method decorators." + :tag "py-variable-name-face" + :group 'python-mode) + +(defface py-number-face + '((t (:inherit default))) + "Highlight numbers." + :tag "py-number-face" + :group 'python-mode) + +(defface py-try-if-face + '((t (:inherit font-lock-keyword-face))) + "Highlight keywords." + :tag "py-try-if-face" + :group 'python-mode) + +(defface py-import-from-face + '((t (:inherit font-lock-keyword-face))) + "Highlight keywords." + :tag "py-import-from-face" + :group 'python-mode) + +(defface py-def-class-face + '((t (:inherit font-lock-keyword-face))) + "Highlight keywords." + :tag "py-def-class-face" + :group 'python-mode) + + ;; PEP 318 decorators +(defface py-decorators-face + '((t (:inherit font-lock-keyword-face))) + "Face method decorators." + :tag "py-decorators-face" + :group 'python-mode) + +(defface py-builtins-face + '((t (:inherit font-lock-builtin-face))) + "Face for builtins like TypeError, object, open, and exec." + :tag "py-builtins-face" + :group 'python-mode) + +(defface py-class-name-face + '((t (:inherit font-lock-type-face))) + "Face for classes." + :tag "py-class-name-face" + :group 'python-mode) + +(defface py-exception-name-face + '((t (:inherit font-lock-builtin-face))) + "." + :tag "py-exception-name-face" + :group 'python-mode) + +(defun py--python-send-setup-code-intern (name buffer) + (let ((setup-file (concat (py--normalize-directory py-temp-directory) "py-" name "-setup-code.py")) + py-return-result-p py-store-result-p) + (unless (file-readable-p setup-file) + (with-temp-buffer + (insert (eval (car (read-from-string (concat "py-" name "-setup-code"))))) + (write-file setup-file))) + (py--execute-file-base nil setup-file nil buffer) + (when py-verbose-p (message "%s" (concat name " setup-code sent to " (process-name (get-buffer-process buffer))))))) + +(defun py--python-send-completion-setup-code (buffer) + "For Python see py--python-send-setup-code." + (py--python-send-setup-code-intern "shell-completion" buffer)) + +(defun py--python-send-ffap-setup-code (buffer) + "For Python see py--python-send-setup-code." + (py--python-send-setup-code-intern "ffap" buffer)) + +(defun py--python-send-eldoc-setup-code (buffer) + "For Python see py--python-send-setup-code." + (py--python-send-setup-code-intern "eldoc" buffer)) + +(defun py--ipython-import-module-completion () + "Setup IPython v0.11 or greater. + +Used by `py-ipython-module-completion-string'" + (let ((setup-file (concat (py--normalize-directory py-temp-directory) "py-ipython-module-completion.py"))) + (unless (file-readable-p setup-file) + (with-temp-buffer + (insert py-ipython-module-completion-code) + (write-file setup-file))) + (py--execute-file-base nil setup-file nil (current-buffer)))) + +(defun py--at-raw-string () + "If at beginning of a raw-string." + (and (looking-at "\"\"\"\\|'''") (member (char-before) (list ?u ?U ?r ?R)))) + +(defun py--docstring-p (pos) + "Check to see if there is a docstring at POS." + (save-excursion + (goto-char pos) + (when (py--at-raw-string) + (forward-char -1) + (setq pos (point))) + (when (py-backward-statement) + (when (looking-at py-def-or-class-re) + pos)))) + +(defun py--font-lock-syntactic-face-function (state) + "STATE expected as result von (parse-partial-sexp (point-min) (point)." + (if (nth 3 state) + (if (py--docstring-p (nth 8 state)) + font-lock-doc-face + font-lock-string-face) + font-lock-comment-face)) + +(and (fboundp 'make-obsolete-variable) + (make-obsolete-variable 'py-mode-hook 'python-mode-hook nil)) + +(defun py-choose-shell-by-shebang (&optional shebang) + "Choose shell by looking at #! on the first line. + +If SHEBANG is non-nil, returns the shebang as string, +otherwise the Python resp. Jython shell command name." + (interactive) + ;; look for an interpreter specified in the first line + (let* (erg res) + (save-excursion + (goto-char (point-min)) + (when (looking-at py-shebang-regexp) + (if shebang + (setq erg (match-string-no-properties 0)) + (setq erg (split-string (match-string-no-properties 0) "[#! \t]")) + (dolist (ele erg) + (when (string-match "[bijp]+ython" ele) + (setq res ele)))))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" res)) + res)) + +(defun py--choose-shell-by-import () + "Choose CPython or Jython mode based imports. + +If a file imports any packages in `py-jython-packages', within +`py-import-check-point-max' characters from the start of the file, +return `jython', otherwise return nil." + (let (mode) + (save-excursion + (goto-char (point-min)) + (while (and (not mode) + (search-forward-regexp + "^\\(\\(from\\)\\|\\(import\\)\\) \\([^ \t\n.]+\\)" + py-import-check-point-max t)) + (setq mode (and (member (match-string 4) py-jython-packages) + 'jython)))) + mode)) + +(defun py-choose-shell-by-path (&optional separator-char) + "SEPARATOR-CHAR according to system ‘path-separator’. + +Select Python executable according to version desplayed in path. +Returns versioned string, nil if nothing appropriate found" + (interactive) + (let ((path (py--buffer-filename-remote-maybe)) + (separator-char (or separator-char py-separator-char)) + erg) + (when (and path separator-char + (string-match (concat separator-char "[iI]?[pP]ython[0-9.]+" separator-char) path)) + (setq erg (substring path + (1+ (string-match (concat separator-char "[iI]?[pP]ython[0-9.]+" separator-char) path)) (1- (match-end 0))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-which-python (&optional shell) + "Return version of Python of current environment, a number. +Optional argument SHELL selected shell." + (interactive) + (let* ((cmd (or shell (py-choose-shell))) + (treffer (string-match "\\([23]*\\.?[0-9\\.]*\\)$" cmd)) + version erg) + (if treffer + ;; if a number if part of python name, assume it's the version + (setq version (substring-no-properties cmd treffer)) + (setq erg (shell-command-to-string (concat cmd " --version"))) + (setq version (cond ((string-match (concat "\\(on top of Python \\)" "\\([0-9]\\.[0-9]+\\)") erg) + (match-string-no-properties 2 erg)) + ((string-match "\\([0-9]\\.[0-9]+\\)" erg) + (substring erg 7 (1- (length erg))))))) + (when (called-interactively-p 'any) + (if version + (when py-verbose-p (message "%s" version)) + (message "%s" "Could not detect Python on your system"))) + (string-to-number version))) + +(defun py-python-current-environment () + "Return path of current Python installation." + (interactive) + (let* ((cmd (py-choose-shell)) + (denv (shell-command-to-string (concat "type " cmd))) + (erg (substring denv (string-match "/" denv)))) + (when (called-interactively-p 'any) + (if erg + (message "%s" erg) + (message "%s" "Could not detect Python on your system"))) + erg)) + + ;; requested by org-mode still +(defalias 'py-toggle-shells 'py-choose-shell) + +(defun py--cleanup-process-name (res) + "Make res ready for use by `executable-find'. + +Returns RES or substring of RES" + (if (string-match "<" res) + (substring res 0 (match-beginning 0)) + res)) + +(defalias 'py-which-shell 'py-choose-shell) +(defun py-choose-shell () + "Return an appropriate executable as a string. + +Does the following: + - look for an interpreter with `py-choose-shell-by-shebang' + - examine imports using `py--choose-shell-by-import' + - look if Path/To/File indicates a Python version + - if not successful, return default value of `py-shell-name' + +When interactivly called, messages the shell name +Return nil, if no executable found." + (interactive "P") + (let* (res + done + (erg + (cond (py-force-py-shell-name-p + (default-value 'py-shell-name)) + (py-use-local-default + (if (not (string= "" py-shell-local-path)) + (expand-file-name py-shell-local-path) + (message "Abort: `py-use-local-default' is set to `t' but `py-shell-local-path' is empty. Maybe call `py-toggle-local-default-use'"))) + ((and (not py-fast-process-p) + (comint-check-proc (current-buffer)) + (setq done t) + (string-match "ython" (process-name (get-buffer-process (current-buffer))))) + (setq res (process-name (get-buffer-process (current-buffer)))) + (py--cleanup-process-name res)) + ((py-choose-shell-by-shebang)) + ((py--choose-shell-by-import)) + ((py-choose-shell-by-path)) + (t (or + (default-value 'py-shell-name) + "python")))) + (cmd (if (or + ;; comint-check-proc was succesful + done + py-edit-only-p) erg + (executable-find erg)))) + (if cmd + (when (called-interactively-p 'any) + (message "%s" cmd)) + (when (called-interactively-p 'any) (message "%s" "Could not detect Python on your system. Maybe set `py-edit-only-p'?"))) + erg)) + + +(defun py--normalize-directory (directory) + "Make sure DIRECTORY ends with a file-path separator char. + +Returns DIRECTORY" + (let ((erg (cond ((string-match (concat py-separator-char "$") directory) + directory) + ((not (string= "" directory)) + (concat directory py-separator-char))))) + (unless erg (when py-verbose-p (message "Warning: directory is empty"))) + erg)) + +(defun py--normalize-pythonpath (pythonpath) + "Make sure PYTHONPATH ends with a colon. + +Returns PYTHONPATH" + (let ((erg (cond ((string-match (concat path-separator "$") pythonpath) + pythonpath) + ((not (string= "" pythonpath)) + (concat pythonpath path-separator)) + (t pythonpath)))) + erg)) + +(defun py-install-directory-check () + "Do some sanity check for `py-install-directory'. + +Returns t if successful." + (interactive) + (let ((erg (and (boundp 'py-install-directory) (stringp py-install-directory) (< 1 (length py-install-directory))))) + (when (called-interactively-p 'any) (message "py-install-directory-check: %s" erg)) + erg)) + +(defun py-guess-py-install-directory () + "Takes value of user directory aka $HOME. + +If `(locate-library \"python-mode\")' is not succesful. + +Used only, if `py-install-directory' is empty." + (interactive) + (let ((erg (cond ((locate-library "python-mode") + (file-name-directory (locate-library "python-mode"))) + ((ignore-errors (string-match "python-mode" (py--buffer-filename-remote-maybe))) + (file-name-directory (py--buffer-filename-remote-maybe))) + ((string-match "python-mode" (buffer-name)) + default-directory)))) + (cond ((and (or (not py-install-directory) (string= "" py-install-directory)) erg) + (setq py-install-directory erg)) + (t (setq py-install-directory (expand-file-name "~/"))))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "Setting py-install-directory to: %s" py-install-directory)) + py-install-directory) + +(defun py--fetch-pythonpath () + "Consider settings of ‘py-pythonpath’." + (if (string= "" py-pythonpath) + (getenv "PYTHONPATH") + (concat (py--normalize-pythonpath (getenv "PYTHONPATH")) py-pythonpath))) + +(defun py-load-pymacs () + "Load Pymacs as delivered. + +Pymacs has been written by François Pinard and many others. +See original source: http://pymacs.progiciels-bpi.ca" + (interactive) + (let ((pyshell (py-choose-shell)) + (path (py--fetch-pythonpath)) + (py-install-directory (cond ((string= "" py-install-directory) + (py-guess-py-install-directory)) + (t (py--normalize-directory py-install-directory))))) + (if (py-install-directory-check) + (progn + ;; If Pymacs has not been loaded before, prepend py-install-directory to + ;; PYTHONPATH, so that the Pymacs delivered with python-mode is used. + (unless (featurep 'pymacs) + (setenv "PYTHONPATH" (concat + (expand-file-name py-install-directory) + (if path (concat path-separator path))))) + (setenv "PYMACS_PYTHON" (if (string-match "IP" pyshell) + "python" + pyshell)) + (require 'pymacs)) + (error "`py-install-directory' not set, see INSTALL")))) + +(when py-load-pymacs-p (py-load-pymacs)) + +(when (and py-load-pymacs-p (featurep 'pymacs)) + (defun py-load-pycomplete () + "Load Pymacs based pycomplete." + (interactive) + (let* ((path (py--fetch-pythonpath)) + (py-install-directory (cond ((string= "" py-install-directory) + (py-guess-py-install-directory)) + (t (py--normalize-directory py-install-directory)))) + (pycomplete-directory (concat (expand-file-name py-install-directory) "completion"))) + (if (py-install-directory-check) + (progn + ;; If the Pymacs process is already running, augment its path. + (when (and (get-process "pymacs") (fboundp 'pymacs-exec)) + (pymacs-exec (concat "sys.path.insert(0, '" pycomplete-directory "')"))) + (require 'pymacs) + (setenv "PYTHONPATH" (concat + pycomplete-directory + (if path (concat path-separator path)))) + (push pycomplete-directory load-path) + (require 'pycomplete) + (add-hook 'python-mode-hook 'py-complete-initialize)) + (error "`py-install-directory' not set, see INSTALL"))))) + +(when (functionp 'py-load-pycomplete) + (py-load-pycomplete)) + +(defun py-set-load-path () + "Include needed subdirs of ‘python-mode’ directory." + (interactive) + (let ((install-directory (py--normalize-directory py-install-directory))) + (cond ((and (not (string= "" install-directory))(stringp install-directory)) + (push (expand-file-name install-directory) load-path) + (push (concat (expand-file-name install-directory) "completion") load-path) + (push (concat (expand-file-name install-directory) "extensions") load-path) + (push (concat (expand-file-name install-directory) "test") load-path) + (push (concat (expand-file-name install-directory) "tools") load-path) + (push (concat (expand-file-name install-directory) "autopair") load-path)) + (t (error "Please set `py-install-directory', see INSTALL")) + (when (called-interactively-p 'any) (message "%s" load-path))))) + +(unless py-install-directory + (push default-directory load-path) + (push (concat default-directory "extensions") load-path)) + +(defun py-count-lines (&optional beg end) + "Count lines in accessible part until current line. + +See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7115 +Optional argument BEG specify beginning. +Optional argument END specify end." + (interactive) + (save-excursion + (let ((count 0) + (beg (or beg (point-min))) + (end (or end (point)))) + (save-match-data + (if (or (eq major-mode 'comint-mode) + (eq major-mode 'py-shell-mode)) + (if + (re-search-backward py-fast-filter-re nil t 1) + (goto-char (match-end 0)) + ;; (when py-debug-p (message "%s" "py-count-lines: Don't see a prompt here")) + (goto-char beg)) + (goto-char beg))) + (while (and (< (point) end)(not (eobp)) (skip-chars-forward "^\n" end)) + (setq count (1+ count)) + (unless (or (not (< (point) end)) (eobp)) (forward-char 1) + (setq count (+ count (abs (skip-chars-forward "\n" end)))))) + (when (bolp) (setq count (1+ count))) + (when (and py-debug-p (called-interactively-p 'any)) (message "%s" count)) + count))) + +(defmacro py-escaped () + "Return t if char is preceded by an odd number of backslashes." + `(save-excursion + (< 0 (% (abs (skip-chars-backward "\\\\")) 2)))) + +(defmacro py-current-line-backslashed-p () + "Return t if current line is a backslashed continuation line." + `(save-excursion + (end-of-line) + (skip-chars-backward " \t\r\n\f") + (and (eq (char-before (point)) ?\\ ) + (py-escaped)))) + +(defmacro py-preceding-line-backslashed-p () + "Return t if preceding line is a backslashed continuation line." + `(save-excursion + (beginning-of-line) + (skip-chars-backward " \t\r\n\f") + (and (eq (char-before (point)) ?\\ ) + (py-escaped)))) + +(defun py--escape-doublequotes (start end) + "Escape doublequotes in region by START END." + (let ((end (copy-marker end))) + (save-excursion + (goto-char start) + (while (and (not (eobp)) (< 0 (abs (skip-chars-forward "^\"" end)))) + (when (eq (char-after) ?\") + (unless (py-escaped) + (insert "\\") + (forward-char 1))))))) + +(defun py--escape-open-paren-col1 (start end) + "Start from position START until position END." + (goto-char start) + ;; (switch-to-buffer (current-buffer)) + (while (re-search-forward "^(" end t 1) + (insert "\\") + (end-of-line))) + +(and py-company-pycomplete-p (require 'company-pycomplete)) + +;; Macros +(defmacro empty-line-p () + "Return t if cursor is at an line with nothing but whitespace-characters, nil otherwise." + `(save-excursion + (progn + (beginning-of-line) + (looking-at "\\s-*$")))) + + + +(require 'ansi-color) +(require 'cc-cmds) +(require 'cl) +(require 'comint) +(require 'compile) +(require 'custom) +(require 'flymake) +(require 'hippie-exp) +(require 'shell) +(require 'thingatpt) +(require 'which-func) + +(defun py-define-menu (map) + (easy-menu-define py-menu map "Py" + `("Python" + ("Interpreter" + ["Ipython" ipython + :help " `ipython' +Start an IPython interpreter."] + + ["Ipython2\.7" ipython2\.7 + :help " `ipython2\.7'"] + + ["Ipython3" ipython3 + :help " `ipython3' +Start an IPython3 interpreter."] + + ["Jython" jython + :help " `jython' +Start an Jython interpreter."] + + ["Python" python + :help " `python' +Start an Python interpreter."] + + ["Python2" python2 + :help " `python2' +Start an Python2 interpreter."] + + ["Python3" python3 + :help " `python3' +Start an Python3 interpreter."]) + ("Edit" + ("Shift" + ("Shift right" + ["Shift block right" py-shift-block-right + :help " `py-shift-block-right' +Indent block by COUNT spaces."] + + ["Shift block or clause right" py-shift-block-or-clause-right + :help " `py-shift-block-or-clause-right' +Indent block-or-clause by COUNT spaces."] + + ["Shift class right" py-shift-class-right + :help " `py-shift-class-right' +Indent class by COUNT spaces."] + + ["Shift clause right" py-shift-clause-right + :help " `py-shift-clause-right' +Indent clause by COUNT spaces."] + + ["Shift comment right" py-shift-comment-right + :help " `py-shift-comment-right' +Indent comment by COUNT spaces."] + + ["Shift def right" py-shift-def-right + :help " `py-shift-def-right' +Indent def by COUNT spaces."] + + ["Shift def or class right" py-shift-def-or-class-right + :help " `py-shift-def-or-class-right' +Indent def-or-class by COUNT spaces."] + + ["Shift indent right" py-shift-indent-right + :help " `py-shift-indent-right' +Indent indent by COUNT spaces."] + + ["Shift minor block right" py-shift-minor-block-right + :help " `py-shift-minor-block-right' +Indent minor-block by COUNT spaces."] + + ["Shift paragraph right" py-shift-paragraph-right + :help " `py-shift-paragraph-right' +Indent paragraph by COUNT spaces."] + + ["Shift region right" py-shift-region-right + :help " `py-shift-region-right' +Indent region by COUNT spaces."] + + ["Shift statement right" py-shift-statement-right + :help " `py-shift-statement-right' +Indent statement by COUNT spaces."] + + ["Shift top level right" py-shift-top-level-right + :help " `py-shift-top-level-right' +Indent top-level by COUNT spaces."]) + ("Shift left" + ["Shift block left" py-shift-block-left + :help " `py-shift-block-left' +Dedent block by COUNT spaces."] + + ["Shift block or clause left" py-shift-block-or-clause-left + :help " `py-shift-block-or-clause-left' +Dedent block-or-clause by COUNT spaces."] + + ["Shift class left" py-shift-class-left + :help " `py-shift-class-left' +Dedent class by COUNT spaces."] + + ["Shift clause left" py-shift-clause-left + :help " `py-shift-clause-left' +Dedent clause by COUNT spaces."] + + ["Shift comment left" py-shift-comment-left + :help " `py-shift-comment-left' +Dedent comment by COUNT spaces."] + + ["Shift def left" py-shift-def-left + :help " `py-shift-def-left' +Dedent def by COUNT spaces."] + + ["Shift def or class left" py-shift-def-or-class-left + :help " `py-shift-def-or-class-left' +Dedent def-or-class by COUNT spaces."] + + ["Shift indent left" py-shift-indent-left + :help " `py-shift-indent-left' +Dedent indent by COUNT spaces."] + + ["Shift minor block left" py-shift-minor-block-left + :help " `py-shift-minor-block-left' +Dedent minor-block by COUNT spaces."] + + ["Shift paragraph left" py-shift-paragraph-left + :help " `py-shift-paragraph-left' +Dedent paragraph by COUNT spaces."] + + ["Shift region left" py-shift-region-left + :help " `py-shift-region-left' +Dedent region by COUNT spaces."] + + ["Shift statement left" py-shift-statement-left + :help " `py-shift-statement-left' +Dedent statement by COUNT spaces."])) + ("Mark" + ["Mark block" py-mark-block + :help " `py-mark-block' +Mark block, take beginning of line positions."] + + ["Mark block or clause" py-mark-block-or-clause + :help " `py-mark-block-or-clause' +Mark block-or-clause, take beginning of line positions."] + + ["Mark class" py-mark-class + :help " `py-mark-class' +Mark class, take beginning of line positions."] + + ["Mark clause" py-mark-clause + :help " `py-mark-clause' +Mark clause, take beginning of line positions."] + + ["Mark comment" py-mark-comment + :help " `py-mark-comment' +Mark comment at point."] + + ["Mark def" py-mark-def + :help " `py-mark-def' +Mark def, take beginning of line positions."] + + ["Mark def or class" py-mark-def-or-class + :help " `py-mark-def-or-class' +Mark def-or-class, take beginning of line positions."] + + ["Mark expression" py-mark-expression + :help " `py-mark-expression' +Mark expression at point."] + + ["Mark except block" py-mark-except-block + :help " `py-mark-except-block' +Mark except-block, take beginning of line positions."] + + ["Mark if block" py-mark-if-block + :help " `py-mark-if-block' +Mark if-block, take beginning of line positions."] + + ["Mark indent" py-mark-indent + :help " `py-mark-indent' +Mark indent, take beginning of line positions."] + + ["Mark line" py-mark-line + :help " `py-mark-line' +Mark line at point."] + + ["Mark minor block" py-mark-minor-block + :help " `py-mark-minor-block' +Mark minor-block, take beginning of line positions."] + + ["Mark partial expression" py-mark-partial-expression + :help " `py-mark-partial-expression' +Mark partial-expression at point."] + + ["Mark paragraph" py-mark-paragraph + :help " `py-mark-paragraph' +Mark paragraph at point."] + + ["Mark section" py-mark-section + :help " `py-mark-section' +Mark section at point."] + + ["Mark statement" py-mark-statement + :help " `py-mark-statement' +Mark statement, take beginning of line positions."] + + ["Mark top level" py-mark-top-level + :help " `py-mark-top-level' +Mark top-level, take beginning of line positions."] + + ["Mark try block" py-mark-try-block + :help " `py-mark-try-block' +Mark try-block, take beginning of line positions."]) + ("Copy" + ["Copy block" py-copy-block + :help " `py-copy-block' +Copy block at point."] + + ["Copy block or clause" py-copy-block-or-clause + :help " `py-copy-block-or-clause' +Copy block-or-clause at point."] + + ["Copy class" py-copy-class + :help " `py-copy-class' +Copy class at point."] + + ["Copy clause" py-copy-clause + :help " `py-copy-clause' +Copy clause at point."] + + ["Copy comment" py-copy-comment + :help " `py-copy-comment'"] + + ["Copy def" py-copy-def + :help " `py-copy-def' +Copy def at point."] + + ["Copy def or class" py-copy-def-or-class + :help " `py-copy-def-or-class' +Copy def-or-class at point."] + + ["Copy expression" py-copy-expression + :help " `py-copy-expression' +Copy expression at point."] + + ["Copy except block" py-copy-except-block + :help " `py-copy-except-block'"] + + ["Copy if block" py-copy-if-block + :help " `py-copy-if-block'"] + + ["Copy indent" py-copy-indent + :help " `py-copy-indent' +Copy indent at point."] + + ["Copy line" py-copy-line + :help " `py-copy-line' +Copy line at point."] + + ["Copy minor block" py-copy-minor-block + :help " `py-copy-minor-block' +Copy minor-block at point."] + + ["Copy partial expression" py-copy-partial-expression + :help " `py-copy-partial-expression' +Copy partial-expression at point."] + + ["Copy paragraph" py-copy-paragraph + :help " `py-copy-paragraph' +Copy paragraph at point."] + + ["Copy section" py-copy-section + :help " `py-copy-section'"] + + ["Copy statement" py-copy-statement + :help " `py-copy-statement' +Copy statement at point."] + + ["Copy top level" py-copy-top-level + :help " `py-copy-top-level' +Copy top-level at point."] + ) + ("Kill" + ["Kill block" py-kill-block + :help " `py-kill-block' +Delete block at point."] + + ["Kill block or clause" py-kill-block-or-clause + :help " `py-kill-block-or-clause' +Delete block-or-clause at point."] + + ["Kill class" py-kill-class + :help " `py-kill-class' +Delete class at point."] + + ["Kill clause" py-kill-clause + :help " `py-kill-clause' +Delete clause at point."] + + ["Kill comment" py-kill-comment + :help " `py-kill-comment' +Delete comment at point."] + + ["Kill def" py-kill-def + :help " `py-kill-def' +Delete def at point."] + + ["Kill def or class" py-kill-def-or-class + :help " `py-kill-def-or-class' +Delete def-or-class at point."] + + ["Kill expression" py-kill-expression + :help " `py-kill-expression' +Delete expression at point."] + + ["Kill except block" py-kill-except-block + :help " `py-kill-except-block' +Delete except-block at point."] + + ["Kill if block" py-kill-if-block + :help " `py-kill-if-block' +Delete if-block at point."] + + ["Kill indent" py-kill-indent + :help " `py-kill-indent' +Delete indent at point."] + + ["Kill line" py-kill-line + :help " `py-kill-line' +Delete line at point."] + + ["Kill minor block" py-kill-minor-block + :help " `py-kill-minor-block' +Delete minor-block at point."] + + ["Kill partial expression" py-kill-partial-expression + :help " `py-kill-partial-expression' +Delete partial-expression at point."] + + ["Kill paragraph" py-kill-paragraph + :help " `py-kill-paragraph' +Delete paragraph at point."] + + ["Kill section" py-kill-section + :help " `py-kill-section' +Delete section at point."] + + ["Kill statement" py-kill-statement + :help " `py-kill-statement' +Delete statement at point."] + + ["Kill top level" py-kill-top-level + :help " `py-kill-top-level' +Delete top-level at point."] + + ["Kill try block" py-kill-try-block + :help " `py-kill-try-block' +Delete try-block at point."]) + ("Delete" + ["Delete block" py-delete-block + :help " `py-delete-block' +Delete BLOCK at point until beginning-of-line."] + + ["Delete block or clause" py-delete-block-or-clause + :help " `py-delete-block-or-clause' +Delete BLOCK-OR-CLAUSE at point until beginning-of-line."] + + ["Delete class" py-delete-class + :help " `py-delete-class' +Delete CLASS at point until beginning-of-line."] + + ["Delete clause" py-delete-clause + :help " `py-delete-clause' +Delete CLAUSE at point until beginning-of-line."] + + ["Delete comment" py-delete-comment + :help " `py-delete-comment' +Delete COMMENT at point."] + + ["Delete def" py-delete-def + :help " `py-delete-def' +Delete DEF at point until beginning-of-line."] + + ["Delete def or class" py-delete-def-or-class + :help " `py-delete-def-or-class' +Delete DEF-OR-CLASS at point until beginning-of-line."] + + ["Delete expression" py-delete-expression + :help " `py-delete-expression' +Delete EXPRESSION at point."] + + ["Delete except block" py-delete-except-block + :help " `py-delete-except-block' +Delete EXCEPT-BLOCK at point until beginning-of-line."] + + ["Delete if block" py-delete-if-block + :help " `py-delete-if-block' +Delete IF-BLOCK at point until beginning-of-line."] + + ["Delete indent" py-delete-indent + :help " `py-delete-indent' +Delete INDENT at point until beginning-of-line."] + + ["Delete line" py-delete-line + :help " `py-delete-line' +Delete LINE at point."] + + ["Delete minor block" py-delete-minor-block + :help " `py-delete-minor-block' +Delete MINOR-BLOCK at point until beginning-of-line."] + + ["Delete partial expression" py-delete-partial-expression + :help " `py-delete-partial-expression' +Delete PARTIAL-EXPRESSION at point."] + + ["Delete paragraph" py-delete-paragraph + :help " `py-delete-paragraph' +Delete PARAGRAPH at point."] + + ["Delete section" py-delete-section + :help " `py-delete-section' +Delete SECTION at point."] + + ["Delete statement" py-delete-statement + :help " `py-delete-statement' +Delete STATEMENT at point until beginning-of-line."] + + ["Delete top level" py-delete-top-level + :help " `py-delete-top-level' +Delete TOP-LEVEL at point."] + + ["Delete try block" py-delete-try-block + :help " `py-delete-try-block' +Delete TRY-BLOCK at point until beginning-of-line."]) + ("Comment" + ["Comment block" py-comment-block + :help " `py-comment-block' +Comments block at point."] + + ["Comment block or clause" py-comment-block-or-clause + :help " `py-comment-block-or-clause' +Comments block-or-clause at point."] + + ["Comment class" py-comment-class + :help " `py-comment-class' +Comments class at point."] + + ["Comment clause" py-comment-clause + :help " `py-comment-clause' +Comments clause at point."] + + ["Comment def" py-comment-def + :help " `py-comment-def' +Comments def at point."] + + ["Comment def or class" py-comment-def-or-class + :help " `py-comment-def-or-class' +Comments def-or-class at point."] + + ["Comment indent" py-comment-indent + :help " `py-comment-indent' +Comments indent at point."] + + ["Comment minor block" py-comment-minor-block + :help " `py-comment-minor-block' +Comments minor-block at point."] + + ["Comment section" py-comment-section + :help " `py-comment-section' +Comments section at point."] + + ["Comment statement" py-comment-statement + :help " `py-comment-statement' +Comments statement at point."] + + ["Comment top level" py-comment-top-level + :help " `py-comment-top-level' +Comments top-level at point."])) + ("Move" + ("Backward" + ["Backward block" py-backward-block + :help " `py-backward-block' +Go to beginning of ‘block’."] + + ["Backward block or clause" py-backward-block-or-clause + :help " `py-backward-block-or-clause' +Go to beginning of ‘block-or-clause’."] + + ["Backward class" py-backward-class + :help " `py-backward-class' +Go to beginning of class."] + + ["Backward clause" py-backward-clause + :help " `py-backward-clause' +Go to beginning of ‘clause’."] + + ["Backward def" py-backward-def + :help " `py-backward-def' +Go to beginning of def."] + + ["Backward def or class" py-backward-def-or-class + :help " `py-backward-def-or-class' +Go to beginning of def-or-class."] + + ["Backward elif block" py-backward-elif-block + :help " `py-backward-elif-block' +Go to beginning of ‘elif-block’."] + + ["Backward else block" py-backward-else-block + :help " `py-backward-else-block' +Go to beginning of ‘else-block’."] + + ["Backward except block" py-backward-except-block + :help " `py-backward-except-block' +Go to beginning of ‘except-block’."] + + ["Backward expression" py-backward-expression + :help " `py-backward-expression' +Go to the beginning of a python expression."] + + ["Backward for block" py-backward-for-block + :help " `py-backward-for-block' +Go to beginning of ‘for-block’."] + + ["Backward if block" py-backward-if-block + :help " `py-backward-if-block' +Go to beginning of ‘if-block’."] + + ["Backward indent" py-backward-indent + :help " `py-backward-indent' +Go to the beginning of a section of equal indent."] + + ["Backward minor block" py-backward-minor-block + :help " `py-backward-minor-block' +Go to beginning of ‘minor-block’."] + + ["Backward partial expression" py-backward-partial-expression + :help " `py-backward-partial-expression'"] + + ["Backward section" py-backward-section + :help " `py-backward-section' +Go to next section start upward in buffer."] + + ["Backward statement" py-backward-statement + :help " `py-backward-statement' +Go to the initial line of a simple statement."] + + ["Backward top level" py-backward-top-level + :help " `py-backward-top-level' +Go up to beginning of statments until level of indentation is null."] + + ["Backward try block" py-backward-try-block + :help " `py-backward-try-block' +Go to beginning of ‘try-block’."]) + ("Forward" + ["Forward block" py-forward-block + :help " `py-forward-block' +Go to end of block."] + + ["Forward block or clause" py-forward-block-or-clause + :help " `py-forward-block-or-clause' +Go to end of block-or-clause."] + + ["Forward class" py-forward-class + :help " `py-forward-class' +Go to end of class."] + + ["Forward clause" py-forward-clause + :help " `py-forward-clause' +Go to end of clause."] + + ["Forward def" py-forward-def + :help " `py-forward-def' +Go to end of def."] + + ["Forward def or class" py-forward-def-or-class + :help " `py-forward-def-or-class' +Go to end of def-or-class."] + + ["Forward elif block" py-forward-elif-block + :help " `py-forward-elif-block' +Go to end of elif-block."] + + ["Forward else block" py-forward-else-block + :help " `py-forward-else-block' +Go to end of else-block."] + + ["Forward except block" py-forward-except-block + :help " `py-forward-except-block' +Go to end of except-block."] + + ["Forward expression" py-forward-expression + :help " `py-forward-expression' +Go to the end of a compound python expression."] + + ["Forward for block" py-forward-for-block + :help " `py-forward-for-block' +Go to end of for-block."] + + ["Forward if block" py-forward-if-block + :help " `py-forward-if-block' +Go to end of if-block."] + + ["Forward indent" py-forward-indent + :help " `py-forward-indent' +Go to the end of a section of equal indentation."] + + ["Forward minor block" py-forward-minor-block + :help " `py-forward-minor-block' +Go to end of minor-block."] + + ["Forward partial expression" py-forward-partial-expression + :help " `py-forward-partial-expression'"] + + ["Forward section" py-forward-section + :help " `py-forward-section' +Go to next section end downward in buffer."] + + ["Forward statement" py-forward-statement + :help " `py-forward-statement' +Go to the last char of current statement."] + + ["Forward top level" py-forward-top-level + :help " `py-forward-top-level' +Go to end of top-level form at point."] + + ["Forward try block" py-forward-try-block + :help " `py-forward-try-block' +Go to end of try-block."]) + ("BOL-forms" + ("Backward" + ["Backward block bol" py-backward-block-bol + :help " `py-backward-block-bol' +Go to beginning of ‘block’, go to BOL."] + + ["Backward block or clause bol" py-backward-block-or-clause-bol + :help " `py-backward-block-or-clause-bol' +Go to beginning of ‘block-or-clause’, go to BOL."] + + ["Backward class bol" py-backward-class-bol + :help " `py-backward-class-bol' +Go to beginning of class, go to BOL."] + + ["Backward clause bol" py-backward-clause-bol + :help " `py-backward-clause-bol' +Go to beginning of ‘clause’, go to BOL."] + + ["Backward def bol" py-backward-def-bol + :help " `py-backward-def-bol' +Go to beginning of def, go to BOL."] + + ["Backward def or class bol" py-backward-def-or-class-bol + :help " `py-backward-def-or-class-bol' +Go to beginning of def-or-class, go to BOL."] + + ["Backward elif block bol" py-backward-elif-block-bol + :help " `py-backward-elif-block-bol' +Go to beginning of ‘elif-block’, go to BOL."] + + ["Backward else block bol" py-backward-else-block-bol + :help " `py-backward-else-block-bol' +Go to beginning of ‘else-block’, go to BOL."] + + ["Backward except block bol" py-backward-except-block-bol + :help " `py-backward-except-block-bol' +Go to beginning of ‘except-block’, go to BOL."] + + ["Backward expression bol" py-backward-expression-bol + :help " `py-backward-expression-bol'"] + + ["Backward for block bol" py-backward-for-block-bol + :help " `py-backward-for-block-bol' +Go to beginning of ‘for-block’, go to BOL."] + + ["Backward if block bol" py-backward-if-block-bol + :help " `py-backward-if-block-bol' +Go to beginning of ‘if-block’, go to BOL."] + + ["Backward indent bol" py-backward-indent-bol + :help " `py-backward-indent-bol' +Go to the beginning of line of a section of equal indent."] + + ["Backward minor block bol" py-backward-minor-block-bol + :help " `py-backward-minor-block-bol' +Go to beginning of ‘minor-block’, go to BOL."] + + ["Backward partial expression bol" py-backward-partial-expression-bol + :help " `py-backward-partial-expression-bol'"] + + ["Backward section bol" py-backward-section-bol + :help " `py-backward-section-bol'"] + + ["Backward statement bol" py-backward-statement-bol + :help " `py-backward-statement-bol' +Goto beginning of line where statement starts."] + + ["Backward try block bol" py-backward-try-block-bol + :help " `py-backward-try-block-bol' +Go to beginning of ‘try-block’, go to BOL."]) + ("Forward" + ["Forward block bol" py-forward-block-bol + :help " `py-forward-block-bol' +Goto beginning of line following end of block."] + + ["Forward block or clause bol" py-forward-block-or-clause-bol + :help " `py-forward-block-or-clause-bol' +Goto beginning of line following end of block-or-clause."] + + ["Forward class bol" py-forward-class-bol + :help " `py-forward-class-bol' +Goto beginning of line following end of class."] + + ["Forward clause bol" py-forward-clause-bol + :help " `py-forward-clause-bol' +Goto beginning of line following end of clause."] + + ["Forward def bol" py-forward-def-bol + :help " `py-forward-def-bol' +Goto beginning of line following end of def."] + + ["Forward def or class bol" py-forward-def-or-class-bol + :help " `py-forward-def-or-class-bol' +Goto beginning of line following end of def-or-class."] + + ["Forward elif block bol" py-forward-elif-block-bol + :help " `py-forward-elif-block-bol' +Goto beginning of line following end of elif-block."] + + ["Forward else block bol" py-forward-else-block-bol + :help " `py-forward-else-block-bol' +Goto beginning of line following end of else-block."] + + ["Forward except block bol" py-forward-except-block-bol + :help " `py-forward-except-block-bol' +Goto beginning of line following end of except-block."] + + ["Forward expression bol" py-forward-expression-bol + :help " `py-forward-expression-bol'"] + + ["Forward for block bol" py-forward-for-block-bol + :help " `py-forward-for-block-bol' +Goto beginning of line following end of for-block."] + + ["Forward if block bol" py-forward-if-block-bol + :help " `py-forward-if-block-bol' +Goto beginning of line following end of if-block."] + + ["Forward indent bol" py-forward-indent-bol + :help " `py-forward-indent-bol' +Go to beginning of line following of a section of equal indentation."] + + ["Forward minor block bol" py-forward-minor-block-bol + :help " `py-forward-minor-block-bol' +Goto beginning of line following end of minor-block."] + + ["Forward partial expression bol" py-forward-partial-expression-bol + :help " `py-forward-partial-expression-bol'"] + + ["Forward section bol" py-forward-section-bol + :help " `py-forward-section-bol'"] + + ["Forward statement bol" py-forward-statement-bol + :help " `py-forward-statement-bol' +Go to the beginning-of-line following current statement."] + + ["Forward top level bol" py-forward-top-level-bol + :help " `py-forward-top-level-bol' +Go to end of top-level form at point, stop at next beginning-of-line."] + + ["Forward try block bol" py-forward-try-block-bol + :help " `py-forward-try-block-bol' +Goto beginning of line following end of try-block."])) + ("Up/Down" + ["Up" py-up + :help " `py-up' +Go up or to beginning of form if inside."] + + ["Down" py-down + :help " `py-down' +Go to beginning one level below of compound statement or definition at point."])) + ("Send" + ["Execute block" py-execute-block + :help " `py-execute-block' +Send block at point to interpreter."] + + ["Execute block or clause" py-execute-block-or-clause + :help " `py-execute-block-or-clause' +Send block-or-clause at point to interpreter."] + + ["Execute buffer" py-execute-buffer + :help " `py-execute-buffer' +:around advice: ‘ad-Advice-py-execute-buffer’"] + + ["Execute class" py-execute-class + :help " `py-execute-class' +Send class at point to interpreter."] + + ["Execute clause" py-execute-clause + :help " `py-execute-clause' +Send clause at point to interpreter."] + + ["Execute def" py-execute-def + :help " `py-execute-def' +Send def at point to interpreter."] + + ["Execute def or class" py-execute-def-or-class + :help " `py-execute-def-or-class' +Send def-or-class at point to interpreter."] + + ["Execute expression" py-execute-expression + :help " `py-execute-expression' +Send expression at point to interpreter."] + + ["Execute indent" py-execute-indent + :help " `py-execute-indent' +Send indent at point to interpreter."] + + ["Execute line" py-execute-line + :help " `py-execute-line' +Send line at point to interpreter."] + + ["Execute minor block" py-execute-minor-block + :help " `py-execute-minor-block' +Send minor-block at point to interpreter."] + + ["Execute paragraph" py-execute-paragraph + :help " `py-execute-paragraph' +Send paragraph at point to interpreter."] + + ["Execute partial expression" py-execute-partial-expression + :help " `py-execute-partial-expression' +Send partial-expression at point to interpreter."] + + ["Execute region" py-execute-region + :help " `py-execute-region' +Send region at point to interpreter."] + + ["Execute statement" py-execute-statement + :help " `py-execute-statement' +Send statement at point to interpreter."] + + ["Execute top level" py-execute-top-level + :help " `py-execute-top-level' +Send top-level at point to interpreter."] + ("Other" + ("IPython" + ["Execute block ipython" py-execute-block-ipython + :help " `py-execute-block-ipython' +Send block at point to IPython interpreter."] + + ["Execute block or clause ipython" py-execute-block-or-clause-ipython + :help " `py-execute-block-or-clause-ipython' +Send block-or-clause at point to IPython interpreter."] + + ["Execute buffer ipython" py-execute-buffer-ipython + :help " `py-execute-buffer-ipython' +Send buffer at point to IPython interpreter."] + + ["Execute class ipython" py-execute-class-ipython + :help " `py-execute-class-ipython' +Send class at point to IPython interpreter."] + + ["Execute clause ipython" py-execute-clause-ipython + :help " `py-execute-clause-ipython' +Send clause at point to IPython interpreter."] + + ["Execute def ipython" py-execute-def-ipython + :help " `py-execute-def-ipython' +Send def at point to IPython interpreter."] + + ["Execute def or class ipython" py-execute-def-or-class-ipython + :help " `py-execute-def-or-class-ipython' +Send def-or-class at point to IPython interpreter."] + + ["Execute expression ipython" py-execute-expression-ipython + :help " `py-execute-expression-ipython' +Send expression at point to IPython interpreter."] + + ["Execute indent ipython" py-execute-indent-ipython + :help " `py-execute-indent-ipython' +Send indent at point to IPython interpreter."] + + ["Execute line ipython" py-execute-line-ipython + :help " `py-execute-line-ipython' +Send line at point to IPython interpreter."] + + ["Execute minor block ipython" py-execute-minor-block-ipython + :help " `py-execute-minor-block-ipython' +Send minor-block at point to IPython interpreter."] + + ["Execute paragraph ipython" py-execute-paragraph-ipython + :help " `py-execute-paragraph-ipython' +Send paragraph at point to IPython interpreter."] + + ["Execute partial expression ipython" py-execute-partial-expression-ipython + :help " `py-execute-partial-expression-ipython' +Send partial-expression at point to IPython interpreter."] + + ["Execute region ipython" py-execute-region-ipython + :help " `py-execute-region-ipython' +Send region at point to IPython interpreter."] + + ["Execute statement ipython" py-execute-statement-ipython + :help " `py-execute-statement-ipython' +Send statement at point to IPython interpreter."] + + ["Execute top level ipython" py-execute-top-level-ipython + :help " `py-execute-top-level-ipython' +Send top-level at point to IPython interpreter."]) + ("IPython2\.7" + ["Execute block ipython2\.7" py-execute-block-ipython2\.7 + :help " `py-execute-block-ipython2\.7'"] + + ["Execute block or clause ipython2\.7" py-execute-block-or-clause-ipython2\.7 + :help " `py-execute-block-or-clause-ipython2\.7'"] + + ["Execute buffer ipython2\.7" py-execute-buffer-ipython2\.7 + :help " `py-execute-buffer-ipython2\.7'"] + + ["Execute class ipython2\.7" py-execute-class-ipython2\.7 + :help " `py-execute-class-ipython2\.7'"] + + ["Execute clause ipython2\.7" py-execute-clause-ipython2\.7 + :help " `py-execute-clause-ipython2\.7'"] + + ["Execute def ipython2\.7" py-execute-def-ipython2\.7 + :help " `py-execute-def-ipython2\.7'"] + + ["Execute def or class ipython2\.7" py-execute-def-or-class-ipython2\.7 + :help " `py-execute-def-or-class-ipython2\.7'"] + + ["Execute expression ipython2\.7" py-execute-expression-ipython2\.7 + :help " `py-execute-expression-ipython2\.7'"] + + ["Execute indent ipython2\.7" py-execute-indent-ipython2\.7 + :help " `py-execute-indent-ipython2\.7'"] + + ["Execute line ipython2\.7" py-execute-line-ipython2\.7 + :help " `py-execute-line-ipython2\.7'"] + + ["Execute minor block ipython2\.7" py-execute-minor-block-ipython2\.7 + :help " `py-execute-minor-block-ipython2\.7'"] + + ["Execute paragraph ipython2\.7" py-execute-paragraph-ipython2\.7 + :help " `py-execute-paragraph-ipython2\.7'"] + + ["Execute partial expression ipython2\.7" py-execute-partial-expression-ipython2\.7 + :help " `py-execute-partial-expression-ipython2\.7'"] + + ["Execute region ipython2\.7" py-execute-region-ipython2\.7 + :help " `py-execute-region-ipython2\.7'"] + + ["Execute statement ipython2\.7" py-execute-statement-ipython2\.7 + :help " `py-execute-statement-ipython2\.7'"] + + ["Execute top level ipython2\.7" py-execute-top-level-ipython2\.7 + :help " `py-execute-top-level-ipython2\.7'"]) + ("IPython3" + ["Execute block ipython3" py-execute-block-ipython3 + :help " `py-execute-block-ipython3' +Send block at point to IPython interpreter."] + + ["Execute block or clause ipython3" py-execute-block-or-clause-ipython3 + :help " `py-execute-block-or-clause-ipython3' +Send block-or-clause at point to IPython interpreter."] + + ["Execute buffer ipython3" py-execute-buffer-ipython3 + :help " `py-execute-buffer-ipython3' +Send buffer at point to IPython interpreter."] + + ["Execute class ipython3" py-execute-class-ipython3 + :help " `py-execute-class-ipython3' +Send class at point to IPython interpreter."] + + ["Execute clause ipython3" py-execute-clause-ipython3 + :help " `py-execute-clause-ipython3' +Send clause at point to IPython interpreter."] + + ["Execute def ipython3" py-execute-def-ipython3 + :help " `py-execute-def-ipython3' +Send def at point to IPython interpreter."] + + ["Execute def or class ipython3" py-execute-def-or-class-ipython3 + :help " `py-execute-def-or-class-ipython3' +Send def-or-class at point to IPython interpreter."] + + ["Execute expression ipython3" py-execute-expression-ipython3 + :help " `py-execute-expression-ipython3' +Send expression at point to IPython interpreter."] + + ["Execute indent ipython3" py-execute-indent-ipython3 + :help " `py-execute-indent-ipython3' +Send indent at point to IPython interpreter."] + + ["Execute line ipython3" py-execute-line-ipython3 + :help " `py-execute-line-ipython3' +Send line at point to IPython interpreter."] + + ["Execute minor block ipython3" py-execute-minor-block-ipython3 + :help " `py-execute-minor-block-ipython3' +Send minor-block at point to IPython interpreter."] + + ["Execute paragraph ipython3" py-execute-paragraph-ipython3 + :help " `py-execute-paragraph-ipython3' +Send paragraph at point to IPython interpreter."] + + ["Execute partial expression ipython3" py-execute-partial-expression-ipython3 + :help " `py-execute-partial-expression-ipython3' +Send partial-expression at point to IPython interpreter."] + + ["Execute region ipython3" py-execute-region-ipython3 + :help " `py-execute-region-ipython3' +Send region at point to IPython interpreter."] + + ["Execute statement ipython3" py-execute-statement-ipython3 + :help " `py-execute-statement-ipython3' +Send statement at point to IPython interpreter."] + + ["Execute top level ipython3" py-execute-top-level-ipython3 + :help " `py-execute-top-level-ipython3' +Send top-level at point to IPython interpreter."]) + ("Jython" + ["Execute block jython" py-execute-block-jython + :help " `py-execute-block-jython' +Send block at point to Jython interpreter."] + + ["Execute block or clause jython" py-execute-block-or-clause-jython + :help " `py-execute-block-or-clause-jython' +Send block-or-clause at point to Jython interpreter."] + + ["Execute buffer jython" py-execute-buffer-jython + :help " `py-execute-buffer-jython' +Send buffer at point to Jython interpreter."] + + ["Execute class jython" py-execute-class-jython + :help " `py-execute-class-jython' +Send class at point to Jython interpreter."] + + ["Execute clause jython" py-execute-clause-jython + :help " `py-execute-clause-jython' +Send clause at point to Jython interpreter."] + + ["Execute def jython" py-execute-def-jython + :help " `py-execute-def-jython' +Send def at point to Jython interpreter."] + + ["Execute def or class jython" py-execute-def-or-class-jython + :help " `py-execute-def-or-class-jython' +Send def-or-class at point to Jython interpreter."] + + ["Execute expression jython" py-execute-expression-jython + :help " `py-execute-expression-jython' +Send expression at point to Jython interpreter."] + + ["Execute indent jython" py-execute-indent-jython + :help " `py-execute-indent-jython' +Send indent at point to Jython interpreter."] + + ["Execute line jython" py-execute-line-jython + :help " `py-execute-line-jython' +Send line at point to Jython interpreter."] + + ["Execute minor block jython" py-execute-minor-block-jython + :help " `py-execute-minor-block-jython' +Send minor-block at point to Jython interpreter."] + + ["Execute paragraph jython" py-execute-paragraph-jython + :help " `py-execute-paragraph-jython' +Send paragraph at point to Jython interpreter."] + + ["Execute partial expression jython" py-execute-partial-expression-jython + :help " `py-execute-partial-expression-jython' +Send partial-expression at point to Jython interpreter."] + + ["Execute region jython" py-execute-region-jython + :help " `py-execute-region-jython' +Send region at point to Jython interpreter."] + + ["Execute statement jython" py-execute-statement-jython + :help " `py-execute-statement-jython' +Send statement at point to Jython interpreter."] + + ["Execute top level jython" py-execute-top-level-jython + :help " `py-execute-top-level-jython' +Send top-level at point to Jython interpreter."]) + ("Python" + ["Execute block python" py-execute-block-python + :help " `py-execute-block-python' +Send block at point to default interpreter."] + + ["Execute block or clause python" py-execute-block-or-clause-python + :help " `py-execute-block-or-clause-python' +Send block-or-clause at point to default interpreter."] + + ["Execute buffer python" py-execute-buffer-python + :help " `py-execute-buffer-python' +Send buffer at point to default interpreter."] + + ["Execute class python" py-execute-class-python + :help " `py-execute-class-python' +Send class at point to default interpreter."] + + ["Execute clause python" py-execute-clause-python + :help " `py-execute-clause-python' +Send clause at point to default interpreter."] + + ["Execute def python" py-execute-def-python + :help " `py-execute-def-python' +Send def at point to default interpreter."] + + ["Execute def or class python" py-execute-def-or-class-python + :help " `py-execute-def-or-class-python' +Send def-or-class at point to default interpreter."] + + ["Execute expression python" py-execute-expression-python + :help " `py-execute-expression-python' +Send expression at point to default interpreter."] + + ["Execute indent python" py-execute-indent-python + :help " `py-execute-indent-python' +Send indent at point to default interpreter."] + + ["Execute line python" py-execute-line-python + :help " `py-execute-line-python' +Send line at point to default interpreter."] + + ["Execute minor block python" py-execute-minor-block-python + :help " `py-execute-minor-block-python' +Send minor-block at point to default interpreter."] + + ["Execute paragraph python" py-execute-paragraph-python + :help " `py-execute-paragraph-python' +Send paragraph at point to default interpreter."] + + ["Execute partial expression python" py-execute-partial-expression-python + :help " `py-execute-partial-expression-python' +Send partial-expression at point to default interpreter."] + + ["Execute region python" py-execute-region-python + :help " `py-execute-region-python' +Send region at point to default interpreter."] + + ["Execute statement python" py-execute-statement-python + :help " `py-execute-statement-python' +Send statement at point to default interpreter."] + + ["Execute top level python" py-execute-top-level-python + :help " `py-execute-top-level-python' +Send top-level at point to default interpreter."]) + ("Python2" + ["Execute block python2" py-execute-block-python2 + :help " `py-execute-block-python2' +Send block at point to Python2 interpreter."] + + ["Execute block or clause python2" py-execute-block-or-clause-python2 + :help " `py-execute-block-or-clause-python2' +Send block-or-clause at point to Python2 interpreter."] + + ["Execute buffer python2" py-execute-buffer-python2 + :help " `py-execute-buffer-python2' +Send buffer at point to Python2 interpreter."] + + ["Execute class python2" py-execute-class-python2 + :help " `py-execute-class-python2' +Send class at point to Python2 interpreter."] + + ["Execute clause python2" py-execute-clause-python2 + :help " `py-execute-clause-python2' +Send clause at point to Python2 interpreter."] + + ["Execute def python2" py-execute-def-python2 + :help " `py-execute-def-python2' +Send def at point to Python2 interpreter."] + + ["Execute def or class python2" py-execute-def-or-class-python2 + :help " `py-execute-def-or-class-python2' +Send def-or-class at point to Python2 interpreter."] + + ["Execute expression python2" py-execute-expression-python2 + :help " `py-execute-expression-python2' +Send expression at point to Python2 interpreter."] + + ["Execute indent python2" py-execute-indent-python2 + :help " `py-execute-indent-python2' +Send indent at point to Python2 interpreter."] + + ["Execute line python2" py-execute-line-python2 + :help " `py-execute-line-python2' +Send line at point to Python2 interpreter."] + + ["Execute minor block python2" py-execute-minor-block-python2 + :help " `py-execute-minor-block-python2' +Send minor-block at point to Python2 interpreter."] + + ["Execute paragraph python2" py-execute-paragraph-python2 + :help " `py-execute-paragraph-python2' +Send paragraph at point to Python2 interpreter."] + + ["Execute partial expression python2" py-execute-partial-expression-python2 + :help " `py-execute-partial-expression-python2' +Send partial-expression at point to Python2 interpreter."] + + ["Execute region python2" py-execute-region-python2 + :help " `py-execute-region-python2' +Send region at point to Python2 interpreter."] + + ["Execute statement python2" py-execute-statement-python2 + :help " `py-execute-statement-python2' +Send statement at point to Python2 interpreter."] + + ["Execute top level python2" py-execute-top-level-python2 + :help " `py-execute-top-level-python2' +Send top-level at point to Python2 interpreter."]) + ("Python3" + ["Execute block python3" py-execute-block-python3 + :help " `py-execute-block-python3' +Send block at point to Python3 interpreter."] + + ["Execute block or clause python3" py-execute-block-or-clause-python3 + :help " `py-execute-block-or-clause-python3' +Send block-or-clause at point to Python3 interpreter."] + + ["Execute buffer python3" py-execute-buffer-python3 + :help " `py-execute-buffer-python3' +Send buffer at point to Python3 interpreter."] + + ["Execute class python3" py-execute-class-python3 + :help " `py-execute-class-python3' +Send class at point to Python3 interpreter."] + + ["Execute clause python3" py-execute-clause-python3 + :help " `py-execute-clause-python3' +Send clause at point to Python3 interpreter."] + + ["Execute def python3" py-execute-def-python3 + :help " `py-execute-def-python3' +Send def at point to Python3 interpreter."] + + ["Execute def or class python3" py-execute-def-or-class-python3 + :help " `py-execute-def-or-class-python3' +Send def-or-class at point to Python3 interpreter."] + + ["Execute expression python3" py-execute-expression-python3 + :help " `py-execute-expression-python3' +Send expression at point to Python3 interpreter."] + + ["Execute indent python3" py-execute-indent-python3 + :help " `py-execute-indent-python3' +Send indent at point to Python3 interpreter."] + + ["Execute line python3" py-execute-line-python3 + :help " `py-execute-line-python3' +Send line at point to Python3 interpreter."] + + ["Execute minor block python3" py-execute-minor-block-python3 + :help " `py-execute-minor-block-python3' +Send minor-block at point to Python3 interpreter."] + + ["Execute paragraph python3" py-execute-paragraph-python3 + :help " `py-execute-paragraph-python3' +Send paragraph at point to Python3 interpreter."] + + ["Execute partial expression python3" py-execute-partial-expression-python3 + :help " `py-execute-partial-expression-python3' +Send partial-expression at point to Python3 interpreter."] + + ["Execute region python3" py-execute-region-python3 + :help " `py-execute-region-python3' +Send region at point to Python3 interpreter."] + + ["Execute statement python3" py-execute-statement-python3 + :help " `py-execute-statement-python3' +Send statement at point to Python3 interpreter."] + + ["Execute top level python3" py-execute-top-level-python3 + :help " `py-execute-top-level-python3' +Send top-level at point to Python3 interpreter."]) + ("Ignoring defaults " + :help "`M-x py-execute-statement- TAB' for example list commands ignoring defaults + + of `py-switch-buffers-on-execute-p' and `py-split-window-on-execute'"))) + ("Hide-Show" + ("Hide" + ["Hide block" py-hide-block + :help " `py-hide-block' +Hide block at point."] + + ["Hide block or clause" py-hide-block-or-clause + :help " `py-hide-block-or-clause' +Hide block-or-clause at point."] + + ["Hide class" py-hide-class + :help " `py-hide-class' +Hide class at point."] + + ["Hide clause" py-hide-clause + :help " `py-hide-clause' +Hide clause at point."] + + ["Hide comment" py-hide-comment + :help " `py-hide-comment' +Hide comment at point."] + + ["Hide def" py-hide-def + :help " `py-hide-def' +Hide def at point."] + + ["Hide def or class" py-hide-def-or-class + :help " `py-hide-def-or-class' +Hide def-or-class at point."] + + ["Hide elif block" py-hide-elif-block + :help " `py-hide-elif-block' +Hide elif-block at point."] + + ["Hide else block" py-hide-else-block + :help " `py-hide-else-block' +Hide else-block at point."] + + ["Hide except block" py-hide-except-block + :help " `py-hide-except-block' +Hide except-block at point."] + + ["Hide expression" py-hide-expression + :help " `py-hide-expression' +Hide expression at point."] + + ["Hide for block" py-hide-for-block + :help " `py-hide-for-block' +Hide for-block at point."] + + ["Hide if block" py-hide-if-block + :help " `py-hide-if-block' +Hide if-block at point."] + + ["Hide indent" py-hide-indent + :help " `py-hide-indent' +Hide indent at point."] + + ["Hide line" py-hide-line + :help " `py-hide-line' +Hide line at point."] + + ["Hide minor block" py-hide-minor-block + :help " `py-hide-minor-block' +Hide minor-block at point."] + + ["Hide minor block" py-hide-minor-block + :help " `py-hide-minor-block' +Hide minor-block at point."] + + ["Hide paragraph" py-hide-paragraph + :help " `py-hide-paragraph' +Hide paragraph at point."] + + ["Hide partial expression" py-hide-partial-expression + :help " `py-hide-partial-expression' +Hide partial-expression at point."] + + ["Hide section" py-hide-section + :help " `py-hide-section' +Hide section at point."] + + ["Hide statement" py-hide-statement + :help " `py-hide-statement' +Hide statement at point."] + + ["Hide top level" py-hide-top-level + :help " `py-hide-top-level' +Hide top-level at point."]) + ("Show" + ["Show block" py-show-block + :help " `py-show-block' +Show block at point."] + + ["Show block or clause" py-show-block-or-clause + :help " `py-show-block-or-clause' +Show block-or-clause at point."] + + ["Show class" py-show-class + :help " `py-show-class' +Show class at point."] + + ["Show clause" py-show-clause + :help " `py-show-clause' +Show clause at point."] + + ["Show comment" py-show-comment + :help " `py-show-comment' +Show comment at point."] + + ["Show def" py-show-def + :help " `py-show-def' +Show def at point."] + + ["Show def or class" py-show-def-or-class + :help " `py-show-def-or-class' +Show def-or-class at point."] + + ["Show elif block" py-show-elif-block + :help " `py-show-elif-block' +Show elif-block at point."] + + ["Show else block" py-show-else-block + :help " `py-show-else-block' +Show else-block at point."] + + ["Show except block" py-show-except-block + :help " `py-show-except-block' +Show except-block at point."] + + ["Show expression" py-show-expression + :help " `py-show-expression' +Show expression at point."] + + ["Show for block" py-show-for-block + :help " `py-show-for-block' +Show for-block at point."] + + ["Show if block" py-show-if-block + :help " `py-show-if-block' +Show if-block at point."] + + ["Show indent" py-show-indent + :help " `py-show-indent' +Show indent at point."] + + ["Show line" py-show-line + :help " `py-show-line' +Show line at point."] + + ["Show minor block" py-show-minor-block + :help " `py-show-minor-block' +Show minor-block at point."] + + ["Show minor block" py-show-minor-block + :help " `py-show-minor-block' +Show minor-block at point."] + + ["Show paragraph" py-show-paragraph + :help " `py-show-paragraph' +Show paragraph at point."] + + ["Show partial expression" py-show-partial-expression + :help " `py-show-partial-expression' +Show partial-expression at point."] + + ["Show section" py-show-section + :help " `py-show-section' +Show section at point."] + + ["Show statement" py-show-statement + :help " `py-show-statement' +Show statement at point."] + + ["Show top level" py-show-top-level + :help " `py-show-top-level' +Show top-level at point."])) + ("Fast process" + ["Execute block fast" py-execute-block-fast + :help " `py-execute-block-fast' +Process block at point by a Python interpreter."] + + ["Execute block or clause fast" py-execute-block-or-clause-fast + :help " `py-execute-block-or-clause-fast' +Process block-or-clause at point by a Python interpreter."] + + ["Execute class fast" py-execute-class-fast + :help " `py-execute-class-fast' +Process class at point by a Python interpreter."] + + ["Execute clause fast" py-execute-clause-fast + :help " `py-execute-clause-fast' +Process clause at point by a Python interpreter."] + + ["Execute def fast" py-execute-def-fast + :help " `py-execute-def-fast' +Process def at point by a Python interpreter."] + + ["Execute def or class fast" py-execute-def-or-class-fast + :help " `py-execute-def-or-class-fast' +Process def-or-class at point by a Python interpreter."] + + ["Execute expression fast" py-execute-expression-fast + :help " `py-execute-expression-fast' +Process expression at point by a Python interpreter."] + + ["Execute partial expression fast" py-execute-partial-expression-fast + :help " `py-execute-partial-expression-fast' +Process partial-expression at point by a Python interpreter."] + + ["Execute region fast" py-execute-region-fast + :help " `py-execute-region-fast'"] + + ["Execute statement fast" py-execute-statement-fast + :help " `py-execute-statement-fast' +Process statement at point by a Python interpreter."] + + ["Execute string fast" py-execute-string-fast + :help " `py-execute-string-fast'"] + + ["Execute top level fast" py-execute-top-level-fast + :help " `py-execute-top-level-fast' +Process top-level at point by a Python interpreter."]) + ("Virtualenv" + ["Virtualenv activate" virtualenv-activate + :help " `virtualenv-activate' +Activate the virtualenv located in DIR"] + + ["Virtualenv deactivate" virtualenv-deactivate + :help " `virtualenv-deactivate' +Deactivate the current virtual enviroment"] + + ["Virtualenv p" virtualenv-p + :help " `virtualenv-p' +Check if a directory is a virtualenv"] + + ["Virtualenv workon" virtualenv-workon + :help " `virtualenv-workon' +Issue a virtualenvwrapper-like virtualenv-workon command"]) + + ["Execute import or reload" py-execute-import-or-reload + :help " `py-execute-import-or-reload' +Import the current buffer’s file in a Python interpreter."] + ("Help" + ["Find definition" py-find-definition + :help " `py-find-definition' +Find source of definition of SYMBOL."] + + ["Help at point" py-help-at-point + :help " `py-help-at-point' +Print help on symbol at point."] + + ["Info lookup symbol" py-info-lookup-symbol + :help " `py-info-lookup-symbol'"] + + ["Symbol at point" py-symbol-at-point + :help " `py-symbol-at-point' +Return the current Python symbol."]) + ("Debugger" + ["Execute statement pdb" py-execute-statement-pdb + :help " `py-execute-statement-pdb' +Execute statement running pdb."] + + ["Pdb" pdb + :help " `pdb' +Run pdb on program FILE in buffer ‘*gud-FILE*’."]) + ("Checks" + ["Flycheck mode" py-flycheck-mode + :help " `py-flycheck-mode' +Toggle ‘flycheck-mode’."] + + ["Pychecker run" py-pychecker-run + :help " `py-pychecker-run' +*Run pychecker (default on the file currently visited)."] + ("Pylint" + ["Pylint run" py-pylint-run + :help " `py-pylint-run' +*Run pylint (default on the file currently visited)."] + + ["Pylint help" py-pylint-help + :help " `py-pylint-help' +Display Pylint command line help messages."] + + ["Pylint flymake mode" pylint-flymake-mode + :help " `pylint-flymake-mode' +Toggle ‘pylint’ ‘flymake-mode’."]) + ("Pep8" + ["Pep8 run" py-pep8-run + :help " `py-pep8-run' +*Run pep8, check formatting - default on the file currently visited."] + + ["Pep8 help" py-pep8-help + :help " `py-pep8-help' +Display pep8 command line help messages."] + + ["Pep8 flymake mode" pep8-flymake-mode + :help " `pep8-flymake-mode' +Toggle ‘pep8’ ‘flymake-mode’."]) + ("Pyflakes" + ["Pyflakes run" py-pyflakes-run + :help " `py-pyflakes-run' +*Run pyflakes (default on the file currently visited)."] + + ["Pyflakes help" py-pyflakes-help + :help " `py-pyflakes-help' +Display Pyflakes command line help messages."] + + ["Pyflakes flymake mode" pyflakes-flymake-mode + :help " `pyflakes-flymake-mode' +Toggle ‘pyflakes’ ‘flymake-mode’."]) + ("Flake8" + ["Flake8 run" py-flake8-run + :help " `py-flake8-run' +Flake8 is a wrapper around these tools:"] + + ["Flake8 help" py-flake8-help + :help " `py-flake8-help' +Display flake8 command line help messages."] + ("Pyflakes-pep8" + ["Pyflakes pep8 run" py-pyflakes-pep8-run + :help " `py-pyflakes-pep8-run'"] + + ["Pyflakes pep8 help" py-pyflakes-pep8-help + :help " `py-pyflakes-pep8-help'"] + + ["Pyflakes pep8 flymake mode" pyflakes-pep8-flymake-mode + :help " `pyflakes-pep8-flymake-mode'"]))) + ("Customize" + + ["Python-mode customize group" (customize-group 'python-mode) + :help "Open the customization buffer for Python mode"] + ("Switches" + :help "Toggle useful modes" + ("Interpreter" + + ["Shell prompt read only" + (setq py-shell-prompt-read-only + (not py-shell-prompt-read-only)) + :help "If non-nil, the python prompt is read only. Setting this variable will only effect new shells.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-shell-prompt-read-only] + + ["Remove cwd from path" + (setq py-remove-cwd-from-path + (not py-remove-cwd-from-path)) + :help "Whether to allow loading of Python modules from the current directory. +If this is non-nil, Emacs removes '' from sys.path when starting +a Python process. This is the default, for security +reasons, as it is easy for the Python process to be started +without the user's realization (e.g. to perform completion).Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-remove-cwd-from-path] + + ["Honor IPYTHONDIR " + (setq py-honor-IPYTHONDIR-p + (not py-honor-IPYTHONDIR-p)) + :help "When non-nil ipython-history file is constructed by \$IPYTHONDIR +followed by "/history". Default is nil. + +Otherwise value of py-ipython-history is used. Use `M-x customize-variable' to set it permanently" +:style toggle :selected py-honor-IPYTHONDIR-p] + + ["Honor PYTHONHISTORY " + (setq py-honor-PYTHONHISTORY-p + (not py-honor-PYTHONHISTORY-p)) + :help "When non-nil python-history file is set by \$PYTHONHISTORY +Default is nil. + +Otherwise value of py-python-history is used. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-honor-PYTHONHISTORY-p] + + ["Enforce py-shell-name" force-py-shell-name-p-on + :help "Enforce customized default `py-shell-name' should upon execution. "] + + ["Don't enforce default interpreter" force-py-shell-name-p-off + :help "Make execute commands guess interpreter from environment"] + + ["Enforce local Python shell " py-force-local-shell-on + :help "Locally indicated Python being enforced upon sessions execute commands. "] + + ["Remove local Python shell enforcement, restore default" py-force-local-shell-off + :help "Restore `py-shell-name' default value and `behaviour'. "]) + + ("Execute" + + ["Fast process" py-fast-process-p + :help " `py-fast-process-p' + +Use `py-fast-process'\. + +Commands prefixed \"py-fast-...\" suitable for large output + +See: large output makes Emacs freeze, lp:1253907 + +Output-buffer is not in comint-mode" + :style toggle :selected py-fast-process-p] + + ["Python mode v5 behavior" + (setq python-mode-v5-behavior-p + (not python-mode-v5-behavior-p)) + :help "Execute region through `shell-command-on-region' as +v5 did it - lp:990079. This might fail with certain chars - see UnicodeEncodeError lp:550661 + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected python-mode-v5-behavior-p] + + ["Force shell name " + (setq py-force-py-shell-name-p + (not py-force-py-shell-name-p)) + :help "When `t', execution with kind of Python specified in `py-shell-name' is enforced, possibly shebang doesn't take precedence. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-force-py-shell-name-p] + + ["Execute \"if name == main\" blocks p" + (setq py-if-name-main-permission-p + (not py-if-name-main-permission-p)) + :help " `py-if-name-main-permission-p' + +Allow execution of code inside blocks delimited by +if __name__ == '__main__' + +Default is non-nil. " + :style toggle :selected py-if-name-main-permission-p] + + ["Ask about save" + (setq py-ask-about-save + (not py-ask-about-save)) + :help "If not nil, ask about which buffers to save before executing some code. +Otherwise, all modified buffers are saved without asking.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-ask-about-save] + + ["Store result" + (setq py-store-result-p + (not py-store-result-p)) + :help " `py-store-result-p' + +When non-nil, put resulting string of `py-execute-...' into kill-ring, so it might be yanked. " + :style toggle :selected py-store-result-p] + + ["Prompt on changed " + (setq py-prompt-on-changed-p + (not py-prompt-on-changed-p)) + :help "When called interactively, ask for save before a changed buffer is sent to interpreter. + +Default is `t'Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-prompt-on-changed-p] + + ["Dedicated process " + (setq py-dedicated-process-p + (not py-dedicated-process-p)) + :help "If commands executing code use a dedicated shell. + +Default is nilUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-dedicated-process-p] + + ["Execute without temporary file" + (setq py-execute-no-temp-p + (not py-execute-no-temp-p)) + :help " `py-execute-no-temp-p' +Seems Emacs-24.3 provided a way executing stuff without temporary files. +In experimental state yet " + :style toggle :selected py-execute-no-temp-p] + + ["Warn tmp files left " + (setq py--warn-tmp-files-left-p + (not py--warn-tmp-files-left-p)) + :help "Messages a warning, when `py-temp-directory' contains files susceptible being left by previous Python-mode sessions. See also lp:987534 Use `M-x customize-variable' to set it permanently" + :style toggle :selected py--warn-tmp-files-left-p]) + + ("Edit" + + ("Completion" + + ["Set Pymacs-based complete keymap " + (setq py-set-complete-keymap-p + (not py-set-complete-keymap-p)) + :help "If `py-complete-initialize', which sets up enviroment for Pymacs based py-complete, should load it's keys into `python-mode-map' + +Default is nil. +See also resp. edit `py-complete-set-keymap' Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-set-complete-keymap-p] + + ["Indent no completion " + (setq py-indent-no-completion-p + (not py-indent-no-completion-p)) + :help "If completion function should indent when no completion found. Default is `t' + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-indent-no-completion-p] + + ["Company pycomplete " + (setq py-company-pycomplete-p + (not py-company-pycomplete-p)) + :help "Load company-pycomplete stuff. Default is nilUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-company-pycomplete-p]) + + ("Filling" + + ("Docstring styles" + :help "Switch docstring-style" + + ["Nil" py-set-nil-docstring-style + :help " `py-set-nil-docstring-style' + +Set py-docstring-style to nil, format string normally. "] + + ["pep-257-nn" py-set-pep-257-nn-docstring-style + :help " `py-set-pep-257-nn-docstring-style' + +Set py-docstring-style to 'pep-257-nn "] + + ["pep-257" py-set-pep-257-docstring-style + :help " `py-set-pep-257-docstring-style' + +Set py-docstring-style to 'pep-257 "] + + ["django" py-set-django-docstring-style + :help " `py-set-django-docstring-style' + +Set py-docstring-style to 'django "] + + ["onetwo" py-set-onetwo-docstring-style + :help " `py-set-onetwo-docstring-style' + +Set py-docstring-style to 'onetwo "] + + ["symmetric" py-set-symmetric-docstring-style + :help " `py-set-symmetric-docstring-style' + +Set py-docstring-style to 'symmetric "]) + + ["Auto-fill mode" + (setq py-auto-fill-mode + (not py-auto-fill-mode)) + :help "Fill according to `py-docstring-fill-column' and `py-comment-fill-column' + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-auto-fill-mode]) + + ["Use current dir when execute" + (setq py-use-current-dir-when-execute-p + (not py-use-current-dir-when-execute-p)) + :help " `toggle-py-use-current-dir-when-execute-p' + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-use-current-dir-when-execute-p] + + ("Indent" + ("TAB related" + + ["indent-tabs-mode" + (setq indent-tabs-mode + (not indent-tabs-mode)) + :help "Indentation can insert tabs if this is non-nil. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected indent-tabs-mode] + + ["Tab indent" + (setq py-tab-indent + (not py-tab-indent)) + :help "Non-nil means TAB in Python mode calls `py-indent-line'.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-tab-indent] + + ["Tab shifts region " + (setq py-tab-shifts-region-p + (not py-tab-shifts-region-p)) + :help "If `t', TAB will indent/cycle the region, not just the current line. + +Default is nil +See also `py-tab-indents-region-p' + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-tab-shifts-region-p] + + ["Tab indents region " + (setq py-tab-indents-region-p + (not py-tab-indents-region-p)) + :help "When `t' and first TAB doesn't shift, indent-region is called. + +Default is nil +See also `py-tab-shifts-region-p' + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-tab-indents-region-p]) + + ["Close at start column" + (setq py-closing-list-dedents-bos + (not py-closing-list-dedents-bos)) + :help "When non-nil, indent list's closing delimiter like start-column. + +It will be lined up under the first character of + the line that starts the multi-line construct, as in: + +my_list = \[ + 1, 2, 3, + 4, 5, 6, +] + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-closing-list-dedents-bos] + + ["Closing list keeps space" + (setq py-closing-list-keeps-space + (not py-closing-list-keeps-space)) + :help "If non-nil, closing parenthesis dedents onto column of opening plus `py-closing-list-space', default is nil Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-closing-list-keeps-space] + + ["Closing list space" + (setq py-closing-list-space + (not py-closing-list-space)) + :help "Number of chars, closing parenthesis outdent from opening, default is 1 Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-closing-list-space] + + ["Tab shifts region " + (setq py-tab-shifts-region-p + (not py-tab-shifts-region-p)) + :help "If `t', TAB will indent/cycle the region, not just the current line. + +Default is nil +See also `py-tab-indents-region-p'Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-tab-shifts-region-p] + + ["Lhs inbound indent" + (setq py-lhs-inbound-indent + (not py-lhs-inbound-indent)) + :help "When line starts a multiline-assignment: How many colums indent should be more than opening bracket, brace or parenthesis. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-lhs-inbound-indent] + + ["Continuation offset" + (setq py-continuation-offset + (not py-continuation-offset)) + :help "With numeric ARG different from 1 py-continuation-offset is set to that value; returns py-continuation-offset. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-continuation-offset] + + ["Electric colon" + (setq py-electric-colon-active-p + (not py-electric-colon-active-p)) + :help " `py-electric-colon-active-p' + +`py-electric-colon' feature. Default is `nil'. See lp:837065 for discussions. " + :style toggle :selected py-electric-colon-active-p] + + ["Electric colon at beginning of block only" + (setq py-electric-colon-bobl-only + (not py-electric-colon-bobl-only)) + :help "When inserting a colon, do not indent lines unless at beginning of block. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-electric-colon-bobl-only] + + ["Electric yank active " + (setq py-electric-yank-active-p + (not py-electric-yank-active-p)) + :help " When non-nil, `yank' will be followed by an `indent-according-to-mode'. + +Default is nilUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-electric-yank-active-p] + + ["Electric kill backward " + (setq py-electric-kill-backward-p + (not py-electric-kill-backward-p)) + :help "Affects `py-electric-backspace'. Default is nil. + +If behind a delimited form of braces, brackets or parentheses, +backspace will kill it's contents + +With when cursor after +my_string\[0:1] +--------------^ + +==> + +my_string\[] +----------^ + +In result cursor is insided emptied delimited form.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-electric-kill-backward-p] + + ["Trailing whitespace smart delete " + (setq py-trailing-whitespace-smart-delete-p + (not py-trailing-whitespace-smart-delete-p)) + :help "Default is nil. When t, python-mode calls + (add-hook 'before-save-hook 'delete-trailing-whitespace nil 'local) + +Also commands may delete trailing whitespace by the way. +When editing other peoples code, this may produce a larger diff than expected Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-trailing-whitespace-smart-delete-p] + + ["Newline delete trailing whitespace " + (setq py-newline-delete-trailing-whitespace-p + (not py-newline-delete-trailing-whitespace-p)) + :help "Delete trailing whitespace maybe left by `py-newline-and-indent'. + +Default is `t'. See lp:1100892 Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-newline-delete-trailing-whitespace-p] + + ["Dedent keep relative column" + (setq py-dedent-keep-relative-column + (not py-dedent-keep-relative-column)) + :help "If point should follow dedent or kind of electric move to end of line. Default is t - keep relative position. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-dedent-keep-relative-column] + + ["Indent paren spanned multilines " + (setq py-indent-paren-spanned-multilines-p + (not py-indent-paren-spanned-multilines-p)) + :help "If non-nil, indents elements of list a value of `py-indent-offset' to first element: + +def foo(): + if (foo && + baz): + bar() + +Default lines up with first element: + +def foo(): + if (foo && + baz): + bar() +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-indent-paren-spanned-multilines-p] + + ["Indent honors multiline listing" + (setq py-indent-honors-multiline-listing + (not py-indent-honors-multiline-listing)) + :help "If `t', indents to 1\+ column of opening delimiter. If `nil', indent adds one level to the beginning of statement. Default is `nil'. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-indent-honors-multiline-listing] + + ["Indent comment " + (setq py-indent-comments + (not py-indent-comments)) + :help "If comments should be indented like code. Default is `nil'. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-indent-comments] + + ["Uncomment indents " + (setq py-uncomment-indents-p + (not py-uncomment-indents-p)) + :help "When non-nil, after uncomment indent lines. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-uncomment-indents-p] + + ["Indent honors inline comment" + (setq py-indent-honors-inline-comment + (not py-indent-honors-inline-comment)) + :help "If non-nil, indents to column of inlined comment start. +Default is nil. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-indent-honors-inline-comment] + + ["Kill empty line" + (setq py-kill-empty-line + (not py-kill-empty-line)) + :help "If t, py-indent-forward-line kills empty lines. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-kill-empty-line] + + ("Smart indentation" + :help "Toggle py-smart-indentation' + +Use `M-x customize-variable' to set it permanently" + + ["Toggle py-smart-indentation" toggle-py-smart-indentation + :help "Toggles py-smart-indentation + +Use `M-x customize-variable' to set it permanently"] + + ["py-smart-indentation on" py-smart-indentation-on + :help "Switches py-smart-indentation on + +Use `M-x customize-variable' to set it permanently"] + + ["py-smart-indentation off" py-smart-indentation-off + :help "Switches py-smart-indentation off + +Use `M-x customize-variable' to set it permanently"]) + + ["Beep if tab change" + (setq py-beep-if-tab-change + (not py-beep-if-tab-change)) + :help "Ring the bell if `tab-width' is changed. +If a comment of the form + + # vi:set tabsize=: + +is found before the first code line when the file is entered, and the +current value of (the general Emacs variable) `tab-width' does not +equal , `tab-width' is set to , a message saying so is +displayed in the echo area, and if `py-beep-if-tab-change' is non-nil +the Emacs bell is also rung as a warning.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-beep-if-tab-change] + + ["Electric comment " + (setq py-electric-comment-p + (not py-electric-comment-p)) + :help "If \"#\" should call `py-electric-comment'. Default is `nil'. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-electric-comment-p] + + ["Electric comment add space " + (setq py-electric-comment-add-space-p + (not py-electric-comment-add-space-p)) + :help "If py-electric-comment should add a space. Default is `nil'. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-electric-comment-add-space-p] + + ["Empty line closes " + (setq py-empty-line-closes-p + (not py-empty-line-closes-p)) + :help "When non-nil, dedent after empty line following block + +if True: + print(\"Part of the if-statement\") + +print(\"Not part of the if-statement\") + +Default is nil + +If non-nil, a C-j from empty line dedents. +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-empty-line-closes-p]) + ["Defun use top level " + (setq py-defun-use-top-level-p + (not py-defun-use-top-level-p)) + :help "When non-nil, keys C-M-a, C-M-e address top-level form. + +Beginning- end-of-defun forms use +commands `py-backward-top-level', `py-forward-top-level' + +mark-defun marks top-level form at point etc. " + :style toggle :selected py-defun-use-top-level-p] + + ["Close provides newline" + (setq py-close-provides-newline + (not py-close-provides-newline)) + :help "If a newline is inserted, when line after block isn't empty. Default is non-nil. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-close-provides-newline] + + ["Block comment prefix " + (setq py-block-comment-prefix-p + (not py-block-comment-prefix-p)) + :help "If py-comment inserts py-block-comment-prefix. + +Default is tUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-block-comment-prefix-p]) + + ("Display" + + ("Index" + + ["Imenu create index " + (setq py--imenu-create-index-p + (not py--imenu-create-index-p)) + :help "Non-nil means Python mode creates and displays an index menu of functions and global variables. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py--imenu-create-index-p] + + ["Imenu show method args " + (setq py-imenu-show-method-args-p + (not py-imenu-show-method-args-p)) + :help "Controls echoing of arguments of functions & methods in the Imenu buffer. +When non-nil, arguments are printed.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-imenu-show-method-args-p] + ["Switch index-function" py-switch-imenu-index-function + :help "`py-switch-imenu-index-function' +Switch between `py--imenu-create-index' from 5.1 series and `py--imenu-create-index-new'."]) + + ("Fontification" + + ["Mark decorators" + (setq py-mark-decorators + (not py-mark-decorators)) + :help "If py-mark-def-or-class functions should mark decorators too. Default is `nil'. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-mark-decorators] + + ["Fontify shell buffer " + (setq py-fontify-shell-buffer-p + (not py-fontify-shell-buffer-p)) + :help "If code in Python shell should be highlighted as in script buffer. + +Default is nil. + +If `t', related vars like `comment-start' will be set too. +Seems convenient when playing with stuff in IPython shell +Might not be TRT when a lot of output arrives Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-fontify-shell-buffer-p] + + ["Use font lock doc face " + (setq py-use-font-lock-doc-face-p + (not py-use-font-lock-doc-face-p)) + :help "If documention string inside of def or class get `font-lock-doc-face'. + +`font-lock-doc-face' inherits `font-lock-string-face'. + +Call M-x `customize-face' in order to have a visible effect. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-use-font-lock-doc-face-p]) + + ["Switch buffers on execute" + (setq py-switch-buffers-on-execute-p + (not py-switch-buffers-on-execute-p)) + :help "When non-nil switch to the Python output buffer. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-switch-buffers-on-execute-p] + + ["Split windows on execute" + (setq py-split-window-on-execute + (not py-split-window-on-execute)) + :help "When non-nil split windows. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-split-window-on-execute] + + ["Keep windows configuration" + (setq py-keep-windows-configuration + (not py-keep-windows-configuration)) + :help "If a windows is splitted displaying results, this is directed by variable `py-split-window-on-execute'\. Also setting `py-switch-buffers-on-execute-p' affects window-configuration\. While commonly a screen splitted into source and Python-shell buffer is assumed, user may want to keep a different config\. + +Setting `py-keep-windows-configuration' to `t' will restore windows-config regardless of settings mentioned above\. However, if an error occurs, it's displayed\. + +To suppres window-changes due to error-signaling also: M-x customize-variable RET. Set `py-keep-4windows-configuration' onto 'force + +Default is nil Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-keep-windows-configuration] + + ["Which split windows on execute function" + (progn + (if (eq 'split-window-vertically py-split-windows-on-execute-function) + (setq py-split-windows-on-execute-function'split-window-horizontally) + (setq py-split-windows-on-execute-function 'split-window-vertically)) + (message "py-split-windows-on-execute-function set to: %s" py-split-windows-on-execute-function)) + + :help "If `split-window-vertically' or `...-horizontally'. Use `M-x customize-variable' RET `py-split-windows-on-execute-function' RET to set it permanently" + :style toggle :selected py-split-windows-on-execute-function] + + ["Modeline display full path " + (setq py-modeline-display-full-path-p + (not py-modeline-display-full-path-p)) + :help "If the full PATH/TO/PYTHON should be displayed in shell modeline. + +Default is nil. Note: when `py-shell-name' is specified with path, it's shown as an acronym in buffer-name already. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-modeline-display-full-path-p] + + ["Modeline acronym display home " + (setq py-modeline-acronym-display-home-p + (not py-modeline-acronym-display-home-p)) + :help "If the modeline acronym should contain chars indicating the home-directory. + +Default is nil Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-modeline-acronym-display-home-p] + + ["Hide show hide docstrings" + (setq py-hide-show-hide-docstrings + (not py-hide-show-hide-docstrings)) + :help "Controls if doc strings can be hidden by hide-showUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-hide-show-hide-docstrings] + + ["Hide comments when hiding all" + (setq py-hide-comments-when-hiding-all + (not py-hide-comments-when-hiding-all)) + :help "Hide the comments too when you do `hs-hide-all'. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-hide-comments-when-hiding-all] + + ["Max help buffer " + (setq py-max-help-buffer-p + (not py-max-help-buffer-p)) + :help "If \"\*Python-Help\*\"-buffer should appear as the only visible. + +Default is nil. In help-buffer, \"q\" will close it. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-max-help-buffer-p] + + ["Current defun show" + (setq py-current-defun-show + (not py-current-defun-show)) + :help "If `py-current-defun' should jump to the definition, highlight it while waiting PY-WHICH-FUNC-DELAY seconds, before returning to previous position. + +Default is `t'.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-current-defun-show] + + ["Match paren mode" + (setq py-match-paren-mode + (not py-match-paren-mode)) + :help "Non-nil means, cursor will jump to beginning or end of a block. +This vice versa, to beginning first. +Sets `py-match-paren-key' in python-mode-map. +Customize `py-match-paren-key' which key to use. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-match-paren-mode]) + + ("Debug" + + ["py-debug-p" + (setq py-debug-p + (not py-debug-p)) + :help "When non-nil, keep resp\. store information useful for debugging\. + +Temporary files are not deleted\. Other functions might implement +some logging etc\. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-debug-p] + + ["Pdbtrack do tracking " + (setq py-pdbtrack-do-tracking-p + (not py-pdbtrack-do-tracking-p)) + :help "Controls whether the pdbtrack feature is enabled or not. +When non-nil, pdbtrack is enabled in all comint-based buffers, +e.g. shell buffers and the \*Python\* buffer. When using pdb to debug a +Python program, pdbtrack notices the pdb prompt and displays the +source file and line that the program is stopped at, much the same way +as gud-mode does for debugging C programs with gdb.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-pdbtrack-do-tracking-p] + + ["Jump on exception" + (setq py-jump-on-exception + (not py-jump-on-exception)) + :help "Jump to innermost exception frame in Python output buffer. +When this variable is non-nil and an exception occurs when running +Python code synchronously in a subprocess, jump immediately to the +source code of the innermost traceback frame. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-jump-on-exception] + + ["Highlight error in source " + (setq py-highlight-error-source-p + (not py-highlight-error-source-p)) + :help "Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-highlight-error-source-p]) + + ("Other" + + ("Directory" + + ["Guess install directory " + (setq py-guess-py-install-directory-p + (not py-guess-py-install-directory-p)) + :help "If in cases, `py-install-directory' isn't set, `py-set-load-path'should guess it from `buffer-file-name'. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-guess-py-install-directory-p] + + ["Use local default" + (setq py-use-local-default + (not py-use-local-default)) + :help "If `t', py-shell will use `py-shell-local-path' instead +of default Python. + +Making switch between several virtualenv's easier, + `python-mode' should deliver an installer, so named-shells pointing to virtualenv's will be available. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-use-local-default] + + ["Use current dir when execute " + (setq py-use-current-dir-when-execute-p + (not py-use-current-dir-when-execute-p)) + :help "When `t', current directory is used by Python-shell for output of `py-execute-buffer' and related commands. + +See also `py-execute-directory'Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-use-current-dir-when-execute-p] + + ["Keep shell dir when execute " + (setq py-keep-shell-dir-when-execute-p + (not py-keep-shell-dir-when-execute-p)) + :help "Don't change Python shell's current working directory when sending code. + +See also `py-execute-directory'Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-keep-shell-dir-when-execute-p] + + ["Fileless buffer use default directory " + (setq py-fileless-buffer-use-default-directory-p + (not py-fileless-buffer-use-default-directory-p)) + :help "When `py-use-current-dir-when-execute-p' is non-nil and no buffer-file exists, value of `default-directory' sets current working directory of Python output shellUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-fileless-buffer-use-default-directory-p]) + + ("Underscore word syntax" + :help "Toggle `py-underscore-word-syntax-p'" + + ["Toggle underscore word syntax" toggle-py-underscore-word-syntax-p + :help " `toggle-py-underscore-word-syntax-p' + +If `py-underscore-word-syntax-p' should be on or off. + + Returns value of `py-underscore-word-syntax-p' switched to. . + +Use `M-x customize-variable' to set it permanently"] + + ["Underscore word syntax on" py-underscore-word-syntax-p-on + :help " `py-underscore-word-syntax-p-on' + +Make sure, py-underscore-word-syntax-p' is on. + +Returns value of `py-underscore-word-syntax-p'. . + +Use `M-x customize-variable' to set it permanently"] + + ["Underscore word syntax off" py-underscore-word-syntax-p-off + :help " `py-underscore-word-syntax-p-off' + +Make sure, `py-underscore-word-syntax-p' is off. + +Returns value of `py-underscore-word-syntax-p'. . + +Use `M-x customize-variable' to set it permanently"]) + + ["Load pymacs " + (setq py-load-pymacs-p + (not py-load-pymacs-p)) + :help "If Pymacs related stuff should be loaded. + +Default is nil. + +Pymacs has been written by François Pinard and many others. +See original source: http://pymacs.progiciels-bpi.caUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-load-pymacs-p] + + ["Verbose " + (setq py-verbose-p + (not py-verbose-p)) + :help "If functions should report results. + +Default is nil. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-verbose-p] + + ["Empty comment line separates paragraph " + (setq py-empty-comment-line-separates-paragraph-p + (not py-empty-comment-line-separates-paragraph-p)) + :help "Consider paragraph start/end lines with nothing inside but comment sign. + +Default is non-nilUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-empty-comment-line-separates-paragraph-p] + + ["Org cycle " + (setq py-org-cycle-p + (not py-org-cycle-p)) + :help "When non-nil, command `org-cycle' is available at shift-TAB, + +Default is nil. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-org-cycle-p] + + ["Set pager cat" + (setq py-set-pager-cat-p + (not py-set-pager-cat-p)) + :help "If the shell environment variable \$PAGER should set to `cat'. + +If `t', use `C-c C-r' to jump to beginning of output. Then scroll normally. + +Avoids lp:783828, \"Terminal not fully functional\", for help('COMMAND') in python-shell + +When non-nil, imports module `os' Use `M-x customize-variable' to +set it permanently" + :style toggle :selected py-set-pager-cat-p] + + ["Edit only " + (setq py-edit-only-p + (not py-edit-only-p)) + :help "When `t' `python-mode' will not take resort nor check for installed Python executables. Default is nil. + +See bug report at launchpad, lp:944093. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-edit-only-p]))) + ("Other" + ["Boolswitch" py-boolswitch + :help " `py-boolswitch' +Edit the assignment of a boolean variable, revert them."] + + ["Empty out list backward" py-empty-out-list-backward + :help " `py-empty-out-list-backward' +Deletes all elements from list before point."] + + ["Kill buffer unconditional" py-kill-buffer-unconditional + :help " `py-kill-buffer-unconditional' +Kill buffer unconditional, kill buffer-process if existing."] + + ["Remove overlays at point" py-remove-overlays-at-point + :help " `py-remove-overlays-at-point' +Remove overlays as set when ‘py-highlight-error-source-p’ is non-nil."] + ("Electric" + ["Complete electric comma" py-complete-electric-comma + :help " `py-complete-electric-comma'"] + + ["Complete electric lparen" py-complete-electric-lparen + :help " `py-complete-electric-lparen'"] + + ["Electric backspace" py-electric-backspace + :help " `py-electric-backspace' +Delete preceding character or level of indentation."] + + ["Electric colon" py-electric-colon + :help " `py-electric-colon' +Insert a colon and indent accordingly."] + + ["Electric comment" py-electric-comment + :help " `py-electric-comment' +Insert a comment. If starting a comment, indent accordingly."] + + ["Electric delete" py-electric-delete + :help " `py-electric-delete' +Delete following character or levels of whitespace."] + + ["Electric yank" py-electric-yank + :help " `py-electric-yank' +Perform command ‘yank’ followed by an ‘indent-according-to-mode’"] + + ["Hungry delete backwards" py-hungry-delete-backwards + :help " `py-hungry-delete-backwards' +Delete the preceding character or all preceding whitespace"] + + ["Hungry delete forward" py-hungry-delete-forward + :help " `py-hungry-delete-forward' +Delete the following character or all following whitespace"]) + ("Filling" + ["Py docstring style" py-py-docstring-style + :help " `py-py-docstring-style'"] + + ["Py fill comment" py-py-fill-comment + :help " `py-py-fill-comment'"] + + ["Py fill paragraph" py-py-fill-paragraph + :help " `py-py-fill-paragraph'"] + + ["Py fill string" py-py-fill-string + :help " `py-py-fill-string'"] + + ["Py fill string django" py-py-fill-string-django + :help " `py-py-fill-string-django'"] + + ["Py fill string onetwo" py-py-fill-string-onetwo + :help " `py-py-fill-string-onetwo'"] + + ["Py fill string pep 257" py-py-fill-string-pep-257 + :help " `py-py-fill-string-pep-257'"] + + ["Py fill string pep 257 nn" py-py-fill-string-pep-257-nn + :help " `py-py-fill-string-pep-257-nn'"] + + ["Py fill string symmetric" py-py-fill-string-symmetric + :help " `py-py-fill-string-symmetric'"]) + ("Abbrevs" :help "see also `py-add-abbrev'" + :filter (lambda (&rest junk) + (abbrev-table-menu python-mode-abbrev-table))) + + ["Add abbrev" py-add-abbrev + :help " `py-add-abbrev' +Defines python-mode specific abbrev for last expressions before point."] + ("Completion" + ["Py indent or complete" py-py-indent-or-complete + :help " `py-py-indent-or-complete'"] + + ["Py shell complete" py-py-shell-complete + :help " `py-py-shell-complete'"] + + ["Py complete" py-py-complete + :help " `py-py-complete'"]) + + ["Find function" py-find-function + :help " `py-find-function' +Find source of definition of SYMBOL."]))) + map) + +;; python-components-map + +(defvar py-use-menu-p t + "If the menu should be loaded. + +Default is t") + +(defvar py-menu nil + "Make a dynamically bound variable ‘py-menu’.") + +(defvar python-mode-map nil) +(setq python-mode-map + (let ((map (make-sparse-keymap))) + ;; electric keys + (define-key map [(:)] 'py-electric-colon) + (define-key map [(\#)] 'py-electric-comment) + (define-key map [(delete)] 'py-electric-delete) + (define-key map [(backspace)] 'py-electric-backspace) + (define-key map [(control backspace)] 'py-hungry-delete-backwards) + (define-key map [(control c) (delete)] 'py-hungry-delete-forward) + ;; (define-key map [(control y)] 'py-electric-yank) + ;; moving point + (define-key map [(control c)(control p)] 'py-backward-statement) + (define-key map [(control c)(control n)] 'py-forward-statement) + (define-key map [(control c)(control u)] 'py-backward-block) + (define-key map [(control c)(control q)] 'py-forward-block) + (define-key map [(control meta a)] 'py-backward-def-or-class) + (define-key map [(control meta e)] 'py-forward-def-or-class) + + ;; (define-key map [(meta i)] 'py-indent-forward-line) + (define-key map [(control j)] 'py-newline-and-indent) + ;; Most Pythoneers expect RET `py-newline-and-indent' + ;; (define-key map (kbd "RET") 'py-newline-and-dedent) + (define-key map (kbd "RET") py-return-key) + ;; (define-key map (kbd "RET") 'newline) + (define-key map [(super backspace)] 'py-dedent) + ;; (define-key map [(control return)] 'py-newline-and-dedent) + ;; indentation level modifiers + (define-key map [(control c)(control l)] 'py-shift-left) + (define-key map [(control c)(control r)] 'py-shift-right) + (define-key map [(control c)(<)] 'py-shift-left) + (define-key map [(control c)(>)] 'py-shift-right) + (define-key map [(control c)(tab)] 'py-indent-region) + (define-key map [(control c)(:)] 'py-guess-indent-offset) + ;; subprocess commands + (define-key map [(control c)(control c)] 'py-execute-buffer) + (define-key map [(control c)(control m)] 'py-execute-import-or-reload) + (define-key map [(control c)(control s)] 'py-execute-string) + (define-key map [(control c)(|)] 'py-execute-region) + (define-key map [(control meta x)] 'py-execute-def-or-class) + (define-key map [(control c)(!)] 'py-shell) + (define-key map [(control c)(control t)] 'py-toggle-shell) + (define-key map [(control meta h)] 'py-mark-def-or-class) + (define-key map [(control c)(control k)] 'py-mark-block-or-clause) + (define-key map [(control c)(.)] 'py-expression) + ;; Miscellaneous + ;; (define-key map [(super q)] 'py-copy-statement) + (define-key map [(control c)(control d)] 'py-pdbtrack-toggle-stack-tracking) + (define-key map [(control c)(control f)] 'py-sort-imports) + (define-key map [(control c)(\#)] 'py-comment-region) + (define-key map [(control c)(\?)] 'py-describe-mode) + (define-key map [(control c)(control e)] 'py-help-at-point) + (define-key map [(control c)(-)] 'py-up-exception) + (define-key map [(control c)(=)] 'py-down-exception) + (define-key map [(control x) (n) (d)] 'py-narrow-to-defun) + ;; information + (define-key map [(control c)(control b)] 'py-submit-bug-report) + (define-key map [(control c)(control v)] 'py-version) + (define-key map [(control c)(control w)] 'py-pychecker-run) + ;; (define-key map (kbd "TAB") 'py-indent-line) + (define-key map (kbd "TAB") 'py-indent-or-complete) + ;; (if py-complete-function + ;; (progn + ;; (define-key map [(meta tab)] py-complete-function) + ;; (define-key map [(esc) (tab)] py-complete-function)) + ;; (define-key map [(meta tab)] 'py-shell-complete) + ;; (define-key map [(esc) (tab)] 'py-shell-complete)) + (substitute-key-definition 'complete-symbol 'completion-at-point + map global-map) + (substitute-key-definition 'backward-up-list 'py-up + map global-map) + (substitute-key-definition 'down-list 'py-down + map global-map) + (when py-use-menu-p + (setq map (py-define-menu map))) + map)) + +(defvar py-python-shell-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "RET") 'comint-send-input) + (define-key map [(control c)(-)] 'py-up-exception) + (define-key map [(control c)(=)] 'py-down-exception) + (define-key map (kbd "TAB") 'py-indent-or-complete) + (define-key map [(meta tab)] 'py-shell-complete) + (define-key map [(control c)(!)] 'py-shell) + (define-key map [(control c)(control t)] 'py-toggle-shell) + ;; electric keys + ;; (define-key map [(:)] 'py-electric-colon) + ;; (define-key map [(\#)] 'py-electric-comment) + ;; (define-key map [(delete)] 'py-electric-delete) + ;; (define-key map [(backspace)] 'py-electric-backspace) + ;; (define-key map [(control backspace)] 'py-hungry-delete-backwards) + ;; (define-key map [(control c) (delete)] 'py-hungry-delete-forward) + ;; (define-key map [(control y)] 'py-electric-yank) + ;; moving point + (define-key map [(control c)(control p)] 'py-backward-statement) + (define-key map [(control c)(control n)] 'py-forward-statement) + (define-key map [(control c)(control u)] 'py-backward-block) + (define-key map [(control c)(control q)] 'py-forward-block) + (define-key map [(control meta a)] 'py-backward-def-or-class) + (define-key map [(control meta e)] 'py-forward-def-or-class) + (define-key map [(control j)] 'py-newline-and-indent) + (define-key map [(super backspace)] 'py-dedent) + ;; (define-key map [(control return)] 'py-newline-and-dedent) + ;; indentation level modifiers + (define-key map [(control c)(control l)] 'comint-dynamic-list-input-ring) + (define-key map [(control c)(control r)] 'comint-previous-prompt) + (define-key map [(control c)(<)] 'py-shift-left) + (define-key map [(control c)(>)] 'py-shift-right) + (define-key map [(control c)(tab)] 'py-indent-region) + (define-key map [(control c)(:)] 'py-guess-indent-offset) + ;; subprocess commands + (define-key map [(control meta h)] 'py-mark-def-or-class) + (define-key map [(control c)(control k)] 'py-mark-block-or-clause) + (define-key map [(control c)(.)] 'py-expression) + ;; Miscellaneous + ;; (define-key map [(super q)] 'py-copy-statement) + (define-key map [(control c)(control d)] 'py-pdbtrack-toggle-stack-tracking) + (define-key map [(control c)(\#)] 'py-comment-region) + (define-key map [(control c)(\?)] 'py-describe-mode) + (define-key map [(control c)(control e)] 'py-help-at-point) + (define-key map [(control x) (n) (d)] 'py-narrow-to-defun) + ;; information + (define-key map [(control c)(control b)] 'py-submit-bug-report) + (define-key map [(control c)(control v)] 'py-version) + (define-key map [(control c)(control w)] 'py-pychecker-run) + (substitute-key-definition 'complete-symbol 'completion-at-point + map global-map) + (substitute-key-definition 'backward-up-list 'py-up + map global-map) + (substitute-key-definition 'down-list 'py-down + map global-map) + map) + "Used inside a Python-shell.") + +(defvar py-ipython-shell-mode-map py-python-shell-mode-map + "Unless setting of ipython-shell-mode needs to be different, let's save some lines of code and copy ‘py-python-shell-mode-map’ here.") + +(defvar py-shell-map py-python-shell-mode-map) + +(setq python-font-lock-keywords + ;; Keywords + `(,(rx symbol-start + (or + "if" "and" "del" "not" "while" "as" "elif" "global" + "or" "async with" "with" "assert" "else" "pass" "yield" "break" + "exec" "in" "continue" "finally" "is" "except" "raise" + "return" "async for" "for" "lambda" "await") + symbol-end) + (,(rx symbol-start (or "async def" "def" "class") symbol-end) . py-def-class-face) + (,(rx symbol-start (or "import" "from") symbol-end) . py-import-from-face) + (,(rx symbol-start (or "try" "if") symbol-end) . py-try-if-face) + ;; functions + (,(rx symbol-start "def" (1+ space) (group (1+ (or word ?_)))) + (1 font-lock-function-name-face)) + (,(rx symbol-start "async def" (1+ space) (group (1+ (or word ?_)))) + (1 font-lock-function-name-face)) + ;; classes + (,(rx symbol-start (group "class") (1+ space) (group (1+ (or word ?_)))) + (1 py-def-class-face) (2 py-class-name-face)) + (,(rx symbol-start + (or "Ellipsis" "True" "False" "None" "__debug__" "NotImplemented") + symbol-end) . py-pseudo-keyword-face) + ;; Decorators. + (,(rx line-start (* (any " \t")) (group "@" (1+ (or word ?_)) + (0+ "." (1+ (or word ?_))))) + (1 py-decorators-face)) + (,(rx symbol-start (or "cls" "self") + symbol-end) . py-object-reference-face) + + ;; Exceptions + (,(rx word-start + (or "ArithmeticError" "AssertionError" "AttributeError" + "BaseException" "BufferError" "BytesWarning" "DeprecationWarning" + "EOFError" "EnvironmentError" "Exception" "FloatingPointError" + "FutureWarning" "GeneratorExit" "IOError" "ImportError" + "ImportWarning" "IndentationError" "IndexError" "KeyError" + "KeyboardInterrupt" "LookupError" "MemoryError" "NameError" "NoResultFound" + "NotImplementedError" "OSError" "OverflowError" + "PendingDeprecationWarning" "ReferenceError" "RuntimeError" + "RuntimeWarning" "StandardError" "StopIteration" "SyntaxError" + "SyntaxWarning" "SystemError" "SystemExit" "TabError" "TypeError" + "UnboundLocalError" "UnicodeDecodeError" "UnicodeEncodeError" + "UnicodeError" "UnicodeTranslateError" "UnicodeWarning" + "UserWarning" "ValueError" "Warning" "ZeroDivisionError" + ;; OSError subclasses + "BlockIOError" "ChildProcessError" "ConnectionError" + "BrokenPipError" "ConnectionAbortedError" + "ConnectionRefusedError" "ConnectionResetError" + "FileExistsError" "FileNotFoundError" "InterruptedError" + "IsADirectoryError" "NotADirectoryError" "PermissionError" + "ProcessLookupError" "TimeoutError") + word-end) . py-exception-name-face) + ;; Builtins + (,(rx + (or space line-start (not (any ".("))) + symbol-start + (group (or "_" "__doc__" "__import__" "__name__" "__package__" "abs" "all" + "any" "apply" "basestring" "bin" "bool" "buffer" "bytearray" + "bytes" "callable" "chr" "classmethod" "cmp" "coerce" "compile" + "complex" "delattr" "dict" "dir" "divmod" "enumerate" "eval" + "execfile" "filter" "float" "format" "frozenset" + "getattr" "globals" "hasattr" "hash" "help" "hex" "id" "input" + "int" "intern" "isinstance" "issubclass" "iter" "len" "list" + "locals" "long" "map" "max" "min" "next" "object" "oct" "open" + "ord" "pow" "property" "range" "raw_input" "reduce" + "reload" "repr" "reversed" "round" "set" "setattr" "slice" + "sorted" "staticmethod" "str" "sum" "super" "tuple" "type" + "unichr" "unicode" "vars" "xrange" "zip")) + symbol-end) (1 py-builtins-face)) + ("\\([._[:word:]]+\\)\\(?:\\[[^]]+]\\)?[[:space:]]*\\(?:\\(?:\\*\\*\\|//\\|<<\\|>>\\|[%&*+/|^-]\\)?=\\)" + (1 py-variable-name-face nil nil)) + ;; a, b, c = (1, 2, 3) + (,(lambda (limit) + (let ((re (rx (group (+ (any word ?. ?_))) (* space) + (* ?, (* space) (+ (any word ?. ?_)) (* space)) + ?, (* space) (+ (any word ?. ?_)) (* space) + (or "=" "+=" "-=" "*=" "/=" "//=" "%=" "**=" ">>=" "<<=" "&=" "^=" "|="))) + (res nil)) + (while (and (setq res (re-search-forward re limit t)) + (goto-char (match-end 1)) + (nth 1 (parse-partial-sexp (point-min) (point))) + ;; (python-syntax-context 'paren) + )) + res)) + (1 py-variable-name-face nil nil)) + ;; Numbers + ;; (,(rx symbol-start (or (1+ digit) (1+ hex-digit)) symbol-end) . py-number-face) + (,(rx symbol-start (1+ digit) symbol-end) . py-number-face))) + +;; python-components-switches + +;; Smart indentation +(defalias 'toggle-py-smart-indentation 'py-toggle-smart-indentation) +(defun py-toggle-smart-indentation (&optional arg) + "Toggle `py-smart-indentation' - on with positiv ARG. + +Returns value of `py-smart-indentation' switched to." + (interactive) + (let ((arg (or arg (if py-smart-indentation -1 1)))) + (if (< 0 arg) + (progn + (setq py-smart-indentation t) + (py-guess-indent-offset)) + (setq py-smart-indentation nil) + (setq py-indent-offset (default-value 'py-indent-offset))) + (when (called-interactively-p 'any) (message "py-smart-indentation: %s" py-smart-indentation)) + py-smart-indentation)) + +(defun py-smart-indentation-on (&optional arg) + "Toggle`py-smart-indentation' - on with positive ARG. + +Returns value of `py-smart-indentation'." + (interactive "p") + (let ((arg (or arg 1))) + (toggle-py-smart-indentation arg)) + (when (called-interactively-p 'any) (message "py-smart-indentation: %s" py-smart-indentation)) + py-smart-indentation) + +(defun py-smart-indentation-off (&optional arg) + "Toggle `py-smart-indentation' according to ARG. + +Returns value of `py-smart-indentation'." + (interactive "p") + (let ((arg (if arg (- arg) -1))) + (toggle-py-smart-indentation arg)) + (when (called-interactively-p 'any) (message "py-smart-indentation: %s" py-smart-indentation)) + py-smart-indentation) + +(defun py-toggle-sexp-function () + "Opens customization." + (interactive) + (customize-variable 'py-sexp-function)) + +;; Autopair mode +;; py-autopair-mode forms +(defalias 'toggle-py-autopair-mode 'py-toggle-autopair-mode) +(defun py-toggle-autopair-mode () + "If `py-autopair-mode' should be on or off. + + Returns value of `py-autopair-mode' switched to." + (interactive) + (and (py-autopair-check) + (setq py-autopair-mode (autopair-mode (if autopair-mode 0 1))))) + +(defun py-autopair-mode-on () + "Make sure, py-autopair-mode' is on. + +Returns value of `py-autopair-mode'." + (interactive) + (and (py-autopair-check) + (setq py-autopair-mode (autopair-mode 1)))) + +(defun py-autopair-mode-off () + "Make sure, py-autopair-mode' is off. + +Returns value of `py-autopair-mode'." + (interactive) + (setq py-autopair-mode (autopair-mode 0))) + +;; py-switch-buffers-on-execute-p forms +(defun toggle-py-switch-buffers-on-execute-p (&optional arg) + "Toggle `py-switch-buffers-on-execute-p' according to ARG. + + Returns value of `py-switch-buffers-on-execute-p' switched to." + (interactive) + (let ((arg (or arg (if py-switch-buffers-on-execute-p -1 1)))) + (if (< 0 arg) + (setq py-switch-buffers-on-execute-p t) + (setq py-switch-buffers-on-execute-p nil)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-switch-buffers-on-execute-p: %s" py-switch-buffers-on-execute-p)) + py-switch-buffers-on-execute-p)) + +(defun py-switch-buffers-on-execute-p-on (&optional arg) + "Toggle `py-py-switch-buffers-on-execute-p' according to ARG. + +Returns value of `py-switch-buffers-on-execute-p'." + (interactive) + (let ((arg (or arg 1))) + (toggle-py-switch-buffers-on-execute-p arg)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-switch-buffers-on-execute-p: %s" py-switch-buffers-on-execute-p)) + py-switch-buffers-on-execute-p) + +(defun py-switch-buffers-on-execute-p-off () + "Make sure, `py-switch-buffers-on-execute-p' is off. + +Returns value of `py-switch-buffers-on-execute-p'." + (interactive) + (toggle-py-switch-buffers-on-execute-p -1) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-switch-buffers-on-execute-p: %s" py-switch-buffers-on-execute-p)) + py-switch-buffers-on-execute-p) + +;; py-split-window-on-execute forms +(defun toggle-py-split-window-on-execute (&optional arg) + "Toggle `py-split-window-on-execute' according to ARG. + + Returns value of `py-split-window-on-execute' switched to." + (interactive) + (let ((arg (or arg (if py-split-window-on-execute -1 1)))) + (if (< 0 arg) + (setq py-split-window-on-execute t) + (setq py-split-window-on-execute nil)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-split-window-on-execute: %s" py-split-window-on-execute)) + py-split-window-on-execute)) + +(defun py-split-window-on-execute-on (&optional arg) + "Toggle `py-py-split-window-on-execute' according to ARG. + +Returns value of `py-split-window-on-execute'." + (interactive) + (let ((arg (or arg 1))) + (toggle-py-split-window-on-execute arg)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-split-window-on-execute: %s" py-split-window-on-execute)) + py-split-window-on-execute) + +(defun py-split-window-on-execute-off () + "Make sure, `py-split-window-on-execute' is off. + +Returns value of `py-split-window-on-execute'." + (interactive) + (toggle-py-split-window-on-execute -1) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-split-window-on-execute: %s" py-split-window-on-execute)) + py-split-window-on-execute) + +;; py-fontify-shell-buffer-p forms +(defun toggle-py-fontify-shell-buffer-p (&optional arg) + "Toggle `py-fontify-shell-buffer-p' according to ARG. + + Returns value of `py-fontify-shell-buffer-p' switched to." + (interactive) + (let ((arg (or arg (if py-fontify-shell-buffer-p -1 1)))) + (if (< 0 arg) + (progn + (setq py-fontify-shell-buffer-p t) + (set (make-local-variable 'font-lock-defaults) + '(python-font-lock-keywords nil nil nil nil + (font-lock-syntactic-keywords + . py-font-lock-syntactic-keywords))) + (unless (looking-at comint-prompt-regexp) + (when (re-search-backward comint-prompt-regexp nil t 1) + (font-lock-fontify-region (line-beginning-position) (point-max))))) + (setq py-fontify-shell-buffer-p nil)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-fontify-shell-buffer-p: %s" py-fontify-shell-buffer-p)) + py-fontify-shell-buffer-p)) + +(defun py-fontify-shell-buffer-p-on (&optional arg) + "Toggle `py-py-fontify-shell-buffer-p' according to ARG. + +Returns value of `py-fontify-shell-buffer-p'." + (interactive) + (let ((arg (or arg 1))) + (toggle-py-fontify-shell-buffer-p arg)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-fontify-shell-buffer-p: %s" py-fontify-shell-buffer-p)) + py-fontify-shell-buffer-p) + +(defun py-fontify-shell-buffer-p-off () + "Make sure, `py-fontify-shell-buffer-p' is off. + +Returns value of `py-fontify-shell-buffer-p'." + (interactive) + (toggle-py-fontify-shell-buffer-p -1) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-fontify-shell-buffer-p: %s" py-fontify-shell-buffer-p)) + py-fontify-shell-buffer-p) + +;; python-mode-v5-behavior-p forms +(defun toggle-python-mode-v5-behavior-p (&optional arg) + "Toggle `python-mode-v5-behavior-p' according to ARG. + + Returns value of `python-mode-v5-behavior-p' switched to." + (interactive) + (let ((arg (or arg (if python-mode-v5-behavior-p -1 1)))) + (if (< 0 arg) + (setq python-mode-v5-behavior-p t) + (setq python-mode-v5-behavior-p nil)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "python-mode-v5-behavior-p: %s" python-mode-v5-behavior-p)) + python-mode-v5-behavior-p)) + +(defun python-mode-v5-behavior-p-on (&optional arg) + "To `python-mode-v5-behavior-p' according to ARG. + +Returns value of `python-mode-v5-behavior-p'." + (interactive) + (let ((arg (or arg 1))) + (toggle-python-mode-v5-behavior-p arg)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "python-mode-v5-behavior-p: %s" python-mode-v5-behavior-p)) + python-mode-v5-behavior-p) + +(defun python-mode-v5-behavior-p-off () + "Make sure, `python-mode-v5-behavior-p' is off. + +Returns value of `python-mode-v5-behavior-p'." + (interactive) + (toggle-python-mode-v5-behavior-p -1) + (when (or py-verbose-p (called-interactively-p 'any)) (message "python-mode-v5-behavior-p: %s" python-mode-v5-behavior-p)) + python-mode-v5-behavior-p) + +;; py-jump-on-exception forms +(defun toggle-py-jump-on-exception (&optional arg) + "Toggle `py-jump-on-exception' according to ARG. + + Returns value of `py-jump-on-exception' switched to." + (interactive) + (let ((arg (or arg (if py-jump-on-exception -1 1)))) + (if (< 0 arg) + (setq py-jump-on-exception t) + (setq py-jump-on-exception nil)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-jump-on-exception: %s" py-jump-on-exception)) + py-jump-on-exception)) + +(defun py-jump-on-exception-on (&optional arg) + "Toggle py-jump-on-exception' according to ARG. + +Returns value of `py-jump-on-exception'." + (interactive) + (let ((arg (or arg 1))) + (toggle-py-jump-on-exception arg)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-jump-on-exception: %s" py-jump-on-exception)) + py-jump-on-exception) + +(defun py-jump-on-exception-off () + "Make sure, `py-jump-on-exception' is off. + +Returns value of `py-jump-on-exception'." + (interactive) + (toggle-py-jump-on-exception -1) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-jump-on-exception: %s" py-jump-on-exception)) + py-jump-on-exception) + +;; py-use-current-dir-when-execute-p forms +(defun toggle-py-use-current-dir-when-execute-p (&optional arg) + "Toggle `py-use-current-dir-when-execute-p' according to ARG. + + Returns value of `py-use-current-dir-when-execute-p' switched to." + (interactive) + (let ((arg (or arg (if py-use-current-dir-when-execute-p -1 1)))) + (if (< 0 arg) + (setq py-use-current-dir-when-execute-p t) + (setq py-use-current-dir-when-execute-p nil)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-use-current-dir-when-execute-p: %s" py-use-current-dir-when-execute-p)) + py-use-current-dir-when-execute-p)) + +(defun py-use-current-dir-when-execute-p-on (&optional arg) + "Toggle py-use-current-dir-when-execute-p' according to ARG. + +Returns value of `py-use-current-dir-when-execute-p'." + (interactive) + (let ((arg (or arg 1))) + (toggle-py-use-current-dir-when-execute-p arg)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-use-current-dir-when-execute-p: %s" py-use-current-dir-when-execute-p)) + py-use-current-dir-when-execute-p) + +(defun py-use-current-dir-when-execute-p-off () + "Make sure, `py-use-current-dir-when-execute-p' is off. + +Returns value of `py-use-current-dir-when-execute-p'." + (interactive) + (toggle-py-use-current-dir-when-execute-p -1) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-use-current-dir-when-execute-p: %s" py-use-current-dir-when-execute-p)) + py-use-current-dir-when-execute-p) + +;; py-electric-comment-p forms +(defun toggle-py-electric-comment-p (&optional arg) + "Toggle `py-electric-comment-p' according to ARG. + + Returns value of `py-electric-comment-p' switched to." + (interactive) + (let ((arg (or arg (if py-electric-comment-p -1 1)))) + (if (< 0 arg) + (setq py-electric-comment-p t) + (setq py-electric-comment-p nil)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-electric-comment-p: %s" py-electric-comment-p)) + py-electric-comment-p)) + +(defun py-electric-comment-p-on (&optional arg) + "Toggle py-electric-comment-p' according to ARG. + +Returns value of `py-electric-comment-p'." + (interactive) + (let ((arg (or arg 1))) + (toggle-py-electric-comment-p arg)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-electric-comment-p: %s" py-electric-comment-p)) + py-electric-comment-p) + +(defun py-electric-comment-p-off () + "Make sure, `py-electric-comment-p' is off. + +Returns value of `py-electric-comment-p'." + (interactive) + (toggle-py-electric-comment-p -1) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-electric-comment-p: %s" py-electric-comment-p)) + py-electric-comment-p) + +;; py-underscore-word-syntax-p forms +(defun toggle-py-underscore-word-syntax-p (&optional arg) + "Toggle `py-underscore-word-syntax-p' according to ARG. + + Returns value of `py-underscore-word-syntax-p' switched to." + (interactive) + (let ((arg (or arg (if py-underscore-word-syntax-p -1 1)))) + (if (< 0 arg) + (progn + (setq py-underscore-word-syntax-p t) + (modify-syntax-entry ?\_ "w" python-mode-syntax-table)) + (setq py-underscore-word-syntax-p nil) + (modify-syntax-entry ?\_ "_" python-mode-syntax-table)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-underscore-word-syntax-p: %s" py-underscore-word-syntax-p)) + py-underscore-word-syntax-p)) + +(defun py-underscore-word-syntax-p-on (&optional arg) + "Toggle py-underscore-word-syntax-p' according to ARG. + +Returns value of `py-underscore-word-syntax-p'." + (interactive) + (let ((arg (or arg 1))) + (toggle-py-underscore-word-syntax-p arg)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-underscore-word-syntax-p: %s" py-underscore-word-syntax-p)) + py-underscore-word-syntax-p) + +(defun py-underscore-word-syntax-p-off () + "Make sure, `py-underscore-word-syntax-p' is off. + +Returns value of `py-underscore-word-syntax-p'." + (interactive) + (toggle-py-underscore-word-syntax-p -1) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-underscore-word-syntax-p: %s" py-underscore-word-syntax-p)) + py-underscore-word-syntax-p) + +;; toggle-py-underscore-word-syntax-p must be known already +;; circular: toggle-py-underscore-word-syntax-p sets and calls it +(defcustom py-underscore-word-syntax-p t + "If underscore chars should be of ‘syntax-class’ word. + +I.e. not of `symbol'. + +Underscores in word-class like `forward-word' travel the indentifiers. +Default is t. + +See bug report at launchpad, lp:940812" + :type 'boolean + :tag "py-underscore-word-syntax-p" + :group 'python-mode + :set (lambda (symbol value) + (set-default symbol value) + (toggle-py-underscore-word-syntax-p (if value 1 0)))) + +;; python-components-edit +(defvar py-keywords "\\<\\(ArithmeticError\\|AssertionError\\|AttributeError\\|BaseException\\|BufferError\\|BytesWarning\\|DeprecationWarning\\|EOFError\\|Ellipsis\\|EnvironmentError\\|Exception\\|False\\|FloatingPointError\\|FutureWarning\\|GeneratorExit\\|IOError\\|ImportError\\|ImportWarning\\|IndentationError\\|IndexError\\|KeyError\\|KeyboardInterrupt\\|LookupError\\|MemoryError\\|NameError\\|NoneNotImplementedError\\|NotImplemented\\|OSError\\|OverflowError\\|PendingDeprecationWarning\\|ReferenceError\\|RuntimeError\\|RuntimeWarning\\|StandardError\\|StopIteration\\|SyntaxError\\|SyntaxWarning\\|SystemError\\|SystemExit\\|TabError\\|True\\|TypeError\\|UnboundLocalError\\|UnicodeDecodeError\\|UnicodeEncodeError\\|UnicodeError\\|UnicodeTranslateError\\|UnicodeWarning\\|UserWarning\\|ValueError\\|Warning\\|ZeroDivisionError\\|__debug__\\|__import__\\|__name__\\|abs\\|all\\|and\\|any\\|apply\\|as\\|assert\\|basestring\\|bin\\|bool\\|break\\|buffer\\|bytearray\\|callable\\|chr\\|class\\|classmethod\\|cmp\\|coerce\\|compile\\|complex\\|continue\\|copyright\\|credits\\|def\\|del\\|delattr\\|dict\\|dir\\|divmod\\|elif\\|else\\|enumerate\\|eval\\|except\\|exec\\|execfile\\|exit\\|file\\|filter\\|float\\|for\\|format\\|from\\|getattr\\|global\\|globals\\|hasattr\\|hash\\|help\\|hex\\|id\\|if\\|import\\|in\\|input\\|int\\|intern\\|is\\|isinstance\\|issubclass\\|iter\\|lambda\\|len\\|license\\|list\\|locals\\|long\\|map\\|max\\|memoryview\\|min\\|next\\|not\\|object\\|oct\\|open\\|or\\|ord\\|pass\\|pow\\|print\\|property\\|quit\\|raise\\|range\\|raw_input\\|reduce\\|reload\\|repr\\|return\\|round\\|set\\|setattr\\|slice\\|sorted\\|staticmethod\\|str\\|sum\\|super\\|tuple\\|type\\|unichr\\|unicode\\|vars\\|while\\|with\\|xrange\\|yield\\|zip\\|\\)\\>" + "Contents like py-fond-lock-keyword.") + +;; ; +(defun py-insert-default-shebang () + "Insert in buffer shebang of installed default Python." + (interactive "*") + (let* ((erg (if py-edit-only-p + py-shell-name + (executable-find py-shell-name))) + (sheb (concat "#! " erg))) + (insert sheb))) + +(defun py--top-level-form-p () + "Return non-nil, if line start with a top level definition. + +Used by `py-electric-colon', which will not indent than." + (let (erg) + (save-excursion + (beginning-of-line) + (setq erg (or (looking-at py-class-re) + (looking-at py-def-re)))) + erg)) + + +(defun py-indent-line-outmost (&optional arg) + "Indent the current line to the outmost reasonable indent. + +With optional \\[universal-argument] ARG an indent with length `py-indent-offset' is inserted unconditionally" + (interactive "*P") + (let* ((need (py-compute-indentation (point))) + (cui (current-indentation)) + (cuc (current-column))) + (cond ((eq 4 (prefix-numeric-value arg)) + (if indent-tabs-mode + (insert (make-string 1 9)) + (insert (make-string py-indent-offset 32)))) + (t + (if (and (eq need cui)(not (eq cuc cui))) + (back-to-indentation) + (beginning-of-line) + (delete-horizontal-space) + (indent-to need)))))) + +(defun py--indent-fix-region-intern (beg end) + "Used when `py-tab-indents-region-p' is non-nil. + +Requires BEG, END as the boundery of region" + (let () + (save-excursion + (save-restriction + (beginning-of-line) + (narrow-to-region beg end) + (forward-line 1) + (narrow-to-region (line-beginning-position) end) + (beginning-of-line) + (delete-region (point) (progn (skip-chars-forward " \t\r\n\f") (point))) + (indent-to (py-compute-indentation)) + (while + (< (line-end-position) end) + (forward-line 1) + (beginning-of-line) + (delete-region (point) (progn (skip-chars-forward " \t\r\n\f") (point))) + (indent-to (py-compute-indentation))))))) + +(defun py--indent-line-intern (need cui indent col &optional beg end region) + (let (erg) + (if py-tab-indent + (progn + (and py-tab-indents-region-p region + (py--indent-fix-region-intern beg end)) + (cond + ((bolp) + (if (and py-tab-shifts-region-p region) + (progn + (while (< (current-indentation) need) + (py-shift-region-right 1))) + (beginning-of-line) + (delete-horizontal-space) + (indent-to need))) + ((< need cui) + (if (and py-tab-shifts-region-p region) + (progn + (when (eq (point) (region-end)) + (exchange-point-and-mark)) + (while (< 0 (current-indentation)) + (py-shift-region-left 1))) + (beginning-of-line) + (delete-horizontal-space) + (indent-to need))) + ((eq need cui) + (if (or (eq this-command last-command) + (eq this-command 'py-indent-line)) + (if (and py-tab-shifts-region-p region) + (while (and (goto-char beg) (< 0 (current-indentation))) + (py-shift-region-left 1)) + (beginning-of-line) + (delete-horizontal-space) + (if (<= (line-beginning-position) (+ (point) (- col cui))) + (forward-char (- col cui)) + (beginning-of-line))))) + ((< cui need) + (if (and py-tab-shifts-region-p region) + (progn + (py-shift-region-right 1)) + (progn + (beginning-of-line) + (delete-horizontal-space) + ;; indent one indent only if goal < need + (setq erg (+ (* (/ cui indent) indent) indent)) + (if (< need erg) + (indent-to need) + (indent-to erg)) + (forward-char (- col cui))))) + (t + (if (and py-tab-shifts-region-p region) + (progn + (while (< (current-indentation) need) + (py-shift-region-right 1))) + (beginning-of-line) + (delete-horizontal-space) + (indent-to need) + (back-to-indentation) + (if (<= (line-beginning-position) (+ (point) (- col cui))) + (forward-char (- col cui)) + (beginning-of-line)))))) + (insert-tab)))) + +(defun py--indent-line-base (beg end region cui need arg this-indent-offset col) + (cond ((eq 4 (prefix-numeric-value arg)) + (if (and (eq cui (current-indentation)) + (<= need cui)) + (if indent-tabs-mode (insert "\t")(insert (make-string py-indent-offset 32))) + (beginning-of-line) + (delete-horizontal-space) + (indent-to (+ need py-indent-offset)))) + ((not (eq 1 (prefix-numeric-value arg))) + (py-smart-indentation-off) + (py--indent-line-intern need cui this-indent-offset col beg end region)) + (t (py--indent-line-intern need cui this-indent-offset col beg end region)))) + +(defun py--calculate-indent-backwards (cui indent-offset) + "Return the next reasonable indent lower than current indentation. + +Requires current indent as CUI +Requires current indent-offset as INDENT-OFFSET" + (if (< 0 (% cui py-indent-offset)) + ;; not correctly indented at all + (/ cui indent-offset) + (- cui indent-offset))) + +(defun py-indent-line (&optional arg outmost-only) + "Indent the current line according ARG. + +When called interactivly with \\[universal-argument], +ignore dedenting rules for block closing statements +\(e.g. return, raise, break, continue, pass) + +An optional \\[universal-argument] followed by a numeric argument +neither 1 nor 4 will switch off `py-smart-indentation' for this execution. +This permits to correct allowed but unwanted indents. Similar to +`toggle-py-smart-indentation' resp. `py-smart-indentation-off' followed by TAB. + +This function is normally used by `indent-line-function' resp. +\\[indent-for-tab-command]. + +When bound to TAB, \\[quoted-insert] TAB inserts a TAB. + +OUTMOST-ONLY stops circling possible indent. + +When `py-tab-shifts-region-p' is t, not just the current line, +but the region is shiftet that way. + +If `py-tab-indents-region-p' is t and first TAB doesn't shift +--as indent is at outmost reasonable--, ‘indent-region’ is called. + +\\[quoted-insert] TAB inserts a literal TAB-character." + (interactive "P") + (unless (eq this-command last-command) + (setq py-already-guessed-indent-offset nil)) + (let ((orig (copy-marker (point))) + ;; TAB-leaves-point-in-the-wrong-lp-1178453-test + (region (use-region-p)) + cui + outmost + col + beg + end + need + this-indent-offset) + (and region + (setq beg (region-beginning)) + (setq end (region-end)) + (goto-char beg)) + (setq cui (current-indentation)) + (setq col (current-column)) + (setq this-indent-offset + (cond ((and py-smart-indentation (not (eq this-command last-command))) + (py-guess-indent-offset)) + ((and py-smart-indentation (eq this-command last-command) py-already-guessed-indent-offset) + py-already-guessed-indent-offset) + (t (default-value 'py-indent-offset)))) + (setq outmost (py-compute-indentation nil nil nil nil nil nil this-indent-offset)) + ;; now choose the indent + (setq need + (cond ((eq this-command last-command) + (if (eq cui outmost) + (when (not outmost-only) + (py--calculate-indent-backwards cui this-indent-offset))) + (if (bolp) + (py-compute-indentation orig) + (py--calculate-indent-backwards cui this-indent-offset))) + (t + outmost + ;; (py-compute-indentation orig) + ))) + (when (and (called-interactively-p 'any) py-verbose-p) (message "py-indent-line, need: %s" need)) + ;; if at outmost + ;; and not (eq this-command last-command), need remains nil + (when need + (py--indent-line-base beg end region cui need arg this-indent-offset col) + (and region (or py-tab-shifts-region-p + py-tab-indents-region-p) + (not (eq (point) orig)) + (exchange-point-and-mark)) + (when (and (called-interactively-p 'any) py-verbose-p)(message "%s" (current-indentation))) + (current-indentation)))) + +(defun py--delete-trailing-whitespace (orig) + "Delete trailing whitespace. + +Either `py-newline-delete-trailing-whitespace-p' +or ` +py-trailing-whitespace-smart-delete-p' must be t. + +Start from position ORIG" + (when (or py-newline-delete-trailing-whitespace-p py-trailing-whitespace-smart-delete-p) + (let ((pos (copy-marker (point)))) + (save-excursion + (goto-char orig) + (if (empty-line-p) + (if (py---emacs-version-greater-23) + (delete-trailing-whitespace (line-beginning-position) pos) + (save-restriction + (narrow-to-region (line-beginning-position) pos) + (delete-trailing-whitespace))) + (skip-chars-backward " \t") + (if (py---emacs-version-greater-23) + (delete-trailing-whitespace (line-beginning-position) pos) + (save-restriction + (narrow-to-region (point) pos) + (delete-trailing-whitespace)))))))) + +(defun py-newline-and-indent () + "Add a newline and indent to outmost reasonable indent. +When indent is set back manually, this is honoured in following lines." + (interactive "*") + (let* ((orig (point)) + ;; lp:1280982, deliberatly dedented by user + (this-dedent + (when (and (or (eq 10 (char-after))(eobp))(looking-back "^[ \t]*" (line-beginning-position))) + (current-column))) + erg) + (newline) + (py--delete-trailing-whitespace orig) + (setq erg + (cond (this-dedent + (indent-to-column this-dedent)) + ((and py-empty-line-closes-p (or (eq this-command last-command)(py--after-empty-line))) + (indent-to-column (save-excursion (py-backward-statement)(- (current-indentation) py-indent-offset)))) + (t + (fixup-whitespace) + (indent-to-column (py-compute-indentation))))) + (when (and (called-interactively-p 'any) py-verbose-p) (message "%s" erg)) + erg)) + +(defalias 'py-newline-and-close-block 'py-newline-and-dedent) +(defun py-newline-and-dedent () + "Add a newline and indent to one level below current. +Returns column." + (interactive "*") + (let ((cui (current-indentation)) + erg) + (newline) + (when (< 0 cui) + (setq erg (- (py-compute-indentation) py-indent-offset)) + (indent-to-column erg)) + (when (and (called-interactively-p 'any) py-verbose-p) (message "%s" erg)) + erg)) + +(defun py-toggle-indent-tabs-mode () + "Toggle `indent-tabs-mode'. + +Returns value of `indent-tabs-mode' switched to." + (interactive) + (when + (setq indent-tabs-mode (not indent-tabs-mode)) + (setq tab-width py-indent-offset)) + (when (and py-verbose-p (called-interactively-p 'any)) (message "indent-tabs-mode %s py-indent-offset %s" indent-tabs-mode py-indent-offset)) + indent-tabs-mode) + +(defun py-indent-tabs-mode (arg &optional iact) + "With positive ARG switch `indent-tabs-mode' on. + +With negative ARG switch `indent-tabs-mode' off. +Returns value of `indent-tabs-mode' switched to. + +If IACT is provided, message result" + (interactive "p") + (if (< 0 arg) + (progn + (setq indent-tabs-mode t) + (setq tab-width py-indent-offset)) + (setq indent-tabs-mode nil)) + (when (and py-verbose-p (or iact (called-interactively-p 'any))) (message "indent-tabs-mode %s py-indent-offset %s" indent-tabs-mode py-indent-offset)) + indent-tabs-mode) + +(defun py-indent-tabs-mode-on (arg) + "Switch `indent-tabs-mode' according to ARG." + (interactive "p") + (py-indent-tabs-mode (abs arg)(called-interactively-p 'any))) + +(defun py-indent-tabs-mode-off (arg) + "Switch `indent-tabs-mode' according to ARG." + (interactive "p") + (py-indent-tabs-mode (- (abs arg))(called-interactively-p 'any))) + +;; Guess indent offset +(defun py-guessed-sanity-check (guessed) + (and (>= guessed 2)(<= guessed 8)(eq 0 (% guessed 2)))) + +(defun py--guess-indent-final (indents) + "Calculate and do sanity-check. + +Expects INDENTS, a cons" + (let* ((first (car indents)) + (second (cadr indents)) + (erg (if (and first second) + (if (< second first) + (- first second) + (- second first)) + (default-value 'py-indent-offset)))) + (setq erg (and (py-guessed-sanity-check erg) erg)) + erg)) + +(defun py--guess-indent-forward () + "Called when moving to end of a form and `py-smart-indentation' is on." + (let* ((first (if + (py--beginning-of-statement-p) + (current-indentation) + (progn + (py-forward-statement) + (py-backward-statement) + (current-indentation)))) + (second (if (or (looking-at py-extended-block-or-clause-re)(eq 0 first)) + (progn + (py-forward-statement) + (py-forward-statement) + (py-backward-statement) + (current-indentation)) + ;; when not starting from block, look above + (while (and (re-search-backward py-extended-block-or-clause-re nil 'movet 1) + (or (>= (current-indentation) first) + (nth 8 (parse-partial-sexp (point-min) (point)))))) + (current-indentation)))) + (list first second))) + +(defun py--guess-indent-backward () + "Called when moving to beginning of a form and `py-smart-indentation' is on." + (let* ((cui (current-indentation)) + (indent (if (< 0 cui) cui 999)) + (pos (progn (while (and (re-search-backward py-extended-block-or-clause-re nil 'move 1) + (or (>= (current-indentation) indent) + (nth 8 (parse-partial-sexp (point-min) (point)))))) + (unless (bobp) (point)))) + (first (and pos (current-indentation))) + (second (and pos (py-forward-statement) (py-forward-statement) (py-backward-statement)(current-indentation)))) + (list first second))) + +(defun py-guess-indent-offset (&optional direction) + "Guess `py-indent-offset'. + +Set local value of `py-indent-offset', return it + +Might change local value of `py-indent-offset' only when called +downwards from beginning of block followed by a statement. +Otherwise ‘default-value’ is returned. +Unless DIRECTION is symbol 'forward, go backward first" + (interactive) + (save-excursion + (let* ((indents + (cond (direction + (if (eq 'forward direction) + (py--guess-indent-forward) + (py--guess-indent-backward))) + ;; guess some usable indent is above current position + ((eq 0 (current-indentation)) + (py--guess-indent-forward)) + (t (py--guess-indent-backward)))) + (erg (py--guess-indent-final indents))) + (if erg (setq py-indent-offset erg) + (setq py-indent-offset + (default-value 'py-indent-offset))) + (when (called-interactively-p 'any) (message "%s" py-indent-offset)) + py-indent-offset))) + +(defun py--comment-indent-function () + "Python version of `comment-indent-function'." + ;; This is required when filladapt is turned off. Without it, when + ;; filladapt is not used, comments which start in column zero + ;; cascade one character to the right + (save-excursion + (beginning-of-line) + (let ((eol (line-end-position))) + (and comment-start-skip + (re-search-forward comment-start-skip eol t) + (setq eol (match-beginning 0))) + (goto-char eol) + (skip-chars-backward " \t") + (max comment-column (+ (current-column) (if (bolp) 0 1)))))) + +;; make general form below work also in these cases +;; (defalias 'py-backward-paragraph 'backward-paragraph) +(defun py-backward-paragraph () + "Go to beginning of current paragraph. + +If already at beginning, go to start of next paragraph upwards" + (interactive) + (let ((erg (and (backward-paragraph)(point)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +;; (defalias 'py-end-of-paragraph 'forward-paragraph) +(defun py-forward-paragraph () + "Go to end of current paragraph. + +If already at end, go to end of next paragraph downwards" + (interactive) + (let ((erg (and (forward-paragraph)(point)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +;; ; +(defun py-indent-and-forward (&optional indent) + "Indent current line according to mode, move one line forward. + +If optional INDENT is given, use it" + (interactive "*") + (beginning-of-line) + (when (member (char-after) (list 32 9 10 12 13)) (delete-region (point) (progn (skip-chars-forward " \t\r\n\f")(point)))) + (indent-to (or indent (py-compute-indentation))) + (if (eobp) + (newline-and-indent) + (forward-line 1)) + (back-to-indentation)) + +(defun py--indent-line-by-line (beg end) + "Indent every line until end to max reasonable extend. + +Starts from second line of region specified +BEG END deliver the boundaries of region to work within" + (goto-char beg) + (py-indent-and-forward) + ;; (forward-line 1) + (while (< (line-end-position) end) + (if (empty-line-p) + (forward-line 1) + (py-indent-and-forward))) + (unless (empty-line-p) (py-indent-and-forward))) + +(defun py-indent-region (beg end) + "Reindent a region delimited by BEG END. + +In case first line accepts an indent, keep the remaining +lines relative. +Otherwise lines in region get outmost indent, +same with optional argument + +In order to shift a chunk of code, where the first line is okay, start with second line." + (interactive "*") + (let ((end (copy-marker end))) + (goto-char beg) + (beginning-of-line) + (setq beg (point)) + (skip-chars-forward " \t\r\n\f") + (py--indent-line-by-line beg end))) + +(defun py--beginning-of-buffer-position () + "Provided for abstract reasons." + (point-min)) + +(defun py--end-of-buffer-position () + "Provided for abstract reasons." + (point-max)) + +;; Declarations start +(defun py--bounds-of-declarations () + "Bounds of consecutive multitude of assigments resp. statements around point. + +Indented same level, which don't open blocks. +Typically declarations resp. initialisations of variables following +a class or function definition. +See also ‘py--bounds-of-statements’" + (let* ((orig-indent (progn + (back-to-indentation) + (unless (py--beginning-of-statement-p) + (py-backward-statement)) + (unless (py--beginning-of-block-p) + (current-indentation)))) + (orig (point)) + last beg end) + (when orig-indent + (setq beg (line-beginning-position)) + ;; look upward first + (while (and + (progn + (unless (py--beginning-of-statement-p) + (py-backward-statement)) + (line-beginning-position)) + (py-backward-statement) + (not (py--beginning-of-block-p)) + (eq (current-indentation) orig-indent)) + (setq beg (line-beginning-position))) + (goto-char orig) + (while (and (setq last (line-end-position)) + (setq end (py-down-statement)) + (not (py--beginning-of-block-p)) + (eq (py-indentation-of-statement) orig-indent))) + (setq end last) + (goto-char beg) + (if (and beg end) + (progn + (when (called-interactively-p 'any) (message "%s %s" beg end)) + (cons beg end)) + (when (called-interactively-p 'any) (message "%s" nil)) + nil)))) + +(defun py-backward-declarations () + "Got to the beginning of assigments resp. statements in current level which don't open blocks." + (interactive) + (let* ((bounds (py--bounds-of-declarations)) + (erg (car bounds))) + (when erg (goto-char erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-declarations () + "Got to the end of assigments resp. statements in current level which don't open blocks." + (interactive) + (let* ((bounds (py--bounds-of-declarations)) + (erg (cdr bounds))) + (when erg (goto-char erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defalias 'py-copy-declarations 'py-declarations) +(defun py-declarations () + "Forms in current level,which don't open blocks or start with a keyword. + +See also `py-statements', which is more general, taking also simple statements starting with a keyword." + (interactive) + (let* ((bounds (py--bounds-of-declarations)) + (beg (car bounds)) + (end (cdr bounds))) + (when (and beg end) + (goto-char beg) + (push-mark) + (goto-char end) + (kill-new (buffer-substring-no-properties beg end)) + (exchange-point-and-mark)))) + +(defun py-kill-declarations () + "Delete variables declared in current level. + +Store deleted variables in ‘kill-ring’" + (interactive "*") + (let* ((bounds (py--bounds-of-declarations)) + (beg (car bounds)) + (end (cdr bounds))) + (when (and beg end) + (goto-char beg) + (push-mark) + (goto-char end) + (kill-new (buffer-substring-no-properties beg end)) + (delete-region beg end)))) +;; Declarations end + +;; Statements start +(defun py--bounds-of-statements () + "Bounds of consecutive multitude of statements around point. + +Indented same level, which don't open blocks." + (interactive) + (let* ((orig-indent (progn + (back-to-indentation) + (unless (py--beginning-of-statement-p) + (py-backward-statement)) + (unless (py--beginning-of-block-p) + (current-indentation)))) + (orig (point)) + last beg end) + (when orig-indent + (setq beg (point)) + (while (and (setq last beg) + (setq beg + (when (py-backward-statement) + (line-beginning-position))) + (not (py-in-string-p)) + (not (py--beginning-of-block-p)) + (eq (current-indentation) orig-indent))) + (setq beg last) + (goto-char orig) + (setq end (line-end-position)) + (while (and (setq last (py--end-of-statement-position)) + (setq end (py-down-statement)) + (not (py--beginning-of-block-p)) + ;; (not (looking-at py-keywords)) + ;; (not (looking-at "pdb\.")) + (not (py-in-string-p)) + (eq (py-indentation-of-statement) orig-indent))) + (setq end last) + (goto-char orig) + (if (and beg end) + (progn + (when (called-interactively-p 'any) (message "%s %s" beg end)) + (cons beg end)) + (when (called-interactively-p 'any) (message "%s" nil)) + nil)))) + +(defun py-backward-statements () + "Got to the beginning of statements in current level which don't open blocks." + (interactive) + (let* ((bounds (py--bounds-of-statements)) + (erg (car bounds))) + (when erg (goto-char erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-statements () + "Got to the end of statements in current level which don't open blocks." + (interactive) + (let* ((bounds (py--bounds-of-statements)) + (erg (cdr bounds))) + (when erg (goto-char erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defalias 'py-copy-statements 'py-statements) +(defun py-statements () + "Copy and mark simple statements in current level which don't open blocks. + +More general than ‘py-declarations’, which would stop at keywords like a print-statement." + (interactive) + (let* ((bounds (py--bounds-of-statements)) + (beg (car bounds)) + (end (cdr bounds))) + (when (and beg end) + (goto-char beg) + (push-mark) + (goto-char end) + (kill-new (buffer-substring-no-properties beg end)) + (exchange-point-and-mark)))) + +(defun py-kill-statements () + "Delete statements declared in current level. + +Store deleted statements in ‘kill-ring’" + (interactive "*") + (let* ((bounds (py--bounds-of-statements)) + (beg (car bounds)) + (end (cdr bounds))) + (when (and beg end) + (kill-new (buffer-substring-no-properties beg end)) + (delete-region beg end)))) + +(defun py--join-words-wrapping (words separator prefix line-length) + (let ((lines ()) + (current-line prefix)) + (while words + (let* ((word (car words)) + (maybe-line (concat current-line word separator))) + (if (> (length maybe-line) line-length) + (setq lines (cons (substring current-line 0 -1) lines) + current-line (concat prefix word separator " ")) + (setq current-line (concat maybe-line " ")))) + (setq words (cdr words))) + (setq lines (cons (substring + current-line 0 (- 0 (length separator) 1)) lines)) + (mapconcat 'identity (nreverse lines) "\n"))) + +(defun py-insert-super () + "Insert a function \"super()\" from current environment. + +As example given in Python v3.1 documentation » The Python Standard Library » + +class C(B): + def method(self, arg): + super().method(arg) # This does the same thing as: + # super(C, self).method(arg) + +Returns the string inserted." + (interactive "*") + (let* ((orig (point)) + (funcname (progn + (py-backward-def) + (when (looking-at (concat py-def-re " *\\([^(]+\\) *(\\(?:[^),]*\\),? *\\([^)]*\\))")) + (match-string-no-properties 2)))) + (args (match-string-no-properties 3)) + (ver (py-which-python)) + classname erg) + (if (< ver 3) + (progn + (py-backward-class) + (when (looking-at (concat py-class-re " *\\([^( ]+\\)")) + (setq classname (match-string-no-properties 2))) + (goto-char orig) + (setq erg (concat "super(" classname ", self)." funcname "(" args ")")) + ;; super(C, self).method(arg)" + (insert erg)) + (goto-char orig) + (setq erg (concat "super()." funcname "(" args ")")) + (insert erg)) + erg)) + +;; Comments +(defun py-delete-comments-in-def-or-class () + "Delete all commented lines in def-or-class at point." + (interactive "*") + (save-excursion + (let ((beg (py--beginning-of-def-or-class-position)) + (end (py--end-of-def-or-class-position))) + (and beg end (py--delete-comments-intern beg end))))) + +(defun py-delete-comments-in-class () + "Delete all commented lines in class at point." + (interactive "*") + (save-excursion + (let ((beg (py--beginning-of-class-position)) + (end (py--end-of-class-position))) + (and beg end (py--delete-comments-intern beg end))))) + +(defun py-delete-comments-in-block () + "Delete all commented lines in block at point." + (interactive "*") + (save-excursion + (let ((beg (py--beginning-of-block-position)) + (end (py--end-of-block-position))) + (and beg end (py--delete-comments-intern beg end))))) + +(defun py-delete-comments-in-region (beg end) + "Delete all commented lines in region delimited by BEG END." + (interactive "r*") + (save-excursion + (py--delete-comments-intern beg end))) + +(defun py--delete-comments-intern (beg end) + (save-restriction + (narrow-to-region beg end) + (goto-char beg) + (while (and (< (line-end-position) end) (not (eobp))) + (beginning-of-line) + (if (looking-at (concat "[ \t]*" comment-start)) + (delete-region (point) (1+ (line-end-position))) + (forward-line 1))))) + +;; Edit docstring +(defun py--edit-docstring-set-vars () + (save-excursion + (setq py--docbeg (when (use-region-p) (region-beginning))) + (setq py--docend (when (use-region-p) (region-end))) + (let ((pps (parse-partial-sexp (point-min) (point)))) + (when (nth 3 pps) + (setq py--docbeg (or py--docbeg (progn (goto-char (nth 8 pps)) + (skip-chars-forward (char-to-string (char-after)))(push-mark)(point)))) + (setq py--docend (or py--docend + (progn (goto-char (nth 8 pps)) + (forward-sexp) + (skip-chars-backward (char-to-string (char-before))) + (point))))) + (setq py--docbeg (copy-marker py--docbeg)) + (setq py--docend (copy-marker py--docend))))) + +(defun py--write-back-docstring () + "When edit is finished, write docstring back to orginal buffer." + (interactive) + (unless (eq (current-buffer) (get-buffer py-edit-docstring-buffer)) + (set-buffer py-edit-docstring-buffer)) + (goto-char (point-min)) + (while (re-search-forward "[\"']" nil t 1) + (or (py-escaped) + (replace-match (concat "\\\\" (match-string-no-properties 0))))) + (jump-to-register py--edit-docstring-register) + ;; (py-restore-window-configuration) + (delete-region py--docbeg py--docend) + (insert-buffer-substring py-edit-docstring-buffer)) + +(defun py-edit-docstring () + "Edit docstring or active region in ‘python-mode’." + (interactive "*") + (save-excursion + (save-restriction + (window-configuration-to-register py--edit-docstring-register) + (setq py--oldbuf (current-buffer)) + (let ((orig (point)) + relpos docstring) + (py--edit-docstring-set-vars) + ;; store relative position in docstring + (setq relpos (1+ (- orig py--docbeg))) + (setq docstring (buffer-substring py--docbeg py--docend)) + (setq py-edit-docstring-orig-pos orig) + (set-buffer (get-buffer-create py-edit-docstring-buffer)) + (erase-buffer) + (switch-to-buffer (current-buffer)) + (insert docstring) + (python-mode) + (local-set-key [(control c)(control c)] 'py--write-back-docstring) + (goto-char relpos) + (message "%s" "Type C-c C-c writes contents back"))))) + +;; python-components-backward-forms + +(defun py-backward-region () + "Go to the beginning of current region." + (interactive) + (let ((beg (region-beginning))) + (when beg (goto-char beg)))) + +(defun py-backward-block (&optional indent) + "Go to beginning of ‘block’ according to INDENT. + +If already at beginning, go one ‘block’ backward. +Return beginning of ‘block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-block-re (called-interactively-p 'any))) + +(defun py-backward-block-or-clause (&optional indent) + "Go to beginning of ‘block-or-clause’ according to INDENT. + +If already at beginning, go one ‘block-or-clause’ backward. +Return beginning of ‘block-or-clause’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-extended-block-or-clause-re (called-interactively-p 'any))) + +;;;###autoload +(defun py-backward-class (&optional indent decorator bol) + "Go to beginning of ‘class’ according to INDENT. + +If already at beginning, go one ‘class’ backward. +Optional DECORATOR BOL + +Return beginning of ‘class’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-class-re (called-interactively-p 'any) decorator bol)) + +(defun py-backward-clause (&optional indent) + "Go to beginning of ‘clause’ according to INDENT. + +If already at beginning, go one ‘clause’ backward. +Return beginning of ‘clause’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-extended-block-or-clause-re (called-interactively-p 'any))) + +;;;###autoload +(defun py-backward-def (&optional indent decorator bol) + "Go to beginning of ‘def’ according to INDENT. + +If already at beginning, go one ‘def’ backward. +Optional DECORATOR BOL + +Return beginning of ‘def’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-def-re (called-interactively-p 'any) decorator bol)) + +;;;###autoload +(defun py-backward-def-or-class (&optional indent decorator bol) + "Go to beginning of ‘def-or-class’ according to INDENT. + +If already at beginning, go one ‘def-or-class’ backward. +Optional DECORATOR BOL + +Return beginning of ‘def-or-class’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-def-or-class-re (called-interactively-p 'any) decorator bol)) + +(defun py-backward-elif-block (&optional indent) + "Go to beginning of ‘elif-block’ according to INDENT. + +If already at beginning, go one ‘elif-block’ backward. +Return beginning of ‘elif-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-elif-block-re (called-interactively-p 'any))) + +(defun py-backward-else-block (&optional indent) + "Go to beginning of ‘else-block’ according to INDENT. + +If already at beginning, go one ‘else-block’ backward. +Return beginning of ‘else-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-else-block-re (called-interactively-p 'any))) + +(defun py-backward-except-block (&optional indent) + "Go to beginning of ‘except-block’ according to INDENT. + +If already at beginning, go one ‘except-block’ backward. +Return beginning of ‘except-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-except-block-re (called-interactively-p 'any))) + +(defun py-backward-for-block (&optional indent) + "Go to beginning of ‘for-block’ according to INDENT. + +If already at beginning, go one ‘for-block’ backward. +Return beginning of ‘for-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-for-block-re (called-interactively-p 'any))) + +(defun py-backward-if-block (&optional indent) + "Go to beginning of ‘if-block’ according to INDENT. + +If already at beginning, go one ‘if-block’ backward. +Return beginning of ‘if-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-if-block-re (called-interactively-p 'any))) + +(defun py-backward-minor-block (&optional indent) + "Go to beginning of ‘minor-block’ according to INDENT. + +If already at beginning, go one ‘minor-block’ backward. +Return beginning of ‘minor-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-minor-block-re (called-interactively-p 'any))) + +(defun py-backward-try-block (&optional indent) + "Go to beginning of ‘try-block’ according to INDENT. + +If already at beginning, go one ‘try-block’ backward. +Return beginning of ‘try-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-try-block-re (called-interactively-p 'any))) + +(defun py-backward-block-bol (&optional indent) + "Go to beginning of ‘block’ according to INDENT, go to BOL. +If already at beginning, go one ‘block’ backward. +Return beginning of ‘block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-block-re (called-interactively-p 'any) nil t)) + +(defun py-backward-block-or-clause-bol (&optional indent) + "Go to beginning of ‘block-or-clause’ according to INDENT, go to BOL. +If already at beginning, go one ‘block-or-clause’ backward. +Return beginning of ‘block-or-clause’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-extended-block-or-clause-re (called-interactively-p 'any) nil t)) + +;;;###autoload +(defun py-backward-class-bol (&optional indent decorator) + "Go to beginning of ‘class’ according to INDENT, go to BOL. +Optional DECORATOR BOL + +If already at beginning, go one ‘class’ backward. +Return beginning of ‘class’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-class-re (called-interactively-p 'any) decorator t)) + +(defun py-backward-clause-bol (&optional indent) + "Go to beginning of ‘clause’ according to INDENT, go to BOL. +If already at beginning, go one ‘clause’ backward. +Return beginning of ‘clause’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-extended-block-or-clause-re (called-interactively-p 'any) nil t)) + +;;;###autoload +(defun py-backward-def-bol (&optional indent decorator) + "Go to beginning of ‘def’ according to INDENT, go to BOL. +Optional DECORATOR BOL + +If already at beginning, go one ‘def’ backward. +Return beginning of ‘def’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-def-re (called-interactively-p 'any) decorator t)) + +;;;###autoload +(defun py-backward-def-or-class-bol (&optional indent decorator) + "Go to beginning of ‘def-or-class’ according to INDENT, go to BOL. +Optional DECORATOR BOL + +If already at beginning, go one ‘def-or-class’ backward. +Return beginning of ‘def-or-class’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-def-or-class-re (called-interactively-p 'any) decorator t)) + +(defun py-backward-elif-block-bol (&optional indent) + "Go to beginning of ‘elif-block’ according to INDENT, go to BOL. +If already at beginning, go one ‘elif-block’ backward. +Return beginning of ‘elif-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-elif-block-re (called-interactively-p 'any) nil t)) + +(defun py-backward-else-block-bol (&optional indent) + "Go to beginning of ‘else-block’ according to INDENT, go to BOL. +If already at beginning, go one ‘else-block’ backward. +Return beginning of ‘else-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-else-block-re (called-interactively-p 'any) nil t)) + +(defun py-backward-except-block-bol (&optional indent) + "Go to beginning of ‘except-block’ according to INDENT, go to BOL. +If already at beginning, go one ‘except-block’ backward. +Return beginning of ‘except-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-except-block-re (called-interactively-p 'any) nil t)) + +(defun py-backward-for-block-bol (&optional indent) + "Go to beginning of ‘for-block’ according to INDENT, go to BOL. +If already at beginning, go one ‘for-block’ backward. +Return beginning of ‘for-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-for-block-re (called-interactively-p 'any) nil t)) + +(defun py-backward-if-block-bol (&optional indent) + "Go to beginning of ‘if-block’ according to INDENT, go to BOL. +If already at beginning, go one ‘if-block’ backward. +Return beginning of ‘if-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-if-block-re (called-interactively-p 'any) nil t)) + +(defun py-backward-minor-block-bol (&optional indent) + "Go to beginning of ‘minor-block’ according to INDENT, go to BOL. +If already at beginning, go one ‘minor-block’ backward. +Return beginning of ‘minor-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-minor-block-re (called-interactively-p 'any) nil t)) + +(defun py-backward-try-block-bol (&optional indent) + "Go to beginning of ‘try-block’ according to INDENT, go to BOL. +If already at beginning, go one ‘try-block’ backward. +Return beginning of ‘try-block’ if successful, nil otherwise" + (interactive) + (py--backward-prepare indent 'py-try-block-re (called-interactively-p 'any) nil t)) + +;; python-components-forward-forms + +(defun py-forward-region () + "Go to the end of current region." + (interactive) + (let ((end (region-end))) + (when end (goto-char end)))) + +(defun py-forward-block (&optional arg decorator bol) + "Go to end of block. + +Return end of block if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-block-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-block-bol () + "Goto beginning of line following end of block. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-block’: down from current definition to next beginning of block below." + (interactive) + (let ((erg (py-forward-block))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-block-or-clause (&optional arg decorator bol) + "Go to end of block-or-clause. + +Return end of block-or-clause if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-block-or-clause-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-block-or-clause-bol () + "Goto beginning of line following end of block-or-clause. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-block-or-clause’: down from current definition to next beginning of block-or-clause below." + (interactive) + (let ((erg (py-forward-block-or-clause))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +;;;###autoload +(defun py-forward-class (&optional arg decorator bol) + "Go to end of class. + +Return end of class if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-class-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-class-bol () + "Goto beginning of line following end of class. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-class’: down from current definition to next beginning of class below." + (interactive) + (let ((erg (py-forward-class))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-clause (&optional arg decorator bol) + "Go to end of clause. + +Return end of clause if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-clause-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-clause-bol () + "Goto beginning of line following end of clause. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-clause’: down from current definition to next beginning of clause below." + (interactive) + (let ((erg (py-forward-clause))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +;;;###autoload +(defun py-forward-def-or-class (&optional arg decorator bol) + "Go to end of def-or-class. + +Return end of def-or-class if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-def-or-class-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-def-or-class-bol () + "Goto beginning of line following end of def-or-class. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-def-or-class’: down from current definition to next beginning of def-or-class below." + (interactive) + (let ((erg (py-forward-def-or-class))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +;;;###autoload +(defun py-forward-def (&optional arg decorator bol) + "Go to end of def. + +Return end of def if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-def-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-def-bol () + "Goto beginning of line following end of def. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-def’: down from current definition to next beginning of def below." + (interactive) + (let ((erg (py-forward-def))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-if-block (&optional arg decorator bol) + "Go to end of if-block. + +Return end of if-block if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-if-block-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-if-block-bol () + "Goto beginning of line following end of if-block. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-if-block’: down from current definition to next beginning of if-block below." + (interactive) + (let ((erg (py-forward-if-block))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-elif-block (&optional arg decorator bol) + "Go to end of elif-block. + +Return end of elif-block if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-elif-block-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-elif-block-bol () + "Goto beginning of line following end of elif-block. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-elif-block’: down from current definition to next beginning of elif-block below." + (interactive) + (let ((erg (py-forward-elif-block))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-else-block (&optional arg decorator bol) + "Go to end of else-block. + +Return end of else-block if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-else-block-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-else-block-bol () + "Goto beginning of line following end of else-block. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-else-block’: down from current definition to next beginning of else-block below." + (interactive) + (let ((erg (py-forward-else-block))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-for-block (&optional arg decorator bol) + "Go to end of for-block. + +Return end of for-block if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-for-block-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-for-block-bol () + "Goto beginning of line following end of for-block. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-for-block’: down from current definition to next beginning of for-block below." + (interactive) + (let ((erg (py-forward-for-block))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-except-block (&optional arg decorator bol) + "Go to end of except-block. + +Return end of except-block if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-except-block-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-except-block-bol () + "Goto beginning of line following end of except-block. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-except-block’: down from current definition to next beginning of except-block below." + (interactive) + (let ((erg (py-forward-except-block))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-try-block (&optional arg decorator bol) + "Go to end of try-block. + +Return end of try-block if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-try-block-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-try-block-bol () + "Goto beginning of line following end of try-block. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-try-block’: down from current definition to next beginning of try-block below." + (interactive) + (let ((erg (py-forward-try-block))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-minor-block (&optional arg decorator bol) + "Go to end of minor-block. + +Return end of minor-block if successful, nil otherwise +Optional arg DECORATOR is used if form supports one +With optional BOL, go to beginning of line following match." + (interactive "p") + (let (erg) + (dotimes (_ (or arg 1)) + (let ((orig (point))) + (setq erg (py--end-base 'py-minor-block-re orig decorator bol)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-forward-minor-block-bol () + "Goto beginning of line following end of minor-block. + +Return position reached, if successful, nil otherwise. +See also ‘py-down-minor-block’: down from current definition to next beginning of minor-block below." + (interactive) + (let ((erg (py-forward-minor-block))) + (setq erg (py--beginning-of-line-form erg)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +;; python-components-forward-forms.el ends here +;; python-components-move + +;; Indentation +;; Travel current level of indentation +(defun py--travel-this-indent-backward (&optional indent) + "Travel INDENT given. + +Otherwise travel current level of indentation" + (let (erg) + (while (and (py-backward-statement) + (or indent (setq indent (current-indentation))) + (eq indent (current-indentation))(setq erg (point)) (not (bobp)))) + erg)) + +(defun py-backward-indent () + "Go to the beginning of a section of equal indent. + +If already at the beginning or before a indent, go to next indent upwards +Returns final position when called from inside section, nil otherwise" + (interactive) + (unless (bobp) + (let (erg) + (setq erg (py--travel-this-indent-backward)) + (when erg (goto-char erg)) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg))) + +(defun py--travel-this-indent-backward-bol (indent) + "Internal use. + +Travel this INDENT backward until bol" + (let (erg) + (while (and (py-backward-statement-bol) + (or indent (setq indent (current-indentation))) + (eq indent (current-indentation))(setq erg (point)) (not (bobp)))) + (when erg (goto-char erg)))) + +(defun py-backward-indent-bol () + "Go to the beginning of line of a section of equal indent. + +If already at the beginning or before an indent, +go to next indent in buffer upwards +Returns final position when called from inside section, nil otherwise" + (interactive) + (unless (bobp) + (let ((indent (when (eq (current-indentation) (current-column)) (current-column))) + erg) + (setq erg (py--travel-this-indent-backward-bol indent)) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg))) + +(defun py--travel-this-indent-forward (indent) + "Internal use. + +Travel this INDENT forward" + (let (last erg) + (while (and (py-down-statement) + (eq indent (current-indentation)) + (setq last (point)))) + (when last (goto-char last)) + (setq erg (py-forward-statement)) + erg)) + +(defun py-forward-indent () + "Go to the end of a section of equal indentation. + +If already at the end, go down to next indent in buffer +Returns final position when called from inside section, nil otherwise" + (interactive) + (unless (eobp) + (let (done indent) + (when (py-forward-statement) + (save-excursion + (setq done (point)) + (setq indent (and (py-backward-statement)(current-indentation)))) + (setq done (py--travel-this-indent-forward indent)) + (when done (goto-char done))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" done)) + done))) + +(defun py-forward-indent-bol () + "Go to beginning of line following of a section of equal indentation. + +If already at the end, go down to next indent in buffer +Returns final position when called from inside section, nil otherwise" + (interactive) + (unless (eobp) + (let (erg indent) + (when (py-forward-statement) + (save-excursion + (setq indent (and (py-backward-statement)(current-indentation)))) + (setq erg (py--travel-this-indent-forward indent)) + (unless (eobp) (forward-line 1) (beginning-of-line) (setq erg (point))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg))) + erg))) + +(defun py-backward-expression (&optional orig done repeat) + "Go to the beginning of a python expression. + +If already at the beginning or before a expression, +go to next expression in buffer upwards + +ORIG - consider orignial position or point. +DONE - transaktional argument +REPEAT - count and consider repeats" + (interactive) + (unless (bobp) + (unless done (skip-chars-backward " \t\r\n\f")) + (let ((repeat (or (and repeat (1+ repeat)) 0)) + (pps (parse-partial-sexp (point-min) (point))) + (orig (or orig (point))) + erg) + (if (< py-max-specpdl-size repeat) + (error "`py-backward-expression' reached loops max") + (cond + ;; comments + ((nth 8 pps) + (goto-char (nth 8 pps)) + (py-backward-expression orig done repeat)) + ;; lists + ((nth 1 pps) + (goto-char (nth 1 pps)) + (skip-chars-backward py-expression-skip-chars)) + ;; in string + ((nth 3 pps) + (goto-char (nth 8 pps))) + ;; after operator + ((and (not done) (looking-back py-operator-re (line-beginning-position))) + (skip-chars-backward "^ \t\r\n\f") + (skip-chars-backward " \t\r\n\f") + (py-backward-expression orig done repeat)) + ((and (not done) + (< 0 (abs (skip-chars-backward py-expression-skip-chars)))) + (setq done t) + (py-backward-expression orig done repeat)))) + (unless (or (eq (point) orig)(and (bobp)(eolp))) + (setq erg (point))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg))) + +(defun py-forward-expression (&optional orig done repeat) + "Go to the end of a compound python expression. + +Operators are ignored. +ORIG - consider orignial position or point. +DONE - transaktional argument +REPEAT - count and consider repeats" + (interactive) + (unless done (skip-chars-forward " \t\r\n\f")) + (unless (eobp) + (let ((repeat (or (and repeat (1+ repeat)) 0)) + (pps (parse-partial-sexp (point-min) (point))) + (orig (or orig (point))) + erg) + (if (< py-max-specpdl-size repeat) + (error "`py-forward-expression' reached loops max") + (cond + ;; in comment + ((nth 4 pps) + (or (< (point) (progn (forward-comment 1)(point)))(forward-line 1)) + (py-forward-expression orig done repeat)) + ;; empty before comment + ((and (looking-at "[ \t]*#")(looking-back "^[ \t]*" (line-beginning-position))) + (while (and (looking-at "[ \t]*#") (not (eobp))) + (forward-line 1)) + (py-forward-expression orig done repeat)) + ;; inside string + ((nth 3 pps) + (goto-char (nth 8 pps)) + (goto-char (scan-sexps (point) 1)) + (setq done t) + (py-forward-expression orig done repeat)) + ((looking-at "\"\"\"\\|'''\\|\"\\|'") + (goto-char (scan-sexps (point) 1)) + (setq done t) + (py-forward-expression orig done repeat)) + ((nth 1 pps) + (goto-char (nth 1 pps)) + (goto-char (scan-sexps (point) 1)) + (setq done t) + (py-forward-expression orig done repeat)) + ;; looking at opening delimiter + ((eq 4 (car-safe (syntax-after (point)))) + (goto-char (scan-sexps (point) 1)) + (setq done t) + (py-forward-expression orig done repeat)) + ((and (eq orig (point)) (looking-at py-operator-re)) + (goto-char (match-end 0)) + (py-forward-expression orig done repeat)) + ((and (not done) + (< 0 (skip-chars-forward py-expression-skip-chars))) + (setq done t) + (py-forward-expression orig done repeat)) + ;; at colon following arglist + ((looking-at ":[ \t]*$") + (forward-char 1))) + (unless (or (eq (point) orig)(and (eobp)(bolp))) + (setq erg (point))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)))) + +(defun py-backward-partial-expression () + "Backward partial-expression." + (interactive) + (let ((orig (point)) + erg) + (and (< 0 (abs (skip-chars-backward " \t\r\n\f")))(not (bobp))(forward-char -1)) + (when (py--in-comment-p) + (py-backward-comment) + (skip-chars-backward " \t\r\n\f")) + ;; part of py-partial-expression-forward-chars + (when (member (char-after) (list ?\ ?\" ?' ?\) ?} ?\] ?: ?#)) + (forward-char -1)) + (skip-chars-backward py-partial-expression-forward-chars) + (when (< 0 (abs (skip-chars-backward py-partial-expression-backward-chars))) + (while (and (not (bobp)) (py--in-comment-p)(< 0 (abs (skip-chars-backward py-partial-expression-backward-chars)))))) + (when (< (point) orig) + (unless + (and (bobp) (member (char-after) (list ?\ ?\t ?\r ?\n ?\f))) + (setq erg (point)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-partial-expression () + "Forward partial-expression." + (interactive) + (let (erg) + (skip-chars-forward py-partial-expression-backward-chars) + ;; group arg + (while + (looking-at "[\[{(]") + (goto-char (scan-sexps (point) 1))) + (setq erg (point)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +;; Partial- or Minor Expression +;; Line +(defun py-backward-line () + "Go to ‘beginning-of-line’, return position. + +If already at ‘beginning-of-line’ and not at BOB, go to beginning of previous line." + (interactive) + (unless (bobp) + (let ((erg + (if (bolp) + (progn + (forward-line -1) + (progn (beginning-of-line)(point))) + (progn (beginning-of-line)(point))))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg))) + +(defun py-forward-line () + "Go to ‘end-of-line’, return position. + +If already at ‘end-of-line’ and not at EOB, go to end of next line." + (interactive) + (unless (eobp) + (let ((orig (point)) + erg) + (when (eolp) (forward-line 1)) + (end-of-line) + (when (< orig (point))(setq erg (point))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg))) + +;; Statement +(defun py-backward-statement (&optional orig done limit ignore-in-string-p repeat) + "Go to the initial line of a simple statement. + +For beginning of compound statement use ‘py-backward-block’. +For beginning of clause ‘py-backward-clause’. + +`ignore-in-string-p' allows moves inside a docstring, used when +computing indents +ORIG - consider orignial position or point. +DONE - transaktional argument +LIMIT - honor limit +IGNORE-IN-STRING-P - also much inside a string +REPEAT - count and consider repeats" + (interactive) + (save-restriction + (unless (bobp) + (let* ((repeat (or (and repeat (1+ repeat)) 0)) + (orig (or orig (point))) + (pps (parse-partial-sexp (or limit (point-min))(point))) + (done done) + erg) + ;; lp:1382788 + (unless done + (and (< 0 (abs (skip-chars-backward " \t\r\n\f"))) + (setq pps (parse-partial-sexp (or limit (point-min))(point))))) + (cond + ((< py-max-specpdl-size repeat) + (error "Py-forward-statement reached loops max. If no error, customize `py-max-specpdl-size'")) + ((and (bolp)(eolp)) + (skip-chars-backward " \t\r\n\f") + (py-backward-statement orig done limit ignore-in-string-p repeat)) + ;; inside string + ((and (nth 3 pps)(not ignore-in-string-p)) + (setq done t) + (goto-char (nth 8 pps)) + (py-backward-statement orig done limit ignore-in-string-p repeat)) + ((nth 4 pps) + (while (ignore-errors (goto-char (nth 8 pps))) + (skip-chars-backward " \t\r\n\f") + (setq pps (parse-partial-sexp (line-beginning-position) (point))) + ) + (py-backward-statement orig done limit ignore-in-string-p repeat)) + ((nth 1 pps) + (goto-char (1- (nth 1 pps))) + (when (py--skip-to-semicolon-backward (save-excursion (back-to-indentation)(point))) + (setq done t)) + (py-backward-statement orig done limit ignore-in-string-p repeat)) + ((py-preceding-line-backslashed-p) + (forward-line -1) + (back-to-indentation) + (setq done t) + (py-backward-statement orig done limit ignore-in-string-p repeat)) + ;; at raw-string + ;; (and (looking-at "\"\"\"\\|'''") (member (char-before) (list ?u ?U ?r ?R))) + ((and (looking-at "\"\"\"\\|'''") (member (char-before) (list ?u ?U ?r ?R))) + (forward-char -1) + (py-backward-statement orig done limit ignore-in-string-p repeat)) + ;; BOL or at space before comment + ((and (looking-at "[ \t]*#")(looking-back "^[ \t]*" (line-beginning-position))) + (forward-comment -1) + (while (and (not (bobp)) (looking-at "[ \t]*#")(looking-back "^[ \t]*" (line-beginning-position))) + (forward-comment -1)) + (unless (bobp) + (py-backward-statement orig done limit ignore-in-string-p repeat))) + ;; at inline comment + ((looking-at "[ \t]*#") + (when (py--skip-to-semicolon-backward (save-excursion (back-to-indentation)(point))) + (setq done t)) + (py-backward-statement orig done limit ignore-in-string-p repeat)) + ;; at beginning of string + ((looking-at py-string-delim-re) + (when (< 0 (abs (skip-chars-backward " \t\r\n\f"))) + (setq done t)) + (back-to-indentation) + (py-backward-statement orig done limit ignore-in-string-p repeat)) + ;; after end of statement + ((and (not done) (eq (char-before) ?\;)) + (skip-chars-backward ";") + (py-backward-statement orig done limit ignore-in-string-p repeat)) + ;; travel until indentation or semicolon + ((and (not done) (py--skip-to-semicolon-backward)) + (setq done t) + (py-backward-statement orig done limit ignore-in-string-p repeat)) + ;; at current indent + ((and (not done) (not (eq 0 (skip-chars-backward " \t\r\n\f")))) + (py-backward-statement orig done limit ignore-in-string-p repeat))) + ;; return nil when before comment + (unless (and (looking-at "[ \t]*#") (looking-back "^[ \t]*" (line-beginning-position))) + (when (< (point) orig)(setq erg (point)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)))) + +(defun py-backward-statement-bol () + "Goto beginning of line where statement start. +Returns position reached, if successful, nil otherwise. + +See also `py-up-statement': up from current definition to next beginning of statement above." + (interactive) + (let* ((orig (point)) + erg) + (unless (bobp) + (cond ((bolp) + (and (py-backward-statement orig) + (progn (beginning-of-line) + (setq erg (point))))) + (t (setq erg + (and + (py-backward-statement) + (progn (beginning-of-line) (point))))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-forward-statement (&optional orig done repeat) + "Go to the last char of current statement. + +ORIG - consider orignial position or point. +DONE - transaktional argument +REPEAT - count and consider repeats" + (interactive) + (unless (eobp) + (let ((repeat (or (and repeat (1+ repeat)) 0)) + (orig (or orig (point))) + erg last + ;; use by scan-lists + forward-sexp-function pps err) + ;; (unless done (py--skip-to-comment-or-semicolon done)) + (setq pps (parse-partial-sexp (point-min) (point))) + ;; (origline (or origline (py-count-lines))) + (cond + ;; which-function-mode, lp:1235375 + ((< py-max-specpdl-size repeat) + (error "Py-forward-statement reached loops max. If no error, customize `py-max-specpdl-size'")) + ;; list + ((nth 1 pps) + (if (<= orig (point)) + (progn + (setq orig (point)) + ;; do not go back at a possible unclosed list + (goto-char (nth 1 pps)) + (if + (ignore-errors (forward-list)) + (progn + (when (looking-at ":[ \t]*$") + (forward-char 1)) + (setq done t) + (skip-chars-forward "^#" (line-end-position)) + (skip-chars-backward " \t\r\n\f" (line-beginning-position)) + (py-forward-statement orig done repeat)) + (setq err (py--record-list-error pps)) + (goto-char orig))))) + ;; in comment + ((looking-at (concat " *" comment-start)) + (goto-char (match-end 0)) + (py-forward-statement orig done repeat)) + ((nth 4 pps) + (py--end-of-comment-intern (point)) + (py--skip-to-comment-or-semicolon done) + (while (and (eq (char-before (point)) ?\\ ) + (py-escaped)(setq last (point))) + (forward-line 1)(end-of-line)) + (and last (goto-char last) + (forward-line 1) + (back-to-indentation)) + (py-forward-statement orig done repeat)) + ;; string + ((looking-at py-string-delim-re) + (goto-char (match-end 0)) + (py-forward-statement orig done repeat)) + ((nth 3 pps) + (when (py-end-of-string) + (end-of-line) + (skip-chars-forward " \t\r\n\f") + (setq pps (parse-partial-sexp (point-min) (point))) + (unless (and done (not (or (nth 1 pps) (nth 8 pps))) (eolp)) (py-forward-statement orig done repeat)))) + ((py-current-line-backslashed-p) + (end-of-line) + (skip-chars-backward " \t\r\n\f" (line-beginning-position)) + (while (and (eq (char-before (point)) ?\\ ) + (py-escaped)) + (forward-line 1) + (end-of-line) + (skip-chars-backward " \t\r\n\f" (line-beginning-position))) + (unless (eobp) + (py-forward-statement orig done repeat))) + ((eq orig (point)) + (if (eolp) + (skip-chars-forward " \t\r\n\f#'\"") + (end-of-line) + (skip-chars-backward " \t\r\n\f" orig)) + ;; point at orig due to a trailing whitespace + (and (eq (point) orig) (skip-chars-forward " \t\r\n\f")) + (setq done t) + (py-forward-statement orig done repeat)) + ((eq (current-indentation) (current-column)) + (py--skip-to-comment-or-semicolon done) + (setq pps (parse-partial-sexp orig (point))) + (if (nth 1 pps) + (py-forward-statement orig done repeat) + (unless done + (py-forward-statement orig done repeat)))) + ((and (looking-at "[[:print:]]+$") (not done) (py--skip-to-comment-or-semicolon done)) + (py-forward-statement orig done repeat))) + (unless + (or + (eq (point) orig) + (member (char-before) (list 10 32 9 ?#))) + (setq erg (point))) + (if (and py-verbose-p err) + (py--message-error err) + (and py-verbose-p (called-interactively-p 'any) (message "%s" erg))) + erg))) + +(defun py-forward-statement-bol () + "Go to the ‘beginning-of-line’ following current statement." + (interactive) + (let ((erg (py-forward-statement))) + (setq erg (py--beginning-of-line-form erg)) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +;; Decorator +(defun py-backward-decorator () + "Go to the beginning of a decorator. + +Returns position if succesful" + (interactive) + (back-to-indentation) + (while (and (not (looking-at "@\\w+")) + (not + ;; (empty-line-p) + (eq 9 (char-after))) + (not (bobp))(forward-line -1)) + (back-to-indentation)) + (let ((erg (when (looking-at "@\\w+")(match-beginning 0)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-forward-decorator () + "Go to the end of a decorator. + +Returns position if succesful" + (interactive) + (let ((orig (point)) erg) + (unless (looking-at "@\\w+") + (setq erg (py-backward-decorator))) + (when erg + (if + (re-search-forward py-def-or-class-re nil t) + (progn + (back-to-indentation) + (skip-chars-backward " \t\r\n\f") + (py-leave-comment-or-string-backward) + (skip-chars-backward " \t\r\n\f") + (setq erg (point))) + (goto-char orig) + (end-of-line) + (skip-chars-backward " \t\r\n\f") + (when (ignore-errors (goto-char (py-in-list-p))) + (forward-list)) + (when (< orig (point)) + (setq erg (point)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg))) + +(defun py-backward-comment (&optional pos) + "Got to beginning of a commented section. + +Start from POS if specified" + (interactive) + (let ((erg pos) + last) + (when erg (goto-char erg)) + (while (and (not (bobp)) (setq erg (py-in-comment-p))) + (when (< erg (point)) + (goto-char erg) + (setq last (point))) + (skip-chars-backward " \t\r\n\f")) + (when last (goto-char last)) + last)) + +(defun py-forward-comment (&optional pos char) + "Go to end of commented section. + +Optional args position and ‘comment-start’ character +Travel empty lines +Start from POS if specified +Use CHAR as ‘comment-start’ if provided" + (interactive) + (let ((orig (or pos (point))) + (char (or char (string-to-char comment-start))) + py-forward-comment-last erg) + (while (and (not (eobp)) + (or + (forward-comment 99999) + (when (py--in-comment-p) + (progn + (end-of-line) + (skip-chars-backward " \t\r\n\f") + (setq py-forward-comment-last (point)))) + (prog1 (forward-line 1) + (end-of-line))))) + (when py-forward-comment-last (goto-char py-forward-comment-last)) + ;; forward-comment fails sometimes + (and (eq orig (point)) (prog1 (forward-line 1) (back-to-indentation)) + (while (member (char-after) (list char 10))(forward-line 1)(back-to-indentation))) + (when (< orig (point)) (setq erg (point))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +;; Helper functions +(defun py-go-to-beginning-of-comment () + "Go to the beginning of current line's comment, if any. + +From a programm use macro `py-backward-comment' instead" + (interactive) + (let ((erg (py-backward-comment))) + (when (and py-verbose-p (called-interactively-p 'any)) + (message "%s" erg)))) + +(defun py--up-decorators-maybe (indent) + (let (done erg) + (while (and (not done) (not (bobp))) + (py-backward-statement) + (if + (and (current-indentation) indent + (looking-at py-decorator-re)) + (setq erg (point)) + (setq done t))) + erg)) + +(defun py--go-to-keyword-bol (regexp) + (let ((orig (point)) + done pps) + (while (and (not done) (not (bobp)) (re-search-backward (concat "^" regexp) nil t 1)) + (setq pps (parse-partial-sexp (point-min) (point))) + (or + (nth 8 pps)(nth 1 pps) + ;; (member (char-after)(list 32 9 ?# ?' ?\")) + (setq done (point)))) + (when (< (point) orig) (point)))) + +(defun py--go-to-keyword (regexp &optional maxindent decorator) + "Return a list, whose car is indentation, cdr position. + +Keyword detected from REGEXP +Honor MAXINDENT if provided" + (let ((maxindent + (or maxindent + (if (empty-line-p) + (progn + (py-backward-statement) + (current-indentation)) + (or maxindent (and (< 0 (current-indentation))(current-indentation)) + ;; make maxindent large enough if not set + (* 99 py-indent-offset))))) + done erg) + (if (eq 0 maxindent) + ;; faster jump to top-level forms + (setq erg (py--go-to-keyword-bol regexp)) + (while (and (not done) (not (bobp))) + (py-backward-statement) + (cond ((eq 0 (current-indentation)) + (when (looking-at regexp) + (setq erg (point)) + (setq done t))) + ((and (<= (current-indentation) maxindent) + (setq maxindent (current-indentation)) + (looking-at regexp)) + (setq erg (point)) + (setq done t))))) + (when (and (or decorator py-mark-decorators) (looking-at py-def-or-class-re)) + (setq done (py--up-decorators-maybe (current-indentation))) + (when done (setq erg done))) + (when erg (setq erg (cons (current-indentation) erg))) + erg)) + +(defun py--clause-lookup-keyword (regexp arg &optional indent origline) + "Return a list, whose car is indentation, cdr position. + +Keyword detected from REGEXP +ARG specifies the direction of search: +\(< 0 arg)'(eobp)'(bobp)) +Consider INDENT and ORIGLINE if provided" + (let* ((origline (or origline (py-count-lines))) + (stop (if (< 0 arg)'(eobp)'(bobp))) + (function (if (< 0 arg) 'py-forward-statement 'py-backward-statement)) + (count 1) + (maxindent (cond (indent indent) + ((< (py-count-lines) origline) + (current-indentation)) + (t 0))) + (complement-re + (cond ((or (string-match "finally" regexp) + (string-match "except" regexp)) + py-try-re) + ((string-match "elif" regexp) + py-if-re) + ((string-match "else" regexp) + py-minor-block-re))) + (first t) + erg done strict) + (while (and (not (eval stop)) + (< 0 count) + (or done (setq erg (funcall function)))) + (setq done nil) + (when (and first (< maxindent (current-indentation))) + (setq maxindent (current-indentation)) + (setq first nil)) + (when (if strict + (< (current-indentation) maxindent) + (<= (current-indentation) maxindent)) + (unless (looking-at py-block-or-clause-re) + (setq maxindent (current-indentation))) + ;; nesting + (cond + ((and (looking-at "\\_[: \n\t]")(save-match-data (string-match regexp "finally"))) + (setq indent (current-indentation)) + (while + (and + (not (eval stop)) + (funcall function) + (setq done t) + (not (and (eq indent (current-indentation)) (looking-at "try")))))) + ((and (looking-at "\\[: \n\t]")(save-match-data (string-match "else" regexp))) + (setq indent (current-indentation)) + (setq count (1+ count)) + (while + (and + (not (eval stop)) + (funcall function) + (setq done t) + (not (and (eq indent (current-indentation)) (looking-at "try\\|if")))))) + ((and (looking-at "\\_[: \n\t]")(save-match-data (string-match "else" regexp))) + (setq indent (current-indentation)) + (setq count (1+ count)) + (while + (and + (not (eval stop)) + (funcall function) + (setq done t) + (not (and (eq indent (current-indentation)) (looking-at "try\\|if")))))) + ((and (looking-at "\\_[ \n\t]")(save-match-data (string-match "elif" regexp))) + (setq indent (current-indentation)) + (while + (and + (not (eval stop)) + (funcall function) + (setq done t) + ;; doesn't mean nesting yet + (setq count (1- count)) + (not (and (eq indent (current-indentation)) (looking-at "if")))))) + ((and complement-re (looking-at complement-re)(<= (current-indentation) maxindent)) + (setq count (1- count))) + (t (cond ((and (string-match "except" regexp)(looking-at py-block-re)) + (setq count (1- count))) + ((and (string-match "else" regexp)(looking-at "except")) + (current-indentation)) + (t + (setq strict t) + )))))) + (when erg + (if (looking-at py-def-or-class-re) + (setq erg (cons (+ (current-indentation) py-indent-offset) erg)) + (setq erg (cons (current-indentation) erg)))) + erg)) + +(defun py-leave-comment-or-string-backward () + "If inside a comment or string, leave it backward." + (interactive) + (let ((pps + (if (featurep 'xemacs) + (parse-partial-sexp (point-min) (point)) + (parse-partial-sexp (point-min) (point))))) + (when (nth 8 pps) + (goto-char (1- (nth 8 pps)))))) + +(defun py-beginning-of-list-pps (&optional iact last ppstart orig done) + "Go to the beginning of a list. + +IACT - if called interactively +LAST - was last match. +Optional PPSTART indicates a start-position for `parse-partial-sexp'. +ORIG - consider orignial position or point. +DONE - transaktional argument +Return beginning position, nil if not inside." + (interactive "p") + (let* ((orig (or orig (point))) + (ppstart (or ppstart (re-search-backward "^[a-zA-Z]" nil t 1) (point-min))) + erg) + (unless done (goto-char orig)) + (setq done t) + (if + (setq erg (nth 1 (if (featurep 'xemacs) + (parse-partial-sexp ppstart (point)) + (parse-partial-sexp (point-min) (point))))) + (progn + (setq last erg) + (goto-char erg) + (py-beginning-of-list-pps iact last ppstart orig done)) + (when iact (message "%s" last)) + last))) + +(defun py-forward-into-nomenclature (&optional arg iact) + "Move forward to end of a nomenclature symbol. + +With \\[universal-argument] (programmatically, optional argument ARG), do it that many times. +IACT - if called interactively +A `nomenclature' is a fancy way of saying AWordWithMixedCaseNotUnderscores." + (interactive "p") + (or arg (setq arg 1)) + (let ((case-fold-search nil) + (orig (point)) + erg) + (if (> arg 0) + (while (and (not (eobp)) (> arg 0)) + ;; (setq erg (re-search-forward "\\(\\W+[_[:lower:][:digit:]ß]+\\)" nil t 1)) + (cond + ((or (not (eq 0 (skip-chars-forward "[[:blank:][:punct:]\n\r]"))) + (not (eq 0 (skip-chars-forward "_")))) + (when (or + (< 1 (skip-chars-forward "[:upper:]")) + (not (eq 0 (skip-chars-forward "[[:lower:][:digit:]ß]"))) + (not (eq 0 (skip-chars-forward "[[:lower:][:digit:]]")))) + (setq arg (1- arg)))) + ((or + (< 1 (skip-chars-forward "[:upper:]")) + (not (eq 0 (skip-chars-forward "[[:lower:][:digit:]ß]"))) + (not (eq 0 (skip-chars-forward "[[:lower:][:digit:]]")))) + (setq arg (1- arg))))) + (while (and (not (bobp)) (< arg 0)) + (when (not (eq 0 (skip-chars-backward "[[:blank:][:punct:]\n\r\f_]"))) + + (forward-char -1)) + (or + (not (eq 0 (skip-chars-backward "[:upper:]"))) + (not (eq 0 (skip-chars-backward "[[:lower:][:digit:]ß]"))) + (skip-chars-backward "[[:lower:][:digit:]ß]")) + (setq arg (1+ arg)))) + (if (< (point) orig) + (progn + (when (looking-back "[[:upper:]]" (line-beginning-position)) + ;; (looking-back "[[:blank:]]" + (forward-char -1)) + (if (looking-at "[[:alnum:]ß]") + (setq erg (point)) + (setq erg nil))) + (if (and (< orig (point)) (not (eobp))) + (setq erg (point)) + (setq erg nil))) + (when (and py-verbose-p (or iact (called-interactively-p 'any))) (message "%s" erg)) + erg)) + +(defun py-backward-into-nomenclature (&optional arg) + "Move backward to beginning of a nomenclature symbol. + +With optional ARG, move that many times. If ARG is negative, move +forward. + +A `nomenclature' is a fancy way of saying AWordWithMixedCaseNotUnderscores." + (interactive "p") + (setq arg (or arg 1)) + (py-forward-into-nomenclature (- arg) arg)) + +(defun py--travel-current-indent (indent &optional orig) + "Move down until clause is closed, i.e. current indentation is reached. + +Takes a list, INDENT and ORIG position." + (unless (eobp) + (let ((orig (or orig (point))) + last) + (while (and (setq last (point))(not (eobp))(py-forward-statement) + (save-excursion (or (<= indent (progn (py-backward-statement)(current-indentation)))(eq last (line-beginning-position)))) + ;; (py--end-of-statement-p) +)) + (goto-char last) + (when (< orig last) + last)))) + +(defun py-beginning-of-block-current-column () + "Reach next beginning of block upwards which start at current column. + +Return position" + (interactive) + (let* ((orig (point)) + (cuco (current-column)) + (str (make-string cuco ?\s)) + pps erg) + (while (and (not (bobp))(re-search-backward (concat "^" str py-block-keywords) nil t)(or (nth 8 (setq pps (parse-partial-sexp (point-min) (point)))) (nth 1 pps)))) + (back-to-indentation) + (and (< (point) orig)(setq erg (point))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-backward-section () + "Go to next section start upward in buffer. + +Return position if successful" + (interactive) + (let ((orig (point))) + (while (and (re-search-backward py-section-start nil t 1) + (nth 8 (parse-partial-sexp (point-min) (point))))) + (when (and (looking-at py-section-start)(< (point) orig)) + (point)))) + +(defun py-forward-section () + "Go to next section end downward in buffer. + +Return position if successful" + (interactive) + (let ((orig (point)) + last) + (while (and (re-search-forward py-section-end nil t 1) + (setq last (point)) + (goto-char (match-beginning 0)) + (nth 8 (parse-partial-sexp (point-min) (point))) + (goto-char (match-end 0)))) + (and last (goto-char last)) + (when (and (looking-back py-section-end (line-beginning-position))(< orig (point))) + (point)))) + +;; python-components-kill-forms + + +(defun py-kill-comment () + "Delete comment at point. + +Stores data in kill ring" + (interactive "*") + (let ((erg (py--mark-base "comment"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-line () + "Delete line at point. + +Stores data in kill ring" + (interactive "*") + (let ((erg (py--mark-base "line"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-paragraph () + "Delete paragraph at point. + +Stores data in kill ring" + (interactive "*") + (let ((erg (py--mark-base "paragraph"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-expression () + "Delete expression at point. + +Stores data in kill ring" + (interactive "*") + (let ((erg (py--mark-base "expression"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-partial-expression () + "Delete partial-expression at point. + +Stores data in kill ring" + (interactive "*") + (let ((erg (py--mark-base "partial-expression"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-section () + "Delete section at point. + +Stores data in kill ring" + (interactive "*") + (let ((erg (py--mark-base "section"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-top-level () + "Delete top-level at point. + +Stores data in kill ring" + (interactive "*") + (let ((erg (py--mark-base "top-level"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-block () + "Delete block at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "block"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-block-or-clause () + "Delete block-or-clause at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "block-or-clause"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-class () + "Delete class at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "class"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-clause () + "Delete clause at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "clause"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-def () + "Delete def at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "def"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-def-or-class () + "Delete def-or-class at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "def-or-class"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-elif-block () + "Delete elif-block at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "elif-block"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-else-block () + "Delete else-block at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "else-block"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-except-block () + "Delete except-block at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "except-block"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-for-block () + "Delete for-block at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "for-block"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-if-block () + "Delete if-block at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "if-block"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-indent () + "Delete indent at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "indent"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-minor-block () + "Delete minor-block at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "minor-block"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-statement () + "Delete statement at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "statement"))) + (kill-region (car erg) (cdr erg)))) + +(defun py-kill-try-block () + "Delete try-block at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (let ((erg (py--mark-base-bol "try-block"))) + (kill-region (car erg) (cdr erg)))) + +;; python-components-close-forms + + +(defun py-close-block () + "Close block at point. + +Set indent level to that of beginning of function definition. + +If final line isn't empty and ‘py-close-block-provides-newline’ non-nil, insert a newline." + (interactive "*") + (let ((erg (py--close-intern 'py-block-re))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-close-class () + "Close class at point. + +Set indent level to that of beginning of function definition. + +If final line isn't empty and ‘py-close-block-provides-newline’ non-nil, insert a newline." + (interactive "*") + (let ((erg (py--close-intern 'py-class-re))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-close-def () + "Close def at point. + +Set indent level to that of beginning of function definition. + +If final line isn't empty and ‘py-close-block-provides-newline’ non-nil, insert a newline." + (interactive "*") + (let ((erg (py--close-intern 'py-def-re))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-close-def-or-class () + "Close def-or-class at point. + +Set indent level to that of beginning of function definition. + +If final line isn't empty and ‘py-close-block-provides-newline’ non-nil, insert a newline." + (interactive "*") + (let ((erg (py--close-intern 'py-def-or-class-re))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-close-minor-block () + "Close minor-block at point. + +Set indent level to that of beginning of function definition. + +If final line isn't empty and ‘py-close-block-provides-newline’ non-nil, insert a newline." + (interactive "*") + (let ((erg (py--close-intern 'py-minor-block-re))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-close-statement () + "Close statement at point. + +Set indent level to that of beginning of function definition. + +If final line isn't empty and ‘py-close-block-provides-newline’ non-nil, insert a newline." + (interactive "*") + (let ((erg (py--close-intern 'py-statement-re))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +;; python-components-mark-forms + + +(defun py-mark-comment () + "Mark comment at point. + +Return beginning and end positions of marked area, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base "comment")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-line () + "Mark line at point. + +Return beginning and end positions of marked area, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base "line")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-paragraph () + "Mark paragraph at point. + +Return beginning and end positions of marked area, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base "paragraph")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-expression () + "Mark expression at point. + +Return beginning and end positions of marked area, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base "expression")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-partial-expression () + "Mark partial-expression at point. + +Return beginning and end positions of marked area, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base "partial-expression")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-section () + "Mark section at point. + +Return beginning and end positions of marked area, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base "section")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-top-level () + "Mark top-level at point. + +Return beginning and end positions of marked area, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base "top-level")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-block () + "Mark block, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "block")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-block-or-clause () + "Mark block-or-clause, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "block-or-clause")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-class (&optional arg) + "Mark class, take beginning of line positions. + +With ARG \\[universal-argument] or ‘py-mark-decorators’ set to t, decorators are marked too. +Return beginning and end positions of region, a cons." + (interactive "P") + (let ((py-mark-decorators (or arg py-mark-decorators)) + erg) + (py--mark-base-bol "class" py-mark-decorators) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-clause () + "Mark clause, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "clause")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-def (&optional arg) + "Mark def, take beginning of line positions. + +With ARG \\[universal-argument] or ‘py-mark-decorators’ set to t, decorators are marked too. +Return beginning and end positions of region, a cons." + (interactive "P") + (let ((py-mark-decorators (or arg py-mark-decorators)) + erg) + (py--mark-base-bol "def" py-mark-decorators) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-def-or-class (&optional arg) + "Mark def-or-class, take beginning of line positions. + +With ARG \\[universal-argument] or ‘py-mark-decorators’ set to t, decorators are marked too. +Return beginning and end positions of region, a cons." + (interactive "P") + (let ((py-mark-decorators (or arg py-mark-decorators)) + erg) + (py--mark-base-bol "def-or-class" py-mark-decorators) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-elif-block () + "Mark elif-block, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "elif-block")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-else-block () + "Mark else-block, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "else-block")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-except-block () + "Mark except-block, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "except-block")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-for-block () + "Mark for-block, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "for-block")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-if-block () + "Mark if-block, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "if-block")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-indent () + "Mark indent, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "indent")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-minor-block () + "Mark minor-block, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "minor-block")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-statement () + "Mark statement, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "statement")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-mark-try-block () + "Mark try-block, take beginning of line positions. + +Return beginning and end positions of region, a cons." + (interactive) + (let (erg) + (setq erg (py--mark-base-bol "try-block")) + (exchange-point-and-mark) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +;; python-components-copy-forms + + +(defun py-copy-block () + "Copy block at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "block"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-block-or-clause () + "Copy block-or-clause at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "block-or-clause"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-buffer () + "Copy buffer at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "buffer"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-class () + "Copy class at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "class"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-clause () + "Copy clause at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "clause"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-def () + "Copy def at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "def"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-def-or-class () + "Copy def-or-class at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "def-or-class"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-expression () + "Copy expression at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "expression"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-indent () + "Copy indent at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "indent"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-line () + "Copy line at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "line"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-minor-block () + "Copy minor-block at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "minor-block"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-paragraph () + "Copy paragraph at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "paragraph"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-partial-expression () + "Copy partial-expression at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "partial-expression"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-region () + "Copy region at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "region"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-statement () + "Copy statement at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "statement"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-top-level () + "Copy top-level at point. + +Store data in kill ring, so it might yanked back." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "top-level"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-block-bol () + "Delete block bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "block"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-block-or-clause-bol () + "Delete block-or-clause bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "block-or-clause"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-buffer-bol () + "Delete buffer bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "buffer"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-class-bol () + "Delete class bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "class"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-clause-bol () + "Delete clause bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "clause"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-def-bol () + "Delete def bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "def"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-def-or-class-bol () + "Delete def-or-class bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "def-or-class"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-expression-bol () + "Delete expression bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "expression"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-indent-bol () + "Delete indent bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "indent"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-line-bol () + "Delete line bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "line"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-minor-block-bol () + "Delete minor-block bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "minor-block"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-paragraph-bol () + "Delete paragraph bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "paragraph"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-partial-expression-bol () + "Delete partial-expression bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "partial-expression"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-region-bol () + "Delete region bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "region"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-statement-bol () + "Delete statement bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "statement"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +(defun py-copy-top-level-bol () + "Delete top-level bol at point. + +Stores data in kill ring. Might be yanked back using ‘C-y’." + (interactive "*") + (save-excursion + (let ((erg (py--mark-base-bol "top-level"))) + (copy-region-as-kill (car erg) (cdr erg))))) + +;; python-components-delete-forms + + +(defun py-delete-block () + "Delete BLOCK at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "block"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-block-or-clause () + "Delete BLOCK-OR-CLAUSE at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "block-or-clause"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-class (&optional arg) + "Delete CLASS at point until ‘beginning-of-line’. + +Don't store data in kill ring. +With ARG \\[universal-argument] or ‘py-mark-decorators’ set to t, ‘decorators’ are included." + (interactive "P") + (let* ((py-mark-decorators (or arg py-mark-decorators)) + (erg (py--mark-base "class" py-mark-decorators))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-clause () + "Delete CLAUSE at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "clause"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-def (&optional arg) + "Delete DEF at point until ‘beginning-of-line’. + +Don't store data in kill ring. +With ARG \\[universal-argument] or ‘py-mark-decorators’ set to t, ‘decorators’ are included." + (interactive "P") + (let* ((py-mark-decorators (or arg py-mark-decorators)) + (erg (py--mark-base "def" py-mark-decorators))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-def-or-class (&optional arg) + "Delete DEF-OR-CLASS at point until ‘beginning-of-line’. + +Don't store data in kill ring. +With ARG \\[universal-argument] or ‘py-mark-decorators’ set to t, ‘decorators’ are included." + (interactive "P") + (let* ((py-mark-decorators (or arg py-mark-decorators)) + (erg (py--mark-base "def-or-class" py-mark-decorators))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-elif-block () + "Delete ELIF-BLOCK at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "elif-block"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-else-block () + "Delete ELSE-BLOCK at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "else-block"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-except-block () + "Delete EXCEPT-BLOCK at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "except-block"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-for-block () + "Delete FOR-BLOCK at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "for-block"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-if-block () + "Delete IF-BLOCK at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "if-block"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-indent () + "Delete INDENT at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "indent"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-minor-block () + "Delete MINOR-BLOCK at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "minor-block"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-statement () + "Delete STATEMENT at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "statement"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-try-block () + "Delete TRY-BLOCK at point until ‘beginning-of-line’. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base-bol "try-block"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-comment () + "Delete COMMENT at point. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base "comment"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-line () + "Delete LINE at point. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base "line"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-paragraph () + "Delete PARAGRAPH at point. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base "paragraph"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-expression () + "Delete EXPRESSION at point. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base "expression"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-partial-expression () + "Delete PARTIAL-EXPRESSION at point. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base "partial-expression"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-section () + "Delete SECTION at point. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base "section"))) + (delete-region (car erg) (cdr erg)))) + +(defun py-delete-top-level () + "Delete TOP-LEVEL at point. + +Don't store data in kill ring." + (interactive) + (let ((erg (py--mark-base "top-level"))) + (delete-region (car erg) (cdr erg)))) + +;; python-components-execute +(defun py-restore-window-configuration () + "Restore ‘py-restore-window-configuration’ when completion is done resp. abandoned." + (let (val) + (and (setq val (get-register py-windows-config-register))(and (consp val) (window-configuration-p (car val))(markerp (cadr val)))(marker-buffer (cadr val)) + (jump-to-register py-windows-config-register)))) + +(defun py-shell-execute-string-now (strg &optional shell buffer proc) + "Send STRG to Python interpreter process. + +Return collected output + +Optional SHELL BUFFER PROC" + (let* (wait + (procbuf (or buffer (process-buffer proc) (progn (setq wait py-new-shell-delay) (py-shell nil nil shell)))) + (proc (or proc (get-buffer-process procbuf))) + (cmd (format "exec '''%s''' in {}" + (mapconcat 'identity (split-string strg "\n") "\\n"))) + ;; TBD remove redundant outbuf + (outbuf procbuf)) + ;; wait is used only when a new py-shell buffer was connected + (and wait (sit-for wait)) + (unwind-protect + (condition-case nil + (progn + (with-current-buffer outbuf + (delete-region (point-min) (point-max))) + (with-current-buffer procbuf + ;; (sit-for 3) + (comint-redirect-send-command-to-process + cmd outbuf proc nil t) + (accept-process-output proc 5)) + (with-current-buffer outbuf + (buffer-substring (point-min) (point-max)))) + (quit (with-current-buffer procbuf + (interrupt-process proc comint-ptyp) + (while (not comint-redirect-completed) ; wait for output + (accept-process-output proc 1))) + (signal 'quit nil)))))) + +(defun py-switch-to-python (eob-p) + "Switch to the Python process buffer, maybe starting new process. + +With EOB-P, go to end of buffer." + (interactive "p") + (pop-to-buffer (process-buffer (py-proc)) t) ;Runs python if needed. + (when eob-p + (goto-char (point-max)))) + +(defalias 'py-shell-send-file 'py-send-file) +(defun py-send-file (file-name &optional process temp-file-name) + "Send FILE-NAME to Python PROCESS. + +If TEMP-FILE-NAME is passed then that file is used for processing +instead, while internally the shell will continue to use +FILE-NAME." + (interactive "fFile to send: ") + (let* ((process (or process (get-buffer-process (py-shell)))) + (temp-file-name (when temp-file-name + (expand-file-name temp-file-name))) + (file-name (or (expand-file-name file-name) temp-file-name))) + (when (not file-name) + (error "If FILE-NAME is nil then TEMP-FILE-NAME must be non-nil")) + (py-send-string + (format + (concat "__pyfile = open('''%s''');" + "exec(compile(__pyfile.read(), '''%s''', 'exec'));" + "__pyfile.close()") + file-name file-name) + process))) + +(defun toggle-force-local-shell (&optional arg) + "If locally indicated Python shell should be taken. + +Enforced upon sessions execute commands. + +Toggles boolean ‘py-force-local-shell-p’ along with ‘py-force-py-shell-name-p’ +Returns value of ‘toggle-force-local-shell’ switched to. + +See also commands +‘py-force-local-shell-on’ +‘py-force-local-shell-off’" + (interactive) + (let ((arg (or arg (if py-force-local-shell-p -1 1)))) + (if (< 0 arg) + (progn + (setq py-shell-name (or py-local-command (py-choose-shell))) + (setq py-force-local-shell-p t)) + (setq py-shell-name (default-value 'py-shell-name)) + (setq py-force-local-shell-p nil)) + (when (called-interactively-p 'any) + (if py-force-local-shell-p + (when py-verbose-p (message "Enforce %s" py-shell-name)) + (when py-verbose-p (message "py-shell-name default restored to: %s" py-shell-name)))) + py-shell-name)) + +(defun py-force-local-shell-on () + "Make sure, ‘py-force-local-shell-p’ is on. + +Returns value of ‘py-force-local-shell-p’. +Optional FAST +Kind of an option 'follow', local shell sets ‘py-shell-name’, enforces its use afterwards" + (interactive) + (toggle-force-local-shell 1) + (when (or py-verbose-p (called-interactively-p 'any)) + (message "Enforce %s" py-shell-name))) + +(defun py-force-local-shell-off () + "Restore ‘py-shell-name’ default value and ‘behaviour’. + +Optional FAST" + (interactive) + (toggle-force-local-shell 1) + (when (or py-verbose-p (called-interactively-p 'any)) + (message "py-shell-name default restored to: %s" py-shell-name))) + +(defun toggle-force-py-shell-name-p (&optional arg) + "If customized default ‘py-shell-name’ should be enforced upon execution. + +If ‘py-force-py-shell-name-p’ should be on or off. +Returns value of ‘py-force-py-shell-name-p’ switched to. + +Optional ARG +See also commands +‘force-py-shell-name-p-on’ +‘force-py-shell-name-p-off’ + +Caveat: Completion might not work that way." + (interactive) + (let ((arg (or arg (if py-force-py-shell-name-p -1 1)))) + (if (< 0 arg) + (setq py-force-py-shell-name-p t) + (setq py-force-py-shell-name-p nil)) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-force-py-shell-name-p: %s" py-force-py-shell-name-p)) + py-force-py-shell-name-p)) + +(defun force-py-shell-name-p-on () + "Switch ‘py-force-py-shell-name-p’ on. + +Customized default ‘py-shell-name’ will be enforced upon execution. +Returns value of ‘py-force-py-shell-name-p’. + +Caveat: Completion might not work that way." + (interactive) + (toggle-force-py-shell-name-p 1) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-force-py-shell-name-p: %s" py-force-py-shell-name-p)) + py-force-py-shell-name-p) + +(defun force-py-shell-name-p-off () + "Make sure, ‘py-force-py-shell-name-p’ is off. + +Function to use by executes will be guessed from environment. +Returns value of ‘py-force-py-shell-name-p’." + (interactive) + (toggle-force-py-shell-name-p -1) + (when (or py-verbose-p (called-interactively-p 'any)) (message "py-force-py-shell-name-p: %s" py-force-py-shell-name-p)) + py-force-py-shell-name-p) + +;; Split-Windows-On-Execute forms +(defalias 'toggle-py-split-windows-on-execute 'py-toggle-split-windows-on-execute) +(defun py-toggle-split-windows-on-execute (&optional arg) + "If ‘py-split-window-on-execute’ should be on or off. + +optional ARG + Returns value of ‘py-split-window-on-execute’ switched to." + (interactive) + (let ((arg (or arg (if py-split-window-on-execute -1 1)))) + (if (< 0 arg) + (setq py-split-window-on-execute t) + (setq py-split-window-on-execute nil)) + (when (called-interactively-p 'any) (message "py-split-window-on-execute: %s" py-split-window-on-execute)) + py-split-window-on-execute)) + +(defun py-split-windows-on-execute-on (&optional arg) + "Make sure, ‘py-split-window-on-execute’ according to ARG. + +Returns value of ‘py-split-window-on-execute’." + (interactive "p") + (let ((arg (or arg 1))) + (toggle-py-split-windows-on-execute arg)) + (when (called-interactively-p 'any) (message "py-split-window-on-execute: %s" py-split-window-on-execute)) + py-split-window-on-execute) + +(defun py-split-windows-on-execute-off () + "Make sure, ‘py-split-window-on-execute’ is off. + +Returns value of ‘py-split-window-on-execute’." + (interactive) + (toggle-py-split-windows-on-execute -1) + (when (called-interactively-p 'any) (message "py-split-window-on-execute: %s" py-split-window-on-execute)) + py-split-window-on-execute) + +;; Shell-Switch-Buffers-On-Execute forms +(defalias 'py-toggle-switch-buffers-on-execute 'py-toggle-shell-switch-buffers-on-execute) +(defalias 'toggle-py-shell-switch-buffers-on-execute 'py-toggle-shell-switch-buffers-on-execute) +(defun py-toggle-shell-switch-buffers-on-execute (&optional arg) + "If ‘py-switch-buffers-on-execute-p’ according to ARG. + + Returns value of ‘py-switch-buffers-on-execute-p’ switched to." + (interactive) + (let ((arg (or arg (if py-switch-buffers-on-execute-p -1 1)))) + (if (< 0 arg) + (setq py-switch-buffers-on-execute-p t) + (setq py-switch-buffers-on-execute-p nil)) + (when (called-interactively-p 'any) (message "py-shell-switch-buffers-on-execute: %s" py-switch-buffers-on-execute-p)) + py-switch-buffers-on-execute-p)) + +(defun py-shell-switch-buffers-on-execute-on (&optional arg) + "Make sure, ‘py-switch-buffers-on-execute-p’ according to ARG. + +Returns value of ‘py-switch-buffers-on-execute-p’." + (interactive "p") + (let ((arg (or arg 1))) + (toggle-py-shell-switch-buffers-on-execute arg)) + (when (called-interactively-p 'any) (message "py-shell-switch-buffers-on-execute: %s" py-switch-buffers-on-execute-p)) + py-switch-buffers-on-execute-p) + +(defun py-shell-switch-buffers-on-execute-off () + "Make sure, ‘py-switch-buffers-on-execute-p’ is off. + +Returns value of ‘py-switch-buffers-on-execute-p’." + (interactive) + (toggle-py-shell-switch-buffers-on-execute -1) + (when (called-interactively-p 'any) (message "py-shell-switch-buffers-on-execute: %s" py-switch-buffers-on-execute-p)) + py-switch-buffers-on-execute-p) + +(defun py-guess-default-python () + "Defaults to \"python\", if guessing didn't succeed." + (interactive) + (let* ((ptn (or py-shell-name (py-choose-shell) "python")) + (erg (if py-edit-only-p ptn (executable-find ptn)))) + (when (called-interactively-p 'any) + (if erg + (message "%s" ptn) + (message "%s" "Could not detect Python on your system"))))) + +;; from ipython.el +(defun py-dirstack-hook () + "To synchronize dir-changes." + (make-local-variable 'shell-dirstack) + (setq shell-dirstack nil) + (make-local-variable 'shell-last-dir) + (setq shell-last-dir nil) + (make-local-variable 'shell-dirtrackp) + (setq shell-dirtrackp t) + (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t)) + +(defalias 'py-dedicated-shell 'py-shell-dedicated) +(defun py-shell-dedicated (&optional argprompt) + "Start an interpreter in another window according to ARGPROMPT. + +With optional \\[universal-argument] user is prompted by +‘py-choose-shell’ for command and options to pass to the Python +interpreter." + (interactive "P") + (py-shell argprompt t)) + +(defun py-set-ipython-completion-command-string (shell) + "Set and return ‘py-ipython-completion-command-string’ according to SHELL." + (interactive) + (let* ((ipython-version (shell-command-to-string (concat shell " -V")))) + (if (string-match "[0-9]" ipython-version) + (setq py-ipython-completion-command-string + (cond ((string-match "^[^0].+" ipython-version) + py-ipython0.11-completion-command-string) + ((string-match "^0.1[1-3]" ipython-version) + py-ipython0.11-completion-command-string) + ((string= "^0.10" ipython-version) + py-ipython0.10-completion-command-string))) + (error ipython-version)))) + +(defun py-ipython--module-completion-import (proc) + "Import module-completion according to PROC." + (interactive) + (let ((ipython-version (shell-command-to-string (concat py-shell-name " -V")))) + (when (and (string-match "^[0-9]" ipython-version) + (string-match "^[^0].+" ipython-version)) + (process-send-string proc "from IPython.core.completerlib import module_completion")))) + +(defun py--compose-buffer-name-initials (liste) + (let (erg) + (dolist (ele liste) + (unless (string= "" ele) + (setq erg (concat erg (char-to-string (aref ele 0)))))) + erg)) + +(defun py--remove-home-directory-from-list (liste) + "Prepare for compose-buffer-name-initials according to LISTE." + (let ((case-fold-search t) + (liste liste) + erg) + (if (listp (setq erg (split-string (expand-file-name "~") "\/"))) + erg + (setq erg (split-string (expand-file-name "~") "\\\\"))) + (while erg + (when (member (car erg) liste) + (setq liste (cdr (member (car erg) liste)))) + (setq erg (cdr erg))) + (butlast liste))) + +(defun py--choose-buffer-name (&optional name dedicated fast-process) + "Return an appropriate NAME to display in modeline. + +Optional DEDICATED FAST-PROCESS +SEPCHAR is the file-path separator of your system." + (let* ((name-first (or name py-shell-name)) + (erg (when name-first (if (stringp name-first) name-first (prin1-to-string name-first)))) + (fast-process (or fast-process py-fast-process-p)) + prefix) + (when (string-match "^py-" erg) + (setq erg (nth 1 (split-string erg "-")))) + ;; remove home-directory from prefix to display + (unless py-modeline-acronym-display-home-p + (save-match-data + (let ((case-fold-search t)) + (when (string-match (concat ".*" (expand-file-name "~")) erg) + (setq erg (replace-regexp-in-string (concat "^" (expand-file-name "~")) "" erg)))))) + (if (or (and (setq prefix (split-string erg "\\\\")) + (< 1 (length prefix))) + (and (setq prefix (split-string erg "\/")) + (< 1 (length prefix)))) + (progn + ;; exect something like default py-shell-name + (setq erg (car (last prefix))) + (unless py-modeline-acronym-display-home-p + ;; home-directory may still inside + (setq prefix (py--remove-home-directory-from-list prefix)) + (setq prefix (py--compose-buffer-name-initials prefix)))) + (setq erg (or name py-shell-name)) + (setq prefix nil)) + (when fast-process (setq erg (concat erg " Fast"))) + (setq erg + (cond ((string-match "^ipython" erg) + (replace-regexp-in-string "ipython" "IPython" erg)) + ((string-match "^jython" erg) + (replace-regexp-in-string "jython" "Jython" erg)) + ((string-match "^python" erg) + (replace-regexp-in-string "python" "Python" erg)) + ((string-match "^python2" erg) + (replace-regexp-in-string "python2" "Python2" erg)) + ((string-match "^python3" erg) + (replace-regexp-in-string "python3" "Python3" erg)) + (t erg))) + (when (or dedicated py-dedicated-process-p) + (setq erg (make-temp-name (concat erg "-")))) + (cond ((and prefix (string-match "^\*" erg)) + (setq erg (replace-regexp-in-string "^\*" (concat "*" prefix " ") erg))) + (prefix + (setq erg (concat "*" prefix " " erg "*"))) + (t (unless (string-match "^\*" erg)(setq erg (concat "*" erg "*"))))) + erg)) + +(defun py--jump-to-exception-intern (act exception-buffer origline) + (let (erg) + (set-buffer exception-buffer) + (goto-char (point-min)) + (forward-line (1- origline)) + (and (search-forward act (line-end-position) t) + (and py-verbose-p (message "exception-buffer: %s on line %d" py-exception-buffer origline)) + (and py-highlight-error-source-p + (setq erg (make-overlay (match-beginning 0) (match-end 0))) + (overlay-put erg + 'face 'highlight))))) + +(defun py--jump-to-exception (perr origline &optional file) + "Jump to the PERR Python code at ORIGLINE in optional FILE." + (let ( + ;; (inhibit-point-motion-hooks t) + (file (or file (car perr))) + (act (nth 2 perr))) + (cond ((and py-exception-buffer + (buffer-live-p py-exception-buffer)) + ;; (pop-to-buffer procbuf) + (py--jump-to-exception-intern act py-exception-buffer origline)) + ((ignore-errors (file-readable-p file)) + (find-file file) + (py--jump-to-exception-intern act (get-buffer (file-name-nondirectory file)) origline)) + ((buffer-live-p (get-buffer file)) + (set-buffer file) + (py--jump-to-exception-intern act file origline)) + (t (setq file (find-file (read-file-name "Exception file: " + nil + file t))) + (py--jump-to-exception-intern act file origline))))) + +(defalias 'py-toggle-split-window-on-execute-function 'py-toggle-split-window-function) +(defun py-toggle-split-window-function () + "If window is splitted vertically or horizontally. + +When code is executed and ‘py-split-window-on-execute’ is t, +the result is displays in an output-buffer, \"\*Python\*\" by default. + +Customizable variable ‘py-split-windows-on-execute-function’ +tells how to split the screen." + (interactive) + (if (eq 'split-window-vertically py-split-windows-on-execute-function) + (setq py-split-windows-on-execute-function'split-window-horizontally) + (setq py-split-windows-on-execute-function 'split-window-vertically)) + (when (and py-verbose-p (called-interactively-p 'any)) + (message "py-split-windows-on-execute-function set to: %s" py-split-windows-on-execute-function))) + +(defun py--manage-windows-set-and-switch (buffer) + "Switch to output BUFFER, go to ‘point-max’. + +Internal use" + (set-buffer buffer) + (goto-char (process-mark (get-buffer-process (current-buffer))))) + +(defun py--alternative-split-windows-on-execute-function () + "If ‘py--split-windows-on-execute-function’ is ‘split-window-vertically’ return ‘split-window-horizontally’ and vice versa." + (if (eq py-split-windows-on-execute-function 'split-window-vertically) + 'split-window-horizontally + 'split-window-vertically)) + +(defun py--get-splittable-window () + "If selected window doesn't permit a further split, search ‘window-list’ for a suitable one." + (or (and (window-left-child)(split-window (window-left-child))) + (and (window-top-child)(split-window (window-top-child))) + (and (window-parent)(ignore-errors (split-window (window-parent)))) + (and (window-atom-root)(split-window (window-atom-root))))) + +(defun py--manage-windows-split (buffer) + "If one window, split BUFFER. + +according to ‘py-split-windows-on-execute-function’." + (interactive) + (set-buffer buffer) + (or + ;; (split-window (selected-window) nil ’below) + (ignore-errors (funcall py-split-windows-on-execute-function)) + ;; If call didn't succeed according to settings of + ;; ‘split-height-threshold’, ‘split-width-threshold’ + ;; resp. ‘window-min-height’, ‘window-min-width’ + ;; try alternative split + (unless (ignore-errors (funcall (py--alternative-split-windows-on-execute-function))) + ;; if alternative split fails, look for larger window + (py--get-splittable-window) + (ignore-errors (funcall (py--alternative-split-windows-on-execute-function)))))) + +;; (defun py--display-windows (output-buffer) +;; "Otherwise new window appears above" +;; (display-buffer output-buffer) +;; (select-window py-exception-window)) + +(defun py--split-t-not-switch-wm (output-buffer number-of-windows exception-buffer) + (unless (window-live-p output-buffer) + (with-current-buffer (get-buffer exception-buffer) + (when (< number-of-windows py-split-window-on-execute-threshold) + (unless + (member (get-buffer-window output-buffer)(window-list)) + (py--manage-windows-split exception-buffer))) + (display-buffer output-buffer t)))) + +(defun py--shell-manage-windows (output-buffer &optional exception-buffer split switch) + "Adapt or restore window configuration from OUTPUT-BUFFER. + +Optional EXCEPTION-BUFFER SPLIT SWITCH +Return nil." + (let* ((exception-buffer (or exception-buffer (other-buffer))) + (output-buffer (get-buffer (or output-buffer py-buffer-name))) + (old-window-list (window-list)) + (number-of-windows (length old-window-list)) + (split (or split py-split-window-on-execute)) + (switch (or switch py-switch-buffers-on-execute-p))) + ;; (output-buffer-displayed-p) + (cond + (py-keep-windows-configuration + (py-restore-window-configuration) + (set-buffer output-buffer) + (goto-char (point-max))) + ((and (eq split 'always) + switch) + (if (member (get-buffer-window output-buffer)(window-list)) + ;; (delete-window (get-buffer-window output-buffer)) + (select-window (get-buffer-window output-buffer)) + (py--manage-windows-split exception-buffer) + ;; otherwise new window appears above + (save-excursion + (other-window 1) + (switch-to-buffer output-buffer)) + (display-buffer exception-buffer))) + ((and + (eq split 'always) + (not switch)) + (if (member (get-buffer-window output-buffer)(window-list)) + (select-window (get-buffer-window output-buffer)) + (py--manage-windows-split exception-buffer) + (display-buffer output-buffer) + (pop-to-buffer exception-buffer))) + ((and + (eq split 'just-two) + switch) + (switch-to-buffer (current-buffer)) + (delete-other-windows) + ;; (sit-for py-new-shell-delay) + (py--manage-windows-split exception-buffer) + ;; otherwise new window appears above + (other-window 1) + (set-buffer output-buffer) + (switch-to-buffer (current-buffer))) + ((and + (eq split 'just-two) + (not switch)) + (switch-to-buffer exception-buffer) + (delete-other-windows) + (unless + (member (get-buffer-window output-buffer)(window-list)) + (py--manage-windows-split exception-buffer)) + ;; Fixme: otherwise new window appears above + (save-excursion + (other-window 1) + (pop-to-buffer output-buffer) + (goto-char (point-max)) + (other-window 1))) + ((and + split + (not switch)) + ;; https://bugs.launchpad.net/python-mode/+bug/1478122 + ;; > If the shell is visible in any of the windows it should re-use that window + ;; > I did double check and py-keep-window-configuration is nil and split is t. + (py--split-t-not-switch-wm output-buffer number-of-windows exception-buffer)) + ((and split switch) + (unless + (member (get-buffer-window output-buffer)(window-list)) + (py--manage-windows-split exception-buffer)) + ;; Fixme: otherwise new window appears above + ;; (save-excursion + ;; (other-window 1) + ;; (pop-to-buffer output-buffer) + ;; [Bug 1579309] python buffer window on top when using python3 + (set-buffer output-buffer) + (switch-to-buffer output-buffer) + (goto-char (point-max)) + ;; (other-window 1) + ) + ((not switch) + (let (pop-up-windows) + (py-restore-window-configuration)))))) + +(defun py-kill-shell-unconditional (&optional shell) + "With optional argument SHELL. + +Otherwise kill default (I)Python shell. +Kill buffer and its process. +Receives a ‘buffer-name’ as argument" + (interactive) + (let ((shell (or shell (py-shell)))) + (py-kill-buffer-unconditional shell))) + +(defun py-kill-default-shell-unconditional () + "Kill buffer \"\*Python\*\" and its process." + (interactive) + (py-kill-buffer-unconditional "*Python*")) + +(defun py--report-executable (buffer) + (let ((erg (downcase (replace-regexp-in-string + "<\\([0-9]+\\)>" "" + (replace-regexp-in-string + "\*" "" + (if + (string-match " " buffer) + (substring buffer (1+ (string-match " " buffer))) + buffer)))))) + (when (string-match "-" erg) + (setq erg (substring erg 0 (string-match "-" erg)))) + erg)) + +(defun py--shell-make-comint (executable buffer args) + "Create comint-proces according to EXECUTABLE return the BUFFER and ARGS." + (let* ((buffer (apply #'make-comint-in-buffer executable buffer executable nil (split-string-and-unquote (car args)))) + (proc (get-buffer-process buffer))) + (with-current-buffer buffer + (if (string-match "^i" (process-name proc)) + (py-ipython-shell-mode) + (py-python-shell-mode))) + buffer)) + +(defun py--guess-buffer-name (argprompt dedicated) + "Guess the ‘buffer-name’ core string according to ARGPROMPT DEDICATED." + (when (and (not dedicated) argprompt + (eq 4 (prefix-numeric-value argprompt))) + (read-buffer "Py-Shell buffer: " + (generate-new-buffer-name (py--choose-buffer-name))))) + +(defun py--configured-shell (name) + "Return the configured PATH/TO/STRING if any according to NAME." + (if (string-match "//\\|\\\\" name) + name + (cond ((string-match "^[Ii]" name) + (or py-ipython-command name)) + ((string-match "[Pp]ython3" name) + (or py-python3-command name)) + ((string-match "[Pp]ython2" name) + (or py-python2-command name)) + ((string-match "[Jj]ython" name) + (or py-jython-command name)) + (t (or py-python-command name))))) + +(defun py--grab-prompt-ps1 (proc buffer) + (py--send-string-no-output "import sys") + (py-fast-send-string "sys.ps1" proc buffer t)) + +;; (defun py--start-fast-process (shell buffer) +;; (let ((proc)) +;; (with-current-buffer buffer +;; (erase-buffer)) +;; (start-process shell buffer shell) +;; proc)) + +(defun py--start-fast-process (shell buffer) + (start-process shell buffer shell)) + +(defun py--shell-fast-proceeding (proc buffer shell setup-code) + (unless (get-buffer-process (get-buffer buffer)) + (setq proc (py--start-fast-process shell buffer)) + (setq py-output-buffer buffer) + (py-fast-send-string-intern setup-code proc))) + +(defun py--reuse-existing-shell (exception-buffer) + (setq py-exception-buffer (or exception-buffer (and py-exception-buffer (buffer-live-p py-exception-buffer) py-exception-buffer) py-buffer-name))) + +(defun py--create-new-shell (executable args buffer exception-buffer) + (let ((buf (or exception-buffer (current-buffer)))) + (with-current-buffer (get-buffer-create buffer) + (apply #'make-comint-in-buffer executable buffer executable nil (split-string-and-unquote args)) + (let ((proc (get-buffer-process (current-buffer)))) + (if (string-match "^i" (process-name proc)) + (py-ipython-shell-mode) + (py-python-shell-mode))) + (unless py-force-default-output-buffer-p + (setq py-output-buffer (current-buffer))) + (sit-for 0.1 t) + (goto-char (point-max)) + ;; otherwise comint might initialize it with point-min + (set-marker comint-last-input-end (point)) + (setq py-exception-buffer (or exception-buffer (and py-exception-buffer (buffer-live-p py-exception-buffer) py-exception-buffer) buf))))) + +(defun py--determine-local-default () + (if (not (string= "" py-shell-local-path)) + (expand-file-name py-shell-local-path) + (when py-use-local-default + (error "Abort: ‘py-use-local-default’ is set to t but ‘py-shell-local-path’ is empty. Maybe call ‘py-toggle-local-default-use’")))) + +(defun py--provide-command-args (fast-process argprompt) + (cond (fast-process "-u") + ((eq 2 (prefix-numeric-value argprompt)) + (mapconcat 'identity py-python2-command-args " ")) + ((string-match "^[Ii]" py-shell-name) + py-ipython-command-args) + ((string-match "^[^-]+3" py-shell-name) + (mapconcat 'identity py-python3-command-args " ")) + (t (mapconcat 'identity py-python-command-args " ")))) + +;;;###autoload +(defun py-shell (&optional argprompt dedicated shell buffer fast exception-buffer split switch internal) + "Start a Python interpreter. + +Interactively, \\[universal-argument] prompts for a new ‘buffer-name’. + \\[universal-argument] 2 prompts for ‘py-python-command-args’. + If ‘default-directory’ is a remote file name, it is also prompted + to change if called with a prefix arg. + Optional ARGPROMPT DEDICATED + Optional string SHELL overrides default ‘py-shell-name’. + Returns py-shell's ‘buffer-name’. + BUFFER allows specifying a name, the Python process is connected to + FAST process not in ‘comint-mode’ buffer + EXCEPTION-BUFFER point to error + Optional SPLIT see var ‘py-split-window-on-execute’ + Optional SWITCH see var ‘py-switch-buffers-on-execute-p’ + Optional INPUT-PROMPT permit command to set prompt + Optional INTERNAL shell will be invisible for users + + \\[describe-mode] in the process buffer provides more info." + (interactive + (when current-prefix-arg + (list + (y-or-n-p "Make dedicated process? ") + (= (prefix-numeric-value current-prefix-arg) 4)))) + ;; (list (python-shell-calculate-command) nil t))) + ;; (message "py-last-exeption-buffer: %s" py-last-exeption-buffer) + (let* ((exception-buffer (or exception-buffer (current-buffer))) + (fast (or fast py-fast-process-p)) + (dedicated (or dedicated py-dedicated-process-p)) + (shell (or shell (py-choose-shell))) + (args (py--provide-command-args fast argprompt)) + (py-use-local-default (py--determine-local-default)) + (buffer-raw (or buffer + ;; Guess according to ARGPROMPT DEDICATED. + (py--guess-buffer-name argprompt dedicated))) + (buffer (if internal + ;; make unvisible for users + (concat " " (or buffer-raw (py--choose-buffer-name nil dedicated fast))) + (or buffer-raw (py--choose-buffer-name shell dedicated fast)))) + (executable (cond + (shell) + (py-shell-name) + (buffer + (py--report-executable buffer)))) + ;; (cmd (format "%s %s" executable args)) +) + (set (make-local-variable 'py-last-exeption-buffer) exception-buffer) + (if fast + ;; user rather wants an interactive shell + (py--shell-fast-proceeding nil buffer shell py-shell-completion-setup-code) + (if (comint-check-proc buffer) + (py--reuse-existing-shell exception-buffer) + ;; buffer might exist but not being empty + (when (or (buffer-live-p buffer)(bufferp (get-buffer buffer))) + ;; kill-buffer-unconditional buffer + (with-current-buffer buffer + (set-buffer-modified-p 'nil) + (kill-buffer (current-buffer)))) + (py--create-new-shell executable args buffer exception-buffer))) + (when (or (called-interactively-p 'any) + (eq 1 argprompt) + (or switch py-switch-buffers-on-execute-p py-split-window-on-execute)) + (py--shell-manage-windows buffer exception-buffer split switch)) + buffer)) + +(defun py-shell-get-process (&optional argprompt dedicated shell buffer) + "Get appropriate Python process for current buffer and return it. + +Optional ARGPROMPT DEDICATED SHELL BUFFER" + (interactive) + (let ((erg (get-buffer-process (py-shell argprompt dedicated shell buffer)))) + (when (called-interactively-p 'any) (message "%S" erg)) + erg)) + +(defun py-switch-to-shell () + "Switch to Python process buffer." + (interactive) + (pop-to-buffer (py-shell) t)) + +;; Code execution commands +(defun py-which-execute-file-command (filename) + "Return the command appropriate to Python version and FILENAME. + +Per default it's \"(format \"execfile(r'%s') # PYTHON-MODE\\n\" filename)\" for Python 2 series." + (format "exec(compile(open(r'%s').read(), r'%s', 'exec')) # PYTHON-MODE\n" filename filename)) + +(defun py--store-result-maybe (erg) + "If no error occurred and ‘py-store-result-p’ store ERG for yank." + (and (not py-error) erg (or py-debug-p py-store-result-p) (kill-new erg))) + +(defun py--close-execution (tempbuf tempfile) + "Delete TEMPBUF and TEMPFILE." + (unless py-debug-p + (when tempfile (py-delete-temporary tempfile tempbuf)))) + +(defun py--execute-base (&optional start end shell filename proc file wholebuf fast dedicated split switch return) + "Update optionial variables START END SHELL FILENAME PROC FILE WHOLEBUF FAST DEDICATED SPLIT SWITCH RETURN." + (setq py-error nil) + (let* ((exception-buffer (current-buffer)) + (start (or start (and (use-region-p) (region-beginning)) (point-min))) + (end (or end (and (use-region-p) (region-end)) (point-max))) + (strg-raw (if py-if-name-main-permission-p + (buffer-substring-no-properties start end) + (py--fix-if-name-main-permission (buffer-substring-no-properties start end)))) + (strg (py--fix-start strg-raw)) + (wholebuf (unless file (or wholebuf (and (eq (buffer-size) (- end start)))))) + ;; (windows-config (window-configuration-to-register py-windows-config-register)) + (origline + (save-restriction + (widen) + (py-count-lines (point-min) end))) + ;; argument SHELL might be a string like "python", "IPython" "python3", a symbol holding PATH/TO/EXECUTABLE or just a symbol like 'python3 + (shell (or + (and shell + ;; shell might be specified in different ways + (or (and (stringp shell) shell) + (ignore-errors (eval shell)) + (and (symbolp shell) (format "%s" shell)))) + ;; (save-excursion + (py-choose-shell) + ;;) + )) + (execute-directory + (cond ((ignore-errors (file-name-directory (file-remote-p (buffer-file-name) 'localname)))) + ((and py-use-current-dir-when-execute-p (buffer-file-name)) + (file-name-directory (buffer-file-name))) + ((and py-use-current-dir-when-execute-p + py-fileless-buffer-use-default-directory-p) + (expand-file-name default-directory)) + ((stringp py-execute-directory) + py-execute-directory) + ((getenv "VIRTUAL_ENV")) + (t (getenv "HOME")))) + (buffer (py--choose-buffer-name shell dedicated fast)) + (filename (or (and filename (expand-file-name filename)) + (py--buffer-filename-remote-maybe))) + (py-orig-buffer-or-file (or filename (current-buffer))) + (proc (or proc (get-buffer-process buffer) + (prog1 + (get-buffer-process (py-shell nil dedicated shell buffer fast exception-buffer split switch)) + (sit-for 0.1)))) + (fast (or fast py-fast-process-p)) + (return (or return py-return-result-p py-store-result-p))) + (setq py-buffer-name buffer) + (py--execute-base-intern strg filename proc file wholebuf buffer origline execute-directory start end shell fast return) + (when (or split py-split-window-on-execute py-switch-buffers-on-execute-p) + (py--shell-manage-windows buffer exception-buffer split switch)))) + +(defun py--send-to-fast-process (strg proc output-buffer return) + "Called inside of ‘py--execute-base-intern’. + +Optional STRG PROC OUTPUT-BUFFER RETURN" + (let ((output-buffer (or output-buffer (process-buffer proc)))) + (with-current-buffer output-buffer + (erase-buffer) + (py-fast-send-string strg + proc + output-buffer return) + (sit-for 0.1)))) + +(defun py--delete-temp-file (tempfile &optional tempbuf) + "After ‘py--execute-buffer-finally’ returned delete TEMPFILE &optional TEMPBUF." + (sit-for py--delete-temp-file-delay t) + (py--close-execution tempbuf tempfile)) + +(defun py--execute-buffer-finally (strg which-shell proc procbuf origline) + (let* ((temp (make-temp-name + ;; FixMe: that should be simpler + (concat (replace-regexp-in-string py-separator-char "-" (replace-regexp-in-string (concat "^" py-separator-char) "" (replace-regexp-in-string ":" "-" (if (stringp which-shell) which-shell (prin1-to-string which-shell))))) "-"))) + (tempbuf (get-buffer-create temp)) + erg) + (setq py-tempfile (concat (expand-file-name py-temp-directory) py-separator-char (replace-regexp-in-string py-separator-char "-" temp) ".py")) + (with-current-buffer tempbuf + (insert strg) + (write-file py-tempfile)) + (unwind-protect + (setq erg (py--execute-file-base proc py-tempfile nil procbuf origline))) + erg)) + +(defun py--execute-base-intern (strg filename proc file wholebuf buffer origline execute-directory start end which-shell &optional fast return) + "Select the handler according to: + +STRG FILENAME PROC FILE WHOLEBUF +BUFFER ORIGLINE EXECUTE-DIRECTORY START END WHICH-SHELL +Optional FAST RETURN" + (let () + (setq py-error nil) + (py--update-execute-directory proc buffer execute-directory) + (cond (fast (py--send-to-fast-process strg proc buffer return)) + ;; enforce proceeding as python-mode.el v5 + (python-mode-v5-behavior-p + (py-execute-python-mode-v5 start end py-exception-buffer origline)) + (py-execute-no-temp-p + (py--execute-ge24.3 start end execute-directory which-shell py-exception-buffer proc file origline)) + ((and filename wholebuf) + (py--execute-file-base proc filename nil buffer origline)) + (t + (py--execute-buffer-finally strg which-shell proc buffer origline) + (py--delete-temp-file py-tempfile))))) + +(defun py--fetch-error (&optional origline) + "Highlight exceptions found in BUF. + +If an exception occurred return error-string, otherwise return nil. +BUF must exist. + +Indicate LINE if code wasn't run from a file, thus remember ORIGLINE of source buffer" + (let* (erg) + (when py-debug-p (switch-to-buffer (current-buffer))) + (goto-char (point-min)) + (when (re-search-forward "File \"\\(.+\\)\", line \\([0-9]+\\)\\(.*\\)$" nil t) + ;; (while (re-search-forward "File \"\\(.+\\)\", line \\([0-9]+\\)\\(.*\\)$" nil t)) + (setq erg (copy-marker (point))) + ;; Replace hints to temp-file by orig-file + (delete-region (progn (beginning-of-line) + (save-match-data + (when (looking-at + ;; all prompt-regexp known + py-fast-filter-re) + (goto-char (match-end 0)))) + + (skip-chars-forward " \t\r\n\f")(point)) (line-end-position)) + (insert (concat " File " (buffer-name py-exception-buffer) ", line " + (prin1-to-string origline)))) + (when erg + (goto-char erg) + (save-match-data + (and (not (py--buffer-filename-remote-maybe + (or + (get-buffer py-exception-buffer) + (get-buffer (file-name-nondirectory py-exception-buffer))))) + (string-match "^[ \t]*File" (buffer-substring-no-properties (point) (line-end-position))) + (looking-at "[ \t]*File") + (replace-match " Buffer"))) + (setq py-error (buffer-substring-no-properties (point-min) (point-max))) + (sit-for 0.1 t) + py-error))) + +(defun py--fetch-result (orig) + "Return ‘buffer-substring’ from ORIG to ‘point-max’." + ;; (switch-to-buffer (current-buffer)) + ;; otherwise py-ert-fast-complete-1 fails + (goto-char orig) + (if (derived-mode-p 'comint-mode) + (replace-regexp-in-string + (format "[ \n]*%s[ \n]*" py-fast-filter-re) + "" + (buffer-substring-no-properties orig (point-max))) + (while (re-search-forward (format "[ \n]*%s[ \n]*" py-fast-filter-re) nil t 1) + (replace-match "")) + (buffer-substring-no-properties orig (point-max)))) + +(defun py--postprocess-comint (output-buffer origline orig) + "Provide return values, check result for error, manage windows. + +According to OUTPUT-BUFFER ORIGLINE ORIG" + ;; py--fast-send-string doesn't set origline + (let (py-result py-error) + (when py-return-result-p + (with-current-buffer output-buffer + (sit-for 0.1 t) + ;; (when py-debug-p (switch-to-buffer (current-buffer))) + ;; (delete-region (point-min) orig) + (setq py-result (py--fetch-result orig))) + ;; (when py-debug-p (message "py-result: %s" py-result)) + (and (string-match "\n$" py-result) + (setq py-result (replace-regexp-in-string py-fast-filter-re "" (substring py-result 0 (match-beginning 0))))) + (if (and py-result (not (string= "" py-result))) + (if (string-match "^Traceback" py-result) + (progn + (with-temp-buffer + (insert py-result) + (sit-for 0.1 t) + (setq py-error (py--fetch-error origline)))) + ;; position no longer needed, no need to correct + (when py-store-result-p + (when (and py-result (not (string= "" py-result))(not (string= (car kill-ring) py-result))) (kill-new py-result))) + py-result) + (message "py--postprocess-comint: %s" "Don't see any result"))))) + +(defun py--execute-ge24.3 (start end execute-directory which-shell &optional exception-buffer proc file origline) + "An alternative way to do it. + +According to START END EXECUTE-DIRECTORY WHICH-SHELL +Optional EXCEPTION-BUFFER PROC FILE ORIGLINE +May we get rid of the temporary file?" + (and (py--buffer-filename-remote-maybe) buffer-offer-save (buffer-modified-p (py--buffer-filename-remote-maybe)) (y-or-n-p "Save buffer before executing? ") + (write-file (py--buffer-filename-remote-maybe))) + (let* ((start (copy-marker start)) + (end (copy-marker end)) + (exception-buffer (or exception-buffer (current-buffer))) + (line (py-count-lines (point-min) (if (eq start (line-beginning-position)) (1+ start) start))) + (strg (buffer-substring-no-properties start end)) + (tempfile (or (py--buffer-filename-remote-maybe) (concat (expand-file-name py-temp-directory) py-separator-char (replace-regexp-in-string py-separator-char "-" "temp") ".py"))) + + (proc (or proc (if py-dedicated-process-p + (get-buffer-process (py-shell nil py-dedicated-process-p which-shell py-buffer-name)) + (or (get-buffer-process py-buffer-name) + (get-buffer-process (py-shell nil py-dedicated-process-p which-shell py-buffer-name)))))) + (procbuf (process-buffer proc)) + (file (or file (with-current-buffer py-buffer-name + (concat (file-remote-p default-directory) tempfile)))) + (filebuf (get-buffer-create file))) + (set-buffer filebuf) + (erase-buffer) + (newline line) + (save-excursion + (insert strg)) + (py--fix-start (buffer-substring-no-properties (point) (point-max))) + (unless (string-match "[jJ]ython" which-shell) + ;; (when (and execute-directory py-use-current-dir-when-execute-p + ;; (not (string= execute-directory default-directory))) + ;; (message "Warning: options ‘execute-directory’ and ‘py-use-current-dir-when-execute-p’ may conflict")) + (and execute-directory + (process-send-string proc (concat "import os; os.chdir(\"" execute-directory "\")\n")) + )) + (set-buffer filebuf) + (process-send-string proc + (buffer-substring-no-properties + (point-min) (point-max))) + (sit-for 0.1 t) + (if (and (setq py-error (save-excursion (py--postprocess-intern origline exception-buffer))) + (car py-error) + (not (markerp py-error))) + (py--jump-to-exception py-error origline) + (unless (string= (buffer-name (current-buffer)) (buffer-name procbuf)) + (when py-verbose-p (message "Output buffer: %s" procbuf)))))) + +(defun py-delete-temporary (&optional file filebuf) + (when (file-readable-p file) + (delete-file file)) + (when (buffer-live-p filebuf) + (set-buffer filebuf) + (set-buffer-modified-p 'nil) + (kill-buffer filebuf))) + +(defun py-execute-python-mode-v5 (start end &optional exception-buffer origline) + "Take START END &optional EXCEPTION-BUFFER ORIGLINE." + (interactive "r") + (let ((exception-buffer (or exception-buffer (current-buffer))) + (pcmd (concat py-shell-name (if (string-equal py-which-bufname + "Jython") + " -" + ;; " -c " + "")))) + (save-excursion + (shell-command-on-region start end + pcmd py-output-buffer)) + (if (not (get-buffer py-output-buffer)) + (message "No output.") + (setq py-error (py--postprocess-intern origline exception-buffer)) + (let* ((line (cadr py-error))) + (if py-error + (when (and py-jump-on-exception line) + (pop-to-buffer exception-buffer)) + (pop-to-buffer py-output-buffer) + (goto-char (point-max)) + (copy-marker (point))))))) + +(defun py--insert-offset-lines (line) + "Fix offline amount, make error point at the correct LINE." + (insert (make-string (- line (py-count-lines (point-min) (point))) 10))) + +(defun py--execute-file-base (&optional proc filename cmd procbuf origline) + "Send to Python interpreter process PROC. + +In Python version 2.. \"execfile('FILENAME')\". + +Takes also CMD PROCBUF ORIGLINE. + +Make that process's buffer visible and force display. Also make +comint believe the user typed this string so that +‘kill-output-from-shell’ does The Right Thing. +Returns position where output starts." + (let* ((origline (or (ignore-errors origline) 1)) + (buffer (or procbuf (py-shell nil nil nil procbuf))) + (proc (or proc (get-buffer-process buffer))) + (cmd (or cmd (py-which-execute-file-command filename))) + + ;; (windows-config (window-configuration-to-register py-windows-config-register)) + erg orig) + (with-current-buffer buffer + ;; (when py-debug-p (switch-to-buffer (current-buffer))) + ;; (goto-char (point-max)) + (setq orig (copy-marker (point-max))) + (py-send-string cmd proc) + (py-send-string cmd proc) + (when (or py-return-result-p py-store-result-p) + (setq erg (py--postprocess-comint buffer origline orig)) + (if py-error + (setq py-error (prin1-to-string py-error)) + erg))) +)) + +(defun py-execute-file (filename) + "When called interactively, user is prompted for FILENAME." + (interactive "fFilename: ") + (let (;; postprocess-output-buffer might want origline + (origline 1) + ;; (windows-config (window-configuration-to-register 313465889)) + (py-exception-buffer filename) + erg) + (if (file-readable-p filename) + (if py-store-result-p + (setq erg (py--execute-file-base nil (expand-file-name filename) nil nil origline)) + (py--execute-file-base nil (expand-file-name filename))) + (message "%s not readable. %s" filename "Do you have write permissions?")) + erg)) + +(defun py--current-working-directory (&optional shell) + "Return the directory of current SHELL." + (replace-regexp-in-string "\n" "" (shell-command-to-string (concat (or shell py-shell-name) " -c \"import os; print(os.getcwd())\"")))) + +(defun py--update-execute-directory-intern (dir proc) + (comint-send-string proc (concat "import os;os.chdir(\"" dir "\")\n"))) + +(defun py--update-execute-directory (proc procbuf execute-directory) + (let ((py-exception-buffer (current-buffer)) + cwd) + (set-buffer procbuf) + (setq cwd (py--current-working-directory)) + (unless (string= execute-directory (concat cwd "/")) + (py--update-execute-directory-intern (or py-execute-directory execute-directory) proc) + (set-buffer py-exception-buffer)))) + +(defun py-execute-string (&optional strg shell dedicated switch fast) + "Send the optional argument STRG to Python default interpreter. + +Optional SHELL DEDICATED SWITCH FAST +See also ‘py-execute-region’." + (interactive) + (let ((strg (or strg (read-from-minibuffer "String: "))) + (shell (or shell (default-value 'py-shell-name)))) + (with-temp-buffer + (insert strg) + (py-execute-region (point-min) (point-max) shell dedicated switch fast)))) + +(defun py-execute-string-dedicated (&optional strg shell switch fast) + "Send the argument STRG to an unique Python interpreter. + +Optional SHELL SWITCH FAST +See also ‘py-execute-region’." + (interactive) + (let ((strg (or strg (read-from-minibuffer "String: "))) + (shell (or shell (default-value 'py-shell-name)))) + (with-temp-buffer + (insert strg) + (py-execute-region (point-min) (point-max) shell t switch fast)))) + +(defun py--insert-execute-directory (directory &optional orig done) + (let ((orig (or orig (point))) + (done done)) + (if done (goto-char done) (goto-char (point-min))) + (cond ((re-search-forward "^from __future__ import " nil t 1) + (py-forward-statement) + (setq done (point)) + (py--insert-execute-directory directory orig done)) + ((re-search-forward py-encoding-string-re nil t 1) + (setq done (point)) + (py--insert-execute-directory directory orig done)) + ((re-search-forward py-shebang-regexp nil t 1) + (setq done (point)) + (py--insert-execute-directory directory orig done)) + (t (forward-line 1) + (unless ;; (empty-line-p) + (eq 9 (char-after)) (newline)) + (insert (concat "import os; os.chdir(\"" directory "\")\n")))))) + +(defun py--fix-if-name-main-permission (strg) + "Remove \"if __name__ == '__main__ '\" STRG from code to execute. + +See ‘py-if-name-main-permission-p’" + (let ((strg (if py-if-name-main-permission-p strg + (replace-regexp-in-string + "if[( ]*__name__[) ]*==[( ]*['\"]\\{1,3\\}__main__['\"]\\{1,3\\}[) ]*:" + ;; space after __main__, i.e. will not be executed + "if __name__ == '__main__ ':" strg)))) + strg)) + +;; ‘py-execute-line’ calls void function, lp:1492054, lp:1519859 +(or (functionp 'indent-rigidly-left) + (defun indent-rigidly--pop-undo () + (and (memq last-command '(indent-rigidly-left indent-rigidly-right + indent-rigidly-left-to-tab-stop + indent-rigidly-right-to-tab-stop)) + (consp buffer-undo-list) + (eq (car buffer-undo-list) nil) + (pop buffer-undo-list))) + + (defun indent-rigidly-left (beg end) + "Indent all lines between BEG and END leftward by one space." + (interactive "r") + (indent-rigidly--pop-undo) + (indent-rigidly + beg end + (if (eq (current-bidi-paragraph-direction) 'right-to-left) 1 -1)))) + +(defun py--fix-start (strg) + "Internal use by py-execute... functions. + +Takes STRG +Avoid empty lines at the beginning." + ;; (when py-debug-p (message "py--fix-start:")) + (let (py--imenu-create-index-p + py-guess-py-install-directory-p + py-autopair-mode + py-complete-function + py-load-pymacs-p + py-load-skeletons-p + erg) + (with-temp-buffer + (python-mode) + (insert strg) + (goto-char (point-min)) + (when (< 0 (setq erg (skip-chars-forward " \t\r\n\f" (line-end-position)))) + (dotimes (_ erg) + (indent-rigidly-left (point-min) (point-max)))) + (unless (py--beginning-of-statement-p) + (py-forward-statement)) + (while (not (eq (current-indentation) 0)) + (py-shift-left py-indent-offset)) + (goto-char (point-max)) + (unless (empty-line-p) + (newline)) + (buffer-substring-no-properties 1 (point-max))))) + +(defun py-fetch-py-master-file () + "Lookup if a ‘py-master-file’ is specified. + +See also doku of variable ‘py-master-file’" + (interactive) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (when (re-search-forward "^ *# Local Variables:" nil (quote move) 1) + (when + (re-search-forward (concat "^\\( *# py-master-file: *\\)\"\\([^ \t]+\\)\" *$") nil t 1) + (setq py-master-file (match-string-no-properties 2)))))) + (when (called-interactively-p 'any) (message "%s" py-master-file))) + +(defun py-execute-import-or-reload (&optional shell) + "Import the current buffer's file in a Python interpreter. + +Optional SHELL +If the file has already been imported, then do reload instead to get +the latest version. + +If the file's name does not end in \".py\", then do execfile instead. + +If the current buffer is not visiting a file, do ‘py-execute-buffer’ +instead. + +If the file local variable ‘py-master-file’ is non-nil, import or +reload the named file instead of the buffer's file. The file may be +saved based on the value of ‘py-execute-import-or-reload-save-p’. + +See also ‘\\[py-execute-region]’. + +This may be preferable to ‘\\[py-execute-buffer]’ because: + + - Definitions stay in their module rather than appearing at top + level, where they would clutter the global namespace and not affect + uses of qualified names (MODULE.NAME). + + - The Python debugger gets line number information about the functions." + (interactive) + ;; Check file local variable py-master-file + (when py-master-file + (let* ((filename (expand-file-name py-master-file)) + (buffer (or (get-file-buffer filename) + (find-file-noselect filename)))) + (set-buffer buffer))) + (let ((py-shell-name (or shell (py-choose-shell))) + (file (py--buffer-filename-remote-maybe))) + (if file + (let ((proc (or + (ignore-errors (get-process (file-name-directory shell))) + (get-buffer-process (py-shell nil py-dedicated-process-p shell (or shell (default-value 'py-shell-name))))))) + ;; Maybe save some buffers + (save-some-buffers (not py-ask-about-save) nil) + (py--execute-file-base proc file + (if (string-match "\\.py$" file) + (let ((m (py--qualified-module-name (expand-file-name file)))) + (if (string-match "python2" py-shell-name) + (format "import sys\nif sys.modules.has_key('%s'):\n reload(%s)\nelse:\n import %s\n" m m m) + (format "import sys,imp\nif'%s' in sys.modules:\n imp.reload(%s)\nelse:\n import %s\n" m m m))) + ;; (format "execfile(r'%s')\n" file) + (py-which-execute-file-command file)))) + (py-execute-buffer)))) + +(defun py--qualified-module-name (file) + "Find the qualified module name for filename FILE. + +Basically, this goes down the directory tree as long as there are __init__.py files there." + (let ((rec #'(lambda (d f) + (let* ((dir (file-name-directory d)) + (initpy (concat dir "__init__.py"))) + (if (file-exists-p initpy) + (let ((d2 (directory-file-name d))) + (funcall rec (file-name-directory d2) + (concat (file-name-nondirectory d2) "." f))) + f))))) + (funcall rec (file-name-directory file) + (file-name-sans-extension (file-name-nondirectory file))))) + +;; Fixme: Try to define the function or class within the relevant +;; module, not just at top level. +(defun py-execute-defun () + "Send the current defun (class or method) to the Python process." + (interactive) + (save-excursion (py-execute-region (progn (beginning-of-defun) (point)) + (progn (end-of-defun) (point))))) + +(defun py-process-file (filename &optional output-buffer error-buffer) + "Process \"python FILENAME\". + +Optional OUTPUT-BUFFER and ERROR-BUFFER might be given." + (interactive "fDatei:") + (let ((coding-system-for-read 'utf-8) + (coding-system-for-write 'utf-8) + (output-buffer (or output-buffer (make-temp-name "py-process-file-output"))) + (pcmd (py-choose-shell))) + (unless (buffer-live-p output-buffer) + (set-buffer (get-buffer-create output-buffer))) + (shell-command (concat pcmd " " filename) output-buffer error-buffer) + (when py-switch-buffers-on-execute-p (switch-to-buffer output-buffer)))) + +(defvar py-last-exeption-buffer nil + "Internal use only - when ‘py-up-exception’ is called. + +In source-buffer, this will deliver the exception-buffer again.") + +(defun py-remove-overlays-at-point () + "Remove overlays as set when ‘py-highlight-error-source-p’ is non-nil." + (interactive "*") + (delete-overlay (car (overlays-at (point))))) + +(defun py-mouseto-exception (event) + "Jump to the code which caused the Python exception at EVENT. +EVENT is usually a mouse click." + (interactive "e") + (cond + ((fboundp 'event-point) + ;; XEmacs + (let* ((point (event-point event)) + (buffer (event-buffer event)) + (e (and point buffer (extent-at point buffer 'py-exc-info))) + (info (and e (extent-property e 'py-exc-info)))) + (message "Event point: %d, info: %s" point info) + (and info + (py--jump-to-exception (car info) nil (cdr info))))))) + +(defun py-goto-exception (&optional file line) + "Go to FILE and LINE indicated by the traceback." + (interactive) + (let ((file file) + (line line)) + (unless (and file line) + (save-excursion + (beginning-of-line) + (if (looking-at py-traceback-line-re) + (setq file (substring-no-properties (match-string 1)) + line (string-to-number (match-string 2)))))) + (if (not file) + (error "Not on a traceback line")) + (find-file file) + (goto-char (point-min)) + (forward-line (1- line)))) + +(defun py--find-next-exception (start buffer searchdir errwhere) + "Find the next Python exception and jump to the code that caused it. +START is the buffer position in BUFFER from which to begin searching +for an exception. SEARCHDIR is a function, either +‘re-search-backward’ or ‘re-search-forward’ indicating the direction +to search. ERRWHERE is used in an error message if the limit (top or +bottom) of the trackback stack is encountered." + (let (file line) + (save-excursion + (with-current-buffer buffer + (goto-char (py--point start)) + (if (funcall searchdir py-traceback-line-re nil t) + (setq file (match-string 1) + line (string-to-number (match-string 2)))))) + (if (and file line) + (py-goto-exception file line) + (error "%s of traceback" errwhere)))) + +(defun py-down-exception (&optional bottom) + "Go to the next line down in the traceback. +With \\[univeral-argument] (programmatically, optional argument +BOTTOM), jump to the bottom (innermost) exception in the exception +stack." + (interactive "P") + (let* ((proc (get-process "Python")) + (buffer (if proc "*Python*" py-output-buffer))) + (if bottom + (py--find-next-exception 'eob buffer 're-search-backward "Bottom") + (py--find-next-exception 'eol buffer 're-search-forward "Bottom")))) + +(defun py-up-exception (&optional top) + "Go to the previous line up in the traceback. +With \\[universal-argument] (programmatically, optional argument TOP) +jump to the top (outermost) exception in the exception stack." + (interactive "P") + (let* ((proc (get-process "Python")) + (buffer (if proc "*Python*" py-output-buffer))) + (if top + (py--find-next-exception 'bob buffer 're-search-forward "Top") + (py--find-next-exception 'bol buffer 're-search-backward "Top")))) +;; ; +;; obsolete by py--fetch-result +;; followed by py--fetch-error +;; still used by py--execute-ge24.3 +(defun py--postprocess-intern (&optional origline exception-buffer) + "Highlight exceptions found in BUF. + +Optional ORIGLINE EXCEPTION-BUFFER +If an exception occurred return error-string, otherwise return nil. +BUF must exist. + +Indicate LINE if code wasn't run from a file, thus remember line of source buffer" + (let* ((pmx (copy-marker (point-max))) + estring ecode erg) + ;; (switch-to-buffer (current-buffer)) + (goto-char pmx) + (sit-for 0.1 t) + (save-excursion + (unless (looking-back py-pdbtrack-input-prompt (line-beginning-position)) + (forward-line -1) + (end-of-line) + (when (or (re-search-backward py-shell-prompt-regexp nil t 1) + (re-search-backward (concat py-ipython-input-prompt-re "\\|" py-ipython-output-prompt-re) nil t 1)) + (save-excursion + (when (re-search-forward "File \"\\(.+\\)\", line \\([0-9]+\\)\\(.*\\)$" nil t) + (setq erg (copy-marker (point))) + (delete-region (progn (beginning-of-line) + (save-match-data + (when (looking-at + ;; all prompt-regexp known + py-fast-filter-re) + (goto-char (match-end 0)))) + + (skip-chars-forward " \t\r\n\f")(point)) (line-end-position)) + (insert (concat " File " (buffer-name exception-buffer) ", line " + (prin1-to-string origline))))) + ;; these are let-bound as ‘tempbuf’ + (and (boundp 'tempbuf) + ;; (message "%s" tempbuf) + (search-forward (buffer-name tempbuf) nil t) + (delete-region (line-beginning-position) (1+ (line-end-position)))) + ;; if no buffer-file exists, signal "Buffer", not "File(when + (when erg + (goto-char erg) + ;; (forward-char -1) + ;; (skip-chars-backward "^\t\r\n\f") + ;; (skip-chars-forward " \t") + (save-match-data + (and (not (py--buffer-filename-remote-maybe + (or + (get-buffer exception-buffer) + (get-buffer (file-name-nondirectory exception-buffer))))) + (string-match "^[ \t]*File" (buffer-substring-no-properties (point) (line-end-position))) + (looking-at "[ \t]*File") + (replace-match " Buffer"))) + (push origline py-error) + (push (buffer-name exception-buffer) py-error) + (forward-line 1) + (when (looking-at "[ \t]*\\([^\t\n\r\f]+\\)[ \t]*$") + (setq estring (match-string-no-properties 1)) + (setq ecode (replace-regexp-in-string "[ \n\t\f\r^]+" " " estring)) + (push 'py-error ecode)))))) + py-error)) + +(defun py--find-next-exception-prepare (direction start) + "According to DIRECTION and START setup exception regexps. + +Depends from kind of Python shell." + (let* ((name (get-process (substring (buffer-name (current-buffer)) 1 -1))) + (buffer (cond (name (buffer-name (current-buffer))) + ((buffer-live-p (get-buffer py-output-buffer)) + py-output-buffer) + (py-last-exeption-buffer (buffer-name py-last-exeption-buffer)) + (t (error "Don't see exeption buffer"))))) + (when buffer (set-buffer (get-buffer buffer))) + (if (eq direction 'up) + (if (string= start "TOP") + (py--find-next-exception 'bob buffer 're-search-forward "Top") + (py--find-next-exception 'bol buffer 're-search-backward "Top")) + (if (string= start "BOTTOM") + (py--find-next-exception 'eob buffer 're-search-backward "Bottom") + (py--find-next-exception 'eol buffer 're-search-forward "Bottom"))))) + +(defalias 'ipython-send-and-indent 'py-execute-line-ipython) +(defalias 'py-execute-region-in-shell 'py-execute-region) +(defalias 'py-ipython-shell-command-on-region 'py-execute-region-ipython) +(defalias 'py-shell-command-on-region 'py-execute-region) +(defalias 'py-send-region-ipython 'py-execute-region-ipython) +(defalias 'py-send-region 'py-execute-region) + +;; python-components-send +(defun py-output-buffer-filter (&optional beg end) + "Clear output buffer from py-shell-input prompt etc. + +Optional BEG END" + (interactive "*") + (let ((beg (cond (beg) + ((use-region-p) + (region-beginning)) + (t (point-min)))) + (end (cond (end (copy-marker end)) + ((use-region-p) + (copy-marker (region-end))) + (t (copy-marker (point-max)))))) + (goto-char beg) + (while (re-search-forward (concat "\\(" py-shell-input-prompt-1-regexp "\\|" py-shell-input-prompt-2-regexp "\\|" "^In \\[[0-9]+\\]: *" "\\)") end (quote move) 1) + (replace-match "")) + (goto-char beg))) + +(defun py-output-filter (strg) + "Clear STRG from py-shell-input prompt." + (interactive "*") + (let (erg) + (while + (not (equal erg (setq erg (replace-regexp-in-string + (concat "\\(\n\\|" py-shell-input-prompt-1-regexp "\\|" + py-shell-input-prompt-2-regexp "\\|" "^In \\[[0-9]+\\]: *" "\\)") "" strg)))) + (sit-for 0.1 t)) + erg)) + + +;; python-components-shell-complete + +(defalias 'py-script-complete 'py-shell-complete) +(defalias 'py-python2-shell-complete 'py-shell-complete) +(defalias 'py-python3-shell-complete 'py-shell-complete) + +(defun py--shell-completion-get-completions (input process completion-code) + "Retrieve available completions for INPUT using PROCESS. +Argument COMPLETION-CODE is the python code used to get +completions on the current context." + (let ((erg + (py--send-string-return-output + (format completion-code input) process))) + ;; (sit-for 0.2 t) + (if (and erg (> (length erg) 2)) + (setq erg (split-string erg "^'\\|^\"\\|;\\|'$\\|\"$" t)) + (and py-verbose-p (message "py--shell-completion-get-completions: %s" "Don't see a completion"))) + erg)) + +;; post-command-hook +;; caused insert-file-contents error lp:1293172 +(defun py--after-change-function (end) + "Restore window-confiuration after completion. + +Takes END" + (when + (and (or + (eq this-command 'completion-at-point) + (eq this-command 'choose-completion) + (eq this-command 'choose-completion) + (eq this-command 'py-shell-complete) + (and (or + (eq last-command 'completion-at-point) + (eq last-command 'choose-completion) + (eq last-command 'choose-completion) + (eq last-command 'py-shell-complete)) + (eq this-command 'self-insert-command)))) + (set-window-configuration + py-last-window-configuration)) + (goto-char end)) + +(defalias 'ipython-complete 'py-shell-complete) + +(defun py--try-completion-intern (input completion) + (let (erg) + (when (and (setq erg (try-completion input completion)) + (looking-back input (line-beginning-position)) + (not (string= input erg))) + (delete-region (match-beginning 0) (match-end 0)) + (insert erg)) + erg)) + +(defun py--try-completion (input completion) + "Repeat `try-completion' as long as match are found. + +Interal used. Takes INPUT COMPLETION" + (let (erg newlist) + (setq erg (py--try-completion-intern input completion)) + (when erg + (dolist (elt completion) + (unless (string= erg elt) + (push elt newlist))) + (if (< 1 (length newlist)) + (with-output-to-temp-buffer py-python-completions + (display-completion-list + (all-completions input (or newlist completion)))) + (set-window-configuration py-last-window-configuration)) + ;; (skip-chars-forward "^ \t\r\n\f") +))) + +(defun py--shell-insert-completion-maybe (completion input) + (cond ((eq completion t) + (and py-verbose-p (message "py--shell-do-completion-at-point %s" "`t' is returned, not completion. Might be a bug."))) + ((null completion) + (and py-verbose-p (message "py--shell-do-completion-at-point %s" "Don't see a completion"))) + ((and completion + (or (and (listp completion) + (string= input (car completion))) + (and (stringp completion) + (string= input completion))))) + ((and completion (stringp completion)(not (string= input completion))) + (progn (delete-char (- (length input))) + (insert completion))) + (t (py--try-completion input completion))) + ) + +(defun py--shell-do-completion-at-point (process imports input exception-buffer code) + "Do completion at point for PROCESS. + +Takes PROCESS IMPORTS INPUT EXCEPTION-BUFFER CODE" + (when imports + (py--send-string-no-output imports process)) + ;; (py--delay-process-dependent process) + (sit-for 0.1 t) + (let* ((completion + (py--shell-completion-get-completions + input process code))) + (set-buffer exception-buffer) + ;; (py--delay-process-dependent process) + ;; (sit-for 1 t) + (when completion + (py--shell-insert-completion-maybe completion input)))) + +(defun py--complete-base (shell word imports exception-buffer) + (let* ((shell (or shell (py-choose-shell))) + (proc (or + ;; completing inside a shell + (get-buffer-process exception-buffer) + (and (comint-check-proc shell) + (get-process shell)) + (prog1 + (get-buffer-process (py-shell nil nil shell)) + (sit-for py-new-shell-delay)))) + (buffer (process-buffer proc)) + (code (if (string-match "[Ii][Pp]ython*" shell) + (py-set-ipython-completion-command-string shell) + py-shell-module-completion-code))) + (py--python-send-completion-setup-code buffer) + (py--shell-do-completion-at-point proc imports word exception-buffer code))) + +(defun py--complete-prepare (&optional shell beg end word fast-complete) + (let* ((exception-buffer (current-buffer)) + ;; (pos (copy-marker (point))) + (pps (parse-partial-sexp + (or + (ignore-errors (cdr-safe comint-last-prompt)) + (ignore-errors comint-last-prompt) + (line-beginning-position)) + (point))) + (in-string (when (nth 3 pps) (nth 8 pps))) + (beg + (save-excursion + (or beg + (and in-string + ;; possible completion of filenames + (progn + (goto-char in-string) + (and + (save-excursion + (skip-chars-backward "^ \t\r\n\f")(looking-at "open"))) + + (skip-chars-forward "\"'")(point))) + (progn (and (eq (char-before) ?\()(forward-char -1)) + (skip-chars-backward "a-zA-Z0-9_.'") (point))))) + (end (or end (point))) + ;; + (word (or word (buffer-substring-no-properties beg end))) + (ausdruck (and (string-match "^/" word)(setq word (substring-no-properties word 1))(concat "\"" word "*\""))) + ;; when in string, assume looking for filename + (filenames (and in-string ausdruck + (list (replace-regexp-in-string "\n" "" (shell-command-to-string (concat "find / -maxdepth 1 -name " ausdruck)))))) + (imports (py-find-imports)) + py-fontify-shell-buffer-p erg) + (cond (fast-complete (py--fast-complete-base shell word imports)) + ((and in-string filenames) + (when (setq erg (try-completion (concat "/" word) filenames)) + (delete-region beg end) + (insert erg))) + (t (py--complete-base shell word imports exception-buffer))) + nil)) + +(defun py-shell-complete (&optional shell beg end word) + "Complete word before point, if any. + +Optional SHELL BEG END WORD" + (interactive) + ;; (save-excursion + ;; (and (buffer-live-p (get-buffer "*Python Completions*")) + ;; (py-kill-buffer-unconditional "*Python Completions*"))) + ;; fast-complete is called + (py--complete-prepare shell beg end word)) + +(defun py-indent-or-complete () + "Complete or indent depending on the context. + +If cursor is at end of a symbol, try to complete +Otherwise call `py-indent-line' + +If `(use-region-p)' returns t, indent region. +Use `C-q TAB' to insert a literally TAB-character + +In ‘python-mode’ `py-complete-function' is called, +in (I)Python shell-modes `py-shell-complete'" + (interactive "*") + (setq py-last-window-configuration + (current-window-configuration)) + (cond ((use-region-p) + (py-indent-region (region-beginning) (region-end))) + ((or (bolp) + (member (char-before)(list 9 10 12 13 32 ?: ?\) ?\] ?\})) + (not (looking-at "[ \t]*$"))) + (py-indent-line)) + ;; ((or (eq major-mode 'python-mode)(derived-mode-p 'python-mode)) (if (string-match "ipython" (py-choose-shell)) + ;; (py-shell-complete) + ;; (funcall py-complete-function))) + ((comint-check-proc (current-buffer)) + (py-shell-complete (substring (process-name (get-buffer-process (current-buffer))) 0 (string-match "<" (process-name (get-buffer-process (current-buffer))))))) + (t + (py-fast-complete)))) + +;; python-components-pdb + +(defun py-execute-statement-pdb () + "Execute statement running pdb." + (interactive) + (let ((py-python-command-args "-i -m pdb")) + (py-execute-statement))) + +(defun py-execute-region-pdb (beg end) + "Takes region between BEG END." + (interactive "r") + (let ((py-python-command-args "-i -m pdb"))) + (py-execute-region beg end)) + +(defun py-pdb-execute-statement () + "Execute statement running pdb." + (interactive) + (let ((stm (progn (py-statement) (car kill-ring)))) + (py-execute-string (concat "import pdb;pdb.run('" stm "')")))) + +(defun py-pdb-help () + "Print generic pdb.help() message." + (interactive) + (py-execute-string "import pdb;pdb.help()")) + +;; https://stackoverflow.com/questions/6980749/simpler-way-to-put-pdb-breakpoints-in-python-code +;; breakpoint at line 3 + +;; python -m pdb -c "b 3" -c c your_script.py + +(defun py-pdb-break-at-current-line () + "Set breakpoint at current line. + +Optional LINE FILE CONDITION" + (interactive) + (py-execute-string (concat "import pdb;pdb.break('" (py-count-lines) "')"))) + +(defun py--pdb-versioned () + "Guess existing pdb version from ‘py-shell-name’. + +Return \"pdb[VERSION]\" if executable found, just \"pdb\" otherwise" + (interactive) + (let ((erg (when (string-match "[23]" py-shell-name) + ;; versions-part + (substring py-shell-name (string-match "[23]" py-shell-name))))) + (if erg + (cond ((executable-find (concat "pdb" erg)) + (concat "pdb" erg)) + ((and (string-match "\\." erg) + (executable-find (concat "pdb" (substring erg 0 (string-match "\\." erg))))) + (concat "pdb" (substring erg 0 (string-match "\\." erg))))) + "pdb"))) + +(defun py-pdb (command-line) + "Run pdb on program FILE in buffer `*gud-FILE*'. +The directory containing FILE becomes the initial working directory +and source-file directory for your debugger. + +At GNU Linux required pdb version should be detected by `py--pdb-version' +at Windows configure `py-python-ms-pdb-command' + +lp:963253 +Argument COMMAND-LINE TBD." + (interactive + (progn + (require 'gud) + (list (gud-query-cmdline + (if (or (eq system-type 'ms-dos)(eq system-type 'windows-nt)) + (car (read-from-string py-python-ms-pdb-command)) + ;; sys.version_info[0] + ;; (car (read-from-string (py--pdb-version))) + 'pdb) + (py--buffer-filename-remote-maybe))))) + (pdb command-line)) + +(defun py--pdb-current-executable () + "When ‘py-pdb-executable’ is set, return it. + +Otherwise return resuslt from `executable-find'" + (or py-pdb-executable + (executable-find "pdb"))) + +(defun py-update-gud-pdb-history () + "If pdb is called at a Python buffer, put it's file name at the head of `gud-pdb-history'." + (interactive) + (let* (;; PATH/TO/pdb + (first (cond ((and gud-pdb-history (ignore-errors (car gud-pdb-history))) + (replace-regexp-in-string "^\\([^ ]+\\) +.+$" "\\1" (car gud-pdb-history))) + (py-pdb-executable + py-pdb-executable) + ((or (eq system-type 'ms-dos)(eq system-type 'windows-nt)) + ;; lp:963253 + "c:/python27/python\ -i\ c:/python27/Lib/pdb.py") + (t + (py--pdb-current-executable)))) + ;; file to debug + (second (cond ((not (ignore-errors + (py--buffer-filename-remote-maybe))) + (error "%s" "Buffer must be saved first.")) + ((py--buffer-filename-remote-maybe)) + (t (and gud-pdb-history (stringp (car gud-pdb-history)) (replace-regexp-in-string "^\\([^ ]+\\) +\\(.+\\)$" "\\2" (car gud-pdb-history)))))) + (erg (and first second (concat first " " second)))) + (when erg + (push erg gud-pdb-history)))) + +(defadvice pdb (before gud-query-cmdline activate) + "Provide a better default command line when called interactively." + (interactive + (list (gud-query-cmdline py-pdb-path + ;; (file-name-nondirectory buffer-file-name) + (file-name-nondirectory (py--buffer-filename-remote-maybe)) )))) + +;; tbreak [ ([filename:]lineno | function) [, condition] ] +;; Same arguments as break, but sets a temporary breakpoint: it +;; is automatically deleted when first hit. + +;; python -m pdb -c "b 3" -c c your_script.py + +(defun py-pdb-tbreak () + "Insert a temporary break." + (interactive) + (let ( + (py-python-command-args '("-i -c \"b 30\" -c c \"eyp.py\"")) + (py-python3-command-args '("-i -c \"b 30\" -c c \"eyp.py\"")) + ) + (py-execute-buffer))) + + +;; python-components-pdbtrack + +;; pdbtrack constants +(defconst py-pdbtrack-stack-entry-regexp + (concat ".*\\("py-shell-input-prompt-1-regexp">\\|"py-ipython-input-prompt-re">\\|>\\) *\\(.*\\)(\\([0-9]+\\))\\([?a-zA-Z0-9_<>()]+\\)()") + "Regular expression pdbtrack uses to find a stack trace entry.") + +(defconst py-pdbtrack-marker-regexp-file-group 2 + "Group position in gud-pydb-marker-regexp that matches the file name.") + +(defconst py-pdbtrack-marker-regexp-line-group 3 + "Group position in gud-pydb-marker-regexp that matches the line number.") + +(defconst py-pdbtrack-marker-regexp-funcname-group 4 + "Group position in gud-pydb-marker-regexp that matches the function name.") + +(defconst py-pdbtrack-track-range 10000 + "Max number of characters from end of buffer to search for stack entry.") + +(defvar py-pdbtrack-is-tracking-p nil) + +(defun py--pdbtrack-overlay-arrow (activation) + "Activate or de arrow at beginning-of-line in current buffer." + ;; This was derived/simplified from edebug-overlay-arrow + (cond (activation + (setq overlay-arrow-position (make-marker)) + (setq overlay-arrow-string "=>") + (set-marker overlay-arrow-position (line-beginning-position) (current-buffer)) + (setq py-pdbtrack-is-tracking-p t)) + (overlay-arrow-position + (setq overlay-arrow-position nil) + (setq py-pdbtrack-is-tracking-p nil)))) + +(defun py--pdbtrack-track-stack-file (text) + "Show the file indicated by the pdb stack entry line, in a separate window. + +Activity is disabled if the buffer-local variable +`py-pdbtrack-do-tracking-p' is nil. + +We depend on the pdb input prompt matching `py-pdbtrack-input-prompt' +at the beginning of the line. + +If the traceback target file path is invalid, we look for the most +recently visited python-mode buffer which either has the name of the +current function \(or class) or which defines the function \(or +class). This is to provide for remote scripts, eg, Zope's 'Script +\(Python)' - put a _copy_ of the script in a buffer named for the +script, and set to python-mode, and pdbtrack will find it.)" + ;; Instead of trying to piece things together from partial text + ;; (which can be almost useless depending on Emacs version), we + ;; monitor to the point where we have the next pdb prompt, and then + ;; check all text from comint-last-input-end to process-mark. + ;; + ;; Also, we're very conservative about clearing the overlay arrow, + ;; to minimize residue. This means, for instance, that executing + ;; other pdb commands wipe out the highlight. You can always do a + ;; 'where' (aka 'w') command to reveal the overlay arrow. + (let* ((origbuf (current-buffer)) + (currproc (get-buffer-process origbuf))) + + (if (not (and currproc py-pdbtrack-do-tracking-p)) + (py--pdbtrack-overlay-arrow nil) + + (let* ((procmark (process-mark currproc)) + (block (buffer-substring (max comint-last-input-end + (- procmark + py-pdbtrack-track-range)) + procmark)) + target target_fname target_lineno target_buffer) + + (if (not (string-match (concat py-pdbtrack-input-prompt "$") block)) + (py--pdbtrack-overlay-arrow nil) + + (setq target (py--pdbtrack-get-source-buffer block)) + + (if (stringp target) + (message "pdbtrack: %s" target) + + (setq target_lineno (car target)) + (setq target_buffer (cadr target)) + (setq target_fname + (py--buffer-filename-remote-maybe target_buffer)) + (switch-to-buffer-other-window target_buffer) + (goto-char (point-min)) + (forward-line (1- target_lineno)) + (message "pdbtrack: line %s, file %s" target_lineno target_fname) + (py--pdbtrack-overlay-arrow t) + (pop-to-buffer origbuf t))))))) + +(defun py--pdbtrack-map-filename (filename) + + (let + ((replacement-val (assoc-default + filename py-pdbtrack-filename-mapping + (lambda (mapkey path) + (string-match + (concat "^" (regexp-quote mapkey)) + path))) + )) + (if (not (eq replacement-val nil)) + (replace-match replacement-val 't 't filename) + filename))) + +(defun py--pdbtrack-get-source-buffer (block) + "Return line number and buffer of code indicated by block's traceback text. + +We look first to visit the file indicated in the trace. + +Failing that, we look for the most recently visited python-mode buffer +with the same name or having the named function. + +If we're unable find the source code we return a string describing the +problem as best as we can determine." + + (if (and (not (string-match py-pdbtrack-stack-entry-regexp block)) + ;; pydb integration still to be done + ;; (not (string-match py-pydbtrack-stack-entry-regexp block)) + ) + (prog1 + "Traceback cue not found" + (message "Block: %s" block)) + (let* ((remote-prefix (or (file-remote-p default-directory) "")) + (filename (concat remote-prefix + (match-string + py-pdbtrack-marker-regexp-file-group block))) + (lineno (string-to-number (match-string + py-pdbtrack-marker-regexp-line-group + block))) + (funcname (match-string py-pdbtrack-marker-regexp-funcname-group + block)) + funcbuffer) + + (cond ((string= filename "") + (format "(Skipping empty filename)")) + + ((file-exists-p filename) + (list lineno (find-file-noselect filename))) + + ((file-exists-p (py--pdbtrack-map-filename filename)) + (list lineno (find-file-noselect (py--pdbtrack-map-filename filename)))) + + ((setq funcbuffer (py--pdbtrack-grub-for-buffer funcname lineno)) + (if (string-match "/Script (Python)$" filename) + ;; Add in number of lines for leading '##' comments: + (setq lineno + (+ lineno + (save-excursion + (with-current-buffer funcbuffer + (count-lines + (point-min) + (max (point-min) + (string-match "^\\([^#]\\|#[^#]\\|#$\\)" + (buffer-substring (point-min) + (point-max)))))))))) + (list lineno funcbuffer)) + + ((= (elt filename 0) ?\<) + (format "(Non-file source: '%s')" filename)) + + (t (format "Not found: %s(), %s" funcname filename)))))) + +(defun py--pdbtrack-grub-for-buffer (funcname lineno) + "Find most recent buffer itself named or having function funcname. + +We walk the buffer-list history for python-mode buffers that are +named for funcname or define a function funcname." + (let ((buffers (buffer-list)) + buf + got) + (while (and buffers (not got)) + (setq buf (car buffers) + buffers (cdr buffers)) + (if (and (save-excursion + (with-current-buffer buf + (string= major-mode "python-mode"))) + (or (string-match funcname (buffer-name buf)) + (string-match (concat "^\\s-*\\(def\\|class\\)\\s-+" + funcname "\\s-*(") + (save-excursion + (with-current-buffer buf + (buffer-substring (point-min) + (point-max))))))) + (setq got buf))) + got)) + + +;; pdbtrack functions +(defun py-pdbtrack-toggle-stack-tracking (arg) + "Set variable `py-pdbtrack-do-tracking-p'. " + (interactive "P") + ;; (if (not (get-buffer-process (current-buffer))) + ;; (error "No process associated with buffer '%s'" (current-buffer))) + + ;; missing or 0 is toggle, >0 turn on, <0 turn off + (cond ((not arg) + (setq py-pdbtrack-do-tracking-p (not py-pdbtrack-do-tracking-p))) + ((zerop (prefix-numeric-value arg)) + (setq py-pdbtrack-do-tracking-p nil)) + ((> (prefix-numeric-value arg) 0) + (setq py-pdbtrack-do-tracking-p t))) + ;; (if py-pdbtrack-do-tracking-p + ;; (progn + ;; (add-hook 'comint-output-filter-functions 'py--pdbtrack-track-stack-file t) + ;; (remove-hook 'comint-output-filter-functions 'python-pdbtrack-track-stack-file t)) + ;; (remove-hook 'comint-output-filter-functions 'py--pdbtrack-track-stack-file t) + ;; ) + (message "%sabled Python's pdbtrack" + (if py-pdbtrack-do-tracking-p "En" "Dis"))) + +(defun turn-on-pdbtrack () + (interactive) + (py-pdbtrack-toggle-stack-tracking 1)) + +(defun turn-off-pdbtrack () + (interactive) + (py-pdbtrack-toggle-stack-tracking 0)) + +;; python-components-help +(defvar py-eldoc-string-code + "__PYDOC_get_help('''%s''')\n" + "Python code used to get a string with the documentation of an object.") + +(defalias 'py-eldoc 'py-eldoc-function) + +;; Info-look functionality. +(require 'info-look) +(eval-when-compile (require 'info)) + +(defun py-info-lookup-symbol () + "Call ‘info-lookup-symbol’. + +Sends help if stuff is missing." + (interactive) + (if (functionp 'pydoc-info-add-help) + (call-interactively 'info-lookup-symbol) + (message "pydoc-info-add-help not found. Please check INSTALL-INFO-FILES"))) + +(info-lookup-add-help + :mode 'python-mode + :regexp "[[:alnum:]_]+" + :doc-spec +'(("(python)Index" nil ""))) + +(defun python-after-info-look () + "Set up info-look for Python. + +Tries to take account of versioned Python Info files, e.g. Debian's +python2.5-ref.info.gz. +Used with ‘eval-after-load’." + (let* ((version (let ((s (shell-command-to-string (concat py-python-command + " -V")))) + (string-match "^Python \\([0-9]+\\.[0-9]+\\>\\)" s) + (match-string 1 s))) + ;; Whether info files have a Python version suffix, e.g. in Debian. + (versioned + (with-temp-buffer + (Info-mode) + ;; First look for Info files corresponding to the version + ;; of the interpreter we're running. + (condition-case () + ;; Don't use ‘info’ because it would pop-up a *info* buffer. + (progn + (Info-goto-node (format "(python%s-lib)Miscellaneous Index" + version)) + t) + (error + ;; Otherwise see if we actually have an un-versioned one. + (condition-case () + (progn + (Info-goto-node + (format "(python-lib)Miscellaneous Index" version)) + nil) + (error + ;; Otherwise look for any versioned Info file. + (condition-case () + (let (found) + (dolist (dir (or Info-directory-list + Info-default-directory-list)) + (unless found + (let ((file (car (file-expand-wildcards + (expand-file-name "python*-lib*" + dir))))) + (if (and file + (string-match + "\\\\)-" + file)) + (setq version (match-string 1 file) + found t))))) + found) + (error))))))))) + (info-lookup-maybe-add-help + :mode 'python-mode + :regexp "[[:alnum:]_]+" + :doc-spec + ;; Fixme: Can this reasonably be made specific to indices with + ;; different rules? Is the order of indices optimal? + ;; (Miscellaneous in -ref first prefers lookup of keywords, for + ;; instance.) + (if versioned + ;; The empty prefix just gets us highlighted terms. + `((,(concat "(python" version "-ref)Miscellaneous Index")) + (,(concat "(python" version "-ref)Module Index")) + (,(concat "(python" version "-ref)Function-Method-Variable Index")) + (,(concat "(python" version "-ref)Class-Exception-Object Index")) + (,(concat "(python" version "-lib)Module Index")) + (,(concat "(python" version "-lib)Class-Exception-Object Index")) + (,(concat "(python" version "-lib)Function-Method-Variable Index")) + (,(concat "(python" version "-lib)Miscellaneous Index"))) + '(("(python-ref)Miscellaneous Index") + ("(python-ref)Module Index") + ("(python-ref)Function-Method-Variable Index") + ("(python-ref)Class-Exception-Object Index") + ("(python-lib)Module Index") + ("(python-lib)Class-Exception-Object Index") + ("(python-lib)Function-Method-Variable Index") + ("(python-lib)Miscellaneous Index")))))) + +;; (if (featurep 'info-look) +;; (python-after-info-look)) + +;; (eval-after-load "info-look" '(python-after-info-look)) + +;; ; +(defun py--warn-tmp-files-left () + "Detect and warn about file of form \"py11046IoE\" in py-temp-directory." + (let ((erg1 (file-readable-p (concat py-temp-directory (char-to-string py-separator-char) (car (directory-files py-temp-directory nil "py[[:alnum:]]+$")))))) + (when (and py-verbose-p erg1) + (message "py--warn-tmp-files-left: %s ?" (concat py-temp-directory (char-to-string py-separator-char) (car (directory-files py-temp-directory nil "py[[:alnum:]]*$"))))))) + +(defun py-fetch-docu () + "Lookup in current buffer for the doku for the symbol at point. + +Useful for newly defined symbol, not known to python yet." + (interactive) + (let* ((symb (prin1-to-string (symbol-at-point))) + erg) + (save-restriction + (widen) + (goto-char (point-min)) + (when (re-search-forward (concat py-def-or-class-re " *" symb) nil (quote move) 1) + (forward-line 1) + (when (looking-at "[ \t]*\"\"\"\\|[ \t]*'''\\|[ \t]*'[^]+\\|[ \t]*\"[^\"]+") + (goto-char (match-end 0)) + (setq erg (buffer-substring-no-properties (match-beginning 0) (re-search-forward "\"\"\"\\|'''" nil 'move))) + (when erg + (set-buffer (get-buffer-create "*Python-Help*")) + (erase-buffer) + (when (called-interactively-p 'any) (switch-to-buffer (current-buffer))) + (insert erg))))))) + +(defun py-info-current-defun (&optional include-type) + "Return name of surrounding function. + +Use Python compatible dotted expression syntax +Optional argument INCLUDE-TYPE indicates to include the type of the defun. +This function is compatible to be used as +‘add-log-current-defun-function’ since it returns nil if point is +not inside a defun." + (interactive) + (let ((names '()) + (min-indent) + (first-run t)) + (save-restriction + (widen) + (save-excursion + (goto-char (line-end-position)) + (forward-comment -9999) + (setq min-indent (current-indentation)) + (while (py-beginning-of-def-or-class) + (when (or (< (current-indentation) min-indent) + first-run) + (setq first-run nil) + (setq min-indent (current-indentation)) + (looking-at py-def-or-class-re) + (setq names (cons + (if (not include-type) + (match-string-no-properties 1) + (mapconcat 'identity + (split-string + (match-string-no-properties 0)) " ")) + names)))))) + (when names + (mapconcat (lambda (strg) strg) names ".")))) + +(defalias 'py-describe-symbol 'py-help-at-point) +(defalias 'py-eldoc-function 'py-help-at-point) +(defun py--help-at-point-intern (orig) + (let* ((beg (point)) + (end (progn (skip-chars-forward "a-zA-Z0-9_." (line-end-position))(point))) + (sym (buffer-substring-no-properties beg end)) + (origfile (py--buffer-filename-remote-maybe)) + (temp (md5 (buffer-name))) + (file (concat (py--normalize-directory py-temp-directory) temp "-py-help-at-point.py")) + (cmd (py-find-imports)) + ;; if symbol is defined in current buffer, go to + (erg (progn (goto-char (point-min)) + (when + (re-search-forward (concat "^[ \t]*def " sym "(") nil t 1) + (forward-char -2) + (point))))) + (if erg + (progn (push-mark orig)(push-mark (point)) + (when (and (called-interactively-p 'any) py-verbose-p) (message "Jump to previous position with %s" "C-u C- C-u C-"))) + (goto-char orig)) + ;; (when cmd + ;; (setq cmd (mapconcat + ;; (lambda (arg) (concat "try: " arg "\nexcept: pass\n")) + ;; (split-string cmd ";" t) + ;; ""))) + (setq cmd (concat cmd "\nimport pydoc\n" + )) + (when (not py-remove-cwd-from-path) + (setq cmd (concat cmd "import sys\n" + "sys.path.insert(0, '" + (file-name-directory origfile) "')\n"))) + (setq cmd (concat cmd "pydoc.help('" sym "')\n")) + (with-temp-buffer + (insert cmd) + (write-file file)) + (py-process-file file "*Python-Help*") + (when (file-readable-p file) + (unless py-debug-p (delete-file file))))) + +(defun py-help-at-point () + "Print help on symbol at point. + +If symbol is defined in current buffer, jump to it's definition" + (interactive) + (let ((orig (point))) + ;; avoid repeated call at identic pos + (unless (eq orig (ignore-errors py-last-position)) + (setq py-last-position orig)) + (unless (member (get-buffer-window "*Python-Help*")(window-list)) + (window-configuration-to-register py-windows-config-register)) + (and (looking-back "(" (line-beginning-position))(not (looking-at "\\sw")) (forward-char -1)) + (if (or (eq (face-at-point) 'font-lock-string-face)(eq (face-at-point) 'font-lock-comment-face)) + (progn + (py-restore-window-configuration) + (goto-char orig)) + (if (or (< 0 (abs (skip-chars-backward "a-zA-Z0-9_." (line-beginning-position))))(looking-at "\\sw")) + (py--help-at-point-intern orig) + (py-restore-window-configuration))))) + +;; Documentation functions + +;; dump the long form of the mode blurb; does the usual doc escapes, +;; plus lines of the form ^[vc]:name\$ to suck variable & command docs +;; out of the right places, along with the keys they're on & current +;; values + +(defun py--dump-help-string (str) + (with-output-to-temp-buffer "*Help*" + (let ((locals (buffer-local-variables)) + funckind funcname func funcdoc + (start 0) mstart end + keys) + (while (string-match "^%\\([vc]\\):\\(.+\\)\n" str start) + (setq mstart (match-beginning 0) end (match-end 0) + funckind (substring str (match-beginning 1) (match-end 1)) + funcname (substring str (match-beginning 2) (match-end 2)) + func (intern funcname)) + (princ (substitute-command-keys (substring str start mstart))) + (cond + ((equal funckind "c") ; command + (setq funcdoc (documentation func) + keys (concat + "Key(s): " + (mapconcat 'key-description + (where-is-internal func python-mode-map) + ", ")))) + ((equal funckind "v") ; variable + (setq funcdoc (documentation-property func 'variable-documentation) + keys (if (assq func locals) + (concat + "Local/Global values: " + (prin1-to-string (symbol-value func)) + " / " + (prin1-to-string (default-value func))) + (concat + "Value: " + (prin1-to-string (symbol-value func)))))) + (t ; unexpected + (error "Error in py--dump-help-string, tag %s" funckind))) + (princ (format "\n-> %s:\t%s\t%s\n\n" + (if (equal funckind "c") "Command" "Variable") + funcname keys)) + (princ funcdoc) + (terpri) + (setq start end)) + (princ (substitute-command-keys (substring str start))) + ;; (and comint-vars-p (py-report-comint-variable-setting)) + ) + (if (featurep 'xemacs) (print-help-return-message) + (help-print-return-message)))) + +(defun py-describe-mode () + "Dump long form of ‘python-mode’ docs." + (interactive) + (py--dump-help-string "Major mode for editing Python files. +Knows about Python indentation, tokens, comments and continuation lines. +Paragraphs are separated by blank lines only. + +Major sections below begin with the string ‘@’; specific function and +variable docs begin with ->. + +@EXECUTING PYTHON CODE + +\\[py-execute-import-or-reload]\timports or reloads the file in the Python interpreter +\\[py-execute-buffer]\tsends the entire buffer to the Python interpreter +\\[py-execute-region]\tsends the current region +\\[py-execute-def-or-class]\tsends the current function or class definition +\\[py-execute-string]\tsends an arbitrary string +\\[py-shell]\tstarts a Python interpreter window; this will be used by +\tsubsequent Python execution commands +%c:py-execute-import-or-reload +%c:py-execute-buffer +%c:py-execute-region +%c:py-execute-def-or-class +%c:py-execute-string +%c:py-shell + +@VARIABLES + +py-install-directory\twherefrom ‘python-mode’ looks for extensions +py-indent-offset\tindentation increment +py-block-comment-prefix\tcomment string used by comment-region + +py-shell-name\tshell command to invoke Python interpreter +py-temp-directory\tdirectory used for temp files (if needed) + +py-beep-if-tab-change\tring the bell if tab-width is changed +%v:py-install-directory +%v:py-indent-offset +%v:py-block-comment-prefix +%v:py-shell-name +%v:py-temp-directory +%v:py-beep-if-tab-change + +@KINDS OF LINES + +Each physical line in the file is either a ‘continuation line’ (the +preceding line ends with a backslash that's not part of a comment, or +the paren/bracket/brace nesting level at the start of the line is +non-zero, or both) or an ‘initial line’ (everything else). + +An initial line is in turn a ‘blank line’ (contains nothing except +possibly blanks or tabs), a ‘comment line’ (leftmost non-blank +character is ‘#’), or a ‘code line’ (everything else). + +Comment Lines + +Although all comment lines are treated alike by Python, Python mode +recognizes two kinds that act differently with respect to indentation. + +An ‘indenting comment line’ is a comment line with a blank, tab or +nothing after the initial ‘#’. The indentation commands (see below) +treat these exactly as if they were code lines: a line following an +indenting comment line will be indented like the comment line. All +other comment lines (those with a non-whitespace character immediately +following the initial ‘#’) are ‘non-indenting comment lines’, and +their indentation is ignored by the indentation commands. + +Indenting comment lines are by far the usual case, and should be used +whenever possible. Non-indenting comment lines are useful in cases +like these: + +\ta = b # a very wordy single-line comment that ends up being +\t #... continued onto another line + +\tif a == b: +##\t\tprint 'panic!' # old code we've ‘commented out’ +\t\treturn a + +Since the ‘#...’ and ‘##’ comment lines have a non-whitespace +character following the initial ‘#’, Python mode ignores them when +computing the proper indentation for the next line. + +Continuation Lines and Statements + +The ‘python-mode’ commands generally work on statements instead of on +individual lines, where a ‘statement’ is a comment or blank line, or a +code line and all of its following continuation lines (if any) +considered as a single logical unit. The commands in this mode +generally (when it makes sense) automatically move to the start of the +statement containing point, even if point happens to be in the middle +of some continuation line. + +@INDENTATION + +Primarily for entering new code: +\t\\[indent-for-tab-command]\t indent line appropriately +\t\\[py-newline-and-indent]\t insert newline, then indent +\t\\[py-electric-backspace]\t reduce indentation, or delete single character + +Primarily for reindenting existing code: +\t\\[py-guess-indent-offset]\t guess py-indent-offset from file content; change locally +\t\\[universal-argument] \\[py-guess-indent-offset]\t ditto, but change globally + +\t\\[py-indent-region]\t reindent region to match its context +\t\\[py-shift-left]\t shift line or region left by py-indent-offset +\t\\[py-shift-right]\t shift line or region right by py-indent-offset + +Unlike most programming languages, Python uses indentation, and only +indentation, to specify block structure. Hence the indentation supplied +automatically by ‘python-mode’ is just an educated guess: only you know +the block structure you intend, so only you can supply correct +indentation. + +The \\[indent-for-tab-command] and \\[py-newline-and-indent] keys try to suggest plausible indentation, based on +the indentation of preceding statements. E.g., assuming +py-indent-offset is 4, after you enter +\tif a > 0: \\[py-newline-and-indent] +the cursor will be moved to the position of the ‘_’ (_ is not a +character in the file, it's just used here to indicate the location of +the cursor): +\tif a > 0: +\t _ +If you then enter ‘c = d’ \\[py-newline-and-indent], the cursor will move +to +\tif a > 0: +\t c = d +\t _ +‘python-mode’ cannot know whether that's what you intended, or whether +\tif a > 0: +\t c = d +\t_ +was your intent. In general, ‘python-mode’ either reproduces the +indentation of the (closest code or indenting-comment) preceding +statement, or adds an extra py-indent-offset blanks if the preceding +statement has ‘:’ as its last significant (non-whitespace and non- +comment) character. If the suggested indentation is too much, use +\\[py-electric-backspace] to reduce it. + +Continuation lines are given extra indentation. If you don't like the +suggested indentation, change it to something you do like, and Python- +mode will strive to indent later lines of the statement in the same way. + +If a line is a continuation line by virtue of being in an unclosed +paren/bracket/brace structure (‘list’, for short), the suggested +indentation depends on whether the current line contains the first item +in the list. If it does, it's indented py-indent-offset columns beyond +the indentation of the line containing the open bracket. If you don't +like that, change it by hand. The remaining items in the list will mimic +whatever indentation you give to the first item. + +If a line is a continuation line because the line preceding it ends with +a backslash, the third and following lines of the statement inherit their +indentation from the line preceding them. The indentation of the second +line in the statement depends on the form of the first (base) line: if +the base line is an assignment statement with anything more interesting +than the backslash following the leftmost assigning ‘=’, the second line +is indented two columns beyond that ‘=’. Else it's indented to two +columns beyond the leftmost solid chunk of non-whitespace characters on +the base line. + +Warning: indent-region should not normally be used! It calls \\[indent-for-tab-command] +repeatedly, and as explained above, \\[indent-for-tab-command] can't guess the block +structure you intend. +%c:indent-for-tab-command +%c:py-newline-and-indent +%c:py-electric-backspace + +The next function may be handy when editing code you didn't write: +%c:py-guess-indent-offset + +The remaining ‘indent’ functions apply to a region of Python code. They +assume the block structure (equals indentation, in Python) of the region +is correct, and alter the indentation in various ways while preserving +the block structure: +%c:py-indent-region +%c:py-shift-left +%c:py-shift-right + +@MARKING & MANIPULATING REGIONS OF CODE + +\\[py-mark-block]\t mark block of lines +\\[py-mark-def-or-class]\t mark smallest enclosing def +\\[universal-argument] \\[py-mark-def-or-class]\t mark smallest enclosing class +\\[comment-region]\t comment out region of code +\\[universal-argument] \\[comment-region]\t uncomment region of code +%c:py-mark-block +%c:py-mark-def-or-class +%c:comment-region + +@MOVING POINT + +\\[py-previous-statement]\t move to statement preceding point +\\[py-next-statement]\t move to statement following point +\\[py-goto-block-up]\t move up to start of current block +\\[py-beginning-of-def-or-class]\t move to start of def +\\[universal-argument] \\[py-beginning-of-def-or-class]\t move to start of class +\\[py-end-of-def-or-class]\t move to end of def +\\[universal-argument] \\[py-end-of-def-or-class]\t move to end of class + +The first two move to one statement beyond the statement that contains +point. A numeric prefix argument tells them to move that many +statements instead. Blank lines, comment lines, and continuation lines +do not count as ‘statements’ for these commands. So, e.g., you can go +to the first code statement in a file by entering +\t\\[beginning-of-buffer]\t to move to the top of the file +\t\\[py-next-statement]\t to skip over initial comments and blank lines +Or do \\[py-previous-statement] with a huge prefix argument. +%c:py-previous-statement +%c:py-next-statement +%c:py-goto-block-up +%c:py-beginning-of-def-or-class +%c:py-end-of-def-or-class + +@LITTLE-KNOWN EMACS COMMANDS PARTICULARLY USEFUL IN PYTHON MODE + +\\[indent-new-comment-line] is handy for entering a multi-line comment. + +\\[set-selective-display] with a ‘small’ prefix arg is ideally suited for viewing the +overall class and def structure of a module. + +‘\\[back-to-indentation]’ moves point to a line's first non-blank character. + +‘\\[indent-relative]’ is handy for creating odd indentation. + +@OTHER EMACS HINTS + +If you don't like the default value of a variable, change its value to +whatever you do like by putting a ‘setq’ line in your .emacs file. +E.g., to set the indentation increment to 4, put this line in your +.emacs: +\t(setq py-indent-offset 4) +To see the value of a variable, do ‘\\[describe-variable]’ and enter the variable +name at the prompt. + +When entering a key sequence like ‘C-c C-n’, it is not necessary to +release the CONTROL key after doing the ‘C-c’ part -- it suffices to +press the CONTROL key, press and release ‘c’ (while still holding down +CONTROL), press and release ‘n’ (while still holding down CONTROL), & +then release CONTROL. + +Entering Python mode calls with no arguments the value of the variable +‘python-mode-hook’, if that value exists and is not nil; for backward +compatibility it also tries ‘py-mode-hook’; see the ‘Hooks’ section of +the Elisp manual for details. + +Obscure: When python-mode is first loaded, it looks for all bindings +to newline-and-indent in the global keymap, and shadows them with +local bindings to py-newline-and-indent.")) + +;; (require 'info-look) +;; The info-look package does not always provide this function (it +;; appears this is the case with XEmacs 21.1) +(when (fboundp 'info-lookup-maybe-add-help) + (info-lookup-maybe-add-help + :mode 'python-mode + :regexp "[a-zA-Z0-9_]+" + :doc-spec '(("(python-lib)Module Index") + ("(python-lib)Class-Exception-Object Index") + ("(python-lib)Function-Method-Variable Index") + ("(python-lib)Miscellaneous Index")))) + +(defun py--find-definition-in-source (sourcefile symbol) + (called-interactively-p 'any) (message "sourcefile: %s" sourcefile) + (when (find-file sourcefile) + ;; (if (stringp py-separator-char) + ;; py-separator-char + ;; (char-to-string py-separator-char)) + + (goto-char (point-min)) + (when + (or (re-search-forward (concat py-def-or-class-re symbol) nil t 1) + (progn + ;; maybe a variable definition? + (goto-char (point-min)) + (re-search-forward (concat "^.+ " symbol) nil t 1))) + (push-mark) + (goto-char (match-beginning 0)) + (exchange-point-and-mark)))) + +;; Find function stuff, lifted from python.el +(defalias 'py-find-function 'py-find-definition) +(defun py--find-definition-question-type (symbol imports) + (let (erg) + (cond ((setq erg (py--send-string-return-output (concat "import inspect;inspect.isbuiltin(\"" symbol "\")")))) + (t (setq erg (py--send-string-return-output (concat imports "import inspect;inspect.getmodule(\"" symbol "\")"))))) + erg)) + +(defun py-find-definition (&optional symbol) + "Find source of definition of SYMBOL. + +Interactively, prompt for SYMBOL." + (interactive) + ;; (set-register 98888888 (list (current-window-configuration) (point-marker))) + (let* ((last-window-configuration + (current-window-configuration)) + (exception-buffer (current-buffer)) + (imports (py-find-imports)) + (symbol (or symbol (with-syntax-table py-dotted-expression-syntax-table + (current-word)))) + (enable-recursive-minibuffers t) + (symbol + (if (called-interactively-p 'any) + (read-string (if symbol + (format "Find location of (default %s): " symbol) + "Find location of: ") + nil nil symbol) + symbol)) + (local (or + (py--until-found (concat "class " symbol) imenu--index-alist) + (py--until-found symbol imenu--index-alist))) + erg sourcefile) + ;; ismethod(), isclass(), isfunction() or isbuiltin() + ;; ismethod isclass isfunction isbuiltin) + (if local + (if (numberp local) + (progn + (goto-char local) + (search-forward symbol (line-end-position) nil 1) + (push-mark) + (setq erg (buffer-substring-no-properties (line-beginning-position) (match-end 0))) + (goto-char (match-beginning 0)) + (exchange-point-and-mark)) + (error "%s" "local not a number")) + (setq erg (py--find-definition-question-type symbol imports)) + (if erg + (cond ((string-match "SyntaxError" erg) + (setq erg (substring-no-properties erg (match-beginning 0))) + (set-window-configuration last-window-configuration) + ;; (jump-to-register 98888888) + (message "Can't get source: %s" erg)) + ((and erg (string-match "builtin" erg)) + (progn + (set-window-configuration last-window-configuration) + ;; (jump-to-register 98888888) + (message "%s" erg))) + ((and erg (setq erg (replace-regexp-in-string "'" "" (py--send-string-return-output "import os;os.getcwd()"))) + (setq sourcefile (replace-regexp-in-string "'" "" (py--send-string-return-output (concat "inspect.getsourcefile(" symbol ")"))))) + (message "%s" sourcefile) + (py--find-definition-in-source sourcefile symbol) + (display-buffer exception-buffer))) + (error "Couldn't find source, please consider a bug-report")) + erg))) + +(defun py-find-imports () + "Find top-level imports. + +Returns imports" + (interactive) + (let (imports erg) + (save-excursion + (if (eq major-mode 'comint-mode) + (progn + (re-search-backward comint-prompt-regexp nil t 1) + (goto-char (match-end 0)) + (while (re-search-forward + "import *[A-Za-z_][A-Za-z_0-9].*\\|^from +[A-Za-z_][A-Za-z_0-9.]+ +import .*" nil t) + (setq imports + (concat + imports + (replace-regexp-in-string + "[\\]\r?\n?\s*" "" + (buffer-substring-no-properties (match-beginning 0) (point))) ";"))) + (when (ignore-errors (string-match ";" imports)) + (setq imports (split-string imports ";" t)) + (dolist (ele imports) + (and (string-match "import" ele) + (if erg + (setq erg (concat erg ";" ele)) + (setq erg ele))) + (setq imports erg)))) + (goto-char (point-min)) + (while (re-search-forward + "^import *[A-Za-z_][A-Za-z_0-9].*\\|^from +[A-Za-z_][A-Za-z_0-9.]+ +import .*" nil t) + (unless (py--end-of-statement-p) + (py-forward-statement)) + (setq imports + (concat + imports + (replace-regexp-in-string + "[\\]\r*\n*\s*" "" + (buffer-substring-no-properties (match-beginning 0) (point))) ";"))))) + ;; (and imports + ;; (setq imports (replace-regexp-in-string ";$" "" imports))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" imports)) + imports)) + +(defun py-update-imports () + "Return imports. + +Imports done are displayed in message buffer." + (interactive) + (save-excursion + (let ( + (orig (point)) + (erg (py-find-imports))) + (goto-char orig) + (when (called-interactively-p 'any) + (switch-to-buffer (current-buffer)) + (message "%s" erg)) + erg))) + +;; Code-Checker +;; pep8 +(defalias 'pep8 'py-pep8-run) +(defun py-pep8-run (command) + "*Run pep8 using COMMAND, check formatting - default on the file currently visited." + (interactive + (let ((default + (if (py--buffer-filename-remote-maybe) + (format "%s %s %s" py-pep8-command + (mapconcat 'identity py-pep8-command-args " ") + (py--buffer-filename-remote-maybe)) + (format "%s %s" py-pep8-command + (mapconcat 'identity py-pep8-command-args " ")))) + (last (when py-pep8-history + (let* ((lastcmd (car py-pep8-history)) + (cmd (cdr (reverse (split-string lastcmd)))) + (newcmd (reverse (cons (py--buffer-filename-remote-maybe) cmd)))) + (mapconcat 'identity newcmd " "))))) + + (list + (if (fboundp 'read-shell-command) + (read-shell-command "Run pep8 like this: " + (if last + last + default) + 'py-pep8-history) + (read-string "Run pep8 like this: " + (if last + last + default) + 'py-pep8-history))))) + (save-some-buffers (not py-ask-about-save) nil) + (if (fboundp 'compilation-start) + ;; Emacs. + (compilation-start command) + ;; XEmacs. + (when (featurep 'xemacs) + (compile-internal command "No more errors")))) + +(defun py-pep8-help () + "Display pep8 command line help messages." + (interactive) + (set-buffer (get-buffer-create "*pep8-Help*")) + (erase-buffer) + (shell-command "pep8 --help" "*pep8-Help*")) + +;; Pylint +(defalias 'pylint 'py-pylint-run) +(defun py-pylint-run (command) + "Run pylint from COMMAND (default on the file currently visited). + +For help see \\[pylint-help] resp. \\[pylint-long-help]. +Home-page: http://www.logilab.org/project/pylint" + (interactive + (let ((default (format "%s %s %s" py-pylint-command + (mapconcat 'identity py-pylint-command-args " ") + (py--buffer-filename-remote-maybe))) + (last (and py-pylint-history (car py-pylint-history)))) + (list (funcall (if (fboundp 'read-shell-command) + 'read-shell-command 'read-string) + "Run pylint like this: " + (or default last) + 'py-pylint-history)))) + (save-some-buffers (not py-ask-about-save)) + (set-buffer (get-buffer-create "*Pylint*")) + (erase-buffer) + (unless (file-readable-p (car (cddr (split-string command)))) + (message "Warning: %s" "pylint needs a file")) + (shell-command command "*Pylint*")) + +(defalias 'pylint-help 'py-pylint-help) +(defun py-pylint-help () + "Display Pylint command line help messages. + +Let's have this until more Emacs-like help is prepared" + (interactive) + (set-buffer (get-buffer-create "*Pylint-Help*")) + (erase-buffer) + (shell-command "pylint --long-help" "*Pylint-Help*")) + +(defalias 'pylint-doku 'py-pylint-doku) +(defun py-pylint-doku () + "Display Pylint Documentation. + +Calls ‘pylint --full-documentation’" + (interactive) + (set-buffer (get-buffer-create "*Pylint-Documentation*")) + (erase-buffer) + (shell-command "pylint --full-documentation" "*Pylint-Documentation*")) + +;; Pyflakes +(defalias 'pyflakes 'py-pyflakes-run) +(defun py-pyflakes-run (command) + "*Run pyflakes on COMMAND (default on the file currently visited). + +For help see \\[pyflakes-help] resp. \\[pyflakes-long-help]. +Home-page: http://www.logilab.org/project/pyflakes" + (interactive + (let ((default + (if (py--buffer-filename-remote-maybe) + (format "%s %s %s" py-pyflakes-command + (mapconcat 'identity py-pyflakes-command-args " ") + (py--buffer-filename-remote-maybe)) + (format "%s %s" py-pyflakes-command + (mapconcat 'identity py-pyflakes-command-args " ")))) + (last (when py-pyflakes-history + (let* ((lastcmd (car py-pyflakes-history)) + (cmd (cdr (reverse (split-string lastcmd)))) + (newcmd (reverse (cons (py--buffer-filename-remote-maybe) cmd)))) + (mapconcat 'identity newcmd " "))))) + + (list + (if (fboundp 'read-shell-command) + (read-shell-command "Run pyflakes like this: " + (if last + last + default) + 'py-pyflakes-history) + (read-string "Run pyflakes like this: " + (if last + last + default) + 'py-pyflakes-history))))) + (save-some-buffers (not py-ask-about-save) nil) + (if (fboundp 'compilation-start) + ;; Emacs. + (compilation-start command) + ;; XEmacs. + (when (featurep 'xemacs) + (compile-internal command "No more errors")))) + +(defalias 'pyflakes-help 'py-pyflakes-help) +(defun py-pyflakes-help () + "Display Pyflakes command line help messages. + +Let's have this until more Emacs-like help is prepared" + (interactive) + ;; (set-buffer (get-buffer-create "*Pyflakes-Help*")) + ;; (erase-buffer) + (with-help-window "*Pyflakes-Help*" + (with-current-buffer standard-output + (insert " pyflakes [file-or-directory ...] + + Pyflakes is a simple program which checks Python + source files for errors. It is similar to + PyChecker in scope, but differs in that it does + not execute the modules to check them. This is + both safer and faster, although it does not + perform as many checks. Unlike PyLint, Pyflakes + checks only for logical errors in programs; it + does not perform any checks on style. + + All commandline arguments are checked, which + have to be either regular files or directories. + If a directory is given, every .py file within + will be checked. + + When no commandline arguments are given, data + will be read from standard input. + + The exit status is 0 when no warnings or errors + are found. When errors are found the exit status + is 2. When warnings (but no errors) are found + the exit status is 1. + +Extracted from http://manpages.ubuntu.com/manpages/natty/man1/pyflakes.1.html")))) + +;; Pyflakes-pep8 +(defalias 'pyflakespep8 'py-pyflakespep8-run) +(defun py-pyflakespep8-run (command) + "*Run COMMAND pyflakespep8, check formatting (default on the file currently visited)." + (interactive + (let ((default + (if (py--buffer-filename-remote-maybe) + (format "%s %s %s" py-pyflakespep8-command + (mapconcat 'identity py-pyflakespep8-command-args " ") + (py--buffer-filename-remote-maybe)) + (format "%s %s" py-pyflakespep8-command + (mapconcat 'identity py-pyflakespep8-command-args " ")))) + (last (when py-pyflakespep8-history + (let* ((lastcmd (car py-pyflakespep8-history)) + (cmd (cdr (reverse (split-string lastcmd)))) + (newcmd (reverse (cons (py--buffer-filename-remote-maybe) cmd)))) + (mapconcat 'identity newcmd " "))))) + + (list + (if (fboundp 'read-shell-command) + (read-shell-command "Run pyflakespep8 like this: " + (if last + last + default) + 'py-pyflakespep8-history) + (read-string "Run pyflakespep8 like this: " + (if last + last + default) + 'py-pyflakespep8-history))))) + (save-some-buffers (not py-ask-about-save) nil) + (if (fboundp 'compilation-start) + ;; Emacs. + (compilation-start command) + ;; XEmacs. + (when (featurep 'xemacs) + (compile-internal command "No more errors")))) + +(defun py-pyflakespep8-help () + "Display pyflakespep8 command line help messages." + (interactive) + (set-buffer (get-buffer-create "*pyflakespep8-Help*")) + (erase-buffer) + (shell-command "pyflakespep8 --help" "*pyflakespep8-Help*")) + +;; Pychecker +;; hack for GNU Emacs +;; (unless (fboundp 'read-shell-command) +;; (defalias 'read-shell-command 'read-string)) + +(defun py-pychecker-run (command) + "Run COMMAND pychecker (default on the file currently visited)." + (interactive + (let ((default + (if (py--buffer-filename-remote-maybe) + (format "%s %s %s" py-pychecker-command + py-pychecker-command-args + (py--buffer-filename-remote-maybe)) + (format "%s %s" py-pychecker-command py-pychecker-command-args))) + (last (when py-pychecker-history + (let* ((lastcmd (car py-pychecker-history)) + (cmd (cdr (reverse (split-string lastcmd)))) + (newcmd (reverse (cons (py--buffer-filename-remote-maybe) cmd)))) + (mapconcat 'identity newcmd " "))))) + + (list + (if (fboundp 'read-shell-command) + (read-shell-command "Run pychecker like this: " + (if last + last + default) + 'py-pychecker-history) + (read-string "Run pychecker like this: " + (if last + last + default) + 'py-pychecker-history))))) + (save-some-buffers (not py-ask-about-save) nil) + (if (fboundp 'compilation-start) + ;; Emacs. + (compilation-start command) + ;; XEmacs. + (when (featurep 'xemacs) + (compile-internal command "No more errors")))) + +;; After ‘sgml-validate-command’. +(defun py-check-command (command) + "Check a Python file (default current buffer's file). +Runs COMMAND, a shell command, as if by ‘compile’. +See ‘py-check-command’ for the default." + (interactive + (list (read-string "Checker command: " + (concat py-check-command " " + (let ((name (py--buffer-filename-remote-maybe))) + (if name + (file-name-nondirectory name))))))) + (require 'compile) ;To define compilation-* variables. + (save-some-buffers (not compilation-ask-about-save) nil) + (let ((compilation-error-regexp-alist py-compilation-regexp-alist) + ;; (cons '("(\\([^,]+\\), line \\([0-9]+\\))" 1) + ;; compilation-error-regexp-alist) + ) + (compilation-start command))) + +;; flake8 +(defalias 'flake8 'py-flake8-run) +(defun py-flake8-run (command) + "COMMAND Flake8 is a wrapper around these tools: +- PyFlakes + - pep8 + - Ned Batchelder's McCabe script + + It also adds features: + - files that contain this line are skipped:: + # flake8: noqa + - no-warn lines that contain a `# noqa`` comment at the end. + - a Git and a Mercurial hook. + - a McCabe complexity checker. + - extendable through ``flake8.extension`` entry points." + (interactive + (let* ((py-flake8-command + (if (string= "" py-flake8-command) + (or (executable-find "flake8") + (error "Don't see \"flake8\" on your system. +Consider \"pip install flake8\" resp. visit \"pypi.python.org\"")) + py-flake8-command)) + (default + (if (py--buffer-filename-remote-maybe) + (format "%s %s %s" py-flake8-command + py-flake8-command-args + (py--buffer-filename-remote-maybe)) + (format "%s %s" py-flake8-command + py-flake8-command-args))) + (last + (when py-flake8-history + (let* ((lastcmd (car py-flake8-history)) + (cmd (cdr (reverse (split-string lastcmd)))) + (newcmd (reverse (cons (py--buffer-filename-remote-maybe) cmd)))) + (mapconcat 'identity newcmd " "))))) + (list + (if (fboundp 'read-shell-command) + (read-shell-command "Run flake8 like this: " + ;; (if last + ;; last + default + 'py-flake8-history1) + (read-string "Run flake8 like this: " + (if last + last + default) + 'py-flake8-history))))) + (save-some-buffers (not py-ask-about-save) nil) + (if (fboundp 'compilation-start) + ;; Emacs. + (compilation-start command) + ;; XEmacs. + (when (featurep 'xemacs) + (compile-internal command "No more errors")))) + +(defun py-flake8-help () + "Display flake8 command line help messages." + (interactive) + (set-buffer (get-buffer-create "*flake8-Help*")) + (erase-buffer) + (shell-command "flake8 --help" "*flake8-Help*")) + +;; from string-strip.el --- Strip CHARS from STRING + +(defvar py-chars-before " \t\n\r\f" + "Used by ‘py--string-strip’.") + +(defvar py-chars-after " \t\n\r\f" + "Used by ‘py--string-strip’.") + +;; (setq strip-chars-before "[ \t\r\n]*") +(defun py--string-strip (str &optional chars-before chars-after) + "Return a copy of STR, CHARS removed. +‘CHARS-BEFORE’ and ‘CHARS-AFTER’ default is \"[ \t\r\n]*\", +i.e. spaces, tabs, carriage returns, newlines and newpages." + (let ((s-c-b (or chars-before + py-chars-before)) + (s-c-a (or chars-after + py-chars-after)) + (erg str)) + (setq erg (replace-regexp-in-string s-c-b "" erg)) + (setq erg (replace-regexp-in-string s-c-a "" erg)) + erg)) + +(defun py-nesting-level (&optional pps) + "Accepts the output of ‘parse-partial-sexp’ - PPS." + (interactive) + (let* ((pps (or (ignore-errors (nth 0 pps)) + (if (featurep 'xemacs) + (parse-partial-sexp (point-min) (point)) + (parse-partial-sexp (point-min) (point))))) + (erg (nth 0 pps))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +;; ffap +(defun py-ffap-module-path (module) + "Function for ‘ffap-alist’ to return path for MODULE." + (let ((process (or + (and (eq major-mode 'py-shell-mode) + (get-buffer-process (current-buffer))) + (py-shell-get-process)))) + (if (not process) + nil + (let ((module-file + (py--send-string-no-output + (format py-ffap-string-code module) process))) + (when module-file + (substring-no-properties module-file 1 -1)))))) + +(eval-after-load "ffap" + '(progn + (push '(python-mode . py-ffap-module-path) ffap-alist) + (push '(py-shell-mode . py-ffap-module-path) ffap-alist))) + +;; Flymake +(defun py-toggle-flymake-intern (name command) + "Clear flymake allowed file-name masks. + +Takes NAME COMMAND" + (unless (string-match "pyflakespep8" name) + (unless (executable-find name) + (when py-verbose-p (message "Don't see %s. Use ‘easy_install’ %s? " name name)))) + (if (py--buffer-filename-remote-maybe) + (let* ((temp-file (flymake-init-create-temp-buffer-copy + 'flymake-create-temp-inplace)) + (local-file (file-relative-name + temp-file + (file-name-directory (py--buffer-filename-remote-maybe))))) + (push (car (read-from-string (concat "(\"\\.py\\'\" flymake-" name ")"))) flymake-allowed-file-name-masks) + (list command (list local-file))) + (message "%s" "flymake needs a ‘file-name’. Please save before calling."))) + +(defun py-flycheck-mode (&optional arg) + "Toggle ‘flycheck-mode’. + +With negative ARG switch off ‘flycheck-mode’ +See menu \"Tools/Syntax Checking\"" + (interactive "p") + (setq arg (or arg (if flycheck-mode 0 1))) + (if (featurep 'flycheck) + (if (< arg 0) + ;; switch off + (flycheck-mode 0) + (when (and py-verbose-p (called-interactively-p 'any)) (message "flycheck-mode: %s" flycheck-mode)) + (flycheck-mode 1) + (when (and py-verbose-p (called-interactively-p 'any)) (message "flycheck-mode: %s" flycheck-mode))) + (error "Can't find flycheck - see README.org"))) + +(defun pylint-flymake-mode () + "Toggle ‘pylint’ ‘flymake-mode’." + (interactive) + (if flymake-mode + ;; switch off + (flymake-mode 0) + (py-toggle-flymake-intern "pylint" "pylint") + (flymake-mode 1))) + +(defun pyflakes-flymake-mode () + "Toggle ‘pyflakes’ ‘flymake-mode’." + (interactive) + (if flymake-mode + ;; switch off + (flymake-mode) + (py-toggle-flymake-intern "pyflakes" "pyflakes") + (flymake-mode))) + +(defun pychecker-flymake-mode () + "Toggle ‘pychecker’ ‘flymake-mode’." + (interactive) + (if flymake-mode + ;; switch off + (flymake-mode) + (py-toggle-flymake-intern "pychecker" "pychecker") + (flymake-mode))) + +(defun pep8-flymake-mode () + "Toggle ‘pep8’ ‘flymake-mode’." + (interactive) + (if flymake-mode + ;; switch off + (flymake-mode) + (py-toggle-flymake-intern "pep8" "pep8") + (flymake-mode))) + +(defun pyflakespep8-flymake-mode () + "Toggle ‘pyflakespep8’ ‘flymake-mode’. + +Joint call to pyflakes and pep8 as proposed by +Keegan Carruthers-Smith" + (interactive) + (if flymake-mode + ;; switch off + (flymake-mode) + (py-toggle-flymake-intern "pyflakespep8" "pyflakespep8") + (flymake-mode))) + +;; ; +;; (defun variables-prepare (kind buffer directory-out &optional directory-in) +;; "Used by variable-finds, variable-states. " +;; (let* ((oldbuf (buffer-name (or buffer (current-buffer)))) +;; ;; (file (buffer-file-name)) +;; (orgname (concat (substring oldbuf 0 (string-match "\\." oldbuf)) ".org")) +;; (reSTname (concat (substring oldbuf 0 (string-match "\\." oldbuf)) ".rst")) +;; (directory-in (or directory-in default-directory)) +;; (command (concat "variables-base-" kind))) +;; (funcall (intern-soft command) oldbuf orgname reSTname directory-in directory-out))) + +(defun py-display-state-of-variables () + "Read the state of ‘python-mode’ variables. + +Display the result in an org-mode buffer. +Assumes vars are defined in current source buffer" + (interactive) + (save-restriction + (let (variableslist) + (goto-char (point-min)) + ;; (eval-buffer) + (while (and (not (eobp))(re-search-forward "^(defvar [[:alpha:]]\\|^(defcustom [[:alpha:]]\\|^(defconst [[:alpha:]]" nil t 1)) + (let* ((name (symbol-at-point)) + (state + (unless + (or (eq name 'py-menu) + (eq name 'python-mode-map) + (string-match "syntax-table" (prin1-to-string name))) + + (prin1-to-string (symbol-value name))))) + (if state + (push (cons (prin1-to-string name) state) variableslist) + (message "don't see a state for %s" (prin1-to-string name)))) + (forward-line 1)) + (setq variableslist (nreverse variableslist)) + (set-buffer (get-buffer-create "State-of-Python-mode-variables.org")) + (erase-buffer) + ;; org + (insert "State of python-mode variables\n\n") + (switch-to-buffer (current-buffer)) + (dolist (ele variableslist) + (if (string-match "^;;; " (car ele)) + (unless (or (string-match "^;;; Constants\\|^;;; Commentary\\|^;;; Code\\|^;;; Macro definitions\\|^;;; Customization" (car ele))) + + (insert (concat (replace-regexp-in-string "^;;; " "* " (car ele)) "\n"))) + (insert (concat "\n** "(car ele) "\n")) + (insert (concat " " (cdr ele) "\n\n"))) + ;; (richten) + (sit-for 0.01)) + (sit-for 0.01) + (org-mode)))) + +;; common typo +(defalias 'iypthon 'ipython) +(defalias 'pyhton 'python) + +;; python-components-extensions + +(defun py-indent-forward-line (&optional arg) + "Indent and move one line forward to next indentation. +Returns column of line reached. + +If `py-kill-empty-line' is non-nil, delete an empty line. +When closing a form, use py-close-block et al, which will move and indent likewise. +With \\[universal argument] just indent. +" + (interactive "*P") + (let ((orig (point)) + erg) + (unless (eobp) + (if (and (py--in-comment-p)(not py-indent-comments)) + (forward-line 1) + (py-indent-line-outmost) + (unless (eq 4 (prefix-numeric-value arg)) + (if (eobp) (newline) + (progn (forward-line 1)) + (when (and py-kill-empty-line (empty-line-p) (not (looking-at "[ \t]*\n[[:alpha:]]")) (not (eobp))) + (delete-region (line-beginning-position) (line-end-position))))))) + (back-to-indentation) + (when (or (eq 4 (prefix-numeric-value arg)) (< orig (point))) (setq erg (current-column))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-dedent-forward-line (&optional arg) + "Dedent line and move one line forward. " + (interactive "*p") + (py-dedent arg) + (if (eobp) + (newline) + (forward-line 1)) + (end-of-line)) + +(defun py-dedent (&optional arg) + "Dedent line according to `py-indent-offset'. + +With arg, do it that many times. +If point is between indent levels, dedent to next level. +Return indentation reached, if dedent done, nil otherwise. + +Affected by `py-dedent-keep-relative-column'. " + (interactive "*p") + (or arg (setq arg 1)) + (let ((orig (copy-marker (point))) + erg) + (dotimes (_ arg) + (let* ((cui (current-indentation)) + (remain (% cui py-indent-offset)) + (indent (* py-indent-offset (/ cui py-indent-offset)))) + (beginning-of-line) + (fixup-whitespace) + (if (< 0 remain) + (indent-to-column indent) + (indent-to-column (- cui py-indent-offset))))) + (when (< (point) orig) + (setq erg (current-column))) + (when py-dedent-keep-relative-column (goto-char orig)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-class-at-point () + "Return class definition as string. + +With interactive call, send it to the message buffer too. " + (interactive) + (save-excursion + (let* ((beg (py-backward-class)) + (end (py-forward-class)) + (res (when (and (numberp beg)(numberp end)(< beg end)) (buffer-substring-no-properties beg end)))) + (when (called-interactively-p 'any) (message "%s" res)) + res))) + +(defun py-function-at-point () + "Return functions definition as string. + +With interactive call, send it to the message buffer too. " + (interactive) + (save-excursion + (let* ((beg (py-backward-function)) + (end (py-forward-function)) + (res (when (and (numberp beg)(numberp end)(< beg end)) (buffer-substring-no-properties beg end)))) + (when (called-interactively-p 'any) (message "%s" res)) + res))) + +(defun py-backward-function () + "Jump to the beginning of defun. Returns point. " + (interactive "p") + (let ((pos (py-backward-def-or-class))) + (when (called-interactively-p 'any) (message "%s" pos)) + pos)) + +(defun py-forward-function () + "Jump to the end of function. " + (interactive "p") + (let ((pos (py-forward-def-or-class))) + (when (called-interactively-p 'any) (message "%s" pos)) + pos)) + +;; Functions for marking regions + +(defun py-line-at-point () + "Return line as string. + With interactive call, send it to the message buffer too. " + (interactive) + (let* ((beg (line-beginning-position)) + (end (line-end-position)) + (res (when (and (numberp beg)(numberp end)(< beg end)) (buffer-substring-no-properties beg end)))) + (when (called-interactively-p 'any) (message "%s" res)) + res)) + +(defun py-match-paren-mode (&optional arg) + "py-match-paren-mode nil oder t" + (interactive "P") + (if (or arg (not py-match-paren-mode)) + (progn + (setq py-match-paren-mode t) + (setq py-match-paren-mode nil)))) + +(defun py--match-end-finish (cui) + (let (skipped) + (unless (eq (current-column) cui) + (when (< (current-column) cui) + (setq skipped (skip-chars-forward " \t" (line-end-position))) + (setq cui (- cui skipped)) + ;; may current-column greater as needed indent? + (if (< 0 cui) + (progn + (unless (empty-line-p) (split-line)) + (indent-to cui)) + (forward-char cui)) + (unless (eq (char-before) 32)(insert 32)(forward-char -1)))))) + +(defun py--match-paren-forward () + (setq py--match-paren-forward-p t) + (let ((cui (current-indentation))) + (cond + ((py--beginning-of-top-level-p) + (py-forward-top-level-bol) + (py--match-end-finish cui)) + ((py--beginning-of-class-p) + (py-forward-class-bol) + (py--match-end-finish cui)) + ((py--beginning-of-def-p) + (py-forward-def-bol) + (py--match-end-finish cui)) + ((py--beginning-of-if-block-p) + (py-forward-if-block-bol) + (py--match-end-finish cui)) + ((py--beginning-of-try-block-p) + (py-forward-try-block-bol) + (py--match-end-finish cui)) + ((py--beginning-of-for-block-p) + (py-forward-for-block-bol) + (py--match-end-finish cui)) + ((py--beginning-of-block-p) + (py-forward-block-bol) + (py--match-end-finish cui)) + ((py--beginning-of-clause-p) + (py-forward-clause-bol) + (py--match-end-finish cui)) + ((py--beginning-of-statement-p) + (py-forward-statement-bol) + (py--match-end-finish cui)) + (t (py-forward-statement) + (py--match-end-finish cui))))) + +(defun py--match-paren-backward () + (setq py--match-paren-forward-p nil) + (let* ((cui (current-indentation)) + (cuc (current-column)) + (cui (min cuc cui))) + (if (eq 0 cui) + (py-backward-top-level) + (when (empty-line-p) (delete-region (line-beginning-position) (point))) + (py-backward-statement) + (unless (< (current-column) cuc) + (while (and (not (bobp)) + (< cui (current-column)) + (py-backward-statement))))))) + +(defun py--match-paren-blocks () + (cond + ((and (looking-back "^[ \t]*" (line-beginning-position))(if (eq last-command 'py-match-paren)(not py--match-paren-forward-p)t) + ;; (looking-at py-extended-block-or-clause-re) + (looking-at "[[:alpha:]_]")) + ;; from beginning of top-level, block, clause, statement + (py--match-paren-forward)) + (t + (py--match-paren-backward)))) + +(defun py-match-paren (&optional arg) + "If at a beginning, jump to end and vice versa. + +When called from within, go to the start. +Matches lists, but also block, statement, string and comment. " + (interactive "*P") + (if (eq 4 (prefix-numeric-value arg)) + (insert "%") + (let ((pps (parse-partial-sexp (point-min) (point)))) + (cond + ;; if inside string, go to beginning + ((nth 3 pps) + (goto-char (nth 8 pps))) + ;; if inside comment, go to beginning + ((nth 4 pps) + (py-backward-comment)) + ;; at comment start, go to end of commented section + ((and + ;; unless comment starts where jumped to some end + (not py--match-paren-forward-p) + (eq 11 (car-safe (syntax-after (point))))) + (py-forward-comment)) + ;; at string start, go to end + ((or (eq 15 (car-safe (syntax-after (point)))) + (eq 7 (car (syntax-after (point))))) + (goto-char (scan-sexps (point) 1)) + (forward-char -1)) + ;; open paren + ((eq 4 (car (syntax-after (point)))) + (goto-char (scan-sexps (point) 1)) + (forward-char -1)) + ((eq 5 (car (syntax-after (point)))) + (goto-char (scan-sexps (1+ (point)) -1))) + ((nth 1 pps) + (goto-char (nth 1 pps))) + (t + ;; Python specific blocks + (py--match-paren-blocks)))))) + +(unless (boundp 'empty-line-p-chars) + (defvar empty-line-p-chars "^[ \t\f\r]*$")) + +(unless (functionp 'in-string-p) + (defun in-string-p (&optional pos) + (interactive) + (let* ((orig (or pos (point))) + (erg + (save-excursion + (save-restriction + (widen) + (beginning-of-defun) + (numberp + (progn + (if (featurep 'xemacs) + (nth 3 (parse-partial-sexp (point) orig) + (nth 3 (parse-partial-sexp (point-min) (point))))))))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg))) + +(defun py-documentation (w) + "Launch PyDOC on the Word at Point" + (interactive + (list (let* ((word (thing-at-point 'word)) + (input (read-string + (format "pydoc entry%s: " + (if (not word) "" (format " (default %s)" word)))))) + (if (string= input "") + (if (not word) (error "No pydoc args given") + word) ;sinon word + input)))) ;sinon input + (shell-command (concat py-shell-name " -c \"from pydoc import help;help(\'" w "\')\"") "*PYDOCS*") + (view-buffer-other-window "*PYDOCS*" t 'kill-buffer-and-window)) + +(defun eva () + "Put \"eval(...)\" forms around strings at point. " + (interactive "*") + (skip-chars-forward " \t\r\n\f") + (let* ((bounds (ar-bounds-of-word-atpt)) + (beg (car bounds)) + (end (cdr bounds))) + (goto-char end) + (insert ")") + (goto-char beg) + (insert "eval("))) + +(defun pst-here () + "Kill previous \"pdb.set_trace()\" and insert it at point. " + (interactive "*") + (let ((orig (copy-marker (point)))) + (search-backward "pdb.set_trace()") + (replace-match "") + (when (empty-line-p) + (delete-region (line-beginning-position) (line-end-position))) + (goto-char orig) + (insert "pdb.set_trace()"))) + +(defalias 'durck 'py-printform-insert) +(defalias 'druck 'py-printform-insert) + +(defun py-printform-insert (&optional arg strg) + "Inserts a print statement out of current `(car kill-ring)' by default, inserts STRING if delivered. + +With optional \\[universal-argument] print as string" + (interactive "*P") + (let* ((name (py--string-strip (or strg (car kill-ring)))) + ;; guess if doublequotes or parentheses are needed + (numbered (not (eq 4 (prefix-numeric-value arg)))) + (form (if numbered + (concat "print(\"" name ": %s \" % (" name "))") + (concat "print(\"" name ": %s \" % \"" name "\")")))) + (insert form))) + +(defun py-line-to-printform-python2 () + "Transforms the item on current in a print statement. " + (interactive "*") + (let* ((name (thing-at-point 'word)) + (form (concat "print(\"" name ": %s \" % " name ")"))) + (delete-region (line-beginning-position) (line-end-position)) + (insert form)) + (forward-line 1) + (back-to-indentation)) + +(defun py-boolswitch () + "Edit the assignment of a boolean variable, revert them. + +I.e. switch it from \"True\" to \"False\" and vice versa" + (interactive "*") + (save-excursion + (unless (py--end-of-statement-p) + (py-forward-statement)) + (backward-word) + (cond ((looking-at "True") + (replace-match "False")) + ((looking-at "False") + (replace-match "True")) + (t (message "%s" "Can't see \"True or False\" here"))))) + +(when (featurep 'thing-at-point-utils) + (defun py-beginning-of-list (&optional iact orig limit done last) + "Go to beginning of any parentized, braced or bracketed expression in statement. " + (interactive "p") + (save-restriction + (let ((orig (or orig (point))) + (done done) + (limit (or limit (re-search-backward "^[a-zA-Z]" nil t 1))) + (last last)) + (unless (or done (not limit)) (narrow-to-region limit (point-max))) + (setq done t) + (goto-char orig) + (let* ((pt (car-safe (ar-in-parentized-p-atpt))) + (br (car-safe (ar-in-braced-p-atpt))) + (bk (car-safe (ar-in-bracketed-p-atpt))) + (erg (car (sort (delq nil (list pt br bk)) '<)))) + (if erg + (progn + (goto-char (1- erg)) + (setq last erg) + (py-beginning-of-list iact (1- erg) limit done last)) + (when last + (goto-char last)) + (when iact (message "%s" last)) + last))))) + + (defun py-end-of-list (&optional iact orig limit done last) + "Go to end of any parentized, braced or bracketed expression in statement. " + (interactive "p") + (save-restriction + (let ((orig (or orig (point))) + (done done) + (limit (or limit (re-search-backward "^[a-zA-Z]" nil t 1))) + (last last)) + (unless (or done (not limit)) (narrow-to-region limit (point-max))) + (setq done t) + (goto-char orig) + (let* ((pt (car-safe (ar-in-parentized-p-atpt))) + (br (car-safe (ar-in-braced-p-atpt))) + (bk (car-safe (ar-in-bracketed-p-atpt))) + (erg (car (sort (delq nil (list pt br bk)) '<)))) + (if erg + (progn + (goto-char (1- erg)) + (setq last erg) + (py-end-of-list iact (1- erg) limit done last)) + (when last + (goto-char last) + (match-paren) + (setq last (1+ (point))) + (when iact (message "%s" last)) + last))))))) + +;; python-components-imenu +;; Imenu definitions + +(defvar py-imenu-class-regexp + (concat ; <> + "\\(" ; + "^[ \t]*" ; newline and maybe whitespace + "\\(class[ \t]+[a-zA-Z0-9_]+\\)" ; class name + ; possibly multiple superclasses + "\\([ \t]*\\((\\([a-zA-Z0-9_,. \t\n]\\)*)\\)?\\)" + "[ \t]*:" ; and the final : + "\\)" ; >>classes<< + ) + "Regexp for Python classes for use with the Imenu package." + ) + +;; (defvar py-imenu-method-regexp +;; (concat ; <> +;; "\\(" ; +;; "^[ \t]*" ; new line and maybe whitespace +;; "\\(def[ \t]+" ; function definitions start with def +;; "\\([a-zA-Z0-9_]+\\)" ; name is here +;; ; function arguments... +;; ;; "[ \t]*(\\([-+/a-zA-Z0-9_=,\* \t\n.()\"'#]*\\))" +;; "[ \t]*(\\([^:#]*\\))" +;; "\\)" ; end of def +;; "[ \t]*:" ; and then the : +;; "\\)" ; >>methods and functions<< +;; ) +;; "Regexp for Python methods/functions for use with the Imenu package." +;; ) + +(defvar py-imenu-method-regexp + (concat ; <> + "\\(" ; + "^[ \t]*" ; new line and maybe whitespace + "\\(def[ \t]+" ; function definitions start with def + "\\([a-zA-Z0-9_]+\\)" ; name is here + ; function arguments... + ;; "[ \t]*(\\([-+/a-zA-Z0-9_=,\* \t\n.()\"'#]*\\))" + "[ \t]*(\\(.*\\))" + "\\)" ; end of def + "[ \t]*:" ; and then the : + "\\)" ; >>methods and functions<< + ) + "Regexp for Python methods/functions for use with the Imenu package.") + + + + + +(defvar py-imenu-method-no-arg-parens '(2 8) + "Indices into groups of the Python regexp for use with Imenu. + +Using these values will result in smaller Imenu lists, as arguments to +functions are not listed. + +See the variable `py-imenu-show-method-args-p' for more +information.") + +(defvar py-imenu-method-arg-parens '(2 7) + "Indices into groups of the Python regexp for use with imenu. +Using these values will result in large Imenu lists, as arguments to +functions are listed. + +See the variable `py-imenu-show-method-args-p' for more +information.") + +;; Note that in this format, this variable can still be used with the +;; imenu--generic-function. Otherwise, there is no real reason to have +;; it. +(defvar py-imenu-generic-expression + (cons + (concat + py-imenu-class-regexp + "\\|" ; or... + py-imenu-method-regexp + ) + py-imenu-method-no-arg-parens) + "Generic Python expression which may be used directly with Imenu. +Used by setting the variable `imenu-generic-expression' to this value. +Also, see the function \\[py--imenu-create-index] for a better +alternative for finding the index.") + + +(defvar py-imenu-generic-regexp nil) +(defvar py-imenu-generic-parens nil) + + +(defun py--imenu-create-index () + "Python interface function for the Imenu package. +Finds all Python classes and functions/methods. Calls function +\\[py--imenu-create-index-engine]. See that function for the details +of how this works." + (save-excursion + (setq py-imenu-generic-regexp (car py-imenu-generic-expression) + py-imenu-generic-parens (if py-imenu-show-method-args-p + py-imenu-method-arg-parens + py-imenu-method-no-arg-parens)) + (goto-char (point-min)) + ;; Warning: When the buffer has no classes or functions, this will + ;; return nil, which seems proper according to the Imenu API, but + ;; causes an error in the XEmacs port of Imenu. Sigh. + (setq index-alist (cdr (py--imenu-create-index-engine nil))))) + +(defun py--imenu-create-index-engine (&optional start-indent) + "Function for finding Imenu definitions in Python. + +Finds all definitions (classes, methods, or functions) in a Python +file for the Imenu package. + +Returns a possibly nested alist of the form + + (INDEX-NAME . INDEX-POSITION) + +The second element of the alist may be an alist, producing a nested +list as in + + (INDEX-NAME . INDEX-ALIST) + +This function should not be called directly, as it calls itself +recursively and requires some setup. Rather this is the engine for +the function \\[py--imenu-create-index-function]. + +It works recursively by looking for all definitions at the current +indention level. When it finds one, it adds it to the alist. If it +finds a definition at a greater indentation level, it removes the +previous definition from the alist. In its place it adds all +definitions found at the next indentation level. When it finds a +definition that is less indented then the current level, it returns +the alist it has created thus far. + +The optional argument START-INDENT indicates the starting indentation +at which to continue looking for Python classes, methods, or +functions. If this is not supplied, the function uses the indentation +of the first definition found." + (let (index-alist + sub-method-alist + looking-p + def-name prev-name + cur-indent def-pos + (class-paren (first py-imenu-generic-parens)) + (def-paren (second py-imenu-generic-parens))) + (switch-to-buffer (current-buffer)) + (setq looking-p + (re-search-forward py-imenu-generic-regexp (point-max) t)) + (while looking-p + (save-excursion + ;; used to set def-name to this value but generic-extract-name + ;; is new to imenu-1.14. this way it still works with + ;; imenu-1.11 + ;;(imenu--generic-extract-name py-imenu-generic-parens)) + (let ((cur-paren (if (match-beginning class-paren) + class-paren def-paren))) + (setq def-name + (buffer-substring-no-properties (match-beginning cur-paren) + (match-end cur-paren)))) + (save-match-data + (py-beginning-of-def-or-class)) + (beginning-of-line) + (setq cur-indent (current-indentation))) + ;; HACK: want to go to the next correct definition location. We + ;; explicitly list them here but it would be better to have them + ;; in a list. + (setq def-pos + (or (match-beginning class-paren) + (match-beginning def-paren))) + ;; if we don't have a starting indent level, take this one + (or start-indent + (setq start-indent cur-indent)) + ;; if we don't have class name yet, take this one + (or prev-name + (setq prev-name def-name)) + ;; what level is the next definition on? must be same, deeper + ;; or shallower indentation + (cond + ;; Skip code in comments and strings + ((py--in-literal)) + ;; at the same indent level, add it to the list... + ((= start-indent cur-indent) + (push (cons def-name def-pos) index-alist)) + ;; deeper indented expression, recurse + ((< start-indent cur-indent) + ;; the point is currently on the expression we're supposed to + ;; start on, so go back to the last expression. The recursive + ;; call will find this place again and add it to the correct + ;; list + (re-search-backward py-imenu-generic-regexp (point-min) 'move) + (setq sub-method-alist (py--imenu-create-index-engine cur-indent)) + (if sub-method-alist + ;; we put the last element on the index-alist on the start + ;; of the submethod alist so the user can still get to it. + (let* ((save-elmt (pop index-alist)) + (classname (and (string-match "^class " (car save-elmt))(replace-regexp-in-string "^class " "" (car save-elmt))))) + (if (and classname (not (string-match "^class " (caar sub-method-alist)))) + (setcar (car sub-method-alist) (concat classname "." (caar sub-method-alist)))) + (push (cons prev-name + (cons save-elmt sub-method-alist)) + index-alist)))) + (t + (setq looking-p nil) + (re-search-backward py-imenu-generic-regexp (point-min) t))) + ;; end-cond + (setq prev-name def-name) + (and looking-p + (setq looking-p + (re-search-forward py-imenu-generic-regexp + (point-max) 'move)))) + (nreverse index-alist))) + +(defun py--imenu-create-index-new (&optional beg end) + (interactive) + "`imenu-create-index-function' for Python. " + (set (make-local-variable 'imenu-max-items) py-imenu-max-items) + (let ((orig (point)) + (beg (or beg (point-min))) + (end (or end (point-max))) + index-alist vars thisend sublist classname pos name) + (goto-char beg) + (while (and (re-search-forward "^[ \t]*\\(def\\|class\\)[ \t]+\\(\\sw+\\)" end t 1)(not (nth 8 (parse-partial-sexp (point-min) (point))))) + (if (save-match-data (string= "class" (match-string-no-properties 1))) + (progn + (setq pos (match-beginning 0) + name (match-string-no-properties 2) + classname (concat "class " name) + thisend (save-match-data (py--end-of-def-or-class-position)) + sublist '()) + (while (and (re-search-forward "^[ \t]*\\(def\\|class\\)[ \t]+\\(\\sw+\\)" (or thisend end) t 1)(not (nth 8 (parse-partial-sexp (point-min) (point))))) + (let* ((pos (match-beginning 0)) + (name (match-string-no-properties 2))) + (push (cons (concat " " name) pos) sublist))) + (if classname + (progn + (setq sublist (nreverse sublist)) + (push (cons classname pos) sublist) + (push (cons classname sublist) index-alist)) + (push sublist index-alist))) + + (let ((pos (match-beginning 0)) + (name (match-string-no-properties 2))) + (push (cons name pos) index-alist)))) + ;; Look for module variables. + (goto-char (point-min)) + (while (re-search-forward "^\\(\\sw+\\)[ \t]*=" end t) + (unless (nth 8 (parse-partial-sexp (point-min) (point))) + (let ((pos (match-beginning 1)) + (name (match-string-no-properties 1))) + (push (cons name pos) vars)))) + (setq index-alist (nreverse index-alist)) + (when vars + (push (cons "Module variables" + (nreverse vars)) + index-alist)) + (goto-char orig) + index-alist)) + +;; A modified slice from python.el +(defvar py-imenu-format-item-label-function + 'py-imenu-format-item-label + "Imenu function used to format an item label. +It must be a function with two arguments: TYPE and NAME.") + +(defvar py-imenu-format-parent-item-label-function + 'py-imenu-format-parent-item-label + "Imenu function used to format a parent item label. +It must be a function with two arguments: TYPE and NAME.") + +(defvar py-imenu-format-parent-item-jump-label-function + 'py-imenu-format-parent-item-jump-label + "Imenu function used to format a parent jump item label. +It must be a function with two arguments: TYPE and NAME.") + +(defun py-imenu-format-item-label (type name) + "Return Imenu label for single node using TYPE and NAME." + (format "%s (%s)" name type)) + +(defun py-imenu-format-parent-item-label (type name) + "Return Imenu label for parent node using TYPE and NAME." + (format "%s..." (py-imenu-format-item-label type name))) + +;; overengineering? +(defun py-imenu-format-parent-item-jump-label (type _name) + "Return Imenu label for parent node jump using TYPE and NAME." + (if (string= type "class") + "*class definition*" + "*function definition*")) + +(defun py-imenu--put-parent (type name pos tree) + "Add the parent with TYPE, NAME and POS to TREE." + (let* ((label + (funcall py-imenu-format-item-label-function type name)) + ;; (jump-label + ;; (funcall py-imenu-format-parent-item-jump-label-function type name)) + (jump-label label + ;; (funcall py-imenu-format-parent-item-jump-label-function type name) + ) + ) + (if (not tree) + (cons label pos) + (cons label (cons (cons jump-label pos) tree))))) + +(defun py-imenu--build-tree (&optional min-indent prev-indent tree) + "Recursively build the tree of nested definitions of a node. +Arguments MIN-INDENT, PREV-INDENT and TREE are internal and should +not be passed explicitly unless you know what you are doing." + (setq min-indent (or min-indent 0) + prev-indent (or prev-indent py-indent-offset)) + (save-restriction + (narrow-to-region (point-min) (point)) + (let* ((pos + (progn + ;; finds a top-level class + (py-backward-def-or-class) + ;; stops behind the indented form at EOL + (py-forward-def-or-class) + ;; may find an inner def-or-class + (py-backward-def-or-class))) + type + (name (when (and pos (looking-at py-def-or-class-re)) + (let ((split (split-string (match-string-no-properties 0)))) + (setq type (car split)) + (cadr split)))) + (label (when name + (funcall py-imenu-format-item-label-function type name))) + (indent (current-indentation)) + (children-indent-limit (+ py-indent-offset min-indent))) + (cond ((not pos) + ;; Nothing found, probably near to bobp. + nil) + ((<= indent min-indent) + ;; The current indentation points that this is a parent + ;; node, add it to the tree and stop recursing. + (py-imenu--put-parent type name pos tree)) + (t + (py-imenu--build-tree + min-indent + indent + (if (<= indent children-indent-limit) + (cons (cons label pos) tree) + (cons + (py-imenu--build-tree + prev-indent indent (list (cons label pos))) + tree)))))))) + +(defun py--imenu-index () + "Return tree Imenu alist for the current Python buffer. " + ;; (switch-to-buffer (current-buffer)) + (save-excursion + (goto-char (point-max)) + (let ((index) + (tree)) + (while (setq tree (py-imenu--build-tree)) + (setq index (cons tree index))) + index))) + +;; python-components-named-shells + +;;;###autoload +(defun ipython (&optional argprompt buffer fast exception-buffer split switch) + "Start an IPython interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "ipython" buffer fast exception-buffer split switch)) + +;;;###autoload +(defun ipython2.7 (&optional argprompt buffer fast exception-buffer split switch) + "Start an IPython2.7 interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "ipython2.7" buffer fast exception-buffer split switch)) + +;;;###autoload +(defun ipython3 (&optional argprompt buffer fast exception-buffer split switch) + "Start an IPython3 interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "ipython3" buffer fast exception-buffer split switch)) + +;;;###autoload +(defun jython (&optional argprompt buffer fast exception-buffer split switch) + "Start an Jython interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "jython" buffer fast exception-buffer split switch)) + +;;;###autoload +(defun python (&optional argprompt buffer fast exception-buffer split switch) + "Start an Python interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "python" buffer fast exception-buffer split switch)) + +;;;###autoload +(defun python2 (&optional argprompt buffer fast exception-buffer split switch) + "Start an Python2 interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "python2" buffer fast exception-buffer split switch)) + +;;;###autoload +(defun python3 (&optional argprompt buffer fast exception-buffer split switch) + "Start an Python3 interpreter. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "python3" buffer fast exception-buffer split switch)) + +;; dedicated +(defun ipython-dedicated (&optional argprompt buffer fast exception-buffer split switch) + "Start an unique IPython interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "ipython" buffer fast exception-buffer split switch)) + +(defun ipython2.7-dedicated (&optional argprompt buffer fast exception-buffer split switch) + "Start an unique IPython2.7 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "ipython2.7" buffer fast exception-buffer split switch)) + +(defun ipython3-dedicated (&optional argprompt buffer fast exception-buffer split switch) + "Start an unique IPython3 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "ipython3" buffer fast exception-buffer split switch)) + +(defun jython-dedicated (&optional argprompt buffer fast exception-buffer split switch) + "Start an unique Jython interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "jython" buffer fast exception-buffer split switch)) + +(defun python-dedicated (&optional argprompt buffer fast exception-buffer split switch) + "Start an unique Python interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "python" buffer fast exception-buffer split switch)) + +(defun python2-dedicated (&optional argprompt buffer fast exception-buffer split switch) + "Start an unique Python2 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "python2" buffer fast exception-buffer split switch)) + +(defun python3-dedicated (&optional argprompt buffer fast exception-buffer split switch) + "Start an unique Python3 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "python3" buffer fast exception-buffer split switch)) + +;; switch +(defun ipython-switch (&optional argprompt buffer fast exception-buffer split) + "Switch to IPython interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "ipython" buffer fast exception-buffer split t)) + +(defun ipython2.7-switch (&optional argprompt buffer fast exception-buffer split) + "Switch to IPython2.7 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "ipython2.7" buffer fast exception-buffer split t)) + +(defun ipython3-switch (&optional argprompt buffer fast exception-buffer split) + "Switch to IPython3 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "ipython3" buffer fast exception-buffer split t)) + +(defun jython-switch (&optional argprompt buffer fast exception-buffer split) + "Switch to Jython interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "jython" buffer fast exception-buffer split t)) + +(defun python-switch (&optional argprompt buffer fast exception-buffer split) + "Switch to Python interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "python" buffer fast exception-buffer split t)) + +(defun python2-switch (&optional argprompt buffer fast exception-buffer split) + "Switch to Python2 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "python2" buffer fast exception-buffer split t)) + +(defun python3-switch (&optional argprompt buffer fast exception-buffer split) + "Switch to Python3 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "python3" buffer fast exception-buffer split t)) + +;; no-switch +(defun ipython-no-switch (&optional argprompt buffer fast exception-buffer split) + "Open an IPython interpreter in another window, but do not switch to it. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "ipython" buffer fast exception-buffer split)) + +(defun ipython2.7-no-switch (&optional argprompt buffer fast exception-buffer split) + "Open an IPython2.7 interpreter in another window, but do not switch to it. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "ipython2.7" buffer fast exception-buffer split)) + +(defun ipython3-no-switch (&optional argprompt buffer fast exception-buffer split) + "Open an IPython3 interpreter in another window, but do not switch to it. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "ipython3" buffer fast exception-buffer split)) + +(defun jython-no-switch (&optional argprompt buffer fast exception-buffer split) + "Open an Jython interpreter in another window, but do not switch to it. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "jython" buffer fast exception-buffer split)) + +(defun python-no-switch (&optional argprompt buffer fast exception-buffer split) + "Open an Python interpreter in another window, but do not switch to it. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "python" buffer fast exception-buffer split)) + +(defun python2-no-switch (&optional argprompt buffer fast exception-buffer split) + "Open an Python2 interpreter in another window, but do not switch to it. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "python2" buffer fast exception-buffer split)) + +(defun python3-no-switch (&optional argprompt buffer fast exception-buffer split) + "Open an Python3 interpreter in another window, but do not switch to it. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt nil "python3" buffer fast exception-buffer split)) + +;; dedicated switch +(defalias 'ipython-dedicated-switch 'ipython-switch-dedicated) +(defun ipython-switch-dedicated (&optional argprompt buffer fast exception-buffer split) + "Switch to an unique IPython interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "ipython" buffer fast exception-buffer split t)) + +(defalias 'ipython2.7-dedicated-switch 'ipython2.7-switch-dedicated) +(defun ipython2.7-switch-dedicated (&optional argprompt buffer fast exception-buffer split) + "Switch to an unique IPython2.7 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "ipython2.7" buffer fast exception-buffer split t)) + +(defalias 'ipython3-dedicated-switch 'ipython3-switch-dedicated) +(defun ipython3-switch-dedicated (&optional argprompt buffer fast exception-buffer split) + "Switch to an unique IPython3 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "ipython3" buffer fast exception-buffer split t)) + +(defalias 'jython-dedicated-switch 'jython-switch-dedicated) +(defun jython-switch-dedicated (&optional argprompt buffer fast exception-buffer split) + "Switch to an unique Jython interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "jython" buffer fast exception-buffer split t)) + +(defalias 'python-dedicated-switch 'python-switch-dedicated) +(defun python-switch-dedicated (&optional argprompt buffer fast exception-buffer split) + "Switch to an unique Python interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "python" buffer fast exception-buffer split t)) + +(defalias 'python2-dedicated-switch 'python2-switch-dedicated) +(defun python2-switch-dedicated (&optional argprompt buffer fast exception-buffer split) + "Switch to an unique Python2 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "python2" buffer fast exception-buffer split t)) + +(defalias 'python3-dedicated-switch 'python3-switch-dedicated) +(defun python3-switch-dedicated (&optional argprompt buffer fast exception-buffer split) + "Switch to an unique Python3 interpreter in another window. + +Optional ARG \\[universal-argument] prompts for path to the interpreter." + (interactive "P") + (py-shell argprompt t "python3" buffer fast exception-buffer split t)) + +;; python-components-electric +(defun py-electric-colon (arg) + "Insert a colon and indent accordingly. + +If a numeric argument ARG is provided, that many colons are inserted +non-electrically. + +Electric behavior is inhibited inside a string or +comment or by universal prefix C-u. + +Switched by `py-electric-colon-active-p', default is nil +See also `py-electric-colon-greedy-p' " + (interactive "*P") + (cond ((not py-electric-colon-active-p) + (self-insert-command (prefix-numeric-value arg))) + ((and py-electric-colon-bobl-only (save-excursion (py-backward-statement) (not (py--beginning-of-block-p)))) + (self-insert-command (prefix-numeric-value arg))) + ((eq 4 (prefix-numeric-value arg)) + (self-insert-command 1)) + (t (insert ":") + (unless (py-in-string-or-comment-p) + (let ((orig (copy-marker (point))) + (indent (py-compute-indentation))) + (unless (or (eq (current-indentation) indent) + (and py-electric-colon-greedy-p + (eq indent (save-excursion (py-backward-statement)(current-indentation)))) + (and (py--top-level-form-p)(< (current-indentation) indent))) + (beginning-of-line) + (delete-horizontal-space) + (indent-to indent)) + (goto-char orig)) + (when py-electric-colon-newline-and-indent-p + (py-newline-and-indent)))))) + +(defun py-electric-close (arg) + "Close completion buffer when it's sure, it's no longer needed, i.e. when inserting a space. + +Works around a bug in `choose-completion'. " + + (interactive "*P") + (cond ((not py-electric-close-active-p) + (self-insert-command (prefix-numeric-value arg))) + ((eq 4 (prefix-numeric-value arg)) + (self-insert-command 1)) + (t (if (called-interactively-p 'any) (self-insert-command (prefix-numeric-value arg)) + ;; used from dont-indent-code-unnecessarily-lp-1048778-test + (insert " "))))) + +(defun py-electric-comment (arg) + "Insert a comment. If starting a comment, indent accordingly. + +If a numeric argument ARG is provided, that many \"#\" are inserted +non-electrically. +With \\[universal-argument] \"#\" electric behavior is inhibited inside a string or comment." + (interactive "*P") + (if (and py-indent-comments py-electric-comment-p) + (if (ignore-errors (eq 4 (car-safe arg))) + (insert "#") + (when (and (eq last-command 'py-electric-comment) (looking-back " " (line-beginning-position))) + (forward-char -1)) + (if (called-interactively-p 'any) (self-insert-command (prefix-numeric-value arg)) + (insert "#")) + (let ((orig (copy-marker (point))) + (indent (py-compute-indentation))) + (unless + (eq (current-indentation) indent) + (goto-char orig) + (beginning-of-line) + (delete-horizontal-space) + (indent-to indent) + (goto-char orig)) + (when py-electric-comment-add-space-p + (unless (looking-at "[ \t]") + (insert " ")))) + (setq last-command this-command)) + (self-insert-command (prefix-numeric-value arg)))) + +;; Electric deletion + +(defun py-empty-out-list-backward () + "Deletes all elements from list before point. " + (interactive "*") + (and (member (char-before) (list ?\) ?\] ?\})) + (let ((orig (point)) + (thischar (char-before)) + pps cn) + (forward-char -1) + (setq pps (parse-partial-sexp (point-min) (point))) + (if (and (not (nth 8 pps)) (nth 1 pps)) + (progn + (goto-char (nth 1 pps)) + (forward-char 1)) + (cond ((or (eq thischar 41)(eq thischar ?\))) + (setq cn "(")) + ((or (eq thischar 125) (eq thischar ?\})) + (setq cn "{")) + ((or (eq thischar 93)(eq thischar ?\])) + (setq cn "["))) + (skip-chars-backward (concat "^" cn))) + (delete-region (point) orig) + (insert-char thischar 1) + (forward-char -1)))) + +(defun py-electric-backspace (&optional arg) + "Delete preceding character or level of indentation. + +When `delete-active-region' and (use-region-p), delete region. + +Unless at indentation: + With `py-electric-kill-backward-p' delete whitespace before point. + With `py-electric-kill-backward-p' at end of a list, empty that list. + +Returns column reached. " + (interactive "p*") + (or arg (setq arg 1)) + (let (erg) + (cond ((and (use-region-p) + ;; Emacs23 doesn't know that var + (boundp 'delete-active-region) delete-active-region) + (backward-delete-char-untabify arg)) + ;; (delete-region (region-beginning) (region-end))) + ((looking-back "^[ \t]+" (line-beginning-position)) + (let* ((remains (% (current-column) py-indent-offset))) + (if (< 0 remains) + (delete-char (- remains)) + (indent-line-to (- (current-indentation) py-indent-offset))))) + ((and py-electric-kill-backward-p (member (char-before) (list ?\) ?\] ?\}))) + (py-empty-out-list-backward)) + ((and py-electric-kill-backward-p (< 0 (setq erg (abs (skip-chars-backward " \t\r\n\f"))))) + (delete-region (point) (+ erg (point)))) + (t (delete-char (- 1)))) + (setq erg (current-column)) + (when (and (called-interactively-p 'any) py-verbose-p) (message "%s" erg)) + erg)) + +(defun py-electric-delete (&optional arg) + "Delete following character or levels of whitespace. + +When `delete-active-region' and (use-region-p), delete region " + (interactive "*p") + (let ((orig (point))) + (cond ((and (use-region-p) + ;; Emacs23 doesn't know that var + (boundp 'delete-active-region) delete-active-region) + (delete-region (region-beginning) (region-end))) + ((save-excursion (and (< (current-column)(current-indentation)) (<= py-indent-offset (skip-chars-forward " \t")))) + (goto-char orig) + (delete-char py-indent-offset)) + ((< 0 (skip-chars-forward " \t")) + (delete-region orig (point))) + (t (delete-char (or arg 1)))))) + +(defun py-electric-yank (&optional arg) + "Perform command `yank' followed by an `indent-according-to-mode' " + (interactive "P") + (cond (py-electric-yank-active-p + (yank arg) + ;; (py-indent-line) + ) + (t (yank arg)))) + +;; required for pending-del and delsel modes +(put 'py-electric-colon 'delete-selection t) ;delsel +(put 'py-electric-colon 'pending-delete t) ;pending-del +(put 'py-electric-backspace 'delete-selection 'supersede) ;delsel +(put 'py-electric-backspace 'pending-delete 'supersede) ;pending-del +(put 'py-electric-delete 'delete-selection 'supersede) ;delsel +(put 'py-electric-delete 'pending-delete 'supersede) ;pending-del + +;; python-components-virtualenv + +(defvar virtualenv-workon-home nil) + +(defvar virtualenv-name nil) + +(defvar virtualenv-old-path nil) + +(defvar virtualenv-old-exec-path nil) + +(if (getenv "WORKON_HOME") + (setq virtualenv-workon-home (getenv "WORKON_HOME")) + (setq virtualenv-workon-home "~/.virtualenvs")) + +(setq virtualenv-name nil) + +;;TODO: Move to a generic UTILITY or TOOL package +(defun virtualenv-filter (predicate sequence) + "Apply to each element of SEQUENCE the PREDICATE, if FUNCTION + returns non-nil append the element to the return value of + virtualenv-filter: a list" + (let ((retlist '())) + (dolist (element sequence) + (when (funcall predicate element) + (push element retlist))) + (nreverse retlist))) + +(defun virtualenv-append-path (dir var) + "Append DIR to a path-like varibale VAR, for example: + (virtualenv-append-path /usr/bin:/bin /home/test/bin) -> /home/test/bin:/usr/bin:/bin" + (concat (expand-file-name dir) + path-separator + var)) + +(defun virtualenv-add-to-path (dir) + "Add the specified path element to the Emacs PATH" + (setenv "PATH" + (virtualenv-append-path dir + (getenv "PATH")))) + +(defun virtualenv-current () + "Barfs the current activated virtualenv" + (interactive) + (message virtualenv-name)) + +(defun virtualenv-activate (dir) + "Activate the virtualenv located in DIR" + (interactive "DVirtualenv Directory: ") + ;; Eventually deactivate previous virtualenv + (when virtualenv-name + (virtualenv-deactivate)) + (let ((cmd (concat "source " dir "/bin/activate\n"))) + (comint-send-string (get-process (get-buffer-process "*shell*")) cmd) + ;; Storing old variables + (setq virtualenv-old-path (getenv "PATH")) + (setq virtualenv-old-exec-path exec-path) + + (setenv "VIRTUAL_ENV" dir) + (virtualenv-add-to-path (concat (py--normalize-directory dir) "bin")) + (push (concat (py--normalize-directory dir) "bin") exec-path) + + (setq virtualenv-name dir))) + +(defun virtualenv-deactivate () + "Deactivate the current virtual enviroment" + (interactive) + ;; Restoring old variables + (setenv "PATH" virtualenv-old-path) + (setq exec-path virtualenv-old-exec-path) + (message (concat "Virtualenv '" virtualenv-name "' deactivated.")) + (setq virtualenv-name nil)) + +(defun virtualenv-p (dir) + "Check if a directory is a virtualenv" + (file-exists-p (concat dir "/bin/activate"))) + +(defun virtualenv-workon-complete () + "return available completions for virtualenv-workon" + (let + ;;Varlist + ((filelist (directory-files virtualenv-workon-home t))) + ;; Get only the basename from the list of the virtual environments + ;; paths + (mapcar 'file-name-nondirectory + ;; Filter the directories and then the virtual environments + (virtualenv-filter 'virtualenv-p + (virtualenv-filter 'file-directory-p filelist))))) + +(defun virtualenv-workon (name) + "Issue a virtualenvwrapper-like virtualenv-workon command" + (interactive (list (completing-read "Virtualenv: " (virtualenv-workon-complete)))) + (if (getenv "WORKON_HOME") + (virtualenv-activate (concat (py--normalize-directory (getenv "WORKON_HOME")) name)) + (virtualenv-activate (concat (py--normalize-directory virtualenv-workon-home) name)))) + +;; python-components-booleans-beginning-forms + +(defun py--beginning-of-comment-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘comment’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-comment-re) + (point)))) + +(defun py--beginning-of-line-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘line’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-line-re) + (point)))) + +(defun py--beginning-of-paragraph-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘paragraph’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-paragraph-re) + (point)))) + +(defun py--beginning-of-expression-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘expression’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-expression-re) + (point)))) + +(defun py--beginning-of-partial-expression-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘partial-expression’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-partial-expression-re) + (point)))) + +(defun py--beginning-of-section-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘section’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-section-re) + (point)))) + +(defun py--beginning-of-top-level-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘top-level’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-top-level-re) + (point)))) + +(defun py--beginning-of-block-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-block-or-clause-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘block-or-clause’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-block-or-clause-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-class-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘class’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-class-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-clause-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘clause’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-clause-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-def-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘def’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-def-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-def-or-class-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘def-or-class’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-def-or-class-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-elif-block-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘elif-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-elif-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-else-block-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘else-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-else-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-except-block-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘except-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-except-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-for-block-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘for-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-for-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-if-block-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘if-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-if-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-indent-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘indent’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-indent-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-minor-block-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘minor-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-minor-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-statement-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘statement’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-statement-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-try-block-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘try-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-try-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (eq (current-column)(current-indentation)) + (point)))) + +(defun py--beginning-of-block-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-block-or-clause-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘block-or-clause’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-block-or-clause-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-class-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘class’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-class-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-clause-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘clause’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-clause-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-def-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘def’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-def-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-def-or-class-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘def-or-class’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-def-or-class-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-elif-block-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘elif-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-elif-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-else-block-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘else-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-else-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-except-block-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘except-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-except-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-for-block-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘for-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-for-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-if-block-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘if-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-if-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-indent-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘indent’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-indent-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-minor-block-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘minor-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-minor-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-statement-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘statement’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-statement-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +(defun py--beginning-of-try-block-bol-p (&optional pps) + "Return position, if cursor is at the beginning of a ‘try-block’, nil otherwise." + (let ((pps (or pps (parse-partial-sexp (point-min) (point))))) + (and (bolp) + (not (or (nth 8 pps)(nth 1 pps))) + (looking-at py-try-block-re) + (looking-back "[^ \t]*" (line-beginning-position)) + (point)))) + +;; python-components-booleans-end-forms + + +(defun py--end-of-comment-p () + "Return position, if cursor is at the end of a comment, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-comment) + (py-forward-comment) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-line-p () + "Return position, if cursor is at the end of a line, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-line) + (py-forward-line) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-paragraph-p () + "Return position, if cursor is at the end of a paragraph, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-paragraph) + (py-forward-paragraph) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-expression-p () + "Return position, if cursor is at the end of a expression, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-expression) + (py-forward-expression) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-partial-expression-p () + "Return position, if cursor is at the end of a partial-expression, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-partial-expression) + (py-forward-partial-expression) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-section-p () + "Return position, if cursor is at the end of a section, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-section) + (py-forward-section) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-top-level-p () + "Return position, if cursor is at the end of a top-level, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-top-level) + (py-forward-top-level) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-block-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-block-bol) + (py-forward-block-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-block-or-clause-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a block-or-clause, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-block-or-clause-bol) + (py-forward-block-or-clause-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-class-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a class, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-class-bol) + (py-forward-class-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-clause-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a clause, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-clause-bol) + (py-forward-clause-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-def-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a def, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-def-bol) + (py-forward-def-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-def-or-class-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a def-or-class, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-def-or-class-bol) + (py-forward-def-or-class-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-elif-block-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a elif-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-elif-block-bol) + (py-forward-elif-block-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-else-block-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a else-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-else-block-bol) + (py-forward-else-block-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-except-block-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a except-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-except-block-bol) + (py-forward-except-block-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-for-block-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a for-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-for-block-bol) + (py-forward-for-block-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-if-block-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a if-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-if-block-bol) + (py-forward-if-block-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-indent-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a indent, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-indent-bol) + (py-forward-indent-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-minor-block-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a minor-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-minor-block-bol) + (py-forward-minor-block-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-statement-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a statement, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-statement-bol) + (py-forward-statement-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-try-block-bol-p () + "Return position, if cursor is at ‘beginning-of-line’ at the end of a try-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-try-block-bol) + (py-forward-try-block-bol) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-block-p () + "Return position, if cursor is at the end of a block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-block) + (py-forward-block) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-block-or-clause-p () + "Return position, if cursor is at the end of a block-or-clause, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-block-or-clause) + (py-forward-block-or-clause) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-class-p () + "Return position, if cursor is at the end of a class, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-class) + (py-forward-class) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-clause-p () + "Return position, if cursor is at the end of a clause, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-clause) + (py-forward-clause) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-def-p () + "Return position, if cursor is at the end of a def, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-def) + (py-forward-def) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-def-or-class-p () + "Return position, if cursor is at the end of a def-or-class, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-def-or-class) + (py-forward-def-or-class) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-elif-block-p () + "Return position, if cursor is at the end of a elif-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-elif-block) + (py-forward-elif-block) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-else-block-p () + "Return position, if cursor is at the end of a else-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-else-block) + (py-forward-else-block) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-except-block-p () + "Return position, if cursor is at the end of a except-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-except-block) + (py-forward-except-block) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-for-block-p () + "Return position, if cursor is at the end of a for-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-for-block) + (py-forward-for-block) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-if-block-p () + "Return position, if cursor is at the end of a if-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-if-block) + (py-forward-if-block) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-indent-p () + "Return position, if cursor is at the end of a indent, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-indent) + (py-forward-indent) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-minor-block-p () + "Return position, if cursor is at the end of a minor-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-minor-block) + (py-forward-minor-block) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-statement-p () + "Return position, if cursor is at the end of a statement, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-statement) + (py-forward-statement) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +(defun py--end-of-try-block-p () + "Return position, if cursor is at the end of a try-block, nil otherwise." + (let ((orig (point)) + erg) + (save-excursion + (py-backward-try-block) + (py-forward-try-block) + (when (eq orig (point)) + (setq erg orig)) + erg))) + +;; python-components-beginning-position-forms + + +(defun py--beginning-of-block-position () + "Return beginning of block position." + (save-excursion + (let ((erg (or (py--beginning-of-block-p) + (py-backward-block)))) + erg))) + +(defun py--beginning-of-block-or-clause-position () + "Return beginning of block-or-clause position." + (save-excursion + (let ((erg (or (py--beginning-of-block-or-clause-p) + (py-backward-block-or-clause)))) + erg))) + +(defun py--beginning-of-class-position () + "Return beginning of class position." + (save-excursion + (let ((erg (or (py--beginning-of-class-p) + (py-backward-class)))) + erg))) + +(defun py--beginning-of-clause-position () + "Return beginning of clause position." + (save-excursion + (let ((erg (or (py--beginning-of-clause-p) + (py-backward-clause)))) + erg))) + +(defun py--beginning-of-comment-position () + "Return beginning of comment position." + (save-excursion + (let ((erg (or (py--beginning-of-comment-p) + (py-backward-comment)))) + erg))) + +(defun py--beginning-of-def-position () + "Return beginning of def position." + (save-excursion + (let ((erg (or (py--beginning-of-def-p) + (py-backward-def)))) + erg))) + +(defun py--beginning-of-def-or-class-position () + "Return beginning of def-or-class position." + (save-excursion + (let ((erg (or (py--beginning-of-def-or-class-p) + (py-backward-def-or-class)))) + erg))) + +(defun py--beginning-of-expression-position () + "Return beginning of expression position." + (save-excursion + (let ((erg (or (py--beginning-of-expression-p) + (py-backward-expression)))) + erg))) + +(defun py--beginning-of-except-block-position () + "Return beginning of except-block position." + (save-excursion + (let ((erg (or (py--beginning-of-except-block-p) + (py-backward-except-block)))) + erg))) + +(defun py--beginning-of-if-block-position () + "Return beginning of if-block position." + (save-excursion + (let ((erg (or (py--beginning-of-if-block-p) + (py-backward-if-block)))) + erg))) + +(defun py--beginning-of-indent-position () + "Return beginning of indent position." + (save-excursion + (let ((erg (or (py--beginning-of-indent-p) + (py-backward-indent)))) + erg))) + +(defun py--beginning-of-line-position () + "Return beginning of line position." + (save-excursion + (let ((erg (or (py--beginning-of-line-p) + (py-backward-line)))) + erg))) + +(defun py--beginning-of-minor-block-position () + "Return beginning of minor-block position." + (save-excursion + (let ((erg (or (py--beginning-of-minor-block-p) + (py-backward-minor-block)))) + erg))) + +(defun py--beginning-of-partial-expression-position () + "Return beginning of partial-expression position." + (save-excursion + (let ((erg (or (py--beginning-of-partial-expression-p) + (py-backward-partial-expression)))) + erg))) + +(defun py--beginning-of-paragraph-position () + "Return beginning of paragraph position." + (save-excursion + (let ((erg (or (py--beginning-of-paragraph-p) + (py-backward-paragraph)))) + erg))) + +(defun py--beginning-of-section-position () + "Return beginning of section position." + (save-excursion + (let ((erg (or (py--beginning-of-section-p) + (py-backward-section)))) + erg))) + +(defun py--beginning-of-statement-position () + "Return beginning of statement position." + (save-excursion + (let ((erg (or (py--beginning-of-statement-p) + (py-backward-statement)))) + erg))) + +(defun py--beginning-of-top-level-position () + "Return beginning of top-level position." + (save-excursion + (let ((erg (or (py--beginning-of-top-level-p) + (py-backward-top-level)))) + erg))) + +(defun py--beginning-of-try-block-position () + "Return beginning of try-block position." + (save-excursion + (let ((erg (or (py--beginning-of-try-block-p) + (py-backward-try-block)))) + erg))) + +(defun py--beginning-of-block-position-bol () + "Return beginning of block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-block-bol-p) + (py-backward-block-bol)))) + erg))) + +(defun py--beginning-of-block-or-clause-position-bol () + "Return beginning of block-or-clause position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-block-or-clause-bol-p) + (py-backward-block-or-clause-bol)))) + erg))) + +(defun py--beginning-of-class-position-bol () + "Return beginning of class position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-class-bol-p) + (py-backward-class-bol)))) + erg))) + +(defun py--beginning-of-clause-position-bol () + "Return beginning of clause position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-clause-bol-p) + (py-backward-clause-bol)))) + erg))) + +(defun py--beginning-of-def-position-bol () + "Return beginning of def position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-def-bol-p) + (py-backward-def-bol)))) + erg))) + +(defun py--beginning-of-def-or-class-position-bol () + "Return beginning of def-or-class position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-def-or-class-bol-p) + (py-backward-def-or-class-bol)))) + erg))) + +(defun py--beginning-of-elif-block-position-bol () + "Return beginning of elif-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-elif-block-bol-p) + (py-backward-elif-block-bol)))) + erg))) + +(defun py--beginning-of-else-block-position-bol () + "Return beginning of else-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-else-block-bol-p) + (py-backward-else-block-bol)))) + erg))) + +(defun py--beginning-of-except-block-position-bol () + "Return beginning of except-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-except-block-bol-p) + (py-backward-except-block-bol)))) + erg))) + +(defun py--beginning-of-for-block-position-bol () + "Return beginning of for-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-for-block-bol-p) + (py-backward-for-block-bol)))) + erg))) + +(defun py--beginning-of-if-block-position-bol () + "Return beginning of if-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-if-block-bol-p) + (py-backward-if-block-bol)))) + erg))) + +(defun py--beginning-of-indent-position-bol () + "Return beginning of indent position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-indent-bol-p) + (py-backward-indent-bol)))) + erg))) + +(defun py--beginning-of-minor-block-position-bol () + "Return beginning of minor-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-minor-block-bol-p) + (py-backward-minor-block-bol)))) + erg))) + +(defun py--beginning-of-statement-position-bol () + "Return beginning of statement position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-statement-bol-p) + (py-backward-statement-bol)))) + erg))) + +(defun py--beginning-of-try-block-position-bol () + "Return beginning of try-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (or (py--beginning-of-try-block-bol-p) + (py-backward-try-block-bol)))) + erg))) + +;; python-components-end-position-forms + + +(defun py--end-of-block-position () + "Return end of block position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-block)))) + erg))) + +(defun py--end-of-block-or-clause-position () + "Return end of block-or-clause position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-block-or-clause)))) + erg))) + +(defun py--end-of-class-position () + "Return end of class position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-class)))) + erg))) + +(defun py--end-of-clause-position () + "Return end of clause position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-clause)))) + erg))) + +(defun py--end-of-comment-position () + "Return end of comment position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-comment)))) + erg))) + +(defun py--end-of-def-position () + "Return end of def position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-def)))) + erg))) + +(defun py--end-of-def-or-class-position () + "Return end of def-or-class position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-def-or-class)))) + erg))) + +(defun py--end-of-expression-position () + "Return end of expression position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-expression)))) + erg))) + +(defun py--end-of-except-block-position () + "Return end of except-block position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-except-block)))) + erg))) + +(defun py--end-of-if-block-position () + "Return end of if-block position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-if-block)))) + erg))) + +(defun py--end-of-indent-position () + "Return end of indent position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-indent)))) + erg))) + +(defun py--end-of-line-position () + "Return end of line position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-line)))) + erg))) + +(defun py--end-of-minor-block-position () + "Return end of minor-block position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-minor-block)))) + erg))) + +(defun py--end-of-partial-expression-position () + "Return end of partial-expression position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-partial-expression)))) + erg))) + +(defun py--end-of-paragraph-position () + "Return end of paragraph position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-paragraph)))) + erg))) + +(defun py--end-of-section-position () + "Return end of section position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-section)))) + erg))) + +(defun py--end-of-statement-position () + "Return end of statement position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-statement)))) + erg))) + +(defun py--end-of-top-level-position () + "Return end of top-level position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-top-level)))) + erg))) + +(defun py--end-of-try-block-position () + "Return end of try-block position." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-try-block)))) + erg))) + +(defun py--end-of-block-position-bol () + "Return end of block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-block-bol)))) + erg))) + +(defun py--end-of-block-or-clause-position-bol () + "Return end of block-or-clause position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-block-or-clause-bol)))) + erg))) + +(defun py--end-of-class-position-bol () + "Return end of class position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-class-bol)))) + erg))) + +(defun py--end-of-clause-position-bol () + "Return end of clause position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-clause-bol)))) + erg))) + +(defun py--end-of-def-position-bol () + "Return end of def position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-def-bol)))) + erg))) + +(defun py--end-of-def-or-class-position-bol () + "Return end of def-or-class position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-def-or-class-bol)))) + erg))) + +(defun py--end-of-elif-block-position-bol () + "Return end of elif-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-elif-block-bol)))) + erg))) + +(defun py--end-of-else-block-position-bol () + "Return end of else-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-else-block-bol)))) + erg))) + +(defun py--end-of-except-block-position-bol () + "Return end of except-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-except-block-bol)))) + erg))) + +(defun py--end-of-for-block-position-bol () + "Return end of for-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-for-block-bol)))) + erg))) + +(defun py--end-of-if-block-position-bol () + "Return end of if-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-if-block-bol)))) + erg))) + +(defun py--end-of-indent-position-bol () + "Return end of indent position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-indent-bol)))) + erg))) + +(defun py--end-of-minor-block-position-bol () + "Return end of minor-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-minor-block-bol)))) + erg))) + +(defun py--end-of-statement-position-bol () + "Return end of statement position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-statement-bol)))) + erg))) + +(defun py--end-of-try-block-position-bol () + "Return end of try-block position at ‘beginning-of-line’." + (save-excursion + (let ((erg (progn + (when (looking-at "[ \\t\\r\\n\\f]*$") + (skip-chars-backward " \t\r\n\f") + (forward-char -1)) + (py-forward-try-block-bol)))) + erg))) + +;; python-components-up-down + + +(defun py-up-statement () + "go to the beginning of next statement upwards in buffer. + +Return position if statement found, nil otherwise." + (interactive) + (let (erg) + (if (py--beginning-of-statement-p) + (setq erg (py-backward-statement)) + (setq erg (and (py-backward-statement) (py-backward-statement)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + + +(defun py-up-base (regexp &optional indent orig decorator bol repeat) + "REGEXP is a quoted symbol + +Go to the beginning of next form upwards in buffer according to INDENT. + +Optional ORIG DECORATOR BOL REPEAT +Return position if form found, nil otherwise." + (unless (bobp) + (let* ((orig (or orig (point))) + (repeat (or (and repeat (1+ repeat)) 0)) + erg name command) + (if (< py-max-specpdl-size repeat) + (error "‘py-up-base’ reached loops max") + (if indent + (progn + (while (and (re-search-backward (symbol-value regexp) nil 'move 1) + (or (nth 8 (parse-partial-sexp (point-min) (point))) + (<= indent (current-indentation)))))) + (unless (py--beginning-of-statement-p) + (py-backward-statement)) + (if (looking-at (symbol-value regexp)) + (py-up-base regexp (current-indentation) orig decorator bol repeat) + (setq name (symbol-name regexp)) + (setq command (intern-soft (concat "py-backward-" (substring name (string-match "minor\\|block\\|def\\|class" name) (string-match "-re" name))))) + (funcall command) + (py-up-base regexp (current-indentation) orig decorator bol repeat))) + (when bol (beginning-of-line)) + (and (looking-at (symbol-value regexp)) (< (point) orig) (setq erg (point))) + (when py-verbose-p (message "%s" erg)) + erg)))) + +(defun py-down-statement () + "Go to the beginning of next statement downwards in buffer. + +Return position if statement found, nil otherwise." + (interactive) + (let* ((orig (point)) + erg) + (cond ((py--end-of-statement-p) + (setq erg + (and + (py-forward-statement) + (py-backward-statement) + (< orig (point)) + (point)))) + ((< orig (and (py-forward-statement) (py-backward-statement))) + (setq erg (point))) + (t (setq erg (ignore-errors (< orig (and (py-forward-statement) (py-forward-statement)(py-backward-statement))))))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-down-base (regexp &optional orig indent decorator bol) + "Go to the beginning of next form below in buffer. + +Return position if form found, nil otherwise. +Expects a quoted symbol 'REGEXP +Optional ORIG INDENT DECORATOR BOL" + (unless (eobp) + (let* ((name (substring (symbol-name regexp) 3 -3)) + (p-command (car (read-from-string (concat "py--beginning-of-" name "-p")))) + (backward-command (car (read-from-string (concat "py-backward-" name)))) + (up-command (car (read-from-string (concat "py-up-" name)))) + ;; (down-command (car (read-from-string (concat "py-down-" name)))) + (forward-command (car (read-from-string (concat "py-forward-" name)))) + erg done start) + (if (funcall p-command) + (setq indent (current-indentation)) + (save-excursion + (cond + ((and indent decorator bol) + (when (funcall backward-command indent decorator bol) + (setq indent (current-indentation)) + (setq start (point)))) + ((and indent decorator) + (when (funcall backward-command indent decorator) + (setq indent (current-indentation)) + (setq start (point)))) + (t (when + (funcall backward-command indent) + (setq indent (current-indentation)) + (setq start (point)))))) + (unless (and indent start) + (while (and (py-down-statement) + (not (looking-at (symbol-value regexp)))))) + + (when + (looking-at (symbol-value regexp)) + (setq done t) + (setq erg (point)) + ;; (setq indent (current-indentation)) + ;; (setq start (point)) + )) + ;; (setq done (funcall forward-command indent decorator bol)) + (while (and (not done) + (py-down-statement) + (< indent (current-indentation)))) + (when (looking-at (symbol-value regexp)) + (setq done (point))) + (when done + (when bol (beginning-of-line)) + (setq erg (point))) + (unless done + (goto-char orig) + (or + (if + (and + (funcall up-command) + ;; up should not result to backward + (not (eq (point) start)) + (funcall forward-command decorator bol) + (< orig (point)) + (setq erg (point))) + (when bol (setq erg (py--beginning-of-line-form erg))) + (goto-char (point-max))))) + (when py-verbose-p (message "%s" erg)) + erg))) + +(defalias 'py-block-up 'py-up-block) +(defun py-up-block (&optional indent decorator bol) + "Go to the beginning of next block upwards in buffer according to INDENT. +Optional DECORATOR BOL +Return position if block found, nil otherwise." + (interactive) + (py-up-base 'py-extended-block-or-clause-re indent (point) decorator bol)) + +(defalias 'py-class-up 'py-up-class) +(defun py-up-class (&optional indent decorator bol) + "Go to the beginning of next class upwards in buffer according to INDENT. +Optional DECORATOR BOL +Return position if class found, nil otherwise." + (interactive) + (py-up-base 'py-class-re indent (point) decorator bol)) + +(defalias 'py-def-up 'py-up-def) +(defun py-up-def (&optional indent decorator bol) + "Go to the beginning of next def upwards in buffer according to INDENT. +Optional DECORATOR BOL +Return position if def found, nil otherwise." + (interactive) + (py-up-base 'py-def-re indent (point) decorator bol)) + +(defalias 'py-def-or-class-up 'py-up-def-or-class) +(defun py-up-def-or-class (&optional indent decorator bol) + "Go to the beginning of next def-or-class upwards in buffer according to INDENT. +Optional DECORATOR BOL +Return position if def-or-class found, nil otherwise." + (interactive) + (py-up-base 'py-def-or-class-re indent (point) decorator bol)) + +(defalias 'py-minor-block-up 'py-up-minor-block) +(defun py-up-minor-block (&optional indent decorator bol) + "Go to the beginning of next minor-block upwards in buffer according to INDENT. +Optional DECORATOR BOL +Return position if minor-block found, nil otherwise." + (interactive) + (py-up-base 'py-extended-block-or-clause-re indent (point) decorator bol)) + +(defalias 'py-block-down 'py-down-block) +(defun py-down-block (&optional orig indent decorator bol) + "Go to the beginning of next block below in buffer according to INDENT. + +Optional INDENT DECORATOR BOL +Return position if block found, nil otherwise." + (interactive) + (py-down-base 'py-block-re (or orig (point)) indent decorator bol)) + +(defalias 'py-class-down 'py-down-class) +(defun py-down-class (&optional orig indent decorator bol) + "Go to the beginning of next class below in buffer according to INDENT. + +Optional INDENT DECORATOR BOL +Return position if class found, nil otherwise." + (interactive) + (py-down-base 'py-class-re (or orig (point)) indent decorator bol)) + +(defalias 'py-def-down 'py-down-def) +(defun py-down-def (&optional orig indent decorator bol) + "Go to the beginning of next def below in buffer according to INDENT. + +Optional INDENT DECORATOR BOL +Return position if def found, nil otherwise." + (interactive) + (py-down-base 'py-def-re (or orig (point)) indent decorator bol)) + +(defalias 'py-def-or-class-down 'py-down-def-or-class) +(defun py-down-def-or-class (&optional orig indent decorator bol) + "Go to the beginning of next def-or-class below in buffer according to INDENT. + +Optional INDENT DECORATOR BOL +Return position if def-or-class found, nil otherwise." + (interactive) + (py-down-base 'py-def-or-class-re (or orig (point)) indent decorator bol)) + +(defalias 'py-minor-block-down 'py-down-minor-block) +(defun py-down-minor-block (&optional orig indent decorator bol) + "Go to the beginning of next minor-block below in buffer according to INDENT. + +Optional INDENT DECORATOR BOL +Return position if minor-block found, nil otherwise." + (interactive) + (py-down-base 'py-minor-block-re (or orig (point)) indent decorator bol)) + +(defun py-up-block-bol (&optional indent decorator) + "Go to the beginning of next block upwards in buffer according to INDENT. + +Go to beginning of line. +Optional DECORATOR. +Return position if block found, nil otherwise." + (interactive) + (py-up-base 'py-block-re indent (point) decorator t)) + +(defun py-up-class-bol (&optional indent decorator) + "Go to the beginning of next class upwards in buffer according to INDENT. + +Go to beginning of line. +Optional DECORATOR. +Return position if class found, nil otherwise." + (interactive) + (py-up-base 'py-class-re indent (point) decorator t)) + +(defun py-up-def-bol (&optional indent decorator) + "Go to the beginning of next def upwards in buffer according to INDENT. + +Go to beginning of line. +Optional DECORATOR. +Return position if def found, nil otherwise." + (interactive) + (py-up-base 'py-def-re indent (point) decorator t)) + +(defun py-up-def-or-class-bol (&optional indent decorator) + "Go to the beginning of next def-or-class upwards in buffer according to INDENT. + +Go to beginning of line. +Optional DECORATOR. +Return position if def-or-class found, nil otherwise." + (interactive) + (py-up-base 'py-def-or-class-re indent (point) decorator t)) + +(defun py-up-minor-block-bol (&optional indent decorator) + "Go to the beginning of next minor-block upwards in buffer according to INDENT. + +Go to beginning of line. +Optional DECORATOR. +Return position if minor-block found, nil otherwise." + (interactive) + (py-up-base 'py-minor-block-re indent (point) decorator t)) + +(defun py-down-block-bol (&optional orig indent decorator bol) + "Go to the beginning of next block below in buffer according to INDENT. + +Optional INDENT DECORATOR BOL. +Go to beginning of line +Return position if block found, nil otherwise " + (interactive) + (py-down-base 'py-block-re (or orig (point)) indent decorator (or bol t))) + +(defun py-down-class-bol (&optional orig indent decorator bol) + "Go to the beginning of next class below in buffer according to INDENT. + +Optional INDENT DECORATOR BOL. +Go to beginning of line +Return position if class found, nil otherwise " + (interactive) + (py-down-base 'py-class-re (or orig (point)) indent decorator (or bol t))) + +(defun py-down-def-bol (&optional orig indent decorator bol) + "Go to the beginning of next def below in buffer according to INDENT. + +Optional INDENT DECORATOR BOL. +Go to beginning of line +Return position if def found, nil otherwise " + (interactive) + (py-down-base 'py-def-re (or orig (point)) indent decorator (or bol t))) + +(defun py-down-def-or-class-bol (&optional orig indent decorator bol) + "Go to the beginning of next def-or-class below in buffer according to INDENT. + +Optional INDENT DECORATOR BOL. +Go to beginning of line +Return position if def-or-class found, nil otherwise " + (interactive) + (py-down-base 'py-def-or-class-re (or orig (point)) indent decorator (or bol t))) + +(defun py-down-minor-block-bol (&optional orig indent decorator bol) + "Go to the beginning of next minor-block below in buffer according to INDENT. + +Optional INDENT DECORATOR BOL. +Go to beginning of line +Return position if minor-block found, nil otherwise " + (interactive) + (py-down-base 'py-minor-block-re (or orig (point)) indent decorator (or bol t))) + +;; python-components-up-down.el ends here +;; python-components-exec-forms + +;; Execute forms at point + +(defun py-execute-try-block () + "Send try-block at point to Python default interpreter." + (interactive) + (let ((beg (prog1 + (or (py--beginning-of-try-block-p) + (save-excursion + (py-backward-try-block))))) + (end (save-excursion + (py-forward-try-block)))) + (py-execute-region beg end))) + +(defun py-execute-if-block () + "Send if-block at point to Python default interpreter." + (interactive) + (let ((beg (prog1 + (or (py--beginning-of-if-block-p) + (save-excursion + (py-backward-if-block))))) + (end (save-excursion + (py-forward-if-block)))) + (py-execute-region beg end))) + +(defun py-execute-for-block () + "Send for-block at point to Python default interpreter." + (interactive) + (let ((beg (prog1 + (or (py--beginning-of-for-block-p) + (save-excursion + (py-backward-for-block))))) + (end (save-excursion + (py-forward-for-block)))) + (py-execute-region beg end))) + +;; python-components-extended-executes + + +(defun py-execute-block (&optional shell dedicated fast split switch proc) + "Send block at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-switch (&optional shell dedicated fast split proc) + "Send block at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-no-switch (&optional shell dedicated fast split proc) + "Send block at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-dedicated (&optional shell fast split switch proc) + "Send block at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block shell t switch nil fast proc wholebuf split))) + +(defun py-execute-block-dedicated-switch (&optional shell fast split proc) + "Send block at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython (&optional dedicated fast split switch proc) + "Send block at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython-switch (&optional dedicated fast split proc) + "Send block at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython-no-switch (&optional dedicated fast split proc) + "Send block at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython-dedicated (&optional fast split switch proc) + "Send block at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython-dedicated-switch (&optional fast split proc) + "Send block at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython2.7 (&optional dedicated fast split switch proc) + "Send block at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython2.7-switch (&optional dedicated fast split proc) + "Send block at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send block at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython2.7-dedicated (&optional fast split switch proc) + "Send block at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython2.7-dedicated-switch (&optional fast split proc) + "Send block at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython3 (&optional dedicated fast split switch proc) + "Send block at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython3-switch (&optional dedicated fast split proc) + "Send block at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython3-no-switch (&optional dedicated fast split proc) + "Send block at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython3-dedicated (&optional fast split switch proc) + "Send block at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-block-ipython3-dedicated-switch (&optional fast split proc) + "Send block at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-jython (&optional dedicated fast split switch proc) + "Send block at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-jython-switch (&optional dedicated fast split proc) + "Send block at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-jython-no-switch (&optional dedicated fast split proc) + "Send block at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-jython-dedicated (&optional fast split switch proc) + "Send block at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-block-jython-dedicated-switch (&optional fast split proc) + "Send block at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-python (&optional dedicated fast split switch proc) + "Send block at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-python-switch (&optional dedicated fast split proc) + "Send block at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-python-no-switch (&optional dedicated fast split proc) + "Send block at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-python-dedicated (&optional fast split switch proc) + "Send block at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-block-python-dedicated-switch (&optional fast split proc) + "Send block at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-python2 (&optional dedicated fast split switch proc) + "Send block at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-python2-switch (&optional dedicated fast split proc) + "Send block at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-python2-no-switch (&optional dedicated fast split proc) + "Send block at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-python2-dedicated (&optional fast split switch proc) + "Send block at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-block-python2-dedicated-switch (&optional fast split proc) + "Send block at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-python3 (&optional dedicated fast split switch proc) + "Send block at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-python3-switch (&optional dedicated fast split proc) + "Send block at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-python3-no-switch (&optional dedicated fast split proc) + "Send block at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-python3-dedicated (&optional fast split switch proc) + "Send block at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-block-python3-dedicated-switch (&optional fast split proc) + "Send block at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause (&optional shell dedicated fast split switch proc) + "Send block-or-clause at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-switch (&optional shell dedicated fast split proc) + "Send block-or-clause at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-no-switch (&optional shell dedicated fast split proc) + "Send block-or-clause at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-dedicated (&optional shell fast split switch proc) + "Send block-or-clause at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause shell t switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-dedicated-switch (&optional shell fast split proc) + "Send block-or-clause at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython (&optional dedicated fast split switch proc) + "Send block-or-clause at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython-no-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython-dedicated (&optional fast split switch proc) + "Send block-or-clause at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython-dedicated-switch (&optional fast split proc) + "Send block-or-clause at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython2.7 (&optional dedicated fast split switch proc) + "Send block-or-clause at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython2.7-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython2.7-dedicated (&optional fast split switch proc) + "Send block-or-clause at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython2.7-dedicated-switch (&optional fast split proc) + "Send block-or-clause at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython3 (&optional dedicated fast split switch proc) + "Send block-or-clause at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython3-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython3-no-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython3-dedicated (&optional fast split switch proc) + "Send block-or-clause at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-ipython3-dedicated-switch (&optional fast split proc) + "Send block-or-clause at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-jython (&optional dedicated fast split switch proc) + "Send block-or-clause at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-jython-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-jython-no-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-jython-dedicated (&optional fast split switch proc) + "Send block-or-clause at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-jython-dedicated-switch (&optional fast split proc) + "Send block-or-clause at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python (&optional dedicated fast split switch proc) + "Send block-or-clause at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python-no-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python-dedicated (&optional fast split switch proc) + "Send block-or-clause at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python-dedicated-switch (&optional fast split proc) + "Send block-or-clause at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python2 (&optional dedicated fast split switch proc) + "Send block-or-clause at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python2-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python2-no-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python2-dedicated (&optional fast split switch proc) + "Send block-or-clause at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python2-dedicated-switch (&optional fast split proc) + "Send block-or-clause at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python3 (&optional dedicated fast split switch proc) + "Send block-or-clause at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python3-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python3-no-switch (&optional dedicated fast split proc) + "Send block-or-clause at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python3-dedicated (&optional fast split switch proc) + "Send block-or-clause at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-block-or-clause-python3-dedicated-switch (&optional fast split proc) + "Send block-or-clause at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'block-or-clause 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-buffer (&optional shell dedicated fast split switch proc) + "Send buffer at point to interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer shell dedicated switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-switch (&optional shell dedicated fast split proc) + "Send buffer at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer shell dedicated 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-no-switch (&optional shell dedicated fast split proc) + "Send buffer at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer shell dedicated 'no-switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-dedicated (&optional shell fast split switch proc) + "Send buffer at point to unique interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer shell t switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-dedicated-switch (&optional shell fast split proc) + "Send buffer at point to unique interpreter and switch to result." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer shell t 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython (&optional dedicated fast split switch proc) + "Send buffer at point to IPython interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython dedicated switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython-switch (&optional dedicated fast split proc) + "Send buffer at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython dedicated 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython-no-switch (&optional dedicated fast split proc) + "Send buffer at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython dedicated 'no-switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython-dedicated (&optional fast split switch proc) + "Send buffer at point to IPython unique interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython t switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython-dedicated-switch (&optional fast split proc) + "Send buffer at point to IPython unique interpreter and switch to result." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython t 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython2.7 (&optional dedicated fast split switch proc) + "Send buffer at point to IPython interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython2.7 dedicated switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython2.7-switch (&optional dedicated fast split proc) + "Send buffer at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython2.7 dedicated 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send buffer at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython2.7 dedicated 'no-switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython2.7-dedicated (&optional fast split switch proc) + "Send buffer at point to IPython unique interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython2.7 t switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython2.7-dedicated-switch (&optional fast split proc) + "Send buffer at point to IPython unique interpreter and switch to result." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython2.7 t 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython3 (&optional dedicated fast split switch proc) + "Send buffer at point to IPython interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython3 dedicated switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython3-switch (&optional dedicated fast split proc) + "Send buffer at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython3 dedicated 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython3-no-switch (&optional dedicated fast split proc) + "Send buffer at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython3 dedicated 'no-switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython3-dedicated (&optional fast split switch proc) + "Send buffer at point to IPython unique interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython3 t switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-ipython3-dedicated-switch (&optional fast split proc) + "Send buffer at point to IPython unique interpreter and switch to result." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'ipython3 t 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-jython (&optional dedicated fast split switch proc) + "Send buffer at point to Jython interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'jython dedicated switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-jython-switch (&optional dedicated fast split proc) + "Send buffer at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'jython dedicated 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-jython-no-switch (&optional dedicated fast split proc) + "Send buffer at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'jython dedicated 'no-switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-jython-dedicated (&optional fast split switch proc) + "Send buffer at point to Jython unique interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'jython t switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-jython-dedicated-switch (&optional fast split proc) + "Send buffer at point to Jython unique interpreter and switch to result." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'jython t 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python (&optional dedicated fast split switch proc) + "Send buffer at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python dedicated switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python-switch (&optional dedicated fast split proc) + "Send buffer at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python dedicated 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python-no-switch (&optional dedicated fast split proc) + "Send buffer at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python dedicated 'no-switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python-dedicated (&optional fast split switch proc) + "Send buffer at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python t switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python-dedicated-switch (&optional fast split proc) + "Send buffer at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python t 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python2 (&optional dedicated fast split switch proc) + "Send buffer at point to Python2 interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python2 dedicated switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python2-switch (&optional dedicated fast split proc) + "Send buffer at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python2 dedicated 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python2-no-switch (&optional dedicated fast split proc) + "Send buffer at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python2 dedicated 'no-switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python2-dedicated (&optional fast split switch proc) + "Send buffer at point to Python2 unique interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python2 t switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python2-dedicated-switch (&optional fast split proc) + "Send buffer at point to Python2 unique interpreter and switch to result." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python2 t 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python3 (&optional dedicated fast split switch proc) + "Send buffer at point to Python3 interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python3 dedicated switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python3-switch (&optional dedicated fast split proc) + "Send buffer at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python3 dedicated 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python3-no-switch (&optional dedicated fast split proc) + "Send buffer at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python3 dedicated 'no-switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python3-dedicated (&optional fast split switch proc) + "Send buffer at point to Python3 unique interpreter." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python3 t switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-buffer-python3-dedicated-switch (&optional fast split proc) + "Send buffer at point to Python3 unique interpreter and switch to result." + (interactive) + (let ((py-master-file (or py-master-file (py-fetch-py-master-file))) + (wholebuf t) + filename buffer) + (when py-master-file + (setq filename (expand-file-name py-master-file) + buffer (or (get-file-buffer filename) + (find-file-noselect filename))) + (set-buffer buffer)) + (py--execute-prepare 'buffer 'python3 t 'switch (point-min) (point-max) nil fast proc wholebuf split))) + +(defun py-execute-class (&optional shell dedicated fast split switch proc) + "Send class at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-class-switch (&optional shell dedicated fast split proc) + "Send class at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-no-switch (&optional shell dedicated fast split proc) + "Send class at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'class shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-class-dedicated (&optional shell fast split switch proc) + "Send class at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class shell t switch nil fast proc wholebuf split))) + +(defun py-execute-class-dedicated-switch (&optional shell fast split proc) + "Send class at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython (&optional dedicated fast split switch proc) + "Send class at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython-switch (&optional dedicated fast split proc) + "Send class at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython-no-switch (&optional dedicated fast split proc) + "Send class at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython-dedicated (&optional fast split switch proc) + "Send class at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython-dedicated-switch (&optional fast split proc) + "Send class at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython2.7 (&optional dedicated fast split switch proc) + "Send class at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython2.7-switch (&optional dedicated fast split proc) + "Send class at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send class at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython2.7-dedicated (&optional fast split switch proc) + "Send class at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython2.7-dedicated-switch (&optional fast split proc) + "Send class at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython3 (&optional dedicated fast split switch proc) + "Send class at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython3-switch (&optional dedicated fast split proc) + "Send class at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython3-no-switch (&optional dedicated fast split proc) + "Send class at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython3-dedicated (&optional fast split switch proc) + "Send class at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-class-ipython3-dedicated-switch (&optional fast split proc) + "Send class at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-jython (&optional dedicated fast split switch proc) + "Send class at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-class-jython-switch (&optional dedicated fast split proc) + "Send class at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-jython-no-switch (&optional dedicated fast split proc) + "Send class at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-class-jython-dedicated (&optional fast split switch proc) + "Send class at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-class-jython-dedicated-switch (&optional fast split proc) + "Send class at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-python (&optional dedicated fast split switch proc) + "Send class at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-class-python-switch (&optional dedicated fast split proc) + "Send class at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-python-no-switch (&optional dedicated fast split proc) + "Send class at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-class-python-dedicated (&optional fast split switch proc) + "Send class at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-class-python-dedicated-switch (&optional fast split proc) + "Send class at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-python2 (&optional dedicated fast split switch proc) + "Send class at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-class-python2-switch (&optional dedicated fast split proc) + "Send class at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-python2-no-switch (&optional dedicated fast split proc) + "Send class at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-class-python2-dedicated (&optional fast split switch proc) + "Send class at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-class-python2-dedicated-switch (&optional fast split proc) + "Send class at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-python3 (&optional dedicated fast split switch proc) + "Send class at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-class-python3-switch (&optional dedicated fast split proc) + "Send class at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-class-python3-no-switch (&optional dedicated fast split proc) + "Send class at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-class-python3-dedicated (&optional fast split switch proc) + "Send class at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-class-python3-dedicated-switch (&optional fast split proc) + "Send class at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'class 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause (&optional shell dedicated fast split switch proc) + "Send clause at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-clause-switch (&optional shell dedicated fast split proc) + "Send clause at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-no-switch (&optional shell dedicated fast split proc) + "Send clause at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-clause-dedicated (&optional shell fast split switch proc) + "Send clause at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause shell t switch nil fast proc wholebuf split))) + +(defun py-execute-clause-dedicated-switch (&optional shell fast split proc) + "Send clause at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython (&optional dedicated fast split switch proc) + "Send clause at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython-switch (&optional dedicated fast split proc) + "Send clause at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython-no-switch (&optional dedicated fast split proc) + "Send clause at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython-dedicated (&optional fast split switch proc) + "Send clause at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython-dedicated-switch (&optional fast split proc) + "Send clause at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython2.7 (&optional dedicated fast split switch proc) + "Send clause at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython2.7-switch (&optional dedicated fast split proc) + "Send clause at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send clause at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython2.7-dedicated (&optional fast split switch proc) + "Send clause at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython2.7-dedicated-switch (&optional fast split proc) + "Send clause at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython3 (&optional dedicated fast split switch proc) + "Send clause at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython3-switch (&optional dedicated fast split proc) + "Send clause at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython3-no-switch (&optional dedicated fast split proc) + "Send clause at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython3-dedicated (&optional fast split switch proc) + "Send clause at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-clause-ipython3-dedicated-switch (&optional fast split proc) + "Send clause at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-jython (&optional dedicated fast split switch proc) + "Send clause at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-clause-jython-switch (&optional dedicated fast split proc) + "Send clause at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-jython-no-switch (&optional dedicated fast split proc) + "Send clause at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-clause-jython-dedicated (&optional fast split switch proc) + "Send clause at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-clause-jython-dedicated-switch (&optional fast split proc) + "Send clause at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python (&optional dedicated fast split switch proc) + "Send clause at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python-switch (&optional dedicated fast split proc) + "Send clause at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python-no-switch (&optional dedicated fast split proc) + "Send clause at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python-dedicated (&optional fast split switch proc) + "Send clause at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python-dedicated-switch (&optional fast split proc) + "Send clause at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python2 (&optional dedicated fast split switch proc) + "Send clause at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python2-switch (&optional dedicated fast split proc) + "Send clause at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python2-no-switch (&optional dedicated fast split proc) + "Send clause at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python2-dedicated (&optional fast split switch proc) + "Send clause at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python2-dedicated-switch (&optional fast split proc) + "Send clause at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python3 (&optional dedicated fast split switch proc) + "Send clause at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python3-switch (&optional dedicated fast split proc) + "Send clause at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python3-no-switch (&optional dedicated fast split proc) + "Send clause at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python3-dedicated (&optional fast split switch proc) + "Send clause at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-clause-python3-dedicated-switch (&optional fast split proc) + "Send clause at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'clause 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def (&optional shell dedicated fast split switch proc) + "Send def at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-switch (&optional shell dedicated fast split proc) + "Send def at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-no-switch (&optional shell dedicated fast split proc) + "Send def at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-dedicated (&optional shell fast split switch proc) + "Send def at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def shell t switch nil fast proc wholebuf split))) + +(defun py-execute-def-dedicated-switch (&optional shell fast split proc) + "Send def at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython (&optional dedicated fast split switch proc) + "Send def at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython-switch (&optional dedicated fast split proc) + "Send def at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython-no-switch (&optional dedicated fast split proc) + "Send def at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython-dedicated (&optional fast split switch proc) + "Send def at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython-dedicated-switch (&optional fast split proc) + "Send def at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython2.7 (&optional dedicated fast split switch proc) + "Send def at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython2.7-switch (&optional dedicated fast split proc) + "Send def at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send def at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython2.7-dedicated (&optional fast split switch proc) + "Send def at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython2.7-dedicated-switch (&optional fast split proc) + "Send def at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython3 (&optional dedicated fast split switch proc) + "Send def at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython3-switch (&optional dedicated fast split proc) + "Send def at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython3-no-switch (&optional dedicated fast split proc) + "Send def at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython3-dedicated (&optional fast split switch proc) + "Send def at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-def-ipython3-dedicated-switch (&optional fast split proc) + "Send def at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-jython (&optional dedicated fast split switch proc) + "Send def at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-jython-switch (&optional dedicated fast split proc) + "Send def at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-jython-no-switch (&optional dedicated fast split proc) + "Send def at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-jython-dedicated (&optional fast split switch proc) + "Send def at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-def-jython-dedicated-switch (&optional fast split proc) + "Send def at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-python (&optional dedicated fast split switch proc) + "Send def at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-python-switch (&optional dedicated fast split proc) + "Send def at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-python-no-switch (&optional dedicated fast split proc) + "Send def at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-python-dedicated (&optional fast split switch proc) + "Send def at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-def-python-dedicated-switch (&optional fast split proc) + "Send def at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-python2 (&optional dedicated fast split switch proc) + "Send def at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-python2-switch (&optional dedicated fast split proc) + "Send def at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-python2-no-switch (&optional dedicated fast split proc) + "Send def at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-python2-dedicated (&optional fast split switch proc) + "Send def at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-def-python2-dedicated-switch (&optional fast split proc) + "Send def at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-python3 (&optional dedicated fast split switch proc) + "Send def at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-python3-switch (&optional dedicated fast split proc) + "Send def at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-python3-no-switch (&optional dedicated fast split proc) + "Send def at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-python3-dedicated (&optional fast split switch proc) + "Send def at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-def-python3-dedicated-switch (&optional fast split proc) + "Send def at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class (&optional shell dedicated fast split switch proc) + "Send def-or-class at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-switch (&optional shell dedicated fast split proc) + "Send def-or-class at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-no-switch (&optional shell dedicated fast split proc) + "Send def-or-class at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-dedicated (&optional shell fast split switch proc) + "Send def-or-class at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class shell t switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-dedicated-switch (&optional shell fast split proc) + "Send def-or-class at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython (&optional dedicated fast split switch proc) + "Send def-or-class at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython-switch (&optional dedicated fast split proc) + "Send def-or-class at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython-no-switch (&optional dedicated fast split proc) + "Send def-or-class at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython-dedicated (&optional fast split switch proc) + "Send def-or-class at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython-dedicated-switch (&optional fast split proc) + "Send def-or-class at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython2.7 (&optional dedicated fast split switch proc) + "Send def-or-class at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython2.7-switch (&optional dedicated fast split proc) + "Send def-or-class at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send def-or-class at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython2.7-dedicated (&optional fast split switch proc) + "Send def-or-class at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython2.7-dedicated-switch (&optional fast split proc) + "Send def-or-class at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython3 (&optional dedicated fast split switch proc) + "Send def-or-class at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython3-switch (&optional dedicated fast split proc) + "Send def-or-class at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython3-no-switch (&optional dedicated fast split proc) + "Send def-or-class at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython3-dedicated (&optional fast split switch proc) + "Send def-or-class at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-ipython3-dedicated-switch (&optional fast split proc) + "Send def-or-class at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-jython (&optional dedicated fast split switch proc) + "Send def-or-class at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-jython-switch (&optional dedicated fast split proc) + "Send def-or-class at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-jython-no-switch (&optional dedicated fast split proc) + "Send def-or-class at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-jython-dedicated (&optional fast split switch proc) + "Send def-or-class at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-jython-dedicated-switch (&optional fast split proc) + "Send def-or-class at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python (&optional dedicated fast split switch proc) + "Send def-or-class at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python-switch (&optional dedicated fast split proc) + "Send def-or-class at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python-no-switch (&optional dedicated fast split proc) + "Send def-or-class at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python-dedicated (&optional fast split switch proc) + "Send def-or-class at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python-dedicated-switch (&optional fast split proc) + "Send def-or-class at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python2 (&optional dedicated fast split switch proc) + "Send def-or-class at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python2-switch (&optional dedicated fast split proc) + "Send def-or-class at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python2-no-switch (&optional dedicated fast split proc) + "Send def-or-class at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python2-dedicated (&optional fast split switch proc) + "Send def-or-class at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python2-dedicated-switch (&optional fast split proc) + "Send def-or-class at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python3 (&optional dedicated fast split switch proc) + "Send def-or-class at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python3-switch (&optional dedicated fast split proc) + "Send def-or-class at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python3-no-switch (&optional dedicated fast split proc) + "Send def-or-class at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python3-dedicated (&optional fast split switch proc) + "Send def-or-class at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-def-or-class-python3-dedicated-switch (&optional fast split proc) + "Send def-or-class at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'def-or-class 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression (&optional shell dedicated fast split switch proc) + "Send expression at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-expression-switch (&optional shell dedicated fast split proc) + "Send expression at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-no-switch (&optional shell dedicated fast split proc) + "Send expression at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-expression-dedicated (&optional shell fast split switch proc) + "Send expression at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression shell t switch nil fast proc wholebuf split))) + +(defun py-execute-expression-dedicated-switch (&optional shell fast split proc) + "Send expression at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython (&optional dedicated fast split switch proc) + "Send expression at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython-switch (&optional dedicated fast split proc) + "Send expression at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython-no-switch (&optional dedicated fast split proc) + "Send expression at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython-dedicated (&optional fast split switch proc) + "Send expression at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython-dedicated-switch (&optional fast split proc) + "Send expression at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython2.7 (&optional dedicated fast split switch proc) + "Send expression at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython2.7-switch (&optional dedicated fast split proc) + "Send expression at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send expression at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython2.7-dedicated (&optional fast split switch proc) + "Send expression at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython2.7-dedicated-switch (&optional fast split proc) + "Send expression at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython3 (&optional dedicated fast split switch proc) + "Send expression at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython3-switch (&optional dedicated fast split proc) + "Send expression at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython3-no-switch (&optional dedicated fast split proc) + "Send expression at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython3-dedicated (&optional fast split switch proc) + "Send expression at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-expression-ipython3-dedicated-switch (&optional fast split proc) + "Send expression at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-jython (&optional dedicated fast split switch proc) + "Send expression at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-expression-jython-switch (&optional dedicated fast split proc) + "Send expression at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-jython-no-switch (&optional dedicated fast split proc) + "Send expression at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-expression-jython-dedicated (&optional fast split switch proc) + "Send expression at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-expression-jython-dedicated-switch (&optional fast split proc) + "Send expression at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python (&optional dedicated fast split switch proc) + "Send expression at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python-switch (&optional dedicated fast split proc) + "Send expression at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python-no-switch (&optional dedicated fast split proc) + "Send expression at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python-dedicated (&optional fast split switch proc) + "Send expression at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python-dedicated-switch (&optional fast split proc) + "Send expression at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python2 (&optional dedicated fast split switch proc) + "Send expression at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python2-switch (&optional dedicated fast split proc) + "Send expression at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python2-no-switch (&optional dedicated fast split proc) + "Send expression at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python2-dedicated (&optional fast split switch proc) + "Send expression at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python2-dedicated-switch (&optional fast split proc) + "Send expression at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python3 (&optional dedicated fast split switch proc) + "Send expression at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python3-switch (&optional dedicated fast split proc) + "Send expression at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python3-no-switch (&optional dedicated fast split proc) + "Send expression at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python3-dedicated (&optional fast split switch proc) + "Send expression at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-expression-python3-dedicated-switch (&optional fast split proc) + "Send expression at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'expression 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent (&optional shell dedicated fast split switch proc) + "Send indent at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-indent-switch (&optional shell dedicated fast split proc) + "Send indent at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-no-switch (&optional shell dedicated fast split proc) + "Send indent at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-indent-dedicated (&optional shell fast split switch proc) + "Send indent at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent shell t switch nil fast proc wholebuf split))) + +(defun py-execute-indent-dedicated-switch (&optional shell fast split proc) + "Send indent at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython (&optional dedicated fast split switch proc) + "Send indent at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython-switch (&optional dedicated fast split proc) + "Send indent at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython-no-switch (&optional dedicated fast split proc) + "Send indent at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython-dedicated (&optional fast split switch proc) + "Send indent at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython-dedicated-switch (&optional fast split proc) + "Send indent at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython2.7 (&optional dedicated fast split switch proc) + "Send indent at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython2.7-switch (&optional dedicated fast split proc) + "Send indent at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send indent at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython2.7-dedicated (&optional fast split switch proc) + "Send indent at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython2.7-dedicated-switch (&optional fast split proc) + "Send indent at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython3 (&optional dedicated fast split switch proc) + "Send indent at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython3-switch (&optional dedicated fast split proc) + "Send indent at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython3-no-switch (&optional dedicated fast split proc) + "Send indent at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython3-dedicated (&optional fast split switch proc) + "Send indent at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-indent-ipython3-dedicated-switch (&optional fast split proc) + "Send indent at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-jython (&optional dedicated fast split switch proc) + "Send indent at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-indent-jython-switch (&optional dedicated fast split proc) + "Send indent at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-jython-no-switch (&optional dedicated fast split proc) + "Send indent at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-indent-jython-dedicated (&optional fast split switch proc) + "Send indent at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-indent-jython-dedicated-switch (&optional fast split proc) + "Send indent at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python (&optional dedicated fast split switch proc) + "Send indent at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python-switch (&optional dedicated fast split proc) + "Send indent at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python-no-switch (&optional dedicated fast split proc) + "Send indent at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python-dedicated (&optional fast split switch proc) + "Send indent at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python-dedicated-switch (&optional fast split proc) + "Send indent at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python2 (&optional dedicated fast split switch proc) + "Send indent at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python2-switch (&optional dedicated fast split proc) + "Send indent at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python2-no-switch (&optional dedicated fast split proc) + "Send indent at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python2-dedicated (&optional fast split switch proc) + "Send indent at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python2-dedicated-switch (&optional fast split proc) + "Send indent at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python3 (&optional dedicated fast split switch proc) + "Send indent at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python3-switch (&optional dedicated fast split proc) + "Send indent at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python3-no-switch (&optional dedicated fast split proc) + "Send indent at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python3-dedicated (&optional fast split switch proc) + "Send indent at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-indent-python3-dedicated-switch (&optional fast split proc) + "Send indent at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'indent 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-line (&optional shell dedicated fast split switch proc) + "Send line at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-line-switch (&optional shell dedicated fast split proc) + "Send line at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-no-switch (&optional shell dedicated fast split proc) + "Send line at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'line shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-line-dedicated (&optional shell fast split switch proc) + "Send line at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line shell t switch nil fast proc wholebuf split))) + +(defun py-execute-line-dedicated-switch (&optional shell fast split proc) + "Send line at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython (&optional dedicated fast split switch proc) + "Send line at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython-switch (&optional dedicated fast split proc) + "Send line at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython-no-switch (&optional dedicated fast split proc) + "Send line at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython-dedicated (&optional fast split switch proc) + "Send line at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython-dedicated-switch (&optional fast split proc) + "Send line at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython2.7 (&optional dedicated fast split switch proc) + "Send line at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython2.7-switch (&optional dedicated fast split proc) + "Send line at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send line at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython2.7-dedicated (&optional fast split switch proc) + "Send line at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython2.7-dedicated-switch (&optional fast split proc) + "Send line at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython3 (&optional dedicated fast split switch proc) + "Send line at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython3-switch (&optional dedicated fast split proc) + "Send line at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython3-no-switch (&optional dedicated fast split proc) + "Send line at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython3-dedicated (&optional fast split switch proc) + "Send line at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-line-ipython3-dedicated-switch (&optional fast split proc) + "Send line at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-jython (&optional dedicated fast split switch proc) + "Send line at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-line-jython-switch (&optional dedicated fast split proc) + "Send line at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-jython-no-switch (&optional dedicated fast split proc) + "Send line at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-line-jython-dedicated (&optional fast split switch proc) + "Send line at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-line-jython-dedicated-switch (&optional fast split proc) + "Send line at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-python (&optional dedicated fast split switch proc) + "Send line at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-line-python-switch (&optional dedicated fast split proc) + "Send line at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-python-no-switch (&optional dedicated fast split proc) + "Send line at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-line-python-dedicated (&optional fast split switch proc) + "Send line at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-line-python-dedicated-switch (&optional fast split proc) + "Send line at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-python2 (&optional dedicated fast split switch proc) + "Send line at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-line-python2-switch (&optional dedicated fast split proc) + "Send line at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-python2-no-switch (&optional dedicated fast split proc) + "Send line at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-line-python2-dedicated (&optional fast split switch proc) + "Send line at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-line-python2-dedicated-switch (&optional fast split proc) + "Send line at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-python3 (&optional dedicated fast split switch proc) + "Send line at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-line-python3-switch (&optional dedicated fast split proc) + "Send line at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-line-python3-no-switch (&optional dedicated fast split proc) + "Send line at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-line-python3-dedicated (&optional fast split switch proc) + "Send line at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-line-python3-dedicated-switch (&optional fast split proc) + "Send line at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'line 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block (&optional shell dedicated fast split switch proc) + "Send minor-block at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-switch (&optional shell dedicated fast split proc) + "Send minor-block at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-no-switch (&optional shell dedicated fast split proc) + "Send minor-block at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-dedicated (&optional shell fast split switch proc) + "Send minor-block at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block shell t switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-dedicated-switch (&optional shell fast split proc) + "Send minor-block at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython (&optional dedicated fast split switch proc) + "Send minor-block at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython-switch (&optional dedicated fast split proc) + "Send minor-block at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython-no-switch (&optional dedicated fast split proc) + "Send minor-block at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython-dedicated (&optional fast split switch proc) + "Send minor-block at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython-dedicated-switch (&optional fast split proc) + "Send minor-block at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython2.7 (&optional dedicated fast split switch proc) + "Send minor-block at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython2.7-switch (&optional dedicated fast split proc) + "Send minor-block at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send minor-block at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython2.7-dedicated (&optional fast split switch proc) + "Send minor-block at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython2.7-dedicated-switch (&optional fast split proc) + "Send minor-block at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython3 (&optional dedicated fast split switch proc) + "Send minor-block at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython3-switch (&optional dedicated fast split proc) + "Send minor-block at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython3-no-switch (&optional dedicated fast split proc) + "Send minor-block at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython3-dedicated (&optional fast split switch proc) + "Send minor-block at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-ipython3-dedicated-switch (&optional fast split proc) + "Send minor-block at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-jython (&optional dedicated fast split switch proc) + "Send minor-block at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-jython-switch (&optional dedicated fast split proc) + "Send minor-block at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-jython-no-switch (&optional dedicated fast split proc) + "Send minor-block at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-jython-dedicated (&optional fast split switch proc) + "Send minor-block at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-jython-dedicated-switch (&optional fast split proc) + "Send minor-block at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python (&optional dedicated fast split switch proc) + "Send minor-block at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python-switch (&optional dedicated fast split proc) + "Send minor-block at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python-no-switch (&optional dedicated fast split proc) + "Send minor-block at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python-dedicated (&optional fast split switch proc) + "Send minor-block at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python-dedicated-switch (&optional fast split proc) + "Send minor-block at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python2 (&optional dedicated fast split switch proc) + "Send minor-block at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python2-switch (&optional dedicated fast split proc) + "Send minor-block at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python2-no-switch (&optional dedicated fast split proc) + "Send minor-block at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python2-dedicated (&optional fast split switch proc) + "Send minor-block at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python2-dedicated-switch (&optional fast split proc) + "Send minor-block at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python3 (&optional dedicated fast split switch proc) + "Send minor-block at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python3-switch (&optional dedicated fast split proc) + "Send minor-block at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python3-no-switch (&optional dedicated fast split proc) + "Send minor-block at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python3-dedicated (&optional fast split switch proc) + "Send minor-block at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-minor-block-python3-dedicated-switch (&optional fast split proc) + "Send minor-block at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'minor-block 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph (&optional shell dedicated fast split switch proc) + "Send paragraph at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-switch (&optional shell dedicated fast split proc) + "Send paragraph at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-no-switch (&optional shell dedicated fast split proc) + "Send paragraph at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-dedicated (&optional shell fast split switch proc) + "Send paragraph at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph shell t switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-dedicated-switch (&optional shell fast split proc) + "Send paragraph at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython (&optional dedicated fast split switch proc) + "Send paragraph at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython-switch (&optional dedicated fast split proc) + "Send paragraph at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython-no-switch (&optional dedicated fast split proc) + "Send paragraph at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython-dedicated (&optional fast split switch proc) + "Send paragraph at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython-dedicated-switch (&optional fast split proc) + "Send paragraph at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython2.7 (&optional dedicated fast split switch proc) + "Send paragraph at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython2.7-switch (&optional dedicated fast split proc) + "Send paragraph at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send paragraph at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython2.7-dedicated (&optional fast split switch proc) + "Send paragraph at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython2.7-dedicated-switch (&optional fast split proc) + "Send paragraph at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython3 (&optional dedicated fast split switch proc) + "Send paragraph at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython3-switch (&optional dedicated fast split proc) + "Send paragraph at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython3-no-switch (&optional dedicated fast split proc) + "Send paragraph at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython3-dedicated (&optional fast split switch proc) + "Send paragraph at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-ipython3-dedicated-switch (&optional fast split proc) + "Send paragraph at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-jython (&optional dedicated fast split switch proc) + "Send paragraph at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-jython-switch (&optional dedicated fast split proc) + "Send paragraph at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-jython-no-switch (&optional dedicated fast split proc) + "Send paragraph at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-jython-dedicated (&optional fast split switch proc) + "Send paragraph at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-jython-dedicated-switch (&optional fast split proc) + "Send paragraph at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python (&optional dedicated fast split switch proc) + "Send paragraph at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python-switch (&optional dedicated fast split proc) + "Send paragraph at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python-no-switch (&optional dedicated fast split proc) + "Send paragraph at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python-dedicated (&optional fast split switch proc) + "Send paragraph at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python-dedicated-switch (&optional fast split proc) + "Send paragraph at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python2 (&optional dedicated fast split switch proc) + "Send paragraph at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python2-switch (&optional dedicated fast split proc) + "Send paragraph at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python2-no-switch (&optional dedicated fast split proc) + "Send paragraph at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python2-dedicated (&optional fast split switch proc) + "Send paragraph at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python2-dedicated-switch (&optional fast split proc) + "Send paragraph at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python3 (&optional dedicated fast split switch proc) + "Send paragraph at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python3-switch (&optional dedicated fast split proc) + "Send paragraph at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python3-no-switch (&optional dedicated fast split proc) + "Send paragraph at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python3-dedicated (&optional fast split switch proc) + "Send paragraph at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-paragraph-python3-dedicated-switch (&optional fast split proc) + "Send paragraph at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'paragraph 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression (&optional shell dedicated fast split switch proc) + "Send partial-expression at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-switch (&optional shell dedicated fast split proc) + "Send partial-expression at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-no-switch (&optional shell dedicated fast split proc) + "Send partial-expression at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-dedicated (&optional shell fast split switch proc) + "Send partial-expression at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression shell t switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-dedicated-switch (&optional shell fast split proc) + "Send partial-expression at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython (&optional dedicated fast split switch proc) + "Send partial-expression at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython-switch (&optional dedicated fast split proc) + "Send partial-expression at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython-no-switch (&optional dedicated fast split proc) + "Send partial-expression at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython-dedicated (&optional fast split switch proc) + "Send partial-expression at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython-dedicated-switch (&optional fast split proc) + "Send partial-expression at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython2.7 (&optional dedicated fast split switch proc) + "Send partial-expression at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython2.7-switch (&optional dedicated fast split proc) + "Send partial-expression at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send partial-expression at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython2.7-dedicated (&optional fast split switch proc) + "Send partial-expression at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython2.7-dedicated-switch (&optional fast split proc) + "Send partial-expression at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython3 (&optional dedicated fast split switch proc) + "Send partial-expression at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython3-switch (&optional dedicated fast split proc) + "Send partial-expression at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython3-no-switch (&optional dedicated fast split proc) + "Send partial-expression at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython3-dedicated (&optional fast split switch proc) + "Send partial-expression at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-ipython3-dedicated-switch (&optional fast split proc) + "Send partial-expression at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-jython (&optional dedicated fast split switch proc) + "Send partial-expression at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-jython-switch (&optional dedicated fast split proc) + "Send partial-expression at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-jython-no-switch (&optional dedicated fast split proc) + "Send partial-expression at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-jython-dedicated (&optional fast split switch proc) + "Send partial-expression at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-jython-dedicated-switch (&optional fast split proc) + "Send partial-expression at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python (&optional dedicated fast split switch proc) + "Send partial-expression at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python-switch (&optional dedicated fast split proc) + "Send partial-expression at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python-no-switch (&optional dedicated fast split proc) + "Send partial-expression at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python-dedicated (&optional fast split switch proc) + "Send partial-expression at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python-dedicated-switch (&optional fast split proc) + "Send partial-expression at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python2 (&optional dedicated fast split switch proc) + "Send partial-expression at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python2-switch (&optional dedicated fast split proc) + "Send partial-expression at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python2-no-switch (&optional dedicated fast split proc) + "Send partial-expression at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python2-dedicated (&optional fast split switch proc) + "Send partial-expression at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python2-dedicated-switch (&optional fast split proc) + "Send partial-expression at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python3 (&optional dedicated fast split switch proc) + "Send partial-expression at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python3-switch (&optional dedicated fast split proc) + "Send partial-expression at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python3-no-switch (&optional dedicated fast split proc) + "Send partial-expression at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python3-dedicated (&optional fast split switch proc) + "Send partial-expression at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-partial-expression-python3-dedicated-switch (&optional fast split proc) + "Send partial-expression at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'partial-expression 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-region (beg end &optional shell dedicated fast split switch proc) + "Send region at point to interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region shell dedicated switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-switch (beg end &optional shell dedicated fast split proc) + "Send region at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region shell dedicated 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-no-switch (beg end &optional shell dedicated fast split proc) + "Send region at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region shell dedicated 'no-switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-dedicated (beg end &optional shell fast split switch proc) + "Send region at point to unique interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region shell t switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-dedicated-switch (beg end &optional shell fast split proc) + "Send region at point to unique interpreter and switch to result." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region shell t 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython (beg end &optional dedicated fast split switch proc) + "Send region at point to IPython interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython dedicated switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython-switch (beg end &optional dedicated fast split proc) + "Send region at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython dedicated 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython-no-switch (beg end &optional dedicated fast split proc) + "Send region at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython dedicated 'no-switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython-dedicated (beg end &optional fast split switch proc) + "Send region at point to IPython unique interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython t switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython-dedicated-switch (beg end &optional fast split proc) + "Send region at point to IPython unique interpreter and switch to result." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython t 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython2.7 (beg end &optional dedicated fast split switch proc) + "Send region at point to IPython interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython2.7 dedicated switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython2.7-switch (beg end &optional dedicated fast split proc) + "Send region at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython2.7 dedicated 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython2.7-no-switch (beg end &optional dedicated fast split proc) + "Send region at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython2.7 dedicated 'no-switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython2.7-dedicated (beg end &optional fast split switch proc) + "Send region at point to IPython unique interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython2.7 t switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython2.7-dedicated-switch (beg end &optional fast split proc) + "Send region at point to IPython unique interpreter and switch to result." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython2.7 t 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython3 (beg end &optional dedicated fast split switch proc) + "Send region at point to IPython interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython3 dedicated switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython3-switch (beg end &optional dedicated fast split proc) + "Send region at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython3 dedicated 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython3-no-switch (beg end &optional dedicated fast split proc) + "Send region at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython3 dedicated 'no-switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython3-dedicated (beg end &optional fast split switch proc) + "Send region at point to IPython unique interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython3 t switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-ipython3-dedicated-switch (beg end &optional fast split proc) + "Send region at point to IPython unique interpreter and switch to result." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'ipython3 t 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-jython (beg end &optional dedicated fast split switch proc) + "Send region at point to Jython interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'jython dedicated switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-jython-switch (beg end &optional dedicated fast split proc) + "Send region at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'jython dedicated 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-jython-no-switch (beg end &optional dedicated fast split proc) + "Send region at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'jython dedicated 'no-switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-jython-dedicated (beg end &optional fast split switch proc) + "Send region at point to Jython unique interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'jython t switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-jython-dedicated-switch (beg end &optional fast split proc) + "Send region at point to Jython unique interpreter and switch to result." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'jython t 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python (beg end &optional dedicated fast split switch proc) + "Send region at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python dedicated switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python-switch (beg end &optional dedicated fast split proc) + "Send region at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python dedicated 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python-no-switch (beg end &optional dedicated fast split proc) + "Send region at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python dedicated 'no-switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python-dedicated (beg end &optional fast split switch proc) + "Send region at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python t switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python-dedicated-switch (beg end &optional fast split proc) + "Send region at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python t 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python2 (beg end &optional dedicated fast split switch proc) + "Send region at point to Python2 interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python2 dedicated switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python2-switch (beg end &optional dedicated fast split proc) + "Send region at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python2 dedicated 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python2-no-switch (beg end &optional dedicated fast split proc) + "Send region at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python2 dedicated 'no-switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python2-dedicated (beg end &optional fast split switch proc) + "Send region at point to Python2 unique interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python2 t switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python2-dedicated-switch (beg end &optional fast split proc) + "Send region at point to Python2 unique interpreter and switch to result." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python2 t 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python3 (beg end &optional dedicated fast split switch proc) + "Send region at point to Python3 interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python3 dedicated switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python3-switch (beg end &optional dedicated fast split proc) + "Send region at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python3 dedicated 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python3-no-switch (beg end &optional dedicated fast split proc) + "Send region at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python3 dedicated 'no-switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python3-dedicated (beg end &optional fast split switch proc) + "Send region at point to Python3 unique interpreter." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python3 t switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-region-python3-dedicated-switch (beg end &optional fast split proc) + "Send region at point to Python3 unique interpreter and switch to result." + (interactive "r") + (let (wholebuf) + (py--execute-prepare 'region 'python3 t 'switch (or beg (region-beginning)) (or end (region-end)) nil fast proc wholebuf split))) + +(defun py-execute-statement (&optional shell dedicated fast split switch proc) + "Send statement at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-statement-switch (&optional shell dedicated fast split proc) + "Send statement at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-no-switch (&optional shell dedicated fast split proc) + "Send statement at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-statement-dedicated (&optional shell fast split switch proc) + "Send statement at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement shell t switch nil fast proc wholebuf split))) + +(defun py-execute-statement-dedicated-switch (&optional shell fast split proc) + "Send statement at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython (&optional dedicated fast split switch proc) + "Send statement at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython-switch (&optional dedicated fast split proc) + "Send statement at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython-no-switch (&optional dedicated fast split proc) + "Send statement at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython-dedicated (&optional fast split switch proc) + "Send statement at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython-dedicated-switch (&optional fast split proc) + "Send statement at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython2.7 (&optional dedicated fast split switch proc) + "Send statement at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython2.7-switch (&optional dedicated fast split proc) + "Send statement at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send statement at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython2.7-dedicated (&optional fast split switch proc) + "Send statement at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython2.7-dedicated-switch (&optional fast split proc) + "Send statement at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython3 (&optional dedicated fast split switch proc) + "Send statement at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython3-switch (&optional dedicated fast split proc) + "Send statement at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython3-no-switch (&optional dedicated fast split proc) + "Send statement at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython3-dedicated (&optional fast split switch proc) + "Send statement at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-statement-ipython3-dedicated-switch (&optional fast split proc) + "Send statement at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-jython (&optional dedicated fast split switch proc) + "Send statement at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-statement-jython-switch (&optional dedicated fast split proc) + "Send statement at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-jython-no-switch (&optional dedicated fast split proc) + "Send statement at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-statement-jython-dedicated (&optional fast split switch proc) + "Send statement at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-statement-jython-dedicated-switch (&optional fast split proc) + "Send statement at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python (&optional dedicated fast split switch proc) + "Send statement at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python-switch (&optional dedicated fast split proc) + "Send statement at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python-no-switch (&optional dedicated fast split proc) + "Send statement at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python-dedicated (&optional fast split switch proc) + "Send statement at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python-dedicated-switch (&optional fast split proc) + "Send statement at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python2 (&optional dedicated fast split switch proc) + "Send statement at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python2-switch (&optional dedicated fast split proc) + "Send statement at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python2-no-switch (&optional dedicated fast split proc) + "Send statement at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python2-dedicated (&optional fast split switch proc) + "Send statement at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python2-dedicated-switch (&optional fast split proc) + "Send statement at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python3 (&optional dedicated fast split switch proc) + "Send statement at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python3-switch (&optional dedicated fast split proc) + "Send statement at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python3-no-switch (&optional dedicated fast split proc) + "Send statement at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python3-dedicated (&optional fast split switch proc) + "Send statement at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-statement-python3-dedicated-switch (&optional fast split proc) + "Send statement at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'statement 'python3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level (&optional shell dedicated fast split switch proc) + "Send top-level at point to interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level shell dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-switch (&optional shell dedicated fast split proc) + "Send top-level at point to interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level shell dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-no-switch (&optional shell dedicated fast split proc) + "Send top-level at point to interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level shell dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-dedicated (&optional shell fast split switch proc) + "Send top-level at point to unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level shell t switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-dedicated-switch (&optional shell fast split proc) + "Send top-level at point to unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level shell t 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython (&optional dedicated fast split switch proc) + "Send top-level at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython-switch (&optional dedicated fast split proc) + "Send top-level at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython-no-switch (&optional dedicated fast split proc) + "Send top-level at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython-dedicated (&optional fast split switch proc) + "Send top-level at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython t switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython-dedicated-switch (&optional fast split proc) + "Send top-level at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython2.7 (&optional dedicated fast split switch proc) + "Send top-level at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython2.7 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython2.7-switch (&optional dedicated fast split proc) + "Send top-level at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython2.7 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython2.7-no-switch (&optional dedicated fast split proc) + "Send top-level at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython2.7 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython2.7-dedicated (&optional fast split switch proc) + "Send top-level at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython2.7 t switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython2.7-dedicated-switch (&optional fast split proc) + "Send top-level at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython2.7 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython3 (&optional dedicated fast split switch proc) + "Send top-level at point to IPython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython3-switch (&optional dedicated fast split proc) + "Send top-level at point to IPython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython3-no-switch (&optional dedicated fast split proc) + "Send top-level at point to IPython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython3-dedicated (&optional fast split switch proc) + "Send top-level at point to IPython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython3 t switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-ipython3-dedicated-switch (&optional fast split proc) + "Send top-level at point to IPython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'ipython3 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-jython (&optional dedicated fast split switch proc) + "Send top-level at point to Jython interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'jython dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-jython-switch (&optional dedicated fast split proc) + "Send top-level at point to Jython interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'jython dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-jython-no-switch (&optional dedicated fast split proc) + "Send top-level at point to Jython interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'jython dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-jython-dedicated (&optional fast split switch proc) + "Send top-level at point to Jython unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'jython t switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-jython-dedicated-switch (&optional fast split proc) + "Send top-level at point to Jython unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'jython t 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python (&optional dedicated fast split switch proc) + "Send top-level at point to default interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python-switch (&optional dedicated fast split proc) + "Send top-level at point to default interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python-no-switch (&optional dedicated fast split proc) + "Send top-level at point to default interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python-dedicated (&optional fast split switch proc) + "Send top-level at point to default unique interpreter. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python t switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python-dedicated-switch (&optional fast split proc) + "Send top-level at point to default unique interpreter and switch to result. + +For ‘default’ see value of ‘py-shell-name’" + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python t 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python2 (&optional dedicated fast split switch proc) + "Send top-level at point to Python2 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python2 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python2-switch (&optional dedicated fast split proc) + "Send top-level at point to Python2 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python2 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python2-no-switch (&optional dedicated fast split proc) + "Send top-level at point to Python2 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python2 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python2-dedicated (&optional fast split switch proc) + "Send top-level at point to Python2 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python2 t switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python2-dedicated-switch (&optional fast split proc) + "Send top-level at point to Python2 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python2 t 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python3 (&optional dedicated fast split switch proc) + "Send top-level at point to Python3 interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python3 dedicated switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python3-switch (&optional dedicated fast split proc) + "Send top-level at point to Python3 interpreter. + +Switch to output buffer. Ignores ‘py-switch-buffers-on-execute-p’." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python3 dedicated 'switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python3-no-switch (&optional dedicated fast split proc) + "Send top-level at point to Python3 interpreter. + +Keep current buffer. Ignores ‘py-switch-buffers-on-execute-p’ " + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python3 dedicated 'no-switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python3-dedicated (&optional fast split switch proc) + "Send top-level at point to Python3 unique interpreter." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python3 t switch nil fast proc wholebuf split))) + +(defun py-execute-top-level-python3-dedicated-switch (&optional fast split proc) + "Send top-level at point to Python3 unique interpreter and switch to result." + (interactive) + (let (wholebuf) + (py--execute-prepare 'top-level 'python3 t 'switch nil fast proc wholebuf split))) + +;; python-abbrev-propose + +(defun py-edit-abbrevs () + "Jumps to `python-mode-abbrev-table' in a buffer containing lists of abbrev definitions. +You can edit them and type \\\\[edit-abbrevs-redefine] to redefine abbrevs +according to your editing. +Buffer contains a header line for each abbrev table, + which is the abbrev table name in parentheses. +This is followed by one line per abbrev in that table: +NAME USECOUNT EXPANSION HOOK +where NAME and EXPANSION are strings with quotes, +USECOUNT is an integer, and HOOK is any valid function +or may be omitted (it is usually omitted). " + (interactive) + (save-excursion + (let ((mat (abbrev-table-name local-abbrev-table))) + (prepare-abbrev-list-buffer) + (set-buffer "*Abbrevs*") + (switch-to-buffer (current-buffer)) + (goto-char (point-min)) + (search-forward (concat "(" (format "%s" mat)))))) + +(defun py--add-abbrev-propose (table type arg &optional dont-ask) + (save-excursion + (let ((orig (point)) + proposal exp name) + (while (< 0 arg) + (py-beginning-of-partial-expression) + (when (looking-at "[[:alpha:]]") + (setq proposal (concat (downcase (match-string-no-properties 0)) proposal))) + (setq arg (1- arg))) + (setq exp (buffer-substring-no-properties (point) orig)) + (setq name + ;; ask only when interactive + (if dont-ask + proposal + (read-string (format (if exp "%s abbrev for \"%s\": " + "Undefine %s abbrev: ") + type exp) proposal))) + (set-text-properties 0 (length name) nil name) + (when (or (null exp) + (not (abbrev-expansion name table)) + (y-or-n-p (format "%s expands to \"%s\"; redefine? " + name (abbrev-expansion name table)))) + (define-abbrev table (downcase name) exp))))) + +(defun py-add-abbrev (arg) + "Defines python-mode specific abbrev for last expressions before point. +Argument is how many `py-partial-expression's form the expansion; or zero means the region is the expansion. + +Reads the abbreviation in the minibuffer; with numeric arg it displays a proposal for an abbrev. +Proposal is composed from the initial character(s) of the +expansion. + +Don't use this function in a Lisp program; use `define-abbrev' instead." + (interactive "p") + (save-excursion + (py--add-abbrev-propose + (if only-global-abbrevs + global-abbrev-table + (or local-abbrev-table + (error "No per-mode abbrev table"))) + "Mode" arg))) + +;; python-components-paragraph + +(defun py-fill-paren (&optional justify) + "Paren fill function for `py-fill-paragraph'. +JUSTIFY should be used (if applicable) as in `fill-paragraph'." + (interactive "*P") + (save-restriction + (save-excursion + (let ((pps (parse-partial-sexp (point-min) (point)))) + (if (nth 1 pps) + (let* ((beg (copy-marker (nth 1 pps))) + (end (and beg (save-excursion (goto-char (nth 1 pps)) + (forward-list)))) + (paragraph-start "\f\\|[ \t]*$") + (paragraph-separate ",")) + (when end (narrow-to-region beg end) + (fill-region beg end justify) + (while (not (eobp)) + (forward-line 1) + (py-indent-line) + (goto-char (line-end-position)))))))))) + +(defun py-fill-string-django (&optional justify) + "Fill docstring according to Django's coding standards style. + + \"\"\" + Process foo, return bar. + \"\"\" + + \"\"\" + Process foo, return bar. + + If processing fails throw ProcessingError. + \"\"\" + +See available styles at `py-fill-paragraph' or var `py-docstring-style' +" + (interactive "*P") + (py-fill-string justify 'django t)) + +(defun py-fill-string-onetwo (&optional justify) + "One newline and start and Two at end style. + + \"\"\"Process foo, return bar.\"\"\" + + \"\"\" + Process foo, return bar. + + If processing fails throw ProcessingError. + + \"\"\" + +See available styles at `py-fill-paragraph' or var `py-docstring-style' +" + (interactive "*P") + (py-fill-string justify 'onetwo t)) + +(defun py-fill-string-pep-257 (&optional justify) + "PEP-257 with 2 newlines at end of string. + + \"\"\"Process foo, return bar.\"\"\" + + \"\"\"Process foo, return bar. + + If processing fails throw ProcessingError. + + \"\"\" + +See available styles at `py-fill-paragraph' or var `py-docstring-style' +" + (interactive "*P") + (py-fill-string justify 'pep-257 t)) + +(defun py-fill-string-pep-257-nn (&optional justify) + "PEP-257 with 1 newline at end of string. + + \"\"\"Process foo, return bar.\"\"\" + + \"\"\"Process foo, return bar. + + If processing fails throw ProcessingError. + \"\"\" + +See available styles at `py-fill-paragraph' or var `py-docstring-style' +" + (interactive "*P") + (py-fill-string justify 'pep-257-nn t)) + +(defun py-fill-string-symmetric (&optional justify) + "Symmetric style. + + \"\"\"Process foo, return bar.\"\"\" + + \"\"\" + Process foo, return bar. + + If processing fails throw ProcessingError. + \"\"\" + +See available styles at `py-fill-paragraph' or var `py-docstring-style' +" + (interactive "*P") + (py-fill-string justify 'symmetric t)) + + +(defun py-set-nil-docstring-style () + "Set py-docstring-style to 'nil" + (interactive) + (setq py-docstring-style 'nil) + (when (and (called-interactively-p 'any) py-verbose-p) + (message "docstring-style set to: %s" py-docstring-style))) + +(defun py-set-pep-257-nn-docstring-style () + "Set py-docstring-style to 'pep-257-nn" + (interactive) + (setq py-docstring-style 'pep-257-nn) + (when (and (called-interactively-p 'any) py-verbose-p) + (message "docstring-style set to: %s" py-docstring-style))) + +(defun py-set-pep-257-docstring-style () + "Set py-docstring-style to 'pep-257" + (interactive) + (setq py-docstring-style 'pep-257) + (when (and (called-interactively-p 'any) py-verbose-p) + (message "docstring-style set to: %s" py-docstring-style))) + +(defun py-set-django-docstring-style () + "Set py-docstring-style to 'django" + (interactive) + (setq py-docstring-style 'django) + (when (and (called-interactively-p 'any) py-verbose-p) + (message "docstring-style set to: %s" py-docstring-style))) + +(defun py-set-symmetric-docstring-style () + "Set py-docstring-style to 'symmetric" + (interactive) + (setq py-docstring-style 'symmetric) + (when (and (called-interactively-p 'any) py-verbose-p) + (message "docstring-style set to: %s" py-docstring-style))) + +(defun py-set-onetwo-docstring-style () + "Set py-docstring-style to 'onetwo" + (interactive) + (setq py-docstring-style 'onetwo) + (when (and (called-interactively-p 'any) py-verbose-p) + (message "docstring-style set to: %s" py-docstring-style))) + +(defun py-fill-comment (&optional justify) + "Fill the comment paragraph at point" + (interactive "*P") + (let (;; Non-nil if the current line contains a comment. + has-comment + + ;; If has-comment, the appropriate fill-prefix (format "%s" r the comment. + comment-fill-prefix) + + ;; Figure out what kind of comment we are looking at. + (save-excursion + (beginning-of-line) + (cond + ;; A line with nothing but a comment on it? + ((looking-at "[ \t]*#[# \t]*") + (setq has-comment t + comment-fill-prefix (buffer-substring (match-beginning 0) + (match-end 0)))) + + ;; A line with some code, followed by a comment? Remember that the hash + ;; which starts the comment shouldn't be part of a string or character. + ((progn + (while (not (looking-at "#\\|$")) + (skip-chars-forward "^#\n\"'\\") + (cond + ((eq (char-after (point)) ?\\) (forward-char 2)) + ((memq (char-after (point)) '(?\" ?')) (forward-sexp 1)))) + (looking-at "#+[\t ]*")) + (setq has-comment t) + (setq comment-fill-prefix + (concat (make-string (current-column) ? ) + (buffer-substring (match-beginning 0) (match-end 0))))))) + + (if (not has-comment) + (fill-paragraph justify) + + ;; Narrow to include only the comment, and then fill the region. + (save-restriction + (narrow-to-region + + ;; Find the first line we should include in the region to fill. + (save-excursion + (while (and (zerop (forward-line -1)) + (looking-at "^[ \t]*#"))) + + ;; We may have gone to far. Go forward again. + (or (looking-at "^[ \t]*#") + (forward-line 1)) + (point)) + + ;; Find the beginning of the first line past the region to fill. + (save-excursion + (while (progn (forward-line 1) + (looking-at "^[ \t]*#"))) + (point))) + + ;; Lines with only hashes on them can be paragraph boundaries. + (let ((paragraph-start (concat paragraph-start "\\|[ \t#]*$")) + (paragraph-separate (concat paragraph-separate "\\|[ \t#]*$")) + (fill-prefix comment-fill-prefix)) + (fill-paragraph justify)))) + t)) + +(defun py-fill-labelled-string (beg end) + "Fill string or paragraph containing lines starting with label + +See lp:1066489 " + (interactive "r*") + (let ((end (copy-marker end)) + (last (copy-marker (point))) + this-beg) + (save-excursion + (save-restriction + ;; (narrow-to-region beg end) + (goto-char beg) + (skip-chars-forward " \t\r\n\f") + (if (looking-at py-labelled-re) + (progn + (setq this-beg (line-beginning-position)) + (goto-char (match-end 0)) + (while (and (not (eobp)) (re-search-forward py-labelled-re end t 1)(< last (match-beginning 0))(setq last (match-beginning 0))) + (save-match-data (fill-region this-beg (1- (line-beginning-position)))) + (setq this-beg (line-beginning-position)) + (goto-char (match-end 0))))))))) + +(defun py--in-or-behind-or-before-a-docstring () + (interactive "*") + (save-excursion + (let* ((raw-pps (nth 8 (parse-partial-sexp (point-min) (point)))) + ;; ;; maybe just behind a string + (n8 (or raw-pps + ;; maybe in front of a string + (back-to-indentation) + (nth 8 (parse-partial-sexp (point-min) (point))))) + (n8pps (or n8 + (when + (equal (string-to-syntax "|") + (syntax-after (point))) + (and + (< 0 (skip-chars-forward "\"'")) + (nth 8 (parse-partial-sexp (point-min) (point)))))))) + (and n8pps (py--docstring-p n8pps))))) + +(defun py--string-fence-delete-spaces (&optional start) + "Delete spaces following or preceding delimiters of string at point. " + (interactive "*") + (let ((beg (or start (nth 8 (parse-partial-sexp (point-min) (point)))))) + (save-excursion + (goto-char beg) + (skip-chars-forward "\"'rRuU") + (delete-region (point) (progn (skip-chars-forward " \t\r\n\f")(point))) + (goto-char beg) + (forward-char 1) + (skip-syntax-forward "^\|") + (skip-chars-backward "\"'rRuU") + ;; (delete-region (point) (progn (skip-chars-backward " \t\r\n\f")(point))) +))) + +(defun py--skip-raw-string-front-fence () + "Skip forward chars u, U, r, R followed by string-delimiters. " + (when (member (char-after) (list ?u ?U ?r ?R)) + (forward-char 1)) + (skip-chars-forward "\'\"")) + +(defun py--fill-fix-end (thisend orig delimiters-style) + ;; Add the number of newlines indicated by the selected style + ;; at the end. + ;; (widen) + (goto-char thisend) + (skip-chars-backward "\"'\n ") + (delete-region (point) (progn (skip-chars-forward " \t\r\n\f") (point))) + (unless (eq (char-after) ?\n) + (and + (cdr delimiters-style) + (or (newline (cdr delimiters-style)) t))) + (py-indent-line) + (goto-char orig)) + +(defun py--fill-docstring-base (thisbeg thisend style multi-line-p beg end py-current-indent orig) + ;; (widen) + ;; fill-paragraph causes wrong indent, lp:1397936 + ;; (narrow-to-region thisbeg thisend) + (let ((delimiters-style + (case style + ;; delimiters-style is a cons cell with the form + ;; (START-NEWLINES . END-NEWLINES). When any of the sexps + ;; is NIL means to not add any newlines for start or end + ;; of docstring. See `py-docstring-style' for a + ;; graphic idea of each style. + (django (cons 1 1)) + (onetwo (and multi-line-p (cons 1 2))) + (pep-257 (and multi-line-p (cons nil 2))) + (pep-257-nn (and multi-line-p (cons nil 1))) + (symmetric (and multi-line-p (cons 1 1)))))) + ;; (save-excursion + (when style + ;; Add the number of newlines indicated by the selected style + ;; at the start. + (goto-char thisbeg) + (py--skip-raw-string-front-fence) + (skip-chars-forward "\'\"") + (when + (car delimiters-style) + (unless (or (empty-line-p)(eolp)) + (newline (car delimiters-style)))) + (indent-region beg end py-current-indent)) + (when multi-line-p + (goto-char thisbeg) + (py--skip-raw-string-front-fence) + (skip-chars-forward " \t\r\n\f") + (forward-line 1) + (beginning-of-line) + (unless (empty-line-p) (newline))) + (py--fill-fix-end thisend orig delimiters-style))) + +(defun py--fill-docstring-last-line (thisend beg end multi-line-p) + (widen) + ;; (narrow-to-region thisbeg thisend) + (goto-char thisend) + (skip-chars-backward "\"'") + (delete-region (point) (progn (skip-chars-backward " \t\r\n\f")(point))) + ;; (narrow-to-region beg end) + (fill-region beg end) + (setq multi-line-p (string-match "\n" (buffer-substring-no-properties beg end))) + (when multi-line-p + ;; adjust the region to fill according to style + (goto-char end))) + +(defun py--fill-docstring-first-line (beg end thisbeg thisend style) + "Refill first line after newline maybe. " + (let (multi-line-p) + (fill-region beg (line-end-position)) + (forward-line 1) + (fill-region (line-beginning-position) end) + (save-restriction + (widen) + (setq multi-line-p (string-match "\n" (buffer-substring-no-properties thisbeg thisend)))) + (when multi-line-p + ;; adjust the region to fill according to style + (goto-char beg) + (skip-chars-forward "\"'") + ;; style might be nil + (when style + (unless (or (eq style 'pep-257-nn)(eq style 'pep-257)(eq (char-after) ?\n)) + (newline-and-indent) + ;; if TQS is at a single line, re-fill remaining line + (fill-region (point) end)))))) + +(defun py--fill-docstring (justify style docstring orig py-current-indent) + ;; Delete spaces after/before string fence + (py--string-fence-delete-spaces docstring) + (let* ((thisbeg (copy-marker docstring)) + (thisend (copy-marker + (progn + (goto-char thisbeg) + (py--skip-raw-string-front-fence) + (skip-syntax-forward "^\|") + (1+ (point))))) + (parabeg (progn (goto-char orig) (py--beginning-of-paragraph-position))) + (paraend (progn (goto-char orig) (py--end-of-paragraph-position))) + ;; if paragraph is a substring, take it + (beg (copy-marker (if (< thisbeg parabeg) parabeg thisbeg))) + (end (copy-marker (if (< thisend paraend) thisend paraend))) + (multi-line-p (string-match "\n" (buffer-substring-no-properties thisbeg thisend))) + first-line-p) + ;; (narrow-to-region beg end) + (goto-char beg) + (setq first-line-p (member (char-after) (list ?\" ?\' ?u ?U ?r ?R))) + (cond ((string-match (concat "^" py-labelled-re) (buffer-substring-no-properties beg end)) + (py-fill-labelled-string beg end)) + (first-line-p + (py--fill-docstring-first-line beg end thisbeg thisend style)) + ((save-excursion (goto-char end) + (or (member (char-after) (list ?\" ?\')) + (member (char-before) (list ?\" ?\')))) + (py--fill-docstring-last-line thisend beg end multi-line-p)) + (t ;; (narrow-to-region beg end) + (fill-region beg end justify))) + (py--fill-docstring-base thisbeg thisend style multi-line-p beg end py-current-indent orig))) + +(defun py-fill-string (&optional justify style docstring) + "String fill function for `py-fill-paragraph'. +JUSTIFY should be used (if applicable) as in `fill-paragraph'. + +Fill according to `py-docstring-style' " + (interactive "*") + (let* ((justify (if current-prefix-arg 'full t)) + (style (or style py-docstring-style)) + (docstring (or docstring (py--in-or-behind-or-before-a-docstring))) + (pps (parse-partial-sexp (point-min) (point))) + (indent (save-excursion (and (nth 3 pps) (goto-char (nth 8 pps)) (current-indentation)))) + ;; fill-paragraph sets orig + (orig (copy-marker (point))) + (docstring (if (and docstring (not (number-or-marker-p docstring))) + (py--in-or-behind-or-before-a-docstring) + docstring))) + (if docstring + (py--fill-docstring justify style docstring orig indent) + (py-fill-paragraph justify)))) + +(defun py-fill-paragraph (&optional justify) + (interactive "*") + (save-excursion + (save-restriction + (window-configuration-to-register py-windows-config-register) + (let* ((pps (parse-partial-sexp (point-min) (point))) + (docstring (unless (not py-docstring-style)(py--in-or-behind-or-before-a-docstring))) + (fill-column py-comment-fill-column)) + (cond ((or (nth 4 pps) + (and (bolp) (looking-at "[ \t]*#[# \t]*"))) + (py-fill-comment)) + (docstring + (setq fill-column py-docstring-fill-column) + (py-fill-string justify py-docstring-style docstring)) + (t + (let* ((beg (save-excursion + (if (looking-at paragraph-start) + (point) + (backward-paragraph) + (when (looking-at paragraph-start) + (point))))) + (end + (when beg + (save-excursion + (forward-paragraph) + (when (looking-at paragraph-separate) + (point)))))) + (and beg end (fill-region beg end)))))) + (jump-to-register py-windows-config-register)))) + +;; python-components-shift-forms + + +(defun py-shift-left (&optional count start end) + "Dedent region according to `py-indent-offset' by COUNT times. + +If no region is active, current line is dedented. +Returns indentation reached. " + (interactive "p") + (let ((erg (py--shift-intern (- count) start end))) + (when (and (called-interactively-p 'any) py-verbose-p) (message "%s" erg)) + erg)) + +(defun py-shift-right (&optional count beg end) + "Indent region according to `py-indent-offset' by COUNT times. + +If no region is active, current line is indented. +Returns indentation reached. " + (interactive "p") + (let ((erg (py--shift-intern count beg end))) + (when (and (called-interactively-p 'any) py-verbose-p) (message "%s" erg)) + erg)) + +(defun py--shift-intern (&optional count start end) + (save-excursion + (let* ((count (or count 1)) + (inhibit-point-motion-hooks t) + deactivate-mark + (beg (cond (start) + ((and py-shift-require-transient-mark-mode-p + (use-region-p)) + (region-beginning)) + ((and (not py-shift-require-transient-mark-mode-p)(mark) (not (eq (mark) (point)))) + (save-excursion + (goto-char + (region-beginning)))) + (t (line-beginning-position)))) + (end (cond (end) + ((and py-shift-require-transient-mark-mode-p + (use-region-p)) + (region-end)) + ((and (not py-shift-require-transient-mark-mode-p)(mark) (not (eq (mark) (point)))) + (save-excursion + (goto-char + (region-end)))) + (t (line-end-position))))) + (setq beg (copy-marker beg)) + (setq end (copy-marker end)) + (if (< 0 count) + (indent-rigidly beg end py-indent-offset) + (indent-rigidly beg end (- py-indent-offset))) + (push-mark beg t) + (goto-char end) + (skip-chars-backward " \t\r\n\f")) + (py-indentation-of-statement))) + +(defun py--shift-forms-base (form arg &optional beg end) + (let* ((begform (concat "py-backward-" form)) + (endform (concat "py-forward-" form)) + (orig (copy-marker (point))) + (beg (cond (beg) + ;; ((and (string-match "region" form) (mark) (not (eq (mark) (point)))(region-beginning))) + ((use-region-p) + (save-excursion + (goto-char (region-beginning)) + (line-beginning-position))) + (t (save-excursion + (if + (ignore-errors (funcall (car (read-from-string begform)))) + (line-beginning-position) + (error "py--shift-forms-base: No active region")))))) + (end (cond (end) + ( + ;; (and (mark) (not (eq (mark) (point)))) + (use-region-p) + (region-end)) + (t (funcall (car (read-from-string endform)))))) + (erg (py--shift-intern arg beg end))) + (goto-char orig) + erg)) + +(defun py-shift-block-right (&optional arg) + "Indent block by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "block" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-block-left (&optional arg) + "Dedent block by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "block" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-block-or-clause-right (&optional arg) + "Indent block-or-clause by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "block-or-clause" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-block-or-clause-left (&optional arg) + "Dedent block-or-clause by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "block-or-clause" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-class-right (&optional arg) + "Indent class by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "class" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-class-left (&optional arg) + "Dedent class by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "class" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-clause-right (&optional arg) + "Indent clause by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "clause" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-clause-left (&optional arg) + "Dedent clause by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "clause" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-comment-right (&optional arg) + "Indent comment by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "comment" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-comment-left (&optional arg) + "Dedent comment by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "comment" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-def-right (&optional arg) + "Indent def by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "def" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-def-left (&optional arg) + "Dedent def by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "def" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-def-or-class-right (&optional arg) + "Indent def-or-class by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "def-or-class" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-def-or-class-left (&optional arg) + "Dedent def-or-class by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "def-or-class" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-indent-right (&optional arg) + "Indent indent by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "indent" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-indent-left (&optional arg) + "Dedent indent by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "indent" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-minor-block-right (&optional arg) + "Indent minor-block by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "minor-block" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-minor-block-left (&optional arg) + "Dedent minor-block by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "minor-block" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-paragraph-right (&optional arg) + "Indent paragraph by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "paragraph" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-paragraph-left (&optional arg) + "Dedent paragraph by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "paragraph" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-region-right (&optional arg) + "Indent region by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "region" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-region-left (&optional arg) + "Dedent region by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "region" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-statement-right (&optional arg) + "Indent statement by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "statement" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-statement-left (&optional arg) + "Dedent statement by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "statement" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-top-level-right (&optional arg) + "Indent top-level by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "top-level" (or arg py-indent-offset)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-shift-top-level-left (&optional arg) + "Dedent top-level by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use \[universal-argument] to specify a different value. + +Returns outmost indentation reached. " + (interactive "*P") + (let ((erg (py--shift-forms-base "top-level" (- (or arg py-indent-offset))))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +;; python-components-execute-file + +;; Execute file commands + +(defun py-execute-file-python (&optional filename) + "Send file to Python default interpreter." + (interactive "fFile: ") + (py--execute-prepare filename "python" nil nil nil nil t)) + +(defun py-execute-file-python-switch (&optional filename) + "Send file to Python default interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python" nil 'switch nil nil t)) + +(defun py-execute-file-python-no-switch (&optional filename) + "Send file to Python default interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python" nil 'no-switch nil nil t)) + +(defun py-execute-file-python-dedicated (&optional filename) + "Send file to Python default interpreter. + +Uses a dedicated shell." + (interactive "fFile: ") + (py--execute-prepare filename "python" 'dedicated nil nil nil t)) + +(defun py-execute-file-python-dedicated-switch (&optional filename) + "Send file to Python default interpreter. + +Uses a dedicated shell. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python" 'dedicated 'switch nil nil t)) + +(defun py-execute-file-ipython (&optional filename) + "Send file to a Ipython interpreter." + (interactive "fFile: ") + (py--execute-prepare filename "ipython" nil nil nil nil t)) + +(defun py-execute-file-ipython-switch (&optional filename) + "Send file to a Ipython interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "ipython" nil 'switch nil nil t)) + +(defun py-execute-file-ipython-no-switch (&optional filename) + "Send file to a Ipython interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "ipython" nil 'no-switch nil nil t)) + +(defun py-execute-file-ipython-dedicated (&optional filename) + "Send file to a Ipython interpreter. + +Uses a dedicated shell." + (interactive "fFile: ") + (py--execute-prepare filename "ipython" 'dedicated nil nil nil t)) + +(defun py-execute-file-ipython-dedicated-switch (&optional filename) + "Send file to a Ipython interpreter. + +Uses a dedicated shell. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "ipython" 'dedicated 'switch nil nil t)) + +(defun py-execute-file-python3 (&optional filename) + "Send file to a Python3 interpreter." + (interactive "fFile: ") + (py--execute-prepare filename "python3" nil nil nil nil t)) + +(defun py-execute-file-python3-switch (&optional filename) + "Send file to a Python3 interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python3" nil 'switch nil nil t)) + +(defun py-execute-file-python3-no-switch (&optional filename) + "Send file to a Python3 interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python3" nil 'no-switch nil nil t)) + +(defun py-execute-file-python3-dedicated (&optional filename) + "Send file to a Python3 interpreter. + +Uses a dedicated shell." + (interactive "fFile: ") + (py--execute-prepare filename "python3" 'dedicated nil nil nil t)) + +(defun py-execute-file-python3-dedicated-switch (&optional filename) + "Send file to a Python3 interpreter. + +Uses a dedicated shell. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python3" 'dedicated 'switch nil nil t)) + +(defun py-execute-file-python2 (&optional filename) + "Send file to a Python2 interpreter." + (interactive "fFile: ") + (py--execute-prepare filename "python2" nil nil nil nil t)) + +(defun py-execute-file-python2-switch (&optional filename) + "Send file to a Python2 interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python2" nil 'switch nil nil t)) + +(defun py-execute-file-python2-no-switch (&optional filename) + "Send file to a Python2 interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python2" nil 'no-switch nil nil t)) + +(defun py-execute-file-python2-dedicated (&optional filename) + "Send file to a Python2 interpreter. + +Uses a dedicated shell." + (interactive "fFile: ") + (py--execute-prepare filename "python2" 'dedicated nil nil nil t)) + +(defun py-execute-file-python2-dedicated-switch (&optional filename) + "Send file to a Python2 interpreter. + +Uses a dedicated shell. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python2" 'dedicated 'switch nil nil t)) + +(defun py-execute-file-python2.7 (&optional filename) + "Send file to a Python2.7 interpreter." + (interactive "fFile: ") + (py--execute-prepare filename "python2.7" nil nil nil nil t)) + +(defun py-execute-file-python2.7-switch (&optional filename) + "Send file to a Python2.7 interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python2.7" nil 'switch nil nil t)) + +(defun py-execute-file-python2.7-no-switch (&optional filename) + "Send file to a Python2.7 interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python2.7" nil 'no-switch nil nil t)) + +(defun py-execute-file-python2.7-dedicated (&optional filename) + "Send file to a Python2.7 interpreter. + +Uses a dedicated shell." + (interactive "fFile: ") + (py--execute-prepare filename "python2.7" 'dedicated nil nil nil t)) + +(defun py-execute-file-python2.7-dedicated-switch (&optional filename) + "Send file to a Python2.7 interpreter. + +Uses a dedicated shell. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python2.7" 'dedicated 'switch nil nil t)) + +(defun py-execute-file-jython (&optional filename) + "Send file to a Jython interpreter." + (interactive "fFile: ") + (py--execute-prepare filename "jython" nil nil nil nil t)) + +(defun py-execute-file-jython-switch (&optional filename) + "Send file to a Jython interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "jython" nil 'switch nil nil t)) + +(defun py-execute-file-jython-no-switch (&optional filename) + "Send file to a Jython interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "jython" nil 'no-switch nil nil t)) + +(defun py-execute-file-jython-dedicated (&optional filename) + "Send file to a Jython interpreter. + +Uses a dedicated shell." + (interactive "fFile: ") + (py--execute-prepare filename "jython" 'dedicated nil nil nil t)) + +(defun py-execute-file-jython-dedicated-switch (&optional filename) + "Send file to a Jython interpreter. + +Uses a dedicated shell. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "jython" 'dedicated 'switch nil nil t)) + +(defun py-execute-file-python3.2 (&optional filename) + "Send file to a Python3.2 interpreter." + (interactive "fFile: ") + (py--execute-prepare filename "python3.2" nil nil nil nil t)) + +(defun py-execute-file-python3.2-switch (&optional filename) + "Send file to a Python3.2 interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python3.2" nil 'switch nil nil t)) + +(defun py-execute-file-python3.2-no-switch (&optional filename) + "Send file to a Python3.2 interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python3.2" nil 'no-switch nil nil t)) + +(defun py-execute-file-python3.2-dedicated (&optional filename) + "Send file to a Python3.2 interpreter. + +Uses a dedicated shell." + (interactive "fFile: ") + (py--execute-prepare filename "python3.2" 'dedicated nil nil nil t)) + +(defun py-execute-file-python3.2-dedicated-switch (&optional filename) + "Send file to a Python3.2 interpreter. + +Uses a dedicated shell. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python3.2" 'dedicated 'switch nil nil t)) + +(defun py-execute-file-python3.3 (&optional filename) + "Send file to a Python3.3 interpreter." + (interactive "fFile: ") + (py--execute-prepare filename "python3.3" nil nil nil nil t)) + +(defun py-execute-file-python3.3-switch (&optional filename) + "Send file to a Python3.3 interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python3.3" nil 'switch nil nil t)) + +(defun py-execute-file-python3.3-no-switch (&optional filename) + "Send file to a Python3.3 interpreter. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python3.3" nil 'no-switch nil nil t)) + +(defun py-execute-file-python3.3-dedicated (&optional filename) + "Send file to a Python3.3 interpreter. + +Uses a dedicated shell." + (interactive "fFile: ") + (py--execute-prepare filename "python3.3" 'dedicated nil nil nil t)) + +(defun py-execute-file-python3.3-dedicated-switch (&optional filename) + "Send file to a Python3.3 interpreter. + +Uses a dedicated shell. +Ignores default of `py-switch-buffers-on-execute-p', uses it with value \"non-nil\"" + (interactive "fFile: ") + (py--execute-prepare filename "python3.3" 'dedicated 'switch nil nil t)) + +;; python-components-section-forms + +(defun py-execute-section () + "Execute section at point." + (interactive) + (py-execute-section-prepare)) + +(defun py-execute-section-python () + "Execute section at point using python interpreter." + (interactive) + (py-execute-section-prepare "python")) + +(defun py-execute-section-python2 () + "Execute section at point using python2 interpreter." + (interactive) + (py-execute-section-prepare "python2")) + +(defun py-execute-section-python3 () + "Execute section at point using python3 interpreter." + (interactive) + (py-execute-section-prepare "python3")) + +(defun py-execute-section-ipython () + "Execute section at point using ipython interpreter." + (interactive) + (py-execute-section-prepare "ipython")) + +(defun py-execute-section-ipython2.7 () + "Execute section at point using ipython2.7 interpreter." + (interactive) + (py-execute-section-prepare "ipython2.7")) + +(defun py-execute-section-ipython3 () + "Execute section at point using ipython3 interpreter." + (interactive) + (py-execute-section-prepare "ipython3")) + +(defun py-execute-section-jython () + "Execute section at point using jython interpreter." + (interactive) + (py-execute-section-prepare "jython")) + +;; python-components-comment + + +(defun py-comment-region (beg end &optional arg) + "Like ‘comment-region’ but uses double hash (‘#’) comment starter." + (interactive "r\nP") + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start))) + (comment-region beg end arg))) + +(defun py-comment-block (&optional beg end arg) + "Comments block at point. + +Uses double hash (‘#’) comment starter when ‘py-block-comment-prefix-p’ is t, +the default" + (interactive "*") + (save-excursion + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start)) + (beg (or beg (py--beginning-of-block-position))) + (end (or end (py--end-of-block-position)))) + (goto-char beg) + (push-mark) + (goto-char end) + (comment-region beg end arg)))) + +(defun py-comment-block-or-clause (&optional beg end arg) + "Comments block-or-clause at point. + +Uses double hash (‘#’) comment starter when ‘py-block-comment-prefix-p’ is t, +the default" + (interactive "*") + (save-excursion + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start)) + (beg (or beg (py--beginning-of-block-or-clause-position))) + (end (or end (py--end-of-block-or-clause-position)))) + (goto-char beg) + (push-mark) + (goto-char end) + (comment-region beg end arg)))) + +(defun py-comment-class (&optional beg end arg) + "Comments class at point. + +Uses double hash (‘#’) comment starter when ‘py-block-comment-prefix-p’ is t, +the default" + (interactive "*") + (save-excursion + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start)) + (beg (or beg (py--beginning-of-class-position))) + (end (or end (py--end-of-class-position)))) + (goto-char beg) + (push-mark) + (goto-char end) + (comment-region beg end arg)))) + +(defun py-comment-clause (&optional beg end arg) + "Comments clause at point. + +Uses double hash (‘#’) comment starter when ‘py-block-comment-prefix-p’ is t, +the default" + (interactive "*") + (save-excursion + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start)) + (beg (or beg (py--beginning-of-clause-position))) + (end (or end (py--end-of-clause-position)))) + (goto-char beg) + (push-mark) + (goto-char end) + (comment-region beg end arg)))) + +(defun py-comment-def (&optional beg end arg) + "Comments def at point. + +Uses double hash (‘#’) comment starter when ‘py-block-comment-prefix-p’ is t, +the default" + (interactive "*") + (save-excursion + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start)) + (beg (or beg (py--beginning-of-def-position))) + (end (or end (py--end-of-def-position)))) + (goto-char beg) + (push-mark) + (goto-char end) + (comment-region beg end arg)))) + +(defun py-comment-def-or-class (&optional beg end arg) + "Comments def-or-class at point. + +Uses double hash (‘#’) comment starter when ‘py-block-comment-prefix-p’ is t, +the default" + (interactive "*") + (save-excursion + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start)) + (beg (or beg (py--beginning-of-def-or-class-position))) + (end (or end (py--end-of-def-or-class-position)))) + (goto-char beg) + (push-mark) + (goto-char end) + (comment-region beg end arg)))) + +(defun py-comment-indent (&optional beg end arg) + "Comments indent at point. + +Uses double hash (‘#’) comment starter when ‘py-block-comment-prefix-p’ is t, +the default" + (interactive "*") + (save-excursion + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start)) + (beg (or beg (py--beginning-of-indent-position))) + (end (or end (py--end-of-indent-position)))) + (goto-char beg) + (push-mark) + (goto-char end) + (comment-region beg end arg)))) + +(defun py-comment-minor-block (&optional beg end arg) + "Comments minor-block at point. + +Uses double hash (‘#’) comment starter when ‘py-block-comment-prefix-p’ is t, +the default" + (interactive "*") + (save-excursion + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start)) + (beg (or beg (py--beginning-of-minor-block-position))) + (end (or end (py--end-of-minor-block-position)))) + (goto-char beg) + (push-mark) + (goto-char end) + (comment-region beg end arg)))) + +(defun py-comment-section (&optional beg end arg) + "Comments section at point. + +Uses double hash (‘#’) comment starter when ‘py-block-comment-prefix-p’ is t, +the default" + (interactive "*") + (save-excursion + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start)) + (beg (or beg (py--beginning-of-section-position))) + (end (or end (py--end-of-section-position)))) + (goto-char beg) + (push-mark) + (goto-char end) + (comment-region beg end arg)))) + +(defun py-comment-statement (&optional beg end arg) + "Comments statement at point. + +Uses double hash (‘#’) comment starter when ‘py-block-comment-prefix-p’ is t, +the default" + (interactive "*") + (save-excursion + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start)) + (beg (or beg (py--beginning-of-statement-position))) + (end (or end (py--end-of-statement-position)))) + (goto-char beg) + (push-mark) + (goto-char end) + (comment-region beg end arg)))) + +(defun py-comment-top-level (&optional beg end arg) + "Comments top-level at point. + +Uses double hash (‘#’) comment starter when ‘py-block-comment-prefix-p’ is t, +the default" + (interactive "*") + (save-excursion + (let ((comment-start (if py-block-comment-prefix-p + py-block-comment-prefix + comment-start)) + (beg (or beg (py--beginning-of-top-level-position))) + (end (or end (py--end-of-top-level-position)))) + (goto-char beg) + (push-mark) + (goto-char end) + (comment-region beg end arg)))) + + +;; python-components-comment ends here +;; python-components-forms-code + + +(defun py-block () + "Block at point. + +Return code of ‘py-block’ at point, a string." + (interactive) + (let ((erg (py--mark-base "block"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-block-or-clause () + "Block-Or-Clause at point. + +Return code of ‘py-block-or-clause’ at point, a string." + (interactive) + (let ((erg (py--mark-base "block-or-clause"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-buffer () + "Buffer at point. + +Return code of ‘py-buffer’ at point, a string." + (interactive) + (let ((erg (py--mark-base "buffer"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-class () + "Class at point. + +Return code of ‘py-class’ at point, a string." + (interactive) + (let ((erg (py--mark-base "class"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-clause () + "Clause at point. + +Return code of ‘py-clause’ at point, a string." + (interactive) + (let ((erg (py--mark-base "clause"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-def () + "Def at point. + +Return code of ‘py-def’ at point, a string." + (interactive) + (let ((erg (py--mark-base "def"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-def-or-class () + "Def-Or-Class at point. + +Return code of ‘py-def-or-class’ at point, a string." + (interactive) + (let ((erg (py--mark-base "def-or-class"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-expression () + "Expression at point. + +Return code of ‘py-expression’ at point, a string." + (interactive) + (let ((erg (py--mark-base "expression"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-indent () + "Indent at point. + +Return code of ‘py-indent’ at point, a string." + (interactive) + (let ((erg (py--mark-base "indent"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-line () + "Line at point. + +Return code of ‘py-line’ at point, a string." + (interactive) + (let ((erg (py--mark-base "line"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-minor-block () + "Minor-Block at point. + +Return code of ‘py-minor-block’ at point, a string." + (interactive) + (let ((erg (py--mark-base "minor-block"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-paragraph () + "Paragraph at point. + +Return code of ‘py-paragraph’ at point, a string." + (interactive) + (let ((erg (py--mark-base "paragraph"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-partial-expression () + "Partial-Expression at point. + +Return code of ‘py-partial-expression’ at point, a string." + (interactive) + (let ((erg (py--mark-base "partial-expression"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-region () + "Region at point. + +Return code of ‘py-region’ at point, a string." + (interactive) + (let ((erg (py--mark-base "region"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-statement () + "Statement at point. + +Return code of ‘py-statement’ at point, a string." + (interactive) + (let ((erg (py--mark-base "statement"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +(defun py-top-level () + "Top-Level at point. + +Return code of ‘py-top-level’ at point, a string." + (interactive) + (let ((erg (py--mark-base "top-level"))) + (py--forms-report-result erg (called-interactively-p 'any)))) + +;; python-components-forms-code.el ends here +;; python-components-fast-forms + +;; Process forms fast + + + +(defun py--filter-result (strg) + "Set `py-result' according to `py-fast-filter-re'. + +Remove trailing newline" + ;; (replace-regexp-in-string (format "[ \n]*%s[ \n]*" py-fast-filter-re) "" + (ansi-color-filter-apply strg) + ;;) + ) + +(defun py-fast-process (&optional buffer) + "Connect am (I)Python process suitable for large output. + +Output buffer displays \"Fast\" by default +It is not in interactive, i.e. comint-mode, as its bookkeepings seem linked to the freeze reported by lp:1253907" + (interactive) + (let ((this-buffer + (set-buffer (or (and buffer (get-buffer-create buffer)) + (get-buffer-create py-buffer-name))))) + (let ((proc (start-process py-shell-name this-buffer py-shell-name))) + (with-current-buffer this-buffer + (erase-buffer)) + proc))) + +(defun py-fast-send-string-intern (strg proc) + (process-send-string proc strg) + (or (string-match "\n$" strg) + (process-send-string proc "\n"))) + +(defun py-fast-send-string (strg proc output-buffer &optional return) + ;; (process-send-string proc "\n") + (with-current-buffer output-buffer + (let ((orig (point))) + (py-fast-send-string-intern strg proc) + (accept-process-output proc 1) + (when return + (setq py-result (py--filter-result (py--fetch-result orig)))) + py-result))) + +(defalias 'py-process-region-fast 'py-execute-region-fast) +(defun py-execute-region-fast (beg end &optional shell dedicated split switch proc) + (interactive "r") + (let ((py-fast-process-p t)) + (py-execute-region beg end shell dedicated t split switch proc))) + +(defun py-execute-block-fast (&optional shell dedicated switch beg end file) + "Process block at point by a Python interpreter. + +Suitable for large output, doesn't mess up interactive shell. +Output buffer not in comint-mode, displays \"Fast\" by default" + (interactive) + (py--execute-prepare 'block shell dedicated switch beg end file t)) + +(defun py-execute-block-or-clause-fast (&optional shell dedicated switch beg end file) + "Process block-or-clause at point by a Python interpreter. + +Suitable for large output, doesn't mess up interactive shell. +Output buffer not in comint-mode, displays \"Fast\" by default" + (interactive) + (py--execute-prepare 'block-or-clause shell dedicated switch beg end file t)) + +(defun py-execute-class-fast (&optional shell dedicated switch beg end file) + "Process class at point by a Python interpreter. + +Suitable for large output, doesn't mess up interactive shell. +Output buffer not in comint-mode, displays \"Fast\" by default" + (interactive) + (py--execute-prepare 'class shell dedicated switch beg end file t)) + +(defun py-execute-clause-fast (&optional shell dedicated switch beg end file) + "Process clause at point by a Python interpreter. + +Suitable for large output, doesn't mess up interactive shell. +Output buffer not in comint-mode, displays \"Fast\" by default" + (interactive) + (py--execute-prepare 'clause shell dedicated switch beg end file t)) + +(defun py-execute-def-fast (&optional shell dedicated switch beg end file) + "Process def at point by a Python interpreter. + +Suitable for large output, doesn't mess up interactive shell. +Output buffer not in comint-mode, displays \"Fast\" by default" + (interactive) + (py--execute-prepare 'def shell dedicated switch beg end file t)) + +(defun py-execute-def-or-class-fast (&optional shell dedicated switch beg end file) + "Process def-or-class at point by a Python interpreter. + +Suitable for large output, doesn't mess up interactive shell. +Output buffer not in comint-mode, displays \"Fast\" by default" + (interactive) + (py--execute-prepare 'def-or-class shell dedicated switch beg end file t)) + +(defun py-execute-expression-fast (&optional shell dedicated switch beg end file) + "Process expression at point by a Python interpreter. + +Suitable for large output, doesn't mess up interactive shell. +Output buffer not in comint-mode, displays \"Fast\" by default" + (interactive) + (py--execute-prepare 'expression shell dedicated switch beg end file t)) + +(defun py-execute-partial-expression-fast (&optional shell dedicated switch beg end file) + "Process partial-expression at point by a Python interpreter. + +Suitable for large output, doesn't mess up interactive shell. +Output buffer not in comint-mode, displays \"Fast\" by default" + (interactive) + (py--execute-prepare 'partial-expression shell dedicated switch beg end file t)) + +(defun py-execute-section-fast (&optional shell dedicated switch beg end file) + "Process section at point by a Python interpreter. + +Suitable for large output, doesn't mess up interactive shell. +Output buffer not in comint-mode, displays \"Fast\" by default" + (interactive) + (py--execute-prepare 'section shell dedicated switch beg end file t)) + +(defun py-execute-statement-fast (&optional shell dedicated switch beg end file) + "Process statement at point by a Python interpreter. + +Suitable for large output, doesn't mess up interactive shell. +Output buffer not in comint-mode, displays \"Fast\" by default" + (interactive) + (py--execute-prepare 'statement shell dedicated switch beg end file t)) + +(defun py-execute-top-level-fast (&optional shell dedicated switch beg end file) + "Process top-level at point by a Python interpreter. + +Suitable for large output, doesn't mess up interactive shell. +Output buffer not in comint-mode, displays \"Fast\" by default" + (interactive) + (py--execute-prepare 'top-level shell dedicated switch beg end file t)) + +;; python-components-narrow + +(defun py-narrow-to-block () + "Narrow to block at point." + (interactive) + (py--narrow-prepare "block")) + +(defun py-narrow-to-block-or-clause () + "Narrow to block-or-clause at point." + (interactive) + (py--narrow-prepare "block-or-clause")) + +(defun py-narrow-to-class () + "Narrow to class at point." + (interactive) + (py--narrow-prepare "class")) + +(defun py-narrow-to-clause () + "Narrow to clause at point." + (interactive) + (py--narrow-prepare "clause")) + +(defun py-narrow-to-def () + "Narrow to def at point." + (interactive) + (py--narrow-prepare "def")) + +(defun py-narrow-to-def-or-class () + "Narrow to def-or-class at point." + (interactive) + (py--narrow-prepare "def-or-class")) + +(defun py-narrow-to-statement () + "Narrow to statement at point." + (interactive) + (py--narrow-prepare "statement")) + +;; python-components-auto-fill + +(defvar py-auto-fill-mode-orig (auto-fill-mode) + "Store the original state of auto-fill-mode. ") + +;; py-fill-column-orig already defined + +(defun py-comment-auto-fill (&optional arg) + "Toggles comment-auto-fill mode" + (interactive "P") + (if (or (and arg (< 0 (prefix-numeric-value arg))) (and (boundp 'py-comment-auto-fill)(not py-comment-auto-fill))) + (progn + (set (make-local-variable 'py-comment-auto-fill-p) t) + (setq fill-column comment-fill-column) + (auto-fill-mode 1)) + (set (make-local-variable 'py-comment-auto-fill-p) nil) +;; (set (make-local-variable 'py-comment-auto-fill-only-comments) nil) + ;; (setq fill-column fill-column-orig) + (auto-fill-mode -1))) + +(defun py-comment-auto-fill-on () + (interactive) + (py-comment-auto-fill 1)) + +(defun py-comment-auto-fill-off () + (interactive) + (py-comment-auto-fill -1)) + +;; python-components-hide-show + + +;; (setq hs-block-start-regexp 'py-extended-block-or-clause-re) +;; (setq hs-forward-sexp-func 'py-forward-block) + +(defun py-hide-base (form &optional beg end) + "Hide visibility of existing form at point." + (hs-minor-mode 1) + (save-excursion + (let* ((form (prin1-to-string form)) + (beg (or beg (or (funcall (intern-soft (concat "py--beginning-of-" form "-p"))) + (funcall (intern-soft (concat "py-backward-" form)))))) + (end (or end (funcall (intern-soft (concat "py-forward-" form))))) + (modified (buffer-modified-p)) + (inhibit-read-only t)) + (if (and beg end) + (progn + (hs-make-overlay beg end 'code) + (set-buffer-modified-p modified)) + (error (concat "No " (format "%s" form) " at point")))))) + +(defun py-show-base (form &optional beg end) + "Remove invisibility of existing form at point." + (save-excursion + (hs-discard-overlays (line-beginning-position) (point)) + (let* ((form (prin1-to-string form)) + (beg (or beg (or (funcall (intern-soft (concat "py--beginning-of-" form "-p"))) + (funcall (intern-soft (concat "py-backward-" form)))))) + (end (or end (funcall (intern-soft (concat "py-forward-" form))))) + (modified (buffer-modified-p)) + (inhibit-read-only t)) + (if (and beg end) + (progn + (hs-discard-overlays beg end) + (set-buffer-modified-p modified)) + (error (concat "No " (format "%s" form) " at point")))))) + +(defun py-hide-show (&optional form beg end) + "Toggle visibility of existing forms at point." + (interactive) + (save-excursion + (let* ((form (prin1-to-string form)) + (beg (or beg (or (funcall (intern-soft (concat "py--beginning-of-" form "-p"))) + (funcall (intern-soft (concat "py-backward-" form)))))) + (end (or end (funcall (intern-soft (concat "py-forward-" form))))) + (modified (buffer-modified-p)) + (inhibit-read-only t)) + (if (and beg end) + (if (overlays-in beg end) + (hs-discard-overlays beg end) + (hs-make-overlay beg end 'code)) + (error (concat "No " (format "%s" form) " at point"))) + (set-buffer-modified-p modified)))) + +(defun py-hide-region (beg end) + "Hide active region." + (interactive + (list + (and (use-region-p) (region-beginning))(and (use-region-p) (region-end)))) + (py-hide-base 'region beg end)) + +(defun py-show-region (beg end) + "Un-hide active region." + (interactive + (list + (and (use-region-p) (region-beginning))(and (use-region-p) (region-end)))) + (py-show-base 'region beg end)) + +(defun py-hide-block () + "Hide block at point." + (interactive) + (py-hide-base 'block)) + +(defun py-show-block () + "Show block at point." + (interactive) + (py-show-base 'block)) + +(defun py-hide-block-or-clause () + "Hide block-or-clause at point." + (interactive) + (py-hide-base 'block-or-clause)) + +(defun py-show-block-or-clause () + "Show block-or-clause at point." + (interactive) + (py-show-base 'block-or-clause)) + +(defun py-hide-class () + "Hide class at point." + (interactive) + (py-hide-base 'class)) + +(defun py-show-class () + "Show class at point." + (interactive) + (py-show-base 'class)) + +(defun py-hide-clause () + "Hide clause at point." + (interactive) + (py-hide-base 'clause)) + +(defun py-show-clause () + "Show clause at point." + (interactive) + (py-show-base 'clause)) + +(defun py-hide-comment () + "Hide comment at point." + (interactive) + (py-hide-base 'comment)) + +(defun py-show-comment () + "Show comment at point." + (interactive) + (py-show-base 'comment)) + +(defun py-hide-def () + "Hide def at point." + (interactive) + (py-hide-base 'def)) + +(defun py-show-def () + "Show def at point." + (interactive) + (py-show-base 'def)) + +(defun py-hide-def-or-class () + "Hide def-or-class at point." + (interactive) + (py-hide-base 'def-or-class)) + +(defun py-show-def-or-class () + "Show def-or-class at point." + (interactive) + (py-show-base 'def-or-class)) + +(defun py-hide-elif-block () + "Hide elif-block at point." + (interactive) + (py-hide-base 'elif-block)) + +(defun py-show-elif-block () + "Show elif-block at point." + (interactive) + (py-show-base 'elif-block)) + +(defun py-hide-else-block () + "Hide else-block at point." + (interactive) + (py-hide-base 'else-block)) + +(defun py-show-else-block () + "Show else-block at point." + (interactive) + (py-show-base 'else-block)) + +(defun py-hide-except-block () + "Hide except-block at point." + (interactive) + (py-hide-base 'except-block)) + +(defun py-show-except-block () + "Show except-block at point." + (interactive) + (py-show-base 'except-block)) + +(defun py-hide-expression () + "Hide expression at point." + (interactive) + (py-hide-base 'expression)) + +(defun py-show-expression () + "Show expression at point." + (interactive) + (py-show-base 'expression)) + +(defun py-hide-for-block () + "Hide for-block at point." + (interactive) + (py-hide-base 'for-block)) + +(defun py-show-for-block () + "Show for-block at point." + (interactive) + (py-show-base 'for-block)) + +(defun py-hide-if-block () + "Hide if-block at point." + (interactive) + (py-hide-base 'if-block)) + +(defun py-show-if-block () + "Show if-block at point." + (interactive) + (py-show-base 'if-block)) + +(defun py-hide-indent () + "Hide indent at point." + (interactive) + (py-hide-base 'indent)) + +(defun py-show-indent () + "Show indent at point." + (interactive) + (py-show-base 'indent)) + +(defun py-hide-line () + "Hide line at point." + (interactive) + (py-hide-base 'line)) + +(defun py-show-line () + "Show line at point." + (interactive) + (py-show-base 'line)) + +(defun py-hide-minor-block () + "Hide minor-block at point." + (interactive) + (py-hide-base 'minor-block)) + +(defun py-show-minor-block () + "Show minor-block at point." + (interactive) + (py-show-base 'minor-block)) + +(defun py-hide-paragraph () + "Hide paragraph at point." + (interactive) + (py-hide-base 'paragraph)) + +(defun py-show-paragraph () + "Show paragraph at point." + (interactive) + (py-show-base 'paragraph)) + +(defun py-hide-partial-expression () + "Hide partial-expression at point." + (interactive) + (py-hide-base 'partial-expression)) + +(defun py-show-partial-expression () + "Show partial-expression at point." + (interactive) + (py-show-base 'partial-expression)) + +(defun py-hide-section () + "Hide section at point." + (interactive) + (py-hide-base 'section)) + +(defun py-show-section () + "Show section at point." + (interactive) + (py-show-base 'section)) + +(defun py-hide-statement () + "Hide statement at point." + (interactive) + (py-hide-base 'statement)) + +(defun py-show-statement () + "Show statement at point." + (interactive) + (py-show-base 'statement)) + +(defun py-hide-top-level () + "Hide top-level at point." + (interactive) + (py-hide-base 'top-level)) + +(defun py-show-top-level () + "Show top-level at point." + (interactive) + (py-show-base 'top-level)) + +;; python-components-hide-show.el ends here +;; python-components-fast-complete + +(defun py--fast-completion-get-completions (input process completion-code buffer) + "Retrieve available completions for INPUT using PROCESS. +Argument COMPLETION-CODE is the python code used to get +completions on the current context." + (with-current-buffer buffer + (erase-buffer) + (let ((completions + (py-fast-send-string + (format completion-code input) process buffer t))) + (when (> (length completions) 2) + (split-string completions "^'\\|^\"\\|;\\|'$\\|\"$" t))))) + +(defun py--fast--do-completion-at-point (process imports input code output-buffer) + "Do completion at point for PROCESS." + ;; send setup-code + (let (py-store-result-p) + (when imports + ;; (message "%s" imports) + (py-fast-send-string-intern imports process))) + (let* ((completion + (py--fast-completion-get-completions input process code output-buffer))) + (sit-for 0.1) + (cond ((eq completion t) + (and py-verbose-p (message "py--fast--do-completion-at-point %s" "`t' is returned, not completion. Might be a bug."))) + ((null completion) + (and py-verbose-p (message "py--fast--do-completion-at-point %s" "Don't see a completion")) + (set-window-configuration py-last-window-configuration)) + ((and completion + (or (and (listp completion) + (string= input (car completion))) + (and (stringp completion) + (string= input completion)))) + (set-window-configuration py-last-window-configuration)) + ((and completion (stringp completion)(not (string= input completion))) + (progn (delete-char (- (length input))) + (insert completion) + ;; (move-marker orig (point)) + ;; minibuffer.el expects a list +)) + (t (py--try-completion input completion))))) + +(defun py--fast-complete-base (shell word imports) + (let* ((shell (or shell "python")) + (buffer (get-buffer-create "*Python Fast*")) + (proc (or (get-buffer-process buffer) (py--start-fast-process shell buffer))) + (code (if (string-match "[Ii][Pp]ython*" shell) + (py-set-ipython-completion-command-string shell) + py-shell-module-completion-code))) + ;; (with-current-buffer buffer + ;; (erase-buffer)) + (py--python-send-completion-setup-code buffer) + (py--fast--do-completion-at-point proc imports word code buffer))) + +(defun py-fast-complete (&optional shell beg end word) + "Complete word before point, if any. + +Use `py-fast-process' " + (interactive) + (setq py-last-window-configuration + (current-window-configuration)) + (py--complete-prepare shell beg end word t)) + +;; python-components-intern + +;; Keymap + +;; (defun py--indent-prepare (inter-re) +;; (progn (back-to-indentation) +;; (or (py--beginning-of-statement-p) +;; (ar-backward-statement)) +;; (cond ((eq 0 (current-indentation)) +;; (current-indentation)) +;; ((looking-at (symbol-value inter-re)) +;; (current-indentation)) +;; (t +;; (if (<= py-indent-offset (current-indentation)) +;; (- (current-indentation) (if ar-smart-indentation (ar-guess-indent-offset) py-indent-offset)) +;; py-indent-offset))))) + +(defun py-separator-char () + "Return the file-path separator char from current machine. + +When `py-separator-char' is customized, its taken. +Returns char found. " + (let ((erg (cond ((characterp py-separator-char) + (char-to-string py-separator-char)) + ;; epd hack + ((and + (string-match "[Ii][Pp]ython" py-shell-name) + (string-match "epd\\|EPD" py-shell-name)) + (replace-regexp-in-string "\n" "" + (shell-command-to-string (concat py-shell-name " -c \"import os; print(os.sep)\""))))))) + (if (and erg (string-match "^$" erg)) + (setq erg (substring erg (string-match "^$" erg))) + (setq erg (replace-regexp-in-string "\n" "" (shell-command-to-string (concat py-shell-name " -W ignore" " -c \"import os; print(os.sep)\""))))) + erg)) + +(defun pps-emacs-version () + "Include the appropriate `parse-partial-sexp' " + (if (featurep 'xemacs) + '(parse-partial-sexp (point-min) (point)) + '(parse-partial-sexp (point-min) (point)))) + +(defun py-in-comment-p () + "Return the beginning of current line's comment, if inside. " + (interactive) + (let* ((pps (parse-partial-sexp (point-min) (point))) + (erg (and (nth 4 pps) (nth 8 pps)))) + erg)) +;; +(defun py-in-string-or-comment-p () + "Returns beginning position if inside a string or comment, nil otherwise. " + (or (nth 8 (parse-partial-sexp (point-min) (point))) + (when (or (looking-at "\"")(looking-at "[ \t]*#[ \t]*")) + (point)))) + +(when py-org-cycle-p + (define-key python-mode-map (kbd "") 'org-cycle)) + +(defun py--buffer-filename-remote-maybe (&optional file-name) + (let ((file-name (or file-name + (and + (ignore-errors (file-readable-p (buffer-file-name))) + (buffer-file-name))))) + (if (and (featurep 'tramp) (tramp-tramp-file-p file-name)) + (tramp-file-name-localname + (tramp-dissect-file-name file-name)) + file-name))) + +(defun py-forward-buffer () + "A complementary form used by auto-generated commands. + +Returns position reached if successful" + (interactive) + (unless (eobp) + (goto-char (point-max)))) + +(defun py-backward-buffer () + "A complementary form used by auto-generated commands. + +Returns position reached if successful" + (interactive) + (unless (bobp) + (goto-char (point-min)))) + +(defun py--execute-prepare (form &optional shell dedicated switch beg end file fast proc wholebuf split buffer) + "Used by python-components-extended-executes ." + (save-excursion + (let* ((form (prin1-to-string form)) + (origline (py-count-lines)) + (beg (unless file + (prog1 + (or beg (funcall (intern-soft (concat "py--beginning-of-" form "-p"))) + + (funcall (intern-soft (concat "py-backward-" form))) + (push-mark))))) + (end (unless file + (or end (funcall (intern-soft (concat "py-forward-" form)))))) + filename) + ;; (setq py-buffer-name nil) + (if file + (progn + (setq filename (expand-file-name form)) + (if (file-readable-p filename) + (py--execute-file-base nil filename nil nil origline) + (message "%s not readable. %s" file "Do you have write permissions?"))) + (py--execute-base beg end shell filename proc file wholebuf fast dedicated split switch buffer))))) + +(defun py-load-skeletons () + "Load skeletons from extensions. " + (interactive) + (load (concat py-install-directory "/extensions/python-components-skeletons.el"))) + +(defun py--kill-emacs-hook () + "Delete files in `py-file-queue'. +These are Python temporary files awaiting execution." + (mapc #'(lambda (filename) + (ignore-errors (delete-file filename))) + py-file-queue)) + +;; Add a designator to the minor mode strings +(or (assq 'py-pdbtrack-is-tracking-p minor-mode-alist) + (push '(py-pdbtrack-is-tracking-p py-pdbtrack-minor-mode-string) + minor-mode-alist)) + +;; bottle.py +;; py = sys.version_info +;; py3k = py >= (3,0,0) +;; py25 = py < (2,6,0) +;; py31 = (3,1,0) <= py < (3,2,0) + +;; sys.version_info[0] +(defun py-python-version (&optional executable verbose) + "Returns versions number of a Python EXECUTABLE, string. + +If no EXECUTABLE given, `py-shell-name' is used. +Interactively output of `--version' is displayed. " + (interactive) + (let* ((executable (or executable py-shell-name)) + (erg (py--string-strip (shell-command-to-string (concat executable " --version"))))) + (when (called-interactively-p 'any) (message "%s" erg)) + (unless verbose (setq erg (cadr (split-string erg)))) + erg)) + +(defun py-version () + "Echo the current version of `python-mode' in the minibuffer." + (interactive) + (message "Using `python-mode' version %s" py-version) + (py-keep-region-active)) + +;; Utility stuff +(declare-function compilation-shell-minor-mode "compile" (&optional arg)) + +;; dereived from shipped python.el +(defun py-history-input-filter (str) + "`comint-input-filter' function for Python process. +Don't save anything for STR matching `py-history-filter-regexp'." + (not (string-match py-history-filter-regexp str))) + +(defun py-load-file (file-name) + "Load a Python file FILE-NAME into the Python process. + +If the file has extension `.py' import or reload it as a module. +Treating it as a module keeps the global namespace clean, provides +function location information for debugging, and supports users of +module-qualified names." + (interactive "f") + (py--execute-file-base (get-buffer-process (get-buffer (py-shell))) file-name)) + +(defun py-proc (&optional argprompt) + "Return the current Python process. + +Start a new process if necessary. " + (interactive "P") + (let ((erg + (cond ((comint-check-proc (current-buffer)) + (get-buffer-process (buffer-name (current-buffer)))) + (t (py-shell argprompt))))) + ;; (when (called-interactively-p 'any) (message "%S" erg)) + erg)) + +;; Miscellany. +(defun py--shell-simple-send (proc strg) + (let* ((strg (substring-no-properties strg)) + (nln (string-match "\n$" strg))) + ;; (or nln (setq strg (concat strg "\n"))) + ;; (comint-simple-send proc (substring-no-properties strg)) + (process-send-string proc strg) + (or nln (process-send-string proc "\n")))) + +(defalias + 'py-shell-redirect-send-command-to-process + 'comint-redirect-send-command-to-process) +(defalias + 'py-shell-dynamic-simple-complete + 'comint-dynamic-simple-complete) + +;; Hooks +;; arrange to kill temp files when Emacs exists +(add-hook 'kill-emacs-hook 'py--kill-emacs-hook) + +(when py--warn-tmp-files-left-p + (add-hook 'python-mode-hook 'py--warn-tmp-files-left)) + + +(defun py-guess-pdb-path () + "If py-pdb-path isn't set, find location of pdb.py. " + (interactive) + (let ((ele (split-string (shell-command-to-string "whereis python"))) + erg) + (while (or (not erg)(string= "" erg)) + (when (and (string-match "^/" (car ele)) (not (string-match "/man" (car ele)))) + (setq erg (shell-command-to-string (concat "find " (car ele) " -type f -name \"pdb.py\"")))) + (setq ele (cdr ele))) + (if erg + (message "%s" erg) + (message "%s" "pdb.py not found, please customize `py-pdb-path'")) + erg)) + +(if py-mode-output-map + nil + (setq py-mode-output-map (make-sparse-keymap)) + (define-key py-mode-output-map [button2] 'py-mouseto-exception) + (define-key py-mode-output-map "\C-c\C-c" 'py-goto-exception) + ;; TBD: Disable all self-inserting keys. This is bogus, we should + ;; really implement this as *Python Output* buffer being read-only + (mapc #' (lambda (key) + (define-key py-mode-output-map key + #'(lambda () (interactive) (beep)))) + (where-is-internal 'self-insert-command))) + +(defun py-toggle-local-default-use () + (interactive) + "Toggle boolean value of `py-use-local-default'. + +Returns `py-use-local-default' + +See also `py-install-local-shells' +Installing named virualenv shells is the preffered way, +as it leaves your system default unchanged." + (setq py-use-local-default (not py-use-local-default)) + (when (called-interactively-p 'any) (message "py-use-local-default set to %s" py-use-local-default)) + py-use-local-default) + +(defalias 'py-hungry-delete-forward 'c-hungry-delete-forward) +(defalias 'py-hungry-delete-backwards 'c-hungry-delete-backwards) + +;; FixMe: for unknown reasons this is not done by mode +(if (file-readable-p abbrev-file-name) + (add-hook 'python-mode-hook + (lambda () + (setq py-this-abbrevs-changed abbrevs-changed) + (load abbrev-file-name nil t) + (setq abbrevs-changed py-this-abbrevs-changed))) + (message "Warning: %s" "no abbrev-file found, customize `abbrev-file-name' in order to make mode-specific abbrevs work. ")) + +;; ; +(push (list + 'python-mode + ;; start regex + (concat (if py-hide-show-hide-docstrings + "^\\s-*\"\"\"\\|" "") + (mapconcat 'identity + (mapcar #'(lambda (x) (concat "^\\s-*" x "\\_>")) + py-hide-show-keywords) + "\\|")) + ;; end regex + nil + ;; comment-start regex + "#" + ;; forward-sexp function + (lambda () + (py-forward-block-or-clause)) + nil) hs-special-modes-alist) + +;; ; + +(defun py--input-filter (str) + "`comint-input-filter' function for Python. + +Don't save anything for STR matching `py-input-filter-re' " + (not (string-match py-input-filter-re str))) + +(make-obsolete 'jpython-mode 'jython-mode nil) + +(push (purecopy "*Python*") same-window-buffer-names) +(push (purecopy "*IPython*") same-window-buffer-names) + +(push (cons (purecopy "\\.py\\'") 'python-mode) auto-mode-alist) + +;; Python Macro File + +(unless (member '(".pym'" . python-mode) auto-mode-alist) + (push (cons (purecopy "\\.pym\\'") 'python-mode) auto-mode-alist)) + +(unless (member '(".pyc'" . python-mode) auto-mode-alist) + (push (cons (purecopy "\\.pyc\\'") 'python-mode) auto-mode-alist)) + +;; Pyrex Source +(unless (member '(".pyx'" . python-mode) auto-mode-alist) + (push (cons (purecopy "\\.pyx\\'") 'python-mode) auto-mode-alist)) + +;; Python Optimized Code +(unless (member '(".pyo'" . python-mode) auto-mode-alist) + (push (cons (purecopy "\\.pyo\\'") 'python-mode) auto-mode-alist)) + +;; Pyrex Definition File +(unless (member '(".pxd'" . python-mode) auto-mode-alist) + (push (cons (purecopy "\\.pxd\\'") 'python-mode) auto-mode-alist)) + +;; Python Repository +(unless (member '(".pyr'" . python-mode) auto-mode-alist) + (push (cons (purecopy "\\.pyr\\'") 'python-mode) auto-mode-alist)) + +;; Python Stub file +;; https://www.python.org/dev/peps/pep-0484/#stub-files +(unless (member '(".pyi'" . python-mode) auto-mode-alist) + (push (cons (purecopy "\\.pyi\\'") 'python-mode) auto-mode-alist)) + +;; Python Path Configuration +(unless (member '(".pth'" . python-mode) auto-mode-alist) + (push (cons (purecopy "\\.pth\\'") 'python-mode) auto-mode-alist)) + +;; Python Wheels +(unless (member '(".whl'" . python-mode) auto-mode-alist) + (push (cons (purecopy "\\.whl\\'") 'python-mode) auto-mode-alist)) + +(unless (member '("!#[ ]*/.*[jp]ython[0-9.]*" . python-mode) magic-mode-alist) + (push '("!#[ \\t]*/.*[jp]ython[0-9.]*" . python-mode) magic-mode-alist)) + +;; lp:1355458, what about using `magic-mode-alist'? + +(defun py--uncomment-intern (beg end) + (uncomment-region beg end) + (when py-uncomment-indents-p + (py-indent-region beg end))) + +(defun py-uncomment (&optional beg) + "Uncomment commented lines at point. + +If region is active, restrict uncommenting at region " + (interactive "*") + (save-excursion + (save-restriction + (when (use-region-p) + (narrow-to-region (region-beginning) (region-end))) + (let* (last + (beg (or beg (save-excursion + (while (and (py-beginning-of-comment) (setq last (point))(prog1 (forward-line -1)(end-of-line)))) + last)))) + (and (py-forward-comment)) + (py--uncomment-intern beg (point)))))) + +(defun py--set-auto-fill-values () + "Internal use by `py--run-auto-fill-timer'" + (let ((pps (parse-partial-sexp (point-min) (point)))) + (cond ((and (nth 4 pps)(numberp py-comment-fill-column)) + (setq fill-column py-comment-fill-column)) + ((and (nth 3 pps)(numberp py-docstring-fill-column)) + (set (make-local-variable 'fill-column) py-docstring-fill-column)) + (t (setq fill-column py-fill-column-orig))))) + +(defun py--run-auto-fill-timer () + "Set fill-column to values of `py-docstring-fill-column' resp. to `py-comment-fill-column' according to environment. " + (when py-auto-fill-mode + (unless py-autofill-timer + (setq py-autofill-timer + (run-with-idle-timer + py-autofill-timer-delay t + 'py--set-auto-fill-values))))) + +;; unconditional Hooks +;; (orgstruct-mode 1) +(add-hook 'python-mode-hook + (lambda () + (setq imenu-create-index-function py--imenu-create-index-function) + (setq indent-tabs-mode py-indent-tabs-mode))) + +(remove-hook 'python-mode-hook 'python-setup-brm) + +(defun py-complete-auto () + "Auto-complete function using py-complete. " + ;; disable company + ;; (when company-mode (company-mode)) + (let ((modified (buffer-chars-modified-tick))) + ;; don't try completion if buffer wasn't modified + (unless (eq modified py-complete-last-modified) + (if py-auto-completion-mode-p + (if (string= "*PythonCompletions*" (buffer-name (current-buffer))) + (sit-for 0.1 t) + (if + (eq py-auto-completion-buffer (current-buffer)) + ;; not after whitespace, TAB or newline + (unless (member (char-before) (list 32 9 10)) + (py-complete) + (setq py-complete-last-modified (buffer-chars-modified-tick))) + (setq py-auto-completion-mode-p nil + py-auto-completion-buffer nil) + (cancel-timer py--auto-complete-timer))))))) + +(defun py-set-command-args (arguments) + "Set Python arguments on the fly, override defaults in this session. + +Use `defcustom' to keep value across sessions " + (interactive + (list + (read-from-minibuffer "Command args: " py-python-command-args))) + (setq py-python-command-args arguments)) + +(defun py---emacs-version-greater-23 () + "Return `t' if emacs major version is above 23" + (< 23 (string-to-number (car (split-string emacs-version "\\."))))) + +(defun py--empty-arglist-indent (nesting &optional indent-offset) + "Internally used by `py-compute-indentation'" + (if + (and (eq 1 nesting) + (save-excursion + (back-to-indentation) + (looking-at py-extended-block-or-clause-re))) + (progn + (back-to-indentation) + (+ (current-column) (* 2 (or indent-offset py-indent-offset)))) + (+ (current-indentation) (or indent-offset py-indent-offset)))) + +(defun py-symbol-at-point () + "Return the current Python symbol." + (interactive) + (let ((erg (with-syntax-table + py-dotted-expression-syntax-table + (current-word)))) + ;; (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py-kill-buffer-unconditional (buffer) + "Kill buffer unconditional, kill buffer-process if existing. " + (interactive + (list (current-buffer))) + (let ((buffer (or (and (bufferp buffer) buffer) + (get-buffer buffer))) + proc kill-buffer-query-functions) + + (ignore-errors + (setq proc (get-buffer-process buffer)) + (and proc (kill-process proc)) + (set-buffer buffer) + (set-buffer-modified-p 'nil) + (kill-buffer (current-buffer))))) + +(defun py--line-backward-maybe () + "Return result of (< 0 (abs (skip-chars-backward \" \\t\\r\\n\\f\"))) " + (skip-chars-backward " \t\f" (line-beginning-position)) + (< 0 (abs (skip-chars-backward " \t\r\n\f")))) + +(defun py--after-empty-line () + "Return `t' if line before contains only whitespace characters. " + (save-excursion + (beginning-of-line) + (forward-line -1) + (beginning-of-line) + (looking-at "\\s-*$"))) + +(defalias 'py-count-indentation 'py-compute-indentation) +(defun py-compute-indentation (&optional iact orig origline closing line nesting repeat indent-offset liep) + "Compute Python indentation. + +When HONOR-BLOCK-CLOSE-P is non-nil, statements such as `return', +`raise', `break', `continue', and `pass' force one level of dedenting. + +Optional arguments are flags resp. values set and used by `py-compute-indentation' internally: +ORIG keeps original position +ORIGLINE keeps line where compute started +CLOSING is t when started at a char delimiting a list as \"]})\" +LINE indicates being not at origline now +NESTING is currently ignored, if executing from inside a list +REPEAT counter enables checks against `py-max-specpdl-size' +INDENT-OFFSET allows calculation of block-local values +LIEP stores line-end-position at point-of-interest +" + (interactive "p") + (save-excursion + (save-restriction + (widen) + ;; in shell, narrow from previous prompt + ;; needed by closing + (unless orig (unless (bobp) (back-to-indentation))) + (let* ((orig (or orig (point))) + (origline (or origline (py-count-lines (point-min) (point)))) + ;; closing indicates: when started, looked + ;; at a single closing parenthesis + ;; line: moved already a line backward + (liep (or liep (line-end-position))) + (line line) + (verbose py-verbose-p) + (pps (parse-partial-sexp (point-min) (point))) + (closing + (or closing + (and (nth 1 pps) + (looking-at ".*\\(\\s)\\)")(nth 0 pps) + ;; char doesn't matter for now, maybe drop + (string-to-char (match-string-no-properties 1))))) + ;; in a recursive call already + (repeat (if repeat + (setq repeat (1+ repeat)) + 0)) + ;; nesting: started nesting a list + (nesting nesting) + (cubuf (current-buffer)) + erg indent this-line) + (if (and (< repeat 1) + (and (comint-check-proc (current-buffer)) + (re-search-backward (concat py-shell-prompt-regexp "\\|" py-ipython-output-prompt-re "\\|" py-ipython-input-prompt-re) nil t 1))) + ;; common recursion not suitable because of prompt + (with-temp-buffer + (insert-buffer-substring cubuf (match-end 0) orig) + (setq indent (py-compute-indentation))) + (if (< py-max-specpdl-size repeat) + (error "`py-compute-indentation' reached loops max.") (setq nesting (nth 0 pps)) + (setq indent + (cond ((bobp) + (cond ((eq liep (line-end-position)) + 0) + ((looking-at py-outdent-re) + (+ (or indent-offset (and py-smart-indentation (py-guess-indent-offset)) py-indent-offset) (current-indentation))) + (t + (current-indentation)))) + ;; in string + ((and (nth 3 pps)(nth 8 pps)) + (cond + ((py--docstring-p (nth 8 pps)) + (save-excursion + (back-to-indentation) + (skip-chars-backward " \t\r\n\f") + (back-to-indentation) + (current-indentation))) + (t 0))) + ((and (looking-at "\"\"\"\\|'''")(not (bobp))) + (py-backward-statement) + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep)) + ;; comments + ((nth 8 pps) + (if (eq liep (line-end-position)) + (progn + (goto-char (nth 8 pps)) + (when (py--line-backward-maybe) (setq line t)) + (skip-chars-backward " \t") + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep)) + (goto-char (nth 8 pps)) + (if + line + (if py-indent-honors-inline-comment + (current-column) + (if py-indent-comments + (progn + (py-backward-comment) + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep)) + 0)) + (forward-char -1) + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep)))) + ((and + (looking-at (concat "[ \t]*" comment-start)) + (looking-back "^[ \t]*" (line-beginning-position))(not line) + (eq liep (line-end-position))) + (if py-indent-comments + (progn + (setq line t) + (skip-chars-backward " \t\r\n\f") + ;; as previous comment-line might + ;; be wrongly unindented, travel + ;; whole commented section + (py-backward-comment) + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep)) + 0)) + ((and + (looking-at (concat "[ \t]*" comment-start)) + (looking-back "^[ \t]*" (line-beginning-position)) + (not (eq liep (line-end-position)))) + (current-indentation)) + ((and (eq 11 (syntax-after (point))) line py-indent-honors-inline-comment) + (current-column)) + ;; lists + ((nth 1 pps) + (save-excursion + (goto-char (nth 1 pps)) + (setq this-line (py-count-lines)) + (cond + ((< 0 (- origline this-line)) + (if (< 1 (- origline this-line)) + (cond + (closing + (cond + (py-closing-list-dedents-bos + (goto-char (nth 1 pps)) + (current-indentation)) + ((looking-back "^[ \t]*" (line-beginning-position)) + (current-column)) + ((and (looking-at "\\s([ \t]*$") py-closing-list-keeps-space) + (+ (current-column) py-closing-list-space)) + ((looking-at "\\s([ \t]*$") + (py--empty-arglist-indent nesting indent-offset)) + ((looking-at "\\s([ \t]*\\([^ \t]+.*\\)$") + (goto-char (match-beginning 1)) + (if py-indent-paren-spanned-multilines-p + (+ (current-column) (or indent-offset py-indent-offset)) + (current-column))) + (t (py--fetch-previous-indent orig)))) + ;; already behind a dedented element in list + ((<= 2 (- origline this-line)) + (py--fetch-previous-indent orig)) + ((< (current-indentation) (current-column)) + (+ (current-indentation) (or indent-offset py-indent-offset))) + (t (py--fetch-previous-indent orig))) + (cond ((looking-at "\\s([ \t]*$") + (py--empty-arglist-indent nesting indent-offset)) + ((looking-at "\\s([ \t]*\\([^ \t]+.*\\)$") + (if + (and (or (bolp) (eq (char-before) 32)) py-indent-paren-spanned-multilines-p) + (progn + (goto-char (match-beginning 1)) + (+ (current-column) (or indent-offset py-indent-offset))) + (goto-char (match-beginning 1)) + (current-column))) + (t (+ (current-column) (* (nth 0 pps))))))) + ((nth 1 (parse-partial-sexp (point-min) (point))) + (goto-char (nth 1 (parse-partial-sexp (point-min) (point)))) + (setq line + ;; should be faster + (< (line-end-position) liep)) + (py-compute-indentation orig origline closing line nesting repeat indent-offset liep)) + ((not (py--beginning-of-statement-p)) + (py-backward-statement) + (py-compute-indentation orig origline closing line nesting repeat indent-offset liep)) + (t (1+ (current-column)))))) + ((and (eq (char-after) (or ?\( ?\{ ?\[)) line) + (1+ (current-column))) + ((py-preceding-line-backslashed-p) + (progn + (py-backward-statement) + (setq this-line (py-count-lines)) + (if (< 1 (- origline this-line)) + (py--fetch-previous-indent orig) + (if (looking-at "from +\\([^ \t\n]+\\) +import") + py-backslashed-lines-indent-offset + (+ (current-indentation) py-continuation-offset))))) + ((and (looking-at py-block-closing-keywords-re) + (eq liep (line-end-position))) + (skip-chars-backward "[ \t\r\n\f]") + (py-backward-statement) + (cond ((looking-at py-extended-block-or-clause-re) + (+ + ;; (if py-smart-indentation (py-guess-indent-offset) indent-offset) + (or indent-offset (and py-smart-indentation (py-guess-indent-offset)) py-indent-offset) + (current-indentation))) + ((looking-at py-block-closing-keywords-re) + (- (current-indentation) (or indent-offset py-indent-offset))) + (t (current-column)))) + ((looking-at py-block-closing-keywords-re) + (if (< (line-end-position) orig) + (- (current-indentation) (or indent-offset py-indent-offset)) + (py-backward-block-or-clause (current-indentation)) + (current-indentation))) + ((and (looking-at py-elif-re) (eq (py-count-lines) origline)) + (when (py--line-backward-maybe) (setq line t)) + (car (py--clause-lookup-keyword py-elif-re -1 nil origline))) + ((and (looking-at py-clause-re)(not line) + (eq liep (line-end-position))) + (cond ((looking-at py-finally-re) + (car (py--clause-lookup-keyword py-finally-re -1 nil origline))) + ((looking-at py-except-re) + (car (py--clause-lookup-keyword py-except-re -1 nil origline))) + ((looking-at py-else-block-re) + (car (py--clause-lookup-keyword py-else-block-re -1 nil origline))) + ((looking-at py-elif-block-re) + (car (py--clause-lookup-keyword py-elif-re -1 nil origline))) + ;; maybe at if, try, with + (t (car (py--clause-lookup-keyword py-block-or-clause-re -1 nil origline))))) + ((looking-at py-extended-block-or-clause-re) + (cond ((and (not line) + (eq liep (line-end-position))) + (when (py--line-backward-maybe) (setq line t)) + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep)) + (t (+ + (cond (indent-offset) + (py-smart-indentation + (py-guess-indent-offset)) + (t py-indent-offset)) + (current-indentation))))) + ((and + (< (line-end-position) liep) + (eq (current-column) (current-indentation))) + (and + (looking-at py-assignment-re) + (goto-char (match-end 0))) + ;; multiline-assignment + (if (and nesting (looking-at " *[[{(]")(not (looking-at ".+[]})][ \t]*$"))) + (+ (current-indentation) (or indent-offset py-indent-offset)) + (current-indentation))) + ((looking-at py-assignment-re) + (py-backward-statement) + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep)) + ((and (< (current-indentation) (current-column))(not line)) + (back-to-indentation) + (unless line + (setq nesting (nth 0 (parse-partial-sexp (point-min) (point))))) + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep)) + ((and (not (py--beginning-of-statement-p)) (not (and line (eq 11 (syntax-after (point)))))) + (if (bobp) + (current-column) + (if (eq (point) orig) + (progn + (when (py--line-backward-maybe) (setq line t)) + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep)) + (py-backward-statement) + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep)))) + ((or (py--statement-opens-block-p py-extended-block-or-clause-re)(looking-at "@")) + (if (< (py-count-lines) origline) + (+ (or indent-offset (and py-smart-indentation (py-guess-indent-offset)) py-indent-offset) (current-indentation)) + (skip-chars-backward " \t\r\n\f") + (setq line t) + (back-to-indentation) + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep))) + ((and py-empty-line-closes-p (py--after-empty-line)) + (progn (py-backward-statement) + (- (current-indentation) (or indent-offset py-indent-offset)))) + ;; still at orignial line + ((and (eq liep (line-end-position)) + (save-excursion + (and (setq erg (py--go-to-keyword py-extended-block-or-clause-re)) + (if (and (not indent-offset) py-smart-indentation) (setq indent-offset (py-guess-indent-offset)) t) + (ignore-errors (< orig (or (py-forward-block-or-clause)(point))))))) + (+ (car erg) (if py-smart-indentation + (or indent-offset (py-guess-indent-offset)) + (or indent-offset py-indent-offset)))) + ((and (not line) + (eq liep (line-end-position)) + (py--beginning-of-statement-p)) + (py-backward-statement) + (py-compute-indentation iact orig origline closing line nesting repeat indent-offset liep)) + (t (current-indentation)))) + (when (and verbose iact) (message "%s" indent)) + indent)))))) + +(defun py--fetch-previous-indent (orig) + "Report the preceding indent. " + (save-excursion + (goto-char orig) + (forward-line -1) + (end-of-line) + (skip-chars-backward " \t\r\n\f") + (current-indentation))) + +(defun py-continuation-offset (&optional arg) + "With numeric ARG different from 1 py-continuation-offset is set to that value; returns py-continuation-offset. " + (interactive "p") + (and (numberp arg) (not (eq 1 arg)) (setq py-continuation-offset arg)) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" py-continuation-offset)) + py-continuation-offset) + +(defalias 'pios 'py-indentation-of-statement) +(defalias 'ios 'py-indentation-of-statement) +(defun py-indentation-of-statement () + "Returns the indenation of the statement at point. " + (interactive) + (let ((erg (save-excursion + (back-to-indentation) + (or (py--beginning-of-statement-p) + (py-backward-statement)) + (current-indentation)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defalias 'py-in-list-p 'py-list-beginning-position) +(defun py-list-beginning-position (&optional start) + "Return lists beginning position, nil if not inside. + +Optional ARG indicates a start-position for `parse-partial-sexp'." + (nth 1 (parse-partial-sexp (or start (point-min)) (point)))) + +(defun py-end-of-list-position (&optional arg) + "Return end position, nil if not inside. + +Optional ARG indicates a start-position for `parse-partial-sexp'." + (interactive) + (let* ((ppstart (or arg (point-min))) + (erg (parse-partial-sexp ppstart (point))) + (beg (nth 1 erg)) + end) + (when beg + (save-excursion + (goto-char beg) + (forward-list 1) + (setq end (point)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" end)) + end)) + +(defun py--in-comment-p () + "Return the beginning of current line's comment, if inside. " + (save-restriction + (widen) + (let* ((pps (parse-partial-sexp (point-min) (point))) + (erg (when (nth 4 pps) (nth 8 pps)))) + (unless erg + (when (looking-at (concat "^[ \t]*" comment-start-skip)) + (setq erg (point)))) + erg))) + +(defun py-in-triplequoted-string-p () + "Returns character address of start tqs-string, nil if not inside. " + (interactive) + (let* ((pps (parse-partial-sexp (point-min) (point))) + (erg (when (and (nth 3 pps) (nth 8 pps))(nth 2 pps)))) + (save-excursion + (unless erg (setq erg + (progn + (when (looking-at "\"\"\"\\|''''") + (goto-char (match-end 0)) + (setq pps (parse-partial-sexp (point-min) (point))) + (when (and (nth 3 pps) (nth 8 pps)) (nth 2 pps))))))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-in-string-p-intern (pps) + (goto-char (nth 8 pps)) + (list (point) (char-after)(skip-chars-forward (char-to-string (char-after))))) + +(defun py-in-string-p () + "if inside a double- triple- or singlequoted string, + +If non-nil, return a list composed of +- beginning position +- the character used as string-delimiter (in decimal) +- and length of delimiter, commonly 1 or 3 " + (interactive) + (save-excursion + (let* ((pps (parse-partial-sexp (point-min) (point))) + (erg (when (nth 3 pps) + (py-in-string-p-intern pps)))) + (unless erg + (when (looking-at "\"\\|'") + (forward-char 1) + (setq pps (parse-partial-sexp (line-beginning-position) (point))) + (when (nth 3 pps) + (setq erg (py-in-string-p-intern pps))))) + + ;; (list (nth 8 pps) (char-before) (1+ (skip-chars-forward (char-to-string (char-before))))) + ;; (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg))) + +(defun py-in-statement-p () + "Returns list of beginning and end-position if inside. + +Result is useful for booleans too: (when (py-in-statement-p)...) +will work. +" + (interactive) + (let ((orig (point)) + beg end erg) + (save-excursion + (setq end (py-forward-statement)) + (setq beg (py-backward-statement)) + (when (and (<= beg orig)(<= orig end)) + (setq erg (cons beg end)) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)))) + +;; Beginning-of- p +(defun py-backward-top-level-p () + "Returns position, if cursor is at the beginning of a top-level, nil otherwise. " + (interactive) + (let (erg) + (and (py--beginning-of-statement-p) + (eq 0 (current-column)) + (setq erg (point)) + erg))) + +(defun py--beginning-of-buffer-p () + "Returns position, if cursor is at the beginning of buffer, nil otherwise. " + (when (bobp)(point))) + +;; End-of- p + +;; Opens +(defun py--statement-opens-block-p (&optional regexp) + "Return position if the current statement opens a block +in stricter or wider sense. + +For stricter sense specify regexp. " + (let* ((regexp (or regexp py-block-or-clause-re)) + (erg (py--statement-opens-base regexp))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py--statement-opens-base (regexp) + (let ((orig (point)) + erg) + (save-excursion + (back-to-indentation) + (py-forward-statement) + (py-backward-statement) + (when (and + (<= (line-beginning-position) orig)(looking-back "^[ \t]*" (line-beginning-position))(looking-at regexp)) + (setq erg (point)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py--statement-opens-clause-p () + "Return position if the current statement opens block or clause. " + (py--statement-opens-base py-clause-re)) + +(defun py--statement-opens-block-or-clause-p () + "Return position if the current statement opens block or clause. " + (py--statement-opens-base py-block-or-clause-re)) + +(defun py--statement-opens-class-p () + "Return `t' if the statement opens a functions or class definition, nil otherwise. " + (py--statement-opens-base py-class-re)) + +(defun py--statement-opens-def-p () + "Return `t' if the statement opens a functions or class definition, nil otherwise. " + (py--statement-opens-base py-def-re)) + +(defun py--statement-opens-def-or-class-p () + "Return `t' if the statement opens a functions or class definition, nil otherwise. " + (py--statement-opens-base py-def-or-class-re)) + +(defun py--record-list-error (pps) + "When encountering a missing parenthesis, store its line, position. `py-verbose-p' must be t + +Unclosed-string errors are not handled here, as made visible by fontification already. +" + (let ((this-err + (save-excursion + (list + (nth 1 pps) + (progn + (goto-char (nth 1 pps)) + (py-count-lines (point-min) (point))))))) + this-err)) + +(defun py--message-error (err) + "Receives a list (position line) " + (message "Closing paren missed: line %s pos %s" (cadr err) (car err))) + +(defun py--end-base-look-upward (thisregexp regexp) + (progn (back-to-indentation) + (let ((bofst (py--beginning-of-statement-p))) + (cond ((and bofst (eq regexp 'py-clause-re)(looking-at py-extended-block-or-clause-re)) + (point)) + ((and bofst (looking-at thisregexp)) + (point)) + (t + (when + (cdr-safe + (py--go-to-keyword + thisregexp)) + (when (py--statement-opens-block-p py-extended-block-or-clause-re) + (point)))))))) + +(defun py--go-down-when-found-upward (regexp) + (let ((thisindent (current-indentation)) + last) + (back-to-indentation) + (while + (and (py-down-statement) + (or (< thisindent (current-indentation)) + (and (eq thisindent (current-indentation)) + (or (eq regexp 'py-minor-block-re) + (eq regexp 'py-block-re) + (eq regexp 'py-if-block-re)) + (looking-at py-clause-re))) + (py-forward-statement)(setq last (point)))) + (and last (goto-char last)))) + +(defun py--end-of-paragraph (regexp) + (let* ((regexp (if (symbolp regexp) (symbol-value regexp) + regexp))) + (while (and (not (eobp)) (re-search-forward regexp nil 'move 1)(nth 8 (parse-partial-sexp (point-min) (point))))))) + +(defun py--end-base (regexp &optional orig decorator bol indent done) + "Used internal by functions going to the end forms. + +Must find start first " + (unless (eobp) + (if (eq regexp 'py-paragraph-re) + (py--end-of-paragraph regexp) + (let* ((pps (parse-partial-sexp (point-min) (point))) + ;; (repeat (or (and repeat (1+ repeat)) 0)) + (orig (or orig (point))) + (regexp (or regexp (symbol-value 'py-extended-block-or-clause-re))) + (thisregexp (if (symbolp regexp) + (cond ((eq regexp 'py-clause-re) + (symbol-value 'py-extended-block-or-clause-re)) + (t (symbol-value regexp))) + regexp)) + (indent (or indent + ;; avoid costly moves by statement + (when (and (not (nth 8 pps)) + (or (looking-back py-decorator-re (line-beginning-position)) + (looking-back (concat (symbol-value regexp) ".+") (line-beginning-position)))) + (current-indentation)) + (if (py--beginning-of-statement-p) + (current-indentation) + (save-excursion (py-backward-statement) (current-indentation))))) + + ;; start of form maybe inside + (this + (cond ((and (looking-at thisregexp) (not (or (nth 1 pps) (nth 8 pps)))) + (point)) + ((and (not (nth 8 pps))(looking-back py-decorator-re (line-beginning-position))) + (and (re-search-forward thisregexp nil t 1) + (match-beginning 0))) + ;; when building the index, avoid costly moves by + ;; statement + ((and (not (nth 8 pps))(looking-back (symbol-value regexp) (line-beginning-position))) + (match-beginning 0)) + (t (py--go-to-keyword thisregexp indent)))) + ;; (done done) + erg) + (cond + (this (setq erg (py--go-down-when-found-upward regexp))) + (t (goto-char orig))) + (if (< orig (point)) + (and erg bol (setq erg (py--beginning-of-line-form erg))) + (setq erg nil) + ;; Prevent eternal loop + (unless done + (when + (py-forward-statement) + (py--end-base regexp (point) decorator bol + ;; update required indent + (if (py--beginning-of-statement-p) + (- (current-indentation) py-indent-offset) + (save-excursion (py-backward-statement) (- (current-indentation) py-indent-offset))) t + ;; indent + )))) + erg)))) + +(defun py--look-downward-for-beginning (regexp) + "When above any beginning of FORM, search downward. " + (let* ((orig (point)) + (erg orig) + pps) + (while (and (not (eobp)) (re-search-forward regexp nil t 1)(setq erg (match-beginning 0)) (setq pps (parse-partial-sexp (point-min) (point))) + (or (nth 8 pps) (nth 1 pps)))) + (cond ((not (or (nth 8 pps) (nth 1 pps) (or (looking-at comment-start)))) + (when (ignore-errors (< orig erg)) + erg))))) + +(defun py-look-downward-for-clause (&optional ind orig regexp) + "If beginning of other clause exists downward in current block. + +If succesful return position. " + (interactive) + (unless (eobp) + (let ((ind (or ind + (save-excursion + (py-backward-statement) + (if (py--statement-opens-block-p) + (current-indentation) + (- (current-indentation) py-indent-offset))))) + (orig (or orig (point))) + (regexp (or regexp py-extended-block-or-clause-re)) + erg) + (end-of-line) + (when (re-search-forward regexp nil t 1) + (when (nth 8 (parse-partial-sexp (point-min) (point))) + (while (and (re-search-forward regexp nil t 1) + (nth 8 (parse-partial-sexp (point-min) (point)))))) + ;; (setq last (point)) + (back-to-indentation) + (unless (and (looking-at py-clause-re) + (not (nth 8 (parse-partial-sexp (point-min) (point)))) (eq (current-indentation) ind)) + (progn (setq ind (current-indentation)) + (while (and (py-forward-statement-bol)(not (looking-at py-clause-re))(<= ind (current-indentation))))) + (if (and (looking-at py-clause-re) + (not (nth 8 (parse-partial-sexp (point-min) (point)))) + (< orig (point))) + (setq erg (point)) + (goto-char orig)))) + (when (called-interactively-p 'any) (message "%s" erg)) + erg))) + +(defun py-current-defun (&optional iact) + "Go to the outermost method or class definition in current scope. + +Python value for `add-log-current-defun-function'. +This tells add-log.el how to find the current function/method/variable. +Returns name of class or methods definition, if found, nil otherwise. + +See customizable variables `py-current-defun-show' and `py-current-defun-delay'." + (interactive "p") + (save-restriction + (widen) + (save-excursion + (let ((erg (when (py-backward-def-or-class) + (forward-word 1) + (skip-chars-forward " \t") + (prin1-to-string (symbol-at-point))))) + (when (and erg py-current-defun-show) + (push-mark (point) t t) (skip-chars-forward "^ (") + (exchange-point-and-mark) + (sit-for py-current-defun-delay)) + (when iact (message (prin1-to-string erg))) + erg)))) + +(defun py-sort-imports () + "Sort multiline imports. + +Put point inside the parentheses of a multiline import and hit +\\[py-sort-imports] to sort the imports lexicographically" + (interactive) + (save-excursion + (let ((open-paren (ignore-errors (save-excursion (progn (up-list -1) (point))))) + (close-paren (ignore-errors (save-excursion (progn (up-list 1) (point))))) + sorted-imports) + (when (and open-paren close-paren) + (goto-char (1+ open-paren)) + (skip-chars-forward " \n\t") + (setq sorted-imports + (sort + (delete-dups + (split-string (buffer-substring + (point) + (save-excursion (goto-char (1- close-paren)) + (skip-chars-backward " \n\t") + (point))) + ", *\\(\n *\\)?")) + ;; XXX Should this sort case insensitively? + 'string-lessp)) + ;; Remove empty strings. + (delete-region open-paren close-paren) + (goto-char open-paren) + (insert "(\n") + (insert (py--join-words-wrapping (remove "" sorted-imports) "," " " 78)) + (insert ")"))))) + +(defun py--in-literal (&optional lim) + "Return non-nil if point is in a Python literal (a comment or string). +Optional argument LIM indicates the beginning of the containing form, +i.e. the limit on how far back to scan." + (let* ((lim (or lim (point-min))) + (state (parse-partial-sexp lim (point)))) + (cond + ((nth 3 state) 'string) + ((nth 4 state) 'comment)))) + +(defconst py-help-address "python-mode@python.org" + "List dealing with usage and developing python-mode. + +Also accepts submission of bug reports, whilst a ticket at +http://launchpad.net/python-mode +is preferable for that. ") + +;; Utilities +(defun py--point (position) + "Returns the value of point at certain commonly referenced POSITIONs. +POSITION can be one of the following symbols: + + bol -- beginning of line + eol -- end of line + bod -- beginning of def or class + eod -- end of def or class + bob -- beginning of buffer + eob -- end of buffer + boi -- back to indentation + bos -- beginning of statement + +This function does not modify point or mark." + (let (erg) + (save-excursion + (setq erg + (progn + (cond + ((eq position 'bol) (beginning-of-line)) + ((eq position 'eol) (end-of-line)) + ((eq position 'bod) (py-backward-def-or-class)) + ((eq position 'eod) (py-forward-def-or-class)) + ;; Kind of funny, I know, but useful for py-up-exception. + ((eq position 'bob) (goto-char (point-min))) + ((eq position 'eob) (goto-char (point-max))) + ((eq position 'boi) (back-to-indentation)) + ((eq position 'bos) (py-backward-statement)) + (t (error "Unknown buffer position requested: %s" position))) (point)))) + erg)) + +(defun py-install-local-shells (&optional local) + "Builds Python-shell commands from executable found in LOCAL. + +If LOCAL is empty, shell-command `find' searches beneath current directory. +Eval resulting buffer to install it, see customizable `py-extensions'. " + (interactive) + (let* ((local-dir (if local + (expand-file-name local) + (read-from-minibuffer "Virtualenv directory: " default-directory))) + (path-separator (if (string-match "/" local-dir) + "/" + "\\" t)) + (shells (split-string (shell-command-to-string (concat "find " local-dir " -maxdepth 9 -type f -executable -name \"*python\"")))) + prefix end orig curexe aktpath) + (set-buffer (get-buffer-create py-extensions)) + (erase-buffer) + (dolist (elt shells) + (setq prefix "") + (setq curexe (substring elt (1+ (string-match "/[^/]+$" elt)))) + (setq aktpath (substring elt 0 (1+ (string-match "/[^/]+$" elt)))) + (dolist (prf (split-string aktpath (regexp-quote path-separator))) + (unless (string= "" prf) + (setq prefix (concat prefix (substring prf 0 1))))) + (setq orig (point)) + (insert py-shell-template) + (setq end (point)) + (goto-char orig) + (when (re-search-forward "\\" end t 1) + (replace-match (concat prefix "-" (substring elt (1+ (save-match-data (string-match "/[^/]+$" elt)))))t)) + (goto-char orig) + (while (search-forward "DOCNAME" end t 1) + (replace-match (if (string= "ipython" curexe) + "IPython" + (capitalize curexe)) t)) + (goto-char orig) + (when (search-forward "FULLNAME" end t 1) + (replace-match elt t)) + (goto-char (point-max))) + (emacs-lisp-mode) + (if (file-readable-p (concat py-install-directory "/" py-extensions)) + (find-file (concat py-install-directory "/" py-extensions))))) + +(defun py-end-of-string (&optional beginning-of-string-position) + "Go to end of string at point if any, if successful return position. " + (interactive) + (let ((orig (point)) + (beginning-of-string-position (or beginning-of-string-position (and (nth 3 (parse-partial-sexp 1 (point)))(nth 8 (parse-partial-sexp 1 (point)))) + (and (looking-at "\"\"\"\\|'''\\|\"\\|\'")(match-beginning 0)))) + erg) + (if beginning-of-string-position + (progn + (goto-char beginning-of-string-position) + (when + ;; work around parse-partial-sexp error + (and (nth 3 (parse-partial-sexp 1 (point)))(nth 8 (parse-partial-sexp 1 (point)))) + (goto-char (nth 3 (parse-partial-sexp 1 (point))))) + (if (ignore-errors (setq erg (scan-sexps (point) 1))) + (goto-char erg) + (goto-char orig))) + + (error (concat "py-end-of-string: don't see end-of-string at " (buffer-name (current-buffer)) "at pos " (point)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py--until-found (search-string liste) + "Search liste for search-string until found. " + (let ((liste liste) element) + (while liste + (if (member search-string (car liste)) + (setq element (car liste) liste nil)) + (setq liste (cdr liste))) + (when element + (while (and element (not (numberp element))) + (if (member search-string (car element)) + (setq element (car element)) + (setq element (cdr element)))) + element))) + +(defun py--delay-process-dependent (process) + "Call a `py-ipython-send-delay' or `py-python-send-delay' according to process" + (if (string-match "ipython" (prin1-to-string process)) + (sit-for py-ipython-send-delay t) + (sit-for py-python-send-delay t))) + +(defun py-send-string (strg &optional process) + "Evaluate STRG in Python PROCESS." + (interactive "sPython command: ") + (let* ((buffer (if process (process-buffer process) (py-shell))) + (proc (or process (get-buffer-process buffer)))) + (py-fast-send-string strg proc buffer))) + +(defun py--send-string-no-output (strg &optional process) + "Send STRING to PROCESS and inhibit output display. +When MSG is non-nil messages the first line of STRING. Return +the output." + (let* (output + (process (or process (get-buffer-process (py-shell)))) + (comint-preoutput-filter-functions + (append comint-preoutput-filter-functions + '(ansi-color-filter-apply + (lambda (strg) + (setq output strg) + ""))))) + (py-send-string strg process) + (sit-for 0.1 t) + ;; (py--delay-process-dependent process) + (when (and output (not (string= "" output))) + (py--string-strip + (format "[ \n]*%s[ \n]*" py-fast-filter-re))))) + +(defun py--send-string-return-output (strg &optional process) + "Send STRING to PROCESS and return output. + +When MSG is non-nil messages the first line of STRING. Return +the output." + (let ((process (or process (get-buffer-process (py-shell)))) + erg) + (with-current-buffer (process-buffer process) + (let ((orig (or (ignore-errors (and comint-last-prompt (cdr comint-last-prompt))) (point)))) + (py-send-string strg process) + ;; (accept-process-output process) + (setq erg + (buffer-substring-no-properties orig (or (ignore-errors (and comint-last-prompt (1- (car comint-last-prompt)))) (point)))) + (if (and erg (not (or (string= "" erg) (string= "''" erg)))) + (replace-regexp-in-string + (format "[ \n]*%s[ \n]*" py-fast-filter-re) + "" erg) + ;; don't insert empty completion string + (delete-region orig (or (ignore-errors (and comint-last-prompt (1- (car comint-last-prompt)))) (point)))) + )))) + +(defun py-which-def-or-class (&optional orig) + "Returns concatenated `def' and `class' names in hierarchical order, if cursor is inside. + +Returns \"???\" otherwise +Used by variable `which-func-functions' " + (interactive) + (let* ((orig (or orig (point))) + (backindent 99999) + (re py-def-or-class-re + ;; (concat py-def-or-class-re "\\([[:alnum:]_]+\\)") + ) + erg forward indent backward limit) + (if + (and (looking-at re) + (not (nth 8 (parse-partial-sexp (point-min) (point))))) + (progn + (setq erg (list (match-string-no-properties 2))) + (setq backindent (current-indentation))) + ;; maybe inside a definition's symbol + (or (eolp) (and (looking-at "[[:alnum:]]")(forward-word 1)))) + (if + (and (not (and erg (eq 0 (current-indentation)))) + (setq limit (py-backward-top-level)) + (looking-at re)) + (progn + (push (match-string-no-properties 2) erg) + (setq indent (current-indentation))) + (goto-char orig) + (while (and + (re-search-backward py-def-or-class-re limit t 1) + (< (current-indentation) backindent) + (setq backindent (current-indentation)) + (setq backward (point)) + (or (< 0 (current-indentation)) + (nth 8 (parse-partial-sexp (point-min) (point)))))) + (when (and backward + (goto-char backward) + (looking-at re)) + (push (match-string-no-properties 2) erg) + (setq indent (current-indentation)))) + ;; (goto-char orig)) + (if erg + (progn + (end-of-line) + (while (and (re-search-forward py-def-or-class-re nil t 1) + (<= (point) orig) + (< indent (current-indentation)) + (or + (nth 8 (parse-partial-sexp (point-min) (point))) + (setq forward (point))))) + (if forward + (progn + (goto-char forward) + (save-excursion + (back-to-indentation) + (and (looking-at re) + (setq erg (list (car erg) (match-string-no-properties 2))) + ;; (< (py-forward-def-or-class) orig) + ;; if match was beyond definition, nil + ;; (setq erg nil) +))) + (goto-char orig)))) + (if erg + (if (< 1 (length erg)) + (setq erg (mapconcat 'identity erg ".")) + (setq erg (car erg))) + (setq erg "???")) + (goto-char orig) + (when (called-interactively-p 'any) (message "%s" erg)) + erg)) + +(defun py--trim-regexp-empty-spaces-left (regexp) + (let ((erg (symbol-value regexp))) + (substring erg (1+ (string-match "\*" erg))))) + +(defun py--beginning-of-form-intern (final-re &optional iact indent orig lc decorator) + "Go to beginning of FORM. + +With INDENT, go to beginning one level above. +Whit IACT, print result in message buffer. + +Returns beginning of FORM if successful, nil otherwise" + (interactive "P") + (let ((regexp + (if (eq 0 indent) + (py--trim-regexp-empty-spaces-left final-re) + (symbol-value final-re))) + erg) + (unless (bobp) + (let* ((orig (or orig (point))) + (indent (or indent (progn + (back-to-indentation) + (or (py--beginning-of-statement-p) + (py-backward-statement)) + (current-indentation))))) + (setq erg (cond ((and (< (point) orig) (looking-at regexp)) + (point)) + ((and (eq 0 (current-column)) (numberp indent) (< 0 indent)) + (when (< 0 (abs (skip-chars-backward " \t\r\n\f"))) + (py-backward-statement) + (unless (looking-at regexp) + (cdr (py--go-to-keyword regexp (current-indentation) decorator))))) + ((numberp indent) + (or (cdr (py--go-to-keyword regexp indent decorator)) + (progn + (goto-char orig) + (cdr (py--go-to-keyword regexp indent decorator))))) + (t (ignore-errors + (cdr (py--go-to-keyword regexp + (- (progn (if (py--beginning-of-statement-p) (current-indentation) (save-excursion (py-backward-statement) (current-indentation)))) py-indent-offset))))))) + (when lc (beginning-of-line) (setq erg (point))))) + (when (and py-verbose-p iact) (message "%s" erg)) + erg)) + +(defun py--backward-prepare (&optional indent final-re iact decorator lc) + (unless (bobp) + (let* ((orig (point)) + (indent + (or indent + (progn + (or (py--beginning-of-statement-p) + (py-backward-statement)) + ;; maybe after last statement? + (if (save-excursion + (< (py-forward-statement) orig)) + (progn (goto-char orig) + (back-to-indentation) + (current-indentation)) + (cond ((looking-back "^[ \t]*" (line-beginning-position)) + (current-indentation)) + (t (progn (back-to-indentation) + (cond ((eq 0 (current-indentation)) + (current-indentation)))))))))) + erg) + ;; def and class need lesser value + (when (and + (member final-re (list 'py-def-or-class-re 'py-class-re 'py-def-re)) + (<= 0 (- indent (if py-smart-indentation (py-guess-indent-offset) py-indent-offset)))) + (setq indent (- indent (if py-smart-indentation (py-guess-indent-offset) py-indent-offset)))) + (if (and (< (point) orig) (looking-at (symbol-value final-re))) + (progn + (and lc (beginning-of-line)) + (setq erg (point)) + (when (and py-verbose-p iact) (message "%s" erg)) + erg) + (py--beginning-of-form-intern final-re iact indent orig lc decorator))))) + +(defun py--fetch-first-python-buffer () + "Returns first (I)Python-buffer found in `buffer-list'" + (let ((buli (buffer-list)) + erg) + (while (and buli (not erg)) + (if (string-match "Python" (prin1-to-string (car buli))) + (setq erg (car buli)) + (setq buli (cdr buli)))) + erg)) + +(defun py-unload-python-el () + "Unloads python-mode delivered by shipped python.el + +Removes python-skeleton forms from abbrevs. +These would interfere when inserting forms heading a block" + (interactive) + (let (done) + (when (featurep 'python) (unload-feature 'python t)) + (when (file-readable-p abbrev-file-name) + (find-file abbrev-file-name) + (goto-char (point-min)) + (while (re-search-forward "^.+python-skeleton.+$" nil t 1) + (setq done t) + (delete-region (match-beginning 0) (1+ (match-end 0)))) + (when done (write-file abbrev-file-name) + ;; now reload + (read-abbrev-file abbrev-file-name)) + (kill-buffer (file-name-nondirectory abbrev-file-name))))) + +(defmacro py--kill-buffer-unconditional (buffer) + "Kill buffer unconditional, kill buffer-process if existing. " + `(let ((proc (get-buffer-process ,buffer)) + kill-buffer-query-functions) + (ignore-errors + (and proc (kill-process proc)) + (set-buffer ,buffer) + (set-buffer-modified-p 'nil) + (kill-buffer (current-buffer))))) + +(defun py--skip-to-semicolon-backward (&optional limit) + "Fetch the beginning of statement after a semicolon. + +Returns `t' if point was moved" + (prog1 + (< 0 (abs (skip-chars-backward "^;" (or limit (line-beginning-position))))) + (skip-chars-forward " \t" (line-end-position)))) + +(defun py--end-of-comment-intern (pos) + (while (and (not (eobp)) + (forward-comment 99999))) + ;; forward-comment fails sometimes + (and (eq pos (point)) (prog1 (forward-line 1) (back-to-indentation)) + (while (member (char-after) (list (string-to-char comment-start) 10))(forward-line 1)(back-to-indentation)))) + +(defun py--skip-to-comment-or-semicolon (done) + "Returns position if comment or semicolon found. " + (let ((orig (point))) + (cond ((and done (< 0 (abs (skip-chars-forward "^#;" (line-end-position)))) + (member (char-after) (list ?# ?\;))) + (when (eq ?\; (char-after)) + (skip-chars-forward ";" (line-end-position)))) + ((and (< 0 (abs (skip-chars-forward "^#;" (line-end-position)))) + (member (char-after) (list ?# ?\;))) + (when (eq ?\; (char-after)) + (skip-chars-forward ";" (line-end-position)))) + ((not done) + (end-of-line))) + (skip-chars-backward " \t" (line-beginning-position)) + (and (< orig (point))(setq done t) + done))) + +(defun py-backward-top-level () + "Go up to beginning of statments until level of indentation is null. + +Returns position if successful, nil otherwise " + (interactive) + (let (erg done) + (unless (bobp) + (while (and (not done)(not (bobp)) + (setq erg (re-search-backward "^[[:alpha:]_'\"]" nil t 1))) + (if + (nth 8 (parse-partial-sexp (point-min) (point))) + (setq erg nil) + (setq done t))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg))) + +(defun py-forward-top-level () + "Go to end of top-level form at point. + +Returns position if successful, nil otherwise" + (interactive) + (let ((orig (point)) + erg) + (unless (eobp) + (unless (py--beginning-of-statement-p) + (py-backward-statement)) + (unless (eq 0 (current-column)) + (py-backward-top-level)) + (cond ((looking-at py-def-re) + (setq erg (py-forward-def))) + ((looking-at py-class-re) + (setq erg (py-forward-class))) + ((looking-at py-block-re) + (setq erg (py-forward-block))) + (t (setq erg (py-forward-statement)))) + (unless (< orig (point)) + (while (and (not (eobp)) (py-down-statement)(< 0 (current-indentation)))) + (if (looking-at py-block-re) + (setq erg (py-forward-block)) + (setq erg (py-forward-statement)))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg))) + +(defun py-down-top-level () + "Go to beginning of next top-level form downward. + +Returns position if successful, nil otherwise" + (interactive) + (let ((orig (point)) + erg) + (while (and (not (eobp)) + (progn (end-of-line) + (re-search-forward "^[[:alpha:]_'\"]" nil 'move 1)) + (nth 8 (parse-partial-sexp (point-min) (point))))) + (when (and (not (eobp)) (< orig (point))) + (goto-char (match-beginning 0)) + (setq erg (point))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-forward-top-level-bol () + "Go to end of top-level form at point, stop at next beginning-of-line. + +Returns position successful, nil otherwise" + (interactive) + (let (erg) + (py-forward-top-level) + (unless (or (eobp) (bolp)) + (forward-line 1) + (beginning-of-line) + (setq erg (point))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py-down (&optional indent) + "Go to beginning one level below of compound statement or definition at point. + +If no statement or block below, but a delimited form --string or list-- go to its beginning. Repeated call from there will behave like down-list. + +Returns position if successful, nil otherwise" + (interactive "P") + (let* ((orig (point)) + erg + (indent (or + indent + (if + (py--beginning-of-statement-p) + (current-indentation) + (progn + (py-backward-statement) + (current-indentation))))) + last) + (while (and (setq last (point)) (py-forward-statement) (py-forward-statement) (py-backward-statement) (eq (current-indentation) indent))) + (if (< indent (current-indentation)) + (setq erg (point)) + (goto-char last)) + (when (< (point) orig) + (goto-char orig)) + (when (and (eq (point) orig) + (progn (forward-char 1) + (skip-chars-forward "^\"'[({" (line-end-position)) + (member (char-after) (list ?\( ?\" ?\' ?\[ ?\{))) + (setq erg (point)))) + (unless erg + (goto-char orig)) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +(defun py--beginning-of-line-form (erg) + "Internal use: Go to beginning of line following end of form. " + (when erg + (unless (eobp) + (forward-line 1) + (beginning-of-line) + (setq erg (point))))) + +(defun py--mark-base (form &optional mark-decorators) + "Returns boundaries of FORM, a cons. + +If PY-MARK-DECORATORS, `def'- and `class'-forms include decorators +If BOL is t, mark from beginning-of-line" + (let* ((begform (intern-soft (concat "py-backward-" form))) + (endform (intern-soft (concat "py-forward-" form))) + (begcheckform (intern-soft (concat "py--beginning-of-" form "-p"))) + (orig (point)) + beg end erg) + (setq beg (if + (setq beg (funcall begcheckform)) + beg + (funcall begform))) + (and mark-decorators + (and (setq erg (py-backward-decorator)) + (setq beg erg))) + (push-mark) + (setq end (funcall endform)) + (unless end (when (< beg (point)) + (setq end (point)))) + (if (and beg end (<= beg orig) (<= orig end)) + (cons beg end) + nil))) + +(defun py--mark-base-bol (form &optional mark-decorators) + (let* ((begform (intern-soft (concat "py-backward-" form "-bol"))) + (endform (intern-soft (concat "py-forward-" form "-bol"))) + (begcheckform (intern-soft (concat "py--beginning-of-" form "-bol-p"))) + beg end erg) + (setq beg (if + (setq beg (funcall begcheckform)) + beg + (funcall begform))) + (when mark-decorators + (save-excursion + (when (setq erg (py-backward-decorator)) + (setq beg erg)))) + (setq end (funcall endform)) + (push-mark beg t t) + (unless end (when (< beg (point)) + (setq end (point)))) + (cons beg end))) + +(defun py-mark-base (form &optional mark-decorators) + "Calls py--mark-base, returns bounds of form, a cons. " + (let* ((bounds (py--mark-base form mark-decorators)) + (beg (car bounds))) + (push-mark beg t t) + bounds)) + +(defun py-beginning (&optional indent) + "Go to beginning of compound statement or definition at point. + +With \\[universal-argument], go to beginning one level above. +Returns position if successful, nil otherwise" + (interactive "P") + (py--beginning-of-form-intern py-extended-block-or-clause-re (called-interactively-p 'any) indent)) + +(defun py-end () + "Go to end of of compound statement or definition at point. + +Returns position block if successful, nil otherwise" + (interactive "P") + (let* ((orig (point)) + (erg (py--end-base 'py-extended-block-or-clause-re orig))) + (when (and py-verbose-p (called-interactively-p 'any)) (message "%s" erg)) + erg)) + +;; Buffer +(defun py-beginning-of-buffer () + "Go to beginning-of-buffer, return position. " + (let ((erg (unless (bobp) + (goto-char (point-min))))) + erg)) + +(defun py-end-of-buffer () + "Go to end-of-buffer, return position. + + If already at end-of-buffer and not at EOB, go to end of next line. " + (let ((erg (unless (eobp) + (goto-char (point-max))))) + erg)) + +(defun py-backward-same-level () + "Go form backward keeping indent level if possible. + +If inside a delimited form --string or list-- go to its beginning. +If not at beginning of a statement or block, go to its beginning. +If at beginning of a statement or block, go to previous beginning of compound statement or definition at point. +If no further element at same level, go one level up." + (interactive) + (let ((pps (parse-partial-sexp (point-min) (point)))) + (cond ((nth 8 pps) (goto-char (nth 8 pps))) + ((nth 1 pps) (goto-char (nth 1 pps))) + (t (if (eq (current-column) (current-indentation)) + (py--beginning-of-form-intern 'py-extended-block-or-clause-re (called-interactively-p 'any)) + (back-to-indentation) + (py-backward-same-level)))))) + +(defun py--end-of-buffer-p () + "Returns position, if cursor is at the end of buffer, nil otherwise. " + (when (eobp)(point))) + +(defun py-sectionize-region (&optional beg end) + "Markup code in region as section. + +Use current region unless optional args BEG END are delivered." + (interactive "*") + (let ((beg (or beg (region-beginning))) + (end (or (and end (copy-marker end)) (copy-marker (region-end))))) + (save-excursion + (goto-char beg) + (unless (empty-line-p) (split-line)) + (beginning-of-line) + (insert py-section-start) + (goto-char end) + (unless (empty-line-p) (newline)) + (insert py-section-end)))) + +(defun py-execute-section-prepare (&optional shell) + "Execute section at point. " + (save-excursion + (let ((start (when (or (py--beginning-of-section-p) + (py-backward-section)) + (forward-line 1) + (beginning-of-line) + (point)))) + (if (and start (py-forward-section)) + (progn + (beginning-of-line) + (skip-chars-backward " \t\r\n\f") + (if shell + (funcall (car (read-from-string (concat "py-execute-region-" shell))) start (point)) + (py-execute-region start (point)))) + (error "Can't see `py-section-start' resp. `py-section-end'"))))) + +(defun py--narrow-prepare (name) + "Used internally. " + (save-excursion + (let ((start (cond ((string= name "statement") + (if (py--beginning-of-statement-p) + (point) + (py-backward-statement-bol))) + ((funcall (car (read-from-string (concat "py--statement-opens-" name "-p"))))) + (t (funcall (car (read-from-string (concat "py-backward-" name "-bol")))))))) + (funcall (car (read-from-string (concat "py-forward-" name)))) + (narrow-to-region (point) start)))) + +(defun py--forms-report-result (erg &optional iact) + (let ((res (ignore-errors (buffer-substring-no-properties (car-safe erg) (cdr-safe erg))))) + (when (and res iact) + (goto-char (car-safe erg)) + (set-mark (point)) + (goto-char (cdr-safe erg))) + res)) + +(defun py-rotate-shell-fontify-style (msg) + "Rotates between possible values 'all, 'input and nil. " + (interactive "p") + (cond ((eq py-shell-fontify-style 'all) + (setq py-shell-fontify-style nil)) + ((eq py-shell-fontify-style 'input) + (setq py-shell-fontify-style 'all)) + (t (setq py-shell-fontify-style 'input))) + (py--shell-setup-fontification py-shell-fontify-style) + (when msg (message "py-shell-fontify-style set to: %s" py-shell-fontify-style))) + +(defun py-toggle-execute-use-temp-file () + (interactive) + (setq py--execute-use-temp-file-p (not py--execute-use-temp-file-p))) + +(defun py--close-intern (regexp) + "Core function, internal used only. " + (let ((cui (car (py--go-to-keyword (symbol-value regexp))))) + (message "%s" cui) + (py--end-base regexp (point)) + (forward-line 1) + (if py-close-provides-newline + (unless (empty-line-p) (split-line)) + (fixup-whitespace)) + (indent-to-column cui) + cui)) + +(defalias 'IPython 'ipython) +(defalias 'Ipython 'ipython) +(defalias 'Python 'python) +(defalias 'Python2 'python2) +(defalias 'Python3 'python3) +(defalias 'ipy 'ipython) +(defalias 'iyp 'ipython) +(defalias 'py-execute-region-default 'py-execute-region) +(defalias 'py-execute-region-default-dedicated 'py-execute-region-dedicated) +(defalias 'py-kill-minor-expression 'py-kill-partial-expression) +(defalias 'pyhotn 'python) +(defalias 'pyhton 'python) +(defalias 'pyt 'python) + +;; python-components-shell-menu + +(and (ignore-errors (require 'easymenu) t) + ;; (easy-menu-define py-menu map "Python Tools" + ;; `("PyTools" + (easy-menu-define + py-shell-menu py-python-shell-mode-map "Py-Shell Mode menu" + `("Py-Shell" + ("Edit" + ("Shift" + ("Shift right" + ["Shift block right" py-shift-block-right + :help " `py-shift-block-right' +Indent block by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift block or clause right" py-shift-block-or-clause-right + :help " `py-shift-block-or-clause-right' +Indent block-or-clause by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift class right" py-shift-class-right + :help " `py-shift-class-right' +Indent class by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift clause right" py-shift-clause-right + :help " `py-shift-clause-right' +Indent clause by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift comment right" py-shift-comment-right + :help " `py-shift-comment-right'"] + + ["Shift def right" py-shift-def-right + :help " `py-shift-def-right' +Indent def by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift def or class right" py-shift-def-or-class-right + :help " `py-shift-def-or-class-right' +Indent def-or-class by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift minor block right" py-shift-minor-block-right + :help " `py-shift-minor-block-right' +Indent minor-block by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached. +A minor block is started by a `for', `if', `try' or `with'."] + + ["Shift paragraph right" py-shift-paragraph-right + :help " `py-shift-paragraph-right' +Indent paragraph by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift region right" py-shift-region-right + :help " `py-shift-region-right' +Indent region according to `py-indent-offset' by COUNT times. + +If no region is active, current line is indented. +Returns indentation reached."] + + ["Shift statement right" py-shift-statement-right + :help " `py-shift-statement-right' +Indent statement by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift top level right" py-shift-top-level-right + :help " `py-shift-top-level-right'"] + ) + ("Shift left" + ["Shift block left" py-shift-block-left + :help " `py-shift-block-left' +Dedent block by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift block or clause left" py-shift-block-or-clause-left + :help " `py-shift-block-or-clause-left' +Dedent block-or-clause by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift class left" py-shift-class-left + :help " `py-shift-class-left' +Dedent class by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift clause left" py-shift-clause-left + :help " `py-shift-clause-left' +Dedent clause by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift comment left" py-shift-comment-left + :help " `py-shift-comment-left'"] + + ["Shift def left" py-shift-def-left + :help " `py-shift-def-left' +Dedent def by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift def or class left" py-shift-def-or-class-left + :help " `py-shift-def-or-class-left' +Dedent def-or-class by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift minor block left" py-shift-minor-block-left + :help " `py-shift-minor-block-left' +Dedent minor-block by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached. +A minor block is started by a `for', `if', `try' or `with'."] + + ["Shift paragraph left" py-shift-paragraph-left + :help " `py-shift-paragraph-left' +Dedent paragraph by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + + ["Shift region left" py-shift-region-left + :help " `py-shift-region-left' +Dedent region according to `py-indent-offset' by COUNT times. + +If no region is active, current line is dedented. +Returns indentation reached."] + + ["Shift statement left" py-shift-statement-left + :help " `py-shift-statement-left' +Dedent statement by COUNT spaces. + +COUNT defaults to `py-indent-offset', +use [universal-argument] to specify a different value. + +Returns outmost indentation reached."] + )) + ("Mark" + ["Mark block" py-mark-block + :help " `py-mark-block' +Mark block at point. + +Returns beginning and end positions of marked area, a cons."] + + ["Mark block or clause" py-mark-block-or-clause + :help " `py-mark-block-or-clause' +Mark block-or-clause at point. + +Returns beginning and end positions of marked area, a cons."] + + ["Mark class" py-mark-class + :help " `py-mark-class' +Mark class at point. + +With C-u or `py-mark-decorators' set to `t', decorators are marked too. +Returns beginning and end positions of marked area, a cons."] + + ["Mark clause" py-mark-clause + :help " `py-mark-clause' +Mark clause at point. + +Returns beginning and end positions of marked area, a cons."] + + ["Mark comment" py-mark-comment + :help " `py-mark-comment' +Mark comment at point. + +Returns beginning and end positions of marked area, a cons."] + + ["Mark def" py-mark-def + :help " `py-mark-def' +Mark def at point. + +With C-u or `py-mark-decorators' set to `t', decorators are marked too. +Returns beginning and end positions of marked area, a cons."] + + ["Mark def or class" py-mark-def-or-class + :help " `py-mark-def-or-class' +Mark def-or-class at point. + +With C-u or `py-mark-decorators' set to `t', decorators are marked too. +Returns beginning and end positions of marked area, a cons."] + + ["Mark expression" py-mark-expression + :help " `py-mark-expression' +Mark expression at point. + +Returns beginning and end positions of marked area, a cons."] + + ["Mark line" py-mark-line + :help " `py-mark-line' +Mark line at point. + +Returns beginning and end positions of marked area, a cons."] + + ["Mark minor block" py-mark-minor-block + :help " `py-mark-minor-block' +Mark minor-block at point. + +Returns beginning and end positions of marked area, a cons."] + + ["Mark paragraph" py-mark-paragraph + :help " `py-mark-paragraph' +Mark paragraph at point. + +Returns beginning and end positions of marked area, a cons."] + + ["Mark partial expression" py-mark-partial-expression + :help " `py-mark-partial-expression' +Mark partial-expression at point. + +Returns beginning and end positions of marked area, a cons."] + + ["Mark statement" py-mark-statement + :help " `py-mark-statement' +Mark statement at point. + +Returns beginning and end positions of marked area, a cons."] + + ["Mark top level" py-mark-top-level + :help " `py-mark-top-level' +Mark top-level at point. + +Returns beginning and end positions of marked area, a cons."] + ) + ("Copy" + ["Copy block" py-copy-block + :help " `py-copy-block' +Copy block at point. + +Store data in kill ring, so it might yanked back."] + + ["Copy block or clause" py-copy-block-or-clause + :help " `py-copy-block-or-clause' +Copy block-or-clause at point. + +Store data in kill ring, so it might yanked back."] + + ["Copy class" py-copy-class + :help " `py-copy-class' +Copy class at point. + +Store data in kill ring, so it might yanked back."] + + ["Copy clause" py-copy-clause + :help " `py-copy-clause' +Copy clause at point. + +Store data in kill ring, so it might yanked back."] + + ["Copy comment" py-copy-comment + :help " `py-copy-comment'"] + + ["Copy def" py-copy-def + :help " `py-copy-def' +Copy def at point. + +Store data in kill ring, so it might yanked back."] + + ["Copy def or class" py-copy-def-or-class + :help " `py-copy-def-or-class' +Copy def-or-class at point. + +Store data in kill ring, so it might yanked back."] + + ["Copy expression" py-copy-expression + :help " `py-copy-expression' +Copy expression at point. + +Store data in kill ring, so it might yanked back."] + + ["Copy line" py-copy-line + :help " `py-copy-line'"] + + ["Copy minor block" py-copy-minor-block + :help " `py-copy-minor-block' +Copy minor-block at point. + +Store data in kill ring, so it might yanked back."] + + ["Copy paragraph" py-copy-paragraph + :help " `py-copy-paragraph'"] + + ["Copy partial expression" py-copy-partial-expression + :help " `py-copy-partial-expression' +Copy partial-expression at point. + +Store data in kill ring, so it might yanked back."] + + ["Copy statement" py-copy-statement + :help " `py-copy-statement' +Copy statement at point. + +Store data in kill ring, so it might yanked back."] + + ["Copy top level" py-copy-top-level + :help " `py-copy-top-level' +Copy top-level at point. + +Store data in kill ring, so it might yanked back."] + ) + ("Kill" + ["Kill block" py-kill-block + :help " `py-kill-block' +Delete `block' at point. + +Stores data in kill ring"] + + ["Kill block or clause" py-kill-block-or-clause + :help " `py-kill-block-or-clause' +Delete `block-or-clause' at point. + +Stores data in kill ring"] + + ["Kill class" py-kill-class + :help " `py-kill-class' +Delete `class' at point. + +Stores data in kill ring"] + + ["Kill clause" py-kill-clause + :help " `py-kill-clause' +Delete `clause' at point. + +Stores data in kill ring"] + + ["Kill comment" py-kill-comment + :help " `py-kill-comment'"] + + ["Kill def" py-kill-def + :help " `py-kill-def' +Delete `def' at point. + +Stores data in kill ring"] + + ["Kill def or class" py-kill-def-or-class + :help " `py-kill-def-or-class' +Delete `def-or-class' at point. + +Stores data in kill ring"] + + ["Kill expression" py-kill-expression + :help " `py-kill-expression' +Delete `expression' at point. + +Stores data in kill ring"] + + ["Kill line" py-kill-line + :help " `py-kill-line'"] + + ["Kill minor block" py-kill-minor-block + :help " `py-kill-minor-block' +Delete `minor-block' at point. + +Stores data in kill ring"] + + ["Kill paragraph" py-kill-paragraph + :help " `py-kill-paragraph'"] + + ["Kill partial expression" py-kill-partial-expression + :help " `py-kill-partial-expression' +Delete `partial-expression' at point. + +Stores data in kill ring"] + + ["Kill statement" py-kill-statement + :help " `py-kill-statement' +Delete `statement' at point. + +Stores data in kill ring"] + + ["Kill top level" py-kill-top-level + :help " `py-kill-top-level' +Delete `top-level' at point. + +Stores data in kill ring"] + ) + ("Delete" + ["Delete block" py-delete-block + :help " `py-delete-block' +Delete BLOCK at point. + +Don't store data in kill ring."] + + ["Delete block or clause" py-delete-block-or-clause + :help " `py-delete-block-or-clause' +Delete BLOCK-OR-CLAUSE at point. + +Don't store data in kill ring."] + + ["Delete class" py-delete-class + :help " `py-delete-class' +Delete CLASS at point. + +Don't store data in kill ring. +With C-u or `py-mark-decorators' set to `t', `decorators' are included."] + + ["Delete clause" py-delete-clause + :help " `py-delete-clause' +Delete CLAUSE at point. + +Don't store data in kill ring."] + + ["Delete comment" py-delete-comment + :help " `py-delete-comment'"] + + ["Delete def" py-delete-def + :help " `py-delete-def' +Delete DEF at point. + +Don't store data in kill ring. +With C-u or `py-mark-decorators' set to `t', `decorators' are included."] + + ["Delete def or class" py-delete-def-or-class + :help " `py-delete-def-or-class' +Delete DEF-OR-CLASS at point. + +Don't store data in kill ring. +With C-u or `py-mark-decorators' set to `t', `decorators' are included."] + + ["Delete expression" py-delete-expression + :help " `py-delete-expression' +Delete EXPRESSION at point. + +Don't store data in kill ring."] + + ["Delete line" py-delete-line + :help " `py-delete-line'"] + + ["Delete minor block" py-delete-minor-block + :help " `py-delete-minor-block' +Delete MINOR-BLOCK at point. + +Don't store data in kill ring."] + + ["Delete paragraph" py-delete-paragraph + :help " `py-delete-paragraph'"] + + ["Delete partial expression" py-delete-partial-expression + :help " `py-delete-partial-expression' +Delete PARTIAL-EXPRESSION at point. + +Don't store data in kill ring."] + + ["Delete statement" py-delete-statement + :help " `py-delete-statement' +Delete STATEMENT at point. + +Don't store data in kill ring."] + + ["Delete top level" py-delete-top-level + :help " `py-delete-top-level' +Delete TOP-LEVEL at point. + +Don't store data in kill ring."] + ) + ("Comment" + ["Comment block" py-comment-block + :help " `py-comment-block' +Comments block at point. + +Uses double hash (`#') comment starter when `py-block-comment-prefix-p' is `t', +the default"] + + ["Comment block or clause" py-comment-block-or-clause + :help " `py-comment-block-or-clause' +Comments block-or-clause at point. + +Uses double hash (`#') comment starter when `py-block-comment-prefix-p' is `t', +the default"] + + ["Comment class" py-comment-class + :help " `py-comment-class' +Comments class at point. + +Uses double hash (`#') comment starter when `py-block-comment-prefix-p' is `t', +the default"] + + ["Comment clause" py-comment-clause + :help " `py-comment-clause' +Comments clause at point. + +Uses double hash (`#') comment starter when `py-block-comment-prefix-p' is `t', +the default"] + + ["Comment def" py-comment-def + :help " `py-comment-def' +Comments def at point. + +Uses double hash (`#') comment starter when `py-block-comment-prefix-p' is `t', +the default"] + + ["Comment def or class" py-comment-def-or-class + :help " `py-comment-def-or-class' +Comments def-or-class at point. + +Uses double hash (`#') comment starter when `py-block-comment-prefix-p' is `t', +the default"] + + ["Comment statement" py-comment-statement + :help " `py-comment-statement' +Comments statement at point. + +Uses double hash (`#') comment starter when `py-block-comment-prefix-p' is `t', +the default"] + )) + ("Move" + ("Backward" + ["Beginning of block" py-beginning-of-block + :help " `py-beginning-of-block' +Go to beginning block, skip whitespace at BOL. + +Returns beginning of block if successful, nil otherwise"] + + ["Beginning of block or clause" py-beginning-of-block-or-clause + :help " `py-beginning-of-block-or-clause' +Go to beginning block-or-clause, skip whitespace at BOL. + +Returns beginning of block-or-clause if successful, nil otherwise"] + + ["Beginning of class" py-beginning-of-class + :help " `py-beginning-of-class' +Go to beginning class, skip whitespace at BOL. + +Returns beginning of class if successful, nil otherwise + +When `py-mark-decorators' is non-nil, decorators are considered too."] + + ["Beginning of clause" py-beginning-of-clause + :help " `py-beginning-of-clause' +Go to beginning clause, skip whitespace at BOL. + +Returns beginning of clause if successful, nil otherwise"] + + ["Beginning of def" py-beginning-of-def + :help " `py-beginning-of-def' +Go to beginning def, skip whitespace at BOL. + +Returns beginning of def if successful, nil otherwise + +When `py-mark-decorators' is non-nil, decorators are considered too."] + + ["Beginning of def or class" py-beginning-of-def-or-class + :help " `py-beginning-of-def-or-class' +Go to beginning def-or-class, skip whitespace at BOL. + +Returns beginning of def-or-class if successful, nil otherwise + +When `py-mark-decorators' is non-nil, decorators are considered too."] + + ["Beginning of elif block" py-beginning-of-elif-block + :help " `py-beginning-of-elif-block' +Go to beginning elif-block, skip whitespace at BOL. + +Returns beginning of elif-block if successful, nil otherwise"] + + ["Beginning of else block" py-beginning-of-else-block + :help " `py-beginning-of-else-block' +Go to beginning else-block, skip whitespace at BOL. + +Returns beginning of else-block if successful, nil otherwise"] + + ["Beginning of except block" py-beginning-of-except-block + :help " `py-beginning-of-except-block' +Go to beginning except-block, skip whitespace at BOL. + +Returns beginning of except-block if successful, nil otherwise"] + + ["Beginning of expression" py-beginning-of-expression + :help " `py-beginning-of-expression' +Go to the beginning of a compound python expression. + +With numeric ARG do it that many times. + +A a compound python expression might be concatenated by \".\" operator, thus composed by minor python expressions. + +If already at the beginning or before a expression, go to next expression in buffer upwards + +Expression here is conceived as the syntactical component of a statement in Python. See http://docs.python.org/reference +Operators however are left aside resp. limit py-expression designed for edit-purposes."] + + ["Beginning of if block" py-beginning-of-if-block + :help " `py-beginning-of-if-block' +Go to beginning if-block, skip whitespace at BOL. + +Returns beginning of if-block if successful, nil otherwise"] + + ["Beginning of partial expression" py-beginning-of-partial-expression + :help " `py-beginning-of-partial-expression'"] + + ["Beginning of statement" py-beginning-of-statement + :help " `py-beginning-of-statement' +Go to the initial line of a simple statement. + +For beginning of compound statement use py-beginning-of-block. +For beginning of clause py-beginning-of-clause."] + + ["Beginning of top level" py-beginning-of-top-level + :help " `py-beginning-of-top-level' +Go up to beginning of statments until level of indentation is null. + +Returns position if successful, nil otherwise"] + + ["Beginning of try block" py-beginning-of-try-block + :help " `py-beginning-of-try-block' +Go to beginning try-block, skip whitespace at BOL. + +Returns beginning of try-block if successful, nil otherwise"] + ) + ("Forward" + ["End of block" py-end-of-block + :help " `py-end-of-block' +Go to end of block. + +Returns end of block if successful, nil otherwise"] + + ["End of block or clause" py-end-of-block-or-clause + :help " `py-end-of-block-or-clause' +Go to end of block-or-clause. + +Returns end of block-or-clause if successful, nil otherwise"] + + ["End of class" py-end-of-class + :help " `py-end-of-class' +Go to end of class. + +Returns end of class if successful, nil otherwise"] + + ["End of clause" py-end-of-clause + :help " `py-end-of-clause' +Go to end of clause. + +Returns end of clause if successful, nil otherwise"] + + ["End of def" py-end-of-def + :help " `py-end-of-def' +Go to end of def. + +Returns end of def if successful, nil otherwise"] + + ["End of def or class" py-end-of-def-or-class + :help " `py-end-of-def-or-class' +Go to end of def-or-class. + +Returns end of def-or-class if successful, nil otherwise"] + + ["End of elif block" py-end-of-elif-block + :help " `py-end-of-elif-block' +Go to end of elif-block. + +Returns end of elif-block if successful, nil otherwise"] + + ["End of else block" py-end-of-else-block + :help " `py-end-of-else-block' +Go to end of else-block. + +Returns end of else-block if successful, nil otherwise"] + + ["End of except block" py-end-of-except-block + :help " `py-end-of-except-block' +Go to end of except-block. + +Returns end of except-block if successful, nil otherwise"] + + ["End of expression" py-end-of-expression + :help " `py-end-of-expression' +Go to the end of a compound python expression. + +With numeric ARG do it that many times. + +A a compound python expression might be concatenated by \".\" operator, thus composed by minor python expressions. + +Expression here is conceived as the syntactical component of a statement in Python. See http://docs.python.org/reference + +Operators however are left aside resp. limit py-expression designed for edit-purposes."] + + ["End of if block" py-end-of-if-block + :help " `py-end-of-if-block' +Go to end of if-block. + +Returns end of if-block if successful, nil otherwise"] + + ["End of partial expression" py-end-of-partial-expression + :help " `py-end-of-partial-expression'"] + + ["End of statement" py-end-of-statement + :help " `py-end-of-statement' +Go to the last char of current statement. + +Optional argument REPEAT, the number of loops done already, is checked for py-max-specpdl-size error. Avoid eternal loops due to missing string delimters etc."] + + ["End of top level" py-end-of-top-level + :help " `py-end-of-top-level' +Go to end of top-level form at point. + +Returns position if successful, nil otherwise"] + + ["End of try block" py-end-of-try-block + :help " `py-end-of-try-block' +Go to end of try-block. + +Returns end of try-block if successful, nil otherwise"] + ) + ("BOL-forms" + ("Backward" + ["Beginning of block bol" py-beginning-of-block-bol + :help " `py-beginning-of-block-bol' +Go to beginning block, go to BOL. + +Returns beginning of block if successful, nil otherwise"] + + ["Beginning of block or clause bol" py-beginning-of-block-or-clause-bol + :help " `py-beginning-of-block-or-clause-bol' +Go to beginning block-or-clause, go to BOL. + +Returns beginning of block-or-clause if successful, nil otherwise"] + + ["Beginning of class bol" py-beginning-of-class-bol + :help " `py-beginning-of-class-bol' +Go to beginning class, go to BOL. + +Returns beginning of class if successful, nil otherwise + +When `py-mark-decorators' is non-nil, decorators are considered too."] + + ["Beginning of clause bol" py-beginning-of-clause-bol + :help " `py-beginning-of-clause-bol' +Go to beginning clause, go to BOL. + +Returns beginning of clause if successful, nil otherwise"] + + ["Beginning of def bol" py-beginning-of-def-bol + :help " `py-beginning-of-def-bol' +Go to beginning def, go to BOL. + +Returns beginning of def if successful, nil otherwise + +When `py-mark-decorators' is non-nil, decorators are considered too."] + + ["Beginning of def or class bol" py-beginning-of-def-or-class-bol + :help " `py-beginning-of-def-or-class-bol' +Go to beginning def-or-class, go to BOL. + +Returns beginning of def-or-class if successful, nil otherwise + +When `py-mark-decorators' is non-nil, decorators are considered too."] + + ["Beginning of elif block bol" py-beginning-of-elif-block-bol + :help " `py-beginning-of-elif-block-bol' +Go to beginning elif-block, go to BOL. + +Returns beginning of elif-block if successful, nil otherwise"] + + ["Beginning of else block bol" py-beginning-of-else-block-bol + :help " `py-beginning-of-else-block-bol' +Go to beginning else-block, go to BOL. + +Returns beginning of else-block if successful, nil otherwise"] + + ["Beginning of except block bol" py-beginning-of-except-block-bol + :help " `py-beginning-of-except-block-bol' +Go to beginning except-block, go to BOL. + +Returns beginning of except-block if successful, nil otherwise"] + + ["Beginning of expression bol" py-beginning-of-expression-bol + :help " `py-beginning-of-expression-bol'"] + + ["Beginning of if block bol" py-beginning-of-if-block-bol + :help " `py-beginning-of-if-block-bol' +Go to beginning if-block, go to BOL. + +Returns beginning of if-block if successful, nil otherwise"] + + ["Beginning of partial expression bol" py-beginning-of-partial-expression-bol + :help " `py-beginning-of-partial-expression-bol'"] + + ["Beginning of statement bol" py-beginning-of-statement-bol + :help " `py-beginning-of-statement-bol' +Goto beginning of line where statement starts. + Returns position reached, if successful, nil otherwise. + +See also `py-up-statement': up from current definition to next beginning of statement above."] + + ["Beginning of try block bol" py-beginning-of-try-block-bol + :help " `py-beginning-of-try-block-bol' +Go to beginning try-block, go to BOL. + +Returns beginning of try-block if successful, nil otherwise"] + ) + ("Forward" + ["End of block bol" py-end-of-block-bol + :help " `py-end-of-block-bol' +Goto beginning of line following end of block. + Returns position reached, if successful, nil otherwise. + +See also `py-down-block': down from current definition to next beginning of block below."] + + ["End of block or clause bol" py-end-of-block-or-clause-bol + :help " `py-end-of-block-or-clause-bol' +Goto beginning of line following end of block-or-clause. + Returns position reached, if successful, nil otherwise. + +See also `py-down-block-or-clause': down from current definition to next beginning of block-or-clause below."] + + ["End of class bol" py-end-of-class-bol + :help " `py-end-of-class-bol' +Goto beginning of line following end of class. + Returns position reached, if successful, nil otherwise. + +See also `py-down-class': down from current definition to next beginning of class below."] + + ["End of clause bol" py-end-of-clause-bol + :help " `py-end-of-clause-bol' +Goto beginning of line following end of clause. + Returns position reached, if successful, nil otherwise. + +See also `py-down-clause': down from current definition to next beginning of clause below."] + + ["End of def bol" py-end-of-def-bol + :help " `py-end-of-def-bol' +Goto beginning of line following end of def. + Returns position reached, if successful, nil otherwise. + +See also `py-down-def': down from current definition to next beginning of def below."] + + ["End of def or class bol" py-end-of-def-or-class-bol + :help " `py-end-of-def-or-class-bol' +Goto beginning of line following end of def-or-class. + Returns position reached, if successful, nil otherwise. + +See also `py-down-def-or-class': down from current definition to next beginning of def-or-class below."] + + ["End of elif block bol" py-end-of-elif-block-bol + :help " `py-end-of-elif-block-bol' +Goto beginning of line following end of elif-block. + Returns position reached, if successful, nil otherwise. + +See also `py-down-elif-block': down from current definition to next beginning of elif-block below."] + + ["End of else block bol" py-end-of-else-block-bol + :help " `py-end-of-else-block-bol' +Goto beginning of line following end of else-block. + Returns position reached, if successful, nil otherwise. + +See also `py-down-else-block': down from current definition to next beginning of else-block below."] + + ["End of except block bol" py-end-of-except-block-bol + :help " `py-end-of-except-block-bol' +Goto beginning of line following end of except-block. + Returns position reached, if successful, nil otherwise. + +See also `py-down-except-block': down from current definition to next beginning of except-block below."] + + ["End of expression bol" py-end-of-expression-bol + :help " `py-end-of-expression-bol'"] + + ["End of if block bol" py-end-of-if-block-bol + :help " `py-end-of-if-block-bol' +Goto beginning of line following end of if-block. + Returns position reached, if successful, nil otherwise. + +See also `py-down-if-block': down from current definition to next beginning of if-block below."] + + ["End of partial expression bol" py-end-of-partial-expression-bol + :help " `py-end-of-partial-expression-bol'"] + + ["End of statement bol" py-end-of-statement-bol + :help " `py-end-of-statement-bol' +Go to the beginning-of-line following current statement."] + + ["End of top level bol" py-end-of-top-level-bol + :help " `py-end-of-top-level-bol' +Go to end of top-level form at point, stop at next beginning-of-line. + +Returns position successful, nil otherwise"] + + ["End of try block bol" py-end-of-try-block-bol + :help " `py-end-of-try-block-bol' +Goto beginning of line following end of try-block. + Returns position reached, if successful, nil otherwise. + +See also `py-down-try-block': down from current definition to next beginning of try-block below."] + )) + ("Up/Down" + ["Up" py-up + :help " `py-up' +Go up or to beginning of form if inside. + +If inside a delimited form --string or list-- go to its beginning. +If not at beginning of a statement or block, go to its beginning. +If at beginning of a statement or block, go to beginning one level above of compound statement or definition at point."] + + ["Down" py-down + :help " `py-down' +Go to beginning one level below of compound statement or definition at point. + +If no statement or block below, but a delimited form --string or list-- go to its beginning. Repeated call from there will behave like down-list. + +Returns position if successful, nil otherwise"] + )) + ("Hide-Show" + ("Hide" + ["Hide region" py-hide-region + :help " `py-hide-region' +Hide active region."] + + ["Hide statement" py-hide-statement + :help " `py-hide-statement' +Hide statement at point."] + + ["Hide block" py-hide-block + :help " `py-hide-block' +Hide block at point."] + + ["Hide clause" py-hide-clause + :help " `py-hide-clause' +Hide clause at point."] + + ["Hide block or clause" py-hide-block-or-clause + :help " `py-hide-block-or-clause' +Hide block-or-clause at point."] + + ["Hide def" py-hide-def + :help " `py-hide-def' +Hide def at point."] + + ["Hide class" py-hide-class + :help " `py-hide-class' +Hide class at point."] + + ["Hide expression" py-hide-expression + :help " `py-hide-expression' +Hide expression at point."] + + ["Hide partial expression" py-hide-partial-expression + :help " `py-hide-partial-expression' +Hide partial-expression at point."] + + ["Hide line" py-hide-line + :help " `py-hide-line' +Hide line at point."] + + ["Hide top level" py-hide-top-level + :help " `py-hide-top-level' +Hide top-level at point."] + ) + ("Show" + ["Show region" py-show-region + :help " `py-show-region' +Un-hide active region."] + + ["Show statement" py-show-statement + :help " `py-show-statement' +Show statement at point."] + + ["Show block" py-show-block + :help " `py-show-block' +Show block at point."] + + ["Show clause" py-show-clause + :help " `py-show-clause' +Show clause at point."] + + ["Show block or clause" py-show-block-or-clause + :help " `py-show-block-or-clause' +Show block-or-clause at point."] + + ["Show def" py-show-def + :help " `py-show-def' +Show def at point."] + + ["Show class" py-show-class + :help " `py-show-class' +Show class at point."] + + ["Show expression" py-show-expression + :help " `py-show-expression' +Show expression at point."] + + ["Show partial expression" py-show-partial-expression + :help " `py-show-partial-expression' +Show partial-expression at point."] + + ["Show line" py-show-line + :help " `py-show-line' +Show line at point."] + + ["Show top level" py-show-top-level + :help " `py-show-top-level' +Show top-level at point."] + )) + ("Virtualenv" + ["Virtualenv activate" virtualenv-activate + :help " `virtualenv-activate' +Activate the virtualenv located in DIR"] + + ["Virtualenv deactivate" virtualenv-deactivate + :help " `virtualenv-deactivate' +Deactivate the current virtual enviroment"] + + ["Virtualenv p" virtualenv-p + :help " `virtualenv-p' +Check if a directory is a virtualenv"] + + ["Virtualenv workon" virtualenv-workon + :help " `virtualenv-workon' +Issue a virtualenvwrapper-like virtualenv-workon command"] + ) + ("Help" + ["Find definition" py-find-definition + :help " `py-find-definition' +Find source of definition of SYMBOL. + +Interactively, prompt for SYMBOL."] + + ["Help at point" py-help-at-point + :help " `py-help-at-point' +Print help on symbol at point. + +If symbol is defined in current buffer, jump to it's definition +Optional C-u used for debugging, will prevent deletion of temp file."] + + ["Info lookup symbol" py-info-lookup-symbol + :help " `py-info-lookup-symbol'"] + + ["Symbol at point" py-symbol-at-point + :help " `py-symbol-at-point' +Return the current Python symbol."] + ) + ("Customize" + + ["Python-mode customize group" (customize-group 'python-mode) + :help "Open the customization buffer for Python mode"] + ("Switches" + :help "Toggle useful modes" + ("Interpreter" + + ["Shell prompt read only" + (setq py-shell-prompt-read-only + (not py-shell-prompt-read-only)) + :help "If non-nil, the python prompt is read only. Setting this variable will only effect new shells.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-shell-prompt-read-only] + + ["Remove cwd from path" + (setq py-remove-cwd-from-path + (not py-remove-cwd-from-path)) + :help "Whether to allow loading of Python modules from the current directory. +If this is non-nil, Emacs removes '' from sys.path when starting +a Python process. This is the default, for security +reasons, as it is easy for the Python process to be started +without the user's realization (e.g. to perform completion).Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-remove-cwd-from-path] + + ["Honor IPYTHONDIR " + (setq py-honor-IPYTHONDIR-p + (not py-honor-IPYTHONDIR-p)) + :help "When non-nil ipython-history file is constructed by \$IPYTHONDIR +followed by "/history". Default is nil. + +Otherwise value of py-ipython-history is used. Use `M-x customize-variable' to set it permanently" +:style toggle :selected py-honor-IPYTHONDIR-p] + + ["Honor PYTHONHISTORY " + (setq py-honor-PYTHONHISTORY-p + (not py-honor-PYTHONHISTORY-p)) + :help "When non-nil python-history file is set by \$PYTHONHISTORY +Default is nil. + +Otherwise value of py-python-history is used. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-honor-PYTHONHISTORY-p] + + ["Enforce py-shell-name" force-py-shell-name-p-on + :help "Enforce customized default `py-shell-name' should upon execution. "] + + ["Don't enforce default interpreter" force-py-shell-name-p-off + :help "Make execute commands guess interpreter from environment"] + + ["Enforce local Python shell " py-force-local-shell-on + :help "Locally indicated Python being enforced upon sessions execute commands. "] + + ["Remove local Python shell enforcement, restore default" py-force-local-shell-off + :help "Restore `py-shell-name' default value and `behaviour'. "]) + + ("Execute" + + ["Fast process" py-fast-process-p + :help " `py-fast-process-p' + +Use `py-fast-process'\. + +Commands prefixed \"py-fast-...\" suitable for large output + +See: large output makes Emacs freeze, lp:1253907 + +Output-buffer is not in comint-mode" + :style toggle :selected py-fast-process-p] + + ["Python mode v5 behavior" + (setq python-mode-v5-behavior-p + (not python-mode-v5-behavior-p)) + :help "Execute region through `shell-command-on-region' as +v5 did it - lp:990079. This might fail with certain chars - see UnicodeEncodeError lp:550661 + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected python-mode-v5-behavior-p] + + ["Force shell name " + (setq py-force-py-shell-name-p + (not py-force-py-shell-name-p)) + :help "When `t', execution with kind of Python specified in `py-shell-name' is enforced, possibly shebang doesn't take precedence. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-force-py-shell-name-p] + + ["Execute \"if name == main\" blocks p" + (setq py-if-name-main-permission-p + (not py-if-name-main-permission-p)) + :help " `py-if-name-main-permission-p' + +Allow execution of code inside blocks delimited by +if __name__ == '__main__' + +Default is non-nil. " + :style toggle :selected py-if-name-main-permission-p] + + ["Ask about save" + (setq py-ask-about-save + (not py-ask-about-save)) + :help "If not nil, ask about which buffers to save before executing some code. +Otherwise, all modified buffers are saved without asking.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-ask-about-save] + + ["Store result" + (setq py-store-result-p + (not py-store-result-p)) + :help " `py-store-result-p' + +When non-nil, put resulting string of `py-execute-...' into kill-ring, so it might be yanked. " + :style toggle :selected py-store-result-p] + + ["Prompt on changed " + (setq py-prompt-on-changed-p + (not py-prompt-on-changed-p)) + :help "When called interactively, ask for save before a changed buffer is sent to interpreter. + +Default is `t'Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-prompt-on-changed-p] + + ["Dedicated process " + (setq py-dedicated-process-p + (not py-dedicated-process-p)) + :help "If commands executing code use a dedicated shell. + +Default is nilUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-dedicated-process-p] + + ["Execute without temporary file" + (setq py-execute-no-temp-p + (not py-execute-no-temp-p)) + :help " `py-execute-no-temp-p' +Seems Emacs-24.3 provided a way executing stuff without temporary files. +In experimental state yet " + :style toggle :selected py-execute-no-temp-p] + + ["Warn tmp files left " + (setq py--warn-tmp-files-left-p + (not py--warn-tmp-files-left-p)) + :help "Messages a warning, when `py-temp-directory' contains files susceptible being left by previous Python-mode sessions. See also lp:987534 Use `M-x customize-variable' to set it permanently" + :style toggle :selected py--warn-tmp-files-left-p]) + + ("Edit" + + ("Completion" + + ["Set Pymacs-based complete keymap " + (setq py-set-complete-keymap-p + (not py-set-complete-keymap-p)) + :help "If `py-complete-initialize', which sets up enviroment for Pymacs based py-complete, should load it's keys into `python-mode-map' + +Default is nil. +See also resp. edit `py-complete-set-keymap' Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-set-complete-keymap-p] + + ["Indent no completion " + (setq py-indent-no-completion-p + (not py-indent-no-completion-p)) + :help "If completion function should indent when no completion found. Default is `t' + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-indent-no-completion-p] + + ["Company pycomplete " + (setq py-company-pycomplete-p + (not py-company-pycomplete-p)) + :help "Load company-pycomplete stuff. Default is nilUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-company-pycomplete-p]) + + ("Filling" + + ("Docstring styles" + :help "Switch docstring-style" + + ["Nil" py-set-nil-docstring-style + :help " `py-set-nil-docstring-style' + +Set py-docstring-style to nil, format string normally. "] + + ["pep-257-nn" py-set-pep-257-nn-docstring-style + :help " `py-set-pep-257-nn-docstring-style' + +Set py-docstring-style to 'pep-257-nn "] + + ["pep-257" py-set-pep-257-docstring-style + :help " `py-set-pep-257-docstring-style' + +Set py-docstring-style to 'pep-257 "] + + ["django" py-set-django-docstring-style + :help " `py-set-django-docstring-style' + +Set py-docstring-style to 'django "] + + ["onetwo" py-set-onetwo-docstring-style + :help " `py-set-onetwo-docstring-style' + +Set py-docstring-style to 'onetwo "] + + ["symmetric" py-set-symmetric-docstring-style + :help " `py-set-symmetric-docstring-style' + +Set py-docstring-style to 'symmetric "]) + + ["Auto-fill mode" + (setq py-auto-fill-mode + (not py-auto-fill-mode)) + :help "Fill according to `py-docstring-fill-column' and `py-comment-fill-column' + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-auto-fill-mode]) + + ["Use current dir when execute" + (setq py-use-current-dir-when-execute-p + (not py-use-current-dir-when-execute-p)) + :help " `toggle-py-use-current-dir-when-execute-p' + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-use-current-dir-when-execute-p] + + ("Indent" + ("TAB related" + + ["indent-tabs-mode" + (setq indent-tabs-mode + (not indent-tabs-mode)) + :help "Indentation can insert tabs if this is non-nil. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected indent-tabs-mode] + + ["Tab indent" + (setq py-tab-indent + (not py-tab-indent)) + :help "Non-nil means TAB in Python mode calls `py-indent-line'.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-tab-indent] + + ["Tab shifts region " + (setq py-tab-shifts-region-p + (not py-tab-shifts-region-p)) + :help "If `t', TAB will indent/cycle the region, not just the current line. + +Default is nil +See also `py-tab-indents-region-p' + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-tab-shifts-region-p] + + ["Tab indents region " + (setq py-tab-indents-region-p + (not py-tab-indents-region-p)) + :help "When `t' and first TAB doesn't shift, indent-region is called. + +Default is nil +See also `py-tab-shifts-region-p' + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-tab-indents-region-p]) + + ["Close at start column" + (setq py-closing-list-dedents-bos + (not py-closing-list-dedents-bos)) + :help "When non-nil, indent list's closing delimiter like start-column. + +It will be lined up under the first character of + the line that starts the multi-line construct, as in: + +my_list = \[ + 1, 2, 3, + 4, 5, 6, +] + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-closing-list-dedents-bos] + + ["Closing list keeps space" + (setq py-closing-list-keeps-space + (not py-closing-list-keeps-space)) + :help "If non-nil, closing parenthesis dedents onto column of opening plus `py-closing-list-space', default is nil Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-closing-list-keeps-space] + + ["Closing list space" + (setq py-closing-list-space + (not py-closing-list-space)) + :help "Number of chars, closing parenthesis outdent from opening, default is 1 Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-closing-list-space] + + ["Tab shifts region " + (setq py-tab-shifts-region-p + (not py-tab-shifts-region-p)) + :help "If `t', TAB will indent/cycle the region, not just the current line. + +Default is nil +See also `py-tab-indents-region-p'Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-tab-shifts-region-p] + + ["Lhs inbound indent" + (setq py-lhs-inbound-indent + (not py-lhs-inbound-indent)) + :help "When line starts a multiline-assignment: How many colums indent should be more than opening bracket, brace or parenthesis. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-lhs-inbound-indent] + + ["Continuation offset" + (setq py-continuation-offset + (not py-continuation-offset)) + :help "With numeric ARG different from 1 py-continuation-offset is set to that value; returns py-continuation-offset. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-continuation-offset] + + ["Electric colon" + (setq py-electric-colon-active-p + (not py-electric-colon-active-p)) + :help " `py-electric-colon-active-p' + +`py-electric-colon' feature. Default is `nil'. See lp:837065 for discussions. " + :style toggle :selected py-electric-colon-active-p] + + ["Electric colon at beginning of block only" + (setq py-electric-colon-bobl-only + (not py-electric-colon-bobl-only)) + :help "When inserting a colon, do not indent lines unless at beginning of block. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-electric-colon-bobl-only] + + ["Electric yank active " + (setq py-electric-yank-active-p + (not py-electric-yank-active-p)) + :help " When non-nil, `yank' will be followed by an `indent-according-to-mode'. + +Default is nilUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-electric-yank-active-p] + + ["Electric kill backward " + (setq py-electric-kill-backward-p + (not py-electric-kill-backward-p)) + :help "Affects `py-electric-backspace'. Default is nil. + +If behind a delimited form of braces, brackets or parentheses, +backspace will kill it's contents + +With when cursor after +my_string\[0:1] +--------------^ + +==> + +my_string\[] +----------^ + +In result cursor is insided emptied delimited form.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-electric-kill-backward-p] + + ["Trailing whitespace smart delete " + (setq py-trailing-whitespace-smart-delete-p + (not py-trailing-whitespace-smart-delete-p)) + :help "Default is nil. When t, python-mode calls + (add-hook 'before-save-hook 'delete-trailing-whitespace nil 'local) + +Also commands may delete trailing whitespace by the way. +When editing other peoples code, this may produce a larger diff than expected Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-trailing-whitespace-smart-delete-p] + + ["Newline delete trailing whitespace " + (setq py-newline-delete-trailing-whitespace-p + (not py-newline-delete-trailing-whitespace-p)) + :help "Delete trailing whitespace maybe left by `py-newline-and-indent'. + +Default is `t'. See lp:1100892 Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-newline-delete-trailing-whitespace-p] + + ["Dedent keep relative column" + (setq py-dedent-keep-relative-column + (not py-dedent-keep-relative-column)) + :help "If point should follow dedent or kind of electric move to end of line. Default is t - keep relative position. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-dedent-keep-relative-column] + + ["Indent paren spanned multilines " + (setq py-indent-paren-spanned-multilines-p + (not py-indent-paren-spanned-multilines-p)) + :help "If non-nil, indents elements of list a value of `py-indent-offset' to first element: + +def foo(): + if (foo && + baz): + bar() + +Default lines up with first element: + +def foo(): + if (foo && + baz): + bar() +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-indent-paren-spanned-multilines-p] + + ["Indent honors multiline listing" + (setq py-indent-honors-multiline-listing + (not py-indent-honors-multiline-listing)) + :help "If `t', indents to 1\+ column of opening delimiter. If `nil', indent adds one level to the beginning of statement. Default is `nil'. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-indent-honors-multiline-listing] + + ["Indent comment " + (setq py-indent-comments + (not py-indent-comments)) + :help "If comments should be indented like code. Default is `nil'. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-indent-comments] + + ["Uncomment indents " + (setq py-uncomment-indents-p + (not py-uncomment-indents-p)) + :help "When non-nil, after uncomment indent lines. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-uncomment-indents-p] + + ["Indent honors inline comment" + (setq py-indent-honors-inline-comment + (not py-indent-honors-inline-comment)) + :help "If non-nil, indents to column of inlined comment start. +Default is nil. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-indent-honors-inline-comment] + + ["Kill empty line" + (setq py-kill-empty-line + (not py-kill-empty-line)) + :help "If t, py-indent-forward-line kills empty lines. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-kill-empty-line] + + ("Smart indentation" + :help "Toggle py-smart-indentation' + +Use `M-x customize-variable' to set it permanently" + + ["Toggle py-smart-indentation" toggle-py-smart-indentation + :help "Toggles py-smart-indentation + +Use `M-x customize-variable' to set it permanently"] + + ["py-smart-indentation on" py-smart-indentation-on + :help "Switches py-smart-indentation on + +Use `M-x customize-variable' to set it permanently"] + + ["py-smart-indentation off" py-smart-indentation-off + :help "Switches py-smart-indentation off + +Use `M-x customize-variable' to set it permanently"]) + + ["Beep if tab change" + (setq py-beep-if-tab-change + (not py-beep-if-tab-change)) + :help "Ring the bell if `tab-width' is changed. +If a comment of the form + + # vi:set tabsize=: + +is found before the first code line when the file is entered, and the +current value of (the general Emacs variable) `tab-width' does not +equal , `tab-width' is set to , a message saying so is +displayed in the echo area, and if `py-beep-if-tab-change' is non-nil +the Emacs bell is also rung as a warning.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-beep-if-tab-change] + + ["Electric comment " + (setq py-electric-comment-p + (not py-electric-comment-p)) + :help "If \"#\" should call `py-electric-comment'. Default is `nil'. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-electric-comment-p] + + ["Electric comment add space " + (setq py-electric-comment-add-space-p + (not py-electric-comment-add-space-p)) + :help "If py-electric-comment should add a space. Default is `nil'. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-electric-comment-add-space-p] + + ["Empty line closes " + (setq py-empty-line-closes-p + (not py-empty-line-closes-p)) + :help "When non-nil, dedent after empty line following block + +if True: + print(\"Part of the if-statement\") + +print(\"Not part of the if-statement\") + +Default is nil + +If non-nil, a C-j from empty line dedents. +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-empty-line-closes-p]) + ["Defun use top level " + (setq py-defun-use-top-level-p + (not py-defun-use-top-level-p)) + :help "When non-nil, keys C-M-a, C-M-e address top-level form. + +Beginning- end-of-defun forms use +commands `py-beginning-of-top-level', `py-end-of-top-level' + +mark-defun marks top-level form at point etc. " + :style toggle :selected py-defun-use-top-level-p] + + ["Close provides newline" + (setq py-close-provides-newline + (not py-close-provides-newline)) + :help "If a newline is inserted, when line after block isn't empty. Default is non-nil. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-close-provides-newline] + + ["Block comment prefix " + (setq py-block-comment-prefix-p + (not py-block-comment-prefix-p)) + :help "If py-comment inserts py-block-comment-prefix. + +Default is tUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-block-comment-prefix-p]) + + ("Display" + + ("Index" + + ["Imenu create index " + (setq py--imenu-create-index-p + (not py--imenu-create-index-p)) + :help "Non-nil means Python mode creates and displays an index menu of functions and global variables. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py--imenu-create-index-p] + + ["Imenu show method args " + (setq py-imenu-show-method-args-p + (not py-imenu-show-method-args-p)) + :help "Controls echoing of arguments of functions & methods in the Imenu buffer. +When non-nil, arguments are printed.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-imenu-show-method-args-p] + ["Switch index-function" py-switch-imenu-index-function + :help "`py-switch-imenu-index-function' +Switch between `py--imenu-create-index' from 5.1 series and `py--imenu-create-index-new'."]) + + ("Fontification" + + ["Mark decorators" + (setq py-mark-decorators + (not py-mark-decorators)) + :help "If py-mark-def-or-class functions should mark decorators too. Default is `nil'. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-mark-decorators] + + ["Fontify shell buffer " + (setq py-fontify-shell-buffer-p + (not py-fontify-shell-buffer-p)) + :help "If code in Python shell should be highlighted as in script buffer. + +Default is nil. + +If `t', related vars like `comment-start' will be set too. +Seems convenient when playing with stuff in IPython shell +Might not be TRT when a lot of output arrives Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-fontify-shell-buffer-p] + + ["Use font lock doc face " + (setq py-use-font-lock-doc-face-p + (not py-use-font-lock-doc-face-p)) + :help "If documention string inside of def or class get `font-lock-doc-face'. + +`font-lock-doc-face' inherits `font-lock-string-face'. + +Call M-x `customize-face' in order to have a visible effect. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-use-font-lock-doc-face-p]) + + ["Switch buffers on execute" + (setq py-switch-buffers-on-execute-p + (not py-switch-buffers-on-execute-p)) + :help "When non-nil switch to the Python output buffer. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-switch-buffers-on-execute-p] + + ["Split windows on execute" + (setq py-split-window-on-execute + (not py-split-window-on-execute)) + :help "When non-nil split windows. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-split-window-on-execute] + + ["Keep windows configuration" + (setq py-keep-windows-configuration + (not py-keep-windows-configuration)) + :help "If a windows is splitted displaying results, this is directed by variable `py-split-window-on-execute'\. Also setting `py-switch-buffers-on-execute-p' affects window-configuration\. While commonly a screen splitted into source and Python-shell buffer is assumed, user may want to keep a different config\. + +Setting `py-keep-windows-configuration' to `t' will restore windows-config regardless of settings mentioned above\. However, if an error occurs, it's displayed\. + +To suppres window-changes due to error-signaling also: M-x customize-variable RET. Set `py-keep-4windows-configuration' onto 'force + +Default is nil Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-keep-windows-configuration] + + ["Which split windows on execute function" + (progn + (if (eq 'split-window-vertically py-split-windows-on-execute-function) + (setq py-split-windows-on-execute-function'split-window-horizontally) + (setq py-split-windows-on-execute-function 'split-window-vertically)) + (message "py-split-windows-on-execute-function set to: %s" py-split-windows-on-execute-function)) + + :help "If `split-window-vertically' or `...-horizontally'. Use `M-x customize-variable' RET `py-split-windows-on-execute-function' RET to set it permanently" + :style toggle :selected py-split-windows-on-execute-function] + + ["Modeline display full path " + (setq py-modeline-display-full-path-p + (not py-modeline-display-full-path-p)) + :help "If the full PATH/TO/PYTHON should be displayed in shell modeline. + +Default is nil. Note: when `py-shell-name' is specified with path, it's shown as an acronym in buffer-name already. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-modeline-display-full-path-p] + + ["Modeline acronym display home " + (setq py-modeline-acronym-display-home-p + (not py-modeline-acronym-display-home-p)) + :help "If the modeline acronym should contain chars indicating the home-directory. + +Default is nil Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-modeline-acronym-display-home-p] + + ["Hide show hide docstrings" + (setq py-hide-show-hide-docstrings + (not py-hide-show-hide-docstrings)) + :help "Controls if doc strings can be hidden by hide-showUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-hide-show-hide-docstrings] + + ["Hide comments when hiding all" + (setq py-hide-comments-when-hiding-all + (not py-hide-comments-when-hiding-all)) + :help "Hide the comments too when you do `hs-hide-all'. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-hide-comments-when-hiding-all] + + ["Max help buffer " + (setq py-max-help-buffer-p + (not py-max-help-buffer-p)) + :help "If \"\*Python-Help\*\"-buffer should appear as the only visible. + +Default is nil. In help-buffer, \"q\" will close it. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-max-help-buffer-p] + + ["Current defun show" + (setq py-current-defun-show + (not py-current-defun-show)) + :help "If `py-current-defun' should jump to the definition, highlight it while waiting PY-WHICH-FUNC-DELAY seconds, before returning to previous position. + +Default is `t'.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-current-defun-show] + + ["Match paren mode" + (setq py-match-paren-mode + (not py-match-paren-mode)) + :help "Non-nil means, cursor will jump to beginning or end of a block. +This vice versa, to beginning first. +Sets `py-match-paren-key' in python-mode-map. +Customize `py-match-paren-key' which key to use. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-match-paren-mode]) + + ("Debug" + + ["py-debug-p" + (setq py-debug-p + (not py-debug-p)) + :help "When non-nil, keep resp\. store information useful for debugging\. + +Temporary files are not deleted\. Other functions might implement +some logging etc\. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-debug-p] + + ["Pdbtrack do tracking " + (setq py-pdbtrack-do-tracking-p + (not py-pdbtrack-do-tracking-p)) + :help "Controls whether the pdbtrack feature is enabled or not. +When non-nil, pdbtrack is enabled in all comint-based buffers, +e.g. shell buffers and the \*Python\* buffer. When using pdb to debug a +Python program, pdbtrack notices the pdb prompt and displays the +source file and line that the program is stopped at, much the same way +as gud-mode does for debugging C programs with gdb.Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-pdbtrack-do-tracking-p] + + ["Jump on exception" + (setq py-jump-on-exception + (not py-jump-on-exception)) + :help "Jump to innermost exception frame in Python output buffer. +When this variable is non-nil and an exception occurs when running +Python code synchronously in a subprocess, jump immediately to the +source code of the innermost traceback frame. + +Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-jump-on-exception] + + ["Highlight error in source " + (setq py-highlight-error-source-p + (not py-highlight-error-source-p)) + :help "Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-highlight-error-source-p]) + + ("Other" + + ("Directory" + + ["Guess install directory " + (setq py-guess-py-install-directory-p + (not py-guess-py-install-directory-p)) + :help "If in cases, `py-install-directory' isn't set, `py-set-load-path'should guess it from `buffer-file-name'. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-guess-py-install-directory-p] + + ["Use local default" + (setq py-use-local-default + (not py-use-local-default)) + :help "If `t', py-shell will use `py-shell-local-path' instead +of default Python. + +Making switch between several virtualenv's easier, + `python-mode' should deliver an installer, so named-shells pointing to virtualenv's will be available. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-use-local-default] + + ["Use current dir when execute " + (setq py-use-current-dir-when-execute-p + (not py-use-current-dir-when-execute-p)) + :help "When `t', current directory is used by Python-shell for output of `py-execute-buffer' and related commands. + +See also `py-execute-directory'Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-use-current-dir-when-execute-p] + + ["Keep shell dir when execute " + (setq py-keep-shell-dir-when-execute-p + (not py-keep-shell-dir-when-execute-p)) + :help "Don't change Python shell's current working directory when sending code. + +See also `py-execute-directory'Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-keep-shell-dir-when-execute-p] + + ["Fileless buffer use default directory " + (setq py-fileless-buffer-use-default-directory-p + (not py-fileless-buffer-use-default-directory-p)) + :help "When `py-use-current-dir-when-execute-p' is non-nil and no buffer-file exists, value of `default-directory' sets current working directory of Python output shellUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-fileless-buffer-use-default-directory-p]) + + ("Underscore word syntax" + :help "Toggle `py-underscore-word-syntax-p'" + + ["Toggle underscore word syntax" toggle-py-underscore-word-syntax-p + :help " `toggle-py-underscore-word-syntax-p' + +If `py-underscore-word-syntax-p' should be on or off. + + Returns value of `py-underscore-word-syntax-p' switched to. . + +Use `M-x customize-variable' to set it permanently"] + + ["Underscore word syntax on" py-underscore-word-syntax-p-on + :help " `py-underscore-word-syntax-p-on' + +Make sure, py-underscore-word-syntax-p' is on. + +Returns value of `py-underscore-word-syntax-p'. . + +Use `M-x customize-variable' to set it permanently"] + + ["Underscore word syntax off" py-underscore-word-syntax-p-off + :help " `py-underscore-word-syntax-p-off' + +Make sure, `py-underscore-word-syntax-p' is off. + +Returns value of `py-underscore-word-syntax-p'. . + +Use `M-x customize-variable' to set it permanently"]) + + ["Load pymacs " + (setq py-load-pymacs-p + (not py-load-pymacs-p)) + :help "If Pymacs related stuff should be loaded. + +Default is nil. + +Pymacs has been written by François Pinard and many others. +See original source: http://pymacs.progiciels-bpi.caUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-load-pymacs-p] + + ["Verbose " + (setq py-verbose-p + (not py-verbose-p)) + :help "If functions should report results. + +Default is nil. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-verbose-p] + + ["Empty comment line separates paragraph " + (setq py-empty-comment-line-separates-paragraph-p + (not py-empty-comment-line-separates-paragraph-p)) + :help "Consider paragraph start/end lines with nothing inside but comment sign. + +Default is non-nilUse `M-x customize-variable' to set it permanently" + :style toggle :selected py-empty-comment-line-separates-paragraph-p] + + ["Org cycle " + (setq py-org-cycle-p + (not py-org-cycle-p)) + :help "When non-nil, command `org-cycle' is available at shift-TAB, + +Default is nil. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-org-cycle-p] + + ["Set pager cat" + (setq py-set-pager-cat-p + (not py-set-pager-cat-p)) + :help "If the shell environment variable \$PAGER should set to `cat'. + +If `t', use `C-c C-r' to jump to beginning of output. Then scroll normally. + +Avoids lp:783828, \"Terminal not fully functional\", for help('COMMAND') in python-shell + +When non-nil, imports module `os' Use `M-x customize-variable' to +set it permanently" + :style toggle :selected py-set-pager-cat-p] + + ["Edit only " + (setq py-edit-only-p + (not py-edit-only-p)) + :help "When `t' `python-mode' will not take resort nor check for installed Python executables. Default is nil. + +See bug report at launchpad, lp:944093. Use `M-x customize-variable' to set it permanently" + :style toggle :selected py-edit-only-p]))) + ("Other" + ["Boolswitch" py-boolswitch + :help " `py-boolswitch' +Edit the assignment of a boolean variable, revert them. + +I.e. switch it from \"True\" to \"False\" and vice versa"] + + ["Empty out list backward" py-empty-out-list-backward + :help " `py-empty-out-list-backward' +Deletes all elements from list before point."] + + ["Kill buffer unconditional" py-kill-buffer-unconditional + :help " `py-kill-buffer-unconditional' +Kill buffer unconditional, kill buffer-process if existing."] + + ["Remove overlays at point" py-remove-overlays-at-point + :help " `py-remove-overlays-at-point' +Remove overlays as set when `py-highlight-error-source-p' is non-nil."] + ("Electric" + ["Complete electric comma" py-complete-electric-comma + :help " `py-complete-electric-comma'"] + + ["Complete electric lparen" py-complete-electric-lparen + :help " `py-complete-electric-lparen'"] + + ["Electric backspace" py-electric-backspace + :help " `py-electric-backspace' +Delete preceding character or level of indentation. + +With ARG do that ARG times. +Returns column reached."] + + ["Electric colon" py-electric-colon + :help " `py-electric-colon' +Insert a colon and indent accordingly. + +If a numeric argument ARG is provided, that many colons are inserted +non-electrically. + +Electric behavior is inhibited inside a string or +comment or by universal prefix C-u. + +Switched by `py-electric-colon-active-p', default is nil +See also `py-electric-colon-greedy-p'"] + + ["Electric comment" py-electric-comment + :help " `py-electric-comment' +Insert a comment. If starting a comment, indent accordingly. + +If a numeric argument ARG is provided, that many \"#\" are inserted +non-electrically. +With C-u \"#\" electric behavior is inhibited inside a string or comment."] + + ["Electric delete" py-electric-delete + :help " `py-electric-delete' +Delete following character or levels of whitespace. + +With ARG do that ARG times."] + + ["Electric yank" py-electric-yank + :help " `py-electric-yank' +Perform command `yank' followed by an `indent-according-to-mode'"] + + ["Hungry delete backwards" py-hungry-delete-backwards + :help " `py-hungry-delete-backwards' +Delete the preceding character or all preceding whitespace +back to the previous non-whitespace character. +See also C-c ."] + + ["Hungry delete forward" py-hungry-delete-forward + :help " `py-hungry-delete-forward' +Delete the following character or all following whitespace +up to the next non-whitespace character. +See also C-c ."] + ) + ("Abbrevs" :help "see also `py-add-abbrev'" + :filter (lambda (&rest junk) + (abbrev-table-menu python-mode-abbrev-table)) ) + + ["Add abbrev" py-add-abbrev + :help " `py-add-abbrev' +Defines python-mode specific abbrev for last expressions before point. +Argument is how many `py-partial-expression's form the expansion; or zero means the region is the expansion. + +Reads the abbreviation in the minibuffer; with numeric arg it displays a proposal for an abbrev. +Proposal is composed from the initial character(s) of the +expansion. + +Don't use this function in a Lisp program; use `define-abbrev' instead."] + ("Completion" + ["Py indent or complete" py-py-indent-or-complete + :help " `py-py-indent-or-complete'"] + + ["Py shell complete" py-py-shell-complete + :help " `py-py-shell-complete'"] + + ["Py complete" py-py-complete + :help " `py-py-complete'"] + ))))) + +;; python-components-foot + +;; sliced from python.el +(defun py-pdbtrack-comint-output-filter-function (output) + "Move overlay arrow to current pdb line in tracked buffer. +Argument OUTPUT is a string with the output from the comint process." + (when (and py-pdbtrack-do-tracking-p (not (string= output ""))) + (let* ((full-output (ansi-color-filter-apply + (buffer-substring comint-last-input-end (point-max)))) + (line-number) + (file-name + (with-temp-buffer + (insert full-output) + ;; When the debugger encounters a pdb.set_trace() + ;; command, it prints a single stack frame. Sometimes + ;; it prints a bit of extra information about the + ;; arguments of the present function. When ipdb + ;; encounters an exception, it prints the _entire_ stack + ;; trace. To handle all of these cases, we want to find + ;; the _last_ stack frame printed in the most recent + ;; batch of output, then jump to the corresponding + ;; file/line number. + (goto-char (point-max)) + (when (re-search-backward py-pdbtrack-stacktrace-info-regexp nil t) + (setq line-number (string-to-number + (match-string-no-properties 2))) + (match-string-no-properties 1))))) + (if (and file-name line-number) + (let* ((tracked-buffer + ;; (python-pdbtrack-set-tracked-buffer file-name) + ;; (python-pdbtrack-set-tracked-buffer (buffer-name py-exception-buffer) + (buffer-name py-exception-buffer)) + (shell-buffer (current-buffer)) + (tracked-buffer-window (get-buffer-window tracked-buffer)) + (tracked-buffer-line-pos)) + (with-current-buffer tracked-buffer + (set (make-local-variable 'overlay-arrow-string) "=>") + (set (make-local-variable 'overlay-arrow-position) (make-marker)) + (setq tracked-buffer-line-pos (progn + (goto-char (point-min)) + (forward-line (1- line-number)) + (point-marker))) + (when tracked-buffer-window + (set-window-point + tracked-buffer-window tracked-buffer-line-pos)) + (set-marker overlay-arrow-position tracked-buffer-line-pos)) + (pop-to-buffer tracked-buffer) + (switch-to-buffer-other-window shell-buffer) + (goto-char (point-max))) + ;; (when python-pdbtrack-tracked-buffer + ;; (with-current-buffer python-pdbtrack-tracked-buffer + ;; (set-marker overlay-arrow-position nil)) + ;; (mapc #'(lambda (buffer) + ;; (ignore-errors (kill-buffer buffer))) + ;; python-pdbtrack-buffers-to-kill) + ;; (setq python-pdbtrack-tracked-buffer nil + ;; python-pdbtrack-buffers-to-kill nil)) + ))) + output) + +(defun py-shell-fontify () + "Fontifies input in shell buffer. " + ;; causes delay in fontification until next trigger + ;; (unless (or (member (char-before) (list 32 ?: ?\))) + ;; (unless (and (eq last-command 'self-insert-command) (eq (char-before) 32)) + ;; (< (abs (save-excursion (skip-chars-backward "^ \t\r\n\f"))) 2)) + (let* ((pps (parse-partial-sexp (line-beginning-position) (point))) + (start (if (and (nth 8 pps) (nth 1 pps)) + (max (nth 1 pps) (nth 8 pps)) + (or (nth 1 pps) (nth 8 pps))))) + (when (or start + (setq start (ignore-errors (cdr comint-last-prompt)))) + (let* ((input (buffer-substring-no-properties + start (point-max))) + (buffer-undo-list t) + (replacement + (save-current-buffer + (set-buffer py-shell--font-lock-buffer) + (erase-buffer) + (insert input) + ;; Ensure buffer is fontified, keeping it + ;; compatible with Emacs < 24.4. + (if (fboundp 'font-lock-ensure) + (funcall 'font-lock-ensure) + (font-lock-default-fontify-buffer)) + (buffer-substring (point-min) (point-max)))) + (replacement-length (length replacement)) + (i 0)) + ;; Inject text properties to get input fontified. + (while (not (= i replacement-length)) + (let* ((plist (text-properties-at i replacement)) + (next-change (or (next-property-change i replacement) + replacement-length)) + (plist (let ((face (plist-get plist 'face))) + (if (not face) + plist + ;; Replace FACE text properties with + ;; FONT-LOCK-FACE so input is fontified. + (plist-put plist 'face nil) + (plist-put plist 'font-lock-face face))))) + (set-text-properties + (+ start i) (+ start next-change) plist) + (setq i next-change))))))) + +(defun py-message-which-python-mode () + (if (buffer-file-name) + (if (string= "python-mode-el" (buffer-file-name)) + (message "%s" "python-mode loaded from python-mode-el") + (message "%s" "python-mode loaded from python-components-mode")) + (message "python-mode loaded from: %s" python-mode-message-string))) + +;;;###autoload +(define-derived-mode py-auto-completion-mode python-mode "Pac" + "Run auto-completion" + ;; disable company + ;; (when company-mode (company-mode)) + (if py-auto-completion-mode-p + (progn + (setq py-auto-completion-mode-p nil + py-auto-completion-buffer nil) + (when (timerp py--auto-complete-timer)(cancel-timer py--auto-complete-timer))) + (setq py-auto-completion-mode-p t + py-auto-completion-buffer (current-buffer)) + (setq py--auto-complete-timer + (run-with-idle-timer + py--auto-complete-timer-delay + ;; 1 + t + #'py-complete-auto))) + (force-mode-line-update)) + +;;;###autoload +(define-derived-mode python-mode prog-mode python-mode-modeline-display + "Major mode for editing Python files. + +To submit a problem report, enter `\\[py-submit-bug-report]' from a +`python-mode' buffer. Do `\\[py-describe-mode]' for detailed +documentation. To see what version of `python-mode' you are running, +enter `\\[py-version]'. + +This mode knows about Python indentation, tokens, comments and +continuation lines. Paragraphs are separated by blank lines only. + +COMMANDS + +`py-shell'\tStart an interactive Python interpreter in another window +`py-execute-statement'\tSend statement at point to Python default interpreter +`py-backward-statement'\tGo to the initial line of a simple statement + +etc. + +See available commands listed in files commands-python-mode at directory doc + +VARIABLES + +`py-indent-offset' indentation increment +`py-shell-name' shell command to invoke Python interpreter +`py-split-window-on-execute' When non-nil split windows +`py-switch-buffers-on-execute-p' When non-nil switch to the Python output buffer + +See available customizations listed in files variables-python-mode at directory doc + +\\{python-mode-map}" + :group 'python-mode + ;; Local vars + (set (make-local-variable 'electric-indent-inhibit) nil) + (set (make-local-variable 'outline-regexp) + (concat (mapconcat 'identity + (mapcar #'(lambda (x) (concat "^\\s-*" x "\\_>")) + py-outline-mode-keywords) + "\\|"))) + (when (>= emacs-major-version 25) + (global-eldoc-mode -1)) + (if py-use-font-lock-doc-face-p + (set (make-local-variable 'font-lock-defaults) + '(python-font-lock-keywords nil nil nil nil + (font-lock-syntactic-keywords + . py-font-lock-syntactic-keywords) + (font-lock-syntactic-face-function + . py--font-lock-syntactic-face-function))) + (set (make-local-variable 'font-lock-defaults) + '(python-font-lock-keywords nil nil nil nil + (font-lock-syntactic-keywords + . py-font-lock-syntactic-keywords)))) + ;; avoid to run py-choose-shell again from `py--fix-start' + (cond ((string-match "ython3" py-python-edit-version) + (font-lock-add-keywords 'python-mode + '(("\\" . 'py-builtins-face) + ("\\" . nil)))) + (t (font-lock-add-keywords 'python-mode + '(("\\" . 'font-lock-keyword-face) + ("\\" . 'py-builtins-face))))) + (set (make-local-variable 'which-func-functions) 'py-which-def-or-class) + (set (make-local-variable 'parse-sexp-lookup-properties) t) + (set (make-local-variable 'comment-use-syntax) t) + (set (make-local-variable 'comment-start) "#") + (set (make-local-variable 'comment-start-skip) "^[ \t]*#+ *") + + (if py-empty-comment-line-separates-paragraph-p + (progn + (set (make-local-variable 'paragraph-separate) (concat "\f\\|^[ \t]*$\\|^[ \t]*" comment-start "[ \t]*$\\|^[ \t\f]*:[[:alpha:]]+ [[:alpha:]]+:.+$")) + (set (make-local-variable 'paragraph-start) + (concat "\f\\|^[ \t]*$\\|^[ \t]*" comment-start "[ \t]*$\\|^[ \t\f]*:[[:alpha:]]+ [[:alpha:]]+:.+$")) + (set (make-local-variable 'paragraph-separate) + (concat "\f\\|^[ \t]*$\\|^[ \t]*" comment-start "[ \t]*$\\|^[ \t\f]*:[[:alpha:]]+ [[:alpha:]]+:.+$"))) + (set (make-local-variable 'paragraph-separate) "\f\\|^[ \t]*$\\|^[ \t]*#[ \t]*$\\|^[ \t\f]*:[[:alpha:]]+ [[:alpha:]]+:.+$") + (set (make-local-variable 'paragraph-start) "\f\\|^[ \t]*$\\|^[ \t]*#[ \t]*$\\|^[ \t\f]*:[[:alpha:]]+ [[:alpha:]]+:.+$")) + (set (make-local-variable 'comment-column) 40) + (set (make-local-variable 'comment-indent-function) #'py--comment-indent-function) + (set (make-local-variable 'indent-region-function) 'py-indent-region) + (set (make-local-variable 'indent-line-function) 'py-indent-line) + (set (make-local-variable 'hs-hide-comments-when-hiding-all) 'py-hide-comments-when-hiding-all) + (set (make-local-variable 'outline-heading-end-regexp) ":[^\n]*\n") + (set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil) + (set (make-local-variable 'add-log-current-defun-function) 'py-current-defun) + (set (make-local-variable 'fill-paragraph-function) 'py-fill-paragraph) + (set (make-local-variable 'require-final-newline) mode-require-final-newline) + (set (make-local-variable 'tab-width) py-indent-offset) + (set (make-local-variable 'eldoc-documentation-function) + #'py-eldoc-function) + (and py-load-skeletons-p + (py-load-skeletons) + (set (make-local-variable 'skeleton-further-elements) + '((< '(backward-delete-char-untabify (min py-indent-offset + (current-column)))) + (^ '(- (1+ (current-indentation))))))) + (and py-guess-py-install-directory-p (py-set-load-path)) + (and py-autopair-mode + (load-library "autopair") + (add-hook 'python-mode-hook + #'(lambda () + (setq autopair-handle-action-fns + (list #'autopair-default-handle-action + #'autopair-python-triple-quote-action)))) + (py-autopair-mode-on)) + (when (and py--imenu-create-index-p + (fboundp 'imenu-add-to-menubar) + (ignore-errors (require 'imenu))) + (setq imenu-create-index-function 'py--imenu-create-index-function) + (setq imenu--index-alist (funcall py--imenu-create-index-function)) + ;; fallback + (unless imenu--index-alist + (setq imenu--index-alist (py--imenu-create-index-new))) + ;; (message "imenu--index-alist: %s" imenu--index-alist) + (imenu-add-to-menubar "PyIndex")) + (when py-trailing-whitespace-smart-delete-p + (add-hook 'before-save-hook 'delete-trailing-whitespace nil 'local)) + ;; this should go into interactive modes + ;; (when py-pdbtrack-do-tracking-p + ;; (add-hook 'comint-output-filter-functions 'py--pdbtrack-track-stack-file)) + (cond + (py-complete-function + (add-hook 'completion-at-point-functions + py-complete-function nil 'local)) + (py-load-pymacs-p + (add-hook 'completion-at-point-functions + 'py-complete-completion-at-point nil 'local)) + (t + (add-hook 'completion-at-point-functions + 'py-shell-complete nil 'local))) + ;; (if py-auto-complete-p + ;; (add-hook 'python-mode-hook 'py--run-completion-timer) + ;; (remove-hook 'python-mode-hook 'py--run-completion-timer)) + ;; (when py-auto-complete-p + ;; (add-hook 'python-mode-hook + ;; (lambda () + ;; (run-with-idle-timer 1 t 'py-shell-complete)))) + (if py-auto-fill-mode + (add-hook 'python-mode-hook 'py--run-auto-fill-timer) + (remove-hook 'python-mode-hook 'py--run-auto-fill-timer)) + + ;; caused insert-file-contents error lp:1293172 + ;; (add-hook 'after-change-functions 'py--after-change-function nil t) + (if py-defun-use-top-level-p + (progn + (set (make-local-variable 'beginning-of-defun-function) 'py-backward-top-level) + (set (make-local-variable 'end-of-defun-function) 'py-end-of-top-level) + (define-key python-mode-map [(control meta a)] 'py-backward-top-level) + (define-key python-mode-map [(control meta e)] 'py-end-of-top-level)) + (set (make-local-variable 'beginning-of-defun-function) 'py-backward-def-or-class) + (set (make-local-variable 'end-of-defun-function) 'py-end-of-def-or-class) + (define-key python-mode-map [(control meta a)] 'py-backward-def-or-class) + (define-key python-mode-map [(control meta e)] 'py-end-of-def-or-class)) + (when py-sexp-use-expression-p + (define-key python-mode-map [(control meta f)] 'py-forward-expression) + (define-key python-mode-map [(control meta b)] 'py-backward-expression)) + + (when py-hide-show-minor-mode-p (hs-minor-mode 1)) + (when py-outline-minor-mode-p (outline-minor-mode 1)) + (when (interactive-p) + (py-message-which-python-mode)) + (force-mode-line-update)) + +(defun py--shell-setup-fontification (&optional style) + "Expected values are either nil, 'all or 'input. " + (setq style (or style py-shell-fontify-style)) + (if style + (progn + (cond ((eq 'all style) + (remove-hook 'change-major-mode-hook 'font-lock-defontify) + (set (make-local-variable 'py--shell-unfontify) 'py-shell-unfontify-p) + (when py--shell-unfontify + (add-hook 'py-python-shell-mode-hook #'py--run-unfontify-timer (current-buffer))) + (remove-hook 'post-command-hook 'py-shell-fontify t) + (set (make-local-variable 'font-lock-defaults) + '(python-font-lock-keywords nil nil nil nil + (font-lock-syntactic-keywords + . py-font-lock-syntactic-keywords))) + (if (fboundp 'font-lock-ensure) + (funcall 'font-lock-ensure) + (font-lock-default-fontify-buffer))) + ;; style is 'input, prepare `py-shell-fontify' + (t (set (make-local-variable 'delay-mode-hooks) t) + (save-current-buffer + ;; Prepare the buffer where the input is fontified + (set-buffer (get-buffer-create py-shell--font-lock-buffer)) + (font-lock-mode 1) + (python-mode)) + ;; post-self-insert-hook + (add-hook 'post-command-hook + #'py-shell-fontify nil 'local))) + (force-mode-line-update)) + ;; no fontification in py-shell + (remove-hook 'py-python-shell-mode-hook 'py--run-unfontify-timer t) + (remove-hook 'post-command-hook 'py-shell-fontify t))) + +;;;###autoload +(define-derived-mode py-python-shell-mode comint-mode "Py" + "Major mode for interacting with a Python process. +A Python process can be started with \\[py-shell]. + +You can send text to the Python process from other buffers +containing Python source. + * \\[py-execute-region] sends the current region to the Python process. + +Sets basic comint variables, see also versions-related stuff in `py-shell'. +\\{py-python-shell-mode-map}" + :group 'python-mode + ;; (require 'ansi-color) ; for ipython + (setq mode-line-process '(":%s")) + ;; (sit-for 0.1) + (when py-verbose-p (message "%s" "Initializing Python shell, please wait")) + (py--all-shell-mode-setting (current-buffer)) + (set-process-sentinel (get-buffer-process (current-buffer)) #'shell-write-history-on-exit) + (comint-read-input-ring t) + (if py-complete-function + (progn + (add-hook 'completion-at-point-functions + py-complete-function nil 'local) + (push py-complete-function comint-dynamic-complete-functions)) + (add-hook 'completion-at-point-functions + 'py-shell-complete nil 'local) + (push 'py-shell-complete comint-dynamic-complete-functions)) + (when py-sexp-use-expression-p + (define-key py-python-shell-mode-map [(control meta f)] 'py-forward-expression) + (define-key py-python-shell-mode-map [(control meta b)] 'py-backward-expression)) + (force-mode-line-update)) + +(defun py--all-shell-mode-setting (buffer) + (py--shell-setup-fontification) + (setenv "PAGER" "cat") + (setenv "TERM" "dumb") + ;; provide next-error etc. + (compilation-shell-minor-mode 1) + (set (make-local-variable 'indent-tabs-mode) py-indent-tabs-mode) + (set (make-local-variable 'compilation-error-regexp-alist) + py-shell-compilation-regexp-alist) + (set (make-local-variable 'comint-prompt-read-only) py-shell-prompt-read-only) + (setq mode-line-process '(":%s")) + ;; (set (make-local-variable 'inhibit-eol-conversion) t) + (set (make-local-variable 'comint-move-point-for-output) t) + (set (make-local-variable 'comint-scroll-show-maximum-output) t) + (set-syntax-table python-mode-syntax-table) + (set (make-local-variable 'comint-output-filter-functions) + '(ansi-color-process-output + py-pdbtrack-comint-output-filter-function + comint-watch-for-password-prompt)) + (if py-auto-complete-p + (add-hook 'py-shell-mode-hook 'py--run-completion-timer) + (remove-hook 'py-shell-mode-hook 'py--run-completion-timer)) + ;; comint settings + (set (make-local-variable 'comint-prompt-regexp) + (cond ((string-match "[iI][pP]ython[[:alnum:]*-]*$" (buffer-name (current-buffer))) + (concat "\\(" + (mapconcat 'identity + (delq nil (list py-shell-input-prompt-1-regexp py-shell-input-prompt-2-regexp py-ipython-input-prompt-re py-ipython-output-prompt-re py-pdbtrack-input-prompt py-pydbtrack-input-prompt)) + "\\|") + "\\)")) + (t (concat "\\(" + (mapconcat 'identity + (delq nil (list py-shell-input-prompt-1-regexp py-shell-input-prompt-2-regexp py-pdbtrack-input-prompt py-pydbtrack-input-prompt)) + "\\|") + "\\)")))) + (remove-hook 'comint-output-filter-functions 'font-lock-extend-jit-lock-region-after-change t) + (set (make-local-variable 'comint-input-filter) 'py-history-input-filter) + (set (make-local-variable 'comment-start) "# ") + (set (make-local-variable 'comment-start-skip) "^[ \t]*#+ *") + (set (make-local-variable 'comment-column) 40) + (set (make-local-variable 'comment-indent-function) #'py--comment-indent-function) + (set (make-local-variable 'indent-region-function) 'py-indent-region) + (set (make-local-variable 'indent-line-function) 'py-indent-line) + (set (make-local-variable 'inhibit-point-motion-hooks) t) + (set (make-local-variable 'comint-input-sender) 'py--shell-simple-send) + (py--python-send-ffap-setup-code buffer) + (py--python-send-eldoc-setup-code buffer) + (force-mode-line-update)) + +;;;###autoload +(define-derived-mode py-ipython-shell-mode comint-mode "IPy" + "Major mode for interacting with a (I)Python process. +A Python process can be started with \\[py-shell]. + +You can send text to the (I)Python process from other buffers +containing Python source. + * \\[py-execute-region] sends the current region to the Python process. + +Sets basic comint variables, see also versions-related stuff in `py-shell'. +\\{py-ipython-shell-mode-map}" + (py--all-shell-mode-setting (current-buffer)) + (py--ipython-import-module-completion) + (py-set-ipython-completion-command-string (process-name (get-buffer-process (current-buffer)))) + ;; (sit-for 0.1 t) + (if py-complete-function + (progn + (add-hook 'completion-at-point-functions + py-complete-function nil 'local) + (push py-complete-function comint-dynamic-complete-functions)) + (add-hook 'completion-at-point-functions + 'py-shell-complete nil 'local) + (push 'py-shell-complete comint-dynamic-complete-functions)) + ;; (sit-for 0.5 t) + (add-hook 'completion-at-point-functions + #'python-shell-completion-at-point nil 'local) + ) + +(autoload 'python-mode "python-mode" "Python Mode." t) + +(defalias 'py-backward-decorator-bol 'py-backward-decorator) +(defalias 'py-beginning-of-block 'py-backward-block) +(defalias 'py-beginning-of-block-bol 'py-backward-block-bol) +(defalias 'py-beginning-of-block-or-clause 'py-backward-block-or-clause) +(defalias 'py-beginning-of-class 'py-backward-class) +(defalias 'py-beginning-of-class-bol 'py-backward-class-bol) +(defalias 'py-beginning-of-clause 'py-backward-clause) +(defalias 'py-beginning-of-clause-bol 'py-backward-clause-bol) +(defalias 'py-beginning-of-comment 'py-backward-comment) +(defalias 'py-beginning-of-declarations 'py-backward-declarations) +(defalias 'py-beginning-of-decorator 'py-backward-decorator) +(defalias 'py-beginning-of-decorator-bol 'py-backward-decorator) +(defalias 'py-beginning-of-def-or-class 'py-backward-def-or-class) +(defalias 'py-beginning-of-expression 'py-backward-expression) +(defalias 'py-beginning-of-line 'py-backward-line) +(defalias 'py-beginning-of-minor-block 'py-backward-minor-block) +(defalias 'py-beginning-of-partial-expression 'py-backward-partial-expression) +(defalias 'py-beginning-of-section 'py-backward-section) +(defalias 'py-beginning-of-statement 'py-backward-statement) +(defalias 'py-beginning-of-statement-bol 'py-backward-statement-bol) +(defalias 'py-beginning-of-top-level 'py-backward-top-level) +(defalias 'py-end-of-block 'py-forward-block) +(defalias 'py-end-of-block-or-clause 'py-forward-block-or-clause) +(defalias 'py-end-of-class 'py-forward-class) +(defalias 'py-end-of-clause 'py-forward-clause) +(defalias 'py-end-of-comment 'py-forward-comment) +(defalias 'py-end-of-decorator 'py-forward-decorator) +(defalias 'py-end-of-def-or-class 'py-forward-def-or-class) +(defalias 'py-end-of-expression 'py-forward-expression) +(defalias 'py-end-of-line 'py-forward-line) +(defalias 'py-end-of-partial-expression 'py-forward-partial-expression) +(defalias 'py-end-of-section 'py-forward-section) +(defalias 'py-end-of-statement 'py-forward-statement) +(defalias 'py-end-of-statement-bol 'py-forward-statement-bol) +(defalias 'py-end-of-top-level 'py-forward-top-level) +(defalias 'py-next-statement 'py-forward-statement) +(defalias 'py-markup-region-as-section 'py-sectionize-region) +(defalias 'py-up 'py-up-block) + +;;; +(provide 'python-mode) +;;; python-mode.el ends here diff --git a/elpa/python-mode-20180721.1847/python-mode.elc b/elpa/python-mode-20180721.1847/python-mode.elc new file mode 100644 index 0000000..7b93545 Binary files /dev/null and b/elpa/python-mode-20180721.1847/python-mode.elc differ diff --git a/elpa/pyvenv-20180727.1142/pyvenv-autoloads.el b/elpa/pyvenv-20180727.1142/pyvenv-autoloads.el new file mode 100644 index 0000000..613418a --- /dev/null +++ b/elpa/pyvenv-20180727.1142/pyvenv-autoloads.el @@ -0,0 +1,73 @@ +;;; pyvenv-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "pyvenv" "pyvenv.el" (23391 65275 0 0)) +;;; Generated autoloads from pyvenv.el + +(autoload 'pyvenv-activate "pyvenv" "\ +Activate the virtual environment in DIRECTORY. + +\(fn DIRECTORY)" t nil) + +(autoload 'pyvenv-deactivate "pyvenv" "\ +Deactivate any current virtual environment. + +\(fn)" t nil) + +(autoload 'pyvenv-workon "pyvenv" "\ +Activate a virtual environment from $WORKON_HOME. + +\(fn NAME)" t nil) + +(defvar pyvenv-mode nil "\ +Non-nil if Pyvenv mode is enabled. +See the `pyvenv-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `pyvenv-mode'.") + +(custom-autoload 'pyvenv-mode "pyvenv" nil) + +(autoload 'pyvenv-mode "pyvenv" "\ +Global minor mode for pyvenv. + +Will show the current virtualenv in the mode line, and respect a +`pyvenv-workon' setting in files. + +\(fn &optional ARG)" t nil) + +(defvar pyvenv-tracking-mode nil "\ +Non-nil if Pyvenv-Tracking mode is enabled. +See the `pyvenv-tracking-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `pyvenv-tracking-mode'.") + +(custom-autoload 'pyvenv-tracking-mode "pyvenv" nil) + +(autoload 'pyvenv-tracking-mode "pyvenv" "\ +Global minor mode to track the current virtualenv. + +When this mode is active, pyvenv will activate a buffer-specific +virtualenv whenever the user switches to a buffer with a +buffer-local `pyvenv-workon' or `pyvenv-activate' variable. + +\(fn &optional ARG)" t nil) + +(autoload 'pyvenv-restart-python "pyvenv" "\ +Restart Python inferior processes. + +\(fn)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; pyvenv-autoloads.el ends here diff --git a/elpa/pyvenv-20180727.1142/pyvenv-pkg.el b/elpa/pyvenv-20180727.1142/pyvenv-pkg.el new file mode 100644 index 0000000..f699054 --- /dev/null +++ b/elpa/pyvenv-20180727.1142/pyvenv-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "pyvenv" "20180727.1142" "Python virtual environment interface" 'nil :commit "0ff4351f5e3a63575c0a88b293df9d3ccbad4ed6" :keywords '("python" "virtualenv" "tools") :authors '(("Jorgen Schaefer" . "contact@jorgenschaefer.de")) :maintainer '("Jorgen Schaefer" . "contact@jorgenschaefer.de") :url "http://github.com/jorgenschaefer/pyvenv") diff --git a/elpa/pyvenv-20180727.1142/pyvenv.el b/elpa/pyvenv-20180727.1142/pyvenv.el new file mode 100644 index 0000000..8ac65f5 --- /dev/null +++ b/elpa/pyvenv-20180727.1142/pyvenv.el @@ -0,0 +1,547 @@ +;;; pyvenv.el --- Python virtual environment interface -*- lexical-binding: t -*- + +;; Copyright (C) 2013-2017 Jorgen Schaefer + +;; Author: Jorgen Schaefer +;; URL: http://github.com/jorgenschaefer/pyvenv +;; Package-Version: 20180727.1142 +;; Version: 1.17 +;; Keywords: Python, Virtualenv, Tools + +;; 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 . + +;;; Commentary: + +;; This is a simple global minor mode which will replicate the changes +;; done by virtualenv activation inside Emacs. + +;; The main entry points are `pyvenv-activate', which queries the user +;; for a virtual environment directory to activate, and +;; `pyvenv-workon', which queries for a virtual environment in +;; $WORKON_HOME (from virtualenvwrapper.sh). + +;; If you want your inferior Python processes to be restarted +;; automatically when you switch your virtual environment, add +;; `pyvenv-restart-python' to `pyvenv-post-activate-hooks'. + +;;; Code: + +(require 'eshell) +(require 'json) + +;; User customization + +(defgroup pyvenv nil + "Python Virtual Environment Interface." + :prefix "pyvenv-" + :group 'languages) + +(defcustom pyvenv-workon nil + "The intended virtualenv in the virtualenvwrapper directory. + +This is rarely useful to set globally. Rather, set this in file- +or directory-local variables using \\[add-file-local-variable] or +\\[add-dir-local-variable]. + +When `pyvenv-mode' is enabled, pyvenv will switch to this +virtualenv. If a virtualenv is already enabled, it will ask first." + :type 'pyvenv-workon + :safe #'stringp + :group 'pyvenv) + +(defcustom pyvenv-activate nil + "The intended virtualenv directory. + +This is rarely useful to set globally. Rather, set this in file- +or directory-local variables using \\[add-file-local-variable] or +\\[add-dir-local-variable]. + +When `pyvenv-mode' is enabled, pyvenv will switch to this +virtualenv. If a virtualenv is already enabled, it will ask first." + :type 'directory + :safe #'stringp + :group 'pyvenv) + +(defcustom pyvenv-tracking-ask-before-change nil + "Non-nil means pyvenv will ask before automatically changing a virtualenv. + +This can happen when a new file is opened with a buffer-local +value (from file-local or directory-local variables) for +`pyvenv-workon' or `pyvenv-workon', or if `pyvenv-tracking-mode' +is active, after every command." + :type 'boolean + :group 'pyvenv) + +(defcustom pyvenv-virtualenvwrapper-python + (or (getenv "VIRTUALENVWRAPPER_PYTHON") + (executable-find "python") + (executable-find "py") + (executable-find "pythonw") + "python") + "The python process which has access to the virtualenvwrapper module. + +This should be $VIRTUALENVWRAPPER_PYTHON outside of Emacs, but +virtualenvwrapper.sh does not export that variable. We make an +educated guess, but that can be off." + :type '(file :must-match t) + :safe #'file-directory-p + :group 'pyvenv) + +(defcustom pyvenv-exec-shell + (or (executable-find "bash") + (executable-find "sh") + shell-file-name) + "The path to a POSIX compliant shell to use for running + virtualenv hooks. Useful if you use a non-POSIX shell (e.g. + fish)." + :type '(file :must-match t) + :group 'pyvenv) + +;; API for other libraries + +(defvar pyvenv-virtual-env nil + "The current virtual environment. + +Do not set this variable directly; use `pyvenv-activate' or +`pyvenv-workon'.") + +(defvar pyvenv-virtual-env-name nil + "The name of the current virtual environment. + +This is usually the base name of `pyvenv-virtual-env'.") + + +(defvar pyvenv-pre-create-hooks nil + "Hooks run before a virtual environment is created.") + + +(defvar pyvenv-post-create-hooks nil + "Hooks run after a virtual environment is created.") + + +(defvar pyvenv-pre-activate-hooks nil + "Hooks run before a virtual environment is activated. + +`pyvenv-virtual-env' is already set.") + +(defvar pyvenv-post-activate-hooks nil + "Hooks run after a virtual environment is activated. + +`pyvenv-virtual-env' is set.") + +(defvar pyvenv-pre-deactivate-hooks nil + "Hooks run before a virtual environment is deactivated. + +`pyvenv-virtual-env' is set.") + +(defvar pyvenv-post-deactivate-hooks nil + "Hooks run after a virtual environment is deactivated. + +`pyvenv-virtual-env' is still set.") + +(defvar pyvenv-mode-line-indicator '(pyvenv-virtual-env-name + ("[" pyvenv-virtual-env-name "] ")) + "How `pyvenv-mode' will indicate the current environment in the mode line.") + +;; Internal code. + +(defvar pyvenv-old-process-environment nil + "The old process environment before the last activate.") + +(defvar pyvenv-old-exec-path nil + "The old exec path before the last activate.") + +(defvar pyvenv-old-eshell-path nil + "The old eshell path before the last activate.") + + +(defun pyvenv-create (venv-name python-executable) + "Create virtualenv. VENV-NAME PYTHON-EXECUTABLE." + (interactive (list + (read-from-minibuffer "Name of virtual environment: ") + (read-file-name "Python interpreter to use: " + (file-name-directory (executable-find "python")) + nil nil "python"))) + (let ((venv-dir (concat (file-name-as-directory (pyvenv-workon-home)) + venv-name))) + (unless (file-exists-p venv-dir) + (run-hooks 'pyvenv-pre-create-hooks) + (with-current-buffer (generate-new-buffer "*virtualenv*") + (call-process "virtualenv" nil t t + "-p" python-executable venv-dir) + (display-buffer (current-buffer))) + (run-hooks 'pyvenv-post-create-hooks)) + (pyvenv-activate venv-dir))) + + +;;;###autoload +(defun pyvenv-activate (directory) + "Activate the virtual environment in DIRECTORY." + (interactive "DActivate venv: ") + (setq directory (expand-file-name directory)) + (pyvenv-deactivate) + (setq pyvenv-virtual-env (file-name-as-directory directory) + pyvenv-virtual-env-name (file-name-nondirectory + (directory-file-name directory)) + python-shell-virtualenv-path directory + python-shell-virtualenv-root directory) + ;; Set venv name as parent directory for generic directories + (when (member pyvenv-virtual-env-name '("venv" ".venv")) + (setq pyvenv-virtual-env-name + (file-name-nondirectory + (directory-file-name + (file-name-directory + (directory-file-name directory)))))) + ;; Preserve variables from being overwritten. + (let ((old-exec-path exec-path) + (old-eshell-path eshell-path-env) + (old-process-environment process-environment)) + (unwind-protect + (pyvenv-run-virtualenvwrapper-hook "pre_activate" pyvenv-virtual-env) + (setq exec-path old-exec-path + eshell-path-env old-eshell-path + process-environment old-process-environment))) + (run-hooks 'pyvenv-pre-activate-hooks) + (let ((new-directories (append + ;; Unix + (when (file-exists-p (format "%s/bin" directory)) + (list (format "%s/bin" directory))) + ;; Windows + (when (file-exists-p (format "%s/Scripts" directory)) + (list (format "%s/Scripts" directory) + ;; Apparently, some virtualenv + ;; versions on windows put the + ;; python.exe in the virtualenv root + ;; for some reason? + directory))))) + (setq pyvenv-old-exec-path exec-path + pyvenv-old-eshell-path eshell-path-env + pyvenv-old-process-environment process-environment + ;; For some reason, Emacs adds some directories to `exec-path' + ;; but not to `process-environment'? + exec-path (append new-directories exec-path) + ;; set eshell path to same as exec-path + eshell-path-env (mapconcat 'identity exec-path ":") + process-environment (append + (list + (format "VIRTUAL_ENV=%s" directory) + (format "PATH=%s" + (mapconcat 'identity + (append new-directories + (split-string (getenv "PATH") + path-separator)) + path-separator)) + ;; No "=" means to unset + "PYTHONHOME") + process-environment) + )) + (pyvenv-run-virtualenvwrapper-hook "post_activate") + (run-hooks 'pyvenv-post-activate-hooks)) + +;;;###autoload +(defun pyvenv-deactivate () + "Deactivate any current virtual environment." + (interactive) + (when pyvenv-virtual-env + (pyvenv-run-virtualenvwrapper-hook "pre_deactivate") + (run-hooks 'pyvenv-pre-deactivate-hooks)) + (when pyvenv-old-process-environment + (setq process-environment pyvenv-old-process-environment + pyvenv-old-process-environment nil)) + (when pyvenv-old-exec-path + (setq exec-path pyvenv-old-exec-path + pyvenv-old-exec-path nil)) + (when pyvenv-old-eshell-path + (setq eshell-path-env pyvenv-old-eshell-path + pyvenv-old-eshell-path nil)) + (when pyvenv-virtual-env + ;; Make sure this does not change `exec-path', as $PATH is + ;; different + (let ((old-exec-path exec-path) + (old-eshell-path eshell-path-env) + (old-process-environment process-environment)) + (unwind-protect + (pyvenv-run-virtualenvwrapper-hook "post_deactivate" + pyvenv-virtual-env) + (setq exec-path old-exec-path + eshell-path-env old-eshell-path + process-environment old-process-environment))) + (run-hooks 'pyvenv-post-deactivate-hooks)) + (setq pyvenv-virtual-env nil + pyvenv-virtual-env-name nil + python-shell-virtualenv-root nil + python-shell-virtualenv-path nil)) + +(defvar pyvenv-workon-history nil + "Prompt history for `pyvenv-workon'.") + +;;;###autoload +(defun pyvenv-workon (name) + "Activate a virtual environment from $WORKON_HOME." + (interactive + (list + (completing-read "Work on: " (pyvenv-virtualenv-list) + nil t nil 'pyvenv-workon-history nil nil))) + (when (not (or (equal name "") + ;; Some completion frameworks can return nil for the + ;; default, see + ;; https://github.com/jorgenschaefer/elpy/issues/144 + (equal name nil))) + (pyvenv-activate (format "%s/%s" + (pyvenv-workon-home) + name)))) + +(defun pyvenv-virtualenv-list (&optional noerror) + "Prompt the user for a name in $WORKON_HOME. + +If NOERROR is set, do not raise an error if WORKON_HOME is not +configured." + (let ((workon-home (pyvenv-workon-home)) + (result nil)) + (if (not (file-directory-p workon-home)) + (when (not noerror) + (error "Can't find a workon home directory, set $WORKON_HOME")) + (dolist (name (directory-files workon-home)) + (when (or (file-exists-p (format "%s/%s/bin/activate" + workon-home name)) + (file-exists-p (format "%s/%s/bin/python" + workon-home name)) + (file-exists-p (format "%s/%s/Scripts/activate.bat" + workon-home name)) + (file-exists-p (format "%s/%s/python.exe" + workon-home name))) + (setq result (cons name result)))) + (sort result (lambda (a b) + (string-lessp (downcase a) + (downcase b))))))) + +(define-widget 'pyvenv-workon 'choice + "Select an available virtualenv from virtualenvwrapper." + :convert-widget + (lambda (widget) + (setq widget (widget-copy widget)) + (widget-put widget + :args (cons '(const :tag "None" nil) + (mapcar (lambda (env) + (list 'const env)) + (pyvenv-virtualenv-list t)))) + (widget-types-convert-widget widget)) + + :prompt-value (lambda (widget prompt value unbound) + (let ((name (completing-read + prompt + (cons "None" + (pyvenv-virtualenv-list t)) + nil t))) + (if (equal name "None") + nil + name)))) + +(defvar pyvenv-mode-map (make-sparse-keymap) + "The mode keymap for `pyvenv-mode'.") + +(easy-menu-define pyvenv-menu pyvenv-mode-map + "Pyvenv Menu" + '("Virtual Envs" + :visible pyvenv-mode + ("Workon" + :help "Activate a virtualenvwrapper environment" + :filter (lambda (&optional ignored) + (mapcar (lambda (venv) + (vector venv `(pyvenv-workon ,venv) + :style 'radio + :selected `(equal pyvenv-virtual-env-name + ,venv))) + (pyvenv-virtualenv-list t)))) + ["Activate" pyvenv-activate + :help "Activate a virtual environment by directory"] + ["Deactivate" pyvenv-deactivate + :help "Deactivate the current virtual environment" + :active pyvenv-virtual-env + :suffix pyvenv-virtual-env-name] + ["Restart Python Processes" pyvenv-restart-python + :help "Restart all Python processes to use the current environment"])) + +;;;###autoload +(define-minor-mode pyvenv-mode + "Global minor mode for pyvenv. + +Will show the current virtualenv in the mode line, and respect a +`pyvenv-workon' setting in files." + :global t + (cond + (pyvenv-mode + (add-to-list 'mode-line-misc-info '(pyvenv-mode pyvenv-mode-line-indicator)) + (add-hook 'hack-local-variables-hook #'pyvenv-track-virtualenv)) + ((not pyvenv-mode) + (setq mode-line-misc-info (delete '(pyvenv-mode pyvenv-mode-line-indicator) + mode-line-misc-info)) + (remove-hook 'hack-local-variables-hook #'pyvenv-track-virtualenv)))) + +;;;###autoload +(define-minor-mode pyvenv-tracking-mode + "Global minor mode to track the current virtualenv. + +When this mode is active, pyvenv will activate a buffer-specific +virtualenv whenever the user switches to a buffer with a +buffer-local `pyvenv-workon' or `pyvenv-activate' variable." + :global t + (if pyvenv-tracking-mode + (add-hook 'post-command-hook 'pyvenv-track-virtualenv) + (remove-hook 'post-command-hook 'pyvenv-track-virtualenv))) + +(defun pyvenv-track-virtualenv () + "Set a virtualenv as specified for the current buffer. + +If either `pyvenv-activate' or `pyvenv-workon' are specified, and +they specify a virtualenv different from the current one, switch +to that virtualenv." + (cond + (pyvenv-activate + (when (and (not (equal (file-name-as-directory pyvenv-activate) + pyvenv-virtual-env)) + (or (not pyvenv-tracking-ask-before-change) + (y-or-n-p (format "Switch to virtualenv %s (currently %s)" + pyvenv-activate pyvenv-virtual-env)))) + (pyvenv-activate pyvenv-activate))) + (pyvenv-workon + (when (and (not (equal pyvenv-workon pyvenv-virtual-env-name)) + (or (not pyvenv-tracking-ask-before-change) + (y-or-n-p (format "Switch to virtualenv %s (currently %s)" + pyvenv-workon pyvenv-virtual-env-name)))) + (pyvenv-workon pyvenv-workon))))) + +(defun pyvenv-run-virtualenvwrapper-hook (hook &rest args) + "Run a virtualenvwrapper hook, and update the environment. + +This will run a virtualenvwrapper hook and update the local +environment accordingly. + +CAREFUL! This will modify your `process-environment' and +`exec-path'." + (when (pyvenv-virtualenvwrapper-supported) + (with-temp-buffer + (let ((tmpfile (make-temp-file "pyvenv-virtualenvwrapper-")) + (shell-file-name pyvenv-exec-shell)) + (unwind-protect + (let ((default-directory (pyvenv-workon-home))) + (apply #'call-process + pyvenv-virtualenvwrapper-python + nil t nil + "-m" "virtualenvwrapper.hook_loader" + "--script" tmpfile + (if (getenv "HOOK_VERBOSE_OPTION") + (cons (getenv "HOOK_VERBOSE_OPTION") + (cons hook args)) + (cons hook args))) + (call-process-shell-command + (format ". '%s' ; python -c 'import os, json; print(\"\\n=-=-=\"); print(json.dumps(dict(os.environ)))'" + tmpfile) + nil t nil)) + (delete-file tmpfile))) + (goto-char (point-min)) + (when (and (not (re-search-forward "No module named '?virtualenvwrapper'?" nil t)) + (re-search-forward "\n=-=-=\n" nil t)) + (let ((output (buffer-substring (point-min) + (match-beginning 0)))) + (when (> (length output) 0) + (with-help-window "*Virtualenvwrapper Hook Output*" + (with-current-buffer "*Virtualenvwrapper Hook Output*" + (let ((inhibit-read-only t)) + (erase-buffer) + (insert + (format + "Output from the virtualenvwrapper hook %s:\n\n" + hook) + output)))))) + (dolist (binding (json-read)) + (let ((env (format "%s=%s" (car binding) (cdr binding)))) + (when (not (member env process-environment)) + (setq process-environment (cons env process-environment)))) + (when (eq (car binding) 'PATH) + (setq exec-path (split-string (cdr binding) + path-separator)))))))) + +;;;###autoload +(defun pyvenv-restart-python () + "Restart Python inferior processes." + (interactive) + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when (and (eq major-mode 'inferior-python-mode) + (get-buffer-process buf)) + (let ((cmd (combine-and-quote-strings (process-command + (get-buffer-process buf)))) + (dedicated (if (string-match "\\[.*\\]$" (buffer-name buf)) + t + nil)) + (show nil)) + (delete-process (get-buffer-process buf)) + (goto-char (point-max)) + (insert "\n\n" + "###\n" + (format "### Restarting in virtualenv %s (%s)\n" + pyvenv-virtual-env-name pyvenv-virtual-env) + "###\n" + "\n\n") + (run-python cmd dedicated show) + (goto-char (point-max))))))) + +(defun pyvenv-hook-dir () + "Return the current hook directory. + +This is usually the value of $VIRTUALENVWRAPPER_HOOK_DIR, but +virtualenvwrapper has stopped exporting that variable, so we go +back to the default of $WORKON_HOME or even just ~/.virtualenvs/." + (or (getenv "VIRTUALENVWRAPPER_HOOK_DIR") + (pyvenv-workon-home))) + +(defun pyvenv-workon-home () + "Return the current workon home. + +This is the value of $WORKON_HOME or ~/.virtualenvs." + (or (getenv "WORKON_HOME") + (expand-file-name "~/.virtualenvs"))) + +(defun pyvenv-virtualenvwrapper-supported () + "Return true iff virtualenvwrapper is supported. + +Right now, this just checks if WORKON_HOME is set." + (getenv "WORKON_HOME")) + +;;; Compatibility + +(when (not (fboundp 'file-name-base)) + ;; Emacs 24.3 + (defun file-name-base (&optional filename) + "Return the base name of the FILENAME: no directory, no extension. +FILENAME defaults to `buffer-file-name'." + (file-name-sans-extension + (file-name-nondirectory (or filename (buffer-file-name))))) + ) + +(when (not (boundp 'mode-line-misc-info)) + (defvar mode-line-misc-info nil + "Compatibility variable for 24.3+") + (let ((line mode-line-format)) + (while line + (when (eq 'which-func-mode + (car-safe (car-safe (cdr line)))) + (setcdr line (cons 'mode-line-misc-format + (cdr line))) + (setq line (cdr line))) + (setq line (cdr line))))) + +(provide 'pyvenv) +;;; pyvenv.el ends here diff --git a/elpa/pyvenv-20180727.1142/pyvenv.elc b/elpa/pyvenv-20180727.1142/pyvenv.elc new file mode 100644 index 0000000..f69dc73 Binary files /dev/null and b/elpa/pyvenv-20180727.1142/pyvenv.elc differ diff --git a/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-autoloads.el b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-autoloads.el new file mode 100644 index 0000000..9552924 --- /dev/null +++ b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-autoloads.el @@ -0,0 +1,32 @@ +;;; rainbow-delimiters-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "rainbow-delimiters" "rainbow-delimiters.el" +;;;;;; (23391 65273 0 0)) +;;; Generated autoloads from rainbow-delimiters.el + +(autoload 'rainbow-delimiters-mode "rainbow-delimiters" "\ +Highlight nested parentheses, brackets, and braces according to their depth. + +\(fn &optional ARG)" t nil) + +(autoload 'rainbow-delimiters-mode-enable "rainbow-delimiters" "\ +Enable `rainbow-delimiters-mode'. + +\(fn)" nil nil) + +(autoload 'rainbow-delimiters-mode-disable "rainbow-delimiters" "\ +Disable `rainbow-delimiters-mode'. + +\(fn)" nil nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; rainbow-delimiters-autoloads.el ends here diff --git a/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-pkg.el b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-pkg.el new file mode 100644 index 0000000..7e89106 --- /dev/null +++ b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "rainbow-delimiters" "20170929.1132" "Highlight brackets according to their depth" 'nil :commit "19b93892afa0494ba749c2ca9c154e04447ad778" :keywords '("faces" "convenience" "lisp" "tools") :authors '(("Jeremy Rayman" . "opensource@jeremyrayman.com") ("Fanael Linithien" . "fanael4@gmail.com")) :maintainer '("Fanael Linithien" . "fanael4@gmail.com") :url "https://github.com/Fanael/rainbow-delimiters") diff --git a/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters.el b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters.el new file mode 100644 index 0000000..c4a4b64 --- /dev/null +++ b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters.el @@ -0,0 +1,300 @@ +;;; rainbow-delimiters.el --- Highlight brackets according to their depth -*- lexical-binding: t -*- + +;; Copyright (C) +;; 2010-2013 Jeremy Rayman +;; 2013-2016 Fanael Linithien +;; Author: Jeremy Rayman +;; Fanael Linithien +;; Maintainer: Fanael Linithien +;; Created: 2010-09-02 +;; Version: 2.1.3 +;; Package-Version: 20170929.1132 +;; Keywords: faces, convenience, lisp, tools +;; Homepage: https://github.com/Fanael/rainbow-delimiters + +;; Note: despite `lexical-binding', there's no Emacs 24 dependency. +;; This is merely an optimization for Emacs 24+, the code is supposed to work +;; with *both* dynamic and lexical binding. + +;; 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 . + +;;; Installation: + +;; The recommended way is to use MELPA (http://melpa.org/) or MELPA Stable +;; (http://stable.melpa.org/). If either is in your `package-archives', do +;; M-x package-install RET rainbow-delimiters RET +;; Otherwise, open `rainbow-delimiters.el' in Emacs and use +;; M-x package-install-from-buffer +;; Any other methods of installation are unsupported. + +;;; Commentary: +;; +;; Rainbow-delimiters is a "rainbow parentheses"-like mode which highlights +;; parentheses, brackets, and braces according to their depth. Each +;; successive level is highlighted in a different color. This makes it easy +;; to spot matching delimiters, orient yourself in the code, and tell which +;; statements are at a given level. +;; +;; Great care has been taken to make this mode fast. You shouldn't see +;; any discernible change in scrolling or editing speed while using it, +;; even in delimiter-rich languages like Clojure, Lisp, and Scheme. +;; +;; Usage: +;; +;; To toggle the mode in the current buffer: +;; M-x rainbow-delimiters-mode +;; To start the mode automatically in `foo-mode', add the following to your init +;; file: +;; (add-hook 'foo-mode-hook #'rainbow-delimiters-mode) +;; To start the mode automatically in most programming modes (Emacs 24 and +;; above): +;; (add-hook 'prog-mode-hook #'rainbow-delimiters-mode) +;; +;; Customization: +;; +;; To customize various options, including the color theme: +;; M-x customize-group rainbow-delimiters +;; +;; You can specify custom colors by customizing following faces: +;; - Faces take the form `rainbow-delimiters-depth-N-face', with N being the +;; depth. Depth begins at 1, the outermost color. Faces exist for depths 1-9. +;; - The unmatched delimiter face: `rainbow-delimiters-unmatched-face'. +;; - The mismatched delimiter face: `rainbow-delimiters-mismatched-face'. + +;;; Code: + +(defgroup rainbow-delimiters nil + "Highlight nested parentheses, brackets, and braces according to their depth." + :prefix "rainbow-delimiters-" + :link '(url-link :tag "Website for rainbow-delimiters" + "https://github.com/Fanael/rainbow-delimiters") + :group 'applications) + +(defgroup rainbow-delimiters-faces nil + "Faces for successively nested pairs of delimiters. + +When depth exceeds innermost defined face, colors cycle back through." + :group 'rainbow-delimiters + :group 'faces + :link '(custom-group-link "rainbow-delimiters") + :prefix "rainbow-delimiters-") + +(defcustom rainbow-delimiters-pick-face-function + #'rainbow-delimiters-default-pick-face + "The function used to pick a face used to highlight a delimiter. +The function should take three arguments (DEPTH MATCH LOC), where: + - DEPTH is the delimiter depth; when zero or negative, it's an unmatched + delimiter. + - MATCH is nil iff the delimiter is a mismatched closing delimiter. + - LOC is the location of the delimiter. +The function should return a value suitable to use as a value of the `face' text +property, or nil, in which case the delimiter is not highlighted. +The function should not move the point or mark or change the match data." + :tag "Pick face function" + :type 'function + :group 'rainbow-delimiters) + +(defface rainbow-delimiters-base-face + '((default (:inherit unspecified))) + "Face inherited by all other rainbow-delimiter faces." + :group 'rainbow-delimiters-faces) + +(defface rainbow-delimiters-unmatched-face + '((default (:inherit rainbow-delimiters-base-face)) + (((background light)) (:foreground "#88090B")) + (((background dark)) (:inherit rainbow-delimiters-base-face :foreground "#88090B"))) + "Face to highlight unmatched closing delimiters in." + :group 'rainbow-delimiters-faces) + +(defface rainbow-delimiters-mismatched-face + '((t :inherit (rainbow-delimiters-unmatched-face rainbow-delimiters-base-face))) + "Face to highlight mismatched closing delimiters in." + :group 'rainbow-delimiters-faces) + +(eval-when-compile + (defmacro rainbow-delimiters--define-depth-faces () + (let ((faces '()) + (light-colors ["#707183" "#7388d6" "#909183" "#709870" "#907373" + "#6276ba" "#858580" "#80a880" "#887070"]) + (dark-colors ["grey55" "#93a8c6" "#b0b1a3" "#97b098" "#aebed8" + "#b0b0b3" "#90a890" "#a2b6da" "#9cb6ad"])) + (dotimes (i 9) + (push `(defface ,(intern (format "rainbow-delimiters-depth-%d-face" (1+ i))) + '((default (:inherit rainbow-delimiters-base-face)) + (((class color) (background light)) :foreground ,(aref light-colors i)) + (((class color) (background dark)) :foreground ,(aref dark-colors i))) + ,(format "Nested delimiter face, depth %d." (1+ i)) + :group 'rainbow-delimiters-faces) + faces)) + `(progn ,@faces)))) +(rainbow-delimiters--define-depth-faces) + +(defcustom rainbow-delimiters-max-face-count 9 + "Number of faces defined for highlighting delimiter levels. + +Determines depth at which to cycle through faces again. + +It's safe to change this variable provided that for all integers from 1 to the +new value inclusive, a face `rainbow-delimiters-depth-N-face' is defined." + :type 'integer + :group 'rainbow-delimiters) + +(defcustom rainbow-delimiters-outermost-only-face-count 0 + "Number of faces to be used only for N outermost delimiter levels. + +This should be smaller than `rainbow-delimiters-max-face-count'." + :type 'integer + :group 'rainbow-delimiters) + + +(defun rainbow-delimiters-default-pick-face (depth match _loc) + "Return a face name appropriate for nesting depth DEPTH. +DEPTH and MATCH are as in `rainbow-delimiters-pick-face-function'. + +The returned value is either `rainbow-delimiters-unmatched-face', +`rainbow-delimiters-mismatched-face', or one of the +`rainbow-delimiters-depth-N-face' faces, obeying +`rainbow-delimiters-max-face-count' and +`rainbow-delimiters-outermost-only-face-count'." + (cond + ((<= depth 0) + 'rainbow-delimiters-unmatched-face) + ((not match) + 'rainbow-delimiters-mismatched-face) + (t + (intern-soft + (concat "rainbow-delimiters-depth-" + (number-to-string + (if (<= depth rainbow-delimiters-max-face-count) + ;; Our nesting depth has a face defined for it. + depth + ;; Deeper than # of defined faces; cycle back through to + ;; `rainbow-delimiters-outermost-only-face-count' + 1. + ;; Return face # that corresponds to current nesting level. + (+ 1 rainbow-delimiters-outermost-only-face-count + (mod (- depth rainbow-delimiters-max-face-count 1) + (- rainbow-delimiters-max-face-count + rainbow-delimiters-outermost-only-face-count))))) + "-face"))))) + +(defun rainbow-delimiters--apply-color (loc depth match) + "Highlight a single delimiter at LOC according to DEPTH. + +LOC is the location of the character to add text properties to. +DEPTH is the nested depth at LOC, which determines the face to use. +MATCH is nil iff it's a mismatched closing delimiter." + (let ((face (funcall rainbow-delimiters-pick-face-function depth match loc))) + (when face + (font-lock-prepend-text-property loc (1+ loc) 'face face)))) + +(defun rainbow-delimiters--char-ineligible-p (loc ppss delim-syntax-code) + "Return t if char at LOC should not be highlighted. +PPSS is the `parse-partial-sexp' state at LOC. +DELIM-SYNTAX-CODE is the `car' of a raw syntax descriptor at LOC. + +Returns t if char at loc meets one of the following conditions: +- Inside a string. +- Inside a comment. +- Is an escaped char, e.g. ?\)" + (or + (nth 3 ppss) ; inside string? + (nth 4 ppss) ; inside comment? + (nth 5 ppss) ; escaped according to the syntax table? + ;; Note: no need to consider single-char openers, they're already handled + ;; by looking at ppss. + (cond + ;; Two character opener, LOC at the first character? + ((/= 0 (logand #x10000 delim-syntax-code)) + (/= 0 (logand #x20000 (or (car (syntax-after (1+ loc))) 0)))) + ;; Two character opener, LOC at the second character? + ((/= 0 (logand #x20000 delim-syntax-code)) + (/= 0 (logand #x10000 (or (car (syntax-after (1- loc))) 0)))) + (t + nil)))) + +;; Main function called by font-lock. +(defun rainbow-delimiters--propertize (end) + "Highlight delimiters in region between point and END. + +Used by font-lock for dynamic highlighting." + (let* ((last-ppss-pos (point)) + (ppss (syntax-ppss))) + (while (> end (progn (skip-syntax-forward "^()" end) + (point))) + (let* ((delim-pos (point)) + (delim-syntax (syntax-after delim-pos))) + (setq ppss (parse-partial-sexp last-ppss-pos delim-pos nil nil ppss)) + (setq last-ppss-pos delim-pos) + ;; `skip-syntax-forward' leaves the point at the delimiter, move past + ;; it. + (forward-char) + (let ((delim-syntax-code (car delim-syntax))) + (cond + ((rainbow-delimiters--char-ineligible-p delim-pos ppss delim-syntax-code) + nil) + ((= 4 (logand #xFFFF delim-syntax-code)) + ;; The (1+ ...) is needed because `parse-partial-sexp' returns the + ;; depth at the opening delimiter, not in the block being started. + (rainbow-delimiters--apply-color delim-pos (1+ (nth 0 ppss)) t)) + (t + ;; Not an opening delimiter, so it's a closing delimiter. + (let ((matches-p (eq (cdr delim-syntax) (char-after (nth 1 ppss))))) + (rainbow-delimiters--apply-color delim-pos (nth 0 ppss) matches-p)))))))) + ;; We already fontified the delimiters, tell font-lock there's nothing more + ;; to do. + nil) + +;; NB: no face defined here because we apply the faces ourselves instead of +;; leaving that to font-lock. +(defconst rainbow-delimiters--font-lock-keywords + '(rainbow-delimiters--propertize)) + +;;;###autoload +(define-minor-mode rainbow-delimiters-mode + "Highlight nested parentheses, brackets, and braces according to their depth." + nil "" nil ; No modeline lighter - it's already obvious when the mode is on. + (font-lock-remove-keywords nil rainbow-delimiters--font-lock-keywords) + (when rainbow-delimiters-mode + (font-lock-add-keywords nil rainbow-delimiters--font-lock-keywords 'append) + (set (make-local-variable 'jit-lock-contextually) t) + (when (or (bound-and-true-p syntax-begin-function) + (bound-and-true-p font-lock-beginning-of-syntax-function)) + ;; We're going to modify `syntax-begin-function', so flush the cache to + ;; avoid getting cached values that used the old value. + (syntax-ppss-flush-cache 0)) + ;; `syntax-begin-function' may break the assumption we rely on that + ;; `syntax-ppss' is exactly equivalent to `parse-partial-sexp' from + ;; `point-min'. Just don't use it, the performance hit should be negligible. + (when (boundp 'syntax-begin-function) + (set (make-local-variable 'syntax-begin-function) nil)) + ;; Obsolete equivalent of `syntax-begin-function'. + (when (boundp 'font-lock-beginning-of-syntax-function) + (set (make-local-variable 'font-lock-beginning-of-syntax-function) nil))) + (when font-lock-mode + (if (fboundp 'font-lock-flush) + (font-lock-flush) + (with-no-warnings (font-lock-fontify-buffer))))) + +;;;###autoload +(defun rainbow-delimiters-mode-enable () + "Enable `rainbow-delimiters-mode'." + (rainbow-delimiters-mode 1)) + +;;;###autoload +(defun rainbow-delimiters-mode-disable () + "Disable `rainbow-delimiters-mode'." + (rainbow-delimiters-mode 0)) + +(provide 'rainbow-delimiters) +;;; rainbow-delimiters.el ends here diff --git a/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters.elc b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters.elc new file mode 100644 index 0000000..2bc2a7b Binary files /dev/null and b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters.elc differ diff --git a/elpa/request-20170201.147/request-autoloads.el b/elpa/request-20170201.147/request-autoloads.el new file mode 100644 index 0000000..ecaa121 --- /dev/null +++ b/elpa/request-20170201.147/request-autoloads.el @@ -0,0 +1,15 @@ +;;; request-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil nil ("request.el") (23391 65272 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; request-autoloads.el ends here diff --git a/elpa/request-20170201.147/request-pkg.el b/elpa/request-20170201.147/request-pkg.el new file mode 100644 index 0000000..dd26d4f --- /dev/null +++ b/elpa/request-20170201.147/request-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "request" "20170201.147" "Compatible layer for URL request in Emacs" '((emacs "24.4")) :commit "a3d080e57eb8be606fbf39d1baff94e1b16e1fb8" :authors '(("Takafumi Arakaki ")) :maintainer '("Takafumi Arakaki ")) diff --git a/elpa/request-20170201.147/request.el b/elpa/request-20170201.147/request.el new file mode 100644 index 0000000..e282ade --- /dev/null +++ b/elpa/request-20170201.147/request.el @@ -0,0 +1,1224 @@ +;;; request.el --- Compatible layer for URL request in Emacs -*- lexical-binding: t; -*- + +;; Copyright (C) 2012 Takafumi Arakaki +;; Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2012 +;; Free Software Foundation, Inc. + +;; Author: Takafumi Arakaki +;; Package-Requires: ((emacs "24.4")) +;; Package-Version: 20170201.147 +;; Version: 0.3.0 + +;; This file is NOT part of GNU Emacs. + +;; request.el 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. + +;; request.el 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 request.el. +;; If not, see . + +;;; Commentary: + +;; Request.el is a HTTP request library with multiple backends. It +;; supports url.el which is shipped with Emacs and curl command line +;; program. User can use curl when s/he has it, as curl is more reliable +;; than url.el. Library author can use request.el to avoid imposing +;; external dependencies such as curl to users while giving richer +;; experience for users who have curl. + +;; Following functions are adapted from GNU Emacs source code. +;; Free Software Foundation holds the copyright of them. +;; * `request--process-live-p' +;; * `request--url-default-expander' + +;;; Code: + +(eval-when-compile + (defvar url-http-method) + (defvar url-http-response-status)) + +(require 'cl-lib) +(require 'url) +(require 'mail-utils) + +(defgroup request nil + "Compatible layer for URL request in Emacs." + :group 'comm + :prefix "request-") + +(defconst request-version "0.3.0") + + +;;; Customize variables + +(defcustom request-storage-directory + (concat (file-name-as-directory user-emacs-directory) "request") + "Directory to store data related to request.el." + :type 'directory) + +(defcustom request-curl "curl" + "Executable for curl command." + :type 'string) + +(defcustom request-curl-options nil + "curl command options. + +List of strings that will be passed to every curl invocation. You can pass +extra options here, like setting the proxy." + :type '(repeat string)) + +(defcustom request-backend (if (executable-find request-curl) + 'curl + 'url-retrieve) + "Backend to be used for HTTP request. +Automatically set to `curl' if curl command is found." + :type '(choice (const :tag "cURL backend" curl) + (const :tag "url-retrieve backend" url-retrieve))) + +(defcustom request-timeout nil + "Default request timeout in second. +`nil' means no timeout." + :type '(choice (integer :tag "Request timeout seconds") + (boolean :tag "No timeout" nil))) + +(defcustom request-temp-prefix "emacs-request" + "Prefix for temporary files created by Request." + :type 'string + :risky t) + +(defcustom request-log-level -1 + "Logging level for request. +One of `error'/`warn'/`info'/`verbose'/`debug'. +-1 means no logging." + :type '(choice (integer :tag "No logging" -1) + (const :tag "Level error" error) + (const :tag "Level warn" warn) + (const :tag "Level info" info) + (const :tag "Level Verbose" verbose) + (const :tag "Level DEBUG" debug))) + +(defcustom request-message-level 'warn + "Logging level for request. +See `request-log-level'." + :type '(choice (integer :tag "No logging" -1) + (const :tag "Level error" error) + (const :tag "Level warn" warn) + (const :tag "Level info" info) + (const :tag "Level Verbose" verbose) + (const :tag "Level DEBUG" debug))) + + +;;; Utilities + +(defun request--safe-apply (function &rest arguments) + (condition-case err + (apply #'apply function arguments) + ((debug error)))) + +(defun request--safe-call (function &rest arguments) + (request--safe-apply function arguments)) + +;; (defun request--url-no-cache (url) +;; "Imitate `cache=false' of `jQuery.ajax'. +;; See: http://api.jquery.com/jQuery.ajax/" +;; ;; FIXME: parse URL before adding ?_=TIME. +;; (concat url (format-time-string "?_=%s"))) + +(defmacro request--document-function (function docstring) + "Document FUNCTION with DOCSTRING. Use this for defstruct accessor etc." + (declare (indent defun) + (doc-string 2)) + `(put ',function 'function-documentation ,docstring)) + +(defun request--process-live-p (process) + "Copied from `process-live-p' for backward compatibility (Emacs < 24). +Adapted from lisp/subr.el. +FSF holds the copyright of this function: + Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2012 + Free Software Foundation, Inc." + (memq (process-status process) '(run open listen connect stop))) + + +;;; Logging + +(defconst request--log-level-def + '(;; debugging + (blather . 60) (trace . 50) (debug . 40) + ;; information + (verbose . 30) (info . 20) + ;; errors + (warn . 10) (error . 0)) + "Named logging levels.") + +(defun request--log-level-as-int (level) + (if (integerp level) + level + (or (cdr (assq level request--log-level-def)) + 0))) + +(defvar request-log-buffer-name " *request-log*") + +(defun request--log-buffer () + (get-buffer-create request-log-buffer-name)) + +(defmacro request-log (level fmt &rest args) + (declare (indent 1)) + `(let ((level (request--log-level-as-int ,level)) + (log-level (request--log-level-as-int request-log-level)) + (msg-level (request--log-level-as-int request-message-level))) + (when (<= level (max log-level msg-level)) + (let ((msg (format "[%s] %s" ,level + (condition-case err + (format ,fmt ,@args) + (error (format " +!!! Logging error while executing: +%S +!!! Error: +%S" + ',args err)))))) + (when (<= level log-level) + (with-current-buffer (request--log-buffer) + (setq buffer-read-only t) + (let ((inhibit-read-only t)) + (goto-char (point-max)) + (insert msg "\n")))) + (when (<= level msg-level) + (message "REQUEST %s" msg)))))) + + +;;; HTTP specific utilities + +(defconst request--url-unreserved-chars + '(?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m ?n ?o ?p ?q ?r ?s ?t ?u ?v ?w ?x ?y ?z + ?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M ?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W ?X ?Y ?Z + ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 + ?- ?_ ?. ?~) + "`url-unreserved-chars' copied from Emacs 24.3 release candidate. +This is used for making `request--urlencode-alist' RFC 3986 compliant +for older Emacs versions.") + +(defun request--urlencode-alist (alist) + ;; FIXME: make monkey patching `url-unreserved-chars' optional + (let ((url-unreserved-chars request--url-unreserved-chars)) + (cl-loop for sep = "" then "&" + for (k . v) in alist + concat sep + concat (url-hexify-string (format "%s" k)) + concat "=" + concat (url-hexify-string (format "%s" v))))) + + +;;; Header parser + +(defun request--parse-response-at-point () + "Parse the first header line such as \"HTTP/1.1 200 OK\"." + (when (re-search-forward "\\=[ \t\n]*HTTP/\\([0-9\\.]+\\) +\\([0-9]+\\)" nil t) + (list :version (match-string 1) + :code (string-to-number (match-string 2))))) + +(defun request--goto-next-body () + (re-search-forward "^\r\n")) + + +;;; Response object + +(cl-defstruct request-response + "A structure holding all relevant information of a request." + status-code history data error-thrown symbol-status url + done-p settings + ;; internal variables + -buffer -raw-header -timer -backend -tempfiles) + +(defmacro request--document-response (function docstring) + (declare (indent defun) + (doc-string 2)) + `(request--document-function ,function ,(concat docstring " + +.. This is an accessor for `request-response' object. + +\(fn RESPONSE)"))) + +(request--document-response request-response-status-code + "Integer HTTP response code (e.g., 200).") + +(request--document-response request-response-history + "Redirection history (a list of response object). +The first element is the oldest redirection. + +You can use restricted portion of functions for the response +objects in the history slot. It also depends on backend. Here +is the table showing what functions you can use for the response +objects in the history slot. + +==================================== ============== ============== +Slots Backends +------------------------------------ ----------------------------- +\\ curl url-retrieve +==================================== ============== ============== +request-response-url yes yes +request-response-header yes no +other functions no no +==================================== ============== ============== +") + +(request--document-response request-response-data + "Response parsed by the given parser.") + +(request--document-response request-response-error-thrown + "Error thrown during request. +It takes the form of ``(ERROR-SYMBOL . DATA)``, which can be +re-raised (`signal'ed) by ``(signal ERROR-SYMBOL DATA)``.") + +(request--document-response request-response-symbol-status + "A symbol representing the status of request (not HTTP response code). +One of success/error/timeout/abort/parse-error.") + +(request--document-response request-response-url + "Final URL location of response.") + +(request--document-response request-response-done-p + "Return t when the request is finished or aborted.") + +(request--document-response request-response-settings + "Keyword arguments passed to `request' function. +Some arguments such as HEADERS is changed to the one actually +passed to the backend. Also, it has additional keywords such +as URL which is the requested URL.") + +(defun request-response-header (response field-name) + "Fetch the values of RESPONSE header field named FIELD-NAME. + +It returns comma separated values when the header has multiple +field with the same name, as :RFC:`2616` specifies. + +Examples:: + + (request-response-header response + \"content-type\") ; => \"text/html; charset=utf-8\" + (request-response-header response + \"unknown-field\") ; => nil +" + (let ((raw-header (request-response--raw-header response))) + (when raw-header + (with-temp-buffer + (erase-buffer) + (insert raw-header) + ;; ALL=t to fetch all fields with the same name to get comma + ;; separated value [#rfc2616-sec4]_. + (mail-fetch-field field-name nil t))))) +;; .. [#rfc2616-sec4] RFC2616 says this is the right thing to do +;; (see http://tools.ietf.org/html/rfc2616.html#section-4.2). +;; Python's requests module does this too. + + +;;; Backend dispatcher + +(defconst request--backend-alist + '((url-retrieve + . ((request . request--url-retrieve) + (request-sync . request--url-retrieve-sync) + (terminate-process . delete-process) + (get-cookies . request--url-retrieve-get-cookies))) + (curl + . ((request . request--curl) + (request-sync . request--curl-sync) + (terminate-process . interrupt-process) + (get-cookies . request--curl-get-cookies)))) + "Map backend and method name to actual method (symbol). + +It's alist of alist, of the following form:: + + ((BACKEND . ((METHOD . FUNCTION) ...)) ...) + +It would be nicer if I can use EIEIO. But as CEDET is included +in Emacs by 23.2, using EIEIO means abandon older Emacs versions. +It is probably necessary if I need to support more backends. But +let's stick to manual dispatch for now.") +;; See: (view-emacs-news "23.2") + +(defun request--choose-backend (method) + "Return `fucall'able object for METHOD of current `request-backend'." + (assoc-default + method + (or (assoc-default request-backend request--backend-alist) + (error "%S is not valid `request-backend'." request-backend)))) + + +;;; Cookie + +(defun request-cookie-string (host &optional localpart secure) + "Return cookie string (like `document.cookie'). + +Example:: + + (request-cookie-string \"127.0.0.1\" \"/\") ; => \"key=value; key2=value2\" +" + (mapconcat (lambda (nv) (concat (car nv) "=" (cdr nv))) + (request-cookie-alist host localpart secure) + "; ")) + +(defun request-cookie-alist (host &optional localpart secure) + "Return cookies as an alist. + +Example:: + + (request-cookie-alist \"127.0.0.1\" \"/\") ; => ((\"key\" . \"value\") ...) +" + (funcall (request--choose-backend 'get-cookies) host localpart secure)) + + +;;; Main + +(cl-defun request-default-error-callback (url &key symbol-status + &allow-other-keys) + (request-log 'error + "Error (%s) while connecting to %s." symbol-status url)) + +(cl-defun request (url &rest settings + &key + (type "GET") + (params nil) + (data nil) + (files nil) + (parser nil) + (headers nil) + (success nil) + (error nil) + (complete nil) + (timeout request-timeout) + (status-code nil) + (sync nil) + (response (make-request-response)) + (unix-socket nil)) + "Send request to URL. + +Request.el has a single entry point. It is `request'. + +==================== ======================================================== +Keyword argument Explanation +==================== ======================================================== +TYPE (string) type of request to make: POST/GET/PUT/DELETE +PARAMS (alist) set \"?key=val\" part in URL +DATA (string/alist) data to be sent to the server +FILES (alist) files to be sent to the server (see below) +PARSER (symbol) a function that reads current buffer and return data +HEADERS (alist) additional headers to send with the request +SUCCESS (function) called on success +ERROR (function) called on error +COMPLETE (function) called on both success and error +TIMEOUT (number) timeout in second +STATUS-CODE (alist) map status code (int) to callback +SYNC (bool) If `t', wait until request is done. Default is `nil'. +==================== ======================================================== + + +* Callback functions + +Callback functions STATUS, ERROR, COMPLETE and `cdr's in element of +the alist STATUS-CODE take same keyword arguments listed below. For +forward compatibility, these functions must ignore unused keyword +arguments (i.e., it's better to use `&allow-other-keys' [#]_).:: + + (CALLBACK ; SUCCESS/ERROR/COMPLETE/STATUS-CODE + :data data ; whatever PARSER function returns, or nil + :error-thrown error-thrown ; (ERROR-SYMBOL . DATA), or nil + :symbol-status symbol-status ; success/error/timeout/abort/parse-error + :response response ; request-response object + ...) + +.. [#] `&allow-other-keys' is a special \"markers\" available in macros + in the CL library for function definition such as `cl-defun' and + `cl-function'. Without this marker, you need to specify all arguments + to be passed. This becomes problem when request.el adds new arguments + when calling callback functions. If you use `&allow-other-keys' + (or manually ignore other arguments), your code is free from this + problem. See info node `(cl) Argument Lists' for more information. + +Arguments data, error-thrown, symbol-status can be accessed by +`request-response-data', `request-response-error-thrown', +`request-response-symbol-status' accessors, i.e.:: + + (request-response-data RESPONSE) ; same as data + +Response object holds other information which can be accessed by +the following accessors: +`request-response-status-code', +`request-response-url' and +`request-response-settings' + +* STATUS-CODE callback + +STATUS-CODE is an alist of the following format:: + + ((N-1 . CALLBACK-1) + (N-2 . CALLBACK-2) + ...) + +Here, N-1, N-2,... are integer status codes such as 200. + + +* FILES + +FILES is an alist of the following format:: + + ((NAME-1 . FILE-1) + (NAME-2 . FILE-2) + ...) + +where FILE-N is a list of the form:: + + (FILENAME &key PATH BUFFER STRING MIME-TYPE) + +FILE-N can also be a string (path to the file) or a buffer object. +In that case, FILENAME is set to the file name or buffer name. + +Example FILES argument:: + + `((\"passwd\" . \"/etc/passwd\") ; filename = passwd + (\"scratch\" . ,(get-buffer \"*scratch*\")) ; filename = *scratch* + (\"passwd2\" . (\"password.txt\" :file \"/etc/passwd\")) + (\"scratch2\" . (\"scratch.txt\" :buffer ,(get-buffer \"*scratch*\"))) + (\"data\" . (\"data.csv\" :data \"1,2,3\\n4,5,6\\n\"))) + +.. note:: FILES is implemented only for curl backend for now. + As furl.el_ supports multipart POST, it should be possible to + support FILES in pure elisp by making furl.el_ another backend. + Contributions are welcome. + + .. _furl.el: http://code.google.com/p/furl-el/ + + +* PARSER function + +PARSER function takes no argument and it is executed in the +buffer with HTTP response body. The current position in the HTTP +response buffer is at the beginning of the buffer. As the HTTP +header is stripped off, the cursor is actually at the beginning +of the response body. So, for example, you can pass `json-read' +to parse JSON object in the buffer. To fetch whole response as a +string, pass `buffer-string'. + +When using `json-read', it is useful to know that the returned +type can be modified by `json-object-type', `json-array-type', +`json-key-type', `json-false' and `json-null'. See docstring of +each function for what it does. For example, to convert JSON +objects to plist instead of alist, wrap `json-read' by `lambda' +like this.:: + + (request + \"http://...\" + :parser (lambda () + (let ((json-object-type 'plist)) + (json-read))) + ...) + +This is analogous to the `dataType' argument of jQuery.ajax_. +Only this function can access to the process buffer, which +is killed immediately after the execution of this function. + +* SYNC + +Synchronous request is functional, but *please* don't use it +other than testing or debugging. Emacs users have better things +to do rather than waiting for HTTP request. If you want a better +way to write callback chains, use `request-deferred'. + +If you can't avoid using it (e.g., you are inside of some hook +which must return some value), make sure to set TIMEOUT to +relatively small value. + +Due to limitation of `url-retrieve-synchronously', response slots +`request-response-error-thrown', `request-response-history' and +`request-response-url' are unknown (always `nil') when using +synchronous request with `url-retrieve' backend. + +* Note + +API of `request' is somewhat mixture of jQuery.ajax_ (Javascript) +and requests.request_ (Python). + +.. _jQuery.ajax: http://api.jquery.com/jQuery.ajax/ +.. _requests.request: http://docs.python-requests.org +" + (request-log 'debug "REQUEST") + ;; FIXME: support CACHE argument (if possible) + ;; (unless cache + ;; (setq url (request--url-no-cache url))) + (unless error + (setq error (apply-partially #'request-default-error-callback url)) + (setq settings (plist-put settings :error error))) + (unless (or (stringp data) + (null data) + (assoc-string "Content-Type" headers t)) + (setq data (request--urlencode-alist data)) + (setq settings (plist-put settings :data data))) + (when params + (cl-assert (listp params) nil "PARAMS must be an alist. Given: %S" params) + (setq url (concat url (if (string-match-p "\\?" url) "&" "?") + (request--urlencode-alist params)))) + (setq settings (plist-put settings :url url)) + (setq settings (plist-put settings :response response)) + (setf (request-response-settings response) settings) + (setf (request-response-url response) url) + (setf (request-response--backend response) request-backend) + ;; Call `request--url-retrieve'(`-sync') or `request--curl'(`-sync'). + (apply (if sync + (request--choose-backend 'request-sync) + (request--choose-backend 'request)) + url settings) + (when timeout + (request-log 'debug "Start timer: timeout=%s sec" timeout) + (setf (request-response--timer response) + (run-at-time timeout nil + #'request-response--timeout-callback response))) + response) + +(defun request--clean-header (response) + "Strip off carriage returns in the header of REQUEST." + (request-log 'debug "-CLEAN-HEADER") + (let ((buffer (request-response--buffer response)) + (backend (request-response--backend response)) + sep-regexp) + (if (eq backend 'url-retrieve) + ;; FIXME: make this workaround optional. + ;; But it looks like sometimes `url-http-clean-headers' + ;; fails to cleanup. So, let's be bit permissive here... + (setq sep-regexp "^\r?$") + (setq sep-regexp "^\r$")) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (request-log 'trace + "(buffer-string) at %S =\n%s" buffer (buffer-string)) + (goto-char (point-min)) + (when (and (re-search-forward sep-regexp nil t) + ;; Are \r characters stripped off already?: + (not (equal (match-string 0) ""))) + (while (re-search-backward "\r$" (point-min) t) + (replace-match ""))))))) + +(defun request--cut-header (response) + "Cut the first header part in the buffer of RESPONSE and move it to +raw-header slot." + (request-log 'debug "-CUT-HEADER") + (let ((buffer (request-response--buffer response))) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (goto-char (point-min)) + (when (re-search-forward "^$" nil t) + (setf (request-response--raw-header response) + (buffer-substring (point-min) (point))) + (delete-region (point-min) (min (1+ (point)) (point-max)))))))) + +(defun request-untrampify-filename (file) + "Return FILE as the local file name." + (or (file-remote-p file 'localname) file)) + +(defun request--parse-data (response parser) + "Run PARSER in current buffer if ERROR-THROWN is nil, +then kill the current buffer." + (request-log 'debug "-PARSE-DATA") + (let ((buffer (request-response--buffer response))) + (request-log 'debug "parser = %s" parser) + (when (and (buffer-live-p buffer) parser) + (with-current-buffer buffer + (request-log 'trace + "(buffer-string) at %S =\n%s" buffer (buffer-string)) + (when (/= (request-response-status-code response) 204) + (goto-char (point-min)) + (setf (request-response-data response) (funcall parser))))))) + +(cl-defun request--callback (buffer &key parser success error complete + timeout status-code response + &allow-other-keys) + (request-log 'debug "REQUEST--CALLBACK") + (request-log 'debug "(buffer-string) =\n%s" + (when (buffer-live-p buffer) + (with-current-buffer buffer (buffer-string)))) + + ;; Sometimes BUFFER given as the argument is different from the + ;; buffer already set in RESPONSE. That's why it is reset here. + ;; FIXME: Refactor how BUFFER is passed around. + (setf (request-response--buffer response) buffer) + (request-response--cancel-timer response) + (cl-symbol-macrolet + ((error-thrown (request-response-error-thrown response)) + (symbol-status (request-response-symbol-status response)) + (data (request-response-data response)) + (done-p (request-response-done-p response))) + + ;; Parse response header + (request--clean-header response) + (request--cut-header response) + ;; Note: Try to do this even `error-thrown' is set. For example, + ;; timeout error can occur while downloading response body and + ;; header is there in that case. + + ;; Parse response body + (request-log 'debug "error-thrown = %S" error-thrown) + (condition-case err + (request--parse-data response parser) + (error + ;; If there was already an error (e.g. server timeout) do not set the + ;; status to `parse-error'. + (unless error-thrown + (setq symbol-status 'parse-error) + (setq error-thrown err) + (request-log 'error "Error from parser %S: %S" parser err)))) + (kill-buffer buffer) + (request-log 'debug "data = %s" data) + + ;; Determine `symbol-status' + (unless symbol-status + (setq symbol-status (if error-thrown 'error 'success))) + (request-log 'debug "symbol-status = %s" symbol-status) + + ;; Call callbacks + (let ((args (list :data data + :symbol-status symbol-status + :error-thrown error-thrown + :response response))) + (let* ((success-p (eq symbol-status 'success)) + (cb (if success-p success error)) + (name (if success-p "success" "error"))) + (when cb + (request-log 'debug "Executing %s callback." name) + (request--safe-apply cb args))) + + (let ((cb (cdr (assq (request-response-status-code response) + status-code)))) + (when cb + (request-log 'debug "Executing status-code callback.") + (request--safe-apply cb args))) + + (when complete + (request-log 'debug "Executing complete callback.") + (request--safe-apply complete args))) + + (setq done-p t) + + ;; Remove temporary files + ;; FIXME: Make tempfile cleanup more reliable. It is possible + ;; callback is never called. + (request--safe-delete-files (request-response--tempfiles response)))) + +(cl-defun request-response--timeout-callback (response) + (request-log 'debug "-TIMEOUT-CALLBACK") + (setf (request-response-symbol-status response) 'timeout) + (setf (request-response-error-thrown response) '(error . ("Timeout"))) + (let* ((buffer (request-response--buffer response)) + (proc (and (buffer-live-p buffer) (get-buffer-process buffer)))) + (when proc + ;; This will call `request--callback': + (funcall (request--choose-backend 'terminate-process) proc)) + + (cl-symbol-macrolet ((done-p (request-response-done-p response))) + (unless done-p + ;; This code should never be executed. However, it occurs + ;; sometimes with `url-retrieve' backend. + ;; FIXME: In Emacs 24.3.50 or later, this is always executed in + ;; request-get-timeout test. Find out if it is fine. + (request-log 'error "Callback is not called when stopping process! \ +Explicitly calling from timer.") + (when (buffer-live-p buffer) + (cl-destructuring-bind (&key code &allow-other-keys) + (with-current-buffer buffer + (goto-char (point-min)) + (request--parse-response-at-point)) + (setf (request-response-status-code response) code))) + (apply #'request--callback + buffer + (request-response-settings response)) + (setq done-p t))))) + +(defun request-response--cancel-timer (response) + (request-log 'debug "REQUEST-RESPONSE--CANCEL-TIMER") + (cl-symbol-macrolet ((timer (request-response--timer response))) + (when timer + (cancel-timer timer) + (setq timer nil)))) + + +(defun request-abort (response) + "Abort request for RESPONSE (the object returned by `request'). +Note that this function invoke ERROR and COMPLETE callbacks. +Callbacks may not be called immediately but called later when +associated process is exited." + (cl-symbol-macrolet ((buffer (request-response--buffer response)) + (symbol-status (request-response-symbol-status response)) + (done-p (request-response-done-p response))) + (let ((process (get-buffer-process buffer))) + (unless symbol-status ; should I use done-p here? + (setq symbol-status 'abort) + (setq done-p t) + (when (and + (processp process) ; process can be nil when buffer is killed + (request--process-live-p process)) + (funcall (request--choose-backend 'terminate-process) process)))))) + + +;;; Backend: `url-retrieve' + +(cl-defun request--url-retrieve-preprocess-settings + (&rest settings &key type data files headers &allow-other-keys) + (when files + (error "`url-retrieve' backend does not support FILES.")) + (when (and (equal type "POST") + data + (not (assoc-string "Content-Type" headers t))) + (push '("Content-Type" . "application/x-www-form-urlencoded") headers) + (setq settings (plist-put settings :headers headers))) + settings) + +(cl-defun request--url-retrieve (url &rest settings + &key type data timeout response + &allow-other-keys + &aux headers) + (setq settings (apply #'request--url-retrieve-preprocess-settings settings)) + (setq headers (plist-get settings :headers)) + (let* ((url-request-extra-headers headers) + (url-request-method type) + (url-request-data data) + (buffer (url-retrieve url #'request--url-retrieve-callback + (nconc (list :response response) settings))) + (proc (get-buffer-process buffer))) + (setf (request-response--buffer response) buffer) + (process-put proc :request-response response) + (request-log 'debug "Start querying: %s" url) + (set-process-query-on-exit-flag proc nil))) + +(cl-defun request--url-retrieve-callback (status &rest settings + &key response url + &allow-other-keys) + (declare (special url-http-method + url-http-response-status)) + (request-log 'debug "-URL-RETRIEVE-CALLBACK") + (request-log 'debug "status = %S" status) + (request-log 'debug "url-http-method = %s" url-http-method) + (request-log 'debug "url-http-response-status = %s" url-http-response-status) + + (setf (request-response-status-code response) url-http-response-status) + (let ((redirect (plist-get status :redirect))) + (when redirect + (setf (request-response-url response) redirect))) + ;; Construct history slot + (cl-loop for v in + (cl-loop with first = t + with l = nil + for (k v) on status by 'cddr + when (eq k :redirect) + if first + do (setq first nil) + else + do (push v l) + finally do (cons url l)) + do (let ((r (make-request-response :-backend 'url-retrieve))) + (setf (request-response-url r) v) + (push r (request-response-history response)))) + + (cl-symbol-macrolet ((error-thrown (request-response-error-thrown response)) + (status-error (plist-get status :error))) + (when (and error-thrown status-error) + (request-log 'warn + "Error %S thrown already but got another error %S from \ +`url-retrieve'. Ignoring it..." error-thrown status-error)) + (unless error-thrown + (setq error-thrown status-error))) + + (apply #'request--callback (current-buffer) settings)) + +(cl-defun request--url-retrieve-sync (url &rest settings + &key type data timeout response + &allow-other-keys + &aux headers) + (setq settings (apply #'request--url-retrieve-preprocess-settings settings)) + (setq headers (plist-get settings :headers)) + (let* ((url-request-extra-headers headers) + (url-request-method type) + (url-request-data data) + (buffer (if timeout + (with-timeout + (timeout + (setf (request-response-symbol-status response) + 'timeout) + (setf (request-response-done-p response) t) + nil) + (url-retrieve-synchronously url)) + (url-retrieve-synchronously url)))) + (setf (request-response--buffer response) buffer) + ;; It seems there is no way to get redirects and URL here... + (when buffer + ;; Fetch HTTP response code + (with-current-buffer buffer + (goto-char (point-min)) + (cl-destructuring-bind (&key version code) + (request--parse-response-at-point) + (setf (request-response-status-code response) code))) + ;; Parse response body, etc. + (apply #'request--callback buffer settings))) + response) + +(defun request--url-retrieve-get-cookies (host localpart secure) + (mapcar + (lambda (c) (cons (url-cookie-name c) (url-cookie-value c))) + (url-cookie-retrieve host localpart secure))) + + +;;; Backend: curl + +(defvar request--curl-cookie-jar nil + "Override what the function `request--curl-cookie-jar' returns. +Currently it is used only for testing.") + +(defun request--curl-cookie-jar () + "Cookie storage for curl backend." + (or request--curl-cookie-jar + (expand-file-name "curl-cookie-jar" request-storage-directory))) + +(defconst request--curl-write-out-template + (if (eq system-type 'windows-nt) + "\\n(:num-redirects %{num_redirects} :url-effective %{url_effective})" + "\\n(:num-redirects %{num_redirects} :url-effective \"%{url_effective}\")")) + +(defun request--curl-mkdir-for-cookie-jar () + (ignore-errors + (make-directory (file-name-directory (request--curl-cookie-jar)) t))) + +(cl-defun request--curl-command + (url &key type data headers timeout response files* unix-socket + &allow-other-keys + &aux + (cookie-jar (convert-standard-filename + (expand-file-name (request--curl-cookie-jar))))) + (append + (list request-curl "--silent" "--include" + "--location" + ;; FIXME: test automatic decompression + "--compressed" + ;; FIMXE: this way of using cookie might be problem when + ;; running multiple requests. + "--cookie" cookie-jar "--cookie-jar" cookie-jar + "--write-out" request--curl-write-out-template) + request-curl-options + (when unix-socket (list "--unix-socket" unix-socket)) + (cl-loop for (name filename path mime-type) in files* + collect "--form" + collect (format "%s=@%s;filename=%s%s" name + (request-untrampify-filename path) filename + (if mime-type + (format ";type=%s" mime-type) + ""))) + (when data + (let ((tempfile (request--make-temp-file))) + (push tempfile (request-response--tempfiles response)) + (let ((file-coding-system-alist nil) + (coding-system-for-write 'binary)) + (with-temp-file tempfile + (setq buffer-file-coding-system 'binary) + (set-buffer-multibyte nil) + (insert data))) + (list "--data-binary" (concat "@" (request-untrampify-filename tempfile))))) + (when type (list "--request" type)) + (cl-loop for (k . v) in headers + collect "--header" + collect (format "%s: %s" k v)) + (list url))) + +(defun request--curl-normalize-files-1 (files get-temp-file) + (cl-loop for (name . item) in files + collect + (cl-destructuring-bind + (filename &key file buffer data mime-type) + (cond + ((stringp item) (list (file-name-nondirectory item) :file item)) + ((bufferp item) (list (buffer-name item) :buffer item)) + (t item)) + (unless (= (cl-loop for v in (list file buffer data) if v sum 1) 1) + (error "Only one of :file/:buffer/:data must be given. Got: %S" + (cons name item))) + (cond + (file + (list name filename file mime-type)) + (buffer + (let ((tf (funcall get-temp-file))) + (with-current-buffer buffer + (write-region (point-min) (point-max) tf nil 'silent)) + (list name filename tf mime-type))) + (data + (let ((tf (funcall get-temp-file))) + (with-temp-buffer + (erase-buffer) + (insert data) + (write-region (point-min) (point-max) tf nil 'silent)) + (list name filename tf mime-type))))))) + +(defun request--make-temp-file () + "Create a temporary file." + (if (file-remote-p default-directory) + (let ((tramp-temp-name-prefix request-temp-prefix) + (vec (tramp-dissect-file-name default-directory))) + (tramp-make-tramp-file-name + (tramp-file-name-method vec) + (tramp-file-name-user vec) + (tramp-file-name-host vec) + (tramp-make-tramp-temp-file vec) + (tramp-file-name-hop vec))) + (make-temp-file request-temp-prefix))) + +(defun request--curl-normalize-files (files) + "Change FILES into a list of (NAME FILENAME PATH MIME-TYPE). +This is to make `request--curl-command' cleaner by converting +FILES to a homogeneous list. It returns a list (FILES* TEMPFILES) +where FILES* is a converted FILES and TEMPFILES is a list of +temporary file paths." + (let (tempfiles noerror) + (unwind-protect + (let* ((get-temp-file (lambda () + (let ((tf (request--make-temp-file))) + (push tf tempfiles) + tf))) + (files* (request--curl-normalize-files-1 files get-temp-file))) + (setq noerror t) + (list files* tempfiles)) + (unless noerror + ;; Remove temporary files only when an error occurs + (request--safe-delete-files tempfiles))))) + +(defun request--safe-delete-files (files) + "Remove FILES but do not raise error when failed to do so." + (mapc (lambda (f) (condition-case err + (delete-file f) + (error (request-log 'error + "Failed delete file %s. Got: %S" f err)))) + files)) + +(cl-defun request--curl (url &rest settings + &key type data files headers timeout response + &allow-other-keys) + "cURL-based request backend. + +Redirection handling strategy +----------------------------- + +curl follows redirection when --location is given. However, +all headers are printed when it is used with --include option. +Number of redirects is printed out sexp-based message using +--write-out option (see `request--curl-write-out-template'). +This number is used for removing extra headers and parse +location header from the last redirection header. + +Sexp at the end of buffer and extra headers for redirects are +removed from the buffer before it is shown to the parser function. +" + (request--curl-mkdir-for-cookie-jar) + (let* (;; Use pipe instead of pty. Otherwise, curl process hangs. + (process-connection-type nil) + ;; Avoid starting program in non-existing directory. + (home-directory (if (file-remote-p default-directory) + (let ((vec (tramp-dissect-file-name default-directory))) + (tramp-make-tramp-file-name + (tramp-file-name-method vec) + (tramp-file-name-user vec) + (tramp-file-name-host vec) + "~/" + (tramp-file-name-hop vec))) + "~/")) + (default-directory (expand-file-name home-directory)) + (buffer (generate-new-buffer " *request curl*")) + (command (cl-destructuring-bind + (files* tempfiles) + (request--curl-normalize-files files) + (setf (request-response--tempfiles response) tempfiles) + (apply #'request--curl-command url :files* files* + :response response settings))) + (proc (apply #'start-file-process "request curl" buffer command))) + (request-log 'debug "Run: %s" (mapconcat 'identity command " ")) + (setf (request-response--buffer response) buffer) + (process-put proc :request-response response) + (set-process-coding-system proc 'binary 'binary) + (set-process-query-on-exit-flag proc nil) + (set-process-sentinel proc #'request--curl-callback))) + +(defun request--curl-read-and-delete-tail-info () + "Read a sexp at the end of buffer and remove it and preceding character. +This function moves the point at the end of buffer by side effect. +See also `request--curl-write-out-template'." + (let (forward-sexp-function) + (goto-char (point-max)) + (forward-sexp -1) + (let ((beg (1- (point)))) + (prog1 + (read (current-buffer)) + (delete-region beg (point-max)))))) + +(defconst request--cookie-reserved-re + (mapconcat + (lambda (x) (concat "\\(^" x "\\'\\)")) + '("comment" "commenturl" "discard" "domain" "max-age" "path" "port" + "secure" "version" "expires") + "\\|") + "Uninterested keys in cookie. +See \"set-cookie-av\" in http://www.ietf.org/rfc/rfc2965.txt") + +(defun request--consume-100-continue () + "Remove \"HTTP/* 100 Continue\" header at the point." + (cl-destructuring-bind (&key code &allow-other-keys) + (save-excursion (request--parse-response-at-point)) + (when (equal code 100) + (delete-region (point) (progn (request--goto-next-body) (point))) + ;; FIXME: Does this make sense? Is it possible to have multiple 100? + (request--consume-100-continue)))) + +(defun request--consume-200-connection-established () + "Remove \"HTTP/* 200 Connection established\" header at the point." + (when (looking-at-p "HTTP/1\\.[0-1] 200 Connection established") + (delete-region (point) (progn (request--goto-next-body) (point))))) + +(defun request--curl-preprocess () + "Pre-process current buffer before showing it to user." + (let (history) + (cl-destructuring-bind (&key num-redirects url-effective) + (request--curl-read-and-delete-tail-info) + (goto-char (point-min)) + (request--consume-100-continue) + (request--consume-200-connection-established) + (when (> num-redirects 0) + (cl-loop with case-fold-search = t + repeat num-redirects + ;; Do not store code=100 headers: + do (request--consume-100-continue) + do (let ((response (make-request-response + :-buffer (current-buffer) + :-backend 'curl))) + (request--clean-header response) + (request--cut-header response) + (push response history)))) + + (goto-char (point-min)) + (nconc (list :num-redirects num-redirects :url-effective url-effective + :history (nreverse history)) + (request--parse-response-at-point))))) + +(defun request--curl-absolutify-redirects (start-url redirects) + "Convert relative paths in REDIRECTS to absolute URLs. +START-URL is the URL requested." + (cl-loop for prev-url = start-url then url + for url in redirects + unless (string-match url-nonrelative-link url) + do (setq url (url-expand-file-name url prev-url)) + collect url)) + +(defun request--curl-absolutify-location-history (start-url history) + "Convert relative paths in HISTORY to absolute URLs. +START-URL is the URL requested." + (when history + (setf (request-response-url (car history)) start-url)) + (cl-loop for url in (request--curl-absolutify-redirects + start-url + (mapcar (lambda (response) + (request-response-header response "location")) + history)) + for response in (cdr history) + do (setf (request-response-url response) url))) + +(defun request--curl-callback (proc event) + (let* ((buffer (process-buffer proc)) + (response (process-get proc :request-response)) + (symbol-status (request-response-symbol-status response)) + (settings (request-response-settings response))) + (request-log 'debug "REQUEST--CURL-CALLBACK event = %s" event) + (request-log 'debug "REQUEST--CURL-CALLBACK proc = %S" proc) + (request-log 'debug "REQUEST--CURL-CALLBACK buffer = %S" buffer) + (request-log 'debug "REQUEST--CURL-CALLBACK symbol-status = %S" + symbol-status) + (cond + ((and (memq (process-status proc) '(exit signal)) + (/= (process-exit-status proc) 0)) + (setf (request-response-error-thrown response) (cons 'error event)) + (apply #'request--callback buffer settings)) + ((equal event "finished\n") + (cl-destructuring-bind (&key version code num-redirects history error + url-effective) + (condition-case err + (with-current-buffer buffer + (request--curl-preprocess)) + ((debug error) + (list :error err))) + (request--curl-absolutify-location-history (plist-get settings :url) + history) + (setf (request-response-status-code response) code) + (setf (request-response-url response) url-effective) + (setf (request-response-history response) history) + (setf (request-response-error-thrown response) + (or error (when (>= code 400) `(error . (http ,code))))) + (apply #'request--callback buffer settings)))))) + +(cl-defun request--curl-sync (url &rest settings &key response &allow-other-keys) + ;; To make timeout work, use polling approach rather than using + ;; `call-process'. + (let (finished) + (prog1 (apply #'request--curl url + :complete (lambda (&rest _) (setq finished t)) + settings) + (let ((proc (get-buffer-process (request-response--buffer response)))) + (while (and (not finished) (request--process-live-p proc)) + (accept-process-output proc)))))) + +(defun request--curl-get-cookies (host localpart secure) + (request--netscape-get-cookies (request--curl-cookie-jar) + host localpart secure)) + + +;;; Netscape cookie.txt parser + +(defun request--netscape-cookie-parse () + "Parse Netscape/Mozilla cookie format." + (goto-char (point-min)) + (let ((tsv-re (concat "^\\(#HttpOnly_\\)?" + (cl-loop repeat 6 concat "\\([^\t\n]+\\)\t") + "\\(.*\\)")) + cookies) + (while (not (eobp)) + ;; HttpOnly cookie starts with '#' but its line is not comment line(#60) + (cond ((and (looking-at-p "^#") (not (looking-at-p "^#HttpOnly_"))) t) + ((looking-at-p "^$") t) + ((looking-at tsv-re) + (let ((cookie (cl-loop for i from 1 to 8 collect (match-string i)))) + (push cookie cookies)))) + (forward-line 1)) + (setq cookies (nreverse cookies)) + (cl-loop for (http-only domain flag path secure expiration name value) in cookies + collect (list domain + (equal flag "TRUE") + path + (equal secure "TRUE") + (null (not http-only)) + (string-to-number expiration) + name + value)))) + +(defun request--netscape-filter-cookies (cookies host localpart secure) + (cl-loop for (domain flag path secure-1 http-only expiration name value) in cookies + when (and (equal domain host) + (equal path localpart) + (or secure (not secure-1))) + collect (cons name value))) + +(defun request--netscape-get-cookies (filename host localpart secure) + (when (file-readable-p filename) + (with-temp-buffer + (erase-buffer) + (insert-file-contents filename) + (request--netscape-filter-cookies (request--netscape-cookie-parse) + host localpart secure)))) + +(provide 'request) + +;;; request.el ends here diff --git a/elpa/request-20170201.147/request.elc b/elpa/request-20170201.147/request.elc new file mode 100644 index 0000000..4eabeb2 Binary files /dev/null and b/elpa/request-20170201.147/request.elc differ diff --git a/elpa/request-deferred-20160419.2305/request-deferred-autoloads.el b/elpa/request-deferred-20160419.2305/request-deferred-autoloads.el new file mode 100644 index 0000000..68be693 --- /dev/null +++ b/elpa/request-deferred-20160419.2305/request-deferred-autoloads.el @@ -0,0 +1,16 @@ +;;; request-deferred-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil nil ("request-deferred.el") (23391 65271 0 +;;;;;; 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; request-deferred-autoloads.el ends here diff --git a/elpa/request-deferred-20160419.2305/request-deferred-pkg.el b/elpa/request-deferred-20160419.2305/request-deferred-pkg.el new file mode 100644 index 0000000..41c758b --- /dev/null +++ b/elpa/request-deferred-20160419.2305/request-deferred-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "request-deferred" "20160419.2305" "Wrap request.el by deferred" '((deferred "0.3.1") (request "0.2.0")) :commit "a3d080e57eb8be606fbf39d1baff94e1b16e1fb8" :authors '(("Takafumi Arakaki ")) :maintainer '("Takafumi Arakaki ")) diff --git a/elpa/request-deferred-20160419.2305/request-deferred.el b/elpa/request-deferred-20160419.2305/request-deferred.el new file mode 100644 index 0000000..d6e1d00 --- /dev/null +++ b/elpa/request-deferred-20160419.2305/request-deferred.el @@ -0,0 +1,71 @@ +;;; request-deferred.el --- Wrap request.el by deferred -*- lexical-binding: t; -*- + +;; Copyright (C) 2012 Takafumi Arakaki + +;; Author: Takafumi Arakaki +;; Package-Requires: ((deferred "0.3.1") (request "0.2.0")) +;; Package-Version: 20160419.2305 +;; Version: 0.2.0 + +;; This file is NOT part of GNU Emacs. + +;; request-deferred.el 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. + +;; request-deferred.el 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 request-deferred.el. +;; If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'request) +(require 'deferred) + +(defun request-deferred (url &rest args) + "Send a request and return deferred object associated with it. + +Following deferred callback takes a response object regardless of +the response result. To make sure no error occurs during the +request, check `request-response-error-thrown'. + +Arguments are the same as `request', but COMPLETE callback cannot +be used as it is used for starting deferred callback chain. + +Example:: + + (require 'request-deferred) + + (deferred:$ + (request-deferred \"http://httpbin.org/get\" :parser 'json-read) + (deferred:nextc it + (lambda (response) + (message \"Got: %S\" (request-response-data response))))) +" + + (let* ((d (deferred:new #'identity)) + (callback-post (apply-partially + (lambda (d &rest args) + (deferred:callback-post + d (plist-get args :response))) + d))) + ;; As `deferred:errorback-post' requires an error object to be + ;; posted, use `deferred:callback-post' for success and error + ;; cases. + (setq args (plist-put args :complete callback-post)) + (apply #'request url args) + d)) + +(provide 'request-deferred) + +;;; request-deferred.el ends here diff --git a/elpa/restclient-20171203.1248/restclient-autoloads.el b/elpa/restclient-20171203.1248/restclient-autoloads.el deleted file mode 100644 index 1ccc2f0..0000000 --- a/elpa/restclient-20171203.1248/restclient-autoloads.el +++ /dev/null @@ -1,39 +0,0 @@ -;;; restclient-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "restclient" "restclient.el" (23163 15714 0 -;;;;;; 0)) -;;; Generated autoloads from restclient.el - -(autoload 'restclient-http-send-current "restclient" "\ -Sends current request. -Optional argument RAW don't reformat response if t. -Optional argument STAY-IN-WINDOW do not move focus to response buffer if t. - -\(fn &optional RAW STAY-IN-WINDOW)" t nil) - -(autoload 'restclient-http-send-current-raw "restclient" "\ -Sends current request and get raw result (no reformatting or syntax highlight of XML, JSON or images). - -\(fn)" t nil) - -(autoload 'restclient-http-send-current-stay-in-window "restclient" "\ -Send current request and keep focus in request window. - -\(fn)" t nil) - -(autoload 'restclient-mode "restclient" "\ -Turn on restclient mode. - -\(fn)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; restclient-autoloads.el ends here diff --git a/elpa/restclient-20171203.1248/restclient-pkg.el b/elpa/restclient-20171203.1248/restclient-pkg.el deleted file mode 100644 index 2e848f2..0000000 --- a/elpa/restclient-20171203.1248/restclient-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "restclient" "20171203.1248" "An interactive HTTP client for Emacs" 'nil :commit "0ce4513a6b5ff1e63c73fda30f11efdb7a296c38" :keywords '("http")) diff --git a/elpa/restclient-20171203.1248/restclient.el b/elpa/restclient-20171203.1248/restclient.el deleted file mode 100644 index e149edb..0000000 --- a/elpa/restclient-20171203.1248/restclient.el +++ /dev/null @@ -1,572 +0,0 @@ -;;; restclient.el --- An interactive HTTP client for Emacs -;; -;; Public domain. - -;; Author: Pavel Kurnosov -;; Maintainer: Pavel Kurnosov -;; Created: 01 Apr 2012 -;; Keywords: http -;; Package-Version: 20171203.1248 - -;; This file is not part of GNU Emacs. -;; This file is public domain software. Do what you want. - -;;; Commentary: -;; -;; This is a tool to manually explore and test HTTP REST -;; webservices. Runs queries from a plain-text query sheet, displays -;; results as a pretty-printed XML, JSON and even images. - -;;; Code: -;; -(require 'url) -(require 'json) - -(defgroup restclient nil - "An interactive HTTP client for Emacs." - :group 'tools) - -(defcustom restclient-log-request t - "Log restclient requests to *Messages*." - :group 'restclient - :type 'boolean) - -(defcustom restclient-same-buffer-response t - "Re-use same buffer for responses or create a new one each time." - :group 'restclient - :type 'boolean) - -(defcustom restclient-same-buffer-response-name "*HTTP Response*" - "Name for response buffer." - :group 'restclient - :type 'string) - -(defcustom restclient-inhibit-cookies nil - "Inhibit restclient from sending cookies implicitly." - :group 'restclient - :type 'boolean) - -(defgroup restclient-faces nil - "Faces used in Restclient Mode" - :group 'restclient - :group 'faces) - -(defface restclient-variable-name-face - '((t (:inherit font-lock-preprocessor-face))) - "Face for variable name." - :group 'restclient-faces) - -(defface restclient-variable-string-face - '((t (:inherit font-lock-string-face))) - "Face for variable value (string)." - :group 'restclient-faces) - -(defface restclient-variable-elisp-face - '((t (:inherit font-lock-function-name-face))) - "Face for variable value (Emacs lisp)." - :group 'restclient-faces) - -(defface restclient-variable-multiline-face - '((t (:inherit font-lock-doc-face))) - "Face for multi-line variable value marker." - :group 'restclient-faces) - -(defface restclient-variable-usage-face - '((t (:inherit restclient-variable-name-face))) - "Face for variable usage (only used when headers/body is represented as a single variable, not highlighted when variable appears in the middle of other text)." - :group 'restclient-faces) - -(defface restclient-method-face - '((t (:inherit font-lock-keyword-face))) - "Face for HTTP method." - :group 'restclient-faces) - -(defface restclient-url-face - '((t (:inherit font-lock-function-name-face))) - "Face for variable value (Emacs lisp)." - :group 'restclient-faces) - -(defface restclient-file-upload-face - '((t (:inherit restclient-variable-multiline-face))) - "Face for highlighting upload file paths." - :group 'restclient-faces) - -(defface restclient-header-name-face - '((t (:inherit font-lock-variable-name-face))) - "Face for HTTP header name." - :group 'restclient-faces) - -(defface restclient-header-value-face - '((t (:inherit font-lock-string-face))) - "Face for HTTP header value." - :group 'restclient-faces) - -(defvar restclient-within-call nil) - -(defvar restclient-request-time-start nil) -(defvar restclient-request-time-end nil) - -(defvar restclient-response-loaded-hook nil - "Hook run after response buffer is formatted.") - -(defvar restclient-http-do-hook nil - "Hook to run before making request.") - -(defvar restclient-response-received-hook nil - "Hook run after data is loaded into response buffer.") - -(defcustom restclient-vars-max-passes 10 - "Maximum number of recursive variable references. This is to prevent hanging if two variables reference each other directly or indirectly." - :group 'restclient - :type 'integer) - -(defconst restclient-comment-separator "#") -(defconst restclient-comment-start-regexp (concat "^" restclient-comment-separator)) -(defconst restclient-comment-not-regexp (concat "^[^" restclient-comment-separator "]")) -(defconst restclient-empty-line-regexp "^\\s-*$") - -(defconst restclient-method-url-regexp - "^\\(GET\\|POST\\|DELETE\\|PUT\\|HEAD\\|OPTIONS\\|PATCH\\) \\(.*\\)$") - -(defconst restclient-header-regexp - "^\\([^](),/:;@[\\{}= \t]+\\): \\(.*\\)$") - -(defconst restclient-use-var-regexp - "^\\(:[^: \n]+\\)$") - -(defconst restclient-var-regexp - (concat "^\\(:[^:= ]+\\)[ \t]*\\(:?\\)=[ \t]*\\(<<[ \t]*\n\\(\\(.*\n\\)*?\\)" restclient-comment-separator "\\|\\([^<].*\\)$\\)")) - -(defconst restclient-svar-regexp - "^\\(:[^:= ]+\\)[ \t]*=[ \t]*\\(.+?\\)$") - -(defconst restclient-evar-regexp - "^\\(:[^: ]+\\)[ \t]*:=[ \t]*\\(.+?\\)$") - -(defconst restclient-mvar-regexp - "^\\(:[^: ]+\\)[ \t]*:?=[ \t]*\\(<<\\)[ \t]*$") - -(defconst restclient-file-regexp - "^<[ \t]*\\([^<>\n\r]+\\)[ \t]*$") - -(defconst restclient-content-type-regexp - "^Content-[Tt]ype: \\(\\w+\\)/\\(?:[^\\+\r\n]*\\+\\)*\\([^;\r\n]+\\)") - -;; The following disables the interactive request for user name and -;; password should an API call encounter a permission-denied response. -;; This API is meant to be usable without constant asking for username -;; and password. -(defadvice url-http-handle-authentication (around restclient-fix) - (if restclient-within-call - (setq ad-return-value t) - ad-do-it)) -(ad-activate 'url-http-handle-authentication) - -(defadvice url-cache-extract (around restclient-fix-2) - (unless restclient-within-call - ad-do-it)) -(ad-activate 'url-cache-extract) - -(defadvice url-http-user-agent-string (around restclient-fix-3) - (if restclient-within-call - (setq ad-return-value nil) - ad-do-it)) -(ad-activate 'url-http-user-agent-string) - -(defun restclient-restore-header-variables () - (url-set-mime-charset-string) - (setq url-mime-language-string nil) - (setq url-mime-encoding-string nil) - (setq url-mime-accept-string nil) - (setq url-personal-mail-address nil)) - -(defun restclient-http-do (method url headers entity &rest handle-args) - "Send ENTITY and HEADERS to URL as a METHOD request." - (if restclient-log-request - (message "HTTP %s %s Headers:[%s] Body:[%s]" method url headers entity)) - (let ((url-request-method (encode-coding-string method 'us-ascii)) - (url-request-extra-headers '()) - (url-request-data (encode-coding-string entity 'utf-8))) - - (restclient-restore-header-variables) - - (dolist (header headers) - (let* ((mapped (assoc-string (downcase (car header)) - '(("from" . url-personal-mail-address) - ("accept-encoding" . url-mime-encoding-string) - ("accept-charset" . url-mime-charset-string) - ("accept-language" . url-mime-language-string) - ("accept" . url-mime-accept-string))))) - - (if mapped - (set (cdr mapped) (encode-coding-string (cdr header) 'us-ascii)) - (let* ((hkey (encode-coding-string (car header) 'us-ascii)) - (hvalue (encode-coding-string (cdr header) 'us-ascii))) - (setq url-request-extra-headers (cons (cons hkey hvalue) url-request-extra-headers)))))) - - (setq restclient-within-call t) - (setq restclient-request-time-start (current-time)) - (run-hooks 'restclient-http-do-hook) - (url-retrieve url 'restclient-http-handle-response - (append (list method url (if restclient-same-buffer-response - restclient-same-buffer-response-name - (format "*HTTP %s %s*" method url))) handle-args) nil restclient-inhibit-cookies))) - -(defun restclient-prettify-response (method url) - (save-excursion - (let ((start (point)) (guessed-mode) (end-of-headers)) - (while (and (not (looking-at restclient-empty-line-regexp)) - (eq (progn - (when (looking-at restclient-content-type-regexp) - (setq guessed-mode - (cdr (assoc-string (concat - (match-string-no-properties 1) - "/" - (match-string-no-properties 2)) - '(("text/xml" . xml-mode) - ("text/plain" . text-mode) - ("application/xml" . xml-mode) - ("application/json" . js-mode) - ("image/png" . image-mode) - ("image/jpeg" . image-mode) - ("image/jpg" . image-mode) - ("image/gif" . image-mode) - ("text/html" . html-mode)))))) - (forward-line)) 0))) - (setq end-of-headers (point)) - (while (and (looking-at restclient-empty-line-regexp) - (eq (forward-line) 0))) - (unless guessed-mode - (setq guessed-mode - (or (assoc-default nil - ;; magic mode matches - '(("<\\?xml " . xml-mode) - ("{\\s-*\"" . js-mode)) - (lambda (re _dummy) - (looking-at re))) 'js-mode))) - (let ((headers (buffer-substring-no-properties start end-of-headers))) - (when guessed-mode - (delete-region start (point)) - (unless (eq guessed-mode 'image-mode) - (apply guessed-mode '()) - (if (fboundp 'font-lock-flush) - (font-lock-flush) - (with-no-warnings - (font-lock-fontify-buffer)))) - - (cond - ((eq guessed-mode 'xml-mode) - (goto-char (point-min)) - (while (search-forward-regexp "\>[ \\t]*\<" nil t) - (backward-char) (insert "\n")) - (indent-region (point-min) (point-max))) - - ((eq guessed-mode 'image-mode) - (let* ((img (buffer-string))) - (delete-region (point-min) (point-max)) - (fundamental-mode) - (insert-image (create-image img nil t)))) - - ((eq guessed-mode 'js-mode) - (let ((json-special-chars (remq (assoc ?/ json-special-chars) json-special-chars))) - (ignore-errors (json-pretty-print-buffer))) - (restclient-prettify-json-unicode))) - - (goto-char (point-max)) - (or (eq (point) (point-min)) (insert "\n")) - (let ((hstart (point))) - (insert method " " url "\n" headers) - (insert (format "Request duration: %fs\n" (float-time (time-subtract restclient-request-time-end restclient-request-time-start)))) - (unless (member guessed-mode '(image-mode text-mode)) - (comment-region hstart (point))))))))) - -(defun restclient-prettify-json-unicode () - (save-excursion - (goto-char (point-min)) - (while (re-search-forward "\\\\[Uu]\\([0-9a-fA-F]\\{4\\}\\)" nil t) - (replace-match (char-to-string (decode-char 'ucs (string-to-number (match-string 1) 16))) t nil)))) - -(defun restclient-http-handle-response (status method url bufname raw stay-in-window) - "Switch to the buffer returned by `url-retreive'. -The buffer contains the raw HTTP response sent by the server." - (setq restclient-within-call nil) - (setq restclient-request-time-end (current-time)) - (if (= (point-min) (point-max)) - (signal (car (plist-get status :error)) (cdr (plist-get status :error))) - (restclient-restore-header-variables) - (when (buffer-live-p (current-buffer)) - (with-current-buffer (restclient-decode-response - (current-buffer) - bufname - restclient-same-buffer-response) - (run-hooks 'restclient-response-received-hook) - (unless raw - (restclient-prettify-response method url)) - (buffer-enable-undo) - (run-hooks 'restclient-response-loaded-hook) - (if stay-in-window - (display-buffer (current-buffer) t) - (switch-to-buffer-other-window (current-buffer))))))) - -(defun restclient-decode-response (raw-http-response-buffer target-buffer-name same-name) - "Decode the HTTP response using the charset (encoding) specified in the Content-Type header. If no charset is specified, default to UTF-8." - (let* ((charset-regexp "^Content-Type.*charset=\\([-A-Za-z0-9]+\\)") - (image? (save-excursion - (search-forward-regexp "^Content-Type.*[Ii]mage" nil t))) - (encoding (if (save-excursion - (search-forward-regexp charset-regexp nil t)) - (intern (downcase (match-string 1))) - 'utf-8))) - (if image? - ;; Dont' attempt to decode. Instead, just switch to the raw HTTP response buffer and - ;; rename it to target-buffer-name. - (with-current-buffer raw-http-response-buffer - ;; We have to kill the target buffer if it exists, or `rename-buffer' - ;; will raise an error. - (when (get-buffer target-buffer-name) - (kill-buffer target-buffer-name)) - (rename-buffer target-buffer-name) - raw-http-response-buffer) - ;; Else, switch to the new, empty buffer that will contain the decoded HTTP - ;; response. Set its encoding, copy the content from the unencoded - ;; HTTP response buffer and decode. - (let ((decoded-http-response-buffer - (get-buffer-create - (if same-name target-buffer-name (generate-new-buffer-name target-buffer-name))))) - (with-current-buffer decoded-http-response-buffer - (setq buffer-file-coding-system encoding) - (save-excursion - (erase-buffer) - (insert-buffer-substring raw-http-response-buffer)) - (kill-buffer raw-http-response-buffer) - (condition-case nil - (decode-coding-region (point-min) (point-max) encoding) - (error - (message (concat "Error when trying to decode http response with encoding: " - (symbol-name encoding))))) - decoded-http-response-buffer))))) - -(defun restclient-current-min () - (save-excursion - (beginning-of-line) - (if (looking-at restclient-comment-start-regexp) - (if (re-search-forward restclient-comment-not-regexp (point-max) t) - (point-at-bol) (point-max)) - (if (re-search-backward restclient-comment-start-regexp (point-min) t) - (point-at-bol 2) - (point-min))))) - -(defun restclient-current-max () - (save-excursion - (if (re-search-forward restclient-comment-start-regexp (point-max) t) - (max (- (point-at-bol) 1) 1) - (progn (goto-char (point-max)) - (if (looking-at "^$") (- (point) 1) (point)))))) - -(defun restclient-replace-all-in-string (replacements string) - (if replacements - (let ((current string) - (pass restclient-vars-max-passes) - (continue t)) - (while (and continue (> pass 0)) - (setq pass (- pass 1)) - (setq current (replace-regexp-in-string (regexp-opt (mapcar 'car replacements)) - (lambda (key) - (setq continue t) - (cdr (assoc key replacements))) - current t t))) - current) - string)) - -(defun restclient-replace-all-in-header (replacements header) - (cons (car header) - (restclient-replace-all-in-string replacements (cdr header)))) - -(defun restclient-chop (text) - (if text (replace-regexp-in-string "\n$" "" text) nil)) - -(defun restclient-find-vars-before-point () - (let ((vars nil) - (bound (point))) - (save-excursion - (goto-char (point-min)) - (while (search-forward-regexp restclient-var-regexp bound t) - (let ((name (match-string-no-properties 1)) - (should-eval (> (length (match-string 2)) 0)) - (value (or (restclient-chop (match-string-no-properties 4)) (match-string-no-properties 3)))) - (setq vars (cons (cons name (if should-eval (restclient-eval-var value) value)) vars)))) - vars))) - -(defun restclient-eval-var (string) - (with-output-to-string (princ (eval (read string))))) - -(defun restclient-make-header (&optional string) - (cons (match-string-no-properties 1 string) - (match-string-no-properties 2 string))) - -(defun restclient-parse-headers (string) - (let ((start 0) - (headers '())) - (while (string-match restclient-header-regexp string start) - (setq headers (cons (restclient-make-header string) headers) - start (match-end 0))) - headers)) - -(defun restclient-read-file (path) - (with-temp-buffer - (insert-file-contents path) - (buffer-string))) - -(defun restclient-parse-body (entity vars) - (if (= 0 (or (string-match restclient-file-regexp entity) 1)) - (restclient-read-file (match-string 1 entity)) - (restclient-replace-all-in-string vars entity))) - -(defun restclient-http-parse-current-and-do (func &rest args) - (save-excursion - (goto-char (restclient-current-min)) - (when (re-search-forward restclient-method-url-regexp (point-max) t) - (let ((method (match-string-no-properties 1)) - (url (match-string-no-properties 2)) - (vars (restclient-find-vars-before-point)) - (headers '())) - (forward-line) - (while (cond - ((and (looking-at restclient-header-regexp) (not (looking-at restclient-empty-line-regexp))) - (setq headers (cons (restclient-replace-all-in-header vars (restclient-make-header)) headers))) - ((looking-at restclient-use-var-regexp) - (setq headers (append headers (restclient-parse-headers (restclient-replace-all-in-string vars (match-string 1))))))) - (forward-line)) - (when (looking-at restclient-empty-line-regexp) - (forward-line)) - (let* ((cmax (restclient-current-max)) - (entity (restclient-parse-body (buffer-substring (min (point) cmax) cmax) vars)) - (url (restclient-replace-all-in-string vars url))) - (apply func method url headers entity args)))))) - -(defun restclient-copy-curl-command () - "Formats the request as a curl command and copies the command to the clipboard." - (interactive) - (restclient-http-parse-current-and-do - '(lambda (method url headers entity) - (let ((header-args - (apply 'append - (mapcar (lambda (header) - (list "-H" (format "%s: %s" (car header) (cdr header)))) - headers)))) - (kill-new (concat "curl " - (mapconcat 'shell-quote-argument - (append '("-i") - header-args - (list (concat "-X" method)) - (list url) - (when (> (string-width entity) 0) - (list "-d" entity))) - " ")))) - (message "curl command copied to clipboard.")))) - -;;;###autoload -(defun restclient-http-send-current (&optional raw stay-in-window) - "Sends current request. -Optional argument RAW don't reformat response if t. -Optional argument STAY-IN-WINDOW do not move focus to response buffer if t." - (interactive) - (restclient-http-parse-current-and-do 'restclient-http-do raw stay-in-window)) - -;;;###autoload -(defun restclient-http-send-current-raw () - "Sends current request and get raw result (no reformatting or syntax highlight of XML, JSON or images)." - (interactive) - (restclient-http-send-current t)) - -;;;###autoload -(defun restclient-http-send-current-stay-in-window () - "Send current request and keep focus in request window." - (interactive) - (restclient-http-send-current nil t)) - -(defun restclient-jump-next () - "Jump to next request in buffer." - (interactive) - (let ((last-min nil)) - (while (not (eq last-min (goto-char (restclient-current-min)))) - (goto-char (restclient-current-min)) - (setq last-min (point)))) - (goto-char (+ (restclient-current-max) 1)) - (goto-char (restclient-current-min))) - -(defun restclient-jump-prev () - "Jump to previous request in buffer." - (interactive) - (let* ((current-min (restclient-current-min)) - (end-of-entity - (save-excursion - (progn (goto-char (restclient-current-min)) - (while (and (or (looking-at "^\s*\\(#.*\\)?$") - (eq (point) current-min)) - (not (eq (point) (point-min)))) - (forward-line -1) - (beginning-of-line)) - (point))))) - (unless (eq (point-min) end-of-entity) - (goto-char end-of-entity) - (goto-char (restclient-current-min))))) - -(defun restclient-mark-current () - "Mark current request." - (interactive) - (goto-char (restclient-current-min)) - (set-mark-command nil) - (goto-char (restclient-current-max)) - (backward-char 1) - (setq deactivate-mark nil)) - -(defun restclient-narrow-to-current () - "Narrow to region of current request" - (interactive) - (narrow-to-region (restclient-current-min) (restclient-current-max))) - -(defconst restclient-mode-keywords - (list (list restclient-method-url-regexp '(1 'restclient-method-face) '(2 'restclient-url-face)) - (list restclient-svar-regexp '(1 'restclient-variable-name-face) '(2 'restclient-variable-string-face)) - (list restclient-evar-regexp '(1 'restclient-variable-name-face) '(2 'restclient-variable-elisp-face t)) - (list restclient-mvar-regexp '(1 'restclient-variable-name-face) '(2 'restclient-variable-multiline-face t)) - (list restclient-use-var-regexp '(1 'restclient-variable-usage-face)) - (list restclient-file-regexp '(0 'restclient-file-upload-face)) - (list restclient-header-regexp '(1 'restclient-header-name-face t) '(2 'restclient-header-value-face t)) - )) - -(defconst restclient-mode-syntax-table - (let ((table (make-syntax-table))) - (modify-syntax-entry ?\# "<" table) - (modify-syntax-entry ?\n ">#" table) - table)) - -(defvar restclient-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-c C-c") 'restclient-http-send-current) - (define-key map (kbd "C-c C-r") 'restclient-http-send-current-raw) - (define-key map (kbd "C-c C-v") 'restclient-http-send-current-stay-in-window) - (define-key map (kbd "C-c C-n") 'restclient-jump-next) - (define-key map (kbd "C-c C-p") 'restclient-jump-prev) - (define-key map (kbd "C-c C-.") 'restclient-mark-current) - (define-key map (kbd "C-c C-u") 'restclient-copy-curl-command) - (define-key map (kbd "C-c n n") 'restclient-narrow-to-current) - map) - "Keymap for restclient-mode.") - -;;;###autoload -(define-derived-mode restclient-mode fundamental-mode "REST Client" - "Turn on restclient mode." - (set (make-local-variable 'comment-start) "# ") - (set (make-local-variable 'comment-start-skip) "# *") - (set (make-local-variable 'comment-column) 48) - - (set (make-local-variable 'font-lock-defaults) '(restclient-mode-keywords))) - -(provide 'restclient) - -(eval-after-load 'helm - '(ignore-errors (require 'restclient-helm))) - -;;; restclient.el ends here diff --git a/elpa/restclient-20171203.1248/restclient.elc b/elpa/restclient-20171203.1248/restclient.elc deleted file mode 100644 index 6e004f9..0000000 Binary files a/elpa/restclient-20171203.1248/restclient.elc and /dev/null differ diff --git a/elpa/restclient-20180316.851/restclient-autoloads.el b/elpa/restclient-20180316.851/restclient-autoloads.el deleted file mode 100644 index a89341c..0000000 --- a/elpa/restclient-20180316.851/restclient-autoloads.el +++ /dev/null @@ -1,39 +0,0 @@ -;;; restclient-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "restclient" "restclient.el" (23243 33523 0 -;;;;;; 0)) -;;; Generated autoloads from restclient.el - -(autoload 'restclient-http-send-current "restclient" "\ -Sends current request. -Optional argument RAW don't reformat response if t. -Optional argument STAY-IN-WINDOW do not move focus to response buffer if t. - -\(fn &optional RAW STAY-IN-WINDOW)" t nil) - -(autoload 'restclient-http-send-current-raw "restclient" "\ -Sends current request and get raw result (no reformatting or syntax highlight of XML, JSON or images). - -\(fn)" t nil) - -(autoload 'restclient-http-send-current-stay-in-window "restclient" "\ -Send current request and keep focus in request window. - -\(fn)" t nil) - -(autoload 'restclient-mode "restclient" "\ -Turn on restclient mode. - -\(fn)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; restclient-autoloads.el ends here diff --git a/elpa/restclient-20180316.851/restclient-pkg.el b/elpa/restclient-20180316.851/restclient-pkg.el deleted file mode 100644 index ba91459..0000000 --- a/elpa/restclient-20180316.851/restclient-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "restclient" "20180316.851" "An interactive HTTP client for Emacs" 'nil :commit "859d944796ce298b5779d9d256bd8d271d57e221" :keywords '("http")) diff --git a/elpa/restclient-20180316.851/restclient.el b/elpa/restclient-20180316.851/restclient.el deleted file mode 100644 index ad8f8f3..0000000 --- a/elpa/restclient-20180316.851/restclient.el +++ /dev/null @@ -1,620 +0,0 @@ -;;; restclient.el --- An interactive HTTP client for Emacs -;; -;; Public domain. - -;; Author: Pavel Kurnosov -;; Maintainer: Pavel Kurnosov -;; Created: 01 Apr 2012 -;; Keywords: http -;; Package-Version: 20180316.851 - -;; This file is not part of GNU Emacs. -;; This file is public domain software. Do what you want. - -;;; Commentary: -;; -;; This is a tool to manually explore and test HTTP REST -;; webservices. Runs queries from a plain-text query sheet, displays -;; results as a pretty-printed XML, JSON and even images. - -;;; Code: -;; -(require 'url) -(require 'json) -(require 'outline) - -(defgroup restclient nil - "An interactive HTTP client for Emacs." - :group 'tools) - -(defcustom restclient-log-request t - "Log restclient requests to *Messages*." - :group 'restclient - :type 'boolean) - -(defcustom restclient-same-buffer-response t - "Re-use same buffer for responses or create a new one each time." - :group 'restclient - :type 'boolean) - -(defcustom restclient-same-buffer-response-name "*HTTP Response*" - "Name for response buffer." - :group 'restclient - :type 'string) - -(defcustom restclient-inhibit-cookies nil - "Inhibit restclient from sending cookies implicitly." - :group 'restclient - :type 'boolean) - -(defcustom restclient-content-type-modes '(("text/xml" . xml-mode) - ("text/plain" . text-mode) - ("application/xml" . xml-mode) - ("application/json" . js-mode) - ("image/png" . image-mode) - ("image/jpeg" . image-mode) - ("image/jpg" . image-mode) - ("image/gif" . image-mode) - ("text/html" . html-mode)) - "An association list mapping content types to buffer modes" - :group 'restclient - :type '(alist :key-type string :value-type symbol)) - -(defgroup restclient-faces nil - "Faces used in Restclient Mode" - :group 'restclient - :group 'faces) - -(defface restclient-variable-name-face - '((t (:inherit font-lock-preprocessor-face))) - "Face for variable name." - :group 'restclient-faces) - -(defface restclient-variable-string-face - '((t (:inherit font-lock-string-face))) - "Face for variable value (string)." - :group 'restclient-faces) - -(defface restclient-variable-elisp-face - '((t (:inherit font-lock-function-name-face))) - "Face for variable value (Emacs lisp)." - :group 'restclient-faces) - -(defface restclient-variable-multiline-face - '((t (:inherit font-lock-doc-face))) - "Face for multi-line variable value marker." - :group 'restclient-faces) - -(defface restclient-variable-usage-face - '((t (:inherit restclient-variable-name-face))) - "Face for variable usage (only used when headers/body is represented as a single variable, not highlighted when variable appears in the middle of other text)." - :group 'restclient-faces) - -(defface restclient-method-face - '((t (:inherit font-lock-keyword-face))) - "Face for HTTP method." - :group 'restclient-faces) - -(defface restclient-url-face - '((t (:inherit font-lock-function-name-face))) - "Face for variable value (Emacs lisp)." - :group 'restclient-faces) - -(defface restclient-file-upload-face - '((t (:inherit restclient-variable-multiline-face))) - "Face for highlighting upload file paths." - :group 'restclient-faces) - -(defface restclient-header-name-face - '((t (:inherit font-lock-variable-name-face))) - "Face for HTTP header name." - :group 'restclient-faces) - -(defface restclient-header-value-face - '((t (:inherit font-lock-string-face))) - "Face for HTTP header value." - :group 'restclient-faces) - -(defvar restclient-within-call nil) - -(defvar restclient-request-time-start nil) -(defvar restclient-request-time-end nil) - -(defvar restclient-response-loaded-hook nil - "Hook run after response buffer is formatted.") - -(defvar restclient-http-do-hook nil - "Hook to run before making request.") - -(defvar restclient-response-received-hook nil - "Hook run after data is loaded into response buffer.") - -(defcustom restclient-vars-max-passes 10 - "Maximum number of recursive variable references. This is to prevent hanging if two variables reference each other directly or indirectly." - :group 'restclient - :type 'integer) - -(defconst restclient-comment-separator "#") -(defconst restclient-comment-start-regexp (concat "^" restclient-comment-separator)) -(defconst restclient-comment-not-regexp (concat "^[^" restclient-comment-separator "]")) -(defconst restclient-empty-line-regexp "^\\s-*$") - -(defconst restclient-method-url-regexp - "^\\(GET\\|POST\\|DELETE\\|PUT\\|HEAD\\|OPTIONS\\|PATCH\\) \\(.*\\)$") - -(defconst restclient-header-regexp - "^\\([^](),/:;@[\\{}= \t]+\\): \\(.*\\)$") - -(defconst restclient-use-var-regexp - "^\\(:[^: \n]+\\)$") - -(defconst restclient-var-regexp - (concat "^\\(:[^:= ]+\\)[ \t]*\\(:?\\)=[ \t]*\\(<<[ \t]*\n\\(\\(.*\n\\)*?\\)" restclient-comment-separator "\\|\\([^<].*\\)$\\)")) - -(defconst restclient-svar-regexp - "^\\(:[^:= ]+\\)[ \t]*=[ \t]*\\(.+?\\)$") - -(defconst restclient-evar-regexp - "^\\(:[^: ]+\\)[ \t]*:=[ \t]*\\(.+?\\)$") - -(defconst restclient-mvar-regexp - "^\\(:[^: ]+\\)[ \t]*:?=[ \t]*\\(<<\\)[ \t]*$") - -(defconst restclient-file-regexp - "^<[ \t]*\\([^<>\n\r]+\\)[ \t]*$") - -(defconst restclient-content-type-regexp - "^Content-[Tt]ype: \\(\\w+\\)/\\(?:[^\\+\r\n]*\\+\\)*\\([^;\r\n]+\\)") - -;; The following disables the interactive request for user name and -;; password should an API call encounter a permission-denied response. -;; This API is meant to be usable without constant asking for username -;; and password. -(defadvice url-http-handle-authentication (around restclient-fix) - (if restclient-within-call - (setq ad-return-value t) - ad-do-it)) -(ad-activate 'url-http-handle-authentication) - -(defadvice url-cache-extract (around restclient-fix-2) - (unless restclient-within-call - ad-do-it)) -(ad-activate 'url-cache-extract) - -(defadvice url-http-user-agent-string (around restclient-fix-3) - (if restclient-within-call - (setq ad-return-value nil) - ad-do-it)) -(ad-activate 'url-http-user-agent-string) - -(defun restclient-restore-header-variables () - (url-set-mime-charset-string) - (setq url-mime-language-string nil) - (setq url-mime-encoding-string nil) - (setq url-mime-accept-string nil) - (setq url-personal-mail-address nil)) - -(defun restclient-http-do (method url headers entity &rest handle-args) - "Send ENTITY and HEADERS to URL as a METHOD request." - (if restclient-log-request - (message "HTTP %s %s Headers:[%s] Body:[%s]" method url headers entity)) - (let ((url-request-method (encode-coding-string method 'us-ascii)) - (url-request-extra-headers '()) - (url-request-data (encode-coding-string entity 'utf-8))) - - (restclient-restore-header-variables) - - (dolist (header headers) - (let* ((mapped (assoc-string (downcase (car header)) - '(("from" . url-personal-mail-address) - ("accept-encoding" . url-mime-encoding-string) - ("accept-charset" . url-mime-charset-string) - ("accept-language" . url-mime-language-string) - ("accept" . url-mime-accept-string))))) - - (if mapped - (set (cdr mapped) (encode-coding-string (cdr header) 'us-ascii)) - (let* ((hkey (encode-coding-string (car header) 'us-ascii)) - (hvalue (encode-coding-string (cdr header) 'us-ascii))) - (setq url-request-extra-headers (cons (cons hkey hvalue) url-request-extra-headers)))))) - - (setq restclient-within-call t) - (setq restclient-request-time-start (current-time)) - (run-hooks 'restclient-http-do-hook) - (url-retrieve url 'restclient-http-handle-response - (append (list method url (if restclient-same-buffer-response - restclient-same-buffer-response-name - (format "*HTTP %s %s*" method url))) handle-args) nil restclient-inhibit-cookies))) - -(defun restclient-prettify-response (method url) - (save-excursion - (let ((start (point)) (guessed-mode) (end-of-headers)) - (while (and (not (looking-at restclient-empty-line-regexp)) - (eq (progn - (when (looking-at restclient-content-type-regexp) - (setq guessed-mode - (cdr (assoc-string (concat - (match-string-no-properties 1) - "/" - (match-string-no-properties 2)) - restclient-content-type-modes)))) - (forward-line)) 0))) - (setq end-of-headers (point)) - (while (and (looking-at restclient-empty-line-regexp) - (eq (forward-line) 0))) - (unless guessed-mode - (setq guessed-mode - (or (assoc-default nil - ;; magic mode matches - '(("<\\?xml " . xml-mode) - ("{\\s-*\"" . js-mode)) - (lambda (re _dummy) - (looking-at re))) 'js-mode))) - (let ((headers (buffer-substring-no-properties start end-of-headers))) - (when guessed-mode - (delete-region start (point)) - (unless (eq guessed-mode 'image-mode) - (apply guessed-mode '()) - (if (fboundp 'font-lock-flush) - (font-lock-flush) - (with-no-warnings - (font-lock-fontify-buffer)))) - - (cond - ((eq guessed-mode 'xml-mode) - (goto-char (point-min)) - (while (search-forward-regexp "\>[ \\t]*\<" nil t) - (backward-char) (insert "\n")) - (indent-region (point-min) (point-max))) - - ((eq guessed-mode 'image-mode) - (let* ((img (buffer-string))) - (delete-region (point-min) (point-max)) - (fundamental-mode) - (insert-image (create-image img nil t)))) - - ((eq guessed-mode 'js-mode) - (let ((json-special-chars (remq (assoc ?/ json-special-chars) json-special-chars))) - (ignore-errors (json-pretty-print-buffer))) - (restclient-prettify-json-unicode))) - - (goto-char (point-max)) - (or (eq (point) (point-min)) (insert "\n")) - (let ((hstart (point))) - (insert method " " url "\n" headers) - (insert (format "Request duration: %fs\n" (float-time (time-subtract restclient-request-time-end restclient-request-time-start)))) - (unless (member guessed-mode '(image-mode text-mode)) - (comment-region hstart (point))))))))) - -(defun restclient-prettify-json-unicode () - (save-excursion - (goto-char (point-min)) - (while (re-search-forward "\\\\[Uu]\\([0-9a-fA-F]\\{4\\}\\)" nil t) - (replace-match (char-to-string (decode-char 'ucs (string-to-number (match-string 1) 16))) t nil)))) - -(defun restclient-http-handle-response (status method url bufname raw stay-in-window) - "Switch to the buffer returned by `url-retreive'. -The buffer contains the raw HTTP response sent by the server." - (setq restclient-within-call nil) - (setq restclient-request-time-end (current-time)) - (if (= (point-min) (point-max)) - (signal (car (plist-get status :error)) (cdr (plist-get status :error))) - (restclient-restore-header-variables) - (when (buffer-live-p (current-buffer)) - (with-current-buffer (restclient-decode-response - (current-buffer) - bufname - restclient-same-buffer-response) - (run-hooks 'restclient-response-received-hook) - (unless raw - (restclient-prettify-response method url)) - (buffer-enable-undo) - (run-hooks 'restclient-response-loaded-hook) - (if stay-in-window - (display-buffer (current-buffer) t) - (switch-to-buffer-other-window (current-buffer))))))) - -(defun restclient-decode-response (raw-http-response-buffer target-buffer-name same-name) - "Decode the HTTP response using the charset (encoding) specified in the Content-Type header. If no charset is specified, default to UTF-8." - (let* ((charset-regexp "^Content-Type.*charset=\\([-A-Za-z0-9]+\\)") - (image? (save-excursion - (search-forward-regexp "^Content-Type.*[Ii]mage" nil t))) - (encoding (if (save-excursion - (search-forward-regexp charset-regexp nil t)) - (intern (downcase (match-string 1))) - 'utf-8))) - (if image? - ;; Dont' attempt to decode. Instead, just switch to the raw HTTP response buffer and - ;; rename it to target-buffer-name. - (with-current-buffer raw-http-response-buffer - ;; We have to kill the target buffer if it exists, or `rename-buffer' - ;; will raise an error. - (when (get-buffer target-buffer-name) - (kill-buffer target-buffer-name)) - (rename-buffer target-buffer-name) - raw-http-response-buffer) - ;; Else, switch to the new, empty buffer that will contain the decoded HTTP - ;; response. Set its encoding, copy the content from the unencoded - ;; HTTP response buffer and decode. - (let ((decoded-http-response-buffer - (get-buffer-create - (if same-name target-buffer-name (generate-new-buffer-name target-buffer-name))))) - (with-current-buffer decoded-http-response-buffer - (setq buffer-file-coding-system encoding) - (save-excursion - (erase-buffer) - (insert-buffer-substring raw-http-response-buffer)) - (kill-buffer raw-http-response-buffer) - (condition-case nil - (decode-coding-region (point-min) (point-max) encoding) - (error - (message (concat "Error when trying to decode http response with encoding: " - (symbol-name encoding))))) - decoded-http-response-buffer))))) - -(defun restclient-current-min () - (save-excursion - (beginning-of-line) - (if (looking-at restclient-comment-start-regexp) - (if (re-search-forward restclient-comment-not-regexp (point-max) t) - (point-at-bol) (point-max)) - (if (re-search-backward restclient-comment-start-regexp (point-min) t) - (point-at-bol 2) - (point-min))))) - -(defun restclient-current-max () - (save-excursion - (if (re-search-forward restclient-comment-start-regexp (point-max) t) - (max (- (point-at-bol) 1) 1) - (progn (goto-char (point-max)) - (if (looking-at "^$") (- (point) 1) (point)))))) - -(defun restclient-replace-all-in-string (replacements string) - (if replacements - (let ((current string) - (pass restclient-vars-max-passes) - (continue t)) - (while (and continue (> pass 0)) - (setq pass (- pass 1)) - (setq current (replace-regexp-in-string (regexp-opt (mapcar 'car replacements)) - (lambda (key) - (setq continue t) - (cdr (assoc key replacements))) - current t t))) - current) - string)) - -(defun restclient-replace-all-in-header (replacements header) - (cons (car header) - (restclient-replace-all-in-string replacements (cdr header)))) - -(defun restclient-chop (text) - (if text (replace-regexp-in-string "\n$" "" text) nil)) - -(defun restclient-find-vars-before-point () - (let ((vars nil) - (bound (point))) - (save-excursion - (goto-char (point-min)) - (while (search-forward-regexp restclient-var-regexp bound t) - (let ((name (match-string-no-properties 1)) - (should-eval (> (length (match-string 2)) 0)) - (value (or (restclient-chop (match-string-no-properties 4)) (match-string-no-properties 3)))) - (setq vars (cons (cons name (if should-eval (restclient-eval-var value) value)) vars)))) - vars))) - -(defun restclient-eval-var (string) - (with-output-to-string (princ (eval (read string))))) - -(defun restclient-make-header (&optional string) - (cons (match-string-no-properties 1 string) - (match-string-no-properties 2 string))) - -(defun restclient-parse-headers (string) - (let ((start 0) - (headers '())) - (while (string-match restclient-header-regexp string start) - (setq headers (cons (restclient-make-header string) headers) - start (match-end 0))) - headers)) - -(defun restclient-read-file (path) - (with-temp-buffer - (insert-file-contents path) - (buffer-string))) - -(defun restclient-parse-body (entity vars) - (if (= 0 (or (string-match restclient-file-regexp entity) 1)) - (restclient-read-file (match-string 1 entity)) - (restclient-replace-all-in-string vars entity))) - -(defun restclient-http-parse-current-and-do (func &rest args) - (save-excursion - (goto-char (restclient-current-min)) - (when (re-search-forward restclient-method-url-regexp (point-max) t) - (let ((method (match-string-no-properties 1)) - (url (match-string-no-properties 2)) - (vars (restclient-find-vars-before-point)) - (headers '())) - (forward-line) - (while (cond - ((and (looking-at restclient-header-regexp) (not (looking-at restclient-empty-line-regexp))) - (setq headers (cons (restclient-replace-all-in-header vars (restclient-make-header)) headers))) - ((looking-at restclient-use-var-regexp) - (setq headers (append headers (restclient-parse-headers (restclient-replace-all-in-string vars (match-string 1))))))) - (forward-line)) - (when (looking-at restclient-empty-line-regexp) - (forward-line)) - (let* ((cmax (restclient-current-max)) - (entity (restclient-parse-body (buffer-substring (min (point) cmax) cmax) vars)) - (url (restclient-replace-all-in-string vars url))) - (apply func method url headers entity args)))))) - -(defun restclient-copy-curl-command () - "Formats the request as a curl command and copies the command to the clipboard." - (interactive) - (restclient-http-parse-current-and-do - '(lambda (method url headers entity) - (let ((header-args - (apply 'append - (mapcar (lambda (header) - (list "-H" (format "%s: %s" (car header) (cdr header)))) - headers)))) - (kill-new (concat "curl " - (mapconcat 'shell-quote-argument - (append '("-i") - header-args - (list (concat "-X" method)) - (list url) - (when (> (string-width entity) 0) - (list "-d" entity))) - " ")))) - (message "curl command copied to clipboard.")))) - -;;;###autoload -(defun restclient-http-send-current (&optional raw stay-in-window) - "Sends current request. -Optional argument RAW don't reformat response if t. -Optional argument STAY-IN-WINDOW do not move focus to response buffer if t." - (interactive) - (restclient-http-parse-current-and-do 'restclient-http-do raw stay-in-window)) - -;;;###autoload -(defun restclient-http-send-current-raw () - "Sends current request and get raw result (no reformatting or syntax highlight of XML, JSON or images)." - (interactive) - (restclient-http-send-current t)) - -;;;###autoload -(defun restclient-http-send-current-stay-in-window () - "Send current request and keep focus in request window." - (interactive) - (restclient-http-send-current nil t)) - -(defun restclient-jump-next () - "Jump to next request in buffer." - (interactive) - (let ((last-min nil)) - (while (not (eq last-min (goto-char (restclient-current-min)))) - (goto-char (restclient-current-min)) - (setq last-min (point)))) - (goto-char (+ (restclient-current-max) 1)) - (goto-char (restclient-current-min))) - -(defun restclient-jump-prev () - "Jump to previous request in buffer." - (interactive) - (let* ((current-min (restclient-current-min)) - (end-of-entity - (save-excursion - (progn (goto-char (restclient-current-min)) - (while (and (or (looking-at "^\s*\\(#.*\\)?$") - (eq (point) current-min)) - (not (eq (point) (point-min)))) - (forward-line -1) - (beginning-of-line)) - (point))))) - (unless (eq (point-min) end-of-entity) - (goto-char end-of-entity) - (goto-char (restclient-current-min))))) - -(defun restclient-mark-current () - "Mark current request." - (interactive) - (goto-char (restclient-current-min)) - (set-mark-command nil) - (goto-char (restclient-current-max)) - (backward-char 1) - (setq deactivate-mark nil)) - -(defun restclient-narrow-to-current () - "Narrow to region of current request" - (interactive) - (narrow-to-region (restclient-current-min) (restclient-current-max))) - -(defun restclient-toggle-body-visibility () - (interactive) - ;; If we are not on the HTTP call line, don't do anything - (let ((at-header (save-excursion - (beginning-of-line) - (looking-at restclient-method-url-regexp)))) - (when at-header - (save-excursion - (end-of-line) - ;; If the overlays at this point have 'invisible set, toggling - ;; must make the region visible. Else it must hide the region - - ;; This part of code is from org-hide-block-toggle method of - ;; Org mode - (let ((overlays (overlays-at (point)))) - (if (memq t (mapcar - (lambda (o) - (eq (overlay-get o 'invisible) 'outline)) - overlays)) - (outline-flag-region (point) (restclient-current-max) nil) - (outline-flag-region (point) (restclient-current-max) t)))) t))) - -(defun restclient-toggle-body-visibility-or-indent () - (interactive) - (unless (restclient-toggle-body-visibility) - (indent-for-tab-command))) - -(defconst restclient-mode-keywords - (list (list restclient-method-url-regexp '(1 'restclient-method-face) '(2 'restclient-url-face)) - (list restclient-svar-regexp '(1 'restclient-variable-name-face) '(2 'restclient-variable-string-face)) - (list restclient-evar-regexp '(1 'restclient-variable-name-face) '(2 'restclient-variable-elisp-face t)) - (list restclient-mvar-regexp '(1 'restclient-variable-name-face) '(2 'restclient-variable-multiline-face t)) - (list restclient-use-var-regexp '(1 'restclient-variable-usage-face)) - (list restclient-file-regexp '(0 'restclient-file-upload-face)) - (list restclient-header-regexp '(1 'restclient-header-name-face t) '(2 'restclient-header-value-face t)) - )) - -(defconst restclient-mode-syntax-table - (let ((table (make-syntax-table))) - (modify-syntax-entry ?\# "<" table) - (modify-syntax-entry ?\n ">#" table) - table)) - -(defvar restclient-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-c C-c") 'restclient-http-send-current) - (define-key map (kbd "C-c C-r") 'restclient-http-send-current-raw) - (define-key map (kbd "C-c C-v") 'restclient-http-send-current-stay-in-window) - (define-key map (kbd "C-c C-n") 'restclient-jump-next) - (define-key map (kbd "C-c C-p") 'restclient-jump-prev) - (define-key map (kbd "C-c C-.") 'restclient-mark-current) - (define-key map (kbd "C-c C-u") 'restclient-copy-curl-command) - (define-key map (kbd "C-c n n") 'restclient-narrow-to-current) - map) - "Keymap for restclient-mode.") - -(define-minor-mode restclient-outline-mode - "Minor mode to allow show/hide of request bodies by TAB." - :init-value nil - :lighter nil - :keymap '(("\t" . restclient-toggle-body-visibility-or-indent) - ("\C-c\C-a" . restclient-toggle-body-visibility-or-indent)) - :group 'restclient) - -;;;###autoload -(define-derived-mode restclient-mode fundamental-mode "REST Client" - "Turn on restclient mode." - (set (make-local-variable 'comment-start) "# ") - (set (make-local-variable 'comment-start-skip) "# *") - (set (make-local-variable 'comment-column) 48) - - (set (make-local-variable 'font-lock-defaults) '(restclient-mode-keywords)) - ;; We use outline-mode's method outline-flag-region to hide/show the - ;; body. As a part of it, it sets 'invisibility text property to - ;; 'outline. To get ellipsis, we need 'outline to be in - ;; buffer-invisibility-spec - (add-to-invisibility-spec '(outline . t))) - -(add-hook 'restclient-mode-hook 'restclient-outline-mode) - -(provide 'restclient) - -(eval-after-load 'helm - '(ignore-errors (require 'restclient-helm))) - -;;; restclient.el ends here diff --git a/elpa/restclient-20180316.851/restclient.elc b/elpa/restclient-20180316.851/restclient.elc deleted file mode 100644 index a93ead2..0000000 Binary files a/elpa/restclient-20180316.851/restclient.elc and /dev/null differ diff --git a/elpa/ruby-end-20141215.1223/ruby-end-autoloads.el b/elpa/ruby-end-20141215.1223/ruby-end-autoloads.el new file mode 100644 index 0000000..434d657 --- /dev/null +++ b/elpa/ruby-end-20141215.1223/ruby-end-autoloads.el @@ -0,0 +1,25 @@ +;;; ruby-end-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "ruby-end" "ruby-end.el" (23391 65269 0 0)) +;;; Generated autoloads from ruby-end.el + +(autoload 'ruby-end-mode "ruby-end" "\ +Automatic insertion of end blocks for Ruby. + +\(fn &optional ARG)" t nil) + +(add-hook 'ruby-mode-hook 'ruby-end-mode) + +(add-hook 'enh-ruby-mode-hook 'ruby-end-mode) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; ruby-end-autoloads.el ends here diff --git a/elpa/ruby-end-20141215.1223/ruby-end-pkg.el b/elpa/ruby-end-20141215.1223/ruby-end-pkg.el new file mode 100644 index 0000000..35d8e92 --- /dev/null +++ b/elpa/ruby-end-20141215.1223/ruby-end-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "ruby-end" "20141215.1223" "Automatic insertion of end blocks for Ruby" 'nil :commit "a136f75abb6d5577ce40d61dfeb778c2e9bb09c0" :keywords '("speed" "convenience" "ruby") :authors '(("Johan Andersson" . "johan.rejeep@gmail.com")) :maintainer '("Johan Andersson" . "johan.rejeep@gmail.com") :url "http://github.com/rejeep/ruby-end") diff --git a/elpa/ruby-end-20141215.1223/ruby-end.el b/elpa/ruby-end-20141215.1223/ruby-end.el new file mode 100644 index 0000000..f7dc4b2 --- /dev/null +++ b/elpa/ruby-end-20141215.1223/ruby-end.el @@ -0,0 +1,188 @@ +;;; ruby-end.el --- Automatic insertion of end blocks for Ruby + +;; Copyright (C) 2010-2012 Johan Andersson + +;; Author: Johan Andersson +;; Maintainer: Johan Andersson +;; Version: 0.4.1 +;; Package-Version: 20141215.1223 +;; Keywords: speed, convenience, ruby +;; URL: http://github.com/rejeep/ruby-end + +;; This file is NOT part of GNU Emacs. + + +;;; License: + +;; 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., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + + +;;; Commentary: + +;; ruby-end is a minor mode for Emacs that can be used with ruby-mode +;; to automatically close blocks by inserting "end" when typing a +;; block-keyword, followed by a space. +;; +;; To use ruby-end-mode, make sure that this file is in Emacs load-path: +;; (add-to-list 'load-path "/path/to/directory/or/file") +;; +;; Then require ruby-end: +;; (require 'ruby-end) +;; +;; ruby-end-mode is automatically started in ruby-mode. + + +;;; Code: + +(require 'ruby-mode) + +(defvar ruby-end-expand-spc-key "SPC" + "Space key name.") + +(defvar ruby-end-expand-ret-key "RET" + "Return key name.") + +(defvar ruby-end-expand-on-ret t + "Should return expand or not.") + +(defvar ruby-end-mode-map + (let ((map (make-sparse-keymap)) + (spc (read-kbd-macro ruby-end-expand-spc-key)) + (ret (read-kbd-macro ruby-end-expand-ret-key))) + (define-key map spc 'ruby-end-space) + (define-key map ret 'ruby-end-return) + map) + "Keymap for `ruby-end-mode'.") + +(defcustom ruby-end-check-statement-modifiers t + "*Disable or enable expansion (insertion of end) for statement modifiers" + :type 'boolean + :group 'ruby) + +(defcustom ruby-end-insert-newline t + "*Disable or enable additional newline in between statement and end" + :type 'boolean + :group 'ruby) + +(defcustom ruby-end-expand-only-for-last-commands '(self-insert-command) + "List of `last-command' values to restrict expansion to, or nil. + +When nil, any `last-command' will do." + :type '(repeat function) + :group 'ruby) + +(defconst ruby-end-expand-postfix-modifiers-before-re + "\\(?:if\\|unless\\|while\\)" + "Regular expression matching statements before point.") + +(defconst ruby-end-expand-prefix-check-modifiers-re + "^\\s-*" + "Prefix for regular expression to prevent expansion with statement modifiers") + +(defconst ruby-end-expand-prefix-re + "\\(?:^\\|\\s-+\\)" + "Prefix for regular expression") + +(defconst ruby-end-expand-keywords-before-re + "\\(?:^\\|\\s-+\\)\\(?:do\\|def\\|class\\|module\\|case\\|for\\|begin\\)" + "Regular expression matching blocks before point.") + + +(defconst ruby-end-expand-after-re + "\\s-*$" + "Regular expression matching after point.") + +(defun ruby-end-space () + "Called when SPC-key is pressed." + (interactive) + (cond + ((ruby-end-expand-p) + (ruby-end-insert-end) + (insert " ")) + (t + (ruby-end-fallback ruby-end-expand-spc-key)))) + +(defun ruby-end-return () + "Called when RET-key is pressed." + (interactive) + (cond + ((and ruby-end-expand-on-ret (ruby-end-expand-p)) + (let ((ruby-end-insert-newline t)) + (ruby-end-insert-end)) + (forward-line 1) + (indent-according-to-mode)) + (t + (ruby-end-fallback ruby-end-expand-ret-key)))) + +(defun ruby-end-fallback (key) + "Execute function that KEY was bound to before `ruby-end-mode'." + (let ((ruby-end-mode nil)) + (call-interactively + (key-binding (edmacro-parse-keys key) t)))) + +(defun ruby-end-insert-end () + "Closes block by inserting end." + (let ((whites + (save-excursion + (back-to-indentation) + (current-column)))) + (save-excursion + (newline) + (when ruby-end-insert-newline + (indent-line-to (+ whites ruby-indent-level)) + (newline)) + (indent-line-to whites) + (insert "end")))) + +(defun ruby-end-expand-p () + "Check if expansion (insertion of end) should be done." + (let ((ruby-end-expand-statement-modifiers-before-re + (concat + (if ruby-end-check-statement-modifiers + ruby-end-expand-prefix-check-modifiers-re + ruby-end-expand-prefix-re) + ruby-end-expand-postfix-modifiers-before-re))) + (and + (or (not ruby-end-expand-only-for-last-commands) + (memq last-command ruby-end-expand-only-for-last-commands)) + (ruby-end-code-at-point-p) + (or + (looking-back ruby-end-expand-statement-modifiers-before-re) + (looking-back ruby-end-expand-keywords-before-re)) + (looking-at ruby-end-expand-after-re)))) + +(defun ruby-end-code-at-point-p () + "Check if point is code, or comment or string." + (let ((properties (text-properties-at (point)))) + (and + (null (memq 'font-lock-string-face properties)) + (null (memq 'font-lock-comment-face properties))))) + +;;;###autoload +(define-minor-mode ruby-end-mode + "Automatic insertion of end blocks for Ruby." + :init-value nil + :lighter " end" + :keymap ruby-end-mode-map) + +;;;###autoload +(add-hook 'ruby-mode-hook 'ruby-end-mode) +;;;###autoload +(add-hook 'enh-ruby-mode-hook 'ruby-end-mode) + +(provide 'ruby-end) + +;;; ruby-end.el ends here diff --git a/elpa/ruby-end-20141215.1223/ruby-end.elc b/elpa/ruby-end-20141215.1223/ruby-end.elc new file mode 100644 index 0000000..c1f8766 Binary files /dev/null and b/elpa/ruby-end-20141215.1223/ruby-end.elc differ diff --git a/elpa/ruby-tools-20151209.1615/ruby-tools-autoloads.el b/elpa/ruby-tools-20151209.1615/ruby-tools-autoloads.el new file mode 100644 index 0000000..11e8453 --- /dev/null +++ b/elpa/ruby-tools-20151209.1615/ruby-tools-autoloads.el @@ -0,0 +1,26 @@ +;;; ruby-tools-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "ruby-tools" "ruby-tools.el" (23391 65268 0 +;;;;;; 0)) +;;; Generated autoloads from ruby-tools.el + +(autoload 'ruby-tools-mode "ruby-tools" "\ +Collection of handy functions for ruby-mode. + +\(fn &optional ARG)" t nil) + +;;;*** + +;;;### (autoloads nil nil ("ruby-tools-pkg.el") (23391 65268 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; ruby-tools-autoloads.el ends here diff --git a/elpa/ruby-tools-20151209.1615/ruby-tools-pkg.el b/elpa/ruby-tools-20151209.1615/ruby-tools-pkg.el new file mode 100644 index 0000000..e81f12a --- /dev/null +++ b/elpa/ruby-tools-20151209.1615/ruby-tools-pkg.el @@ -0,0 +1,4 @@ +(define-package "ruby-tools" "20151209.1615" "Collection of handy functions for ruby-mode." 'nil) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/ruby-tools-20151209.1615/ruby-tools.el b/elpa/ruby-tools-20151209.1615/ruby-tools.el new file mode 100644 index 0000000..185f661 --- /dev/null +++ b/elpa/ruby-tools-20151209.1615/ruby-tools.el @@ -0,0 +1,191 @@ +;;; ruby-tools.el --- Collection of handy functions for ruby-mode + +;; Copyright (C) 2012-2013 Johan Andersson + +;; Author: Johan Andersson +;; Maintainer: Johan Andersson +;; Version: 0.1.2 +;; Keywords: speed, convenience, ruby +;; URL: http://github.com/rejeep/ruby-tools + +;; This file is NOT part of GNU Emacs. + + +;;; License: + +;; 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., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + + +;;; Commentary: + +;; ruby-tools is a minor mode for Emacs that can be used with +;; ruby-mode. It includes various handy functions that will improve +;; your productivity. +;; +;; To use ruby-tools-mode, make sure that this file is in Emacs load-path: +;; (add-to-list 'load-path "/path/to/directory/or/file") +;; +;; Then require ruby-tools: +;; (require 'ruby-tools) +;; +;; ruby-tools-mode is automatically started in ruby-mode. + + +;;; Code: + +(require 'ruby-mode) + +(defvar ruby-tools-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-'") 'ruby-tools-to-single-quote-string) + (define-key map (kbd "C-\"") 'ruby-tools-to-double-quote-string) + (define-key map (kbd "C-:") 'ruby-tools-to-symbol) + (define-key map (kbd "C-;") 'ruby-tools-clear-string) + (define-key map (kbd "#") 'ruby-tools-interpolate) + map) + "Keymap for `ruby-tools-mode'.") + + +(defun ruby-tools-looking-around (back at) + "Check if looking backwards at BACK and forward at AT." + (and (looking-at-p at) (looking-back back))) + +(defun ruby-tools-symbol-at-point-p () + "Check if cursor is at a symbol or not." + (or (ruby-tools-looking-around ":[A-Za-z0-9_]*" "[A-Za-z0-9_]*") + (ruby-tools-looking-around "[^A-Za-z0-9_]+" ":[A-Za-z0-9_]*"))) + +(defun ruby-tools-string-at-point-p () + "Check if cursor is at a string or not." + (ruby-tools-string-region)) + +(defun ruby-tools-symbol-region () + "Return region for symbol at point." + (list + (save-excursion + (if (looking-at-p ":") + (point) + (search-backward ":" (line-beginning-position) t))) + (save-excursion + (when (and (looking-at-p ":") (not (eolp))) + (forward-char)) + (if (re-search-forward "[^A-Za-z0-9_]" (line-end-position) t) + (1- (point)) + (line-end-position))))) + +(defun ruby-tools-string-region () + "Return region for string at point." + (let ((orig-point (point)) (regex "'\\(\\(\\\\'\\)\\|[^']\\)*'\\|\"\\(\\(\\\\\"\\)\\|[^\"]\\)*\"") beg end) + (save-excursion + (goto-char (line-beginning-position)) + (while (and (re-search-forward regex (line-end-position) t) (not (and beg end))) + (let ((match-beg (match-beginning 0)) (match-end (match-end 0))) + (when (and + (>= orig-point match-beg) + (<= orig-point match-end)) + (setq beg match-beg) + (setq end match-end)))) + (and beg end (list beg end))))) + +(defun ruby-tools-interpolate () + "Interpolate with #{} in some places." + (interactive) + (if (and mark-active (equal (point) (region-end))) + (exchange-point-and-mark)) + (insert "#") + (when (or + (ruby-tools-looking-around "\"[^\"\n]*" "[^\"\n]*\"") + (ruby-tools-looking-around "`[^`\n]*" "[^`\n]*`") + (ruby-tools-looking-around "%([^(\n]*" "[^)\n]*)")) + (cond (mark-active + (goto-char (region-beginning)) + (insert "{") + (goto-char (region-end)) + (insert "}")) + (t + (insert "{}") + (forward-char -1))))) + +(defun ruby-tools-to-symbol () + "Turn string at point to symbol." + (interactive) + (if (ruby-tools-string-at-point-p) + (let* ((region (ruby-tools-string-region)) + (min (nth 0 region)) + (max (nth 1 region)) + (content (buffer-substring-no-properties (1+ min) (1- max)))) + (when (string-match-p "^\\([a-ZA-Z_][a-ZA-Z0-9_]*\\)?$" content) + ;; prevent insert from pushing point to the next line + (let ((new-point (if (eolp) (1- (point)) (point)))) + (delete-region min max) + (insert (concat ":" content)) + (goto-char new-point)))))) + +(defun ruby-tools-to-single-quote-string () + (interactive) + (ruby-tools-to-string "'")) + +(defun ruby-tools-to-double-quote-string () + (interactive) + (ruby-tools-to-string "\"")) + +(defun ruby-tools-to-string (string-quote) + "Convert symbol or string at point to string." + (let* ((at-string + (ruby-tools-string-at-point-p)) + (at-symbol + (and (not at-string) (ruby-tools-symbol-at-point-p)))) + (when (or at-string at-symbol) + (let* ((region + (or + (and at-symbol (ruby-tools-symbol-region)) + (and at-string (ruby-tools-string-region)))) + (min (nth 0 region)) + (max (nth 1 region)) + (content + (buffer-substring-no-properties (1+ min) (if at-symbol max (1- max))))) + (setq content + (if (equal string-quote "'") + (replace-regexp-in-string "\\\\\"" "\"" (replace-regexp-in-string "\\([^\\\\]\\)'" "\\1\\\\'" content)) + (replace-regexp-in-string "\\\\\'" "'" (replace-regexp-in-string "\\([^\\\\]\\)\"" "\\1\\\\\"" content)))) + (let ((orig-point (point))) + (delete-region min max) + (insert + (format "%s%s%s" string-quote content string-quote)) + (goto-char orig-point)))))) + +(defun ruby-tools-clear-string () + "Clear string at point." + (interactive) + (when (ruby-tools-string-at-point-p) + (let* ((region (ruby-tools-string-region)) + (min (nth 0 region)) + (max (nth 1 region))) + (delete-region (+ min 1) (- max 1))))) + + +;;;###autoload +(define-minor-mode ruby-tools-mode + "Collection of handy functions for ruby-mode." + :init-value nil + :lighter " rt" + :keymap ruby-tools-mode-map) + +(add-hook 'ruby-mode-hook 'ruby-tools-mode) + +(provide 'ruby-tools) + +;;; ruby-tools.el ends here diff --git a/elpa/ruby-tools-20151209.1615/ruby-tools.elc b/elpa/ruby-tools-20151209.1615/ruby-tools.elc new file mode 100644 index 0000000..f969c83 Binary files /dev/null and b/elpa/ruby-tools-20151209.1615/ruby-tools.elc differ diff --git a/elpa/s-20180406.808/s-autoloads.el b/elpa/s-20180406.808/s-autoloads.el new file mode 100644 index 0000000..0e4c4a4 --- /dev/null +++ b/elpa/s-20180406.808/s-autoloads.el @@ -0,0 +1,15 @@ +;;; s-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil nil ("s.el") (23391 65267 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; s-autoloads.el ends here diff --git a/elpa/s-20180406.808/s-pkg.el b/elpa/s-20180406.808/s-pkg.el new file mode 100644 index 0000000..7080f87 --- /dev/null +++ b/elpa/s-20180406.808/s-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "s" "20180406.808" "The long lost Emacs string manipulation library." 'nil :commit "03410e6a7a2b11e47e1fea3b7d9899c7df26435e" :keywords '("strings") :authors '(("Magnar Sveen" . "magnars@gmail.com")) :maintainer '("Magnar Sveen" . "magnars@gmail.com")) diff --git a/elpa/s-20180406.808/s.el b/elpa/s-20180406.808/s.el new file mode 100644 index 0000000..d8e359a --- /dev/null +++ b/elpa/s-20180406.808/s.el @@ -0,0 +1,747 @@ +;;; s.el --- The long lost Emacs string manipulation library. + +;; Copyright (C) 2012-2015 Magnar Sveen + +;; Author: Magnar Sveen +;; Version: 1.12.0 +;; Package-Version: 20180406.808 +;; Keywords: strings + +;; 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 . + +;;; Commentary: + +;; The long lost Emacs string manipulation library. +;; +;; See documentation on https://github.com/magnars/s.el#functions + +;;; Code: + +;; Silence byte-compiler +(defvar ucs-normalize-combining-chars) ; Defined in `ucs-normalize' +(autoload 'slot-value "eieio") + +(defun s-trim-left (s) + "Remove whitespace at the beginning of S." + (declare (pure t) (side-effect-free t)) + (save-match-data + (if (string-match "\\`[ \t\n\r]+" s) + (replace-match "" t t s) + s))) + +(defun s-trim-right (s) + "Remove whitespace at the end of S." + (save-match-data + (declare (pure t) (side-effect-free t)) + (if (string-match "[ \t\n\r]+\\'" s) + (replace-match "" t t s) + s))) + +(defun s-trim (s) + "Remove whitespace at the beginning and end of S." + (declare (pure t) (side-effect-free t)) + (s-trim-left (s-trim-right s))) + +(defun s-collapse-whitespace (s) + "Convert all adjacent whitespace characters to a single space." + (declare (pure t) (side-effect-free t)) + (replace-regexp-in-string "[ \t\n\r]+" " " s)) + +(defun s-split (separator s &optional omit-nulls) + "Split S into substrings bounded by matches for regexp SEPARATOR. +If OMIT-NULLS is non-nil, zero-length substrings are omitted. + +This is a simple wrapper around the built-in `split-string'." + (declare (side-effect-free t)) + (save-match-data + (split-string s separator omit-nulls))) + +(defun s-split-up-to (separator s n &optional omit-nulls) + "Split S up to N times into substrings bounded by matches for regexp SEPARATOR. + +If OMIT-NULLS is non-nil, zero-length substrings are omitted. + +See also `s-split'." + (declare (side-effect-free t)) + (save-match-data + (let ((op 0) + (r nil)) + (with-temp-buffer + (insert s) + (setq op (goto-char (point-min))) + (while (and (re-search-forward separator nil t) + (< 0 n)) + (let ((sub (buffer-substring op (match-beginning 0)))) + (unless (and omit-nulls + (equal sub "")) + (push sub r))) + (setq op (goto-char (match-end 0))) + (setq n (1- n))) + (let ((sub (buffer-substring op (point-max)))) + (unless (and omit-nulls + (equal sub "")) + (push sub r)))) + (nreverse r)))) + +(defun s-lines (s) + "Splits S into a list of strings on newline characters." + (declare (pure t) (side-effect-free t)) + (s-split "\\(\r\n\\|[\n\r]\\)" s)) + +(defun s-join (separator strings) + "Join all the strings in STRINGS with SEPARATOR in between." + (declare (pure t) (side-effect-free t)) + (mapconcat 'identity strings separator)) + +(defun s-concat (&rest strings) + "Join all the string arguments into one string." + (declare (pure t) (side-effect-free t)) + (apply 'concat strings)) + +(defun s-prepend (prefix s) + "Concatenate PREFIX and S." + (declare (pure t) (side-effect-free t)) + (concat prefix s)) + +(defun s-append (suffix s) + "Concatenate S and SUFFIX." + (declare (pure t) (side-effect-free t)) + (concat s suffix)) + +(defun s-repeat (num s) + "Make a string of S repeated NUM times." + (declare (pure t) (side-effect-free t)) + (let (ss) + (while (> num 0) + (setq ss (cons s ss)) + (setq num (1- num))) + (apply 'concat ss))) + +(defun s-chop-suffix (suffix s) + "Remove SUFFIX if it is at end of S." + (declare (pure t) (side-effect-free t)) + (let ((pos (- (length suffix)))) + (if (and (>= (length s) (length suffix)) + (string= suffix (substring s pos))) + (substring s 0 pos) + s))) + +(defun s-chop-suffixes (suffixes s) + "Remove SUFFIXES one by one in order, if they are at the end of S." + (declare (pure t) (side-effect-free t)) + (while suffixes + (setq s (s-chop-suffix (car suffixes) s)) + (setq suffixes (cdr suffixes))) + s) + +(defun s-chop-prefix (prefix s) + "Remove PREFIX if it is at the start of S." + (declare (pure t) (side-effect-free t)) + (let ((pos (length prefix))) + (if (and (>= (length s) (length prefix)) + (string= prefix (substring s 0 pos))) + (substring s pos) + s))) + +(defun s-chop-prefixes (prefixes s) + "Remove PREFIXES one by one in order, if they are at the start of S." + (declare (pure t) (side-effect-free t)) + (while prefixes + (setq s (s-chop-prefix (car prefixes) s)) + (setq prefixes (cdr prefixes))) + s) + +(defun s-shared-start (s1 s2) + "Returns the longest prefix S1 and S2 have in common." + (declare (pure t) (side-effect-free t)) + (let ((search-length (min (length s1) (length s2))) + (i 0)) + (while (and (< i search-length) + (= (aref s1 i) (aref s2 i))) + (setq i (1+ i))) + (substring s1 0 i))) + +(defun s-shared-end (s1 s2) + "Returns the longest suffix S1 and S2 have in common." + (declare (pure t) (side-effect-free t)) + (let* ((l1 (length s1)) + (l2 (length s2)) + (search-length (min l1 l2)) + (i 0)) + (while (and (< i search-length) + (= (aref s1 (- l1 i 1)) (aref s2 (- l2 i 1)))) + (setq i (1+ i))) + ;; If I is 0, then it means that there's no common suffix between + ;; S1 and S2. + ;; + ;; However, since (substring s (- 0)) will return the whole + ;; string, `s-shared-end' should simply return the empty string + ;; when I is 0. + (if (zerop i) + "" + (substring s1 (- i))))) + +(defun s-chomp (s) + "Remove one trailing `\\n`, `\\r` or `\\r\\n` from S." + (declare (pure t) (side-effect-free t)) + (s-chop-suffixes '("\n" "\r") s)) + +(defun s-truncate (len s &optional ellipsis) + "If S is longer than LEN, cut it down and add ELLIPSIS to the end. + +The resulting string, including ellipsis, will be LEN characters +long. + +When not specified, ELLIPSIS defaults to ‘...’." + (declare (pure t) (side-effect-free t)) + (unless ellipsis + (setq ellipsis "...")) + (if (> (length s) len) + (format "%s%s" (substring s 0 (- len (length ellipsis))) ellipsis) + s)) + +(defun s-word-wrap (len s) + "If S is longer than LEN, wrap the words with newlines." + (declare (side-effect-free t)) + (save-match-data + (with-temp-buffer + (insert s) + (let ((fill-column len)) + (fill-region (point-min) (point-max))) + (buffer-substring (point-min) (point-max))))) + +(defun s-center (len s) + "If S is shorter than LEN, pad it with spaces so it is centered." + (declare (pure t) (side-effect-free t)) + (let ((extra (max 0 (- len (length s))))) + (concat + (make-string (ceiling extra 2) ? ) + s + (make-string (floor extra 2) ? )))) + +(defun s-pad-left (len padding s) + "If S is shorter than LEN, pad it with PADDING on the left." + (declare (pure t) (side-effect-free t)) + (let ((extra (max 0 (- len (length s))))) + (concat (make-string extra (string-to-char padding)) + s))) + +(defun s-pad-right (len padding s) + "If S is shorter than LEN, pad it with PADDING on the right." + (declare (pure t) (side-effect-free t)) + (let ((extra (max 0 (- len (length s))))) + (concat s + (make-string extra (string-to-char padding))))) + +(defun s-left (len s) + "Returns up to the LEN first chars of S." + (declare (pure t) (side-effect-free t)) + (if (> (length s) len) + (substring s 0 len) + s)) + +(defun s-right (len s) + "Returns up to the LEN last chars of S." + (declare (pure t) (side-effect-free t)) + (let ((l (length s))) + (if (> l len) + (substring s (- l len) l) + s))) + +(defun s-ends-with? (suffix s &optional ignore-case) + "Does S end with SUFFIX? + +If IGNORE-CASE is non-nil, the comparison is done without paying +attention to case differences. + +Alias: `s-suffix?'" + (declare (pure t) (side-effect-free t)) + (let ((start-pos (- (length s) (length suffix)))) + (and (>= start-pos 0) + (eq t (compare-strings suffix nil nil + s start-pos nil ignore-case))))) + +(defun s-starts-with? (prefix s &optional ignore-case) + "Does S start with PREFIX? + +If IGNORE-CASE is non-nil, the comparison is done without paying +attention to case differences. + +Alias: `s-prefix?'. This is a simple wrapper around the built-in +`string-prefix-p'." + (declare (pure t) (side-effect-free t)) + (string-prefix-p prefix s ignore-case)) + +(defun s--truthy? (val) + (declare (pure t) (side-effect-free t)) + (not (null val))) + +(defun s-contains? (needle s &optional ignore-case) + "Does S contain NEEDLE? + +If IGNORE-CASE is non-nil, the comparison is done without paying +attention to case differences." + (declare (pure t) (side-effect-free t)) + (let ((case-fold-search ignore-case)) + (s--truthy? (string-match-p (regexp-quote needle) s)))) + +(defun s-equals? (s1 s2) + "Is S1 equal to S2? + +This is a simple wrapper around the built-in `string-equal'." + (declare (pure t) (side-effect-free t)) + (string-equal s1 s2)) + +(defun s-less? (s1 s2) + "Is S1 less than S2? + +This is a simple wrapper around the built-in `string-lessp'." + (declare (pure t) (side-effect-free t)) + (string-lessp s1 s2)) + +(defun s-matches? (regexp s &optional start) + "Does REGEXP match S? +If START is non-nil the search starts at that index. + +This is a simple wrapper around the built-in `string-match-p'." + (declare (side-effect-free t)) + (s--truthy? (string-match-p regexp s start))) + +(defun s-blank? (s) + "Is S nil or the empty string?" + (declare (pure t) (side-effect-free t)) + (or (null s) (string= "" s))) + +(defun s-blank-str? (s) + "Is S nil or the empty string or string only contains whitespace?" + (declare (pure t) (side-effect-free t)) + (or (s-blank? s) (s-blank? (s-trim s)))) + +(defun s-present? (s) + "Is S anything but nil or the empty string?" + (declare (pure t) (side-effect-free t)) + (not (s-blank? s))) + +(defun s-presence (s) + "Return S if it's `s-present?', otherwise return nil." + (declare (pure t) (side-effect-free t)) + (and (s-present? s) s)) + +(defun s-lowercase? (s) + "Are all the letters in S in lower case?" + (declare (side-effect-free t)) + (let ((case-fold-search nil)) + (not (string-match-p "[[:upper:]]" s)))) + +(defun s-uppercase? (s) + "Are all the letters in S in upper case?" + (declare (side-effect-free t)) + (let ((case-fold-search nil)) + (not (string-match-p "[[:lower:]]" s)))) + +(defun s-mixedcase? (s) + "Are there both lower case and upper case letters in S?" + (let ((case-fold-search nil)) + (s--truthy? + (and (string-match-p "[[:lower:]]" s) + (string-match-p "[[:upper:]]" s))))) + +(defun s-capitalized? (s) + "In S, is the first letter upper case, and all other letters lower case?" + (declare (side-effect-free t)) + (let ((case-fold-search nil)) + (s--truthy? + (string-match-p "^[[:upper:]][^[:upper:]]*$" s)))) + +(defun s-numeric? (s) + "Is S a number?" + (declare (pure t) (side-effect-free t)) + (s--truthy? + (string-match-p "^[0-9]+$" s))) + +(defun s-replace (old new s) + "Replaces OLD with NEW in S." + (declare (pure t) (side-effect-free t)) + (replace-regexp-in-string (regexp-quote old) new s t t)) + +(defalias 's-replace-regexp 'replace-regexp-in-string) + +(defun s--aget (alist key) + (declare (pure t) (side-effect-free t)) + (cdr (assoc-string key alist))) + +(defun s-replace-all (replacements s) + "REPLACEMENTS is a list of cons-cells. Each `car` is replaced with `cdr` in S." + (declare (pure t) (side-effect-free t)) + (replace-regexp-in-string (regexp-opt (mapcar 'car replacements)) + (lambda (it) (s--aget replacements it)) + s t t)) + +(defun s-downcase (s) + "Convert S to lower case. + +This is a simple wrapper around the built-in `downcase'." + (declare (side-effect-free t)) + (downcase s)) + +(defun s-upcase (s) + "Convert S to upper case. + +This is a simple wrapper around the built-in `upcase'." + (declare (side-effect-free t)) + (upcase s)) + +(defun s-capitalize (s) + "Convert the first word's first character to upper case and the rest to lower case in S." + (declare (side-effect-free t)) + (concat (upcase (substring s 0 1)) (downcase (substring s 1)))) + +(defun s-titleize (s) + "Convert each word's first character to upper case and the rest to lower case in S. + +This is a simple wrapper around the built-in `capitalize'." + (declare (side-effect-free t)) + (capitalize s)) + +(defmacro s-with (s form &rest more) + "Threads S through the forms. Inserts S as the last item +in the first form, making a list of it if it is not a list +already. If there are more forms, inserts the first form as the +last item in second form, etc." + (declare (debug (form &rest [&or (function &rest form) fboundp]))) + (if (null more) + (if (listp form) + `(,(car form) ,@(cdr form) ,s) + (list form s)) + `(s-with (s-with ,s ,form) ,@more))) + +(put 's-with 'lisp-indent-function 1) + +(defun s-index-of (needle s &optional ignore-case) + "Returns first index of NEEDLE in S, or nil. + +If IGNORE-CASE is non-nil, the comparison is done without paying +attention to case differences." + (declare (pure t) (side-effect-free t)) + (let ((case-fold-search ignore-case)) + (string-match-p (regexp-quote needle) s))) + +(defun s-reverse (s) + "Return the reverse of S." + (declare (pure t) (side-effect-free t)) + (save-match-data + (if (multibyte-string-p s) + (let ((input (string-to-list s)) + output) + (require 'ucs-normalize) + (while input + ;; Handle entire grapheme cluster as a single unit + (let ((grapheme (list (pop input)))) + (while (memql (car input) ucs-normalize-combining-chars) + (push (pop input) grapheme)) + (setq output (nconc (nreverse grapheme) output)))) + (concat output)) + (concat (nreverse (string-to-list s)))))) + +(defun s-match-strings-all (regex string) + "Return a list of matches for REGEX in STRING. + +Each element itself is a list of matches, as per +`match-string'. Multiple matches at the same position will be +ignored after the first." + (declare (side-effect-free t)) + (save-match-data + (let ((all-strings ()) + (i 0)) + (while (and (< i (length string)) + (string-match regex string i)) + (setq i (1+ (match-beginning 0))) + (let (strings + (num-matches (/ (length (match-data)) 2)) + (match 0)) + (while (/= match num-matches) + (push (match-string match string) strings) + (setq match (1+ match))) + (push (nreverse strings) all-strings))) + (nreverse all-strings)))) + +(defun s-matched-positions-all (regexp string &optional subexp-depth) + "Return a list of matched positions for REGEXP in STRING. +SUBEXP-DEPTH is 0 by default." + (declare (side-effect-free t)) + (if (null subexp-depth) + (setq subexp-depth 0)) + (save-match-data + (let ((pos 0) result) + (while (and (string-match regexp string pos) + (< pos (length string))) + (let ((m (match-end subexp-depth))) + (push (cons (match-beginning subexp-depth) (match-end subexp-depth)) result) + (setq pos (match-end 0)))) + (nreverse result)))) + +(defun s-match (regexp s &optional start) + "When the given expression matches the string, this function returns a list +of the whole matching string and a string for each matched subexpressions. +If it did not match the returned value is an empty list (nil). + +When START is non-nil the search will start at that index." + (declare (side-effect-free t)) + (save-match-data + (if (string-match regexp s start) + (let ((match-data-list (match-data)) + result) + (while match-data-list + (let* ((beg (car match-data-list)) + (end (cadr match-data-list)) + (subs (if (and beg end) (substring s beg end) nil))) + (setq result (cons subs result)) + (setq match-data-list + (cddr match-data-list)))) + (nreverse result))))) + +(defun s-slice-at (regexp s) + "Slices S up at every index matching REGEXP." + (declare (side-effect-free t)) + (if (= 0 (length s)) (list "") + (save-match-data + (let (i) + (setq i (string-match regexp s 1)) + (if i + (cons (substring s 0 i) + (s-slice-at regexp (substring s i))) + (list s)))))) + +(defun s-split-words (s) + "Split S into list of words." + (declare (side-effect-free t)) + (s-split + "[^[:word:]0-9]+" + (let ((case-fold-search nil)) + (replace-regexp-in-string + "\\([[:lower:]]\\)\\([[:upper:]]\\)" "\\1 \\2" + (replace-regexp-in-string "\\([[:upper:]]\\)\\([[:upper:]][0-9[:lower:]]\\)" "\\1 \\2" s))) + t)) + +(defun s--mapcar-head (fn-head fn-rest list) + "Like MAPCAR, but applies a different function to the first element." + (if list + (cons (funcall fn-head (car list)) (mapcar fn-rest (cdr list))))) + +(defun s-lower-camel-case (s) + "Convert S to lowerCamelCase." + (declare (side-effect-free t)) + (s-join "" (s--mapcar-head 'downcase 'capitalize (s-split-words s)))) + +(defun s-upper-camel-case (s) + "Convert S to UpperCamelCase." + (declare (side-effect-free t)) + (s-join "" (mapcar 'capitalize (s-split-words s)))) + +(defun s-snake-case (s) + "Convert S to snake_case." + (declare (side-effect-free t)) + (s-join "_" (mapcar 'downcase (s-split-words s)))) + +(defun s-dashed-words (s) + "Convert S to dashed-words." + (declare (side-effect-free t)) + (s-join "-" (mapcar 'downcase (s-split-words s)))) + +(defun s-capitalized-words (s) + "Convert S to Capitalized words." + (declare (side-effect-free t)) + (let ((words (s-split-words s))) + (s-join " " (cons (capitalize (car words)) (mapcar 'downcase (cdr words)))))) + +(defun s-titleized-words (s) + "Convert S to Titleized Words." + (declare (side-effect-free t)) + (s-join " " (mapcar 's-titleize (s-split-words s)))) + +(defun s-word-initials (s) + "Convert S to its initials." + (declare (side-effect-free t)) + (s-join "" (mapcar (lambda (ss) (substring ss 0 1)) + (s-split-words s)))) + +;; Errors for s-format +(progn + (put 's-format-resolve + 'error-conditions + '(error s-format s-format-resolve)) + (put 's-format-resolve + 'error-message + "Cannot resolve a template to values")) + +(defun s-format (template replacer &optional extra) + "Format TEMPLATE with the function REPLACER. + +REPLACER takes an argument of the format variable and optionally +an extra argument which is the EXTRA value from the call to +`s-format'. + +Several standard `s-format' helper functions are recognized and +adapted for this: + + (s-format \"${name}\" 'gethash hash-table) + (s-format \"${name}\" 'aget alist) + (s-format \"$0\" 'elt sequence) + +The REPLACER function may be used to do any other kind of +transformation." + (let ((saved-match-data (match-data))) + (unwind-protect + (replace-regexp-in-string + "\\$\\({\\([^}]+\\)}\\|[0-9]+\\)" + (lambda (md) + (let ((var + (let ((m (match-string 2 md))) + (if m m + (string-to-number (match-string 1 md))))) + (replacer-match-data (match-data))) + (unwind-protect + (let ((v + (cond + ((eq replacer 'gethash) + (funcall replacer var extra)) + ((eq replacer 'aget) + (funcall 's--aget extra var)) + ((eq replacer 'elt) + (funcall replacer extra var)) + ((eq replacer 'oref) + (funcall #'slot-value extra (intern var))) + (t + (set-match-data saved-match-data) + (if extra + (funcall replacer var extra) + (funcall replacer var)))))) + (if v (format "%s" v) (signal 's-format-resolve md))) + (set-match-data replacer-match-data)))) template + ;; Need literal to make sure it works + t t) + (set-match-data saved-match-data)))) + +(defvar s-lex-value-as-lisp nil + "If `t' interpolate lisp values as lisp. + +`s-lex-format' inserts values with (format \"%S\").") + +(defun s-lex-fmt|expand (fmt) + "Expand FMT into lisp." + (declare (side-effect-free t)) + (list 's-format fmt (quote 'aget) + (append '(list) + (mapcar + (lambda (matches) + (list + 'cons + (cadr matches) + `(format + (if s-lex-value-as-lisp "%S" "%s") + ,(intern (cadr matches))))) + (s-match-strings-all "${\\([^}]+\\)}" fmt))))) + +(defmacro s-lex-format (format-str) + "`s-format` with the current environment. + +FORMAT-STR may use the `s-format' variable reference to refer to +any variable: + + (let ((x 1)) + (s-lex-format \"x is: ${x}\")) + +The values of the variables are interpolated with \"%s\" unless +the variable `s-lex-value-as-lisp' is `t' and then they are +interpolated with \"%S\"." + (declare (debug (form))) + (s-lex-fmt|expand format-str)) + +(defun s-count-matches (regexp s &optional start end) + "Count occurrences of `regexp' in `s'. + +`start', inclusive, and `end', exclusive, delimit the part of `s' to +match. `start' and `end' are both indexed starting at 1; the initial +character in `s' is index 1. + +This function starts looking for the next match from the end of the +previous match. Hence, it ignores matches that overlap a previously +found match. To count overlapping matches, use +`s-count-matches-all'." + (declare (side-effect-free t)) + (save-match-data + (with-temp-buffer + (insert s) + (goto-char (point-min)) + (count-matches regexp (or start 1) (or end (point-max)))))) + +(defun s-count-matches-all (regexp s &optional start end) + "Count occurrences of `regexp' in `s'. + +`start', inclusive, and `end', exclusive, delimit the part of `s' to +match. `start' and `end' are both indexed starting at 1; the initial +character in `s' is index 1. + +This function starts looking for the next match from the second +character of the previous match. Hence, it counts matches that +overlap a previously found match. To ignore matches that overlap a +previously found match, use `s-count-matches'." + (declare (side-effect-free t)) + (let* ((anchored-regexp (format "^%s" regexp)) + (match-count 0) + (i 0) + (narrowed-s (substring s + (when start (1- start)) + (when end (1- end))))) + (save-match-data + (while (< i (length narrowed-s)) + (when (s-matches? anchored-regexp (substring narrowed-s i)) + (setq match-count (1+ match-count))) + (setq i (1+ i)))) + match-count)) + +(defun s-wrap (s prefix &optional suffix) + "Wrap string S with PREFIX and optionally SUFFIX. + +Return string S with PREFIX prepended. If SUFFIX is present, it +is appended, otherwise PREFIX is used as both prefix and +suffix." + (declare (pure t) (side-effect-free t)) + (concat prefix s (or suffix prefix))) + + +;;; Aliases + +(defalias 's-blank-p 's-blank?) +(defalias 's-blank-str-p 's-blank-str?) +(defalias 's-capitalized-p 's-capitalized?) +(defalias 's-contains-p 's-contains?) +(defalias 's-ends-with-p 's-ends-with?) +(defalias 's-equals-p 's-equals?) +(defalias 's-less-p 's-less?) +(defalias 's-lowercase-p 's-lowercase?) +(defalias 's-matches-p 's-matches?) +(defalias 's-mixedcase-p 's-mixedcase?) +(defalias 's-numeric-p 's-numeric?) +(defalias 's-prefix-p 's-starts-with?) +(defalias 's-prefix? 's-starts-with?) +(defalias 's-present-p 's-present?) +(defalias 's-starts-with-p 's-starts-with?) +(defalias 's-suffix-p 's-ends-with?) +(defalias 's-suffix? 's-ends-with?) +(defalias 's-uppercase-p 's-uppercase?) + + +(provide 's) +;;; s.el ends here diff --git a/elpa/s-20180406.808/s.elc b/elpa/s-20180406.808/s.elc new file mode 100644 index 0000000..ab34a2d Binary files /dev/null and b/elpa/s-20180406.808/s.elc differ diff --git a/elpa/scheme-complete-20170824.1413/scheme-complete-autoloads.el b/elpa/scheme-complete-20170824.1413/scheme-complete-autoloads.el new file mode 100644 index 0000000..4178900 --- /dev/null +++ b/elpa/scheme-complete-20170824.1413/scheme-complete-autoloads.el @@ -0,0 +1,15 @@ +;;; scheme-complete-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil nil ("scheme-complete.el") (23391 65266 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; scheme-complete-autoloads.el ends here diff --git a/elpa/scheme-complete-20170824.1413/scheme-complete-pkg.el b/elpa/scheme-complete-20170824.1413/scheme-complete-pkg.el new file mode 100644 index 0000000..292899a --- /dev/null +++ b/elpa/scheme-complete-20170824.1413/scheme-complete-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "scheme-complete" "20170824.1413" "Smart auto completion for Scheme in Emacs" 'nil :commit "4c77038048cbcf34b5907f0439c93058a71a2d2b" :authors '(("Alex Shinn")) :maintainer '("Alex Shinn")) diff --git a/elpa/scheme-complete-20170824.1413/scheme-complete.el b/elpa/scheme-complete-20170824.1413/scheme-complete.el new file mode 100644 index 0000000..e37d4b5 --- /dev/null +++ b/elpa/scheme-complete-20170824.1413/scheme-complete.el @@ -0,0 +1,4715 @@ +;;; scheme-complete.el --- Smart auto completion for Scheme in Emacs + +;;; Author: Alex Shinn +;;; Version: 0.9.7 +;; Package-Version: 20170824.1413 + +;;; This code is written by Alex Shinn and placed in the Public +;;; Domain. All warranties are disclaimed. + +;;; Commentary: +;;; This file provides a single function, `scheme-smart-complete', +;;; which you can use for intelligent, context-sensitive completion +;;; for any Scheme implementation. To use it just load this file and +;;; bind that function to a key in your preferred mode: +;;; +;;; (autoload 'scheme-smart-complete "scheme-complete" nil t) +;;; (eval-after-load 'scheme +;;; '(define-key scheme-mode-map "\e\t" 'scheme-smart-complete)) +;;; +;;; Alternately, you may want to just bind TAB to the +;;; `scheme-complete-or-indent' function, which indents at the start +;;; of a line and otherwise performs the smart completion: +;;; +;;; (eval-after-load 'scheme +;;; '(define-key scheme-mode-map "\t" 'scheme-complete-or-indent)) +;;; +;;; Note: the completion uses a somewhat less common style than +;;; typically found in other modes. The first tab will complete the +;;; longest prefix common to all possible completions. The second +;;; tab will show a list of those completions. Subsequent tabs will +;;; scroll that list. You can't use the mouse to select from the +;;; list - when you see what you want, just type the next one or +;;; more characters in the symbol you want and hit tab again to +;;; continue completing it. Any key typed will bury the completion +;;; list. This ensures you can achieve a completion with the +;;; minimal number of keystrokes without the completions window +;;; lingering and taking up space. +;;; +;;; If you use eldoc-mode (included in Emacs), you can also get live +;;; scheme documentation with: +;;; +;;; (autoload 'scheme-get-current-symbol-info "scheme-complete" nil t) +;;; (add-hook 'scheme-mode-hook +;;; (lambda () +;;; (make-local-variable 'eldoc-documentation-function) +;;; (setq eldoc-documentation-function 'scheme-get-current-symbol-info) +;;; (eldoc-mode))) +;;; +;;; You can enable slightly smarter indentation with +;;; +;;; (setq lisp-indent-function 'scheme-smart-indent-function) +;;; +;;; which basically ignores the scheme-indent-function property for +;;; locally overridden symbols (e.g. if you use the (let loop () ...) +;;; idiom it won't use the special loop indentation inside). +;;; +;;; There's a single custom variable, `scheme-default-implementation', +;;; which you can use to specify your preferred implementation when we +;;; can't infer it from the source code. +;;; +;;; That's all there is to it. + +;;; History: +;;; 0.9.7: 2017/08/24 - improving caching, adding some missing (scheme char) +;;; bindings +;;; 0.9.6: 2017/04/10 - fix possible inf loop in enclosing-2-sexp-prefixes +;;; 0.9.5: 2017/04/02 - completiong for only/except/export, better caching +;;; 0.9.4: 2017/04/01 - don't open non-existant files +;;; 0.9.3: 2016/06/04 - string-cursors, bugfixes, speedups, introducing +;;: unit tests with ert +;;; 0.9.2: 2016/05/03 - several bugfixes +;;; 0.9.1: 2016/04/08 - fixing bug in cond-expand parsing +;;; 0.9.0: 2015/12/23 - R7RS support +;;; 0.8.11: 2013/02/20 - formatting for melpa packaging +;;; 0.8.10: 2010/01/31 - factoring out a `scheme-get-completions' utility +;;; (thanks to Scott Dolim), and not jumping to end +;;; of current symbol if there are no completions for it +;;; 0.8.9: 2009/10/28 - allowing indented module/library definitions, +;;; added various customizations for tab/indent behavior, +;;; complete jumps to end of current symbol +;;; 0.8.8: 2009/08/18 - fixing bug in scheme-directory-tree-files +;; with funny file names +;;; 0.8.7: 2009/07/18 - foof-loop support, don't complete current var, +;; updating chicken 4 module information +;;; 0.8.6: 2009/05/03 - fixing support for chicken 4 w/ unbalanced parens +;;; 0.8.5: 2009/04/30 - full support for chicken 4, fixed bug in caching +;;; 0.8.4: 2008/12/26 - numerous small bugfixes (Merry Christmas!) +;;; 0.8.3: 2008/10/06 - smart indent, inferring types from imported modules, +;;; optionally caching exports, chicken 4 support +;;; 0.8.2: 2008/07/04 - both TAB and M-TAB scroll results (thanks Peter Bex), +;;; better MATCH handling, fixed SRFI-55, other bugfixes +;;; 0.8.1: 2008/04/17 - great renaming, everthing starts with `scheme-' +;;; also, don't scan imported modules multiple times +;;; 0.8: 2008/02/08 - several parsing bugfixes on unclosed parenthesis +;;; (thanks to Kazushi NODA) +;;; filename completion works properly on absolute paths +;;; eldoc works properly on dotted lambdas +;;; 0.7: 2008/01/18 - handles higher-order types (for apply, map, etc.) +;;; smarter string completion (hostname, username, etc.) +;;; smarter type inference, various bugfixes +;;; 0.6: 2008/01/06 - more bugfixes (merry christmas) +;;; 0.5: 2008/01/03 - handling internal defines, records, smarter +;;; parsing +;;; 0.4: 2007/11/14 - silly bugfix plus better repo env support +;;; for searching chicken and gauche modules +;;; 0.3: 2007/11/13 - bugfixes, better inference, smart strings +;;; 0.2: 2007/10/15 - basic type inference +;;; 0.1: 2007/09/11 - initial release +;;; +;;; What is this talk of 'release'? Klingons do not make software +;;; 'releases'. Our software 'escapes' leaving a bloody trail of +;;; designers and quality assurance people in its wake. + +(require 'cl) + +;; this is just to eliminate some warnings when compiling - this file +;; should be loaded after 'scheme +(eval-when (compile) + (require 'scheme)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; You can set the `scheme-default-implementation' to your preferred +;; implementation, for when we can't figure out the file from +;; heuristics. Alternately, in any given buffer, just +;; +;; (setq *scheme-current-implementation* whatever) + +(defvar *scheme-current-implementation* nil) +(make-variable-buffer-local '*scheme-current-implementation*) + +(defvar *scheme-current-context* nil) +(make-variable-buffer-local '*scheme-current-context*) + +;; most implementations use their name as the script name +(defvar *scheme-interpreter-alist* + '(("chibi-scheme" . chibi) + ("csi" . chicken) + ("gosh" . gauche) + ("gsi" . gambit) + )) + +(defvar in-mod-p nil) + +(defgroup scheme-complete nil + "Smart tab completion" + :group 'scheme) + +(defcustom scheme-default-implementation nil + "Default scheme implementation to provide completion for +when scheme-complete can't infer the current implementation." + :type 'symbol + :group 'scheme-complete) + +(defcustom scheme-always-use-default-implementation-p nil + "Always use `scheme-default-implementation' instead of heuristics." + :type 'symbol + :group 'scheme-complete) + +(defcustom scheme-complete-smart-indent-p t + "Toggles using `scheme-smart-indent' for `scheme-complete-or-indent'." + :type 'boolean + :group 'scheme-complete) + +(defcustom scheme-indent-before-complete-p nil + "Toggles indenting the current line before completing." + :type 'boolean + :group 'scheme-complete) + +(defcustom scheme-complete-empty-tab-behavior 'complete + "Behavior for `scheme-complete-or-indent' when completing an empty symbol. +A value of `complete' (the default) will complete all symbols +elligible according to the normal type inference rules. Since +they are not being filtered by any prefix, the list may be long - +you can scroll through it or switch to the *Completions* buffer +to view it. A value of `indent' will assume you meant to indent +at that location, and `beep' will just beep and do nothing." + :type '(choice (const complete) (const indent) (const beep)) + :group 'scheme-complete) + +(defcustom scheme-complete-from-end-of-symbol-p t + "If true jump to the end when completing from the middle of a symbol." + :type 'boolean + :group 'scheme-complete) + +(defcustom scheme-complete-cache-p t + "Toggles caching of module/load export information." + :type 'boolean + :group 'scheme-complete) + +(defcustom scheme-interleave-definitions-p nil + "Allow internal defines to be mixed with expressions." + :type 'boolean + :group 'scheme-complete) + +(defcustom scheme-complete-recursive-inference-p t + "Recursively infer types from imported modules rather than shallow parses." + :type 'boolean + :group 'scheme-complete) + +(defcustom *scheme-r7rs-extension* ".sld" + "File extension for R7RS library declarations." + :type 'string + :group 'scheme-complete) + +(defcustom *scheme-max-decl-file-search-depth* 5 + "Maximum number of directories to backtrack looking for including libraries." + :type 'integer + :group 'scheme-complete) + +(defcustom *scheme-use-r7rs* t + "Set to nil to restore legacy behavior." + :type 'boolean + :group 'scheme-complete) + +(defcustom *scheme-default-library-path* nil + "Library path to search for modules. Inferred (possibly slowly) if not set." + :type '(repeat file) + :group 'scheme-complete) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; info +;; +;; identifier type [doc-string no-type-display?] +;; +;; types: +;; +;; pair, number, symbol, etc. +;; (lambda (param-types) [return-type]) +;; (syntax (param-types) [return-type]) +;; (set name values ...) +;; (flags name values ...) +;; (list type) +;; (string expander) +;; (special type function [outer-function]) + +(defvar *scheme-r7rs-lib-decl-info* + '((begin (syntax (body \.\.\.))) + (cond-expand (syntax (clause \.\.\.))) + (export (syntax identifier \.\.\.)) + (import (special list scheme-available-modules)) + (include (syntax filename \.\.\.)) + (include-ci (syntax filename \.\.\.)) + (include-library-declarations (syntax filename \.\.\.)))) + +(defvar *scheme-r7rs-info* + `(((scheme base) + (_ (syntax) "auxiliary syntax") + (... (syntax) "auxiliary syntax") + (* (lambda (z1 \.\.\.) z)) + (+ (lambda (z1 \.\.\.) z)) + (- (lambda (z1 \.\.\.) z)) + (/ (lambda (z1 \.\.\.) z)) + (<= (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically nondecreasing") + (< (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically increasing") + (=> (syntax) "auxiliary syntax") + (= (lambda (z1 z2 \.\.\.) bool) "returns #t iff the arguments are all equal") + (>= (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically nonincreasing") + (> (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically decreasing") + (abs (lambda (x1) x2) "returns the absolute value of X") + (and (syntax (expr \.\.\.)) "evaluate EXPRs while true, return last") + (append (lambda (list \.\.\.) list) "concatenates the list arguments") + (apply (lambda ((lambda obj a) obj \.\.\.) a) "procedure application") + (assoc (lambda (obj list)) "the element of LIST whose car is equal? to OBJ") + (assq (lambda (obj list)) "the element of LIST whose car is eq? to OBJ") + (assv (lambda (obj list)) "the element of LIST whose car is eqv? to OBJ") + (begin (syntax (expr \.\.\.)) "evaluate each EXPR in turn and return the last") + (boolean? (lambda (obj) bool) "returns #t iff OBJ is #t or #f") + (boolean=? (lambda (bool1 bool2) bool)) + (bytevector (lambda (i \.\.\.) bytevector)) + (bytevector-copy (lambda (bytevector :optional start end) bytevector)) + (bytevector-append (lambda (bytevector \.\.\.) bytevector)) + (bytevector-copy! (lambda (bytevector i \.\.\. bytevector :optional start end) undefined)) + (bytevector-length (lambda (bytevector) i)) + (bytevector-u8-ref (lambda (bytevector i) i)) + (bytevector-u8-set! (lambda (bytevector i i) undefined)) + (bytevector? (lambda (obj) bool)) + (caar (lambda (pair) obj)) + (cadr (lambda (pair) obj)) + (call-with-current-continuation (lambda (proc) obj) "goto on steroids") + (call-with-values (lambda (producer consumer) obj)) + (call-with-port (lambda (port proc) obj)) + (call/cc (lambda (proc) obj) "short for call-with-current-continuation") + (case (syntax (expr clause \.\.\.)) "look for EXPR among literal lists") + (car (lambda (pair) obj)) + (cdr (lambda (pair) obj)) + (cdar (lambda (pair) obj)) + (cddr (lambda (pair) obj)) + (ceiling (lambda (x1) n) "smallest integer not smaller than X") + (char->integer (lambda (ch) int)) + (char<=? (lambda (ch1 ch2) bool)) + (char=? (lambda (ch1 ch2) bool)) + (char>? (lambda (ch1 ch2) bool)) + (char? (lambda (obj) bool) "returns #t iff OBJ is a character") + (complex? (lambda (obj) bool) "returns #t iff OBJ is a complex number") + (cond (syntax (clause \.\.\.)) "try each clause until one succeeds") + (cond-expand (syntax (clause \.\.\.))) + (cons (lambda (obj1 obj2) pair) "create a newly allocated pair") + (define-syntax (syntax (identifier body \.\.\.) undefined) "create a macro") + (define (syntax (identifier value) undefined) "define a new variable") + (define-values (syntax (identifier \.\.\.) expr)) + (define-record-type (syntax name (make field \.\.\.) pred-name (field get set) \.\.\.)) + (denominator (lambda (rational) n)) + (do (syntax (vars finish body \.\.\.)) "simple iterator") + (dynamic-wind (lambda (before-thunk thunk after-thunk) obj)) + (else (syntax) "auxiliary syntax") + (eq? (lambda (obj1 obj2) bool) "finer grained version of EQV?") + (equal? (lambda (obj1 obj2) bool) "recursive equivalence") + (eqv? (lambda (obj1 obj2) bool) "returns #t if OBJ1 and OBJ2 are the same object") + (error (lambda (msg args \.\.\.) error)) + (error-object? (lambda (obj) bool)) + (error-object-message (lambda (error) string)) + (error-object-irritants (lambda (error) list)) + (even? (lambda (n) bool)) + (exact (lambda (z) z)) + (exact-integer-sqrt (lambda (n) n)) + (exact-integer? (lambda (z) bool)) + (exact? (lambda (z) bool) "returns #t iff Z is exact") + (expt (lambda (z1 z2) z) "returns Z1 raised to the Z2 power") + (floor (lambda (x1) n) "largest integer not larger than X") + (for-each (lambda ((lambda obj a) obj \.\.\.) undefined) "apply PROC to each element of LIST in order") + (gcd (lambda (n1 \.\.\.) n) "greatest common divisor") + (floor/ (lambda (x1) (values n n))) + (floor-quotient (lambda (x1) n)) + (floor-remainder (lambda (x1) n)) + (truncate/ (lambda (x1) (values n n))) + (truncate-quotient (lambda (x1) n)) + (truncate-remainder (lambda (x1) n)) + (features (lambda () (list symbol))) + (guard (syntax ((var clause \.\.\.) body \.\.\.))) + (if (syntax (cond then else)) "conditional evaluation") + (include (syntax filename \.\.\.)) + (include-ci (syntax filename \.\.\.)) + (inexact (lambda (z) z)) + (inexact? (lambda (z) bool) "returns #t iff Z is inexact") + (integer->char (lambda (int) ch)) + (integer? (lambda (obj) bool) "returns #t iff OBJ is an integer") + (lambda (syntax (params body \.\.\.)) "procedure syntax") + (lcm (lambda (n2 \.\.\.) n) "least common multiple") + (length (lambda (list) n)) + (let* (syntax (vars body \.\.\.)) "bind new local variables sequentially") + (let-syntax (syntax (syntaxes body \.\.\.)) "a local macro") + (letrec* (syntax (vars body \.\.\.)) "bind new local variables recursively in order") + (letrec-syntax (syntax (syntaxes body \.\.\.)) "a local macro") + (let-values (syntax (vars body \.\.\.))) + (let*-values (syntax (vars body \.\.\.))) + (letrec (syntax (vars body \.\.\.)) "bind new local variables recursively") + (let (syntax (vars body \.\.\.)) "bind new local variables in parallel") + (list-copy (lambda (list) list)) + (list->string (lambda (list) str)) + (list->vector (lambda (list) vec)) + (list-ref (lambda (list k) obj) "returns the Kth element of LIST") + (list-set! (lambda (list k val) undefined)) + (list-tail (lambda (list k) list) "returns the Kth cdr of LIST") + (list? (lambda (obj) bool) "returns #t iff OBJ is a proper list") + (list (lambda (obj \.\.\.) list) "returns a newly allocated list") + (make-bytevector (lambda (k :optional u8) bytevector)) + (make-list (lambda (k :optional obj) list)) + (make-parameter (lambda (init :optional converter) parameter)) + (make-string (lambda (k :optional ch) str) "a new string of length k") + (make-vector (lambda (len :optional fill) vec) "a new vector of K elements") + (map (lambda ((lambda (obj1 . obj2) a) list \.\.\.) (list a)) "a new list of PROC applied to every element of LIST") + (max (lambda (x1 x2 \.\.\.) x3) "returns the maximum of the arguments") + (member (lambda (obj list)) "the sublist of LIST whose car is equal? to OBJ") + (memq (lambda (obj list)) "the sublist of LIST whose car is eq? to OBJ") + (memv (lambda (obj list)) "the sublist of LIST whose car is eqv? to OBJ") + (min (lambda (x1 x2 \.\.\.) x3) "returns the minimum of the arguments") + (modulo (lambda (n1 n2) n) "same sign as N2") + (negative? (lambda (x1) bool)) + (not (lambda (obj) bool) "returns #t iff OBJ is false") + (null? (lambda (obj) bool) "returns #t iff OBJ is the empty list") + (number->string (lambda (z :optional radix) str)) + (number? (lambda (obj) bool) "returns #t iff OBJ is a number") + (numerator (lambda (rational) n)) + (odd? (lambda (n) bool)) + (or (syntax (expr \.\.\.)) "return the first true EXPR") + (pair? (lambda (obj) bool) "returns #t iff OBJ is a pair") + (parameterize (syntax (((id value) \.\.\.) body \.\.\.))) + (positive? (lambda (x1) bool)) + (procedure? (lambda (obj) bool) "returns #t iff OBJ is a procedure") + (quasiquote (syntax (expr)) "quote literals allowing escapes") + (quote (syntax (expr)) "represent EXPR literally without evaluating it") + (quotient (lambda (n1 n2) n) "integer division") + (raise-continuable (lambda (obj) error)) + (raise (lambda (obj) error)) + (rational? (lambda (obj) bool) "returns #t iff OBJ is a rational number") + (rationalize (lambda (x1 y) n) "rational number differing from X by at most Y") + (real? (lambda (obj) bool) "returns #t iff OBJ is a real number") + (remainder (lambda (n1 n2) n) "same sign as N1") + (reverse (lambda (list) list)) + (round (lambda (x1) n) "round to even (banker's rounding)") + (set! (syntax (identifier value) undefined) "set the value of a variable") + (set-car! (lambda (pair obj) undefined)) + (set-cdr! (lambda (pair obj) undefined)) + (square (lambda (z) z)) + (string->list (lambda (str) list)) + (string->number (lambda (str :optional radix) z)) + (string->symbol (lambda (str) symbol)) + (string->vector (lambda (str) vector)) + (string-append (lambda (str \.\.\.) str) "concatenate the string arguments") + (string-copy (lambda (str) str)) + (string-copy! (lambda (str k str :optional start end) undefined)) + (string-fill! (lambda (str ch) undefined) "set every char in STR to CH") + (string-for-each (lambda (proc str \.\.\.) undefined)) + (string-length (lambda (str) n) "the number of characters in STR") + (string-map (lambda (proc str \.\.\.) str)) + (string-ref (lambda (str i) ch) "the Ith character of STR") + (string-set! (lambda (str i ch) undefined) "set the Ith character of STR to CH") + (string<=? (lambda (str1 str2) bool)) + (string=? (lambda (str1 str2) bool)) + (string>? (lambda (str1 str2) bool)) + (string? (lambda (obj) bool) "returns #t iff OBJ is a string") + (string (lambda (ch \.\.\.) str) "a new string made of the char arguments") + (substring (lambda (str start end) str)) + (symbol->string (lambda (symbol) str)) + (symbol=? (lambda (symbol1 symbol2) bool)) + (symbol? (lambda (obj) bool) "returns #t iff OBJ is a symbol") + (syntax-error (syntax (msg obj \.\.\.) error)) + (syntax-rules (syntax (literals clauses \.\.\.) undefined) "simple macro language") + (truncate (lambda (x1) n) "drop fractional part") + (values (lambda (obj \.\.\.) (values obj \.\.\.)) "send multiple values to the calling continuation") + (unquote (syntax (expr)) "escape an expression inside quasiquote") + (unquote-splicing (syntax (expr)) "escape and splice a list expression inside quasiquote") + (vector-append (lambda (vec \.\.\.) vec)) + (vector-copy (lambda (vec :optional start end) vec)) + (vector-copy! (lambda (vec k vec :optional start end) undefined)) + (vector->list (lambda (vec) list)) + (vector->string (lambda (vec) str)) + (vector-fill! (lambda (vec obj) undefined) "set every element in VEC to OBJ") + (vector-for-each (lambda (proc vec \.\.\.) undefined)) + (vector-length (lambda (vec) n) "the number of elements in VEC") + (vector-map (lambda (proc vec \.\.\.) map)) + (vector-ref (lambda (vec i) obj) "the Ith element of VEC") + (vector-set! (lambda (vec i obj) undefined) "set the Ith element of VEC to OBJ") + (vector? (lambda (obj) bool) "returns #t iff OBJ is a vector") + (vector (lambda (obj \.\.\.) vec)) + (zero? (lambda (z) bool)) + (when (syntax (expr body \.\.\.))) + (with-exception-handler (lambda (proc thunk))) + (unless (syntax (expr body \.\.\.))) + (binary-port? (lambda (obj) bool)) + (char-ready? (lambda (:optional input-port) bool)) + (textual-port? (lambda (obj) bool)) + (close-port (lambda (port) undefined)) + (close-input-port (lambda (input-port))) + (close-output-port (lambda (output-port))) + (current-error-port (lambda () output-port) "the default output for error messages") + (current-input-port (lambda () input-port) "the default input for read procedures") + (current-output-port (lambda () output-port) "the default output for write procedures") + (eof-object (lambda () eof-object)) + (eof-object? (lambda (obj) bool) "returns #t iff OBJ is the end-of-file object") + (file-error? (lambda (obj) bool)) + (flush-output-port (lambda (:optional output-port) undefined)) + (get-output-string (lambda (output-port) str)) + (get-output-bytevector (lambda (output-port) bytevector)) + (input-port? (lambda (obj) bool) "returns #t iff OBJ is an input port") + (input-port-open? (lambda (input-port) bool)) + (newline (lambda (:optional output-port) undefined) "send a linefeed") + (open-input-string (lambda (str) input-port)) + (open-input-bytevector (lambda (bytevector) input-port)) + (open-output-string (lambda () output-port)) + (open-output-bytevector (lambda () output-port)) + (output-port? (lambda (obj) bool) "returns #t iff OBJ is an output port") + (output-port-open? (lambda (output-port) bool)) + (peek-char (lambda (:optional input-port) ch)) + (peek-u8 (lambda (:optional input-port) u8)) + (port? (lambda (obj) port)) + (read-bytevector (lambda (k :optional input-port) bytevector)) + (read-bytevector! (lambda (bytevector :optional input-port start end) undefined)) + (read-char (lambda (:optional input-port) ch) "read a single character") + (read-error? (lambda (obj) error)) + (read-line (lambda (:optional input-port) str)) + (read-string (lambda (k :optional input-port))) + (read-u8 (lambda (:optional input-port) u8)) + (string->utf8 (lambda (str :optional start end) bytevector)) + (utf8->string (lambda (bytevector :optional start end) str)) + (u8-ready? (lambda (:optional input-port) bool)) + (write-bytevector (lambda (bytevector :optional output-port start end))) + (write-char (lambda (char :optional output-port) undefined) "write a single character") + (write-string (lambda (str :optional output-port start end))) + (write-u8 (lambda (u8 :optional output-port)))) + ((scheme case-lambda) + (case-lambda (syntax (clauses \.\.\.) procedure))) + ((scheme char) + (digit-value (lambda (ch) n)) + (char-downcase (lambda (ch) ch)) + (char-foldcase (lambda (ch) ch)) + (char-upcase (lambda (ch) ch)) + (char-alphabetic? (lambda (ch) bool)) + (char-lower-case? (lambda (ch) bool)) + (char-upper-case? (lambda (ch) bool)) + (char-numeric? (lambda (ch) bool)) + (char-whitespace? (lambda (ch) bool)) + (char-ci<=? (lambda (ch1 ch2 \.\.\.) bool)) + (char-ci=? (lambda (ch1 ch2 \.\.\.) bool)) + (char-ci>? (lambda (ch1 ch2 \.\.\.) bool)) + (string-downcase (lambda (str) str)) + (string-foldcase (lambda (str) str)) + (string-upcase (lambda (str) str)) + (string-ci<=? (lambda (str1 str2 \.\.\.) bool)) + (string-ci=? (lambda (str1 str2 \.\.\.) bool)) + (string-ci>? (lambda (str1 str2 \.\.\.) bool))) + ((scheme complex) + (angle (lambda (z) x1)) + (imag-part (lambda (z) x1)) + (magnitude (lambda (z) x1)) + (make-polar (lambda (x1 x2) z) "create a complex number") + (make-rectangular (lambda (x1 x2) z) "create a complex number") + (real-part (lambda (z) x1))) + ((scheme cxr) + (caaaar (lambda (pair))) (caaadr (lambda (pair))) + (caadar (lambda (pair))) (caaddr (lambda (pair))) + (cadaar (lambda (pair))) (cadadr (lambda (pair))) + (caddar (lambda (pair))) (cadddr (lambda (pair))) + (cdaaar (lambda (pair))) (cdaadr (lambda (pair))) + (cdadar (lambda (pair))) (cdaddr (lambda (pair))) + (cddaar (lambda (pair))) (cddadr (lambda (pair))) + (cdddar (lambda (pair))) (cddddr (lambda (pair))) + (caaar (lambda (pair))) (caadr (lambda (pair))) + (cadar (lambda (pair))) (caddr (lambda (pair))) + (cdaar (lambda (pair))) (cdadr (lambda (pair))) + (cddar (lambda (pair))) (cdddr (lambda (pair)))) + ((scheme eval) + (eval (lambda (expr env))) + (environment (lambda (list \.\.\.) env))) + ((scheme file) + (call-with-input-file (lambda (path proc) input-port)) + (call-with-output-file (lambda (path proc) output-port)) + (delete-file (lambda (path) undefined)) + (file-exists? (lambda (path) bool)) + (open-input-file (lambda (path) input-port)) + (open-output-file (lambda (path) output-port)) + (open-binary-input-file (lambda (path) input-port)) + (open-binary-output-file (lambda (path) output-port)) + (with-input-from-file (lambda (path thunk) obj)) + (with-output-to-file (lambda (path thunk) obj))) + ((scheme inexact) + (acos (lambda (z) z) "arccosine function") + (asin (lambda (z) z) "arcsine function") + (atan (lambda (z) z) "arctangent function") + (cos (lambda (z) z) "cosine function") + (exp (lambda (z) z) "e^Z") + (finite? (lambda (z) bool)) + (infinite? (lambda (z) bool)) + (log (lambda (z) z) "natural logarithm of Z") + (nan? (lambda (z) bool)) + (sin (lambda (z) z) "sine function") + (sqrt (lambda (z) z) "principal square root of Z") + (tan (lambda (z) z))) + ((scheme lazy) + (delay (syntax (expr)) "create a promise to evaluate EXPR") + (delay-force (syntax (expr))) + (force (lambda (promise) obj) "force the delayed value of PROMISE") + (make-promise (lambda (obj) promise)) + (promise? (lambda (obj) bool))) + ((scheme load) + (load (lambda (path) undefined))) + ((scheme process-context) + (get-environment-variable (lambda (str) (or str bool))) + (get-environment-variables (lambda () (list (pair str str)))) + (command-line (lambda () (list str))) + (emergency-exit (lambda (:optional obj) undefined)) + (exit (lambda (:optional obj) undefined))) + ((scheme read) + (read (lambda (:optional input-port) obj))) + ((scheme repl) + (interaction-environment (lambda () env))) + ((scheme time) + (current-second (lambda () x1)) + (current-jiffy (lambda () n)) + (jiffies-per-second (lambda () n))) + ((scheme write) + (write (lambda (obj :optional output-port) undefined) "write an object, handling cycles") + (write-shared (lambda (obj :optional output-port) undefined) "write an object showing all shared structure") + (write-simple (lambda (obj :optional output-port) undefined) "write a non-cyclic object") + (display (lambda (obj :optional output-port) undefined) "display an object")) + )) + +(defvar *scheme-r5rs-info* + nil) + +(defvar *scheme-r5rs-bindings* + '(define set! let let* letrec lambda if cond + case delay and or begin do quote quasiquote unquote unquote-splicing + define-syntax let-syntax letrec-syntax syntax-rules eqv? eq? equal? not + boolean? number? complex? real? rational? integer? exact? inexact? = < > + <= >= zero? positive? negative? odd? even? max min + * - / abs quotient + remainder modulo gcd lcm numerator denominator floor ceiling truncate + round rationalize exp log sin cos tan asin acos atan sqrt expt + make-rectangular make-polar real-part imag-part magnitude angle + number->string string->number pair? cons car cdr set-car! set-cdr! caar + cadr cdar cddr caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar + caaadr caadar caaddr cadaar cadadr caddar cadddr cdaaar cdaadr cdadar + cdaddr cddaar cddadr cdddar cddddr null? list? list length append reverse + list-tail list-ref memq memv member assq assv assoc symbol? symbol->string + string->symbol char? char=? char? char<=? char>=? char-ci=? + char-ci? char-ci<=? char-ci>=? char-alphabetic? char-numeric? + char-whitespace? char-upper-case? char-lower-case? char->integer + integer->char char-upcase char-downcase string? make-string string + string-length string-ref string-set! string=? string-ci=? string? string<=? string>=? string-ci? string-ci<=? + string-ci>=? substring string-append string->list list->string string-copy + string-fill! vector? make-vector vector vector-length vector-ref + vector-set! vector->list list->vector vector-fill! procedure? apply map + for-each force call-with-current-continuation values call-with-values + dynamic-wind scheme-report-environment null-environment + call-with-input-file call-with-output-file input-port? output-port? + current-input-port current-output-port with-input-from-file + with-output-to-file open-input-file open-output-file close-input-port + close-output-port read read-char peek-char eof-object? char-ready? write + display newline write-char load eval)) + +(defun scheme-r5rs-info () + (unless *scheme-r5rs-info* + (setq *scheme-r5rs-info* + (append + '((exact->inexact (lambda (z) z)) + (inexact->exact (lambda (z) z))) + (mapcar #'(lambda (x) + (scheme-env-lookup *scheme-r7rs-info* x)) + *scheme-r5rs-bindings*)))) + *scheme-r5rs-info*) + +(defvar *scheme-srfi-info* + [ + ;; SRFI 0 + ("Feature-based conditional expansion construct" + (cond-expand (syntax (clause \.\.\.)))) + + ;; SRFI 1 + ("List Library" + (xcons (lambda (object object) pair)) + (cons* (lambda (object \.\.\.) pair)) + (make-list (lambda (integer :optional object) list)) + (list-tabulate (lambda (integer procedure) list)) + (list-copy (lambda (list) list)) + (circular-list (lambda (object \.\.\.) list)) + (iota (lambda (integer :optional integer integer) list)) + (proper-list? (lambda (object) bool)) + (circular-list? (lambda (object) bool)) + (dotted-list? (lambda (object) bool)) + (not-pair? (lambda (object) bool)) + (null-list? (lambda (object) bool)) + (list= (lambda (procedure list \.\.\.) bool)) + (first (lambda (pair))) + (second (lambda (pair))) + (third (lambda (pair))) + (fourth (lambda (pair))) + (fifth (lambda (pair))) + (sixth (lambda (pair))) + (seventh (lambda (pair))) + (eighth (lambda (pair))) + (ninth (lambda (pair))) + (tenth (lambda (pair))) + (car+cdr (lambda (pair))) + (take (lambda (pair integer) list)) + (drop (lambda (pair integer) list)) + (take-right (lambda (pair integer) list)) + (drop-right (lambda (pair integer) list)) + (take! (lambda (pair integer) list)) + (drop-right! (lambda (pair integer) list)) + (split-at (lambda (pair integer) list)) + (split-at! (lambda (pair integer) list)) + (last (lambda (pair) obj)) + (last-pair (lambda (pair) pair)) + (length+ (lambda (object) n)) + (concatenate (lambda (list) list)) + (append! (lambda (list \.\.\.) list)) + (concatenate! (lambda (list) list)) + (reverse! (lambda (list) list)) + (append-reverse (lambda (list list) list)) + (append-reverse! (lambda (list list) list)) + (zip (lambda (list \.\.\.) list)) + (unzip1 (lambda (list) list)) + (unzip2 (lambda (list) list)) + (unzip3 (lambda (list) list)) + (unzip4 (lambda (list) list)) + (unzip5 (lambda (list) list)) + (count (lambda ((lambda (obj1 . obj2)) list \.\.\.) n)) + (fold (lambda ((lambda (obj1 obj2 . obj3) a) object list \.\.\.) a)) + (unfold (lambda (procedure procedure procedure object :optional procedure) obj)) + (pair-fold (lambda ((lambda obj a) object list \.\.\.) a)) + (reduce (lambda ((lambda (obj1 obj2 . obj3) a) object list \.\.\.) a)) + (fold-right (lambda ((lambda (obj1 obj2 . obj3) a) object list \.\.\.) a)) + (unfold-right (lambda (procedure procedure procedure object :optional object) obj)) + (pair-fold-right (lambda ((lambda (obj1 obj2 . obj3) a) object list \.\.\.) a)) + (reduce-right (lambda ((lambda (obj1 obj2 . obj3) a) object list \.\.\.) a)) + (append-map (lambda ((lambda (obj1 . obj2)) list \.\.\.) list)) + (append-map! (lambda ((lambda (obj1 . obj2)) list \.\.\.) list)) + (map! (lambda ((lambda (obj1 . obj2)) list \.\.\.) list)) + (pair-for-each (lambda ((lambda (obj1 . obj2)) list \.\.\.) undefined)) + (filter-map (lambda ((lambda (obj1 . obj2)) list \.\.\.) list)) + (map-in-order (lambda ((lambda (obj1 . obj2)) list \.\.\.) list)) + (filter (lambda ((lambda (obj1 . obj2)) list) list)) + (partition (lambda ((lambda (obj) bool) list) list)) + (remove (lambda ((lambda (obj1) bool) list) list)) + (filter! (lambda ((lambda (obj1) bool) list) list)) + (partition! (lambda ((lambda (obj1) bool) list) list)) + (remove! (lambda ((lambda (obj1) bool) list) list)) + (find (lambda ((lambda (obj1) bool) list) obj)) + (find-tail (lambda ((lambda (obj1) bool) list) obj)) + (any (lambda ((lambda (obj1 . obj2) a) list \.\.\.) a)) + (every (lambda ((lambda (obj1 . obj2) a) list \.\.\.) a)) + (list-index (lambda ((lambda (obj1 . obj2)) list \.\.\.) (or bool integer))) + (take-while (lambda ((lambda (obj)) list) list)) + (drop-while (lambda ((lambda (obj)) list) list)) + (take-while! (lambda ((lambda (obj)) list) list)) + (span (lambda ((lambda (obj)) list) list)) + (break (lambda ((lambda (obj)) list) list)) + (span! (lambda ((lambda (obj)) list) list)) + (break! (lambda ((lambda (obj)) list) list)) + (delete (lambda (object list :optional procedure) list)) + (delete-duplicates (lambda (list :optional procedure) list)) + (delete! (lambda (obj list :optional procedure) list)) + (delete-duplicates! (lambda (list :optional procedure) list)) + (alist-cons (lambda (obj1 obj2 alist) alist)) + (alist-copy (lambda (alist) alist)) + (alist-delete (lambda (obj alist) alist)) + (alist-delete! (lambda (obj alist) alist)) + (lset<= (lambda (procedure list \.\.\.) bool)) + (lset= (lambda (procedure list \.\.\.) bool)) + (lset-adjoin (lambda (procedure list object \.\.\.) list)) + (lset-union (lambda (procedure list \.\.\.) list)) + (lset-union! (lambda (procedure list \.\.\.) list)) + (lset-intersection (lambda (procedure list \.\.\.) list)) + (lset-intersection! (lambda (procedure list \.\.\.) list)) + (lset-difference (lambda (procedure list \.\.\.) list)) + (lset-difference! (lambda (procedure list \.\.\.) list)) + (lset-xor (lambda (procedure list \.\.\.) list)) + (lset-xor! (lambda (procedure list \.\.\.) list)) + (lset-diff+intersection (lambda (procedure list \.\.\.) list)) + (lset-diff+intersection! (lambda (procedure list \.\.\.) list)) + + ) + + ;; SRFI 2 + ("AND-LET*: an AND with local bindings, a guarded LET* special form" + (and-let* (syntax (bindings body \.\.\.)))) + + () + + ;; SRFI 4 + ("Homogeneous numeric vector datatypes" + + (u8vector? (lambda (obj) bool)) + (make-u8vector (lambda (size integer) u8vector)) + (u8vector (lambda (integer \.\.\.) u8vector)) + (u8vector-length (lambda (u8vector) n)) + (u8vector-ref (lambda (u8vector i) int)) + (u8vector-set! (lambda (u8vector i u8value) undefined)) + (u8vector->list (lambda (u8vector) list)) + (list->u8vector (lambda (list) u8vector)) + + (s8vector? (lambda (obj) bool)) + (make-s8vector (lambda (size integer) s8vector)) + (s8vector (lambda (integer \.\.\.) s8vector)) + (s8vector-length (lambda (s8vector) n)) + (s8vector-ref (lambda (s8vector i) int)) + (s8vector-set! (lambda (s8vector i s8value) undefined)) + (s8vector->list (lambda (s8vector) list)) + (list->s8vector (lambda (list) s8vector)) + + (u16vector? (lambda (obj) bool)) + (make-u16vector (lambda (size integer) u16vector)) + (u16vector (lambda (integer \.\.\.))) + (u16vector-length (lambda (u16vector) n)) + (u16vector-ref (lambda (u16vector i) int)) + (u16vector-set! (lambda (u16vector i u16value) undefined)) + (u16vector->list (lambda (u16vector) list)) + (list->u16vector (lambda (list) u16vector)) + + (s16vector? (lambda (obj) bool)) + (make-s16vector (lambda (size integer) s16vector)) + (s16vector (lambda (integer \.\.\.) s16vector)) + (s16vector-length (lambda (s16vector) n)) + (s16vector-ref (lambda (s16vector i) int)) + (s16vector-set! (lambda (s16vector i s16value) undefined)) + (s16vector->list (lambda (s16vector) list)) + (list->s16vector (lambda (list) s16vector)) + + (u32vector? (lambda (obj) bool)) + (make-u32vector (lambda (size integer) u32vector)) + (u32vector (lambda (integer \.\.\.) u32vector)) + (u32vector-length (lambda (u32vector) n)) + (u32vector-ref (lambda (u32vector i) int)) + (u32vector-set! (lambda (u32vector i u32value) undefined)) + (u32vector->list (lambda (u32vector) list)) + (list->u32vector (lambda (list) u32vector)) + + (s32vector? (lambda (obj) bool)) + (make-s32vector (lambda (size integer) s32vector)) + (s32vector (lambda (integer \.\.\.) s32vector)) + (s32vector-length (lambda (s32vector) n)) + (s32vector-ref (lambda (s32vector i) int)) + (s32vector-set! (lambda (s32vector i s32value) undefined)) + (s32vector->list (lambda (s32vector) list)) + (list->s32vector (lambda (list) s32vector)) + + (u64vector? (lambda (obj) bool)) + (make-u64vector (lambda (size integer) u64vector)) + (u64vector (lambda (integer \.\.\.) u64vector)) + (u64vector-length (lambda (u64vector) n)) + (u64vector-ref (lambda (u64vector i) int)) + (u64vector-set! (lambda (u64vector i u64value) undefined)) + (u64vector->list (lambda (u64vector) list)) + (list->u64vector (lambda (list) u64vector)) + + (s64vector? (lambda (obj) bool)) + (make-s64vector (lambda (size integer) s64vector)) + (s64vector (lambda (integer \.\.\.) s64vector)) + (s64vector-length (lambda (s64vector) n)) + (s64vector-ref (lambda (s64vector i) int)) + (s64vector-set! (lambda (s64vector i s64value) undefined)) + (s64vector->list (lambda (s64vector) list)) + (list->s64vector (lambda (list) s64vector)) + + (f32vector? (lambda (obj) bool)) + (make-f32vector (lambda (size integer) f32vector)) + (f32vector (lambda (number \.\.\.) f32vector)) + (f32vector-length (lambda (f32vector) n)) + (f32vector-ref (lambda (f32vector i) int)) + (f32vector-set! (lambda (f32vector i f32value) undefined)) + (f32vector->list (lambda (f32vector) list)) + (list->f32vector (lambda (list) f32vector)) + + (f64vector? (lambda (obj) bool)) + (make-f64vector (lambda (size integer) f64vector)) + (f64vector (lambda (number \.\.\.) f64vector)) + (f64vector-length (lambda (f64vector) n)) + (f64vector-ref (lambda (f64vector i) int)) + (f64vector-set! (lambda (f64vector i f64value) undefined)) + (f64vector->list (lambda (f64vector) list)) + (list->f64vector (lambda (list) f64vector)) + ) + + ;; SRFI 5 + ("A compatible let form with signatures and rest arguments" + (let (syntax (bindings body \.\.\.)))) + + ;; SRFI 6 + ("Basic String Ports" + (open-input-string (lambda (str) input-port)) + (open-output-string (lambda () output-port)) + (get-output-string (lambda (output-port) str))) + + ;; SRFI 7 + ("Feature-based program configuration language" + (program (syntax (clause \.\.\.))) + (feature-cond (syntax (clause)))) + + ;; SRFI 8 + ("receive: Binding to multiple values" + (receive (syntax (identifiers producer body \.\.\.)))) + + ;; SRFI 9 + ("Defining Record Types" + (define-record-type (syntax (name constructor-name pred-name fields \.\.\.)))) + + ;; SRFI 10 + ("Sharp-Comma External Form" + (define-reader-ctor (syntax (name proc) undefined))) + + ;; SRFI 11 + ("Syntax for receiving multiple values" + (let-values (syntax (bindings body \.\.\.))) + (let-values* (syntax (bindings body \.\.\.)))) + + () + + ;; SRFI 13 + ("String Library" + (string-map (lambda (proc str :optional start end) str)) + (string-map! (lambda (proc str :optional start end) undefined)) + (string-fold (lambda (kons knil str :optional start end) obj)) + (string-fold-right (lambda (kons knil str :optional start end) obj)) + (string-unfold (lambda (p f g seed :optional base make-final) str)) + (string-unfold-right (lambda (p f g seed :optional base make-final) str)) + (string-tabulate (lambda (proc len) str)) + (string-for-each (lambda (proc str :optional start end) undefined)) + (string-for-each-index (lambda (proc str :optional start end) undefined)) + (string-every (lambda (pred str :optional start end) obj)) + (string-any (lambda (pred str :optional start end) obj)) + (string-hash (lambda (str :optional bound start end) int)) + (string-hash-ci (lambda (str :optional bound start end) int)) + (string-compare (lambda (string1 string2 lt-proc eq-proc gt-proc :optional start end) obj)) + (string-compare-ci (lambda (string1 string2 lt-proc eq-proc gt-proc :optional start end) obj)) + (string= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string<> (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string< (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string> (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string<= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string>= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string-ci= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string-ci<> (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string-ci< (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string-ci> (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string-ci<= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string-ci>= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string-titlecase (lambda (string :optional start end) str)) + (string-upcase (lambda (string :optional start end) str)) + (string-downcase (lambda (string :optional start end) str)) + (string-titlecase! (lambda (string :optional start end) undefined)) + (string-upcase! (lambda (string :optional start end) undefined)) + (string-downcase! (lambda (string :optional start end) undefined)) + (string-take (lambda (string nchars) str)) + (string-drop (lambda (string nchars) str)) + (string-take-right (lambda (string nchars) str)) + (string-drop-right (lambda (string nchars) str)) + (string-pad (lambda (string k :optional char start end) str)) + (string-pad-right (lambda (string k :optional char start end) str)) + (string-trim (lambda (string :optional char/char-set/pred start end) str)) + (string-trim-right (lambda (string :optional char/char-set/pred start end) str)) + (string-trim-both (lambda (string :optional char/char-set/pred start end) str)) + (string-filter (lambda (char/char-set/pred string :optional start end) str)) + (string-delete (lambda (char/char-set/pred string :optional start end) str)) + (string-index (lambda (string char/char-set/pred :optional start end) (or integer bool))) + (string-index-right (lambda (string char/char-set/pred :optional end start) (or integer bool))) + (string-skip (lambda (string char/char-set/pred :optional start end) (or integer bool))) + (string-skip-right (lambda (string char/char-set/pred :optional end start) (or integer bool))) + (string-count (lambda (string char/char-set/pred :optional start end) n)) + (string-prefix-length (lambda (string1 string2 :optional start1 end1 start2 end2) n)) + (string-suffix-length (lambda (string1 string2 :optional start1 end1 start2 end2) n)) + (string-prefix-length-ci (lambda (string1 string2 :optional start1 end1 start2 end2) n)) + (string-suffix-length-ci (lambda (string1 string2 :optional start1 end1 start2 end2) n)) + (string-prefix? (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string-suffix? (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string-prefix-ci? (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string-suffix-ci? (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) + (string-contains (lambda (string pattern :optional s-start s-end p-start p-end) obj)) + (string-contains-ci (lambda (string pattern :optional s-start s-end p-start p-end) obj)) + (string-fill! (lambda (string char :optional start end) undefined)) + (string-copy! (lambda (to tstart from :optional fstart fend) undefined)) + (string-copy (lambda (str :optional start end) str)) + (substring/shared (lambda (str start :optional end) str)) + (string-reverse (lambda (str :optional start end) str)) + (string-reverse! (lambda (str :optional start end) undefined)) + (reverse-list->string (lambda (char-list) str)) + (string->list (lambda (str :optional start end) list)) + (string-concatenate (lambda (string-list) str)) + (string-concatenate/shared (lambda (string-list) str)) + (string-append/shared (lambda (str \.\.\.) str)) + (string-concatenate-reverse (lambda (string-list :optional final-string end) str)) + (string-concatenate-reverse/shared (lambda (string-list :optional final-string end) str)) + (xsubstring (lambda (str from :optional to start end) str)) + (string-xcopy! (lambda (target tstart str from :optional to start end) undefined)) + (string-null? (lambda (str) bool)) + (string-join (lambda (string-list :optional delim grammar) str)) + (string-tokenize (lambda (string :optional token-chars start end) str)) + (string-replace (lambda (str1 str2 start1 end1 :optional start2 end2) str)) + (string-kmp-partial-search (lambda (pat rv str i :optional c= p-start s-start s-end) n)) + (make-kmp-restart-vector (lambda (str :optional c= start end) vec)) + (kmp-step (lambda (pat rv c i c= p-start) n)) + ) + + ;; SRFI 14 + ("Character-Set Library" + (char-set? (lambda (cset) bool)) + (char-set= (lambda (cset \.\.\.) bool)) + (char-set<= (lambda (cset \.\.\.) bool)) + (char-set-hash (lambda (cset :optional int) int)) + (char-set-cursor (lambda (cset) cursor)) + (char-set-ref (lambda (cset cursor) ch)) + (char-set-cursor-next (lambda (cset cursor) int)) + (end-of-char-set? (lambda (cursor) bool)) + (char-set-fold (lambda (proc obj cset) obj)) + (char-set-unfold (lambda (proc proc proc obj :optional obj) cset)) + (char-set-unfold! (lambda (proc proc proc obj obj) cset)) + (char-set-for-each (lambda (proc cset) undefined)) + (char-set-map (lambda (proc cset) cset)) + (char-set-copy (lambda (cset) cset)) + (char-set (lambda (ch \.\.\.) cset)) + (list->char-set (lambda (list :optional obj) cset)) + (list->char-set! (lambda (list cset) cset)) + (string->char-set (lambda (str :optional cset) cset)) + (string->char-set! (lambda (str cset) cset)) + (ucs-range->char-set (lambda (int int :optional bool cset) cset)) + (ucs-range->char-set! (lambda (int int bool cset) cset)) + (char-set-filter (lambda (proc cset :optional base-cset) cset)) + (char-set-filter! (lambda (proc cset base-cset) cset)) + (->char-set (lambda (obj) cset)) + (char-set-size (lambda (cset) n)) + (char-set-count (lambda (proc cset) n)) + (char-set-contains? (lambda (cset ch) bool)) + (char-set-every (lambda (proc cset) obj)) + (char-set-any (lambda (proc cset) obj)) + (char-set-adjoin (lambda (cset ch \.\.\.) cset)) + (char-set-delete (lambda (cset ch \.\.\.) cset)) + (char-set-adjoin! (lambda (cset ch \.\.\.) cset)) + (char-set-delete! (lambda (cset ch \.\.\.) cset)) + (char-set->list (lambda (cset) list)) + (char-set->string (lambda (cset) str)) + (char-set-complement (lambda (cset) cset)) + (char-set-union (lambda (cset \.\.\.) cset)) + (char-set-intersection (lambda (cset \.\.\.) cset)) + (char-set-xor (lambda (cset \.\.\.) cset)) + (char-set-difference (lambda (cset \.\.\.) cset)) + (char-set-diff+intersection (lambda (cset \.\.\.) cset)) + (char-set-complement! (lambda (cset) cset)) + (char-set-union! (lambda (cset \.\.\.) cset)) + (char-set-intersection! (lambda (cset \.\.\.) cset)) + (char-set-xor! (lambda (cset \.\.\.) cset)) + (char-set-difference! (lambda (cset \.\.\.) cset)) + (char-set-diff+intersection! (lambda (cset \.\.\.) cset)) + (char-set:lower-case char-set) + (char-set:upper-case char-set) + (char-set:letter char-set) + (char-set:digit char-set) + (char-set:letter+digit char-set) + (char-set:graphic char-set) + (char-set:printing char-set) + (char-set:whitespace char-set) + (char-set:blank char-set) + (char-set:iso-control char-set) + (char-set:punctuation char-set) + (char-set:symbol char-set) + (char-set:hex-digit char-set) + (char-set:ascii char-set) + (char-set:empty char-set) + (char-set:full char-set) + ) + + () + + ;; SRFI 16 + ("Syntax for procedures of variable arity" + (case-lambda (syntax (clauses \.\.\.) procedure))) + + ;; SRFI 17 + ("Generalized set!" + (set! (syntax (what value) undefined))) + + ;; SRFI 18 + ("Multithreading support" + (current-thread (lambda () thread)) + (thread? (lambda (obj) bool)) + (make-thread (lambda (thunk :optional name) thread)) + (thread-name (lambda (thread) name)) + (thread-specific (lambda (thread))) + (thread-specific-set! (lambda (thread obj))) + (thread-base-priority (lambda (thread))) + (thread-base-priority-set! (lambda (thread number))) + (thread-priority-boost (lambda (thread))) + (thread-priority-boost-set! (lambda (thread number))) + (thread-quantum (lambda (thread))) + (thread-quantum-set! (lambda (thread number))) + (thread-start! (lambda (thread))) + (thread-yield! (lambda ())) + (thread-sleep! (lambda (number))) + (thread-terminate! (lambda (thread))) + (thread-join! (lambda (thread :optional timeout timeout-val))) + (mutex? (lambda (obj) bool)) + (make-mutex (lambda (:optional name) mutex)) + (mutex-name (lambda (mutex) name)) + (mutex-specific (lambda (mutex))) + (mutex-specific-set! (lambda (mutex obj))) + (mutex-state (lambda (mutex))) + (mutex-lock! (lambda (mutex :optional timeout thread))) + (mutex-unlock! (lambda (mutex :optional condition-variable timeout))) + (condition-variable? (lambda (obj) bool)) + (make-condition-variable (lambda (:optional name) condition-variable)) + (condition-variable-name (lambda (condition-variable) name)) + (condition-variable-specific (lambda (condition-variable))) + (condition-variable-specific-set! (lambda (condition-variable obj))) + (condition-variable-signal! (lambda (condition-variable))) + (condition-variable-broadcast! (lambda (condition-variable))) + (current-time (lambda () time)) + (time? (lambda (obj) bool)) + (time->seconds (lambda (time) x1)) + (seconds->time (lambda (x1) time)) + (current-exception-handler (lambda () handler)) + (with-exception-handler (lambda (handler thunk))) + (raise (lambda (obj))) + (join-timeout-exception? (lambda (obj) bool)) + (abandoned-mutex-exception? (lambda (obj) bool)) + (terminated-thread-exception? (lambda (obj) bool)) + (uncaught-exception? (lambda (obj) bool)) + (uncaught-exception-reason (lambda (exc) obj)) + ) + + ;; SRFI 19 + ("Time Data Types and Procedures" + (current-date (lambda (:optional tz-offset)) date) + (current-julian-day (lambda ()) jdn) + (current-modified-julian-day (lambda ()) mjdn) + (current-time (lambda (:optional time-type)) time) + (time-resolution (lambda (:optional time-type)) nanoseconds) + (make-time (lambda (type nanosecond second))) + (time? (lambda (obj))) + (time-type (lambda (time))) + (time-nanosecond (lambda (time))) + (time-second (lambda (time))) + (set-time-type! (lambda (time))) + (set-time-nanosecond! (lambda (time))) + (set-time-second! (lambda (time))) + (copy-time (lambda (time))) + (time<=? (lambda (time1 time2))) + (time=? (lambda (time1 time2))) + (time>? (lambda (time1 time2))) + (time-difference (lambda (time1 time2))) + (time-difference! (lambda (time1 time2))) + (add-duration (lambda (time duration))) + (add-duration! (lambda (time duration))) + (subtract-duration (lambda (time duration))) + (subtract-duration! (lambda (time duration))) + (make-date (lambda (nanosecond second minute hour day month year zone-offset))) + (date? (lambda (obj))) + (date-nanosecond (lambda (date))) + (date-second (lambda (date))) + (date-minute (lambda (date))) + (date-hour (lambda (date))) + (date-day (lambda (date))) + (date-month (lambda (date))) + (date-year (lambda (date))) + (date-zone-offset (lambda (date))) + (date-year-day (lambda (date))) + (date-week-day (lambda (date))) + (date-week-number (lambda (date))) + (date->julian-day (lambda (date))) + (date->modified-julian-day (lambda (date))) + (date->time-monotonic (lambda (date))) + (date->time-tai (lambda (date))) + (date->time-utc (lambda (date))) + (julian-day->date (lambda (date))) + (julian-day->time-monotonic (lambda (date))) + (julian-day->time-tai (lambda (date))) + (julian-day->time-utc (lambda (date))) + (modified-julian-day->date (lambda (date))) + (modified-julian-day->time-monotonic (lambda (date))) + (modified-julian-day->time-tai (lambda (date))) + (modified-julian-day->time-utc (lambda (date))) + (time-monotonic->date (lambda (date))) + (time-monotonic->julian-day (lambda (date))) + (time-monotonic->modified-julian-day (lambda (date))) + (time-monotonic->time-monotonic (lambda (date))) + (time-monotonic->time-tai (lambda (date))) + (time-monotonic->time-tai! (lambda (date))) + (time-monotonic->time-utc (lambda (date))) + (time-monotonic->time-utc! (lambda (date))) + (time-tai->date (lambda (date))) + (time-tai->julian-day (lambda (date))) + (time-tai->modified-julian-day (lambda (date))) + (time-tai->time-monotonic (lambda (date))) + (time-tai->time-monotonic! (lambda (date))) + (time-tai->time-utc (lambda (date))) + (time-tai->time-utc! (lambda (date))) + (time-utc->date (lambda (date))) + (time-utc->julian-day (lambda (date))) + (time-utc->modified-julian-day (lambda (date))) + (time-utc->time-monotonic (lambda (date))) + (time-utc->time-monotonic! (lambda (date))) + (time-utc->time-tai (lambda (date))) + (time-utc->time-tai! (lambda (date))) + (date->string (lambda (date :optional format-string))) + (string->date (lambda (input-string template-string))) + ) + + () + + ;; SRFI 21 + ("Real-time multithreading support" + srfi-18) ; same as srfi-18 + + ;; SRFI 22 + ("Running Scheme Scripts on Unix" + ) + + ;; SRFI 23 + ("Error reporting mechanism" + (error (lambda (reason-string arg \.\.\.) error))) + + () + + ;; SRFI 25 + ("Multi-dimensional Array Primitives" + (array? (lambda (obj))) + (make-array (lambda (shape :optional init))) + (shape (lambda (bound \.\.\.))) + (array (lambda (shape obj \.\.\.))) + (array-rank (lambda (array))) + (array-start (lambda (array))) + (array-end (lambda (array))) + (array-shape (lambda (array))) + (array-ref (lambda (array i \.\.\.))) + (array-set! (lambda (array obj \.\.\.) undefined)) + (share-array (lambda (array shape proc))) + ) + + ;; SRFI 26 + ("Notation for Specializing Parameters without Currying" + (cut (syntax (obj \.\.\.))) + (cute (lambda (obj \.\.\.)))) + + ;; SRFI 27 + ("Sources of Random Bits" + (random-integer (lambda (n))) + (random-real (lambda ())) + (default-random-source (lambda ())) + (make-random-source (lambda ())) + (random-source? (lambda (obj))) + (random-source-state-ref (lambda (random-source))) + (random-source-state-set! (lambda (random-source state))) + (random-source-randomize! (lambda (random-source))) + (random-source-pseudo-randomize! (lambda (random-source i j))) + (random-source-make-integers (lambda (random-source))) + (random-source-make-reals (lambda (random-source))) + ) + + ;; SRFI 28 + ("Basic Format Strings" + (format (lambda (port-or-boolean format-string arg \.\.\.)))) + + ;; SRFI 29 + ("Localization" + (current-language (lambda (:optional symbol))) + (current-country (lambda (:optional symbol))) + (current-locale-details (lambda (:optional list))) + (declare-bundle! (lambda (bundle-name association-list))) + (store-bundle (lambda (bundle-name))) + (load-bundle! (lambda (bundle-name))) + (localized-template (lambda (package-name message-template-name))) + ) + + ;; SRFI 30 + ("Nested Multi-line Comments" + ) + + ;; SRFI 31 + ("A special form for recursive evaluation" + (rec (syntax (name body \.\.\.) procedure))) + + () + + () + + ;; SRFI 34 + ("Exception Handling for Programs" + (guard (syntax (clauses \.\.\.))) + (raise (lambda (obj))) + ) + + ;; SRFI 35 + ("Conditions" + (make-condition-type (lambda (id parent field-name-list))) + (condition-type? (lambda (obj))) + (make-condition (lambda (condition-type))) + (condition? (lambda (obj))) + (condition-has-type? (lambda (condition condition-type))) + (condition-ref (lambda (condition field-name))) + (make-compound-condition (lambda (condition \.\.\.))) + (extract-condition (lambda (condition condition-type))) + (define-condition-type (syntax (name parent pred-name fields \.\.\.))) + (condition (syntax (type-field-binding \.\.\.))) + ) + + ;; SRFI 36 + ("I/O Conditions" + (&error condition) + (&i/o-error condition) + (&i/o-port-error condition) + (&i/o-read-error condition) + (&i/o-write-error condition) + (&i/o-closed-error condition) + (&i/o-filename-error condition) + (&i/o-malformed-filename-error condition) + (&i/o-file-protection-error condition) + (&i/o-file-is-read-only-error condition) + (&i/o-file-already-exists-error condition) + (&i/o-no-such-file-error condition) + ) + + ;; SRFI 37 + ("args-fold: a program argument processor" + (args-fold + (arg-list option-list unrecognized-option-proc operand-proc seed \.\.\.)) + (option-processor (lambda (option name arg seeds \.\.\.))) + (operand-processor (lambda (operand seeds \.\.\.))) + (option (lambda (name-list required-arg? optional-arg? option-proc))) + (option-names (lambda (option))) + (option-required-arg? (lambda (option))) + (option-optional-arg? (lambda (option))) + (option-processor (lambda (option))) + ) + + ;; SRFI 38 + ("External Representation for Data With Shared Structure" + (write-with-shared-structure (lambda (obj :optional port optarg))) + (read-with-shared-structure (lambda (:optional port))) + ) + + ;; SRFI 39 + ("Parameter objects" + (make-parameter (lambda (init-value :optional converter))) + (parameterize (syntax (bindings body \.\.\.)))) + + ;; SRFI 40 + ("A Library of Streams" + (stream-null stream) + (stream-cons (syntax (obj stream))) + (stream? (lambda (obj))) + (stream-null? (lambda (obj))) + (stream-pair? (lambda (obj))) + (stream-car (lambda (stream))) + (stream-cdr (lambda (stream))) + (stream-delay (syntax (expr))) + (stream (lambda (obj \.\.\.))) + (stream-unfoldn (lambda (generator-proc seed n))) + (stream-map (lambda (proc stream \.\.\.))) + (stream-for-each (lambda (proc stream \.\.\.) undefined)) + (stream-filter (lambda (pred stream))) + ) + + () + + ;; SRFI 42 + ("Eager Comprehensions" + (list-ec (syntax)) + (append-ec (syntax)) + (sum-ec (syntax)) + (min-ec (syntax)) + (max-ec (syntax)) + (any?-ec (syntax)) + (every?-ec (syntax)) + (first-ec (syntax)) + (do-ec (syntax)) + (fold-ec (syntax)) + (fold3-ec (syntax)) + (:list (syntax () undefined)) + (:string (syntax () undefined)) + (:vector (syntax () undefined)) + (:integers (syntax () undefined)) + (:range (syntax () undefined)) + (:real-range (syntax () undefined)) + (:char-range (syntax () undefined)) + (:port (syntax () undefined)) + (:do (syntax () undefined)) + (:let (syntax () undefined)) + (:parallel (syntax () undefined)) + (:while (syntax () undefined)) + (:until (syntax () undefined)) + ) + + ;; SRFI 43 + ("Vector Library" + (vector-unfold (f length initial-seed \.\.\.)) + (vector-unfold-right (lambda (f length initial-seed \.\.\.))) + (vector-tabulate (lambda (f size))) + (vector-copy (lambda (vec :optional start end fill))) + (vector-reverse-copy (lambda (vec :optional start end))) + (vector-append (lambda (vec \.\.\.))) + (vector-concatenate (lambda (vector-list))) + (vector-empty? (lambda (obj))) + (vector= (lambda (eq-proc vec \.\.\.))) + (vector-fold (lambda (kons knil vec \.\.\.))) + (vector-fold-right (lambda (kons knil vec \.\.\.))) + (vector-map (lambda (f vec \.\.\.))) + (vector-map! (lambda (f vec \.\.\.))) + (vector-for-each (lambda (f vec \.\.\.) undefined)) + (vector-count (lambda (pred vec \.\.\.))) + (vector-index (lambda (pred vec \.\.\.))) + (vector-index-right (lambda (pred vec \.\.\.))) + (vector-skip (lambda (pred vec \.\.\.))) + (vector-skip-right (lambda (pred vec \.\.\.))) + (vector-binary-search (lambda (vec value cmp-proc))) + (vector-any (lambda (pred vec \.\.\.))) + (vector-every (lambda (pred vec \.\.\.))) + (vector-swap! (lambda (vec i j) undefined)) + (vector-reverse! (lambda (vec :optional start end) undefined)) + (vector-copy! (lambda (target-vec t-start source-vec :optional start end) undefined)) + (vector-reverse-copy! (lambda (target-vec t-start source-vec :optional start end) undefined)) + (reverse-vector-to-list (lambda (vec :optional start end))) + (reverse-list-to-vector (lambda (list))) + ) + + ;; SRFI 44 + ("Collections" + ) + + ;; SRFI 45 + ("Primitives for expressing iterative lazy algorithms" + (delay (syntax (expr))) + (lazy (syntax (expr))) + (force (lambda (promise))) + (eager (lambda (promise))) + ) + + ;; SRFI 46 + ("Basic Syntax-rules Extensions" + (syntax-rules (syntax () undefined))) + + ;; SRFI 47 + ("Array" + (make-array (lambda (prototype k \.\.\.))) + (ac64 (lambda (:optional z))) + (ac32 (lambda (:optional z))) + (ar64 (lambda (:optional x1))) + (ar32 (lambda (:optional x1))) + (as64 (lambda (:optional n))) + (as32 (lambda (:optional n))) + (as16 (lambda (:optional n))) + (as8 (lambda (:optional n))) + (au64 (lambda (:optional n))) + (au32 (lambda (:optional n))) + (au16 (lambda (:optional n))) + (au8 (lambda (:optional n))) + (at1 (lambda (:optional bool))) + (make-shared-array (lambda (array mapper k \.\.\.))) + (array-rank (lambda (obj))) + (array-dimensions (lambda (array))) + (array-in-bounds? (lambda (array k \.\.\.))) + (array-ref (lambda (array k \.\.\.))) + (array-set! (lambda (array obj k \.\.\.))) + ) + + ;; SRFI 48 + ("Intermediate Format Strings" + (format (lambda (port-or-boolean format-string arg \.\.\.)))) + + ;; SRFI 49 + ("Indentation-sensitive syntax" + ) + + () + + ;; SRFI 51 + ("Handling rest list" + (rest-values (lambda (caller rest-list :optional args-number-limit default))) + (arg-and (syntax)) + (arg-ands (syntax)) + (err-and (syntax)) + (err-ands (syntax)) + (arg-or (syntax)) + (arg-ors (syntax)) + (err-or (syntax)) + (err-ors (syntax)) + ) + + () + + () + + ;; SRFI 54 + ("Formatting" + (cat (lambda (obj \.\.\.)))) + + ;; SRFI 55 + ("require-extension" + (require-extension (syntax))) + + () + + ;; SRFI 57 + ("Records" + (define-record-type (syntax)) + (define-record-scheme (syntax)) + (record-update (syntax)) + (record-update! (syntax)) + (record-compose (syntax))) + + ;; SRFI 58 + ("Array Notation" + ) + + ;; SRFI 59 + ("Vicinity" + (program-vicinity (lambda ())) + (library-vicinity (lambda ())) + (implementation-vicinity (lambda ())) + (user-vicinity (lambda ())) + (home-vicinity (lambda ())) + (in-vicinity (lambda (vicinity filename))) + (sub-vicinity (lambda (vicinity name))) + (make-vicinity (lambda (dirname))) + (path-vicinity (lambda (path))) + (vicinity:suffix? (lambda (ch))) + ) + + ;; SRFI 60 + ("Integers as Bits" + (bitwise-and (lambda (n \.\.\.) int)) + (bitwise-ior (lambda (n \.\.\.) int)) + (bitwise-xor (lambda (n \.\.\.) int)) + (bitwise-not (lambda (n) int)) + (bitwise-if (lambda (mask n m) int)) + (any-bits-set? (lambda (n m) bool)) + (bit-count (lambda (n) int)) + (integer-length (lambda (n) int)) + (first-bit-set (lambda (n) int)) + (bit-set? (lambda (index n) bool)) + (copy-bit (lambda (index n bool) int)) + (bit-field (lambda (n start end) int)) + (copy-bit-field (lambda (to-int from-int start end) int)) + (arithmetic-shift (lambda (n count) int)) + (rotate-bit-field (lambda (n count start end) int)) + (reverse-bit-field (lambda (n start end) int)) + (integer->list (lambda (k :optional len) list)) + (list->integer (lambda (list) int)) + ) + + ;; SRFI 61 + ("A more general cond clause" + (cond (syntax))) + + ;; SRFI 62 + ("S-expression comments" + ) + + ;; SRFI 63 + ("Homogeneous and Heterogeneous Arrays" + ) + + ;; SRFI 64 + ("A Scheme API for test suites" + (test-assert (syntax)) + (test-eqv (syntax)) + (test-equal (syntax)) + (test-eq (syntax)) + (test-approximate (syntax)) + (test-error (syntax)) + (test-read-eval-string (lambda (string))) + (test-begin (syntax (suite-name :optional count))) + (test-end (syntax (suite-name))) + (test-group (syntax (suite-name decl-or-expr \.\.\.))) + (test-group-with-cleanup (syntax (suite-name decl-or-expr \.\.\.))) + (test-match-name (lambda (name))) + (test-match-nth (lambda (n :optional count))) + (test-match-any (lambda (specifier \.\.\.))) + (test-match-all (lambda (specifier \.\.\.))) + (test-skip (syntax (specifier))) + (test-expect-fail (syntax (specifier))) + (test-runner? (lambda (obj))) + (test-runner-current (lambda (:optional runner))) + (test-runner-get (lambda ())) + (test-runner-simple (lambda ())) + (test-runner-null (lambda ())) + (test-runner-create (lambda ())) + (test-runner-factory (lambda (:optional factory))) + (test-apply (syntax (runner specifier \.\.\.))) + (test-with-runner (syntax (runner decl-or-expr \.\.\.))) + (test-result-kind (lambda (:optional runner))) + (test-passed? (lambda (:optional runner))) + (test-result-ref (lambda (runner prop-name (:optional default)))) + (test-result-set! (lambda (runner prop-name value))) + (test-result-remove (lambda (runner prop-name))) + (test-result-clear (lambda (runner))) + (test-result-alist (lambda (runner))) + (test-runner-on-test-begin (lambda (runner :optional proc))) + (test-runner-on-test-begin! (lambda (runner :optional proc))) + (test-runner-on-test-end (lambda (runner :optional proc))) + (test-runner-on-test-end! (lambda (runner :optional proc))) + (test-runner-on-group-begin (lambda (runner :optional proc))) + (test-runner-on-group-begin! (lambda (runner :optional proc))) + (test-runner-on-group-end (lambda (runner :optional proc))) + (test-runner-on-group-end! (lambda (runner :optional proc))) + (test-runner-on-bad-count (lambda (runner :optional proc))) + (test-runner-on-bad-count! (lambda (runner :optional proc))) + (test-runner-on-bad-end-name (lambda (runner :optional proc))) + (test-runner-on-bad-end-name! (lambda (runner :optional proc))) + (test-runner-on-final (lambda (runner :optional proc))) + (test-runner-on-final! (lambda (runner :optional proc))) + (test-runner-pass-count (lambda (runner))) + (test-runner-fail-count (lambda (runner))) + (test-runner-xpass-count (lambda (runner))) + (test-runner-skip-count (lambda (runner))) + (test-runner-test-name (lambda (runner))) + (test-runner-group-path (lambda (runner))) + (test-runner-group-stack (lambda (runner))) + (test-runner-aux-value (lambda (runner))) + (test-runner-aux-value! (lambda (runner))) + (test-runner-reset (lambda (runner))) + ) + + () + + ;; SRFI 66 + ("Octet Vectors" + (make-u8vector (lambda (len n))) + (u8vector (lambda (n \.\.\.))) + (u8vector->list (lambda (u8vector))) + (list->u8vector (lambda (octet-list))) + (u8vector-length u8vector) + (u8vector-ref (lambda (u8vector k))) + (u8vector-set! (lambda (u8vector k n))) + (u8vector=? (lambda (u8vector-1 u8vector-2))) + (u8vector-compare (lambda (u8vector-1 u8vector-2))) + (u8vector-copy! (lambda (source source-start target target-start n))) + (u8vector-copy (lambda (u8vector))) + ) + + ;; SRFI 67 + ("Compare Procedures" + ) + + () + + ;; SRFI 69 + ("Basic hash tables" + (alist->hash-table (lambda (alist) hash-table)) + (hash (lambda (obj :optional n) int)) + (hash-by-identity (lambda (obj :optional n) int)) + (hash-table->alist (lambda (hash-table) alist)) + (hash-table-copy (lambda (hash-table) hash-table)) + (hash-table-delete! (lambda (hash-table key) undefined)) + (hash-table-equivalence-function (lambda (hash-table) pred)) + (hash-table-exists? (lambda (hash-table key) bool)) + (hash-table-fold (lambda (hash-table f init-value))) + (hash-table-hash-function (lambda (hash-table) f)) + (hash-table-keys (lambda (hash-table) list)) + (hash-table-merge! (lambda (hash-table1 hash-table2) undefined)) + (hash-table-ref (lambda (hash-table key :optional thunk))) + (hash-table-ref/default (lambda (hash-table key default))) + (hash-table-remove! (lambda (hash-table proc) undefined)) + (hash-table-set! (lambda (hash-table key value) undefined)) + (hash-table-size (lambda (hash-table) n)) + (hash-table-update! (lambda (hash-table key proc :optional thunk) undefined)) + (hash-table-update!/default (lambda (hash-table key proc default) undefined)) + (hash-table-values (lambda (hash-table) list)) + (hash-table-walk (lambda (hash-table proc) undefined)) + (hash-table? (lambda (obj) bool)) + (make-hash-table (lambda (:optional eq-fn hash-fn) hash-table)) + (string-ci-hash (lambda (str :optional n) n)) + (string-hash (lambda (str1 :optional n) n)) + ) + + ;; SRFI 70 + ("Numbers" + ) + + ;; SRFI 71 + ("LET-syntax for multiple values" + ) + + ;; SRFI 72 + ("Simple hygienic macros" + ) + + () + + ;; SRFI 74 + ("Octet-Addressed Binary Blocks" + ) + + () () () () () ; 75-79 + () () () () () () () () () () ; 80-89 + () () () () () () () () () () ; 90-99 + () () () () () () () () () () ; 100-109 + () () () () () () () () () () ; 110-119 + () () () () () () () () () () ; 120-129 + + ;; SRFI 130 + ("Cursor-based string library" + (string-cursor-ref (lambda (string string-cursor) char)) + (string-cursor-set! (lambda (string string-cursor char))) + (string-cursor-start (lambda (string) string-cursor)) + (string-cursor-end (lambda (string) string-cursor)) + (string-cursor->index (lambda (string string-cursor) i)) + (string-index->cursor (lambda (string i) string-cursor)) + (string-cursor-next (lambda (string string-cursor) string-cursor)) + (string-cursor-prev (lambda (string string-cursor) string-cursor)) + (string-cursor-forward (lambda (string string-cursor i) string-cursor)) + (string-cursor-back (lambda (string string-cursor i) string-cursor)) + (string-cursor? (lambda (string-cursor1 string-cursor2) boolean)) + (string-cursor<=? (lambda (string-cursor1 string-cursor2) boolean)) + (string-cursor>=? (lambda (string-cursor1 string-cursor2) boolean)) + (string-cursor=? (lambda (string-cursor1 string-cursor2) boolean)) + (string-cursor-diff (lambda (string string-cursor1 string-cursor2) i)) + (string-fold (lambda (kons knil str :optional start end) obj)) + (string-fold-right (lambda (kons knil str :optional start end) obj)) + (string-tabulate (lambda (proc len) str)) + (string-for-each-cursor (lambda (proc str :optional start-indexer end-indexer) undefined)) + (string-every (lambda (pred str :optional start end) obj)) + (string-any (lambda (pred str :optional start end) obj)) + (string-ref/cursor (lambda (str string-indexer) char)) + (string->list/cursors (lambda (str :optional start-indexer end-indexer) ls)) + (string->vector/cursors (lambda (str :optional start-indexer end-indexer) vector)) + (substring/cursors (lambda (str start-indexer :optional end-indexer) str)) + (string-copy/cursors (lambda (str :optional start-indexer end-indexer) str)) + (reverse-list->string (lambda (ls) str)) + (string-take (lambda (string nchars) str)) + (string-drop (lambda (string nchars) str)) + (string-take-right (lambda (string nchars) str)) + (string-drop-right (lambda (string nchars) str)) + (string-pad (lambda (string k :optional char start-indexer end-indexer) str)) + (string-pad-right (lambda (string k :optional char start-indexer end-indexer) str)) + (string-trim (lambda (string :optional pred start-indexer end-indexer) str)) + (string-trim-right (lambda (string :optional pred start-indexer end-indexer) str)) + (string-trim-both (lambda (string :optional pred start-indexer end-indexer) str)) + (string-filter (lambda (pred string :optional start-indexer end-indexer) str)) + (string-remove (lambda (pred string :optional start-indexer end-indexer) str)) + (string-index (lambda (string pred :optional start-indexer end-indexer) (or string-cursor bool))) + (string-index-right (lambda (string pred :optional end-indexer start-indexer) (or string-cursor bool))) + (string-skip (lambda (string pred :optional start-indexer end-indexer) (or string-cursor bool))) + (string-skip-right (lambda (string pred :optional end-indexer start-indexer) (or string-cursor bool))) + (string-count (lambda (string pred :optional start-indexer end-indexer) n)) + (string-prefix-length (lambda (string1 string2 :optional start-indexer1 end-indexer1 start-indexer2 end-indexer2) n)) + (string-suffix-length (lambda (string1 string2 :optional start-indexer1 end-indexer1 start-indexer2 end-indexer2) n)) + (string-prefix? (lambda (string1 string2 :optional start-indexer1 end-indexer1 start-indexer2 end-indexer2) bool)) + (string-suffix? (lambda (string1 string2 :optional start-indexer1 end-indexer1 start-indexer2 end-indexer2) bool)) + (string-contains (lambda (string pattern :optional s-start s-end p-start p-end) obj)) + (string-reverse (lambda (str :optional start end) str)) + (string-concatenate (lambda (string-list) str)) + (string-concatenate-reverse (lambda (string-list :optional final-string end) str)) + (string-replicate (lambda (str from :optional to start end) str)) + (string-null? (lambda (str) bool)) + (string-join (lambda (string-list :optional delim grammar) str)) + (string-split (lambda (string :optional token-chars start end) str)) + (string-replace (lambda (str1 str2 start1 end1 :optional start2 end2) str)) + ) + + ]) + +;; another big table - consider moving to a separate file +(defvar *scheme-implementation-exports* + `((chibi + (current-exception-handler (lambda (:optional thunk) thunk)) + (command-line (lambda () list)) + (pair-source (lambda (pair))) + (pair-source-set! (lambda (pair obj))) + (cons-source (lambda (kar kdr source) pair)) + (bytevector-u8-ref (lambda (bytevector i) n)) + (bytevector-u8-set! (lambda (bytevector i n))) + (bytevector-length (lambda (bytevector) n)) + (string-cursor-ref (lambda (string string-cursor) char)) + (string-cursor-set! (lambda (string string-cursor char))) + (string-cursor-start (lambda (string) string-cursor)) + (string-cursor-end (lambda (string) string-cursor)) + (string-cursor->index (lambda (string string-cursor) i)) + (string-index->cursor (lambda (string i) string-cursor)) + (string-cursor-offset (lambda (string string-cursor) i)) + (string-cursor-next (lambda (string string-cursor) string-cursor)) + (string-cursor-prev (lambda (string string-cursor) string-cursor)) + (string-cursor? (lambda (string-cursor1 string-cursor2) boolean)) + (string-cursor<=? (lambda (string-cursor1 string-cursor2) boolean)) + (string-cursor>=? (lambda (string-cursor1 string-cursor2) boolean)) + (string-cursor=? (lambda (string-cursor1 string-cursor2) boolean)) + (string-size (lambda (string) i)) + (make-exception (lambda (symbol string list proc source) exception)) + (exception-kind (lambda (exception) symbol)) + (exception-irritants (lambda (exception) list)) + (is-a? (lambda (obj type) boolean)) + (fixnum? (lambda (obj) boolean)) + (flonum? (lambda (obj) boolean)) + (bignum? (lambda (obj) boolean)) + (ratio? (lambda (obj) boolean)) + (ratio-numerator (lambda (n) n)) + (ratio-denominator (lambda (n) n)) + (complex? (lambda (obj) boolean)) + (complex-real (lambda (z) x)) + (complex-imag (lambda (z) x)) + (bytevector? (lambda (obj) boolean)) + (fileno? (lambda (obj) boolean)) + (exception? (lambda (obj) boolean)) + (closure? (lambda (obj) boolean)) + (opcode? (lambda (obj) boolean)) + (binary-port? (lambda (obj) boolean)) + (textual-port? (lambda (obj) boolean)) + (port-open? (lambda (obj) boolean)) + (apply1 (lambda (proc list))) + (raise (lambda (obj))) + (flush-output (lambda (:optional port))) + (equal?/bounded (lambda (a b bound) boolean)) + (identifier? (lambda (obj) boolean)) + (identifier=? (lambda (obj env obj env) boolean)) + (identifier->symbol (lambda (obj) symbol)) + (length* (lambda (obj) n)) + (append2 (lambda (ls ls) ls)) + (open-binary-input-file (lambda (filename) port)) + (open-binary-output-file (lambda (filename) port)) + (make-environment (lambda () env)) + (primitive-environment (lambda (i) env)) + (env-parent (lambda (env) env)) + (compile (lambda (obj :optional env))) + (generate (lambda (obj :optional env))) + (%load (lambda (filename :optional env))) + (%import (lambda (env env list boolean))) + (print-exception (lambda (exception :optional port))) + (print-stack-trace (lambda (:optional port))) + (warn-undefs (lambda (from to res))) + (make-bytevector (lambda (i) bytevector)) + (string-concatenate (lambda (list :optional string) string)) + (make-syntactic-closure (lambda (env list obj) syntactic-closure)) + (strip-syntactic-closures (lambda (obj))) + (open-output-string (lambda () output-port)) + (open-input-string (lambda (string) input-port)) + (get-output-string (lambda (output-port) string)) + (open-input-file-descriptor (lambda (i :optional boolean) input-port)) + (open-output-file-descriptor (lambda (i :optional boolean) output-port)) + (set-port-line! (lambda (port i))) + (register-optimization! (lambda (proc i))) + (exact-sqrt (lambda (i) i)) + (string-index->offset (lambda (string i) i)) + (string-offset->index (lambda (string i) i)) + (substring-cursor (lambda (string start-indexer :optional end-indexer) string)) + (subbytes (lambda (bytevector start :optional end) bytevector)) + (port-fold-case? (lambda (port) boolean)) + (set-port-fold-case! (lambda (port boolean))) + (lookup-type (lambda (string obj) type)) + (register-simple-type (lambda (string type list) type)) + (make-type-predicate (lambda (string i) proc)) + (make-constructor (lambda (string i i) proc)) + (make-getter (lambda (string i i) proc)) + (make-setter (lambda (string i i) proc)) + (type-slot-offset (lambda (type symbol) proc)) + (slot-ref (lambda (obj obj obj i))) + (slot-set! (lambda (obj obj obj i obj))) + (port-fileno (lambda (port) fileno)) + (current-environment (lambda () env)) + (set-current-environment! (lambda (env))) + (%meta-env (lambda () env)) + (env-exports (lambda (env) list)) + (current-module-path (lambda (:optional list) list)) + (find-module-file (lambda (filename) filename)) + (load-module-file (lambda (filename env))) + (add-module-directory (lambda (filename boolean))) + (%dk (lambda (:optional obj))) + (yield! (lambda ())) + (thread-parameters (lambda ())) + (thread-parameters-set! (lambda (obj))) + (any (lambda ((lambda (obj1 . obj2) a) list \.\.\.) a)) + (every (lambda ((lambda (obj1 . obj2) a) list \.\.\.) a)) + (error (lambda (reason-string arg \.\.\.) error)) + (sc-macro-transformer (lambda (proc) proc)) + (rsc-macro-transformer (lambda (proc) proc)) + (er-macro-transformer (lambda (proc) proc)) + (delay-force (syntax expr)) + (define-auxiliary-syntax (syntax symbol)) + (call-with-input-string (lambda (str proc))) + (call-with-output-string (lambda (proc) str)) + (syntax-error (syntax string)) + (letrec* (syntax (vars body \.\.\.)) "bind new local variables recursively in order") + (let-optionals* (syntax (list vars body \.\.\.)) "bind variables optionally") + (raise-continuable (lambda (exception))) + (with-exception-handler (lambda (handler thunk))) + (protect (syntax (clauses \.\.\.))) + (with-exception-protect (lambda (thunk thunk))) + (exception-protect (syntax expr final))) + (gauche + (E2BIG integer) + (EACCES integer) + (EADDRINUSE integer) + (EADDRNOTAVAIL integer) + (EADV integer) + (EAFNOSUPPORT integer) + (EAGAIN integer) + (EALREADY integer) + (EBADE integer) + (EBADF integer) + (EBADFD integer) + (EBADMSG integer) + (EBADR integer) + (EBADRQC integer) + (EBADSLT integer) + (EBFONT integer) + (EBUSY integer) + (ECANCELED integer) + (ECHILD integer) + (ECHRNG integer) + (ECOMM integer) + (ECONNABORTED integer) + (ECONNREFUSED integer) + (ECONNRESET integer) + (EDEADLK integer) + (EDEADLOCK integer) + (EDESTADDRREQ integer) + (EDOM integer) + (EDOTDOT integer) + (EDQUOT integer) + (EEXIST integer) + (EFAULT integer) + (EFBIG integer) + (EHOSTDOWN integer) + (EHOSTUNREACH integer) + (EIDRM integer) + (EILSEQ integer) + (EINPROGRESS integer) + (EINTR integer) + (EINVAL integer) + (EIO integer) + (EISCONN integer) + (EISDIR integer) + (EISNAM integer) + (EKEYEXPIRED integer) + (EKEYREJECTED integer) + (EKEYREVOKED integer) + (EL2HLT integer) + (EL2NSYNC integer) + (EL3HLT integer) + (EL3RST integer) + (ELIBACC integer) + (ELIBBAD integer) + (ELIBEXEC integer) + (ELIBMAX integer) + (ELIBSCN integer) + (ELNRNG integer) + (ELOOP integer) + (EMEDIUMTYPE integer) + (EMFILE integer) + (EMLINK integer) + (EMSGSIZE integer) + (EMULTIHOP integer) + (ENAMETOOLONG integer) + (ENAVAIL integer) + (ENETDOWN integer) + (ENETRESET integer) + (ENETUNREACH integer) + (ENFILE integer) + (ENOANO integer) + (ENOBUFS integer) + (ENOCSI integer) + (ENODATA integer) + (ENODEV integer) + (ENOENT integer) + (ENOEXEC integer) + (ENOKEY integer) + (ENOLCK integer) + (ENOLINK integer) + (ENOMEDIUM integer) + (ENOMEM integer) + (ENOMSG integer) + (ENONET integer) + (ENOPKG integer) + (ENOPROTOOPT integer) + (ENOSPC integer) + (ENOSR integer) + (ENOSTR integer) + (ENOSYS integer) + (ENOTBLK integer) + (ENOTCONN integer) + (ENOTDIR integer) + (ENOTEMPTY integer) + (ENOTNAM integer) + (ENOTSOCK integer) + (ENOTTY integer) + (ENOTUNIQ integer) + (ENXIO integer) + (EOPNOTSUPP integer) + (EOVERFLOW integer) + (EPERM integer) + (EPFNOSUPPORT integer) + (EPIPE integer) + (EPROTO integer) + (EPROTONOSUPPORT integer) + (EPROTOTYPE integer) + (ERANGE integer) + (EREMCHG integer) + (EREMOTE integer) + (EREMOTEIO integer) + (ERESTART integer) + (EROFS integer) + (ESHUTDOWN integer) + (ESOCKTNOSUPPORT integer) + (ESPIPE integer) + (ESRCH integer) + (ESRMNT integer) + (ESTALE integer) + (ESTRPIPE integer) + (ETIME integer) + (ETIMEDOUT integer) + (ETOOMANYREFS integer) + (ETXTBSY integer) + (EUCLEAN integer) + (EUNATCH integer) + (EUSERS integer) + (EWOULDBLOCK integer) + (EXDEV integer) + (EXFULL integer) + (F_OK integer) + (LC_ALL integer) + (LC_COLLATE integer) + (LC_CTYPE integer) + (LC_MONETARY integer) + (LC_NUMERIC integer) + (LC_TIME integer) + (RAND_MAX integer) + (R_OK integer) + (SEEK_CUR integer) + (SEEK_END integer) + (SEEK_SET integer) + (SIGABRT integer) + (SIGALRM integer) + (SIGBUS integer) + (SIGCHLD integer) + (SIGCONT integer) + (SIGFPE integer) + (SIGHUP integer) + (SIGILL integer) + (SIGINT integer) + (SIGIO integer) + (SIGIOT integer) + (SIGKILL integer) + (SIGPIPE integer) + (SIGPOLL integer) + (SIGPROF integer) + (SIGPWR integer) + (SIGQUIT integer) + (SIGSEGV integer) + (SIGSTKFLT integer) + (SIGSTOP integer) + (SIGTERM integer) + (SIGTRAP integer) + (SIGTSTP integer) + (SIGTTIN integer) + (SIGTTOU integer) + (SIGURG integer) + (SIGUSR1 integer) + (SIGUSR2 integer) + (SIGVTALRM integer) + (SIGWINCH integer) + (SIGXCPU integer) + (SIGXFSZ integer) + (SIG_BLOCK integer) + (SIG_SETMASK integer) + (SIG_UNBLOCK integer) + (W_OK integer) + (X_OK integer) + (acons (lambda (key value alist) alist)) + (acosh (lambda (z) z)) + (add-load-path (lambda (path) undefined)) + (add-method! (lambda (generic method) undefined)) + (all-modules (lambda () list)) + (allocate-instance (lambda (class list))) + (and-let* (syntax)) + (any (lambda (pred list))) + (any$ (lambda (pred) proc)) + (any-pred (lambda (pred \.\.\.) pred)) + (append! (lambda (list \.\.\.) list)) + (apply$ (lambda (proc) proc)) + (apply-generic (lambda (generic list))) + (apply-method (lambda (method list))) + (apply-methods (lambda (generic list list))) + (arity (lambda (proc) n)) + (arity-at-least-value (lambda (n))) + (arity-at-least? (lambda (proc) bool)) + (ash (lambda (n i) n)) + (asinh (lambda (z) z)) + (assoc$ (lambda (obj) proc)) + (atanh (lambda (z) z)) + (autoload (syntax)) + (begin0 (syntax)) + (bignum? (lambda (obj) bool)) + (bit-field (lambda (n start end) n)) + (byte-ready? (lambda (:optional input-port) bool)) + (call-with-input-string (lambda (str proc))) + (call-with-output-string (lambda (proc) str)) + (call-with-string-io (lambda (str proc) str)) + (case-lambda (syntax (clauses \.\.\.) procedure)) + (change-class (lambda (obj new-class))) + (change-object-class (lambda (obj orig-class new-class))) + (char->ucs (lambda (ch) int)) + (char-set (lambda (ch \.\.\.) char-set)) + (char-set-contains? (lambda (char-set ch) bool)) + (char-set-copy (lambda (char-set) char-set)) + (char-set? (lambda (obj) bool)) + (check-arg (syntax)) + (circular-list? (lambda (obj) bool)) + (clamp (lambda (x1 :optional min-x max-x) x2)) + (class-direct-methods (lambda (class) list)) + (class-direct-slots (lambda (class) list)) + (class-direct-subclasses (lambda (class) list)) + (class-direct-supers (lambda (class) list)) + (class-name (lambda (class) sym)) + (class-of (lambda (obj) class)) + (class-precedence-list (lambda (class) list)) + (class-slot-accessor (lambda (class id) proc)) + (class-slot-bound? (lambda (class id) bool)) + (class-slot-definition (lambda (class id))) + (class-slot-ref (lambda (class slot))) + (class-slot-set! (lambda (class slot val) undefined)) + (class-slots (lambda (class) list)) + (closure-code (lambda (proc))) + (closure? (lambda (obj) bool)) + (compare (lambda (obj1 obj2) n)) + (complement (lambda (proc) proc)) + (compose (lambda (proc \.\.\.) proc)) + (compute-applicable-methods (lambda (generic list))) + (compute-cpl (lambda (generic list))) + (compute-get-n-set (lambda (class slot))) + (compute-slot-accessor (lambda (class slot))) + (compute-slots (lambda (class))) + (cond-expand (syntax)) + (condition (syntax)) + (condition-has-type? (lambda (condition obj))) + (condition-ref (lambda (condition id))) + (condition-type? (lambda (obj) bool)) + (condition? (lambda (obj) bool)) + (copy-bit (lambda (index n i) n)) + (copy-bit-field (lambda (n start end from) n)) + (copy-port (lambda (from-port to-port :optional unit-sym) undefined)) + (cosh (lambda (z) z)) + (count$ (lambda (pred) proc)) + (current-class-of (lambda (obj) class)) + (current-error-port (lambda () output-port)) + (current-exception-handler (lambda () handler)) + (current-load-history (lambda () list)) + (current-load-next (lambda () list)) + (current-load-port (lambda () port)) + (current-module (lambda () env)) + (current-thread (lambda () thread)) + (current-time (lambda () time)) + (cut (syntax)) + (cute (lambda (args \.\.\.) proc)) + (debug-print (lambda (obj))) + (debug-print-width (lambda () int)) + (debug-source-info (lambda (obj))) + (dec! (syntax)) + (decode-float (lambda (x1) vector)) + (define-class (syntax)) + (define-condition-type (syntax)) + (define-constant (syntax)) + (define-generic (syntax)) + (define-in-module (syntax)) + (define-inline (syntax)) + (define-macro (syntax)) + (define-method (syntax)) + (define-module (syntax)) + (define-reader-ctor (lambda (sym proc) undefined)) + (define-values (syntax)) + (delete$ (lambda (obj) proc)) + (delete-keyword (lambda (id list) list)) + (delete-keyword! (lambda (id list) list)) + (delete-method! (lambda (generic method) undefined)) + (digit->integer (lambda (ch) n)) + (disasm (lambda (proc) undefined)) + (dolist (syntax)) + (dotimes (syntax)) + (dotted-list? (lambda (obj) bool)) + (dynamic-load (lambda (file))) + (eager (lambda (obj))) + (eq-hash (lambda (obj))) + (eqv-hash (lambda (obj))) + (error (lambda (msg-string args \.\.\.))) + (errorf (lambda (fmt-string args \.\.\.))) + (eval-when (syntax)) + (every$ (lambda (pred) pred)) + (every-pred (lambda (pred \.\.\.) pred)) + (exit (lambda (:optional n) undefined)) + (export (syntax)) + (export-all (syntax)) + (export-if-defined (syntax)) + (extend (syntax)) + (extract-condition (lambda (condition type))) + (file-exists? (lambda (filename) bool)) + (file-is-directory? (lambda (filename) bool)) + (file-is-regular? (lambda (filename) bool)) + (filter$ (lambda (pred) proc)) + (find (lambda (pred list))) + (find$ (lambda (pred) proc)) + (find-module (lambda (id) env)) + (find-tail$ (lambda (pred) proc)) + (fixnum? (lambda (obj) bool)) + (flonum? (lambda (obj) bool)) + (fluid-let (syntax)) + (flush (lambda (:optional output-port) undefined)) + (flush-all-ports (lambda () undefined)) + (fmod (lambda (x1 x2) x3)) + (fold (lambda (proc init list))) + (fold$ (lambda (proc :optional init) proc)) + (fold-right (lambda (proc init list))) + (fold-right$ (lambda (proc :optional init))) + (for-each$ (lambda (proc) (lambda (ls) undefined))) + (foreign-pointer-attribute-get (lambda (ptr attr))) + (foreign-pointer-attribute-set (lambda (ptr attr val))) + (foreign-pointer-attributes (lambda (ptr) list)) + (format (lambda (fmt-string arg \.\.\.))) + (format/ss (lambda (fmt-string arg \.\.\.))) + (frexp (lambda (x1) x2)) + (gauche-architecture (lambda () string)) + (gauche-architecture-directory (lambda () string)) + (gauche-character-encoding (lambda () symbol)) + (gauche-dso-suffix (lambda () string)) + (gauche-library-directory (lambda () string)) + (gauche-site-architecture-directory (lambda () string)) + (gauche-site-library-directory (lambda () string)) + (gauche-version (lambda () string)) + (gc (lambda () undefined)) + (gc-stat (lambda () list)) + (gensym (lambda (:optional name) symbol)) + (get-keyword (lambda (id list :optional default))) + (get-keyword* (syntax)) + (get-optional (syntax)) + (get-output-string (lambda (string-output-port) string)) + (get-remaining-input-string (lambda (port) string)) + (get-signal-handler (lambda (n) proc)) + (get-signal-handler-mask (lambda (n) n)) + (get-signal-handlers (lambda () list)) + (get-signal-pending-limit (lambda () n)) + (getter-with-setter (lambda (get-proc set-proc) proc)) + (global-variable-bound? (lambda (sym) bool)) + (global-variable-ref (lambda (sym))) + (guard (syntax)) + (has-setter? (lambda (proc) bool)) + (hash (lambda (obj))) + (hash-table (lambda (id pair \.\.\.) hash-table)) + (hash-table-delete! (lambda (hash-table key) undefined)) + (hash-table-exists? (lambda (hash-table key) bool)) + (hash-table-fold (lambda (hash-table proc init))) + (hash-table-for-each (lambda (hash-table proc) undefined)) + (hash-table-get (lambda (hash-table key :optional default))) + (hash-table-keys (lambda (hash-table) list)) + (hash-table-map (lambda (hash-table proc) list)) + (hash-table-num-entries (lambda (hash-table) n)) + (hash-table-pop! (lambda (hash-table key :optional default))) + (hash-table-push! (lambda (hash-table key value) undefined)) + (hash-table-put! (lambda (hash-table key value) undefined)) + (hash-table-stat (lambda (hash-table) list)) + (hash-table-type (lambda (hash-table) id)) + (hash-table-update! (lambda (hash-table key proc :optional default) undefined)) + (hash-table-values (lambda (hash-table) list)) + (hash-table? (lambda (obj) bool)) + (identifier->symbol (lambda (obj) sym)) + (identifier? (lambda (obj) bool)) + (identity (lambda (obj))) + (import (syntax)) + (inc! (syntax)) + (inexact-/ (lambda (x1 x2) x3)) + (initialize (lambda (obj))) + (instance-slot-ref (lambda (obj id))) + (instance-slot-set (lambda (obj id value))) + (integer->digit (lambda (n) ch)) + (integer-length (lambda (n) n)) + (is-a? (lambda (obj class) bool)) + (keyword->string (lambda (id) string)) + (keyword? (lambda (obj) bool)) + (last-pair (lambda (pair) pair)) + (lazy (syntax)) + (ldexp (lambda (x1 n) x2)) + (let-keywords* (syntax)) + (let-optionals* (syntax)) + (let/cc (syntax)) + (let1 (syntax)) + (library-exists? (lambda (filename) bool)) + (library-fold (lambda (string proc init))) + (library-for-each (lambda (string proc) undefined)) + (library-has-module? (lambda (filename id) bool)) + (library-map (lambda (string proc) list)) + (list* (lambda (obj \.\.\.) list)) + (list-copy (lambda (list) list)) + (logand (lambda (n \.\.\.) n)) + (logbit? (lambda (index n) bool)) + (logcount (lambda (n) n)) + (logior (lambda (n \.\.\.) n)) + (lognot (lambda (n) n)) + (logtest (lambda (n \.\.\.) bool)) + (logxor (lambda (n \.\.\.) n)) + (macroexpand (lambda (obj))) + (macroexpand-1 (lambda (obj))) + (make (lambda (class args \.\.\.))) + (make-byte-string (lambda (n :optional int) byte-string)) + (make-compound-condition (lambda (condition \.\.\.) condition)) + (make-condition (lambda (condition-type field+value \.\.\.) condition)) + (make-condition-type (lambda (id condition-type list) condition-type)) + (make-hash-table (lambda (:optional id) hash-table)) + (make-keyword (lambda (string) sym)) + (make-list (lambda (n :optional init) list)) + (make-module (lambda (id :optional if-exists-proc) env)) + (make-weak-vector (lambda (n) vector)) + (map$ (lambda (proc) proc)) + (member$ (lambda (obj) proc)) + (merge (lambda (list1 list2 proc) list)) + (merge! (lambda (list1 list2 proc) list)) + (method-more-specific? (lambda (method1 method2 list) bool)) + (min&max (lambda (x1 \.\.\.) (values x2 x3))) + (modf (lambda (x1) x2)) + (module-exports (lambda (env) list)) + (module-imports (lambda (env) list)) + (module-name (lambda (env) sym)) + (module-name->path (lambda (sym) string)) + (module-parents (lambda (env) list)) + (module-precedence-list (lambda (env) list)) + (module-table (lambda (env) hash-table)) + (module? (lambda (obj) bool)) + (null-list? (lambda (obj) bool)) + (object-* (lambda (z \.\.\.) z)) + (object-+ (lambda (z \.\.\.) z)) + (object-- (lambda (z \.\.\.) z)) + (object-/ (lambda (z \.\.\.) z)) + (object-apply (lambda (proc arg \.\.\.))) + (object-compare (lambda (obj1 obj2) n)) + (object-equal? (lambda (obj1 obj2) bool)) + (object-hash (lambda (obj) n)) + (open-coding-aware-port (lambda (input-port) input-port)) + (open-input-buffered-port (lambda ())) + (open-input-fd-port (lambda (fileno) input-port)) + (open-input-string (lambda (str) input-port)) + (open-output-buffered-port (lambda ())) + (open-output-fd-port (lambda (fileno) output-port)) + (open-output-string (lambda () string-output-port)) + (pa$ (lambda (proc arg \.\.\.) proc)) + (partition$ (lambda (pred) proc)) + (path->module-name (lambda (str) sym)) + (peek-byte (lambda (:optional input-port) n)) + (pop! (syntax (list))) + (port->byte-string (lambda (input-port) byte-string)) + (port->list (lambda (proc input-port) list)) + (port->sexp-list (lambda (port) list)) + (port->string (lambda (port) string)) + (port->string-list (lambda (port) list)) + (port-buffering (lambda (port) sym)) + (port-closed? (lambda (port) bool)) + (port-current-line (lambda (port) n)) + (port-file-number (lambda (port) n)) + (port-fold (lambda (proc init port))) + (port-fold-right (lambda (proc init port))) + (port-for-each (lambda (proc read-proc) undefined)) + (port-map (lambda (proc read-proc))) + (port-name (lambda (port) name)) + (port-position-prefix (lambda ())) + (port-seek (lambda (port offset (set int SEEK_SET SEEK_CUR SEEK_END)))) + (port-tell (lambda (port) n)) + (port-type (lambda (port) sym)) + (print (lambda (obj \.\.\.))) + (procedure-arity-includes? (lambda (proc n) bool)) + (procedure-info (lambda (proc))) + (profiler-reset (lambda () undefined)) + (profiler-show (lambda () undefined)) + (profiler-show-load-stats (lambda () undefined)) + (profiler-start (lambda () undefined)) + (profiler-stop (lambda () undefined)) + (program (syntax)) + (promise-kind (lambda ())) + (promise? (lambda (obj) bool)) + (proper-list? (lambda (obj) bool)) + (provide (lambda (str) undefined)) + (provided? (lambda (str) bool)) + (push! (syntax)) + (quotient&remainder (lambda (n1 n2) (values n1 n2))) + (raise (lambda (exn) undefined)) + (read-block (lambda (n :optional input-port) string)) + (read-byte (lambda (:optional input-port) n)) + (read-eval-print-loop (lambda () undefined)) + (read-from-string (lambda (str))) + (read-line (lambda (:optional input-port) str)) + (read-list (lambda (ch :optional input-port))) + (read-reference-has-value? (lambda ())) + (read-reference-value (lambda ())) + (read-reference? (lambda ())) + (read-with-shared-structure (lambda (:optional input-port))) + (read/ss (lambda (:optional input-port))) + (rec (syntax)) + (receive (syntax)) + (redefine-class! (lambda ())) + (reduce$ (lambda (proc :optional default) proc)) + (reduce-right$ (lambda (proc :optional default) proc)) + (ref (lambda (obj key \.\.\.))) + (ref* (lambda (obj key \.\.\.))) + (regexp->string (lambda (regexp) string)) + (regexp-case-fold? (lambda (regexp) bool)) + (regexp-compile (lambda (str) regexp)) + (regexp-optimize (lambda (str) str)) + (regexp-parse (lambda (str) list)) + (regexp-quote (lambda (str) str)) + (regexp-replace (lambda (regexp string subst) string)) + (regexp-replace* (lambda (string regexp subst \.\.\.) string)) + (regexp-replace-all (lambda (regexp string subst) string)) + (regexp-replace-all* (lambda (string regexp subst \.\.\.))) + (regexp? (lambda (obj) bool)) + (regmatch? (lambda (obj) bool)) + (remove$ (lambda (pred) proc)) + (report-error (lambda ())) + (require (syntax)) + (require-extension (syntax)) + (reverse! (lambda (list) list)) + (rxmatch (lambda (regexp string) regmatch)) + (rxmatch-after (lambda (regmatch :optional i) str)) + (rxmatch-before (lambda (regmatch :optional i) str)) + (rxmatch-case (syntax)) + (rxmatch-cond (syntax)) + (rxmatch-end (lambda (regmatch :optional i) n)) + (rxmatch-if (syntax)) + (rxmatch-let (syntax)) + (rxmatch-num-matches (lambda (regmatch) i)) + (rxmatch-start (lambda (regmatch :optional i) n)) + (rxmatch-substring (lambda (regmatch :optional i) str)) + (seconds->time (lambda (x1) time)) + (select-module (syntax)) + (set!-values (syntax)) + (set-signal-handler! (lambda (signals handler) undefined)) + (set-signal-pending-limit (lambda (n) undefined)) + (setter (lambda (proc) proc)) + (sinh (lambda (z) z)) + (slot-bound-using-accessor? (lambda (proc obj id) bool)) + (slot-bound-using-class? (lambda (class obj id) bool)) + (slot-bound? (lambda (obj id) bool)) + (slot-definition-accessor (lambda ())) + (slot-definition-allocation (lambda ())) + (slot-definition-getter (lambda ())) + (slot-definition-name (lambda ())) + (slot-definition-option (lambda ())) + (slot-definition-options (lambda ())) + (slot-definition-setter (lambda ())) + (slot-exists-using-class? (lambda (class obj id) bool)) + (slot-exists? (lambda (obj id) bool)) + (slot-initialize-using-accessor! (lambda ())) + (slot-missing (lambda (class obj id))) + (slot-push! (lambda (obj id value) undefined)) + (slot-ref (lambda (obj id))) + (slot-ref-using-accessor (lambda (proc obj id))) + (slot-ref-using-class (lambda (class obj id))) + (slot-set! (lambda (obj id value) undefined)) + (slot-set-using-accessor! (lambda (proc obj id value) undefined)) + (slot-set-using-class! (lambda (class obj id value) undefined)) + (slot-unbound (lambda (class obj id))) + (sort (lambda (seq :optional proc))) + (sort! (lambda (seq :optional proc))) + (sort-applicable-methods (lambda ())) + (sorted? (lambda (seq :optional proc))) + (split-at (lambda (list i) (values list list))) + (stable-sort (lambda (seq :optional proc))) + (stable-sort! (lambda (seq :optional proc))) + (standard-error-port (lambda () output-port)) + (standard-input-port (lambda () input-port)) + (standard-output-port (lambda () output-port)) + (string->regexp (lambda (str) regexp)) + (string-byte-ref (lambda (str i) n)) + (string-byte-set! (lambda (str i n) undefined)) + (string-complete->incomplete (lambda (str) str)) + (string-immutable? (lambda (str) bool)) + (string-incomplete->complete (lambda (str) str)) + (string-incomplete->complete! (lambda (str) str)) + (string-incomplete? (lambda (str) bool)) + (string-interpolate (lambda (str) list)) + (string-join (lambda (list :optional delim-str (set grammar infix strict-infix prefix suffix)))) + ;; deprecated + ;; (string-pointer-byte-index (lambda ())) + ;; (string-pointer-copy (lambda ())) + ;; (string-pointer-index (lambda ())) + ;; (string-pointer-next! (lambda ())) + ;; (string-pointer-prev! (lambda ())) + ;; (string-pointer-ref (lambda ())) + ;; (string-pointer-set! (lambda ())) + ;; (string-pointer-substring (lambda ())) + ;; (string-pointer? (lambda ())) + (string-scan (lambda (string item :optional (set return index before after before* after* both)))) + (string-size (lambda (str) n)) + (string-split (lambda (str splitter) list)) + (string-substitute! (lambda ())) + (subr? (lambda (obj) bool)) + (supported-character-encoding? (lambda (id) bool)) + (supported-character-encodings (lambda () list)) + (symbol-bound? (lambda (id) bool)) + (syntax-error (syntax)) + (syntax-errorf (syntax)) + (sys-abort (lambda () undefined)) + (sys-access (lambda (filename (flags amode R_OK W_OK X_OK F_OK)))) + (sys-alarm (lambda (x1) x2)) + (sys-asctime (lambda (time) str)) + (sys-basename (lambda (filename) str)) + (sys-chdir (lambda (dirname))) + (sys-chmod (lambda (filename n))) + (sys-chown (lambda (filename uid gid))) + (sys-close (lambda (fileno))) + (sys-crypt (lambda (key-str salt-str) str)) + (sys-ctermid (lambda () string)) + (sys-ctime (lambda (time) string)) + (sys-difftime (lambda (time1 time2) x1)) + (sys-dirname (lambda (filename) string)) + (sys-exec (lambda (command-string list) n)) + (sys-exit (lambda (n) undefined)) + (sys-fchmod (lambda (port-or-fileno n))) + (sys-fdset-max-fd (lambda (fdset))) + (sys-fdset-ref (lambda (fdset port-or-fileno))) + (sys-fdset-set! (lambda (fdset port-or-fileno))) + (sys-fork (lambda () n)) + (sys-fork-and-exec (lambda (command-string list) n)) + (sys-fstat (lambda (port-or-fileno) sys-stat)) + (sys-ftruncate (lambda (port-or-fileno n))) + (sys-getcwd (lambda () string)) + (sys-getdomainname (lambda () string)) + (sys-getegid (lambda () gid)) + (sys-getenv (lambda (name) string)) + (sys-geteuid (lambda () uid)) + (sys-getgid (lambda () gid)) + (sys-getgrgid (lambda () gid)) + (sys-getgrnam (lambda (name))) + (sys-getgroups (lambda () list)) + (sys-gethostname (lambda () string)) + (sys-getloadavg (lambda () list)) + (sys-getlogin (lambda () string)) + (sys-getpgid (lambda () gid)) + (sys-getpgrp (lambda () gid)) + (sys-getpid (lambda () pid)) + (sys-getppid (lambda () pid)) + (sys-getpwnam (lambda (name))) + (sys-getpwuid (lambda () uid)) + (sys-gettimeofday (lambda () (values x1 x2))) + (sys-getuid (lambda () uid)) + (sys-gid->group-name (lambda (gid) name)) + (sys-glob (lambda (string) list)) + (sys-gmtime (lambda (time) string)) + (sys-group-name->gid (lambda (name) gid)) + (sys-isatty (lambda (port-or-fileno) bool)) + (sys-kill (lambda (pid))) + (sys-lchown (lambda (filename uid gid))) + (sys-link (lambda (old-filename new-filename))) + (sys-localeconv (lambda () alist)) + (sys-localtime (lambda (time) string)) + (sys-lstat (lambda (filename) sys-stat)) + (sys-mkdir (lambda (dirname))) + (sys-mkfifo (lambda (filename))) + (sys-mkstemp (lambda (filename))) + (sys-mktime (lambda (time) x1)) + (sys-nanosleep (lambda (x1))) + (sys-normalize-pathname (lambda (filename) string)) + (sys-pause (lambda (x1))) + (sys-pipe (lambda (:optional buffering) (values input-port output-port))) + (sys-putenv (lambda (name string))) + (sys-random (lambda () n)) + (sys-readdir (lambda (dirname) list)) + (sys-readlink (lambda (filename) string)) + (sys-realpath (lambda (filename) string)) + (sys-remove (lambda (filename))) + (sys-rename (lambda (old-filename new-filename))) + (sys-rmdir (lambda (dirname))) + (sys-select (lambda (read-filenos write-filenos execpt-filenos :optional timeout-x))) + (sys-select! (lambda (read-filenos write-filenos execpt-filenos :optional timeout-x))) + (sys-setenv (lambda (name string))) + (sys-setgid (lambda (gid))) + (sys-setlocale (lambda (locale-string))) + (sys-setpgid (lambda (gid))) + (sys-setsid (lambda ())) + (sys-setuid (lambda (uid))) + (sys-sigmask (lambda ((set how SIG_SETMASK SIG_BLOCK SIG_UNBLOCK) sigset))) + (sys-signal-name (lambda (n))) + (sys-sigset (lambda (n \.\.\.) sigset)) + (sys-sigset-add! (lambda (sigset n))) + (sys-sigset-delete! (lambda (sigset n))) + (sys-sigset-empty! (lambda (sigset))) + (sys-sigset-fill! (lambda (sigset))) + (sys-sigsuspend (lambda (sigset))) + (sys-sigwait (lambda (sigset))) + (sys-sleep (lambda (x1))) + (sys-srandom (lambda (n))) + (sys-stat (lambda (filename))) + ;; deprecated + ;; (sys-stat->atime (lambda ())) + ;; (sys-stat->ctime (lambda ())) + ;; (sys-stat->dev (lambda ())) + ;; (sys-stat->file-type (lambda ())) + ;; (sys-stat->gid (lambda ())) + ;; (sys-stat->ino (lambda ())) + ;; (sys-stat->mode (lambda ())) + ;; (sys-stat->mtime (lambda ())) + ;; (sys-stat->nlink (lambda ())) + ;; (sys-stat->rdev (lambda ())) + ;; (sys-stat->size (lambda ())) + ;; (sys-stat->type (lambda ())) + ;; (sys-stat->uid (lambda ())) + (sys-strerror (lambda (errno) string)) + (sys-strftime (lambda (format-string time))) + (sys-symlink (lambda (old-filename new-filename))) + (sys-system (lambda (command) n)) + (sys-time (lambda () n)) + (sys-times (lambda () list)) + ;; (sys-tm->alist (lambda ())) + (sys-tmpnam (lambda () string)) + (sys-truncate (lambda (filename n))) + (sys-ttyname (lambda (port-or-fileno) string)) + (sys-uid->user-name (lambda (uid) name)) + (sys-umask (lambda () n)) + (sys-uname (lambda () string)) + (sys-unlink (lambda (filename))) + (sys-unsetenv (lambda (name))) + (sys-user-name->uid (lambda (name) uid)) + (sys-utime (lambda (filename))) + (sys-wait (lambda ())) + (sys-wait-exit-status (lambda (n) n)) + (sys-wait-exited? (lambda (n) bool)) + (sys-wait-signaled? (lambda (n) bool)) + (sys-wait-stopped? (lambda (n) bool)) + (sys-wait-stopsig (lambda (n) n)) + (sys-wait-termsig (lambda (n) n)) + (sys-waitpid (lambda (pid))) + (tanh (lambda (z) z)) + (time (syntax)) + (time->seconds (lambda (time) x1)) + (time? (lambda (obj) bool)) + (toplevel-closure? (lambda (obj) bool)) + (touch-instance! (lambda ())) + (ucs->char (lambda (n) ch)) + (undefined (lambda () undefined)) + (undefined? (lambda (obj) bool)) + (unless (syntax)) + (until (syntax)) + (unwrap-syntax (lambda (obj))) + (update! (syntax)) + (update-direct-method! (lambda ())) + (update-direct-subclass! (lambda ())) + (use (special symbol scheme-gauche-available-modules)) + (use-version (syntax)) + (values-ref (syntax)) + (vector-copy (lambda (vector :optional start end fill) vector)) + (vm-dump (lambda () undefined)) + (vm-get-stack-trace (lambda () undefined)) + (vm-get-stack-trace-lite (lambda () undefined)) + (vm-set-default-exception-handler (lambda (handler) undefined)) + (warn (lambda (message-str args) undefined)) + (weak-vector-length (lambda (vector) n)) + (weak-vector-ref (lambda (vector i))) + (weak-vector-set! (lambda (vector i value) undefined)) + (when (syntax)) + (while (syntax)) + (with-error-handler (lambda (handler thunk))) + (with-error-to-port (lambda (port thunk))) + (with-exception-handler (lambda (handler thunk))) + (with-input-from-port (lambda (port thunk))) + (with-input-from-string (lambda (string thunk))) + (with-module (syntax)) + (with-output-to-port (lambda (port thunk))) + (with-output-to-string (lambda (thunk) string)) + (with-port-locking (lambda (port thunk))) + (with-ports (lambda (input-port output-port error-port thunk))) + (with-signal-handlers (syntax)) + (with-string-io (lambda (string thunk) string)) + (write* (lambda (obj :optional output-port) undefined)) + (write-byte (lambda (n :optional output-port) undefined)) + (write-limited (lambda (obj :optional output-port))) + (write-object (lambda (obj output-port))) + (write-to-string (lambda (obj) string)) + (write-with-shared-structure (lambda (obj :optional output-port))) + (write/ss (lambda (obj :optional output-port))) + (x->integer (lambda (obj) integer)) + (x->number (lambda (obj) number)) + (x->string (lambda (obj) string)) + ))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; special lookups (TODO add more impls, try to abstract better) + +;; visit a file and kill the buffer only if it wasn't already open +(defmacro scheme-with-find-file (path-expr &rest body) + (let ((path (gensym "path")) + (buf0 (gensym "buf")) + (buf (gensym "buf"))) + `(save-window-excursion + (let* ((,path (file-truename ,path-expr)) + (,buf0 (find-if + #'(lambda (x) + (let ((buf-file (buffer-file-name x))) + (and buf-file + (equal ,path (file-truename buf-file))))) + (buffer-list))) + (,buf (or ,buf0 (and (file-exists-p ,path) + (find-file-noselect ,path t))))) + (unless ,buf + (error "no such file" ,path)) + (set-buffer ,buf) + (unwind-protect + (save-excursion + (goto-char (point-min)) + ,@body) + (unless ,buf0 (kill-buffer (current-buffer)))))))) + +(defun scheme-srfi-exports (i) + (and (integerp i) + (>= i 0) + (< i (length *scheme-srfi-info*)) + (let ((info (cdr (aref *scheme-srfi-info* i)))) + (if (and (consp info) (null (cdr info)) (symbolp (car info))) + (scheme-module-exports/compute (car info)) + info)))) + +(defvar scheme-module-exports-function nil + "Set to override the exports inferred from the implementation") + +(defvar *scheme-module-exports-functions* + '((chicken . scheme-module-exports/chicken) + (gauche . scheme-module-exports/gauche))) + +(defun scheme-fixup-path (path) + (and (consp path) + (delete-duplicates + (remove-if-not #'(lambda (dir) + (and (stringp dir) + (not (equal dir "")) + (or (string-prefix-p "./" dir) + (file-directory-p dir)))) + path)))) + +(defvar *scheme-chibi-repo-path* 'compute-me-later) +(defvar *scheme-chicken-repo-path* 'compute-me-later) +(defvar *scheme-gauche-repo-path* 'compute-me-later) +(defvar *scheme-gauche-site-repo-path* 'compute-me-later) + +(defun scheme-library-path (impl) + (case impl + ((chibi) + (when (not (listp *scheme-chibi-repo-path*)) + (setq *scheme-chibi-repo-path* + (or (scheme-fixup-path + (read (scheme-shell-command-to-line + "chibi-scheme -q -p '(current-module-path)'"))) + (list "." "./lib" "/usr/local/share/chibi")))) + *scheme-chibi-repo-path*) + ((chicken) + (when (not (listp *scheme-chicken-repo-path*)) + (setq *scheme-chicken-repo-path* + (scheme-fixup-path + (let ((base + (scheme-fixup-path + (list (getenv "CHICKEN_HOME") + (scheme-shell-command-to-line + "csi -p '(repository-path)'"))))) + (or base (list "/usr/local/lib/chicken/7")))))) + *scheme-chicken-repo-path*) + ((gauche) + (when (not (listp *scheme-gauche-repo-path*)) + (setq *scheme-gauche-repo-path* + (scheme-fixup-path + (cons (scheme-shell-command-to-line "gauche-config --syslibdir") + (list "/usr/share/gauche" + "/usr/local/share/gauche" + "/opt/share/gauche" + "/opt/local/share/gauche")))) + (setq *scheme-gauche-site-repo-path* + (scheme-fixup-path + (cons (scheme-shell-command-to-line "gauche-config --sitelibdir") + (mapcar #'(lambda (dir) (concat dir "/site/lib")) + *scheme-gauche-repo-path*))))) + (append *scheme-gauche-site-repo-path* + *scheme-gauche-repo-path*)) + (t '()))) + +(defun scheme-library-root (base) + "The root library dir for `base'." + (scheme-with-find-file base + (re-search-forward "^(define-library\\s-" nil t) + (let ((name (reverse (scheme-nth-sexp-at-point 0))) + (dir base)) + (while (and (consp name) + (string-match (concat (scheme-sexp-to-string (car name)) + "\\(/+\\|\\.sld\\)?") + dir)) + (setq name (cdr name)) + (setq dir + (replace-regexp-in-string "/+$" "" (file-name-directory dir)))) + (and (null name) dir)))) + +(defun scheme-guess-containing-library-path (impl) + (or *scheme-default-library-path* + (let* ((lang+base + (scheme-code-context (buffer-file-name (current-buffer)))) + (dir (and (memq (car lang+base) '(r7rs r7rs-library-declaration)) + (cadr lang+base) + (scheme-library-root (cadr lang+base))))) + (if dir (list dir) (list "." "./lib"))))) + +(defun scheme-r7rs-library-path (impl) + (scheme-fixup-path + (append (scheme-guess-containing-library-path impl) + (and (symbolp impl) + (list (concat "/usr/local/share/snow/" (symbol-name impl)))) + ;; default to chibi since it installs source + (scheme-library-path + (if (or (not impl) (eq 'r7rs impl)) + (or scheme-default-implementation 'chibi) + impl))))) + +(defun scheme-mtime>? (a b) + (or (> (car a) (car b)) + (and (= (car a) (car b)) + (> (cadr a) (cadr b))))) + +(defvar *scheme-complete-module-cache* (make-hash-table :test #'equal) + "Cache of module exports.") + +(defun scheme-complete-clear-cache () + "Clear all scheme-complete caches." + (interactive) + (setq *scheme-imported-modules* '()) + (setq *scheme-complete-module-cache* (make-hash-table :test #'equal)) + (setq *scheme-library-includes-cache* (make-hash-table :test #'equal)) + (setq *scheme-include-globals-cache* (make-hash-table :test #'equal))) + +(defun scheme-module-exports (mod) + (unless (member mod *scheme-imported-modules*) + (push mod *scheme-imported-modules*) + (scheme-module-exports/compute mod))) + +(defun scheme-module-exports/compute (mod) + (cond + ((and (consp mod) (eq 'srfi (car mod)) (integerp (cadr mod)) + (scheme-srfi-exports (cadr mod))) + ) + ((and (symbolp mod) (string-match "^srfi-" (symbol-name mod))) + (scheme-srfi-exports + (string-to-number (substring (symbol-name mod) 5)))) + ((equal '(scheme r5rs) mod) + (scheme-r5rs-info)) + ((equal '(chibi) mod) + (append (scheme-r5rs-info) + (cdr (assq (car mod) *scheme-implementation-exports*)))) + ((and (consp mod) (eq 'scheme (car mod)) + (cdr (assoc mod *scheme-r7rs-info*)))) + ((and (consp mod) (null (cdr mod)) + (cdr (assq (car mod) *scheme-implementation-exports*)))) + ((and (symbolp mod) + (cdr (assq mod *scheme-implementation-exports*)))) + (t + (let ((cached (gethash mod *scheme-complete-module-cache*))) + ;; check cache + (if (and cached + (stringp (car cached)) + (not + (ignore-errors + (let ((mtime (nth 5 (file-attributes (car cached)))) + (ptime (cadr cached))) + (scheme-mtime>? mtime ptime))))) + (caddr cached) + ;; (re)compute module exports + (let ((export-fun + (if (consp mod) + #'scheme-module-exports/r7rs + (or scheme-module-exports-function + (cdr (assq (scheme-current-implementation) + *scheme-module-exports-functions*)) + #'scheme-module-exports/r7rs)))) + (when export-fun + (let ((res (funcall export-fun mod))) + (when res + (when (and scheme-complete-cache-p (car res)) + (puthash mod + (list + (car res) + (nth 5 (file-attributes (car res))) + (cadr res)) + *scheme-complete-module-cache*)) + (cadr res)))))))))) + +(defun scheme-module-exports/r7rs (mod) + (let* ((file (concat (if (symbolp mod) + (subst-char-in-string ?. ?/ (symbol-name mod)) + (mapconcat #'(lambda (x) (if (numberp x) + (number-to-string x) + (symbol-name x))) + mod + "/")) + *scheme-r7rs-extension*)) + (path (scheme-r7rs-library-path (scheme-current-implementation))) + (dir (scheme-find-file-in-path file path))) + ;;(message "mod: %s file: %s path: %s dir: %s" mod file path dir) + (when dir + (list (concat dir "/" file) + (scheme-with-find-file (concat dir "/" file) + (scheme-current-exports/typed)))))) + +(defun scheme-module-exports/chicken (mod) + ;; TODO: use types.db + (let* ((mod-str (symbol-name mod)) + ;; look for the source in the current directory + (source-file (concat mod-str ".scm")) + ;; try the chicken modules db + (modules-db (concat (scheme-library-path 'chicken) "/modules.db"))) + (cond + ((eq mod 'scheme) + (list nil (scheme-r5rs-info))) + ((file-exists-p source-file) + (list source-file + (scheme-with-find-file source-file + (scheme-current-exports/typed)))) + ((file-exists-p modules-db) + (list modules-db + (mapcar + #'(lambda (x) + (cons (intern (car (split-string (substring x 1)))) + '((lambda ())))) + (remove-if-not + #'(lambda (x) (string-match (concat " " mod-str ")") x)) + (scheme-file->lines modules-db)))))))) + +(defun scheme-module-exports/gauche (mod) + (let* ((file (concat (subst-char-in-string ?. ?/ (symbol-name mod)) ".scm")) + (path (scheme-library-path 'gauche)) + (dir (scheme-find-file-in-path file path))) + (when dir + (list + (concat dir "/" file) + (scheme-with-find-file (concat dir "/" file) + (or (scheme-current-exports) + (scheme-current-globals))))))) + +(defun scheme-chicken-available-modules (&optional sym) + (mapcar + #'(lambda (mod) (split-string mod "\\.")) + (append + (mapcar + #'(lambda (f) + (let ((f (file-name-sans-extension f))) + (if (equalp "import" (file-name-extension f)) + (file-name-sans-extension f) + f))) + (directory-files "." nil "^[^.].*\\.scm$" t)) + (scheme-append-map + #'(lambda (dir) + (mapcar + #'(lambda (f) + (let ((f (file-name-sans-extension f))) + (if (equalp "import" (file-name-extension f)) + (file-name-sans-extension f) + f))) + (if (string-match "/7" dir) + (directory-files dir nil "^[^.].*\\.import\\.\\(so\\|scm\\)$" t) + (directory-files dir nil "^[^.].*\\.\\(so\\|scm\\)$" t)))) + (scheme-library-path 'chicken))))) + +(defun scheme-gauche-available-modules (&optional sym) + (let ((path (scheme-library-path 'gauche))) + (mapcar + #'(lambda (f) (split-string f "/")) + (mapcar + #'file-name-sans-extension + (scheme-append-map + #'(lambda (dir) + (let ((len (length dir))) + (mapcar #'(lambda (f) (substring f (+ 1 len))) + (scheme-directory-tree-files dir t "\\.scm\\'" 2)))) + path))))) + +(defun scheme-r7rs-available-modules (&optional impl) + (let ((path (scheme-r7rs-library-path + (or impl (scheme-current-implementation))))) + (append + '(("scheme" "base") ("scheme" "case-lambda") ("scheme char") + ("scheme" "complex") ("scheme" "cxr") ("scheme" "eval") + ("scheme" "file") ("scheme" "inexact") ("scheme" "lazy") + ("scheme" "load") ("scheme" "process-context") ("scheme" "r5rs") + ("scheme" "read") ("scheme" "repl") ("scheme" "time") ("scheme" "write")) + (mapcar + #'(lambda (f) (split-string f "/+" t)) + (mapcar + #'file-name-sans-extension + (scheme-append-map + #'(lambda (dir) + (let ((len (length dir))) + (mapcar #'(lambda (f) (substring f (+ 1 len))) + (scheme-directory-tree-files dir t "\\.sld\\'" 2)))) + path)))))) + +(defun scheme-available-modules (&optional impl) + (case impl + ((chicken) (scheme-chicken-available-modules impl)) + ((gauche) (scheme-gauche-available-modules impl)) + (t (scheme-r7rs-available-modules impl)))) + +(defun scheme-library-completions (prefix) + (let ((libs (scheme-available-modules (scheme-current-implementation)))) + (while (consp prefix) + (let* ((s (pop prefix)) + (str (cond ((symbolp s) (symbol-name s)) + ((numberp s) (number-to-string s)) + (t s)))) + (setq libs (mapcar #'cdr (remove-if-not + #'(lambda (x) (equal str (car x))) + libs))))) + (remove-duplicates (remove nil (mapcar #'car libs)) :test #'equal))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; utilities + +(defun scheme-assoc-delete-all (key alist) + (while (and (consp (car alist)) + (equal (car (car alist)) key)) + (setq alist (cdr alist))) + (let ((tail alist) tail-cdr) + (while (setq tail-cdr (cdr tail)) + (if (and (consp (car tail-cdr)) + (equal (car (car tail-cdr)) key)) + (setcdr tail (cdr tail-cdr)) + (setq tail tail-cdr)))) + alist) + +(defun scheme-append-map (proc init-ls) + (if (null init-ls) + '() + (let* ((ls (reverse init-ls)) + (res (funcall proc (pop ls)))) + (while (consp ls) + (setq res (append (funcall proc (pop ls)) res))) + res))) + +(defun scheme-flatten (ls) + (cond + ((consp ls) (cons (car ls) (scheme-flatten (cdr ls)))) + ((null ls) '()) + (t (list ls)))) + +(defun scheme-in-string-p () + (let ((orig (point))) + (save-excursion + (goto-char (point-min)) + (let ((parses (parse-partial-sexp (point) orig))) + (nth 3 parses))))) + +(defun scheme-beginning-of-sexp () + (ignore-errors + (let ((syn (char-syntax (char-before (point))))) + (if (or (eq syn ?\() + (and (eq syn ?\") (scheme-in-string-p))) + (forward-char -1) + (forward-sexp -1)) + t))) + +(defun scheme-shell-command-to-line (cmd) + (and (fboundp 'shell-command-to-string) + (let* ((res (shell-command-to-string cmd)) + (len (length res))) + (and (> len 0) (substring res 0 (- len 1)))))) + +(defun scheme-find-file-in-path (file path) + (car (remove-if-not + #'(lambda (dir) (file-exists-p (concat dir "/" file))) + path))) + +(defun scheme-directory-tree-files (init-dir &optional full match maxdepth) + (let ((res '()) + (stack + (list (cons 0 (if (file-directory-p init-dir) (list init-dir) '()))))) + (while (consp stack) + (let* ((x (pop stack)) + (depth (car x)) + (dirs (cdr x))) + (setq depth (car x)) + (while (consp dirs) + (let* ((dir (pop dirs)) + (files (remove-if #'(lambda (f) (string-prefix-p "." f)) + (directory-files dir))) + (full-files (mapcar #'(lambda (f) (concat dir "/" f)) files)) + (matches (if match + (remove-if-not + #'(lambda (f) (string-match match f)) + (if full full-files files)) + (if full full-files files)))) + (setq res (append matches res)) + (when (or (not maxdepth) (consp matches) (< depth maxdepth)) + (push (cons (+ depth 1) + (remove-if-not #'file-directory-p full-files)) + stack)))))) + res)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; sexp manipulation + +(defun scheme-in-comment-p () + (memq 'font-lock-comment-face (text-properties-at (point)))) + +;; returns current argument position within sexp +(defun scheme-beginning-of-current-sexp-operator () + (ignore-errors + (let ((pos 0)) + (if (scheme-in-comment-p) + (comment-search-backward)) + (skip-syntax-backward "w_") + (while (and (not (bobp)) + (not (eq ?\( (char-before))) + (scheme-beginning-of-sexp)) + (incf pos)) + pos))) + +(defun scheme-beginning-of-next-sexp () + (forward-sexp 2) + (backward-sexp 1)) + +(defun scheme-beginning-of-string () + (interactive) + (search-backward "\"" nil t) + (while (and (> (point) (point-min)) (eq ?\\ (char-before))) + (search-backward "\"" nil t))) + +;; for the enclosing sexp, returns a cons of the leading symbol (if +;; any) and the current position within the sexp (starting at 0) +;; (defun scheme-enclosing-sexp-prefix () +;; (save-excursion +;; (let ((pos (scheme-beginning-of-current-sexp-operator))) +;; (cons (scheme-symbol-at-point) pos)))) + +(defun scheme-enclosing-2-sexp-prefixes () + (ignore-errors + (save-excursion + (let* ((pos1 (scheme-beginning-of-current-sexp-operator)) + (sym1 (scheme-symbol-at-point))) + (backward-char) + (or + (ignore-errors + (let ((pos2 (scheme-beginning-of-current-sexp-operator))) + (list sym1 pos1 (scheme-symbol-at-point) pos2))) + (list sym1 pos1 nil 0)))))) + +(defun scheme-preceding-sexps () + (save-excursion + (let ((end (point)) + (res '())) + (scheme-beginning-of-current-sexp-operator) + (ignore-errors + (while (< (point) end) + (let ((x (scheme-nth-sexp-at-point 0))) + (forward-sexp 1) + (when (< (point) end) + (push x res))))) + (reverse res)))) + +(defun scheme-sexp->elisp (str) + "Hack to handle differences between scheme and elisp sexp syntax." + (replace-regexp-in-string + "#\\\\" "?" + (replace-regexp-in-string + "#t\\(rue\\)?\\>" "t" + (replace-regexp-in-string "#f\\(alse\\)?\\>" "nil" str)))) + +;; sexp-at-point is always fragile, both because the user can input +;; incomplete sexps and because some scheme sexps are not valid elisp +;; sexps. this is one of the few places we use it, so we're careful +;; to wrap it in ignore-errors. +(defun scheme-nth-sexp-at-point (n) + (ignore-errors + (save-excursion + (forward-sexp (+ n 1)) + (let ((end (point))) + (forward-sexp -1) + (let ((str (buffer-substring-no-properties (point) end))) + (car (or (ignore-errors (read-from-string str)) + (read-from-string (scheme-sexp->elisp str))))))))) + +(defun scheme-symbol-at-point () + (let ((str (scheme-symbol-string-at-point))) + (and str (intern str)))) + +(defun scheme-symbol-string-at-point () + (save-excursion + (skip-syntax-backward "w_") + (let ((start (point))) + (skip-syntax-forward "w_") + (and (< start (point)) + (buffer-substring-no-properties start (point)))))) + +;; should be called from start of current top-level +(defun scheme-goto-next-top-level (&optional in-mod-p) + (let ((here (point))) + (or (ignore-errors (forward-sexp 2) + (forward-sexp -1) + (< here (point))) + (if in-mod-p + (progn (goto-char here) + ;; heuristic, if the parens are unbalanced look + ;; for a define starting after a blank line. + ;; better might be to assume they're using a + ;; consistent indentation for the module body. + (and (re-search-forward + "\n\\s-*\n\\(;[^\n]*\n\\)?\\s-*(" nil t) + (progn (backward-char 1) t))) + (or (ignore-errors (end-of-defun) (end-of-defun) + (beginning-of-defun) + (< here (point))) + (progn (goto-char here) + (forward-char) + ;; allow for prompts in inferior-scheme mode + (and (re-search-forward + "^\\(\\(#;\\|[0-9]*\\)?\\sw*=?\]?> *\\)?(" nil t) + (progn (backward-char 1) t))))) + (goto-char (point-max))))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; variable extraction + +(defun scheme-sexp-type-at-point (&optional env) + (case (and (not (eobp)) (char-syntax (char-after))) + ((?\() + (forward-char 1) + (if (memq (char-syntax (char-after)) '(?w ?_)) + (let ((op (scheme-symbol-at-point))) + (cond + ((eq op 'lambda) + (let ((params (scheme-nth-sexp-at-point 1))) + `(lambda ,params))) + (t + (let ((spec (scheme-env-lookup env op))) + (and spec + (consp (cadr spec)) + (eq 'lambda (caadr spec)) + (cddadr spec) + (car (cddadr spec))))))) + nil)) + ((?\") + 'string) + ((?\w) + (if (string-match "[0-9]" (string (char-after))) + 'number + (let ((sym (scheme-symbol-at-point))) + (cadr (scheme-env-lookup env sym))))) + (t + nil))) + +(defun scheme-let-vars-at-point (&optional env limit loopp) + (let ((end (min (or limit (point-max)) + (or (ignore-errors + (save-excursion (forward-sexp) (point))) + (point-min)))) + (vars '())) + (forward-char 1) + (while (< (point) end) + (when (eq ?\( (char-after)) + (save-excursion + (forward-char 1) + (if (and loopp (looking-at "\\(for\\|let\\|with\\)\\>")) + (scheme-beginning-of-next-sexp)) + (if (eq ?w (char-syntax (char-after))) + (let* ((sym (scheme-symbol-at-point)) + (type (and (not loopp) + (ignore-errors + (scheme-beginning-of-next-sexp) + (scheme-sexp-type-at-point env))))) + (push (if type (list sym type) (list sym)) vars))) + (when loopp + (while (and (< (point) end) + (ignore-errors + (scheme-beginning-of-next-sexp) + (eq ?w (char-syntax (char-after))))) + (push (list (scheme-symbol-at-point)) vars))))) + (unless (ignore-errors (let ((here (point))) + (scheme-beginning-of-next-sexp) + (> (point) here))) + (goto-char end))) + (reverse vars))) + +(defun scheme-extract-match-clause-vars (x) + (cond + ((null x) '()) + ((symbolp x) + (if (memq x '(_ ___ \.\.\.)) + '() + (list (list x)))) + ((consp x) + (case (car x) + ((or not) + (scheme-extract-match-clause-vars (cdr x))) + ((and) + (if (and (consp (cdr x)) + (consp (cddr x)) + (symbolp (cadr x)) + (consp (caddr x)) + (not (memq (caaddr x) + '(= $ @ ? and or not quote quasiquote get! set!)))) + (cons (list (cadr x) (if (listp (caddr x)) 'list 'pair)) + (scheme-extract-match-clause-vars (cddr x))) + (scheme-extract-match-clause-vars (cddr x)))) + ((= $ @) + (if (consp (cdr x)) (scheme-extract-match-clause-vars (cddr x)) '())) + ((\? ? ) ; XXXX this is a hack, the lone ? gets read as a char (space) + (if (and (consp (cdr x)) + (consp (cddr x)) + (symbolp (cadr x)) + (symbolp (caddr x))) + (cons (list (caddr x) (scheme-predicate->type (cadr x))) + (scheme-extract-match-clause-vars (cdddr x))) + (scheme-extract-match-clause-vars (cddr x)))) + ((get! set!) + (if (consp (cdr x)) (scheme-extract-match-clause-vars (cadr x)) '())) + ((quote) '()) + ((quasiquote) '()) ; XXXX + (t + (union (scheme-extract-match-clause-vars (car x)) + (scheme-extract-match-clause-vars (cdr x)))))) + ((vectorp x) + (scheme-extract-match-clause-vars (concatenate 'list x))) + (t + '()))) + +;; call this from the first opening paren of the match clauses +(defun scheme-extract-match-vars (&optional pos limit) + (let ((match-vars '()) + (limit (or limit + (save-excursion + (or + (ignore-errors (end-of-defun) (point)) + (point-max)))))) + (save-excursion + (while (< (point) limit) + (let* ((end (ignore-errors (forward-sexp) (point))) + (start (and end (progn (backward-sexp) (point))))) + (cond + ((and pos start end (or (< pos start) (> pos end))) + (goto-char (if end (+ end 1) limit))) + (t + (forward-char 1) + (let* ((pat (scheme-nth-sexp-at-point 0)) + (new-vars (ignore-errors + (scheme-extract-match-clause-vars pat)))) + (setq match-vars (append new-vars match-vars))) + (goto-char (if (or pos (not end)) limit (+ end 1))))))) + match-vars))) + +(defvar *scheme-imported-modules* '() + "Dynamically shadowed in scheme-current-imports.") + +(defun scheme-guess-implementation () + (save-excursion + (goto-char (point-min)) + (or + (and (looking-at "#! *\\([^ \t\n]+\\)") + (let ((script (file-name-nondirectory (match-string 1)))) + (cdr (assoc script *scheme-interpreter-alist*)))) + (cond + ((re-search-forward "(define-library +\\(.\\)" nil t) + 'r7rs) + ((re-search-forward "(define-module +\\(.\\)" nil t) + (if (equal "(" (match-string 1)) + 'guile + 'gauche)) + ((re-search-forward "(\\(?:use\\|require-library\\) " nil t) + 'chicken) + ((re-search-forward "(module\\s-" nil t) + 'chicken))))) + +(defun scheme-current-implementation () + (when (and (not *scheme-current-implementation*) + (not scheme-always-use-default-implementation-p)) + (setq *scheme-current-implementation* (scheme-guess-implementation))) + (or *scheme-current-implementation* + scheme-default-implementation)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun scheme-current-local-vars (&optional env) + (let ((vars '()) + (start (point)) + (limit (save-excursion (beginning-of-defun) (+ (point) 1))) + (let-limit (save-excursion (scheme-beginning-of-sexp) + (scheme-beginning-of-sexp) + (point))) + (scan-internal)) + (save-excursion + (while (> (point) limit) + (or (ignore-errors + (progn + (skip-chars-backward " \t\n" limit) + (scheme-beginning-of-sexp))) + (goto-char limit)) + (when (and (> (point) (point-min)) + (eq ?\( (char-syntax (char-before (point)))) + (eq ?w (char-syntax (char-after (point))))) + (setq scan-internal t) + (let ((sym (scheme-symbol-at-point))) + (case sym + ((lambda) + (setq vars + (append + (mapcar #'list + (scheme-flatten (scheme-nth-sexp-at-point 1))) + vars))) + ((match match-let match-let*) + (setq vars + (append + (ignore-errors + (save-excursion + (let ((limit (save-excursion + (cond + ((eq sym 'match) + (backward-char 1) + (forward-sexp 1)) + (t + (forward-sexp 2))) + (point)))) + (forward-sexp 2) + (if (eq sym 'match) + (forward-sexp 1)) + (backward-sexp 1) + (if (not (eq sym 'match)) + (forward-char 1)) + (scheme-extract-match-vars + (and (or (eq sym 'match) (< start limit)) start) + limit)))) + vars))) + ((let let* letrec letrec* let-syntax letrec-syntax + and-let* do loop) + (or + (ignore-errors + (save-excursion + (scheme-beginning-of-next-sexp) + (let* ((loop-name + (and (memq sym '(let loop)) + (eq ?w (char-syntax (char-after (point)))) + (prog1 (scheme-symbol-at-point) + (scheme-beginning-of-next-sexp)))) + (let-vars + (scheme-let-vars-at-point + env let-limit (eq sym 'loop)))) + (if loop-name + ;; named let + (setq vars + (cons `(,loop-name (lambda ,(mapcar #'car let-vars))) + (append let-vars vars))) + (setq vars (append let-vars vars)))) + t)) + (goto-char limit))) + ((let-values let*-values) + (setq vars + (append (mapcar + #'list + (scheme-append-map + #'scheme-flatten + (remove-if-not #'consp + (scheme-nth-sexp-at-point 1)))) + vars))) + ((receive defun defmacro) + (setq vars + (append (mapcar #'list + (scheme-flatten + (scheme-nth-sexp-at-point 1))) + vars))) + (t + (if (string-match "^\\(jazz\\.\\)?define\\(-.*\\)?" + (symbol-name sym)) + (let ((defs (save-excursion + (backward-char) + (scheme-extract-definitions)))) + (setq vars + (append (scheme-append-map + #'(lambda (x) + (and (consp (cdr x)) + (consp (cadr x)) + (eq 'lambda (caadr x)) + (mapcar #'list + (scheme-flatten + (cadadr x))))) + defs) + (and (not (= 1 (current-column))) defs) + vars))) + (setq scan-internal nil)))) + ;; check for internal defines + (when scan-internal + (ignore-errors + (save-excursion + (forward-sexp + (+ 1 (if (numberp scan-internal) scan-internal 2))) + (backward-sexp) + (if (< (point) start) + (setq vars (append (scheme-current-definitions) vars)) + )))))))) + (reverse vars))) + +(defun scheme-extract-import-module-imports (sexp) + (case (and (consp sexp) (car sexp)) + ((prefix prefix-in) + (let* ((ids (scheme-extract-import-module-imports (cadr sexp))) + (prefix0 (caddr sexp)) + (prefix (if (symbolp prefix0) (symbol-name prefix0) prefix0))) + (mapcar #'(lambda (x) + (cons (intern (concat prefix (symbol-name (car x)))) + (cdr x))) + ids))) + ((prefix-all-except) + (let ((prefix + (if (symbolp (cadr sexp)) (symbol-name (cadr sexp)) (cadr sexp))) + (exceptions (cddr sexp))) + (mapcar #'(lambda (x) + (if (memq (car x) exceptions) + x + (cons (intern (concat prefix (symbol-name (car x)))) + (cdr x)))) + (scheme-extract-import-module-imports (caddr sexp))))) + ((for for-syntax for-template for-label for-meta) + (scheme-extract-import-module-imports (cadr sexp))) + ((rename rename-in) + (let ((renames (cddr sexp))) + (mapcar #'(lambda (x) + (cons (or (cadr (assq (car x) renames)) (car x)) (cdr x))) + (scheme-extract-import-module-imports (cadr sexp))))) + ((except except-in) + (remove-if #'(lambda (x) (memq (car x) (cddr sexp))) + (scheme-extract-import-module-imports (cadr sexp)))) + ((only only-in) + (remove-if-not + #'(lambda (x) (memq (car x) (cddr sexp))) + (scheme-extract-import-module-imports (cadr sexp)))) + ((import import-for-syntax require) + (scheme-append-map #'scheme-extract-import-module-imports (cdr sexp))) + ((library) + (if (and (stringp (cadr sexp)) (file-exists-p (cadr sexp))) + (scheme-module-exports (intern (cadr sexp))))) + ((lib) + (if (and (equal "srfi" (caddr sexp)) + (stringp (cadr sexp)) + (string-match "^[0-9]+\\." (cadr sexp))) + (scheme-module-exports + (intern (file-name-sans-extension (concat "srfi-" (cadr sexp))))) + (scheme-module-exports + (intern (apply 'concat (append (cddr sexp) (list (cadr sexp)))))))) + (t + (scheme-module-exports sexp)))) + +(defun scheme-extract-sexp-imports (sexp) + (case (and (consp sexp) (car sexp)) + ((begin define-module) + (scheme-append-map #'scheme-extract-sexp-imports (cdr sexp))) + ((cond-expand) + (scheme-append-map #'scheme-extract-sexp-imports + (scheme-append-map #'cdr (cdr sexp)))) + ((use require-extension) + (scheme-append-map #'scheme-module-exports (cdr sexp))) + ((import) + (scheme-append-map #'scheme-extract-import-module-imports (cdr sexp))) + ((autoload) + (unless (member (cadr sexp) *scheme-imported-modules*) + (push (cadr sexp) *scheme-imported-modules*) + (mapcar #'(lambda (x) (cons (if (consp x) (car x) x) '((lambda obj)))) + (cddr sexp)))) + ((load) + (unless (member (cadr sexp) *scheme-imported-modules*) + (push (cadr sexp) *scheme-imported-modules*) + (and (stringp (cadr sexp)) + (not (string-match ".*\\.\\(o[0-9]*\\|so\\|dll\\|dylib\\)" + (cadr sexp))) + (file-exists-p (cadr sexp)) + (scheme-with-find-file (cadr sexp) + (scheme-current-globals))))) + ((library module) + (scheme-append-map #'scheme-extract-import-module-imports + (remove-if #'(lambda (x) + (memq (car x) '(import require))) + (cdr sexp)))) + )) + +(defun scheme-module-symbol-p (sym) + (memq sym '(use require require-extension begin cond-expand + module library define-module autoload load import))) + +(defun scheme-skip-shebang () + ;; skip shebang if present + (if (looking-at "#!") + ;; guile skips until a closing !# + (if (eq 'guile (scheme-current-implementation)) + (re-search-forward "!#" nil t) + (forward-line)))) + +(defun scheme-current-imports () + (let ((imports '()) + (*scheme-imported-modules* '()) + (in-mod-p nil)) + (save-excursion + (goto-char (point-min)) + (scheme-skip-shebang) + (if (re-search-forward "^(" nil t) + (forward-char -1)) + ;; scan for module forms + (while (not (eobp)) + (when (eq ?\( (char-after)) + (forward-char 1) + (let ((sym (and (not (eq ?\( (char-after))) + (scheme-symbol-at-point)))) + (cond + ((memq sym '(module library)) + (forward-sexp 3) + (forward-sexp -1) + (setq in-mod-p t)) + ((eq sym 'define-library) + (forward-sexp 1) + (setq in-mod-p t)) + ((scheme-module-symbol-p sym) + (forward-char -1) + (ignore-errors + (let* ((decl (scheme-nth-sexp-at-point 0)) + (res (scheme-extract-sexp-imports decl))) + (setq imports (append res imports))))) + (t + (forward-char -1))))) + (scheme-goto-next-top-level in-mod-p))) + imports)) + +(defun scheme-file-imports (file) + (scheme-with-find-file file + (scheme-current-imports))) + +;; we should be just inside the opening paren of an expression +(defun scheme-name-of-define () + (save-excursion + (scheme-beginning-of-next-sexp) + (if (eq ?\( (char-syntax (char-after))) + (forward-char)) + (and (memq (char-syntax (char-after)) '(?\w ?\_)) + (scheme-symbol-at-point)))) + +(defun scheme-type-of-define (&optional env) + (save-excursion + (scheme-beginning-of-next-sexp) + (cond + ((eq ?\( (char-syntax (char-after))) + `(lambda ,(cdr (scheme-nth-sexp-at-point 0)))) + (t + (ignore-errors (scheme-beginning-of-next-sexp) + (scheme-sexp-type-at-point env)))))) + +;; we should be at the opening paren of an expression +(defun scheme-extract-definitions (&optional env) + (save-excursion + (let ((sym (ignore-errors (and (eq ?\( (char-syntax (char-after))) + (progn (forward-char) + (scheme-symbol-at-point)))))) + (case sym + ((define-syntax define-compiled-syntax defmacro define-macro) + (list (list (scheme-name-of-define) '(syntax)))) + ((define define-inline define-constant define-primitive defun) + (let ((name (scheme-name-of-define)) + (type (scheme-type-of-define env))) + (list (if type (list name type) (list name))))) + ((defvar define-class) + (list (list (scheme-name-of-define) 'non-procedure))) + ((define-record) + (backward-char) + (ignore-errors + (let* ((sexp (scheme-nth-sexp-at-point 0)) + (name (symbol-name (cadr sexp)))) + `((,(intern (concat name "?")) (lambda (obj) boolean)) + (,(intern (concat "make-" name)) (lambda ,(cddr sexp) )) + ,@(scheme-append-map + #'(lambda (x) + `((,(intern (concat name "-" (symbol-name x))) + (lambda (non-procedure))) + (,(intern (concat name "-" (symbol-name x) "-set!")) + (lambda (non-procedure val) undefined)))) + (cddr sexp)))))) + ((define-record-type) + (backward-char) + (ignore-errors + (let ((sexp (scheme-nth-sexp-at-point 0))) + `((,(caaddr sexp) (lambda ,(cdaddr sexp))) + (,(cadddr sexp) (lambda (obj))) + ,@(scheme-append-map + #'(lambda (x) + (if (consp x) + (if (consp (cddr x)) + `((,(cadr x) (lambda (non-procedure))) + (,(caddr x) + (lambda (non-procedure val) undefined))) + `((,(cadr x) (lambda (non-procedure))))))) + (cddddr sexp)))))) + ((begin progn) + (forward-sexp) + (scheme-current-definitions)) + ((include include-ci) + (scheme-append-map + #'(lambda (file) + (scheme-with-find-file file + (scheme-current-globals))) + (ignore-errors (cdr (scheme-nth-sexp-at-point 0))))) + (t + '()))))) + +(defun scheme-in-define-name () + (ignore-errors + (save-excursion + (dotimes (i 2) + (scheme-beginning-of-sexp) + (backward-char)) + (and (save-excursion + (beginning-of-line) + (looking-at "\\s-*(define")) + (point))))) + +(defvar *scheme-include-globals-cache* (make-hash-table :test #'equal) + "Cache for included unmodified files.") + +(defun scheme-include-globals (file from-file env) + (let* ((key (cons file from-file)) + (mtime (nth 5 (file-attributes file))) + (cached (gethash key *scheme-include-globals-cache*))) + (if (and cached + (not (or (and mtime (scheme-mtime>? mtime (caadr cached))) + (let ((buf (get-buffer file))) + (and buf + (equal (buffer-file-name buf) + (file-truename file)) + (buffer-modified-p buf)))))) + (caddr cached) + (let ((res (ignore-errors + (scheme-with-find-file file + (scheme-current-globals env))))) + (puthash key (list mtime res) *scheme-include-globals-cache*) + res)))) + +;; a little more liberal than -extract-definitions, we try to scan to +;; a new top-level form (i.e. a line beginning with an open paren) if +;; there's an error during normal sexp movement +(defun scheme-current-globals (&optional env) + (let ((res '()) + (in-mod-p nil) + (skip (scheme-in-define-name)) + (from-file (buffer-file-name (current-buffer)))) + (save-excursion + (goto-char (point-min)) + (or (ignore-errors (end-of-defun) (beginning-of-defun) t) + (re-search-forward "^(" nil t) + (goto-char (point-max))) + (while (not (eobp)) + (when (and (eq ?\( (char-syntax (char-after))) + (eq ?w (char-syntax (char-after (1+ (point)))))) + (let ((sym (save-excursion (forward-char) (scheme-symbol-at-point)))) + (case sym + ((module define-module define-library) + (setq in-mod-p t) + (forward-char)) + ((include include-ci) + (let* ((files (cdr (scheme-nth-sexp-at-point 0))) + (defs (scheme-append-map + #'(lambda (file) + (scheme-include-globals file from-file env)) + files))) + (setq res (append defs res)))) + ((begin) + (save-excursion + (forward-char) + (setq res + (append (ignore-errors (scheme-extract-definitions env)) + res)))) + (t + (unless (eq (point) skip) + (setq res + (append (ignore-errors (scheme-extract-definitions env)) + res))))))) + (scheme-goto-next-top-level in-mod-p))) + res)) + +;; for internal defines, etc. +(defun scheme-current-definitions (&optional enclosing-end) + (let ((defs '()) + (end (or enclosing-end (point-max)))) + (save-excursion + (while (< (point) end) + (let ((here (point)) + (new-defs (scheme-extract-definitions))) + (cond + (new-defs + (setq defs (append new-defs defs)) + (or (ignore-errors (scheme-beginning-of-next-sexp) + (> (point) here)) + (goto-char end))) + ;; non-definition form, maybe stop scanning + ((not scheme-interleave-definitions-p) + (goto-char end)))))) + defs)) + +(defun scheme-current-exports () + "Returns a list of all symbols exported in the current file" + (let ((res '()) + (in-mod-p nil)) + (save-excursion + (goto-char (point-min)) + (or (ignore-errors (end-of-defun) (beginning-of-defun) t) + (re-search-forward "^(" nil t) + (goto-char (point-max))) + (while (not (eobp)) + (when (and (eq ?\( (char-syntax (char-after))) + (eq ?w (char-syntax (char-after (1+ (point)))))) + (let ((sym (save-excursion (forward-char) (scheme-symbol-at-point)))) + (case sym + ((define-module define-library) + (setq in-mod-p t) + (forward-char)) + ((export provide) + (unless (and (eq 'provide sym) + (eq 'chicken (scheme-current-implementation))) + (setq res (nconc (cdr (scheme-nth-sexp-at-point 0)) res)))) + ((export-all) + (goto-char (point-max))) + ((extend) + (let ((parents (cdr (scheme-nth-sexp-at-point 0)))) + (setq res (nconc (mapcar #'car + (scheme-append-map + #'scheme-module-exports/gauche + parents)) + res)))) + ((module) + (forward-char) + (forward-sexp) + (let ((x (scheme-nth-sexp-at-point 0))) + (cond + ((eq '* x) + (goto-char (point-max))) + ((listp x) + (setq res + (nconc (remove-if-not #'symbolp (cdr x)) res))))))))) + (scheme-goto-next-top-level in-mod-p))) + res)) + +(defun scheme-current-exports/typed () + "Returns an alist of (symbols . type) for all current exports" + (let* ((exports (scheme-current-exports)) + (imports (and scheme-complete-recursive-inference-p + (ignore-errors (scheme-current-imports)))) + (globals (ignore-errors (scheme-current-globals (list imports)))) + (env (append imports globals)) + (typed-exports + (if exports + (remove-if-not #'(lambda (x) (memq (car x) exports)) env) + env)) + (undefined-exports + (remove-if #'(lambda (x) (assq x typed-exports)) exports))) + ;;(message "exports: %s" exports) + (append typed-exports + (mapcar #'(lambda (x) (list x 'object)) undefined-exports)))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; This is rather complicated because we want to auto-generate +;; docstring summaries from the type information, which means +;; inferring various types from common names. The benefit is that you +;; don't have to input the same information twice, and can often +;; cut&paste&munge procedure descriptions from the original +;; documentation. + +(defun scheme-translate-type (type) + (if (not (symbolp type)) + type + (case type + ((pred proc thunk handler dispatch producer consumer f fn g kons) + 'procedure) + ((num) 'number) + ((z) 'complex) + ((x1 x2 x3 y timeout seconds nanoseconds) 'real) + ((i j k n m int index size count len length bound nchars start end + pid uid gid fd fileno errno u8 byte) + 'integer) + ((scur string-cursor) + 'string-cursor) + ((start-indexer end-indexer) + '(or integer string-cursor)) + ((ch) 'char) + ((str name pattern) 'string) + ((file path pathname) 'filename) + ((dir dirname) 'directory) + ((sym id identifier) 'symbol) + ((ls lis lst list alist lists) 'list) + ((vec vector) 'vector) + ((bv bvec bytevector byte-vector) 'bytevector) + ((ht hashtable hash-table) 'hash-table) + ((exc excn exn err error) 'exception) + ((ptr) 'pointer) + ((bool) 'boolean) + ((env) 'environment) + ((char string boolean number complex real integer procedure char-set + port input-port output-port pair vector array stream + thread mutex condition-variable time exception date duration locative + random-source state condition condition-type queue pointer + u8vector s8vector u16vector s16vector u32vector s32vector + u64vector s64vector f32vector f64vector undefined symbol + block filename directory mmap listener environment non-procedure + read-table continuation blob generic method class regexp regmatch + sys-stat fdset) + type) + ((parent seed option mode) 'non-procedure) + (t + (let* ((str (symbol-name type)) + (i (string-match "-?[0-9]+$" str))) + (if i + (scheme-translate-type (intern (substring str 0 i))) + (let ((i (string-match "-\\([^-]+\\)$" str))) + (if i + (scheme-translate-type (intern (substring str (+ i 1)))) + (if (string-match "\\?$" str) + 'boolean + 'object))))))))) + +(defun scheme-lookup-type (spec pos) + "Resolve the type for `pos' the given param list `spec', handling :optional" + (let ((i 1) + (type nil)) + (while (and (consp spec) (<= i pos)) + (cond + ((eq :optional (car spec)) + (decf i)) + ((= i pos) + (setq type (car spec)) + (setq spec nil)) + ((and (consp (cdr spec)) (eq '\.\.\. (cadr spec))) + (setq type (car spec)) + (setq spec nil))) + (setq spec (cdr spec)) + (incf i)) + (if type + (setq type (scheme-translate-type type))) + type)) + +(defun scheme-predicate->type (pred) + (case pred + ((even? odd?) 'integer) + ((char-upper-case? char-lower-case? + char-alphabetic? char-numeric? char-whitespace?) + 'char) + (t + ;; catch all the `type?' predicates with pattern matching + ;; ... we could be smarter if the env was passed + (let ((str (symbol-name pred))) + (if (string-match "\\?$" str) + (scheme-translate-type + (intern (substring str 0 (- (length str) 1)))) + 'object))))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; completion + +(eval-when (compile load eval) + (unless (fboundp 'event-matches-key-specifier-p) + (defalias 'event-matches-key-specifier-p 'eq))) + +(unless (fboundp 'read-event) + (defun read-event () + (aref (read-key-sequence nil) 0))) + +(unless (fboundp 'event-basic-type) + (defalias 'event-basic-type 'event-key)) + +(defun scheme-string-prefix-p (pref str) + (let ((p-len (length pref)) + (s-len (length str))) + (and (<= p-len s-len) + (equal pref (substring str 0 p-len))))) + +(defun scheme-do-completion (str coll &optional strs pred) + (let* ((completion1 (try-completion str coll pred)) + (completion2 (and strs (try-completion str strs pred))) + (completion (if (and completion2 + (or (not completion1) + (< (length completion2) + (length completion1)))) + completion2 + completion1))) + (cond + ((eq completion t)) + ((not completion) + (message "Can't find completion for \"%s\"" str) + (ding)) + ((not (string= str completion)) + (let ((prefix-p (scheme-string-prefix-p completion completion1))) + ;; prefix-p is false when we need to auto-quote a string + (unless prefix-p + (save-excursion + (backward-char (length str)) + (insert "\""))) + (insert (substring completion (length str))) + (unless prefix-p + (insert "\"") + (when (not (or (memq (char-syntax (char-after)) '(32 41)))) + (insert " ") + (backward-char)) + (backward-char)))) + (t + (let ((win-config (current-window-configuration)) + (done nil)) + (message "Hit space to flush") + (with-output-to-temp-buffer "*Completions*" + (display-completion-list + (sort + (all-completions str (append strs coll) pred) + 'string-lessp))) + (while (not done) + (let* ((orig-event + (with-current-buffer (get-buffer "*Completions*") + (read-event))) + (event (event-basic-type orig-event))) + (cond + ((or (event-matches-key-specifier-p event 'tab) + (event-matches-key-specifier-p event 9)) + (save-selected-window + (select-window (get-buffer-window "*Completions*")) + (if (pos-visible-in-window-p (point-max)) + (goto-char (point-min)) + (scroll-up)))) + (t + (set-window-configuration win-config) + (if (or (event-matches-key-specifier-p event 'space) + (event-matches-key-specifier-p event 32)) + (bury-buffer (get-buffer "*Completions*")) + (setq unread-command-events (list orig-event))) + (setq done t)))))))))) + +(defun scheme-env-lookup (env sym) + (let ((spec nil) + (ls env)) + (while (and ls (not spec)) + (setq spec (assq sym (pop ls)))) + spec)) + +(defun scheme-inside-top-level-p (pat) + (save-excursion + (beginning-of-defun) + (looking-at pat))) + +(defun scheme-inside-module-p () + (scheme-inside-top-level-p "^(\\(?:module\\|library\\)\\s-")) + +(defun scheme-inside-define-library-p () + (scheme-inside-top-level-p "^(define-library\\s-")) + +(defun scheme-inside-define*-p () + (scheme-inside-top-level-p + "^(\\(?:define-library\\|define-syntax\\|define\\)\\s-")) + +(defun scheme-inside-library-begin-p () + (let ((res nil)) + (save-excursion + (while (and (not (bobp)) + (ignore-errors + (scheme-beginning-of-sexp) + (backward-char) + t)) + (when (looking-at "(begin\\(\\s-\\|\n\\)") + (setq res t) + (goto-char (point-min))))) + res)) + +(defun scheme-library-decl-includes (decl base) + (case (and (consp decl) (car decl)) + ((include include-ci) + (list '() + (mapcar #'(lambda (f) (concat (file-name-directory base) f)) + (cdr decl)))) + ((include-library-declarations) + (let* ((file (concat (file-name-directory base) (cadr decl))) + (res (scheme-library-includes file t))) + `((,file ,@(car res)) ,(cadr res)))) + ((cond-expand) + (let ((x + (mapcar + #'(lambda (clause) (scheme-library-decl-includes (cadr clause) base)) + (cdr decl)))) + (list (scheme-append-map #'car x) + (scheme-append-map #'cadr x)))) + (t + (list '() '())))) + +(defvar *scheme-library-includes-cache* (make-hash-table :test #'equal)) + +(defun scheme-library-includes/uncached (base &optional flatp) + (let ((decls '()) + (files '())) + (when (file-exists-p base) + (scheme-with-find-file base + (let ((limit (point-max))) + (when (not flatp) + (re-search-forward "^(define-library\\s-" nil t) + (forward-sexp 1)) + (while (< (point) limit) + (let* ((decl (scheme-nth-sexp-at-point 0)) + (includes (and decl (scheme-library-decl-includes decl base)))) + (when includes + (setq decls (append decls (car includes))) + (setq files (append files (cadr includes)))) + (scheme-goto-next-top-level (not flatp))))))) + (list decls files))) + +(defun scheme-library-includes (base &optional flatp) + (let ((cached (and (not flatp) + (gethash base *scheme-library-includes-cache*)))) + (if (and cached + (not + (ignore-errors + (let ((mtime (nth 5 (file-attributes base))) + (ptime (car cached))) + (scheme-mtime>? mtime ptime))))) + (cdr cached) + (let ((res (scheme-library-includes/uncached base flatp))) + (puthash base + (cons (nth 5 (file-attributes base)) res) + *scheme-library-includes-cache*) + res)))) + +(defun scheme-library-include-type (base file) + (let ((decls+files (scheme-library-includes base))) + (cond ((member file (car decls+files)) 'r7rs-library-declaration) + ((member file (cadr decls+files)) 'r7rs)))) + +;; Returns ( ) +;; where is one of: +;; - r7rs-library-declaration +;; - r7rs +;; - r5rs +;; and is the file containing the +;; enclosing library declaration, or nil for programs. +(defun scheme-code-context (file) + (cond + ((scheme-inside-define-library-p) + (list (if (scheme-inside-library-begin-p) + 'r7rs + 'r7rs-library-declaration) + file)) + ((not *scheme-use-r7rs*) + (if (scheme-inside-module-p) + (list 'r5rs (buffer-file-name (current-buffer))) + (list 'r5rs nil))) + (t + (or *scheme-current-context* + (let ((res (scheme-code-context/uncached file))) + ;; cache if we don't expect the context to change + (when (and (car res) (cadr res)) + (setq *scheme-current-context* res)) + res))))) + +(defun scheme-code-context/uncached (file) + ;; check for including library files, starting with the same named .sld + (let* ((sld (concat (file-name-sans-extension file) + *scheme-r7rs-extension*)) + (include-type (scheme-library-include-type sld file))) + (unless (or include-type (equalp file sld)) + (let ((dir (file-name-directory file)) + (count 0) + (sld-pat + (concat (regexp-quote *scheme-r7rs-extension*) "\\'"))) + (while (and (< count *scheme-max-decl-file-search-depth*) + (not (member dir '(nil "" "/" "./")))) + (let ((sld-ls (directory-files dir t sld-pat))) + (while (consp sld-ls) + (setq sld (pop sld-ls)) + (setq include-type (scheme-library-include-type sld file)) + (when include-type + (setq sld-ls '() + dir "/")))) + (incf count) + (setq dir (file-name-directory + (replace-regexp-in-string "/+\\'" "" dir)))))) + (if include-type + (list include-type sld) + (list 'r7rs nil)))) + +(defun scheme-current-env () + (let* ((file (buffer-file-name (current-buffer))) + (lang+base (scheme-code-context file)) + (lang (car lang+base)) + (base (cadr lang+base))) + ;; base language + (case lang + ((r7rs-library-declaration) + (let ((enclosing (scheme-enclosing-2-sexp-prefixes))) + (cond + ((and (eq 'import (caddr enclosing)) + (> (cadr enclosing) 1) + (memq (car enclosing) '(only except))) + (let* ((lib (save-excursion + (when (eq ?w (char-syntax (char-before (point)))) + (scheme-beginning-of-sexp)) + (dotimes (i (- (cadr enclosing) 1)) + (backward-sexp)) + (scheme-nth-sexp-at-point 0))) + (exports (and lib (scheme-module-exports/compute lib)))) + (list exports))) + ((memq (caddr enclosing) '(import only except)) + (list (mapcar #'list + (append + (and (= 0 (cadr enclosing)) + '(only except rename prefix drop-prefix)) + (mapcar #'intern + (scheme-library-completions + (scheme-preceding-sexps))))))) + ((eq 'import (car enclosing)) nil) + ((eq 'export (car enclosing)) + (let* ((imports (ignore-errors (scheme-current-imports))) + (globals (ignore-errors + (scheme-current-globals (list imports)))) + (exports (scheme-current-exports))) + (list (mapcar #'list (remove-if #'(lambda (x) (memq (car x) exports)) + (append imports globals)))))) + (t (list *scheme-r7rs-lib-decl-info*))))) + ((r5rs) + (let* ((env (if base + '(((import + (special list scheme-available-modules)))) + (list (scheme-r5rs-info)))) + (base (cdr (assq (scheme-current-implementation) + *scheme-implementation-exports*)))) + (if (and base (not in-mod-p)) (push base env)) + env)) + (t ; r7rs + (let* ((env '()) + (can-import-p (not (scheme-inside-define*-p))) + (in-import-p + (and can-import-p + (eq 'import (caddr (scheme-enclosing-2-sexp-prefixes)))))) + (cond + (in-import-p + (push (mapcar #'list + (mapcar #'intern + (scheme-library-completions + (scheme-preceding-sexps)))) + env)) + (t + ;; imports + (let ((imports (ignore-errors (scheme-file-imports (or base file))))) + (if imports (push imports env))) + ;; top-level defs + (let ((top (ignore-errors (scheme-current-globals)))) + (if top (push top env))) + ;; current local vars + (let ((locals (ignore-errors (scheme-current-local-vars env)))) + (if locals (push locals env))) + ;; define-library/import + (unless env + (push '((define-library (syntax clause))) env)) + (when can-import-p + (push '((import (special list scheme-available-modules))) env)))) + env))))) + +(defun scheme-env-filter (pred env) + (mapcar #'car + (apply #'concatenate + 'list + (mapcar #'(lambda (e) (remove-if-not pred e)) env)))) + +;; checking return values: +;; a should be capable of returning instances of b +(defun scheme-type-match-p (a b) + (let ((a1 (scheme-translate-type a)) + (b1 (scheme-translate-type b))) + (and (not (eq a1 'undefined)) ; check a *does* return something + (or (eq a1 b1) ; and they're the same + (eq a1 'object) ; ... or a can return anything + (eq b1 'object) ; ... or b can receive anything + (if (symbolp a1) + (if (symbolp b1) + (case a1 ; ... or the types overlap + ((number complex real rational integer) + (memq b1 '(number complex real rational integer))) + ((port input-port output-port) + (memq b1 '(port input-port output-port))) + ((pair list) + (memq b1 '(pair list))) + ((non-procedure) + (not (eq 'procedure b1)))) + (and + (consp b1) + (if (eq 'or (car b1)) + ;; type unions + (find-if + #'(lambda (x) + (scheme-type-match-p + a1 (scheme-translate-type x))) + (cdr b1)) + (let ((b2 (scheme-translate-special-type b1))) + (and (not (equal b1 b2)) + (scheme-type-match-p a1 b2)))))) + (and (consp a1) + (case (car a1) + ((or) + ;; type unions + (find-if + #'(lambda (x) + (scheme-type-match-p (scheme-translate-type x) b1)) + (cdr a1))) + ((lambda) + ;; procedures + (or (eq 'procedure b1) + (and (consp b1) + (eq 'lambda (car b1)) + (scheme-param-list-match-p (cadr a1) + (cadr b1))))) + (t + ;; other special types + (let ((a2 (scheme-translate-special-type a1)) + (b2 (scheme-translate-special-type b1))) + (and (or (not (equal a1 a2)) (not (equal b1 b2))) + (scheme-type-match-p a2 b2))))))))))) + +(defun scheme-param-list-match-p (p1 p2) + (or (and (symbolp p1) (not (null p1))) + (and (symbolp p2) (not (null p2))) + (and (null p1) (null p2)) + (and (consp p1) (consp p2) + (scheme-param-list-match-p (cdr p1) (cdr p2))))) + +(defun scheme-translate-special-type (x) + (if (not (consp x)) + x + (case (car x) + ((list string) (car x)) + ((set special) (cadr x)) + ((flags) 'integer) + (t x)))) + +(defun scheme-nth* (n ls) + (while (and (consp ls) (> n 0)) + (setq n (- n 1) + ls (cdr ls))) + (and (consp ls) (car ls))) + +(defun scheme-file->lines (file) + (and (file-readable-p file) + (scheme-with-find-file file + (goto-char (point-min)) + (let ((res '())) + (while (not (eobp)) + (let ((start (point))) + (forward-line) + (push (buffer-substring-no-properties start (- (point) 1)) + res))) + (reverse res))))) + +(defun scheme-passwd-file-names (file &optional pat) + (delete + nil + (mapcar + #'(lambda (line) + (and (not (string-match "^[ ]*#" line)) + (or (not pat) (string-match pat line)) + (string-match "^\\([^:]*\\):" line) + (match-string 1 line))) + (scheme-file->lines file)))) + +(defun scheme-host-file-names (file) + (scheme-append-map + #'(lambda (line) + (let ((i (string-match "#" line))) + (if i (setq line (substring line 0 i)))) + (cdr (split-string line))) + (scheme-file->lines file))) + +(defun scheme-ssh-known-hosts-file-names (file) + (scheme-append-map + #'(lambda (line) + (split-string (car (split-string line)) ",")) + (scheme-file->lines file))) + +(defun scheme-ssh-config-file-names (file) + (scheme-append-map + #'(lambda (line) + (and (string-match "^ *Host" line) + (cdr (split-string line)))) + (scheme-file->lines file))) + +(defun scheme-complete-user-name (trans sym) + (if (string-match "apple" (emacs-version)) + (append (scheme-passwd-file-names "/etc/passwd" "^[^_].*") + (delete "Shared" (directory-files "/Users" nil "^[^.].*"))) + (scheme-passwd-file-names "/etc/passwd"))) + +(defun scheme-complete-host-name (trans sym) + (append (scheme-host-file-names "/etc/hosts") + (scheme-ssh-known-hosts-file-names "~/.ssh/known_hosts") + (scheme-ssh-config-file-names "~/.ssh/config"))) + +;; my /etc/services is 14k lines, so we try to optimize this +(defun scheme-complete-port-name (trans sym) + (and (file-readable-p "/etc/services") + (scheme-with-find-file "/etc/services" + (goto-char (point-min)) + (let ((rx (concat "^\\(" (regexp-quote (if (symbolp sym) + (symbol-name sym) + sym)) + "[^ ]*\\)")) + (res '())) + (while (not (eobp)) + (if (not (re-search-forward rx nil t)) + (goto-char (point-max)) + (let ((str (match-string-no-properties 1))) + (if (not (equal str (car res))) + (push str res))) + (forward-char 1))) + res)))) + +(defun scheme-complete-file-name (trans sym) + (let* ((file (file-name-nondirectory sym)) + (dir (file-name-directory sym)) + (res (file-name-all-completions file (or dir ".")))) + (if dir + (mapcar #'(lambda (f) (concat dir f)) res) + res))) + +(defun scheme-complete-directory-name (trans sym) + (let* ((file (file-name-nondirectory sym)) + (dir (file-name-directory sym)) + (res (file-name-all-completions file (or dir "."))) + (res2 (if dir (mapcar #'(lambda (f) (concat dir f)) res) res))) + (remove-if-not #'file-directory-p res2))) + +(defun scheme-string-completer (type) + (case type + ((filename) + '(scheme-complete-file-name file-name-nondirectory)) + ((directory) + '(scheme-complete-directory-name file-name-nondirectory)) + (t + (cond + ((and (consp type) (eq 'string (car type))) + (cadr type)) + ((and (consp type) (eq 'or (car type))) + (car (delete nil (mapcar #'scheme-string-completer (cdr type))))))))) + +(defun scheme-apply-string-completer (cmpl sym) + (let ((func (if (consp cmpl) (car cmpl) cmpl)) + (trans (and (consp cmpl) (cadr cmpl)))) + (funcall func trans sym))) + +(defun scheme-complete-variable-name (trans sym) + (dabbrev-expand nil)) + +(defun scheme-smart-complete (&optional arg) + (interactive "P") + (if scheme-indent-before-complete-p + (lisp-indent-line)) + (cond + ((and scheme-complete-from-end-of-symbol-p + (not (eobp)) + (eq ?w (char-syntax (char-after))) + (not (bobp)) + (eq ?w (char-syntax (char-before)))) + (let ((orig-start (point))) + (forward-sexp 1) + (let ((ls (scheme-get-completions arg))) + (cond + ((not (or (try-completion (car ls) (cadr ls) (cadddr ls)) + (and (caddr ls) + (try-completion (car ls) (caddr ls) (cadddr ls))))) + (goto-char orig-start) + (insert " ") + (forward-char -1) + (apply #'scheme-do-completion (scheme-get-completions arg))) + (t + (message "found %s completions" (length (cadr ls))) + (apply #'scheme-do-completion ls)))))) + (t + (apply #'scheme-do-completion (scheme-get-completions arg))))) + +;; normalize the base completions to a list of string lists +(defun scheme-get-completions (&optional arg) + (let ((res (scheme-get-base-completions arg))) + (cons (car res) + (cons (mapcar #'(lambda (x) + (cond + ((symbolp x) (list (symbol-name x))) + ((stringp x) (list x)) + (t x))) + (cadr res)) + (cddr res))))) + +(defun scheme-get-base-completions (&optional arg) + (let* ((end (point)) + (start (save-excursion (skip-syntax-backward "w_") (point))) + (sym (buffer-substring-no-properties start end)) + (in-str-p (scheme-in-string-p)) + (x (save-excursion + (if in-str-p (scheme-beginning-of-string)) + (scheme-enclosing-2-sexp-prefixes))) + (inner-proc (car x)) + (inner-pos (cadr x)) + (outer-proc (caddr x)) + (outer-pos (cadddr x)) + (env (save-excursion + (if in-str-p (scheme-beginning-of-string)) + (scheme-current-env))) + (outer-spec (scheme-env-lookup env outer-proc)) + (outer-type (scheme-translate-type (cadr outer-spec))) + (inner-spec (scheme-env-lookup env inner-proc)) + (inner-type (scheme-translate-type (cadr inner-spec)))) + (cond + ;; return all env symbols when a prefix arg is given + (arg + (list sym (scheme-env-filter #'(lambda (x) t) env))) + ;; allow different types of strings + (in-str-p + (let* ((param-type + (and (consp inner-type) + (eq 'lambda (car inner-type)) + (scheme-lookup-type (cadr inner-type) inner-pos))) + (completer (or (scheme-string-completer param-type) + '(scheme-complete-file-name + file-name-nondirectory)))) + (list sym + (scheme-apply-string-completer completer sym)))) + ;; outer special + ((and (consp outer-type) + (eq 'special (car outer-type)) + (cadddr outer-type)) + (list sym (funcall (cadddr outer-type) sym))) + ;; inner special + ((and (consp inner-type) + (eq 'special (car inner-type)) + (caddr inner-type)) + (list sym (funcall (caddr inner-type) sym))) + ;; completing inner procedure, complete procedures with a + ;; matching return type + ((and (consp outer-type) + (eq 'lambda (car outer-type)) + (not (zerop outer-pos)) + (scheme-nth* (- outer-pos 1) (cadr outer-type)) + (or (zerop inner-pos) + (and (>= 1 inner-pos) + (consp inner-type) + (eq 'lambda (car inner-type)) + (let ((param-type + (scheme-lookup-type (cadr inner-type) inner-pos))) + (and (consp param-type) + (eq 'lambda (car param-type)) + (eq (caddr inner-type) (caddr param-type))))))) + (let ((want-type (scheme-lookup-type (cadr outer-type) outer-pos))) + (list + sym + (scheme-env-filter + #'(lambda (x) + (let ((type (cadr x))) + (or (memq type '(procedure object nil)) + (and (consp type) + (or (and (eq 'syntax (car type)) + (not (eq 'undefined (caddr type)))) + (and (eq 'lambda (car type)) + (scheme-type-match-p (caddr type) + want-type))))))) + env)))) + ;; completing a normal parameter + ((and inner-proc + (not (zerop inner-pos)) + (consp inner-type) + (eq 'lambda (car inner-type))) + (let* ((param-type (scheme-lookup-type (cadr inner-type) inner-pos)) + (set-or-flags + (or (and (consp param-type) + (case (car param-type) + ((set) (cddr param-type)) + ((flags) (cdr param-type)))) + ;; handle nested arithmetic functions inside a flags + ;; parameter + (and (not (zerop outer-pos)) + (consp outer-type) + (eq 'lambda (car outer-type)) + (let ((outer-param-type + (scheme-lookup-type (cadr outer-type) + outer-pos))) + (and (consp outer-param-type) + (eq 'flags (car outer-param-type)) + (memq (scheme-translate-type param-type) + '(number complex real rational integer)) + (memq (scheme-translate-type (caddr inner-type)) + '(number complex real rational integer)) + (cdr outer-param-type)))))) + (base-type (if set-or-flags + (if (and (consp param-type) + (eq 'set (car param-type))) + (scheme-translate-type (cadr param-type)) + 'integer) + param-type)) + (base-completions + (scheme-env-filter + #'(lambda (x) + (and (not (and (consp (cadr x)) (eq 'syntax (caadr x)))) + (scheme-type-match-p (cadr x) base-type))) + env)) + (str-completions + (let ((completer (scheme-string-completer base-type))) + (and + completer + (scheme-apply-string-completer completer sym))))) + (list + sym + (append set-or-flags base-completions) + str-completions))) + ;; completing a function + ((zerop inner-pos) + (list + sym + (scheme-env-filter + #'(lambda (x) + (or (null (cdr x)) + (memq (cadr x) '(procedure object nil)) + (and (consp (cadr x)) + (memq (caadr x) '(lambda syntax special))))) + env))) + ;; complete everything + (t + (list sym (scheme-env-filter #'(lambda (x) t) env)))))) + +(defun scheme-complete-or-indent (&optional arg) + (interactive "P") + (let* ((end (point)) + (func + (if (or (and (not (bobp)) + (eq ?w (char-syntax (char-before)))) + (and (not (and (looking-at "\\s-*$") + (looking-back ")"))) + (save-excursion + (beginning-of-line) + (re-search-forward "\\S-" end t)) + (case scheme-complete-empty-tab-behavior + ((indent) nil) + ((beep) (beep)) + (t t)))) + 'scheme-smart-complete + 'lisp-indent-line))) + (funcall func arg))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; optional indentation handling + +(defvar calculate-lisp-indent-last-sexp) + +;; Copied from scheme-indent-function, but ignore +;; scheme-indent-function property for local variables. +(defun scheme-smart-indent-function (indent-point state) + (let ((normal-indent (current-column))) + (goto-char (1+ (elt state 1))) + (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t) + (if (and (elt state 2) + (not (looking-at "\\sw\\|\\s_"))) + ;; car of form doesn't seem to be a symbol + (progn + (if (not (> (save-excursion (forward-line 1) (point)) + calculate-lisp-indent-last-sexp)) + (progn (goto-char calculate-lisp-indent-last-sexp) + (beginning-of-line) + (parse-partial-sexp (point) + calculate-lisp-indent-last-sexp 0 t))) + ;; Indent under the list or under the first sexp on the same + ;; line as calculate-lisp-indent-last-sexp. Note that first + ;; thing on that line has to be complete sexp since we are + ;; inside the innermost containing sexp. + (backward-prefix-chars) + (current-column)) + (let* ((function (buffer-substring-no-properties + (point) + (progn (forward-sexp 1) (point)))) + (function-sym (intern-soft function)) + (method (and (not (assq function-sym (scheme-current-local-vars))) + (get function-sym 'scheme-indent-function)))) + (cond ((or (eq method 'defun) + (and (null method) + (> (length function) 3) + (string-match "\\`def" function))) + (lisp-indent-defform state indent-point)) + ((integerp method) + (lisp-indent-specform method state + indent-point normal-indent)) + (method + (funcall method state indent-point normal-indent))))))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; optional eldoc function + +(defun scheme-translate-dot-to-optional (ls) + (let ((res '())) + (while (consp ls) + (setq res (cons (car ls) res)) + (setq ls (cdr ls))) + (if (not (null ls)) + (setq res (cons ls (cons :optional res)))) + (reverse res))) + +(defun scheme-optional-in-brackets (ls) + ;; put optional arguments inside brackets (via a vector) + (if (memq :optional ls) + (let ((res '())) + (while (and (consp ls) (not (eq :optional (car ls)))) + (push (pop ls) res)) + (reverse (cons (apply #'vector (cdr ls)) res))) + ls)) + +(defun scheme-base-type (x) + (if (not (consp x)) + x + (case (car x) + ((string list) (car x)) + ((set) (or (cadr x) (car x))) + ((flags) 'integer) + ((lambda) 'procedure) + ((syntax) 'syntax) + (t x)))) + +(defun scheme-sexp-to-string (sexp) + (with-output-to-string (princ sexp))) + +(defun scheme-get-current-symbol-info () + (let* ((sym (eldoc-current-symbol)) + (fnsym0 (eldoc-fnsym-in-current-sexp)) + (fnsym (if (consp fnsym0) (car fnsym0) fnsym0)) + (env (save-excursion + (if (scheme-in-string-p) (scheme-beginning-of-string)) + (scheme-current-env))) + (spec (or (and sym (scheme-env-lookup env sym)) + (and fnsym (scheme-env-lookup env fnsym))))) + (and (consp spec) + (consp (cdr spec)) + (let ((type (cadr spec))) + (concat + (cond + ((nth 3 spec) + "") + ((and (consp type) + (memq (car type) '(syntax lambda))) + (concat + (if (eq (car type) 'syntax) + "syntax: " + "") + (scheme-sexp-to-string + (cons (car spec) + (scheme-optional-in-brackets + (mapcar #'scheme-base-type + (scheme-translate-dot-to-optional + (cadr type)))))) + (if (and (consp (cddr type)) + (not (memq (caddr type) '(obj object)))) + (concat " => " (scheme-sexp-to-string (caddr type))) + ""))) + ((and (consp type) (eq (car type) 'special)) + (scheme-sexp-to-string (car spec))) + (t + (scheme-sexp-to-string type))) + (if (and (not (nth 3 spec)) (nth 4 spec)) " - " "") + (or (nth 4 spec) "")))))) + +(provide 'scheme-complete) + +;;; scheme-complete.el ends here +;;; Local Variables: +;;; eval: (put 'scheme-with-find-file 'lisp-indent-hook 1) +;;; End: diff --git a/elpa/scheme-complete-20170824.1413/scheme-complete.elc b/elpa/scheme-complete-20170824.1413/scheme-complete.elc new file mode 100644 index 0000000..7f14cc3 Binary files /dev/null and b/elpa/scheme-complete-20170824.1413/scheme-complete.elc differ diff --git a/elpa/scribble-mode-20160124.2328/scribble-mode-autoloads.el b/elpa/scribble-mode-20160124.2328/scribble-mode-autoloads.el new file mode 100644 index 0000000..aec8fe6 --- /dev/null +++ b/elpa/scribble-mode-20160124.2328/scribble-mode-autoloads.el @@ -0,0 +1,26 @@ +;;; scribble-mode-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "scribble-mode" "scribble-mode.el" (23391 65265 +;;;;;; 0 0)) +;;; Generated autoloads from scribble-mode.el + +(autoload 'scribble-mode "scribble-mode" "\ +Major mode for editing scribble files. + +\\{scribble-mode-map} + +\(fn)" t nil) + +(add-to-list 'auto-mode-alist '("\\.scrbl\\'" . scribble-mode)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; scribble-mode-autoloads.el ends here diff --git a/elpa/scribble-mode-20160124.2328/scribble-mode-pkg.el b/elpa/scribble-mode-20160124.2328/scribble-mode-pkg.el new file mode 100644 index 0000000..b4dffb4 --- /dev/null +++ b/elpa/scribble-mode-20160124.2328/scribble-mode-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "scribble-mode" "20160124.2328" "Major mode for editing Scribble documents" '((emacs "24")) :commit "34e9e5edb921813b6483e0fefa848efb6ee4b314" :keywords '("convenience") :authors '(("Mario Rodas" . "marsam@users.noreply.github.com")) :maintainer '("Mario Rodas" . "marsam@users.noreply.github.com") :url "https://github.com/emacs-pe/scribble-mode") diff --git a/elpa/scribble-mode-20160124.2328/scribble-mode.el b/elpa/scribble-mode-20160124.2328/scribble-mode.el new file mode 100644 index 0000000..fc245d0 --- /dev/null +++ b/elpa/scribble-mode-20160124.2328/scribble-mode.el @@ -0,0 +1,128 @@ +;;; scribble-mode.el --- Major mode for editing Scribble documents -*- lexical-binding: t; -*- + +;; Copyright (c) 2014 Mario Rodas + +;; Author: Mario Rodas +;; URL: https://github.com/emacs-pe/scribble-mode +;; Package-Version: 20160124.2328 +;; Keywords: convenience +;; Version: 0.1 +;; Package-Requires: ((emacs "24")) + +;; This file is NOT part of GNU Emacs. + +;;; License: + +;; 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 . + +;;; Commentary: +;; A major mode for editing Scribble documents. +;; +;; You can install [geiser][] to `scribble-mode-hook' to eldoc and auto +;; completion support: +;; +;; (add-hook 'scribble-mode-hook #'geiser-mode) +;; +;; [geiser]: http://www.nongnu.org/geiser/ + +;;; Code: + +(defgroup scribble-mode nil + "Major mode for editing Scribble documents." + :prefix "scribble-mode-" + :group 'languages) + +(defcustom scribble-mode-executable "scribble" + "Path to scribble executable." + :type 'string + :group 'scribble-mode) + +(defvar scribble-mode-imenu-generic-expression + `(("Title" + ,(rx "@title" (? (: "[" (* (not (any "]")))) "]") "{" (group (+ (not (any "}")))) "}") + 1) + ("Section" + ,(rx "@" (* "sub") "section" (? (: "[" (* (not (any "]")))) "]") "{" (group (+ (not (any "}")))) "}") + 1))) + +(defvar scribble-mode-syntax-table + (let ((table (make-syntax-table))) + ;; Whitespace + (modify-syntax-entry ?\t " " table) + (modify-syntax-entry ?\n "> " table) + (modify-syntax-entry ?\f " " table) + (modify-syntax-entry ?\r " " table) + (modify-syntax-entry ?\s " " table) + + (modify-syntax-entry ?\" "\" " table) + (modify-syntax-entry ?\\ "\\ " table) + + ;; Special characters + (modify-syntax-entry ?' "' " table) + (modify-syntax-entry ?` "' " table) + (modify-syntax-entry ?, "' " table) + (modify-syntax-entry ?@ "' " table) + + ;; Comments + (modify-syntax-entry ?\@ "' 1" table) + (modify-syntax-entry ?\; "' 2" table) + (modify-syntax-entry ?\n ">" table) + + (modify-syntax-entry ?# "w 14" table) + (modify-syntax-entry ?| "_ 23bn" table) + + ;; Brackets and braces balance for editing convenience. + (modify-syntax-entry ?\[ "(] " table) + (modify-syntax-entry ?\] ")[ " table) + (modify-syntax-entry ?{ "(} " table) + (modify-syntax-entry ?} "){ " table) + (modify-syntax-entry ?\( "() " table) + (modify-syntax-entry ?\) ")( " table) + table) + "Syntax table for `scribble-mode'.") + +(defvar scribble-mode-font-lock-keywords + `((,(rx bol (group "#lang") (+ space) (group (1+ not-newline))) + (1 font-lock-keyword-face) + (2 font-lock-variable-name-face)) + ;; keyword arguments + (,(rx (group "#:" (+ (not (any space ")"))))) + (1 font-lock-keyword-face)) + ;; #t #f + (,(regexp-opt '("#t" "#f") 'symbols) + (1 font-lock-constant-face)) + (,(rx (group "@" (+ (not (any space "[" "{" "("))))) ; FIXME + (1 font-lock-function-name-face))) + "Font lock for `scribble-mode'.") + +;;;###autoload +(define-derived-mode scribble-mode prog-mode "Scribble" + "Major mode for editing scribble files. + +\\{scribble-mode-map}" + (set (make-local-variable 'comment-start) "@;") + (set (make-local-variable 'comment-end) "") + (set (make-local-variable 'comment-multi-line) nil) + (set (make-local-variable 'font-lock-defaults) + '(scribble-mode-font-lock-keywords)) + (set (make-local-variable 'imenu-generic-expression) + scribble-mode-imenu-generic-expression) + (imenu-add-to-menubar "Contents")) + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.scrbl\\'" . scribble-mode)) + +(provide 'scribble-mode) + +;;; scribble-mode.el ends here diff --git a/elpa/scribble-mode-20160124.2328/scribble-mode.elc b/elpa/scribble-mode-20160124.2328/scribble-mode.elc new file mode 100644 index 0000000..ac81b61 Binary files /dev/null and b/elpa/scribble-mode-20160124.2328/scribble-mode.elc differ diff --git a/elpa/sesman-20180727.1016/sesman-autoloads.el b/elpa/sesman-20180727.1016/sesman-autoloads.el new file mode 100644 index 0000000..75336b0 --- /dev/null +++ b/elpa/sesman-20180727.1016/sesman-autoloads.el @@ -0,0 +1,73 @@ +;;; sesman-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "sesman" "sesman.el" (23391 65264 0 0)) +;;; Generated autoloads from sesman.el + +(autoload 'sesman-start "sesman" "\ +Start sesman session. + +\(fn)" t nil) + +(autoload 'sesman-restart "sesman" "\ +Restart sesman session. + +\(fn)" t nil) + +(autoload 'sesman-quit "sesman" "\ +Terminate sesman session. +When WHICH is nil, kill only the current session; when a single universal +argument or 'linked, kill all linked session; when a double universal argument, +t or 'all, kill all sessions. + +\(fn &optional WHICH)" t nil) + +(autoload 'sesman-show-session-info "sesman" "\ +Display session(s) info. +When WHICH is nil, show info for current session; when a single universal +argument or 'linked, show info for all linked sessions; when a double universal +argument or 'all, show info for all sessions. + +\(fn &optional WHICH)" t nil) + +(autoload 'sesman-show-links "sesman" "\ +Display links active in the current context. + +\(fn)" t nil) + +(autoload 'sesman-link-with-buffer "sesman" "\ +Associate SESSION with BUFFER. +BUFFER defaults to current buffer. On universal argument, or if BUFFER is 'ask, +ask for buffer. + +\(fn &optional BUFFER SESSION)" t nil) + +(autoload 'sesman-link-with-directory "sesman" "\ +Associate a SESSION with DIR. +DIR defaults to `default-directory'. On universal argument, or if DIR is 'ask, +ask for directory. + +\(fn &optional DIR SESSION)" t nil) + +(autoload 'sesman-link-with-project "sesman" "\ +Link the SESSION with PROJECT. +PROJECT defaults to current project. On universal argument, or if PROJECT is +'ask, ask for the project. + +\(fn &optional PROJECT SESSION)" t nil) + +(autoload 'sesman-unlink "sesman" "\ +Break any of the previously created links. + +\(fn)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; sesman-autoloads.el ends here diff --git a/elpa/sesman-20180727.1016/sesman-pkg.el b/elpa/sesman-20180727.1016/sesman-pkg.el new file mode 100644 index 0000000..01f1c7d --- /dev/null +++ b/elpa/sesman-20180727.1016/sesman-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "sesman" "20180727.1016" "Generic Session Manager" '((emacs "25")) :commit "ea2e4fa0fe5431c463fce1f6db7ba925bccea38c" :keywords '("process") :authors '(("Vitalie Spinu")) :maintainer '("Vitalie Spinu") :url "https://github.com/vspinu/sesman") diff --git a/elpa/sesman-20180727.1016/sesman.el b/elpa/sesman-20180727.1016/sesman.el new file mode 100644 index 0000000..921b11e --- /dev/null +++ b/elpa/sesman-20180727.1016/sesman.el @@ -0,0 +1,766 @@ +;;; sesman.el --- Generic Session Manager -*- lexical-binding: t -*- +;; +;; Copyright (C) 2018, Vitalie Spinu +;; Author: Vitalie Spinu +;; URL: https://github.com/vspinu/sesman +;; Package-Version: 20180727.1016 +;; Keywords: process +;; Version: 0.1.1-snapshot +;; Package-Requires: ((emacs "25")) +;; Keywords: processes, tools, vc +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; 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, 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; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth +;; Floor, Boston, MA 02110-1301, USA. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Commentary: +;; +;; Sesman provides facilities for session management and interactive session +;; association with the current contexts (project, directory, buffers etc). See +;; project's readme for more details. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Code: + +(require 'cl-generic) +(require 'seq) +(require 'subr-x) + +(defgroup sesman nil + "Generic Session Manager." + :prefix "sesman-" + :group 'tools + :link '(url-link :tag "GitHub" "https://github.com/vspinu/sesman")) + +;; (defcustom sesman-disambiguate-by-relevance t +;; "If t choose most relevant session in ambiguous situations, otherwise ask. +;; Ambiguity arises when multiple sessions are associated with current context. By +;; default only projects could be associated with multiple sessions. See +;; `sesman-single-link-contexts' in order to change that. Relevance is decided by +;; system's implementation, see `sesman-more-relevant-p'." +;; :group 'sesman +;; :type 'boolean) + +(defcustom sesman-single-link-context-types '(buffer) + "List of context types to which at most one session can be linked." + :group 'sesman + :type '(repeat symbol) + :package-version '(sesman . "0.1.0")) + +;; FIXME: +;; (defcustom sesman-abbreviate-paths 2 +;; "Abbreviate paths to that many parents. +;; When set to nil, don't abbreviate directories." +;; :group 'sesman +;; :type '(choice number +;; (const :tag "Don't abbreviate" nil))) + +(defvar sesman-sessions-hashmap (make-hash-table :test #'equal) + "Hash-table of all sesman sessions. +Key is a cons (system-name . session-name).") + +(defvar sesman-links-alist nil + "An alist of all sesman links. +Each element is of the form (key cxt-type cxt-value) where +\"key\" is of the form (system-name . session-name). system-name +and cxt-type must be symbols.") + +(defvar-local sesman-system nil + "Name of the system managed by `sesman'. +Can be either a symbol, or a function returning a symbol.") + + +;; Internal Utilities + +(defun sesman--on-C-u-u-sessions (system which) + (cond + ((null which) + (let ((ses (sesman-current-session system))) + (when ses + (list ses)))) + ((or (equal which '(4)) (eq which 'linked)) + (sesman-linked-sessions system)) + ((or (equal which '(16)) (eq which 'all) (eq which t)) + (sesman--all-system-sessions system)) + (t (error "Invalid which argument (%s)" which)))) + +(defun sesman--cap-system-name (system) + (let ((name (symbol-name system))) + (if (string-match-p "^[[:upper:]]" name) + name + (capitalize name)))) + +(defun sesman--link-session (system session &optional cxt-type cxt-val) + (let* ((ses-name (or (car-safe session) + (error "SESSION must be a headed list"))) + (cxt-val (or cxt-val + (sesman--expand-path-maybe + (or (if cxt-type + (sesman-context cxt-type system) + ;; use the lest specific context-type available + (seq-some (lambda (ctype) + (let ((val (sesman-context ctype system))) + (setq cxt-type ctype) + val)) + (reverse (sesman-context-types system)))) + (error "No local context of type %s" cxt-type))))) + (key (cons system ses-name)) + (link (list key cxt-type cxt-val))) + (if (member cxt-type sesman-single-link-context-types) + (thread-last sesman-links-alist + (seq-remove (sesman--link-lookup-fn system nil cxt-type cxt-val)) + (cons link) + (setq sesman-links-alist)) + (unless (seq-filter (sesman--link-lookup-fn system ses-name cxt-type cxt-val) + sesman-links-alist) + (setq sesman-links-alist (cons link sesman-links-alist)))) + key)) + +(defun sesman--link-session-interactively (cxt-type cxt-value session) + (let ((system (sesman--system)) + (cxt-name (symbol-name cxt-type))) + (if (member cxt-type (sesman-context-types system)) + (let ((session (or session + (sesman-ask-for-session + system + (format "Link with %s %s: " + cxt-name (sesman--abbrev-path-maybe + (sesman-context cxt-type system))) + (sesman--all-system-sessions system) + 'ask-new)))) + (sesman--link-session system session cxt-type cxt-value)) + (error (format "%s association not allowed for this system (%s)" + (capitalize cxt-name) + system))))) + +(defun sesman--expand-path-maybe (obj) + (if (stringp obj) + (expand-file-name obj) + obj)) + +;; FIXME: incorporate `sesman-abbreviate-paths' +(defun sesman--abbrev-path-maybe (obj) + (if (stringp obj) + (abbreviate-file-name obj) + obj)) + +(defun sesman--system-in-buffer (&optional buffer) + (with-current-buffer (or buffer (current-buffer)) + (if (functionp sesman-system) + (funcall sesman-system) + sesman-system))) + +(defun sesman--system () + (if sesman-system + (if (functionp sesman-system) + (funcall sesman-system) + sesman-system) + (error "No `sesman-system' in buffer `%s'" (current-buffer)))) + +(defun sesman--all-system-sessions (&optional system) + "Return a list of sessions registered with SYSTEM." + (let ((system (or system (sesman--system))) + sessions) + (maphash + (lambda (k s) + (when (eql (car k) system) + (push s sessions))) + sesman-sessions-hashmap) + (sesman--sort-sessions system sessions))) + +;; FIXME: make this a macro +(defun sesman--link-lookup-fn (&optional system ses-name cxt-type cxt-val x) + (let ((system (or system (caar x))) + (ses-name (or ses-name (cdar x))) + (cxt-type (or cxt-type (nth 1 x))) + (cxt-val (or cxt-val (nth 2 x)))) + (lambda (el) + (and (or (null system) (eq (caar el) system)) + (or (null ses-name) (equal (cdar el) ses-name)) + (or (null cxt-type) + (if (listp cxt-type) + (member (nth 1 el) cxt-type) + (eq (nth 1 el) cxt-type))) + (or (null cxt-val) (equal (nth 2 el) cxt-val)))))) + +(defun sesman--unlink (x) + (setq sesman-links-alist + (seq-remove (sesman--link-lookup-fn nil nil nil nil x) + sesman-links-alist))) + +(defun sesman--clear-links () + (setq sesman-links-alist + (seq-filter (lambda (x) + (gethash (car x) sesman-sessions-hashmap)) + sesman-links-alist))) + +(defun sesman--format-link (link) + (let ((val (sesman--abbrev-path-maybe + (sesman--lnk-value link)))) + (format "%s(%s) -> ses(%s)" + (sesman--lnk-context-type link) + val + (propertize (sesman--lnk-session-name link) 'face 'bold)))) + +(defun sesman--ask-for-link (prompt links &optional ask-all) + (let* ((name.keys (mapcar (lambda (link) + (cons (sesman--format-link link) link)) + links)) + (name.keys (append name.keys + (when (and ask-all (> (length name.keys) 1)) + '(("*all*"))))) + (nms (mapcar #'car name.keys)) + (sel (completing-read prompt nms nil t nil nil (car nms)))) + (cond ((string= sel "*all*") + links) + (ask-all + (list (cdr (assoc sel name.keys)))) + (t + (cdr (assoc sel name.keys)))))) + +(defun sesman--sort-sessions (system sessions) + (seq-sort (lambda (x1 x2) + (sesman-more-relevant-p system x1 x2)) + sessions)) + +(defun sesman--sort-links (system links) + (seq-sort (lambda (x1 x2) + (sesman-more-relevant-p system + (gethash (car x1) sesman-sessions-hashmap) + (gethash (car x2) sesman-sessions-hashmap))) + links)) + +;; link data structure accessors +(defun sesman--lnk-system-name (lnk) + (caar lnk)) +(defun sesman--lnk-session-name (lnk) + (cdar lnk)) +(defun sesman--lnk-context-type (lnk) + (cadr lnk)) +(defun sesman--lnk-value (lnk) + (nth 2 lnk)) + + +;;; User Interface + +;;;###autoload +(defun sesman-start () + "Start sesman session." + (interactive) + (let ((system (sesman--system))) + (message "Starting new %s session ..." system) + (sesman-start-session system))) + +;;;###autoload +(defun sesman-restart () + "Restart sesman session." + (interactive) + (let* ((system (sesman--system)) + (old-session (sesman-ensure-session system))) + (message "Restarting %s '%s' session" system (car old-session)) + (sesman-restart-session system old-session))) + +;;;###autoload +(defun sesman-quit (&optional which) + "Terminate sesman session. +When WHICH is nil, kill only the current session; when a single universal +argument or 'linked, kill all linked session; when a double universal argument, +t or 'all, kill all sessions." + (interactive "P") + (let* ((system (sesman--system)) + (sessions (sesman--on-C-u-u-sessions system which))) + (if (null sessions) + (message "No more %s sessions" system) + (mapc (lambda (s) + (sesman-unregister system s) + (sesman-quit-session system s)) + sessions) + (message + "Killed %s %s %s" system + (if (= 1 (length sessions)) "session" "sessions") + (mapcar #'car sessions))))) + +;;;###autoload +(defun sesman-show-session-info (&optional which) + "Display session(s) info. +When WHICH is nil, show info for current session; when a single universal +argument or 'linked, show info for all linked sessions; when a double universal +argument or 'all, show info for all sessions." + (interactive "P") + (let* ((system (sesman--system)) + (sessions (sesman--on-C-u-u-sessions system which))) + (if sessions + (message (mapconcat + (lambda (ses) + (format "%s [linked: %s]\n%s" + (propertize (car ses) 'face 'bold) + (sesman-session-links system ses t) + (sesman-session-info system ses))) + (delete-consecutive-dups sessions) + "\n")) + (message "No %s sessions" system)))) + +;;;###autoload +(defun sesman-show-links () + "Display links active in the current context." + (interactive) + (let* ((system (sesman--system)) + (links (sesman-current-links system))) + (if links + (message (mapconcat #'sesman--format-link links "\n")) + (message "No %s links in the current context" system)))) + +;;;###autoload +(defun sesman-link-with-buffer (&optional buffer session) + "Associate SESSION with BUFFER. +BUFFER defaults to current buffer. On universal argument, or if BUFFER is 'ask, +ask for buffer." + (interactive "P") + (let ((buf (if (or (eq buffer 'ask) + (equal buffer '(4))) + (let ((this-system (sesman--system))) + (read-buffer "Link buffer: " (current-buffer) t + (lambda (b) + (equal this-system (sesman--system-in-buffer b))))) + (or buffer (current-buffer))))) + (sesman--link-session-interactively 'buffer buf session))) + +;;;###autoload +(defun sesman-link-with-directory (&optional dir session) + "Associate a SESSION with DIR. +DIR defaults to `default-directory'. On universal argument, or if DIR is 'ask, +ask for directory." + (interactive "P") + (let ((dir (if (or (eq dir 'ask) + (equal dir '(4))) + (read-directory-name "Link directory: ") + (or dir default-directory)))) + (sesman--link-session-interactively 'directory dir session))) + +;;;###autoload +(defun sesman-link-with-project (&optional project session) + "Link the SESSION with PROJECT. +PROJECT defaults to current project. On universal argument, or if PROJECT is +'ask, ask for the project." + (interactive "P") + (let* ((system (sesman--system)) + (project (if (or (eq project 'ask) + (equal project '(4))) + ;; FIXME: should be a completion over all known projects for this system + (read-directory-name "Project: " (sesman-project system)) + (or project (sesman-project system))))) + (sesman--link-session-interactively 'project project session))) + +;;;###autoload +(defun sesman-unlink () + "Break any of the previously created links." + (interactive) + (let* ((system (sesman--system)) + (links (or (sesman-current-links system) + (user-error "No %s links found" system)))) + (mapc #'sesman--unlink + (sesman--ask-for-link "Unlink: " links 'ask-all)))) + +(defvar sesman-map + (let (sesman-map) + (define-prefix-command 'sesman-map) + (define-key sesman-map (kbd "C-i") #'sesman-show-session-info) + (define-key sesman-map (kbd "i") #'sesman-show-session-info) + (define-key sesman-map (kbd "C-l") #'sesman-show-links) + (define-key sesman-map (kbd "l") #'sesman-show-links) + (define-key sesman-map (kbd "C-s") #'sesman-start) + (define-key sesman-map (kbd "s") #'sesman-start) + (define-key sesman-map (kbd "C-r") #'sesman-restart) + (define-key sesman-map (kbd "r") #'sesman-restart) + (define-key sesman-map (kbd "C-q") #'sesman-quit) + (define-key sesman-map (kbd "q") #'sesman-quit) + (define-key sesman-map (kbd "C-b") #'sesman-link-with-buffer) + (define-key sesman-map (kbd "b") #'sesman-link-with-buffer) + (define-key sesman-map (kbd "C-d") #'sesman-link-with-directory) + (define-key sesman-map (kbd "d") #'sesman-link-with-directory) + (define-key sesman-map (kbd "C-p") #'sesman-link-with-project) + (define-key sesman-map (kbd "p") #'sesman-link-with-project) + (define-key sesman-map (kbd "C-u") #'sesman-unlink) + (define-key sesman-map (kbd " u") #'sesman-unlink) + sesman-map) + "Session management prefix keymap.") + +(defvar sesman-menu + '("Sesman" + ["Show Session Info" sesman-show-session-info] + ["Show Links" sesman-show-links] + "--" + ["Start" sesman-start] + ["Restart" sesman-restart :active (sesman-connected-p)] + ["Quit" sesman-quit :active (sesman-connected-p)] + "--" + ["Link with Buffer" sesman-link-with-buffer :active (sesman-connected-p)] + ["Link with Directory" sesman-link-with-directory :active (sesman-connected-p)] + ["Link with Project" sesman-link-with-project :active (sesman-connected-p)] + "--" + ["Unlink" sesman-unlink :active (sesman-connected-p)]) + "Sesman Menu.") + +(defun sesman-install-menu (map) + "Install `sesman-menu' into MAP." + (easy-menu-do-define 'seman-menu-open + map + (get 'sesman-menu 'variable-documentation) + sesman-menu)) + + +;;; System Generic + +(cl-defgeneric sesman-start-session (system) + "Start and return SYSTEM SESSION.") + +(cl-defgeneric sesman-quit-session (system session) + "Terminate SYSTEM SESSION.") + +(cl-defgeneric sesman-restart-session (system session) + "Restart SYSTEM SESSION. +By default, calls `sesman-quit-session' and then +`sesman-start-session'." + (let ((old-name (car session))) + (sesman-quit-session system session) + (let ((new-session (sesman-start-session system))) + (setcar new-session old-name)))) + +(cl-defgeneric sesman-session-info (_system session) + (cdr session)) + +(cl-defgeneric sesman-project (_system) + "Retrieve project root for SYSTEM in directory DIR. +DIR defaults to `default-directory'. Return a string or nil if no project has +been found." + nil) + +(cl-defgeneric sesman-more-relevant-p (_system session1 session2) + "Return non-nil if SESSION1 should be sorted before SESSION2. +By default, sort by session name. Systems should overwrite this method to +provide a more meaningful ordering. If your system objects are buffers you can +use `sesman-more-recent-p' utility in this method." + (not (string-greaterp (car session1) (car session2)))) + +(cl-defgeneric sesman-context-types (_system) + "Return a list of context types understood by SYSTEM." + '(buffer directory project)) + + +;;; System API + +(defun sesman-session (system session-name) + "Retrieve SYSTEM's session with SESSION-NAME from global hash." + (let ((system (or system (sesman--system)))) + (gethash (cons system session-name) sesman-sessions-hashmap))) + +(defun sesman-sessions (system) + "Return a list of all sessions registered with SYSTEM. +`sesman-linked-sessions' lead the list." + (let ((system (or system (sesman--system)))) + (delete-dups + (append (sesman-linked-sessions system) + ;; (sesman-friendly-sessions system) + (sesman--all-system-sessions system))))) + +(defun sesman-has-sessions-p (system) + "Return t if there is at least one session registered with SYSTEM." + (let ((system (or system (sesman--system))) + (found)) + (condition-case nil + (maphash (lambda (k _) + (when (eq (car k) system) + (setq found t) + (throw 'found nil))) + sesman-sessions-hashmap) + (error)) + found)) + +(defvar sesman--select-session-history nil) +(defun sesman-ask-for-session (system prompt &optional sessions ask-new ask-all) + "Ask for a SYSTEM session with PROMPT. +SESSIONS defaults to value returned from `sesman-sessions'. If +ASK-NEW is non-nil, offer *new* option to start a new session. If +ASK-ALL is non-nil offer *all* option. If ASK-ALL is non-nil, +return a list of sessions, otherwise a single session." + (let* ((sessions (or sessions (sesman-sessions system))) + (name.syms (mapcar (lambda (s) + (let ((name (car s))) + (cons (if (symbolp name) (symbol-name name) name) + name))) + sessions)) + (nr (length name.syms)) + (syms (if (and (not ask-new) (= nr 0)) + (error "No %s sessions found" system) + (append name.syms + (when ask-new '(("*new*"))) + (when (and ask-all (> nr 1)) + '(("*all*")))))) + (def (caar syms)) + ;; (def (if (assoc (car sesman--select-session-history) syms) + ;; (car sesman--select-session-history) + ;; (caar syms))) + (sel (completing-read + prompt (mapcar #'car syms) nil t nil 'sesman--select-session-history def))) + (cond + ((string= sel "*new*") + (let ((ses (sesman-start-session system))) + (message "Started %s" (car ses)) + (if ask-all (list ses) ses))) + ((string= sel "*all*") + sessions) + (t + (let* ((sym (cdr (assoc sel syms))) + (ses (assoc sym sessions))) + (if ask-all (list ses) ses)))))) + +(defun sesman-current-session (system &optional cxt-types) + "Get the most relevant linked session for SYSTEM. +CXT-TYPES is as in `sesman-linked-sessions'." + (car (sesman-linked-sessions system cxt-types))) + +(defun sesman-ensure-session (system &optional cxt-types) + "Get the most relevant linked session for SYSTEM or throw if none exists. +CXT-TYPES is as in `sesman-linked-sessions'." + (or (car (sesman-linked-sessions system cxt-types)) + (user-error "No linked %s sessions" system))) + +(defun sesman-linked-sessions (system &optional cxt-types) + "Return a list of SYSTEM sessions linked in current context. +CXT-TYPES is a list of context types to consider. Defaults to the +list returned from `sesman-context-types'." + (let* ((system (or system (sesman--system))) + (cxt-types (or cxt-types (sesman-context-types system)))) + ;; just in case some links are lingering due to user errors + (sesman--clear-links) + (mapcar (lambda (assoc) + (gethash (car assoc) sesman-sessions-hashmap)) + (sesman-current-links system cxt-types)))) + +(defun sesman-session-links (system session &optional as-string) + "Retrieve all links for SYSTEM's SESSION from the global `sesman-links-alist'. +Return an alist of the form + ((buffer buffers..) + (directory directories...) + (project projects...)). +If AS-STRING is non-nil, return an equivalent string representation." + (let* ((system (or system (sesman--system))) + (session (or session (sesman-current-session system))) + (ses-name (car session)) + (links (thread-last sesman-links-alist + (seq-filter (sesman--link-lookup-fn system ses-name)) + (sesman--sort-links system) + (reverse))) + (out (mapcar (lambda (x) (list x)) + (sesman-context-types system)))) + (mapc (lambda (link) + (let* ((type (sesman--lnk-context-type link)) + (val (sesman--lnk-value link)) + (entry (assoc type out))) + (when entry + (setcdr entry (cons val (cdr entry)))))) + links) + (let ((out (delq nil (mapcar (lambda (el) (and (cdr el) el)) out)))) + (if as-string + (mapconcat (lambda (link-vals) + (let ((type (car link-vals))) + (mapconcat (lambda (l) + (let ((l (if (listp l) (cdr l) l))) + (format "%s(%s)" type l))) + (cdr link-vals) + " "))) + out + " ") + out)))) + +(defun sesman-links (system &optional session-name cxt-types) + "Retrieve all links for SYSTEM, SESSION-NAME and CXT-TYPES." + (let ((lfn (sesman--link-lookup-fn system session-name cxt-types))) + (seq-filter lfn sesman-links-alist))) + +(defun sesman-current-links (system &optional cxt-types) + "Retrieve all active links in current context for SYSTEM. +CXT-TYPES is a list of context types to consider. Returned links +are a subset of `sesman-links-alist' sorted in order of relevance." + ;; mapcan is a built-in in 26.1; don't want to require cl-lib for one function + (seq-mapcat + (lambda (cxt-type) + (let ((lfn (sesman--link-lookup-fn system nil cxt-type))) + (sesman--sort-links + system + (seq-filter (lambda (l) + (and (funcall lfn l) + (sesman-relevant-context-p cxt-type (nth 2 l)))) + sesman-links-alist)))) + (or cxt-types (sesman-context-types system)))) + +(defun sesman-has-links-p (system &optional cxt-types) + "Return t if there is at least one linked session. +CXT-TYPES defaults to `sesman-context-types' for current SYSTEM." + (let ((cxt-types (or cxt-types (sesman-context-types system))) + (found)) + (condition-case nil + (mapc (lambda (l) + (when (eq system (sesman--lnk-system-name l)) + (let ((cxt (sesman--lnk-context-type l))) + (when (and (member cxt cxt-types) + (sesman-relevant-context-p cxt (sesman--lnk-value l))) + (setq found t) + (throw 'found nil))))) + sesman-links-alist) + (error)) + found)) + +(defun sesman-register (system session) + "Register SESSION into `sesman-sessions-hashmap' and `sesman-links-alist'. +SYSTEM defaults to current system. If a session with same name is already +registered in `sesman-sessions-hashmap', change the name by appending \"#1\", +\"#2\" ... to the name. This function should be called by system-specific +connection initializers (\"run-xyz\", \"xyz-jack-in\" etc.)." + (let* ((system (or system (sesman--system))) + (ses-name (car session)) + (ses-name0 (car session)) + (i 1)) + (while (sesman-session system ses-name) + (setq ses-name (format "%s#%d" ses-name0 i) + i (1+ i))) + (setq session (cons ses-name (cdr session))) + (puthash (cons system ses-name) session sesman-sessions-hashmap) + (sesman--link-session system session) + session)) + +(defun sesman-unregister (system session) + "Unregister SESSION. +SYSTEM defaults to current system. Remove session from +`sesman-sessions-hashmap' and `sesman-links-alist'." + (let ((ses-key (cons system (car session)))) + (remhash ses-key sesman-sessions-hashmap) + (sesman--clear-links) + session)) + +(defun sesman-add-object (system session-name object &optional allow-new) + "Add (destructively) OBJECT to session SESSION-NAME of SYSTEM. +If ALLOW-NEW is nil and session with SESSION-NAME does not exist +throw an error, otherwise register a new session with +session (list SESSION-NAME OBJECT)." + (let* ((system (or system (sesman--system))) + (session (sesman-session system session-name))) + (if session + (setcdr session (cons object (cdr session))) + (if allow-new + (sesman-register system (list session-name object)) + (error "%s session '%s' does not exist" + (sesman--cap-system-name system) session-name))))) + +(defun sesman-remove-object (system session-name object &optional auto-unregister no-error) + "Remove (destructively) OBJECT from session SESSION-NAME of SYSTEM. +If SESSION-NAME is nil, retrieve the session with +`sesman-session-for-object'. If OBJECT is the last object in sesman +session, `sesman-unregister' the session. If AUTO-UNREGISTER is non-nil +unregister sessions of length 0 and remove all the links with the session. +If NO-ERROR is non-nil, don't throw an error if OBJECT is not found in any +session. This is useful if there are several \"concurrent\" parties which +can remove the object." + (let* ((system (or system (sesman--system))) + (session (if session-name + (sesman-session system session-name) + (sesman-session-for-object system object no-error))) + (new-session (delete object session))) + (cond ((null new-session)) + ((= (length new-session) 1) + (when auto-unregister + (sesman-unregister system session))) + (t + (puthash (cons system (car session)) new-session sesman-sessions-hashmap))))) + +(defun sesman-session-for-object (system object &optional no-error) + "Retrieve SYSTEM session which contains OBJECT. +When NO-ERROR is non-nil, don't throw an error if OBJECT is not part of any +session. In such case, return nil." + (let* ((system (or system (sesman--system))) + (sessions (sesman--all-system-sessions system))) + (or (seq-find (lambda (ses) + (seq-find (lambda (x) (equal object x)) (cdr ses))) + sessions) + (unless no-error + (error "%s is not part of any %s sessions" + object system))))) + +(defun sesman-session-name-for-object (system object &optional no-error) + "Retrieve the name of the SYSTEM's session containing OBJECT. +When NO-ERROR is non-nil, don't throw an error if OBJCECT is not part of +any session. In such case, return nil." + (car (sesman-session-for-object system object no-error))) + +(defun sesman-more-recent-p (bufs1 bufs2) + "Return t if BUFS1 is more recent than BUFS2. +BUFS1 and BUFS2 are either buffers or lists of buffers. When lists of +buffers, most recent buffers from each list are considered. To be used +primarily in `sesman-more-relevant-p' methods when session objects are +buffers." + (let ((bufs1 (if (bufferp bufs1) (list bufs1) bufs1)) + (bufs2 (if (bufferp bufs2) (list bufs2) bufs2))) + (eq 1 (seq-some (lambda (b) + (if (member b bufs1) + 1 + (when (member b bufs2) + -1))) + (buffer-list))))) + + +;;; Contexts +(cl-defgeneric sesman-context (_cxt-type _system) + "Given context type CXT-TYPE return the context.") +(cl-defmethod sesman-context ((_cxt-type (eql buffer)) _system) + "Return current buffer." + (current-buffer)) +(cl-defmethod sesman-context ((_cxt-type (eql directory)) _system) + "Return current directory." + default-directory) +(cl-defmethod sesman-context ((_cxt-type (eql project)) system) + "Return current project." + (or + (sesman-project (or system (sesman--system))) + ;; Normally we would use (project-roots (project-current)) but currently + ;; project-roots fails on nil and doesn't work on custom `('foo . + ;; "path/to/project"). So, use vc as a fallback and don't use project.el at + ;; all for now. + (vc-root-dir))) + +(cl-defgeneric sesman-relevant-context-p (_cxt-type cxt) + "Non-nil if context CXT is relevant to current context of type CXT-TYPE.") +(cl-defmethod sesman-relevant-context-p ((_cxt-type (eql buffer)) buf) + "Non-nil if BUF is `current-buffer'." + (eq (current-buffer) buf)) +(cl-defmethod sesman-relevant-context-p ((_cxt-type (eql directory)) dir) + "Non-nil if DIR is the parent or equals the `default-directory'." + (when (and dir default-directory) + (string-match-p (concat "^" dir) (expand-file-name default-directory)))) +(cl-defmethod sesman-relevant-context-p ((_cxt-type (eql project)) proj) + "Non-nil if PROJ is the parent or equals the `default-directory'." + (when (and proj default-directory) + (string-match-p (concat "^" proj) + (expand-file-name default-directory)))) + + +(provide 'sesman) + +;;; sesman.el ends here diff --git a/elpa/sesman-20180727.1016/sesman.elc b/elpa/sesman-20180727.1016/sesman.elc new file mode 100644 index 0000000..5f6c72d Binary files /dev/null and b/elpa/sesman-20180727.1016/sesman.elc differ diff --git a/elpa/session-20120510.1700/session-autoloads.el b/elpa/session-20120510.1700/session-autoloads.el deleted file mode 100644 index 9e6e81b..0000000 --- a/elpa/session-20120510.1700/session-autoloads.el +++ /dev/null @@ -1,39 +0,0 @@ -;;; session-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "session" "session.el" (22993 41322 0 0)) -;;; Generated autoloads from session.el - -(autoload 'session-jump-to-last-change "session" "\ -Jump to the position of the last change. -Without prefix arg, jump successively to previous change positions which -differ by at least `session-jump-undo-threshold' characters by repeated -invocation of this command. With prefix argument 0, jump to end of last -change. With numeric prefix argument, jump to start of first change in -the ARG's undo block in the `buffer-undo-list'. - -With non-numeric prefix argument (\\[universal-argument] only), set -point as oldest change position. It might change slightly if you jump -to it due to intermediate insert/delete elements in the -`buffer-undo-list'. - -\(fn &optional ARG)" t nil) - -(autoload 'session-initialize "session" "\ -Initialize package session and read previous session file. -Setup hooks and load `session-save-file', see variable `session-initialize'. At -best, this function is called at the end of the Emacs startup, i.e., add -this function to `after-init-hook'. - -\(fn)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; session-autoloads.el ends here diff --git a/elpa/session-20120510.1700/session-pkg.el b/elpa/session-20120510.1700/session-pkg.el deleted file mode 100644 index 02c7a15..0000000 --- a/elpa/session-20120510.1700/session-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "session" "20120510.1700" "use variables, registers and buffer places across sessions" 'nil :commit "19ea0806873daac3539a4b956e15655e99e3dd6c" :url "http://emacs-session.sourceforge.net/" :keywords '("session" "session management" "desktop" "data" "tools")) diff --git a/elpa/session-20120510.1700/session.el b/elpa/session-20120510.1700/session.el deleted file mode 100644 index 2ecf526..0000000 --- a/elpa/session-20120510.1700/session.el +++ /dev/null @@ -1,1755 +0,0 @@ -;;; session.el --- use variables, registers and buffer places across sessions - -;; Copyright 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2010, 2011 -;; Free Software Foundation, Inc. -;; -;; Author: Christoph Wedler -;; Version: 2.3a (see also `session-version' below) -;; Package-Version: 20120510.1700 -;; Keywords: session, session management, desktop, data, tools -;; X-URL: http://emacs-session.sourceforge.net/ - -;; 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 Licence, 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 . - -;;; Commentary: - -;; When you start Emacs, package Session restores various variables (e.g., -;; input histories) from your last session. It also provides a menu -;; containing recently changed/visited files and restores the places (e.g., -;; point) of such a file when you revisit it. - -;; For details, check or, if you prefer -;; the manual style, the documentation of functions \\[session-save-session] -;; and `session-store-buffer-places'. - -;; Bug fixes, bug reports, improvements, and suggestions for the newest version -;; are strongly appreciated. - -;;; To-do: - -;; One could imaging a combination of desktop.el and session.el. IMHO it is -;; easier to include the remaining features of desktop.el (load some files at -;; startup) into session.el, but desktop.el is already part of Emacs... -;; Anyway, here are some ideas for the combined desktop/session: -;; -;; * Using contexts for buffer positions (idea from bookmark and vc). -;; * Define common code with bookmark to restore buffers from a -;; file-representation (for files, dired, info buffers). -;; * Saving window-configurations? - -;;; Installation, private: - -;; 1. Make sure to use Emacs-20.2, XEmacs-20.2 or higher. -;; 2. Put this file into your load-path, i.e. any directory mentioned in the -;; value of `load-path'. -;; 3. Byte-compile this file. -;; 4. Load this package by M-x load-library RET session RET -;; 5. Start customization with M-x customize-group RET session RET or the -;; menu [Options][Customize...]...[Data][Session]. -;; 6. Toggle the [Session Use Package] option to "in use". -;; 7. Save your customization via [Save for future sessions]. -;; 8. If you use both this package and desktop.el, customize the variable -;; `desktop-globals-to-save' to include only the symbol -;; `desktop-missing-file-warning'. - -;; Remark: adding some code to your ~/.emacs like in previous versions of -;; session.el still works. - -;;; Installation, system- or distribution-wide: - -;; The idea here should be to offer new defaults to your users (like using this -;; package), while allowing them to choose otherwise. This is probably best -;; done by defining a custom theme (you probably add other customizations to -;; the custom theme file as well, custom themes might only work with newer -;; Emacsen): - -;; 1. Like 1-3 in the private installation instruction. -;; 2. Create the autoloads and custom-loads for session.el and make sure that -;; they are loaded at Emacs startup. You can do it manually by adding the -;; code below to your site.start.el. -;; 3. Define a custom theme like `our-custom' by adding a file called -;; "our-custom-theme.el" with the code below to a directory in the -;; load-path. -;; 4. Enable your custom theme by adding the code below to your default.el. -;; 5. Tell your users that they can disable this package by customizing the -;; user option according to 5-7 in the private installation instruction or -;; by setting `inhibit-default-init' to t. - -;; ;; site-start.el, Emacs: -;; (autoload 'session-jump-to-last-change "session" nil t) -;; (autoload 'session-initialize "session" nil t) -;; (eval-after-load "cus-load" -;; '(progn (custom-add-load 'data 'session) -;; (custom-add-load 'session 'session))) - -;; ;; site-start.el, XEmacs: -;; (autoload 'session-jump-to-last-change "session" nil t) -;; (autoload 'session-initialize "session" nil t) -;; (custom-add-load 'data 'session) -;; (custom-add-load 'session 'session) - -;; ;; our-custom-theme.el, Emacs and XEmacs: -;; (deftheme our-custom "Created 2011-01-15.") -;; (custom-theme-set-variables -;; 'our-custom -;; '(session-use-package t nil (session))) -;; (provide-theme 'our-custom) - -;; ;; default.el, Emacs: -;; (enable-theme 'our-custom) - -;; ;; default.el, XEmacs: -;; (require-theme 'our-custom) - -;;; Installation, integration of other packages - -;;(defun my-org-reveal-session-jump () -;; (when (and (eq major-mode 'org-mode) -;; (outline-invisible-p)) -;; (org-reveal))) -;;(add-hook 'session-after-jump-to-last-change-hook 'my-org-reveal-session-jump) - -;;; Code: - -(provide 'session) -(require 'custom) - -;; General Emacs/XEmacs-compatibility compile-time macros -(eval-when-compile - (require 'cl) - (defmacro cond-emacs-xemacs (&rest args) - (cond-emacs-xemacs-macfn - args "`cond-emacs-xemacs' must return exactly one element")) - (defun cond-emacs-xemacs-macfn (args &optional msg) - (if (atom args) args - (and (eq (car args) :@) (null msg) ; (:@ ...spliced...) - (setq args (cdr args) - msg "(:@ ....) must return exactly one element")) - (let ((ignore (if (string-match "XEmacs" emacs-version) :EMACS :XEMACS)) - (mode :BOTH) code) - (while (consp args) - (if (memq (car args) '(:EMACS :XEMACS :BOTH)) (setq mode (pop args))) - (if (atom args) - (or args (error "Used selector %s without elements" mode)) - (or (eq ignore mode) - (push (cond-emacs-xemacs-macfn (car args)) code)) - (pop args))) - (cond (msg (if (or args (cdr code)) (error msg) (car code))) - ((or (null args) (eq ignore mode)) (nreverse code)) - (t (nconc (nreverse code) args)))))) - ;; Emacs/XEmacs-compatibility `defun': remove interactive "_" for Emacs, use - ;; existing functions when they are `fboundp', provide shortcuts if they are - ;; known to be defined in a specific Emacs branch (for short .elc) - (defmacro defunx (name arglist &rest definition) - (let ((xemacsp (string-match "XEmacs" emacs-version)) reuses first) - (while (memq (setq first (car definition)) - '(:try :emacs-and-try :xemacs-and-try - :emacs-only :xemacs-only)) - (if (memq first (if xemacsp - '(:xemacs-and-try :xemacs-only) - '(:emacs-and-try :emacs-only))) - (setq reuses (cadr definition) - definition nil) - (unless (memq first '(:emacs-only :xemacs-only)) - (push (cadr definition) reuses))) - (setq definition (cddr definition))) - (if (and reuses (symbolp reuses)) - `(defalias ',name ',reuses) - (let* ((docstring (if (stringp (car definition)) (pop definition))) - (spec (and (not xemacsp) - (eq (car-safe (car definition)) 'interactive) - (null (cddar definition)) - (cadar definition)))) - (if (and (stringp spec) - (not (string-equal spec "")) - (eq (aref spec 0) ?_)) - (setq definition - (cons (if (string-equal spec "_") - '(interactive) - `(interactive ,(substring spec 1))) - (cdr definition)))) - (if (null reuses) - `(defun ,name ,arglist ,docstring - ,@(cond-emacs-xemacs-macfn definition)) - ;; no dynamic docstring in this case - `(eval-and-compile ; no warnings in Emacs - (defalias ',name - (cond ,@(mapcar (lambda (func) `((fboundp ',func) ',func)) - (nreverse reuses)) - (t ,(if definition - `(lambda ,arglist ,docstring - ,@(cond-emacs-xemacs-macfn definition)) - 'ignore))))))))))) - -(eval-when-compile - (defvar put-buffer-names-in-file-menu) - (defvar menu-bar-files-menu) - (defvar yank-menu) - (defvar minibuffer-local-ns-map)) - - - -;;;;########################################################################## -;;;; User options, configuration variables -;;;;########################################################################## - - -(defconst session-version "2.3a" - "Current version of package session. -Check for the newest.") - - -;;;=========================================================================== -;;; Customization and initialization -;;;=========================================================================== - -(defgroup session nil - "Use variables, registers and buffer places across sessions." - :group 'data - :link '(emacs-commentary-link "session.el") - :link '(url-link "http://emacs-session.sourceforge.net/") - :prefix "session-") - -(defgroup session-globals nil - "Which variables and registers to save across sessions." - :group 'session - :prefix "session-") - -(defgroup session-places nil - "Which places are stored for which buffers." - :group 'session - :prefix "session-") - -(defgroup session-miscellaneous nil - "Miscellaneous configurations of package session." - :group 'session - :prefix "session-") - -(defcustom session-initialize t - "Whether/what to initialize with function `session-initialize'. -If t, do full initialization. Otherwise, the value should be a list -with element. To enable, include - - * `de-saveplace' to de-install package saveplace (is redundant), - * `session' to load and save the session file, - * `places' to store and use places for files/buffers, - * `keys' to setup the default key and mouse bindings, - * `menus' to setup the menus." - :group 'session-miscellaneous - :type '(choice (const :tag "All" t) - (set :value (de-saveplace session places keys menus) - (const :tag "De-install saveplace" de-saveplace) - (const :tag "Load/Save Session" session) - (const :tag "Store/Use Places" places) - (const :tag "Setup Key/Mouse Bindings" keys) - (const :tag "Setup Menus" menus)))) - - -;;;=========================================================================== -;;; User Options and Configuration: Menu -;;;=========================================================================== - -(defcustom session-menu-max-size 36 - "*Max number of entries which may appear in the session menus." - :group 'session-miscellaneous - :type 'integer) - -(defcustom session-file-menu-max-string - (if (if (boundp 'put-buffer-names-in-file-menu) - put-buffer-names-in-file-menu ; XEmacs - nil) ; Emacs: no buffer names in file menu - (cons 50 20) - 50) - "*Max length of strings in submenus of the File menu. -Value has the form MAX or (MAX . NAME-THRESHOLD). If the second form is -used and the length returned by `buffer-name' is longer than -NAME-THRESHOLD, the maximum length will be shortened accordingly. - -Deprecated: a negative number -MAX stands for (MAX . 0)." - :group 'session-miscellaneous - :type '(choice (cons (integer :tag "Max. length" 50) - (integer :tag "Name threshold" 20)) - (integer 50))) - -(defcustom session-edit-menu-max-string 50 - "*Max length of strings in submenus of the Edit menu. -See also `session-compact-yank-gap-regexp'. - -When running under Emacs, customize `yank-menu-length' instead." - :group 'session-miscellaneous - :type 'integer) - -(defcustom session-compact-yank-gap-regexp "\\(\n\\|[ \t][ \t][ \t]\\)[ \t\n]*" - "*Regexp used when trying to find a gap in a long compact string. -If non-nil, leading and trailing whitespaces are not shown, and we try -to find a gap consisting matched by this regexp if we have to split the -string according to `session-edit-menu-max-string'. - -This variable has no effect when running under Emacs." - :group 'session-miscellaneous - :type 'string) - -(defcustom session-menu-permanent-string " *" - "*Marker for permanent files in menu \"File >> Open...recently changed\". -A file can set as permanent with prefix argument 3 for a command in -`session-kill-buffer-commands'. It can be set as non-permanent with -prefix argument -1." - :group 'session-miscellaneous - :type 'string) - -;; TODO: not quite sure whehter this is needed anymore - and if whether -;; it is the best way to exclude certain files. Other options are: -;; based on directory, file name, mode, calling command -(defcustom session-set-file-name-exclude-regexp - "[/\\]\\.overview\\|[/\\]\\.session\\|News[/\\]" - "*Regexp matching file names not to be stored in `file-name-history'. -This is used by `session-set-file-name-history'. Value nil means, do -not exclude any file." - :group 'session-miscellaneous - :type '(choice (const nil) regexp)) - -(defvar session-menu-accelerator-support - (and (featurep 'menu-accelerator-support) - (fboundp 'submenu-generate-accelerator-spec) - 'submenu-generate-accelerator-spec) - "Function to generate menu accelerators, or nil if not supported.") - -;; calling `abbrev-file-name' on remote files opens the connection! -(defvar session-abbrev-inhibit-function -;; this will be renamed with the next release (when minimum is -;; Emacs-22.1, jun 2007 and XEmacs 21.4.12, jan 2003) -> only there we have -;; `define-obsolete-variable-alias' - (cond ((fboundp 'file-remote-p) 'file-remote-p) - ;; `file-remote-p' doesn't exist in Emacs < 22.1 - ((fboundp 'efs-ftp-path) 'efs-ftp-path) - ((fboundp 'ange-ftp-ftp-name) 'ange-ftp-ftp-name) - ((fboundp 'ange-ftp-ftp-path) 'ange-ftp-ftp-path)) - "Function used to determine whether to abbreviate file name. -A file name is not abbreviated if this function returns non-nil when -called with the file name.") - -(defvar session-directory-sep-char ; directory-sep-char is not set - (if (memq system-type '(ms-dos windows-nt)) ?\\ ?\/) - "Directory separator character for session menus.") - -(defvar session-save-file-coding-system - (cond-emacs-xemacs - :EMACS 'iso-latin-1-with-esc - ;; used `emacs-mule' but this fails with X-Symbol characters... - :XEMACS (and (featurep 'mule) 'escape-quoted)) - "Coding system to use when writing `session-save-file' if non-nil.") - - -;;;=========================================================================== -;;; User Options and Configuration: save global variables between sessions -;;;=========================================================================== - -(defcustom session-globals-max-size 50 - "*Maximal number of elements in the global variables. -Global variables are only saved if they are non-empty lists. This value -can be shadowed by some element in `session-globals-include'. If an -element appears more than once in the list, only the first appearance -will be stored." - :group 'session-globals - :type 'integer) - -(defcustom session-globals-max-string 1024 - "*Maximal length of string elements in global variables." - :group 'session-globals - :type 'integer) - -(defcustom session-registers-max-string 1024 - "*Maximal length of string elements in registers." - :group 'session-globals - :type 'integer) - -(defcustom session-save-file - (expand-file-name ".session" - (cond ((boundp 'user-emacs-directory) user-emacs-directory) - ((boundp 'user-init-directory) user-init-directory) - (t "~"))) - "File to save global variables and registers into. -It is saved with coding system `session-save-file-coding-system' at the -end of an Emacs session and loaded at the beginning. Used for variables -which are typically changed by editing operations, e.g., history and -ring variables. See \\[session-save-session] for details." - :group 'session-globals - :type 'file) - -(defvar session-old-save-file (expand-file-name ".session" "~") - "Value of `session-save-file' before Version 2.3 of this package.") - -(defvar session-save-print-spec '(t 2 1024) - ;; only for advanced users -> no custom - "*Print specification for the values of global variables to save. -The value looks like (CIRCLE LEVEL LENGTH) and is used to bind variables -`print-circle', `print-circle' and `print-circle' when evaluating -`session-save-session'.") - -(defcustom session-save-file-modes 384 - "Mode bits of session save file, as an integer, or nil. -After writing `session-save-file', set mode bits of that file to this -value if it is non-nil." - :group 'session-globals - :type '(choice (const :tag "Don't change" nil) integer)) - -(defvar session-before-save-hook nil - "Hook to be run before `session-save-file' is saved. -The functions are called after the global variables are written, -directly before the file is actually saved.") - -(defvar session-after-load-save-file-hook - (cond-emacs-xemacs - :EMACS (and (default-boundp 'yank-menu) - (fboundp 'menu-bar-update-yank-menu) - '(session-refresh-yank-menu))) - "Hook to be run after `session-save-file' has been loaded. -The functions are called when the file has been successfully loaded.") - -(defcustom session-globals-regexp "-\\(ring\\|history\\)\\'" - "Regexp matching global variables to be saved between sessions. -Variables in `session-globals-exclude' are not saved, but variables in -`session-globals-include' are always saved." - :group 'session-globals - :type 'regexp) - -(defcustom session-globals-exclude - '(load-history - register-alist vc-comment-ring flyspell-auto-correct-ring org-mark-ring - planner-browser-file-display-rule-ring) - "Global variables not to be saved between sessions. -It affects `session-globals-regexp' and `session-globals-include'." - :group 'session-globals - :type '(repeat variable)) - -(defcustom session-globals-include '((kill-ring 10) - (session-file-alist 100 t) - (file-name-history 200) - search-ring regexp-search-ring) - "Global variables to be saved between sessions. -Each element has one of the following forms: - NAME, - (NAME MAX-SIZE), or - (NAME MAX-SIZE ASSOC-P). -where NAME is the symbol name of the variable, whose value must be a -non-empty list and string elements in this list must be smaller than -`session-globals-max-string'. MAX-SIZE (default is -`session-globals-max-size') is the maximal number of elements to be -saved for this symbol where only the first of equal elements are saved, -and ASSOC-P (default is nil) non-nil means that the variable is an alist -where the equality of elements is checked on the `car'. - -If MAX-SIZE or ASSOC-P is non-nil, it can be useful to include a -variable in this list even if it matches `session-globals-regexp'. -`session-globals-exclude' has no effect on these variables. - -Do not use this variable to customize your Emacs. Package custom is the -appropriate choice for this!" - :group 'session-globals - :type '(repeat (choice (variable :tag "List var with standard max size") - (list variable - (integer :tag "Max size") - (boolean :tag "Alist"))))) - - -;;;=========================================================================== -;;; Configuration: registers and local variables -;;;=========================================================================== - -(defcustom session-registers '((?0 . ?9) ?- ?= ?\\ ?` region (?a . ?z)) - "*Registers to be saved in `session-save-file'. -Valid elements in this list are: - CHAR or (FROM . TO) or `file' or `region' or t. -CHAR is a register to save, (FROM . TO) represents a list of registers -from FROM to TO. `file' means, only save the following registers in -this list if they contain file or file-query references. `region' -means, only save registers if they contain a region which has less then -`session-registers-max-string' characters. t means, allow both content -types. Processing of this list starts with type `file'. - -Before saving the session files, markers in registers are turned into -file references, see variable `session-register-swap-out'." - :group 'session-globals - :type '(repeat (choice (const :tag "File registers:" file) - (const :tag "String registers:" region) - (const :tag "Any register type:" t) - (character :tag "Register") - (cons :tag "Registers" - (character :tag "From") - (character :tag "To"))))) - -(defcustom session-locals-include '(overwrite-mode) - "Local variables to be stored for specific buffers. -See also `session-locals-predicate'. - -Do not add variables to this list which are more appropriate for local -variables in files, i.e., variables which are related to the contents of -the file, e.g. `major-mode'!" - :group 'session-places - :type '(repeat variable)) - -(defcustom session-locals-predicate 'local-variable-p - "Function which must return non-nil for a local variable to be stored. -This function is called on all variables in `session-locals-include' -with the variable as the first and the current buffer as the second -argument. Good values are nil (do not store any variable), -`local-variable-p' for local variables, `local-variable-if-set-p' for -variables which become local when set, and t (store all variables in -`session-locals-include')." - :group 'session-places - :type '(choice (const :tag "none" nil) - (const :tag "All" t) - (function-item local-variable-p) - (function-item local-variable-if-set-p) - (function :tag "Other function"))) - -(defvar session-register-swap-out (if (fboundp 'register-swap-out) - 'register-swap-out - 'session-register-swap-out) - "Function processing markers in registers when a buffer is killed. -If non-nil, this function is added to `kill-buffer-hook'. Good values -are `register-swap-out' and the function `session-register-swap-out'.") - - -;;;=========================================================================== -;;; User Options and Configuration: buffer check--undo, mode+name -;;;=========================================================================== - -(defcustom session-jump-undo-threshold 240 - "*Number of character positions the undo position must be different. -Without prefix arg, `session-jump-to-last-change' jumps successively to -change positions which differ by at least `session-jump-undo-threshold' -characters compared to the current position and previously visited -change positions, see `session-jump-undo-remember'." - :group 'session-places - :type 'integer) - -(defcustom session-jump-undo-remember 2 - "*Number of previously visited change positions checked additionally. -See `session-jump-undo-threshold' and `session-jump-to-last-change'." - :group 'session-places - :type 'integer) - -(defvar session-after-jump-to-last-change-hook nil - "Hook to be after `session-jump-to-last-change' has been executed. -The functions are called if `point' has been moved.") - -;; Problem if homedir is a symlink (/bar/home -> /net/bar.home) & tmp-mounted -;; (file-truename "~/foo") => "/tmp_mnt/net/bar.home/foo" -;; (abbreviate-file-name "/tmp_mnt/net/bar.home/foo") => "/net/bar.home/foo" -;; I.e., there is a bug in `abbreviate-file-name' on both Emacs and XEmacs -;; (with 2nd arg t). Workaround: use the following in your ~/.emacs: - -;;(unless (string= (abbreviate-file-name (file-truename "~") t) "~") ; XEmacs -;; (setq abbreviated-home-dir -;; (let ((abbreviated-home-dir "$foo")) -;; (concat "\\`\\(?:" -;; (regexp-quote (abbreviate-file-name (expand-file-name "~"))) -;; "\\|" -;; (regexp-quote (abbreviate-file-name (file-truename "~"))) -;; "\\)\\(/\\|\\'\\)")))) - -(defconst session-use-truenames-default - (cond-emacs-xemacs - :EMACS (string= (abbreviate-file-name (file-truename "~")) "~") - :XEMACS (and (string= (abbreviate-file-name (file-truename "~") t) "~") - (if (eq system-type 'windows-nt) - 'session-xemacs-buffer-local-mswindows-file-p - t)))) - -(defcustom session-use-truenames session-use-truenames-default - "*Whether to use the canonical file names when saving/restoring places. -If a function, it is called with no argument and returns whether to use -the canonical names of files. If non-nil, store and check file names -returned by `file-truename'." - :group 'session-places - :type '(choice (const :tag "No" nil) - (const :tag "Yes" t) - (function-item :tag "If not starting with \\\\" - session-xemacs-buffer-local-mswindows-file-p) - (function :tag "Other function"))) - -(defcustom session-auto-store t - "*Determines whether a buffer to be killed passes the mode/name check. -This boolean is used by `session-default-buffer-check-p', see -`session-buffer-check-function'. - -A buffer passes the mode/name check, if it passes the mode check, see -below, and its file name is not matched by -`session-name-disable-regexp', or if fails the mode check and its file -name is matched by `session-name-enable-regexp'. - -A buffer passes the mode check, if this variable is non-nil and its -major mode is not a member of `session-mode-disable-list', or if this -variable is nil and its major mode is a member of -`session-mode-enable-list'." - :group 'session-places - :type 'boolean) - -(defcustom session-undo-check 1 - "*Determines how a buffer to be killed passes the undo check. -Its value is MIN or (MIN . LAST) where MIN is a number. Used by -`session-default-buffer-check-p', see `session-buffer-check-function'. - -To pass the undo check - * the length of `buffer-undo-list', assumed to be -1 if no undo - information is recorded, must be higher or equal to MIN, - * the first form is used or LAST is nil: no further requirement - * LAST is `and': additionally, `session-last-change' must be non-nil, - i.e., the buffer has been changed previously, - * LAST is `or': alternatively, `session-last-change' is non-nil." - :group 'session-places - :type '(choice (integer :tag "Min no of Changes") - (cons (integer :tag "Min no of Changes") - (choice :tag "Previous and New Changes" - (const :tag "Only consider New Changes" nil) - (const :tag "AND previously changed" and) - (const :tag "OR previously changed" or))))) - -(defcustom session-kill-buffer-commands '(kill-this-buffer) - "*Commands which kill a buffer. -If a prefix argument was provided to any of these commands, it will -influence the decision whether to store places for the buffer, see -`session-store-buffer-places'. Using commands which use the minibuffer -for input, is useless." - :group 'session-places - :type '(repeat (function :tag "Command"))) - -(defcustom session-buffer-check-function 'session-default-buffer-check-p - "Function which return non-nil if buffer places should be stored. -Used by `session-store-buffer-places'. This function is called with the -buffer to check as argument. You can also assume that the current -buffer is the buffer to check. - -The default value `session-default-buffer-check-p' returns non-nil, if -the buffer - * visits an existing readable file, - * passes the mode/name check, see `session-auto-store', and - * passes the undo check, see `session-undo-check', its default value 1 - means: the buffer must have been changed during the session." - :group 'session-globals - :type '(choice (function-item :tag "Default check" - session-default-buffer-check-p) - (function :tag "Other function"))) - -(defcustom session-mode-disable-list - '(vm-mode gnus-score-mode message-mode tar-mode) - "*Major modes of buffers for which no places are stored. -See `session-buffer-check-function'." - :group 'session-globals - :type '(repeat (function :tag "Major mode"))) - -(defcustom session-mode-enable-list nil - "*Major modes of buffers for which places are stored. -See `session-buffer-check-function'." - :group 'session-globals - :type '(repeat (function :tag "Major mode"))) - -(defcustom session-name-disable-regexp - (concat "\\`" (regexp-quote - (if (fboundp 'temp-directory) (temp-directory) "/tmp"))) - "*File names of buffers for which no places are stored. -See `session-buffer-check-function'." - :group 'session-places - :type '(choice (const nil) regexp)) - -(defcustom session-name-enable-regexp nil - "*File names of buffers for which places are stored. -See `session-buffer-check-function'." - :group 'session-places - :type '(choice (const nil) regexp)) - - - - -;;;;########################################################################## -;;;; Store buffer places and local variables, change register contents -;;;;########################################################################## - - -(defvar session-last-change nil - "Position of last change in current buffer. -This variable is set by `session-find-file-hook' if the buffer was -changed in a previous session. It can also be set by providing an -prefix argument to `session-jump-to-last-change'.") -(make-variable-buffer-local 'session-last-change) - -(defvar session-file-alist nil - "Alist for places and local variables for some files. -It has the form - (NAME POINT MARK POINT-MIN POINT-MAX PERMANENT LAST-CHANGE - (SYMBOL . VAR) ...) - -NAME is the file name, POINT is the point position, MARK is the mark -position, POINT-MIN and POINT-MAX determine the narrow part if non-nil, -PERMANENT is the permanent marker (see `session-buffer-check-function'), -LAST-CHANGE is the position of the last change in the previous session -or was explicitly set with prefix argument 0 for command -\\[session-jump-to-last-change]. Optional pairs (SYMBOL . VAR) are -local variables with their values.") - -(defvar session-jump-to-last-change-counter 0 - "Number of repeated invocations of `session-jump-to-last-change'.") - -(defvar session-jump-to-last-change-recent nil - "Current position and previously visited change positions.") - - -;;;=========================================================================== -;;; Position of last change -;;;=========================================================================== - -(defun session-undo-position (num pos1 pos2) - "Return a previous undo-position or set it. -If argument NUM is nil, set `session-last-change' to the recomputed -position given by argument POS1 and return POS1 normalized. - -Otherwise, return a previous undo-position or nil, if no such position -can be found. If `session-jump-to-last-change-counter' is nil, the -position found is the stored last-change position. - -If POS1 and POS2 are nil, NUM is the number of undo-boundaries to skip. -The position returned is the last change inside the corresponding undo -step. - -Otherwise, NUM is the number of undo entries to skip. The position -returned is the last change after these entries outside the range from -POS1 to POS2. Increment `session-jump-to-last-change-counter' by the -number of entries skipped additionally." - (let ((undo-list (and (consp buffer-undo-list) buffer-undo-list)) - elem ; element in undo-list, t = not of interest - back-list ; used position must be recomputed due to processed elems - len ; length of deletion/insertion - pos) ; interesting position in undo-list - (while (and undo-list (null (car undo-list))) - (pop undo-list)) ; ignore undo-boundaries at beg - (while undo-list - ;; inspect element in undo-list ---------------------------------------- - (setq elem (pop undo-list)) - (cond ((atom elem) ; marker position - (when (or elem pos1) ; undo-boundary is of interest if POS1=nil - (if (integerp elem) - (setq pos elem ; use point position in undo-list - back-list (cons nil back-list)) - (setq elem t)))) ; ignore uninteresting elem - ((stringp (car elem)) ; deletion: (TEXT . POSITION) - (setq pos (abs (cdr elem)) - len (length (car elem))) - (push (list* pos (+ pos len) (- len)) back-list) - (when pos1 ; adopt POS{1,2} if after deletion - (if (> pos1 pos) (incf pos1 len)) - (if (>= pos2 pos) (incf pos2 len)))) - ((integerp (car elem)) ; insertion: (START . END) - (setq pos (car elem) - len (- (cdr elem) pos)) - (push (list* pos pos len) back-list) - (when pos1 ; adopt POS{1,2} if after/in insertion - (if (> pos1 pos) - (setq pos1 (if (> pos1 (cdr elem)) (- pos1 len) pos))) - (if (> pos2 pos) - (setq pos2 (if (> pos2 (cdr elem)) (- pos2 len) pos)))) - (setq pos (cdr elem))) ; point more likely at end of insertion - (t - (setq elem t))) - ;; evaluation element inspection --------------------------------------- - (cond ((null num)) ; set POS1 as `session-last-change' - ((null pos1) ; looking for undo-boundaries - (when (if elem - (and (zerop num) pos) - (<= (decf num) 0)) - (setq undo-list nil))) - ((eq elem t) ; uninteresting element - (setq pos nil)) - ((> num 0) ; interesting, but not the NUM's one - (decf num) - (setq pos nil)) - ((and (<= pos1 pos) (<= pos pos2)) ; inside start region - (incf session-jump-to-last-change-counter) - (setq pos nil)) - (t - (setq undo-list nil)))) - ;; finalize: evaluate result and process back-list ----------------------- - (cond ((null num) ; set POS1 as `session-last-change' - (setq session-last-change pos1 - pos session-last-change)) - ((or (null pos) (> num 0)) ; no position found in undo-list - (setq session-jump-to-last-change-counter nil) - (setq pos session-last-change)) - (t ; pos in undo-list - (if session-jump-to-last-change-counter - (incf session-jump-to-last-change-counter)) - (setq back-list (cdr back-list)))) - (when pos - (while back-list - (setq elem (pop back-list)) - (cond ((null elem)) ; integer position in undo-list - ((> pos (cadr elem)) ; position after affected region - (incf pos (cddr elem))) ; increment/decrement position - ((> pos (car elem)) ; position in affected region - (setq pos (car elem))))) ; set position to region begin - pos))) - -;;;###autoload -(defun session-jump-to-last-change (&optional arg) - "Jump to the position of the last change. -Without prefix arg, jump successively to previous change positions which -differ by at least `session-jump-undo-threshold' characters by repeated -invocation of this command. With prefix argument 0, jump to end of last -change. With numeric prefix argument, jump to start of first change in -the ARG's undo block in the `buffer-undo-list'. - -With non-numeric prefix argument (\\[universal-argument] only), set -point as oldest change position. It might change slightly if you jump -to it due to intermediate insert/delete elements in the -`buffer-undo-list'." - ;; note: for compatibility reasons (pre v2.2), we use abs(ARG) - (interactive "P") - (if (consp arg) - (let ((pos (session-undo-position nil (point) (point))) - (undo-list (and (consp buffer-undo-list) buffer-undo-list))) - (setq arg 1) - (while (and undo-list (null (car undo-list))) (pop undo-list)) - (while undo-list (or (pop undo-list) (incf arg))) - (message "Store %d as special last-change position (%s %d %s)" - pos - (substitute-command-keys "\\[universal-argument]") - arg - (substitute-command-keys "\\[session-jump-to-last-change]"))) - ;; set and restrict previously visited undo positions -------------------- - (push (point) session-jump-to-last-change-recent) - (if (and (null arg) (eq last-command 'session-jump-to-last-change-seq)) - (let ((recent (nthcdr session-jump-undo-remember - session-jump-to-last-change-recent))) - (if recent (setcdr recent nil))) - (setcdr session-jump-to-last-change-recent nil) ; only point - (setq session-jump-to-last-change-counter 0)) - (let (pos) - (if arg - (setq pos (session-undo-position (abs (prefix-numeric-value arg)) - nil nil)) - ;; compute position, compare it with positions in - ;; `session-jump-to-last-change-recent' - (let ((recent session-jump-to-last-change-recent) old pos1 pos2) - (setq pos (point)) - (while recent ; at least point is there - (setq old (pop recent)) - (setq pos1 (- pos session-jump-undo-threshold) - pos2 (+ pos session-jump-undo-threshold)) - (when (and (<= pos1 old) (<= old pos2)) - (setq pos (session-undo-position - session-jump-to-last-change-counter pos1 pos2)) - (setq recent (and pos - session-jump-to-last-change-counter - session-jump-to-last-change-recent)))))) - (cond ((null pos) - (message (if (or arg (atom buffer-undo-list)) - "Do not know position of last change" - "Do not know position of last distant change"))) - ((< pos (point-min)) - (goto-char (point-min)) - (message "Change position outside visible region")) - ((> pos (point-max)) - (goto-char (point-max)) - (message "Change position outside visible region")) - (t - (goto-char pos) - (cond ((null session-jump-to-last-change-counter) - (message "Jumped to stored last-change position")) - ((null arg) - (setq this-command 'session-jump-to-last-change-seq))) - (run-hooks 'session-after-jump-to-last-change-hook)))))) - - -;;;=========================================================================== -;;; Yank menu (Emacs: refresh existing menu, XEmacs: do our own) -;;;=========================================================================== - -;; this function should be defined in menu-bar.el... -(defunx session-refresh-yank-menu () - :xemacs-only ignore - "Refresh `yank-menu' according to `kill-ring'." - (when (and (default-boundp 'yank-menu) - (fboundp 'menu-bar-update-yank-menu)) - (let ((killed (reverse (default-value 'kill-ring)))) - (while killed - (menu-bar-update-yank-menu (pop killed) nil))))) - -(defun session-yank (arg) - "Reinsert the last stretch of killed text, like \\[yank]. -Calls `yank' with argument ARG and with `interprogram-paste-function' -bound to nil." - (interactive "*p") - (let ((interprogram-paste-function nil)) ;#dynamic - (yank arg))) - -(defun session-popup-yank-menu (event) - ;; checkdoc-params: (event) - "Pop up a menu for inserting items in `kill-ring'." - (interactive "e") - (when kill-ring - (setq this-command last-command) - (popup-menu '("Select and Paste" - :filter session-yank-menu-filter)))) - -(defun session-yank-menu-filter (menu-items) - ;; checkdoc-params: (menu-items) - "Return a menu for inserting items in `kill-ring'." - (let ((menu nil) - (ring nil) - (max session-menu-max-size) - (len (length kill-ring)) - (half-str-len (/ (- session-edit-menu-max-string 4) 2)) - (i 0) - (active (not buffer-read-only)) - elem - (interprogram-paste-function nil)) ;#dynamic - ;; Traversing (append kill-ring-yank-pointer kill-ring) instead indexing - ;; (current-kill INDEX) would be probably more efficient, but would be a - ;; very low-level hack - (while (and (< i len) (> max 0)) - (setq elem (current-kill i t) - i (1+ i)) - (unless (or (assoc elem ring) (string-match "\\`[ \t\n]*\\'" elem)) - (push (cons elem i) ring) - (setq max (1- max)))) - (while ring - (setq elem (car ring) - ring (cdr ring)) - (push (session-yank-string (car elem) half-str-len - (list 'session-yank (cdr elem)) - active) - menu)) - (session-menu-maybe-accelerator menu-items menu))) - -(defun session-yank-string (string half-len-str callback active) - ;; checkdoc-order: nil - "Return menu item STRING with callback CALLBACK. -If ACTIVE is non-nil, the item is active. HALF-LEN-STR is the length of -the two parts of a abbreviated menu item name." - (let ((beg (or (and session-compact-yank-gap-regexp - (string-match "\\`[ \t\n]+" string) - (match-end 0)) - 0)) - (end (or (and session-compact-yank-gap-regexp - (string-match "[ \t\n]+\\'" string)) - (length string)))) - (vector (if (> (- end beg) session-edit-menu-max-string) - (let ((gap (and session-compact-yank-gap-regexp - (string-match session-compact-yank-gap-regexp - string (- end half-len-str)) - (match-end 0)))) - (if (and gap (< gap (- end 3))) - (setq half-len-str (- (+ half-len-str half-len-str gap) - end)) - (setq gap (- end half-len-str))) - (concat (session-subst-char-in-string - ?\t ?\ (substring string beg (+ beg half-len-str)) t) - " ... " - (session-subst-char-in-string - ?\t ?\ (substring string gap end) t))) - (session-subst-char-in-string - ?\t ?\ (substring string beg end) t)) - callback - active))) - -;; from EMACS-20.4/lisp/subr.el: -(defunx session-subst-char-in-string (fromchar tochar string &optional inplace) - :try subst-char-in-string - "Replace FROMCHAR with TOCHAR in STRING each time it occurs. -Unless optional argument INPLACE is non-nil, return a new string." - (let ((i (length string)) - (newstr (if inplace string (copy-sequence string)))) - (while (> i 0) - (setq i (1- i)) - (if (eq (aref newstr i) fromchar) - (aset newstr i tochar))) - newstr)) - - -;;;=========================================================================== -;;; Menu filters -;;;=========================================================================== - -(defun session-file-opened-recompute () - "Move file name of all live buffers to top of the menu of visited files." - (interactive) - (session-file-changed-recompute t)) - -(defun session-file-changed-recompute (&optional for-opened) - "Store buffer places for all live buffers. -Works like \\[session-file-opened-recompute] if FOR-OPENED is non-nil." - (interactive) - (let ((session-use-package t)) ;#dynamic - (save-excursion - (dolist (buffer (nreverse (buffer-list))) - (set-buffer buffer) - (when buffer-file-name - (condition-case nil ; potential errors with remote files - (if for-opened - (session-set-file-name-history) - (session-store-buffer-places 1)) - (error nil))))))) - -(defun session-file-opened-menu-filter (menu-items) - ;; checkdoc-params: (menu-items) - "This is the menu filter for \"File >> Open...recently visited\". -See `session-file-changed-menu-filter'." - (session-file-changed-menu-filter menu-items file-name-history)) - -(defun session-file-changed-menu-filter (menu-items &optional files find-fn) - ;; checkdoc-params: (menu-items) - "This is the menu filter for \"File >> Open...recently changed\". -It dynamically creates a list of files to use as the contents of the -menu. The files are taken from FILES or `session-file-alist'. It -doesn't show the same name twice and shows `session-menu-max-size' names -at most. FIND-FN or \\[find-file] is the function to use when selecting -a file in the menu." - (or files (setq files session-file-alist)) - (or find-fn (setq find-fn 'session-find-file)) - (let ((excl nil) - (menu nil) - (i session-menu-max-size) - (max-string (max (cond ((natnump session-file-menu-max-string) - session-file-menu-max-string) - ((integerp session-file-menu-max-string) - (- 0 session-file-menu-max-string - (length (buffer-name)))) - ((consp session-file-menu-max-string) - (- (car session-file-menu-max-string) - (max (- (length (buffer-name)) - (cdr session-file-menu-max-string)) - 0))) - (t 50)) - 16))) - (while (and files (> i 0)) - (let ((name (pop files)) desc) - (when (consp name) - (setq desc name - name (car name))) - (setq name (session-abbrev-file-name (directory-file-name name))) - (unless (member name excl) - (setq i (1- i)) - (push name excl) - (push (vector (or (session-file-prune-name name max-string) name) - (list find-fn name) - :keys (concat (and (sixth desc) "p") - (let ((buf (get-file-buffer name))) - (when buf - (with-current-buffer buf - (if (consp buffer-undo-list) - (if (buffer-modified-p) - "c" "s") - (if buffer-read-only - "r" "v"))))))) - menu)))) - (session-menu-maybe-accelerator menu-items (nreverse menu)))) - -(defun session-file-prune-name (elem max-string) - "Prune name f menu entry ELEM to use a miximum string length MAX-STRING." - (when (> (length elem) max-string) - (let* ((sep-string (char-to-string session-directory-sep-char)) - (components (split-string elem (regexp-quote sep-string)))) - (or (cdr components) ; successful split - (eq session-directory-sep-char ?\/) ; already Unix separator - (setq sep-string "/" - components (split-string elem (regexp-quote sep-string)))) - (let* ((prefix (if (< (length (car components)) 3) ; e.g. "~" or "C:" - (concat (pop components) sep-string - (pop components)) - (pop components))) - (len (+ (length prefix) 7)) ; "/ ... /" - postfix) - (when (cdr components) ; more than one remaining dir component - (setq components (nreverse components)) - (incf len (length (car components))) - (push (pop components) postfix) ; always use last one - (while (<= (incf len (1+ (length (car components)))) max-string) - (push (pop components) postfix)) - (concat prefix sep-string " ... " sep-string - (mapconcat 'identity postfix sep-string))))))) - -(defun session-menu-maybe-accelerator (menu-items menu) - "Return menu consisting of items in MENU-ITEMS and MENU. -MENU-ITEMS have the usual format of elements in a menu, except that the -name always starts with a accelerator specification \"%_. \". Also, a -:keys specification will be evaluated if :keys is the first keyword. - -The items in MENU will be modified to add accelerator specifications if -`session-menu-accelerator-support' is non-nil." - (append menu-items - (if session-menu-accelerator-support - (funcall session-menu-accelerator-support menu) - menu))) - -(defun session-abbrev-file-name (name) - "Return a version of NAME shortened using `directory-abbrev-alist'. -This function does not consider remote file names (see -`session-abbrev-inhibit-function') and substitutes \"~\" for the user's -home directory." - (if (and session-abbrev-inhibit-function - (or (not (fboundp session-abbrev-inhibit-function)) - (funcall session-abbrev-inhibit-function name))) - name - (cond-emacs-xemacs (abbreviate-file-name name :XEMACS t)))) - - -;;;=========================================================================== -;;; Functions in hooks -;;;=========================================================================== - -(defun session-find-file (filename) - "Call \\[find-file] and add FILENAME to `file-name-history'." - ;; also sets history when just switching to existing buffer - (interactive "FFind file: ") - (find-file filename) - (let ((session-use-package t)) ;#dynamic - (session-set-file-name-history))) - -(defun session-set-file-name-history () - ;; TODO later: test `this-command' matching regexo "find-file" or similar - "Add file-name of current buffer to `file-name-history'. -Don't add the file name if it matches -`session-set-file-name-exclude-regexp', or if it is already at the front -of `file-name-history'. This function is useful in `find-file-hooks'." - (and session-use-package - buffer-file-name - (not (string= (car file-name-history) buffer-file-name)) - (not (string= (car file-name-history) buffer-file-truename)) -;; (file-exists-p buffer-file-name) (file-readable-p buffer-file-name) - (let ((name (session-abbrev-file-name buffer-file-name))) - (unless (and session-set-file-name-exclude-regexp - (string-match session-set-file-name-exclude-regexp name)) - (push name file-name-history))))) - -(defun session-find-file-hook () - "Function in `find-file-hooks'. See `session-file-alist'." - (unless (or (eq this-command 'session-disable) - (null session-use-package)) - (let* ((ass (assoc (session-buffer-file-name) session-file-alist)) - (point (second ass)) - (mark (third ass)) - (min (fourth ass)) - (max (fifth ass)) - (alist (nthcdr 7 ass))) - (condition-case nil - (while alist - (if (local-variable-if-set-p (caar alist) (current-buffer)) - (set (caar alist) (cdar alist))) - (setq alist (cdr alist))) - (error nil)) - (setq session-last-change (seventh ass)) - (and mark - (<= (point-min) mark) (<= mark (point-max)) - ;; I had `set-mark' but this function activates mark in Emacs, but - ;; not in XEmacs. `push-mark' is also OK and doesn't activate in - ;; both Emacsen which is better if we use `pending-delete-mode'. - (push-mark mark t)) - (and min max - (<= (point-min) min) (<= max (point-max)) - (narrow-to-region min max)) - (and point - (<= (point-min) point) (<= point (point-max)) - (goto-char point))))) - -(defun session-kill-buffer-hook () - "Function in `kill-buffer-hook'. -See `session-file-alist' and `session-registers'." - (if (and session-use-package buffer-file-name) - (let ((arg (if (memq this-command session-kill-buffer-commands) - (prefix-numeric-value current-prefix-arg) - 1))) - (condition-case nil - (if (> arg -2) - (session-store-buffer-places arg) - (setq file-name-history - (delete buffer-file-truename - (delete buffer-file-name file-name-history))) -;;; (setq session-file-alist -;;; (delete* (session-buffer-file-name) session-file-alist -;;; :key 'car :test 'string=))) ; Emacs CL policy... - (let ((fname (session-buffer-file-name)) - (alist (cons nil session-file-alist))) - (while (cdr alist) - (if (string= (cadr alist) fname) - (setcdr alist (cddr alist)) - (setq alist (cdr alist)))) - (setq session-file-alist (cdr alist)))) - (error nil))))) - - -;;;=========================================================================== -;;; Change register contents from marker to file -;;;=========================================================================== - -(defun session-register-swap-out () - "Turn markers in registers into file references when a buffer is killed. -See variable `session-register-swap-out'." - (and buffer-file-name - (let ((tail register-alist)) - (while tail - (and (markerp (cdr (car tail))) - (eq (marker-buffer (cdr (car tail))) (current-buffer)) - (setcdr (car tail) - (cons 'file buffer-file-name))) - (setq tail (cdr tail)))))) - - - -;;;;########################################################################## -;;;; Save global variables, add functions to hooks -;;;;########################################################################## - - -(defvar session-successful-p nil - "Whether the file `session-save-file' has been loaded successfully.") - - -;;;=========================================================================== -;;; The buffer file name -;;;=========================================================================== - -(defun session-xemacs-buffer-local-mswindows-file-p () - "Return t if the current buffer visits a local file on MS-Windows. -Also returns t if the current buffer does not visit a file. Return nil -of the current buffer visits a file starting with \"\\\\\". Workaround -for XEmacs bug in `file-truename' for file names starting with -\"\\\\\"." - (or (< (length buffer-file-name) 2) - (not (string= (substring buffer-file-name 0 2) "\\\\")))) - -(defun session-buffer-file-name () - "Return the buffer file name according to `session-use-truenames'." - (if (if (functionp session-use-truenames) - (funcall session-use-truenames) - session-use-truenames) - buffer-file-truename - buffer-file-name)) - - -;;;=========================================================================== -;;; Store places and local variables for buffer to be killed -;;;=========================================================================== - -(defun session-toggle-permanent-flag (arg &optional check) - "Toggle the permanent flag of the current buffer. -With ARG, set permanent flag if and only if ARG is positive. If the -permanent flag is set, the places are stored as well. If CHECK is -non-nil, just return the status of the permanent flag: either nil if it -is unset or `session-menu-permanent-string' if it is set." - (interactive "P") - (if buffer-file-name - (let ((permanent (if arg - (> (prefix-numeric-value arg) 0) - (not (nth 5 (assoc (session-buffer-file-name) - session-file-alist)))))) - (if check - (if permanent nil session-menu-permanent-string) - (session-store-buffer-places (if permanent 3 -1)) - (message (if permanent - "Permanent flag is set and places are stored" - "Permanent flag has been unset")))) - (if check nil (error "Buffer is not visiting a file")))) - -(defun session-store-buffer-places (arg) - "Store places and local variables in current buffer. -An entry for the current buffer and its places is added to the front of -`session-file-alist' if the buffer is visiting a file and if it is -mentioned in the list below. ARG is the prefix argument to a command in -`session-kill-buffer-commands' or 1 for any other command. - -ARG=-2: delete current buffer from `session-file-alist' (implemented - in `session-kill-buffer-hook') -ARG=-1: delete PERMANENT flag for buffer, -ARG=0: do nothing, -ARG=1: store buffer places, if the PERMANENT flag is set or the buffer - passes the function in `session-buffer-check-function', -ARG=2: always store buffer places, -ARG=3: set PERMANENT flag and store buffer places. - -See also `session-last-change' and `session-locals-include'. - -Note that not storing buffer places does not mean deleting an old entry -for the same file. It means that there is the danger of the entry -becoming too old to be saved across session. By default, only the first -100 entries of `session-file-alist' are saved, see -`session-globals-include'." - (let ((file-name (session-buffer-file-name))) - (when file-name - (let ((permanent (nthcdr 5 (assoc file-name session-file-alist)))) - (and (< arg 0) (car permanent) - (setcar permanent nil)) ; reset permanent in existing entry - (setq permanent (or (car permanent) (> arg 2))) - (if (or (and permanent (> arg 0)) - (> arg 1) - (and (= arg 1) - (funcall session-buffer-check-function (current-buffer)))) - (let ((locals session-locals-include) - (store nil)) - (while locals - (if (if (functionp session-locals-include) - (funcall session-locals-predicate - (car locals) (current-buffer)) - session-locals-predicate) - (push (cons (car locals) - (symbol-value (car locals))) - store)) - (setq locals (cdr locals))) - (setq store - (nconc (list file-name - (point) (mark t) - (point-min) - (and (<= (point-max) (buffer-size)) - (point-max)) - permanent - (session-undo-position 0 nil nil)) - store)) - (if (equal (caar session-file-alist) file-name) - (setcar session-file-alist store) - (push store session-file-alist)))))))) - -(defun session-find-file-not-found-hook () - "Query the user to delete the permanent flag for a non-existent file. -Always return nil." - (when session-use-package - (let ((file-name (session-buffer-file-name))) - (when file-name - (let ((permanent (nthcdr 5 (assoc file-name session-file-alist)))) - (and (car permanent) - (y-or-n-p "Delete permanent flag for non-existent file? ") - (setcar permanent nil))))))) - - -;;;=========================================================================== -;;; Default standard check for buffers to be killed -;;;=========================================================================== - -(defun session-default-buffer-check-p (buffer) - "Default function for `session-buffer-check-function'. -Argument BUFFER should be the current buffer." - (and - ;; undo check ------------------------------------------------------------- - (or (and (eq (cdr-safe session-undo-check) 'or) - session-last-change) - (and (or (not (eq (cdr-safe session-undo-check) 'and)) - session-last-change) - (>= (if (listp buffer-undo-list) (length buffer-undo-list) -1) - (if (consp session-undo-check) - (car session-undo-check) - session-undo-check)))) - ;; mode and name check ---------------------------------------------------- - (let ((file (buffer-file-name buffer))) - (and (or (and (fboundp session-abbrev-inhibit-function) - (funcall session-abbrev-inhibit-function file)) - (and (file-exists-p file) (file-readable-p file))) - (if (if session-auto-store - (not (memq major-mode session-mode-disable-list)) - (memq major-mode session-mode-enable-list)) - (not (and session-name-disable-regexp - (string-match session-name-disable-regexp file))) - (and session-name-enable-regexp - (string-match session-name-enable-regexp file))))))) - - -;;;=========================================================================== -;;; Save session file -;;;=========================================================================== - -(defun session-save-session (&optional force) - "Save session: file places, *-ring, *-history, registers. -Save some global variables and registers into file `session-save-file' -with coding system `session-save-file-coding-system'. Run functions in -`session-before-save-hook' before writing the file. - -See also `session-globals-regexp', `session-globals-include' and -`session-registers'. - -This function does not save the session if `session-use-package' is nil -and FORCE is nil. When called interactively, FORCE is non-nil. - -This command is automatically executed when exiting Emacs, except when -using \\[save-buffers-kill-emacs] with prefix argument 0." - (interactive "p") - (and (or force session-use-package) - session-save-file - (not (and (eq this-command 'save-buffers-kill-emacs) - (equal current-prefix-arg 0))) - (or session-successful-p - (not (file-exists-p session-save-file)) - (y-or-n-p "Overwrite old session file (not loaded)? ")) - (save-excursion - ;; `kill-emacs' doesn't kill the buffers ---------------------------- - (dolist (buffer (nreverse (buffer-list))) - (set-buffer buffer) - (when buffer-file-name - (condition-case nil ; potential errors with remote files - (session-store-buffer-places 1) - (error nil)) - (if session-register-swap-out - (funcall session-register-swap-out)))) - ;; create header of session file ------------------------------------ - (set-buffer (get-buffer-create " session ")) - (erase-buffer) - (let ((coding-system-for-write ;#dynamic - (and session-save-file-coding-system - (condition-case nil - (check-coding-system session-save-file-coding-system) - (error nil))))) - (when coding-system-for-write - (insert (format ";;; -*- coding: %S; -*-\n" - session-save-file-coding-system))) - (insert ";;; Automatically generated on " (current-time-string) - "\n;;; Invoked by " (user-login-name) "@" (system-name) - " using " emacs-version "\n") - ;; save global variables and registers ---------------------------- - (let ((s-excl session-globals-exclude)) - (dolist (incl (append session-globals-include - (apropos-internal session-globals-regexp - 'boundp))) - (let ((symbol (if (consp incl) (car incl) incl))) - (unless (memq symbol s-excl) - (push symbol s-excl) - (when (default-boundp symbol) - (session-save-insert-variable symbol - (default-value symbol) - (cdr-safe incl))))))) - (session-save-registers) - ;; write session file --------------------------------------------- - (run-hooks 'session-before-save-hook) - (condition-case var - (progn - (if (file-exists-p session-save-file) - (delete-file session-save-file)) - (make-directory (file-name-directory session-save-file) t) - (write-region (point-min) (point-max) session-save-file) - (if session-save-file-modes - (set-file-modes session-save-file - session-save-file-modes))) - (error ; efs would signal `ftp-error' - (or (y-or-n-p "Could not write session file. Exit anyway? ") - (cond-emacs-xemacs - (:EMACS signal :XEMACS signal-error :BOTH - (car var) (cdr var)))))) - (kill-buffer (current-buffer)))))) - -(defun session-save-insert-variable (symbol val spec) - "Print SYMBOL and its value VAL into the current buffer. -Argument SPEC looks like (MAX-SIZE ASSOC-P), see variable -`session-globals-include' for details. - -Only true lists are printed which do not have a level-1 recursion. -Elements in the list are not printed if one of the following is true: - - the element is no cons if ASSO-P is non-nil, - - strings which are too long, see `session-globals-max-string', - - non-readable elements, or - - elements which are not fully represented according to the - specification in `session-save-print-spec'." - (when (consp val) - (let ((print-circle (car session-save-print-spec)) ;#dynamic - (print-level (cadr session-save-print-spec)) ;#dynamic - (print-length (caddr session-save-print-spec)) ;#dynamic - (len (or (car spec) session-globals-max-size)) - (ass-p (cadr spec)) - (slist nil) klist clist) - (while (and (consp val) (> len 0)) - (if (memq val clist) - (setq val t) ; don't print recursive lists - (push val clist) - (let* ((elem (pop val)) - (estr (prin1-to-string elem))) - ;; read/load isn't clever: ignore non-readable elements - (unless (cond (ass-p - (or (atom elem) - (member (car elem) klist) - (condition-case nil - (prog1 nil - (read estr) - (push (car elem) klist)) - (error t)))) - ((member estr slist)) - ((stringp elem) - (> (length elem) session-globals-max-string)) - ((condition-case nil - (prog1 nil - (read estr)) - (error t)))) - (push estr slist) - (decf len))))) - (when (and slist (null val)) ; don't print non-true lists - (insert (format "(setq-default %S '(" symbol)) - (setq slist (nreverse slist)) - (while slist - (insert (pop slist) (if slist " " "))\n"))))))) - -(defunx session-next-range-char (char) - ;; XEmacs register functions should handle integers as chars better... - :emacs-only 1+ - "Return the next char after CHAR." - (int-to-char (1+ char))) - -(defun session-save-registers () - "Save registers in `session-registers'." - (let ((chars session-registers) - (type 'file) - register from to) - (while chars - (if (symbolp (car chars)) - (setq type (car chars) - chars (cdr chars)) - (setq from (car chars) - chars (cdr chars)) - (if (consp from) - (setq to (cdr from) - from (car from)) - (setq to from)) - (while (<= from to) - (setq register (get-register from)) - (cond ((null register)) - ((and (memq type '(file t)) - (consp register) - (memq (car register) '(file file-query))) - (insert (if (eq (car register) 'file) - (format "(set-register %S '(file . %S))\n" - from (cdr register)) - (format "(set-register %S '(file-query %S %d))\n" - from (cadr register) (caddr register))))) - ((and (memq type '(region t)) - (stringp register) - (< (length register) session-registers-max-string)) - (insert (format "(set-register %S %S)\n" from register)))) - (setq from (session-next-range-char from))))))) - - -;;;=========================================================================== -;;; Minibuffer history completion, see XEmacs' list-mode -;;;=========================================================================== - -(defvar session-history-help-string - '(concat (if (device-on-window-system-p) - (substitute-command-keys "Click \\\\[list-mode-item-mouse-selected] on a history element to select it.\n") "") - (substitute-command-keys "In this buffer, type RET to select the element near point.\n\n")) - "Form the evaluate to get a help string for history elements.") - -(defun session-minibuffer-history-help () - "List history of current minibuffer type. -In Emacs, the *History* buffer talks about \"completions\" instead -\"history elements\". In XEmacs before 21.4.9, selecting an entry might -not work if the minibuffer is non-empty." - (interactive) - (let ((history (symbol-value minibuffer-history-variable))) - (message nil) - (if history - (with-output-to-temp-buffer "*History*" - (cond-emacs-xemacs - (display-completion-list - (sort history #'string-lessp) - :XEMACS - :help-string session-history-help-string - :completion-string "Elements in the history are:")) - (save-excursion - (set-buffer standard-output) - (setq completion-base-size 0))) - (ding) - (session-minibuffer-message " [Empty history]")))) - -(defunx session-minibuffer-message (string) - :emacs-only minibuffer-message - :xemacs-only temp-minibuffer-message) - - -;;;=========================================================================== -;;; Set hooks, load session file -;;;=========================================================================== - -;; easymenu.el is for top-level menus only... both Emacs and XEmacs could -;; profit from a better menu interface... -(defunx session-add-submenu (menu) - "Add the menu MENU to the beginning of the File menu in the menubar. -If the \"File\" menu does not exist, no submenu is added. See -`easy-menu-define' for the format of MENU." - (and menu - :EMACS - (>= emacs-major-version 21) - (boundp 'menu-bar-files-menu) - (let ((keymap (easy-menu-create-menu (car menu) (cdr menu)))) - ;; `easy-menu-get-map' doesn't get the right one => use hard-coded - (define-key menu-bar-files-menu (vector (intern (car menu))) - (cons 'menu-item - (cons (car menu) - (if (not (symbolp keymap)) - (list keymap) - (cons (symbol-function keymap) - (get keymap 'menu-prop))))))) - :XEMACS - (featurep 'menubar) - (let ((current-menubar default-menubar) ;#dynamic - (first (cadar (find-menu-item default-menubar '("File"))))) - (when first - ;; XEmacs-20.4 `add-submenu' does not have 4th arg IN-MENU - (add-submenu '("File") menu - ;; arg BEFORE cannot be retrieved by any - ;; menubar function -- great... - (cond ((vectorp first) (aref first 0)) - ((consp first) (car first)))))))) - -(defunx session-initialize-keys () - "Define some key bindings for package session." - (define-key ctl-x-map [(undo)] 'session-jump-to-last-change) - (define-key ctl-x-map [(control ?\/)] 'session-jump-to-last-change) - (define-key minibuffer-local-map [(meta ?\?)] - 'session-minibuffer-history-help) - :XEMACS - ;; C-down-mouse-3 pops up mode menu under Emacs - (define-key global-map [(control button3)] 'session-popup-yank-menu) - :EMACS - ;; Emacs doesn't seem to have keymap inheritance... - (define-key minibuffer-local-completion-map [(meta ?\?)] - 'session-minibuffer-history-help) - (define-key minibuffer-local-must-match-map [(meta ?\?)] - 'session-minibuffer-history-help) - (define-key minibuffer-local-ns-map [(meta ?\?)] - 'session-minibuffer-history-help)) - -(defunx session-initialize-menus () - "Add some submenus for package session." - (session-add-submenu '("Open...Recently Visited" - :included file-name-history - :filter session-file-opened-menu-filter - ["Move File Names Of All Buffers To Top" - session-file-opened-recompute] - "---")) - (session-add-submenu '("Open...Recently Changed" - ;;:included session-file-alist - :filter session-file-changed-menu-filter - ["Perform Evaluation For All Buffers" - session-file-changed-recompute] - ["Permanently List Current Buffer " - session-toggle-permanent-flag - ;; :keys must be at third position! - ;;:keys (session-toggle-permanent-flag nil t) - :active buffer-file-name - :style toggle - :selected (session-toggle-permanent-flag nil t)] - "---")) - :XEMACS - (and (featurep 'menubar) - (find-menu-item default-menubar '("Edit")) - (let ((current-menubar default-menubar)) - ;; XEmacs-20.4 `add-submenu' does not have 4th arg IN-MENU - (add-submenu '("Edit") - '("Select and Paste" - :included kill-ring - :filter session-yank-menu-filter) - (cond ((find-menu-item default-menubar - '("Edit" "Delete")) - "Delete") ; why just BEFORE, not AFTER - ((find-menu-item default-menubar - '("Edit" "Paste")) - "Paste") - ((find-menu-item default-menubar - '("Edit" "Undo")) - "Undo")))))) - -(defun session-initialize-do () - "Initialize package session and read previous session file. -Setup hooks and load `session-save-file', see variable `session-initialize'. At -best, this function is called at the end of the Emacs startup, i.e., add -this function to `after-init-hook'." - (when (and session-use-package - (null (get 'session-initialize :initilized-with))) - (when (or (eq session-initialize t) - (memq 'de-saveplace session-initialize)) - ;; Features of package saveplace, which has an auto-init, are covered by - ;; this package. - (when (functionp 'eval-after-load) - (eval-after-load "saveplace" - '(progn - (remove-hook 'find-file-hooks 'save-place-find-file-hook) - (remove-hook 'kill-emacs-hook 'save-place-kill-emacs-hook) - (remove-hook 'kill-buffer-hook 'save-place-to-alist))))) - (when (or (eq session-initialize t) - (memq 'places session-initialize)) - ;; `session-find-file-hook' should be *very* late in `find-file-hooks', - ;; esp. if some package, e.g. crypt, iso-cvt, change the buffer contents: - (add-hook 'find-file-hooks 'session-find-file-hook t) - (add-hook 'find-file-not-found-hooks 'session-find-file-not-found-hook t) - (add-hook 'kill-buffer-hook 'session-kill-buffer-hook) - (if session-register-swap-out - (add-hook 'kill-buffer-hook session-register-swap-out))) - (when (or (eq session-initialize t) (memq 'keys session-initialize)) - (condition-case nil - (session-initialize-keys) - (error nil))) - (when (or (eq session-initialize t) (memq 'menus session-initialize)) - (unless (memq 'session-set-file-name-history find-file-hooks) - ;; already initialized (probably not a good idea to redo for menus) - (add-hook 'find-file-hooks 'session-set-file-name-history) - (session-initialize-menus))) - (when (or (eq session-initialize t) - (memq 'session session-initialize)) - (add-hook 'kill-emacs-hook 'session-save-session) - (or session-successful-p - (setq session-successful-p - (and session-save-file - (condition-case nil - (progn - ;; load might fail with coding-system = emacs-mule - (unless (load session-save-file t nil t) - (and session-old-save-file - (load session-old-save-file t nil t))) - (run-hooks 'session-after-load-save-file-hook) - t) - (error nil)))))) - (put 'session-initialize :initilized-with session-initialize))) - -(defun session-initialize-and-set (symbol value) - "Custom :set function for `session-use-package'. -It sets the default value of SYMBOL to VALUE and initializes this -package." - (set-default symbol value) ; symbol should be `session-use-package' - (when value - (if (cond-emacs-xemacs - :EMACS (and (boundp 'after-init-time) (null after-init-time)) - :XEMACS (null init-file-loaded)) - ;; in the meantime,`session-use-package' could have been reset to nil - ;; (e.g. when using custom theme with t, user setting with nil) - (add-hook 'after-init-hook 'session-initialize-do) - (session-initialize-do)))) - -;; This must be late in this file as set function is called during loading. -(defcustom session-use-package nil - "Non-nil if package session is in use. -If in use, - - the file name history is updated when visiting a file, - - buffer places are stored when killing a buffer, - - the session file is saved when exiting Emacs, and - - keybindings are menus are added the first time the package is put - into use, see variable `session-initialize'." - :group 'session - :type '(boolean :on "in use" :off "not yet initialized or turned off" - :help-echo "Use package Session, initialize if necessary.") - :require 'session - :set 'session-initialize-and-set) - -;;;###autoload -(defun session-initialize () - "Initialize package session and read previous session file. -Setup hooks and load `session-save-file', see variable `session-initialize'. At -best, this function is called at the end of the Emacs startup, i.e., add -this function to `after-init-hook'." - (interactive) - (put 'session-initialize :initilized-with nil) - (custom-set-variables '(session-use-package t nil (session)))) - -;;; Local IspellPersDict: .ispell_session -;;; session.el ends here diff --git a/elpa/session-20120510.1700/session.elc b/elpa/session-20120510.1700/session.elc deleted file mode 100644 index f022cec..0000000 Binary files a/elpa/session-20120510.1700/session.elc and /dev/null differ diff --git a/elpa/shut-up-20180628.1830/shut-up-autoloads.el b/elpa/shut-up-20180628.1830/shut-up-autoloads.el new file mode 100644 index 0000000..2520acf --- /dev/null +++ b/elpa/shut-up-20180628.1830/shut-up-autoloads.el @@ -0,0 +1,47 @@ +;;; shut-up-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "shut-up" "shut-up.el" (23391 65262 0 0)) +;;; Generated autoloads from shut-up.el + +(autoload 'shut-up "shut-up" "\ +Evaluate BODY with silenced output. + +While BODY is evaluated, all output is redirected to a buffer, +unless `shut-up-ignore' is non-nil. This affects: + +- `message' +- All functions using `standard-output' (e.g. `print', `princ', etc.) + +Inside BODY, the buffer is bound to the lexical variable +`shut-up-sink'. Additionally provide a lexical function +`shut-up-current-output', which returns the current contents of +`shut-up-sink' when called with no arguments. + +Changes to the variable `shut-up-ignore' inside BODY does not +have any affect. + +\(fn &rest BODY)" nil t) + +(function-put 'shut-up 'lisp-indent-function '0) + +(autoload 'shut-up-silence-emacs "shut-up" "\ +Silence Emacs. + +Change Emacs settings to reduce the output. + +WARNING: This function has GLOBAL SIDE-EFFECTS. You should only +call this function in `noninteractive' sessions. + +\(fn)" nil nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; shut-up-autoloads.el ends here diff --git a/elpa/shut-up-20180628.1830/shut-up-pkg.el b/elpa/shut-up-20180628.1830/shut-up-pkg.el new file mode 100644 index 0000000..4705192 --- /dev/null +++ b/elpa/shut-up-20180628.1830/shut-up-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "shut-up" "20180628.1830" "Shut up would you!" '((cl-lib "0.3") (emacs "24")) :commit "081d6b01e3ba0e60326558e545c4019219e046ce" :authors '(("Johan Andersson" . "johan.rejeep@gmail.com")) :maintainer '("Johan Andersson" . "johan.rejeep@gmail.com") :url "http://github.com/rejeep/shut-up.el") diff --git a/elpa/shut-up-20180628.1830/shut-up.el b/elpa/shut-up-20180628.1830/shut-up.el new file mode 100644 index 0000000..db5326f --- /dev/null +++ b/elpa/shut-up-20180628.1830/shut-up.el @@ -0,0 +1,150 @@ +;;; shut-up.el --- Shut up would you! -*- lexical-binding: t; -*- + +;; Copyright (C) 2013, 2014 Johan Andersson +;; Copyright (C) 2014, 2015 Sebastian Wiesner + +;; Author: Johan Andersson +;; Maintainer: Johan Andersson +;; Package-Requires: ((cl-lib "0.3") (emacs "24")) +;; Package-Version: 20180628.1830 +;; Version: 0.3.2 +;; URL: http://github.com/rejeep/shut-up.el + +;; This file is NOT part of GNU Emacs. + +;;; License: + +;; 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., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: + +;;; Code: + +(require 'cl-lib) +(eval-when-compile + (defvar dired-use-ls-dired)) + +;; NOTE: This variable has been added in most recent version of +;; Emacs. It's declared here to support lexical binding and to avoid +;; compiler warnings. +(defvar inhibit-message nil) + +(defvar shut-up-ignore nil + "When non-nil, do not hide output inside `shut-up'. + +Changes to this variable inside a `shut-up' block has no +effect.") + +;; Preserve the original definition of `write-region' +(unless (fboundp 'shut-up-write-region-original) + (fset 'shut-up-write-region-original (symbol-function 'write-region))) + +(defun shut-up-write-region (start end filename + &optional append visit lockname mustbenew) + "Like `write-region', but try to suppress any messages." + (unless visit + (setq visit 'no-message)) + ;; Call our "copy" of `write-region', because if this function is used to + ;; override `write-region', calling `write-region' directly here would result + ;; in any endless recursion. + (shut-up-write-region-original start end filename + append visit lockname mustbenew)) + +(unless (fboundp 'shut-up-load-original) + (fset 'shut-up-load-original (symbol-function 'load))) + +(defun shut-up-load (file &optional noerror _nomessage nosuffix must-suffix) + "Like `load', but try to be quiet about it." + (shut-up-load-original file noerror :nomessage nosuffix must-suffix)) + +(defun shut-up-buffer-string (buffer) + "Get the contents of BUFFER. + +When BUFFER is alive, return its contents without properties. +Otherwise return nil." + (when (buffer-live-p buffer) + (with-current-buffer buffer + (buffer-substring-no-properties (point-min) (point-max))))) + +(defun shut-up-insert-to-buffer (object buffer) + "Insert OBJECT into BUFFER. + +If BUFFER is not live, do nothing." + (when (buffer-live-p buffer) + (with-current-buffer buffer + (cl-typecase object + (character (insert-char object 1)) + (string (insert object)) + (t (princ object #'insert-char)))))) + +;;;###autoload +(defmacro shut-up (&rest body) + "Evaluate BODY with silenced output. + +While BODY is evaluated, all output is redirected to a buffer, +unless `shut-up-ignore' is non-nil. This affects: + +- `message' +- All functions using `standard-output' (e.g. `print', `princ', etc.) + +Inside BODY, the buffer is bound to the lexical variable +`shut-up-sink'. Additionally provide a lexical function +`shut-up-current-output', which returns the current contents of +`shut-up-sink' when called with no arguments. + +Changes to the variable `shut-up-ignore' inside BODY does not +have any affect." + (declare (indent 0)) + `(let ((shut-up-sink (generate-new-buffer " *shutup*")) + (inhibit-message t)) + (cl-labels ((shut-up-current-output () (or (shut-up-buffer-string shut-up-sink) ""))) + (if shut-up-ignore + (progn ,@body) + (unwind-protect + ;; Override `standard-output', for `print' and friends, and + ;; monkey-patch `message' + (cl-letf ((standard-output + (lambda (char) + (shut-up-insert-to-buffer char shut-up-sink))) + ((symbol-function 'message) + (lambda (fmt &rest args) + (when fmt + (let ((text (concat (apply #'format fmt args) "\n"))) + (shut-up-insert-to-buffer text shut-up-sink))))) + ((symbol-function 'write-region) #'shut-up-write-region) + ((symbol-function 'load) #'shut-up-load)) + ,@body) + (and (buffer-name shut-up-sink) + (kill-buffer shut-up-sink))))))) + +;;;###autoload +(defun shut-up-silence-emacs () + "Silence Emacs. + +Change Emacs settings to reduce the output. + +WARNING: This function has GLOBAL SIDE-EFFECTS. You should only +call this function in `noninteractive' sessions." + ;; Loading vc-git... + (remove-hook 'find-file-hooks 'vc-find-file-hook) + + ;; ls does not support --dired; see `dired-use-ls-dired' for more details. + (eval-after-load "dired" + '(setq dired-use-ls-dired nil))) + +(provide 'shut-up) + +;;; shut-up.el ends here diff --git a/elpa/shut-up-20180628.1830/shut-up.elc b/elpa/shut-up-20180628.1830/shut-up.elc new file mode 100644 index 0000000..cb14fec Binary files /dev/null and b/elpa/shut-up-20180628.1830/shut-up.elc differ diff --git a/elpa/simplezen-20130421.1000/simplezen-autoloads.el b/elpa/simplezen-20130421.1000/simplezen-autoloads.el new file mode 100644 index 0000000..0376c87 --- /dev/null +++ b/elpa/simplezen-20130421.1000/simplezen-autoloads.el @@ -0,0 +1,15 @@ +;;; simplezen-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil nil ("simplezen.el") (23391 65261 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; simplezen-autoloads.el ends here diff --git a/elpa/simplezen-20130421.1000/simplezen-pkg.el b/elpa/simplezen-20130421.1000/simplezen-pkg.el new file mode 100644 index 0000000..0904db6 --- /dev/null +++ b/elpa/simplezen-20130421.1000/simplezen-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "simplezen" "20130421.1000" "A simple subset of zencoding-mode for Emacs." '((s "1.4.0") (dash "1.1.0")) :commit "119fdf2c6890a0c56045ae72cf4fce0071a81481" :authors '(("Magnar Sveen" . "magnars@gmail.com")) :maintainer '("Magnar Sveen" . "magnars@gmail.com")) diff --git a/elpa/simplezen-20130421.1000/simplezen.el b/elpa/simplezen-20130421.1000/simplezen.el new file mode 100644 index 0000000..0b9351f --- /dev/null +++ b/elpa/simplezen-20130421.1000/simplezen.el @@ -0,0 +1,138 @@ +;;; simplezen.el --- A simple subset of zencoding-mode for Emacs. + +;; Copyright (C) 2013 Magnar Sveen + +;; Author: Magnar Sveen +;; Package-Requires: ((s "1.4.0") (dash "1.1.0")) +;; Package-Version: 20130421.1000 +;; Version: 0.1.1 + +;; 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 . + +;;; Commentary: + +;; A simple subset of zencoding-mode for Emacs. + +;; It completes these types: +;; +;; div -->
+;; input --> +;; .article -->
+;; #logo --> +;; ul.items -->
    +;; h2#tagline -->

    +;; +;; So why not just use zencoding-mode for a much richer set of features? +;; +;; - this covers 98% of my usage of zencoding-mode +;; - this is simple enough to be predictable +;; +;; The original had a way of surprising me. Like when I just wanted to +;; add a quick tag inside some prose, and it garbled the +;; entire sentence. That doesn't happen here, since this subset does not +;; look past whitespace. +;; +;; It also will not try to expand anything that is not a known html-tag, +;; reducing the number of errors when I just want to indent the line. +;; Yes, I have it on TAB. +;; +;; ## Setup +;; +;; You can bind `simplezen-expand` to any button of your choosing. +;; +;; (require 'simplezen) +;; (define-key html-mode-map (kbd "C-c C-z") 'simplezen-expand) +;; +;; If you want it bound to `tab` you can do this: +;; +;; (define-key html-mode-map (kbd "TAB") 'simplezen-expand-or-indent-for-tab) +;; +;; Then it will still indent the line, except in cases where you're +;; looking back at a valid simplezen-expression (see above). +;; +;; To get it working with yasnippet aswell, I did this: +;; +;; (defun --setup-simplezen () +;; (set (make-local-variable 'yas/fallback-behavior) +;; '(apply simplezen-expand-or-indent-for-tab))) +;; +;; (add-hook 'sgml-mode-hook '--setup-simplezen) +;; +;; Which will give yasnippet first priority, then simplezen gets it +;; chance, and if neither of those did anything it will indent the line. + +;;; Code: + +(require 'dash) +(require 's) + +(defvar simplezen-html-tags + '("a" "abbr" "acronym" "address" "area" "b" "base" "bdo" "big" "blockquote" "body" "br" + "button" "caption" "cite" "code" "col" "colgroup" "dd" "del" "dfn" "div" "dl" "dt" + "em" "fieldset" "form" "h1" "h2" "h3" "h4" "h5" "h6" "head" "html" "hr" "i" "img" + "input" "ins" "kbd" "label" "legend" "li" "link" "map" "meta" "noscript" "object" "ol" + "optgroup" "option" "p" "param" "pre" "q" "samp" "script" "select" "small" "span" + "strong" "style" "sub" "sup" "table" "tbody" "td" "textarea" "tfoot" "th" "thead" + "title" "tr" "tt" "ul" "var" "article" "aside" "bdi" "command" "details" "dialog" + "summary" "figure" "figcaption" "footer" "header" "hgroup" "mark" "meter" "nav" + "progress" "ruby" "rt" "rp" "section" "time" "wbr" "audio" "video" "source" "embed" + "track" "canvas" "datalist" "keygen" "output")) + +(defvar simplezen-empty-tags + '("area" "base" "basefont" "br" "col" "frame" "hr" "img" "input" "isindex" "link" + "meta" "param" "wbr")) + +(defvar simplezen-fallback-behavior nil + "Function to call if simplezen does not find a match.") + +(defun simplezen--maybe-fall-back () + (when simplezen-fallback-behavior + (call-interactively simplezen-fallback-behavior))) + +(defun simplezen-expand () + (interactive) + (if (looking-back "[[:lower:]1-6]") + (let* ((end (point)) + (beg (save-excursion (search-backward-regexp " \\|^\\|>") + (unless (bolp) (forward-char 1)) + (point))) + (expressions (s-slice-at "[.#]" (buffer-substring beg end))) + (first (car expressions)) + (tagname (if (or (s-starts-with? "." first) + (s-starts-with? "#" first)) + "div" + first))) + (if (member tagname simplezen-html-tags) + (let ((id (--first (s-starts-with? "#" it) expressions)) + (classes (->> expressions + (--filter (s-starts-with? "." it)) + (--map (s-chop-prefix "." it)) + (s-join " ")))) + (delete-char (- beg end)) + (insert "<" tagname + (if (s-blank? id) "" (s-concat " id=\"" (s-chop-prefix "#" id) "\"")) + (if (s-blank? classes) "" (s-concat " class=\"" classes "\"")) + ">") + (unless (member tagname simplezen-empty-tags) + (save-excursion (insert "")))) + (simplezen--maybe-fall-back))) + (simplezen--maybe-fall-back))) + +(defun simplezen-expand-or-indent-for-tab () + (interactive) + (let ((simplezen-fallback-behavior 'indent-for-tab-command)) + (simplezen-expand))) + +(provide 'simplezen) +;;; simplezen.el ends here diff --git a/elpa/simplezen-20130421.1000/simplezen.elc b/elpa/simplezen-20130421.1000/simplezen.elc new file mode 100644 index 0000000..8e8396d Binary files /dev/null and b/elpa/simplezen-20130421.1000/simplezen.elc differ diff --git a/elpa/smex-20151212.2209/smex-autoloads.el b/elpa/smex-20151212.2209/smex-autoloads.el new file mode 100644 index 0000000..84c0ca1 --- /dev/null +++ b/elpa/smex-20151212.2209/smex-autoloads.el @@ -0,0 +1,31 @@ +;;; smex-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "smex" "smex.el" (23391 65260 0 0)) +;;; Generated autoloads from smex.el + +(autoload 'smex "smex" "\ + + +\(fn)" t nil) + +(autoload 'smex-major-mode-commands "smex" "\ +Like `smex', but limited to commands that are relevant to the active major mode. + +\(fn)" t nil) + +(autoload 'smex-initialize "smex" "\ + + +\(fn)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; smex-autoloads.el ends here diff --git a/elpa/smex-20151212.2209/smex-pkg.el b/elpa/smex-20151212.2209/smex-pkg.el new file mode 100644 index 0000000..47f3d96 --- /dev/null +++ b/elpa/smex-20151212.2209/smex-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "smex" "20151212.2209" "M-x interface with Ido-style fuzzy matching." '((emacs "24")) :commit "55aaebe3d793c2c990b39a302eb26c184281c42c" :keywords '("convenience" "usability") :authors '(("Cornelius Mika" . "cornelius.mika@gmail.com")) :maintainer '("Cornelius Mika" . "cornelius.mika@gmail.com") :url "http://github.com/nonsequitur/smex/") diff --git a/elpa/smex-20151212.2209/smex.el b/elpa/smex-20151212.2209/smex.el new file mode 100644 index 0000000..a85821f --- /dev/null +++ b/elpa/smex-20151212.2209/smex.el @@ -0,0 +1,484 @@ +;;; smex.el --- M-x interface with Ido-style fuzzy matching. -*- lexical-binding: t; -*- + +;; Copyright (C) 2009-2014 Cornelius Mika and contributors +;; +;; Author: Cornelius Mika and contributors +;; URL: http://github.com/nonsequitur/smex/ +;; Package-Version: 20151212.2209 +;; Package-Requires: ((emacs "24")) +;; Version: 3.0 +;; Keywords: convenience, usability + +;; This file is not part of GNU Emacs. + +;;; License: + +;; Licensed under the same terms as Emacs. + +;;; Commentary: + +;; Quick start: +;; run (smex-initialize) +;; +;; Bind the following commands: +;; smex, smex-major-mode-commands +;; +;; For a detailed introduction see: +;; http://github.com/nonsequitur/smex/blob/master/README.markdown + +;;; Code: + +(require 'ido) + +(defgroup smex nil + "M-x interface with Ido-style fuzzy matching and ranking heuristics." + :group 'extensions + :group 'convenience + :link '(emacs-library-link :tag "Lisp File" "smex.el")) + +(defcustom smex-auto-update t + "If non-nil, `Smex' checks for new commands each time it is run. +Turn it off for minor speed improvements on older systems." + :type 'boolean + :group 'smex) + +(defcustom smex-save-file (locate-user-emacs-file "smex-items" ".smex-items") + "File in which the smex state is saved between Emacs sessions. +Variables stored are: `smex-data', `smex-history'. +Must be set before initializing Smex." + :type 'string + :group 'smex) + +(defcustom smex-history-length 7 + "Determines on how many recently executed commands +Smex should keep a record. +Must be set before initializing Smex." + :type 'integer + :group 'smex) + +(defcustom smex-prompt-string "M-x " + "String to display in the Smex prompt." + :type 'string + :group 'smex) + +(defcustom smex-flex-matching t + "Enables Ido flex matching. On by default. +Set this to nil to disable fuzzy matching." + :type 'boolean + :group 'smex) + +(defvar smex-initialized-p nil) +(defvar smex-cache) +(defvar smex-ido-cache) +(defvar smex-data) +(defvar smex-history) +(defvar smex-command-count 0) +(defvar smex-custom-action nil) + +;; Check if Smex is supported +(when (equal (cons 1 1) + (ignore-errors + (subr-arity (symbol-function 'execute-extended-command)))) + (error "Your Emacs has a non-elisp version of `execute-extended-command', which is incompatible with Smex")) + +;;-------------------------------------------------------------------------------- +;; Smex Interface + +;;;###autoload +(defun smex () + (interactive) + (unless smex-initialized-p + (smex-initialize)) + (if (smex-already-running) + (smex-update-and-rerun) + (and smex-auto-update + (smex-detect-new-commands) + (smex-update)) + (smex-read-and-run smex-ido-cache))) + +(defun smex-already-running () + (and (boundp 'ido-choice-list) + (eql ido-choice-list smex-ido-cache) + (minibuffer-window-active-p (selected-window)))) + +(defun smex-update-and-rerun () + (smex-do-with-selected-item + (lambda (_) (smex-update) (smex-read-and-run smex-ido-cache ido-text)))) + +(defun smex-read-and-run (commands &optional initial-input) + (let* ((chosen-item-name (smex-completing-read commands initial-input)) + (chosen-item (intern chosen-item-name))) + (if smex-custom-action + (let ((action smex-custom-action)) + (setq smex-custom-action nil) + (funcall action chosen-item)) + (unwind-protect + (with-no-warnings ; Don't warn about interactive use of `execute-extended-command' + (execute-extended-command current-prefix-arg chosen-item-name)) + (smex-rank chosen-item))))) + +;;;###autoload +(defun smex-major-mode-commands () + "Like `smex', but limited to commands that are relevant to the active major mode." + (interactive) + (unless smex-initialized-p + (smex-initialize)) + (let ((commands (delete-dups (append (smex-extract-commands-from-keymap (current-local-map)) + (smex-extract-commands-from-features major-mode))))) + (setq commands (smex-sort-according-to-cache commands)) + (setq commands (mapcar #'symbol-name commands)) + (smex-read-and-run commands))) + +(defun smex-completing-read (choices initial-input) + (let ((ido-completion-map ido-completion-map) + (ido-setup-hook (cons 'smex-prepare-ido-bindings ido-setup-hook)) + (ido-enable-prefix nil) + (ido-enable-flex-matching smex-flex-matching) + (ido-max-prospects 10) + (minibuffer-completion-table choices)) + (ido-completing-read (smex-prompt-with-prefix-arg) choices nil nil + initial-input 'extended-command-history (car choices)))) + +(defun smex-prompt-with-prefix-arg () + (if (not current-prefix-arg) + smex-prompt-string + (concat + (if (eq current-prefix-arg '-) + "- " + (if (integerp current-prefix-arg) + (format "%d " current-prefix-arg) + (if (= (car current-prefix-arg) 4) + "C-u " + (format "%d " (car current-prefix-arg))))) + smex-prompt-string))) + +(defun smex-prepare-ido-bindings () + (define-key ido-completion-map (kbd "TAB") 'minibuffer-complete) + (define-key ido-completion-map (kbd "C-h f") 'smex-describe-function) + (define-key ido-completion-map (kbd "C-h w") 'smex-where-is) + (define-key ido-completion-map (kbd "M-.") 'smex-find-function) + (define-key ido-completion-map (kbd "C-a") 'move-beginning-of-line)) + +;;-------------------------------------------------------------------------------- +;; Cache and Maintenance + +(defun smex-rebuild-cache () + (interactive) + (setq smex-cache nil) + + ;; Build up list 'new-commands' and later put it at the end of 'smex-cache'. + ;; This speeds up sorting. + (let (new-commands) + (mapatoms (lambda (symbol) + (when (commandp symbol) + (let ((known-command (assq symbol smex-data))) + (if known-command + (setq smex-cache (cons known-command smex-cache)) + (setq new-commands (cons (list symbol) new-commands))))))) + (if (eq (length smex-cache) 0) + (setq smex-cache new-commands) + (setcdr (last smex-cache) new-commands))) + + (setq smex-cache (sort smex-cache 'smex-sorting-rules)) + (smex-restore-history) + (setq smex-ido-cache (smex-convert-for-ido smex-cache))) + +(defun smex-convert-for-ido (command-items) + (mapcar (lambda (command-item) (symbol-name (car command-item))) command-items)) + +(defun smex-restore-history () + "Rearranges `smex-cache' according to `smex-history'" + (if (> (length smex-history) smex-history-length) + (setcdr (nthcdr (- smex-history-length 1) smex-history) nil)) + (mapc (lambda (command) + (unless (eq command (caar smex-cache)) + (let ((command-cell-position (smex-detect-position + smex-cache + (lambda (cell) + (eq command (caar cell)))))) + (when command-cell-position + (let ((command-cell (smex-remove-nth-cell + command-cell-position smex-cache))) + (setcdr command-cell smex-cache) + (setq smex-cache command-cell)))))) + (reverse smex-history))) + +(defun smex-sort-according-to-cache (list) + "Sorts a list of commands by their order in `smex-cache'" + (let (sorted) + (dolist (command-item smex-cache) + (let ((command (car command-item))) + (when (memq command list) + (setq sorted (cons command sorted)) + (setq list (delq command list))))) + (nreverse (append list sorted)))) + +(defun smex-update () + (interactive) + (smex-save-history) + (smex-rebuild-cache)) + +(defun smex-detect-new-commands () + (let ((i 0)) + (mapatoms (lambda (symbol) (if (commandp symbol) (setq i (1+ i))))) + (unless (= i smex-command-count) + (setq smex-command-count i)))) + +(defun smex-auto-update (&optional idle-time) + "Update Smex when Emacs has been idle for IDLE-TIME." + (unless idle-time (setq idle-time 60)) + (run-with-idle-timer idle-time t + '(lambda () (if (smex-detect-new-commands) (smex-update))))) + +;;;###autoload +(defun smex-initialize () + (interactive) + (unless ido-mode (smex-initialize-ido)) + (smex-load-save-file) + (smex-detect-new-commands) + (smex-rebuild-cache) + (add-hook 'kill-emacs-hook 'smex-save-to-file) + (setq smex-initialized-p t)) + +(defun smex-initialize-ido () + "Sets up a minimal Ido environment for `ido-completing-read'." + (with-no-warnings ; `ido-init-completion-maps' is deprecated in Emacs 25 + (ido-init-completion-maps)) + (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)) + +(defsubst smex-save-file-not-empty-p () + (string-match-p "\[^[:space:]\]" (buffer-string))) + +(defun smex-load-save-file () + "Loads `smex-history' and `smex-data' from `smex-save-file'" + (let ((save-file (expand-file-name smex-save-file))) + (if (file-readable-p save-file) + (with-temp-buffer + (insert-file-contents save-file) + (condition-case nil + (setq smex-history (read (current-buffer)) + smex-data (read (current-buffer))) + (error (if (smex-save-file-not-empty-p) + (error "Invalid data in smex-save-file (%s). Can't restore history." + smex-save-file) + (unless (boundp 'smex-history) (setq smex-history nil)) + (unless (boundp 'smex-data) (setq smex-data nil)))))) + (setq smex-history nil smex-data nil)))) + +(defun smex-save-history () + "Updates `smex-history'" + (setq smex-history nil) + (let ((cell smex-cache)) + (dotimes (_ smex-history-length) + (setq smex-history (cons (caar cell) smex-history)) + (setq cell (cdr cell)))) + (setq smex-history (nreverse smex-history))) + +(defmacro smex-pp (list-var) + `(smex-pp* ,list-var ,(symbol-name list-var))) + +(defun smex-save-to-file () + (interactive) + (smex-save-history) + (with-temp-file (expand-file-name smex-save-file) + (smex-pp smex-history) + (smex-pp smex-data))) + +;;-------------------------------------------------------------------------------- +;; Ranking + +(defun smex-sorting-rules (command-item other-command-item) + "Returns true if COMMAND-ITEM should sort before OTHER-COMMAND-ITEM." + (let* ((count (or (cdr command-item ) 0)) + (other-count (or (cdr other-command-item) 0)) + (name (car command-item)) + (other-name (car other-command-item)) + (length (length (symbol-name name))) + (other-length (length (symbol-name other-name)))) + (or (> count other-count) ; 1. Frequency of use + (and (= count other-count) + (or (< length other-length) ; 2. Command length + (and (= length other-length) + (string< name other-name))))))) ; 3. Alphabetical order + +(defun smex-rank (command) + (let ((command-item (or (assq command smex-cache) + ;; Update caches and try again if not found. + (progn (smex-update) + (assq command smex-cache))))) + (when command-item + (smex-update-counter command-item) + + ;; Don't touch the cache order if the chosen command + ;; has just been execucted previously. + (unless (eq command-item (car smex-cache)) + (let (command-cell + (pos (smex-detect-position smex-cache (lambda (cell) + (eq command-item (car cell)))))) + ;; Remove the just executed command. + (setq command-cell (smex-remove-nth-cell pos smex-cache)) + ;; And put it on top of the cache. + (setcdr command-cell smex-cache) + (setq smex-cache command-cell) + + ;; Repeat the same for the ido cache. Should this be DRYed? + (setq command-cell (smex-remove-nth-cell pos smex-ido-cache)) + (setcdr command-cell smex-ido-cache) + (setq smex-ido-cache command-cell) + + ;; Now put the last history item back to its normal place. + (smex-sort-item-at smex-history-length)))))) + +(defun smex-update-counter (command-item) + (let ((count (cdr command-item))) + (setcdr command-item + (if count + (1+ count) + ;; Else: Command has just been executed for the first time. + ;; Add it to `smex-data'. + (if smex-data + (setcdr (last smex-data) (list command-item)) + (setq smex-data (list command-item))) + 1)))) + +(defun smex-sort-item-at (n) + "Sorts item at position N in `smex-cache'." + (let* ((command-cell (nthcdr n smex-cache)) + (command-item (car command-cell))) + (let ((insert-at (smex-detect-position + command-cell + (lambda (cell) + (smex-sorting-rules command-item (car cell)))))) + ;; TODO: Should we handle the case of 'insert-at' being nil? + ;; This will never happen in practice. + (when (> insert-at 1) + (setq command-cell (smex-remove-nth-cell n smex-cache)) + ;; smex-cache just got shorter by one element, so subtract '1' from insert-at. + (setq insert-at (+ n (- insert-at 1))) + (smex-insert-cell command-cell insert-at smex-cache) + + ;; Repeat the same for the ido cache. DRY? + (setq command-cell (smex-remove-nth-cell n smex-ido-cache)) + (smex-insert-cell command-cell insert-at smex-ido-cache))))) + +(defun smex-detect-position (cell function) + "Detects, relatively to CELL, the position of the cell +on which FUNCTION returns true. +Only checks cells after CELL, starting with the cell right after CELL. +Returns nil when reaching the end of the list." + (let ((pos 1)) + (catch 'break + (while t + (setq cell (cdr cell)) + (if (not cell) + (throw 'break nil) + (if (funcall function cell) (throw 'break pos)) + (setq pos (1+ pos))))))) + +(defun smex-remove-nth-cell (n list) + "Removes and returns the Nth cell in LIST." + (let* ((previous-cell (nthcdr (- n 1) list)) + (result (cdr previous-cell))) + (setcdr previous-cell (cdr result)) + result)) + +(defun smex-insert-cell (new-cell n list) + "Inserts cell at position N in LIST." + (let* ((cell (nthcdr (- n 1) list)) + (next-cell (cdr cell))) + (setcdr (setcdr cell new-cell) next-cell))) + +;;-------------------------------------------------------------------------------- +;; Help and Reference + +(defun smex-do-with-selected-item (fn) + (setq smex-custom-action fn) + (ido-exit-minibuffer)) + +(defun smex-describe-function () + (interactive) + (smex-do-with-selected-item (lambda (chosen) + (describe-function chosen) + (pop-to-buffer "*Help*")))) + +(defun smex-where-is () + (interactive) + (smex-do-with-selected-item 'where-is)) + +(defun smex-find-function () + (interactive) + (smex-do-with-selected-item 'find-function)) + +(defun smex-extract-commands-from-keymap (map) + (let (commands) + (smex-parse-keymap map commands) + commands)) + +(defun smex-parse-keymap (map commands) + (map-keymap (lambda (_binding element) + (if (and (listp element) (eq 'keymap (car element))) + (smex-parse-keymap element commands) + ;; Strings are commands, too. Reject them. + (if (and (symbolp element) (commandp element)) + (push element commands)))) + map)) + +(defun smex-extract-commands-from-features (mode) + (let ((library-path (symbol-file mode)) + (mode-name (symbol-name mode)) + commands) + + (string-match "\\(.+?\\)\\(-mode\\)?$" mode-name) + ;; 'lisp-mode' -> 'lisp' + (setq mode-name (match-string 1 mode-name)) + (if (string= mode-name "c") (setq mode-name "cc")) + (setq mode-name (regexp-quote mode-name)) + + (dolist (feature load-history) + (let ((feature-path (car feature))) + (when (and feature-path (or (equal feature-path library-path) + (string-match mode-name (file-name-nondirectory + feature-path)))) + (dolist (item (cdr feature)) + (if (and (listp item) (eq 'defun (car item))) + (let ((function (cdr item))) + (when (commandp function) + (setq commands (append commands (list function)))))))))) + commands)) + +(defun smex-show-unbound-commands () + "Shows unbound commands in a new buffer, +sorted by frequency of use." + (interactive) + (setq smex-data (sort smex-data 'smex-sorting-rules)) + (let ((unbound-commands (delq nil + (mapcar (lambda (command-item) + (unless (where-is-internal (car command-item)) + command-item)) + smex-data)))) + (view-buffer-other-window "*Smex: Unbound Commands*") + (setq buffer-read-only t) + (let ((inhibit-read-only t)) + (erase-buffer) + (smex-pp unbound-commands)) + (set-buffer-modified-p nil) + (goto-char (point-min)))) + +;; A copy of `ido-pp' that's compatible with lexical bindings +(defun smex-pp* (list list-name) + (let ((print-level nil) (eval-expression-print-level nil) + (print-length nil) (eval-expression-print-length nil)) + (insert "\n;; ----- " list-name " -----\n(\n ") + (while list + (let* ((elt (car list)) + (s (if (consp elt) (car elt) elt))) + (if (and (stringp s) (= (length s) 0)) + (setq s nil)) + (if s + (prin1 elt (current-buffer))) + (if (and (setq list (cdr list)) s) + (insert "\n ")))) + (insert "\n)\n"))) + +(provide 'smex) +;;; smex.el ends here diff --git a/elpa/smex-20151212.2209/smex.elc b/elpa/smex-20151212.2209/smex.elc new file mode 100644 index 0000000..42d50eb Binary files /dev/null and b/elpa/smex-20151212.2209/smex.elc differ diff --git a/elpa/sotclojure-20170922.8/sotclojure-autoloads.el b/elpa/sotclojure-20170922.8/sotclojure-autoloads.el new file mode 100644 index 0000000..65570e4 --- /dev/null +++ b/elpa/sotclojure-20170922.8/sotclojure-autoloads.el @@ -0,0 +1,45 @@ +;;; sotclojure-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "sotclojure" "sotclojure.el" (23391 65259 0 +;;;;;; 0)) +;;; Generated autoloads from sotclojure.el + +(autoload 'sotclojure-mode "sotclojure" "\ +Toggle SoTclojure mode on or off. +With a prefix argument ARG, enable SoTclojure mode if ARG is +positive, and disable it otherwise. If called from Lisp, enable +the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. +\\{sotclojure-mode-map} + +\(fn &optional ARG)" t nil) + +;;;*** + +;;;### (autoloads nil "sotclojure-on" "sotclojure-on.el" (23391 65259 +;;;;;; 0 0)) +;;; Generated autoloads from sotclojure-on.el + +(autoload 'sotclojure-turn-on-everywhere "sotclojure-on" "\ +Call-once function to turn on sotclojure everywhere. +Calls `sotclojure-mode' on all `clojure-mode' buffers, and sets +up a hook and abbrevs. + +\(fn)" nil nil) + +(eval-after-load 'sotlisp '(speed-of-thought-hook-in #'sotclojure-turn-on-everywhere #'sotclojure-turn-off-everywhere)) + +;;;*** + +;;;### (autoloads nil nil ("sotclojure-pkg.el") (23391 65259 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; sotclojure-autoloads.el ends here diff --git a/elpa/sotclojure-20170922.8/sotclojure-on.el b/elpa/sotclojure-20170922.8/sotclojure-on.el new file mode 100644 index 0000000..4504e08 --- /dev/null +++ b/elpa/sotclojure-20170922.8/sotclojure-on.el @@ -0,0 +1,54 @@ +;;; sotclojure-on.el --- Auxiliary functions for turning on sotclojure -*- lexical-binding: t; -*- + +;; Copyright (C) 2017 Artur Malabarba + +;; Author: Artur Malabarba + +;; 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 . + +;;; Code: + +;;;###autoload +(defun sotclojure-turn-on-everywhere () + "Call-once function to turn on sotclojure everywhere. +Calls `sotclojure-mode' on all `clojure-mode' buffers, and sets +up a hook and abbrevs." + (add-hook 'clojure-mode-hook #'sotclojure-mode) + (eval-after-load 'sotclojure + '(sotclojure-define-all-abbrevs)) + (mapc (lambda (b) + (with-current-buffer b + (when (derived-mode-p 'clojure-mode) + (sotclojure-mode 1)))) + (buffer-list))) + +(defun sotclojure-turn-off-everywhere () + "Call-once function to turn off sotclojure everywhere. +Removes `sotclojure-mode' from all `clojure-mode' buffers, and +removes hooks and abbrevs." + (remove-hook 'clojure-mode-hook #'sotclojure-mode) + (eval-after-load 'sotclojure + '(sotclojure-erase-all-abbrevs)) + (mapc (lambda (b) + (with-current-buffer b + (when (derived-mode-p 'clojure-mode) + (sotclojure-mode -1)))) + (buffer-list))) + +;;;###autoload +(eval-after-load 'sotlisp + '(speed-of-thought-hook-in #'sotclojure-turn-on-everywhere #'sotclojure-turn-off-everywhere)) + +(provide 'sotclojure-on) +;;; sotclojure-on.el ends here diff --git a/elpa/sotclojure-20170922.8/sotclojure-on.elc b/elpa/sotclojure-20170922.8/sotclojure-on.elc new file mode 100644 index 0000000..9e46428 Binary files /dev/null and b/elpa/sotclojure-20170922.8/sotclojure-on.elc differ diff --git a/elpa/sotclojure-20170922.8/sotclojure-pkg.el b/elpa/sotclojure-20170922.8/sotclojure-pkg.el new file mode 100644 index 0000000..36c1a7c --- /dev/null +++ b/elpa/sotclojure-20170922.8/sotclojure-pkg.el @@ -0,0 +1,15 @@ +(define-package "sotclojure" "20170922.8" "Write clojure at the speed of thought." + '((emacs "24.1") + (clojure-mode "4.0.0") + (cider "0.8") + (sotlisp "1.3")) + :keywords + '("convenience" "clojure") + :authors + '(("Artur Malabarba" . "emacs@endlessparentheses.com")) + :maintainer + '("Artur Malabarba" . "emacs@endlessparentheses.com") + :url "https://github.com/Malabarba/speed-of-thought-clojure") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/sotclojure-20170922.8/sotclojure.el b/elpa/sotclojure-20170922.8/sotclojure.el new file mode 100644 index 0000000..7f715fd --- /dev/null +++ b/elpa/sotclojure-20170922.8/sotclojure.el @@ -0,0 +1,288 @@ +;;; sotclojure.el --- Write clojure at the speed of thought. -*- lexical-binding: t; -*- + +;; Copyright (C) 2015 Free Software Foundation, Inc. + +;; Author: Artur Malabarba +;; Keywords: convenience, clojure +;; Package-Requires: ((emacs "24.1") (clojure-mode "4.0.0") (cider "0.8") (sotlisp "1.3")) +;; Version: 1.2 +;; URL: https://github.com/Malabarba/speed-of-thought-clojure + +;; 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 . + +;;; Commentary: +;; +;; This defines a new local minor-mode `sotclojure-mode', which is +;; activated by the global `speed-of-thought-mode' on any clojure +;; buffers. +;; +;; The mode is quite simple, and is composed of two parts: +;; +;; 1.1 Abbrevs +;; ─────────── +;; +;; A large number of abbrevs which expand function initials to their +;; name. A few examples: +;; +;; • wl -> when-let [|] +;; • n -> not +;; • wo -> with-open +;; • np -> number? (the p stands for predicate) +;; • ck -> :keys [|] (the c stands for colon) +;; +;; Note that, in order to avoid frustration, the 1-letter abbrevs will +;; only expand after a `(' or after a `/', so you can still use 1-letter +;; local variables like `a' and `n'. +;; +;; 1.2 Commands +;; ──────────── +;; +;; It also defines 4 commands, which really fit into this "follow the +;; thought-flow" way of writing. The bindings are as follows: +;; `M-RET': Break line, and insert `()' with point in the middle. +;; `C-RET': Do `forward-up-list', then do M-RET. +;; +;; Hitting RET followed by a `(' was one of the most common key sequences +;; for me while writing elisp, so giving it a quick-to-hit key was a +;; significant improvement. +;; +;; `C-c f': Find function under point. If it is not defined, create a +;; definition for it below the current function and leave point inside. +;; +;; With these commands, you just write your code as you think of it. Once +;; you hit a “stop-point” of sorts in your tought flow, you hit `C-c f/v' +;; on any undefined functions/variables, write their definitions, and hit +;; `C-u C-SPC' to go back to the main function. +;; +;; 1.3 Small Example +;; ───────────────── +;; +;; With the above (assuming you use something like paredit or +;; electric-pair-mode), if you write: +;; +;; ┌──── +;; │ (wl SPC {ck SPC x C-f C-RET (a SPC (np SPC y C-f SPC f SPC y +;; └──── +;; +;; You get +;; +;; ┌──── +;; │ (when-let [{:keys [x]} +;; │ (and (number? y) (first y))]) +;; └──── +;; +;;; Code: + +(require 'sotlisp) +(require 'clojure-mode) +(require 'cider) +(require 'sotclojure-on) + +(defun sotclojure--function-p () + "Non-nil if point is at reasonable place for a function name. +In clojure, that is basically anywhere. Still, for the sake of +usability, return nil if word at point has a single letter and is +not after a `('." + (save-excursion + (ignore-errors + (and (not (string-match (rx (syntax symbol)) (string last-command-event))) + (sotlisp--code-p) + (not (let ((orig (point))) + (save-excursion + (beginning-of-defun) + (nth 3 (parse-partial-sexp (point) orig))))) + (string-match (rx alpha) (string (char-before))) + (or (and (< (skip-chars-backward (rx word)) -1) + (= ?\s (char-before))) + (and (string-match (rx (not (syntax symbol))) + (string (char-before))) + (not (sotlisp--whitespace-char-p (char-before))))))))) + +(defvar sotclojure--function-table (make-hash-table :test #'equal) + "Table where function abbrev expansions are stored.") + + +;;; Abbrev definitions +(defconst sotclojure--default-function-abbrevs + '( + ("a" . "and ") + ("am" . "alter-meta! ") + ("amb" . "alter-meta! ") + ("ai" . "assoc-in ") + ("as" . "assoc ") + ("ap" . "associative? ") + ("b" . "binding [$]") + ("bl" . "butlast ") + ("c" . "count ") + ("ca" . ":as ") + ("ck" . ":keys [$] ") + ("co" . ":or {$}") + ("con" . ":only [$]") + ("cp" . "coll? ") + ("cr" . ":refer [$]") + ("cs" . ":strs [$]") + ("cy" . ":syms [$]") + ("d" . "def ") + ("di" . "dissoc ") + ("df" . "defn $ []\n ") + ("dm" . "defmacro $\n \"\"\n []\n ") + ("dv" . "def $ nil\n \"\"") + ("ds" . "doseq [it $]") + ("dt" . "deftest ") + ("ep" . "empty? ") + ("f" . "first ") + ("fi" . "filter ") + ("fp" . "fn? ") + ("fn" . "fn [$]") + ("g" . "get ") + ("gb" . "group-by ") + ("gi" . "get-in ") + ("i" . "into ") + ("ip" . "instance? ") + ("idp" . "identical? ") + ("il" . "if-let [$]") + ("kp" . "keyword? ") + ("l" . "let [$]") + ("let" . "let [$]") + ("loop" . "loop [$]") + ("lp" . "list? ") + ("m" . "map ") + ("mc" . "mapcat ") + ("mp" . "map? ") + ("n" . "not ") + ("np" . "number? ") + ("pl" . "println ") + ("pn" . "println ") + ("r" . "reduce ") + ("rb" . "reset! ") + ("re" . "remove ") + ("rf" . "re-find #\"$\"") + ("rs" . "re-seq #\"$\"") + ("s" . "str ") + ("sb" . "swap! ") + ("sk" . "select-keys ") + ("sp" . "seq? ") + ("stp" . "string? ") + ("syp" . "symbol? ") + ("t" . "throw (Exception. \"$\")") + ("tt" . "testing \"$\"") + ("u" . "update ") + ("ui" . "update-in $ []") + ("vm" . "vary-meta ") + ("vp" . "vector? ") + ("w" . "when ") + ("wn" . "when-not ") + ("wl" . "when-let [$]") + ("wb" . "with-bindings ") + ("wm" . "with-meta ") + ("wo" . "with-open [$]") + ("wr" . "with-redefs [$]") + ("wis" . "with-in-str ") + ("wos" . "with-out-str ") + ) + "Alist of (ABBREV . EXPANSION) used by `sotclojure'.") + +(defun sotclojure-define-function-abbrev (name expansion) + "Define a function abbrev expanding NAME to EXPANSION. +This abbrev will only be expanded in places where a function name is +sensible. Roughly, this is right after a `(' or a `#''. + +If EXPANSION is any string, it doesn't have to be the just the +name of a function. In particular: + - if it contains a `$', this char will not be inserted and + point will be moved to its position after expansion." + (define-abbrev clojure-mode-abbrev-table + name t #'sotclojure--expand-function + ;; Don't override user abbrevs + :system t + ;; Only expand in function places. + :enable-function #'sotclojure--function-p) + (puthash name expansion sotclojure--function-table)) + +(defun sotclojure--expand-function () + "Expand the function abbrev before point. +See `sotclojure-define-function-abbrev'." + (let ((r (point))) + (skip-chars-backward (rx alnum)) + (let* ((name (buffer-substring (point) r)) + (expansion (gethash name sotclojure--function-table nil))) + (if (not expansion) + (progn (goto-char r) nil) + (delete-region (point) r) + (insert expansion) + (when (string-match "\\$" expansion) + (setq sotlisp--needs-moving t)) + ;; Must be last. + (sotlisp--post-expansion-cleanup))))) + +(put 'sotclojure--expand-function 'no-self-insert t) + +(defun sotclojure-erase-all-abbrevs () + "Undefine all abbrevs defined by `sotclojure'." + (interactive) + (maphash (lambda (x _) (define-abbrev clojure-mode-abbrev-table x nil)) + sotclojure--function-table)) + +(defun sotclojure-define-all-abbrevs () + "Define all abbrevs in `sotclojure--default-function-abbrevs'." + (interactive) + (mapc (lambda (x) (sotclojure-define-function-abbrev (car x) (cdr x))) + sotclojure--default-function-abbrevs)) + +(defun sotclojure-find-or-define-function (&optional prefix) + "If symbol under point is a defined function, go to it, otherwise define it. +Essentially `find-function' on steroids. + +If you write in your code the name of a function you haven't +defined yet, just place point on its name and hit \\[sotclojure-find-or-define-function] +and a defun will be inserted with point inside it. After that, +you can just hit `pop-mark' to go back to where you were. +With a PREFIX argument, creates a `defmacro' instead. + +If the function under point is already defined this just calls +`find-function', with one exception: + if there's a defun (or equivalent) for this function in the + current buffer, we go to that even if it's not where the + global definition comes from (this is useful if you're + writing an Emacs package that also happens to be installed + through package.el). + +With a prefix argument, defines a `defmacro' instead of a `defun'." + (interactive "P") + (let ((name (cider-symbol-at-point))) + (unless (and name (sotlisp--find-in-buffer "(def[^ ]* " name)) + (let ((dict (cider-var-info name))) + (if (and dict (> (length dict) 10)) + (cider--find-var name) + (sotlisp--beginning-of-defun) + (insert "(def" (if prefix "macro" "n")) + (save-excursion + (insert " " name "\n \"\"\n [])\n\n"))))))) + + +;;; Mode definition +;;;###autoload +(define-minor-mode sotclojure-mode + nil nil " SoT" + `(([M-return] . sotlisp-newline-and-parentheses) + ([C-return] . sotlisp-downlist-newline-and-parentheses) + (,(kbd "C-M-;") . sotlisp-comment-or-uncomment-sexp) + ("\C-cf" . sotclojure-find-or-define-function)) + (if sotclojure-mode + (abbrev-mode 1) + (kill-local-variable 'abbrev-mode))) + +(provide 'sotclojure) +;;; sotclojure.el ends here + diff --git a/elpa/sotclojure-20170922.8/sotclojure.elc b/elpa/sotclojure-20170922.8/sotclojure.elc new file mode 100644 index 0000000..c1fb6c6 Binary files /dev/null and b/elpa/sotclojure-20170922.8/sotclojure.elc differ diff --git a/elpa/sotlisp-20180706.1749/sotlisp-autoloads.el b/elpa/sotlisp-20180706.1749/sotlisp-autoloads.el new file mode 100644 index 0000000..653612a --- /dev/null +++ b/elpa/sotlisp-20180706.1749/sotlisp-autoloads.el @@ -0,0 +1,41 @@ +;;; sotlisp-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "sotlisp" "sotlisp.el" (23391 65258 0 0)) +;;; Generated autoloads from sotlisp.el + +(defvar speed-of-thought-mode nil "\ +Non-nil if Speed-Of-Thought mode is enabled. +See the `speed-of-thought-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `speed-of-thought-mode'.") + +(custom-autoload 'speed-of-thought-mode "sotlisp" nil) + +(autoload 'speed-of-thought-mode "sotlisp" "\ +Toggle Speed-Of-Thought mode on or off. +With a prefix argument ARG, enable Speed-Of-Thought mode if ARG is +positive, and disable it otherwise. If called from Lisp, enable +the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. +\\{speed-of-thought-mode-map} + +\(fn &optional ARG)" t nil) + +(autoload 'speed-of-thought-hook-in "sotlisp" "\ +Add functions ON and OFF to `speed-of-thought-mode' hooks. +If `speed-of-thought-mode' is already on, call ON. + +\(fn ON OFF)" nil nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; sotlisp-autoloads.el ends here diff --git a/elpa/sotlisp-20180706.1749/sotlisp-pkg.el b/elpa/sotlisp-20180706.1749/sotlisp-pkg.el new file mode 100644 index 0000000..99817a3 --- /dev/null +++ b/elpa/sotlisp-20180706.1749/sotlisp-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "sotlisp" "20180706.1749" "Write lisp at the speed of thought." '((emacs "24.1")) :commit "cc5730c0803a6e0f18e22d6027784b915d304318" :keywords '("convenience" "lisp") :authors '(("Artur Malabarba" . "emacs@endlessparentheses.com")) :maintainer '("Artur Malabarba" . "emacs@endlessparentheses.com") :url "https://github.com/Malabarba/speed-of-thought-lisp") diff --git a/elpa/sotlisp-20180706.1749/sotlisp.el b/elpa/sotlisp-20180706.1749/sotlisp.el new file mode 100644 index 0000000..93e436b --- /dev/null +++ b/elpa/sotlisp-20180706.1749/sotlisp.el @@ -0,0 +1,722 @@ +;;; sotlisp.el --- Write lisp at the speed of thought. -*- lexical-binding: t; -*- + +;; Copyright (C) 2014, 2015 Free Software Foundation, Inc. + +;; Author: Artur Malabarba +;; URL: https://github.com/Malabarba/speed-of-thought-lisp +;; Package-Version: 20180706.1749 +;; Keywords: convenience, lisp +;; Package-Requires: ((emacs "24.1")) +;; Version: 1.6.2 + +;; 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 . + +;;; Commentary: +;; +;; This defines a new global minor-mode `speed-of-thought-mode', which +;; activates locally on any supported buffer. Currently, only +;; `emacs-lisp-mode' buffers are supported. +;; +;; The mode is quite simple, and is composed of two parts: +;; +;;; Abbrevs +;; +;; A large number of abbrevs which expand function +;; initials to their name. A few examples: +;; +;; - wcb -> with-current-buffer +;; - i -> insert +;; - r -> require ' +;; - a -> and +;; +;; However, these are defined in a way such that they ONLY expand in a +;; place where you would use a function, so hitting SPC after "(r" +;; expands to "(require '", but hitting SPC after "(delete-region r" +;; will NOT expand the `r', because that's obviously not a function. +;; Furthermore, "#'r" will expand to "#'require" (note how it omits +;; that extra quote, since it would be useless here). +;; +;;; Commands +;; +;; It also defines 4 commands, which really fit into this "follow the +;; thought-flow" way of writing. The bindings are as follows, I +;; understand these don't fully adhere to conventions, and I'd +;; appreciate suggestions on better bindings. +;; +;; - M-RET :: Break line, and insert "()" with point in the middle. +;; - C-RET :: Do `forward-up-list', then do M-RET. +;; +;; Hitting RET followed by a `(' was one of the most common key sequences +;; for me while writing elisp, so giving it a quick-to-hit key was a +;; significant improvement. +;; +;; - C-c f :: Find function under point. If it is not defined, create a +;; definition for it below the current function and leave point inside. +;; - C-c v :: Same, but for variable. +;; +;; With these commands, you just write your code as you think of it. Once +;; you hit a "stop-point" of sorts in your thought flow, you hit `C-c f/v` +;; on any undefined functions/variables, write their definitions, and hit +;; `C-u C-SPC` to go back to the main function. +;; +;;; Small Example +;; +;; With the above (assuming you use something like paredit or +;; electric-pair-mode), if you write: +;; +;; ( w t b M-RET i SPC text +;; +;; You get +;; +;; (with-temp-buffer (insert text)) + +;;; Code: +(require 'skeleton) + +;;; Predicates +(defun sotlisp--auto-paired-p () + "Non-nil if this buffer auto-inserts parentheses." + (or (bound-and-true-p electric-pair-mode) + (bound-and-true-p paredit-mode) + (bound-and-true-p smartparens-mode) + (bound-and-true-p lispy-mode))) + +(defun sotlisp--looking-back (regexp) + (string-match + (concat regexp "\\'") + (buffer-substring (line-beginning-position) (point)))) + +(defun sotlisp--function-form-p () + "Non-nil if point is at the start of a sexp. +Specially, avoids matching inside argument lists." + (and (eq (char-before) ?\() + (not (sotlisp--looking-back "(\\(defun\\s-+.*\\|\\(lambda\\|dolist\\|dotimes\\)\\s-+\\)(")) + (save-excursion + (forward-char -1) + (condition-case nil + (progn + (backward-up-list) + (forward-sexp -1) + (not + (looking-at-p (rx (* (or (syntax word) (syntax symbol) "-")) + "let" symbol-end)))) + (error t))) + (not (string-match (rx (syntax symbol)) (string last-command-event))))) + +(defun sotlisp--function-quote-p () + "Non-nil if point is at a sharp-quote." + (ignore-errors + (save-excursion + (forward-char -2) + (looking-at-p "#'")))) + +(defun sotlisp--code-p () + (save-excursion + (let ((r (point))) + (beginning-of-defun) + (let ((pps (parse-partial-sexp (point) r))) + (not (or (elt pps 3) + (elt pps 4))))))) + +(defun sotlisp--function-p () + "Non-nil if point is at reasonable place for a function name. +Returns non-nil if, after moving backwards by a sexp, either +`sotlisp--function-form-p' or `sotlisp--function-quote-p' return +non-nil." + (save-excursion + (ignore-errors + (and (not (string-match (rx (syntax symbol)) (string last-command-event))) + (sotlisp--code-p) + (progn + (skip-chars-backward (rx alnum)) + (or (sotlisp--function-form-p) + (sotlisp--function-quote-p))))))) + +(defun sotlisp--whitespace-p () + "Non-nil if current `self-insert'ed char is whitespace." + (sotlisp--whitespace-char-p last-command-event)) +(make-obsolete 'sotlisp--whitespace-p 'sotlisp--whitespace-char-p "1.2") + +(defun sotlisp--whitespace-char-p (char) + "Non-nil if CHAR is has whitespace syntax." + (ignore-errors + (string-match (rx space) (string char)))) + + +;;; Expansion logic +(defvar sotlisp--needs-moving nil + "Will `sotlisp--move-to-$' move point after insertion?") + +(defun sotlisp--move-to-$ () + "Move backwards until `$' and delete it. +Point is left where the `$' char was. Does nothing if variable +`sotlisp-mode' is nil." + (when (bound-and-true-p speed-of-thought-mode) + (when sotlisp--needs-moving + (setq sotlisp--needs-moving nil) + (skip-chars-backward "^\\$") + (delete-char -1)))) + +(add-hook 'post-command-hook #'sotlisp--move-to-$ 'append) + +(defun sotlisp--maybe-skip-closing-paren () + "Move past `)' if variable `electric-pair-mode' is enabled." + (when (and (char-after ?\)) + (sotlisp--auto-paired-p)) + (forward-char 1))) + +(defun sotlisp--post-expansion-cleanup () + "Do some processing conditioned on the expansion done. +If the command that triggered the expansion was a whitespace +char, perform the steps below and return t. + +If the expansion ended in a $, delete it and call +`sotlisp--maybe-skip-closing-paren'. +If it ended in a space and there's a space ahead, delete the +space ahead." + ;; Inform `expand-abbrev' that `self-insert-command' should not + ;; trigger, by returning non-nil on SPC. + (when (sotlisp--whitespace-char-p last-command-event) + ;; And maybe move out of closing paren if expansion ends with $. + (if (eq (char-before) ?$) + (progn (delete-char -1) + (setq sotlisp--needs-moving nil) + (sotlisp--maybe-skip-closing-paren)) + (when (and (sotlisp--whitespace-char-p (char-after)) + (sotlisp--whitespace-char-p (char-before))) + (delete-char 1))) + t)) + +(defvar sotlisp--function-table (make-hash-table :test #'equal) + "Table where function abbrev expansions are stored.") + +(defun sotlisp--expand-function () + "Expand the function abbrev before point. +See `sotlisp-define-function-abbrev'." + (let ((r (point))) + (skip-chars-backward (rx alnum)) + (let* ((name (buffer-substring (point) r)) + (expansion (gethash name sotlisp--function-table))) + (cond + ((not expansion) (progn (goto-char r) nil)) + ((consp expansion) + (delete-region (point) r) + (let ((skeleton-end-newline nil)) + (skeleton-insert (cons "" expansion))) + t) + ((stringp expansion) + (delete-region (point) r) + (if (sotlisp--function-quote-p) + ;; After #' use the simple expansion. + (insert (sotlisp--simplify-function-expansion expansion)) + ;; Inside a form, use the full expansion. + (insert expansion) + (when (string-match "\\$" expansion) + (setq sotlisp--needs-moving t))) + ;; Must be last. + (sotlisp--post-expansion-cleanup)))))) + +(put 'sotlisp--expand-function 'no-self-insert t) + +(defun sotlisp--simplify-function-expansion (expansion) + "Take a substring of EXPANSION up to first space. +The space char is not included. Any \"$\" are also removed." + (replace-regexp-in-string + "\\$" "" + (substring expansion 0 (string-match " " expansion)))) + + +;;; Abbrev definitions +(defconst sotlisp--default-function-abbrevs + '( + ("a" . "and ") + ("ah" . "add-hook '") + ("atl" . "add-to-list '") + ("bb" . "bury-buffer") + ("bc" . "forward-char -1") + ("bfn" . "buffer-file-name") + ("bl" . "buffer-list$") + ("blp" . "buffer-live-p ") + ("bn" . "buffer-name") + ("bod" . "beginning-of-defun") + ("bol" . "forward-line 0$") + ("bp" . "boundp '") + ("bs" . "buffer-string$") + ("bsn" . "buffer-substring-no-properties") + ("bss" . "buffer-substring ") + ("bw" . "forward-word -1") + ("c" . "concat ") + ("ca" . "char-after$") + ("cb" . "current-buffer$") + ("cc" . "condition-case er\n$\n(error nil)") + ("ci" . "call-interactively ") + ("cip" . "called-interactively-p 'any") + ("csv" . "customize-save-variable '") + ("d" . "delete-char 1") + ("dc" . "delete-char 1") + ("dcu" . "defcustom $ t\n \"\"\n :type 'boolean") + ("df" . "defun $ ()\n \"\"\n ") + ("dfa" . "defface $ \n '((t))\n \"\"\n ") + ("dfc" . "defcustom $ t\n \"\"\n :type 'boolean") + ("dff" . "defface $ \n '((t))\n \"\"\n ") + ("dfv" . "defvar $ t\n \"\"") + ("dk" . "define-key ") + ("dl" . "dolist (it $)") + ("dt" . "dotimes (it $)") + ("dmp" . "derived-mode-p '") + ("dm" . "defmacro $ ()\n \"\"\n ") + ("dr" . "delete-region ") + ("dv" . "defvar $ t\n \"\"") + ("e" . "error \"$\"") + ("ef" . "executable-find ") + ("efn" . "expand-file-name ") + ("eol" . "end-of-line") + ("f" . "format \"$\"") + ("fb" . "fboundp '") + ("fbp" . "fboundp '") + ("fc" . "forward-char 1") + ("ff" . "find-file ") + ("fl" . "forward-line 1") + ("fp" . "functionp ") + ("frp" . "file-readable-p ") + ("fs" . "forward-sexp 1") + ("fu" . "funcall ") + ("fw" . "forward-word 1") + ("g" . "goto-char ") + ("gc" . "goto-char ") + ("gsk" . "global-set-key ") + ("i" . "insert ") + ("ie" . "ignore-errors ") + ("ii" . "interactive") + ("il" . "if-let (($))") + ("ir" . "indent-region ") + ("jcl" . "justify-current-line ") + ("jl" . "delete-indentation") + ("jos" . "just-one-space") + ("jr" . "json-read$") + ("jtr" . "jump-to-register ") + ("k" . ("kbd " (format "%S" (key-description (read-key-sequence-vector "Key: "))))) + ("kb" . "kill-buffer") + ("kn" . "kill-new ") + ("kp" . "keywordp ") + ("l" . "lambda ($)") + ("la" . ("looking-at \"" - "\"")) + ("lap" . "looking-at-p \"$\"") + ("lb" . "looking-back \"$\"") + ("lbp" . "line-beginning-position") + ("lep" . "line-end-position") + ("let" . "let (($))") + ("lp" . "listp ") + ("m" . "message \"$%s\"") + ("mb" . "match-beginning 0") + ("mc" . "mapcar ") + ("mct" . "mapconcat ") + ("me" . "match-end 0") + ("ms" . "match-string 0") + ("msn" . "match-string-no-properties 0") + ("msnp" . "match-string-no-properties 0") + ("msp" . "match-string-no-properties 0") + ("mt" . "mapconcat ") + ("n" . "not ") + ("nai" . "newline-and-indent$") + ("nl" . "forward-line 1") + ("np" . "numberp ") + ("ntr" . "narrow-to-region ") + ("ow" . "other-window 1") + ("p" . "point$") + ("pm" . "point-marker$") + ("pa" . "point-max$") + ("pg" . "plist-get ") + ("pi" . "point-min$") + ("pz" . "propertize ") + ("r" . "require '") + ("ra" . "use-region-p$") + ("rap" . "use-region-p$") + ("rb" . "region-beginning") + ("re" . "region-end") + ("rh" . "remove-hook '") + ("rm" . "replace-match \"$\"") + ("ro" . "regexp-opt ") + ("rq" . "regexp-quote ") + ("rris" . "replace-regexp-in-string ") + ("rrs" . "replace-regexp-in-string ") + ("rs" . "while (search-forward $ nil t)\n(replace-match \"\") nil t)") + ("rsb" . "re-search-backward \"$\" nil 'noerror") + ("rsf" . "re-search-forward \"$\" nil 'noerror") + ("s" . "setq ") + ("sb" . "search-backward $ nil 'noerror") + ("sbr" . "search-backward-regexp $ nil 'noerror") + ("scb" . "skip-chars-backward \"$\\r\\n[:blank:]\"") + ("scf" . "skip-chars-forward \"$\\r\\n[:blank:]\"") + ("se" . "save-excursion") + ("sf" . "search-forward $ nil 'noerror") + ("sfr" . "search-forward-regexp $ nil 'noerror") + ("sic" . "self-insert-command") + ("sl" . "setq-local ") + ("sm" . "string-match \"$\"") + ("smd" . "save-match-data") + ("sn" . "symbol-name ") + ("sp" . "stringp ") + ("sq" . "string= ") + ("sr" . "save-restriction") + ("ss" . "substring ") + ("ssn" . "substring-no-properties ") + ("ssnp" . "substring-no-properties ") + ("stb" . "switch-to-buffer ") + ("sw" . "selected-window$") + ("syp" . "symbolp ") + ("tap" . "thing-at-point 'symbol") + ("tf" . "thread-first ") + ("tl" . "thread-last ") + ("u" . "unless ") + ("ul" . "up-list") + ("up" . "unwind-protect\n(progn $)") + ("urp" . "use-region-p$") + ("w" . "when ") + ("wcb" . "with-current-buffer ") + ("wf" . "write-file ") + ("wh" . "while ") + ("wl" . "when-let (($))") + ("we" . "window-end") + ("ws" . "window-start") + ("wsw" . "with-selected-window ") + ("wtb" . "with-temp-buffer") + ("wtf" . "with-temp-file ") + ) + "Alist of (ABBREV . EXPANSION) used by `sotlisp'.") + +(defun sotlisp-define-function-abbrev (name expansion) + "Define a function abbrev expanding NAME to EXPANSION. +This abbrev will only be expanded in places where a function name is +sensible. Roughly, this is right after a `(' or a `#''. + +If EXPANSION is any string, it doesn't have to be the just the +name of a function. In particular: + - if it contains a `$', this char will not be inserted and + point will be moved to its position after expansion. + - if it contains a space, only a substring of it up to the +first space is inserted when expanding after a `#'' (this is done +by defining two different abbrevs). + +For instance, if one defines + (sotlisp-define-function-abbrev \"d\" \"delete-char 1\") + +then triggering `expand-abbrev' after \"d\" expands in the +following way: + (d => (delete-char 1 + #'d => #'delete-char" + (define-abbrev emacs-lisp-mode-abbrev-table + name t #'sotlisp--expand-function + ;; Don't override user abbrevs + :system t + ;; Only expand in function places. + :enable-function #'sotlisp--function-p) + (puthash name expansion sotlisp--function-table)) + +(defun sotlisp-erase-all-abbrevs () + "Undefine all abbrevs defined by `sotlisp'." + (interactive) + (maphash (lambda (x _) (define-abbrev emacs-lisp-mode-abbrev-table x nil)) + sotlisp--function-table)) + +(defun sotlisp-define-all-abbrevs () + "Define all abbrevs in `sotlisp--default-function-abbrevs'." + (interactive) + (mapc (lambda (x) (sotlisp-define-function-abbrev (car x) (cdr x))) + sotlisp--default-function-abbrevs)) + + +;;; The global minor-mode +(defvar speed-of-thought-turn-on-hook '() + "Hook run once when `speed-of-thought-mode' is enabled. +Note that `speed-of-thought-mode' is global, so this is not run +on every buffer. + +See `sotlisp-turn-on-everywhere' for an example of what a +function in this hook should do.") + +(defvar speed-of-thought-turn-off-hook '() + "Hook run once when `speed-of-thought-mode' is disabled. +Note that `speed-of-thought-mode' is global, so this is not run +on every buffer. + +See `sotlisp-turn-on-everywhere' for an example of what a +function in this hook should do.") + +;;;###autoload +(define-minor-mode speed-of-thought-mode + nil nil nil nil + :global t + (run-hooks (if speed-of-thought-mode + 'speed-of-thought-turn-on-hook + 'speed-of-thought-turn-off-hook))) + +;;;###autoload +(defun speed-of-thought-hook-in (on off) + "Add functions ON and OFF to `speed-of-thought-mode' hooks. +If `speed-of-thought-mode' is already on, call ON." + (add-hook 'speed-of-thought-turn-on-hook on) + (add-hook 'speed-of-thought-turn-off-hook off) + (when speed-of-thought-mode (funcall on))) + + +;;; The local minor-mode +(define-minor-mode sotlisp-mode + nil nil " SoT" + `(([M-return] . sotlisp-newline-and-parentheses) + ([C-return] . sotlisp-downlist-newline-and-parentheses) + (,(kbd "C-M-;") . ,(if (fboundp 'comment-or-uncomment-sexp) + #'comment-or-uncomment-sexp + #'sotlisp-comment-or-uncomment-sexp)) + ("\C-cf" . sotlisp-find-or-define-function) + ("\C-cv" . sotlisp-find-or-define-variable)) + (if sotlisp-mode + (abbrev-mode 1) + (kill-local-variable 'abbrev-mode))) + +(defun sotlisp-turn-on-everywhere () + "Call-once function to turn on sotlisp everywhere. +Calls `sotlisp-mode' on all `emacs-lisp-mode' buffers, and sets +up a hook and abbrevs." + (add-hook 'emacs-lisp-mode-hook #'sotlisp-mode) + (sotlisp-define-all-abbrevs) + (mapc (lambda (b) + (with-current-buffer b + (when (derived-mode-p 'emacs-lisp-mode) + (sotlisp-mode 1)))) + (buffer-list))) + +(defun sotlisp-turn-off-everywhere () + "Call-once function to turn off sotlisp everywhere. +Removes `sotlisp-mode' from all `emacs-lisp-mode' buffers, and +removes hooks and abbrevs." + (remove-hook 'emacs-lisp-mode-hook #'sotlisp-mode) + (sotlisp-erase-all-abbrevs) + (mapc (lambda (b) + (with-current-buffer b + (when (derived-mode-p 'emacs-lisp-mode) + (sotlisp-mode -1)))) + (buffer-list))) + +(speed-of-thought-hook-in #'sotlisp-turn-on-everywhere #'sotlisp-turn-off-everywhere) + + +;;; Commands +(defun sotlisp-newline-and-parentheses () + "`newline-and-indent' then insert a pair of parentheses." + (interactive) + (point) + (ignore-errors (expand-abbrev)) + (newline-and-indent) + (insert "()") + (forward-char -1)) + +(defun sotlisp-downlist-newline-and-parentheses () + "`up-list', `newline-and-indent', then insert a parentheses pair." + (interactive) + (ignore-errors (expand-abbrev)) + (up-list) + (newline-and-indent) + (insert "()") + (forward-char -1)) + +(defun sotlisp--find-in-buffer (r s) + "Find the string (concat R (regexp-quote S)) somewhere in this buffer." + (let ((l (save-excursion + (goto-char (point-min)) + (save-match-data + (when (search-forward-regexp (concat r (regexp-quote s) "\\_>") + nil :noerror) + (match-beginning 0)))))) + (when l + (push-mark) + (goto-char l) + l))) + +(defun sotlisp--beginning-of-defun () + "`push-mark' and move above this defun." + (push-mark) + (beginning-of-defun) + (forward-line -1) + (unless (looking-at "^;;;###autoload\\s-*\n") + (forward-line 1))) + +(defun sotlisp--function-at-point () + "Return name of `function-called-at-point'." + (if (save-excursion + (ignore-errors (forward-sexp -1) + (looking-at-p "#'"))) + (thing-at-point 'symbol) + (let ((fcap (function-called-at-point))) + (if fcap + (symbol-name fcap) + (thing-at-point 'symbol))))) + +(defun sotlisp-find-or-define-function (&optional prefix) + "If symbol under point is a defined function, go to it, otherwise define it. +Essentially `find-function' on steroids. + +If you write in your code the name of a function you haven't +defined yet, just place point on its name and hit \\[sotlisp-find-or-define-function] +and a defun will be inserted with point inside it. After that, +you can just hit `pop-mark' to go back to where you were. +With a PREFIX argument, creates a `defmacro' instead. + +If the function under point is already defined this just calls +`find-function', with one exception: + if there's a defun (or equivalent) for this function in the + current buffer, we go to that even if it's not where the + global definition comes from (this is useful if you're + writing an Emacs package that also happens to be installed + through package.el). + +With a prefix argument, defines a `defmacro' instead of a `defun'." + (interactive "P") + (let ((name (sotlisp--function-at-point))) + (unless (and name (sotlisp--find-in-buffer "(def\\(un\\|macro\\|alias\\) " name)) + (let ((name-s (intern-soft name))) + (if (fboundp name-s) + (find-function name-s) + (sotlisp--beginning-of-defun) + (insert "(def" (if prefix "macro" "un") + " " name " (") + (save-excursion (insert ")\n \"\"\n )\n\n"))))))) + +(defun sotlisp-find-or-define-variable (&optional prefix) + "If symbol under point is a defined variable, go to it, otherwise define it. +Essentially `find-variable' on steroids. + +If you write in your code the name of a variable you haven't +defined yet, place point on its name and hit \\[sotlisp-find-or-define-variable] +and a `defcustom' will be created with point inside. After that, +you can just `pop-mark' to go back to where you were. With a +PREFIX argument, creates a `defvar' instead. + +If the variable under point is already defined this just calls +`find-variable', with one exception: + if there's a defvar (or equivalent) for this variable in the + current buffer, we go to that even if it's not where the + global definition comes from (this is useful if you're + writing an Emacs package that also happens to be installed + through package.el). + +With a prefix argument, defines a `defvar' instead of a `defcustom'." + (interactive "P") + (let ((name (symbol-name (variable-at-point t)))) + (unless (sotlisp--find-in-buffer "(def\\(custom\\|const\\|var\\) " name) + (unless (and (symbolp (variable-at-point)) + (ignore-errors (find-variable (variable-at-point)) t)) + (let ((name (thing-at-point 'symbol))) + (sotlisp--beginning-of-defun) + (insert "(def" (if prefix "var" "custom") + " " name " t") + (save-excursion + (insert "\n \"\"" + (if prefix "" "\n :type 'boolean") + ")\n\n"))))))) + + +;;; Comment sexp +(defun sotlisp-uncomment-sexp (&optional n) + "Uncomment a sexp around point." + (interactive "P") + (let* ((initial-point (point-marker)) + (inhibit-field-text-motion t) + (p) + (end (save-excursion + (when (elt (syntax-ppss) 4) + (re-search-backward comment-start-skip + (line-beginning-position) + t)) + (setq p (point-marker)) + (comment-forward (point-max)) + (point-marker))) + (beg (save-excursion + (forward-line 0) + (while (and (not (bobp)) + (= end (save-excursion + (comment-forward (point-max)) + (point)))) + (forward-line -1)) + (goto-char (line-end-position)) + (re-search-backward comment-start-skip + (line-beginning-position) + t) + (ignore-errors + (while (looking-at comment-start-skip) + (forward-char -1)) + (unless (looking-at "[\n\r[:blank]]") + (forward-char 1))) + (point-marker)))) + (unless (= beg end) + (uncomment-region beg end) + (goto-char p) + ;; Indentify the "top-level" sexp inside the comment. + (ignore-errors + (while (>= (point) beg) + (backward-prefix-chars) + (skip-chars-backward "\r\n[:blank:]") + (setq p (point-marker)) + (backward-up-list))) + ;; Re-comment everything before it. + (ignore-errors + (comment-region beg p)) + ;; And everything after it. + (goto-char p) + (forward-sexp (or n 1)) + (skip-chars-forward "\r\n[:blank:]") + (if (< (point) end) + (ignore-errors + (comment-region (point) end)) + ;; If this is a closing delimiter, pull it up. + (goto-char end) + (skip-chars-forward "\r\n[:blank:]") + (when (eq 5 (car (syntax-after (point)))) + (delete-indentation)))) + ;; Without a prefix, it's more useful to leave point where + ;; it was. + (unless n + (goto-char initial-point)))) + +(defun sotlisp--comment-sexp-raw () + "Comment the sexp at point or ahead of point." + (pcase (or (bounds-of-thing-at-point 'sexp) + (save-excursion + (skip-chars-forward "\r\n[:blank:]") + (bounds-of-thing-at-point 'sexp))) + (`(,l . ,r) + (goto-char r) + (skip-chars-forward "\r\n[:blank:]") + (save-excursion + (comment-region l r)) + (skip-chars-forward "\r\n[:blank:]")))) + +(defun sotlisp-comment-or-uncomment-sexp (&optional n) + "Comment the sexp at point and move past it. +If already inside (or before) a comment, uncomment instead. +With a prefix argument N, (un)comment that many sexps." + (interactive "P") + (if (or (elt (syntax-ppss) 4) + (< (save-excursion + (skip-chars-forward "\r\n[:blank:]") + (point)) + (save-excursion + (comment-forward 1) + (point)))) + (sotlisp-uncomment-sexp n) + (dotimes (_ (or n 1)) + (sotlisp--comment-sexp-raw)))) + +(provide 'sotlisp) +;;; sotlisp.el ends here diff --git a/elpa/sotlisp-20180706.1749/sotlisp.elc b/elpa/sotlisp-20180706.1749/sotlisp.elc new file mode 100644 index 0000000..36589cc Binary files /dev/null and b/elpa/sotlisp-20180706.1749/sotlisp.elc differ diff --git a/elpa/srcery-theme-20180729.1444/srcery-theme-autoloads.el b/elpa/srcery-theme-20180729.1444/srcery-theme-autoloads.el new file mode 100644 index 0000000..32ea765 --- /dev/null +++ b/elpa/srcery-theme-20180729.1444/srcery-theme-autoloads.el @@ -0,0 +1,19 @@ +;;; srcery-theme-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "srcery-theme" "srcery-theme.el" (23391 65256 +;;;;;; 0 0)) +;;; Generated autoloads from srcery-theme.el + +(when 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 +;; End: +;;; srcery-theme-autoloads.el ends here diff --git a/elpa/srcery-theme-20180729.1444/srcery-theme-pkg.el b/elpa/srcery-theme-20180729.1444/srcery-theme-pkg.el new file mode 100644 index 0000000..e7c0042 --- /dev/null +++ b/elpa/srcery-theme-20180729.1444/srcery-theme-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "srcery-theme" "20180729.1444" "Dark color theme." '((emacs "24")) :commit "96e2f46b7068b84702809163f4d9d379d22f0395" :keywords '("faces") :authors '(("Daniel Berg")) :maintainer '("Daniel Berg") :url "https://github.com/srcery-colors/srcery-emacs") diff --git a/elpa/srcery-theme-20180729.1444/srcery-theme.el b/elpa/srcery-theme-20180729.1444/srcery-theme.el new file mode 100644 index 0000000..773ed74 --- /dev/null +++ b/elpa/srcery-theme-20180729.1444/srcery-theme.el @@ -0,0 +1,2867 @@ +;;; srcery-theme.el --- Dark color theme. +;; Copyright (C) 2018 Daniel Berg + +;; Author: Daniel Berg +;; URL: https://github.com/srcery-colors/srcery-emacs +;; Package-Version: 20180729.1444 + +;; Version: 0.1.0 +;; Keywords: faces +;; Package-Requires: ((emacs "24")) + +;; 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 . + +;; This file is not part of Emacs. + +;;; Commentary: + +;; Port of vim-srcery: https://github.com/srcery-colors/srcery-vim , a dark color theme +;; with with focus on clearly defined contrastig colors and relative ease of +;; use. Srcery should play well with a 256 color terminal, provided the terminal +;; colors are set to srcery colors. See here for sample terminal configs: +;; https://github.com/srcery-colors/srcery-terminal + +;;; Credits + +;; Nasser Alshammari +;; https://github.com/nashamri/spacemacs-theme +;; I used this theme as a base for how to make an Emacs color theme + +;; Kelvin Smith +;; https://github.com/oneKelvinSmith/monokai-emacs +;; Used as a reference for 256 color handling + +;;; Code: + +(unless (>= emacs-major-version 24) + (error "Srcery theme requires Emacs 24 or later!")) + +(deftheme srcery "Srcery color theme") + +(defgroup srcery nil + "Srcery options." + :group 'faces) + +(defcustom srcery-org-height t + "Use varying text heights for org headings." + :type 'boolean + :group 'srcery) + +(defcustom srcery-invert-matches nil + "Use inverse video for search matches." + :type 'boolean + :group 'srcery) + +(defcustom srcery-invert-region t + "Use inverse video for region." + :type 'boolean + :group 'srcery) + +(defcustom srcery-transparent-background nil + "Sets black background color to nil in terminal" + :type 'boolean + :group 'srcery) + +(defcustom srcery-black "#1C1B19" + "Palette - black." + :type 'string + :group 'srcery) + +(defcustom srcery-red "#EF2F27" + "Palette - red." + :type 'string + :group 'srcery) + +(defcustom srcery-green "#519F50" + "Palette - green." + :type 'string + :group 'srcery) + +(defcustom srcery-yellow "#FBB829" + "Palette - yellow." + :type 'string + :group 'srcery) + +(defcustom srcery-blue "#2C78BF" + "Palette - blue." + :type 'string + :group 'srcery) + +(defcustom srcery-magenta "#E02C6D" + "Palette - magenta." + :type 'string + :group 'srcery) + +(defcustom srcery-cyan "#0AAEB3" + "Palette - cyan." + :type 'string + :group 'srcery) + +(defcustom srcery-white "#918175" + "Palette - white." + :type 'string + :group 'srcery) + +(defcustom srcery-bright-black "#2D2C29" + "Palette - bright black." + :type 'string + :group 'srcery) + +(defcustom srcery-bright-red "#F75341" + "Palette - bright red." + :type 'string + :group 'srcery) + +(defcustom srcery-bright-green "#98BC37" + "Palette - bright green." + :type 'string + :group 'srcery) + +(defcustom srcery-bright-yellow "#FED06E" + "Palette - bright yellow." + :type 'string + :group 'srcery) + +(defcustom srcery-bright-blue "#68A8E4" + "Palette - bright blue." + :type 'string + :group 'srcery) + +(defcustom srcery-bright-magenta "#FF5C8F" + "Palette - bright magenta." + :type 'string + :group 'srcery) + +(defcustom srcery-bright-cyan "#53FDE9" + "Palette - bright cyan." + :type 'string + :group 'srcery) + +(defcustom srcery-bright-white "#FCE8C3" + "Palette - bright white." + :type 'string + :group 'srcery) + +(defcustom srcery-orange "#D75F00" + "Palette xterm 166 - orange." + :type 'string + :group 'srcery) + +(defcustom srcery-bright-orange "#FF8700" + "Palette xterm 208 - bright orange." + :type 'string + :group 'srcery) + +(defcustom srcery-hard-black "#121212" + "Palette xterm 233 - hard black." + :type 'string + :group 'srcery) + +(defcustom srcery-gray-1 "#262626" + "Palette xterm 235 - gray 1." + :type 'string + :group 'srcery) + +(defcustom srcery-gray-2 "#303030" + "Palette xterm 236 - gray 2." + :type 'string + :group 'srcery) + +(defcustom srcery-gray-3 "#3A3A3A" + "Palette xterm 237 - gray 3." + :type 'string + :group 'srcery) + +(defcustom srcery-gray-4 "#444444" + "Palette xterm 238 - gray 4." + :type 'string + :group 'srcery) + +(defcustom srcery-gray-5 "#4E4E4E" + "Palette xterm 239 - gray 5." + :type 'string + :group 'srcery) + +(let* ((srcery-class '((class color) (min-colors 257))) + + (srcery-256-class '((class color) (min-colors 89))) + + (srcery-256-black "black") + (srcery-256-red "red") + (srcery-256-green "green") + (srcery-256-yellow "yellow") + (srcery-256-blue "blue") + (srcery-256-magenta "magenta") + (srcery-256-cyan "cyan") + (srcery-256-white "white") + (srcery-256-bright-black "brightblack") + (srcery-256-bright-red "brightred") + (srcery-256-bright-green "brightgreen") + (srcery-256-bright-yellow "brightyellow") + (srcery-256-bright-blue "brightblue") + (srcery-256-bright-magenta "brightmagenta") + (srcery-256-bright-cyan "brightcyan") + (srcery-256-bright-white "brightwhite") + + (srcery-256-orange "color-166") + (srcery-256-bright-orange "color-208") + (srcery-256-hard-black "color-233") + (srcery-256-gray1 "color-235") + (srcery-256-gray2 "color-236") + (srcery-256-gray3 "color-237") + (srcery-256-gray4 "color-238") + (srcery-256-gray5 "color-239")) + + (custom-theme-set-faces + 'srcery + + ;; basics + `(cursor + ((,srcery-class (:background ,srcery-bright-white :foreground ,srcery-black :inverse-video t)) + (,srcery-256-class (:background ,srcery-256-bright-white :foreground ,srcery-256-black :inverse-video t)))) + + `(custom-button + ((,srcery-class (:background ,srcery-black :foreground ,srcery-bright-white :box (:line-width 2 :style released-button))) + (,srcery-256-class (:background ,(if srcery-transparent-background nil srcery-256-black) :foreground ,srcery-256-bright-white :box (:line-width 2 :style released-button))))) + + `(default + ((,srcery-class (:background ,srcery-black :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,(if srcery-transparent-background nil srcery-256-black) :foreground ,srcery-256-bright-white)))) + + `(default-italic + ((,srcery-class (:italic t)) + (,srcery-256-class (:italic t)))) + + `(error + ((,srcery-class (:foreground ,srcery-red :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-red :weight bold)))) + + `(eval-sexp-fu-flash + ((,srcery-class (:background ,srcery-green)) + (,srcery-256-class (:background ,srcery-256-green)))) + + `(eval-sexp-fu-flash-error + ((,srcery-class (:background ,srcery-red)) + (,srcery-256-class (:background ,srcery-256-red)))) + + `(font-lock-builtin-face + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(font-lock-comment-face + ((,srcery-class (:foreground ,srcery-white :italic t)) + (,srcery-256-class (:foreground ,srcery-256-white :italic t)))) + + `(font-lock-constant-face + ((,srcery-class (:foreground ,srcery-bright-magenta)) + (,srcery-256-class (:foreground ,srcery-256-bright-magenta)))) + + `(font-lock-reference-face + ((,srcery-class (:foreground ,srcery-bright-blue)) + (,srcery-256-class (:foreground ,srcery-256-bright-blue)))) + + `(font-lock-doc-face + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(font-lock-function-name-face + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(font-lock-keyword-face + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(font-lock-negation-char-face + ((,srcery-class (:foreground ,srcery-bright-magenta)) + (,srcery-256-class (:foreground ,srcery-256-bright-magenta)))) + + `(font-lock-preprocessor-face + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(font-lock-string-face + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(font-lock-type-face + ((,srcery-class (:foreground ,srcery-bright-blue)) + (,srcery-256-class (:foreground ,srcery-256-bright-blue)))) + + `(font-lock-variable-name-face + ((,srcery-class (:foreground ,srcery-cyan)) + (,srcery-256-class (:foreground ,srcery-256-cyan)))) + + `(font-lock-warning-face + ((,srcery-class (:foreground ,srcery-bright-orange :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-bright-orange :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(fringe + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(header-line + ((,srcery-class (:background ,srcery-black)) + (,srcery-256-class (:background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(highlight + ((,srcery-class ,(if srcery-invert-matches + `(:inverse-video t) + `(:background ,srcery-gray-4 :weight bold))) + (,srcery-256-class ,(if srcery-invert-matches + `(:inverse-video t) + `(:background ,srcery-256-gray4 :weight bold))))) + + `(hl-line + ((,srcery-class (:background ,srcery-bright-black)) + (,srcery-256-class (:background ,srcery-256-bright-black)))) + + `(isearch + ((,srcery-class ,(if srcery-invert-matches + `(:inverse-video t :underline t :weight bold) + `(:underline t :background ,srcery-gray-4 :weight bold))) + (,srcery-256-class ,(if srcery-invert-matches + `(:inverse-video t :underline t :weight bold) + `(:underline t :background ,srcery-256-gray4 :weight bold))))) + `(isearch-fail + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(lazy-highlight + ((,srcery-class ,(if srcery-invert-matches + `(:inverse-video t) + `(:background ,srcery-gray-4 :weight bold))) + (,srcery-256-class ,(if srcery-invert-matches + `(:inverse-video t) + `(:background ,srcery-256-gray4 :weight bold))))) + + `(link + ((,srcery-class (:inherit font-lock-comment-face :underline t)) + (,srcery-256-class (:inherit font-lock-comment-face :underline t)))) + + `(link-visited + ((,srcery-class (:inherit font-lock-comment-face :underline t)) + (,srcery-256-class (:inherit font-lock-comment-face :underline t)))) + + `(match + ((,srcery-class ,(if srcery-invert-matches + `(:inverse-video t) + `(:background ,srcery-gray-4 :weight bold))) + (,srcery-256-class ,(if srcery-invert-matches + `(:inverse-video t) + `(:background ,srcery-256-gray4 :weight bold))))) + + `(minibuffer-prompt + ((,srcery-class (:weight bold :foreground ,srcery-yellow)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-yellow)))) + + `(page-break-lines + ((,srcery-class (:foreground ,srcery-gray-3)) + (,srcery-256-class (:foreground ,srcery-256-gray3)))) + + `(region + ((,srcery-class ,(if srcery-invert-region + `(:inverse-video t) + `(:background ,srcery-hard-black :weight bold))) + (,srcery-256-class ,(if srcery-invert-region + `(:inverse-video t) + `(:background ,srcery-256-hard-black :weight bold))))) + + `(secondary-selection + ((,srcery-class (:background ,srcery-gray-2)) + (,srcery-256-class (:background ,srcery-256-gray2)))) + + `(success + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(tooltip + ((,srcery-class (:background ,srcery-bright-blue :foreground ,srcery-bright-white :bold nil :italic nil :underline nil)) + (,srcery-256-class (:background ,srcery-256-bright-blue :foreground ,srcery-256-bright-white :bold nil :italic nil :underline nil)))) + + `(vertical-border + ((,srcery-class (:foreground ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-magenta)))) + + `(warning + ((,srcery-class (:foreground ,srcery-bright-orange)) + (,srcery-256-class (:foreground ,srcery-256-bright-orange)))) + + `(tool-bar + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + + ;; ahs + `(ahs-face + ((,srcery-class (:background ,srcery-magenta)) + (,srcery-256-class (:background ,srcery-256-magenta)))) + + `(ahs-plugin-whole-buffer-face + ((,srcery-class (:background ,srcery-yellow :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-yellow :foreground ,srcery-256-black)))) + + `(ahs-edit-mode-face + ((,srcery-class (:background ,srcery-bright-red :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-bright-red :foreground ,srcery-256-bright-white)))) + + ;; anzu-mode + `(anzu-mode-line + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + ;; auto-complete + `(ac-completion-face + ((,srcery-class (:background ,srcery-bright-black :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-bright-black :foreground ,srcery-256-bright-white)))) + + ;; avy + `(avy-lead-face + ((,srcery-class (:background ,srcery-bright-black :foreground ,srcery-bright-magenta)) + (,srcery-256-class (:background ,srcery-256-bright-black :foreground ,srcery-256-bright-magenta)))) + + `(avy-lead-face-0 + ((,srcery-class (:background ,srcery-bright-black :foreground ,srcery-bright-yellow)) + (,srcery-256-class (:background ,srcery-256-bright-black :foreground ,srcery-256-bright-yellow)))) + + `(avy-lead-face-1 + ((,srcery-class (:background ,srcery-bright-black :foreground ,srcery-bright-green)) + (,srcery-256-class (:background ,srcery-256-bright-black :foreground ,srcery-256-bright-green)))) + + `(avy-lead-face-2 + ((,srcery-class (:background ,srcery-bright-black :foreground ,srcery-bright-blue)) + (,srcery-256-class (:background ,srcery-256-bright-black :foreground ,srcery-256-bright-blue)))) + + + ;; cider + `(cider-enlightened + ((,srcery-class (:background nil :box (:color ,srcery-yellow :line-width -1 :style nil) :foreground ,srcery-yellow)) + (,srcery-256-class (:background nil :box (:color ,srcery-256-yellow :line-width -1 :style nil) :foreground ,srcery-256-yellow)))) + + `(cider-enlightened-face + ((,srcery-class (:background nil :box (:color ,srcery-white :line-width -1 :style nil) :foreground ,srcery-blue)) + (,srcery-256-class (:background nil :box (:color ,srcery-256-white :line-width -1 :style nil) :foreground ,srcery-256-blue)))) + + `(cider-enlightened-local + ((,srcery-class (:foreground ,srcery-bright-yellow)) + (,srcery-256-class (:foreground ,srcery-256-bright-yellow)))) + + `(cider-instrumented-face + ((,srcery-class (:background nil :box (:color ,srcery-red :line-width -1 :style nil) :foreground ,srcery-red)) + (,srcery-256-class (:background nil :box (:color ,srcery-256-red :line-width -1 :style nil) :foreground ,srcery-256-red)))) + + `(cider-result-overlay-face + ((,srcery-class (:background nil :box (:color ,srcery-blue :line-width -1 :style nil) :foreground ,srcery-blue)) + (,srcery-256-class (:background nil :box (:color ,srcery-256-blue :line-width -1 :style nil) :foreground ,srcery-256-blue)))) + + `(cider-test-error-face + ((,srcery-class (:background ,srcery-bright-orange :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-orange :foreground ,srcery-256-black)))) + + `(cider-test-failure-face + ((,srcery-class (:background ,srcery-red :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-red :foreground ,srcery-256-bright-white)))) + + `(cider-test-success-face + ((,srcery-class (:background ,srcery-green :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-green :foreground ,srcery-256-black)))) + + `(cider-traced-face + ((,srcery-class :box (:color ,srcery-cyan :line-width -1 :style nil)) + (,srcery-256-class :box (:color ,srcery-256-cyan :line-width -1 :style nil)))) + + `(cider-fringe-good-face + ((,srcery-class :foreground ,srcery-green) + (,srcery-256-class :foreground ,srcery-256-green))) + + `(cider-fragile-button-face + ((,srcery-class :foreground ,srcery-orange :box (:style released-button)) + (,srcery-256-class :foreground ,srcery-256-orange :box (:style released-button)))) + + `(cider-stacktrace-promoted-button-face + ((,srcery-class :foreground ,srcery-red :box (:style released-button)) + (,srcery-256-class :foreground ,srcery-256-red :box (:style released-button)))) + + `(cider-stacktrace-suppressed-button-face + ((,srcery-class :foreground ,srcery-white :box (:style pressed-button)) + (,srcery-256-class :foreground ,srcery-256-white :box (:style pressed-button)))) + + `(cider-enlightened-local-face + ((,srcery-class :foreground ,srcery-yellow :weight bold) + (,srcery-256-class :foreground ,srcery-256-yellow :weight bold))) + + `(cider-deprecated-face + ((,srcery-class :background ,srcery-bright-yellow :foreground ,srcery-black) + (,srcery-256-class :background ,srcery-256-bright-yellow :foreground ,srcery-256-black))) + + `(cider-debug-code-overlay-face + ((,srcery-class :background ,srcery-bright-blue :foreground ,srcery-black) + (,srcery-256-class :background ,srcery-256-bright-blue :foreground ,srcery-256-black))) + + `(cider-docview-table-border-face + ((,srcery-class :foreground ,srcery-white) + (,srcery-256-class :foreground ,srcery-256-white))) + + ;; clojure + `(clojure-keyword-face + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + ;; company + `(company-echo-common + ((,srcery-class (:background ,srcery-bright-white :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-white :foreground ,srcery-256-black)))) + + `(company-preview + ((,srcery-class (:background ,srcery-gray-1 :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-gray1 :foreground ,srcery-256-bright-white)))) + + `(company-preview-common + ((,srcery-class (:background ,srcery-gray-1 :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-gray1 :foreground ,srcery-256-bright-white)))) + + `(company-preview-search + ((,srcery-class (:inherit match)) + (,srcery-256-class (:inherit match)))) + + `(company-scrollbar-bg + ((,srcery-class (:background ,srcery-gray-1)) + (,srcery-256-class (:background ,srcery-256-gray1)))) + + `(company-scrollbar-fg + ((,srcery-class (:background ,srcery-white)) + (,srcery-256-class (:background ,srcery-256-white)))) + + `(company-template-field + ((,srcery-class (:inherit region)) + (,srcery-256-class (:inherit region)))) + + `(company-tooltip + ((,srcery-class (:background ,srcery-gray-1 :foreground ,srcery-white)) + (,srcery-256-class (:background ,srcery-256-gray1 :foreground ,srcery-256-white)))) + + `(company-tooltip-annotation + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(company-tooltip-common + ((,srcery-class (:background ,srcery-gray-1 :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-gray1 :foreground ,srcery-256-bright-white)))) + + `(company-tooltip-common-selection + ((,srcery-class (:foreground ,srcery-bright-magenta)) + (,srcery-256-class (:foreground ,srcery-256-bright-magenta)))) + + `(company-tooltip-mouse + ((,srcery-class (:inherit highlight)) + (,srcery-256-class (:inherit highlight)))) + + `(company-tooltip-search + ((,srcery-class (:inherit match)) + (,srcery-256-class (:inherit match)))) + + `(company-tooltip-selection + ((,srcery-class (:foreground ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-magenta)))) + + ;; racer + `(racer-tooltip + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-gray-1)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,srcery-256-gray1)))) + + `(racer-help-heading-face + ((,srcery-class (:foreground ,srcery-bright-white :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :weight bold)))) + + ;; rust + `(rust-builtin-formatting-macro-face + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(rust-question-mark-face + ((,srcery-class (:foreground ,srcery-blue :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-blue :weight bold)))) + + `(rust-string-interpolation-face + ((,srcery-class (:foreground ,srcery-bright-green :italic t)) + (,srcery-256-class (:foreground ,srcery-256-bright-green :italic t)))) + + `(rust-unsafe-face + ((,srcery-class (:foreground ,srcery-bright-orange)) + (,srcery-256-class (:foreground ,srcery-256-bright-orange)))) + + ;; diff + `(diff-added + ((,srcery-class :background nil :foreground ,srcery-green) + (,srcery-256-class :background nil :foreground ,srcery-256-green))) + + `(diff-changed + ((,srcery-class :background nil :foreground ,srcery-red) + (,srcery-256-class :background nil :foreground ,srcery-256-red))) + + `(diff-header + ((,srcery-class :background ,srcery-bright-black :foreground ,srcery-yellow) + (,srcery-256-class :background ,srcery-256-bright-black :foreground ,srcery-256-yellow))) + + `(diff-indicator-added + ((,srcery-class :background nil :foreground ,srcery-green) + (,srcery-256-class :background nil :foreground ,srcery-256-green))) + + `(diff-indicator-changed + ((,srcery-class :background nil :foreground ,srcery-red) + (,srcery-256-class :background nil :foreground ,srcery-256-red))) + + `(diff-indicator-removed + ((,srcery-class :background nil :foreground ,srcery-red) + (,srcery-256-class :background nil :foreground ,srcery-256-red))) + + `(diff-refine-added + ((,srcery-class :background ,srcery-green :foreground ,srcery-black) + (,srcery-256-class :background ,srcery-256-green :foreground ,srcery-256-black))) + + `(diff-refine-changed + ((,srcery-class :background ,srcery-blue :foreground ,srcery-bright-white) + (,srcery-256-class :background ,srcery-256-blue :foreground ,srcery-256-bright-white))) + + `(diff-refine-removed + ((,srcery-class :background ,srcery-red :foreground ,srcery-bright-white) + (,srcery-256-class :background ,srcery-256-red :foreground ,srcery-256-bright-white))) + + `(diff-removed + ((,srcery-class :background nil :foreground ,srcery-red) + (,srcery-256-class :background nil :foreground ,srcery-256-red))) + + ;; diff-hl + `(diff-hl-change + ((,srcery-class :foreground ,srcery-blue) + (,srcery-256-class :foreground ,srcery-256-blue))) + + `(diff-hl-delete + ((,srcery-class :foreground ,srcery-red) + (,srcery-256-class :foreground ,srcery-256-red))) + + `(diff-hl-insert + ((,srcery-class :foreground ,srcery-green) + (,srcery-256-class :foreground ,srcery-256-green))) + + ;; dired + `(dired-directory + ((,srcery-class (:foreground ,srcery-blue :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-blue :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(dired-flagged + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(dired-header + ((,srcery-class (:foreground ,srcery-green :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-green :weight bold)))) + + `(dired-ignored + ((,srcery-class (:inherit shadow)) + (,srcery-256-class (:inherit shadow)))) + + `(dired-mark + ((,srcery-class (:foreground ,srcery-green :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-green :weight bold)))) + + `(dired-marked + ((,srcery-class (:foreground ,srcery-magenta :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-magenta :weight bold)))) + + `(dired-perm-write + ((,srcery-class (:foreground ,srcery-bright-white :underline t)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :underline t)))) + + `(dired-symlink + ((,srcery-class (:foreground ,srcery-cyan :background ,srcery-black :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-cyan :background ,(if srcery-transparent-background nil srcery-256-black) :weight bold)))) + + `(dired-warning + ((,srcery-class (:foreground ,srcery-bright-orange)) + (,srcery-256-class (:foreground ,srcery-256-bright-orange)))) + + `(diredp-date-time + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(diredp-number + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(diredp-file-name + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(diredp-file-suffix + ((,srcery-class (:foreground ,srcery-bright-blue)) + (,srcery-256-class (:foreground ,srcery-256-bright-blue)))) + + `(diredp-dir-heading + ((,srcery-class (:foreground ,srcery-bright-white :underline t)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :underline t)))) + + `(diredp-dir-heading + ((,srcery-class (:foreground ,srcery-bright-white :underline t)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :underline t)))) + + `(diredp-dir-priv + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(diredp-read-priv + ((,srcery-class (:foreground ,srcery-bright-yellow)) + (,srcery-256-class (:foreground ,srcery-256-bright-yellow)))) + + `(diredp-write-priv + ((,srcery-class (:foreground ,srcery-bright-red)) + (,srcery-256-class (:foreground ,srcery-256-bright-red)))) + + `(diredp-write-priv + ((,srcery-class (:foreground ,srcery-bright-red)) + (,srcery-256-class (:foreground ,srcery-256-bright-red)))) + + `(diredp-dir-name + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(diredp-exec-priv + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(diredp-symlink + ((,srcery-class (:foreground ,srcery-bright-cyan)) + (,srcery-256-class (:foreground ,srcery-256-bright-cyan)))) + + `(diredp-tagged-autofile-name + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,srcery-256-magenta)))) + + `(diredp-no-priv + ((,srcery-class (:foreground ,srcery-white)) + (,srcery-256-class (:foreground ,srcery-256-white)))) + + `(diredp-flag-mark + ((,srcery-class (:background ,srcery-green :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-green :foreground ,srcery-256-black)))) + + `(diredp-flag-mark-line + ((,srcery-class (:background ,srcery-green :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-green :foreground ,srcery-256-black)))) + + `(diredp-autofile-name + ((,srcery-class (:background ,srcery-blue :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-blue :foreground ,srcery-256-bright-white)))) + + `(diredp-deletion + ((,srcery-class (:background ,srcery-red :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-red :foreground ,srcery-256-bright-white)))) + + `(diredp-ignored-file-name + ((,srcery-class (:foreground ,srcery-white)) + (,srcery-256-class (:foreground ,srcery-256-white)))) + + `(diredp-link-priv + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(diredp-mode-line-marked + ((,srcery-class (:foreground ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-magenta)))) + + `(diredp-other-priv + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(diredp-rare-priv + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + ;; ediff + `(ediff-current-diff-A + ((,srcery-class(:background ,srcery-gray-1 :foreground ,srcery-red)) + (,srcery-256-class(:background ,srcery-256-gray1 :foreground ,srcery-256-red)))) + + `(ediff-current-diff-Ancestor + ((,srcery-class(:background ,srcery-black :foreground ,srcery-cyan)) + (,srcery-256-class(:background ,(if srcery-transparent-background nil srcery-256-black) :foreground ,srcery-256-cyan)))) + + `(ediff-current-diff-B + ((,srcery-class(:foreground ,srcery-green)) + (,srcery-256-class(:foreground ,srcery-256-green)))) + + `(ediff-current-diff-C + ((,srcery-class(:background ,srcery-blue :foreground ,srcery-blue)) + (,srcery-256-class(:background ,srcery-256-blue :foreground ,srcery-256-blue)))) + + `(ediff-even-diff-A + ((,srcery-class(:background ,srcery-bright-black)) + (,srcery-256-class(:background ,srcery-256-bright-black)))) + + `(ediff-even-diff-Ancestor + ((,srcery-class(:background ,srcery-bright-black)) + (,srcery-256-class(:background ,srcery-256-bright-black)))) + + `(ediff-even-diff-B + ((,srcery-class(:background ,srcery-bright-black)) + (,srcery-256-class(:background ,srcery-256-bright-black)))) + + `(ediff-even-diff-C + ((,srcery-class(:background ,srcery-bright-black)) + (,srcery-256-class(:background ,srcery-256-bright-black)))) + + `(ediff-fine-diff-A + ((,srcery-class(:background nil :weight bold)) + (,srcery-256-class(:background nil :weight bold)))) + + `(ediff-fine-diff-Ancestor + ((,srcery-class(:background nil :weight bold)) + (,srcery-256-class(:background nil :weight bold)))) + + `(ediff-fine-diff-B + ((,srcery-class(:background nil :weight bold)) + (,srcery-256-class(:background nil :weight bold)))) + + `(ediff-fine-diff-C + ((,srcery-class(:background nil :weight bold)) + (,srcery-256-class(:background nil :weight bold)))) + + `(ediff-odd-diff-A + ((,srcery-class(:background ,srcery-black)) + (,srcery-256-class(:background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(ediff-odd-diff-Ancestor + ((,srcery-class(:background ,srcery-black)) + (,srcery-256-class(:background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(ediff-odd-diff-B + ((,srcery-class(:background ,srcery-black)) + (,srcery-256-class(:background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(ediff-odd-diff-C + ((,srcery-class(:background ,srcery-black)) + (,srcery-256-class(:background ,(if srcery-transparent-background nil srcery-256-black))))) + + + ;; ein + `(ein:cell-input-area + ((,srcery-class (:background ,srcery-bright-black)) + (,srcery-256-class (:background ,srcery-256-bright-black)))) + + `(ein:cell-input-prompt + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(ein:cell-output-prompt + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(ein:notification-tab-normal + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(ein:notification-tab-selected + ((,srcery-class (:foreground ,srcery-green :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-green :weight bold)))) + + ;;eldoc + `(eldoc-highlight-function-argument + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + + ;; enh-ruby + `(enh-ruby-string-delimiter-face + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(enh-ruby-op-face + ((,srcery-class (:background ,srcery-black :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,(if srcery-transparent-background nil srcery-256-black) :foreground ,srcery-256-bright-white)))) + + ;; erc + `(erc-input-face + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(erc-my-nick-face + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(erc-nick-default-face + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(erc-nick-prefix-face + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(erc-notice-face + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(erc-prompt-face + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + `(erc-timestamp-face + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + + ;; eshell + `(eshell-ls-archive + ((,srcery-class (:foreground ,srcery-red :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-red :weight bold)))) + + `(eshell-ls-backup + ((,srcery-class (:inherit font-lock-comment-face)) + (,srcery-256-class (:inherit font-lock-comment-face)))) + + `(eshell-ls-clutter + ((,srcery-class (:inherit font-lock-comment-face)) + (,srcery-256-class (:inherit font-lock-comment-face)))) + + `(eshell-ls-directory + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(eshell-ls-executable + ((,srcery-class (:foreground ,srcery-orange :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-orange :weight bold)))) + + `(eshell-ls-missing + ((,srcery-class (:inherit font-lock-warning-face)) + (,srcery-256-class (:inherit font-lock-warning-face)))) + + `(eshell-ls-product + ((,srcery-class (:inherit font-lock-doc-face)) + (,srcery-256-class (:inherit font-lock-doc-face)))) + + `(eshell-ls-special + ((,srcery-class (:foreground ,srcery-magenta :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-magenta :weight bold)))) + + `(eshell-ls-symlink + ((,srcery-class (:foreground ,srcery-cyan :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-cyan :weight bold)))) + + `(eshell-ls-unreadable + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(eshell-prompt + ((,srcery-class (:foreground ,srcery-magenta :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-magenta :weight bold)))) + + ;; evil + `(evil-ex-substitute-matches + ((,srcery-class (:background ,srcery-red :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-red :foreground ,srcery-256-bright-white)))) + + `(evil-ex-substitute-replacement + ((,srcery-class (:background ,srcery-bright-green :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-green :foreground ,srcery-256-black)))) + + `(evil-search-highlight-persist-highlight-face + ((,srcery-class ,(if srcery-invert-matches + `(:inverse-video t) + `(:background ,srcery-gray-4 :weight bold))) + (,srcery-256-class ,(if srcery-invert-matches + `(:inverse-video t) + `(:background ,srcery-256-gray4 :weight bold))))) + + `(flycheck-error + ((,srcery-class (:foreground ,srcery-red :underline t)) + (,srcery-256-class (:foreground ,srcery-256-red :underline t)))) + + `(flycheck-info + ((,srcery-class (:foreground ,srcery-bright-white :underline t)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :underline t)))) + + `(flycheck-warning + ((,srcery-class (:foreground ,srcery-bright-orange :underline t)) + (,srcery-256-class (:foreground ,srcery-bright-orange :underline t)))) + + `(flycheck-error-list-checker-name + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(flycheck-fringe-error + ((,srcery-class (:foreground ,srcery-red :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-red :weight bold)))) + + `(flycheck-fringe-info + ((,srcery-class (:foreground ,srcery-red :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-red :weight bold)))) + + `(flycheck-fringe-warning + ((,srcery-class (:foreground ,srcery-bright-orange :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-bright-orange :weight bold)))) + + ;; Flyspell + ;; ------------------------------ + `(flyspell-duplicate + ((,srcery-class (:foreground ,srcery-bright-white :underline t)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :underline t)))) + + `(flyspell-incorrect + ((,srcery-class (:foreground ,srcery-red :underline t)) + (,srcery-256-class (:foreground ,srcery-256-red :underline t)))) + + ;; jabber + `(jabber-activity-face + ((,srcery-class (:weight bold :foreground ,srcery-red)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-red)))) + + `(jabber-activity-personal-face + ((,srcery-class (:weight bold :foreground ,srcery-blue)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-blue)))) + + `(jabber-chat-error + ((,srcery-class (:weight bold :foreground ,srcery-red)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-red)))) + + `(jabber-chat-prompt-foreign + ((,srcery-class (:weight bold :foreground ,srcery-red)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-red)))) + + `(jabber-chat-prompt-local + ((,srcery-class (:weight bold :foreground ,srcery-blue)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-blue)))) + + `(jabber-chat-prompt-system + ((,srcery-class (:weight bold :foreground ,srcery-green)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-green)))) + + `(jabber-chat-text-foreign + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(jabber-chat-text-local + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(jabber-rare-time-face + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(jabber-roster-user-away + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(jabber-roster-user-chatty + ((,srcery-class (:weight bold :foreground ,srcery-green)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-green)))) + + `(jabber-roster-user-dnd + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(jabber-roster-user-error + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(jabber-roster-user-offline + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(jabber-roster-user-online + ((,srcery-class (:weight bold :foreground ,srcery-green)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-green)))) + + `(jabber-roster-user-xa + ((,srcery-class (:foreground ,srcery-cyan)) + (,srcery-256-class (:foreground ,srcery-256-cyan)))) + + ;; git + `(git-commit-summary + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(git-commit-nonempty-second-line + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(diff-file-header + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(diff-hunk-header + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(diff-function + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(diff-header + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + ;; git-gutter-fr + `(git-gutter-fr:added + ((,srcery-class (:foreground ,srcery-green :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-green :weight bold)))) + + `(git-gutter-fr:deleted + ((,srcery-class (:foreground ,srcery-red :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-red :weight bold)))) + + `(git-gutter-fr:modified + ((,srcery-class (:foreground ,srcery-blue :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-blue :weight bold)))) + + `(git-gutter+-added + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(git-gutter+-deleted + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(git-gutter+-separator + ((,srcery-class (:foreground ,srcery-cyan)) + (,srcery-256-class (:foreground ,srcery-256-cyan)))) + + `(git-gutter+-modified + ((,srcery-class (:foreground ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-magenta)))) + + `(git-gutter+-unchanged + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(git-gutter:added + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(git-gutter:modified + ((,srcery-class (:foreground ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-magenta)))) + + `(git-gutter:unchanged + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + ;; git-timemachine + `(git-timemachine-minibuffer-detail-face + ((,srcery-class (:foreground ,srcery-blue :weight bold :background ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue :weight bold :background ,srcery-256-blue)))) + + + ;; gnus + `(gnus-emphasis-highlight-words + ((,srcery-class (:background ,srcery-green :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-green :foreground ,srcery-256-black)))) + + `(gnus-header-content + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(gnus-header-from + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(gnus-header-name + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(gnus-header-subject + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + `(gnus-summary-cancelled + ((,srcery-class (:background ,srcery-bright-orange :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-orange :foreground ,srcery-256-black)))) + + ;; guide-key + `(guide-key/highlight-command-face + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(guide-key/key-face + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(guide-key/prefix-command-face + ((,srcery-class (:foreground ,srcery-red :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-red :weight bold)))) + + ;; helm + `(helm-bookmark-directory + ((,srcery-class (:inherit helm-ff-directory)) + (,srcery-256-class (:inherit helm-ff-directory)))) + + `(helm-bookmark-file + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(helm-bookmark-gnus + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(helm-bookmark-info + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(helm-bookmark-man + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(helm-bookmark-w3m + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(helm-buffer-directory + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(helm-buffer-file + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-buffer-not-saved + ((,srcery-class (:foreground ,srcery-green :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-green :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-buffer-process + ((,srcery-class (:foreground ,srcery-red :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-red :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-buffer-saved-out + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-buffer-size + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-candidate-number + ((,srcery-class (:background ,srcery-black :foreground ,srcery-red :weight bold)) + (,srcery-256-class (:background ,(if srcery-transparent-background nil srcery-256-black) :foreground ,srcery-256-red :weight bold)))) + + `(helm-ff-directory + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(helm-ff-dotted-directory + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(helm-ff-dotted-symlink-directory + ((,srcery-class (:foreground ,srcery-cyan)) + (,srcery-256-class (:foreground ,srcery-256-cyan)))) + + `(helm-ff-executable + ((,srcery-class (:foreground ,srcery-green :background ,srcery-black :weight normal)) + (,srcery-256-class (:foreground ,srcery-256-green :background ,(if srcery-transparent-background nil srcery-256-black) :weight normal)))) + + `(helm-ff-file + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-black :weight normal)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,(if srcery-transparent-background nil srcery-256-black) :weight normal)))) + + `(helm-ff-invalid-symlink + ((,srcery-class (:foreground ,srcery-red :background ,srcery-black :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-red :background ,(if srcery-transparent-background nil srcery-256-black) :weight bold)))) + + `(helm-ff-prefix + ((,srcery-class (:foreground ,srcery-black :background ,srcery-red :weight normal)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-red :weight normal)))) + + `(helm-ff-symlink + ((,srcery-class (:foreground ,srcery-cyan :background ,srcery-black :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-cyan :background ,(if srcery-transparent-background nil srcery-256-black) :weight bold)))) + + `(helm-grep-cmd-line + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-grep-file + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-grep-finish + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-grep-lineno + ((,srcery-class (:foreground ,srcery-bright-blue :background ,srcery-black :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-bright-blue :background ,(if srcery-transparent-background nil srcery-256-black) :weight bold)))) + + `(helm-grep-match + ((,srcery-class (:foreground nil :background nil :inherit helm-match)) + (,srcery-256-class (:foreground nil :background nil :inherit helm-match)))) + + `(helm-header + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-black :underline nil :box nil)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,(if srcery-transparent-background nil srcery-256-black) :underline nil :box nil)))) + + `(helm-header-line-left-margin + ((,srcery-class (:foreground ,srcery-red :background ,nil)) + (,srcery-256-class (:foreground ,srcery-256-red :background ,nil)))) + + `(helm-match + ((,srcery-class (:foreground ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-magenta)))) + + `(helm-match-item + ((,srcery-class (:foreground ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-magenta)))) + + `(helm-moccur-buffer + ((,srcery-class (:foreground ,srcery-blue :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-blue :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-selection + ((,srcery-class (:background ,srcery-bright-black :weight bold)) + (,srcery-256-class (:background ,srcery-256-bright-black :weight bold)))) + + `(helm-selection-line + ((,srcery-class (:background ,srcery-bright-black :weight bold)) + (,srcery-256-class (:background ,srcery-256-bright-black :weight bold)))) + + `(helm-separator + ((,srcery-class (:foreground ,srcery-green :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-green :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-source-header + ((,srcery-class (:background ,srcery-black :foreground ,srcery-green :underline t)) + (,srcery-256-class (:background ,(if srcery-transparent-background nil srcery-256-black) :foreground ,srcery-256-green :underline t)))) + + `(helm-time-zone-current + ((,srcery-class (:foreground ,srcery-red :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-red :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-time-zone-home + ((,srcery-class (:foreground ,srcery-green :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-green :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-visible-mark + ((,srcery-class (:foreground ,srcery-red :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-red :background ,(if srcery-transparent-background nil srcery-256-black))))) + + + ;; helm-swoop + `(helm-swoop-target-line-block-face + ((,srcery-class (:foreground ,srcery-yellow :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-yellow :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(helm-swoop-target-line-face + ((,srcery-class (:background ,srcery-bright-black :weight bold)) + (,srcery-256-class (:background ,srcery-256-bright-black :weight bold)))) + + `(helm-swoop-target-word-face + ((,srcery-class (:foreground ,srcery-magenta :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-magenta :weight bold)))) + + ;; highlights + `(hi-yellow + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(hi-green + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + ;; highlight-indentation + `(highlight-indentation-face + ((,srcery-class (:background ,srcery-white)) + (,srcery-256-class (:background ,srcery-256-white)))) + + ;; highlight-symbol + `(highlight-symbol-face + ((,srcery-class (:background ,srcery-bright-black)) + (,srcery-256-class (:background ,srcery-256-bright-black)))) + + ;; hydra + `(hydra-face-blue + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(hydra-face-red + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + ;; ido + `(ido-first-match + ((,srcery-class (:foreground ,srcery-green :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-green :weight bold)))) + + `(ido-only-match + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + `(ido-subdir + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(ido-indicator + ((,srcery-class (:background ,srcery-red :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-red :foreground ,srcery-256-bright-white)))) + + `(ido-vertical-match-face + ((,srcery-class (:foreground ,srcery-green :underline nil)) + (,srcery-256-class (:foreground ,srcery-256-green :underline nil)))) + + ;; info + `(info-header-xref + ((,srcery-class (:foreground ,srcery-yellow :underline t)) + (,srcery-256-class (:foreground ,srcery-256-yellow :underline t)))) + + `(info-menu + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(info-node + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + `(info-quoted-name + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(info-reference-item + ((,srcery-class (:background nil :underline t :weight bold)) + (,srcery-256-class (:background nil :underline t :weight bold)))) + + `(info-string + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(info-title-1 + ((,srcery-class (:height 1.4 :weight bold)) + (,srcery-256-class (:height 1.4 :weight bold)))) + + `(info-title-2 + ((,srcery-class (:height 1.3 :weight bold)) + (,srcery-256-class (:height 1.3 :weight bold)))) + + `(info-title-3 + ((,srcery-class (:height 1.3)) + (,srcery-256-class (:height 1.3)))) + + `(info-title-4 + ((,srcery-class (:height 1.2)) + (,srcery-256-class (:height 1.2)))) + + ;; ivy + `(ivy-current-match + ((,srcery-class (:background ,srcery-magenta :weight bold)) + (,srcery-256-class (:background ,srcery-256-magenta :weight bold)))) + + `(ivy-minibuffer-match-face-1 + ((,srcery-class (:weight bold)) + (,srcery-256-class (:weight bold)))) + + `(ivy-minibuffer-match-face-2 + ((,srcery-class (:foreground ,srcery-blue :underline t)) + (,srcery-256-class (:foreground ,srcery-256-blue :underline t)))) + + `(ivy-minibuffer-match-face-3 + ((,srcery-class (:foreground ,srcery-yellow :underline t)) + (,srcery-256-class (:foreground ,srcery-256-yellow :underline t)))) + + `(ivy-minibuffer-match-face-4 + ((,srcery-class (:foreground ,srcery-bright-green :underline t)) + (,srcery-256-class (:foreground ,srcery-256-bright-green :underline t)))) + + `(ivy-remote + ((,srcery-class (:foreground ,srcery-cyan)) + (,srcery-256-class (:foreground ,srcery-256-cyan)))) + + ;; latex + `(font-latex-bold-face + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(font-latex-italic-face + ((,srcery-class (:foreground ,srcery-red :italic t)) + (,srcery-256-class (:foreground ,srcery-256-red :italic t)))) + + `(font-latex-match-reference-keywords + ((,srcery-class (:foreground ,srcery-bright-magenta)) + (,srcery-256-class (:foreground ,srcery-256-bright-magenta)))) + + `(font-latex-match-variable-keywords + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(font-latex-sectioning-0-face + ((,srcery-class (:weight bold :foreground ,srcery-bright-green :height ,(if srcery-org-height 1.3 1.0))) + (,srcery-256-class (:weight bold :foreground ,srcery-256-bright-green :height ,(if srcery-org-height 1.3 1.0))))) + + `(font-latex-sectioning-1-face + ((,srcery-class (:weight bold :foreground ,srcery-bright-yellow :height ,(if srcery-org-height 1.3 1.0))) + (,srcery-256-class (:weight bold :foreground ,srcery-256-bright-yellow :height ,(if srcery-org-height 1.3 1.0))))) + + `(font-latex-sectioning-2-face + ((,srcery-class (:weight bold :foreground ,srcery-blue :height ,(if srcery-org-height 1.3 1.0))) + (,srcery-256-class (:weight bold :foreground ,srcery-256-blue :height ,(if srcery-org-height 1.3 1.0))))) + + `(font-latex-sectioning-3-face + ((,srcery-class (:weight bold :foreground ,srcery-cyan :height ,(if srcery-org-height 1.2 1.0))) + (,srcery-256-class (:weight bold :foreground ,srcery-256-cyan :height ,(if srcery-org-height 1.2 1.0))))) + + `(font-latex-sectioning-4-face + ((,srcery-class (:bold nil :foreground ,srcery-bright-green :height ,(if srcery-org-height 1.1 1.0))) + (,srcery-class (:bold nil :foreground ,srcery-256-bright-green :height ,(if srcery-org-height 1.1 1.0))))) + + `(font-latex-sectioning-5-face + ((,srcery-class (:bold nil :foreground ,srcery-yellow)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-yellow)))) + + `(font-latex-string-face + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + ;; Line numbers + `(linum + ((,srcery-class (:foreground ,srcery-white :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-white :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(linum-relative-current-face + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(line-number + ((,srcery-class (:foreground ,srcery-white :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-white :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(line-number-current-line + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + ;; Git + `(diff-context + ((,srcery-class :foreground ,srcery-bright-white) + (,srcery-256-class :foreground ,srcery-256-bright-white))) + + ;; magit + `(magit-blame-culprit + ((,srcery-class :foreground ,srcery-yellow) + (,srcery-256-class :foreground ,srcery-256-yellow))) + + `(magit-blame-header + ((,srcery-class :foreground ,srcery-green) + (,srcery-256-class :foreground ,srcery-256-green))) + + `(magit-blame-sha1 + ((,srcery-class :foreground ,srcery-yellow) + (,srcery-256-class :foreground ,srcery-256-yellow))) + + `(magit-blame-subject + ((,srcery-class :foreground ,srcery-yellow) + (,srcery-256-class :foreground ,srcery-256-yellow))) + + `(magit-blame-time + ((,srcery-class :foreground ,srcery-green) + (,srcery-256-class :foreground ,srcery-256-green))) + + `(magit-blame-name + ((,srcery-class :foreground ,srcery-yellow) + (,srcery-256-class :foreground ,srcery-256-yellow))) + + `(magit-blame-heading + ((,srcery-class :foreground ,srcery-green) + (,srcery-256-class :foreground ,srcery-256-green))) + + `(magit-blame-hash + ((,srcery-class :foreground ,srcery-yellow) + (,srcery-256-class :foreground ,srcery-256-yellow))) + + `(magit-blame-summary + ((,srcery-class :foreground ,srcery-yellow) + (,srcery-256-class :foreground ,srcery-256-yellow))) + + `(magit-blame-date + ((,srcery-class :foreground ,srcery-green) + (,srcery-256-class :foreground ,srcery-256-green))) + + `(magit-log-date + ((,srcery-class :foreground ,srcery-bright-white) + (,srcery-256-class :foreground ,srcery-256-bright-white))) + + `(magit-log-graph + ((,srcery-class :foreground ,srcery-bright-white) + (,srcery-256-class :foreground ,srcery-256-bright-white))) + + `(magit-reflog-amend + ((,srcery-class :foreground ,srcery-magenta) + (,srcery-256-class :foreground ,srcery-256-magenta))) + + `(magit-reflog-other + ((,srcery-class :foreground ,srcery-cyan) + (,srcery-256-class :foreground ,srcery-256-cyan))) + + `(magit-reflog-rebase + ((,srcery-class :foreground ,srcery-magenta) + (,srcery-256-class :foreground ,srcery-256-magenta))) + + `(magit-reflog-remote + ((,srcery-class :foreground ,srcery-cyan) + (,srcery-256-class :foreground ,srcery-256-cyan))) + + `(magit-reflog-reset + ((,srcery-class :foreground ,srcery-red) + (,srcery-256-class :foreground ,srcery-256-red))) + + `(magit-branch + ((,srcery-class (:foreground ,srcery-bright-magenta :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-bright-magenta :weight bold)))) + + `(magit-branch-current + ((,srcery-class (:background ,srcery-black :foreground ,srcery-blue :weight bold :box t)) + (,srcery-256-class (:background ,(if srcery-transparent-background nil srcery-256-black) :foreground ,srcery-256-blue :weight bold :box t)))) + + `(magit-branch-local + ((,srcery-class (:background ,srcery-black :foreground ,srcery-blue :weight bold)) + (,srcery-256-class (:background ,(if srcery-transparent-background nil srcery-256-black) :foreground ,srcery-256-blue :weight bold)))) + + `(magit-branch-remote + ((,srcery-class (:background ,srcery-black :foreground ,srcery-orange :weight bold)) + (,srcery-256-class (:background ,(if srcery-transparent-background nil srcery-256-black) :foreground ,srcery-256-orange :weight bold)))) + + `(magit-diff-file-header + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(magit-diff-file-heading + ((,srcery-class (:foreground ,srcery-blue :weight light)) + (,srcery-256-class (:foreground ,srcery-256-blue :weight light)))) + + `(magit-diff-file-heading-highlight + ((,srcery-class (:foreground ,srcery-blue :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-blue :weight bold)))) + + `(magit-diff-file-heading-selection + ((,srcery-class (:foreground ,srcery-blue :weight bold :background ,srcery-bright-black)) + (,srcery-256-class (:foreground ,srcery-256-blue :weight bold :background ,srcery-256-bright-black)))) + + + `(magit-diff-hunk-heading + ((,srcery-class (:foreground ,srcery-yellow :weight light)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight light)))) + + `(magit-diff-hunk-heading-highlight + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + `(magit-diff-hunk-heading-selection + ((,srcery-class (:foreground ,srcery-black :background ,srcery-white :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-white :weight bold)))) + + + `(magit-diff-added + ((,srcery-class (:foreground ,srcery-green :weight light)) + (,srcery-256-class (:foreground ,srcery-256-green :weight light)))) + + `(magit-diff-removed + ((,srcery-class (:foreground ,srcery-red :weight light)) + (,srcery-256-class (:foreground ,srcery-256-red :weight light)))) + + `(magit-diff-context + ((,srcery-class (:foreground ,srcery-white :weight light)) + (,srcery-256-class (:foreground ,srcery-256-white :weight light)))) + + `(magit-diff-added-highlight + ((,srcery-class (:foreground ,srcery-green :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-green :weight bold)))) + + `(magit-diff-removed-highlight + ((,srcery-class (:foreground ,srcery-red :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-red :weight bold)))) + + `(magit-diff-context-highlight + ((,srcery-class (:foreground ,srcery-white :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-white :weight bold)))) + + `(magit-diff-base + ((,srcery-class (:foreground ,srcery-white :weight light)) + (,srcery-256-class (:foreground ,srcery-256-white :weight light)))) + + `(magit-diff-base-highlight + ((,srcery-class (:foreground ,srcery-white :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-white :weight bold)))) + + `(magit-diff-lines-boundary + ((,srcery-class (:background ,srcery-white :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-white :foreground ,srcery-256-black)))) + + `(magit-diff-lines-heading + ((,srcery-class (:background ,srcery-white :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-white :foreground ,srcery-256-black)))) + + `(magit-hash + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(magit-item-highlight + ((,srcery-class :background ,srcery-bright-black) + (,srcery-256-class :background ,srcery-256-bright-black))) + + `(magit-log-author + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(magit-log-head-label-head + ((,srcery-class (:background ,srcery-yellow :foreground ,srcery-black :weight bold)) + (,srcery-256-class (:background ,srcery-256-yellow :foreground ,srcery-256-black :weight bold)))) + + `(magit-log-head-label-local + ((,srcery-class (:background ,srcery-red :foreground ,srcery-black :weight bold)) + (,srcery-256-class (:background ,srcery-256-red :foreground ,srcery-256-black :weight bold)))) + + `(magit-log-head-label-remote + ((,srcery-class (:background ,srcery-green :foreground ,srcery-black :weight bold)) + (,srcery-256-class (:background ,srcery-256-green :foreground ,srcery-256-black :weight bold)))) + + `(magit-log-head-label-tags + ((,srcery-class (:background ,srcery-magenta :foreground ,srcery-black :weight bold)) + (,srcery-256-class (:background ,srcery-256-magenta :foreground ,srcery-256-black :weight bold)))) + + `(magit-log-head-label-wip + ((,srcery-class (:background ,srcery-cyan :foreground ,srcery-black :weight bold)) + (,srcery-256-class (:background ,srcery-256-cyan :foreground ,srcery-256-black :weight bold)))) + + `(magit-log-sha1 + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(magit-process-ng + ((,srcery-class (:foreground ,srcery-bright-orange :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-bright-orange :weight bold)))) + + `(magit-process-ok + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + `(magit-section-heading + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(magit-section-highlight + ((,srcery-class (:weight bold)) + (,srcery-256-class (:weight bold)))) + + `(section-heading-selection + ((,srcery-class (:foreground ,srcery-red :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-red :weight bold)))) + + `(magit-section-title + ((,srcery-class (:background ,srcery-black :foreground ,srcery-red :weight bold)) + (,srcery-256-class (:background ,(if srcery-transparent-background nil srcery-256-black) :foreground ,srcery-256-red :weight bold)))) + + `(magit-cherry-equivalent + ((,srcery-class (:foreground ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-magenta)))) + + `(magit-cherry-unmatched + ((,srcery-class (:foreground ,srcery-cyan)) + (,srcery-256-class (:foreground ,srcery-256-cyan)))) + + `(magit-reflog-checkout + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(magit-reflog-cherry-pick + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(magit-bisect-bad + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(magit-bisect-good + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(magit-bisect-skip + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(magit-diff-conflict-heading + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(magithub-ci-no-status + ((,srcery-class (:foreground ,srcery-gray-5)) + (,srcery-256-class (:foreground ,srcery-256-gray5)))) + + `(magithub-issue-number + ((,srcery-class (:foreground ,srcery-white)) + (,srcery-256-class (:foreground ,srcery-256-white)))) + + `(magithub-notification-reason + ((,srcery-class (:foreground ,srcery-white)) + (,srcery-256-class (:foreground ,srcery-256-white)))) + + ;; smerge + `(smerge-base + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(smerge-markers + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(smerge-mine + ((,srcery-class (:foreground nil)) + (,srcery-256-class (:foreground ,nil)))) + + `(smerge-other + ((,srcery-class (:background ,srcery-bright-black)) + (,srcery-256-class (:background ,srcery-256-bright-black)))) + + `(smerge-refined-added + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(smerge-refined-changed + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(smerge-refined-removed + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(smerge-upper + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(smerge-lower + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + ;; man + `(Man-overstrike + ((,srcery-class (:foreground ,srcery-blue :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-blue :weight bold)))) + + `(Man-reverse + ((,srcery-class (:foreground ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-magenta)))) + + `(Man-underline + ((,srcery-class (:foreground ,srcery-green :underline t)) + (,srcery-256-class (:foreground ,srcery-256-green :underline t)))) + + + ;; markdown + `(markdown-header-face-1 + ((,srcery-class (:weight bold :foreground ,srcery-blue :height ,(if srcery-org-height 1.3 1.0))) + (,srcery-256-class (:weight bold :foreground ,srcery-256-blue :height ,(if srcery-org-height 1.3 1.0))))) + + `(markdown-header-face-2 + ((,srcery-class (:weight bold :foreground ,srcery-bright-cyan :height ,(if srcery-org-height 1.2 1.0))) + (,srcery-256-class (:weight bold :foreground ,srcery-256-bright-cyan :height ,(if srcery-org-height 1.2 1.0))))) + + `(markdown-header-face-3 + ((,srcery-class (:bold nil :foreground ,srcery-bright-green :height ,(if srcery-org-height 1.1 1.0))) + (,srcery-256-class (:bold nil :foreground ,srcery-256-bright-green :height ,(if srcery-org-height 1.1 1.0))))) + + `(markdown-header-face-4 + ((,srcery-class (:bold nil :foreground ,srcery-yellow)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-yellow)))) + + `(markdown-header-face-5 + ((,srcery-class (:bold nil :foreground ,srcery-blue)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-blue)))) + + `(markdown-header-face-6 + ((,srcery-class (:bold nil :foreground ,srcery-cyan)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-cyan)))) + + `(markdown-html-tag-delimiter-face + ((,srcery-class (:bold nil :foreground ,srcery-gray-5)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-gray5)))) + + `(markdown-list-face + ((,srcery-class (:bold nil :foreground ,srcery-gray-5)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-gray5)))) + + `(markdown-markup-face + ((,srcery-class (:bold nil :foreground ,srcery-gray-5)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-gray5)))) + + ;; mu4e + `(mu4e-cited-1-face + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(mu4e-cited-7-face + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(mu4e-header-marks-face + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(mu4e-header-key-face + ((,srcery-class (:foreground ,srcery-cyan :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-cyan :weight bold)))) + + `(mu4e-view-url-number-face + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(mu4e-unread-face + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + ;; neotree + `(neo-dir-link-face + ((,srcery-class (:foreground ,srcery-red :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-red :weight bold)))) + + `(neo-expand-btn-face + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(neo-file-link-face + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(neo-root-dir-face + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + ;; org + `(org-agenda-clocking + ((,srcery-class (:background ,srcery-magenta :foreground ,srcery-green)) + (,srcery-256-class (:background ,srcery-256-magenta :foreground ,srcery-256-green)))) + + `(org-agenda-date + ((,srcery-class (:foreground ,srcery-blue :height ,(if srcery-org-height 1.1 1.0))) + (,srcery-256-class (:foreground ,srcery-256-blue :height ,(if srcery-org-height 1.1 1.0))))) + + `(org-agenda-date-today + ((,srcery-class (:foreground ,srcery-red :slant italic :weight bold :height ,(if srcery-org-height 1.3 1.0))) + (,srcery-256-class (:foreground ,srcery-256-red :slant italic :weight bold :height ,(if srcery-org-height 1.3 1.0))))) + + `(org-agenda-date-weekend + ((,srcery-class (:weight bold :foreground ,srcery-blue)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-blue)))) + + `(org-agenda-done + ((,srcery-class (:foreground ,srcery-green :height ,(if srcery-org-height 1.2 1.0))) + (,srcery-256-class (:foreground ,srcery-256-green :height ,(if srcery-org-height 1.2 1.0))))) + + `(org-agenda-structure + ((,srcery-class (:weight bold :foreground ,srcery-green)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-green)))) + + `(org-block + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(org-block-begin-line + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(org-block-end-line + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(org-clock-overlay + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(org-code + ((,srcery-class (:foreground ,srcery-cyan)) + (,srcery-256-class (:foreground ,srcery-256-cyan)))) + + `(org-column + ((,srcery-class (:background ,srcery-magenta)) + (,srcery-256-class (:background ,srcery-256-magenta)))) + + `(org-column-title + ((,srcery-class (:background ,srcery-magenta)) + (,srcery-256-class (:background ,srcery-256-magenta)))) + + `(org-date + ((,srcery-class (:underline t :foreground ,srcery-blue)) + (,srcery-256-class (:underline t :foreground ,srcery-256-blue)))) + + `(org-date-selected + ((,srcery-class (:background ,srcery-yellow :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-yellow :foreground ,srcery-256-black)))) + + `(org-document-info-keyword + ((,srcery-class (:foreground ,srcery-white)) + (,srcery-256-class (:foreground ,srcery-256-white)))) + + `(org-document-info + ((,srcery-class (:foreground ,srcery-bright-magenta)) + (,srcery-256-class (:foreground ,srcery-256-bright-magenta)))) + + `(org-document-title + ((,srcery-class (:foreground ,srcery-yellow :weight bold :height ,(if srcery-org-height 1.4 1.0))) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold :height ,(if srcery-org-height 1.4 1.0))))) + + `(org-done + ((,srcery-class (:foreground ,srcery-green :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-green :weight bold)))) + + `(org-ellipsis + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(org-footnote + ((,srcery-class (:underline t :foreground ,srcery-bright-white)) + (,srcery-256-class (:underline t :foreground ,srcery-256-bright-white)))) + + `(org-hide + ((,srcery-class (:foreground ,srcery-black :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-black)))) + + `(org-kbd + ((,srcery-class (:inherit region :foreground ,srcery-bright-white :box (:line-width 1 :style released-button))) + (,srcery-256-class (:inherit region :foreground ,srcery-256-bright-white :box (:line-width 1 :style released-button))))) + + `(org-level-1 + ((,srcery-class (:weight bold :foreground ,srcery-bright-blue :height ,(if srcery-org-height 1.3 1.0))) + (,srcery-256-class (:weight bold :foreground ,srcery-256-bright-blue :height ,(if srcery-org-height 1.3 1.0))))) + + `(org-level-2 + ((,srcery-class (:weight bold :foreground ,srcery-green :height ,(if srcery-org-height 1.2 1.0))) + (,srcery-256-class (:weight bold :foreground ,srcery-256-green :height ,(if srcery-org-height 1.2 1.0))))) + + `(org-level-3 + ((,srcery-class (:bold nil :foreground ,srcery-yellow :height ,(if srcery-org-height 1.1 1.0))) + (,srcery-256-class (:bold nil :foreground ,srcery-256-yellow :height ,(if srcery-org-height 1.1 1.0))))) + + `(org-level-4 + ((,srcery-class (:bold nil :foreground ,srcery-blue)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-blue)))) + + `(org-level-5 + ((,srcery-class (:bold nil :foreground ,srcery-cyan)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-cyan)))) + + `(org-level-6 + ((,srcery-class (:bold nil :foreground ,srcery-green)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-green)))) + + `(org-level-7 + ((,srcery-class (:bold nil :foreground ,srcery-bright-orange)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-orange)))) + + `(org-level-8 + ((,srcery-class (:bold nil :foreground ,srcery-bright-magenta)) + (,srcery-256-class (:bold nil :foreground ,srcery-256-bright-magenta)))) + + `(org-link + ((,srcery-class (:foreground ,srcery-white :underline t)) + (,srcery-256-class (:foreground ,srcery-256-white :underline t)))) + + `(org-meta-line + ((,srcery-class (:foreground ,srcery-white)) + (,srcery-256-class (:foreground ,srcery-256-white)))) + + `(org-mode-line-clock-overrun + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(org-mode-line-clock + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(org-priority + ((,srcery-class (:foreground ,srcery-bright-orange :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-bright-orange :weight bold)))) + + `(org-quote + ((,srcery-class (:inherit org-block :slant italic)) + (,srcery-256-class (:inherit org-block :slant italic)))) + + `(org-scheduled + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(org-scheduled-today + ((,srcery-class (:foreground ,srcery-yellow :height ,(if srcery-org-height 1.2 1.0))) + (,srcery-256-class (:foreground ,srcery-256-yellow :height ,(if srcery-org-height 1.2 1.0))))) + + `(org-sexp-date + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(org-special-keyword + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(org-table + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-gray-1)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,srcery-256-gray1)))) + + `(org-time-grid + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(org-todo + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + `(org-verbatim + ((,srcery-class (:foreground ,srcery-bright-orange)) + (,srcery-256-class (:foreground ,srcery-256-bright-orange)))) + + `(org-verse + ((,srcery-class (:inherit org-block :slant italic)) + (,srcery-256-class (:inherit org-block :slant italic)))) + + `(org-warning + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + ;; perspective + `(persp-selected-face + ((,srcery-class (:weight bold :foreground ,srcery-yellow)) + (,srcery-256-class (:weight bold :foreground ,srcery-256-yellow)))) + + ;; popup + `(popup-face + ((,srcery-class (:background ,srcery-bright-black :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-bright-black :foreground ,srcery-256-bright-white)))) + + `(popup-tip-face + ((,srcery-class (:background ,srcery-bright-blue :foreground ,srcery-bright-white :bold nil :italic nil :underline nil)) + (,srcery-256-class (:background ,srcery-256-bright-blue :foreground ,srcery-256-bright-white :bold nil :italic nil :underline nil)))) + + `(popup-menu-face + ((,srcery-class (:background ,srcery-bright-black :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-bright-black :foreground ,srcery-256-bright-white)))) + + `(popup-enu-selection-face + ((,srcery-class (:background ,srcery-bright-blue :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-bright-blue :foreground ,srcery-256-bright-white)))) + + `(popup-menu-mouse-face + ((,srcery-class (:inherit highlight)) + (,srcery-256-class (:inherit highlight)))) + + `(popup-isearch-match + ((,srcery-class (:inherit match)) + (,srcery-256-class (:inherit match)))) + + `(popup-scroll-bar-foreground-face + ((,srcery-class (:background ,srcery-gray-4)) + (,srcery-256-class (:background ,srcery-256-gray4)))) + + `(popup-scroll-bar-background-face + ((,srcery-class (:background ,srcery-bright-black)) + (,srcery-256-class (:background ,srcery-256-bright-black)))) + + + ;; mode-line + `(powerline-active1 + ((,srcery-class (:background ,srcery-gray-3 :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-gray3 :foreground ,srcery-256-bright-white)))) + + `(powerline-active2 + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-bright-black)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,srcery-256-bright-black)))) + + `(powerline-inactive1 + ((,srcery-class (:background ,srcery-bright-black :foreground ,srcery-white)) + (,srcery-256-class (:background ,srcery-256-bright-black :foreground ,srcery-256-white)))) + + `(powerline-inactive2 + ((,srcery-class (:background ,srcery-bright-black :foreground ,srcery-white)) + (,srcery-256-class (:background ,srcery-256-bright-black :foreground ,srcery-256-white)))) + + `(mode-line + ((,srcery-class (:foreground ,srcery-white :background ,srcery-bright-black)) + (,srcery-256-class (:foreground ,srcery-256-white :background ,srcery-256-bright-black)))) + + `(mode-line-inactive + ((,srcery-class (:foreground ,srcery-white :background ,srcery-bright-black)) + (,srcery-256-class (:foreground ,srcery-256-white :background ,srcery-256-bright-black)))) + + `(mode-line-buffer-id + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(mode-line-highlight + ((,srcery-class (:background ,srcery-bright-black :box (:color ,srcery-magenta :line-width 1))) + (,srcery-256-class (:background ,srcery-256-bright-black :box (:color ,srcery-256-magenta :line-width 1))))) + + `(mode-line-buffer-id-inactive + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(magit-mode-line-process + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + ;; `(mode-line-emphasis + ;; ((,srcery-class (:weight bold :foreground ,srcery-yellow)) + ;; (,srcery-256-class (:weight bold :foreground ,srcery-256-yellow)))) + + `(spaceline-python-venv + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(spaceline-flycheck-error + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(spaceline-flycheck-info + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(spaceline-flycheck-warning + ((,srcery-class (:foreground ,srcery-bright-orange)) + (,srcery-256-class (:foreground ,srcery-256-bright-orange)))) + + `(spaceline-evil-normal + ((,srcery-class (:background ,srcery-gray-4 :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-gray4 :foreground ,srcery-256-bright-white)))) + + `(spaceline-evil-insert + ((,srcery-class (:background ,srcery-bright-white :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-white :foreground ,srcery-256-black)))) + + `(spaceline-evil-replace + ((,srcery-class (:background ,srcery-bright-red :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-bright-red :foreground ,srcery-256-bright-white)))) + + `(spaceline-evil-visual + ((,srcery-class (:background ,srcery-cyan :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-cyan :foreground ,srcery-256-black)))) + + `(spaceline-evil-motion + ((,srcery-class (:background ,srcery-bright-magenta :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-magenta :foreground ,srcery-256-black)))) + + `(spaceline-evil-emacs + ((,srcery-class (:background ,srcery-orange :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-orange :foreground ,srcery-256-bright-white)))) + + `(spaceline-unmodified + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(spaceline-modified + ((,srcery-class (:background ,srcery-bright-orange :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-orange :foreground ,srcery-256-black)))) + + `(spaceline-read-only + ((,srcery-class (:background ,srcery-gray-1 :foreground ,srcery-orange)) + (,srcery-256-class (:background ,srcery-256-gray1 :foreground ,srcery-256-orange)))) + + `(spaceline-highlight-face + ((,srcery-class (:background ,srcery-yellow :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-yellow :foreground ,srcery-256-black)))) + + + ;; rainbow-delimiters + `(rainbow-delimiters-depth-1-face + ((,srcery-class :foreground ,srcery-bright-white) + (,srcery-256-class :foreground ,srcery-256-bright-white))) + + `(rainbow-delimiters-depth-2-face + ((,srcery-class :foreground ,srcery-bright-blue) + (,srcery-256-class :foreground ,srcery-256-bright-blue))) + + `(rainbow-delimiters-depth-3-face + ((,srcery-class :foreground ,srcery-bright-white) + (,srcery-256-class :foreground ,srcery-256-bright-white))) + + `(rainbow-delimiters-depth-4-face + ((,srcery-class :foreground ,srcery-bright-cyan) + (,srcery-256-class :foreground ,srcery-256-bright-cyan))) + + `(rainbow-delimiters-depth-5-face + ((,srcery-class :foreground ,srcery-bright-green) + (,srcery-256-class :foreground ,srcery-256-bright-green))) + + `(rainbow-delimiters-depth-6-face + ((,srcery-class :foreground ,srcery-blue) + (,srcery-256-class :foreground ,srcery-256-blue))) + + `(rainbow-delimiters-depth-7-face + ((,srcery-class :foreground ,srcery-green) + (,srcery-256-class :foreground ,srcery-256-green))) + + `(rainbow-delimiters-depth-8-face + ((,srcery-class :foreground ,srcery-yellow) + (,srcery-256-class :foreground ,srcery-256-yellow))) + + `(rainbow-delimiters-unmatched-face + ((,srcery-class :foreground ,srcery-red) + (,srcery-256-class :foreground ,srcery-256-red))) + + `(rainbow-delimiters-mismatched-face + ((,srcery-class :foreground ,srcery-bright-red) + (,srcery-256-class :foreground ,srcery-256-bright-red))) + + ;; `(rainbow-delimiters-unmatched-face + ;; ((,srcery-class :foreground ,srcery-red :overline t :inhert bold) + ;; (,srcery-256-class :foreground ,srcery-256-red :overline t :inhert bold))) + + ;; `(rainbow-delimiters-mismatched-face + ;; ((,srcery-class :foreground ,srcery-red :overline t :weight bold) + ;; (,srcery-256-class :foreground ,srcery-256-red :overline t :weight bold))) + + + ;; sh + `(sh-heredoc + ((,srcery-class (:foreground ,srcery-green :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-green :weight bold)))) + + `(sh-quoted-exec + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + ;; shm + `(shm-current-face + ((,srcery-class (:background ,srcery-green, :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-green, :foreground ,srcery-256-black)))) + + `(shm-quarantine-face + ((,srcery-class (:background ,srcery-gray-1)) + (,srcery-256-class (:background ,srcery-256-gray1)))) + + + ;; show-paren + `(show-paren-match + ((,srcery-class (:foreground ,srcery-bright-magenta :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-bright-magenta :weight bold)))) + + `(show-paren-mismatch + ((,srcery-class (:background ,srcery-red :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-red :foreground ,srcery-256-bright-white)))) + + + ;; paren-face + `(parenthesis + ((,srcery-class (:foreground ,srcery-gray-5)) + (,srcery-256-class (:foreground ,srcery-256-gray5)))) + + + ;; smartparens + `(sp-pair-overlay-face + ((,srcery-class (:background ,srcery-magenta :foreground nil)) + (,srcery-256-class (:background ,srcery-256-magenta :foreground nil)))) + + `(sp-show-pair-match-face + ((,srcery-class (:foreground ,srcery-bright-magenta :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-bright-magenta :weight bold)))) + + `(sp-wrap-overlay-closing-pair + ((,srcery-class (:background ,srcery-magenta :foreground, srcery-bright-yellow)) + (,srcery-256-class (:background ,srcery-256-magenta :foreground, srcery-256-bright-yellow)))) + + + ;; evil-snipe + `(evil-snipe-first-match-face + ((,srcery-class (:foreground ,srcery-magenta :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-magenta :weight bold)))) + + `(evil-snipe-matches-face + ((,srcery-class (:foreground ,srcery-magenta :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-magenta :weight bold)))) + + + ;; spacemacs + `(spacemacs-normal-face + ((,srcery-class (:background ,srcery-gray-4 :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-gray4 :foreground ,srcery-256-bright-white)))) + + `(spacemacs-insert-face + ((,srcery-class (:background ,srcery-bright-white :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-white :foreground ,srcery-256-black)))) + + `(spacemacs-replace-face + ((,srcery-class (:background ,srcery-bright-red :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-bright-red :foreground ,srcery-256-bright-white)))) + + `(spacemacs-visual-face + ((,srcery-class (:background ,srcery-bright-cyan :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-cyan :foreground ,srcery-256-black)))) + + `(spacemacs-motion-face + ((,srcery-class (:background ,srcery-magenta :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-magenta :foreground ,srcery-256-bright-white)))) + + `(spacemacs-emacs-face + ((,srcery-class (:background ,srcery-orange :foreground ,srcery-bright-white)) + (,srcery-256-class (:background ,srcery-256-orange :foreground ,srcery-256-bright-white)))) + + `(spacemacs-hybrid-face + ((,srcery-class (:background ,srcery-bright-blue :foreground ,srcery-bright-black)) + (,srcery-256-class (:background ,srcery-256-bright-blue :foreground ,srcery-256-bright-black)))) + + `(spacemacs-lisp-face + ((,srcery-class (:background ,srcery-green :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-green :foreground ,srcery-256-black)))) + + `(spacemacs-evilified-face + ((,srcery-class (:background ,srcery-bright-yellow :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-yellow :foreground ,srcery-256-black)))) + + `(spacemacs-helm-navigation-ms-face + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(spacemacs-transient-state-title-face + ((,srcery-class (:background nil :foreground ,srcery-green :box nil :weight bold)) + (,srcery-256-class (:background nil :foreground ,srcery-256-green :box nil :weight bold)))) + + `(spacemacs-transient-state-title-face + ((,srcery-class (:background nil :foreground ,srcery-green :box nil :weight bold)) + (,srcery-256-class (:background nil :foreground ,srcery-256-green :box nil :weight bold)))) + + `(spacemacs-ido-navigation-ts-face + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(spacemacs-iedit-face + ((,srcery-class (:background ,srcery-bright-orange :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-orange :foreground ,srcery-256-black)))) + + `(spacemacs-iedit-insert-face + ((,srcery-class (:background ,srcery-bright-orange :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-bright-orange :foreground ,srcery-256-black)))) + + `(spacemacs-micro-state-binding-face + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + ;; spacemacs-ido-navigation-ts-face + ;; swiper + `(swiper-line-face + ((,srcery-class (:background ,srcery-magenta :weight bold)) + (,srcery-256-class (:background ,srcery-256-magenta :weight bold)))) + + `(swiper-match-face-1 + ((,srcery-class (:weight bold)) + (,srcery-256-class (:weight bold)))) + + `(swiper-match-face-2 + ((,srcery-class (:foreground ,srcery-blue :underline t)) + (,srcery-256-class (:foreground ,srcery-256-blue :underline t)))) + + `(swiper-match-face-3 + ((,srcery-class (:foreground ,srcery-yellow :underline t)) + (,srcery-256-class (:foreground ,srcery-256-yellow :underline t)))) + + `(swiper-match-face-4 + ((,srcery-class (:foreground ,srcery-bright-green :underline t)) + (,srcery-256-class (:foreground ,srcery-256-bright-green :underline t)))) + + + ;; term + `(term + ((,srcery-class (:foreground ,srcery-bright-white :background ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-bright-white :background ,(if srcery-transparent-background nil srcery-256-black))))) + + `(term-color-black + ((,srcery-class (:foreground ,srcery-black)) + (,srcery-256-class (:foreground ,srcery-256-black)))) + + `(term-color-blue + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(term-color-cyan + ((,srcery-class (:foreground ,srcery-cyan)) + (,srcery-256-class (:foreground ,srcery-256-cyan)))) + + `(term-color-green + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(term-color-magenta + ((,srcery-class (:foreground ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-magenta)))) + + `(term-color-red + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(term-color-white + ((,srcery-class (:foreground ,srcery-white)) + (,srcery-256-class (:foreground ,srcery-256-white)))) + + `(term-color-yellow + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + + ;; web-mode + `(web-mode-builtin-face + ((,srcery-class (:inherit ,font-lock-builtin-face)) + (,srcery-256-class (:inherit ,font-lock-builtin-face)))) + + `(web-mode-comment-face + ((,srcery-class (:inherit ,font-lock-comment-face)) + (,srcery-256-class (:inherit ,font-lock-comment-face)))) + + `(web-mode-constant-face + ((,srcery-class (:inherit ,font-lock-constant-face)) + (,srcery-256-class (:inherit ,font-lock-constant-face)))) + + `(web-mode-doctype-face + ((,srcery-class (:inherit ,font-lock-comment-face)) + (,srcery-256-class (:inherit ,font-lock-comment-face)))) + + `(web-mode-function-name-face + ((,srcery-class (:inherit ,font-lock-function-name-face)) + (,srcery-256-class (:inherit ,font-lock-function-name-face)))) + + `(web-mode-html-attr-name-face + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + `(web-mode-html-attr-value-face + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(web-mode-html-tag-face + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(web-mode-html-tag-bracket-face + ((,srcery-class (:foreground ,srcery-gray-5)) + (,srcery-256-class (:foreground ,srcery-256-gray5)))) + + `(web-mode-keyword-face + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(web-mode-string-face + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(web-mode-symbol-face + ((,srcery-class (:foreground ,srcery-bright-blue)) + (,srcery-256-class (:foreground ,srcery-256-bright-blue)))) + + `(web-mode-type-face + ((,srcery-class (:inherit ,font-lock-type-face)) + (,srcery-256-class (:inherit ,font-lock-type-face)))) + + `(web-mode-warning-face + ((,srcery-class (:inherit ,font-lock-warning-face)) + (,srcery-256-class (:inherit ,font-lock-warning-face)))) + + ;; CSS + `(css-selector + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(css-property + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + ;; XML + `(nxml-element-local-name + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(nxml-attribute-local-name + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + ;; which-key + `(which-key-command-description-face + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(which-key-group-description-face + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(which-key-key-face + ((,srcery-class (:foreground ,srcery-yellow :weight bold)) + (,srcery-256-class (:foreground ,srcery-256-yellow :weight bold)))) + + `(which-key-separator-face + ((,srcery-class (:background nil :foreground ,srcery-bright-green)) + (,srcery-256-class (:background nil :foreground ,srcery-256-bright-green)))) + + `(which-key-special-key-face + ((,srcery-class (:background ,srcery-yellow :foreground ,srcery-black)) + (,srcery-256-class (:background ,srcery-256-yellow :foreground ,srcery-256-black)))) + + + ;; which-function-mode + `(which-func + ((,srcery-class (:foreground ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-yellow)))) + + + ;; whitespace-mode + `(whitespace-empty + ((,srcery-class (:background nil :foreground ,srcery-yellow)) + (,srcery-256-class (:background nil :foreground ,srcery-256-yellow)))) + + `(whitespace-indentation + ((,srcery-class (:background nil :foreground ,srcery-bright-orange)) + (,srcery-256-class (:background nil :foreground ,srcery-256-bright-orange)))) + + `(whitespace-line + ((,srcery-class (:background nil :foreground ,srcery-green)) + (,srcery-256-class (:background nil :foreground ,srcery-256-green)))) + + `(whitespace-newline + ((,srcery-class (:background nil :foreground ,srcery-green)) + (,srcery-256-class (:background nil :foreground ,srcery-256-green)))) + + `(whitespace-space + ((,srcery-class (:background nil :foreground ,srcery-gray-4)) + (,srcery-256-class (:background nil :foreground ,srcery-256-gray4)))) + + `(whitespace-space-after-tab + ((,srcery-class (:background nil :foreground ,srcery-yellow)) + (,srcery-256-class (:background nil :foreground ,srcery-256-yellow)))) + + `(whitespace-space-before-tab + ((,srcery-class (:background nil :foreground ,srcery-yellow)) + (,srcery-256-class (:background nil :foreground ,srcery-256-yellow)))) + + `(whitespace-tab + ((,srcery-class (:background nil)) + (,srcery-256-class (:background nil)))) + + `(whitespace-trailing + ((,srcery-class (:background ,srcery-red :foreground ,srcery-bright-orange)) + (,srcery-256-class (:background ,srcery-256-red :foreground ,srcery-256-bright-orange)))) + + + ;; ctbl + `(ctbl:face-cell-select + ((,srcery-class (:foreground ,srcery-black :background ,srcery-bright-magenta)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-bright-magenta)))) + + `(ctbl:face-continue-bar + ((,srcery-class (:foreground ,srcery-black :background ,srcery-bright-yellow)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-bright-yellow)))) + + `(ctbl:face-row-select + ((,srcery-class (:foreground ,srcery-black :background ,srcery-bright-blue)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-bright-blue)))) + + ;; hlt + `(hlt-property-highlight + ((,srcery-class (:foreground ,srcery-black :background ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-yellow)))) + + `(hlt-regexp-level-1 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-bright-magenta)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-bright-magenta)))) + + `(hlt-regexp-level-2 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-bright-green)))) + + `(hlt-regexp-level-3 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-magenta)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-magenta)))) + + `(hlt-regexp-level-4 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-bright-yellow)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-bright-yellow)))) + + `(hlt-regexp-level-5 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-green)))) + + `(hlt-regexp-level-6 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-bright-blue)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-bright-blue)))) + + `(hlt-regexp-level-7 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-cyan)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-cyan)))) + + `(hlt-regexp-level-8 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-blue)))) + + ;; reb + `(reb-match-0 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-bright-blue)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-bright-blue)))) + + `(reb-match-1 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-bright-cyan)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-bright-cyan)))) + + `(reb-match-2 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-green)))) + + `(reb-match-3 + ((,srcery-class (:foreground ,srcery-black :background ,srcery-yellow)) + (,srcery-256-class (:foreground ,srcery-256-black :background ,srcery-256-yellow)))) + + ;; other, need more work + `(ac-completion-face + ((,srcery-class (:underline t :foreground ,srcery-red)) + (,srcery-256-class (:underline t :foreground ,srcery-256-red)))) + + `(epc:face-title + ((,srcery-class :foreground ,srcery-blue :weight bold) + (,srcery-256-class :foreground ,srcery-256-blue :weight bold))) + + `(ffap + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(flx-highlight-face + ((,srcery-class (:foreground ,srcery-green :underline nil)) + (,srcery-256-class (:foreground ,srcery-256-green :underline nil)))) + + `(icompletep-determined + ((,srcery-class :foreground ,srcery-red) + (,srcery-256-class :foreground ,srcery-256-red))) + + `(js2-external-variable + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(js2-function-param + ((,srcery-class (:foreground ,srcery-bright-magenta)) + (,srcery-256-class (:foreground ,srcery-256-bright-magenta)))) + + `(js2-jsdoc-html-tag-delimiter + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(js2-jsdoc-html-tag-name + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(js2-jsdoc-value + ((,srcery-class (:foreground ,srcery-bright-green)) + (,srcery-256-class (:foreground ,srcery-256-bright-green)))) + + `(js2-private-function-call + ((,srcery-class (:foreground ,srcery-bright-magenta)) + (,srcery-256-class (:foreground ,srcery-256-bright-magenta)))) + + `(js2-private-member + ((,srcery-class (:foreground ,srcery-bright-white)) + (,srcery-256-class (:foreground ,srcery-256-bright-white)))) + + `(js2-object-property + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(js3-error-face + ((,srcery-class (:underline ,srcery-bright-orange)) + (,srcery-256-class (:underline ,srcery-256-bright-orange)))) + + `(js3-external-variable-face + ((,srcery-class (:foreground ,srcery-blue)) + (,srcery-256-class (:foreground ,srcery-256-blue)))) + + `(js3-function-param-face + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(js3-instance-member-face + ((,srcery-class (:foreground ,srcery-bright-magenta)) + (,srcery-256-class (:foreground ,srcery-256-bright-magenta)))) + + `(js3-jsdoc-tag-face + ((,srcery-class (:foreground ,srcery-red)) + (,srcery-256-class (:foreground ,srcery-256-red)))) + + `(js3-warning-face + ((,srcery-class (:underline ,srcery-red)) + (,srcery-256-class (:underline ,srcery-256-red)))) + + `(slime-repl-inputed-output-face + ((,srcery-class (:foreground ,srcery-green)) + (,srcery-256-class (:foreground ,srcery-256-green)))) + + `(trailing-whitespace + ((,srcery-class :foreground nil :background ,srcery-red) + (,srcery-256-class :foreground nil :background ,srcery-256-red))) + + `(undo-tree-visualizer-current-face + ((,srcery-class :foreground ,srcery-red) + (,srcery-256-class :foreground ,srcery-256-red))) + + `(undo-tree-visualizer-default-face + ((,srcery-class :foreground ,srcery-bright-white) + (,srcery-256-class :foreground ,srcery-256-bright-white))) + + `(undo-tree-visualizer-register-face + ((,srcery-class :foreground ,srcery-green) + (,srcery-256-class :foreground ,srcery-256-green))) + + `(undo-tree-visualizer-unmodified-face + ((,srcery-class :foreground ,srcery-blue) + (,srcery-256-class :foreground ,srcery-256-blue))) + + `(undo-tree-visualizer-active-branch-face + ((,srcery-class :foreground ,srcery-bright-magenta) + (,srcery-256-class :foreground ,srcery-256-bright-magenta))) + + `(persp-face-lighter-buffer-not-in-persp + ((,srcery-class :background ,srcery-red :foreground ,srcery-bright-white) + (,srcery-256-class :background ,srcery-256-red :foreground ,srcery-256-bright-white))) + + `(pulse-highlight-face + ((,srcery-class :background ,srcery-green :foreground ,srcery-black) + (,srcery-256-class :background ,srcery-256-green :foreground ,srcery-256-black))) + + `(pulse-highlight-start-face + ((,srcery-class :background ,srcery-bright-green :foreground ,srcery-black) + (,srcery-256-class :background ,srcery-256-bright-green :foreground ,srcery-256-black))) + + `(custom-invalid + ((,srcery-class :background ,srcery-bright-red :foreground ,srcery-bright-white) + (,srcery-256-class :background ,srcery-256-bright-red :foreground ,srcery-256-bright-white))) + + `(holiday + ((,srcery-class :background ,srcery-bright-magenta :foreground ,srcery-bright-white) + (,srcery-256-class :background ,srcery-256-bright-magenta :foreground ,srcery-256-bright-white))) + + `(whitespace-trailing + ((,srcery-class :background ,srcery-red :foreground ,srcery-bright-white) + (,srcery-256-class :background ,srcery-256-red :foreground ,srcery-256-bright-white))) + + `(whitespace-big-indent + ((,srcery-class :background ,srcery-bright-red :foreground ,srcery-bright-white) + (,srcery-256-class :background ,srcery-256-bright-red :foreground ,srcery-256-bright-white))) + + `(whitespace-hspace + ((,srcery-class :background ,srcery-bright-blue :foreground ,srcery-bright-white) + (,srcery-256-class :background ,srcery-256-bright-blue :foreground ,srcery-256-bright-white))) + ) + + (custom-theme-set-variables + 'srcery + `(ansi-color-names-vector [,srcery-black ,srcery-red ,srcery-green ,srcery-yellow ,srcery-blue ,srcery-magenta ,srcery-cyan ,srcery-white]) + `(hl-paren-colors '(,srcery-bright-white ,srcery-green ,srcery-blue ,srcery-white)))) + +;;;###autoload +(when load-file-name + (add-to-list 'custom-theme-load-path + (file-name-as-directory (file-name-directory load-file-name)))) + +(provide-theme 'srcery) + +;; Local Variables: +;; no-byte-compile: t +;; End: + +;;; srcery-theme.el ends here diff --git a/elpa/string-edit-20160411.656/string-edit-autoloads.el b/elpa/string-edit-20160411.656/string-edit-autoloads.el new file mode 100644 index 0000000..e2b64bb --- /dev/null +++ b/elpa/string-edit-20160411.656/string-edit-autoloads.el @@ -0,0 +1,23 @@ +;;; string-edit-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "string-edit" "string-edit.el" (23391 65255 +;;;;;; 0 0)) +;;; Generated autoloads from string-edit.el + +(autoload 'string-edit-at-point "string-edit" "\ +Pop up a buffer to edit the string at point. +This saves you from needing to manually escape characters. + +\(fn)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; string-edit-autoloads.el ends here diff --git a/elpa/string-edit-20160411.656/string-edit-pkg.el b/elpa/string-edit-20160411.656/string-edit-pkg.el new file mode 100644 index 0000000..f25806c --- /dev/null +++ b/elpa/string-edit-20160411.656/string-edit-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "string-edit" "20160411.656" "Avoid escape nightmares by editing string in separate buffer" '((dash "1.2.0")) :commit "c44b65b4c5e9f52be9c14d88ca2f402a18d9e1dd" :authors '(("Magnar Sveen" . "magnars@gmail.com")) :maintainer '("Magnar Sveen" . "magnars@gmail.com")) diff --git a/elpa/string-edit-20160411.656/string-edit.el b/elpa/string-edit-20160411.656/string-edit.el new file mode 100644 index 0000000..85c1634 --- /dev/null +++ b/elpa/string-edit-20160411.656/string-edit.el @@ -0,0 +1,262 @@ +;;; string-edit.el --- Avoid escape nightmares by editing string in separate buffer + +;; Copyright (C) 2013 Magnar Sveen + +;; Author: Magnar Sveen +;; Version: 0.1.0 +;; Package-Version: 20160411.656 +;; Package-Requires: ((dash "1.2.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 . + +;;; Commentary: + +;; Avoid escape nightmares by editing string in separate buffer + +;;; Code: + +(require 'dash) + +(defvar se/original) +(defvar se/original-buffer) + +(defvar string-edit-at-point-hook () + "Hook to run just before enabling `string-edit-mode'. +This hook provides an opportunity to enable a custom major mode +before the minor mode is enabled.") + +;;;###autoload +(defun string-edit-at-point () + "Pop up a buffer to edit the string at point. +This saves you from needing to manually escape characters." + (interactive) + (when (se/point-inside-string-p) + (let* ((p (point)) + (original-buffer (current-buffer)) + (original (se/find-original))) + (select-window (split-window-vertically -4)) + (switch-to-buffer (generate-new-buffer "*string-edit*")) + (insert (se/aget :raw original)) + (goto-char (- p (se/aget :beg original) -1)) + (funcall (se/aget :cleanup original)) + (enlarge-window (1- (line-number-at-pos (point-max)))) + (se/guess-at-major-mode) + (run-hooks 'string-edit-at-point-hook) + (string-edit-mode 1) + (set (make-local-variable 'se/original) original) + (set (make-local-variable 'se/original-buffer) original-buffer) + (font-lock-fontify-buffer)))) + +(defun string-edit-abort () + "Used in string-edit-mode to close the popup window" + (interactive) + (kill-buffer) + (delete-window)) + +(defun string-edit-conclude () + (interactive) + (funcall (se/aget :escape se/original)) + (let ((p (point)) + (contents (buffer-substring-no-properties (point-min) (point-max))) + (original se/original) + (original-buffer se/original-buffer) + (beg (se/aget :beg se/original))) + (kill-buffer) + (delete-window) + (switch-to-buffer original-buffer) + (goto-char beg) + (delete-char (length (se/aget :raw original))) + (insert "\"" contents "\"") + (let ((end (point))) + (goto-char (+ p beg)) + (indent-region beg end)))) + +(defun se/find-original () + (if (derived-mode-p 'js2-mode 'js-mode) + (se/js-strings-at-point) + (se/string-at-point))) + +(defun se/guess-at-major-mode () + (save-excursion + (goto-char (point-min)) + (when (looking-at "<") + (html-mode)))) + +(defun se/unescape (quote) + (goto-char (point-min)) + (while (search-forward (concat "\\" quote) nil t) + (replace-match "") + (insert quote))) + +(defun se/escape (quote) + (goto-char (point-min)) + (while (search-forward quote nil t) + (replace-match "") + (insert "\\" quote))) + +(defun se/unescape-ws (signifier char) + (goto-char (point-min)) + (while (search-forward (concat "\\" signifier) nil t) + (replace-match "") + (insert char))) + +(defun se/escape-ws (signifier char) + (goto-char (point-min)) + (while (search-forward char nil t) + (replace-match "") + (insert "\\" signifier))) + +(defvar string-edit-mode-map nil + "Keymap for string-edit minor mode.") + +(unless string-edit-mode-map + (setq string-edit-mode-map (make-sparse-keymap))) + +(--each '(("C-c C-k" . string-edit-abort) + ("C-c C-c" . string-edit-conclude)) + (define-key string-edit-mode-map (read-kbd-macro (car it)) (cdr it))) + +(define-minor-mode string-edit-mode + "Minor mode for useful keybindings while editing string." + nil " StringEdit" string-edit-mode-map + (if string-edit-mode-map + (add-hook 'post-command-hook 'se/post-command nil t) + (remove-hook 'post-command-hook 'se/post-command t))) + +(defun se/post-command () + (se/adjust-window-size-to-fit-text)) + +(defun se/adjust-window-size-to-fit-text () + (when (and (> (+ 2 (line-number-at-pos (point-max))) + (window-height)) + (> (/ (frame-height) (window-height)) + 1)) + (enlarge-window 1))) + +(defun se/aget (key map) + (cdr (assoc key map))) + +(defun se/current-quotes-char () + "The char that is the current quote delimiter, or nil if not in a string." + (let ((delimiter (nth 3 (syntax-ppss)))) + (cond ((stringp delimiter) delimiter) + ;; `syntax-ppss' can return t meaning 'a generic string delimiter'. + (delimiter ?\")))) + +(defalias 'se/point-inside-string-p 'se/current-quotes-char) + +(defun se/move-point-backward-out-of-string () + "Move point backward until it exits the current quoted string." + (while (se/point-inside-string-p) (backward-char))) + +(defun se/move-point-forward-out-of-string () + "Move point forward until it exits the current quoted string." + (while (se/point-inside-string-p) (forward-char))) + +(defun se/string-position-at-point () + (let (beg) + (save-excursion + (se/move-point-backward-out-of-string) + (setq beg (point)) + (forward-sexp 1) + (cons beg (point))))) + +;;; String conversion types + +;; Regular old strings + +(defun se/string-at-point () + (let* ((pos (se/string-position-at-point)) + (p (point)) + (beg (car pos)) + (end (cdr pos)) + (raw (buffer-substring-no-properties beg end)) + (quote (char-to-string (se/current-quotes-char)))) + `((:beg . ,beg) + (:end . ,end) + (:raw . ,raw) + (:cleanup . ,(-partial 'se/string-at-point/clean-up quote)) + (:escape . ,(-partial 'se/string-at-point/escape quote))))) + +(defun se/string-at-point/clean-up (quote) + (save-excursion + (goto-char (point-max)) + (delete-char (- (length quote))) + (goto-char (point-min)) + (delete-char (length quote)) + (se/unescape quote) + (se/unescape-ws "n" "\n") + (se/unescape-ws "r" "\r") + (se/unescape-ws "t" "\t") + (se/unescape "\\"))) + +(defun se/string-at-point/escape (quote) + (save-excursion + (se/escape "\\") + (se/escape-ws "n" "\n") + (se/escape-ws "r" "\r") + (se/escape-ws "t" "\t") + (se/escape quote))) + +;; JavaScript strings, can be concatenated + +(defun se/js-strings-at-point () + (let ((quote (char-to-string (se/current-quotes-char))) + beg end) + (save-excursion + (se/move-point-backward-out-of-string) + (while (looking-back (concat (regexp-quote quote) "[\n\r\t ]*\\+[\n ]*")) + (goto-char (match-beginning 0)) + (se/move-point-backward-out-of-string)) + (setq beg (point))) + (save-excursion + (se/move-point-forward-out-of-string) + (while (looking-at (concat "[\n ]*\\+[\n ]*" (regexp-quote quote))) + (goto-char (match-end 0)) + (se/move-point-forward-out-of-string)) + (setq end (point))) + `((:beg . ,beg) + (:end . ,end) + (:raw . ,(buffer-substring-no-properties beg end)) + (:cleanup . ,(-partial 'se/js-strings-at-point/clean-up quote)) + (:escape . ,(-partial 'se/js-strings-at-point/escape quote))))) + +(defun se/js-strings-at-point/clean-up (quote) + (save-excursion + (goto-char (point-max)) + (delete-char (- (length quote))) + (goto-char (point-min)) + (delete-char (length quote)) + (while (search-forward (concat quote " + " quote) nil t) + (replace-match "")) + (goto-char (point-min)) + (while (re-search-forward (concat (regexp-quote quote) " \\+ *\n *" (regexp-quote quote)) nil t) + (replace-match "\n")) + (se/unescape quote) + (se/unescape "\\"))) + +(defun se/js-strings-at-point/escape (quote) + (save-excursion + (se/escape "\\") + (se/escape quote) + (goto-char (point-min)) + (while (re-search-forward "^" nil t) + (unless (bobp) + (insert "\"")) + (end-of-line) + (unless (eobp) + (insert "\" +"))))) + +(provide 'string-edit) +;;; string-edit.el ends here diff --git a/elpa/string-edit-20160411.656/string-edit.elc b/elpa/string-edit-20160411.656/string-edit.elc new file mode 100644 index 0000000..e40e090 Binary files /dev/null and b/elpa/string-edit-20160411.656/string-edit.elc differ diff --git a/elpa/suggest-20180725.2312/suggest-autoloads.el b/elpa/suggest-20180725.2312/suggest-autoloads.el new file mode 100644 index 0000000..8a0fb6c --- /dev/null +++ b/elpa/suggest-20180725.2312/suggest-autoloads.el @@ -0,0 +1,32 @@ +;;; suggest-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "suggest" "suggest.el" (23391 65254 0 0)) +;;; Generated autoloads from suggest.el + +(autoload 'suggest "suggest" "\ +Open a Suggest buffer that provides suggestions for the inputs +and outputs given. + +\(fn)" t nil) + +(autoload 'suggest-update "suggest" "\ +Update the suggestions according to the latest inputs/output given. + +\(fn)" t nil) + +;;;*** + +;;;### (autoloads nil nil ("suggest-bench.el" "suggest-pkg.el") (23391 +;;;;;; 65254 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; suggest-autoloads.el ends here diff --git a/elpa/suggest-20180725.2312/suggest-bench.el b/elpa/suggest-20180725.2312/suggest-bench.el new file mode 100644 index 0000000..46ef443 --- /dev/null +++ b/elpa/suggest-20180725.2312/suggest-bench.el @@ -0,0 +1,43 @@ +;;; suggest-bench.el --- measure suggest.el performance + +;;; Code: + +(require 'suggest) +(require 'dash) +(require 'shut-up) + +(defmacro suggest--print-time (form) + "Evaluate FORM, and print the time taken." + `(progn + (message "%s" ',form) + (-let [(total-time gc-runs gc-time) + (shut-up (benchmark-run 1 ,form))] + (message " time: %fs (%fs in %d GCs)" + total-time + gc-time + gc-runs)))) + + +(defun suggest--possibilities-bench () + (interactive) + ;; Basic arithmetic. + (suggest--print-time + (suggest--possibilities '("x" "y") '(1 2) 3)) + ;; List access. + (suggest--print-time + (suggest--possibilities '("x") '((?a ?b ?c)) ?c)) + ;; List generation + (suggest--print-time + (suggest--possibilities '("x") '(4) '(1 2 3 4))) + ;; Zero results. + (suggest--print-time + (suggest--possibilities '("x") '("foo") "bar"))) + +(defun suggest-bench () + (interactive) + ;; Overall call time. + (suggest--print-time + (suggest))) + +(provide 'suggest-bench) +;; suggest-bench.el ends here diff --git a/elpa/suggest-20180725.2312/suggest-bench.elc b/elpa/suggest-20180725.2312/suggest-bench.elc new file mode 100644 index 0000000..7aa58ac Binary files /dev/null and b/elpa/suggest-20180725.2312/suggest-bench.elc differ diff --git a/elpa/suggest-20180725.2312/suggest-pkg.el b/elpa/suggest-20180725.2312/suggest-pkg.el new file mode 100644 index 0000000..4843fe0 --- /dev/null +++ b/elpa/suggest-20180725.2312/suggest-pkg.el @@ -0,0 +1,17 @@ +(define-package "suggest" "20180725.2312" "suggest elisp functions that give the output requested" + '((emacs "24.4") + (loop "1.3") + (dash "2.13.0") + (s "1.11.0") + (f "0.18.2") + (spinner "1.7.3")) + :keywords + '("convenience") + :authors + '(("Wilfred Hughes" . "me@wilfred.me.uk")) + :maintainer + '("Wilfred Hughes" . "me@wilfred.me.uk") + :url "https://github.com/Wilfred/suggest.el") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/suggest-20180725.2312/suggest.el b/elpa/suggest-20180725.2312/suggest.el new file mode 100644 index 0000000..10d98a3 --- /dev/null +++ b/elpa/suggest-20180725.2312/suggest.el @@ -0,0 +1,956 @@ +;;; suggest.el --- suggest elisp functions that give the output requested -*- lexical-binding: t; -*- + +;; Copyright (C) 2017-2018 + +;; Author: Wilfred Hughes +;; Version: 0.8 +;; Keywords: convenience +;; Package-Requires: ((emacs "24.4") (loop "1.3") (dash "2.13.0") (s "1.11.0") (f "0.18.2") (spinner "1.7.3")) +;; URL: https://github.com/Wilfred/suggest.el + +;; 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 . + +;;; Commentary: + +;; Suggest.el will find functions that give the output requested. It's +;; a great way of exploring list, string and arithmetic functions. + +;;; Code: + +(require 'dash) +(require 'seq) +(require 'loop) +(require 's) +(require 'f) +(require 'spinner) +(require 'subr-x) +(require 'cl-extra) ;; cl-prettyprint +(require 'cl-lib) ;; cl-incf, cl-evenp, cl-oddp + +(defcustom suggest-insert-example-on-start t + "If t, insert example data in suggest buffer, else don't." + :group 'suggest + :type 'boolean) + +;; See also `cl--simple-funcs' and `cl--safe-funcs'. +(defvar suggest-functions + (list + ;; TODO: add funcall, apply and map? + ;; Boolean functions + #'not + ;; Type predicates + #'arrayp + #'atom + #'booleanp + #'consp + #'floatp + #'functionp + #'integerp + #'listp + #'numberp + #'sequencep + #'stringp + #'symbolp + ;; Sequence predicates + #'seq-set-equal-p + #'seq-empty-p + ;; Built-in functions that access or examine lists. + #'car + #'cdr + #'cadr + #'cdar + #'last + #'cons + #'nth + #'nthcdr + #'list + #'length + #'safe-length + #'reverse + #'remove + #'remq + #'append + #'butlast + ;; Built-in functions that create lists. + #'make-list + #'number-sequence + ;; Sequence functions + #'elt + #'aref + #'seq-subseq + #'seq-drop + #'seq-take + #'seq-sort + #'seq-reverse + #'seq-concatenate + #'seq-into + #'seq-position + #'seq-uniq + #'seq-partition + #'seq-intersection + #'seq-difference + ;; CL list functions. + #'cl-first + #'cl-second + #'cl-third + #'cl-list* + ;; dash.el list functions. + #'-non-nil + #'-slice + #'-take + #'-take-last + #'-drop + #'-drop-last + #'-select-by-indices + #'-select-column + #'-concat + #'-flatten + #'-replace + #'-replace-first + #'-insert-at + #'-replace-at + #'-remove-at + #'-remove-at-indices + #'-sum + #'-product + #'-min + #'-max + #'-is-prefix-p + #'-is-suffix-p + #'-is-infix-p + #'-split-at + #'-split-on + #'-partition + #'-partition-all + #'-elem-index + #'-elem-indices + #'-union + #'-difference + #'-intersection + #'-distinct + #'-rotate + #'-sort + #'-repeat + #'-cons* + #'-snoc + #'-interpose + #'-interleave + #'-zip + #'-first-item + #'-last-item + #'-butlast + ;; alist functions + #'assoc + #'alist-get + ;; plist functions + #'plist-get + #'lax-plist-get + #'plist-member + ;; hash tables + #'gethash + #'hash-table-keys + #'hash-table-values + ;; vectors + ;; TODO: there must be more worth using + #'vector + #'vconcat + ;; Arithmetic + #'+ + #'- + #'* + #'/ + #'% + #'mod + #'max + #'min + #'ash + #'lsh + #'log + #'expt + #'sqrt + #'abs + #'float + #'round + #'truncate + #'ceiling + #'fceiling + #'ffloor + #'fround + #'ftruncate + #'1+ + #'1- + #'cl-evenp + #'natnump + #'cl-oddp + #'zerop + ;; Logical operators + #'lsh + #'logand + #'logior + #'logxor + #'lognot + ;; Strings + #'string + #'make-string + #'upcase + #'downcase + #'substring + #'concat + #'split-string + #'capitalize + #'replace-regexp-in-string + #'format + #'string-join + #'string-prefix-p + #'string-suffix-p + #'string-remove-prefix + #'string-remove-suffix + #'prin1-to-string + ;; Quoting strings + #'shell-quote-argument + #'regexp-quote + ;; s.el string functions + #'s-trim + #'s-trim-left + #'s-trim-right + #'s-pad-left + #'s-pad-right + #'s-chomp + #'s-collapse-whitespace + #'s-word-wrap + #'s-left + #'s-right + #'s-chop-suffix + #'s-chop-suffixes + #'s-chop-prefix + #'s-chop-prefixes + #'s-shared-start + #'s-shared-end + #'s-truncate + #'s-repeat + #'s-concat + #'s-prepend + #'s-append + #'s-lines + #'s-split + #'s-join + #'s-ends-with-p + #'s-starts-with-p + #'s-contains-p + #'s-replace + #'s-capitalize + #'s-index-of + #'s-reverse + #'s-count-matches + #'s-split-words + #'s-wrap + ;; Symbols + #'symbol-name + #'symbol-value + #'symbol-file + #'intern + ;; Converting between types + #'string-to-list + #'string-to-number + #'string-to-char + #'number-to-string + #'char-to-string + ;; Paths + #'file-name-as-directory + #'file-name-base + #'file-name-directory + #'file-name-nondirectory + #'file-name-extension + #'expand-file-name + #'abbreviate-file-name + #'directory-file-name + ;; Paths with f.el + #'f-join + #'f-split + #'f-filename + #'f-parent + #'f-common-parent + #'f-ext + #'f-no-ext + #'f-base + #'f-short + #'f-long + #'f-canonical + #'f-slash + #'f-depth + #'f-relative + ;; These are not pure, but still safe: + #'f-files + #'f-directories + #'f-entries + ;; Keyboard codes + #'kbd + #'key-description + ;; Generic functions + #'identity + #'ignore + ) + "Functions that suggest will consider. + +These functions must not produce side effects, and must not be +higher order functions. + +Side effects are obviously bad: we don't want to call +`delete-file' with arbitrary strings! + +Higher order functions are any functions that call `funcall' or +`apply'. These are not safe to call with arbitrary symbols, but +see `suggest-funcall-functions'. + +The best functions for examples generally take a small number of +arguments, and no arguments are functions. For other functions, +the likelihood of users discovering them is too low. + +Likewise, we avoid predicates of one argument, as those generally +need multiple examples to ensure they do what the user wants. + +See also `suggest-extra-args'.") + +(defvar suggest-funcall-functions + (list + ;; Higher order list functions. + #'mapcar + ;; When called with a symbol, read will call it. + #'read + ;; dash.el higher order list functions. + #'-map + #'-mapcat + ;; dash.el folding/unfolding + #'-reduce + #'-reduce-r + #'-iterate + ) + "Pure functions that may call `funcall'. We will consider +consider these, but only with arguments that are known to be safe." ) + +(defvar suggest-extra-args + (list + ;; There's no special values for `list', and it produces silly + ;; results when we add values. + #'list '() + ;; Similarly, we can use nil when building a list, but otherwise + ;; we're just building an irrelevant list if we use the default + ;; values. + #'cons '(nil) + #'-cons* '(nil) + #'-snoc '(nil) + #'append '(nil) + #'vector '(nil) + ;; `format' has specific formatting strings that are worth trying. + #'format '("%d" "%o" "%x" "%X" "%e" "%c" "%f" "%s" "%S") + ;; `-iterate' is great for building incrementing/decrementing lists. + ;; (an alternative to `number-sequence'). + #'-iterate '(1+ 1-) + ;; Lists can be sorted in a variety of ways. + #'-sort '(< > string< string>) + #'seq-sort '(< > string< string>) + ;; Sequences of type. + #'seq-concatenate '(vector string list) + #'seq-into '(vector string list) + ;; For indexing functions, just use non-negative numbers. This + ;; avoids confusing results like (last nil 5) => nil. + #'elt '(0 1 2) + #'nth '(0 1 2) + #'nthcdr '(0 1 2) + #'last '(0 1 2) + #'-drop '(0 1 2) + #'-drop-last '(0 1 2) + #'-take '(0 1 2) + ;; For functions that look up a value, don't supply any extra + ;; arguments. + #'plist-member '() + #'assoc '() + ;; Likewise for comparisons, there's no interesting extra value we can offer. + #'-is-suffix-p '() + #'-is-prefix-p '() + #'-is-infix-p '() + ;; Joining strings is commonly done with spaces or newlines. + #'string-join '("\n" " ") ; default is "" already. + #'s-join '("" "\n" " ") + ;; Remove has some weird behaviours with t: (remove 'foo t) => t. + ;; Only use nil as an extra value, so we can discover remove as an + ;; alternative to `-non-nil'. + #'remove '(nil) + ;; mapcar with identity is a fun way to convert sequences (strings, + ;; vectors) to lists. + #'mapcar '(identity) + ;; These common values often set flags in interesting + ;; ways. + t '(nil t -1 0 1 2)) + "Some functions work best with a special extra argument. + +This plist associates functions with particular arguments that +produce good results. If a function isn't explicitly mentioned, +we look up `t' instead.") + +(defun suggest--unsafe-p (fn args) + "Is FN unsafe to call with ARGS? + +Safety here means that we: + +* don't have any side effects, and +* don't crash Emacs." + (or + ;; Due to Emacs bug #25684, string functions that call + ;; caseify_object in casefiddle.c cause Emacs to segfault when + ;; given negative integers. + (and (memq fn '(upcase downcase capitalize upcase-initials)) + (consp args) + (null (cdr args)) + (integerp (car args)) + (< (car args) 0)) + ;; If `read' is called with nil or t, it prompts interactively. + (and (eq fn 'read) + (member args '(nil (nil) (t)))) + ;; Work around https://github.com/Wilfred/suggest.el/issues/37 on + ;; Emacs 24, where it's possible to crash `read' with a list. + (and (eq fn 'read) + (eq emacs-major-version 24) + (consp (car args))) + ;; Work around https://github.com/magnars/dash.el/issues/241 + (and (memq fn '(-interleave -zip)) + (null args)) + (and (memq fn suggest-funcall-functions) ; + ;; TODO: what about circular lists? + ;; + ;; Does apply even handle that nicely? It looks like apply + ;; tries to get the length of the list and hangs until C-g. + (format-proper-list-p args) + (--any (or + ;; Don't call any higher order functions with symbols that + ;; aren't known to be safe. + (and (symbolp it) (not (memq it suggest-functions))) + ;; Don't allow callable objects (interpreted or + ;; byte-compiled function objects). + (and (not (symbolp it)) (functionp it))) + args)))) + +(defun suggest--safe-p (fn args) + "Is FN safe to call with ARGS?" + (not (suggest--unsafe-p fn args))) + +(defface suggest-heading + '((((class color) (background light)) :foreground "DarkGoldenrod4" :weight bold) + (((class color) (background dark)) :foreground "LightGoldenrod2" :weight bold)) + "Face for headings." + :group 'suggest) + +(defvar suggest--inputs-heading ";; Inputs (one per line):") +(defvar suggest--outputs-heading ";; Desired output:") +(defvar suggest--results-heading ";; Suggestions:") + +(defun suggest--insert-heading (text) + "Highlight TEXT as a heading and insert in the current buffer." + ;; Make a note of where the heading starts. + (let ((excluding-last (substring text 0 (1- (length text)))) + (last-char (substring text (1- (length text)))) + (start (point)) + end) + ;; Insert the heading, ensuring it's not editable, + (insert (propertize excluding-last + 'read-only t)) + ;; but allow users to type immediately after the heading. + (insert (propertize last-char + 'read-only t + 'rear-nonsticky t)) + ;; Point is now at the end of the heading, save that position. + (setq end (point)) + ;; Start the overlay after the ";; " bit. + (let ((overlay (make-overlay (+ 3 start) end))) + ;; Highlight the text in the heading. + (overlay-put overlay 'face 'suggest-heading))) + (insert "\n")) + +(defun suggest--on-heading-p () + "Return t if point is on a heading." + (get-char-property (point) 'read-only)) + +(defun suggest--raw-inputs () + "Read the input lines in the current suggestion buffer." + (let ((headings-seen 0) + (raw-inputs nil)) + (loop-for-each-line + ;; Make a note of when we've passed the inputs heading. + (when (and (suggest--on-heading-p)) + (cl-incf headings-seen) + (if (equal headings-seen 2) + ;; Stop once we reach the outputs. + (loop-return (nreverse raw-inputs)) + (loop-continue))) + ;; Skip over empty lines. + (when (equal it "") + (loop-continue)) + (push (substring-no-properties it) raw-inputs)))) + +;; TODO: check that there's only one line of output, or prevent +;; multiple lines being entered. +(defun suggest--raw-output () + "Read the output line in the current suggestion buffer." + (save-excursion + ;; Move past the 'desired output' heading. + (suggest--nth-heading 2) + (forward-line 1) + ;; Skip blank lines. + (while (looking-at "\n") + (forward-line 1)) + ;; Return the current line. + (buffer-substring (point) (line-end-position)))) + +(defun suggest--keybinding (command keymap) + "Find the keybinding for COMMAND in KEYMAP." + (where-is-internal command keymap t)) + +(defun suggest--insert-section-break () + "Insert section break." + (insert "\n\n")) + +;;;###autoload +(defun suggest () + "Open a Suggest buffer that provides suggestions for the inputs +and outputs given." + (interactive) + (let ((buf (get-buffer-create "*suggest*")) + (inhibit-read-only t) + (inhibit-modification-hooks t)) + (switch-to-buffer buf) + (erase-buffer) + (suggest-mode) + + (suggest--insert-heading suggest--inputs-heading) + (when suggest-insert-example-on-start + (insert "1\n2")) + + (suggest--insert-section-break) + + (suggest--insert-heading suggest--outputs-heading) + (when suggest-insert-example-on-start + (insert "3")) + + (suggest--insert-section-break) + + (suggest--insert-heading suggest--results-heading) + ;; Populate the suggestions for 1, 2 => 3 + (when suggest-insert-example-on-start + (suggest-update)) + + ;; Put point on the first input. + (suggest--nth-heading 1) + (forward-line 1)) + (add-hook 'first-change-hook + (lambda () (suggest--update-needed t)) + nil t)) + +(defun suggest--nth-heading (n) + "Move point to Nth heading in the current *suggest* buffer. +N counts from 1." + (goto-char (point-min)) + (let ((headings-seen 0)) + (while (< headings-seen n) + (when (suggest--on-heading-p) + (cl-incf headings-seen)) + (forward-line 1))) + (forward-line -1)) + +(defun suggest--write-suggestions-string (text) + "Write TEXT to the suggestion section." + (let ((inhibit-read-only t)) + (save-excursion + ;; Move to the first line of the results. + (suggest--nth-heading 3) + (forward-line 1) + ;; Remove the current suggestions text. + (delete-region (point) (point-max)) + ;; Insert the text, ensuring it can't be edited. + (insert (propertize text 'read-only t))))) + +(defun suggest--format-output (value) + "Format VALUE as the output to a function." + (let* ((lines (s-lines (s-trim (pp-to-string value)))) + (prefixed-lines + (--map-indexed + (if (zerop it-index) (concat ";=> " it) (concat "; " it)) + lines))) + (s-join "\n" prefixed-lines))) + +(defun suggest--format-suggestion (suggestion output) + "Format SUGGESTION as a lisp expression returning OUTPUT." + (let ((formatted-call "")) + ;; Build up a string "(func1 (func2 ... literal-inputs))" + (let ((funcs (plist-get suggestion :funcs)) + (literals (plist-get suggestion :literals))) + (dolist (func funcs) + (let ((func-sym (plist-get func :sym)) + (variadic-p (plist-get func :variadic-p))) + (if variadic-p + (setq formatted-call + (format "%s(apply #'%s " formatted-call func-sym)) + (setq formatted-call + (format "%s(%s " formatted-call func-sym))))) + (setq formatted-call + (format "%s%s" formatted-call + (s-join " " literals))) + (setq formatted-call + (concat formatted-call (s-repeat (length funcs) ")")))) + (let* (;; A string of spaces the same length as the suggestion. + (matching-spaces (s-repeat (length formatted-call) " ")) + (formatted-output (suggest--format-output output)) + ;; Append the output to the formatted suggestion. If the + ;; output runs over multiple lines, indent appropriately. + (formatted-lines + (--map-indexed + (if (zerop it-index) + (format "%s %s" formatted-call it) + (format "%s %s" matching-spaces it)) + (s-lines formatted-output)))) + (s-join "\n" formatted-lines)))) + +(defun suggest--write-suggestions (suggestions output) + "Write SUGGESTIONS to the current *suggest* buffer. +SUGGESTIONS is a list of forms." + (->> suggestions + (--map (suggest--format-suggestion it output)) + (s-join "\n") + (suggest--write-suggestions-string))) + +(defun suggest--read-eval (form) + "Read and eval FORM, but don't open a debugger on errors." + (condition-case err + (eval (read form)) + (error (user-error + "Could not eval %s: %s" form err)))) + +;; TODO: this would be a good match for dash.el. +(defun suggest--permutations (lst) + "Return a list of all possible orderings of list LST." + (cl-case (length lst) + (0 nil) + (1 (list lst)) + (t + ;; TODO: this is ugly. + ;; TODO: extract an accumulate macro? + (let ((permutations nil)) + (--each-indexed lst + (let* ((element it) + (remainder (-remove-at it-index lst)) + (remainder-perms (suggest--permutations remainder))) + (--each remainder-perms (push (cons element it) permutations)))) + (nreverse permutations))))) + +(defconst suggest--search-depth 4 + "The maximum number of nested function calls to try. +This tends to impact performance for values where many functions +could work, especially numbers.") + +(defconst suggest--max-possibilities 20 + "The maximum number of possibilities to return. +This has a major impact on performance, and later possibilities +tend to be progressively more silly.") + +(defconst suggest--max-intermediates 200) + +(defconst suggest--max-per-value 3) + +(defsubst suggest--classify-output (inputs func-output target-output) + "Classify FUNC-OUTPUT so we can decide whether we should keep it." + (cond + ((equal func-output target-output) + 'match) + ;; If the function gave us nil, we're not going to + ;; find any interesting values by further exploring + ;; this value. + ((null func-output) + 'ignore) + ;; If the function gave us the same target-output as our + ;; input, don't bother exploring further. Too many + ;; functions return the input if they can't do + ;; anything with it. + ((and (equal (length inputs) 1) + (equal (-first-item inputs) func-output)) + 'ignore) + ;; The function returned a different result to what + ;; we wanted, but might be worth exploring further. + (t + 'different))) + +(defsubst suggest--call (func values literals &optional variadic-p) + "Call FUNC with VALUES, ignoring all errors. +If FUNC returns a value, return a plist (:output ...). Returns +nil otherwise." + (when (suggest--safe-p func (if variadic-p + (car values) + values)) + (let ((default-directory "/") + (file-name-handler-alist nil) + func-output func-success) + (ignore-errors + (setq func-output + (if variadic-p + (apply func (car values)) + (apply func values))) + (setq func-success t)) + (when func-success + (list :output func-output + :variadic-p variadic-p + :literals literals))))) + +(defun suggest--unread (value) + "Convert VALUE to a string that can be read to obtain VALUE. +This is primarily for quoting symbols." + (cond + ((consp value) + (format "'%S" value)) + ((functionp value) + (format "#'%s" value)) + ((and + (symbolp value) + (not (keywordp value)) + (not (eq value nil)) + (not (eq value t))) + (format "'%s" value)) + (t + (s-trim (pp-to-string value))))) + +(defsubst suggest--try-call (iteration func input-values input-literals) + "Try to call FUNC with INPUT-VALUES, and return a list of outputs" + (let (outputs) + ;; See if (func value1 value2...) gives us a value. + (-when-let (result (suggest--call func input-values input-literals)) + (push result outputs)) + + ;; See if (apply func input-values) gives us a value. + (when (and (eq (length input-values) 1) (listp (car input-values))) + (-when-let (result (suggest--call func input-values input-literals t)) + (push result outputs))) + + ;; See if (func COMMON-CONSTANT value1 value2...) gives us a value. + (when (zerop iteration) + (dolist (extra-arg (if (plist-member suggest-extra-args func) + (plist-get suggest-extra-args func) + (plist-get suggest-extra-args t))) + (dolist (position '(after before)) + (let ((args (if (eq position 'before) + (cons extra-arg input-values) + (-snoc input-values extra-arg))) + (literals (if (eq position 'before) + (cons (suggest--unread extra-arg) input-literals) + (-snoc input-literals (suggest--unread extra-arg))))) + (-when-let (result (suggest--call func args literals)) + (push result outputs)))))) + ;; Return results in ascending order of preference, so we prefer + ;; (+ 1 2) over (+ 0 1 2). + (nreverse outputs))) + +(defmacro suggest--dolist-catch (var-val-tag &rest body) + "Loop over a list, terminating early if TAG is thrown. +Evaluate BODY with VAR bound to each car from LIST, in turn. + +\(fn (VAR LIST TAG) BODY...)" + (declare (indent 1) (debug ((symbolp form &optional form) body))) + (unless (consp var-val-tag) + (signal 'wrong-type-argument (list 'consp var-val-tag))) + (unless (= (length var-val-tag) 3) + (signal 'wrong-number-of-arguments (list 3 (length var-val-tag)))) + (-let [(var val tag) var-val-tag] + `(catch ,tag + (dolist (,var ,val) + ,@body)))) + +(defun suggest--possibilities (input-literals input-values output) + "Return a list of possibilities for these INPUTS-VALUES and OUTPUT. +Each possbility form uses INPUT-LITERALS so we show variables rather +than their values." + (let (possibilities + (possibilities-count 0) + this-iteration + intermediates + (intermediates-count 0) + (value-occurrences (make-hash-table :test #'equal)) + (funcs (append suggest-functions suggest-funcall-functions)) + ;; Since we incrementally build a huge list of results, + ;; garbage collection does a load of work but doesn't find + ;; much to collect. Disable GC, as it significantly improves + ;; performance. + (gc-cons-threshold 50000000)) + ;; Setup: no function calls, all permutations of our inputs. + (setq this-iteration + (-map (-lambda ((values . literals)) + (list :funcs nil :values values :literals literals)) + ;; Only consider unique permutations. + (-distinct + (-zip-pair (suggest--permutations input-values) + (suggest--permutations input-literals))))) + (catch 'done + (dotimes (iteration suggest--search-depth) + ;; We need to call redisplay so the spinner keeps rotating + ;; as we search. + (redisplay) + (suggest--dolist-catch (func funcs 'done-iteration) + (suggest--dolist-catch (item this-iteration 'done-func) + (let ((literals (plist-get item :literals)) + (values (plist-get item :values)) + (funcs (plist-get item :funcs))) + ;; Try to call the function, then classify its return values. + (dolist (func-result (suggest--try-call iteration func values literals)) + (let ((func-output (plist-get func-result :output))) + (cl-case (suggest--classify-output values func-output output) + ;; The function gave us the output we wanted, just save it. + ('match + (push + (list :funcs (cons (list :sym func + :variadic-p (plist-get func-result :variadic-p)) + funcs) + :literals (plist-get func-result :literals)) + possibilities) + (cl-incf possibilities-count) + (when (>= possibilities-count suggest--max-possibilities) + (throw 'done nil)) + + ;; If we're on the first iteration, we're just + ;; searching all input permutations. Don't try any + ;; other permutations, or we end up showing e.g. both + ;; (+ 2 3) and (+ 3 2). + (when (zerop iteration) + (throw 'done-func nil))) + ;; The function returned a different result to what + ;; we wanted. Build a list of these values so we + ;; can explore them. + ('different + (when (and + (< intermediates-count suggest--max-intermediates) + (< (gethash func-output value-occurrences 0) + suggest--max-per-value)) + (puthash + func-output + (1+ (gethash func-output value-occurrences 0)) + value-occurrences) + (cl-incf intermediates-count) + (push + (list :funcs (cons (list :sym func + :variadic-p (plist-get output :variadic-p)) + funcs) + :literals (plist-get func-result :literals) + :values (list func-output)) + intermediates))))))))) + + (setq this-iteration intermediates) + (setq intermediates nil) + (setq intermediates-count 0))) + ;; Return a plist of just :funcs and :literals, which is all we + ;; need to render the result. + (-map (lambda (res) + (list :funcs (plist-get res :funcs) + :literals (plist-get res :literals))) + possibilities))) + +(defun suggest--cmp-relevance (pos1 pos2) + "Compare two possibilities such that the more relevant result + is smaller." + (let ((pos1-func-count (length (plist-get pos1 :funcs))) + (pos2-func-count (length (plist-get pos2 :funcs))) + (pos1-arg-count (length (plist-get pos1 :literals))) + (pos2-arg-count (length (plist-get pos2 :literals))) + (pos1-apply-count (length (--filter (plist-get it :variadic-p) + (plist-get pos1 :funcs)))) + (pos2-apply-count (length (--filter (plist-get it :variadic-p) + (plist-get pos2 :funcs))))) + (cond + ;; If we have the same number of function calls, with the same + ;; number of arguments, prefer functions with shorter names. This + ;; is a dumb but surprisingly effective heuristic. + ((and + (= pos1-func-count pos2-func-count) + (= pos1-arg-count pos2-arg-count) + (= pos1-apply-count pos2-apply-count)) + (let ((join-names (lambda (pos) + (->> (plist-get pos :funcs) + (--map (plist-get it :sym)) + (-map #'symbol-name) + (apply #'concat))))) + (< (length (funcall join-names pos1)) (length (funcall join-names pos2))))) + + ;; Prefer direct function calls to using apply. + ((and + (= pos1-func-count pos2-func-count) + (= pos1-arg-count pos2-arg-count)) + (< pos1-apply-count pos2-apply-count)) + + ;; Prefer calls that don't have extra arguments, so prefer (1+ 1) + ;; over (+ 1 1). + ((= pos1-func-count pos2-func-count) + (< pos1-arg-count pos2-arg-count)) + + ;; Prefer fewer function calls over all else. + (t + (< (length (plist-get pos1 :funcs)) (length (plist-get pos2 :funcs))))))) + +(defvar suggest--spinner nil) + +;;;###autoload +(defun suggest-update () + "Update the suggestions according to the latest inputs/output given." + (interactive) + (setq suggest--spinner (spinner-create 'progress-bar t)) + (spinner-start suggest--spinner) + + (unwind-protect + ;; TODO: error on multiple inputs on one line. + (let* ((raw-inputs (suggest--raw-inputs)) + (inputs (--map (suggest--read-eval it) raw-inputs)) + (raw-output (suggest--raw-output)) + (desired-output (suggest--read-eval raw-output)) + (possibilities + (suggest--possibilities raw-inputs inputs desired-output))) + ;; Sort, and take the top 5 most relevant results. + (setq possibilities + (-take 5 + (-sort #'suggest--cmp-relevance possibilities))) + + (if possibilities + (suggest--write-suggestions + possibilities + ;; We show the evalled output, not the raw input, so if + ;; users use variables, we show the value of that variable. + desired-output) + (suggest--write-suggestions-string ";; No matches found."))) + (setq suggest--spinner nil)) + (suggest--update-needed nil) + (set-buffer-modified-p nil)) + +(define-derived-mode suggest-mode emacs-lisp-mode + '("Suggest" (:eval (spinner-print suggest--spinner))) + "A major mode for finding functions that provide the output requested.") + +(define-key suggest-mode-map (kbd "C-c C-c") #'suggest-update) + +(defun suggest--update-needed (update-needed) + "Update the suggestions heading to say whether we need +the user to call `suggest-update'." + (save-excursion + (suggest--nth-heading 3) + (let ((inhibit-read-only t)) + (delete-region (point) (line-end-position)) + (if update-needed + (suggest--insert-heading + (format ";; Suggestions (press %s to update):" + (key-description + (suggest--keybinding #'suggest-update suggest-mode-map)))) + (suggest--insert-heading suggest--results-heading))))) + +(provide 'suggest) +;;; suggest.el ends here diff --git a/elpa/suggest-20180725.2312/suggest.elc b/elpa/suggest-20180725.2312/suggest.elc new file mode 100644 index 0000000..916e4d0 Binary files /dev/null and b/elpa/suggest-20180725.2312/suggest.elc differ diff --git a/elpa/swiper-20180713.1646/swiper-autoloads.el b/elpa/swiper-20180713.1646/swiper-autoloads.el new file mode 100644 index 0000000..5531cc9 --- /dev/null +++ b/elpa/swiper-20180713.1646/swiper-autoloads.el @@ -0,0 +1,32 @@ +;;; swiper-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "swiper" "swiper.el" (23391 65253 0 0)) +;;; Generated autoloads from swiper.el + +(autoload 'swiper-avy "swiper" "\ +Jump to one of the current swiper candidates. + +\(fn)" t nil) + +(autoload 'swiper "swiper" "\ +`isearch' with an overview. +When non-nil, INITIAL-INPUT is the initial search pattern. + +\(fn &optional INITIAL-INPUT)" t nil) + +(autoload 'swiper-all "swiper" "\ +Run `swiper' for all open buffers. + +\(fn &optional INITIAL-INPUT)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; swiper-autoloads.el ends here diff --git a/elpa/swiper-20180713.1646/swiper-pkg.el b/elpa/swiper-20180713.1646/swiper-pkg.el new file mode 100644 index 0000000..6bd09c2 --- /dev/null +++ b/elpa/swiper-20180713.1646/swiper-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "swiper" "20180713.1646" "Isearch with an overview. Oh, man!" '((emacs "24.1") (ivy "0.9.0")) :commit "951560ef88397e23e3bfea7cf2c1d5831234be69" :keywords '("matching") :authors '(("Oleh Krehel" . "ohwoeowho@gmail.com")) :maintainer '("Oleh Krehel" . "ohwoeowho@gmail.com") :url "https://github.com/abo-abo/swiper") diff --git a/elpa/swiper-20180713.1646/swiper.el b/elpa/swiper-20180713.1646/swiper.el new file mode 100644 index 0000000..ba2ea2e --- /dev/null +++ b/elpa/swiper-20180713.1646/swiper.el @@ -0,0 +1,1040 @@ +;;; swiper.el --- Isearch with an overview. Oh, man! -*- lexical-binding: t -*- + +;; Copyright (C) 2015-2018 Free Software Foundation, Inc. + +;; Author: Oleh Krehel +;; URL: https://github.com/abo-abo/swiper +;; Package-Version: 20180713.1646 +;; Version: 0.10.0 +;; Package-Requires: ((emacs "24.1") (ivy "0.9.0")) +;; Keywords: matching + +;; This file is part of GNU Emacs. + +;; This file 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. + +;; For a full copy of the GNU General Public License +;; see . + +;;; Commentary: + +;; This package gives an overview of the current regex search +;; candidates. The search regex can be split into groups with a +;; space. Each group is highlighted with a different face. +;; +;; It can double as a quick `regex-builder', although only single +;; lines will be matched. + +;;; Code: + +(require 'ivy) + +(defgroup swiper nil + "`isearch' with an overview." + :group 'matching + :prefix "swiper-") + +(defface swiper-match-face-1 + '((t (:inherit lazy-highlight))) + "The background face for `swiper' matches.") + +(defface swiper-match-face-2 + '((t (:inherit isearch))) + "Face for `swiper' matches modulo 1.") + +(defface swiper-match-face-3 + '((t (:inherit match))) + "Face for `swiper' matches modulo 2.") + +(defface swiper-match-face-4 + '((t (:inherit isearch-fail))) + "Face for `swiper' matches modulo 3.") + +(defface swiper-line-face + '((t (:inherit highlight))) + "Face for current `swiper' line.") + +(defcustom swiper-faces '(swiper-match-face-1 + swiper-match-face-2 + swiper-match-face-3 + swiper-match-face-4) + "List of `swiper' faces for group matches." + :group 'ivy-faces + :type '(repeat face)) + +(defcustom swiper-min-highlight 2 + "Only highlight matches for regexps at least this long." + :type 'integer) + +(defcustom swiper-include-line-number-in-search nil + "Include line number in text of search candidates." + :type 'boolean + :group 'swiper) + +(defcustom swiper-goto-start-of-match nil + "When non-nil, go to the start of the match, not its end." + :type 'boolean + :group 'swiper) + +(defvar swiper-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "M-q") 'swiper-query-replace) + (define-key map (kbd "C-l") 'swiper-recenter-top-bottom) + (define-key map (kbd "C-'") 'swiper-avy) + (define-key map (kbd "C-7") 'swiper-mc) + (define-key map (kbd "C-c C-f") 'swiper-toggle-face-matching) + map) + "Keymap for swiper.") + +(defun swiper-query-replace () + "Start `query-replace' with string to replace from last search string." + (interactive) + (if (null (window-minibuffer-p)) + (user-error "Should only be called in the minibuffer through `swiper-map'") + (let* ((enable-recursive-minibuffers t) + (from (ivy--regex ivy-text)) + (to (minibuffer-with-setup-hook + (lambda () + (setq minibuffer-default + (if (string-match "\\`\\\\_<\\(.*\\)\\\\_>\\'" ivy-text) + (match-string 1 ivy-text) + ivy-text))) + (read-from-minibuffer (format "Query replace %s with: " from))))) + (swiper--cleanup) + (ivy-exit-with-action + (lambda (_) + (with-ivy-window + (move-beginning-of-line 1) + (let ((inhibit-read-only t)) + (perform-replace from to + t t nil)))))))) + +(defun swiper-all-query-replace () + "Start `query-replace' with string to replace from last search string." + (interactive) + (if (null (window-minibuffer-p)) + (user-error + "Should only be called in the minibuffer through `swiper-all-map'") + (let* ((enable-recursive-minibuffers t) + (from (ivy--regex ivy-text)) + (to (query-replace-read-to from "Query replace" t))) + (swiper--cleanup) + (ivy-exit-with-action + (lambda (_) + (let ((wnd-conf (current-window-configuration)) + (inhibit-message t)) + (unwind-protect + (dolist (cand ivy--old-cands) + (let ((buffer (get-text-property 0 'buffer cand))) + (switch-to-buffer buffer) + (goto-char (point-min)) + (perform-replace from to t t nil))) + (set-window-configuration wnd-conf)))))))) + +(defvar avy-background) +(defvar avy-all-windows) +(defvar avy-style) +(defvar avy-keys) +(declare-function avy--regex-candidates "ext:avy") +(declare-function avy--process "ext:avy") +(declare-function avy--overlay-post "ext:avy") +(declare-function avy-action-goto "ext:avy") +(declare-function avy-candidate-beg "ext:avy") +(declare-function avy--done "ext:avy") +(declare-function avy--make-backgrounds "ext:avy") +(declare-function avy-window-list "ext:avy") +(declare-function avy-read "ext:avy") +(declare-function avy-read-de-bruijn "ext:avy") +(declare-function avy-tree "ext:avy") +(declare-function avy-push-mark "ext:avy") +(declare-function avy--remove-leading-chars "ext:avy") + +;;;###autoload +(defun swiper-avy () + "Jump to one of the current swiper candidates." + (interactive) + (unless (require 'avy nil 'noerror) + (error "Package avy isn't installed")) + (unless (string= ivy-text "") + (let* ((avy-all-windows nil) + ;; We'll have overlapping overlays, so we sort all the + ;; overlays in the visible region by their start, and then + ;; throw out non-Swiper overlays or overlapping Swiper + ;; overlays. + (visible-overlays (cl-sort (with-ivy-window + (overlays-in (window-start) + (window-end))) + #'< :key #'overlay-start)) + (min-overlay-start 0) + (overlays-for-avy (cl-remove-if-not + (lambda (ov) + (when (and (>= (overlay-start ov) + min-overlay-start) + (memq (overlay-get ov 'face) + swiper-faces)) + (setq min-overlay-start (overlay-start ov)))) + visible-overlays)) + (candidates (append + (mapcar (lambda (ov) + (cons (overlay-start ov) + (overlay-get ov 'window))) + overlays-for-avy) + (save-excursion + (save-restriction + (narrow-to-region (window-start) (window-end)) + (goto-char (point-min)) + (forward-line) + (let ((cands)) + (while (< (point) (point-max)) + (push (cons (1+ (point)) + (selected-window)) + cands) + (forward-line)) + cands))))) + (candidate (unwind-protect + (prog2 + (avy--make-backgrounds + (append (avy-window-list) + (list (ivy-state-window ivy-last)))) + (if (eq avy-style 'de-bruijn) + (avy-read-de-bruijn + candidates avy-keys) + (avy-read (avy-tree candidates avy-keys) + #'avy--overlay-post + #'avy--remove-leading-chars)) + (avy-push-mark)) + (avy--done)))) + (if (window-minibuffer-p (cdr candidate)) + (progn + (ivy-set-index (- (line-number-at-pos (car candidate)) 2)) + (ivy--exhibit) + (ivy-done) + (ivy-call)) + (ivy-quit-and-run + (avy-action-goto (avy-candidate-beg candidate))))))) + +(declare-function mc/create-fake-cursor-at-point "ext:multiple-cursors-core") +(declare-function multiple-cursors-mode "ext:multiple-cursors-core") + +(defun swiper-mc () + "Create a fake cursor for each `swiper' candidate." + (interactive) + (unless (require 'multiple-cursors nil t) + (error "Multiple-cursors isn't installed")) + (unless (window-minibuffer-p) + (error "Call me only from `swiper'")) + (let ((cands (nreverse ivy--old-cands))) + (unless (string= ivy-text "") + (ivy-exit-with-action + (lambda (_) + (let (cand) + (while (setq cand (pop cands)) + (swiper--action cand) + (when cands + (mc/create-fake-cursor-at-point)))) + (multiple-cursors-mode 1)))))) + +(defun swiper-recenter-top-bottom (&optional arg) + "Call (`recenter-top-bottom' ARG)." + (interactive "P") + (with-ivy-window + (recenter-top-bottom arg))) + +(defvar swiper-font-lock-exclude + '(bbdb-mode + bookmark-bmenu-mode + package-menu-mode + gnus-summary-mode + gnus-article-mode + gnus-group-mode + emms-playlist-mode + emms-stream-mode + eshell-mode + erc-mode + forth-mode + forth-block-mode + helpful-mode + nix-mode + org-agenda-mode + dired-mode + jabber-chat-mode + elfeed-search-mode + elfeed-show-mode + fundamental-mode + Man-mode + woman-mode + mu4e-view-mode + mu4e-headers-mode + notmuch-tree-mode + notmuch-search-mode + help-mode + debbugs-gnu-mode + occur-mode + occur-edit-mode + bongo-mode + bongo-library-mode + magit-popup-mode + adoc-mode + bongo-playlist-mode + eww-mode + treemacs-mode + twittering-mode + vc-dir-mode + rcirc-mode + circe-channel-mode + circe-server-mode + circe-query-mode + sauron-mode + w3m-mode) + "List of major-modes that are incompatible with `font-lock-ensure'.") + +(defun swiper-font-lock-ensure-p () + "Return non-nil if we should `font-lock-ensure'." + (or (derived-mode-p 'magit-mode) + (bound-and-true-p magit-blame-mode) + (memq major-mode swiper-font-lock-exclude))) + +(defun swiper-font-lock-ensure () + "Ensure the entired buffer is highlighted." + (unless (swiper-font-lock-ensure-p) + (unless (or (> (buffer-size) 100000) (null font-lock-mode)) + (if (fboundp 'font-lock-ensure) + (font-lock-ensure) + (with-no-warnings (font-lock-fontify-buffer)))))) + +(defvar swiper--format-spec "" + "Store the current candidates format spec.") + +(defvar swiper--width nil + "Store the number of digits needed for the longest line nubmer.") + +(defvar swiper-use-visual-line nil + "When non-nil, use `line-move' instead of `forward-line'.") + +(defvar dired-isearch-filenames) +(declare-function dired-move-to-filename "dired") + +(defun swiper--line () + (let* ((beg (cond ((and (eq major-mode 'dired-mode) + (bound-and-true-p dired-isearch-filenames)) + (dired-move-to-filename) + (point)) + (swiper-use-visual-line + (save-excursion + (beginning-of-visual-line) + (point))) + (t + (point)))) + (end (if swiper-use-visual-line + (save-excursion + (end-of-visual-line) + (point)) + (line-end-position)))) + + (concat + " " + (buffer-substring beg end)))) + +(declare-function outline-show-all "outline") + +(defun swiper--candidates (&optional numbers-width) + "Return a list of this buffer lines. + +NUMBERS-WIDTH, when specified, is used for width spec of line +numbers; replaces calculating the width from buffer line count." + (if (and visual-line-mode + ;; super-slow otherwise + (< (buffer-size) 20000)) + (progn + (when (eq major-mode 'org-mode) + (require 'outline) + (if (fboundp 'outline-show-all) + (outline-show-all) + (with-no-warnings + (show-all)))) + (setq swiper-use-visual-line t)) + (setq swiper-use-visual-line nil)) + (let ((n-lines (count-lines (point-min) (point-max)))) + (unless (zerop n-lines) + (setq swiper--width (or numbers-width + (1+ (floor (log n-lines 10))))) + (setq swiper--format-spec + (format "%%-%dd " swiper--width)) + (let ((line-number 0) + (advancer (if swiper-use-visual-line + (lambda (arg) (line-move arg t)) + #'forward-line)) + candidates) + (save-excursion + (goto-char (point-min)) + (swiper-font-lock-ensure) + (while (< (point) (point-max)) + (let ((str (swiper--line))) + (setq str (ivy-cleanup-string str)) + (let ((line-number-str + (format swiper--format-spec (cl-incf line-number)))) + (if swiper-include-line-number-in-search + (setq str (concat line-number-str str)) + (put-text-property + 0 1 'display line-number-str str)) + (put-text-property + 0 1 'swiper-line-number line-number-str str)) + (push str candidates)) + (funcall advancer 1)) + (nreverse candidates)))))) + +(defvar swiper--opoint 1 + "The point when `swiper' starts.") + +;;;###autoload +(defun swiper (&optional initial-input) + "`isearch' with an overview. +When non-nil, INITIAL-INPUT is the initial search pattern." + (interactive) + (swiper--ivy (swiper--candidates) initial-input)) + +(defvar swiper--current-window-start nil) + +(defun swiper--extract-matches (regex cands) + "Extract captured REGEX groups from CANDS." + (let (res) + (dolist (cand cands) + (setq cand (substring cand 1)) + (when (string-match regex cand) + (push (mapconcat (lambda (n) (match-string-no-properties n cand)) + (number-sequence + 1 + (/ (- (length (match-data)) 2) 2)) + " ") + res))) + (nreverse res))) + +(defun swiper-occur (&optional revert) + "Generate a custom occur buffer for `swiper'. +When REVERT is non-nil, regenerate the current *ivy-occur* buffer. +When capture groups are present in the input, print them instead of lines." + (let* ((buffer (ivy-state-buffer ivy-last)) + (fname (propertize + (with-ivy-window + (if (buffer-file-name buffer) + (file-name-nondirectory + (buffer-file-name buffer)) + (buffer-name buffer))) + 'face + 'compilation-info)) + (re (progn (string-match "\"\\(.*\\)\"" (buffer-name)) + (match-string 1 (buffer-name)))) + (re (mapconcat #'identity (ivy--split re) ".*?")) + (cands + (mapcar + (lambda (s) + (let* ((n (get-text-property 0 'swiper-line-number s)) + (i (string-match-p "[ \t\n\r]+\\'" n))) + (when i (setq n (substring n 0 i))) + (put-text-property 0 (length n) 'face 'compilation-line-number n) + (format "%s:%s:%s" fname n (substring s 1)))) + (if (not revert) + ivy--old-cands + (setq ivy--old-re nil) + (let ((ivy--regex-function 'swiper--re-builder)) + (ivy--filter re (with-current-buffer buffer + (swiper--candidates)))))))) + (if (string-match-p "\\\\(" re) + (insert + (mapconcat #'identity + (swiper--extract-matches + re (with-current-buffer buffer + (swiper--candidates))) + "\n")) + (unless (eq major-mode 'ivy-occur-grep-mode) + (ivy-occur-grep-mode) + (font-lock-mode -1)) + (setq swiper--current-window-start nil) + (insert (format "-*- mode:grep; default-directory: %S -*-\n\n\n" + default-directory)) + (insert (format "%d candidates:\n" (length cands))) + (ivy--occur-insert-lines + (mapcar + (lambda (cand) (concat "./" cand)) + cands)) + (goto-char (point-min)) + (forward-line 4)))) + +(ivy-set-occur 'swiper 'swiper-occur) + +(declare-function evil-set-jump "ext:evil-jumps") + +(defvar swiper--current-line nil) +(defvar swiper--current-match-start nil) +(defvar swiper--point-min nil) +(defvar swiper--point-max nil) +(defvar swiper--reveal-mode nil) + +(defun swiper--init () + "Perform initialization common to both completion methods." + (setq swiper--current-line nil) + (setq swiper--current-match-start nil) + (setq swiper--current-window-start nil) + (setq swiper--opoint (point)) + (setq swiper--point-min (point-min)) + (setq swiper--point-max (point-max)) + (when (setq swiper--reveal-mode + (bound-and-true-p reveal-mode)) + (reveal-mode -1)) + (when (bound-and-true-p evil-mode) + (evil-set-jump))) + +(declare-function char-fold-to-regexp "char-fold") + +(defun swiper--re-builder (str) + "Transform STR into a swiper regex. +This is the regex used in the minibuffer where candidates have +line numbers. For the buffer, use `ivy--regex' instead." + (let* ((re-builder (ivy-alist-setting ivy-re-builders-alist)) + (re (cond + ((equal str "") + "") + ((equal str "^") + (setq ivy--subexps 0) + ".") + ((string-match "^\\^" str) + (let ((re (funcall re-builder (substring str 1)))) + (if (zerop ivy--subexps) + (prog1 (format "^ ?\\(%s\\)" re) + (setq ivy--subexps 1)) + (format "^ %s" re)))) + ((eq (bound-and-true-p search-default-mode) 'char-fold-to-regexp) + (mapconcat #'char-fold-to-regexp (ivy--split str) ".*")) + (t + (funcall re-builder str))))) + re)) + +(defvar swiper-history nil + "History for `swiper'.") + +(defvar swiper-invocation-face nil + "The face at the point of invocation of `swiper'.") + +(defcustom swiper-stay-on-quit nil + "When non-nil don't go back to search start on abort." + :type 'boolean) + +(defun swiper--ivy (candidates &optional initial-input) + "Select one of CANDIDATES and move there. +When non-nil, INITIAL-INPUT is the initial search pattern." + (swiper--init) + (setq swiper-invocation-face + (plist-get (text-properties-at (point)) 'face)) + (let ((preselect + (if swiper-use-visual-line + (count-screen-lines + (point-min) + (save-excursion (beginning-of-visual-line) (point))) + (1- (line-number-at-pos)))) + (minibuffer-allow-text-properties t) + res) + (unwind-protect + (and + (setq res + (ivy-read + "Swiper: " + candidates + :initial-input initial-input + :keymap swiper-map + :preselect preselect + :require-match t + :update-fn #'swiper--update-input-ivy + :unwind #'swiper--cleanup + :action #'swiper--action + :re-builder #'swiper--re-builder + :history 'swiper-history + :caller 'swiper)) + (point)) + (unless (or res swiper-stay-on-quit) + (goto-char swiper--opoint)) + (when (and (null res) (> (length ivy-text) 0)) + (cl-pushnew ivy-text swiper-history)) + (when swiper--reveal-mode + (reveal-mode 1))))) + +(defun swiper-toggle-face-matching () + "Toggle matching only the candidates with `swiper-invocation-face'." + (interactive) + (setf (ivy-state-matcher ivy-last) + (if (ivy-state-matcher ivy-last) + nil + #'swiper--face-matcher)) + (setq ivy--old-re nil)) + +(defun swiper--face-matcher (regexp candidates) + "Return REGEXP matching CANDIDATES. +Matched candidates should have `swiper-invocation-face'." + (cl-remove-if-not + (lambda (x) + (and + (string-match regexp x) + (let ((s (match-string 0 x)) + (i 0)) + (while (and (< i (length s)) + (text-property-any + i (1+ i) + 'face swiper-invocation-face + s)) + (cl-incf i)) + (eq i (length s))))) + candidates)) + +(defun swiper--ensure-visible () + "Remove overlays hiding point." + (let ((overlays (overlays-at (1- (point)))) + ov expose) + (while (setq ov (pop overlays)) + (if (and (invisible-p (overlay-get ov 'invisible)) + (setq expose (overlay-get ov 'isearch-open-invisible))) + (funcall expose ov))))) + +(defvar swiper--overlays nil + "Store overlays.") + +(defun swiper--cleanup () + "Clean up the overlays." + (while swiper--overlays + (delete-overlay (pop swiper--overlays))) + (save-excursion + (goto-char (point-min)) + (isearch-clean-overlays))) + +(defun swiper--update-input-ivy () + "Called when `ivy' input is updated." + (with-ivy-window + (swiper--cleanup) + (when (> (length (ivy-state-current ivy-last)) 0) + (let* ((regexp-or-regexps (funcall ivy--regex-function ivy-text)) + (regexps + (if (listp regexp-or-regexps) + (mapcar #'car (cl-remove-if-not #'cdr regexp-or-regexps)) + (list regexp-or-regexps)))) + (dolist (re regexps) + (let* ((re (replace-regexp-in-string + " " "\t" + re)) + (str (get-text-property 0 'swiper-line-number (ivy-state-current ivy-last))) + (num (if (string-match "^[0-9]+" str) + (string-to-number (match-string 0 str)) + 0))) + (unless (memq this-command '(ivy-yank-word + ivy-yank-symbol + ivy-yank-char + scroll-other-window)) + (when (cl-plusp num) + (unless (if swiper--current-line + (eq swiper--current-line num) + (eq (line-number-at-pos) num)) + (goto-char swiper--point-min) + (if swiper-use-visual-line + (line-move (1- num)) + (forward-line (1- num)))) + (if (and (equal ivy-text "") + (>= swiper--opoint (line-beginning-position)) + (<= swiper--opoint (line-end-position))) + (goto-char swiper--opoint) + (if (eq swiper--current-line num) + (when swiper--current-match-start + (goto-char swiper--current-match-start)) + (setq swiper--current-line num)) + (when (re-search-forward re (line-end-position) t) + (setq swiper--current-match-start (match-beginning 0)))) + (isearch-range-invisible (line-beginning-position) + (line-end-position)) + (unless (and (>= (point) (window-start)) + (<= (point) (window-end (ivy-state-window ivy-last) t))) + (recenter)) + (setq swiper--current-window-start (window-start)))) + (swiper--add-overlays + re + (max (window-start) swiper--point-min) + (min (window-end (selected-window) t) swiper--point-max)))))))) + +(defun swiper--add-overlays (re &optional beg end wnd) + "Add overlays for RE regexp in visible part of the current buffer. +BEG and END, when specified, are the point bounds. +WND, when specified is the window." + (setq wnd (or wnd (ivy-state-window ivy-last))) + (let ((ov (if visual-line-mode + (make-overlay + (save-excursion + (beginning-of-visual-line) + (point)) + (save-excursion + (end-of-visual-line) + (point))) + (make-overlay + (line-beginning-position) + (1+ (line-end-position)))))) + (overlay-put ov 'face 'swiper-line-face) + (overlay-put ov 'window wnd) + (push ov swiper--overlays) + (let* ((wh (window-height)) + (beg (or beg (save-excursion + (forward-line (- wh)) + (point)))) + (end (or end (save-excursion + (forward-line wh) + (point)))) + (case-fold-search (ivy--case-fold-p re))) + (when (>= (length re) swiper-min-highlight) + (save-excursion + (goto-char beg) + ;; RE can become an invalid regexp + (while (and (ignore-errors (re-search-forward re end t)) + (> (- (match-end 0) (match-beginning 0)) 0)) + ;; Don't highlight a match if it spans multiple + ;; lines. `count-lines' returns 1 if the match is within a + ;; single line, even if it includes the newline, and 2 or + ;; greater otherwise. We hope that the inclusion of the + ;; newline will not ever be a problem in practice. + (when (< (count-lines (match-beginning 0) (match-end 0)) 2) + (unless (and (consp ivy--old-re) + (null + (save-match-data + (ivy--re-filter ivy--old-re + (list + (buffer-substring-no-properties + (line-beginning-position) + (line-end-position))))))) + (let ((mb (match-beginning 0)) + (me (match-end 0))) + (unless (> (- me mb) 2017) + (swiper--add-overlay mb me + (if (zerop ivy--subexps) + (cadr swiper-faces) + (car swiper-faces)) + wnd 0)))) + (let ((i 1) + (j 0)) + (while (<= (cl-incf j) ivy--subexps) + (let ((bm (match-beginning j)) + (em (match-end j))) + (when (and (integerp em) + (integerp bm)) + (while (and (< j ivy--subexps) + (integerp (match-beginning (+ j 1))) + (= em (match-beginning (+ j 1)))) + (setq em (match-end (cl-incf j)))) + (swiper--add-overlay + bm em + (nth (1+ (mod (+ i 2) (1- (length swiper-faces)))) + swiper-faces) + wnd i) + (cl-incf i)))))))))))) + +(defun swiper--add-overlay (beg end face wnd priority) + "Add overlay bound by BEG and END to `swiper--overlays'. +FACE, WND and PRIORITY are properties corresponding to +the face, window and priority of the overlay." + (let ((overlay (make-overlay beg end))) + (push overlay swiper--overlays) + (overlay-put overlay 'face face) + (overlay-put overlay 'window wnd) + (overlay-put overlay 'priority priority))) + +(defcustom swiper-action-recenter nil + "When non-nil, recenter after exiting `swiper'." + :type 'boolean) +(defvar evil-search-module) +(defvar evil-ex-search-pattern) +(defvar evil-ex-search-persistent-highlight) +(defvar evil-ex-search-direction) +(declare-function evil-ex-search-activate-highlight "evil-ex") + + +(defun swiper--action (x) + "Goto line X." + (let ((ln (1- (read (or (get-text-property 0 'swiper-line-number x) + (and (string-match ":\\([0-9]+\\):.*\\'" x) + (match-string-no-properties 1 x)))))) + (re (ivy--regex ivy-text))) + (if (null x) + (user-error "No candidates") + (with-ivy-window + (unless (equal (current-buffer) + (ivy-state-buffer ivy-last)) + (switch-to-buffer (ivy-state-buffer ivy-last))) + (goto-char swiper--point-min) + (funcall (if swiper-use-visual-line + #'line-move + #'forward-line) + ln) + (when (and (re-search-forward re (line-end-position) t) swiper-goto-start-of-match) + (goto-char (match-beginning 0))) + (swiper--ensure-visible) + (cond (swiper-action-recenter + (recenter)) + (swiper--current-window-start + (set-window-start (selected-window) swiper--current-window-start))) + (when (/= (point) swiper--opoint) + (unless (and transient-mark-mode mark-active) + (when (eq ivy-exit 'done) + (push-mark swiper--opoint t) + (message "Mark saved where search started")))) + (add-to-history + 'regexp-search-ring + re + regexp-search-ring-max) + ;; integration with evil-mode's search + (when (bound-and-true-p evil-mode) + (when (eq evil-search-module 'isearch) + (setq isearch-string ivy-text)) + (when (eq evil-search-module 'evil-search) + (add-to-history 'evil-ex-search-history re) + (setq evil-ex-search-pattern (list re t t)) + (setq evil-ex-search-direction 'forward) + (when evil-ex-search-persistent-highlight + (evil-ex-search-activate-highlight evil-ex-search-pattern)))))))) + +(defun swiper-from-isearch () + "Invoke `swiper' from isearch." + (interactive) + (let ((query (if isearch-regexp + isearch-string + (regexp-quote isearch-string)))) + (isearch-exit) + (swiper query))) + +(defvar swiper-multi-buffers nil + "Store the current list of buffers.") + +(defvar swiper-multi-candidates nil + "Store the list of candidates for `swiper-multi'.") + +(defun swiper-multi-prompt () + "Return prompt for `swiper-multi'." + (format "Buffers (%s): " + (mapconcat #'identity swiper-multi-buffers ", "))) + +(defun swiper-multi () + "Select one or more buffers. +Run `swiper' for those buffers." + (interactive) + (setq swiper-multi-buffers nil) + (let ((ivy-use-virtual-buffers nil)) + (ivy-read (swiper-multi-prompt) + 'internal-complete-buffer + :action 'swiper-multi-action-1)) + (ivy-read "Swiper: " swiper-multi-candidates + :action 'swiper-multi-action-2 + :unwind #'swiper--cleanup + :caller 'swiper-multi)) + +(defun swiper-multi-action-1 (x) + "Add X to list of selected buffers `swiper-multi-buffers'. +If X is already part of the list, remove it instead. Quit the selection if +X is selected by either `ivy-done', `ivy-alt-done' or `ivy-immediate-done', +otherwise continue prompting for buffers." + (if (member x swiper-multi-buffers) + (progn + (setq swiper-multi-buffers (delete x swiper-multi-buffers))) + (unless (equal x "") + (setq swiper-multi-buffers (append swiper-multi-buffers (list x))))) + (let ((prompt (swiper-multi-prompt))) + (setf (ivy-state-prompt ivy-last) prompt) + (setq ivy--prompt (concat "%-4d " prompt))) + (cond ((memq this-command '(ivy-done + ivy-alt-done + ivy-immediate-done)) + (setq swiper-multi-candidates + (swiper--multi-candidates + (mapcar #'get-buffer swiper-multi-buffers)))) + ((eq this-command 'ivy-call) + (with-selected-window (active-minibuffer-window) + (delete-minibuffer-contents))))) + +(defun swiper-multi-action-2 (x) + "Move to candidate X from `swiper-multi'." + (when (> (length x) 0) + (let ((buffer-name (get-text-property 0 'buffer x))) + (when buffer-name + (with-ivy-window + (switch-to-buffer buffer-name) + (goto-char (point-min)) + (forward-line (1- (read (get-text-property 0 'swiper-line-number x)))) + (re-search-forward + (ivy--regex ivy-text) + (line-end-position) t) + (isearch-range-invisible (line-beginning-position) + (line-end-position)) + (unless (eq ivy-exit 'done) + (swiper--cleanup) + (swiper--add-overlays (ivy--regex ivy-text)))))))) + +(defun swiper-all-buffer-p (buffer) + "Return non-nil if BUFFER should be considered by `swiper-all'." + (let ((mode (buffer-local-value 'major-mode (get-buffer buffer)))) + (cond + ;; Ignore TAGS buffers, they tend to add duplicate results. + ((eq mode #'tags-table-mode) nil) + ;; Always consider dired buffers, even though they're not backed + ;; by a file. + ((eq mode #'dired-mode) t) + ;; Always consider stash buffers too, as they may have + ;; interesting content not present in any buffers. We don't #' + ;; quote to satisfy the byte-compiler. + ((eq mode 'magit-stash-mode) t) + ;; Email buffers have no file, but are useful to search + ((eq mode 'gnus-article-mode) t) + ;; Otherwise, only consider the file if it's backed by a file. + (t (buffer-file-name buffer))))) + +;;* `swiper-all' +(defun swiper-all-function (str) + "Search in all open buffers for STR." + (if (and (< (length str) 3)) + (list "" (format "%d chars more" (- 3 (length ivy-text)))) + (let* ((buffers (cl-remove-if-not #'swiper-all-buffer-p (buffer-list))) + (re-full (funcall ivy--regex-function str)) + re re-tail + cands match + (case-fold-search (ivy--case-fold-p str))) + (if (stringp re-full) + (setq re re-full) + (setq re (caar re-full)) + (setq re-tail (cdr re-full))) + (dolist (buffer buffers) + (with-current-buffer buffer + (save-excursion + (goto-char (point-min)) + (while (re-search-forward re nil t) + (setq match (if (memq major-mode '(org-mode dired-mode)) + (buffer-substring-no-properties + (line-beginning-position) + (line-end-position)) + (buffer-substring + (line-beginning-position) + (line-end-position)))) + (put-text-property + 0 1 'buffer + (buffer-name) + match) + (put-text-property 0 1 'point (point) match) + (when (or (null re-tail) (ivy-re-match re-tail match)) + (push match cands)))))) + (setq ivy--old-re re-full) + (if (null cands) + (list "") + (setq ivy--old-cands (nreverse cands)))))) + +(defvar swiper-window-width 80) + +(defun swiper--all-format-function (cands) + "Format CANDS for `swiper-all'. +See `ivy-format-function' for further information." + (let* ((ww swiper-window-width) + (col2 1) + (cands-with-buffer + (mapcar (lambda (s) + (let ((buffer (get-text-property 0 'buffer s))) + (setq col2 (max col2 (length buffer))) + (cons s buffer))) cands)) + (col1 (- ww 4 col2))) + (setq cands + (mapcar (lambda (x) + (if (cdr x) + (let ((s (ivy--truncate-string (car x) col1))) + (concat + s + (make-string + (max 0 + (- ww (string-width s) (length (cdr x)))) + ?\ ) + (cdr x))) + (car x))) + cands-with-buffer)) + (ivy--format-function-generic + (lambda (str) + (ivy--add-face str 'ivy-current-match)) + (lambda (str) + str) + cands + "\n"))) + +(defvar swiper-all-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "M-q") 'swiper-all-query-replace) + map) + "Keymap for `swiper-all'.") + +;;;###autoload +(defun swiper-all (&optional initial-input) + "Run `swiper' for all open buffers." + (interactive) + (let* ((swiper-window-width (- (frame-width) (if (display-graphic-p) 0 1))) + (ivy-format-function #'swiper--all-format-function)) + (ivy-read "swiper-all: " 'swiper-all-function + :action 'swiper-all-action + :unwind #'swiper--cleanup + :update-fn (lambda () + (swiper-all-action (ivy-state-current ivy-last))) + :dynamic-collection t + :keymap swiper-all-map + :initial-input initial-input + :caller 'swiper-multi))) + +(defun swiper-all-action (x) + "Move to candidate X from `swiper-all'." + (when (> (length x) 0) + (let ((buffer-name (get-text-property 0 'buffer x))) + (when buffer-name + (with-ivy-window + (switch-to-buffer buffer-name) + (goto-char (get-text-property 0 'point x)) + (isearch-range-invisible (line-beginning-position) + (line-end-position)) + (unless (eq ivy-exit 'done) + (swiper--cleanup) + (swiper--add-overlays (ivy--regex ivy-text)))))))) + +(defun swiper--multi-candidates (buffers) + "Extract candidates from BUFFERS." + (let* ((ww (window-width)) + (res nil) + (column-2 (apply #'max + (mapcar + (lambda (b) + (length (buffer-name b))) + buffers))) + (column-1 (- ww 4 column-2 1))) + (dolist (buf buffers) + (with-current-buffer buf + (setq res + (append + (mapcar + (lambda (s) + (setq s (concat (ivy--truncate-string s column-1) " ")) + (let ((len (length s))) + (put-text-property + (1- len) len 'display + (concat + (make-string + (max 0 + (- ww (string-width s) (length (buffer-name)) 3)) + ?\ ) + (buffer-name)) + s) + (put-text-property 0 len 'buffer buf s) + s)) + (swiper--candidates 4)) + res)) + nil)) + res)) + +(provide 'swiper) + +;;; swiper.el ends here diff --git a/elpa/swiper-20180713.1646/swiper.elc b/elpa/swiper-20180713.1646/swiper.elc new file mode 100644 index 0000000..c3fe584 Binary files /dev/null and b/elpa/swiper-20180713.1646/swiper.elc differ diff --git a/elpa/tablist-20170219.1935/tablist-autoloads.el b/elpa/tablist-20170219.1935/tablist-autoloads.el deleted file mode 100644 index 5065f81..0000000 --- a/elpa/tablist-20170219.1935/tablist-autoloads.el +++ /dev/null @@ -1,35 +0,0 @@ -;;; tablist-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "tablist" "tablist.el" (23355 30548 0 0)) -;;; Generated autoloads from tablist.el - -(autoload 'tablist-minor-mode "tablist" "\ -Toggle Tablist minor mode on or off. -With a prefix argument ARG, enable Tablist minor mode if ARG is -positive, and disable it otherwise. If called from Lisp, enable -the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. -\\{tablist-minor-mode-map} - -\(fn &optional ARG)" t nil) - -(autoload 'tablist-mode "tablist" "\ - - -\(fn)" t nil) - -;;;*** - -;;;### (autoloads nil nil ("tablist-filter.el" "tablist-pkg.el") -;;;;;; (23355 30548 0 0)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; tablist-autoloads.el ends here diff --git a/elpa/tablist-20170219.1935/tablist-filter.el b/elpa/tablist-20170219.1935/tablist-filter.el deleted file mode 100644 index 0ea7e2c..0000000 --- a/elpa/tablist-20170219.1935/tablist-filter.el +++ /dev/null @@ -1,448 +0,0 @@ -;;; tablist-filter.el --- Filter expressions for tablists. -*- lexical-binding:t -*- - -;; Copyright (C) 2013, 2014 Andreas Politz - -;; Author: Andreas Politz -;; Keywords: extensions, lisp - -;; 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 . - -;;; Commentary: - -;; - -(defvar python-mode-hook) -(let (python-mode-hook) ;FIXME: Why? -(require 'semantic/wisent/comp) -(require 'semantic/wisent/wisent)) - -;;; Code: - -(defvar wisent-eoi-term) -(declare-function wisent-parse "semantic/wisent/wisent.el") - -(defvar tablist-filter-binary-operator - '((== . tablist-filter-op-equal) - (=~ . tablist-filter-op-regexp) - (< . tablist-filter-op-<) - (> . tablist-filter-op->) - (<= . tablist-filter-op-<=) - (>= . tablist-filter-op->=) - (= . tablist-filter-op-=))) - -(defvar tablist-filter-unary-operator nil) - -(defvar tablist-filter-wisent-parser nil) - -(defvar tablist-filter-lexer-regexps nil) - -(defvar tablist-filter-wisent-grammar - '( - ;; terminals - ;; Use lowercase for better looking error messages. - (operand unary-operator binary-operator or and not) - - ;; terminal associativity & precedence - ((left binary-operator) - (left unary-operator) - (left or) - (left and) - (left not)) - - ;; rules - (filter-or-empty - ((nil)) - ((?\( ?\)) nil) - ((filter) $1)) - (filter - ((operand) $1) ;;Named filter - ((operand binary-operator operand) `(,(intern $2) ,$1 ,$3)) - ((unary-operator operand) `(,(intern $1) ,$2)) - ((not filter) `(not ,$2)) - ((filter and filter) `(and ,$1 ,$3)) - ((filter or filter) `(or ,$1 ,$3)) - ((?( filter ?)) $2)))) - -(defun tablist-filter-parser-init (&optional reinitialize interactive) - (interactive (list t t)) - (unless (and tablist-filter-lexer-regexps - (not reinitialize)) - (let ((re (mapcar - (lambda (l) - (let ((re (regexp-opt - (mapcar 'symbol-name - (mapcar 'car l)) t))) - (if (= (length re) 0) - ".\\`" ;;matches nothing - re))) - (list tablist-filter-binary-operator - tablist-filter-unary-operator)))) - (setq tablist-filter-lexer-regexps - (nreverse - (cons (concat "\\(?:" (car re) "\\|" (cadr re) - "\\|[ \t\f\r\n\"!()]\\|&&\\|||\\)") - re))))) - (unless (and tablist-filter-wisent-parser - (not reinitialize)) - (let ((wisent-compile-grammar* - (symbol-function - 'wisent-compile-grammar))) - (setq tablist-filter-wisent-parser - ;; Trick the byte-compile into not using the byte-compile - ;; handler in semantic/wisent/comp.el, since it does not - ;; always work (wisent-context-compile-grammar n/a). - (funcall wisent-compile-grammar* - tablist-filter-wisent-grammar)))) - (when interactive - (message "Parser reinitialized.")) - nil) - -(defun tablist-filter-wisent-lexer () - (cl-destructuring-bind (unary-op binary-op keywords) - tablist-filter-lexer-regexps - (skip-chars-forward " \t\f\r\n") - (cond - ((eobp) (list wisent-eoi-term)) - ((= ?\" (char-after)) - `(operand , (condition-case err - (read (current-buffer)) - (error (signal (car err) (cons - "invalid lisp string" - (cdr err))))))) - ((looking-at unary-op) - (goto-char (match-end 0)) - `(unary-operator ,(match-string-no-properties 0))) - ((looking-at binary-op) - (goto-char (match-end 0)) - `(binary-operator ,(match-string-no-properties 0))) - ((looking-at "&&") - (forward-char 2) - `(and "&&")) - ((looking-at "||") - (forward-char 2) - `(or "||")) - ((= ?! (char-after)) - (forward-char) - `(not "!")) - ((= ?\( (char-after)) - (forward-char) - `(?\( "(")) - ((= ?\) (char-after)) - (forward-char) - `(?\) ")")) - (t - (let ((beg (point))) - (when (re-search-forward keywords nil 'move) - (goto-char (match-beginning 0))) - `(operand ,(buffer-substring-no-properties - beg - (point)))))))) - -(defun tablist-filter-parse (filter) - (interactive "sFilter: ") - (tablist-filter-parser-init) - (with-temp-buffer - (save-excursion (insert filter)) - (condition-case error - (wisent-parse tablist-filter-wisent-parser - 'tablist-filter-wisent-lexer - (lambda (msg) - (signal 'error - (replace-regexp-in-string - "\\$EOI" "end of input" - msg t t)))) - (error - (signal 'error - (append (if (consp (cdr error)) - (cdr error) - (list (cdr error))) - (list (point)))))))) - -(defun tablist-filter-unparse (filter &optional noerror) - (cl-labels - ((unparse (filter &optional noerror) - (cond - ((stringp filter) - (if (or (string-match (nth 2 tablist-filter-lexer-regexps) - filter) - (= 0 (length filter))) - (format "%S" filter) - filter)) - ((and (eq (car-safe filter) 'not) - (= (length filter) 2)) - (let ((paren (memq (car-safe (nth 1 filter)) '(or and)))) - (format "!%s%s%s" - (if paren "(" "") - (unparse (cadr filter) noerror) - (if paren ")" "")))) - ((and (memq (car-safe filter) '(and or)) - (= (length filter) 3)) - (let ((lparen (and (eq (car filter) 'and) - (eq 'or (car-safe (car-safe (cdr filter)))))) - (rparen (and (eq (car filter) 'and) - (eq 'or (car-safe (car-safe (cddr filter))))))) - (format "%s%s%s %s %s%s%s" - (if lparen "(" "") - (unparse (cadr filter) noerror) - (if lparen ")" "") - (cl-case (car filter) - (and "&&") (or "||")) - (if rparen "(" "") - (unparse (car (cddr filter)) noerror) - (if rparen ")" "")))) - ((and (assq (car-safe filter) tablist-filter-binary-operator) - (= (length filter) 3)) - (format "%s %s %s" - (unparse (cadr filter) noerror) - (car filter) - (unparse (car (cddr filter)) noerror))) - ((and (assq (car-safe filter) tablist-filter-unary-operator) - (= (length filter) 2)) - (format "%s %s" - (car filter) - (unparse (cadr filter) noerror))) - ((not filter) "") - (t (funcall (if noerror 'format 'error) - "Invalid filter: %s" filter))))) - (tablist-filter-parser-init) - (unparse filter noerror))) - -(defun tablist-filter-eval (filter id entry &optional named-alist) - (cl-labels - ((feval (filter) - (pcase filter - (`(not . ,(and operand (guard (not (cdr operand))))) - (not (feval (car operand)))) - (`(and . ,(and operands (guard (= 2 (length operands))))) - (and - (feval (nth 0 operands)) - (feval (nth 1 operands)))) - (`(or . ,(and operands (guard (= 2 (length operands))))) - (or - (feval (nth 0 operands)) - (feval (nth 1 operands)))) - (`(,op . ,(and operands (guard (= (length operands) 1)))) - (let ((fn (assq op tablist-filter-unary-operator))) - (unless fn - (error "Undefined unary operator: %s" op)) - (funcall fn id entry (car operands)))) - (`(,op . ,(and operands (guard (= (length operands) 2)))) - (let ((fn (cdr (assq op tablist-filter-binary-operator)))) - (unless fn - (error "Undefined binary operator: %s" op)) - (funcall fn id entry (car operands) - (cadr operands)))) - ((guard (stringp filter)) - (let ((fn (cdr (assoc filter named-alist)))) - (unless fn - (error "Undefined named filter: %s" filter)) - (if (functionp fn) - (funcall fn id entry)) - (feval - (if (stringp fn) (tablist-filter-unparse fn) fn)))) - (`nil t) - (_ (error "Invalid filter: %s" filter))))) - (feval filter))) - -(defun tablist-filter-get-item-by-name (entry col-name) - (let* ((col (cl-position col-name tabulated-list-format - :key 'car - :test - (lambda (s1 s2) - (eq t (compare-strings - s1 nil nil s2 nil nil t))))) - (item (and col (elt entry col)))) - (unless col - (error "No such column: %s" col-name)) - (if (consp item) ;(LABEL . PROPS) - (car item) - item))) - -(defun tablist-filter-op-equal (_id entry op1 op2) - "COLUMN == STRING : Matches if COLUMN's entry is equal to STRING." - (let ((item (tablist-filter-get-item-by-name entry op1))) - (string= item op2))) - -(defun tablist-filter-op-regexp (_id entry op1 op2) - "COLUMN =~ REGEXP : Matches if COLUMN's entry matches REGEXP." - (let ((item (tablist-filter-get-item-by-name entry op1))) - (string-match op2 item))) - -(defun tablist-filter-op-< (id entry op1 op2) - "COLUMN < NUMBER : Matches if COLUMN's entry is less than NUMBER." - (tablist-filter-op-numeric '< id entry op1 op2)) - -(defun tablist-filter-op-> (id entry op1 op2) - "COLUMN > NUMBER : Matches if COLUMN's entry is greater than NUMBER." - (tablist-filter-op-numeric '> id entry op1 op2)) - -(defun tablist-filter-op-<= (id entry op1 op2) - "COLUMN <= NUMBER : Matches if COLUMN's entry is less than or equal to NUMBER." - (tablist-filter-op-numeric '<= id entry op1 op2)) - -(defun tablist-filter-op->= (id entry op1 op2) - "COLUMN >= NUMBER : Matches if COLUMN's entry is greater than or equal to NUMBER." - (tablist-filter-op-numeric '>= id entry op1 op2)) - -(defun tablist-filter-op-= (id entry op1 op2) - "COLUMN = NUMBER : Matches if COLUMN's entry as a number is equal to NUMBER." - (tablist-filter-op-numeric '= id entry op1 op2)) - -(defun tablist-filter-op-numeric (op _id entry op1 op2) - (let ((item (tablist-filter-get-item-by-name entry op1))) - (funcall op (string-to-number item) - (string-to-number op2)))) - -(defun tablist-filter-help (&optional temporary) - (interactive) - (cl-labels - ((princ-op (op) - (princ (car op)) - (princ (concat (make-string (max 0 (- 4 (length (symbol-name (car op))))) - ?\s) - "- " - (car (split-string - (or (documentation (cdr op)) - (format "FIXME: Not documented: %s" - (cdr op))) - "\n" t)) - "\n")))) - (with-temp-buffer-window - "*Help*" - (if temporary - '((lambda (buf alist) - (let ((win - (or (display-buffer-reuse-window buf alist) - (display-buffer-in-side-window buf alist)))) - (fit-window-to-buffer win) - win)) - (side . bottom))) - nil - (princ "Filter entries with the following operators.\n\n") - (princ "&& - FILTER1 && FILTER2 : Locical and.\n") - (princ "|| - FILTER1 || FILTER2 : Locical or.\n") - (dolist (op tablist-filter-binary-operator) - (princ-op op)) - (princ "! - ! FILTER : Locical not.\n\n") - (dolist (op tablist-filter-unary-operator) - (princ-op op)) - (princ "\"...\" may be used to quote names and values if necessary, -and \(...\) to group expressions.") - (with-current-buffer standard-output - (help-mode))))) - -;; -;; **Filter Functions -;; - -;; filter ::= nil | named | fn | (OP OP1 [OP2]) - -(defun tablist-filter-negate (filter) - "Return a filter not matching filter." - (cond - ((eq (car-safe filter) 'not) - (cadr filter)) - (filter - (list 'not filter)))) - -(defun tablist-filter-push (filter new-filter &optional or-p) - "Return a filter combining FILTER and NEW-FILTER. - -By default the filters are and'ed, unless OR-P is non-nil." - (if (or (null filter) - (null new-filter)) - (or filter - new-filter) - (list (if or-p 'or 'and) - filter new-filter))) - -(defun tablist-filter-pop (filter) - "Remove the first operator or operand from filter. - -If filter starts with a negation, return filter unnegated, -if filter starts with a dis- or conjuction, remove the first operand, -if filter is nil, raise an error, -else return nil." - (pcase filter - (`(,(or `and `or) . ,tail) - (car (cdr tail))) - (`(not . ,op1) - (car op1)) - (_ (unless filter - (error "Filter is empty"))))) - -(defun tablist-filter-map (fn filter) - (pcase filter - (`(,(or `and `or `not) . ,tail) - (cons (car filter) - (mapcar (lambda (f) - (tablist-filter-map fn f)) - tail))) - (_ (funcall fn filter)))) - -;; -;; Reading filter -;; - -(defvar tablist-filter-edit-history nil) -(defvar tablist-filter-edit-display-help t) - -(defun tablist-filter-edit-filter (prompt &optional - initial-filter history - validate-fn) - (let* ((str (tablist-filter-unparse initial-filter)) - (filter initial-filter) - (validate-fn (or validate-fn 'identity)) - error done) - (save-window-excursion - (when tablist-filter-edit-display-help - (tablist-filter-help t)) - (while (not done) - (minibuffer-with-setup-hook - (lambda () - (when error - (when (car error) - (goto-char (+ (field-beginning) - (car error))) - (skip-chars-backward " \t\n")) - (minibuffer-message "%s" (cdr error)) - (setq error nil))) - (setq str (propertize - (read-string prompt str - (or history 'tablist-filter-edit-history))) - done t)) - (condition-case err - (progn - (setq filter (tablist-filter-parse str)) - (funcall validate-fn filter)) - (error - (setq done nil) - (setq error (cons (car-safe (cddr err)) nil)) - (when (car error) - (setq str (with-temp-buffer - (insert str) - (goto-char (car error)) - (set-text-properties - (progn - (skip-chars-backward " \t\n") - (backward-char) - (point)) - (min (car error) (point-max)) - '(face error rear-nonsticky t)) - (buffer-string)))) - (setcdr error (error-message-string err))))) - filter))) - -(provide 'tablist-filter) -;;; tablist-filter.el ends here diff --git a/elpa/tablist-20170219.1935/tablist-filter.elc b/elpa/tablist-20170219.1935/tablist-filter.elc deleted file mode 100644 index e079d7b..0000000 Binary files a/elpa/tablist-20170219.1935/tablist-filter.elc and /dev/null differ diff --git a/elpa/tablist-20170219.1935/tablist-pkg.el b/elpa/tablist-20170219.1935/tablist-pkg.el deleted file mode 100644 index 178badd..0000000 --- a/elpa/tablist-20170219.1935/tablist-pkg.el +++ /dev/null @@ -1,7 +0,0 @@ -(define-package "tablist" "20170219.1935" "Extended tabulated-list-mode" - '((emacs "24.3")) - :keywords - '("extensions" "lisp")) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/tablist-20170219.1935/tablist.el b/elpa/tablist-20170219.1935/tablist.el deleted file mode 100644 index 1fbfb31..0000000 --- a/elpa/tablist-20170219.1935/tablist.el +++ /dev/null @@ -1,1941 +0,0 @@ -;;; tablist.el --- Extended tabulated-list-mode -*- lexical-binding: t -*- - -;; Copyright (C) 2013, 2014 Andreas Politz - -;; Author: Andreas Politz -;; Keywords: extensions, lisp -;; Package: tablist -;; Version: 0.70 -;; Package-Requires: ((emacs "24.3")) - -;; 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 . - -;;; Commentary: -;; -;; This package adds marks and filters to tabulated-list-mode. It -;; also kind of puts a dired face on tabulated list buffers. -;; -;; It can be used by deriving from tablist-mode and some features by -;; using tablist-minor-mode inside a tabulated-list-mode buffer. -;; - -;;; Code: - -(require 'cl-lib) -(require 'ring) -(require 'tabulated-list) -(require 'dired) -(require 'tablist-filter) - -;; -;; *Macros -;; - -(defmacro tablist-save-marks (&rest body) - "Eval body, while preserving all marks." - (let ((marks (make-symbol "marks"))) - `(let (,marks) - (save-excursion - (goto-char (point-min)) - (let ((re "^\\([^ ]\\)")) - (while (re-search-forward re nil t) - (push (cons (tabulated-list-get-id) - (tablist-get-mark-state)) - ,marks)))) - (unwind-protect - (progn ,@body) - (save-excursion - (dolist (m ,marks) - (let ((id (pop m))) - (goto-char (point-min)) - (while (and id (not (eobp))) - (when (equal id (tabulated-list-get-id)) - (tablist-put-mark-state m) - (setq id nil)) - (forward-line))))))))) - -(defmacro tablist-with-remembering-entry (&rest body) - "Remember where body left of and restore previous position. - -If the current entry is still visible, move to it. Otherwise move -to the next visible one after it. If that also fails, goto to -the beginning of the buffer. Finally move point to the major -column." - (declare (indent 0) (debug t)) - (let ((re (make-symbol "re")) - (id (make-symbol "id")) - (col (make-symbol "col"))) - `(let ((,re - (replace-regexp-in-string - "[\t ]+" "[\t ]*" (regexp-quote - (or (thing-at-point 'line) "")) - t t)) - (,id (tabulated-list-get-id)) - (,col (tablist-current-column))) - (progn - ,@body - (let (success pos) - (goto-char (point-min)) - (setq pos (point)) - (while (and (setq success (re-search-forward ,re nil t)) - (> (point) (prog1 pos (setq pos (point)))) - (forward-line -1) - (not (equal ,id (tabulated-list-get-id)))) - (forward-line)) - (unless success - (goto-char (point-min)) - (while (and (not (eobp)) - (not success)) - (if (equal (tabulated-list-get-id) ,id) - (setq success t) - (forward-line)))) - (unless (and success (not (invisible-p (point)))) - (goto-char (point-min))) - (tablist-skip-invisible-entries) - (tablist-move-to-column - (or ,col (car (tablist-major-columns)))) - (dolist (win (get-buffer-window-list)) - (set-window-point win (point)))))))) - -(defmacro tablist-with-filter-displayed (&rest body) - "Display the current filter in the mode while evalling BODY." - (let ((state (make-symbol "state"))) - `(let ((,state (tablist-display-filter 'state))) - (tablist-display-filter t) - (unwind-protect - (progn ,@body) - (tablist-display-filter ,state))))) - -;; -;; *Mode Maps -;; - -(defvar tablist-mode-filter-map - (let ((kmap (make-sparse-keymap))) - (define-key kmap "p" 'tablist-pop-filter) - (define-key kmap "r" 'tablist-push-regexp-filter) - (define-key kmap "=" 'tablist-push-equal-filter) - (define-key kmap "n" 'tablist-push-numeric-filter) - (define-key kmap "!" 'tablist-negate-filter) - (define-key kmap "t" 'tablist-toggle-first-filter-logic) - (define-key kmap "/" 'tablist-display-filter) - (define-key kmap "z" 'tablist-suspend-filter) - - (define-key kmap "a" 'tablist-push-named-filter) - (define-key kmap "s" 'tablist-name-current-filter) - (define-key kmap "D" 'tablist-delete-named-filter) - (define-key kmap "d" 'tablist-deconstruct-named-filter) - (define-key kmap "e" 'tablist-edit-filter) - (define-key kmap "C" 'tablist-clear-filter) - kmap)) - -(defvar tablist-mode-mark-map - (let ((kmap (make-sparse-keymap))) - (define-key kmap "c" 'tablist-change-marks) - (define-key kmap "!" 'tablist-unmark-all-marks) - (define-key kmap "r" 'tablist-mark-items-regexp) - (define-key kmap "n" 'tablist-mark-items-numeric) - (define-key kmap "m" 'tablist-mark-forward) - kmap)) - -(defvar tablist-mode-regexp-map - (let ((kmap (make-sparse-keymap))) - ;; (define-key kmap "&" 'tablist-flag-gargabe-items) - (define-key kmap "m" 'tablist-mark-items-regexp) - kmap)) - -(defvar tablist-minor-mode-map - (let ((kmap (make-sparse-keymap))) - (define-key kmap "m" 'tablist-mark-forward) - (define-key kmap (kbd "DEL") 'tablist-unmark-backward) - (define-key kmap "k" 'tablist-do-kill-lines) - (define-key kmap "U" 'tablist-unmark-all-marks) - (define-key kmap "u" 'tablist-unmark-forward) - (define-key kmap "t" 'tablist-toggle-marks) - - (define-key kmap (kbd "TAB") 'tablist-forward-column) - (define-key kmap "\t" 'tablist-forward-column) - (define-key kmap [backtab] 'tablist-backward-column) - - (define-key kmap "%" tablist-mode-regexp-map) - (define-key kmap "*" tablist-mode-mark-map) - (define-key kmap "/" tablist-mode-filter-map) - - ;; (define-key kmap "e" 'tablist-edit-column) - ;; (define-key kmap "i" 'tablist-insert-entry) - (define-key kmap "s" 'tablist-sort) - (define-key kmap [remap back-to-indentation] 'tablist-move-to-major-column) - (define-key kmap [remap next-line] 'tablist-next-line) - (define-key kmap [remap previous-line] 'tablist-previous-line) - (define-key kmap "<" 'tablist-shrink-column) - (define-key kmap ">" 'tablist-enlarge-column) - (define-key kmap "q" 'tablist-quit) - (define-key kmap "G" 'tablist-revert) - (define-key kmap (kbd "C-c C-e") 'tablist-export-csv) - kmap)) - -(defvar tablist-mode-map - (let ((kmap (copy-keymap tablist-minor-mode-map))) - (set-keymap-parent kmap tabulated-list-mode-map) - (define-key kmap "d" 'tablist-flag-forward) - (define-key kmap (kbd "RET") 'tablist-find-entry) - (define-key kmap "f" 'tablist-find-entry) - ;; (define-key kmap "~" 'tablist-flag-gargabe-items) - (define-key kmap "D" 'tablist-do-delete) - (define-key kmap "C" 'tablist-do-copy) - (define-key kmap "R" 'tablist-do-rename) - (define-key kmap "x" 'tablist-do-flagged-delete) - ;; (define-key kmap "F" 'tablist-find-marked-items) - ;; (define-key kmap (kbd "C-o") 'tablist-display-item) - kmap)) - -;; -;; *Variables -;; - -;; Marking -(defvar tablist-umark-filtered-entries t) -(defvar tablist-marker-char dired-marker-char - "The character used for marking.") -(defvar tablist-marker-face 'dired-mark - "The face used for the mark character.") -(defvar tablist-marked-face 'dired-marked - "The face used for marked major columns.") - -;; Operations -(defvar-local tablist-operations-function nil - "A function for handling operations on the entries. - -The function is called with varying number of arguments, while -the first one is always a symbol describing one of the following -operations. - -`supported-operations' - -This is the only mandatory operation. There are no other -arguments and the function should return a list of symbols of -supported operations. - -`delete' - -The 2nd argument will be a list of entry ID's. The function -should somehow delete these entries and update -`tabulated-list-entries'. - -`find-entry' - -The 2nd argument is the ID of an entry. The function should -somehow find/display this entry, i.e. a kind of default -operation. - -`edit-column' - -The function is called with 3 further arguments: ID, INDEX and -NEW-COLUMN, where ID represents the entry to edit, INDEX is the index -of the column and NEW-COLUMN is the proposed new value for this -column. It should either - -i. return a new edited complete entry and update -`tabulated-list-entries', or - -ii. throw an error, if NEW-COLUMN is not a valid value for this -column. - -`complete' - -The function is called with 4 further arguments: ID, INDEX, -STRING and POS, where ID represents an entry, INDEX is the index -of the column to complete, STRING it's current value and POS an -offset of the current position of point into STRING. - -The function should return a collection for this column, suitable -as argument for the function `completion-in-region'.") - -;; Differentiating columns -(defvar-local tablist-major-columns nil - "Columns used to mark and when querying.") - -;; Filter -(defvar-local tablist-current-filter nil) -(defvar-local tablist-filter-suspended nil) -(defvar tablist-named-filter nil) - -;; History variables -(defvar tablist-column-name-history nil) - -;; Hooks -(defvar tablist-selection-changed-functions nil - "A hook run when ever point moves to a different entry.") - -;; Context Window -(defvar-local tablist-context-window nil) -(defvar-local tablist-context-window-function nil) -(defvar tablist-context-window-display-action - `((display-buffer-reuse-window - tablist-display-buffer-split-below-and-attach) - (window-height . 0.25) - (inhibit-same-window . t))) - -;; -;; *Setup -;; - -(defvar savehist-additional-variables) -(add-hook 'savehist-save-hook - (lambda nil - (add-to-list 'savehist-additional-variables 'tablist-named-filter))) - -;;;###autoload -(define-minor-mode tablist-minor-mode - nil nil nil nil - (unless (derived-mode-p 'tabulated-list-mode) - (error "Buffer is not in Tabulated List Mode")) - (tablist-init (not tablist-minor-mode))) - -;;;###autoload -(define-derived-mode tablist-mode tabulated-list-mode "TL" - (tablist-init)) - -(defun tablist-init (&optional disable) - (let ((cleaned-misc (cl-remove 'tablist-current-filter - mode-line-misc-info :key 'car))) - (cond - ((not disable) - (set (make-local-variable 'mode-line-misc-info) - (append - (list - (list 'tablist-current-filter - '(:eval (format " [%s]" - (if tablist-filter-suspended - "suspended" - "filtered"))))))) - (add-hook 'post-command-hook - 'tablist-selection-changed-handler nil t) - (add-hook 'tablist-selection-changed-functions - 'tablist-context-window-update nil t)) - (t - (setq mode-line-misc-info cleaned-misc) - (remove-hook 'post-command-hook - 'tablist-selection-changed-handler t) - (remove-hook 'tablist-selection-changed-functions - 'tablist-context-window-update t))))) - -(defun tablist-quit () - (interactive) - (tablist-hide-context-window) - (quit-window)) - -(defvar-local tablist-selected-id nil) -(defvar tablist-edit-column-minor-mode) - -(defun tablist-selection-changed-handler () - (unless tablist-edit-column-minor-mode - (let ((id tablist-selected-id) - (selected (tabulated-list-get-id))) - (unless (eq selected id) - (setq tablist-selected-id selected) - (run-hook-with-args - 'tablist-selection-changed-functions - tablist-selected-id))))) - -(defvar tablist-context-window-update--timer nil) - -(defun tablist-context-window-update (&optional id) - (when (and tablist-context-window-function - (window-live-p tablist-context-window) - (not tablist-edit-column-minor-mode)) - (unless id - (setq id (tabulated-list-get-id))) - (when (timerp tablist-context-window-update--timer) - (cancel-timer tablist-context-window-update--timer)) - (setq tablist-context-window-update--timer - (run-with-idle-timer 0.1 nil - (lambda (fn window) - (when (window-live-p window) - (with-selected-window window - (set-window-dedicated-p nil nil) - (save-selected-window - (funcall fn id)) - (when (window-live-p (selected-window)) - (set-window-dedicated-p nil t))))) - tablist-context-window-function - tablist-context-window)))) - -(defun tablist-display-context-window () - (interactive) - (unless tablist-context-window-function - (error "No function for handling a context is defined")) - (unless (window-live-p tablist-context-window) - (setq tablist-context-window - (display-buffer - (current-buffer) - tablist-context-window-display-action))) - (prog1 - tablist-context-window - (tablist-context-window-update))) - -(defun tablist-hide-context-window () - (interactive) - (when (window-live-p tablist-context-window) - (let ((ignore-window-parameters t)) - (delete-window tablist-context-window))) - (setq tablist-context-window nil)) - -(defun tablist-toggle-context-window () - (interactive) - (if (window-live-p tablist-context-window) - (tablist-hide-context-window) - (tablist-display-context-window))) - -;; -;; *Marking -;; - -(defun tablist-revert () - "Revert the list with marks preserved, position kept." - (interactive) - (tablist-save-marks - (tablist-with-remembering-entry - (tabulated-list-revert)))) - -(defun tablist-major-columns () - (if (null tablist-major-columns) - (number-sequence 0 (1- (length tabulated-list-format))) - (if (numberp tablist-major-columns) - (list tablist-major-columns) - tablist-major-columns))) - -(defun tablist-put-mark (&optional pos) - "Put a mark before the entry at POS. - -POS defaults to point. Use `tablist-marker-char', -`tablist-marker-face', `tablist-marked-face' and -`tablist-major-columns' to determine how to mark and what to put -a face on." - (when (or (null tabulated-list-padding) - (< tabulated-list-padding 1)) - (setq tabulated-list-padding 1) - (tabulated-list-revert)) - (save-excursion - (and pos (goto-char pos)) - (unless (tabulated-list-get-id) - (error "No entry at this position")) - (let ((inhibit-read-only t)) - (tabulated-list-put-tag - (string tablist-marker-char)) - (put-text-property - (point-at-bol) - (1+ (point-at-bol)) - 'face tablist-marker-face) - (let ((columns (tablist-column-offsets))) - (dolist (c (tablist-major-columns)) - (when (and (>= c 0) - (< c (length columns))) - (let ((beg (+ (point-at-bol) - (nth c columns))) - (end (if (= c (1- (length columns))) - (point-at-eol) - (+ (point-at-bol) - (nth (1+ c) columns))))) - (cond - ((and tablist-marked-face - (not (eq tablist-marker-char ?\s))) - (tablist--save-face-property beg end) - (put-text-property - beg end 'face tablist-marked-face)) - (t (tablist--restore-face-property beg end)))))))))) - -(defun tablist-mark-forward (&optional arg interactive) - "Mark ARG entries forward. - -ARG is interpreted as a prefix-arg. If interactive is non-nil, -maybe use the active region instead of ARG. - -See `tablist-put-mark' for how entries are marked." - (interactive (list current-prefix-arg t)) - (cond - ;; Mark files in the active region. - ((and interactive (use-region-p)) - (save-excursion - (goto-char (region-beginning)) - (beginning-of-line) - (tablist-repeat-over-lines - (1+ (count-lines - (point) - (save-excursion - (goto-char (region-end)) - (beginning-of-line) - (point)))) - 'tablist-put-mark))) - ;; Mark the current (or next ARG) files. - (t - (tablist-repeat-over-lines - (prefix-numeric-value arg) - 'tablist-put-mark)))) - -(defun tablist-mark-backward (&optional arg interactive) - "Mark ARG entries backward. - -See `tablist-mark-forward'." - (interactive (list current-prefix-arg t)) - (tablist-mark-forward (- (prefix-numeric-value arg)) - interactive)) - -(defun tablist-unmark-forward (&optional arg interactive) - "Unmark ARG entries forward. - -See `tablist-mark-forward'." - (interactive (list current-prefix-arg t)) - (let ((tablist-marker-char ?\s) - tablist-marked-face) - (tablist-mark-forward arg interactive))) - -(defun tablist-unmark-backward (&optional arg interactive) - "Unmark ARG entries backward. - -See `tablist-mark-forward'." - (interactive (list current-prefix-arg t)) - (let ((tablist-marker-char ?\s) - tablist-marked-face) - (tablist-mark-backward arg interactive))) - -(defun tablist-flag-forward (&optional arg interactive) - "Flag ARG entries forward. - -See `tablist-mark-forward'." - (interactive (list current-prefix-arg t)) - (let ((tablist-marker-char ?D) - (tablist-marked-face 'dired-flagged)) - (tablist-mark-forward arg interactive))) - -(defun tablist-change-marks (old new) - "Change all OLD marks to NEW marks. - -OLD and NEW are both characters used to mark files." - (interactive - (let* ((cursor-in-echo-area t) - (old (progn (message "Change (old mark): ") (read-char))) - (new (progn (message "Change %c marks to (new mark): " old) - (read-char)))) - (list old new))) - (when (eq new ?\n) - (error "Mark character \\n is not allowed")) - (let ((default-mark-p (equal tablist-marker-char new)) - (tablist-marker-char old)) - (save-excursion - (tablist-map-over-marks - (lambda nil - (pcase new - (?D - (tablist-flag-forward 1)) - (_ - (let ((tablist-marker-char new) - (tablist-marked-face - (and default-mark-p - tablist-marked-face))) - (tablist-put-mark))))))))) - -(defun tablist-unmark-all-marks (&optional marks interactive) - "Remove alls marks in MARKS. - -MARKS should be a string of mark characters to match and defaults -to all marks. Interactively, remove all marks, unless a prefix -arg was given, in which case ask about which ones to remove. -Give a message, if interactive is non-nil. - -Returns the number of unmarked marks." - (interactive - (list (if current-prefix-arg - (read-string "Remove marks: ")) t)) - (let ((re (if marks - (tablist-marker-regexp marks) - "^[^ ]")) - (removed 0)) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward re nil t) - (let ((tablist-marker-char ?\s) - tablist-marker-face - tablist-marked-face) - (tablist-put-mark)) - (cl-incf removed))) - (when interactive - (message "Removed %d marks" removed)) - removed)) - -(defun tablist-toggle-marks () - "Unmark all marked and mark all unmarked entries. - -See `tablist-put-mark'." - (interactive) - (let ((marked-re (tablist-marker-regexp)) - (not-marked-re - (let ((tablist-marker-char ?\s)) - (tablist-marker-regexp)))) - (save-excursion - (goto-char (point-min)) - (tablist-skip-invisible-entries) - (while (not (eobp)) - (cond - ((looking-at marked-re) - (save-excursion (tablist-unmark-backward -1))) - ((looking-at not-marked-re) - (tablist-put-mark))) - (tablist-forward-entry))) - (tablist-move-to-major-column))) - -(defun tablist-get-marked-items (&optional arg distinguish-one-marked) - "Return marked or ARG entries." - (let ((items (save-excursion - (tablist-map-over-marks - (lambda () (cons (tabulated-list-get-id) - (tabulated-list-get-entry))) - arg nil distinguish-one-marked)))) - (if (and distinguish-one-marked - (eq (car items) t)) - items - (nreverse items)))) - -(defun tablist-mark-items-regexp (column-name regexp) - "Mark entries matching REGEXP in column COLUMN-NAME." - (interactive - (tablist-read-regexp-filter "Mark" current-prefix-arg )) - (tablist-map-with-filter - 'tablist-put-mark - `(=~ ,column-name ,regexp))) - -(defun tablist-mark-items-numeric (binop column-name operand) - "Mark items fulfilling BINOP with arg OPERAND in column COLUMN-NAME. - -First the column's value is coerced to a number N. Then the test -proceeds as \(BINOP N OPERAND\)." - (interactive - (tablist-read-numeric-filter "Mark" current-prefix-arg)) - (tablist-map-with-filter - 'tablist-put-mark - `(,binop ,column-name ,operand))) - -(defun tablist-map-over-marks (fn &optional arg show-progress - distinguish-one-marked) - (prog1 - (cond - ((and arg (integerp arg)) - (let (results) - (tablist-repeat-over-lines - arg - (lambda () - (if show-progress (sit-for 0)) - (push (funcall fn) results))) - (if (< arg 0) - (nreverse results) - results))) - (arg - ;; non-nil, non-integer ARG means use current item: - (tablist-skip-invisible-entries) - (unless (eobp) - (list (funcall fn)))) - (t - (cl-labels ((search (re) - (let (sucess) - (tablist-skip-invisible-entries) - (while (and (setq sucess - (re-search-forward re nil t)) - (invisible-p (point))) - (tablist-forward-entry)) - sucess))) - (let ((regexp (tablist-marker-regexp)) - next-position results found) - (save-excursion - (goto-char (point-min)) - ;; remember position of next marked file before BODY - ;; can insert lines before the just found file, - ;; confusing us by finding the same marked file again - ;; and again and... - (setq next-position (and (search regexp) - (point-marker)) - found (not (null next-position))) - (while next-position - (goto-char next-position) - (if show-progress (sit-for 0)) - (push (funcall fn) results) - ;; move after last match - (goto-char next-position) - (forward-line 1) - (set-marker next-position nil) - (setq next-position (and (search regexp) - (point-marker))))) - (if (and distinguish-one-marked (= (length results) 1)) - (setq results (cons t results))) - (if found - results - (unless (or (eobp) (invisible-p (point))) - (list (funcall fn)))))))) - (tablist-move-to-major-column))) - -(defun tablist-marker-regexp (&optional marks) - "Return a regexp matching marks in MARKS. - -MARKS should be a string of mark characters to match and defaults -to the current value of `tablist-marker-char' as a string." - (concat (format "^[%s]" - (or marks (string tablist-marker-char))))) - -(defun tablist-get-mark-state () - "Return the mark state of the entry at point." - (save-excursion - (beginning-of-line) - (when (looking-at "^\\([^ ]\\)") - (let ((mark (buffer-substring - (match-beginning 1) - (match-end 1)))) - (tablist-move-to-major-column) - (list (aref mark 0) - (get-text-property 0 'face mark) - (get-text-property (point) 'face)))))) - -(defun tablist-put-mark-state (state) - "Set the mark of the entry at point according to STATE. - -STATE is a return value of `tablist-get-mark-state'." - (cl-destructuring-bind (tablist-marker-char - tablist-marker-face - tablist-marked-face) - state - (tablist-put-mark))) - -(defun tablist-mark-prompt (arg items) - "Return a string suitable for use in a tablist prompt." - ;; distinguish-one-marked can cause the first element to be just t. - (if (eq (car items) t) (setq items (cdr items))) - (let ((count (length items))) - (if (= count 1) - (car items) - ;; more than 1 item: - (if (integerp arg) - ;; abs(arg) = count - ;; Perhaps this is nicer, but it also takes more screen space: - ;;(format "[%s %d items]" (if (> arg 0) "next" "previous") - ;; count) - (format "[next %d item%s]" - arg (dired-plural-s arg)) - (format "%c [%d item%s]" dired-marker-char count - (dired-plural-s count)))))) - -;; -;; *Movement -;; - -(defun tablist-forward-entry (&optional n) - "Move past the next N unfiltered entries." - (unless n (setq n 1)) - (while (and (> n 0) - (not (eobp))) - (forward-line) - (when (invisible-p (point)) - (tablist-skip-invisible-entries)) - (cl-decf n)) - (while (and (< n 0) - (not (bobp))) - (forward-line -1) - (when (invisible-p (point)) - (tablist-skip-invisible-entries t)) - (cl-incf n)) - n) - -(defun tablist-next-line (&optional n) - (interactive "p") - (when (and (< n 0) - (save-excursion - (end-of-line 0) - (tablist-skip-invisible-entries t) - (bobp))) - (signal 'beginning-of-buffer nil)) - (when (and (> n 0) - (save-excursion - (tablist-forward-entry) - (eobp))) - (signal 'end-of-buffer nil)) - - (let ((col (tablist-current-column))) - (tablist-forward-entry (or n 1)) - (if col - (tablist-move-to-column col) - (tablist-move-to-major-column)))) - -(defun tablist-previous-line (&optional n) - (interactive "p") - (tablist-next-line (- (or n 1)))) - -(defun tablist-repeat-over-lines (arg function) - "Call FUNCTION for the next ARG entries." - ;; Move out of potentially invisble area. - (tablist-skip-invisible-entries) - (let ((pos (make-marker))) - (while (and (> arg 0) - (not (eobp))) - (cl-decf arg) - (save-excursion - (tablist-forward-entry) - (move-marker pos (1+ (point)))) - (unless (eobp) - (save-excursion (funcall function))) - ;; Advance to the next line--actually, to the line that *was* next. - ;; (If FUNCTION inserted some new lines in between, skip them.) - (goto-char pos)) - (while (and (< arg 0) (not (bobp))) - (cl-incf arg) - (tablist-forward-entry -1) - (save-excursion (funcall function))) - (move-marker pos nil) - (tablist-move-to-major-column))) - -(defun tablist-move-to-column (n) - "Move to the N'th list column." - (interactive "p") - (when (tabulated-list-get-id) - (let ((columns (tablist-column-offsets))) - (when (or (< n 0) - (>= n (length columns))) - (error "No such column: %s" n)) - (beginning-of-line) - (forward-char (nth n columns)) - (when (and (plist-get (nthcdr 3 (elt tabulated-list-format n)) - :right-align) - (not (= n (1- (length columns))))) - (forward-char (1- (car (cdr (elt tabulated-list-format n))))))))) - -(defun tablist-move-to-major-column (&optional first-skip-invisible-p) - "Move to the first major column." - (interactive (list t)) - (when first-skip-invisible-p - (tablist-skip-invisible-entries)) - (tablist-move-to-column (car (tablist-major-columns)))) - -(defun tablist-forward-column (n) - "Move n columns forward, while wrapping around." - (interactive "p") - (unless (tabulated-list-get-id) - (error "No entry on this line")) - (let* ((columns (tablist-column-offsets)) - (current (1- (length columns)))) - ;; find current column - (while (and (>= current 0) - (> (nth current columns) - (current-column))) - (cl-decf current)) - ;; there may be an invisible spec here - (when (bolp) - (forward-char)) - ;; before any columns - (when (< current 0) - (goto-char (+ (point-at-bol) (if (> n 0) - (car columns) - (car (last columns))))) - (setq n (* (cl-signum n) (1- (abs n))))) - (when (/= n 0) - (tablist-move-to-column - (mod (+ current n) (length columns)))))) - -(defun tablist-backward-column (n) - "Move n columns backward, while wrapping around." - (interactive "p") - (tablist-forward-column (- n))) - -;; -(defun tablist-skip-invisible-entries (&optional backward) - "Skip invisible entries BACKWARD or forward. - -Do nothing, if the entry at point is visible. Otherwise move to -the beginning of the next visible entry in the direction -determined by BACKWARD. - -Return t, if point is now in a visible area." - - (cond - ((and backward - (not (bobp)) - (get-text-property (point) 'invisible)) - (when (get-text-property (1- (point)) 'invisible) - (goto-char (previous-single-property-change - (point) - 'invisible nil (point-min)))) - (forward-line -1)) - ((and (not backward) - (not (eobp)) - (get-text-property (point) 'invisible)) - (goto-char (next-single-property-change - (point) - 'invisible nil (point-max))))) - (not (invisible-p (point)))) - -;; -;; *Operations -;; - -(defun tablist-yes-or-no-p (operation arg items) - "Query the user whether to proceed with some operation. - -Operation should be a symbol or string describing the operation, -ARG the prefix-arg of the command used in -`tablist-get-marked-items' or elsewhere, to get the ITEMS." - - (let ((pp-items (mapcar 'tablist-pretty-print-entry - (mapcar 'cdr items))) - dired-no-confirm - (op-str (upcase-initials - (if (stringp operation) - operation - (symbol-name operation))))) - (dired-mark-pop-up - (format " *%s*" op-str) nil - pp-items - dired-deletion-confirmer - (format "%s %s " - op-str - (tablist-mark-prompt arg pp-items))))) - -(defun tablist-operation-available-p (op) - (and (functionp tablist-operations-function) - (memq op (funcall tablist-operations-function - 'supported-operations)))) - -(defun tablist-do-delete (&optional arg) - "Delete ARG entries." - (interactive "P") - (unless (tablist-operation-available-p 'delete) - (error "Deleting entries is not available in this buffer")) - (let ((items (tablist-get-marked-items arg))) - (when (tablist-yes-or-no-p 'delete arg items) - (tablist-do-kill-lines arg) - (funcall tablist-operations-function - 'delete (mapcar 'car items)) - (tablist-move-to-major-column)))) - -(defun tablist-do-flagged-delete (&optional interactive) - "Delete all entries marked with a D." - (interactive "p") - (let* ((tablist-marker-char ?D)) - (if (save-excursion - (goto-char (point-min)) - (re-search-forward (tablist-marker-regexp) nil t)) - (tablist-do-delete) - (or (not interactive) - (message "(No deletions requested)"))))) - -(defun tablist-do-kill-lines (&optional arg interactive) - "Remove ARG lines from the display." - (interactive (list current-prefix-arg t)) - (save-excursion - (let ((positions - (tablist-map-over-marks 'point arg)) - (inhibit-read-only t)) - (dolist (pos positions) - (goto-char pos) - (tabulated-list-delete-entry)) - (when interactive - (message (format "Killed %d line%s" - (length positions) - (dired-plural-s (length positions)))))))) - -(defun tablist-do-operation (arg fn operation &optional delete-p revert-p) - "Operate on marked items. - -ARG should be the `current-prefix-arg', FN is a function of two -arguments \(ID ENTRY\) handling the operation. It gets called -repeatly with all marked items. OPERATION is a symbol or string -describing the operation, it is used for display. - -Optional non-nil DELETE-P means, remove the items from the display. -Optional REVERT-P means, revert the display afterwards." - (let ((items (tablist-get-marked-items arg))) - (unless items - (error "No items marked")) - (when (tablist-yes-or-no-p operation arg items) - (when delete-p - (tablist-do-kill-lines arg)) - (dolist (item items) - (funcall fn (car item))) - (when revert-p - (tablist-revert)) - (tablist-move-to-major-column)))) - -;; -;; *Editing -;; -(defvar tablist-edit-column-minor-mode-map - (let ((kmap (make-sparse-keymap))) - (set-keymap-parent kmap (current-global-map)) - (define-key kmap [remap self-insert-command] 'self-insert-command) - (define-key kmap "\r" 'tablist-edit-column-commit) - (define-key kmap (kbd "C-g") 'tablist-edit-column-quit) - (define-key kmap (kbd "C-c C-c") 'tablist-edit-column-commit) - (define-key kmap (kbd "C-c C-q") 'tablist-edit-column-quit) - (define-key kmap "\t" 'tablist-edit-column-complete) - (define-key kmap (kbd "TAB") 'tablist-edit-column-complete) - (define-key kmap [remap end-of-buffer] 'end-of-line) - (define-key kmap [remap beginning-of-buffer] 'beginning-of-line) - (define-key kmap [remap mark-whole-buffer] 'tablist-edit-column-mark-field) - kmap)) - -(define-minor-mode tablist-edit-column-minor-mode - "" nil nil nil - (unless (or tablist-minor-mode - (derived-mode-p 'tablist-mode)) - (error "Not in a tablist buffer")) - (cond - (tablist-edit-column-minor-mode - (add-to-list 'mode-line-misc-info - '(tablist-edit-column-minor-mode "[edit]")) - (add-hook 'post-command-hook 'tablist-edit-column-constrain-point nil t) - (read-only-mode -1)) - (t - (remove-hook 'post-command-hook 'tablist-edit-column-constrain-point t) - (read-only-mode 1)))) - -(defun tablist-edit-column (&optional n) - (interactive "P") - (unless n (setq n (tablist-current-column))) - (tablist-assert-column-editable n) - (let* ((offsets (append (tablist-column-offsets) - (list (- (point-at-eol) - (point-at-bol))))) - (beg (+ (point-at-bol) - (nth n offsets))) - (end (+ (point-at-bol) - (nth (1+ n) offsets))) - (entry (tabulated-list-get-entry beg)) - (inhibit-read-only t) - (inhibit-field-text-motion t) - (alist `((entry . ,entry) - (column . ,n) - (id . ,(tabulated-list-get-id beg)))) - ov) - (goto-char beg) - (delete-region beg end) - (add-text-properties - (point-at-bol) (point-at-eol) - '(read-only t field t)) - (unless (= beg (point-at-bol)) - (put-text-property (1- beg) beg 'rear-nonsticky t)) - (save-excursion - ;; Keep one read-only space at the end for keeping text - ;; properties. - (insert - (propertize - (concat - (tablist-nth-entry n entry) - (propertize " " - 'display `(space :align-to ,(- end (point-at-bol))))) - 'field nil - 'front-sticky '(tablist-edit) - 'rear-nonsticky '(read-only field) - 'tablist-edit alist)) - (setq end (point))) - (add-text-properties - (1- end) end '(read-only t field 'tablist-edit-end)) - (setq ov (make-overlay beg end)) - (overlay-put ov 'priority 9999) - (overlay-put ov 'face '(:background "deep sky blue" :foreground "white")) - (overlay-put ov 'evaporate t) - (overlay-put ov 'tablist-edit t) - (tablist-edit-column-minor-mode 1))) - -(defun tablist-edit-column-quit () - (interactive) - (tablist-edit-column-commit t)) - -(defun tablist-edit-column-commit (&optional abandon-edit) - (interactive (list current-prefix-arg)) - (let ((inhibit-read-only t) - (inhibit-field-text-motion t) - bounds) - (condition-case nil - (setq bounds (tablist-edit-column-bounds)) - (error - (tablist-edit-column-minor-mode -1) - (tabulated-list-revert) - (put-text-property (point-min) (point-max) - 'tablist-edit nil) - (error "Unable to complete the edit"))) - (let* ((beg (car bounds)) - (end (cdr bounds)) - (alist (get-text-property beg 'tablist-edit)) - (column (cdr (assq 'column alist))) - (id (cdr (assq 'id alist))) - (entry (cdr (assq 'entry alist))) - (item (buffer-substring-no-properties beg (1- end)))) - - (unless abandon-edit - ;; Throws an error, if item is invalid. - (setq entry (funcall tablist-operations-function - 'edit-column id column item))) - (tablist-edit-column-minor-mode -1) - (remove-overlays beg end 'tablist-edit t) - (put-text-property beg end 'tablist-edit nil) - (delete-region (point-at-bol) (1+ (point-at-eol))) - (save-excursion - (tabulated-list-print-entry id entry)) - (forward-char (nth column (tablist-column-offsets)))))) - -(defun tablist-edit-column-complete () - (interactive) - (unless (tablist-operation-available-p 'complete) - (error "Completion not available")) - (cl-destructuring-bind (beg &rest end) - (tablist-edit-column-bounds t) - (let* ((string (buffer-substring-no-properties - beg end)) - (alist (get-text-property beg 'tablist-edit)) - (completions (funcall tablist-operations-function - 'complete - (cdr (assq 'id alist)) - (cdr (assq 'column alist)) - string - (- (point) beg)))) - (unless completions - (error "No completions available")) - (completion-in-region beg end completions)))) - -(defun tablist-column-editable (n) - (and (tablist-operation-available-p 'edit-column) - (not (tablist-column-property n :read-only)))) - -(defun tablist-assert-column-editable (n) - (unless (and (>= n 0) - (< n (length tabulated-list-format))) - (error "Invalid column number: %s" n)) - (unless (tablist-operation-available-p 'edit-column) - (error "Editing columns not enabled in this buffer")) - (when (tablist-column-property n :read-only) - (error "This column is read-only"))) - -(defun tablist-edit-column-constrain-point () - (unless tablist-edit-column-minor-mode - (error "Not editing a column")) - (unless (get-text-property (point) 'tablist-edit) - (let ((bounds (tablist-edit-column-bounds))) - (when bounds - (if (> (point) (cdr bounds)) - (goto-char (1- (cdr bounds))) - (goto-char (car bounds))) - (point))))) - -(defun tablist-edit-column-bounds (&optional skip-final-space) - (unless tablist-edit-column-minor-mode - (error "Not editing a column")) - (let ((pos (next-single-property-change - (point) 'tablist-edit)) - beg end) - (cond - ((null pos) - (setq end (previous-single-property-change - (point-max) 'tablist-edit) - beg (previous-single-property-change - end 'tablist-edit))) - ((get-text-property pos 'tablist-edit) - (setq beg pos - end (next-single-property-change - pos 'tablist-edit))) - (pos - (setq end pos - beg (previous-single-property-change - pos 'tablist-edit)))) - - (unless (and beg end (get-text-property beg 'tablist-edit)) - (error "Unable to locate edited text")) - (cons beg (if skip-final-space (1- end) end)))) - -(defun tablist-edit-column-mark-field () - (interactive) - (push-mark (field-beginning)) - (push-mark (field-end) nil t) - (goto-char (field-beginning))) - -(defun tablist-find-entry (&optional id) - (interactive) - (unless (tablist-operation-available-p 'find-entry) - (error "Finding entries not supported in this buffer")) - (funcall tablist-operations-function - 'find-entry - (or id (tabulated-list-get-id)))) - -;; -;; *Utility -;; - -(defun tablist-column-property (n prop) - (plist-get - (nthcdr 3 (aref tabulated-list-format n)) - prop)) - -(defun tablist-current-column () - "Return the column number at point. - -Returns nil, if point is before the first column." - (let ((column - (1- (cl-position - (current-column) - (append (tablist-column-offsets) - (list most-positive-fixnum)) - :test (lambda (column offset) (> offset column)))))) - (when (>= column 0) - column))) - -(defun tablist-column-offsets () - "Return a list of column positions. - -This is a list of offsets from the beginning of the line." - (let ((cc tabulated-list-padding) - columns) - (dotimes (i (length tabulated-list-format)) - (let* ((c (aref tabulated-list-format i)) - (len (nth 1 c)) - (pad (or (plist-get (nthcdr 3 c) :pad-right) - 1))) - (push cc columns) - (when (numberp len) - (cl-incf cc len)) - (when pad - (cl-incf cc pad)))) - (nreverse columns))) - -(defun tablist-pretty-print-entry (item) - (mapconcat (lambda (i) - (tablist-nth-entry i item)) - (tablist-major-columns) " ")) - -(defun tablist--save-face-property (beg end) - ;; We need to distinguish ,,not set'' from ''no face''. - (unless (and (text-property-not-all beg end 'face nil) - (< beg end)) - (put-text-property beg (1+ beg) 'face 'default)) - (unless (text-property-not-all beg end 'tablist-saved-face nil) - (tablist-copy-text-property beg end 'face 'tablist-saved-face))) - -(defun tablist--restore-face-property (beg end) - (when (text-property-not-all beg end 'tablist-saved-face nil) - (tablist-copy-text-property beg end 'tablist-saved-face 'face))) - -(defun tablist-copy-text-property (beg end from to) - "Copy text property FROM to TO in region BEG to END." - (let ((inhibit-read-only t)) - (save-excursion - (while (< beg end) - (goto-char beg) - (put-text-property - (point) - (setq beg (next-single-property-change - (point) from nil end)) - to - (get-text-property (point) from)))))) - -;; -(defun tablist-read-column-name (arg &optional prompt default) - "Read the name of a column using ARG. - -If ARG is a number, return column ARG. -If ARG is nil, return DEFAULT or the current column. -Else ask the user, using PROMPT and DEFAULT." - (cond - ((numberp arg) - (or (tablist-column-name - (prefix-numeric-value arg)) - (error "No such column: %d" (prefix-numeric-value arg)))) - ((null arg) - (or default - (tablist-column-name - (or (tablist-current-column) - (car (tablist-major-columns)) - 0)))) - (t - (let* ((default (or default - (tablist-column-name - (car (tablist-major-columns))))) - (result - (completing-read - (format "%s %s: " - (or prompt "Use column") - (if default - (format "(default %s)" - default) - "")) - (tablist-column-names) - nil t nil 'tablist-column-name-history))) - (if (> (length result) 0) - result - (if (not default) - (error "No column selected") - default)))))) - -(defun tablist-column-name (n) - "Return the name of column N." - (when (and n - (>= n 0) - (< n (length tabulated-list-format))) - (substring-no-properties - (car (elt tabulated-list-format n)) 0))) - -(defun tablist-column-names () - "Return a list of all column-names." - (mapcar 'tablist-column-name - (number-sequence 0 (1- (length tabulated-list-format))))) - -(defun tablist-nth-entry (n &optional entry) - (unless entry (setq entry (tabulated-list-get-entry))) - (when (and entry - (>= n 0) - (< n (length entry))) - (let ((str (elt entry n))) - (if (stringp str) - str - (car str))))) - -(defun tablist-major-column-name () - "Return a list of the major column names." - (tablist-column-name (car (tablist-major-columns)))) - -(defun tablist-export-csv (&optional separator always-quote-p - invisible-p out-buffer display-p) - "Export a tabulated list to a CSV format. - -Use SEPARATOR (or ;) and quote if necessary (or always if -ALWAYS-QUOTE-P is non-nil). Only consider non-filtered entries, -unless invisible-p is non-nil. Create a buffer for the output or -insert it after point in OUT-BUFFER. Finally if DISPLAY-P is -non-nil, display this buffer. - -Return the output buffer." - - (interactive (list nil t nil nil t)) - (unless (derived-mode-p 'tabulated-list-mode) - (error "Not in Tabulated List Mode")) - (unless (stringp separator) - (setq separator (string (or separator ?\;)))) - (let* ((outb (or out-buffer - (get-buffer-create - (format "%s.csv" (buffer-name))))) - (escape-re (format "[%s\"\n]" separator)) - (header (tablist-column-names))) - (unless (buffer-live-p outb) - (error "Expected a live buffer: %s" outb)) - (cl-labels - ((printit (entry) - (insert - (mapconcat - (lambda (e) - (unless (stringp e) - (setq e (car e))) - (if (or always-quote-p - (string-match escape-re e)) - (concat "\"" - (replace-regexp-in-string "\"" "\"\"" e t t) - "\"") - e)) - entry separator)) - (insert ?\n))) - (with-current-buffer outb - (let ((inhibit-read-only t)) - (erase-buffer) - (printit header))) - (save-excursion - (goto-char (point-min)) - (unless invisible-p - (tablist-skip-invisible-entries)) - (while (not (eobp)) - (let* ((entry (tabulated-list-get-entry))) - (with-current-buffer outb - (let ((inhibit-read-only t)) - (printit entry))) - (if invisible-p - (forward-line) - (tablist-forward-entry))))) - (if display-p - (display-buffer outb)) - outb))) - -;; - -(defun tablist-enlarge-column (&optional column width) - "Enlarge column COLUMN by WIDTH. - -This function is lazy and therfore pretty slow." - (interactive - (list nil (* (prefix-numeric-value current-prefix-arg) - 3))) - (unless column (setq column (tablist-current-column))) - (unless column - (error "No column given and no entry at point")) - (unless width (setq width 1)) - (when (or (not (numberp column)) - (< column 0) - (>= column (length tabulated-list-format))) - (error "No such column: %d" column)) - (when (= column (1- (length tabulated-list-format))) - (error "Can't resize last column")) - - (let* ((cur-width (cadr (elt tabulated-list-format column)))) - (setcar (cdr (elt tabulated-list-format column)) - (max 3 (+ cur-width width))) - (tablist-with-remembering-entry - (tablist-save-marks - (tabulated-list-init-header) - (tabulated-list-print))))) - -(defun tablist-shrink-column (&optional column width) - (interactive - (list nil (* (prefix-numeric-value current-prefix-arg) - 3))) - (tablist-enlarge-column column (- (or width 1)))) - -;; *Sorting -;; - -(defun tablist-sort (&optional column) - "Sort the tabulated-list by COLUMN. - -COLUMN may be either a name or an index. The default compare -function is given by the `tabulated-list-format', which see. - -This function saves the current sort column and the inverse -sort-direction in the variable `tabulated-list-sort-key', which -also determines the default COLUMN and direction. - -The main difference to `tabulated-list-sort' is, that this -function sorts the buffer in-place and it ignores a nil sort -entry in `tabulated-list-format' and sorts on the column -anyway (why not ?)." - - (interactive - (list - (if (null current-prefix-arg) - (tablist-column-name - (or (tablist-current-column) - (car (tablist-major-columns)) - 0)) - (tablist-read-column-name - '(4) "Sort by column" - (tablist-column-name (car (tablist-major-columns))))))) - - (unless column - (setq column (or (car tabulated-list-sort-key) - (tablist-column-name (car (tablist-major-columns))) - (tablist-column-name 0)))) - (when (numberp column) - (let ((column-name (tablist-column-name column))) - (unless column-name - (error "No such column: %d" column)) - (setq column column-name))) - - (setq tabulated-list-sort-key - (cons column - (if (equal column (car tabulated-list-sort-key)) - (cdr tabulated-list-sort-key)))) - - (let* ((entries (if (functionp tabulated-list-entries) - (funcall tabulated-list-entries) - tabulated-list-entries)) - (reverse (cdr tabulated-list-sort-key)) - (n (tabulated-list--column-number ;;errors if column is n/a - (car tabulated-list-sort-key))) - (compare-fn (nth 2 (aref tabulated-list-format n)))) - - (when (or (null compare-fn) - (eq compare-fn t)) - (setq compare-fn - (lambda (a b) - (setq a (aref (cadr a) n)) - (setq b (aref (cadr b) n)) - (string< (if (stringp a) a (car a)) - (if (stringp b) b (car b)))))) - - (unless compare-fn - (error "This column cannot be sorted: %s" column)) - - (setcdr tabulated-list-sort-key (not reverse)) - ;; Presort the entries and hash the result and sort the buffer. - (setq entries (sort (copy-sequence entries) compare-fn)) - (let ((hash (make-hash-table :test 'equal))) - (dotimes (i (length entries)) - (puthash (caar entries) i hash) - (setq entries (cdr entries))) - (tablist-with-remembering-entry - (goto-char (point-min)) - (tablist-skip-invisible-entries) - (let ((inhibit-read-only t)) - (sort-subr - nil 'tablist-forward-entry 'end-of-line - (lambda () - (gethash (tabulated-list-get-id) hash 0)) - nil (if reverse '< '>)))) - (tablist-move-to-column n) - ;; Make the sort arrows display. - (tabulated-list-init-header)))) - -;; -;; *Filter -;; - -(defun tablist-read-filter-name (prompt) - (let ((filter (cdr (assq major-mode tablist-named-filter)))) - (unless filter - (error "No filter defined for %s mode" mode-name)) - (let ((name (completing-read - (format "%s: " prompt) - filter - nil t))) - (unless (> (length name) 0) - (error "No filter selected")) - name))) - -(defun tablist-apply-filter (&optional filter) - "Apply FILTER to the current tabulated list. - -FILTER defaults to `tablist-current-filter'." - (unless filter (setq filter tablist-current-filter)) - (tablist-filter-unhide-buffer) - (when (and filter - (null tablist-filter-suspended)) - (tablist-with-remembering-entry - (tablist-map-with-filter - (lambda nil - (if tablist-umark-filtered-entries - (save-excursion (tablist-unmark-forward))) - (tablist-filter-hide-entry)) - (tablist-filter-negate filter)))) - (force-mode-line-update)) - -(defadvice tabulated-list-print (after tabulated-list activate) - "Reapply the filter." - (when (or tablist-minor-mode - (derived-mode-p 'tablist-mode)) - (tablist-apply-filter))) - -(defun tablist-eval-filter (filter) - (tablist-filter-eval - filter - (tabulated-list-get-id) - (tabulated-list-get-entry) - (cdr (assq major-mode tablist-named-filter)))) - -(defun tablist-map-with-filter (fn filter &optional show-progress - distinguish-one-marked) - "Call FN for every unfiltered entry matching FILTER." - (prog1 - (cl-labels ((search () - (tablist-skip-invisible-entries) - (while (and (not (eobp)) - (not (tablist-eval-filter filter))) - (tablist-forward-entry)) - (unless (eobp) - (point-marker)))) - (let (next-position results) - (save-excursion - (goto-char (point-min)) - (setq next-position (search)) - (while next-position - (goto-char next-position) - (if show-progress (sit-for 0)) - (push (funcall fn) results) - ;; move after last match - (goto-char next-position) - (forward-line 1) - (set-marker next-position nil) - (setq next-position (search))) - (if (and distinguish-one-marked (= (length results) 1)) - (setq results (cons t results)))))))) - -;; -;; **Filter Commands -;; -(defun tablist-push-filter (filter &optional interactive or-p) - (setq tablist-current-filter - (tablist-filter-push - tablist-current-filter - filter or-p)) - (tablist-apply-filter) - (when interactive - (tablist-display-filter-temporarily))) - -(defun tablist-pop-filter (&optional n interactive) - "Remove the first N filter components." - (interactive (list (prefix-numeric-value current-prefix-arg) t)) - (while (and tablist-current-filter - (> n 0)) - (setq tablist-current-filter - (tablist-filter-pop - tablist-current-filter)) - (cl-decf n)) - (tablist-apply-filter) - (when interactive - (when (> n 0) - (message "The filter is empty.")) - (tablist-display-filter-temporarily)) - n) - -(defun tablist-negate-filter (&optional interactive) - "Negate the current filter." - (interactive (list t)) - (setq tablist-current-filter - (tablist-filter-negate - tablist-current-filter)) - (tablist-apply-filter) - (when interactive - (tablist-display-filter-temporarily))) - -(defun tablist-toggle-first-filter-logic () - "Toggle between and/or for the first filter operand." - (interactive) - (setq tablist-current-filter - (pcase tablist-current-filter - (`(or ,x1 ,x2) - `(and ,x1 ,x2)) - (`(and ,x1 ,x2) - `(or ,x1 ,x2)) - (`(not ,x) x) - (x `(not ,x)))) - (tablist-apply-filter) - (tablist-display-filter-temporarily)) - -(defun tablist-suspend-filter (&optional flag) - "Temporarily disable filtering according to FLAG. - -Interactively, this command toggles filtering." - (interactive - (list (not tablist-filter-suspended))) - (let ((state tablist-filter-suspended)) - (unless (eq (not (not state)) - (not (not flag))) - (set (make-local-variable 'tablist-filter-suspended) flag) - (tablist-apply-filter)))) - -(defun tablist-read-regexp-filter (operation arg) - (let ((column-name (tablist-read-column-name arg))) - (list - column-name - (let ((re - (read-regexp (format "%s where %s matches: " operation column-name)))) - (unless (> (length re) 0) - (error "No regexp given")) - re)))) - -(defun tablist-read-equal-filter (operation arg) - (let ((column-name (tablist-read-column-name arg))) - (list - column-name - (read-string (format "%s where %s equals: " operation column-name))))) - -(defun tablist-read-numeric-filter (operation arg) - (let* ((entry (tabulated-list-get-entry 1)) - (default (cl-some - (lambda (idx) - (let ((value (tablist-nth-entry idx entry))) - (when (or (not (eq 0 (string-to-number value))) - (equal "0" value)) - (tablist-column-name idx)))) - (number-sequence 0 (length entry)))) - (column-name (tablist-read-column-name arg nil default)) - (op (completing-read - (format "%s %s matching binary op: " operation column-name) - '("=" "<" ">" "<=" ">=") nil t)) - oper) - - (when (equal "" op) - (error "No operation selected")) - (setq op (intern op)) - (setq oper (number-to-string - (read-number - (format "%s where %s %s " operation column-name op)))) - - (list op column-name oper))) - -(defun tablist-push-regexp-filter (column-name regexp) - "Add a new filter matching REGEXP in COLUMN-NAME. - -The filter is and'ed with the current filter. Use -`tablist-toggle-first-filter-logic' to change this." - (interactive - (tablist-with-filter-displayed - (tablist-read-regexp-filter "Filter" current-prefix-arg))) - (tablist-push-filter - `(=~ ,column-name ,regexp) - (called-interactively-p 'any))) - -(defun tablist-push-equal-filter (column-name string) - "Add a new filter whre string equals COLUMN-NAME's value. - -The filter is and'ed with the current filter. Use -`tablist-toggle-first-filter-logic' to change this." - (interactive - (tablist-with-filter-displayed - (tablist-read-equal-filter "Filter" current-prefix-arg))) - (tablist-push-filter - `(== ,column-name ,string) - (called-interactively-p 'any))) - -(defun tablist-push-numeric-filter (op column-name 2nd-arg) - "Add a new filter matching a numeric predicate. - -The filter is and'ed with the current filter. Use -`tablist-toggle-first-filter-logic' to change this." - (interactive - (tablist-with-filter-displayed - (tablist-read-numeric-filter "Filter" current-prefix-arg))) - (tablist-push-filter - `(,op ,column-name ,2nd-arg) - (called-interactively-p 'any))) - -(defun tablist-push-named-filter (name) - "Add a named filter called NAME. - -Named filter are saved in the variable `tablist-named-filter'." - (interactive - (tablist-with-filter-displayed - (list - (tablist-read-filter-name "Add filter")))) - (when (and name (symbolp name)) - (setq name (symbol-name name))) - (tablist-push-filter name (called-interactively-p 'any))) - -(defun tablist-delete-named-filter (name &optional mode) - (interactive - (tablist-with-filter-displayed - (list - (tablist-read-filter-name "Delete filter")))) - (setq tablist-current-filter - (tablist-filter-map - (lambda (f) - (when (equal f name) - (setq f (tablist-get-named-filter f))) - f) - tablist-current-filter)) - (unless mode (setq mode major-mode)) - (let ((mode-filter - (assq mode tablist-named-filter))) - (when mode-filter - (setcdr mode-filter - (cl-remove name (cdr mode-filter) - :test 'equal :key 'car))))) - -(defun tablist-name-current-filter (name) - (interactive - (list (tablist-with-filter-displayed - (read-string - "Add name for current filter: ")))) - (unless tablist-current-filter - (error "Filter is empty")) - (unless (> (length name) 0) - (error "No name given")) - (tablist-put-named-filter - name (if (stringp tablist-current-filter) - (tablist-get-named-filter - tablist-current-filter) - tablist-current-filter)) - (setq tablist-current-filter name) - (force-mode-line-update)) - -(defun tablist-deconstruct-named-filter () - (interactive) - (let (found) - (setq tablist-current-filter - (tablist-filter-map - (lambda (f) - (when (and (not found) - (stringp f)) - (setq found t) - (let ((df (tablist-get-named-filter f))) - (unless df - (error "Filter is not defined: %s" f)) - (setq f df))) - f) - tablist-current-filter)) - (unless found - (error "No named filter found")) - (force-mode-line-update))) - -(defun tablist-filter-names (&optional mode) - (mapcar 'car (cdr (assq (or mode major-mode) - tablist-named-filter)))) - -(defun tablist-get-named-filter (name &optional mode) - (cdr (assoc name - (cdr (assq (or mode major-mode) - tablist-named-filter))))) - -(defun tablist-put-named-filter (name filter &optional mode) - (unless mode (setq mode major-mode)) - (let ((mode-filter - (assq mode tablist-named-filter))) - (unless mode-filter - (setq mode-filter (cons mode nil)) - (push mode-filter tablist-named-filter)) - (let ((entry (assoc name mode-filter))) - (if entry - (setcdr entry filter) - (setcdr mode-filter - (list (cons name filter))))))) - -(defun tablist-validate-named-filter (filter) - (tablist-filter-map - (lambda (f) - (when (and (stringp f) - (null (tablist-get-named-filter f))) - (error "Undefined named filter: %s (defined: %s)" f - (mapconcat 'identity (tablist-filter-names) ",")))) - filter)) - -(defun tablist-edit-filter () - (interactive) - (setq tablist-current-filter - (tablist-with-filter-displayed - (tablist-filter-edit-filter - "Edit filter: " - tablist-current-filter - nil - 'tablist-validate-named-filter))) - (tablist-apply-filter)) - -(defun tablist-clear-filter () - (interactive) - (setq tablist-current-filter nil) - (tablist-apply-filter)) - -;; **Displaying filter -;; - -(defconst tablist-display-filter-mode-line-tag nil) - -(defun tablist-display-filter (&optional flag) - "Display the current filter according to FLAG. - -If FLAG has the value 'toggle, toggle it's visibility. -If FLAG has the 'state, then do nothing but return the current -visibility." - (interactive (list 'toggle)) - (let* ((tag 'tablist-display-filter-mode-line-tag) - (displayed-p (not (not (assq tag mode-line-format))))) - (if (eq flag 'state) - displayed-p - (let ((display-p (not (not (if (eq flag 'toggle) - (not displayed-p) - flag))))) - (unless (eq displayed-p display-p) - (setq mode-line-format - (if display-p - (list (cons tag mode-line-format) - '(:eval - (replace-regexp-in-string - "%" "%%" - (concat - (propertize "Filter: " 'face 'minibuffer-prompt) - (and tablist-filter-suspended - "[suspended] ") - (if tablist-current-filter - (tablist-filter-unparse - tablist-current-filter t) - "[none]"))))) - (cdr (assq tag mode-line-format))))) - (force-mode-line-update) - display-p)))) - -(defun tablist-display-filter-temporarily () - (tablist-with-filter-displayed - (sit-for 9999))) - -;; -;; **Hiding/Unhiding Entries -;; -(defun tablist-filter-set-entry-hidden (flag &optional pos) - (save-excursion - (when pos (goto-char pos)) - (beginning-of-line) - (let ((inhibit-read-only t)) - (add-text-properties - (point-at-bol) - (1+ (point-at-eol)) - `(invisible ,flag))))) - -(defun tablist-filter-hide-entry (&optional pos) - (interactive) - (tablist-filter-set-entry-hidden t pos)) - -(defun tablist-filter-unhide-entry (&optional pos) - (tablist-filter-set-entry-hidden nil pos)) - -(defun tablist-filter-unhide-buffer () - (let ((inhibit-read-only t)) - (remove-text-properties - (point-min) (point-max) - '(invisible)))) - -(defun tablist-window-attach (awindow &optional window) - "Attach AWINDOW to WINDOW. - -This has the following effect. Whenever WINDOW, defaulting to -the selected window, stops displaying the buffer it currently -displays (e.g., by switching buffers or because it was deleted) -AWINDOW is deleted." - (unless window (setq window (selected-window))) - (let ((buffer (window-buffer window)) - (hook (make-symbol "window-attach-hook"))) - (fset hook - (lambda () - (when (or (not (window-live-p window)) - (not (eq buffer (window-buffer window)))) - (remove-hook 'window-configuration-change-hook - hook) - ;; Deleting windows inside wcch may cause errors in - ;; windows.el . - (run-with-timer - 0 nil (lambda (win) - (when (and (window-live-p win) - (not (eq win (selected-window)))) - (delete-window win))) - awindow)))) - (add-hook 'window-configuration-change-hook hook))) - -(defun tablist-display-buffer-split-below-and-attach (buf alist) - "Display buffer action using `tablist-window-attach'." - (let ((window (selected-window)) - (height (cdr (assq 'window-height alist))) - newwin) - (when height - (when (floatp height) - (setq height (round (* height (frame-height))))) - (setq height (- (max height window-min-height)))) - (setq newwin (window--display-buffer - buf - (split-window-below height) - 'window alist display-buffer-mark-dedicated)) - (tablist-window-attach newwin window) - newwin)) - -(defun tablist-generate-sorter (column compare-fn &optional read-fn) - "Generate a sort function for `tabulated-list' entries. - -Example: - - \(tablist-generate-sorter 0 '< 'string-to-number\) - -would create a sort function sorting `tabulated-list-entries' on -the 0-th column as numbers by the less-than relation." - - (lambda (e1 e2) - (funcall compare-fn - (funcall (or read-fn 'identity) - (aref (cadr e1) column)) - (funcall read-fn - (aref (cadr e2) column))))) - -(provide 'tablist) -;;; tablist.el ends here diff --git a/elpa/tablist-20170219.1935/tablist.elc b/elpa/tablist-20170219.1935/tablist.elc deleted file mode 100644 index 796b5c1..0000000 Binary files a/elpa/tablist-20170219.1935/tablist.elc and /dev/null differ diff --git a/elpa/tagedit-20161121.855/tagedit-autoloads.el b/elpa/tagedit-20161121.855/tagedit-autoloads.el new file mode 100644 index 0000000..85ea225 --- /dev/null +++ b/elpa/tagedit-20161121.855/tagedit-autoloads.el @@ -0,0 +1,121 @@ +;;; tagedit-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "tagedit" "tagedit.el" (23391 65248 0 0)) +;;; Generated autoloads from tagedit.el + +(autoload 'tagedit-add-paredit-like-keybindings "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-add-experimental-features "tagedit" "\ + + +\(fn)" nil nil) + +(autoload 'tagedit-disable-experimental-features "tagedit" "\ + + +\(fn)" nil nil) + +(autoload 'tagedit-goto-tag-content "tagedit" "\ +Goto start of content within current tag. + +\(fn)" t nil) + +(autoload 'tagedit-insert-exclamation-mark "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-maybe-insert-slash "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-kill "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-forward-slurp-tag "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-forward-barf-tag "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-kill-attribute "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-toggle-multiline-tag "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-raise-tag "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-splice-tag "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-split-tag "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-join-tags "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-convolute-tags "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-insert-equal "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-insert-quote "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-insert-lt "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-insert-hash "tagedit" "\ + + +\(fn)" t nil) + +(autoload 'tagedit-insert-dot "tagedit" "\ + + +\(fn)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; tagedit-autoloads.el ends here diff --git a/elpa/tagedit-20161121.855/tagedit-pkg.el b/elpa/tagedit-20161121.855/tagedit-pkg.el new file mode 100644 index 0000000..14c6528 --- /dev/null +++ b/elpa/tagedit-20161121.855/tagedit-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "tagedit" "20161121.855" "Some paredit-like features for html-mode" '((s "1.3.1") (dash "1.0.3")) :commit "b3a70101a0dcf85498c92b7fcfa7fdbac869746c" :keywords '("convenience") :authors '(("Magnar Sveen" . "magnars@gmail.com")) :maintainer '("Magnar Sveen" . "magnars@gmail.com")) diff --git a/elpa/tagedit-20161121.855/tagedit.el b/elpa/tagedit-20161121.855/tagedit.el new file mode 100644 index 0000000..d18339a --- /dev/null +++ b/elpa/tagedit-20161121.855/tagedit.el @@ -0,0 +1,1147 @@ +;;; tagedit.el --- Some paredit-like features for html-mode + +;; Copyright (C) 2012 Magnar Sveen + +;; Author: Magnar Sveen +;; Version: 1.4.0 +;; Package-Version: 20161121.855 +;; Keywords: convenience +;; Package-Requires: ((s "1.3.1") (dash "1.0.3")) + +;; 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 . + +;;; Commentary: + +;; A collection of paredit-like functions for editing in html-mode. + +;; ## Installation +;; +;; I highly recommended installing tagedit through elpa. +;; +;; It's available on [marmalade](http://marmalade-repo.org/) and +;; [melpa](http://melpa.milkbox.net/): +;; +;; M-x package-install tagedit +;; +;; You can also install the dependencies on your own, and just dump +;; tagedit in your path somewhere: +;; +;; -
    s.el +;; - dash.el + +;; ## Functions +;; +;; This is it at the moment: +;; +;; - `tagedit-forward-slurp-tag` moves the next sibling into this tag. +;; - `tagedit-forward-barf-tag` moves the last child out of this tag. +;; - `tagedit-raise-tag` replaces the parent tag with this tag. +;; - `tagedit-splice-tag` replaces the parent tag with its contents. +;; - `tagedit-kill` kills to the end of the line, while preserving the structure. +;; +;; Not part of paredit: +;; +;; - `tagedit-kill-attribute` kills the html attribute at point. + +;; ## Setup +;; +;; If you want tagedit to bind to the same keys as paredit, there's this: +;; +;; ```cl +;; (eval-after-load 'sgml-mode +;; '(progn +;; (require 'tagedit) +;; (tagedit-add-paredit-like-keybindings) +;; (add-hook 'html-mode-hook (lambda () (tagedit-mode 1))))) +;; ``` +;; +;; Or you can cherry-pick functions and bind them however you want: +;; +;; ```cl +;; (define-key tagedit-mode-map (kbd "C-") 'tagedit-forward-slurp-tag) +;; (define-key tagedit-mode-map (kbd "C-") 'tagedit-forward-barf-tag) +;; (define-key tagedit-mode-map (kbd "M-r") 'tagedit-raise-tag) +;; (define-key tagedit-mode-map (kbd "M-s") 'tagedit-splice-tag) +;; (define-key tagedit-mode-map (kbd "C-k") 'tagedit-kill) +;; (define-key tagedit-mode-map (kbd "s-k") 'tagedit-kill-attribute) +;; ``` + +;; ## Experimental tag editing +;; +;; I am currently working on automatically updating the closing tag when +;; you edit the starting tag. It is an experimental feature, since it is quite new +;; and I'm sure it breaks some things. +;; +;; This also inserts `<>` when you type `<`, and expands it to +;; `
    ` as you type. +;; +;; You can turn on experimental features using: +;; +;; ```cl +;; (tagedit-add-experimental-features) +;; ``` + +;; ## Other conveniences +;; +;; It also expands one-line tags into multi-line tags for you, when you +;; press refill-paragraph. Like this: +;; +;; ```html +;;

    My one very long text inside a tag that I'd like to refill

    +;; ``` +;; +;; then after `M-q`: +;; +;; ```html +;;

    +;; My one very long text inside a tag that +;; I'd like to refill +;;

    +;; ``` +;; +;; You can disable this behavior by setting +;; `tagedit-expand-one-line-tags` to nil. + +;;; Code: + +;; Vocabulary +;; +;; - a tag can be self-closing or consist of an open tag and a closing tag. +;; - a tag that is not self-closing has contents +;; - a tag has innards between < and > +;; - a tag has details between +;; +;; TODO: fix old methods to use a consistent vocabulary + +(require 's) +(require 'dash) +(require 'sgml-mode) + +;;;###autoload +(defun tagedit-add-paredit-like-keybindings () + (interactive) + + ;; paredit lookalikes + (define-key tagedit-mode-map (kbd "C-") 'tagedit-forward-slurp-tag) + (define-key tagedit-mode-map (kbd "C-)") 'tagedit-forward-slurp-tag) + (define-key tagedit-mode-map (kbd "C-") 'tagedit-forward-barf-tag) + (define-key tagedit-mode-map (kbd "C-}") 'tagedit-forward-barf-tag) + (define-key tagedit-mode-map (kbd "M-r") 'tagedit-raise-tag) + (define-key tagedit-mode-map (kbd "M-s") 'tagedit-splice-tag) + (define-key tagedit-mode-map (kbd "M-S") 'tagedit-split-tag) + (define-key tagedit-mode-map (kbd "M-J") 'tagedit-join-tags) + (define-key tagedit-mode-map (kbd "M-?") 'tagedit-convolute-tags) + (define-key tagedit-mode-map (kbd "M-'") 'tagedit-goto-tag-content) + (define-key tagedit-mode-map (kbd "C-c C-") 'te/kill-current-tag) + (define-key tagedit-mode-map (kbd "C-%") 'te/goto-tag-match) + (define-key tagedit-mode-map (kbd "C-^") 'te/goto-tag-begging) + (define-key tagedit-mode-map (kbd "C-$") 'te/goto-tag-end) + + ;; no paredit equivalents + (define-key tagedit-mode-map (kbd "s-k") 'tagedit-kill-attribute) + (define-key tagedit-mode-map (kbd "s-") 'tagedit-toggle-multiline-tag)) + +;;;###autoload +(defun tagedit-add-experimental-features () + (setq tagedit-experimental-features-on? t) + (te/maybe-turn-on-tag-editing) + (define-key tagedit-mode-map (kbd "<") 'tagedit-insert-lt) + (define-key tagedit-mode-map (kbd ">") 'tagedit-insert-gt) + (define-key tagedit-mode-map (kbd ".") 'tagedit-insert-dot) + (define-key tagedit-mode-map (kbd "#") 'tagedit-insert-hash) + ) + +;;;###autoload +(defun tagedit-disable-experimental-features () + (setq tagedit-experimental-features-on? nil) + (te/turn-off-tag-editing) + (define-key tagedit-mode-map (kbd "<") nil) + (define-key tagedit-mode-map (kbd ">") nil)) + +;;;###autoload +(defun tagedit-goto-tag-content () + "Goto start of content within current tag." + (interactive) + (goto-char (te/inner-beg (te/current-tag)))) + +(defun te/goto-tag-begging () + (interactive) + (goto-char (te/get (te/current-tag) :beg))) + +(defun te/goto-tag-end () + (interactive) + (goto-char (1- (te/get (te/current-tag) :end)))) + +(defun te/goto-tag-match () + (interactive) + (let* ((tag (te/current-tag)) + (in-opening-tag (and (>= (point) (te/get tag :beg)) (<= (point) (te/inner-beg tag)))) + (in-closing-tag (and (<= (point) (te/get tag :end)) (>= (point) (te/inner-end tag))))) + (if in-opening-tag + (te/goto-tag-end) + (te/goto-tag-begging)))) + +(defun te/kill-current-tag (arg) + (interactive "p") + (decf arg) + (let* ((tag (te/current-tag)) (parent tag)) + (dotimes (i arg) + (setq parent (te/parent-tag parent))) + (kill-region (te/get parent :beg) (te/get parent :end)))) + +(defun tagedit-insert-gt () + (interactive) + (if (and (te/point-inside-tag-innards?) + (not (te/point-inside-string?))) + (search-forward ">") + (self-insert-command 1))) + +;;;###autoload +(defun tagedit-insert-exclamation-mark () + (interactive) + (when (and (looking-back "<") + (looking-at ">")) + (te/delete-mirror-end-tag) + (te/conclude-tag-edit)) + (self-insert-command 1)) + +;;;###autoload +(defun tagedit-maybe-insert-slash () + (interactive) + (let ((tag (te/current-tag))) + (if (and (member (te/get tag :name) te/tags-that-cannot-self-close) + (looking-at ">")) + (message "Cannot self-close %ss." (te/get tag :name)) + (self-insert-command 1)))) + +;;;###autoload +(defun tagedit-kill () + (interactive) + (when (and (te/point-at-tag-name) ;; skip past tagname if inside to avoid mangling the document. Even + (looking-at "\\sw")) ;; better would be to update the closing tag, but that's for + (skip-syntax-forward "w")) ;; another day + (let ((current-tag (te/current-tag))) + (cond + ((looking-at "\\s *$") + (kill-line)) + + ((te/point-inside-string?) + (te/kill-to-end-of-string)) + + ((te/point-inside-tag-details?) + (if (te/tag-details-ends-on-this-line?) + (te/kill-to-end-of-tag-details) + (te/kill-remaining-attributes-on-line))) + + ((and current-tag + (not (te/looking-at-tag current-tag)) + (te/tag-ends-on-this-line? current-tag)) + (te/kill-to-end-of-tag-contents current-tag)) + + (:else (te/kill-remaining-tags-on-line))))) + +;;;###autoload +(defun tagedit-forward-slurp-tag () + (interactive) + (te/conclude-tag-edit) + (when (te/is-self-closing (te/current-tag)) + (save-excursion (te/open-self-closing-tag (te/current-tag)))) + (save-excursion + (let* ((current-tag (te/current-tag)) + (next-sibling (te/next-sibling current-tag))) + (if next-sibling + (te/move-end-tag current-tag (te/get next-sibling :end)) + (let ((parent (te/parent-tag current-tag))) + (if (not parent) + (error "Nothing to slurp") + (goto-char (te/get parent :beg)) + (tagedit-forward-slurp-tag)))))) + (save-excursion (te/ensure-proper-multiline (te/current-tag))) + (te/indent (te/current-tag))) + +;;;###autoload +(defun tagedit-forward-barf-tag () + (interactive) + (te/conclude-tag-edit) + (save-excursion + (let* ((current-tag (te/current-tag)) + (last-child (te/last-child current-tag))) + (if (not last-child) + (error "Nothing to barf") + (goto-char (te/get last-child :beg)) + (skip-syntax-backward " >") + (te/move-end-tag current-tag (point))))) + (save-excursion (te/ensure-proper-multiline (te/current-tag))) + (te/indent (te/parent-tag (te/current-tag)))) + +;;;###autoload +(defun tagedit-kill-attribute () + (interactive) + (when (and (te/point-inside-tag-innards?) + (not (looking-at ">"))) + (te/select-attribute) + (kill-region (1- (region-beginning)) (region-end)) + (just-one-space) + (when (looking-at ">") + (delete-char -1)))) + +;;;###autoload +(defun tagedit-toggle-multiline-tag () + (interactive) + (te/conclude-tag-edit) + (let ((current-tag (te/current-tag))) + (if (te/is-self-closing current-tag) + (message "Can't toggle multiline for self-closing tags.") + (if (te/is-one-line-tag current-tag) + (te/one->multi-line-tag current-tag))))) + +;;;###autoload +(defun tagedit-raise-tag () + (interactive) + (te/conclude-tag-edit) + (let* ((current (te/current-tag)) + (contents (te/contents current)) + (parent (te/parent-tag current))) + (save-excursion + (te/delete parent) + (let ((beg (point))) + (insert contents) + (indent-region beg (point)))))) + +;;;###autoload +(defun tagedit-splice-tag () + (interactive) + (te/conclude-tag-edit) + (let* ((current (te/current-tag)) + (parent (te/parent-tag current))) + (save-excursion + (te/delete-end-tag parent) + (te/delete-beg-tag parent) + (te/indent (te/current-tag))))) + +;;;###autoload +(defun tagedit-split-tag () + (interactive) + (te/conclude-tag-edit) + (when (te/point-inside-tag-innards?) + (error "Can't split here and keep a valid document.")) + (let* ((tag (te/current-tag)) + (opening-tag (buffer-substring (te/get tag :beg) + (te/inner-beg tag))) + (closing-tag (buffer-substring (te/inner-end tag) + (te/get tag :end))) + (multiline? (te/is-multiline tag))) + (insert closing-tag) + (insert opening-tag) + (when multiline? + (let ((first (save-excursion (te/backward-list) + (te/current-tag-behind))) + (second (te/current-tag))) + (te/ensure-proper-multiline second) + (te/ensure-proper-multiline first))))) + +;;;###autoload +(defun tagedit-join-tags () + (interactive) + (unless (and (te/looking-back-at-closing-tag) + (te/looking-at-opening-tag)) + (error "Place cursor between tags to join.")) + (te/conclude-tag-edit) + (save-excursion + (let ((first (te/current-tag-behind)) + (second (te/current-tag-ahead))) + (if (s-equals? (te/get first :name) (te/get second :name)) + (progn + (te/delete-beg-tag second) + (te/delete-end-tag first)) + (let ((name (completing-read "Type after join: " + (list (te/get first :name) (te/get second :name))))) + (te/change-tag-name second name) + (te/change-tag-name first name) + (tagedit-join-tags)))))) + +;;;###autoload +(defun tagedit-convolute-tags () + (interactive) + (unless (looking-at "<") + (error "For stability reasons, place point at the start of the tag when convoluting.")) + (unless (te/parent-tag (te/parent-tag (te/current-tag))) + (error "Can only convolute at depth 3 (tag needs a grandparent).")) + (let* ((current (te/current-tag)) + (parent (te/parent-tag current)) + (opening-tag (buffer-substring (te/get parent :beg) + (te/inner-beg parent))) + (closing-tag (buffer-substring (te/inner-end parent) + (te/get parent :end))) + (prev-siblings (buffer-substring (te/inner-beg parent) + (point)))) + (save-excursion + (te/delete-end-tag parent) + (goto-char (te/inner-beg parent)) + (delete-char (length prev-siblings)) + (te/delete-beg-tag parent)) + (setq parent (te/parent-tag (te/current-tag))) + (save-excursion + (goto-char (te/get parent :end)) + (insert closing-tag) + (goto-char (te/get parent :beg)) + (save-excursion (insert prev-siblings)) + (insert opening-tag) + (te/ensure-proper-multiline (te/current-tag)) + (te/indent (te/current-tag))) + (skip-syntax-forward " "))) + +;;;###autoload +(defun tagedit-insert-equal () + (interactive) + (if (and (not (te/point-inside-string?)) + (te/point-inside-tag-details?) + (looking-back "\\sw") + (not (looking-at "\""))) + (progn (insert "=\"\"") + (forward-char -1)) + (self-insert-command 1))) + +;;;###autoload +(defun tagedit-insert-quote () + (interactive) + (unless (and (eq last-command 'tagedit-insert-equal) + (looking-back "\"")) + (self-insert-command 1))) + +;;;###autoload +(defun tagedit-insert-lt () + (interactive) + (when (fboundp 'autopair-mode) + (autopair-mode -1)) + (if (or (te/point-inside-string?) + (te/point-inside-tag-innards?)) + (self-insert-command 1) + (insert "<>") + (forward-char -1) + (te/create-mirror (point) (point)) + (forward-char -3) + (te/create-master (point) (point)))) + +;;;###autoload +(defun tagedit-insert-hash () + (interactive) + (if (te/eligible-for-auto-attribute-insert?) + (if (te/has-attribute "id" (te/current-tag)) + (te/mark-current-id-attribute) + (te/insert-attribute "id")) + (self-insert-command 1))) + +;;;###autoload +(defun tagedit-insert-dot () + (interactive) + (if (te/eligible-for-auto-attribute-insert?) + (if (te/has-attribute "class" (te/current-tag)) + (te/expand-current-class-attribute) + (te/insert-attribute "class")) + (self-insert-command 1))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Extension points for modes +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defvar te/skip-tag-forward-fn (apply-partially 'sgml-skip-tag-forward 1) + "Skip to end of tag or matching closing tag if present.") + +(defvar te/skip-tag-backward-fn (apply-partially 'sgml-skip-tag-backward 1) + "Skip to beginning of tag or matching opening tag if present.") + +(defvar te/empty-tag-p-fn 'sgml-empty-tag-p + "Return non-nil if TAG-NAME is an implicitly empty tag.") + +(defvar te/current-tag-fn 'te-sgml/current-tag + "Return information about current tag as an alist: + + ((:name . a) + (:self-closing . b) + (:beg . c) + (:end . d)) + + a is the tagname, ie. 'div' + b is :t if there is no need for a closing tag, otherwise :f + c is the position in the buffer of the opening pointy bracket < + d is the position in the buffer of the closing pointy bracket > + + The current tag is defined as the tag we are either: + + 1) looking directly at (point is at the opening bracket) + 2) otherwise it is the tag point is inside + + If point is not inside any tags, returns nil. ") + +(defvar te/forward-list-fn 'forward-list + "Move forward across the next or .") + +(defvar te/backward-list-fn 'backward-list + "Move backward across the previous or .") + +(defvar te/forward-sexp-fn 'forward-sexp + "Move forward across one balanced expression (sexp).") + +(defvar te/backward-sexp-fn 'backward-sexp + "Move backward across one balanced expression (sexp).") + +(defvar te/point-inside-string-fn 'te-sgml/point-inside-string? + "Checks if point is currently inside an attribute string.") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun te/get (list key) + (cdr (assoc key list))) + +(defun te/skip-tag-forward () + (funcall te/skip-tag-forward-fn)) + +(defun te/skip-tag-backward () + (funcall te/skip-tag-backward-fn)) + +(defun te/empty-tag-p (tag-name) + (funcall te/empty-tag-p-fn tag-name)) + +(defun te/current-tag () + (funcall te/current-tag-fn)) + +(defun te/forward-list () + (funcall te/forward-list-fn)) + +(defun te/backward-list () + (funcall te/backward-list-fn)) + +(defun te/forward-sexp () + (funcall te/forward-sexp-fn)) + +(defun te/backward-sexp () + (funcall te/backward-sexp-fn)) + +(defun te/point-inside-string? () + (funcall te/point-inside-string-fn)) + +(defun te/current-tag-behind () + (save-excursion + (skip-syntax-backward " ") + (backward-char) + (te/current-tag))) + +(defun te/current-tag-ahead () + (save-excursion + (skip-syntax-forward " ") + (te/current-tag))) + +(defun te/change-tag-name (tag name) + (save-excursion + (unless (te/is-self-closing tag) + (goto-char (te/get tag :end)) + (backward-char) + (delete-char (- (length (te/get tag :name)))) + (insert name)) + (goto-char (te/get tag :beg)) + (forward-char) + (delete-char (length (te/get tag :name))) + (insert name))) + +(defun te/eligible-for-auto-attribute-insert? () + (and (te/point-inside-tag-innards?) + (not (te/point-inside-string?)) + (not (te/point-inside-comment?)))) + +(defun te/expand-current-class-attribute () + (te/goto-attribute-end "class" (te/current-tag)) + (unless (looking-back " ") + (insert " "))) + +(defun te/mark-current-id-attribute () + (te/goto-attribute-end "id" (te/current-tag)) + (set-mark (point)) + (forward-char 1) + (te/backward-sexp) + (forward-char 1)) + +(defun te/has-attribute (attr tag) + (save-excursion + (goto-char (te/get tag :beg)) + (search-forward (concat attr "=\"") (te/inner-beg tag) t))) + +(defun te/goto-attribute-end (attr tag) + (goto-char (te/get tag :beg)) + (search-forward (concat attr "=") (te/inner-beg tag) t) + (te/forward-sexp) + (forward-char -1)) + +(defun te/insert-attribute (name) + (unless (looking-back " ") + (insert " ")) + (insert name "=\"\"") + (unless (looking-at "[ >/]") + (insert " ") + (forward-char -1)) + (forward-char -1)) + +(defvar tagedit-experimental-features-on? nil) + +(defun te/maybe-turn-on-tag-editing () + (when (and tagedit-mode tagedit-experimental-features-on?) + (add-hook 'before-change-functions 'te/before-change-handler nil t) + (add-hook 'post-command-hook 'te/maybe-start-tag-edit nil t))) + +(defun te/turn-off-tag-editing () + (remove-hook 'before-change-functions 'te/before-change-handler t) + (remove-hook 'post-command-hook 'te/maybe-start-tag-edit t)) + +(defun te/before-change-handler (beg end) + (when (and te/master + (< beg (overlay-start te/master)) + (> end (overlay-end te/master))) + (te/delete-master) + (te/delete-mirror))) + +(defun te/maybe-start-tag-edit (&rest ignore) + (ignore-errors + (when (and (not te/master) + (not te/mirror) + (te/point-at-tag-name)) + (let ((tag (te/current-tag))) + (unless (te/is-unmatched-open tag) + (te/create-master (1+ (te/get tag :beg)) + (te/tag-details-beg tag)) + (unless (te/is-self-closing tag) + (te/create-mirror (- (te/get tag :end) (length (te/get tag :name)) 1) + (- (te/get tag :end) 1)))))))) + +(defvar tagedit-mode-map nil + "Keymap for tagedit minor mode.") + +(unless tagedit-mode-map + (setq tagedit-mode-map (make-sparse-keymap))) + +(--each '(("C-k" . tagedit-kill) + ("=" . tagedit-insert-equal) + ("!" . tagedit-insert-exclamation-mark) + ("\"" . tagedit-insert-quote)) + (define-key tagedit-mode-map (read-kbd-macro (car it)) (cdr it))) + +(define-minor-mode tagedit-mode + "Minor mode for pseudo-structurally editing html." + nil " Tagedit" tagedit-mode-map + (if tagedit-mode + (te/maybe-turn-on-tag-editing) + (te/turn-off-tag-editing))) + +(defvar te/tags-that-cannot-self-close '("div" "span" "script")) + +(defun te/looking-at-tag (tag) + (= (point) (te/get tag :beg))) + +(defvar te/master nil) +(defvar te/mirror nil) + +(make-variable-buffer-local 'te/master) +(make-variable-buffer-local 'te/mirror) + +(defface te/master-face + `((((class color) (background light)) + (:underline "#777777")) + (((class color) (background dark)) + (:underline "#777777")) + (t (:underline t))) + "The face used to highlight master" + :group 'tagedit) + +(defface te/mirror-face + `((((class color) (background light)) + (:underline "#777777")) + (((class color) (background dark)) + (:underline "#777777")) + (t (:underline t))) + "The face used to highlight mirror" + :group 'tagedit) + +(defun te/delete-mirror () + (when te/mirror + (delete-overlay te/mirror) + (setq te/mirror nil))) + +(defun te/create-mirror (beg end) + (te/delete-mirror) + (setq te/mirror (make-overlay beg end nil nil t)) + (overlay-put te/mirror 'priority 100) + (overlay-put te/mirror 'face 'te/mirror-face)) + +(defun te/delete-master () + (when te/master + (delete-overlay te/master) + (setq te/master nil))) + +(defvar te/master-keymap (make-sparse-keymap)) +(define-key te/master-keymap (kbd "TAB") 'tagedit-insert-gt) +(define-key te/master-keymap (kbd "/") 'tagedit-maybe-insert-slash) + +(defun te/create-master (beg end) + (if (or (< (point) beg) + (> (point) end)) + (error "Point must be inside master region")) + (te/delete-master) + (setq te/master (make-overlay beg end nil nil t)) + (overlay-put te/master 'priority 100) + (overlay-put te/master 'face 'te/master-face) + (overlay-put te/master 'keymap te/master-keymap) + (overlay-put te/master 'modification-hooks '(te/on-master-modification)) + (overlay-put te/master 'insert-in-front-hooks '(te/on-master-modification)) + (overlay-put te/master 'insert-behind-hooks '(te/on-master-modification)) + (add-hook 'before-revert-hook 'te/conclude-tag-edit nil t) + (add-hook 'post-command-hook 'te/post-command-handler nil t)) + +(defun te/conclude-tag-edit () + (when (and te/mirror + te/master + (save-excursion + (goto-char (overlay-start te/master)) + (te/is-self-closing (te/current-tag)))) + (te/delete-mirror-end-tag)) + (te/delete-master) + (te/delete-mirror) + (remove-hook 'before-revert-hook 'te/conclude-tag-edit t) + (remove-hook 'post-command-hook 'te/post-command-handler t)) + +(defmacro te/delete-to (&rest body) + `(let ((beg (point))) + ,@body + (delete-region beg (point)))) + +(defun te/delete-mirror-end-tag () + (save-excursion + (goto-char (overlay-start te/mirror)) + (search-backward "<") + (te/delete-to (search-forward ">")))) + +(defun te/point-is-outside-of-master () + "Is point outside of master?" + (or (null te/master) + (< (point) (overlay-start te/master)) + (> (point) (overlay-end te/master)))) + +(defun te/active-region-is-outside-of-master () + "Is region active and mark outside master?" + (and (region-active-p) + (or (< (mark) (overlay-start te/master)) + (> (mark) (overlay-end te/master))))) + +(defvar te/tag-name-re "[[:lower:][:upper:]0-9\-:]*") + +(defun te/point-at-tag-name () + (looking-back (concat "<" te/tag-name-re))) + +(defun te/looking-back-at-closing-tag () + (looking-back (concat "\\s *"))) + +(defun te/looking-at-opening-tag () + (looking-at (concat "\\s *<" te/tag-name-re))) + +(defun te/master-string () + (buffer-substring (overlay-start te/master) + (overlay-end te/master))) + +(defun te/post-command-handler () + "Clear all marks if point or region is outside of master" + (if (or (te/point-is-outside-of-master) + (te/active-region-is-outside-of-master) + (not (te/point-at-tag-name))) + (te/conclude-tag-edit))) + +(defun te/on-master-modification (overlay after? beg end &optional length) + (when after? + (let ((inhibit-modification-hooks t)) + (save-excursion + (goto-char (overlay-start te/master)) + (let ((master (te/current-tag))) + (if te/mirror + (if (te/is-self-closing master) + (te/remove-closing-tag-and-mirror master) + (te/update-mirror-from-master master)) + (unless (te/is-self-closing master) + (te/insert-closing-tag-with-mirror master)))))))) + +(defun te/insert-closing-tag-with-mirror (master) + (let ((name (te/get master :name))) + (goto-char (te/get master :end)) + (insert "") + (te/create-mirror (- (point) 1 (length name)) + (- (point) 1)))) + +(defun te/remove-closing-tag-and-mirror (master) + (te/delete-mirror-end-tag) + (te/delete-mirror)) + +(defun te/update-mirror-from-master (master) + (goto-char (overlay-start te/mirror)) + (delete-char (- (overlay-end te/mirror) + (overlay-start te/mirror))) + (insert (te/get master :name))) + +(defun te/tag-ends-on-this-line? (tag) + (save-excursion + (= (line-number-at-pos) + (progn (goto-char (te/get tag :end)) + (te/backward-list) + (line-number-at-pos))))) + +(defmacro te/kill-to (&rest body) + (declare (debug (body)) + (indent 0)) + `(let ((beg (point))) + ,@body + (kill-region beg (point)))) + +(defun te/kill-remaining-tags-on-line () + (let ((line (line-number-at-pos))) + (te/kill-to + (while (and (= line (line-number-at-pos)) + (not (eolp)) + (search-forward-regexp "\\(<\\|$\\)" nil t)) + (when (and (looking-back "<" 1) + (not (looking-at "!--"))) + (forward-char -1) + (te/skip-tag-forward)))))) + +(defun te/kill-to-end-of-tag-contents (tag) + (te/kill-to (goto-char (te/get tag :end)) + (te/backward-list))) + +(defun te/kill-remaining-attributes-on-line () + (let ((line (line-number-at-pos))) + (te/kill-to + (while (and (= line (line-number-at-pos)) + (not (looking-at "\\s *$"))) + (te/goto-end-of-attribute))))) + +(defun te/point-inside-tag-details? () + (let ((tag (te/current-tag))) + (and tag + (<= (te/tag-details-beg tag) (point)) + (<= (point) (te/tag-details-end tag))))) + +(defun te/point-inside-tag-innards? () + (let ((tag (te/current-tag))) + (and tag + (< (te/get tag :beg) (point)) + (<= (point) (te/tag-details-end tag))))) + +(defun te/tag-details-beg (tag) + (+ (te/get tag :beg) 1 (length (te/get tag :name)))) + +(defun te/tag-details-end (tag) + (save-excursion + (goto-char (te/get tag :beg)) + (te/forward-list) + (if (looking-back "/>" 2) + (- (point) 2) + (- (point) 1)))) + +(defun te/tag-details-ends-on-this-line? () + (= (line-number-at-pos) + (line-number-at-pos (te/tag-details-end (te/current-tag))))) + +(defun te/kill-to-end-of-tag-details () + (te/kill-to + (goto-char (te/tag-details-end (te/current-tag))))) + +(defun te/kill-to-end-of-string () + (te/kill-to + (te/move-point-forward-out-of-string) + (forward-char -1))) + +(defun te/point-inside-comment? () + (nth 4 (syntax-ppss))) + +(defun te/move-point-forward-out-of-string () + "Move point forward until it exits the current quoted string." + (while (te/point-inside-string?) (forward-char))) + +(defun te/open-self-closing-tag (tag) + (when (te/empty-tag-p (te/get tag :name)) + (error "Cannot open empty tag %s." (te/get tag :name))) + (goto-char (te/get tag :end)) + (forward-char -1) + (when (looking-back "/" 1) + (delete-char -1)) + (forward-char 1) + (te/insert-closing-tag tag)) + +(defun te/ensure-proper-multiline (tag) + (when (te/is-multiline tag) + (goto-char (te/get tag :end)) + (unless (looking-at "$") + (newline)) + (te/backward-sexp) + (unless (looking-back "^\s*") + (newline)) + (goto-char (te/get tag :beg)) + (unless (looking-back "^\s*") + (newline)) + (te/forward-sexp) + (unless (looking-at "$") + (newline)))) + +(defun te/is-multiline (tag) + (not (= (line-number-at-pos (te/get tag :beg)) + (line-number-at-pos (te/get tag :end))))) + +(defun te/insert-closing-tag (tag) + (insert "")) + +(defun te/move-end-tag (tag pos) + (let ((tag-start-line (line-number-at-pos (point)))) + (goto-char pos) + (save-excursion + (te/delete-end-tag tag)) + (te/insert-closing-tag tag))) + +(defun te/delete-end-tag (tag) + (goto-char (te/get tag :end)) + (if (save-excursion ;; end tag is alone on line + (beginning-of-line) + (looking-at (concat "^\s*$"))) + (delete-char (- 0 (current-column) 1)) ;; then delete entire line + (te/backward-sexp) + (delete-region (point) (te/get tag :end)))) ;; otherwise just the end tag + +(defun te/delete-beg-tag (tag) + (goto-char (te/get tag :beg)) + (te/forward-sexp) + (if (save-excursion ;; beg tag is alone on line + (beginning-of-line) + (looking-at (concat "^\s*<" (te/get tag :name) "[^>]*>$"))) + (progn ;; then delete entire line + (delete-char (- 0 (current-column))) + (delete-char 1)) + (delete-region (te/get tag :beg) (point)))) + +(defun te/indent (tag) + (if tag + (indent-region (te/get tag :beg) + (te/get tag :end)) + (indent-region (point-min) (point-max)))) + +(defun te/is-self-closing (tag) + (or (eq :t (te/get tag :self-closing)) + (te/empty-tag-p (te/get tag :name)))) + +(defun te/is-unmatched-open (tag) + (and (= (te/inner-beg tag) (te/get tag :end)) + (not (te/is-self-closing tag)))) + +(defun te/goto-end-of-attribute () + (search-forward "\"") + (when (te/point-inside-string?) + (forward-char -1) + (te/forward-sexp))) + +(defun te/select-attribute () + (search-forward "\"") + (when (te/point-inside-string?) + (forward-char -1) + (te/forward-sexp)) + (set-mark (point)) + (te/backward-sexp) + (search-backward " ") + (forward-char 1)) + +(defvar tagedit-expand-one-line-tags t + "Should tagedit change one-line tags into multi-line tags? +This happens when you press refill-paragraph.") + +(defadvice fill-paragraph (before tagedit-maybe-expand-tag activate) + (te/maybe-expand-tag)) + +(defun te/maybe-expand-tag () + (when (and tagedit-expand-one-line-tags tagedit-mode) + (let ((current-tag (te/current-tag))) + (when (te/is-one-line-tag current-tag) + (te/one->multi-line-tag current-tag))))) + +(defun te/is-one-line-tag (tag) + (when tag + (save-excursion + (goto-char (te/get tag :beg)) + (= (line-number-at-pos) + (progn + (goto-char (te/get tag :end)) + (line-number-at-pos)))))) + +(defun te/one->multi-line-tag (tag) + (save-excursion + (goto-char (te/inner-end tag)) + (let ((end (point))) + (insert "\n") + (goto-char (te/inner-beg tag)) + (insert "\n") + (indent-region (point) (+ 3 end))))) + +(defun te/parent-tag (tag) + (save-excursion + (goto-char (1- (te/get tag :beg))) + (let ((parent (te/current-tag))) + (when (and parent + (not (= (te/get parent :beg) + (te/get tag :beg)))) + parent)))) + +(defun te/just-one-blank-line () + (newline 2) + (forward-line -1) + (delete-blank-lines)) + +(defun te/contents (tag) + (buffer-substring (te/get tag :beg) + (te/get tag :end))) + +(defun te/inner-contents (tag) + (if (te/is-self-closing tag) + "" + (buffer-substring (te/inner-beg tag) + (te/inner-end tag)))) + +(defun te/delete (tag) + (goto-char (te/get tag :beg)) + (delete-region (te/get tag :beg) + (te/get tag :end))) + +(defun te/inner-beg (tag) + (save-excursion + (goto-char (te/get tag :beg)) + (te/forward-list) + (point))) + +(defun te/inner-end (tag) + (- (te/get tag :end) + (length (te/get tag :name)) + 3)) + +(defun te/current-text-node () + (unless (te/point-inside-tag-innards?) + (save-excursion + (let* ((beg (progn + (search-backward ">") + (forward-char 1) + (skip-syntax-forward " >") + (point))) + (end (progn + (search-forward "<") + (forward-char -1) + (skip-syntax-backward " >") + (point)))) + `((:name . "text-node") + (:self-closing :t) + (:beg . ,beg) + (:end . ,end)))))) + +(defun te/last-child (tag) + (unless (te/empty-tag tag) + (save-excursion + (goto-char (te/get tag :end)) + (te/backward-sexp) + (skip-syntax-backward " >") + (if (looking-back ">") + (progn + (backward-char 1) + (te/current-tag)) + (te/current-text-node))))) + +(defun te/empty-tag (tag) + (equal "" (s-trim (te/inner-contents tag)))) + +(defun te/looking-at-parents-end-tag (tag) + (save-excursion + (let ((here (point)) + (parent (te/parent-tag tag))) + (when parent + (goto-char (te/get parent :end)) + (te/backward-sexp) + (= here (point)))))) + +(defun te/next-sibling (tag) + (save-excursion + (goto-char (te/get tag :end)) + (skip-syntax-forward " >") + (unless (eobp) + (if (looking-at "<") + (unless (te/looking-at-parents-end-tag tag) + (forward-char 1) + (te/current-tag)) + (te/current-text-node))))) + +(eval-after-load 'multiple-cursors-core + '(progn + (add-to-list 'mc/cursor-specific-vars 'te/master) + (add-to-list 'mc/cursor-specific-vars 'te/mirror))) + +;; todo: when concluding mc, must remove overlays for vanishing cursors +;; todo: don't lose overlays when creating new cursor + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; sgml-mode specific functions +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defvar te-sgml/self-closing-tag-types + '(empty jsp)) + +(defun te-sgml/point-inside-string? () + (nth 3 (syntax-ppss))) + +(defun te-sgml/tag-name-from-context (context) + (or (sgml-tag-name context) + (save-excursion + (forward-char 1) + (let ((beg (point))) + (search-forward-regexp "[ >]") + (buffer-substring-no-properties beg (- (point) 1)))))) + +(defun te-sgml/current-tag () + (ignore-errors + (save-excursion + (let* ((context (te-sgml/get-context)) + (name (te-sgml/tag-name-from-context context)) + (beg (sgml-tag-start context)) + (end (progn (te/skip-tag-forward) (point))) + (self-closing (if (memq (sgml-tag-type context) te-sgml/self-closing-tag-types) + :t :f))) + `((:name . ,(if self-closing (s-chop-suffix "/" name) name)) + (:self-closing . ,self-closing) + (:beg . ,beg) + (:end . ,end)))))) + +(defun te-sgml/get-context () + (when (looking-at "<") (forward-char 1)) + (let ((context (car (sgml-get-context)))) + (when (looking-at "\n\n" + (pp-to-string `(use-package ,name ,@args*)) + "\n ==>\n\n" + (pp-to-string + (macroexp-progn + (let ((use-package-verbose 'errors) + (use-package-expand-minimally t)) + (use-package-process-keywords name args* + (and (plist-get args* :demand) + (list :demand t))))))) + ""))) + (use-package-process-keywords name args* + (and (plist-get args* :demand) + (list :demand t))))) + +;;;###autoload +(defmacro use-package (name &rest args) + "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. + +: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', + `: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 Defer loading of a package until after any of the named + features are loaded. +:demand Prevent deferred loading in all cases. + +: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 `customize-set-variable' with each variable definition. +: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." + (declare (indent 1)) + (unless (memq :disabled args) + (macroexp-progn + (use-package-concat + (when use-package-compute-statistics + `((use-package-statistics-gather :use-package ',name nil))) + (if (eq use-package-verbose 'errors) + (use-package-core name args) + (condition-case-unless-debug err + (use-package-core name args) + (error + (ignore + (display-warning + 'use-package + (format "Failed to parse package %s: %s" + name (error-message-string err)) :error))))) + (when use-package-compute-statistics + `((use-package-statistics-gather :use-package ',name t))))))) + +(put 'use-package 'lisp-indent-function 'defun) + +(provide 'use-package-core) + +;; Local Variables: +;; indent-tabs-mode: nil +;; End: + +;;; use-package-core.el ends here diff --git a/elpa/use-package-20180715.1801/use-package-core.elc b/elpa/use-package-20180715.1801/use-package-core.elc new file mode 100644 index 0000000..184d440 Binary files /dev/null and b/elpa/use-package-20180715.1801/use-package-core.elc differ diff --git a/elpa/use-package-20180715.1801/use-package-delight.el b/elpa/use-package-20180715.1801/use-package-delight.el new file mode 100644 index 0000000..85d5c7c --- /dev/null +++ b/elpa/use-package-20180715.1801/use-package-delight.el @@ -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 +;; Maintainer: John Wiegley +;; 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 diff --git a/elpa/use-package-20180715.1801/use-package-delight.elc b/elpa/use-package-20180715.1801/use-package-delight.elc new file mode 100644 index 0000000..42b4005 Binary files /dev/null and b/elpa/use-package-20180715.1801/use-package-delight.elc differ diff --git a/elpa/use-package-20180715.1801/use-package-diminish.el b/elpa/use-package-20180715.1801/use-package-diminish.el new file mode 100644 index 0000000..1f3895f --- /dev/null +++ b/elpa/use-package-20180715.1801/use-package-diminish.el @@ -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 +;; Maintainer: John Wiegley +;; 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 diff --git a/elpa/use-package-20180715.1801/use-package-diminish.elc b/elpa/use-package-20180715.1801/use-package-diminish.elc new file mode 100644 index 0000000..409e542 Binary files /dev/null and b/elpa/use-package-20180715.1801/use-package-diminish.elc differ diff --git a/elpa/use-package-20180715.1801/use-package-ensure.el b/elpa/use-package-20180715.1801/use-package-ensure.el new file mode 100644 index 0000000..50005a9 --- /dev/null +++ b/elpa/use-package-20180715.1801/use-package-ensure.el @@ -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 +;; Maintainer: John Wiegley +;; 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 ( :pin )")))))))) + +(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 diff --git a/elpa/use-package-20180715.1801/use-package-ensure.elc b/elpa/use-package-20180715.1801/use-package-ensure.elc new file mode 100644 index 0000000..88128c9 Binary files /dev/null and b/elpa/use-package-20180715.1801/use-package-ensure.elc differ diff --git a/elpa/use-package-20180715.1801/use-package-jump.el b/elpa/use-package-20180715.1801/use-package-jump.el new file mode 100644 index 0000000..4044ad1 --- /dev/null +++ b/elpa/use-package-20180715.1801/use-package-jump.el @@ -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 +;; Maintainer: John Wiegley +;; 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 diff --git a/elpa/use-package-20180715.1801/use-package-jump.elc b/elpa/use-package-20180715.1801/use-package-jump.elc new file mode 100644 index 0000000..8bc753c Binary files /dev/null and b/elpa/use-package-20180715.1801/use-package-jump.elc differ diff --git a/elpa/use-package-20180715.1801/use-package-lint.el b/elpa/use-package-20180715.1801/use-package-lint.el new file mode 100644 index 0000000..c6e7c3c --- /dev/null +++ b/elpa/use-package-20180715.1801/use-package-lint.el @@ -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 +;; Maintainer: John Wiegley +;; 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 diff --git a/elpa/use-package-20180715.1801/use-package-lint.elc b/elpa/use-package-20180715.1801/use-package-lint.elc new file mode 100644 index 0000000..cc86871 Binary files /dev/null and b/elpa/use-package-20180715.1801/use-package-lint.elc differ diff --git a/elpa/use-package-20180715.1801/use-package-pkg.el b/elpa/use-package-20180715.1801/use-package-pkg.el new file mode 100644 index 0000000..e9364fd --- /dev/null +++ b/elpa/use-package-20180715.1801/use-package-pkg.el @@ -0,0 +1,13 @@ +(define-package "use-package" "20180715.1801" "A configuration macro for simplifying your .emacs" + '((emacs "24.3") + (bind-key "2.4")) + :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: diff --git a/elpa/use-package-20180715.1801/use-package.el b/elpa/use-package-20180715.1801/use-package.el new file mode 100644 index 0000000..1a8fff8 --- /dev/null +++ b/elpa/use-package-20180715.1801/use-package.el @@ -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 +;; Maintainer: John Wiegley +;; 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 diff --git a/elpa/use-package-20180715.1801/use-package.elc b/elpa/use-package-20180715.1801/use-package.elc new file mode 100644 index 0000000..bcd624c Binary files /dev/null and b/elpa/use-package-20180715.1801/use-package.elc differ diff --git a/elpa/vimish-fold-20180101.612/vimish-fold-autoloads.el b/elpa/vimish-fold-20180101.612/vimish-fold-autoloads.el new file mode 100644 index 0000000..d68041e --- /dev/null +++ b/elpa/vimish-fold-20180101.612/vimish-fold-autoloads.el @@ -0,0 +1,117 @@ +;;; vimish-fold-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "vimish-fold" "vimish-fold.el" (23391 65245 +;;;;;; 0 0)) +;;; Generated autoloads from vimish-fold.el + +(autoload 'vimish-fold "vimish-fold" "\ +Fold active region staring at BEG, ending at END. + +\(fn BEG END)" t nil) + +(autoload 'vimish-fold-unfold "vimish-fold" "\ +Delete all `vimish-fold--folded' overlays at point. + +\(fn)" t nil) + +(autoload 'vimish-fold-refold "vimish-fold" "\ +Refold unfolded fold at point. + +\(fn)" t nil) + +(autoload 'vimish-fold-delete "vimish-fold" "\ +Delete fold at point. + +\(fn)" t nil) + +(autoload 'vimish-fold-unfold-all "vimish-fold" "\ +Unfold all folds in current buffer. + +\(fn)" t nil) + +(autoload 'vimish-fold-refold-all "vimish-fold" "\ +Refold all closed folds in current buffer. + +\(fn)" t nil) + +(autoload 'vimish-fold-delete-all "vimish-fold" "\ +Delete all folds in current buffer. + +\(fn)" t nil) + +(autoload 'vimish-fold-toggle "vimish-fold" "\ +Toggle fold at point. + +\(fn)" t nil) + +(autoload 'vimish-fold-toggle-all "vimish-fold" "\ +Toggle all folds in current buffer. + +\(fn)" t nil) + +(autoload 'vimish-fold-avy "vimish-fold" "\ +Fold region of text between point and line selected with avy. + +This feature needs `avy' package. + +\(fn)" t nil) + +(autoload 'vimish-fold-next-fold "vimish-fold" "\ +Jump to next folded region in current buffer. + +\(fn)" t nil) + +(autoload 'vimish-fold-previous-fold "vimish-fold" "\ +Jump to previous folded region in current buffer. + +\(fn)" t nil) + +(autoload 'vimish-fold-mode "vimish-fold" "\ +Toggle `vimish-fold-mode' minor mode. + +With a prefix argument ARG, enable `vimish-fold-mode' mode if ARG +is positive, and disable it otherwise. If called from Lisp, +enable the mode if ARG is omitted or NIL, and toggle it if ARG is +`toggle'. + +This minor mode sets hooks so when you `find-file' it calls +`vimish-fold--restore-folds' and when you kill a file it calls +`vimish-fold--save-folds'. + +For globalized version of this mode see `vimish-gold-global-mode'. + +\(fn &optional ARG)" t nil) + +(defvar vimish-fold-global-mode nil "\ +Non-nil if Vimish-Fold-Global mode is enabled. +See the `vimish-fold-global-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `vimish-fold-global-mode'.") + +(custom-autoload 'vimish-fold-global-mode "vimish-fold" nil) + +(autoload 'vimish-fold-global-mode "vimish-fold" "\ +Toggle Vimish-Fold mode in all buffers. +With prefix ARG, enable Vimish-Fold-Global mode if ARG is positive; +otherwise, disable it. If called from Lisp, enable the mode if +ARG is omitted or nil. + +Vimish-Fold mode is enabled in all buffers where +`vimish-fold-mode' would do it. +See `vimish-fold-mode' for more information on Vimish-Fold mode. + +\(fn &optional ARG)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; vimish-fold-autoloads.el ends here diff --git a/elpa/vimish-fold-20180101.612/vimish-fold-pkg.el b/elpa/vimish-fold-20180101.612/vimish-fold-pkg.el new file mode 100644 index 0000000..f605f7a --- /dev/null +++ b/elpa/vimish-fold-20180101.612/vimish-fold-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "vimish-fold" "20180101.612" "Fold text like in Vim" '((emacs "24.4") (cl-lib "0.5") (f "0.18.0")) :commit "c904cd3e8515e76fb836615305e174369211f6df" :keywords '("convenience") :authors '(("Mark Karpov" . "markkarpov92@gmail.com")) :maintainer '("Mark Karpov" . "markkarpov92@gmail.com") :url "https://github.com/mrkkrp/vimish-fold") diff --git a/elpa/vimish-fold-20180101.612/vimish-fold.el b/elpa/vimish-fold-20180101.612/vimish-fold.el new file mode 100644 index 0000000..a3b709b --- /dev/null +++ b/elpa/vimish-fold-20180101.612/vimish-fold.el @@ -0,0 +1,535 @@ +;;; vimish-fold.el --- Fold text like in Vim -*- lexical-binding: t; -*- +;; +;; Copyright © 2015–2018 Mark Karpov +;; Copyright © 2012–2013 Magnar Sveen +;; +;; Author: Mark Karpov +;; Author: Magnar Sveen +;; URL: https://github.com/mrkkrp/vimish-fold +;; Package-Version: 20180101.612 +;; Version: 0.2.3 +;; Package-Requires: ((emacs "24.4") (cl-lib "0.5") (f "0.18.0")) +;; Keywords: convenience +;; +;; 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. +;; +;; You should have received a copy of the GNU General Public License along +;; with this program. If not, see . + +;;; Commentary: + +;; This is a package to perform text folding like in Vim. It has the +;; following features: +;; +;; * folding of active regions; +;; +;; * good visual feedback: it's obvious which part of text is folded; +;; +;; * persistence by default: when you kill a buffer your folds don't +;; disappear; +;; +;; * persistence scales well, you can work on hundreds of files with lots of +;; folds without adverse effects; +;; +;; * it does not break indentation; +;; +;; * folds can be toggled from folded state to unfolded and back very +;; easily; +;; +;; * quick navigation between existing folds; +;; +;; * you can use mouse to unfold folds (good for beginners and not only for +;; them); +;; +;; * for fans of `avy' package: you can use `avy' to fold text with minimal +;; number of key strokes! + +;;; Code: + +(require 'cl-lib) +(require 'f) + +(defgroup vimish-fold nil + "Fold text like in Vim" + :group 'text + :tag "Vimish Fold" + :prefix "vimish-fold-" + :link '(url-link :tag "GitHub" "https://github.com/mrkkrp/vimish-fold")) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Basic functionality + +(defface vimish-fold-overlay + '((t (:inherit highlight))) + "Face used to highlight the fold overlay.") + +(defface vimish-fold-mouse-face + '((t (:inherit highlight :weight bold))) + "Face to use when mouse hovers over folded text.") + +(defface vimish-fold-fringe + '((t (:inherit font-lock-function-name-face))) + "Face used to indicate folded text on fringe.") + +(defcustom vimish-fold-indication-mode 'left-fringe + "The indication mode for folded text areas. + +This variable may have one of the following values: +`left-fringe', `right-fringe', or NIL. + +If set to `left-fringe' or `right-fringe', indicate folded text +via icons in the left and right fringe respectively. + +If set to NIL, do not indicate folded text, just highlight it." + :tag "Indication on folded text" + :type '(choice (const :tag "Indicate in the left fringe" left-fringe) + (const :tag "Indicate in the right fringe" right-fringe) + (const :tag "Do not indicate" nil))) + +(defcustom vimish-fold-blank-fold-header "" + "The string is used as fold header when it consists of blank characters." + :tag "Header of Blank Fold" + :type 'string) + +(defcustom vimish-fold-header-width 80 + "Width of header of folded region. + +This can be a number or NIL. If it's NIL value returned of +`window-width' will be used." + :tag "Width of header of folded region" + :type '(choice (const :tag "use window width") + (integer :tag "width of fold header"))) + +(defcustom vimish-fold-show-lines t + "Whether to show number of lines folded in fold header." + :tag "Show number of lines folded" + :type 'boolean) + +(defcustom vimish-fold-include-last-empty-line nil + "Whether to include last empty line in selection into created fold." + :tag "Include last empty line into created fold" + :type 'boolean + :package-version '(vimish-fold . "0.2.1")) + +(defcustom vimish-fold-persist-on-saving t + "Whether to save folds on buffer saving. + +Other than on saving, folds are also saved on buffer killing and +when user quits Emacs. Turn this option off if the additional +overhead is undesirable." + :tag "Save folds on buffer saving." + :type 'boolean + :package-version '(vimish-fold . "0.2.3")) + +(defvar vimish-fold-folded-keymap (make-sparse-keymap) + "Keymap which is active when point is placed on folded text.") + +(defvar vimish-fold-unfolded-keymap (make-sparse-keymap) + "Keymap which is active when point is placed on unfolded text.") + +(defun vimish-fold--correct-region (beg end) + "Return a cons of corrected BEG and END. + +We only support folding by whole lines, so we should make sure +that beginning and end positions are correct. Also, sometimes +users select region including last newline into it, they don't +really want to include it, we correct this here." + (cl-destructuring-bind (beg . end) + (if (>= end beg) + (cons beg end) + (cons end beg)) + (save-excursion + (let* ((beg* (progn (goto-char beg) + (line-beginning-position))) + (end* (progn (goto-char end) + (if (and (zerop (current-column)) + (/= end beg*) + (not vimish-fold-include-last-empty-line)) + (1- end) + (line-end-position))))) + (cons beg* end*))))) + +(defun vimish-fold--read-only (on beg end) + "If ON is non-NIL, make text between BEG and END read-only. + +If ON is NIL, make the text editable again." + (let ((inhibit-read-only t)) + (with-silent-modifications + (funcall + (if on #'add-text-properties #'remove-text-properties) + beg end (list 'read-only on))))) + +(defun vimish-fold--get-header (beg end) + "Extract folding header from region between BEG and END in BUFFER. + +If BUFFER is NIL, current buffer is used." + (let ((info (when vimish-fold-show-lines + (format " %d lines" (count-lines beg end))))) + (save-excursion + (goto-char beg) + (re-search-forward "^\\([[:blank:]]*.+\\)$") + (concat + (truncate-string-to-width + (if (and (>= (match-beginning 1) beg) + (<= (match-end 1) end)) + (match-string-no-properties 1) + vimish-fold-blank-fold-header) + (- (or vimish-fold-header-width + (window-width)) + (length info)) + nil + 32 ; space + "…") + info)))) + +(defun vimish-fold--setup-fringe (overlay &optional prefix) + "Setup fringe for OVERLAY according to user settings. + +If PREFIX is not NIL, setup fringe for every line." + (when vimish-fold-indication-mode + (unless (memq vimish-fold-indication-mode + '(left-fringe right-fringe)) + (error "Invalid fringe side: %S" + vimish-fold-indication-mode)) + (overlay-put overlay (if prefix 'line-prefix 'before-string) + (propertize "…" 'display + (list vimish-fold-indication-mode + 'empty-line + 'vimish-fold-fringe))))) + +(defun vimish-fold--apply-cosmetic (overlay header) + "Make OVERLAY look according to user's settings displaying HEADER. + +This includes fringe bitmaps and faces." + (overlay-put overlay 'display + (propertize header 'face 'vimish-fold-overlay)) + (overlay-put overlay 'pointer 'hand) + (overlay-put overlay 'mouse-face 'vimish-fold-mouse-face) + (overlay-put overlay 'help-echo "Click to unfold the text") + (vimish-fold--setup-fringe overlay)) + +(defun vimish-fold--vimish-overlay-p (overlay) + "Detect if given OVERLAY is created by this package." + (memq (overlay-get overlay 'type) + '(vimish-fold--folded + vimish-fold--unfolded))) + +;;;###autoload +(defun vimish-fold (beg end) + "Fold active region staring at BEG, ending at END." + (interactive "r") + (deactivate-mark) + (cl-destructuring-bind (beg . end) (vimish-fold--correct-region beg end) + (when (< (count-lines beg end) 2) + (error "Nothing to fold")) + (dolist (overlay (overlays-in beg end)) + (when (vimish-fold--vimish-overlay-p overlay) + (goto-char (overlay-start overlay)) + (error "Fold already exists here"))) + (vimish-fold--read-only t (max 1 (1- beg)) end) + (let ((overlay (make-overlay beg end nil t nil))) + (overlay-put overlay 'type 'vimish-fold--folded) + (overlay-put overlay 'evaporate t) + (overlay-put overlay 'keymap vimish-fold-folded-keymap) + (vimish-fold--apply-cosmetic overlay (vimish-fold--get-header beg end))) + (goto-char beg))) + +(defun vimish-fold--unfold (overlay) + "Unfold fold found by its OVERLAY type `vimish-fold--folded'." + (when (eq (overlay-get overlay 'type) 'vimish-fold--folded) + (let ((beg (overlay-start overlay)) + (end (overlay-end overlay))) + (vimish-fold--read-only nil (max 1 (1- beg)) end) + (delete-overlay overlay) + (let ((unfolded (make-overlay beg end nil t nil))) + (overlay-put unfolded 'type 'vimish-fold--unfolded) + (overlay-put unfolded 'evaporate t) + (overlay-put unfolded 'keymap vimish-fold-unfolded-keymap) + (vimish-fold--setup-fringe unfolded t))))) + +;;;###autoload +(defun vimish-fold-unfold () + "Delete all `vimish-fold--folded' overlays at point." + (interactive) + (mapc #'vimish-fold--unfold (overlays-at (point)))) + +(define-key vimish-fold-folded-keymap (kbd "") #'vimish-fold-unfold) +(define-key vimish-fold-folded-keymap (kbd "C-`") #'vimish-fold-unfold) + +(defun vimish-fold--refold (overlay) + "Refold fold found by its OVERLAY type `vimish-fold--unfolded'." + (when (eq (overlay-get overlay 'type) 'vimish-fold--unfolded) + (let* ((beg (overlay-start overlay)) + (end (overlay-end overlay))) + (delete-overlay overlay) + (vimish-fold beg end)))) + +;;;###autoload +(defun vimish-fold-refold () + "Refold unfolded fold at point." + (interactive) + (mapc #'vimish-fold--refold (overlays-at (point)))) + +(define-key vimish-fold-unfolded-keymap (kbd "C-`") #'vimish-fold-refold) + +(defun vimish-fold--delete (overlay) + "Internal function used to delete folds represented by OVERLAY. + +If OVERLAY does not represent a fold, it's ignored." + (when (vimish-fold--vimish-overlay-p overlay) + (when (eq (overlay-get overlay 'type) + 'vimish-fold--folded) + (vimish-fold--read-only + nil + (max 1 (1- (overlay-start overlay))) + (overlay-end overlay))) + (delete-overlay overlay))) + +;;;###autoload +(defun vimish-fold-delete () + "Delete fold at point." + (interactive) + (mapc #'vimish-fold--delete (overlays-at (point)))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Extra features + +(defun vimish-fold--folds-in (beg end) + "Return all folds exiting between BEG and END in current buffer." + (cl-remove-if-not + #'vimish-fold--vimish-overlay-p + (overlays-in beg end))) + +;;;###autoload +(defun vimish-fold-unfold-all () + "Unfold all folds in current buffer." + (interactive) + (mapc #'vimish-fold--unfold + (vimish-fold--folds-in + (point-min) + (point-max)))) + +;;;###autoload +(defun vimish-fold-refold-all () + "Refold all closed folds in current buffer." + (interactive) + (save-excursion ; after folding cursor jumps to beginning of fold + (mapc #'vimish-fold--refold + (vimish-fold--folds-in + (point-min) + (point-max))))) + +;;;###autoload +(defun vimish-fold-delete-all () + "Delete all folds in current buffer." + (interactive) + (mapc #'vimish-fold--delete + (vimish-fold--folds-in + (point-min) + (point-max)))) + +(defun vimish-fold--toggle (overlay) + "Unfold or refold fold represented by OVERLAY depending on its type." + (when (vimish-fold--vimish-overlay-p overlay) + (save-excursion + (goto-char (overlay-start overlay)) + (if (eq (overlay-get overlay 'type) + 'vimish-fold--folded) + (vimish-fold-unfold) + (vimish-fold-refold))))) + +;;;###autoload +(defun vimish-fold-toggle () + "Toggle fold at point." + (interactive) + (mapc #'vimish-fold--toggle (overlays-at (point)))) + +;;;###autoload +(defun vimish-fold-toggle-all () + "Toggle all folds in current buffer." + (interactive) + (mapc #'vimish-fold--toggle + (vimish-fold--folds-in + (point-min) + (point-max)))) + +(declare-function avy-goto-line "ext:avy") + +;;;###autoload +(defun vimish-fold-avy () + "Fold region of text between point and line selected with avy. + +This feature needs `avy' package." + (interactive) + (if (require 'avy nil t) + (let ((beg (point)) + (end (let (avy-all-windows) + (ignore avy-all-windows) + (call-interactively #'avy-goto-line) + (point)))) + (vimish-fold beg end)) + (message "Package ‘avy’ is unavailable"))) + +;;;###autoload +(defun vimish-fold-next-fold () + "Jump to next folded region in current buffer." + (interactive) + (let ((folds-after-point + (cl-nset-difference + (vimish-fold--folds-in (point) (point-max)) + (overlays-at (point))))) + (if folds-after-point + (goto-char + (cl-reduce + #'min + (mapcar + #'overlay-start + folds-after-point))) + (message "No more folds after point")))) + +;;;###autoload +(defun vimish-fold-previous-fold () + "Jump to previous folded region in current buffer." + (interactive) + (let ((folds-before-point + (cl-nset-difference + (vimish-fold--folds-in (point-min) (point)) + (overlays-at (point))))) + (if folds-before-point + (goto-char + (cl-reduce + #'max + (mapcar + #'overlay-start + folds-before-point))) + (message "No more folds before point")))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Persistence + +(defcustom vimish-fold-dir + (file-name-as-directory (f-expand "vimish-fold" user-emacs-directory)) + "The directory where Vimish Fold keeps its files. + +The string should end with a slash. If it doesn't exist, it will +be created automatically." + :tag "Directory for Folding Info" + :type 'directory) + +(defun vimish-fold--make-file-name (file) + "Return path to file where information about folding in FILE is written." + (f-expand + (replace-regexp-in-string + (regexp-opt (list (f-path-separator) ":")) "!" file) + vimish-fold-dir)) + +(defun vimish-fold--restore-from (list) + "Restore folds in current buffer form LIST. + +Elements of LIST should be of the following form: + + (BEG END &optional UNFOLDED)" + (save-excursion + (dolist (item list) + (cl-destructuring-bind (beg end . rest) item + (funcall #'vimish-fold beg end) + (when (car rest) + (goto-char beg) + (vimish-fold-unfold)))))) + +(defun vimish-fold--save-folds (&optional buffer-or-name) + "Save folds in BUFFER-OR-NAME, which should have associated file. + +BUFFER-OR-NAME defaults to current buffer." + (with-current-buffer (or buffer-or-name (current-buffer)) + (let ((filename (buffer-file-name)) + regions) + (when filename + (dolist (overlay (overlays-in (point-min) (point-max))) + (when (vimish-fold--vimish-overlay-p overlay) + (push (list (overlay-start overlay) + (overlay-end overlay) + (eq (overlay-get overlay 'type) + 'vimish-fold--unfolded)) + regions))) + (let ((fold-file (vimish-fold--make-file-name filename))) + (if regions + (with-temp-buffer + (pp regions (current-buffer)) + (let ((version-control 'never)) + (condition-case nil + (progn + (apply #'f-mkdir (f-split vimish-fold-dir)) + (write-region (point-min) (point-max) fold-file) + (message nil)) + (file-error + (message "Vimish Fold: can't write %s" fold-file))) + (kill-buffer (current-buffer)))) + (when (f-exists? fold-file) + (f-delete fold-file)))))))) + +(defun vimish-fold--restore-folds (&optional buffer-or-name) + "Restore folds in BUFFER-OR-NAME, if they have been saved. + +BUFFER-OR-NAME defaults to current buffer. + +Return T is some folds have been restored and NIL otherwise." + (with-current-buffer (or buffer-or-name (current-buffer)) + (let ((filename (buffer-file-name))) + (when (and filename + (null (vimish-fold--folds-in + (point-min) + (point-max)))) + (let ((fold-file (vimish-fold--make-file-name filename))) + (when (and fold-file (f-readable? fold-file)) + (vimish-fold--restore-from + (with-temp-buffer + (insert-file-contents fold-file) + (read (buffer-string)))))))))) + +(defun vimish-fold--kill-emacs-hook () + "Traverse all buffers and try to save their folds." + (mapc #'vimish-fold--save-folds (buffer-list))) + +;;;###autoload +(define-minor-mode vimish-fold-mode + "Toggle `vimish-fold-mode' minor mode. + +With a prefix argument ARG, enable `vimish-fold-mode' mode if ARG +is positive, and disable it otherwise. If called from Lisp, +enable the mode if ARG is omitted or NIL, and toggle it if ARG is +`toggle'. + +This minor mode sets hooks so when you `find-file' it calls +`vimish-fold--restore-folds' and when you kill a file it calls +`vimish-fold--save-folds'. + +For globalized version of this mode see `vimish-gold-global-mode'." + :global nil + (let ((fnc (if vimish-fold-mode #'add-hook #'remove-hook))) + (funcall fnc 'find-file-hook #'vimish-fold--restore-folds) + (funcall fnc 'kill-buffer-hook #'vimish-fold--save-folds) + (funcall fnc 'kill-emacs-hook #'vimish-fold--kill-emacs-hook) + (when vimish-fold-persist-on-saving + (funcall fnc 'before-save-hook #'vimish-fold--save-folds)))) + +;;;###autoload +(define-globalized-minor-mode vimish-fold-global-mode + vimish-fold-mode vimish-fold-mode) + +(provide 'vimish-fold) + +;;; vimish-fold.el ends here diff --git a/elpa/vimish-fold-20180101.612/vimish-fold.elc b/elpa/vimish-fold-20180101.612/vimish-fold.elc new file mode 100644 index 0000000..9883996 Binary files /dev/null and b/elpa/vimish-fold-20180101.612/vimish-fold.elc differ diff --git a/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode-autoloads.el b/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode-autoloads.el new file mode 100644 index 0000000..447cb57 --- /dev/null +++ b/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode-autoloads.el @@ -0,0 +1,30 @@ +;;; visual-ascii-mode-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "visual-ascii-mode" "visual-ascii-mode.el" +;;;;;; (23391 65244 0 0)) +;;; Generated autoloads from visual-ascii-mode.el + +(autoload 'visual-ascii-mode "visual-ascii-mode" "\ +Visualize ascii code on buffer. + +\(fn &optional ARG)" t nil) + +(autoload 'turn-on-visual-ascii-mode "visual-ascii-mode" "\ +Turn on visual-ascii-mode. + +\(fn)" nil nil) + +(autoload 'global-visual-ascii-mode "visual-ascii-mode" "\ +The globlized visual-ascii-mode" t) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; visual-ascii-mode-autoloads.el ends here diff --git a/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode-pkg.el b/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode-pkg.el new file mode 100644 index 0000000..54b30f6 --- /dev/null +++ b/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "visual-ascii-mode" "20150129.1046" "Visualize ascii code (small integer) on buffer." 'nil :commit "99285a099a17472ddd9f1b4f74e9d092dd8c5947" :keywords '("presentation") :authors '(("Dewdrops" . "v_v_4474@126.com")) :maintainer '("Dewdrops" . "v_v_4474@126.com") :url "https://github.com/Dewdrops/visual-ascii-mode") diff --git a/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode.el b/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode.el new file mode 100644 index 0000000..0aa4a1f --- /dev/null +++ b/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode.el @@ -0,0 +1,206 @@ +;;; visual-ascii-mode.el --- Visualize ascii code (small integer) on buffer. + +;; Copyright (C) 2015 by Dewdrops + +;; Author: Dewdrops +;; URL: https://github.com/Dewdrops/visual-ascii-mode +;; Package-Version: 20150129.1046 +;; Version: 0.1 +;; Keywords: presentation +;; Package-Requires: + +;; This file is NOT part of GNU Emacs. + +;;; License: +;; + +;; 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 . + +;;; Commentary: +;; +;; Installation: +;; +;; Use Melpa(https://github.com/milkypostman/melpa) or just put +;; visual-ascii-mode.el somewhere in your load-path and add these lines to your +;; .emacs: +;; (require 'visual-ascii-mode) +;; +;; Usage: +;; Type `M-x visual-ascii-mode' to enable visual-ascii-mode in current buffer. + +;;; Code: + + +(defgroup visual-ascii-mode nil + "Visualize ascii code on buffer" + :prefix "visual-ascii-mode" + :group 'Convenience) + +(defcustom visual-ascii-mode-show-unicode nil + "Non-nil means that any integer less than (`max-char') will be recognized as + unicode and be visualized." + :type 'boolean + :group 'visual-ascii-mode) + +(defcustom visual-ascii-mode-display-in-comment nil + "Non-nil means that ascii code inside comment or string will be visualized." + :type 'boolean + :group 'visual-ascii-mode) + +(defcustom visual-ascii-mode-show-unprintable-character t + "This variable controls whether/how to display unprintable characters. + +t means to show control characters in C-what style (which returned by `single-key-description'), +`abbrev' means to use ASCII control code abbreviation, +nil means not to display unprintable character." + :type 'symbol + :group 'visual-ascii-mode) + +(defface visual-ascii-mode-printable-face + '((t (:foreground "white" :background "red"))) + "Face used in visual-ascii-mode for printable characters" + :group 'visual-ascii-mode) + +(defface visual-ascii-mode-unprintable-face + '((t (:foreground "black" :background "DeepSkyBlue"))) + "Face used in visual-ascii-mode for printable characters" + :group 'visual-ascii-mode) + +(defvar visual-ascii-mode/number2ascii + ["NUL" "SOH" "STX" "ETX" "EOT" "ENQ" "ACK" "BEL" "BS" "HT" + "LF" "VT" "FF" "CR" "SO" "SI" "DLE" "DC1" "DC2" "DC3" + "DC4" "NAK" "SYN" "ETB" "CAN" "EM" "SUB" "ESC" "FS" "GS" + "RS" "US" "SPC" "!" "\"" "#" "$" "%" "&" "'" + "(" ")" "*" "+" "," "-" "." "/" "0" "1" + "2" "3" "4" "5" "6" "7" "8" "9" ":" ";" + "<" "=" ">" "?" "@" "A" "B" "C" "D" "E" + "F" "G" "H" "I" "j" "k" "L" "M" "N" "O" + "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" + "Z" "[" "\\" "]" "^" "_" "`" "a" "b" "c" + "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" + "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" + "x" "y" "z" "{" "|" "}" "~" "DEL"]) + +(defvar visual-ascii-mode/number-regexp + "\\b\\(?:0[xX][0-9a-fA-F]+\\|[0-9]+\\)\\b") + +(defvar visual-ascii-mode/overlays nil) + + +(defun visual-ascii-mode/render () + "Render ascii characters." + (dolist (ov visual-ascii-mode/overlays) + (overlay-put ov + 'after-string + (overlay-get ov 'visual-ascii-str)))) + +(defun visual-ascii-mode/cleanup () + "Clean visual-ascii-mode overlays." + (dolist (ov visual-ascii-mode/overlays) + (delete-overlay ov)) + (setq visual-ascii-mode/overlays nil)) + +(defun visual-ascii-mode/handler () + "Handler called in `post-command-hook'." + (visual-ascii-mode/cleanup) + (visual-ascii-mode/populate-overlays (window-start) (window-end)) + (visual-ascii-mode/render)) + +(defun visual-ascii-mode/comment-or-string-p () + "Determine whether inside string/comment cntext." + (memq (syntax-ppss-context (syntax-ppss)) '(comment string))) + +(defun visual-ascii-mode/populate-overlays (beg end) + "Prepare all overlays to be displayed." + (save-excursion + (goto-char beg) + (while (re-search-forward visual-ascii-mode/number-regexp end t) + (when (and (or visual-ascii-mode-display-in-comment + (not (visual-ascii-mode/comment-or-string-p))) + (let ((inhibit-changing-match-data t)) + (save-excursion + (goto-char (match-beginning 0)) + (looking-back "^\\|[^0-9a-zA-Z.+-]"))) + (looking-at-p "$\\|[^0-9a-zA-Z.+-]")) + (visual-ascii-mode/make-overlay (match-beginning 0) + (match-end 0)))))) + +(defun visual-ascii-mode/str2num (s) + "Convert string to integer." + (ignore-errors + (if (string-match-p "0[xX]" s) + (string-to-number (substring s 2) 16) + (string-to-number s)))) + +(defun visual-ascii-mode/make-overlay (beg end) + "Make overlay for the number between BEG and END." + (let ((n (visual-ascii-mode/str2num (buffer-substring-no-properties beg end)))) + (when (and (integerp n) (>= n 0)) + (let ((printable (and + (characterp n) + (aref printable-chars n))) + (desc + (cond + ((and (eq visual-ascii-mode-show-unprintable-character 'abbrev) + (< n 128)) + (aref visual-ascii-mode/number2ascii n)) + ((or (< n 128) + (and visual-ascii-mode-show-unicode + (characterp n)) + (and visual-ascii-mode-show-unprintable-character + ;; 260046848 = 0b1111110000000000000000000000 + (logand 260046848 n) + ;; 4194303 = 0b1111111111111111111111 + (< (logand 4194303 n) 128))) + (single-key-description n))))) + (when desc + (let ((ov (make-overlay beg end)) + (face (if printable + 'visual-ascii-mode-printable-face + 'visual-ascii-mode-unprintable-face))) + (overlay-put ov + 'visual-ascii-str + (propertize desc + 'face face)) + (add-to-list 'visual-ascii-mode/overlays ov))))))) + +;;;###autoload +(define-minor-mode visual-ascii-mode + "Visualize ascii code on buffer." + :lighter "" + (if visual-ascii-mode + (progn + (add-hook 'post-command-hook 'visual-ascii-mode/handler t 'local) + (visual-ascii-mode/populate-overlays (window-start) (window-end)) + (visual-ascii-mode/render)) + (progn + (remove-hook 'post-command-hook 'visual-ascii-mode/handler 'local) + (visual-ascii-mode/cleanup)))) + +;;;###autoload +(defun turn-on-visual-ascii-mode () + "Turn on visual-ascii-mode." + (unless (minibufferp) + (visual-ascii-mode 1))) + +(define-globalized-minor-mode global-visual-ascii-mode + visual-ascii-mode turn-on-visual-ascii-mode) + +;;;###autoload +(autoload 'global-visual-ascii-mode "visual-ascii-mode" + "The globlized visual-ascii-mode" t) + + +(provide 'visual-ascii-mode) +;;; visual-ascii-mode.el ends here diff --git a/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode.elc b/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode.elc new file mode 100644 index 0000000..fd7722a Binary files /dev/null and b/elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode.elc differ diff --git a/elpa/visual-fill-column-20180727.2225/visual-fill-column-autoloads.el b/elpa/visual-fill-column-20180727.2225/visual-fill-column-autoloads.el new file mode 100644 index 0000000..ad2f265 --- /dev/null +++ b/elpa/visual-fill-column-20180727.2225/visual-fill-column-autoloads.el @@ -0,0 +1,57 @@ +;;; visual-fill-column-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "visual-fill-column" "visual-fill-column.el" +;;;;;; (23391 65243 0 0)) +;;; Generated autoloads from visual-fill-column.el + +(autoload 'visual-fill-column-mode "visual-fill-column" "\ +Wrap lines according to `fill-column' in `visual-line-mode'. + +\(fn &optional ARG)" t nil) + +(defvar global-visual-fill-column-mode nil "\ +Non-nil if Global Visual-Fill-Column mode is enabled. +See the `global-visual-fill-column-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `global-visual-fill-column-mode'.") + +(custom-autoload 'global-visual-fill-column-mode "visual-fill-column" nil) + +(autoload 'global-visual-fill-column-mode "visual-fill-column" "\ +Toggle Visual-Fill-Column mode in all buffers. +With prefix ARG, enable Global Visual-Fill-Column mode if ARG is positive; +otherwise, disable it. If called from Lisp, enable the mode if +ARG is omitted or nil. + +Visual-Fill-Column mode is enabled in all buffers where +`turn-on-visual-fill-column-mode' would do it. +See `visual-fill-column-mode' for more information on Visual-Fill-Column mode. + +\(fn &optional ARG)" t nil) + +(autoload 'visual-fill-column-split-window-sensibly "visual-fill-column" "\ +Split WINDOW sensibly, unsetting its margins first. +This function unsets the window margins and calls +`split-window-sensibly'. + +By default, `split-window-sensibly' does not split a window +vertically if it has wide margins, even if there is enough space +for a vertical split. This function can be used as the value of +`split-window-preferred-function' to enable vertically splitting +windows with wide margins. + +\(fn &optional WINDOW)" nil nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; visual-fill-column-autoloads.el ends here diff --git a/elpa/visual-fill-column-20180727.2225/visual-fill-column-pkg.el b/elpa/visual-fill-column-20180727.2225/visual-fill-column-pkg.el new file mode 100644 index 0000000..3f7460c --- /dev/null +++ b/elpa/visual-fill-column-20180727.2225/visual-fill-column-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "visual-fill-column" "20180727.2225" "fill-column for visual-line-mode" '((emacs "24.3")) :commit "ca65ed65d27bdce189bbb15f58399a682aa6f02b" :authors '(("Joost Kremers" . "joostkremers@fastmail.fm")) :maintainer '("Joost Kremers" . "joostkremers@fastmail.fm")) diff --git a/elpa/visual-fill-column-20180727.2225/visual-fill-column.el b/elpa/visual-fill-column-20180727.2225/visual-fill-column.el new file mode 100644 index 0000000..55509bc --- /dev/null +++ b/elpa/visual-fill-column-20180727.2225/visual-fill-column.el @@ -0,0 +1,207 @@ +;;; visual-fill-column.el --- fill-column for visual-line-mode -*- lexical-binding: t -*- + +;; Copyright (C) 2015-2018 Joost Kremers +;; Copyright (C) 2016 Martin Rudalics +;; All rights reserved. + +;; Author: Joost Kremers +;; Maintainer: Joost Kremers +;; Created: 2015 +;; Version: 1.9 +;; Package-Version: 20180727.2225 +;; Package-Requires: ((emacs "24.3")) + +;; This file is NOT part of GNU Emacs. + +;; visual-fill-column 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. + +;; visual-fill-column 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. If not, see . + +;;; Commentary: + +;; `visual-fill-column-mode' is a small Emacs minor mode that mimics the effect of `fill-column' +;; in `visual-line-mode'. Instead of wrapping lines at the window edge, which +;; is the standard behaviour of `visual-line-mode', it wraps lines at +;; `fill-column'. If `fill-column' is too large for the window, the text is +;; wrapped at the window edge. + +;;; Code: + +(defgroup visual-fill-column nil "Wrap lines according to `fill-column' in `visual-line-mode'." + :group 'wp + :prefix "visual-fill-column-") + +(defcustom visual-fill-column-width nil + "Width of the text area. +By default, the global value of `fill-column' is used, but if +this option is set to a value, it is used instead." + :group 'visual-fill-column + :type '(choice (const :tag "Use `fill-column'" :value nil) + (integer :tag "Specify width" :value 70))) +(make-variable-buffer-local 'visual-fill-column-width) +(put 'visual-fill-column-width 'safe-local-variable 'numberp) + +(defcustom visual-fill-column-fringes-outside-margins t + "Put the fringes outside the margins." + :group 'visual-fill-column + :type '(choice (const :tag "Put fringes outside the margins" t) + (const :tag "Keep the fringes inside the margins" nil))) +(make-variable-buffer-local 'visual-fill-column-fringes-outside-margins) +(put 'visual-fill-column-fringes-outside-margins 'safe-local-variable 'symbolp) + +(defcustom visual-fill-column-center-text nil + "If set, center the text area in the window." + :group 'visual-fill-column + :type '(choice (const :tag "Display text area at window margin" nil) + (const :tag "Center text area" t))) +(make-variable-buffer-local 'visual-fill-column-center-text) +(put 'visual-fill-column-center-text 'safe-local-variable 'symbolp) + +;;;###autoload +(define-minor-mode visual-fill-column-mode + "Wrap lines according to `fill-column' in `visual-line-mode'." + :init-value nil :lighter nil :global nil + (if visual-fill-column-mode + (visual-fill-column-mode--enable) + (visual-fill-column-mode--disable))) + +;;;###autoload +(define-globalized-minor-mode global-visual-fill-column-mode visual-fill-column-mode turn-on-visual-fill-column-mode + :require 'visual-fill-column-mode + :group 'visual-fill-column) + +(defun turn-on-visual-fill-column-mode () + "Turn on `visual-fill-column-mode'. +Note that `visual-fill-column-mode' is only turned on in buffers +in which Visual Line mode is active as well, and only in buffers +that actually visit a file." + (when (and visual-line-mode + buffer-file-name) + (visual-fill-column-mode 1))) + +(defun visual-fill-column-mode--enable () + "Set up `visual-fill-column-mode' for the current buffer." + (add-hook 'window-configuration-change-hook #'visual-fill-column--adjust-window 'append 'local) + (visual-fill-column--adjust-window)) + +(defun visual-fill-column-mode--disable () + "Disable `visual-fill-column-mode' for the current buffer." + (remove-hook 'window-configuration-change-hook #'visual-fill-column--adjust-window 'local) + (set-window-fringes (get-buffer-window (current-buffer)) nil) + (set-window-margins (get-buffer-window (current-buffer)) nil)) + +(defun visual-fill-column-split-window (&optional window size side pixelwise) + "Split WINDOW, unsetting its margins first. +SIZE, SIDE, and PIXELWISE are passed on to `split-window'. This +function is for use in the window parameter `split-window'." + (let ((horizontal (memq side '(t left right))) + margins new) + (when horizontal + ;; Reset margins. + (setq margins (window-margins window)) + (set-window-margins window nil)) + ;; Now try to split the window. + (set-window-parameter window 'split-window nil) + (unwind-protect + (setq new (split-window window size side pixelwise)) + (set-window-parameter window 'split-window #'visual-fill-column-split-window) + ;; Restore old margins if we failed. + (when (and horizontal (not new)) + (set-window-margins window (car margins) (cdr margins)))))) + +;;;###autoload +(defun visual-fill-column-split-window-sensibly (&optional window) + "Split WINDOW sensibly, unsetting its margins first. +This function unsets the window margins and calls +`split-window-sensibly'. + +By default, `split-window-sensibly' does not split a window +vertically if it has wide margins, even if there is enough space +for a vertical split. This function can be used as the value of +`split-window-preferred-function' to enable vertically splitting +windows with wide margins." + (let ((margins (window-margins window)) + new) + ;; unset the margins and try to split the window + (when (buffer-local-value 'visual-fill-column-mode (window-buffer window)) + (set-window-margins window nil)) + (unwind-protect + (setq new (split-window-sensibly window)) + (when (not new) + (set-window-margins window (car margins) (cdr margins)))))) + +(defun visual-fill-column--adjust-window () + "Adjust the window margins and fringes." + ;; Only run when we're really looking at a buffer that has v-f-c-mode enabled. See #22. + (when (buffer-local-value 'visual-fill-column-mode (window-buffer (selected-window))) + (set-window-fringes (get-buffer-window (current-buffer)) nil nil visual-fill-column-fringes-outside-margins) + (if (>= emacs-major-version 25) + (set-window-parameter (get-buffer-window (current-buffer)) 'split-window #'visual-fill-column-split-window)) + (visual-fill-column--set-margins))) + +(defun visual-fill-column-adjust (&optional _inc) + "Adjust the window margins and fringes. +This function is for use as advice to `text-scale-adjust'. It +calls `visual-fill-column--adjust-window', but only if +`visual-fill-column' is active." + (if visual-fill-column-mode + (visual-fill-column--adjust-window))) + +(defun visual-fill-column--window-max-text-width (&optional window) + "Return the maximum possible text width of WINDOW. +The maximum possible text width is the width of the current text +area plus the margins, but excluding the fringes, scroll bar and +right divider. WINDOW defaults to the selected window. The +return value is scaled to account for `text-scale-mode-amount' +and `text-scale-mode-step'." + (or window (setq window (get-buffer-window (current-buffer)))) + (let* ((margins (window-margins window)) + (buffer (window-buffer window)) + (scale (if (and (boundp 'text-scale-mode-step) + (boundp 'text-scale-mode-amount)) + (with-current-buffer buffer + (expt text-scale-mode-step + text-scale-mode-amount)) + 1.0))) + (truncate (/ (+ (window-width window) + (or (car margins) 0) + (or (cdr margins) 0)) + (float scale))))) + +(defun visual-fill-column--set-margins () + "Set window margins for the current window." + ;; calculate left & right margins + (let* ((window (get-buffer-window (current-buffer))) + (total-width (visual-fill-column--window-max-text-width window)) + (width (or visual-fill-column-width + fill-column)) + (margins (if (< (- total-width width) 0) ; margins must be >= 0 + 0 + (- total-width width))) + (left (if visual-fill-column-center-text + (/ margins 2) + 0)) + (right (if visual-fill-column-center-text + (/ margins 2) + margins))) + + ;; put an explicitly R2L buffer on the right side of the window + (when (and (eq bidi-paragraph-direction 'right-to-left) + (= left 0)) + (setq left right) + (setq right 0)) + + (set-window-margins window left right))) + +(provide 'visual-fill-column) + +;;; visual-fill-column.el ends here diff --git a/elpa/visual-fill-column-20180727.2225/visual-fill-column.elc b/elpa/visual-fill-column-20180727.2225/visual-fill-column.elc new file mode 100644 index 0000000..9f06d8a Binary files /dev/null and b/elpa/visual-fill-column-20180727.2225/visual-fill-column.elc differ diff --git a/elpa/wc-mode-20170126.2029/wc-mode-autoloads.el b/elpa/wc-mode-20170126.2029/wc-mode-autoloads.el deleted file mode 100644 index 1f4ec8a..0000000 --- a/elpa/wc-mode-20170126.2029/wc-mode-autoloads.el +++ /dev/null @@ -1,37 +0,0 @@ -;;; wc-mode-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "wc-mode" "wc-mode.el" (23291 47246 0 0)) -;;; Generated autoloads from wc-mode.el - -(autoload 'wc-mode "wc-mode" "\ -Toggle wc mode With no argument, this command toggles the -mode. Non-null prefix argument turns on the mode. Null prefix -argument turns off the mode. - -When Wc mode is enabled on a buffer, it counts the current words -in the buffer and keeps track of a differential of added or -subtracted words. - -A goal of number of words added/subtracted can be set while using -this mode. Upon completion of the goal, the modeline text will -highlight indicating that the goal has been reached. - -Commands: -\\{wc-mode-map} - -Entry to this mode calls the value of `wc-mode-hook' if that -value is non-nil. - -\(fn &optional ARG)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; wc-mode-autoloads.el ends here diff --git a/elpa/wc-mode-20170126.2029/wc-mode-pkg.el b/elpa/wc-mode-20170126.2029/wc-mode-pkg.el deleted file mode 100644 index b10ecf6..0000000 --- a/elpa/wc-mode-20170126.2029/wc-mode-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "wc-mode" "20170126.2029" "Running word count with goals (minor mode)" 'nil :commit "f218f42709a651b34d6c1ddd98856f44648ef707" :url "https://github.com/bnbeckwith/wc-mode") diff --git a/elpa/wc-mode-20170126.2029/wc-mode.el b/elpa/wc-mode-20170126.2029/wc-mode.el deleted file mode 100644 index 24b829b..0000000 --- a/elpa/wc-mode-20170126.2029/wc-mode.el +++ /dev/null @@ -1,325 +0,0 @@ -;;; wc-mode.el --- Running word count with goals (minor mode) -;; -;; Author: Benjamin Beckwith -;; Created: 2010-6-19 -;; Version: 1.3 -;; Package-Version: 20170126.2029 -;; Last-Updated: 2016-10-31 -;; URL: https://github.com/bnbeckwith/wc-mode -;; Keywords: -;; Compatability: -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Commentary: -;; -;; Read the following for how to use the 'how-many' function -;; http://www.neverfriday.com/sweetfriday/2008/06/emacs-tip-word-counting-with-a.html -;; The following site had a good idea on how to produce number of chars -;; http://xahlee.org/emacs/elisp_count-region.html -;; Inspired by http://750words.com -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Change Log: -;; -;; 1.3 Goal functions now perform reset by default -;; 1.2 Reset functions added -;; 1.1 Counting functions tied to buffer-local variables -;; This allows customization of the counting methods -;; 1.0 Keystrokes for all goals added. -;; Hooks variable added. -;; In-code documentation updated. -;; 0.9 Added keymap for basic mode features/functions -;; 0.8 Added modeline format customization -;; Added other customizations -;; 0.7 Added stats for lines and characters -;; 0.6 Mode line goal code added -;; 0.5 Initial version focused on word-count -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; 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 this program; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth -;; Floor, Boston, MA 02110-1301, USA. -;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;;; Code: - -(defgroup wc nil - "Customization group for `wc-mode'." - :group 'wp) - -(defcustom wc-modeline-format "WC[%W%w/%tw]" - "The format string for the modeline. -The detailed information for this minor mode can be shown in many -ways in the modeline. The formatting strings recognized in this -format are as follows. - - %W Original word count (before changes) - %L Original line count - %C Original character count - %w Change in words - %l Change in lines - %c Change in characters - %gc Character change goal - %gl Line change goal - %gw Word change goal - %tw Total words in buffer - %tl Total lines in buffer - %tc Total characters in buffer - -The default modeline, WC[%W%w/%tw], will display the original number -of words followed by the change in words (delta), followed by the total -number of words in the buffer. -It will looks something like WC[742+360/1100] in the modeline. -" - :group 'wc) - -(defcustom wc-mode-hook nil - "Hook to run when entering wc-mode." - :type 'hook - :group 'wc) - -(defface wc-goal-face - '((t (:inherit highlight))) - "Face for modeline when goal is reached" - :group 'wc) - -(defvar wc-mode-map - (let ((map (make-sparse-keymap "Wordcount"))) - (define-key map (kbd "C-c C-w w") 'wc-set-word-goal) - (define-key map (kbd "C-c C-w l") 'wc-set-line-goal) - (define-key map (kbd "C-c C-w a") 'wc-set-char-goal) - (define-key map (kbd "C-c C-w c") 'wc-count) - map) - "Keymap for wc-mode") - -(defvar wc-orig-words nil "Original count of words in the buffer") -(defvar wc-orig-lines nil "Original count of words in the buffer") -(defvar wc-orig-chars nil "Original count of words in the buffer") -(make-variable-buffer-local 'wc-orig-words) -(make-variable-buffer-local 'wc-orig-lines) -(make-variable-buffer-local 'wc-orig-chars) - -(defvar wc-words-delta 0 "Change in word count") -(defvar wc-lines-delta 0 "Change in line count") -(defvar wc-chars-delta 0 "Change in char count") -(make-variable-buffer-local 'wc-words-delta) -(make-variable-buffer-local 'wc-lines-delta) -(make-variable-buffer-local 'wc-chars-delta) - -(defvar wc-word-goal nil "Goal for number of words added") -(defvar wc-line-goal nil "Goal for number of lines added") -(defvar wc-char-goal nil "Goal for numger of chars added") -(make-variable-buffer-local 'wc-word-goal) -(make-variable-buffer-local 'wc-line-goal) -(make-variable-buffer-local 'wc-char-goal) - -(defvar wc-count-chars-function - (function (lambda (rstart rend) - "Count the characters specified by the region bounded by -RSTART and REND." - (- rend rstart)))) - -(defvar wc-count-words-function - (function (lambda (rstart rend) - "Count the words specified by the region bounded by -RSTART and REND." - (if (boundp 'count-words) - (count-words rstart rend) - (how-many "\\w+" rstart rend))))) - -(defvar wc-count-lines-function - (function (lambda (rstart rend) - "Count the lines specified by the region bounded by -RSTART and REND." - (how-many "\n" rstart rend)))) - -(defvar wc-modeline-format-alist - '(("%W" . (number-to-string wc-orig-words)) - ("%L" . (number-to-string wc-orig-lines)) - ("%C" . (number-to-string wc-orig-chars)) - ("%w" . (wc-prepend-sign wc-words-delta)) - ("%l" . (wc-prepend-sign wc-lines-delta)) - ("%c" . (wc-prepend-sign wc-chars-delta)) - ("%gc" . (wc-prepend-sign wc-char-goal)) - ("%gl" . (wc-prepend-sign wc-line-goal)) - ("%gw" . (wc-prepend-sign wc-word-goal)) - ("%tc" . (number-to-string (+ wc-orig-chars wc-chars-delta))) - ("%tl" . (number-to-string (+ wc-orig-lines wc-lines-delta))) - ("%tw" . (number-to-string (+ wc-orig-words wc-words-delta)))) - "Format and value pair -Format will be evaluated in `wc-generate-modeline'") - -(defvar wc-mode-hooks nil "Hooks to run upon entry to wc-mode") - -(defun wc-format-modeline-string (fmt) - "Format the modeline string according to specification and return result" - (let ((case-fold-search nil)) - (dolist (pair wc-modeline-format-alist fmt) - (when (string-match (car pair) fmt) - (setq fmt (replace-match (eval (cdr pair)) t t fmt)))))) - -(defun wc-prepend-sign (val) - "Add a sign to the beginning of a value. -Also cheat here a bit and add nil-value processing." - (if val - (format "%s%d" - (if (< val 0) - "-" "+") - (abs val)) - "none")) - -(defun wc-reset () - "Reset the original word, line, and char count to their current -value." - (interactive) - (setq wc-orig-words nil) - (setq wc-orig-lines nil) - (setq wc-orig-chars nil) - (wc-mode-update)) - -(defun wc-set-word-goal (goal) - "Set a goal for adding or removing words in the buffer" - (interactive "nHow many words: ") - (setq wc-word-goal goal) - (wc-reset) - (message "Goal set at %d words" goal)) - -(defun wc-set-line-goal (goal) - "Set a goal for adding or removing lines in the buffer" - (interactive "nHow many lines: ") - (setq wc-line-goal goal) - (wc-reset) - (message "Goal set at %d lines" goal)) - -(defun wc-set-char-goal (goal) - "Set a goal for adding or removing chars in the buffer" - (interactive "nHow many characters: ") - (setq wc-char-goal goal) - (wc-reset) - (message "Goal set at %d characters" goal)) - -(defun wc-goal-reached () - "Returns t when the goal change is reached." - (or - (if wc-line-goal - (if (< wc-line-goal 0) - (<= wc-lines-delta wc-line-goal) - (>= wc-lines-delta wc-line-goal))) - (if wc-word-goal - (if (< wc-word-goal 0) - (<= wc-words-delta wc-word-goal) - (>= wc-words-delta wc-word-goal))) - (if wc-char-goal - (if (< wc-char-goal 0) - (<= wc-chars-delta wc-char-goal) - (>= wc-chars-delta wc-char-goal))))) - - -(defun wc-count (&optional rstart rend field) - "Count the words, lines and characters present in the region -following point. This function follows most of the rules present -in the `how-many' function. If INTERACTIVE is omitted or nil, -just return the word count, do not print it. Otherwise, if -INTERACTIVE is t, the function behaves according to interactive -behavior. - -START and END specify the region to operate on. - -When called interactively, this function first checks to see if -it is in Transient Mark mode. If that is the case, then the -function operates over the marked region. Otherwise, it will -operate over the entire buffer. -" - (interactive) - (if rstart - (setq rend (max rstart rend)) - (if (and (interactive-p) transient-mark-mode mark-active) - (setq rstart (region-beginning) - rend (region-end)) - (setq rstart (point-min) - rend (point-max)))) - (let ((wcount (funcall wc-count-words-function rstart rend)) - (lcount (funcall wc-count-lines-function rstart rend)) - (ccount (funcall wc-count-chars-function rstart rend))) - (when (interactive-p) (message "%d line%s, %d word%s, %d char%s" - lcount - (if (= lcount 1) "" "s") - wcount - (if (= wcount 1) "" "s") - ccount - (if (= ccount 1) "" "s") - )) - (if field - (nth field (list lcount wcount ccount)) - (list lcount wcount ccount)))) - -(defalias 'wc 'wc-count - "Alias function `wc-count' to the more legible `wc'.") - -(defun wc-generate-modeline () - (let ((modeline (wc-format-modeline-string wc-modeline-format))) - (when (wc-goal-reached) - (put-text-property 0 (length modeline) 'face 'wc-goal-face modeline)) - (list " " modeline))) - -(defun wc-mode-update () - "Return a string to update the modeline appropriately" - (let* ((stats (wc-count (point-min) (point-max)))) - (unless wc-orig-lines (setq wc-orig-lines (nth 0 stats))) - (unless wc-orig-words (setq wc-orig-words (nth 1 stats))) - (unless wc-orig-chars (setq wc-orig-chars (nth 2 stats))) - (setq wc-lines-delta (- (nth 0 stats) wc-orig-lines)) - (setq wc-words-delta (- (nth 1 stats) wc-orig-words)) - (setq wc-chars-delta (- (nth 2 stats) wc-orig-chars)) - (wc-generate-modeline))) - -;;;###autoload -(define-minor-mode wc-mode - "Toggle wc mode With no argument, this command toggles the -mode. Non-null prefix argument turns on the mode. Null prefix -argument turns off the mode. - -When Wc mode is enabled on a buffer, it counts the current words -in the buffer and keeps track of a differential of added or -subtracted words. - -A goal of number of words added/subtracted can be set while using -this mode. Upon completion of the goal, the modeline text will -highlight indicating that the goal has been reached. - -Commands: -\\{wc-mode-map} - -Entry to this mode calls the value of `wc-mode-hook' if that -value is non-nil." - ;; initial value (off) - :init-value nil - ;; The indicator for the mode line - :lighter (:eval (wc-mode-update)) - ;; The customization group - :group 'wc - ;; The local keymap to use - :keymap wc-mode-map - ;; The mode body code - (if wc-mode - (run-mode-hooks 'wc-mode-hooks))) - -(provide 'wc-mode) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; wc-mode.el ends here - diff --git a/elpa/wc-mode-20170126.2029/wc-mode.elc b/elpa/wc-mode-20170126.2029/wc-mode.elc deleted file mode 100644 index 7c69e27..0000000 Binary files a/elpa/wc-mode-20170126.2029/wc-mode.elc and /dev/null differ diff --git a/elpa/web-mode-20180628.1122/web-mode-autoloads.el b/elpa/web-mode-20180628.1122/web-mode-autoloads.el new file mode 100644 index 0000000..3a0b982 --- /dev/null +++ b/elpa/web-mode-20180628.1122/web-mode-autoloads.el @@ -0,0 +1,21 @@ +;;; web-mode-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "web-mode" "web-mode.el" (23391 65240 0 0)) +;;; Generated autoloads from web-mode.el + +(autoload 'web-mode "web-mode" "\ +Major mode for editing web templates. + +\(fn)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; web-mode-autoloads.el ends here diff --git a/elpa/web-mode-20180628.1122/web-mode-pkg.el b/elpa/web-mode-20180628.1122/web-mode-pkg.el new file mode 100644 index 0000000..bdb7fda --- /dev/null +++ b/elpa/web-mode-20180628.1122/web-mode-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "web-mode" "20180628.1122" "major mode for editing web templates" '((emacs "23.1")) :commit "471e1235d976e209de5262e75ecf7cc3e1fec39f" :keywords '("languages") :authors '(("François-Xavier Bois ")) :maintainer '("François-Xavier Bois") :url "http://web-mode.org") diff --git a/elpa/web-mode-20180628.1122/web-mode.el b/elpa/web-mode-20180628.1122/web-mode.el new file mode 100644 index 0000000..6f6fd25 --- /dev/null +++ b/elpa/web-mode-20180628.1122/web-mode.el @@ -0,0 +1,13475 @@ +;;; web-mode.el --- major mode for editing web templates +;;; -*- coding: utf-8; lexical-binding: t; -*- + +;; Copyright 2011-2018 François-Xavier Bois + +;; Version: 16.0.12 +;; Package-Version: 20180628.1122 +;; Author: François-Xavier Bois +;; Maintainer: François-Xavier Bois +;; Package-Requires: ((emacs "23.1")) +;; URL: http://web-mode.org +;; Repository: http://github.com/fxbois/web-mode +;; Created: July 2011 +;; Keywords: languages +;; License: GNU General Public License >= 2 +;; Distribution: This file is not part of Emacs + +;;; Commentary: + +;;============================================================================== +;; WEB-MODE is sponsored by ** Kernix ** Best DigitalFactory & DataLab in Paris +;;============================================================================== + +;;; Code: + +;;---- CONSTS ------------------------------------------------------------------ + +(defconst web-mode-version "16.0.12" + "Web Mode version.") + +;;---- GROUPS ------------------------------------------------------------------ + +(defgroup web-mode nil + "Major mode for editing web templates" + :group 'languages + :prefix "web-" + :link '(url-link :tag "Site" "http://web-mode.org") + :link '(url-link :tag "Repository" "https://github.com/fxbois/web-mode")) + +(defgroup web-mode-faces nil + "Faces for syntax highlighting." + :group 'web-mode + :group 'faces) + +;;---- CUSTOMS ----------------------------------------------------------------- + +(defcustom web-mode-block-padding 0 + "Multi-line block (php, ruby, java, python, asp, etc.) left padding." + :type 'integer + :group 'web-mode) + +(defcustom web-mode-part-padding 1 + "Part elements (script, style) left padding." + :type 'integer + :group 'web-mode) + +(defcustom web-mode-script-padding web-mode-part-padding + "Script element left padding." + :type 'integer + :group 'web-mode) + +(defcustom web-mode-style-padding web-mode-part-padding + "Style element left padding." + :type 'integer + :group 'web-mode) + +(defcustom web-mode-attr-indent-offset nil + "Html attribute indentation level." + :type '(choice (integer :tags "Number of spaces") + (const :tags "Default" nil)) + :safe #'(lambda (v) (or (integerp v) (booleanp v))) + :group 'web-mode) + +(defcustom web-mode-attr-value-indent-offset nil + "Html attribute value indentation level." + :type '(choice (integer :tags "Number of spaces") + (const :tags "Default" nil)) + :safe #'(lambda (v) (or (integerp v) (booleanp v))) + :group 'web-mode) + +(defcustom web-mode-markup-indent-offset + (if (and (boundp 'standard-indent) standard-indent) standard-indent 2) + "Html indentation level." + :type 'integer + :safe #'integerp + :group 'web-mode) + +(defcustom web-mode-css-indent-offset + (if (and (boundp 'standard-indent) standard-indent) standard-indent 2) + "CSS indentation level." + :type 'integer + :safe #'integerp + :group 'web-mode) + +(defcustom web-mode-code-indent-offset + (if (and (boundp 'standard-indent) standard-indent) standard-indent 2) + "Code (javascript, php, etc.) indentation level." + :type 'integer + :safe #'integerp + :group 'web-mode) + +(defcustom web-mode-sql-indent-offset 4 + "Sql (inside strings) indentation level." + :type 'integer + :safe #'integerp + :group 'web-mode) + +(defcustom web-mode-enable-css-colorization (display-graphic-p) + "In a CSS part, set background according to the color: #xxx, rgb(x,x,x)." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-comment-interpolation nil + "Enable highlight of keywords like FIXME, TODO, etc. in comments." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-comment-annotation nil + "Enable annotation in comments (jsdoc, phpdoc, etc.)." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-auto-indentation (display-graphic-p) + "Auto-indentation." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-auto-closing (display-graphic-p) + "Auto-closing." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-auto-pairing (display-graphic-p) + "Auto-pairing." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-auto-opening (display-graphic-p) + "Html element auto-opening." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-auto-quoting (display-graphic-p) + "Add double quotes after the character = in a tag." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-auto-expanding nil + "e.g. s/ expands to |." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-control-block-indentation t + "Control blocks increase indentation." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-current-element-highlight nil + "Enable current element highlight." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-current-column-highlight nil + "Show column for current element." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-whitespace-fontification nil + "Enable whitespaces." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-html-entities-fontification nil + "Enable html entities fontification." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-block-face nil + "Enable block face (useful for setting a background for example). +See web-mode-block-face." + :type 'boolean + :group 'web-mode) + +(defcustom web-mode-enable-part-face nil + "Enable part face (useful for setting background of \n\n|\n\n") + ("table" . "\n\n\n\n\n
    |
    ") + ("ul" . "
      \n
    • |
    • \n
    • \n
    "))) + )) + +(defvar web-mode-engine-token-regexps + (list + '("asp" . "//\\|/\\*\\|\"\\|'") + '("ejs" . "//\\|/\\*\\|\"\\|'") + '("erb" . "\"\\|'\\|#\\|<<[-]?['\"]?\\([[:alnum:]_]+\\)['\"]?") + '("lsp" . "\"\\|#|\\|;") + '("mako" . "\"\\|'\\|#") + '("mason" . "\"\\|'\\|#") + '("mojolicious" . "\"\\|'") + '("php" . "//\\|/\\*\\|#\\|\"\\|'\\|<<<['\"]?\\([[:alnum:]]+\\)['\"]?") + '("python" . "\"\\|'\\|#") + '("web2py" . "\"\\|'")) + "Engine regexps used to identify tokens (strings / comments) in blocks.") + +(defvar web-mode-engine-open-delimiter-regexps + (list + '("angular" . "{{") + '("asp" . "<%\\|" nil 4) + ("\\.svg$" "" nil 0) + ("\\.js$" "" t 0) + ("\\.css$" "" t 0) + ("\\.html?$" "" nil 4)) + "List of elements and extensions for `web-mode-file-link'. It +consists of a string that contains the regular expression that +matches the appropriate files, a format string with element that +contains the link (%s should be put where the path goes,) a bool +that tells if the element belongs in the element, and +number of characters to move back if needed (or 0 if point +shouldn't be moved back.)") + +(defvar web-mode-sql-queries + (regexp-opt + '("SELECT" "INSERT" "UPDATE" "DELETE" "select" "insert" "update" "delete"))) + +(defvar web-mode-sql-keywords + (regexp-opt + (append + (cdr (assoc "sql" web-mode-extra-keywords)) + '("SELECT" "INSERT" "UPDATE" "DELETE" + "FROM" "WHERE" "GROUP BY" "LIKE" "LIMIT" "HAVING" "JOIN" "LEFT" "INNER" + "FULL" "OUTER" "VALUES" "ORDER BY" "SEPARATOR" "ASC" "DESC" + "AND" "OR" "ON" "WHEN" "ELSE" "END" "THEN")))) + +(defvar web-mode-python-constants + (regexp-opt + (append + (cdr (assoc "python" web-mode-extra-constants)) + '("True" "False" "None" "__debug__" "NotImplemented" "Ellipsis")))) + +(defvar web-mode-erlang-constants + (regexp-opt + (append + (cdr (assoc "erlang" web-mode-extra-constants)) + '("true" "false")))) + +(defvar web-mode-erlang-keywords + (regexp-opt + (append + (cdr (assoc "erlang" web-mode-extra-keywords)) + '("else" "if" "do" "end")))) + +(defvar web-mode-cl-emb-constants + (regexp-opt + '("nil" "t" "raw" "escape"))) + +(defvar web-mode-cl-emb-keywords + (regexp-opt + '("if" "else" "endif" "unless" "endunless" "var" "repeat" + "endrepeat" "loop" "endloop" "include" "call" "with" + "endwith" "set" "genloop" "endgenloop" "insert"))) + +(defvar web-mode-lsp-constants + (regexp-opt + '("nil" "t"))) + +(defvar web-mode-lsp-keywords + (regexp-opt + '("dolist" "let" "while" "cond" "when" "progn" "if" + "dotimes" "unless" "lambda" + "loop" "for" "and" "or" "in" "do" "defun"))) + +(defvar web-mode-php-constants + (regexp-opt + (append + (cdr (assoc "php" web-mode-extra-constants)) + '("TRUE" "FALSE" "NULL" "true" "false" "null" + "STR_PAD_LEFT" "STR_PAD_RIGHT" + "ENT_COMPAT" "ENT_QUOTES" "ENT_NOQUOTES" "ENT_IGNORE" + "ENT_SUBSTITUTE" "ENT_DISALLOWED" "ENT_HTML401" "ENT_XML1" + "ENT_XHTML" "ENT_HTML5" "JSON_PRETTY_PRINT" + "LIBXML_NOBLANKS")))) + +(defvar web-mode-php-keywords + (regexp-opt + (append + (cdr (assoc "php" web-mode-extra-keywords)) + '("and" "array" "as" "break" + "callable" "case" "catch" "catch all" "class" "clone" "const" "continue" + "default" "die" "do" "echo" "else" "elseif" "empty" + "endfor" "endforeach" "endif" "endswitch" "endwhile" "exit" "extends" + "finally" "for" "foreach" "function" "global" "goto" + "if" "include" "include_once" "instanceof" "interface" "isset" + "list" "next" "new" "or" "private" "protected" "public" + "require" "require_once" "return" "static" "switch" "try" "throw" + "unset" "use" "var" "when" "while" "xor" "yield")))) + +(defvar web-mode-php-types + (eval-when-compile + (regexp-opt + '("array" "bool" "boolean" "char" "const" "double" "float" + "int" "integer" "long" "mixed" "object" "real" "string")))) + +(defvar web-mode-css-at-rules + (eval-when-compile + (regexp-opt + '("charset" "import" "media" "page" "font-face" + "namespace" "supports" "document" + "keyframes" "-moz-keyframes" "-webkit-keyframes" + "mixin" "viewport")))) + +(defvar web-mode-css-pseudo-classes + (eval-when-compile + (regexp-opt + '("active" "after" "before" "checked" "disabled" "empty" "enabled" + "first" "first-child" "first-letter" "first-line" "first-of-type" "focus" + "hover" "lang" "last-child" "last-of-type" "left" "link" + "not" "nth-child" "nth-last-child" "nth-last-of-type" "nth-of-type" + "only-child" "only-of-type" + "right" "root" "selection" "target" "visited")))) + +(defvar web-mode-python-keywords + (regexp-opt + (append + (cdr (assoc "python" web-mode-extra-keywords)) + '("and" "as" "assert" "break" "class" "continue" "def" "del" + "elif" "else" "except" "finally" "for" "from" "global" + "if" "import" "in" "is" "lambda" "nonlocal" "not" "or" "pass" + "raise" "return" "try" "while" "with" "yield")))) + +(defvar web-mode-jsp-keywords + (regexp-opt + (append + (cdr (assoc "jsp" web-mode-extra-keywords)) + '("case" "catch" "do" "else" "end" "false" "for" "function" + "if" "in" "include" + "new" "package" "page" "private" "protected" "public" + "return" "tag" "taglib" "throw" "throws" "true" "try" "void" "while")))) + +(defvar web-mode-erb-keywords + (regexp-opt + (append + (cdr (assoc "erb" web-mode-extra-keywords)) + '("alias" "and" "begin" "break" "case" "class" "def" "defined?" "do" + "elsif" "else" "end" "ensure" "fail" "for" "if" "in" + "module" "next" "not" "or" "redo" "rescue" "retry" "return" + "then" "super" "unless" "undef" "until" "when" "while" "yield" + "__ENCODING__" "__FILE__" "__LINE__")))) + +(defvar web-mode-mason-keywords + (regexp-opt + (append + (cdr (assoc "mason" web-mode-extra-keywords)) + '("and" "base" "close" "die" "each" "else" "elsif" "eval" "exists" + "foreach" "grep" "if" "length" "local" "my" "next" "open" "or" + "package" "pop" "ref" "return" "stat" "sub" "tie" + "undef" "unless" "use" "while")))) + +(defvar web-mode-erb-builtins + (regexp-opt + (append + (cdr (assoc "erb" web-mode-extra-builtins)) + + '("__callee__" "__dir__" "__method__" + "abort" "at_exit" "autoload" "autoload?" + "binding" "block_given?" "caller" "catch" + "eval" "exec" "exit" "exit!" "fail" "fork" "format" + "lambda" "load" "loop" "open" + "p" "print" "printf" "proc" "putc" "puts" + "raise" "rand" "readline" "readlines" "require" "require_relative" + "sleep" "spawn" "sprintf" "srand" "syscall" "system" + "throw" "trap" "warn" + "alias_method" "attr" "attr_accessor" "attr_reader" "attr_writer" + "define_method" "extend" "include" "module_function" + "prepend" "private" "protected" "public" + "refine" "using" + + "error_message_on" "error_messages_for" "form" "input" + "auto_discovery_link_tag" "image_tag" "javascript_include_tag" + "stylesheet_link_tag" "image_path" "path_to_image"" " + "javascript_path" "path_to_javascript" "register_javascript_expansion" + "register_javascript_include_default" "register_stylesheet_expansion" + "stylesheet_path" "path_to_stylesheet" "atom_feed" "entry" "updated" + "benchmark" "cache" "capture" "content_for" "distance_of_time_in_words" + "distance_of_time_in_words_to_now" "time_ago_in_words" "date_select" + "datetime_select" "time_select" "select_date" "select_datetime" + "select_day" "select_hour" "select_minute" "select_month" "select_second" + "select_time" "select_year" "debug" + "check_box" "fields_for" "file_field" "form_for" "hidden_field" + "label" "password_field" "radio_button" "text_area" "text_field" + "check_box_tag" "field_set_tag" "file_field_tag" "form_tag" + "hidden_field_tag" "image_submit_tag" "label_tag" "password_field_tag" + "radio_button_tag" "select_tag" "submit_tag" "text_area_tag" + "text_field_tag" + "collection_select" "country_options_for_select" "country_select" + "option_groups_from_collection_for_select" "options_for_select" + "options_from_collection_for_select" "select" + "time_zone_options_for_select" + "time_zone_select" "button_to_function" "define_javascript_functions" + "escape_javascript" "javascript_tag" "link_to_function"" " + "number_to_currency" "number_to_human_size" "number_to_percentage" + "number_to_phone" "number_with_delimiter" "number_with_precision" + "evaluate_remote_response" "form_remote_for" "form_remote_tag" + "link_to_remote" "observe_field" "observe_field" + "periodically_call_remote" + "remote_form_for" "remote_function" "submit_to_remote" "update_page" + "update_page_tag" "dom_class" "dom_id" "partial_path" "sanitize" + "sanitize_css" "strip_links" "strip_tags" + "cdata_section" "content_tag" "escape_once" "tag" + "auto_link" "concat" "cycle" "excerpt" "highlight" "markdown" "pluralize" + "reset_cycle" "simple_format" "textilize" "textilize_without_paragraph" + "truncate" "word_wrap" "button_to" "current_page?" "link_to" "link_to_if" + "link_to_unless" "link_to_unless_current" "mail_to" "url_for" + "action_name" "atom_feed" "audio_path" "audio_tag" + "content_tag_for" "controller" "controller_name" "action_name" + "controller_path" "convert_to_model" "cookies" "csrf_meta_tag" + "csrf_meta_tags" "headers" + "current_cycle" "div_for" "email_field" "email_field_tag" + "favicon_link_tag" "flash" "l" "button_tag" + "grouped_collection_select" "grouped_options_for_select" + "image_alt" "j" "javascript_cdata_section" + "localize" "logger" "number_field" + "number_field_tag" "number_to_human" "params" "path_to_audio" + "path_to_video" "phone_field" "phone_field_tag" "provide" + "range_field" "range_field_tag" "raw" "render" "request" + "request_forgery_protection_token" "response" "safe_concat" + "safe_join" "search_field" "search_field_tag" + "session" "t" "telephone_field" "telephone_field_tag" + "time_tag" "translate" "url_field" "url_field_tag" + "url_options" "video_path" "video_tag" "simple_form_for" + + )))) + +(defvar web-mode-asp-constants + (regexp-opt + (append + (cdr (assoc "asp" web-mode-extra-constants)) + '("adAsyncExecute" "adAsyncFetch" "adAsyncFetchNonBlocking" "adCmdFile" + "adCmdStoredProc" "adCmdTable" "adCmdTableDirect" "adCmdText" "adCmdUnknown" + "adCmdUnspecified" "adExecuteNoRecords" "adExecuteRecord" "adExecuteStream" + "adLockBatchOptimistic" "adLockOptimistic" "adLockPessimistic" + "adLockReadOnly" "adLockUnspecified" "adOpenDynamic" "adOpenForwardOnly" + "adOpenKeyset" "adOpenStatic" "adOpenUnspecified" "adOptionUnspecified" + "Empty" "Nothing" "Null" "True" "False" + "vbBack" "vbCr" "vbCrLf" "vbFormFeed" "vbLf" "vbNewLine" "vbNullChar" + "vbNullString" "vbObjectError" "vbScript" "vbTab" "vbVerticalTab")))) + +(defvar web-mode-asp-keywords + (regexp-opt + (append + (cdr (assoc "asp" web-mode-extra-keywords)) + '("Abs" "And" "Array" "Asc" "Atn" + "CBool" "CByte" "CCur" "CDate" "CDbl" "CInt" "CLng" "CSng" "CStr" + "Call" "Case" "Chr" "Class" "Const" "Cos" "CreateObject" + "Date" "DateAdd" "DateDiff" "DatePart" "DateSerial" "DateValue" + "Day" "Dim" "Do" + "Each" "Else" "ElseIf" "End" "Erase" "Err" "Eval" "Exit" "Exp" + "Explicit" + "Filter" "Fix" "For" "FormatCurrency" "FormatDateTime" + "FormatNumber" "FormatPercent" "Function" + "GetLocale" "GetObject" "GetRef" "Hex" "Hour" + "If" "In" "InStr" "InStrRev" "InputBox" "Int" "IsArray" "IsDate" + "IsEmpty" "IsNull" "IsNumeric" "IsObject" "Join" + "LBound" "LCase" "LTrim" "Language" "Left" "Len" "Let" + "LoadPicture" "Log" "Loop" + "Mid" "Minute" "Month" "MonthName" "MsgBox" + "New" "Next" "Not" "Now" + "Oct" "On" "Option" "Or" "Preserve" "Private" "Public" + "RGB" "RTrim" "Redim" "Rem" "Replace" "Right" "Rnd" "Round" + "ScriptEngine" "ScriptEngineBuildVersion" + "ScriptEngineMajorVersion" "ScriptEngineMinorVersion" + "Second" "Select" "Set" "SetLocale" "Sgn" "Sin" "Space" "Split" + "Sqr" "StrComp" "StrReverse" "String" "Sub" + "Tan" "Then" "Time" "TimeSerial" "TimeValue" "Timer" "To" "Trim" + "TypeName" + "UBound" "UCase" "Until" "VarType" + "Weekday" "WeekdayName" "Wend" "With" "While" "Year")))) + +(defvar web-mode-asp-types + (regexp-opt + (append + (cdr (assoc "asp" web-mode-extra-types)) + '("Application" "ASPError" "Request" "Response" "Server" "Session")))) + +(defvar web-mode-aspx-keywords + (regexp-opt + (append + (cdr (assoc "aspx" web-mode-extra-keywords)) + '("case" "catch" "do" "else" "end" "for" "foreach" "function" + "if" "in" "include" "new" "package" "page" "return" + "tag" "throw" "throws" "try" "while")))) + +(defvar web-mode-smarty-keywords + (regexp-opt '("as"))) + +(defvar web-mode-velocity-keywords + (eval-when-compile + (regexp-opt '("in" "true" "false")))) + +(defvar web-mode-freemarker-keywords + (eval-when-compile + (regexp-opt '("as" "list")))) + +(defvar web-mode-go-keywords + (eval-when-compile + (regexp-opt + '("const" "define" "else" "end" + "for" "func" "if" "import" + "pipeline" "range" "return" "struct" + "template" "type" "var" "with")))) + +(defvar web-mode-go-functions + (eval-when-compile + (regexp-opt + '("and" "call" "ge" "html" "index" "js" "len" "not" "or" + "print" "printf" "println" "urlquery" "where")))) + +(defvar web-mode-go-types + (regexp-opt + (append + (cdr (assoc "go" web-mode-extra-types)) + '("int" "string")))) + +(defvar web-mode-closure-keywords + (eval-when-compile + (regexp-opt '("in" "and" "not" "or")))) + +(defvar web-mode-django-control-blocks + (append + (cdr (assoc "django" web-mode-extra-control-blocks)) + '( + + "assets" "autoescape" + "block" "blocktrans" + "cache" "call" "capture" "comment" + "draw" + "embed" + "filter" "for" "foreach" "form" + "if" "ifchanged" "ifequal" "ifnotequal" + "macro" + "random" "raw" + "safe" "sandbox" "spaceless" + "tablerow" + "unless" + "verbatim" + "with" + + "endassets" "endautoescape" + "endblock" "endblocktrans" + "endcache" "endcall" "endcapture" "endcomment" + "draw" + "endembed" + "endfilter" "endfor" "endforeach" "endform" + "endif" "endifchanged" "endifequal" "endifnotequal" + "endmacro" + "endrandom" "endraw" + "endsafe" "endsandbox" "endspaceless" + "endtablerow" + "endunless" + "endverbatim" + "endwith" + + ;; "set" "endset" ;#504 + + "csrf_token" "cycle" "debug" + "elif" "else" "elseif" "elsif" "empty" "extends" + "firstof" "include" "load" "lorem" "now" "regroup" "ssi" + "trans" "templatetag" "url" "widthratio" + + ;; #805 + "graph" "endgraph" + "javascript" "endjavascript" + "schema" "endschema" + "stylesheet" "endstylesheet" + + ))) + +(defvar web-mode-django-control-blocks-regexp + (regexp-opt web-mode-django-control-blocks t)) + +(defvar web-mode-django-keywords + (eval-when-compile + (regexp-opt + '("and" "as" "assign" + "break" + "cache" "call" "case" "context" "continue" + "do" + "flush" "from" + "ignore" "import" "in" "is" + "layout" "load" + "missing" + "none" "not" + "or" + "pluralize" + "random" + "set" ;#504 + "unless" "use" + "var" + )))) + +(defvar web-mode-django-types + (eval-when-compile + (regexp-opt '("null" "false" "true")))) + +(defvar web-mode-directives + (eval-when-compile + (regexp-opt + '("include" "page" "taglib" + "Assembly" "Control" "Implements" "Import" + "Master" "OutputCache" "Page" "Reference" "Register")))) + +(defvar web-mode-template-toolkit-keywords + (regexp-opt + '("block" "call" "case" "catch" "clear" "default" "do" + "else" "elsif" "end" "filter" "final" "for" + "foreach" "get" "if" "in" "include" "insert" "is" "last" + "macro" "meta" "or" "perl" "process" "rawperl" "return" + "set" "stop" "switch" "tags" "throw" "try" + "unless" "use" "while" "wrapper"))) + +(defvar web-mode-perl-keywords + (regexp-opt + '("__DATA__" "__END__" "__FILE__" "__LINE__" "__PACKAGE__" + "and" "cmp" "continue" "CORE" "do" "else" "elsif" "eq" "exp" + "for" "foreach" "ge" "gt" "if" "le" "lock" "lt" "m" "ne" "no" + "or" "package" "q" "qq" "qr" "qw" "qx" "s" "sub" + "tr" "unless" "until" "while" "xor" "y" + "my" "use" "print" "say"))) + +(defvar web-mode-javascript-keywords + (regexp-opt + (append + (cdr (assoc "javascript" web-mode-extra-keywords)) + '("as" "async" "await" "break" "case" "catch" "class" "const" "continue" + "debugger" "default" "delete" "do" "else" "enum" "eval" + "export" "extends" "finally" "for" "from" "function" "get" "if" + "implements" "import" "in" "instanceof" "interface" "let" + "new" "of" "package" "private" "protected" "public" + "return" "set" "static" "super" "switch" + "throw" "try" "typeof" "var" "void" "while" "with" "yield")))) + +(defvar web-mode-javascript-constants + (regexp-opt + '("false" "null" "undefined" "Infinity" "NaN" "true" "arguments" "this"))) + +(defvar web-mode-razor-keywords + (regexp-opt + (append + (cdr (assoc "razor" web-mode-extra-keywords)) + '("false" "true" "foreach" "if" "else" "in" "var" "for" "display" + "match" "case" "to" + "Html")))) + +(defvar web-mode-selector-font-lock-keywords + (list + '("$[[:alnum:]-]+" 0 'web-mode-css-variable-face) + (cons (concat "@\\(" web-mode-css-at-rules "\\)\\_>") + '(0 'web-mode-css-at-rule-face)) + '("\\_<\\(all\|braille\\|embossed\\|handheld\\|print\\|projection\\|screen\\|speech\\|tty\\|tv\\|and\\|or\\)\\_>" + 1 'web-mode-keyword-face) + '("[^,]+" 0 'web-mode-css-selector-face) + (cons (concat ":\\([ ]*[[:alpha:]][^,{]*\\)") '(0 'web-mode-css-pseudo-class-face t t)) + )) + +(defvar web-mode-declaration-font-lock-keywords + (list + '("--[[:alnum:]-]+" 0 'web-mode-css-variable-face) + '("$[[:alnum:]-]+" 0 'web-mode-css-variable-face) + (cons (concat "@\\(" web-mode-css-at-rules "\\)\\_>") '(1 'web-mode-css-at-rule-face)) + '("\\([[:alpha:]-]+\\)[ ]?:" 0 'web-mode-css-property-name-face) + '("\\([[:alpha:]-]+\\)[ ]?(" 1 'web-mode-css-function-face) + '("#[[:alnum:]]\\{1,6\\}" 0 'web-mode-css-color-face t t) + '("![ ]?important" 0 'web-mode-css-priority-face t t) + '("\\([^,]+\\)[ ]+{" 1 'web-mode-css-selector-face) + '("'[^']*'\\|\"[^\"]*\"" 0 'web-mode-string-face t t) + )) + +(defvar web-mode-html-font-lock-keywords + (list + '("]\\|>" 0 'web-mode-html-tag-face t) + '(" \\([[:alnum:]-]+=\\)\\(\"[^\"]+\"\\)" + (1 'web-mode-html-attr-name-face) + (2 'web-mode-html-attr-value-face)) + )) + +;; voir https://www.gnu.org/software/emacs/manual/html_node/elisp/Search_002dbased-Fontification.html +(defvar web-mode-javascript-font-lock-keywords + (list + '("@\\([[:alnum:]_]+\\)\\_>" 0 'web-mode-keyword-face) + (cons (concat "\\_<\\(function\\*\\)\\_>") '(1 'web-mode-keyword-face)) + (cons (concat "\\([ \t}{(]\\|^\\)\\(" web-mode-javascript-keywords "\\)\\_>") '(2 'web-mode-keyword-face)) + (cons (concat "\\_<\\(" web-mode-javascript-constants "\\)\\_>") '(0 'web-mode-constant-face)) + '("\\_<\\([$]\\)(" 1 'web-mode-type-face) + '("\\_<\\(new\\|instanceof\\|class\\|extends\\) \\([[:alnum:]_.]+\\)\\_>" 2 'web-mode-type-face) + '("\\_<\\([[:alnum:]_]+\\):[ ]*function[ ]*(" 1 'web-mode-function-name-face) + '("\\_<\\(function\\|get\\|set\\)[ ]+\\([[:alnum:]_]+\\)" + (1 'web-mode-keyword-face) + (2 'web-mode-function-name-face)) + '("\\([[:alnum:]_]+\\)[ ]*([^)]*)[ \n]*{" 1 'web-mode-function-name-face) + '("([ ]*\\([[:alnum:]_]+\\)[ ]*=>" 1 'web-mode-function-name-face) + '("[ ]*\\([[:alnum:]_]+\\)[ ]*=[ ]*([^)]*)[ ]*=>[ ]*{" 1 'web-mode-function-name-face) + '("\\_<\\(var\\|let\\|const\\)[ ]+\\([[:alnum:]_]+\\)" 2 'web-mode-variable-name-face) + '("({" "\\([[:alnum:]_]+\\)[, }]+" nil nil (1 'web-mode-variable-name-face)) ;#738 + '("\\([[:alnum:]_]+\\)[ ]*=> [{(]" 1 'web-mode-variable-name-face) + ;; #989 + ;; '("\\(function\\|[,=]\\|^\\)[ ]*(" + ;; ("\\([[:alnum:]_]+\\)\\([ ]*=[^,)]*\\)?[,)]" nil nil (1 'web-mode-variable-name-face))) + '("\\([[:alnum:]_]+\\):" 1 'web-mode-variable-name-face) + '("\\_<\\([[:alnum:]_-]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("[a-zA-Z]<\\([a-zA-Z]+\\)[,>]" 1 'web-mode-type-face) + )) + +(defvar web-mode-stylus-font-lock-keywords + (list + '("^[ \t]*\\([[:alnum:]().-]+\\)$" 1 'web-mode-css-selector-face) + '("^[ \t]*\\([[:alnum:]-]+[ ]*:\\)" 1 'web-mode-css-property-name-face) + )) + +(defvar web-mode-sql-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-sql-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + '("\\_<\\([[:alnum:]_-]+\\)[ ]?(" 1 'web-mode-function-call-face) + )) + +(defvar web-mode-markdown-font-lock-keywords + (list + '("^[ ]*[*].*$" 0 'web-mode-variable-name-face) + '("^[ ]*#.*$" 0 'web-mode-comment-face) + )) + +(defvar web-mode-html-tag-font-lock-keywords + (list + '("\\(" 0 'web-mode-html-tag-bracket-face) + )) + +(defvar web-mode-dust-font-lock-keywords + (list + '("{[#:/?@><+^]\\([[:alpha:]_.]+\\)" 1 'web-mode-block-control-face) + '(":\\([[:alpha:]]+\\)" 1 'web-mode-keyword-face) + '("\\_<\\([[:alnum:]_]+=\\)\\(\"[^\"]*\"\\|[[:alnum:]_]*\\)" + (1 'web-mode-block-attr-name-face) + (2 'web-mode-block-attr-value-face)) + '("\\\([[:alnum:]_.]+\\)" 0 'web-mode-variable-name-face) + )) + +(defvar web-mode-template-toolkit-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-template-toolkit-keywords "\\)\\_>") '(1 'web-mode-keyword-face)) + '("\\\([[:alpha:]][[:alnum:]_]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("\\\([[:alpha:]][[:alnum:]_]+\\)" 0 'web-mode-variable-name-face) + )) + +(defvar web-mode-smarty-font-lock-keywords + (list + (cons (concat "[ ]\\(" web-mode-smarty-keywords "\\)[ ]") '(1 'web-mode-keyword-face)) + '("{/?\\([[:alpha:]_]+\\)" 1 'web-mode-block-control-face) + '("\\([}{]\\)" 0 'web-mode-block-delimiter-face) + '("\\_<\\([$]\\)\\([[:alnum:]_]+\\)" (1 nil) (2 'web-mode-variable-name-face)) + '("\\_<\\(\\sw+\\)[ ]?(" 1 'web-mode-function-call-face) + '(" \\(\\sw+[ ]?=\\)" 1 'web-mode-param-name-face) + '(" \\(\\sw+\\)[ }]" 1 'web-mode-param-name-face) + '("|\\([[:alnum:]_]+\\)" 1 'web-mode-function-call-face) + '("\\(->\\)\\(\\sw+\\)" (1 nil) (2 'web-mode-variable-name-face)) + '("[.]\\([[:alnum:]_-]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("[.]\\([[:alnum:]_]+\\)" 1 'web-mode-variable-name-face) + '("#\\([[:alnum:]_]+\\)#" 1 'web-mode-variable-name-face) + )) + +(defvar web-mode-velocity-font-lock-keywords + (list + '("#{?\\([[:alpha:]_]+\\)\\_>" (1 'web-mode-block-control-face)) + (cons (concat "\\_<\\(" web-mode-velocity-keywords "\\)\\_>") '(1 'web-mode-keyword-face t t)) + '("#macro([ ]*\\([[:alpha:]]+\\)[ ]+" 1 'web-mode-function-name-face) + '("[.]\\([[:alnum:]_-]+\\)" 1 'web-mode-variable-name-face) + '("\\_<\\($[!]?[{]?\\)\\([[:alnum:]_-]+\\)[}]?" (1 nil) (2 'web-mode-variable-name-face)) + )) + +(defvar web-mode-mako-tag-font-lock-keywords + (list + '("") '(1 'web-mode-constant-face)) + (cons (concat "\\_<\\(" web-mode-python-keywords "\\)\\_>") '(1 'web-mode-keyword-face)) + (cons (concat "\\_<\\(endfor\\|endif\\|endwhile\\)\\_>") '(1 'web-mode-keyword-face)) + )) + +(defvar web-mode-web2py-font-lock-keywords + (list + '("\\_<\\(\\sw+\\)[ ]?(" 1 'web-mode-function-call-face) + (cons (concat "\\_<\\(" web-mode-python-constants "\\)\\_>") '(1 'web-mode-constant-face)) + (cons (concat "\\_<\\(" web-mode-python-keywords "\\)\\_>") '(1 'web-mode-keyword-face)) + (cons (concat "\\_<\\(block\\|extend\\|super\\|end\\|include\\)\\_>") '(1 'web-mode-keyword-face)) + )) + +(defvar web-mode-django-expr-font-lock-keywords + (list + '("|[ ]?\\([[:alpha:]_]+\\)\\_>" 1 'web-mode-filter-face) + (cons (concat "\\_<\\(" web-mode-django-types "\\)\\_>") '(1 'web-mode-type-face)) + '("\\_<\\([[:alpha:]_]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("[[:alnum:]_]+" 0 'web-mode-variable-name-face) + )) + +(defvar web-mode-django-code-font-lock-keywords + (list + (cons (concat "{%[ ]*\\(" web-mode-django-control-blocks-regexp "\\)[ %]") '(1 'web-mode-block-control-face)) + '("{%[ ]*\\(end[[:alpha:]]+\\)\\_>" 1 'web-mode-block-control-face) ;#504 + (cons (concat "\\_<\\(" web-mode-django-keywords "\\)\\_>") '(1 'web-mode-keyword-face)) + (cons (concat "\\_<\\(" web-mode-django-types "\\)\\_>") '(1 'web-mode-type-face)) + '("|[ ]?\\([[:alpha:]_]+\\)\\_>" 1 'web-mode-function-call-face) + '("\\_<\\([[:alpha:]_]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("[[:alnum:]_.]+" 0 'web-mode-variable-name-face) + '("[[:alnum:]_]+\\([.][[:alnum:]_]+\\)+" 0 'web-mode-variable-name-face t t) + )) + +(defvar web-mode-ctemplate-font-lock-keywords + (list + '("{[~]?{[#/>^]?[ ]*\\([[:alnum:]_.-]+\\)" 1 'web-mode-block-control-face) + '("[ \t]+\\([[:alnum:]_-]+\\)=" + (1 'web-mode-block-attr-name-face)) + '("\"[^\"]+\"" 0 'web-mode-block-string-face) + )) + +(defvar web-mode-razor-font-lock-keywords + (list + '("@\\([[:alnum:]_.]+\\)[ ]*[({]" 1 'web-mode-block-control-face) + (cons (concat "\\_<\\(" web-mode-razor-keywords "\\)\\_>") '(1 'web-mode-keyword-face)) + '("\\_<\\(String\\)\\_>" 1 'web-mode-type-face) + '("\\([[:alnum:]]+:\\)" 1 'web-mode-symbol-face) + '("\\(@[[:alnum:]_.]+\\)" 1 'web-mode-variable-name-face) + )) + +(defvar web-mode-riot-font-lock-keywords + (list + '("\\(parent\\|opts\\|tags\\|this\\)\\.\\([[:alnum:]_.]+\\)" + (1 'web-mode-constant-face) + (2 'web-mode-variable-name-face)) + '("\\([[:alnum:]_.]+\\)" 0 'web-mode-variable-name-face) + )) + +(defvar web-mode-closure-font-lock-keywords + (list + '("{\\([@/]?[[:alpha:]]+[?]?\\)" 1 'web-mode-block-control-face) + '("{[@]?param[?]?[ ]+\\([[:alnum:]]+[:]?\\)" 1 'web-mode-symbol-face) + '("\\_<\\(true\\|false\\|null\\)\\_>" 1 'web-mode-type-face) + '("\\\_<[[:alpha:]]+:[ ]+\\([[:alpha:]]+\\)" 1 'web-mode-type-face) + (cons (concat "\\_<\\(" web-mode-closure-keywords "\\)\\_>") '(1 'web-mode-keyword-face)) + '("{\\(alias\\|call\\|delcall\\|delpackage\\|deltemplate\\|namespace\\|template\\)[ ]+\\([[:alnum:].]+\\)" 2 'web-mode-constant-face) + '("\\(allowemptydefault\\|data\\|desc\\|meaning\\|autoescape\\|private\\|variant\\)=" 0 'web-mode-block-attr-name-face) + '("|\\([[:alpha:]]+\\)" 1 'web-mode-function-call-face) + '("\\_<\\([[:alnum:]]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("$\\([[:alnum:]._]+\\)" 1 'web-mode-variable-name-face) + )) + +(defvar web-mode-go-font-lock-keywords + (list + '("{{[-]?[ ]*\\([[:alpha:]]+\\)" 1 'web-mode-block-control-face) + '("\\_") '(0 'web-mode-type-face)) + (cons (concat "\\_<\\(" web-mode-go-keywords "\\)\\_>") '(1 'web-mode-keyword-face)) + (cons (concat "\\_<\\(" web-mode-go-functions "\\)\\_>") '(1 'web-mode-function-call-face)) + '("[$.]\\([[:alnum:]_]+\\)" 1 'web-mode-variable-name-face t t) + '("|[ ]?\\([[:alpha:]_]+\\)\\_>" 1 'web-mode-filter-face) + )) + +(defvar web-mode-expression-font-lock-keywords + (list + '("[[:alpha:]_]" 0 'web-mode-variable-name-face) + )) + +(defvar web-mode-angular-font-lock-keywords + (list + '("[[:alpha:]_]" 0 'web-mode-variable-name-face) + )) + +(defvar web-mode-underscore-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-javascript-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + '("\\_<\\(_\.[[:alpha:]]+\\)(" 1 'web-mode-function-call-face) + '("\\_" 1 'web-mode-type-face) + '("\\_<\\([[:alnum:]_]+\\):[ ]*function[ ]*(" 1 'web-mode-function-name-face) + '("\\_<\\(var\\)\\_>[ ]+\\([[:alnum:]_]+\\)" + (1 'web-mode-keyword-face) + (2 'web-mode-variable-name-face)) + )) + +(defvar web-mode-vue-font-lock-keywords + (list + '("\\_<\\([[:alnum:]_-]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("[[:alpha:]_]" 0 'web-mode-variable-name-face) + )) + +(defvar web-mode-engine-tag-font-lock-keywords + (list + '("") '(0 'web-mode-keyword-face)) + '("\\(public\\|private\\)[ ]+\\([[:alpha:]]+\\)[ ]+\\([[:alnum:]._]+\\)[ ]?(" + (2 'web-mode-type-face) + (3 'web-mode-function-name-face)) + '("\\_<\\([[:alnum:]._]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("@\\(\\sw*\\)" 1 'web-mode-variable-name-face) + '("\\_<\\([[:alnum:].]+\\)[ ]+[{[:alpha:]]+" 1 'web-mode-type-face) + )) + +(defvar web-mode-asp-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-asp-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + (cons (concat "\\_<\\(" web-mode-asp-types "\\)\\_>") '(0 'web-mode-type-face)) + (cons (concat "\\_<\\(" web-mode-asp-constants "\\)\\_>") '(0 'web-mode-constant-face)) + '("\\(Class\\|new\\) \\([[:alnum:]_]+\\)" 2 'web-mode-type-face) + '("Const \\([[:alnum:]_]+\\)" 1 'web-mode-constant-face) + '("\\_" + (0 'web-mode-keyword-face) + ("[[:alnum:]_]+" nil nil (0 'web-mode-variable-name-face))) + '("\\_<\\(public\\|private\\|sub\\|function\\)\\_> \\([[:alnum:]_]+\\)[ ]*(" 2 'web-mode-function-name-face) + '("\\_<\\(public\\|private\\|dim\\)\\_> \\([[:alnum:]_]+\\)" 2 'web-mode-variable-name-face) + )) + +(defvar web-mode-aspx-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-aspx-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + '("\\_<\\([[:alnum:].]+\\)[ ]+[[:alpha:]]+" 1 'web-mode-type-face) + )) + +(defvar web-mode-uel-font-lock-keywords + (list + '("[$#{]{\\|}" 0 'web-mode-preprocessor-face) + '("\\([[:alpha:]_]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("|[ ]*\\(trim\\|x\\|u\\)" 1 'web-mode-function-call-face) + '("[[:alpha:]_]" 0 'web-mode-variable-name-face) + )) + +(defvar web-mode-php-var-interpolation-font-lock-keywords + (list + '("[[:alpha:]_]" 0 'web-mode-variable-name-face) + '("\".+\"\\|'.*'" 0 'web-mode-string-face) + )) + +(defvar web-mode-marko-font-lock-keywords + (list + '("[[:alnum:]_]+" 0 'web-mode-variable-name-face) + )) + +(defvar web-mode-freemarker-square-font-lock-keywords + (list + '("\\[/?[#@]\\([[:alpha:]_.]*\\)" 1 'web-mode-block-control-face) + '("#\\(macro\\|function\\) \\([[:alpha:]]+\\)" 2 'web-mode-function-name-face) + (cons (concat "\\_<\\(" web-mode-freemarker-keywords "\\)\\_>") '(1 'web-mode-keyword-face)) + '("\\_<\\([[:alnum:]._]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("[[:alpha:]]\\([[:alnum:]_]+\\)?" 0 'web-mode-variable-name-face) + )) + +(defvar web-mode-freemarker-font-lock-keywords + (list + '("") '(1 'web-mode-keyword-face)) + '("\\_<\\([[:alnum:]._]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("[[:alpha:]]\\([[:alnum:]_]+\\)?" 0 'web-mode-variable-name-face) + )) + +(defvar web-mode-directive-font-lock-keywords + (list + '("<%@[ ]*\\([[:alpha:]]+\\)[ ]+" 1 'web-mode-block-control-face) + '("\\_<\\([[:alpha:]]+=\\)\\(\"[^\"]*\"\\)" + (1 'web-mode-block-attr-name-face t t) + (2 'web-mode-block-attr-value-face t t)) + )) + +(defvar web-mode-erb-font-lock-keywords + (list + '("[^:]\\(:[[:alnum:]_]+\\)" 1 'web-mode-symbol-face) + '("\\([[:alnum:]_]+:\\)[ ]+" 1 'web-mode-symbol-face) + (cons (concat "\\_<\\(" web-mode-erb-builtins "\\)\\_>") '(0 'web-mode-builtin-face)) + (cons (concat "\\_<\\(" web-mode-erb-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + '("\\_<\\(self\\|true\\|false\\|nil\\)\\_>" 0 'web-mode-variable-name-face) + '("[@$]@?\\([[:alnum:]_]+\\)" 0 'web-mode-variable-name-face) + '("class[ ]+\\([[:alnum:]_]+\\)" 1 'web-mode-type-face) + '("def[ ]+\\([[:alnum:]_]+\\)" 1 'web-mode-function-name-face) + '("\\(?:\\_<\\|::\\)\\([A-Z]+[[:alnum:]_]+\\)" 1 (unless (eq (char-after) ?\() 'web-mode-type-face)) + '("/[^/]+/" 0 'web-mode-string-face) + )) + +(defvar web-mode-ejs-font-lock-keywords + web-mode-javascript-font-lock-keywords) + +(defvar web-mode-python-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-python-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + )) + +(defvar web-mode-erlang-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-erlang-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + (cons (concat "\\_<\\(" web-mode-erlang-constants "\\)\\_>") '(0 'web-mode-constant-face)) + '("@\\([[:alnum:]_]+\\)" 0 'web-mode-variable-name-face) + '("[ ]\\(:[[:alnum:]-_]+\\)" 1 'web-mode-symbol-face) + )) + +(defvar web-mode-mason-code-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-mason-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + '("sub[ ]+\\([[:alnum:]_]+\\)" 1 'web-mode-function-name-face) + '("\\_<\\([[:alnum:]_]+\\)[ ]?::" 1 'web-mode-type-face) + '("\\([@]\\)\\([[:alnum:]#_]*\\)" (1 nil) (2 'web-mode-variable-name-face)) + '("\\_<\\([$%]\\)\\([[:alnum:]@#_]*\\)" (1 nil) (2 'web-mode-variable-name-face)) + '("{\\([[:alnum:]_]+\\)}" 1 'web-mode-variable-name-face) + '("\\_<\\(\\sw+\\)[ ]?(" 1 'web-mode-function-call-face) + '("[[:alnum:]_][ ]?::[ ]?\\([[:alnum:]_]+\\)" 1 'web-mode-variable-name-face) + '("->[ ]?\\([[:alnum:]_]+\\)" 1 'web-mode-variable-name-face) + '("\\(?:method\\|def\\) \\([[:alnum:]._]+\\)" 1 'web-mode-function-name-face) + '("|[ ]*\\([[:alnum:],]+\\)[ ]*%>" 1 'web-mode-filter-face) + )) + +(defvar web-mode-mason-block-font-lock-keywords + (list + '("<[/]?%\\([[:alpha:]]+\\)" 1 'web-mode-block-control-face) + '("[[:alpha:]]" 0 'web-mode-block-attr-value-face) + )) + +(defvar web-mode-mojolicious-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-perl-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + '("\\_<\\(begin\\|end\\)\\_>" 1 'web-mode-constant-face) + '("\\_<\\([$]\\)\\([[:alnum:]_]*\\)" (1 nil) (2 'web-mode-variable-name-face)) + )) + +(defvar web-mode-lsp-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-lsp-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + (cons (concat "\\_<\\(" web-mode-lsp-constants "\\)\\_>") '(1 'web-mode-constant-face)) + '("[ ]\\(:[[:alnum:]-_]+\\)" 1 'web-mode-symbol-face) + '("(defun \\([[:alnum:]-:]+\\)" 1 'web-mode-function-name-face) + '("(defvar \\([[:alnum:]-:]+\\)" 1 'web-mode-variable-name-face) + )) + +(defvar web-mode-cl-emb-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-cl-emb-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + (cons (concat "\\_<\\(" web-mode-cl-emb-constants "\\)\\_>") '(0 'web-mode-constant-face)) + '("\\(@\\)" 1 'web-mode-function-call-face) + (list (concat "\\(@" web-mode-cl-emb-keywords "\\)[ ]+\\([[:alnum:]_]+\\)") + '(1 'web-mode-keyword-face) + '(2 'web-mode-variable-name-face)) + )) + +(defvar web-mode-php-font-lock-keywords + (list + (cons (concat "\\_<\\(" web-mode-php-keywords "\\)\\_>") '(0 'web-mode-keyword-face)) + (cons (concat "(\\_<\\(" web-mode-php-types "\\)\\_>") '(1 'web-mode-type-face)) + (cons (concat "\\_<\\(" web-mode-php-constants "\\)\\_>") '(0 'web-mode-constant-face)) + '("function[ ]+\\([[:alnum:]_]+\\)" 1 'web-mode-function-name-face) + '("\\_<\\([[:alnum:]_]+\\)[ ]?(" 1 'web-mode-function-call-face) + '("[[:alnum:]_][ ]?::[ ]?\\([[:alnum:]_]+\\)" 1 'web-mode-constant-face) + '("->[ ]?\\([[:alnum:]_]+\\)" 1 'web-mode-variable-name-face) + '("\\_<\\([[:alnum:]_]+\\)[ ]?::" 1 'web-mode-type-face) + '("\\_<\\(instanceof\\|class\\|extends\\|new\\)[ ]+\\([[:alnum:]_]+\\)" 2 'web-mode-type-face) + '("\\(\\_<\\|[+-]\\)\\([$]\\)\\([[:alnum:]_]*\\)" (2 nil) (3 'web-mode-variable-name-face)) + )) + +(defvar web-mode-spip-font-lock-keywords + (list + '("<:.+:>" 0 'web-mode-block-string-face) + '("#[A-Z0-9_]+" 0 'web-mode-variable-name-face) + '("|[a-z0-9_=!?<>]+" 0 'web-mode-function-call-face) + '("(\\([[:alnum:]_ ]+\\))" 1 'web-mode-constant-face) + )) + +(defvar web-mode-latex-font-lock-keywords + (list + '("[[:alnum:]_]+" 0 'web-mode-function-name-face t t) + )) + +(defvar web-mode-blade-font-lock-keywords + (append + (list + '("@\\([[:alpha:]_]+\\)" (1 'web-mode-block-control-face))) + web-mode-php-font-lock-keywords)) + +(defvar web-mode-engines-font-lock-keywords + '(("angular" . web-mode-angular-font-lock-keywords) + ("blade" . web-mode-blade-font-lock-keywords) + ("cl-emb" . web-mode-cl-emb-font-lock-keywords) + ("closure" . web-mode-closure-font-lock-keywords) + ("ctemplate" . web-mode-ctemplate-font-lock-keywords) + ("dust" . web-mode-dust-font-lock-keywords) + ("elixir" . web-mode-erlang-font-lock-keywords) + ("ejs" . web-mode-ejs-font-lock-keywords) + ("erb" . web-mode-erb-font-lock-keywords) + ("go" . web-mode-go-font-lock-keywords) + ("hero" . web-mode-go-font-lock-keywords) + ("lsp" . web-mode-lsp-font-lock-keywords) + ("marko" . web-mode-marko-font-lock-keywords) + ("mojolicious" . web-mode-mojolicious-font-lock-keywords) + ("php" . web-mode-php-font-lock-keywords) + ("python" . web-mode-python-font-lock-keywords) + ("razor" . web-mode-razor-font-lock-keywords) + ("riot" . web-mode-riot-font-lock-keywords) + ("smarty" . web-mode-smarty-font-lock-keywords) + ("spip" . web-mode-spip-font-lock-keywords) + ("template-toolkit" . web-mode-template-toolkit-font-lock-keywords) + ("underscore" . web-mode-underscore-font-lock-keywords) + ("web2py" . web-mode-web2py-font-lock-keywords) + ("velocity" . web-mode-velocity-font-lock-keywords) + ("vue" . web-mode-vue-font-lock-keywords) + ("xoops" . web-mode-smarty-font-lock-keywords) + ) + "Engines font-lock keywords") + +(defvar web-mode-before-auto-complete-hooks nil + "List of functions to run before triggering the auto-complete library. + +Auto-complete sources will sometimes need some tweaking to work +nicely with web-mode. This hook gives users the chance to adjust +the environment as needed for ac-sources, right before they're used.") + +(defvar web-mode-ignore-ac-start-advice nil + "If not nil 'defadvice' for 'ac-start' will be ignored. + +Can be set inside a hook in 'web-mode-before-auto-complete-hooks' to +non nil to ignore the defadvice which sets ac-sources according to current +language. This is needed if the corresponding auto-completion triggers +another auto-completion with different ac-sources (e.g. ac-php)") + +(defvar web-mode-ac-sources-alist nil + "alist mapping language names to ac-sources for that language.") + +(defvar web-mode-syntax-table + (let ((table (make-syntax-table))) + (modify-syntax-entry ?- "_" table) + (modify-syntax-entry ?_ "_" table) ;#563 + (modify-syntax-entry ?< "." table) + (modify-syntax-entry ?> "." table) + (modify-syntax-entry ?& "." table) + (modify-syntax-entry ?/ "." table) + (modify-syntax-entry ?= "." table) + (modify-syntax-entry ?% "." table) + table) + "Syntax table used to reveal whitespaces.") + +(defvar web-mode-map + (let ((map (make-sparse-keymap))) + + (define-key map [menu-bar wm] (cons "Web-Mode" (make-sparse-keymap))) + (define-key map [menu-bar wm dom] (cons "Dom" (make-sparse-keymap))) + (define-key map [menu-bar wm blk] (cons "Block" (make-sparse-keymap))) + (define-key map [menu-bar wm attr] (cons "Html Attr" (make-sparse-keymap))) + (define-key map [menu-bar wm tag] (cons "Html Tag" (make-sparse-keymap))) + (define-key map [menu-bar wm elt] (cons "Html Element" (make-sparse-keymap))) + + (define-key map [menu-bar wm sep-1] '(menu-item "--")) + + (define-key map [menu-bar wm dom dom-xpa] '(menu-item "XPath" web-mode-dom-xpath)) + (define-key map [menu-bar wm dom dom-tra] '(menu-item "Traverse" web-mode-dom-traverse)) + (define-key map [menu-bar wm dom dom-err] '(menu-item "Show error(s)" web-mode-dom-errors-show)) + (define-key map [menu-bar wm dom dom-ent] '(menu-item "Replace html entities" web-mode-dom-entities-replace)) + (define-key map [menu-bar wm dom dom-quo] '(menu-item "Replace dumb quotes" web-mode-dom-quotes-replace)) + (define-key map [menu-bar wm dom dom-apo] '(menu-item "Replace apostrophes" web-mode-dom-apostrophes-replace)) + (define-key map [menu-bar wm dom dom-nor] '(menu-item "Normalize" web-mode-dom-normalize)) + + (define-key map [menu-bar wm blk blk-sel] '(menu-item "Select" web-mode-block-select)) + (define-key map [menu-bar wm blk blk-pre] '(menu-item "Previous" web-mode-block-previous)) + (define-key map [menu-bar wm blk blk-nex] '(menu-item "Next" web-mode-block-next)) + (define-key map [menu-bar wm blk blk-kil] '(menu-item "Kill" web-mode-block-kill)) + (define-key map [menu-bar wm blk blk-end] '(menu-item "End" web-mode-block-end)) + (define-key map [menu-bar wm blk blk-clo] '(menu-item "Close" web-mode-block-close)) + (define-key map [menu-bar wm blk blk-beg] '(menu-item "Beginning" web-mode-block-beginning)) + + (define-key map [menu-bar wm attr attr-ins] '(menu-item "Insert" web-mode-attribute-insert)) + (define-key map [menu-bar wm attr attr-end] '(menu-item "End" web-mode-attribute-end)) + (define-key map [menu-bar wm attr attr-beg] '(menu-item "Beginning" web-mode-attribute-beginning)) + (define-key map [menu-bar wm attr attr-sel] '(menu-item "Select" web-mode-attribute-select)) + (define-key map [menu-bar wm attr attr-kil] '(menu-item "Kill" web-mode-attribute-kill)) + (define-key map [menu-bar wm attr attr-nex] '(menu-item "Next" web-mode-attribute-next)) + (define-key map [menu-bar wm attr attr-pre] '(menu-item "Previous" web-mode-attribute-previous)) + (define-key map [menu-bar wm attr attr-tra] '(menu-item "Transpose" web-mode-attribute-transpose)) + + (define-key map [menu-bar wm tag tag-beg] '(menu-item "Sort Attributes" web-mode-tag-attributes-sort)) + (define-key map [menu-bar wm tag tag-sel] '(menu-item "Select" web-mode-tag-select)) + (define-key map [menu-bar wm tag tag-pre] '(menu-item "Previous" web-mode-tag-previous)) + (define-key map [menu-bar wm tag tag-nex] '(menu-item "Next" web-mode-tag-next)) + (define-key map [menu-bar wm tag tag-end] '(menu-item "End" web-mode-tag-end)) + (define-key map [menu-bar wm tag tag-beg] '(menu-item "Beginning" web-mode-tag-beginning)) + + (define-key map [menu-bar wm elt elt-wra] '(menu-item "Wrap" web-mode-element-wrap)) + (define-key map [menu-bar wm elt elt-van] '(menu-item "Vanish" web-mode-element-vanish)) + (define-key map [menu-bar wm elt elt-exc] '(menu-item "Transpose" web-mode-element-transpose)) + (define-key map [menu-bar wm elt elt-sel] '(menu-item "Select" web-mode-element-select)) + (define-key map [menu-bar wm elt elt-ren] '(menu-item "Rename" web-mode-element-rename)) + (define-key map [menu-bar wm elt elt-pre] '(menu-item "Previous" web-mode-element-previous)) + (define-key map [menu-bar wm elt elt-par] '(menu-item "Parent" web-mode-element-parent)) + (define-key map [menu-bar wm elt elt-nex] '(menu-item "Next" web-mode-element-next)) + (define-key map [menu-bar wm elt elt-mut] '(menu-item "Mute blanks" web-mode-element-mute-blanks)) + (define-key map [menu-bar wm elt elt-del] '(menu-item "Kill" web-mode-element-kill)) + (define-key map [menu-bar wm elt elt-end] '(menu-item "End" web-mode-element-end)) + (define-key map [menu-bar wm elt elt-inn] '(menu-item "Content (select)" web-mode-element-content-select)) + (define-key map [menu-bar wm elt elt-clo] '(menu-item "Close" web-mode-element-close)) + (define-key map [menu-bar wm elt elt-ins] '(menu-item "Insert" web-mode-element-insert)) + (define-key map [menu-bar wm elt elt-dup] '(menu-item "Clone" web-mode-element-clone)) + (define-key map [menu-bar wm elt elt-cfo] '(menu-item "Children fold" web-mode-element-children-fold-or-unfold)) + (define-key map [menu-bar wm elt elt-chi] '(menu-item "Child" web-mode-element-child)) + (define-key map [menu-bar wm elt elt-beg] '(menu-item "Beginning" web-mode-element-beginning)) + + (define-key map [menu-bar wm fol] '(menu-item "Fold/Unfold" web-mode-fold-or-unfold)) + (define-key map [menu-bar wm hig] '(menu-item "Highlight buffer" web-mode-buffer-highlight)) + (define-key map [menu-bar wm ind] '(menu-item "Indent buffer" web-mode-buffer-indent)) + (define-key map [menu-bar wm nav] '(menu-item "Tag/Block navigation" web-mode-navigate)) + (define-key map [menu-bar wm exp] '(menu-item "Mark and Expand" web-mode-mark-and-expand)) + (define-key map [menu-bar wm spa] '(menu-item "Toggle whitespaces" web-mode-whitespaces-show)) + (define-key map [menu-bar wm sni] '(menu-item "Insert snippet" web-mode-snippet-insert)) + + ;;-------------------------------------------------------------------------- + ;; "C-c " are reserved for users + + (define-key map (kbd "C-c C-a b") 'web-mode-attribute-beginning) + (define-key map (kbd "C-c C-a e") 'web-mode-attribute-end) + (define-key map (kbd "C-c C-a i") 'web-mode-attribute-insert) + (define-key map (kbd "C-c C-a n") 'web-mode-attribute-next) + (define-key map (kbd "C-c C-a s") 'web-mode-attribute-select) + (define-key map (kbd "C-c C-a k") 'web-mode-attribute-kill) + (define-key map (kbd "C-c C-a p") 'web-mode-attribute-previous) + (define-key map (kbd "C-c C-a t") 'web-mode-attribute-transpose) + + (define-key map (kbd "C-c C-b b") 'web-mode-block-beginning) + (define-key map (kbd "C-c C-b c") 'web-mode-block-close) + (define-key map (kbd "C-c C-b e") 'web-mode-block-end) + (define-key map (kbd "C-c C-b k") 'web-mode-block-kill) + (define-key map (kbd "C-c C-b n") 'web-mode-block-next) + (define-key map (kbd "C-c C-b p") 'web-mode-block-previous) + (define-key map (kbd "C-c C-b s") 'web-mode-block-select) + + (define-key map (kbd "C-c C-d a") 'web-mode-dom-apostrophes-replace) + (define-key map (kbd "C-c C-d d") 'web-mode-dom-errors-show) + (define-key map (kbd "C-c C-d e") 'web-mode-dom-entities-replace) + (define-key map (kbd "C-c C-d n") 'web-mode-dom-normalize) + (define-key map (kbd "C-c C-d q") 'web-mode-dom-quotes-replace) + (define-key map (kbd "C-c C-d t") 'web-mode-dom-traverse) + (define-key map (kbd "C-c C-d x") 'web-mode-dom-xpath) + + (define-key map (kbd "C-c C-e /") 'web-mode-element-close) + (define-key map (kbd "C-c C-e a") 'web-mode-element-content-select) + (define-key map (kbd "C-c C-e b") 'web-mode-element-beginning) + (define-key map (kbd "C-c C-e c") 'web-mode-element-clone) + (define-key map (kbd "C-c C-e d") 'web-mode-element-child) + (define-key map (kbd "C-c C-e e") 'web-mode-element-end) + (define-key map (kbd "C-c C-e f") 'web-mode-element-children-fold-or-unfold) + (define-key map (kbd "C-c C-e i") 'web-mode-element-insert) + (define-key map (kbd "C-c C-e k") 'web-mode-element-kill) + (define-key map (kbd "C-c C-e m") 'web-mode-element-mute-blanks) + (define-key map (kbd "C-c C-e n") 'web-mode-element-next) + (define-key map (kbd "C-c C-e p") 'web-mode-element-previous) + (define-key map (kbd "C-c C-e r") 'web-mode-element-rename) + (define-key map (kbd "C-c C-e s") 'web-mode-element-select) + (define-key map (kbd "C-c C-e t") 'web-mode-element-transpose) + (define-key map (kbd "C-c C-e u") 'web-mode-element-parent) + (define-key map (kbd "C-c C-e v") 'web-mode-element-vanish) + (define-key map (kbd "C-c C-e w") 'web-mode-element-wrap) + + (define-key map (kbd "C-c C-t a") 'web-mode-tag-attributes-sort) + (define-key map (kbd "C-c C-t b") 'web-mode-tag-beginning) + (define-key map (kbd "C-c C-t e") 'web-mode-tag-end) + (define-key map (kbd "C-c C-t m") 'web-mode-tag-match) + (define-key map (kbd "C-c C-t n") 'web-mode-tag-next) + (define-key map (kbd "C-c C-t p") 'web-mode-tag-previous) + (define-key map (kbd "C-c C-t s") 'web-mode-tag-select) + + ;;-------------------------------------------------------------------------- + + ;;(define-key map (kbd "M-q") 'fill-paragraph) + (define-key map (kbd "M-;") 'web-mode-comment-or-uncomment) + + ;;C-c C-a : attribute + ;;C-c C-b : block + ;;C-c C-d : dom + ;;C-c C-e : element + (define-key map (kbd "C-c C-f") 'web-mode-fold-or-unfold) + (define-key map (kbd "C-c C-h") 'web-mode-buffer-highlight) + (define-key map (kbd "C-c C-i") 'web-mode-buffer-indent) + (define-key map (kbd "C-c C-j") 'web-mode-jshint) + (define-key map (kbd "C-c C-l") 'web-mode-file-link) + (define-key map (kbd "C-c C-m") 'web-mode-mark-and-expand) + (define-key map (kbd "C-c C-n") 'web-mode-navigate) + (define-key map (kbd "C-c C-r") 'web-mode-reload) + (define-key map (kbd "C-c C-s") 'web-mode-snippet-insert) + ;;C-c C-t : tag + (define-key map (kbd "C-c C-w") 'web-mode-whitespaces-show) + + map) + "Keymap for `web-mode'.") + +;;---- COMPATIBILITY ----------------------------------------------------------- + +(eval-and-compile + + ;; compatibility with emacs < 23 + (defun web-mode-string-match-p (regexp string &optional start) + "Same as `string-match' except it does not change the match data." + (let ((inhibit-changing-match-data t)) + (string-match regexp string start))) + + (unless (fboundp 'string-match-p) + (fset 'string-match-p (symbol-function 'web-mode-string-match-p))) + + ;; compatibility with emacs < 23.3 + (if (fboundp 'with-silent-modifications) + (defalias 'web-mode-with-silent-modifications 'with-silent-modifications) + (defmacro web-mode-with-silent-modifications (&rest body) + `(let ((old-modified-p (buffer-modified-p)) + (inhibit-modification-hooks t) + (buffer-undo-list t)) + (unwind-protect + ,@body + (set-buffer-modified-p old-modified-p))))) + + ;; compatibility with emacs < 24.3 + (defun web-mode-buffer-narrowed-p () + (if (fboundp 'buffer-narrowed-p) + (buffer-narrowed-p) + (/= (- (point-max) (point-min)) (buffer-size)))) + + ;; compatibility with emacs < 24 + (defalias 'web-mode-prog-mode + (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode)) + + ;; compatibility with emacs < 24.3 + (unless (fboundp 'setq-local) + (defmacro setq-local (var val) + `(set (make-local-variable ',var) ,val))) + + ;; compatability with emacs < 24.4 + (defun web-mode-string-suffix-p (suffix string) + "Return t if STRING ends with SUFFIX." + (and (string-match (rx-to-string `(: ,suffix eos) t) + string) + t)) + + (unless (fboundp 'string-suffix-p) + (fset 'string-suffix-p (symbol-function 'web-mode-string-suffix-p))) + + ) ;eval-and-compile + +;;---- MAJOR MODE -------------------------------------------------------------- + +;;;###autoload +(define-derived-mode web-mode web-mode-prog-mode "Web" + "Major mode for editing web templates." + + (make-local-variable 'web-mode-attr-indent-offset) + (make-local-variable 'web-mode-attr-value-indent-offset) + (make-local-variable 'web-mode-auto-pairs) + (make-local-variable 'web-mode-block-regexp) + (make-local-variable 'web-mode-change-beg) + (make-local-variable 'web-mode-change-end) + (make-local-variable 'web-mode-code-indent-offset) + (make-local-variable 'web-mode-column-overlays) + (make-local-variable 'web-mode-comment-formats) + (make-local-variable 'web-mode-comment-style) + (make-local-variable 'web-mode-content-type) + (make-local-variable 'web-mode-css-indent-offset) + (make-local-variable 'web-mode-display-table) + (make-local-variable 'web-mode-django-control-blocks) + (make-local-variable 'web-mode-django-control-blocks-regexp) + (make-local-variable 'web-mode-enable-block-face) + (make-local-variable 'web-mode-enable-inlays) + (make-local-variable 'web-mode-enable-part-face) + (make-local-variable 'web-mode-enable-sexp-functions) + (make-local-variable 'web-mode-engine) + (make-local-variable 'web-mode-engine-attr-regexp) + (make-local-variable 'web-mode-engine-file-regexps) + (make-local-variable 'web-mode-engine-open-delimiter-regexps) + (make-local-variable 'web-mode-engine-token-regexp) + (make-local-variable 'web-mode-expand-initial-pos) + (make-local-variable 'web-mode-expand-initial-scroll) + (make-local-variable 'web-mode-expand-previous-state) + (make-local-variable 'web-mode-indent-style) + (make-local-variable 'web-mode-indentless-attributes) + (make-local-variable 'web-mode-indentless-elements) + (make-local-variable 'web-mode-is-scratch) + (make-local-variable 'web-mode-fontification-off) + (make-local-variable 'web-mode-jshint-errors) + (make-local-variable 'web-mode-last-enabled-feature) + (make-local-variable 'web-mode-markup-indent-offset) + (make-local-variable 'web-mode-minor-engine) + (make-local-variable 'web-mode-overlay-tag-end) + (make-local-variable 'web-mode-overlay-tag-start) + (make-local-variable 'web-mode-part-beg) + (make-local-variable 'web-mode-scan-beg) + (make-local-variable 'web-mode-scan-end) + (make-local-variable 'web-mode-sql-indent-offset) + (make-local-variable 'web-mode-time) + + (make-local-variable 'comment-end) + (make-local-variable 'comment-region-function) + (make-local-variable 'comment-start) + (make-local-variable 'fill-paragraph-function) + (make-local-variable 'font-lock-beg) + (make-local-variable 'font-lock-defaults) + (make-local-variable 'font-lock-extend-region-functions) + (make-local-variable 'font-lock-end) + (make-local-variable 'font-lock-support-mode) + (make-local-variable 'font-lock-unfontify-region-function) + (make-local-variable 'imenu-case-fold-search) + (make-local-variable 'imenu-create-index-function) + (make-local-variable 'imenu-generic-expression) + (make-local-variable 'indent-line-function) + (make-local-variable 'parse-sexp-lookup-properties) + (make-local-variable 'uncomment-region-function) + (make-local-variable 'yank-excluded-properties) + + (setq web-mode-time (current-time)) + + (setq comment-end "-->" + comment-region-function 'web-mode-comment-or-uncomment-region + comment-start "")) + ((string= sub1 "<") + (setq closing-string ">" + delim-open "")) + ((string= sub1 "[") + (setq closing-string "]" + delim-open "\\[/?[#@]" + delim-close "/?\\]")) + (t + (setq closing-string "}" + delim-open "${" + delim-close "}")) + ) + ) ;freemarker + + ((string= web-mode-engine "velocity") + (cond + ((string= sub2 "##") + (setq closing-string "EOL")) + ((string= sub2 "#*") + (setq closing-string "*#")) + (t + (setq closing-string "EOV" + delim-open "#")) + ) + ) ;velocity + + ((string= web-mode-engine "razor") + (cond + ((string= sub2 "@@") + (forward-char 2) + (setq closing-string nil)) + ((string= sub2 "@*") + (setq closing-string "*@")) + ((string= sub1 "@") + (setq closing-string "EOR" + delim-open "@")) + ((and (string= sub1 "}") + (looking-at-p "[ ]*\n")) + ;;(setq closing-string "EOC") + (save-excursion + (let (paren-pos) + (setq paren-pos (web-mode-part-opening-paren-position (1- (point)))) + (if (and paren-pos (get-text-property paren-pos 'block-side)) + (setq closing-string "EOC") + (setq closing-string nil) + ) ;if + ) ;let + ) ;save-excursion + ;;(message "%s %S %S" sub2 (point) (get-text-property (point) 'part-side)) + ) + ((string= sub1 "}") + ;;(message "%s: %s" (point) sub1) + (save-excursion + (let (paren-pos) + (setq paren-pos (web-mode-part-opening-paren-position (1- (point)))) + (if (and paren-pos (get-text-property paren-pos 'block-side)) + (setq closing-string "EOR") + (setq closing-string nil) + ) ;if + ) ;let + ) ;save-excursion + ) ;case } + ) ;cond + ) ;razor + + ((and (string= web-mode-engine "riot") + (not (get-text-property open 'part-side))) + (setq closing-string (if (string= tagopen "{") "}" "/// end script") + delim-open "{" + delim-close "}") + ) ;riot + + ((string= web-mode-engine "spip") + (cond + ((and (string= sub1 "#") + (looking-at "[A-Z0-9_]+")) + (setq closing-string (match-string-no-properties 0))) + ((string= sub1 "(") + (setq closing-string '("(" . ")"))) + ((string= sub1 "{") + (setq closing-string '("{" . "}"))) + ((string= sub2 "<:") + (setq closing-string ":>")) + (t + (setq closing-string "]")) + )) + + ((string= web-mode-engine "marko") + (setq closing-string "}" + delim-open "${" + delim-close "}") + ) ;marko + + ) ;cond + + (when closing-string + (cond + + ((listp closing-string) + (cond + ((web-mode-rsf-balanced (car closing-string) (cdr closing-string) reg-end t) + (setq close (match-end 0) + pos (point)) + ) + ((and (string= web-mode-engine "php") + (string= " (point) reg-end) reg-end (point)) + pos (if (> (point) reg-end) reg-end (point))) + (goto-char pos)) + + ((string= closing-string "EOV") + (web-mode-velocity-skip open) + (setq close (point) + pos (point))) + + ((and (member web-mode-engine '("ctemplate")) + (re-search-forward closing-string reg-end t)) + (setq close (match-end 0) + pos (point))) + + ((search-forward closing-string reg-end t) + (setq close (match-end 0) + pos (point))) + ) ;cond + + (when (and close (>= reg-end pos)) + ;;(message "pos(%S) : open(%S) close(%S)" pos open close) + (put-text-property open (1+ open) 'block-beg 0) + (put-text-property open (1+ open) 'block-controls 0) + (put-text-property open close 'block-side t) + (put-text-property (1- close) close 'block-end t) + (when delim-open + (web-mode-block-delimiters-set open close delim-open delim-close)) + (web-mode-block-scan open close) + (cond + ((and (string= web-mode-engine "erb") + (looking-at-p "<%= javascript_tag do %>")) + (setq tagopen "<%= javascript_tag do %>")) + ((and (string= web-mode-engine "mako") + (looking-at-p "<%block filter=\"collect_js\">")) + (setq tagopen "<%block filter=\"collect_js\">")) + ((and (string= web-mode-engine "mako") + (looking-at-p "<%block filter=\"collect_css\">")) + (setq tagopen "<%block filter=\"collect_css\">")) + ((and (string= web-mode-engine "django") + (looking-at-p "{% javascript %}")) + (setq tagopen "{% javascript %}")) + ((and (string= web-mode-engine "django") + (looking-at-p "{% schema %}")) + (setq tagopen "{% schema %}")) + ((and (string= web-mode-engine "django") + (looking-at-p "{% stylesheet %}")) + (setq tagopen "{% stylesheet %}")) + ) + ;;(message "%S %s" (point) tagopen) + (when (and (member tagopen '("" + "<%block filter=\"collect_js\">" + "<%block filter=\"collect_css\">" + "{% javascript %}" + "{% schema %}" + "{% stylesheet %}")) + (setq part-beg close) + (setq tagclose + (cond + ((string= tagopen "") "<% end %>") + ((member tagopen '("<%block filter=\"collect_js\">" + "<%block filter=\"collect_css\">")) " part-end part-beg)) + ;;(message "end=%S" (point)) + (put-text-property part-beg part-end + 'part-side + (cond + ((member tagopen '("" "{% stylesheet %}")) 'css) + (t 'javascript))) + (setq pos part-beg + part-beg nil + part-end nil) + ) ;when + ) ;when close + + (if pos (goto-char pos)) + + ) ;when closing-string + + ) ;while + + (cond + ((>= i 2000) + (message "scan-blocks ** warning (%S) **" i)) + ((string= web-mode-engine "razor") + (web-mode-process-blocks reg-beg reg-end 'web-mode-block-scan)) + ((string= web-mode-engine "django") + (web-mode-scan-engine-comments reg-beg reg-end + "{% comment %}" "{% endcomment %}")) + ((string= web-mode-engine "mako") + (web-mode-scan-engine-comments reg-beg reg-end + "<%doc>" "")) + ((string= web-mode-engine "mason") + (web-mode-scan-engine-comments reg-beg reg-end + "<%doc>" "")) + ) ;cond + + ))) + +(defun web-mode-closure-skip (reg-beg reg-end) + (let (regexp char pos inc continue found) + (setq regexp "[\"'{}]" + inc 0) + (while (and (not found) (re-search-forward regexp reg-end t)) + (setq char (char-before)) + (cond + ((get-text-property (point) 'block-side) + (setq found t)) + ((eq char ?\{) + (setq inc (1+ inc))) + ((eq char ?\}) + (cond + ((and (not (eobp)) + (< inc 1)) + (setq found t + pos (point))) + ((> inc 0) + (setq inc (1- inc))) + ) + ) + ((eq char ?\') + (setq continue t) + (while (and continue (search-forward "'" reg-end t)) + (setq continue (web-mode-string-continue-p reg-beg)) + ) + ) + ((eq char ?\") + (setq continue t) + (while (and continue (search-forward "\"" reg-end t)) + (setq continue (web-mode-string-continue-p reg-beg)) + ) + ) + ) ;cond + ) ;while + pos)) + +(defun web-mode-django-skip (reg-beg reg-end) + (let (regexp char pos inc continue found) + (setq regexp "[\"'{}]" + inc 0) + (while (and (not found) (re-search-forward regexp reg-end t)) + (setq char (char-before)) + (cond + ((get-text-property (point) 'block-side) + (setq found t)) + ((eq char ?\{) + (setq inc (1+ inc))) + ((eq char ?\}) + (cond + ((and (not (eobp)) + (eq (char-after) ?\}) + (< inc 2)) + (forward-char) + (setq found t + pos (1+ (point)))) + ((> inc 0) + (setq inc (1- inc))) + ) + ) + ((eq char ?\') + (setq continue t) + (while (and continue (search-forward "'" reg-end t)) + (setq continue (web-mode-string-continue-p reg-beg)) + ) + ) + ((eq char ?\") + (setq continue t) + (while (and continue (search-forward "\"" reg-end t)) + (setq continue (web-mode-string-continue-p reg-beg)) + ) + ) + ) ;cond + ) ;while + pos)) + +(defun web-mode-velocity-skip (pos) + (goto-char pos) + (let ((continue t) (i 0)) + (when (eq ?\# (char-after)) + (forward-char)) + (when (member (char-after) '(?\$ ?\@)) + (forward-char)) + (when (member (char-after) '(?\!)) + (forward-char)) + (if (member (char-after) '(?\{)) + (search-forward "}") + (setq continue t) + (while continue + (skip-chars-forward "a-zA-Z0-9_-") + (when (> (setq i (1+ i)) 500) + (message "velocity-skip ** warning (%S) **" pos) + (setq continue nil)) + (when (member (char-after) '(?\()) + (search-forward ")" nil t)) + (if (member (char-after) '(?\.)) + (forward-char) + (setq continue nil)) + ) ;while + ) ;if + )) + +(defun web-mode-razor-skip (pos) + (goto-char pos) + (let ((continue t) (i 0)) + (while continue + (skip-chars-forward " =@a-zA-Z0-9_-") + (cond + ((> (setq i (1+ i)) 500) + (message "razor-skip ** warning **") + (setq continue nil)) + ((and (eq (char-after) ?\*) + (eq (char-before) ?@)) + (when (not (search-forward "*@" nil t)) + (setq continue nil)) + ) + ((looking-at-p "@[({]") + (forward-char) + (when (setq pos (web-mode-closing-paren-position (point))) + (goto-char pos)) + (forward-char) + ) + ((and (not (eobp)) (eq ?\( (char-after))) + (cond + ((looking-at-p "[ \n]*[<@]") + (setq continue nil)) + ((setq pos (web-mode-closing-paren-position)) + (goto-char pos) + (forward-char)) + (t + (forward-char)) + ) ;cond + ) + ((and (not (eobp)) (eq ?\< (char-after)) (looking-back "[a-z]" (point-min))) + (setq pos (point)) + (cond + ;; #988 + ((search-forward ">" (line-end-position) t) + (goto-char pos) + (setq continue nil) + ) + (t + (setq continue nil)) + ) ;cond + ) + ((and (not (eobp)) (eq ?\. (char-after))) + (forward-char)) + ((and (not (eobp)) (looking-at-p "[ \n]*else")) + (re-search-forward "[ \t]*else") + ) + ((looking-at-p "[ \n]*{") + (search-forward "{") + (if (looking-at-p "[ \n]*[<@]") + (setq continue nil) + (backward-char) + (when (setq pos (web-mode-closing-paren-position)) + (goto-char pos)) + (forward-char) + ) ;if + ) + ((looking-at-p "}") + (forward-char)) + (t + (setq continue nil)) + ) ;cond + ) ;while + )) + +(defun web-mode-block-delimiters-set (reg-beg reg-end delim-open delim-close) + "Set text-property 'block-token to 'delimiter-(beg|end) on block delimiters (e.g. )" + ;;(message "reg-beg(%S) reg-end(%S) delim-open(%S) delim-close(%S)" reg-beg reg-end delim-open delim-close) + (when (member web-mode-engine + '("asp" "aspx" "cl-emb" "clip" "closure" "ctemplate" "django" "dust" + "elixir" "ejs" "erb" "freemarker" "go" "hero" "jsp" "lsp" "mako" "mason" "mojolicious" + "smarty" "template-toolkit" "web2py" "xoops")) + (save-excursion + (when delim-open + (goto-char reg-beg) + (looking-at delim-open) + (setq delim-open (match-string-no-properties 0))) + (when delim-close + (goto-char reg-end) + (looking-back delim-close reg-beg t) + (setq delim-close (match-string-no-properties 0))) + )) + (when delim-open + (put-text-property reg-beg (+ reg-beg (length delim-open)) + 'block-token 'delimiter-beg)) + (when delim-close + (put-text-property (- reg-end (length delim-close)) reg-end + 'block-token 'delimiter-end)) + ) + +(defun web-mode-process-blocks (reg-beg reg-end func) + (let ((i 0) (continue t) (block-beg reg-beg) (block-end nil)) + (while continue + (setq block-end nil) + (unless (get-text-property block-beg 'block-beg) + (setq block-beg (web-mode-block-next-position block-beg))) + (when (and block-beg (< block-beg reg-end)) + (setq block-end (web-mode-block-end-position block-beg))) + (cond + ((> (setq i (1+ i)) 2000) + (message "process-blocks ** warning (%S) **" (point)) + (setq continue nil)) + ((or (null block-end) (> block-end reg-end)) + (setq continue nil)) + (t + (setq block-end (1+ block-end)) + (funcall func block-beg block-end) + (setq block-beg block-end) + ) ;t + ) ;cond + ) ;while + )) + +(defun web-mode-block-scan (block-beg block-end) + (let (sub1 sub2 sub3 regexp token-type) + + ;;(message "block-beg=%S block-end=%S" block-beg block-end) + ;;(remove-text-properties block-beg block-end web-mode-scan-properties) + + (goto-char block-beg) + + (cond + ((>= (point-max) (+ block-beg 3)) + (setq sub3 (buffer-substring-no-properties block-beg (+ block-beg 3)) + sub2 (buffer-substring-no-properties block-beg (+ block-beg 2)) + sub1 (buffer-substring-no-properties block-beg (+ block-beg 1))) + ) + ((>= (point-max) (+ block-beg 2)) + (setq sub3 (buffer-substring-no-properties block-beg (+ block-beg 2)) + sub2 (buffer-substring-no-properties block-beg (+ block-beg 2)) + sub1 (buffer-substring-no-properties block-beg (+ block-beg 1))) + ) + (t + (setq sub1 (buffer-substring-no-properties block-beg (+ block-beg 1))) + (setq sub2 sub1 + sub3 sub1) + ) + ) + + (cond + + ((member web-mode-engine '("php" "lsp" "python" "web2py" "mason")) + (setq regexp web-mode-engine-token-regexp)) + + ((string= web-mode-engine "mako") + (cond + ((string= sub2 "##") + (setq token-type 'comment) + ) + (t + (setq regexp web-mode-engine-token-regexp)) + ) + ) ;mako + + ((string= web-mode-engine "django") + (cond + ((member sub2 '("{{" "{%")) + (setq regexp "\"\\|'")) + ((string= sub2 "{#") + (setq token-type 'comment)) + ) + ) ;django + + ((string= web-mode-engine "ctemplate") + (cond + ((string= sub3 "{{!") + (setq token-type 'comment)) + ((member sub2 '("{{")) + ) + ) + ) ;ctemplate + + ((string= web-mode-engine "go") + (cond + ((string= sub3 "{{/") + (setq token-type 'comment)) + ((string= sub2 "{{") + (setq regexp "\"\\|'")) + ) + ) ;go + + ((string= web-mode-engine "hero") + (cond + ((string= sub3 "<%#") + (setq token-type 'comment)) + (t + (setq regexp "\"\\|'")) + ) + ) ;hero + + ((string= web-mode-engine "razor") + (cond + ((string= sub2 "@*") + (setq token-type 'comment)) + (t + (setq regexp "//\\|@\\*\\|\"\\|'")) + ) + ) ;razor + + ((string= web-mode-engine "blade") + (cond + ((string= sub3 "{{-") + (setq token-type 'comment)) + (t + (setq regexp "\"\\|'")) + ) + ) ;blade + + ((string= web-mode-engine "cl-emb") + (cond + ((string= sub3 "<%#") + (setq token-type 'comment)) + (t + (setq regexp "\"\\|'")) + ) + ) ;cl-emb + + ((string= web-mode-engine "elixir") + (cond + ((string= sub3 "<%#") + (setq token-type 'comment)) + (t + (setq regexp "\"\\|'")) + ) + ) ;elixir + + ((string= web-mode-engine "mojolicious") + (cond + ((or (string= sub2 "%#") (string= sub3 "<%#")) + (setq token-type 'comment)) + (t + (setq regexp "\"\\|'")) + ) + ) ;mojolicious + + ((string= web-mode-engine "velocity") + (cond + ((member sub2 '("##" "#*")) + (setq token-type 'comment)) + ((member sub1 '("$" "#")) + (setq regexp "\"\\|'")) + ) + ) ;velocity + + ((string= web-mode-engine "jsp") + (cond + ((string= sub3 "<%-") + (setq token-type 'comment)) + ((string= sub3 "<%@") + (setq regexp "/\\*")) + ((member sub2 '("${" "#{")) + (setq regexp "\"\\|'")) + ((string= sub2 "<%") + (setq regexp "//\\|/\\*\\|\"\\|'")) + ) + ) ;jsp + + ((string= web-mode-engine "clip") + (setq regexp nil) + ) ;clip + + ((and (string= web-mode-engine "asp") + (string= sub2 "<%")) + (setq regexp "//\\|/\\*\\|\"\\|'") + ) ;asp + + ((string= web-mode-engine "aspx") + (cond + ((string= sub3 "<%-") + (setq token-type 'comment)) + ((string= sub3 "<%@") + (setq regexp "/\\*")) + ((string= sub3 "<%$") + (setq regexp "\"\\|'")) + (t + (setq regexp "//\\|/\\*\\|\"\\|'")) + ) + ) ;aspx + + ((string= web-mode-engine "freemarker") + (cond + ((member sub3 '("<#-" "[#-")) + (setq token-type 'comment)) + ((member sub2 '("${" "#{")) + (setq regexp "\"\\|'")) + ((or (member sub2 '("<@" "[@" "<#" "[#")) + (member sub3 '(" (- block-end block-beg) 6)) + (web-mode-block-tokenize + (web-mode-block-code-beginning-position block-beg) + (web-mode-block-code-end-position block-beg) + regexp) + ) + ) ;cond + + )) + +(defun web-mode-block-tokenize (reg-beg reg-end &optional regexp) + (unless regexp (setq regexp web-mode-engine-token-regexp)) + ;;(message "tokenize: reg-beg(%S) reg-end(%S) regexp(%S)" reg-beg reg-end regexp) + ;;(message "tokenize: reg-beg(%S) reg-end(%S) command(%S)" reg-beg reg-end this-command) + ;;(message "%S>%S : %S" reg-beg reg-end (buffer-substring-no-properties reg-beg reg-end)) + (save-excursion + (let ((pos reg-beg) beg end char match continue (flags 0) token-type token-end) + + (remove-list-of-text-properties reg-beg reg-end '(block-token)) + + ;; TODO : vérifier la cohérence + (put-text-property reg-beg reg-end 'block-side t) + + (goto-char reg-beg) + + (when (> (point) reg-end) + (message "block-tokenize ** reg-beg(%S) > reg-end(%S) **" reg-beg reg-end)) + + (while (and (< (point) reg-end) (re-search-forward regexp reg-end t)) + (setq beg (match-beginning 0) + match (match-string 0) + continue t + token-type 'comment + token-end (if (< reg-end (line-end-position)) reg-end (line-end-position)) + char (aref match 0)) + (cond + + ((and (string= web-mode-engine "asp") (eq char ?\')) + (goto-char token-end)) + + ((and (string= web-mode-engine "razor") (eq char ?\')) + (cond + ((looking-at-p "\\(.\\|[\\][bfntr]\\|[\\]u....\\)'") + (search-forward "'" reg-end t) + (setq token-type 'string) + ) + (t + (re-search-forward "[[:alnum:]_-]+") + (setq token-type 'symbol) + ))) + + ((eq char ?\') + (setq token-type 'string) + (while (and continue (search-forward "'" reg-end t)) + (setq continue (web-mode-string-continue-p reg-beg)) + )) + + ((eq char ?\") + (setq token-type 'string) + (while (and continue (search-forward "\"" reg-end t)) + (setq continue (web-mode-string-continue-p reg-beg)) + )) + + ((string= match "//") + (goto-char token-end)) + + ((eq char ?\;) + (goto-char token-end)) + + ((string= match "#|") + (unless (search-forward "|#" reg-end t) + (goto-char token-end))) + + ((eq char ?\#) + (goto-char token-end)) + + ((string= match "/*") + (unless (search-forward "*/" reg-end t) + (goto-char token-end)) + ) + + ((string= match "@*") + (unless (search-forward "*@" reg-end t) + (goto-char token-end))) + + ((eq char ?\<) + (setq token-type 'string) + (re-search-forward (concat "^[ ]*" (match-string 1)) reg-end t)) + + (t + (message "block-tokenize ** token end (%S) **" beg) + (setq token-type nil)) + + ) ;cond + + (put-text-property beg (point) 'block-token token-type) + + (when (eq token-type 'comment) + (put-text-property beg (1+ beg) 'syntax-table (string-to-syntax "<")) + (if (or (< (point) (line-end-position)) (= (point) (point-max))) + (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax ">")) ;#445 #480 + (put-text-property (point) (1+ (point)) 'syntax-table (string-to-syntax ">")) ;#377 + ) + ) + + ) ;while + + (web-mode-block-controls-unset pos) + + ))) + +(defun web-mode-set-php-controls (reg-beg reg-end) + (goto-char reg-beg) + (let (match controls + (continue t) + (regexp "endif\\|endforeach\\|endfor\\|endwhile\\|elseif\\|else\\|if\\|foreach\\|for\\|while")) + (while continue + (if (not (web-mode-block-rsf regexp reg-end)) + (setq continue nil) + (setq match (match-string-no-properties 0)) +;; (message "%S %S" match (point)) + (cond + ((and (member match '("else" "elseif")) + (looking-at-p "[ ]*[:(]")) + (setq controls (append controls (list (cons 'inside "if")))) + ) + ((and (>= (length match) 3) + (string= (substring match 0 3) "end")) + (setq controls (append controls (list (cons 'close (substring match 3))))) + ) + ((and (progn (skip-chars-forward "[ ]") t) + (eq (char-after) ?\() + (web-mode-closing-paren reg-end) + ;;(progn (message "ixi%S" (point))) + (looking-at-p ")[ ]*:")) + (setq controls (append controls (list (cons 'open match)))) + ) + ) ;cond + ) ;if + ) ;while + ;;(message "%S-%S %S" reg-beg reg-end controls) + (when (and controls (> (length controls) 1)) + (setq controls (web-mode-block-controls-reduce controls))) + controls)) + +(defun web-mode-block-controls-reduce (controls) + (when (and (eq (car (car controls)) 'open) + (member (cons 'close (cdr (car controls))) controls)) + (setq controls nil)) + controls) + +(defun web-mode-block-controls-unset (pos) + (cond + ((null (get-text-property pos 'block-side)) + (message "block-controls-unset ** invalid value (%S) **" pos)) + ((or (get-text-property pos 'block-beg) + (setq pos (web-mode-block-beginning-position pos))) + (put-text-property pos (1+ pos) 'block-controls 0)) + (t + (message "block-controls-unset ** failure (%S) **" (point))) + )) + +(defun web-mode-block-controls-get (pos) + (web-mode-with-silent-modifications + (let ((controls nil)) + (cond + ((null (get-text-property pos 'block-side)) + (message "block-controls-get ** invalid value (%S) **" pos)) + ((or (get-text-property pos 'block-beg) + (setq pos (web-mode-block-beginning-position pos))) + (setq controls (get-text-property pos 'block-controls)) + (when (integerp controls) + (web-mode-block-controls-set pos (web-mode-block-end-position pos)) + (setq controls (get-text-property pos 'block-controls)) + ) + ) + (t + (message "block-controls-get ** failure (%S) **" (point))) + ) ;cond + controls))) + +(defun web-mode-block-controls-set (reg-beg reg-end) + (save-excursion + (goto-char reg-beg) + (let (controls pos type control) + + (cond + + ((null web-mode-engine) + (message "block-controls-set ** unknown engine (%S) **" web-mode-engine) + ) + + ((string= web-mode-engine "php") + (setq controls (web-mode-set-php-controls reg-beg reg-end)) + (when (web-mode-block-starts-with "}" reg-beg) + (setq controls (append controls (list (cons 'close "{"))))) + (when (web-mode-block-ends-with (cons "{" "}") reg-beg) + (setq controls (append controls (list (cons 'open "{"))))) + ) ;php + + ((string= web-mode-engine "ejs") + (cond + ((web-mode-block-ends-with "}[ ]*else[ ]*{" reg-beg) + (setq controls (append controls (list (cons 'inside "{"))))) + ((web-mode-block-starts-with "}" reg-beg) + (setq controls (append controls (list (cons 'close "{"))))) + ((web-mode-block-ends-with "{" reg-beg) + (setq controls (append controls (list (cons 'open "{"))))) + ) + ) ;ejs + + ((string= web-mode-engine "erb") + (cond + ((web-mode-block-starts-with "else\\|elsif\\|when" reg-beg) + (setq controls (append controls (list (cons 'inside "ctrl"))))) + ((web-mode-block-starts-with "end" reg-beg) + (setq controls (append controls (list (cons 'close "ctrl"))))) + ((web-mode-block-ends-with " do\\( |.*|\\)?" reg-beg) + (setq controls (append controls (list (cons 'open "ctrl"))))) + ((and (web-mode-block-starts-with "\\(for\\|if\\|unless\\|case\\)\\_>" reg-beg) + (not (web-mode-block-ends-with "end" reg-end))) + (setq controls (append controls (list (cons 'open "ctrl"))))) + ) + ) ;erb + + ((string= web-mode-engine "django") + (cond + ((and (string= web-mode-minor-engine "jinja") ;#504 + (web-mode-block-starts-with "else\\_>" reg-beg)) + (let ((continue t) + (pos reg-beg) + (ctrl nil)) + (while continue + (cond + ((null (setq pos (web-mode-block-control-previous-position 'open pos))) + (setq continue nil)) + ((member (setq ctrl (cdr (car (get-text-property pos 'block-controls)))) '("if" "ifequal" "ifnotequal" "for")) + (setq continue nil) + ) + ) ;cond + ) + (setq controls (append controls (list (cons 'inside (or ctrl "if"))))) + ) + ) + ((web-mode-block-starts-with "form_start[ ]*(" reg-beg) + (setq controls (append controls (list (cons 'open "form_start"))))) + ((web-mode-block-starts-with "form_end[ ]*(" reg-beg) + (setq controls (append controls (list (cons 'close "form_start"))))) + ((not (eq (char-after (1+ reg-beg)) ?\%)) + ) + ((web-mode-block-starts-with "\\(else\\|els?if\\)" reg-beg) + (let ((continue t) + (pos reg-beg) + (ctrl nil)) + (while continue + (cond + ((null (setq pos (web-mode-block-control-previous-position 'open pos))) + (setq continue nil)) + ((member (setq ctrl (cdr (car (get-text-property pos 'block-controls)))) '("if" "ifequal" "ifnotequal")) + (setq continue nil) + ) + ) ;cond + ) ;while + (setq controls (append controls (list (cons 'inside (or ctrl "if"))))) + ) ;let + ) ;case else + ((web-mode-block-starts-with "\\(empty\\)" reg-beg) + (setq controls (append controls (list (cons 'inside "for"))))) + ((web-mode-block-starts-with "end\\([[:alpha:]]+\\)" reg-beg) + (setq controls (append controls (list (cons 'close (match-string-no-properties 1)))))) + ((web-mode-block-starts-with (concat web-mode-django-control-blocks-regexp "[ %]") reg-beg) + (let (control) + (setq control (match-string-no-properties 1)) + ;;(message "%S %S %S" control (concat "end" control) web-mode-django-control-blocks) + (when (member (concat "end" control) web-mode-django-control-blocks) + (setq controls (append controls (list (cons 'open control)))) + ) ;when + ) ;let + ) ;case + ) ;cond + ) ;django + + ((string= web-mode-engine "smarty") + (cond + ((and (eq (char-after (1+ reg-beg)) ?\/) + (web-mode-block-starts-with "\\([[:alpha:]]+\\)" reg-beg)) + (setq controls (append controls (list (cons 'close (match-string-no-properties 1)))))) + ((web-mode-block-starts-with "\\(else\\|elseif\\)" reg-beg) + (setq controls (append controls (list (cons 'inside "if"))))) + ((web-mode-block-starts-with "\\(block\\|foreach\\|for\\|if\\|section\\|while\\)") + (setq controls (append controls (list (cons 'open (match-string-no-properties 1)))))) + ) + ) ;smarty + + ((string= web-mode-engine "xoops") + (cond + ((and (eq (char-after (+ reg-beg 2)) ?\/) + (web-mode-block-starts-with "\\([[:alpha:]]+\\)" reg-beg)) + (setq controls (append controls (list (cons 'close (match-string-no-properties 1)))))) + ((web-mode-block-starts-with "\\(else\\|elseif\\)" reg-beg) + (setq controls (append controls (list (cons 'inside "if"))))) + ((web-mode-block-starts-with "\\(block\\|foreach\\|for\\|if\\|section\\|while\\)") + (setq controls (append controls (list (cons 'open (match-string-no-properties 1)))))) + ) + ) ;xoops + + ((string= web-mode-engine "web2py") + (cond + ((web-mode-block-starts-with "def" reg-beg) + (setq controls (append controls (list (cons 'open "def"))))) + ((web-mode-block-starts-with "return" reg-beg) + (setq controls (append controls (list (cons 'close "def"))))) + ((web-mode-block-starts-with "block" reg-beg) + (setq controls (append controls (list (cons 'open "block"))))) + ((web-mode-block-starts-with "end" reg-beg) + (setq controls (append controls (list (cons 'close "block"))))) + ((web-mode-block-starts-with "pass" reg-beg) + (setq controls (append controls (list (cons 'close "ctrl"))))) + ((web-mode-block-starts-with "\\(except\\|finally\\|els\\)" reg-beg) + (setq controls (append controls (list (cons 'inside "ctrl"))))) + ((web-mode-block-starts-with "\\(if\\|for\\|try\\|while\\)") + (setq controls (append controls (list (cons 'open "ctrl"))))) + ) + ) ;web2py + + ((string= web-mode-engine "dust") + (cond + ((eq (char-after (1- reg-end)) ?\/) + ) + ((eq (char-after (1+ reg-beg)) ?\:) + (setq pos (web-mode-block-control-previous-position 'open reg-beg)) + (when pos + (setq controls (append controls + (list + (cons 'inside + (cdr (car (web-mode-block-controls-get pos)))))))) + ) + ((looking-at "{/\\([[:alpha:].]+\\)") + (setq controls (append controls (list (cons 'close (match-string-no-properties 1)))))) + ((looking-at "{[#?@><+^]\\([[:alpha:].]+\\)") + (setq controls (append controls (list (cons 'open (match-string-no-properties 1)))))) + ) + ) ;dust + + ((member web-mode-engine '("mojolicious")) + (cond + ((web-mode-block-ends-with "begin" reg-beg) + (setq controls (append controls (list (cons 'open "begin"))))) + ((web-mode-block-starts-with "end" reg-beg) + (setq controls (append controls (list (cons 'close "begin"))))) + ((web-mode-block-starts-with "}[ ]*else[ ]*{" reg-beg) + (setq controls (append controls (list (cons 'inside "{"))))) + ((web-mode-block-starts-with "}" reg-beg) + (setq controls (append controls (list (cons 'close "{"))))) + ((web-mode-block-ends-with "{" reg-beg) + (setq controls (append controls (list (cons 'open "{"))))) + ) + ) ;mojolicious + + ((member web-mode-engine '("aspx" "underscore")) + (cond + ((and (web-mode-block-starts-with "}" reg-beg) + (web-mode-block-ends-with "{" reg-beg)) + (setq controls (append controls (list (cons 'inside "{"))))) + ((web-mode-block-starts-with "}" reg-beg) + (setq controls (append controls (list (cons 'close "{"))))) + ((web-mode-block-ends-with "{" reg-beg) + (setq controls (append controls (list (cons 'open "{"))))) + ) + ) ;aspx underscore + + ((member web-mode-engine '("jsp" "asp" "clip")) + (cond + ((eq (char-after (1- reg-end)) ?\/) + ) + ((looking-at "" reg-beg) + (setq controls (append controls (list (cons 'close "ctrl"))))) + ((web-mode-block-starts-with "else\\_>" reg-beg) + (setq controls (append controls (list (cons 'inside "ctrl"))))) + ((web-mode-block-starts-with "\\(range\\|with\\|if\\|define\\|block\\)\\_>" reg-beg) + (setq controls (append controls (list (cons 'open "ctrl"))))) + ) + ) ;go + + ((string= web-mode-engine "template-toolkit") + (cond + ((web-mode-block-starts-with "end" reg-beg) + (setq controls (append controls (list (cons 'close "ctrl"))))) + ((web-mode-block-starts-with "els\\|catch\\|final" reg-beg) + (setq controls (append controls (list (cons 'inside "ctrl"))))) + ((web-mode-block-starts-with "filter\\|foreach\\|if\\|last\\|next\\|perl\\|rawperl\\|try\\|unless\\|while" reg-beg) + (setq controls (append controls (list (cons 'open "ctrl"))))) + ) + ) ;template-toolkit + + ((string= web-mode-engine "cl-emb") + (cond + ((web-mode-block-starts-with "@else" reg-beg) + (setq controls (append controls (list (cons 'inside "if"))))) + ((web-mode-block-starts-with "@\\(?:end\\)?\\(if\\|unless\\|repeat\\|loop\\|with\\|genloop\\)" reg-beg) + (setq control (match-string-no-properties 1) + type (if (eq (aref (match-string-no-properties 0) 1) ?e) 'close 'open)) + (setq controls (append controls (list (cons type control))))) + ) + ) ;cl-emb + + ((string= web-mode-engine "elixir") + (cond + ((web-mode-block-starts-with "end" reg-beg) + (setq controls (append controls (list (cons 'close "ctrl"))))) + ((web-mode-block-starts-with "else" reg-beg) + (setq controls (append controls (list (cons 'inside "ctrl"))))) + ((web-mode-block-ends-with " do" reg-beg) + (setq controls (append controls (list (cons 'open "ctrl"))))) + ((web-mode-block-ends-with " ->" reg-beg) + (setq controls (append controls (list (cons 'open "ctrl"))))) + ) + ) ;elixir + + ((string= web-mode-engine "velocity") + (cond + ((web-mode-block-starts-with "{?end" reg-beg) + (setq controls (append controls (list (cons 'close "ctrl"))))) + ((web-mode-block-starts-with "{?els" reg-beg) + (setq controls (append controls (list (cons 'inside "ctrl"))))) + ((web-mode-block-starts-with "{?\\(define\\|if\\|for\\|foreach\\|macro\\)" reg-beg) + (setq controls (append controls (list (cons 'open "ctrl"))))) + ) + ) ;velocity + + ((string= web-mode-engine "freemarker") + (cond + ((looking-at "[<[]#\\(import\\|include\\|assign\\|return\\|local\\)") + ) + ((eq (char-after (1- reg-end)) ?\/) + ) + ((looking-at "[<[]#\\(break\\|case\\|default\\)") + (setq controls (append controls (list (cons 'inside "switch")))) + ) + ((looking-at "[<[]#els") + (setq controls (append controls (list (cons 'inside "if")))) + ) + ((looking-at " n 0))) + +(defun web-mode-scan-elements (reg-beg reg-end) + (save-excursion + (let (part-beg part-end flags limit close-expr props tname tbeg tend element-content-type (regexp web-mode-dom-regexp) part-close-tag char) + ;;(message "scan-elements: reg-beg(%S) reg-end(%S)" reg-beg reg-end) + (goto-char reg-beg) + + (while (web-mode-dom-rsf regexp reg-end) + + ;;(message "%S: %S (%S %S)" (point) (match-string-no-properties 0) reg-beg reg-end) + + (setq flags 0 + tname (downcase (match-string-no-properties 1)) + char (aref tname 0) + tbeg (match-beginning 0) + tend nil + element-content-type nil + limit reg-end + part-beg nil + part-end nil + props nil + close-expr nil + part-close-tag nil) + + ;;(message "tname[%S] tbeg(%S) point(%S)" tname tbeg (point)) + + (cond + + ((member tname '("/>" ">")) ;;jsx fragment #952 + (setq tname "_fragment_" + tend (point)) + (if (eq char ?\/) + (setq props (list 'tag-name tname 'tag-type 'end) + flags (logior flags 20)) ;; 16 + 4 + (setq props (list 'tag-name tname 'tag-type 'start) + flags (logior flags 16)) + ) ;if + ) + + ((not (member char '(?\! ?\?))) + (cond + ((string-match-p "-" tname) + (setq flags (logior flags 2))) + ((string-match-p ":" tname) + (setq flags (logior flags 32))) + ) + (cond + ((eq char ?\/) + (setq props (list 'tag-name (substring tname 1) 'tag-type 'end) + flags (logior flags 4) + limit (if (> reg-end (line-end-position)) (line-end-position) reg-end)) + ) + ((web-mode-element-is-void tname) + ;;(message "void: tag=%S" tname) + (setq props (list 'tag-name tname 'tag-type 'void))) + (t + (setq props (list 'tag-name tname 'tag-type 'start))) + ) ;cond + ) ; not " + props '(tag-type comment))) + ((string= tname "?xml") + (setq ;;regexp web-mode-tag-regexp2 + close-expr "?>" + props '(tag-type declaration))) + ((string= tname "![cdata[") + (setq close-expr "]]>" + props '(tag-type cdata))) + ((string= tname "!doctype") + (setq ;;regexp web-mode-tag-regexp2 + props '(tag-type doctype))) + ) ;cond - special tags + + (cond + + (tend + ) + + ((and (null close-expr) (eq (char-after) ?\>)) + (setq flags (logior flags 16) + tend (1+ (point))) + ;;(message "end=%S" tend) + ) + + ((and (null close-expr) + (looking-at "[ ]\\(class\\|id\\|href\\|style\\)=\"[[:alnum:]_=:/?;#. -]*\">")) + ;;(message "scan-elements: %S %S" (point) (match-string-no-properties 0)) + (let ((beg (1+ (point))) + (end (+ (point) (length (match-string-no-properties 0))))) + ;;(message "beg=%S end=%S" beg end) + (setq flags (logior flags 17) + tend end) + (put-text-property beg (1+ beg) 'tag-attr-beg 0) + (put-text-property beg (1- end) 'tag-attr t) + (put-text-property (- end 2) (1- end) 'tag-attr-end (length (match-string-no-properties 1))) + ) ;let + ;;(message "tend=%S" tend) + ) + + ((null close-expr) + (setq flags (logior flags (web-mode-attr-skip reg-end))) + (when (> (logand flags 8) 0) + (setq props (plist-put props 'tag-type 'void))) + (setq tend (point))) + ((web-mode-dom-sf close-expr limit t) + (setq tend (point))) + (t + (setq tend (line-end-position))) + + ) ;cond + + (cond + ((string= tname "style") + (let (style) + (setq style (buffer-substring-no-properties tbeg tend) + part-close-tag "") + (cond + ((string-match-p " lang[ ]*=[ ]*[\"']stylus" style) + (setq element-content-type "stylus")) + (t + (setq element-content-type "css")) + ) ;cond + ) ;let + ) ;style + ((string= tname "script") + (let (script) + (setq script (buffer-substring-no-properties tbeg tend) + part-close-tag "") + (cond + ((string-match-p " type[ ]*=[ ]*[\"']text/\\(jsx\\|babel\\)" script) + (setq element-content-type "jsx")) + ((string-match-p " type[ ]*=[ ]*[\"']text/\\(markdown\\|template\\)" script) + (setq element-content-type "markdown")) + ((string-match-p " type[ ]*=[ ]*[\"']text/ruby" script) + (setq element-content-type "ruby")) + ((string-match-p " type[ ]*=[ ]*[\"']text/\\(x-handlebars\\|x-jquery-tmpl\\|x-jsrender\\|html\\|ng-template\\|template\\|x-template\\|mustache\\|x-dust-template\\)" script) + (setq element-content-type "html" + part-close-tag nil)) + ((string-match-p " type[ ]*=[ ]*[\"']application/\\(ld\\+json\\|json\\)" script) + (setq element-content-type "json")) + (t + (setq element-content-type "javascript")) + ) ;cond + ) ;let + ) ;script + ((and (string= web-mode-engine "archibus") + (string= tname "sql")) + (setq element-content-type "sql" + part-close-tag "")) + ) + + (add-text-properties tbeg tend props) + (put-text-property tbeg (1+ tbeg) 'tag-beg flags) + (put-text-property (1- tend) tend 'tag-end t) + + (when (and part-close-tag + (web-mode-dom-sf part-close-tag reg-end t) + (setq part-beg tend) + (setq part-end (match-beginning 0)) + (> part-end part-beg)) + (put-text-property part-beg part-end 'part-side + (intern element-content-type web-mode-obarray)) + (setq tend part-end) + ) ;when + + (goto-char tend) + + ) ;while + + ))) + +;; FLAGS: tag +;; (1)attrs (2)custom (4)slash-beg (8)slash-end (16)bracket-end +;; (32)namespaced + +;; FLAGS: attr +;; (1)custom-attr (2)engine-attr (4)spread-attr[jsx] (8)code-value + +;; STATES: attr +;; (0)nil (1)space (2)name (3)space-before (4)equal (5)space-after +;; (6)value-uq (7)value-sq (8)value-dq (9)value-bq : jsx attr={} + +(defun web-mode-attr-skip (limit) + + (let ((tag-flags 0) (attr-flags 0) (continue t) (attrs 0) (counter 0) (brace-depth 0) + (pos-ori (point)) (state 0) (equal-offset 0) (go-back nil) + (is-jsx (or (string= web-mode-content-type "jsx") (eq (get-text-property (point) 'part-type) 'jsx))) + attr name-beg name-end val-beg char pos escaped spaced quoted) + + (while continue + + (setq pos (point) + char (char-after) + spaced (eq char ?\s)) + + (when quoted (setq quoted (1+ quoted))) + + (cond + + ((>= pos limit) + (setq continue nil) + (setq go-back t) + (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) + ) + + ((or (and (= state 8) (not (member char '(?\" ?\\)))) + (and (= state 7) (not (member char '(?\' ?\\)))) + (and (= state 9) (not (member char '(?} ?\\)))) + ) + (when (and (= state 9) (eq char ?\{)) + (setq brace-depth (1+ brace-depth))) + ) + + ((and (= state 9) (eq char ?\}) (> brace-depth 1)) + (setq brace-depth (1- brace-depth))) + + ((get-text-property pos 'block-side) + (when (= state 2) + (setq name-end pos)) + ) + + ((and (= state 2) is-jsx (eq char ?\}) (eq attr-flags 4)) + (setq name-end pos) + (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) + (setq state 0 + attr-flags 0 + equal-offset 0 + name-beg nil + name-end nil + val-beg nil) + ) + + ((or (and (= state 8) (eq ?\" char) (not escaped)) + (and (= state 7) (eq ?\' char) (not escaped)) + (and (= state 9) (eq ?\} char) (= brace-depth 1)) + ) + + ;;(message "%S %S" (point) attr-flags) + (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) + (setq state 0 + attr-flags 0 + equal-offset 0 + name-beg nil + name-end nil + val-beg nil) + ) + + ((and (member state '(4 5)) (member char '(?\' ?\" ?\{))) + (setq val-beg pos) + (setq quoted 1) + (setq state (cond ((eq ?\' char) 7) + ((eq ?\" char) 8) + (t 9))) + (when (= state 9) + (setq brace-depth 1)) + ) + + ((and (eq ?\= char) (member state '(2 3))) + (setq equal-offset (- pos name-beg)) + (setq state 4) + (setq attr (buffer-substring-no-properties name-beg (1+ name-end))) + (when (and web-mode-indentless-attributes (member (downcase attr) web-mode-indentless-attributes)) + ;;(message "onclick") + (setq attr-flags (logior attr-flags 8))) + ) + + ((and spaced (= state 0)) + (setq state 1) + ) + + ((and (eq char ?\<) (not (member state '(7 8 9)))) + (setq continue nil) + (setq go-back t) + (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) + ) + + ((and (eq char ?\>) (not (member state '(7 8 9)))) + (setq tag-flags (logior tag-flags 16)) + (when (eq (char-before) ?\/) + (setq tag-flags (logior tag-flags 8)) + ) + (setq continue nil) + (when name-beg + (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset)))) + ) + + ((and spaced (member state '(1 3 5))) + ) + + ((and spaced (= state 2)) + (setq state 3) + ) + + ((and (eq char ?\/) (member state '(4 5))) + (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) + (setq state 1 + attr-flags 0 + equal-offset 0 + name-beg nil + name-end nil + val-beg nil) + ) + + ((and (eq char ?\/) (member state '(0 1))) + ) + + ((and spaced (= state 4)) + (setq state 5) + ) + + ((and (= state 3) + (or (and (>= char 97) (<= char 122)) ;a - z + (and (>= char 65) (<= char 90)) ;A - Z + (eq char ?\-))) + (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) + (setq state 2 + attr-flags 0 + equal-offset 0 + name-beg pos + name-end pos + val-beg nil) + ) + + ((and (eq char ?\n) (not (member state '(7 8 9)))) + (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) + (setq state 1 + attr-flags 0 + equal-offset 0 + name-beg nil + name-end nil + val-beg nil) + ) + + ((and (= state 6) (member char '(?\s ?\n ?\/))) + (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) + (setq state 1 + attr-flags 0 + equal-offset 0 + name-beg nil + name-end nil + val-beg nil) + ) + + ((and quoted (= quoted 2) (member char '(?\s ?\n ?\>))) + (when (eq char ?\>) + (setq tag-flags (logior tag-flags 16)) + (setq continue nil)) + (setq state 6) + (setq attrs (+ attrs (web-mode-attr-scan state char name-beg name-end val-beg attr-flags equal-offset))) + (setq state 1 + attr-flags 0 + equal-offset 0 + name-beg nil + name-end nil + val-beg nil) + ) + + ((and (not spaced) (= state 1)) + (when (and is-jsx (eq char ?\{)) + (setq attr-flags 4)) + (setq state 2) + (setq name-beg pos + name-end pos) + ) + + ((member state '(4 5)) + (setq val-beg pos) + (setq state 6) + ) + + ((= state 1) + (setq state 2) + ) + + ((= state 2) + (setq name-end pos) + (when (and (= attr-flags 0) (member char '(?\- ?\:))) + (let (attr) + (setq attr (buffer-substring-no-properties name-beg (1+ name-end))) + (cond + ((member attr '("http-equiv")) + (setq attr-flags (1- attr-flags)) + ) + ((and web-mode-engine-attr-regexp + (string-match-p web-mode-engine-attr-regexp attr)) + ;;(message "%S: %S" pos web-mode-engine-attr-regexp) + (setq attr-flags (logior attr-flags 2)) + ;;(setq attr-flags (1- attr-flags)) + ) + ((and (eq char ?\-) (not (string= attr "http-"))) + (setq attr-flags (logior attr-flags 1))) + ) ;cond + ) ;let + ) ;when attr-flags = 1 + ) ;state=2 + + ) ;cond + + ;;(message "point(%S) end(%S) state(%S) c(%S) name-beg(%S) name-end(%S) val-beg(%S) attr-flags(%S) equal-offset(%S)" pos end state char name-beg name-end val-beg attr-flags equal-offset) + + (when (and quoted (>= quoted 2)) + (setq quoted nil)) + + (setq escaped (eq ?\\ char)) + (when (null go-back) + (forward-char)) + + ) ;while + + (when (> attrs 0) (setq tag-flags (logior tag-flags 1))) + + tag-flags)) + +(defun web-mode-attr-scan (state char name-beg name-end val-beg flags equal-offset) +;; (message "point(%S) state(%S) c(%c) name-beg(%S) name-end(%S) val-beg(%S) flags(%S) equal-offset(%S)" +;; (point) state char name-beg name-end val-beg flags equal-offset) + (if (null flags) (setq flags 0)) + (cond + ((null name-beg) +;; (message "name-beg is null (%S)" (point)) + 0) + ((or (and (= state 8) (not (eq ?\" char))) + (and (= state 7) (not (eq ?\' char)))) + (put-text-property name-beg (1+ name-beg) 'tag-attr-beg flags) + (put-text-property name-beg val-beg 'tag-attr t) + (put-text-property (1- val-beg) val-beg 'tag-attr-end equal-offset) + 1) + ((and (member state '(4 5)) (null val-beg)) + (put-text-property name-beg (1+ name-beg) 'tag-attr-beg flags) + (put-text-property name-beg (+ name-beg equal-offset 1) 'tag-attr t) + (put-text-property (+ name-beg equal-offset) (+ name-beg equal-offset 1) 'tag-attr-end equal-offset) + 1) + (t + (let (val-end) + (if (null val-beg) + (setq val-end name-end) + (setq val-end (point)) + (when (or (null char) (member char '(?\s ?\n ?\> ?\/))) + (setq val-end (1- val-end)) + ) + ) ;if + (put-text-property name-beg (1+ name-beg) 'tag-attr-beg flags) + (put-text-property name-beg (1+ val-end) 'tag-attr t) + (put-text-property val-end (1+ val-end) 'tag-attr-end equal-offset) + ) ;let + 1) ;t + ) ;cond + ) + +(defun web-mode-process-parts (reg-beg reg-end func) + (let ((i 0) (continue t) (part-beg reg-beg) (part-end nil)) + (while continue + (setq part-end nil) + (unless (get-text-property part-beg 'part-side) + (setq part-beg (web-mode-part-next-position part-beg))) + (when (and part-beg (< part-beg reg-end)) + (setq part-end (web-mode-part-end-position part-beg))) + (cond + ((> (setq i (1+ i)) 100) + (message "process-parts ** warning (%S) **" (point)) + (setq continue nil)) + ((or (null part-end) (> part-end reg-end)) + (setq continue nil)) + (t + (setq part-end (1+ part-end)) + (funcall func part-beg part-end) + (setq part-beg part-end)) + ) ;cond + ) ;while + )) + +(defun web-mode-part-scan (reg-beg reg-end &optional content-type depth) + (save-excursion + (let (token-re ch-before ch-at ch-next token-type beg continue) + ;;(message "%S %S" reg-beg reg-end) + (cond + (content-type + ) + ((member web-mode-content-type web-mode-part-content-types) + (setq content-type web-mode-content-type)) + (t + (setq content-type (symbol-name (get-text-property reg-beg 'part-side)))) + ) ;cond + + (goto-char reg-beg) + + (cond + ((member content-type '("javascript" "json")) + (setq token-re "/\\|\"\\|'\\|`")) + ((member content-type '("jsx")) + (setq token-re "/\\|\"\\|'\\|`\\|]")) + ((string= web-mode-content-type "css") + (setq token-re "\"\\|'\\|/\\*\\|//")) + ((string= content-type "css") + (setq token-re "\"\\|'\\|/\\*")) + (t + (setq token-re "/\\*\\|\"\\|'")) + ) + + (while (and token-re (< (point) reg-end) (web-mode-dom-rsf token-re reg-end t)) + + (setq beg (match-beginning 0) + token-type nil + continue t + ch-at (char-after beg) + ch-next (or (char-after (1+ beg)) ?\d) + ch-before (or (char-before beg) ?\d)) + + ;;(message "[%S>%S|%S] %S %c %c %c" reg-beg reg-end depth beg ch-before ch-at ch-next) + + (cond + + ((eq ?\' ch-at) + (while (and continue (search-forward "'" reg-end t)) + (cond + ((get-text-property (1- (point)) 'block-side) + (setq continue t)) + (t + (setq continue (web-mode-string-continue-p reg-beg))) + ) + ) ;while + (setq token-type 'string)) + + ((eq ?\` ch-at) + (while (and continue (search-forward "`" reg-end t)) + (cond + ((get-text-property (1- (point)) 'block-side) + (setq continue t)) + (t + (setq continue (web-mode-string-continue-p reg-beg))) + ) + ) ;while + (setq token-type 'string)) + + ((eq ?\" ch-at) + (while (and continue (search-forward "\"" reg-end t)) + (cond + ((get-text-property (1- (point)) 'block-side) + (setq continue t)) + (t + (setq continue (web-mode-string-continue-p reg-beg))) + ) ;cond + ) ;while + (cond + ((string= content-type "json") + (if (looking-at-p "[ ]*:") + (cond + ((eq ?\@ (char-after (1+ beg))) + (setq token-type 'context)) + (t + (setq token-type 'key)) + ) + (setq token-type 'string)) + ) ;json + (t + (setq token-type 'string)) + ) ;cond + ) + + ((and (eq ?\< ch-at) + (not (or (and (>= ch-before 97) (<= ch-before 122)) + (and (>= ch-before 65) (<= ch-before 90))))) + ;;(message "before [%S>%S|%S] pt=%S" reg-beg reg-end depth (point)) + (search-backward "<") + (if (web-mode-jsx-skip reg-end) + (web-mode-jsx-scan-element beg (point) depth) + (forward-char)) + ;;(message "after [%S>%S|%S] pt=%S" reg-beg reg-end depth (point)) + ) + + ((and (eq ?\/ ch-at) (member content-type '("javascript" "jsx"))) + (cond + ((eq ?\\ ch-before) + ) + ((eq ?\* ch-next) + ;;(message "--> %S %S" (point) reg-end) + (when (search-forward "*/" reg-end t) + (setq token-type 'comment)) + ) + ((eq ?\/ ch-next) + (setq token-type 'comment) + (goto-char (if (< reg-end (line-end-position)) reg-end (line-end-position))) + ) + ((and (looking-at-p ".*/") + (looking-back "\\(^\\|case\\|[[(,=:!&|?{};]\\)[ ]*/" (point-min))) + ;;(re-search-forward "/[gimyu]*" reg-end t)) + (let ((eol (line-end-position))) + (while (and continue (search-forward "/" eol t)) + (cond + ((get-text-property (1- (point)) 'block-side) + (setq continue t)) + ((looking-back "\\\\+/" reg-beg t) + (setq continue (= (mod (- (point) (match-beginning 0)) 2) 0))) + (t + (re-search-forward "[gimyu]*" eol t) + (setq token-type 'string) + (setq continue nil)) + ) + ) ;while + ) ;let + ) + ) ;cond + ) + + ((eq ?\/ ch-next) + ;;(message "%S" (point)) + (cond + ((and (string= content-type "css") + (eq ?/ ch-at) + (eq ?: ch-before)) + ) + (t + (unless (eq ?\\ ch-before) + (setq token-type 'comment) + (goto-char (if (< reg-end (line-end-position)) reg-end (line-end-position))) + ) + ) + ) + + ) + + ((eq ?\* ch-next) + (cond + ((search-forward "*/" reg-end t) + (setq token-type 'comment)) + ((not (eobp)) + (forward-char)) + ) ;cond + ) + + ) ;cond + + (when (and beg (>= reg-end (point)) token-type) + (put-text-property beg (point) 'part-token token-type) + (cond + ((eq token-type 'comment) + (put-text-property beg (1+ beg) 'syntax-table (string-to-syntax "<")) + (when (< (point) (point-max)) + (if (< (point) (line-end-position)) + (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax ">")) ;#445 + (put-text-property (point) (1+ (point)) 'syntax-table (string-to-syntax ">")) ;#377 + ) + ) ;when + ) ;comment + ((eq token-type 'string) + (put-text-property beg (1+ beg) 'syntax-table (string-to-syntax "|")) + (when (< (point) (point-max)) + (if (< (point) (line-end-position)) + (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax "|")) + (put-text-property (point) (1+ (point)) 'syntax-table (string-to-syntax "|")) + ) + ) ;when + ) ;string + ) ;cond + ) ;when + + (when (> (point) reg-end) + (message "reg-beg(%S) reg-end(%S) token-type(%S) point(%S)" reg-beg reg-end token-type (point))) + + ;;(message "#[%S>%S|%S] %S %c %c %c | (%S)" reg-beg reg-end depth beg ch-before ch-at ch-next (point)) + + ) ;while + + ))) + +(defun web-mode-string-continue-p (reg-beg) + "Is `point' preceeded by an odd number of backslashes?" + (let ((p (1- (point)))) + (while (and (< reg-beg p) (eq ?\\ (char-before p))) + (setq p (1- p))) + (= (mod (- (point) p) 2) 0))) + +(defun web-mode-jsx-skip (reg-end) + (let ((continue t) (pos nil) (i 0) tag) + (looking-at "<\\([[:alpha:]][[:alnum:]:-]*\\)") + (setq tag (match-string-no-properties 1)) + ;;(message "point=%S tag=%S" (point) tag) + (save-excursion + (while continue + (cond + ((> (setq i (1+ i)) 1000) + (message "jsx-skip ** warning **") + (setq continue nil)) + ((looking-at "<[[:alpha:]][[:alnum:]:-]*[ ]*/>") + (goto-char (match-end 0)) + (setq pos (point)) + (setq continue nil)) + ((not (web-mode-dom-rsf ">\\([ \t\n]*[\];,)':}|&]\\)\\|{" reg-end)) + (setq continue nil) + ) + ((eq (char-before) ?\{) + (backward-char) + (web-mode-closing-paren reg-end) + (forward-char) + ) + (t + (setq continue nil) + (setq pos (match-beginning 1)) + ) ;t + ) ;cond + ) ;while + ) ;save-excursion + (when pos (goto-char pos)) + ;;(message "jsx-skip: %S" pos) + pos)) + +;; (defun web-mode-jsx-skip2 (reg-end) +;; (let ((continue t) (pos nil) (i 0) (tag nil) (regexp nil) (counter 1)) +;; (looking-at "<\\([[:alpha:]][[:alnum:]:-]*\\)") +;; (setq tag (match-string-no-properties 1)) +;; (setq regexp (concat " (setq i (1+ i)) 100) +;; (message "jsx-skip ** warning **") +;; (setq continue nil)) +;; ((looking-at "<[[:alpha:]][[:alnum:]:-]*[ ]*/>") +;; (goto-char (match-end 0)) +;; (setq pos (point)) +;; (setq continue nil)) +;; ((not (web-mode-dom-rsf ">\\([ \t\n]*[\];,)':}]\\)\\|{" reg-end)) +;; (setq continue nil) +;; ) +;; ((eq (char-before) ?\{) +;; (backward-char) +;; (web-mode-closing-paren reg-end) +;; (forward-char) +;; ) +;; (t +;; (setq continue nil) +;; (setq pos (match-beginning 1)) +;; ) ;t +;; ) ;cond +;; ) ;while +;; ) ;save-excursion +;; (when pos (goto-char pos)) +;; ;;(message "jsx-skip: %S" pos) +;; pos)) + +;; http://facebook.github.io/jsx/ +;; https://github.com/facebook/jsx/blob/master/AST.md +(defun web-mode-jsx-scan-element (reg-beg reg-end depth) + (unless depth (setq depth 1)) + (save-excursion + (let (token-beg token-end regexp) + (goto-char reg-beg) + (put-text-property reg-beg (1+ reg-beg) 'jsx-beg depth) + (put-text-property (1- reg-end) reg-end 'jsx-end depth) + (put-text-property reg-beg reg-end 'jsx-depth depth) + (goto-char reg-beg) + (web-mode-scan-elements reg-beg reg-end) + (web-mode-jsx-scan-expression reg-beg reg-end (1+ depth)) + ))) + +(defun web-mode-jsx-scan-expression (reg-beg reg-end depth) + (let ((continue t) beg end) + (save-excursion + (goto-char reg-beg) + ;;(message "reg-beg=%S reg-end=%S" reg-beg reg-end) + (while (and continue (search-forward "{" reg-end t)) + (backward-char) + (setq beg (point) + end (web-mode-closing-paren reg-end)) + (cond + ((eq (get-text-property beg 'part-token) 'comment) + (forward-char)) + ((not end) + (setq continue nil)) + (t + (setq end (1+ end)) + (put-text-property beg end 'jsx-depth depth) + (put-text-property beg (1+ beg) 'jsx-beg depth) + (put-text-property (1- end) end 'jsx-end depth) + (web-mode-part-scan beg end "jsx" (1+ depth)) + ) ;t + ) ;cond + ) ;while + ) ;save-excursion + )) + +(defun web-mode-jsx-is-html (&optional pos) + (interactive) + (unless pos (setq pos (point))) + (let (ret (depth (get-text-property pos 'jsx-depth))) + (cond + ((or (null depth) (<= pos 2)) + (setq pos nil)) + ((and (= depth 1) (get-text-property pos 'jsx-beg)) + (setq pos nil)) + ((get-text-property pos 'tag-end) + (setq pos nil)) + ((get-text-property pos 'tag-attr-beg) + (setq pos nil)) + ((get-text-property pos 'jsx-beg) + (setq pos (null (get-text-property pos 'tag-beg)))) + ((setq pos (web-mode-jsx-depth-beginning-position pos)) + (setq pos (not (null (get-text-property pos 'tag-beg))))) + (t + (setq pos nil)) + ) ;cond + ;;(message "is-html: %S (depth=%S)" pos depth) + pos)) + +(defun web-mode-jsx-is-expr (&optional pos) + (cond + ((and (get-text-property pos 'jsx-beg) + (not (get-text-property pos 'tag-beg))) + nil) + (t + (setq pos (web-mode-jsx-depth-beginning-position pos)) + (null (get-text-property pos 'tag-beg))) + ) ;cond + ) + +(defun web-mode-jsx-depth-beginning-position (&optional pos target-depth) + (interactive) + (unless pos (setq pos (point))) + (unless target-depth (setq target-depth (get-text-property pos 'jsx-depth))) + (cond + ((or (null target-depth) (bobp)) + (setq pos nil)) + ((and (get-text-property pos 'jsx-beg) (= target-depth (get-text-property pos 'jsx-depth))) + ) + (t + (let ((continue t) depth) + (while continue + (setq pos (previous-single-property-change pos 'jsx-depth)) + (cond + ((or (null pos) + (null (setq depth (get-text-property pos 'jsx-depth)))) + (setq continue nil + pos nil)) + ((and (get-text-property pos 'jsx-beg) (= target-depth depth)) + (setq continue nil)) + ) ;cond + ) ;while + ) ;let + ) ;t + ) ;cond + ;;(message "beg: %S" pos) + pos) + +(defun web-mode-jsx-element-next (reg-end) + (let (continue beg end) + (setq beg (point)) + (unless (get-text-property beg 'jsx-depth) + (setq beg (next-single-property-change beg 'jsx-beg))) + (setq continue (and beg (< beg reg-end)) + end beg) + (while continue + (setq end (next-single-property-change end 'jsx-end)) + (cond + ((or (null end) (> end reg-end)) + (setq continue nil + end nil)) + ((eq (get-text-property end 'jsx-depth) 1) + (setq continue nil)) + (t + (setq end (1+ end))) + ) ;cond + ) ;while + ;;(message "beg=%S end=%S" beg end) + (if (and beg end (< beg end)) (cons beg end) nil))) + +(defun web-mode-jsx-expression-next (reg-end) + (let (beg end depth continue pos) + (setq beg (point)) + ;;(message "pt=%S" beg) + (unless (and (get-text-property beg 'jsx-beg) (null (get-text-property beg 'tag-beg))) + ;;(setq beg (next-single-property-change beg 'jsx-beg)) + (setq continue t + pos (1+ beg)) + (while continue + (setq pos (next-single-property-change pos 'jsx-beg)) + (cond + ((null pos) + (setq continue nil + beg nil)) + ((> pos reg-end) + (setq continue nil + beg nil)) + ((null (get-text-property pos 'jsx-beg)) + ) + ((null (get-text-property pos 'tag-beg)) + (setq continue nil + beg pos)) + ;;(t + ;; (setq pos (1+ pos))) + ) ;cond + ) ;while + ) ;unless + ;;(message "beg=%S" beg) + (when (and beg (< beg reg-end)) + (setq depth (get-text-property beg 'jsx-beg) + continue (not (null depth)) + pos beg) + ;;(message "beg=%S" beg) + (while continue + (setq pos (next-single-property-change pos 'jsx-end)) + ;;(message "pos=%S" pos) + (cond + ((null pos) + (setq continue nil)) + ((> pos reg-end) + (setq continue nil)) + ((eq depth (get-text-property pos 'jsx-end)) + (setq continue nil + end pos)) + (t + ;;(setq pos (1+ pos)) + ) + ) ;cond + ) ;while + ) ;when + ;;(message "%S > %S" beg end) + (if (and beg end) (cons beg end) nil))) + +(defun web-mode-jsx-depth-next (reg-end) + (let (beg end depth continue pos) + (setq beg (point)) + ;;(message "pt=%S" beg) + (unless (get-text-property beg 'jsx-beg) + ;;(setq beg (next-single-property-change beg 'jsx-beg)) + ;;(setq pos (1+ beg)) + (setq pos (next-single-property-change (1+ beg) 'jsx-beg)) + (cond + ((null pos) + (setq beg nil)) + ((>= pos reg-end) + (setq beg nil)) + (t + (setq beg pos)) + ) ;cond + ) ;unless + ;;(message "beg=%S" beg) + (when beg + (setq depth (get-text-property beg 'jsx-beg) + continue (not (null depth)) + pos beg) + ;;(message "beg=%S" beg) + (while continue + (setq pos (next-single-property-change pos 'jsx-end)) + ;;(message "pos=%S" pos) + (cond + ((null pos) + (setq continue nil)) + ((> pos reg-end) + (setq continue nil)) + ((eq depth (get-text-property pos 'jsx-end)) + (setq continue nil + end pos)) + (t + ;;(setq pos (1+ pos)) + ) + ) ;cond + ) ;while + ) ;when + ;;(message "%S > %S" beg end) + (if (and beg end) (cons beg end) nil))) + +(defun web-mode-jsx-beginning () + (interactive) + (let (depth (continue t) (reg-beg (point-min)) (pos (point))) + (setq depth (get-text-property pos 'jsx-depth)) + (cond + ((not depth) + ) + ((get-text-property (1- pos) 'jsx-beg) + (goto-char (1- pos))) + (t + (while continue + (setq pos (previous-single-property-change pos 'jsx-beg)) + ;;(message "pos=%S" pos) + (cond + ((null pos) + (setq continue nil)) + ((<= pos reg-beg) + (setq continue nil)) + ((eq depth (get-text-property pos 'jsx-beg)) + (setq continue nil)) + ) ;cond + ) ;while + (web-mode-go pos) + ) ;t + ) ;cond + )) + +(defun web-mode-jsx-end () + (interactive) + (let (depth (continue t) (reg-end (point-max)) (pos (point))) + (setq depth (get-text-property pos 'jsx-depth)) + (cond + ((not depth) + ) + ((get-text-property pos 'jsx-end) + (goto-char (+ pos 1))) + (t + (while continue + (setq pos (next-single-property-change pos 'jsx-end)) + ;;(message "pos=%S" pos) + (cond + ((null pos) + (setq continue nil)) + ((> pos reg-end) + (setq continue nil)) + ((eq depth (get-text-property pos 'jsx-end)) + (setq continue nil)) + ) ;cond + ) ;while + (web-mode-go pos 1) + ) ;t + ) ;cond + )) + +;; css rule = selector(s) + declaration (properties) +(defun web-mode-css-rule-next (limit) + (let (at-rule var-rule sel-beg sel-end dec-beg dec-end chunk) + (skip-chars-forward "\n\t ") + (setq sel-beg (point)) + (when (and (< (point) limit) + (web-mode-part-rsf "[{;]" limit)) + (setq sel-end (1- (point))) + (cond + ((eq (char-before) ?\{) + (setq dec-beg (point)) + (setq dec-end (web-mode-closing-paren-position (1- dec-beg) limit)) + (if dec-end + (progn + (goto-char dec-end) + (forward-char)) + (setq dec-end limit) + (goto-char limit)) + ) + (t + ) + ) ;cond + (setq chunk (buffer-substring-no-properties sel-beg sel-end)) + (cond + ((string-match "@\\([[:alpha:]-]+\\)" chunk) + (setq at-rule (match-string-no-properties 1 chunk))) + ((string-match "\\$\\([[:alpha:]-]+\\)" chunk) + (setq var-rule (match-string-no-properties 1 chunk))) + ) ;cond + ) ;when + (if (not sel-end) + (progn (goto-char limit) nil) + (list :at-rule at-rule + :var-rule var-rule + :sel-beg sel-beg + :sel-end sel-end + :dec-beg dec-beg + :dec-end dec-end) + ) ;if + )) + +(defun web-mode-css-rule-current (&optional pos part-beg part-end) + "Current CSS rule boundaries." + (unless pos (setq pos (point))) + (unless part-beg (setq part-beg (web-mode-part-beginning-position pos))) + (unless part-end (setq part-end (web-mode-part-end-position pos))) + (save-excursion + (let (beg end) + (goto-char pos) + (if (not (web-mode-part-sb "{" part-beg)) + (progn + (setq beg part-beg) + (if (web-mode-part-sf ";" part-end) + (setq end (1+ (point))) + (setq end part-end)) + ) ;progn + (setq beg (point)) + (setq end (web-mode-closing-paren-position beg part-end)) + (if end + (setq end (1+ end)) + (setq end (line-end-position))) +;; (message "%S >>beg%S >>end%S" pos beg end) + (if (> pos end) + + ;;selectors + (progn + (goto-char pos) + (if (web-mode-part-rsb "[};]" part-beg) + (setq beg (1+ (point))) + (setq beg part-beg) + ) ;if + (goto-char pos) + (if (web-mode-part-rsf "[{;]" part-end) + (cond + ((eq (char-before) ?\;) + (setq end (point)) + ) + (t + (setq end (web-mode-closing-paren-position (1- (point)) part-end)) + (if end + (setq end (1+ end)) + (setq end part-end)) + ) + ) ;cond + (setq end part-end) + ) + ) ;progn selectors + + ;; declaration + (goto-char beg) + (if (web-mode-part-rsb "[}{;]" part-beg) + (setq beg (1+ (point))) + (setq beg part-beg) + ) ;if + ) ;if > pos end + ) +;; (message "beg(%S) end(%S)" beg end) + (when (eq (char-after beg) ?\n) + (setq beg (1+ beg))) + (cons beg end) + ))) + +(defun web-mode-scan-engine-comments (reg-beg reg-end tag-start tag-end) + "Scan engine comments (mako, django)." + (save-excursion + (let (beg end (continue t)) + (goto-char reg-beg) + (while (and continue + (< (point) reg-end) + (re-search-forward tag-start reg-end t)) + (goto-char (match-beginning 0)) + (setq beg (point)) + (if (not (re-search-forward tag-end reg-end t)) + (setq continue nil) + (setq end (point)) + (remove-list-of-text-properties beg end web-mode-scan-properties) + (add-text-properties beg end '(block-side t block-token comment)) + (put-text-property beg (1+ beg) 'block-beg 0) + (put-text-property (1- end) end 'block-end t) + ) ;if + ) ;while + ))) + +(defun web-mode-propertize (&optional beg end) + (unless beg (setq beg web-mode-change-beg)) + (unless end (setq end web-mode-change-end)) + ;;(message "%S %S" web-mode-content-type (get-text-property beg 'part-side)) + ;;(message "propertize: beg(%S) end(%S)" web-mode-change-beg web-mode-change-end) + ;;(message "%S %S" (get-text-property beg 'part-side) (get-text-property end 'part-side)) + (when (and end (> end (point-max))) + (setq end (point-max))) + ;;(message "propertize: reset web-mode-change-beg|end") + (setq web-mode-change-beg nil + web-mode-change-end nil) + (cond + ((or (null beg) (null end)) + nil) + ((and (member web-mode-engine '("php" "asp")) + (get-text-property beg 'block-side) + (get-text-property end 'block-side) + (> beg (point-min)) + (not (eq (get-text-property (1- beg) 'block-token) 'delimiter-beg)) + (not (eq (get-text-property end 'block-token) 'delimiter-end))) + ;;(message "invalidate block") + (web-mode-invalidate-block-region beg end)) + ((and (or (member web-mode-content-type '("css" "jsx" "javascript")) + (and (get-text-property beg 'part-side) + (get-text-property end 'part-side) + (> beg (point-min)) + (get-text-property (1- beg) 'part-side)) + )) + ;;(message "invalidate part (%S > %S)" beg end) + (web-mode-invalidate-part-region beg end)) + (t + ;;(message "invalidate default (%S > %S)" beg end) + (web-mode-invalidate-region beg end)) + ) ;cond + ) + +;; NOTE: il est important d'identifier des caractères en fin de ligne +;; web-mode-block-tokenize travaille en effet sur les fins de lignes pour +;; les commentaires de type // +(defun web-mode-invalidate-block-region (pos-beg pos-end) + ;; (message "pos-beg(%S) pos-end(%S)" pos-beg pos-end) + (save-excursion + (let (beg end code-beg code-end) + ;;(message "invalidate-block-region: pos-beg(%S)=%S" pos-beg (get-text-property pos 'block-side)) + ;;(message "code-beg(%S) code-end(%S) pos-beg(%S) pos-end(%S)" code-beg code-end pos-beg pos-end) + (cond + ((not (and (setq code-beg (web-mode-block-code-beginning-position pos-beg)) + (setq code-end (web-mode-block-code-end-position pos-beg)) + (>= pos-beg code-beg) + (<= pos-end code-end) + (> code-end code-beg))) + (web-mode-invalidate-region pos-beg pos-end)) + ((member web-mode-engine '("asp")) + (goto-char pos-beg) + (forward-line -1) + (setq beg (line-beginning-position)) + (when (> code-beg beg) + (setq beg code-beg)) + (goto-char pos-beg) + (forward-line) + (setq end (line-end-position)) + (when (< code-end end) + (setq end code-end)) + ;; ?? pas de (web-mode-block-tokenize beg end) ? + (cons beg end) + ) ;asp + (t + (goto-char pos-beg) + (when (string= web-mode-engine "php") + (cond + ((and (looking-back "\*" (point-min)) + (looking-at-p "/")) + (search-backward "/*" code-beg)) + ) ;cond + ) + (if (web-mode-block-rsb "[;{}(][ ]*\n" code-beg) + (setq beg (match-end 0)) + (setq beg code-beg)) + (goto-char pos-end) + (if (web-mode-block-rsf "[;{})][ ]*\n" code-end) + (setq end (1- (match-end 0))) + (setq end code-end)) + (web-mode-block-tokenize beg end) + ;;(message "beg(%S) end(%S)" beg end) + (cons beg end) + ) + ) ;cond + ))) + +(defun web-mode-invalidate-part-region (pos-beg pos-end) + (save-excursion + (let (beg end part-beg part-end language) + (if (member web-mode-content-type web-mode-part-content-types) + (setq language web-mode-content-type) + (setq language (symbol-name (get-text-property pos-beg 'part-side)))) + (setq part-beg (web-mode-part-beginning-position pos-beg) + part-end (web-mode-part-end-position pos-beg)) + ;;(message "language(%S) pos-beg(%S) pos-end(%S) part-beg(%S) part-end(%S)" + ;; language pos-beg pos-end part-beg part-end) + (goto-char pos-beg) + (cond + ((not (and part-beg part-end + (>= pos-beg part-beg) + (<= pos-end part-end) + (> part-end part-beg))) + (web-mode-invalidate-region pos-beg pos-end)) + ((member language '("javascript" "json" "jsx")) + (if (web-mode-javascript-rsb "[;{}(][ ]*\n" part-beg) + (setq beg (match-end 0)) + (setq beg part-beg)) + (goto-char pos-end) + (if (web-mode-javascript-rsf "[;{})][ ]*\n" part-end) + (setq end (match-end 0)) + (setq end part-end)) + (web-mode-scan-region beg end language)) + ((string= language "css") + (let (rule1 rule2) + (setq rule1 (web-mode-css-rule-current pos-beg)) + (setq rule2 rule1) + (when (> pos-end (cdr rule1)) + (setq rule2 (web-mode-css-rule-current pos-end))) + (setq beg (car rule1) + end (cdr rule2)) + ) + (web-mode-scan-region beg end language)) + (t + (setq beg part-beg + end part-end) + (web-mode-scan-region beg end language)) + ) ;cond + ))) + +(defun web-mode-invalidate-region (reg-beg reg-end) + ;;(message "%S | reg-beg(%S) reg-end(%S)" (point) reg-beg reg-end) + (setq reg-beg (web-mode-invalidate-region-beginning-position reg-beg) + reg-end (web-mode-invalidate-region-end-position reg-end)) + ;;(message "invalidate-region: reg-beg(%S) reg-end(%S)" reg-beg reg-end) + (web-mode-scan-region reg-beg reg-end)) + +(defun web-mode-invalidate-region-beginning-position (pos) + (save-excursion + (goto-char pos) + (when (and (bolp) (not (bobp))) + (backward-char)) + (beginning-of-line) + ;;(message "pos=%S %S" (point) (text-properties-at (point))) + (setq pos (point-min)) + (let ((continue (not (bobp)))) + (while continue + (cond + ((bobp) + (setq continue nil)) + ;; NOTE: Going back to the previous start tag is necessary + ;; when inserting a part endtag (e.g. ). + ;; Indeed, parts must be identified asap. + ((and (progn (back-to-indentation) t) + (get-text-property (point) 'tag-beg) + (eq (get-text-property (point) 'tag-type) 'start)) + (setq pos (point) + continue nil)) + (t + (forward-line -1)) + ) ;cond + ) ;while + ;;(message "pos=%S" pos) + pos))) + +(defun web-mode-invalidate-region-end-position (pos) + (save-excursion + (goto-char pos) + ;;(message "pos=%S %S" pos (get-text-property pos 'block-token)) + (when (string= web-mode-engine "jsp") + (cond + ((and (looking-back "<%" (point-min)) + (looking-at-p "--")) + (search-forward "--%>")) + ((and (looking-back "-- %" (point-min)) + (looking-at-p ">")) + (search-forward "--%>")) + ) ;cond + ) ;when + (setq pos (point-max)) + (let ((continue (not (eobp)))) + (while continue + (end-of-line) + ;;(message "%S %S" (point) (get-text-property (point) 'block-token)) + (cond + ((eobp) + (setq continue nil)) + ((and (not (get-text-property (point) 'tag-type)) + (not (get-text-property (point) 'part-side)) + (not (get-text-property (point) 'block-side))) + (setq pos (point) + continue nil)) + (t + (forward-line)) + ) ;cond + ) ;while + pos))) + +(defun web-mode-buffer-scan () + "Scan entine buffer." + (interactive) + (web-mode-scan-region (point-min) (point-max))) + +;;---- FONTIFICATION ----------------------------------------------------------- + +(defun web-mode-font-lock-highlight (limit) + ;;(message "font-lock-highlight: point(%S) limit(%S) change-beg(%S) change-end(%S)" (point) limit web-mode-change-beg web-mode-change-end) + (cond + (web-mode-fontification-off + nil) + (t + (web-mode-highlight-region (point) limit) + nil) + )) + +(defun web-mode-buffer-highlight () + (interactive) + (cond + ((fboundp 'font-lock-flush) + (font-lock-flush) + (font-lock-ensure)) + (t ;emacs 24 + ;;(font-lock-fontify-buffer) + (font-lock-fontify-region (point-min) (point-max))) + ) ;cond + ) + +(defun web-mode-extend-region () + ;;(message "extend-region: flb(%S) fle(%S) wmcb(%S) wmce(%S)" font-lock-beg font-lock-end web-mode-change-beg web-mode-change-end) + (cond + (web-mode-fontification-off + nil) + (t + (when (or (null web-mode-change-beg) (< font-lock-beg web-mode-change-beg)) + ;;(message "font-lock-beg(%S) < web-mode-change-beg(%S)" font-lock-beg web-mode-change-beg) + (setq web-mode-change-beg font-lock-beg)) + (when (or (null web-mode-change-end) (> font-lock-end web-mode-change-end)) + ;;(message "font-lock-end(%S) > web-mode-change-end(%S)" font-lock-end web-mode-change-end) + (setq web-mode-change-end font-lock-end)) + (let ((region (web-mode-propertize web-mode-change-beg web-mode-change-end))) + (when region + ;;(message "region: %S" region) + (setq font-lock-beg (car region) + font-lock-end (cdr region)) + ) ;when + ) ;let + nil) ;t + )) + +(defun web-mode-unfontify-region (beg end) + ;;(message "unfontify: %S %S" beg end) + ) + +(defun web-mode-highlight-region (&optional beg end) ;; content-type) + ;;(message "highlight-region: beg(%S) end(%S)" beg end) + (web-mode-with-silent-modifications + (save-excursion + (save-restriction + (save-match-data + (let ((buffer-undo-list t) + (inhibit-point-motion-hooks t) + (inhibit-quit t)) + ;;(message "web-mode-highlight-region=%S" (point)) + (remove-list-of-text-properties beg end '(font-lock-face face)) + (cond + ((and (get-text-property beg 'block-side) + (not (get-text-property beg 'block-beg))) + (web-mode-block-highlight beg end)) + ((or (member web-mode-content-type web-mode-part-content-types) + (get-text-property beg 'part-side)) + (web-mode-part-highlight beg end) + (web-mode-process-blocks beg end 'web-mode-block-highlight)) + ((string= web-mode-engine "none") + (web-mode-highlight-tags beg end) + (web-mode-process-parts beg end 'web-mode-part-highlight)) + (t + (web-mode-highlight-tags beg end) + (web-mode-process-parts beg end 'web-mode-part-highlight) + (web-mode-process-blocks beg end 'web-mode-block-highlight)) + ) ;cond + (when web-mode-enable-element-content-fontification + (web-mode-highlight-elements beg end)) + (when web-mode-enable-whitespace-fontification + (web-mode-highlight-whitespaces beg end)) + ) ;let + ))))) + +(defun web-mode-highlight-tags (reg-beg reg-end &optional depth) + (let ((continue t)) + (goto-char reg-beg) + (when (and (not (get-text-property (point) 'tag-beg)) + (not (web-mode-tag-next))) + (setq continue nil)) + (when (and continue (>= (point) reg-end)) + (setq continue nil)) + (while continue + (cond + (depth + (when (eq depth (get-text-property (point) 'jsx-depth)) + (web-mode-tag-highlight)) + ) + (t + (web-mode-tag-highlight)) + ) ;cond + (when (or (not (web-mode-tag-next)) + (>= (point) reg-end)) + (setq continue nil)) + ) ;while + (when web-mode-enable-inlays + (when (null web-mode-inlay-regexp) + (setq web-mode-inlay-regexp (regexp-opt '("\\[" "\\(" "\\begin{align}")))) + (let (beg end expr) + (goto-char reg-beg) + (while (web-mode-dom-rsf web-mode-inlay-regexp reg-end) + (setq beg (match-beginning 0) + end nil + expr (substring (match-string-no-properties 0) 0 2)) + (setq expr (cond + ((string= expr "\\[") "\\]") + ((string= expr "\\(") "\\)") + (t "\\end{align}"))) + (when (and (web-mode-dom-sf expr reg-end) + (setq end (match-end 0)) + (not (text-property-any beg end 'tag-end t))) + (font-lock-append-text-property beg end 'font-lock-face 'web-mode-inlay-face) + ) ;when + ) ;while + ) ;let + ) ;when + (when web-mode-enable-html-entities-fontification + (let (beg end) + (goto-char reg-beg) + (while (web-mode-dom-rsf "&\\([#]?[[:alnum:]]\\{2,8\\}\\);" reg-end) + (setq beg (match-beginning 0) + end (match-end 0)) + (when (not (text-property-any beg end 'tag-end t)) + (font-lock-append-text-property beg end 'font-lock-face 'web-mode-html-entity-face) + ) ;when + ) ;while + ) ;let + ) ;when + )) + +(defun web-mode-tag-highlight (&optional beg end) + (unless beg (setq beg (point))) + (unless end (setq end (1+ (web-mode-tag-end-position beg)))) + (let (name type face flags slash-beg slash-end bracket-end) + (setq flags (get-text-property beg 'tag-beg) + type (get-text-property beg 'tag-type) + name (get-text-property beg 'tag-name)) + (setq bracket-end (> (logand flags 16) 0)) + (cond + ((eq type 'comment) + (put-text-property beg end 'font-lock-face 'web-mode-comment-face) + (when (and web-mode-enable-comment-interpolation (> (- end beg) 5)) + (web-mode-interpolate-comment beg end nil))) + ((eq type 'cdata) + (put-text-property beg end 'font-lock-face 'web-mode-doctype-face)) + ((eq type 'doctype) + (put-text-property beg end 'font-lock-face 'web-mode-doctype-face)) + ((eq type 'declaration) + (put-text-property beg end 'font-lock-face 'web-mode-doctype-face)) + (name + (setq slash-beg (> (logand flags 4) 0) + slash-end (> (logand flags 8) 0) + bracket-end (> (logand flags 16) 0)) + (setq face (cond + ((not bracket-end) 'web-mode-html-tag-unclosed-face) + ((and web-mode-enable-element-tag-fontification + (setq face (cdr (assoc name web-mode-element-tag-faces)))) + face) + ((> (logand flags 32) 0) 'web-mode-html-tag-namespaced-face) + ((> (logand flags 2) 0) 'web-mode-html-tag-custom-face) + (t 'web-mode-html-tag-face))) + (put-text-property beg (+ beg (if slash-beg 2 1)) + 'font-lock-face 'web-mode-html-tag-bracket-face) + (unless (string= name "_fragment_") + (put-text-property (+ beg (if slash-beg 2 1)) + (+ beg (if slash-beg 2 1) (length name)) + 'font-lock-face face)) + (when (or slash-end bracket-end) + (put-text-property (- end (if slash-end 2 1)) end 'font-lock-face 'web-mode-html-tag-bracket-face) + ) ;when + (when (> (logand flags 1) 0) + ;;(message "%S>%S" beg end) + (web-mode-highlight-attrs beg end)) + ) ;case name + ) ;cond + )) + +(defun web-mode-highlight-attrs (reg-beg reg-end) + (let ((continue t) (pos reg-beg) beg end flags offset face) + ;;(message "highlight-attrs %S>%S" reg-beg reg-end) + (while continue + (setq beg (web-mode-attribute-next-position pos reg-end)) + (cond + ((or (null beg) (>= beg reg-end)) + (setq continue nil)) + (t + (setq flags (or (get-text-property beg 'tag-attr-beg) 0)) + (setq face (cond + ((= (logand flags 1) 1) 'web-mode-html-attr-custom-face) + ((= (logand flags 2) 2) 'web-mode-html-attr-engine-face) + ((= (logand flags 4) 4) nil) + (t 'web-mode-html-attr-name-face))) + ;;(setq end (if (get-text-property beg 'tag-attr-end) beg (web-mode-attribute-end-position beg))) + (setq end (web-mode-attribute-end-position beg)) + ;;(message "beg=%S end=%S" beg end) + (cond + ((or (null end) (>= end reg-end)) + (setq continue nil)) + (t + (setq offset (get-text-property end 'tag-attr-end)) + (if (= offset 0) + (put-text-property beg (1+ end) 'font-lock-face face) + (put-text-property beg (+ beg offset) 'font-lock-face face) + (put-text-property (+ beg offset) (+ beg offset 1) + 'font-lock-face + 'web-mode-html-attr-equal-face) + (when (not (get-text-property (+ beg offset 1) 'jsx-beg)) + (put-text-property (+ beg offset 1) (1+ end) + 'font-lock-face + 'web-mode-html-attr-value-face) + ) + ) ;if offset + (setq pos (1+ end)) + ) ;t + ) ;cond + ) ;t + );cond + ) ;while + )) + +(defun web-mode-block-highlight (reg-beg reg-end) + (let (sub1 sub2 sub3 continue char keywords token-type face beg end (buffer (current-buffer))) + ;;(message "reg-beg=%S reg-end=%S" reg-beg reg-end) + + ;; NOTE: required for blocks inside tag attrs + (remove-list-of-text-properties reg-beg reg-end '(font-lock-face)) + + (goto-char reg-beg) + + (when (null web-mode-engine-font-lock-keywords) + (setq sub1 (buffer-substring-no-properties + reg-beg (+ reg-beg 1)) + sub2 (buffer-substring-no-properties + reg-beg (+ reg-beg 2)) + sub3 (buffer-substring-no-properties + reg-beg (+ reg-beg (if (>= (point-max) (+ reg-beg 3)) 3 2)))) + ) + + (cond + + ((and (get-text-property reg-beg 'block-beg) + (eq (get-text-property reg-beg 'block-token) 'comment)) + (put-text-property reg-beg reg-end 'font-lock-face 'web-mode-comment-face) + ) ;comment block + + (web-mode-engine-font-lock-keywords + (setq keywords web-mode-engine-font-lock-keywords) + ) + + ((string= web-mode-engine "django") + (cond + ((string= sub2 "{{") + (setq keywords web-mode-django-expr-font-lock-keywords)) + ((string= sub2 "{%") + (setq keywords web-mode-django-code-font-lock-keywords)) + )) ;django + + ((string= web-mode-engine "mako") + (cond + ((member sub3 '("<% " "<%\n" "<%!")) + (setq keywords web-mode-mako-block-font-lock-keywords)) + ((eq (aref sub2 0) ?\%) + (setq keywords web-mode-mako-block-font-lock-keywords)) + ((member sub2 '("<%" " %S face(%S)" beg end face) + (remove-list-of-text-properties beg end '(face)) + (put-text-property beg end 'font-lock-face face) + ) + (setq continue nil + end nil) + ) ;if end + ) ;progn beg + (setq continue nil + end nil) + ) ;if beg + (when (and beg end) + (save-match-data + (when (and web-mode-enable-heredoc-fontification + (eq char ?\<) + (> (- end beg) 8) + ;;(progn (message "%S" (buffer-substring-no-properties beg end)) t) + (string-match-p "JS\\|JAVASCRIPT\\|HTM\\|CSS" (buffer-substring-no-properties beg end))) + (setq keywords + (cond + ((string-match-p "H" (buffer-substring-no-properties beg (+ beg 8))) + web-mode-html-font-lock-keywords) + (t + web-mode-javascript-font-lock-keywords) + )) + (web-mode-fontify-region beg end keywords) + )) +;; (message "%S %c %S beg=%S end=%S" web-mode-enable-string-interpolation char web-mode-engine beg end) + (when (and web-mode-enable-string-interpolation + (member char '(?\" ?\<)) + (member web-mode-engine '("php" "erb")) + (> (- end beg) 4)) + (web-mode-interpolate-block-string beg end) + ) ;when + (when (and web-mode-enable-comment-interpolation + (eq token-type 'comment) + (> (- end beg) 3)) + (web-mode-interpolate-comment beg end t) + ) ;when + (when (and web-mode-enable-comment-annotation + (eq token-type 'comment) + (> (- end beg) 3)) + (web-mode-annotate-comment beg end) + ) ;when + (when (and web-mode-enable-sql-detection + (eq token-type 'string) + (> (- end beg) 6) + ;;(eq char ?\<) + ;;(web-mode-looking-at-p (concat "[ \n]*" web-mode-sql-queries) (1+ beg)) + (web-mode-looking-at-p (concat "\\(.\\|<<<[[:alnum:]]+\\)[ \n]*" web-mode-sql-queries) beg) + ) + (web-mode-interpolate-sql-string beg end) + ) ;when + ) ;when beg end + ) ;while continue + ) ;when keywords + + ;;(when (and (member web-mode-engine '("jsp" "mako")) + (when (and (member web-mode-engine '("mako")) + (> (- reg-end reg-beg) 12) + (eq ?\< (char-after reg-beg))) + (web-mode-interpolate-block-tag reg-beg reg-end)) + + (when web-mode-enable-block-face +;; (message "block-face %S %S" reg-beg reg-end) + (font-lock-append-text-property reg-beg reg-end 'face 'web-mode-block-face)) + + )) + +(defun web-mode-part-highlight (reg-beg reg-end &optional depth) + (save-excursion + (let (start continue token-type face pos beg end string-face comment-face content-type) + ;;(message "part-highlight: reg-beg(%S) reg-end(%S)" reg-beg reg-end) + (if (member web-mode-content-type web-mode-part-content-types) + (setq content-type web-mode-content-type) + (setq content-type (symbol-name (get-text-property reg-beg 'part-side)))) + ;;(message "content-type=%S" content-type) + (unless depth + (when (string= content-type "jsx") (setq depth 0)) + ) + (setq string-face 'web-mode-part-string-face + comment-face 'web-mode-part-comment-face) + (cond + ((member content-type '("javascript" "jsx")) + (setq string-face 'web-mode-javascript-string-face + comment-face 'web-mode-javascript-comment-face) + (web-mode-fontify-region reg-beg reg-end web-mode-javascript-font-lock-keywords)) + ((string= content-type "json") + (setq string-face 'web-mode-json-string-face + comment-face 'web-mode-json-comment-face) + (web-mode-fontify-region reg-beg reg-end web-mode-javascript-font-lock-keywords)) + ((string= content-type "css") + (setq string-face 'web-mode-css-string-face + comment-face 'web-mode-css-comment-face) + (web-mode-css-rules-highlight reg-beg reg-end)) + ((string= content-type "sql") + (web-mode-fontify-region reg-beg reg-end web-mode-sql-font-lock-keywords)) + ((string= content-type "stylus") + (web-mode-fontify-region reg-beg reg-end web-mode-stylus-font-lock-keywords)) + ((string= content-type "markdown") + (web-mode-fontify-region reg-beg reg-end web-mode-markdown-font-lock-keywords)) + ((string= content-type "ruby") + (web-mode-fontify-region reg-beg reg-end web-mode-erb-font-lock-keywords)) + ) ;cond + + (goto-char reg-beg) + + ;;(when (string= content-type "jsx") (web-mode-highlight-tags reg-beg reg-end)) + ;;(setq continue (and pos (< pos reg-end))) + (setq continue t + pos reg-beg) + (while continue + (if (get-text-property pos 'part-token) + (setq beg pos) + (setq beg (next-single-property-change pos 'part-token))) + (cond + ((or (null beg) (>= beg reg-end)) + (setq continue nil + end nil)) + ((and (eq depth 0) (get-text-property beg 'jsx-depth)) + (setq pos (or (next-single-property-change beg 'jsx-depth) (point-max)))) + (t + (setq token-type (get-text-property beg 'part-token)) + (setq face (cond + ((eq token-type 'string) string-face) + ((eq token-type 'comment) comment-face) + ((eq token-type 'context) 'web-mode-json-context-face) + ((eq token-type 'key) 'web-mode-json-key-face) + (t nil))) + (setq end (or (next-single-property-change beg 'part-token) (point-max)) + pos end) + (cond + ((or (null end) (> end reg-end)) + (setq continue nil + end nil)) + (t + (when face + (remove-list-of-text-properties beg end '(face)) + (put-text-property beg end 'font-lock-face face)) + (cond + ((< (- end beg) 6) + ) + ((eq token-type 'string) + (when (and web-mode-enable-string-interpolation + (member content-type '("javascript" "jsx"))) + (web-mode-interpolate-javascript-string beg end))) + ((eq token-type 'comment) + (when web-mode-enable-comment-interpolation + (web-mode-interpolate-comment beg end t)) + (when web-mode-enable-comment-annotation + (web-mode-annotate-comment beg end)) + ) + ) ;cond + ) ;t + ) ;cond + ) ;t + ) ;cond + ) ;while + + (when (and (string= web-mode-content-type "html") web-mode-enable-part-face) + (font-lock-append-text-property reg-beg reg-end 'face + (cond + ((string= content-type "javascript") + 'web-mode-script-face) + ((string= content-type "css") + 'web-mode-style-face) + (t + 'web-mode-part-face))) + ) + + (when (and web-mode-enable-css-colorization (string= content-type "stylus")) + (goto-char reg-beg) + (while (and (re-search-forward "#[0-9a-fA-F]\\{6\\}\\|#[0-9a-fA-F]\\{3\\}\\|rgba?([ ]*\\([[:digit:]]\\{1,3\\}\\)[ ]*,[ ]*\\([[:digit:]]\\{1,3\\}\\)[ ]*,[ ]*\\([[:digit:]]\\{1,3\\}\\)\\(.*?\\))" end t) + (<= (point) reg-end)) + (web-mode-colorize (match-beginning 0) (match-end 0)) + ) + ) + + (when (and (eq depth 0) (string= content-type "jsx")) + (let (pair elt-beg elt-end exp-beg exp-end exp-depth) + (goto-char reg-beg) + (while (setq pair (web-mode-jsx-element-next reg-end)) + ;;(message "elt-pair=%S" pair) + (setq elt-beg (car pair) + elt-end (cdr pair)) + (remove-list-of-text-properties elt-beg (1+ elt-end) '(face)) + (web-mode-highlight-tags elt-beg elt-end 1) + (goto-char elt-beg) + (while (setq pair (web-mode-jsx-expression-next elt-end)) + ;;(message "exp-pair=%S elt-end=%S" pair elt-end) + (setq exp-beg (car pair) + exp-end (cdr pair)) + (when (eq (char-after exp-beg) ?\{) + ;;(message "%S : %c %c" exp-beg (char-after (+ exp-beg 1)) (char-after (+ exp-beg 2))) + (cond + ;;((and (eq (char-after (+ exp-beg 1)) ?\/) (eq (char-after (+ exp-beg 2)) ?\*)) + ;; (put-text-property exp-beg (1+ exp-end) 'font-lock-face 'web-mode-part-comment-face) + ;; ) + (t + (setq exp-depth (get-text-property exp-beg 'jsx-depth)) + (remove-list-of-text-properties exp-beg exp-end '(font-lock-face)) + (put-text-property exp-beg (1+ exp-beg) 'font-lock-face 'web-mode-block-delimiter-face) + (when (and (eq (get-text-property exp-beg 'tag-attr-beg) 4) (web-mode-looking-at-p "\.\.\." (1+ exp-beg))) + (put-text-property exp-beg (+ exp-beg 4) 'font-lock-face 'web-mode-block-delimiter-face)) + (put-text-property exp-end (1+ exp-end) 'font-lock-face 'web-mode-block-delimiter-face) + (web-mode-highlight-tags (1+ exp-beg) exp-end (1+ exp-depth)) + (web-mode-part-highlight (1+ exp-beg) exp-end exp-depth) + (web-mode-fontify-region (1+ exp-beg) exp-end web-mode-javascript-font-lock-keywords) + ) ;t + ) ;cond + ) ;when + (goto-char (1+ exp-beg)) + ) ;while exp + + (when (and elt-beg web-mode-jsx-depth-faces) + (let (depth-beg depth-end jsx-face) + (goto-char elt-beg) + (while (setq pair (web-mode-jsx-depth-next reg-end)) + ;;(message "depth-pair=%S" pair) + (setq depth-beg (car pair) + depth-end (cdr pair) + depth (get-text-property depth-beg 'jsx-depth) + jsx-face (elt web-mode-jsx-depth-faces (1- depth))) + ;;(message "%S" jsx-face) + (font-lock-prepend-text-property depth-beg (1+ depth-end) 'face jsx-face) + (goto-char (+ depth-beg 2)) + ) + ) ;let + ) + + (goto-char (1+ elt-end)) + ) ;while elt + ) ;let + ) ;when + + ) ;let + ) ;save-excursion + ) + +(defun web-mode-css-rules-highlight (part-beg part-end) + (save-excursion + (goto-char part-beg) + (let (rule (continue t) (i 0) (at-rule nil) (var-rule nil)) + (while continue + (setq rule (web-mode-css-rule-next part-end)) + ;;(message "rule=%S" rule) + (cond + ((> (setq i (1+ i)) 1000) + (message "css-rules-highlight ** too much rules **") + (setq continue nil)) + ((null rule) + (setq continue nil)) + ((and (setq at-rule (plist-get rule :at-rule)) + (not (member at-rule '("charset" "font-face" "import" "viewport"))) + (plist-get rule :dec-end)) + (web-mode-css-rule-highlight (plist-get rule :sel-beg) + (plist-get rule :sel-end) + nil nil) + (web-mode-css-rules-highlight (plist-get rule :dec-beg) + (plist-get rule :dec-end))) + (t + (web-mode-css-rule-highlight (plist-get rule :sel-beg) + (plist-get rule :sel-end) + (plist-get rule :dec-beg) + (plist-get rule :dec-end))) + ) ;cond + ) ;while + ) ;let + )) + +(defun web-mode-css-rule-highlight (sel-beg sel-end dec-beg dec-end) + (save-excursion + ;;(let ((end sel-end)) + ;;(message "sel-beg=%S sel-end=%S dec-beg=%S dec-end=%S" sel-beg sel-end dec-beg dec-end) + (web-mode-fontify-region sel-beg sel-end web-mode-selector-font-lock-keywords) + (when (and dec-beg dec-end) + ;;(setq end dec-end) + (web-mode-fontify-region dec-beg dec-end web-mode-declaration-font-lock-keywords) + ) ;when + (when (and dec-beg dec-end) + (goto-char dec-beg) + (while (and web-mode-enable-css-colorization + (re-search-forward "#[0-9a-fA-F]\\{6\\}\\|#[0-9a-fA-F]\\{3\\}\\|rgba?([ ]*\\([[:digit:]]\\{1,3\\}\\)[ ]*,[ ]*\\([[:digit:]]\\{1,3\\}\\)[ ]*,[ ]*\\([[:digit:]]\\{1,3\\}\\)\\(.*?\\))" dec-end t) + ;;(progn (message "%S %S" end (point)) t) + (<= (point) dec-end)) + (web-mode-colorize (match-beginning 0) (match-end 0)) + ) ;while + ) ;when + ;;) ;let + )) + +(defun web-mode-fontify-region (beg end keywords) +;; (message "beg=%S end=%S" beg end);; (symbol-name keywords)) + (save-excursion + (let ((font-lock-keywords keywords) + (font-lock-multiline nil) + (font-lock-keywords-case-fold-search + (member web-mode-engine '("archibus" "asp" "template-toolkit"))) + (font-lock-keywords-only t) + (font-lock-extend-region-functions nil)) + ;; (message "%S" keywords) + (when (listp font-lock-keywords) + (font-lock-fontify-region beg end) + ) + ) + )) + +(defun web-mode-colorize-foreground (color) + (let* ((values (x-color-values color)) + (r (car values)) + (g (cadr values)) + (b (car (cdr (cdr values))))) + (if (> 128.0 (floor (+ (* .3 r) (* .59 g) (* .11 b)) 256)) + "white" "black"))) + +(defun web-mode-colorize (beg end) + (let (str plist len) + (setq str (buffer-substring-no-properties beg end)) + (setq len (length str)) + (cond + ((string= (substring str 0 1) "#") + (setq plist (list :background str + :foreground (web-mode-colorize-foreground str))) + (put-text-property beg end 'face plist)) + ((or (string= (substring str 0 4) "rgb(") (string= (substring str 0 5) "rgba(")) + (setq str (format "#%02X%02X%02X" + (string-to-number (match-string-no-properties 1)) + (string-to-number (match-string-no-properties 2)) + (string-to-number (match-string-no-properties 3)))) + (setq plist (list :background str + :foreground (web-mode-colorize-foreground str))) + (put-text-property beg end 'face plist)) + ) ;cond + )) + +(defun web-mode-interpolate-block-tag (beg end) + (save-excursion + (goto-char (+ 4 beg)) + (setq end (1- end)) + (while (re-search-forward "${.*?}" end t) + (remove-list-of-text-properties (match-beginning 0) (match-end 0) '(face)) + (web-mode-fontify-region (match-beginning 0) (match-end 0) + web-mode-uel-font-lock-keywords)) + )) + +(defun web-mode-interpolate-javascript-string (beg end) + (save-excursion + (goto-char (1+ beg)) + (setq end (1- end)) + (while (re-search-forward "${.*?}" end t) + (put-text-property (match-beginning 0) (match-end 0) + 'font-lock-face + 'web-mode-variable-name-face) + ) + )) + +;; todo : parsing plus compliqué: {$obj->values[3]->name} +(defun web-mode-interpolate-block-string (beg end) + (save-excursion + (goto-char (1+ beg)) + (setq end (1- end)) + (cond + ((string= web-mode-engine "php") + (while (re-search-forward "$[[:alnum:]_]+\\(->[[:alnum:]_]+\\)*\\|{[ ]*$.+?}" end t) +;; (message "%S > %S" (match-beginning 0) (match-end 0)) + (remove-list-of-text-properties (match-beginning 0) (match-end 0) '(font-lock-face)) + (web-mode-fontify-region (match-beginning 0) (match-end 0) + web-mode-php-var-interpolation-font-lock-keywords) + )) + ((string= web-mode-engine "erb") + (while (re-search-forward "#{.*?}" end t) + (remove-list-of-text-properties (match-beginning 0) (match-end 0) '(font-lock-face)) + (put-text-property (match-beginning 0) (match-end 0) + 'font-lock-face 'web-mode-variable-name-face) + )) + ) ;cond + )) + +(defun web-mode-interpolate-comment (beg end block-side) + (save-excursion + (let ((regexp (concat "\\_<\\(" web-mode-comment-keywords "\\)\\_>"))) + (goto-char beg) + (while (re-search-forward regexp end t) + (font-lock-prepend-text-property (match-beginning 1) (match-end 1) + 'font-lock-face + 'web-mode-comment-keyword-face) + ) ;while + ))) + +(defun web-mode-annotate-comment (beg end) + (save-excursion + ;;(message "beg=%S end=%S" beg end) + (goto-char beg) + (when (looking-at-p "/\\*\\*") + (while (re-search-forward "[ ]+\\({[^}]+}\\)" end t) + (font-lock-prepend-text-property (match-beginning 1) (match-end 1) + 'font-lock-face + 'web-mode-annotation-type-face)) + (goto-char beg) + (while (re-search-forward "\\(@[[:alnum:]]+\\)" end t) + (font-lock-prepend-text-property (match-beginning 1) (match-end 1) + 'font-lock-face + 'web-mode-annotation-tag-face)) + ) ;when + )) + +(defun web-mode-interpolate-sql-string (beg end) + (save-excursion + (let ((case-fold-search t) + (regexp (concat "\\_<\\(" web-mode-sql-keywords "\\)\\_>"))) + (goto-char beg) + (while (re-search-forward regexp end t) + (font-lock-prepend-text-property (match-beginning 1) (match-end 1) + 'font-lock-face + 'web-mode-sql-keyword-face) + ) ;while + ))) + +(defun web-mode-fill-paragraph (&optional justify) + (save-excursion + (let ((pos (point)) fill-coll + prop pair beg end delim-beg delim-end chunk fill-col) + (cond + ((or (eq (get-text-property pos 'part-token) 'comment) + (eq (get-text-property pos 'block-token) 'comment)) + (setq prop + (if (get-text-property pos 'part-token) 'part-token 'block-token)) + (setq pair (web-mode-property-boundaries prop pos)) + (when (and pair (> (- (cdr pair) (car pair)) 6)) + (setq fill-coll (if (< fill-column 10) 70 fill-column)) + (setq beg (car pair) + end (cdr pair)) + (goto-char beg) + (setq chunk (buffer-substring-no-properties beg (+ beg 2))) + (cond + ((string= chunk "//") + (setq delim-beg "//" + delim-end "EOL")) + ((string= chunk "/*") + (setq delim-beg "/*" + delim-end "*/")) + ((string= chunk "{#") + (setq delim-beg "{#" + delim-end "#}")) + ((string= chunk "")) + ) + ) + ) ;comment - case + ((web-mode-is-content) + (setq pair (web-mode-content-boundaries pos)) + (setq beg (car pair) + end (cdr pair)) + ) + ) ;cond + ;;(message "beg(%S) end(%S)" beg end) + (when (and beg end) + (fill-region beg end)) + t))) + +(defun web-mode-property-boundaries (prop &optional pos) + "property boundaries (cdr is 1+)" + (unless pos (setq pos (point))) + (let (beg end val) + (setq val (get-text-property pos prop)) + (if (null val) + val + (if (or (bobp) + (not (eq (get-text-property (1- pos) prop) val))) + (setq beg pos) + (setq beg (previous-single-property-change pos prop)) + (when (null beg) (setq beg (point-min)))) + (if (or (eobp) + (not (eq (get-text-property (1+ pos) prop) val))) + (setq end pos) + (setq end (next-single-property-change pos prop)) + (when (null end) (setq end (point-min)))) + (cons beg end)))) + +(defun web-mode-content-boundaries (&optional pos) + (unless pos (setq pos (point))) + (let (beg end) + (setq beg (or (previous-property-change pos (current-buffer)) + (point-max))) + (setq end (or (next-property-change pos (current-buffer)) + (point-min))) + (while (and (< beg end) (member (char-after beg) '(?\s ?\n))) + (setq beg (1+ beg))) + (while (and (> end beg) (member (char-after (1- end)) '(?\s ?\n))) + (setq end (1- end))) +;; (message "beg(%S) end(%S)" beg end) + (cons beg end) + )) + +(defun web-mode-engine-syntax-check () + (interactive) + (let ((proc nil) (errors nil) + (file (concat temporary-file-directory "emacs-web-mode-tmp"))) + (write-region (point-min) (point-max) file) + (cond + ;; ((null (buffer-file-name)) + ;; ) + ((string= web-mode-engine "php") + (setq proc (start-process "php-proc" nil "php" "-l" file)) + (set-process-filter + proc + (lambda (proc output) + (cond + ((string-match-p "No syntax errors" output) + (message "No syntax errors") + ) + (t + ;; (setq output (replace-regexp-in-string temporary-file-directory "" output)) + ;; (message output) + (message "Syntax error") + (setq errors t)) + ) ;cond + ;; (delete-file file) + ) ;lambda + ) + ) ;php + (t + (message "no syntax checker found") + ) ;t + ) ;cond + errors)) + +(defun web-mode-jshint () + "Run JSHint on all the JavaScript parts." + (interactive) + (let (proc lines) + (when (buffer-file-name) + (setq proc (start-process + "jshint-proc" + nil + (or (executable-find "jshint") "/usr/local/bin/jshint") + "--extract=auto" + (buffer-file-name))) + (setq web-mode-jshint-errors 0) + (set-process-filter proc + (lambda (proc output) + (let ((offset 0) overlay pos (old 0) msg) + (remove-overlays (point-min) (point-max) 'font-lock-face 'web-mode-error-face) + (while (string-match + "line \\([[:digit:]]+\\), col \\([[:digit:]]+\\), \\(.+\\)\\.$" + output offset) + (setq web-mode-jshint-errors (1+ web-mode-jshint-errors)) + (setq offset (match-end 0)) + (setq pos (web-mode-coord-position + (match-string-no-properties 1 output) + (match-string-no-properties 2 output))) + (when (get-text-property pos 'tag-beg) + (setq pos (1- pos))) + (when (not (= pos old)) + (setq old pos) + (setq overlay (make-overlay pos (1+ pos))) + (overlay-put overlay 'font-lock-face 'web-mode-error-face) + ) + (setq msg (or (overlay-get overlay 'help-echo) + (concat "line=" + (match-string-no-properties 1 output) + " column=" + (match-string-no-properties 2 output) + ))) + (overlay-put overlay 'help-echo + (concat msg " ## " (match-string-no-properties 3 output))) + ) ;while + )) + ) + ) ;when + )) + +(defun web-mode-dom-errors-show () + "Show unclosed tags." + (interactive) + (let (beg end tag pos l n tags i cont cell overlay overlays first + (ori (point)) + (errors 0) + (continue t) + ) + (setq overlays (overlays-in (point-min) (point-max))) + (when overlays + (dolist (overlay overlays) + (when (eq (overlay-get overlay 'face) 'web-mode-warning-face) + (delete-overlay overlay) + ) + ) + ) + (goto-char (point-min)) + (when (not (or (get-text-property (point) 'tag-beg) + (web-mode-tag-next))) + (setq continue nil)) + (while continue + (setq pos (point)) + (setq tag (get-text-property pos 'tag-name)) + (cond + ((eq (get-text-property (point) 'tag-type) 'start) + (setq tags (add-to-list 'tags (list tag pos))) +;; (message "(%S) opening %S" pos tag) + ) + ((eq (get-text-property (point) 'tag-type) 'end) + (setq i 0 + l (length tags) + cont t) + (while (and (< i l) cont) + (setq cell (nth i tags)) +;; (message "cell=%S" cell) + (setq i (1+ i)) + (cond + ((string= tag (nth 0 cell)) + (setq cont nil) + ) + (t + (setq errors (1+ errors)) + (setq beg (nth 1 cell)) + (setq end (web-mode-tag-end-position beg)) + (unless first + (setq first beg)) + (setq overlay (make-overlay beg (1+ end))) + (overlay-put overlay 'font-lock-face 'web-mode-warning-face) +;; (message "invalid <%S> at %S" (nth 0 cell) (nth 1 cell)) + ) + ) ;cond + ) ;while + + (dotimes (i i) + (setq tags (cdr tags))) + + ) + ) ;cond + (when (not (web-mode-tag-next)) + (setq continue nil)) + ) ;while + (message "%S error(s) detected" errors) + (if (< errors 1) + (goto-char ori) + (goto-char first) + (recenter)) + ;; (message "%S" tags) + )) + +(defun web-mode-highlight-elements (beg end) + (save-excursion + (goto-char beg) + (let ((continue (or (get-text-property (point) 'tag-beg) (web-mode-tag-next))) + (i 0) (ctx nil) (face nil)) + (while continue + (cond + ((> (setq i (1+ i)) 1000) + (message "highlight-elements ** too much tags **") + (setq continue nil)) + ((> (point) end) + (setq continue nil)) + ((not (get-text-property (point) 'tag-beg)) + (setq continue nil)) + ((eq (get-text-property (point) 'tag-type) 'start) + (when (and (setq ctx (web-mode-element-boundaries (point))) + (<= (car (cdr ctx)) end) + (setq face (cdr (assoc (get-text-property (point) 'tag-name) web-mode-element-content-faces)))) + (font-lock-prepend-text-property (1+ (cdr (car ctx))) (car (cdr ctx)) + 'font-lock-face face)) + ) + ) ;cond + (when (not (web-mode-tag-next)) + (setq continue nil)) + ) ;while + ))) + +(defun web-mode-enable (feature) + "Enable one feature." + (interactive + (list (completing-read + "Feature: " + (let (features) + (dolist (elt web-mode-features) + (setq features (append features (list (car elt))))) + features)))) + (when (and (or (not feature) (< (length feature) 1)) web-mode-last-enabled-feature) + (setq feature web-mode-last-enabled-feature)) + (when feature + (setq web-mode-last-enabled-feature feature) + (setq feature (cdr (assoc feature web-mode-features))) + (cond + ((eq feature 'web-mode-enable-current-column-highlight) + (web-mode-column-show)) + ((eq feature 'web-mode-enable-current-element-highlight) + (when (not web-mode-enable-current-element-highlight) + (web-mode-toggle-current-element-highlight)) + ) + ((eq feature 'web-mode-enable-whitespace-fontification) + (web-mode-whitespaces-on)) + (t + (set feature t) + (web-mode-buffer-highlight)) + ) + ) ;when + ) + +(defun web-mode-disable (feature) + "Disable one feature." + (interactive + (list (completing-read + "Feature: " + (let (features) + (dolist (elt web-mode-features) + (setq features (append features (list (car elt))))) + features)))) + (when (and (or (not feature) (< (length feature) 1)) web-mode-last-enabled-feature) + (setq feature web-mode-last-enabled-feature)) + (when feature + (setq feature (cdr (assoc feature web-mode-features))) + (cond + ((eq feature 'web-mode-enable-current-column-highlight) + (web-mode-column-hide)) + ((eq feature 'web-mode-enable-current-element-highlight) + (when web-mode-enable-current-element-highlight + (web-mode-toggle-current-element-highlight)) + ) + ((eq feature 'web-mode-enable-whitespace-fontification) + (web-mode-whitespaces-off)) + (t + (set feature nil) + (web-mode-buffer-highlight)) + ) + ) ;when + ) + +(defun web-mode-make-tag-overlays () + (unless web-mode-overlay-tag-start + (setq web-mode-overlay-tag-start (make-overlay 1 1) + web-mode-overlay-tag-end (make-overlay 1 1)) + (overlay-put web-mode-overlay-tag-start + 'font-lock-face + 'web-mode-current-element-highlight-face) + (overlay-put web-mode-overlay-tag-end + 'font-lock-face + 'web-mode-current-element-highlight-face))) + +(defun web-mode-delete-tag-overlays () + (when web-mode-overlay-tag-start + (delete-overlay web-mode-overlay-tag-start) + (delete-overlay web-mode-overlay-tag-end))) + +(defun web-mode-column-overlay-factory (index) + (let (overlay) + (when (null web-mode-column-overlays) + (dotimes (i 100) + (setq overlay (make-overlay 1 1)) + (overlay-put overlay 'font-lock-face 'web-mode-current-column-highlight-face) + (setq web-mode-column-overlays (append web-mode-column-overlays (list overlay))) + ) + ) ;when + (setq overlay (nth index web-mode-column-overlays)) + (when (null overlay) + (setq overlay (make-overlay 1 1)) + (overlay-put overlay 'font-lock-face 'web-mode-current-column-highlight-face) + (setq web-mode-column-overlays (append web-mode-column-overlays (list overlay))) + ) ;when + overlay)) + +(defun web-mode-column-hide () + (setq web-mode-enable-current-column-highlight nil) + (remove-overlays (point-min) (point-max) + 'font-lock-face + 'web-mode-current-column-highlight-face)) + +(defun web-mode-column-show () + (let ((index 0) overlay diff column line-to line-from) + (web-mode-column-hide) + (setq web-mode-enable-current-column-highlight t) + (save-excursion + (back-to-indentation) + (setq column (current-column) + line-to (web-mode-line-number)) + (when (and (get-text-property (point) 'tag-beg) + (member (get-text-property (point) 'tag-type) '(start end)) + (web-mode-tag-match) + (setq line-from (web-mode-line-number)) + (not (= line-from line-to))) + (when (> line-from line-to) + (let (tmp) + (setq tmp line-from) + (setq line-from line-to) + (setq line-to tmp)) + ) ;when + ;;(message "column(%S) line-from(%S) line-to(%S)" column line-from line-to) + (goto-char (point-min)) + (when (> line-from 1) + (forward-line (1- line-from))) + (while (<= line-from line-to) + (setq overlay (web-mode-column-overlay-factory index)) + (setq diff (- (line-end-position) (point))) + (cond + ((or (and (= column 0) (= diff 0)) + (> column diff)) + (end-of-line) + (move-overlay overlay (point) (point)) + (overlay-put overlay + 'after-string + (concat + (if (> column diff) (make-string (- column diff) ?\s) "") + (propertize " " + 'font-lock-face + 'web-mode-current-column-highlight-face) + ) ;concat + ) + ) + (t + (move-to-column column) + (overlay-put overlay 'after-string nil) + (move-overlay overlay (point) (1+ (point))) + ) + ) ;cond + (setq line-from (1+ line-from)) + (forward-line) + (setq index (1+ index)) + ) ;while + ) ;when + ) ;save-excursion + ) ;let + ) + +(defun web-mode-highlight-current-element () + (let ((ctx (web-mode-element-boundaries)) len) + (cond + ((null ctx) + (web-mode-delete-tag-overlays)) + (t + (web-mode-make-tag-overlays) + (setq len (length (get-text-property (caar ctx) 'tag-name))) + (move-overlay web-mode-overlay-tag-start (+ (caar ctx) 1) (+ (caar ctx) 1 len)) + (move-overlay web-mode-overlay-tag-end (+ (cadr ctx) 2) (+ (cadr ctx) 2 len)) + ) ;t + ) ;cond + )) + +(defun web-mode-highlight-whitespaces (beg end) + (save-excursion + (goto-char beg) + (while (re-search-forward web-mode-whitespaces-regexp end t) + (add-text-properties (match-beginning 0) (match-end 0) + '(face web-mode-whitespace-face)) + ) ;while + )) + +(defun web-mode-whitespaces-show () + "Toggle whitespaces." + (interactive) + (if web-mode-enable-whitespace-fontification + (web-mode-whitespaces-off) + (web-mode-whitespaces-on))) + +(defun web-mode-whitespaces-on () + "Show whitespaces." + (interactive) + (when web-mode-display-table + (setq buffer-display-table web-mode-display-table)) + (setq web-mode-enable-whitespace-fontification t)) + +(defun web-mode-whitespaces-off () + (setq buffer-display-table nil) + (setq web-mode-enable-whitespace-fontification nil)) + +(defun web-mode-use-tabs () + "Tweaks vars to be compatible with TAB indentation." + (let (offset) + (setq web-mode-block-padding 0) + (setq web-mode-script-padding 0) + (setq web-mode-style-padding 0) + (setq offset + (cond + ((and (boundp 'tab-width) tab-width) tab-width) + ((and (boundp 'standard-indent) standard-indent) standard-indent) + (t 4))) + ;; (message "offset(%S)" offset) + (setq web-mode-attr-indent-offset offset) + (setq web-mode-code-indent-offset offset) + (setq web-mode-css-indent-offset offset) + (setq web-mode-markup-indent-offset offset) + (setq web-mode-sql-indent-offset offset) + (add-to-list 'web-mode-indentation-params '("lineup-args" . nil)) + (add-to-list 'web-mode-indentation-params '("lineup-calls" . nil)) + (add-to-list 'web-mode-indentation-params '("lineup-concats" . nil)) + (add-to-list 'web-mode-indentation-params '("lineup-ternary" . nil)) + )) + +(defun web-mode-buffer-indent () + "Indent all buffer." + (interactive) + (let ((debug t) (ts (current-time)) (sub nil)) + (indent-region (point-min) (point-max)) + (when debug + (setq sub (time-subtract (current-time) ts)) + (message "buffer-indent: time elapsed = %Ss %9Sµs" (nth 1 sub) (nth 2 sub))) + (delete-trailing-whitespace))) + +(defun web-mode-buffer-change-tag-case (&optional type) + "Change html tag case." + (interactive) + (save-excursion + (goto-char (point-min)) + (let ((continue t) f) + (setq f (if (member type '("upper" "uppercase" "upper-case")) 'uppercase 'downcase)) + (when (and (not (get-text-property (point) 'tag-beg)) + (not (web-mode-tag-next))) + (setq continue nil)) + (while continue + (skip-chars-forward " depth 1)) + (when (get-text-property pos 'jsx-beg) + (setq depth (1- depth))) + (setq reg-beg (web-mode-jsx-depth-beginning-position pos depth)) + (setq reg-beg (1+ reg-beg)) + ;;(message "%S" (point)) + (save-excursion + (goto-char reg-beg) + (cond + ((and (not (looking-at-p "[ ]*$")) + (looking-back "^[[:space:]]*{" (point-min))) + (setq reg-col (+ (current-indentation) 1 + (cond + ((looking-at "[ ]+") (length (match-string-no-properties 0))) + (t 0)) + )) + ) + ((looking-at-p "[ ]*\\[[ ]*$") ;; #0659 + (setq reg-col (current-indentation)) + ) + ((and (looking-back "=[ ]*{" (point-min)) ;; #0739 + (looking-at-p "{[ ]*")) + (setq reg-col (current-indentation)) + ) + (t + ;;(message "%S : %S %S" (point) (current-indentation) web-mode-code-indent-offset) + ;;(setq reg-col (+ (current-indentation) web-mode-code-indent-offset web-mode-jsx-expression-padding))) + (setq reg-col (+ (current-indentation) web-mode-code-indent-offset))) + ) + + ;;(message "%S %S %S" (point) (current-indentation) reg-col) + ) ;save-excursion + ) + ((string= web-mode-content-type "jsx") + (setq reg-beg (point-min))) + (t + (setq reg-beg (or (web-mode-part-beginning-position pos) (point-min))) + (save-excursion + (goto-char reg-beg) + (search-backward "<" nil t) + (setq reg-col (current-column)) + ) ;save-excursion + ) + ) ;cond + ;;(message "jsx reg-beg=%S" reg-beg) + ) ;jsx + + ((string= web-mode-content-type "php") + (setq language "php" + curr-indentation web-mode-code-indent-offset)) + + ((or (string= web-mode-content-type "xml")) + (setq language "xml" + curr-indentation web-mode-markup-indent-offset)) + + ;; TODO: est ce util ? + ((and (get-text-property pos 'tag-beg) + (get-text-property pos 'tag-name) + ;;(not (get-text-property pos 'part-side)) + ) + (setq language "html" + curr-indentation web-mode-markup-indent-offset)) + + ((and (get-text-property pos 'block-side) + (not (get-text-property pos 'block-beg))) + + (setq reg-beg (or (web-mode-block-beginning-position pos) (point-min))) + (goto-char reg-beg) + (setq reg-col (current-column)) + (setq language web-mode-engine) + (setq curr-indentation web-mode-code-indent-offset) + + (cond + ((string= web-mode-engine "blade") + (save-excursion + (when (web-mode-rsf "{[{!]+[ ]*") + (setq reg-col (current-column)))) + (setq reg-beg (+ reg-beg 2)) + ) + ((string= web-mode-engine "razor") + (setq reg-beg (+ reg-beg 2)) + ) + ;; tests/demo.chtml + ((string= web-mode-engine "ctemplate") + (save-excursion + (when (web-mode-rsf "{{#?") + (setq reg-col (current-column)))) + ) + ((string= web-mode-engine "dust") + (save-excursion + (when (web-mode-rsf "{@") + (setq reg-col (current-column)))) + ) + ((string= web-mode-engine "template-toolkit") + (setq reg-beg (+ reg-beg 3) + reg-col (+ reg-col 3)) + ) + ((and (string= web-mode-engine "jsp") + (web-mode-looking-at "<%@" reg-beg)) + (save-excursion + (goto-char reg-beg) + (looking-at "<%@[ ]*[[:alpha:]]+[ ]+\\| pos (point-min)) + (eq (get-text-property pos 'part-token) 'comment) + (eq (get-text-property (1- pos) 'part-token) 'comment) + (progn + (setq reg-beg (previous-single-property-change pos 'part-token)) + t)) + (and (> pos (point-min)) + (eq (get-text-property pos 'block-token) 'comment) + (eq (get-text-property (1- pos) 'block-token) 'comment) + (progn + (setq reg-beg (previous-single-property-change pos 'block-token)) + t)) + (and (> pos (point-min)) + (eq (get-text-property pos 'tag-type) 'comment) + (not (get-text-property pos 'tag-beg)) + (progn + (setq reg-beg (web-mode-tag-beginning-position pos)) + t)) + ) + (setq token "comment")) + ((or (and (> pos (point-min)) + (member (get-text-property pos 'part-token) + '(string context key)) + (member (get-text-property (1- pos) 'part-token) + '(string context key))) + (and (eq (get-text-property pos 'block-token) 'string) + (eq (get-text-property (1- pos) 'block-token) 'string))) + (setq token "string")) + ) + + (goto-char pos) + (setq curr-line (web-mode-trim + (buffer-substring-no-properties + (line-beginning-position) + (line-end-position)))) + (setq curr-char (if (string= curr-line "") 0 (aref curr-line 0))) + + (when (or (member language '("php" "blade" "javascript" "jsx" "razor" "css")) + (and (member language '("html" "xml")) + (not (eq ?\< curr-char)))) + (let (prev) + (cond + ((member language '("html" "xml" "javascript" "jsx" "css")) + (when (setq prev (web-mode-part-previous-live-line reg-beg)) + (setq prev-line (nth 0 prev) + prev-indentation (nth 1 prev) + prev-pos (nth 2 prev)) + ) + ) + ((setq prev (web-mode-block-previous-live-line)) + (setq prev-line (car prev) + prev-indentation (cdr prev)) + (setq prev-line (web-mode-clean-block-line prev-line))) + ) ;cond + ) ;let + (when (>= (length prev-line) 1) + (setq prev-char (aref prev-line (1- (length prev-line)))) + (setq prev-line (substring-no-properties prev-line)) + ) + ) + + (cond + ((not (member web-mode-content-type '("html" "xml"))) + ) + ((member language '("javascript" "jsx" "ruby")) + (setq reg-col (if web-mode-script-padding (+ reg-col web-mode-script-padding) 0))) + ((member language '("css" "sql" "markdown" "stylus")) + (setq reg-col (if web-mode-style-padding (+ reg-col web-mode-style-padding) 0))) + ((not (member language '("html" "xml" "razor"))) + (setq reg-col (if web-mode-block-padding (+ reg-col web-mode-block-padding) 0))) + ) + + (list :curr-char curr-char + :curr-indentation curr-indentation + :curr-line curr-line + :language language + :options options + :prev-char prev-char + :prev-indentation prev-indentation + :prev-line prev-line + :prev-pos prev-pos + :reg-beg reg-beg + :reg-col reg-col + :token token) + ))) + +(defun web-mode-indent-line () + + (web-mode-propertize) + + (let ((offset nil) + (char nil) + (debug nil) + (inhibit-modification-hooks t) + (adjust t)) + + (save-excursion + (back-to-indentation) + (setq char (char-after)) + (let* ((pos (point)) + (ctx (web-mode-point-context pos)) + (curr-char (plist-get ctx :curr-char)) + (curr-indentation (plist-get ctx :curr-indentation)) + (curr-line (plist-get ctx :curr-line)) + (language (plist-get ctx :language)) + (prev-char (plist-get ctx :prev-char)) + (prev-indentation (plist-get ctx :prev-indentation)) + (prev-line (plist-get ctx :prev-line)) + (prev-pos (plist-get ctx :prev-pos)) + (reg-beg (plist-get ctx :reg-beg)) + (reg-col (plist-get ctx :reg-col)) + (token (plist-get ctx :token)) + (options (plist-get ctx :options)) + (chars (list curr-char prev-char)) + (tmp nil) + (is-js (member language '("javascript" "jsx" "ejs")))) + + ;;(message "%S" language) + ;;(message "curr-char=[%c] prev-char=[%c]\n%S" curr-char prev-char ctx) + ;;(message "options=%S" ctx) + + (cond + + ((or (bobp) (= (line-number-at-pos pos) 1)) + (when debug (message "I100")) + (setq offset 0)) + + ((string= token "string") + (when debug (message "I120(%S) string" pos)) + (cond + ((web-mode-is-token-end pos) + (if (get-text-property pos 'block-side) + (web-mode-block-token-beginning) + (web-mode-part-token-beginning)) + (setq offset (current-indentation)) + ) + ((and web-mode-enable-sql-detection + (web-mode-block-token-starts-with (concat "[ \n]*" web-mode-sql-queries))) + (save-excursion + (let (col) + (web-mode-block-string-beginning) + (skip-chars-forward "[ \"'\n]") + (setq col (current-column)) + (goto-char pos) + (if (looking-at-p "\\(SELECT\\|INSERT\\|DELETE\\|UPDATE\\|FROM\\|LEFT\\|JOIN\\|WHERE\\|GROUP BY\\|LIMIT\\|HAVING\\|\)\\)") + (setq offset col) + (setq offset (+ col web-mode-sql-indent-offset))) + ) + ) ;save-excursion + ) + ((and is-js + (web-mode-is-ql-string pos "Relay\.QL")) + (setq offset (web-mode-relayql-indentation pos)) + ) + ((and is-js + (web-mode-is-ql-string pos "gql")) + (setq offset (web-mode-relayql-indentation pos "gql")) + ) + ((and is-js + (web-mode-is-ql-string pos "graphql")) + (setq offset (web-mode-relayql-indentation pos "graphql")) + ) + ((and is-js + (web-mode-is-styled-component-string pos)) + (setq offset (web-mode-styled-component-indentation pos)) + ) + ((and is-js + (web-mode-is-html-string pos)) + (setq offset (web-mode-html-indentation pos)) + ) + (t + (setq offset nil)) + ) ;cond + ) ;case string + + ((string= token "comment") + (when debug (message "I130(%S) comment" pos)) + (if (eq (get-text-property pos 'tag-type) 'comment) + (web-mode-tag-beginning) + (goto-char (car + (web-mode-property-boundaries + (if (eq (get-text-property pos 'part-token) 'comment) + 'part-token + 'block-token) + pos)))) + (setq offset (current-column)) + (cond + ((string= web-mode-engine "freemarker") + (setq offset (+ (current-indentation) 2))) + ((member (buffer-substring-no-properties (point) (+ (point) 2)) '("/*" "{*" "@*")) + (cond + ((eq ?\* curr-char) + (setq offset (+ offset 1))) + (t + (setq offset (+ offset 3))) + ) ;cond + ) + ((string= (buffer-substring-no-properties (point) (+ (point) 4)) "" curr-line) + (setq offset offset)) + ((string-match-p "^-" curr-line) + (setq offset (+ offset 3))) + (t + (setq offset (+ offset 5))) + ) ;cond + ) + ((and (string= web-mode-engine "django") (looking-back "{% comment %}" (point-min))) + (setq offset (- offset 12))) + ((and (string= web-mode-engine "mako") (looking-back "<%doc%>" (point-min))) + (setq offset (- offset 6))) + ((and (string= web-mode-engine "mason") (looking-back "<%doc%>" (point-min))) + (setq offset (- offset 6))) + ) ;cond + ) ;case comment + + ((and (string= web-mode-engine "mason") + (string-match-p "^%" curr-line)) + (when debug (message "I140(%S) mason" pos)) + (setq offset 0)) + + ((and (get-text-property pos 'block-beg) + (or (web-mode-block-is-close pos) + (web-mode-block-is-inside pos))) + (when debug (message "I150(%S) block-match" pos)) + (cond + ((not (web-mode-block-match)) + ) + ((and (string= web-mode-engine "closure") + (string-match-p "{\\(case\\|default\\)" curr-line)) + (setq offset (+ (current-indentation) web-mode-markup-indent-offset))) + (t + (setq offset (current-indentation)) + ) + ) ;cond + ) + + ((eq (get-text-property pos 'block-token) 'delimiter-end) + (when debug (message "I160(%S) block-beginning" pos)) + (when (web-mode-block-beginning) + (setq reg-col (current-indentation)) + (setq offset (current-column)))) + + ((or (and (get-text-property pos 'tag-beg) + (eq (get-text-property pos 'tag-type) 'end)) + (and (eq (get-text-property pos 'tag-type) 'comment) + (string-match-p "" (point)) + (web-mode-insert-text-at-pos "" (point)) + (web-mode-insert-text-at-pos "") + (search-backward " -->") + ) ;case html + ) ;cond + )) + +(defun web-mode-comment (pos) + (let (ctx language col sel beg end tmp block-side single-line-block pos-after content) + + (setq pos-after pos) + + (setq block-side (get-text-property pos 'block-side)) + (setq single-line-block (web-mode-is-single-line-block pos)) + + (cond + + ((and block-side (string= web-mode-engine "erb")) + (web-mode-comment-erb-block pos) + ) + + ((and single-line-block block-side + (intern-soft (concat "web-mode-comment-" web-mode-engine "-block"))) + (funcall (intern (concat "web-mode-comment-" web-mode-engine "-block")) pos) + ) + + (t + (setq ctx (web-mode-point-context + (if mark-active (region-beginning) (line-beginning-position)))) + (setq language (plist-get ctx :language)) + (setq col (current-column)) + (cond + (mark-active + ;;(message "%S %S" (point) col) + ) + ((and (member language '("html" "xml")) + (get-text-property (progn (back-to-indentation) (point)) 'tag-beg)) + (web-mode-element-select)) + (t + (end-of-line) + (set-mark (line-beginning-position))) + ) ;cond + + (setq beg (region-beginning) + end (region-end)) + + (when (> (point) (mark)) + (exchange-point-and-mark)) + + (if (and (eq (char-before end) ?\n) + (not (eq (char-after end) ?\n))) + (setq end (1- end))) + + (setq sel (buffer-substring-no-properties beg end)) + + (cond + + ((member language '("html" "xml")) + (cond + ((and (= web-mode-comment-style 2) (string= web-mode-engine "django")) + (setq content (concat "{# " sel " #}"))) + ((and (= web-mode-comment-style 2) (member web-mode-engine '("ejs" "erb"))) + (setq content (concat "<%# " sel " %>"))) + ((and (= web-mode-comment-style 2) (string= web-mode-engine "aspx")) + (setq content (concat "<%-- " sel " --%>"))) + ((and (= web-mode-comment-style 2) (string= web-mode-engine "smarty")) + (setq content (concat "{* " sel " *}"))) + ((and (= web-mode-comment-style 2) (string= web-mode-engine "xoops")) + (setq content (concat "<{* " sel " *}>"))) + ((and (= web-mode-comment-style 2) (string= web-mode-engine "hero")) + (setq content (concat "<%# " sel " %>"))) + ((and (= web-mode-comment-style 2) (string= web-mode-engine "blade")) + (setq content (concat "{{-- " sel " --}}"))) + ((and (= web-mode-comment-style 2) (string= web-mode-engine "ctemplate")) + (setq content (concat "{{!-- " sel " --}}"))) + ((and (= web-mode-comment-style 2) (string= web-mode-engine "razor")) + (setq content (concat "@* " sel " *@"))) + (t + (setq content (concat "")) + (when (< (length sel) 1) + (search-backward " -->") + (setq pos-after nil)) + )) + ) ;case html + + ((member language '("php" "javascript" "java" "jsx")) + (let (alt) + (setq alt (cdr (assoc language web-mode-comment-formats))) + ;;(message "alt=%S sel=%S col=%S" alt sel col) + (cond + ((and alt (string= alt "//")) + (setq content (replace-regexp-in-string (concat "\n[ ]\\{" (number-to-string col) "\\}") "\n" sel)) + (setq content (replace-regexp-in-string (concat "\n") "\n// " content)) + (setq content (concat "// " content))) + ((get-text-property pos 'jsx-depth) + (setq content (concat "{/* " sel " */}"))) + (web-mode-comment-prefixing + (setq content (replace-regexp-in-string (concat "\n[ ]\\{" (number-to-string col) "\\}") "\n* " sel)) + (setq content (concat "/* " content " */"))) + (t + (setq content (concat "/* " sel " */"))) + ) ;cond + ) ;let + ) + + ((member language '("erb")) + (setq content (replace-regexp-in-string "^[ ]*" "#" sel))) + + ((member language '("asp")) + (setq content (replace-regexp-in-string "^[ ]*" "''" sel))) + + (t + (setq content (concat "/* " sel " */"))) + + ) ;cond + + (when content + (delete-region beg end) + (deactivate-mark) + (let (beg end) + (setq beg (point-at-bol)) + (insert content) + (setq end (point-at-eol)) + (indent-region beg end) + ) + ) ;when + + ) ;t + ) ;cond + + (when pos-after (goto-char pos-after)) + + )) + +(defun web-mode-comment-ejs-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-insert-text-at-pos "//" (+ beg 2)))) + +(defun web-mode-comment-erb-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-insert-text-at-pos "#" (+ beg 2)))) + +(defun web-mode-comment-django-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-insert-text-at-pos "#" end) + (web-mode-insert-text-at-pos "#" (1+ beg)))) + +(defun web-mode-comment-dust-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-insert-text-at-pos "!" end) + (web-mode-insert-text-at-pos "!" (1+ beg)))) + +(defun web-mode-comment-aspx-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-insert-text-at-pos "#" end) + (web-mode-insert-text-at-pos "#" (1+ beg)))) + +(defun web-mode-comment-jsp-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-insert-text-at-pos "--" (+ beg 2)))) + +(defun web-mode-comment-go-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-insert-text-at-pos "*/" (1- end)) + (web-mode-insert-text-at-pos "/*" (+ beg (if (web-mode-looking-at "{{" beg) 2 0))))) + +(defun web-mode-comment-php-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-insert-text-at-pos "*/" (- end 2)) + (web-mode-insert-text-at-pos "/*" (+ beg 1 (if (web-mode-looking-at "<\\?php" beg) 5 3))))) + +(defun web-mode-comment-boundaries (&optional pos) + (interactive) + (unless pos (setq pos (point))) + (let ((beg pos) (end pos) prop) + (save-excursion + (goto-char pos) + (setq prop + (cond + ((eq (get-text-property pos 'block-token) 'comment) 'block-token) + ((eq (get-text-property pos 'tag-type) 'comment) 'tag-type) + ((eq (get-text-property pos 'part-token) 'comment) 'part-token) + (t nil) + )) + (if (null prop) + (setq beg nil + end nil) + (when (and (not (bobp)) + (eq (get-text-property pos prop) (get-text-property (1- pos) prop))) + (setq beg (or (previous-single-property-change pos prop) (point-min)))) + (when (and (not (eobp)) + (eq (get-text-property pos prop) (get-text-property (1+ pos) prop))) + (setq end (or (next-single-property-change pos prop) (point-max))))) + (when (and beg (string= (buffer-substring-no-properties beg (+ beg 2)) "//")) + (goto-char end) + (while (and (looking-at-p "\n[ ]*//") + (not (eobp))) + (search-forward "//") + (backward-char 2) + ;;(message "%S" (point)) + (setq end (next-single-property-change (point) prop)) + (goto-char end) + ;;(message "%S" (point)) + ) ;while + ) ;when + (when end (setq end (1- end))) + ) ;save-excursion + ;;(message "beg=%S end=%S" beg end) + (if (and beg end) (cons beg end) nil) + )) + +(defun web-mode-uncomment (pos) + (let ((beg pos) (end pos) (sub2 "") comment boundaries) + (save-excursion + (cond + ((and (get-text-property pos 'block-side) + (intern-soft (concat "web-mode-uncomment-" web-mode-engine "-block"))) + (funcall (intern (concat "web-mode-uncomment-" web-mode-engine "-block")) pos)) + ((and (setq boundaries (web-mode-comment-boundaries pos)) + (setq beg (car boundaries)) + (setq end (1+ (cdr boundaries))) + (> (- end beg) 4)) + ;;(message "beg(%S) end(%S)" beg end) + (setq comment (buffer-substring-no-properties beg end)) + (setq sub2 (substring comment 0 2)) + (cond + ((member sub2 '("$\\)" "" comment))) + ((string= sub2 "{#") + (setq comment (replace-regexp-in-string "\\(^{#[ ]?\\|[ ]?#}$\\)" "" comment))) + ((string= sub2 "{/") ;jsx comments + (setq comment (replace-regexp-in-string "\\(^{/\\*[ ]?\\|[ ]?\\*/}$\\)" "" comment))) + ((string= sub2 "/*") + ;;(message "%S" comment) + ;;(setq comment (replace-regexp-in-string "\\(\\*/\\|^/\\*[ ]?\\|^[ \t]*\\*\\)" "" comment)) + (setq comment (replace-regexp-in-string "\\([ ]?\\*/$\\|^/\\*[ ]?\\)" "" comment)) + (setq comment (replace-regexp-in-string "\\(^[ \t]*\\*\\)" "" comment)) + ;;(message "%S" comment) + ) + ((string= sub2 "//") + (setq comment (replace-regexp-in-string "^ *//" "" comment))) + ) ;cond + (delete-region beg end) + (web-mode-insert-and-indent comment) + (goto-char beg) + ) + ) ;cond + (indent-according-to-mode) + ))) + +(defun web-mode-uncomment-erb-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (cond + ((string= (buffer-substring-no-properties beg (+ beg 4)) "<%#=") + (web-mode-remove-text-at-pos 1 (+ beg 2))) + ((string-match-p "<[%[:alpha:]]" (buffer-substring-no-properties (+ beg 2) (- end 2))) + (web-mode-remove-text-at-pos 2 (1- end)) + (web-mode-remove-text-at-pos 3 beg)) + (t + (web-mode-remove-text-at-pos 1 (+ beg 2))) + ) ;cond + ) + ) + +(defun web-mode-uncomment-ejs-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-remove-text-at-pos 1 (+ beg 2)))) + +(defun web-mode-uncomment-django-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (cond + ((web-mode-looking-at-p "{#[{%]" beg) + (web-mode-remove-text-at-pos 1 (1- end)) + (web-mode-remove-text-at-pos 1 (1+ beg)) + ) + (t + (web-mode-remove-text-at-pos 2 (1- end)) + (web-mode-remove-text-at-pos 2 beg)) + ) ;cond + )) + +(defun web-mode-uncomment-ctemplate-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-remove-text-at-pos 5 (- end 4)) + (web-mode-remove-text-at-pos 5 beg))) + +(defun web-mode-uncomment-dust-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-remove-text-at-pos 1 (1- end)) + (web-mode-remove-text-at-pos 1 (1+ beg)))) + +(defun web-mode-uncomment-aspx-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-remove-text-at-pos 1 (1- end)) + (web-mode-remove-text-at-pos 1 (1+ beg)))) + +(defun web-mode-uncomment-jsp-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-remove-text-at-pos 2 (+ beg 2)))) + +(defun web-mode-uncomment-go-block (pos) + (let (beg end) + (setq beg (web-mode-block-beginning-position pos) + end (web-mode-block-end-position pos)) + (web-mode-remove-text-at-pos 2 (+ beg 2)) + (web-mode-remove-text-at-pos 2 (- end 5)))) + +(defun web-mode-snippet-names () + (let (codes) + (dolist (snippet web-mode-snippets) + (add-to-list 'codes (car snippet) t)) + codes)) + +(defun web-mode-snippet-insert (code) + "Insert a snippet." + (interactive + (list (completing-read "Snippet: " (web-mode-snippet-names)))) + (let (beg + (continue t) + (counter 0) + end + sel + snippet + (l (length web-mode-snippets)) + pos) + (when mark-active + (setq sel (web-mode-trim (buffer-substring-no-properties + (region-beginning) (region-end)))) + (delete-region (region-beginning) (region-end))) + (while (and continue (< counter l)) + (setq snippet (nth counter web-mode-snippets)) + (when (string= (car snippet) code) + (setq continue nil)) + (setq counter (1+ counter))) + (when snippet + (setq snippet (cdr snippet)) + (setq beg (point-at-bol)) + (insert snippet) + (setq pos (point) + end (point)) + (when (string-match-p "|" snippet) + (search-backward "|") + (delete-char 1) + (setq pos (point) + end (1- end))) + (when sel + (insert sel) + (setq pos (point) + end (+ end (length sel)))) + (goto-char end) + (setq end (point-at-eol)) + (unless sel (goto-char pos)) + (indent-region beg end)) + )) + +(defun web-mode-looking-at (regexp pos) + (save-excursion + (goto-char pos) + (looking-at regexp))) + +(defun web-mode-looking-at-p (regexp pos) + (save-excursion + (goto-char pos) + (looking-at-p regexp))) + +(defun web-mode-looking-back (regexp pos &optional limit greedy) + (save-excursion + (goto-char pos) + (if limit + (looking-back regexp limit greedy) + (looking-back regexp (point-min))))) + +(defun web-mode-insert-text-at-pos (text pos) + (let ((mem web-mode-enable-auto-pairing)) + (setq web-mode-enable-auto-pairing nil) + (save-excursion + (goto-char pos) + (insert text) + (setq web-mode-enable-auto-pairing mem) + ))) + +(defun web-mode-remove-text-at-pos (n &optional pos) + (unless pos (setq pos (point))) + (delete-region pos (+ pos n))) + +(defun web-mode-insert-and-indent (text) + (let (beg end) + (setq beg (point-at-bol)) + (insert text) + (setq end (point-at-eol)) + (indent-region beg end) + )) + +(defun web-mode-indentation-at-pos (pos) + (save-excursion + (goto-char pos) + (current-indentation))) + +(defun web-mode-navigate (&optional pos) + "Move point to the matching opening/closing tag/block." + (interactive) + (unless pos (setq pos (point))) + (let (init) + (goto-char pos) + (setq init (point)) + (when (> (current-indentation) (current-column)) + (back-to-indentation)) + (setq pos (point)) + (cond + ((and (get-text-property pos 'block-side) + (web-mode-block-beginning) + (web-mode-block-controls-get (point))) + (web-mode-block-match)) + ((member (get-text-property pos 'tag-type) '(start end)) + (web-mode-tag-beginning) + (web-mode-tag-match)) + (t + (goto-char init)) + ) + )) + +(defun web-mode-block-match (&optional pos) + (unless pos (setq pos (point))) + (let (pos-ori controls control (counter 1) type (continue t) pair) + (setq pos-ori pos) + (goto-char pos) + (setq controls (web-mode-block-controls-get pos)) + ;;(message "controls=%S" controls) + (cond + (controls + (setq pair (car controls)) + (setq control (cdr pair)) + (setq type (car pair)) + (when (eq type 'inside) (setq type 'close)) + (while continue + (cond + ((and (> pos-ori 1) (bobp)) + (setq continue nil)) + ((or (and (eq type 'open) (not (web-mode-block-next))) + (and (eq type 'close) (not (web-mode-block-previous)))) + (setq continue nil) + ) + ((null (setq controls (web-mode-block-controls-get (point)))) + ) + (t + ;;TODO : est il nécessaire de faire un reverse sur controls si on doit matcher backward + (dolist (pair controls) + (cond + ((not (string= (cdr pair) control)) + ) + ((eq (car pair) 'inside) + ) + ((eq (car pair) type) + (setq counter (1+ counter))) + (t + (setq counter (1- counter))) + ) + ) ;dolist + (when (= counter 0) + (setq continue nil)) + ) ;t + ) ;cond + ) ;while + (if (= counter 0) (point) nil) + ) ;controls + (t + (goto-char pos-ori) + nil + ) ;controls = nul + ) ;conf + )) + +(defun web-mode-tag-match (&optional pos) + "Move point to the matching opening/closing tag." + (interactive) + (unless pos (setq pos (point))) + (let (regexp name) + (cond + ((eq (get-text-property pos 'tag-type) 'void) + (web-mode-tag-beginning)) + ((and (eq (get-text-property pos 'tag-type) 'comment) + (web-mode-looking-at-p " %S %S" pos (get-text-property pos 'jsx-depth)) + ) + ((and blockside + (member (get-text-property pos 'block-token) '(string comment)) + (eq (get-text-property pos 'block-token) (get-text-property (1- pos) 'block-token))) + (setq pos (web-mode-block-token-beginning-position pos))) + ((and (not blockside) + (member (get-text-property pos 'part-token) '(string comment)) + (eq (get-text-property pos 'part-token) (get-text-property (1- pos) 'part-token))) + (setq pos (web-mode-part-token-beginning-position pos))) + ((and (not blockside) + (get-text-property pos 'block-side)) + (when (setq pos (web-mode-block-beginning-position pos)) + (setq pos (1- pos)))) + ((member char '(?\) ?\] ?\})) + (setq pos (web-mode-part-opening-paren-position pos reg-beg)) + (setq pos (1- pos))) + ((and (eq char ?\=) + (web-mode-looking-back "[<>!=]+" pos reg-beg t)) + (setq pos (- pos 1 (length (match-string-no-properties 0))))) + ((member char '(?\( ?\{ ?\[ ?\= ?\< ?\>)) + (web-mode-looking-at ".[ \t\n]*" pos) + (setq continue nil + pos (+ pos (length (match-string-no-properties 0))))) + + ((web-mode-looking-at "\\(return\\)[ \n]" pos) + (setq continue nil + pos (+ pos (length (match-string-no-properties 0))))) + ((and (eq char ?\:) + (web-mode-looking-back "[{,][ \t\n]*[[:alnum:]_]+[ ]*" pos)) + (web-mode-looking-at ".[ \t\n]*" pos) + (setq continue nil + pos (+ pos (length (match-string-no-properties 0))))) + (t + (setq pos (web-mode-rsb-position pos regexp reg-beg)) + (when (not pos) + (cond + (is-jsx + (when (web-mode-looking-at "[ \n]*" reg-beg) + (setq pos (+ reg-beg (length (match-string-no-properties 0))))) + (setq continue nil)) + (t + (message "javascript-statement-beginning-position ** search failure **") + (setq continue nil + pos reg-beg)) + ) ;cond + ) + ) ;t + ) ;cond + ) ;while + ;;(message "%S -------" pos) + pos)) + +(defun web-mode-javascript-args-beginning-position (pos &optional reg-beg) + (unless pos (setq pos (point))) + (setq pos (1- pos)) + (let ((char nil) + (blockside (get-text-property pos 'block-side)) + (i 0) + (continue (not (null pos)))) + (unless reg-beg + (if blockside + (setq reg-beg (web-mode-block-beginning-position pos)) + (setq reg-beg (web-mode-part-beginning-position pos))) + ) + (while continue + (setq char (char-after pos)) + (cond + ((> (setq i (1+ i)) 20000) + (message "javascript-args-beginning-position ** warning (%S) **" pos) + (setq continue nil + pos nil)) + ((null pos) + (message "javascript-args-beginning-position ** invalid pos **") + (setq continue nil)) + ((< pos reg-beg) + (message "javascript-args-beginning-position ** failure(position) **") + (setq continue nil + pos reg-beg)) + ((and blockside + (member (get-text-property pos 'block-token) '(string comment)) + (eq (get-text-property pos 'block-token) (get-text-property (1- pos) 'block-token))) + (setq pos (web-mode-block-token-beginning-position pos))) + ((and (not blockside) + (member (get-text-property pos 'part-token) '(string comment)) + (eq (get-text-property pos 'part-token) (get-text-property (1- pos) 'part-token))) + (setq pos (web-mode-part-token-beginning-position pos))) + ((and (not blockside) + (get-text-property pos 'block-side)) + (when (setq pos (web-mode-block-beginning-position pos)) + (setq pos (1- pos))) + ) + ((member char '(?\) ?\] ?\})) + (when (setq pos (web-mode-part-opening-paren-position pos reg-beg)) + (setq pos (1- pos)))) + ((member char '(?\( ?\[ ?\{)) + (web-mode-looking-at ".[ ]*" pos) + (setq pos (+ pos (length (match-string-no-properties 0))) + continue nil) + ) + ((web-mode-looking-at "\\(var\\|let\\|return\\|const\\)[ \n]" pos) + (setq pos (+ pos (length (match-string-no-properties 0))) + continue nil)) + (t + (setq pos (web-mode-rsb-position pos "[\]\[}{)(]\\|\\(var\\|let\\|return\\|const\\)" reg-beg)) + (when (not pos) + (message "javascript-args-beginning-position ** search failure **") + (setq continue nil + pos reg-beg))) + ) ;cond + ) ;while + ;;(message "=%S" pos) + pos)) + +(defun web-mode-javascript-calls-beginning-position (pos &optional reg-beg) + (unless pos (setq pos (point))) + ;;(message "pos=%S" pos) + (let ((char nil) + (dot-pos nil) + (blockside (get-text-property pos 'block-side)) + (i 0) + (continue (not (null pos)))) + (unless reg-beg + (setq reg-beg (if blockside + (web-mode-block-beginning-position pos) + (web-mode-part-beginning-position pos)))) + (while continue + (setq char (char-after pos)) + ;;(message "%S| %S=%c" reg-beg pos char) + (cond + ((> (setq i (1+ i)) 20000) + (message "javascript-calls-beginning-position ** warning (%S) **" pos) + (setq continue nil + pos nil)) + ((null pos) + (message "javascript-calls-beginning-position ** invalid pos **") + (setq continue nil)) + ((< pos reg-beg) + (setq continue nil + pos reg-beg)) + ((and blockside + (member (get-text-property pos 'block-token) '(string comment)) + (eq (get-text-property pos 'block-token) (get-text-property (1- pos) 'block-token))) + (setq pos (web-mode-block-token-beginning-position pos))) + ((and (not blockside) + (member (get-text-property pos 'part-token) '(string comment)) + (eq (get-text-property pos 'part-token) (get-text-property (1- pos) 'part-token))) + (setq pos (web-mode-part-token-beginning-position pos))) + ((and (not blockside) + (get-text-property pos 'block-side)) + (when (setq pos (web-mode-block-beginning-position pos)) + (setq pos (1- pos)))) + ((and (member char '(?\.)) (> i 1)) + (setq dot-pos pos + pos (1- pos))) + ((member char '(?\) ?\])) + (when (setq pos (web-mode-part-opening-paren-position pos reg-beg)) + (setq pos (1- pos))) + ) + ((member char '(?\( ?\{ ?\} ?\[ ?\= ?\? ?\: ?\; ?\, ?\& ?\| ?\>)) + (web-mode-looking-at ".[ \t\n]*" pos) + (setq pos (+ pos (length (match-string-no-properties 0))) + continue nil)) + ((web-mode-looking-at "\\(return\\|else\\)[ \n]" pos) + (setq pos (+ pos (length (match-string-no-properties 0))) + continue nil)) + (t + (setq pos (web-mode-rsb-position pos "[\]\[}{)(=?:;,&|>.]\\|\\(return\\|else\\)" reg-beg)) + (when (not pos) + (message "javascript-calls-beginning-position ** search failure **") + (setq pos reg-beg + continue nil)) + ) ;t + ) ;cond + ) ;while + ;;(message "pos=%S dot-pos=%S" pos dot-pos) + (if (null pos) pos (cons pos dot-pos)) + )) + +(defun web-mode-is-styled-component-string (pos) + (let (beg) + (cond + ((and (setq beg (web-mode-part-token-beginning-position pos)) + (web-mode-looking-at-p "`" beg) + (web-mode-looking-back "styled[[:alnum:].]+" beg)) + beg) + (t + nil) + ) ;cond + )) + +;; Relay.QL , gql, graphql +(defun web-mode-is-ql-string (pos prefix-regexp) + (let (beg) + (cond + ((and (setq beg (web-mode-part-token-beginning-position pos)) + (web-mode-looking-back prefix-regexp beg)) + beg) + (t + nil) + ) ;cond + )) + +(defun web-mode-is-html-string (pos) + (let (beg) + (cond + ((and (setq beg (web-mode-part-token-beginning-position pos)) + (web-mode-looking-at-p "`[ \t\n]*<[a-zA-Z]" beg) + (web-mode-looking-back "\\(template\\|html\\)\\([ ]*[=:][ ]*\\)?" beg)) + beg) + (t + nil) + ) ;cond + )) + +(defun web-mode-part-token-beginning-position (&optional pos) + (unless pos (setq pos (point))) + (cond + ((not (get-text-property pos 'part-token)) + nil) + ((or (= pos (point-min)) + (and (> pos (point-min)) + (not (get-text-property (1- pos) 'part-token)))) + pos) + (t + (setq pos (previous-single-property-change pos 'part-token)) + (if (and pos (> pos (point-min))) pos (point-min))) + )) + +(defun web-mode-part-token-end-position (&optional pos) + (unless pos (setq pos (point))) + (cond + ((not (get-text-property pos 'part-token)) + nil) + ((or (= pos (point-max)) + (not (get-text-property (1+ pos) 'part-token))) + pos) + (t + (1- (next-single-property-change pos 'part-token))) + )) + +(defun web-mode-block-token-beginning-position (&optional pos) + (unless pos (setq pos (point))) + (cond + ((not (get-text-property pos 'block-token)) + nil) + ((or (= pos (point-min)) + (and (> pos (point-min)) + (not (get-text-property (1- pos) 'block-token)))) + pos) + (t + (setq pos (previous-single-property-change pos 'block-token)) + (if (and pos (> pos (point-min))) pos (point-min))) + )) + +(defun web-mode-block-token-end-position (&optional pos) + (unless pos (setq pos (point))) + (cond + ((not (get-text-property pos 'block-token)) + nil) + ((or (= pos (point-max)) + (not (get-text-property (1+ pos) 'block-token))) + pos) + (t + (1- (next-single-property-change pos 'block-token))) + )) + +(defun web-mode-block-code-end-position (&optional pos) + (unless pos (setq pos (point))) + (setq pos (web-mode-block-end-position pos)) + (cond + ((not pos) + nil) + ((and (eq (get-text-property pos 'block-token) 'delimiter-end) + (eq (get-text-property (1- pos) 'block-token) 'delimiter-end)) + (previous-single-property-change pos 'block-token)) + ((= pos (1- (point-max))) ;; TODO: comparer plutot avec line-end-position + (point-max)) + (t + pos) + )) + +(defun web-mode-block-end-position (&optional pos) + (unless pos (setq pos (point))) + (cond + ((get-text-property pos 'block-end) + pos) + ((get-text-property pos 'block-side) + (or (next-single-property-change pos 'block-end) + (point-max))) + (t + nil) + )) + +(defun web-mode-block-previous-position (&optional pos) + (unless pos (setq pos (point))) + (cond + ((= pos (point-min)) + (setq pos nil)) + ((get-text-property pos 'block-side) + (setq pos (web-mode-block-beginning-position pos)) + (cond + ((or (null pos) (= pos (point-min))) + (setq pos nil) + ) + ((and (setq pos (previous-single-property-change pos 'block-beg)) + (> pos (point-min))) + (setq pos (1- pos)) + ) + ) + ) ;block-side + ((get-text-property (1- pos) 'block-side) + (setq pos (web-mode-block-beginning-position (1- pos))) + ) + (t + (setq pos (previous-single-property-change pos 'block-side)) + (cond + ((and (null pos) (get-text-property (point-min) 'block-beg)) + (setq pos (point-min))) + ((and pos (> pos (point-min))) + (setq pos (web-mode-block-beginning-position (1- pos)))) + ) + ) + ) ;conf + pos) + +(defun web-mode-block-next-position (&optional pos limit) + (unless pos (setq pos (point))) + (unless limit (setq limit (point-max))) + (cond + ((and (get-text-property pos 'block-side) + (setq pos (web-mode-block-end-position pos)) + (< pos (point-max)) + (setq pos (1+ pos))) + (unless (get-text-property pos 'block-beg) + (setq pos (next-single-property-change pos 'block-side))) + ) + (t + (setq pos (next-single-property-change pos 'block-side))) + ) ;cond + (if (and pos (<= pos limit)) pos nil)) + +;;---- EXCURSION --------------------------------------------------------------- + +(defun web-mode-backward-sexp (n) + (interactive "p") + (if (< n 0) (web-mode-forward-sexp (- n)) + (let (pos) + (dotimes (_ n) + (skip-chars-backward "[:space:]") + (setq pos (point)) + (cond + ((bobp) nil) + ((get-text-property (1- pos) 'block-end) + (backward-char 1) + (web-mode-block-beginning)) + ((get-text-property (1- pos) 'block-token) + (backward-char 1) + (web-mode-block-token-beginning)) + ((get-text-property (1- pos) 'part-token) + (backward-char 1) + (web-mode-part-token-beginning)) + ((get-text-property (1- pos) 'tag-end) + (backward-char 1) + (web-mode-element-beginning)) + ((get-text-property (1- pos) 'tag-attr) + (backward-char 1) + (web-mode-attribute-beginning)) + ((get-text-property (1- pos) 'tag-type) + (backward-char 1) + (web-mode-tag-beginning)) + ((get-text-property (1- pos) 'jsx-end) + (backward-char 1) + (web-mode-jsx-beginning)) + (t + (let ((forward-sexp-function nil)) + (backward-sexp)) + ) ;case t + ) ;cond + ) ;dotimes + ))) ;let if defun + +(defun web-mode-forward-sexp (n) + (interactive "p") + (if (< n 0) (web-mode-backward-sexp (- n)) + (let (pos) + (dotimes (_ n) + (skip-chars-forward "[:space:]") + (setq pos (point)) + (cond + ((eobp) nil) + ((get-text-property pos 'block-beg) + (web-mode-block-end)) + ((get-text-property pos 'block-token) + (web-mode-block-token-end)) + ((get-text-property pos 'part-token) + (web-mode-part-token-end)) + ((get-text-property pos 'tag-beg) + (web-mode-element-end)) + ((get-text-property pos 'tag-attr) + (web-mode-attribute-end)) + ((get-text-property pos 'tag-type) + (web-mode-tag-end)) + ((get-text-property pos 'jsx-beg) + (web-mode-jsx-end)) + (t + (let ((forward-sexp-function nil)) + (forward-sexp)) + ) ;case t + ) ;cond + ) ;dotimes + ))) ;let if defun + +(defun web-mode-comment-beginning () + "Fetch current comment beg." + (interactive) + (web-mode-go (web-mode-comment-beginning-position (point)))) + +(defun web-mode-comment-end () + "Fetch current comment end." + (interactive) + (web-mode-go (web-mode-comment-end-position (point)) 1)) + +(defun web-mode-tag-beginning () + "Fetch current html tag beg." + (interactive) + (web-mode-go (web-mode-tag-beginning-position (point)))) + +(defun web-mode-tag-end () + "Fetch current html tag end." + (interactive) + (web-mode-go (web-mode-tag-end-position (point)) 1)) + +(defun web-mode-tag-previous () + "Fetch previous tag." + (interactive) + (web-mode-go (web-mode-tag-previous-position (point)))) + +(defun web-mode-tag-next () + "Fetch next tag. Might be html comment or server tag (e.g. jsp)." + (interactive) + (web-mode-go (web-mode-tag-next-position (point)))) + +(defun web-mode-attribute-beginning () + "Fetch html attribute beginning." + (interactive) + (web-mode-go (web-mode-attribute-beginning-position (point)))) + +(defun web-mode-attribute-end () + "Fetch html attribute end." + (interactive) + (web-mode-go (web-mode-attribute-end-position (point)) 1)) + +(defun web-mode-attribute-next (&optional arg) + "Fetch next attribute." + (interactive "p") + (unless arg (setq arg 1)) + (cond + ((= arg 1) (web-mode-go (web-mode-attribute-next-position (point)))) + ((< arg 1) (web-mode-element-previous (* arg -1))) + (t + (while (>= arg 1) + (setq arg (1- arg)) + (web-mode-go (web-mode-attribute-next-position (point))) + ) + ) + ) + ) + +(defun web-mode-attribute-previous (&optional arg) + "Fetch previous attribute." + (interactive "p") + (unless arg (setq arg 1)) + (unless arg (setq arg 1)) + (cond + ((= arg 1) (web-mode-go (web-mode-attribute-previous-position (point)))) + ((< arg 1) (web-mode-element-next (* arg -1))) + (t + (while (>= arg 1) + (setq arg (1- arg)) + (web-mode-go (web-mode-attribute-previous-position (point))) + ) + ) + ) + ) + +(defun web-mode-element-previous (&optional arg) + "Fetch previous element." + (interactive "p") + (unless arg (setq arg 1)) + (cond + ((= arg 1) (web-mode-go (web-mode-element-previous-position (point)))) + ((< arg 1) (web-mode-element-next (* arg -1))) + (t + (while (>= arg 1) + (setq arg (1- arg)) + (web-mode-go (web-mode-element-previous-position (point))) + ) ;while + ) ;t + ) ;cond + ) + +(defun web-mode-element-next (&optional arg) + "Fetch next element." + (interactive "p") + (unless arg (setq arg 1)) + (cond + ((= arg 1) (web-mode-go (web-mode-element-next-position (point)))) + ((< arg 1) (web-mode-element-previous (* arg -1))) + (t + (while (>= arg 1) + (setq arg (1- arg)) + (web-mode-go (web-mode-element-next-position (point))) + ) ;while + ) ;t + ) ;cond + ) + +(defun web-mode-element-sibling-next () + "Fetch next sibling element." + (interactive) + (let ((pos (point))) + (save-excursion + (cond + ((not (get-text-property pos 'tag-type)) + (if (and (web-mode-element-parent) + (web-mode-tag-match) + (web-mode-tag-next) + (member (get-text-property (point) 'tag-type) '(start void comment))) + (setq pos (point)) + (setq pos nil)) + ) + ((member (get-text-property pos 'tag-type) '(start void)) + (if (and (web-mode-tag-match) + (web-mode-tag-next) + (member (get-text-property (point) 'tag-type) '(start void comment))) + (setq pos (point)) + (setq pos nil)) + ) + ((and (web-mode-tag-next) + (member (get-text-property (point) 'tag-type) '(start void comment))) + (setq pos (point))) + (t + (setq pos nil)) + ) ;cond + ) ;save-excursion + (web-mode-go pos))) + +(defun web-mode-element-sibling-previous () + "Fetch previous sibling element." + (interactive) + (let ((pos (point))) + (save-excursion + (cond + ((not (get-text-property pos 'tag-type)) + (if (and (web-mode-element-parent) + (web-mode-tag-previous) + (web-mode-element-beginning)) + (setq pos (point)) + (setq pos nil)) + ) + ((eq (get-text-property pos 'tag-type) 'start) + (if (and (web-mode-tag-beginning) + (web-mode-tag-previous) + (web-mode-element-beginning)) + (setq pos (point)) + (setq pos nil)) + ) + ((and (web-mode-element-beginning) + (web-mode-tag-previous) + (web-mode-element-beginning)) + (setq pos (point))) + (t + (setq pos nil)) + ) ;cond + ) ;save-excursion + (web-mode-go pos))) + +(defun web-mode-element-beginning () + "Move to beginning of element." + (interactive) + (web-mode-go (web-mode-element-beginning-position (point)))) + +(defun web-mode-element-end () + "Move to end of element." + (interactive) + (web-mode-go (web-mode-element-end-position (point)) 1)) + +(defun web-mode-element-parent () + "Fetch parent element." + (interactive) + (web-mode-go (web-mode-element-parent-position (point)))) + +(defun web-mode-element-child () + "Fetch child element." + (interactive) + (web-mode-go (web-mode-element-child-position (point)))) + +(defun web-mode-dom-traverse () + "Traverse html dom tree." + (interactive) + (cond + ((web-mode-element-child) + ) + ((web-mode-element-sibling-next) + ) + ((and (web-mode-element-parent) + (not (web-mode-element-sibling-next))) + (goto-char (point-min))) + (t + (goto-char (point-min))) + ) ;cond + ) + +(defun web-mode-closing-paren (limit) + (let ((pos (web-mode-closing-paren-position (point) limit))) + (if (or (null pos) (> pos limit)) + nil + (goto-char pos) + pos) + )) + +(defun web-mode-part-next () + "Move point to the beginning of the next part." + (interactive) + (web-mode-go (web-mode-part-next-position (point)))) + +(defun web-mode-part-beginning () + "Move point to the beginning of the current part." + (interactive) + (web-mode-go (web-mode-part-beginning-position (point)))) + +(defun web-mode-part-end () + "Move point to the end of the current part." + (interactive) + (web-mode-go (web-mode-part-end-position (point)) 1)) + +(defun web-mode-block-previous () + "Move point to the beginning of the previous block." + (interactive) + (web-mode-go (web-mode-block-previous-position (point)))) + +(defun web-mode-block-next () + "Move point to the beginning of the next block." + (interactive) + (web-mode-go (web-mode-block-next-position (point)))) + +(defun web-mode-block-beginning () + "Move point to the beginning of the current block." + (interactive) + (web-mode-go (web-mode-block-beginning-position (point)))) + +(defun web-mode-block-end () + "Move point to the end of the current block." + (interactive) + (web-mode-go (web-mode-block-end-position (point)) 1)) + +(defun web-mode-block-token-beginning () + (web-mode-go (web-mode-block-token-beginning-position (point)))) + +(defun web-mode-block-token-end () + (web-mode-go (web-mode-block-token-end-position (point)) 1)) + +(defun web-mode-part-token-beginning () + (web-mode-go (web-mode-part-token-beginning-position (point)))) + +(defun web-mode-part-token-end () + (web-mode-go (web-mode-part-token-end-position (point)) 1)) + +(defun web-mode-block-opening-paren (limit) + (web-mode-go (web-mode-block-opening-paren-position (point) limit))) + +(defun web-mode-block-string-beginning (&optional pos block-beg) + (unless pos (setq pos (point))) + (unless block-beg (setq block-beg (web-mode-block-beginning-position pos))) + (web-mode-go (web-mode-block-string-beginning-position pos block-beg))) + +(defun web-mode-block-statement-beginning (pos block-beg is-ternary) + (unless pos (setq pos (point))) + (unless block-beg (setq block-beg (web-mode-block-beginning-position pos))) + (web-mode-go (web-mode-block-statement-beginning-position pos block-beg is-ternary))) + +(defun web-mode-block-args-beginning (&optional pos block-beg) + (unless pos (setq pos (point))) + (unless block-beg (setq block-beg (web-mode-block-beginning-position pos))) + (web-mode-go (web-mode-block-args-beginning-position pos block-beg))) + +(defun web-mode-block-calls-beginning (&optional pos block-beg) + (unless pos (setq pos (point))) + (unless block-beg (setq block-beg (web-mode-block-beginning-position pos))) + (web-mode-go (web-mode-block-calls-beginning-position pos block-beg))) + +(defun web-mode-javascript-string-beginning (&optional pos reg-beg) + (unless pos (setq pos (point))) + (unless reg-beg + (if (get-text-property pos 'block-side) + (setq reg-beg (web-mode-block-beginning-position pos)) + (setq reg-beg (web-mode-part-beginning-position pos)))) + (web-mode-go (web-mode-javascript-string-beginning-position pos reg-beg))) + +(defun web-mode-javascript-statement-beginning (pos reg-beg is-ternary) + (unless pos (setq pos (point))) + (unless reg-beg + (if (get-text-property pos 'block-side) + (setq reg-beg (web-mode-block-beginning-position pos)) + (setq reg-beg (web-mode-part-beginning-position pos)))) + (web-mode-go (web-mode-javascript-statement-beginning-position pos reg-beg is-ternary))) + +(defun web-mode-javascript-args-beginning (&optional pos reg-beg) + (unless pos (setq pos (point))) + (unless reg-beg + (setq reg-beg (if (get-text-property pos 'block-side) + (web-mode-block-beginning-position pos) + (web-mode-part-beginning-position pos)))) + ;;(message "reg-beg%S" reg-beg) + (web-mode-go (web-mode-javascript-args-beginning-position pos reg-beg))) + +(defun web-mode-javascript-calls-beginning (&optional pos reg-beg) + (unless pos (setq pos (point))) + (unless reg-beg + (if (get-text-property pos 'block-side) + (setq reg-beg (web-mode-block-beginning-position pos)) + (setq reg-beg (web-mode-part-beginning-position pos)))) + (let (pair) + (setq pair (web-mode-javascript-calls-beginning-position pos reg-beg)) + (when pair (web-mode-go (car pair))) + )) + +(defun web-mode-go (pos &optional offset) + (unless offset (setq offset 0)) + (when pos + (cond + ((and (> offset 0) (<= (+ pos offset) (point-max))) + (setq pos (+ pos offset))) + ((and (< offset 0) (>= (+ pos offset) (point-min))) + (setq pos (+ pos offset))) + ) ;cond + (goto-char pos)) + pos) + +;;---- SEARCH ------------------------------------------------------------------ + +(defun web-mode-rsf-balanced (regexp-open regexp-close &optional limit noerror) + (unless noerror (setq noerror t)) + (let ((continue t) + (level 1) + (pos (point)) + ret + (regexp (concat regexp-open "\\|" regexp-close))) + (while continue + (setq ret (re-search-forward regexp limit noerror)) + (cond + ((null ret) + (setq continue nil) + ) + (t + (if (string-match-p regexp-open (match-string-no-properties 0)) + (setq level (1+ level)) + (setq level (1- level))) + (when (< level 1) + (setq continue nil) + ) + ) ;t + ) ;cond + ) ;while + (when (not (= level 0)) (goto-char pos)) + ret)) + +(defun web-mode-block-sb (expr &optional limit noerror) + (unless limit (setq limit (web-mode-block-beginning-position (point)))) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (search-backward expr limit noerror)) + (when (or (null ret) + (not (get-text-property (point) 'block-token))) + (setq continue nil) + ) ;when + ) ;while + ret)) + +(defun web-mode-block-sf (expr &optional limit noerror) + (unless limit (setq limit (web-mode-block-end-position (point)))) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (search-forward expr limit noerror)) + (when (or (null ret) + (not (get-text-property (point) 'block-token))) + (setq continue nil) + ) ;when + ) ;while + ret)) + +(defun web-mode-block-rsb (regexp &optional limit noerror) + (unless limit (setq limit (web-mode-block-beginning-position (point)))) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (re-search-backward regexp limit noerror)) + (when (or (null ret) + (not (get-text-property (point) 'block-token))) + (setq continue nil) + ) ;when + ) ;while + ret)) + +(defun web-mode-block-rsf (regexp &optional limit noerror) + (unless limit (setq limit (web-mode-block-end-position (point)))) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (re-search-forward regexp limit noerror)) + (when (or (null ret) + (not (get-text-property (point) 'block-token))) + (setq continue nil) + ) ;when + ) ;while + ret)) + +(defun web-mode-part-sb (expr &optional limit noerror) + (unless limit (setq limit (web-mode-part-beginning-position (point)))) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (search-backward expr limit noerror)) + (when (or (null ret) + (and (not (get-text-property (point) 'part-token)) + (not (get-text-property (point) 'block-side))) + ) + (setq continue nil) + ) ;when + ) ;while + ret)) + +(defun web-mode-part-sf (expr &optional limit noerror) + (unless limit (setq limit (web-mode-part-end-position (point)))) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (search-forward expr limit noerror)) + (when (or (null ret) + (and (not (get-text-property (point) 'part-token)) + (not (get-text-property (point) 'block-side))) + ) + (setq continue nil) + ) ;when + ) ;while + ret)) + +(defun web-mode-part-rsb (regexp &optional limit noerror) + (unless limit (setq limit (web-mode-part-beginning-position (point)))) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (re-search-backward regexp limit noerror)) + (when (or (null ret) + (and (not (get-text-property (point) 'part-token)) + (not (get-text-property (point) 'block-side))) + ) + (setq continue nil) + ) ;when + ) ;while + ret)) + +(defun web-mode-part-rsf (regexp &optional limit noerror) + (unless limit (setq limit (web-mode-part-end-position (point)))) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (re-search-forward regexp limit t)) + (when (or (null ret) + (and (not (get-text-property (point) 'part-token)) + (not (get-text-property (point) 'block-side))) + ) + (setq continue nil) + ) ;when + ) ;while + ret)) + +(defun web-mode-javascript-rsb (regexp &optional limit noerror) + (unless limit (setq limit (web-mode-part-beginning-position (point)))) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (re-search-backward regexp limit noerror)) + (when (or (null ret) + (and (not (get-text-property (point) 'part-token)) + (not (get-text-property (point) 'block-side)) + (not (get-text-property (point) 'jsx-depth))) + ) + (setq continue nil) + ) ;when + ) ;while + ret)) + +(defun web-mode-javascript-rsf (regexp &optional limit noerror) + (unless limit (setq limit (web-mode-part-end-position (point)))) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (re-search-forward regexp limit t)) + (when (or (null ret) + (and (not (get-text-property (point) 'part-token)) + (not (get-text-property (point) 'block-side)) + (not (get-text-property (point) 'jsx-depth))) + ) + (setq continue nil) + ) ;when + ) ;while + ret)) + +(defun web-mode-dom-sf (expr &optional limit noerror) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (search-forward expr limit noerror)) + (if (or (null ret) + (not (get-text-property (- (point) (length expr)) 'block-side))) + (setq continue nil)) + ) + ret)) + +(defun web-mode-dom-rsf (regexp &optional limit noerror) + (unless noerror (setq noerror t)) + (let ((continue t) (ret nil)) + (while continue + (setq ret (re-search-forward regexp limit noerror)) + ;; (message "ret=%S point=%S limit=%S i=%S" ret (point) limit 0) + (cond + ((null ret) + (setq continue nil)) + ((or (get-text-property (match-beginning 0) 'block-side) + (get-text-property (match-beginning 0) 'part-token)) + ) + (t + (setq continue nil)) + ) ;cond + ) ;while + ret)) + +(defun web-mode-rsb-position (pos regexp &optional limit noerror) + (unless noerror (setq noerror t)) + (save-excursion + (goto-char pos) + (if (re-search-backward regexp limit noerror) (point) nil) + )) + +(defun web-mode-rsb (regexp &optional limit noerror) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (re-search-backward regexp limit noerror)) + (if (or (null ret) + (not (web-mode-is-comment-or-string))) + (setq continue nil))) + ret)) + +(defun web-mode-rsf (regexp &optional limit noerror) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (re-search-forward regexp limit noerror)) + (if (or (null ret) + (not (web-mode-is-comment-or-string))) + (setq continue nil)) + ) + ret)) + +(defun web-mode-sb (expr &optional limit noerror) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (search-backward expr limit noerror)) + (if (or (null ret) + (not (web-mode-is-comment-or-string))) + (setq continue nil))) + ret)) + +(defun web-mode-sf (expr &optional limit noerror) + (unless noerror (setq noerror t)) + (let ((continue t) ret) + (while continue + (setq ret (search-forward expr limit noerror)) + (if (or (null ret) + (not (web-mode-is-comment-or-string))) + (setq continue nil))) + ret)) + +(defun web-mode-content-rsf (regexp &optional limit noerror) + (unless noerror (setq noerror t)) + (let ((continue t) ret beg end) + (while continue + (setq ret (re-search-forward regexp limit noerror) + beg (if (null ret) (point) (match-beginning 0)) + end (if (null ret) (point) (1- (match-end 0)))) + (if (or (null ret) + (and (web-mode-is-content beg) + (web-mode-is-content end))) + (setq continue nil))) + ret)) + +;;---- ADVICES ----------------------------------------------------------------- + +(defadvice ac-start (before web-mode-set-up-ac-sources activate) + "Set `ac-sources' based on current language before running auto-complete." + (when (equal major-mode 'web-mode) + ;; set ignore each time to nil. User has to implement a hook to change it + ;; for each completion + (setq web-mode-ignore-ac-start-advice nil) + (run-hooks 'web-mode-before-auto-complete-hooks) + (unless web-mode-ignore-ac-start-advice + (when web-mode-ac-sources-alist + (let ((new-web-mode-ac-sources + (assoc (web-mode-language-at-pos) + web-mode-ac-sources-alist))) + (setq ac-sources (cdr new-web-mode-ac-sources))))))) + +;;---- MINOR MODE ADDONS ------------------------------------------------------- + +(defun web-mode-yasnippet-exit-hook () + "Yasnippet exit hook" + (when (and (boundp 'yas-snippet-beg) (boundp 'yas-snippet-end)) + (indent-region yas-snippet-beg yas-snippet-end))) + +(defun web-mode-imenu-index () + (interactive) + "Returns imenu items." + (let (toc-index + line) + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (setq line (buffer-substring-no-properties + (line-beginning-position) + (line-end-position))) + (let (found + (i 0) + item + regexp + type + type-idx + content + content-idx + content-regexp + close-tag-regexp + concat-str + jumpto + str) + (while (and (not found ) (< i (length web-mode-imenu-regexp-list))) + (setq item (nth i web-mode-imenu-regexp-list)) + (setq regexp (nth 0 item)) + (setq type-idx (nth 1 item)) + (setq content-idx (nth 2 item)) + (setq concat-str (nth 3 item)) + (when (not (numberp content-idx)) + (setq content-regexp (nth 2 item) + close-tag-regexp (nth 4 item) + content-idx nil)) + + (when (string-match regexp line) + + (cond + (content-idx + (setq type (match-string type-idx line)) + (setq content (match-string content-idx line)) + (setq str (concat type concat-str content)) + (setq jumpto (line-beginning-position))) + (t + (let (limit) + (setq type (match-string type-idx line)) + (goto-char (line-beginning-position)) + (save-excursion + (setq limit (re-search-forward close-tag-regexp (point-max) t))) + + (when limit + (when (re-search-forward content-regexp limit t) + (setq content (match-string 1)) + (setq str (concat type concat-str content)) + (setq jumpto (line-beginning-position)) + ) + ))) + ) + (when str (setq toc-index + (cons (cons str jumpto) + toc-index) + ) + (setq found t)) + ) + (setq i (1+ i)))) + (forward-line) + (goto-char (line-end-position)) ;; make sure we are at eobp + )) + (nreverse toc-index))) + +;;---- UNIT TESTING ------------------------------------------------------------ + +(defun web-mode-test () + "Executes web-mode unit tests. See `web-mode-tests-directory'." + (interactive) + (let (files ret regexp) + (setq regexp "^[[:alnum:]][[:alnum:]._]+\\'") + (setq files (directory-files web-mode-tests-directory t regexp)) + (dolist (file files) + (cond + ((eq (string-to-char (file-name-nondirectory file)) ?\_) + (delete-file file)) + (t + (setq ret (web-mode-test-process file))) + ) ;cond + ) ;dolist + )) + +(defun web-mode-test-process (file) + (with-temp-buffer + (let (out sig1 sig2 success err) + (setq-default indent-tabs-mode nil) + (if (string-match-p "sql" file) + (setq web-mode-enable-sql-detection t) + (setq web-mode-enable-sql-detection nil)) + (insert-file-contents file) + (set-visited-file-name file) + (web-mode) + (setq sig1 (md5 (current-buffer))) + (delete-horizontal-space) + (while (not (eobp)) + (forward-line) + (delete-horizontal-space) + (end-of-line)) + (web-mode-buffer-indent) + (setq sig2 (md5 (current-buffer))) + (setq success (string= sig1 sig2)) + (setq out (concat (if success "ok" "ko") " : " (file-name-nondirectory file) "\n")) + (princ out) + (setq err (concat (file-name-directory file) "_err." (file-name-nondirectory file))) + (if success + (when (file-readable-p err) + (delete-file err)) + (write-file err) + (message "[%s]" (buffer-string)) + ) ;if + out))) + +;;---- MISC -------------------------------------------------------------------- + +(defun web-mode-set-engine (engine) + "Set the engine for the current buffer." + (interactive + (list (completing-read + "Engine: " + (let (engines) + (dolist (elt web-mode-engines) + (setq engines (append engines (list (car elt))))) + engines)))) + (setq web-mode-content-type "html" + web-mode-engine (web-mode-engine-canonical-name engine) + web-mode-minor-engine engine) + (web-mode-on-engine-setted) + (web-mode-buffer-highlight)) + +(defun web-mode-set-content-type (content-type) + "Set the content-type for the current buffer" + (interactive (list (completing-read "Content-type: " web-mode-part-content-types))) + (setq web-mode-content-type content-type) + (when (called-interactively-p 'any) + ) + (web-mode-buffer-highlight)) + +(defun web-mode-on-engine-setted () + (let (elt elts engines) + + (when (string= web-mode-engine "razor") (setq web-mode-enable-block-face t)) + (setq web-mode-engine-attr-regexp (cdr (assoc web-mode-engine web-mode-engine-attr-regexps))) + (setq web-mode-engine-token-regexp (cdr (assoc web-mode-engine web-mode-engine-token-regexps))) + + ;;(message "%S %S %S" web-mode-engine web-mode-engine-attr-regexp web-mode-engine-token-regexp) + + (when (null web-mode-minor-engine) + (setq web-mode-minor-engine "none")) + + (setq elt (assoc web-mode-engine web-mode-engine-open-delimiter-regexps)) + (cond + (elt + (setq web-mode-block-regexp (cdr elt))) + ((string= web-mode-engine "archibus") + (setq web-mode-block-regexp nil)) + (t + (setq web-mode-engine "none")) + ) + + (unless (boundp 'web-mode-extra-auto-pairs) + (setq web-mode-extra-auto-pairs nil)) + + (setq web-mode-auto-pairs + (append + (cdr (assoc web-mode-engine web-mode-engines-auto-pairs)) + (cdr (assoc nil web-mode-engines-auto-pairs)) + (cdr (assoc web-mode-engine web-mode-extra-auto-pairs)) + (cdr (assoc nil web-mode-extra-auto-pairs)))) + + (unless (boundp 'web-mode-extra-snippets) + (setq web-mode-extra-snippets nil)) + + (setq elts + (append + (cdr (assoc web-mode-engine web-mode-extra-snippets)) + (cdr (assoc nil web-mode-extra-snippets)) + (cdr (assoc web-mode-engine web-mode-engines-snippets)) + (cdr (assoc nil web-mode-engines-snippets)))) + + ;;(message "%S" elts) + + (dolist (elt elts) + (unless (assoc (car elt) web-mode-snippets) + (setq web-mode-snippets (append (list elt) web-mode-snippets))) + ) + + (setq web-mode-engine-font-lock-keywords + (symbol-value (cdr (assoc web-mode-engine web-mode-engines-font-lock-keywords)))) + + (when (and (string= web-mode-minor-engine "jinja") + (not (member "endtrans" web-mode-django-control-blocks))) + (add-to-list 'web-mode-django-control-blocks "endtrans") + (setq web-mode-django-control-blocks-regexp + (regexp-opt web-mode-django-control-blocks t)) + ) + + (when (string= web-mode-engine "spip") + (modify-syntax-entry ?# "w" (syntax-table))) + +;; (message "%S" (symbol-value (cdr (assoc web-mode-engine web-mode-engines-font-lock-keywords)))) + + )) + +(defun web-mode-detect-engine () + (save-excursion + (goto-char (point-min)) + (when (re-search-forward "-\\*- engine:[ ]*\\([[:alnum:]-]+\\)[ ]*-\\*-" web-mode-chunk-length t) + (setq web-mode-minor-engine (match-string-no-properties 1)) + (setq web-mode-engine (web-mode-engine-canonical-name web-mode-minor-engine))) + web-mode-minor-engine)) + +(defun web-mode-guess-engine-and-content-type () + (let (buff-name elt found) + + (setq buff-name (buffer-file-name)) + (unless buff-name (setq buff-name (buffer-name))) + (setq web-mode-is-scratch (string= buff-name "*scratch*")) + (setq web-mode-content-type nil) + + (when (boundp 'web-mode-content-types-alist) + (setq found nil) + (dolist (elt web-mode-content-types-alist) + (when (and (not found) (string-match-p (cdr elt) buff-name)) + (setq web-mode-content-type (car elt) + found t)) + ) ;dolist + ) ;when + + (unless web-mode-content-type + (setq found nil) + (dolist (elt web-mode-content-types) + (when (and (not found) (string-match-p (cdr elt) buff-name)) + (setq web-mode-content-type (car elt) + found t)) + ) ;dolist + ) ;unless + + (when (boundp 'web-mode-engines-alist) + (setq found nil) + (dolist (elt web-mode-engines-alist) + (cond + ((stringp (cdr elt)) + (when (string-match-p (cdr elt) buff-name) + (setq web-mode-engine (car elt)))) + ((functionp (cdr elt)) + (when (funcall (cdr elt)) + (setq web-mode-engine (car elt)))) + ) ;cond + ) ;dolist + ) ;when + + (unless web-mode-engine + (setq found nil) + (dolist (elt web-mode-engine-file-regexps) + ;;(message "%S %S" (cdr elt) buff-name) + (when (and (not found) (string-match-p (cdr elt) buff-name)) + (setq web-mode-engine (car elt) + found t)) + ) + ) + + (when (and (or (null web-mode-engine) (string= web-mode-engine "none")) + (string-match-p "php" (buffer-substring-no-properties + (line-beginning-position) + (line-end-position)))) + (setq web-mode-engine "php")) + + (when (and (string= web-mode-content-type "javascript") + (string-match-p "@jsx" + (buffer-substring-no-properties + (point-min) + (if (< (point-max) web-mode-chunk-length) + (point-max) + web-mode-chunk-length) + ))) + (setq web-mode-content-type "jsx")) + + (when web-mode-engine + (setq web-mode-minor-engine web-mode-engine + web-mode-engine (web-mode-engine-canonical-name web-mode-engine)) + ) + + (when (and (or (null web-mode-engine) + (string= web-mode-engine "none")) + web-mode-enable-engine-detection) + (web-mode-detect-engine)) + + (web-mode-on-engine-setted) + + )) + +(defun web-mode-engine-canonical-name (name) + (let (engine) + (cond + ((null name) + nil) + ((assoc name web-mode-engines) + name) + (t + (dolist (elt web-mode-engines) + (when (and (null engine) (member name (cdr elt))) + (setq engine (car elt))) + ) ;dolist + engine) + ))) + +(defun web-mode-on-after-save () + (when web-mode-is-scratch + (web-mode-guess-engine-and-content-type) + (web-mode-buffer-highlight)) + nil) + +(defun web-mode-on-exit () + (web-mode-with-silent-modifications + (put-text-property (point-min) (point-max) 'invisible nil) + (remove-overlays) + (remove-hook 'change-major-mode-hook 'web-mode-on-exit t) + )) + +(defun web-mode-file-link (file) + "Insert a link to a file in html document. This function can be +extended to support more filetypes by customizing +`web-mode-links'." + (interactive + (list (file-relative-name (read-file-name "Link file: ")))) + (let ((matched nil) + (point-line (line-number-at-pos)) + (point-column (current-column))) + (dolist (type web-mode-links) + (when (string-match (car type) file) + (setq matched t) + (when (nth 2 type) + (goto-char (point-min)) + (search-forward " ") + (backward-char 7) + (open-line 1)) + (insert (format (cadr type) file)) + (indent-for-tab-command) + (when (nth 2 type) + ;; return point where it was and fix indentation + (forward-line) + (indent-for-tab-command) + (if (> point-line (- (line-number-at-pos) 2)) + (forward-line (+ (- point-line (line-number-at-pos)) 1)) + (forward-line (- point-line (line-number-at-pos)))) + (move-to-column point-column)) + ;; move point back if needed + (backward-char (nth 3 type)))) + (when (not matched) + (user-error "Unknown file type")))) + +(defun web-mode-reload () + "Reload web-mode." + (interactive) + (web-mode-with-silent-modifications + (put-text-property (point-min) (point-max) 'invisible nil) + (remove-overlays) + (setq font-lock-unfontify-region-function 'font-lock-default-unfontify-region) + (load "web-mode.el") + (setq web-mode-change-beg nil + web-mode-change-end nil) + (web-mode) + )) + +(defun web-mode-trace (msg) + (let (sub) + (when (null web-mode-time) (setq web-mode-time (current-time))) + (setq sub (time-subtract (current-time) web-mode-time)) + (when nil + (save-excursion + (let ((n 0)) + (goto-char (point-min)) + (while (web-mode-tag-next) + (setq n (1+ n)) + ) + (message "%S tags found" n) + ))) + (message "%18s: time elapsed = %Ss %9Sµs" msg (nth 1 sub) (nth 2 sub)) + )) + +(defun web-mode-reveal () + "Display text properties at point." + (interactive) + (let (symbols out) + (setq out (format + "[point=%S engine=%S minor=%S content-type=%S language-at-pos=%S]\n" + (point) + web-mode-engine + web-mode-minor-engine + web-mode-content-type + (web-mode-language-at-pos (point)))) + (setq symbols (append web-mode-scan-properties '(font-lock-face face))) + (dolist (symbol symbols) + (when symbol + (setq out (concat out (format "%s(%S) " (symbol-name symbol) (get-text-property (point) symbol))))) + ) + (message "%s\n" out) + ;;(message "syntax-class=%S" (syntax-class (syntax-after (point)))) + (message nil))) + +(defun web-mode-debug () + "Display informations useful for debugging." + (interactive) + (let ((modes nil) + (customs '(web-mode-enable-current-column-highlight web-mode-enable-current-element-highlight indent-tabs-mode)) + (ignore '(abbrev-mode auto-composition-mode auto-compression-mode auto-encryption-mode auto-insert-mode blink-cursor-mode column-number-mode delete-selection-mode display-time-mode electric-indent-mode file-name-shadow-mode font-lock-mode global-font-lock-mode global-hl-line-mode line-number-mode menu-bar-mode mouse-wheel-mode recentf-mode show-point-mode tool-bar-mode tooltip-mode transient-mark-mode))) + (message "\n") + (message "--- WEB-MODE DEBUG BEG ---") + (message "versions: emacs(%S.%S) web-mode(%S)" + emacs-major-version emacs-minor-version web-mode-version) + (message "vars: engine(%S) minor(%S) content-type(%S) file(%S)" + web-mode-engine + web-mode-minor-engine + web-mode-content-type + (or (buffer-file-name) (buffer-name))) + (message "system: window(%S) config(%S)" window-system system-configuration) + (message "colors: fg(%S) bg(%S) " + (cdr (assoc 'foreground-color default-frame-alist)) + (cdr (assoc 'background-color default-frame-alist))) + (mapc (lambda (mode) + (condition-case nil + (if (and (symbolp mode) (symbol-value mode) (not (member mode ignore))) + (add-to-list 'modes mode)) + (error nil)) + ) ;lambda + minor-mode-list) + (message "minor modes: %S" modes) + (message "vars:") + (dolist (custom customs) + (message (format "%s=%S " (symbol-name custom) (symbol-value custom)))) + (message "--- WEB-MODE DEBUG END ---") + (switch-to-buffer "*Messages*") + (goto-char (point-max)) + (recenter) + )) + +(provide 'web-mode) + +;;; web-mode.el ends here + +;; Local Variables: +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: diff --git a/elpa/web-mode-20180628.1122/web-mode.elc b/elpa/web-mode-20180628.1122/web-mode.elc new file mode 100644 index 0000000..3b6f158 Binary files /dev/null and b/elpa/web-mode-20180628.1122/web-mode.elc differ diff --git a/elpa/which-key-20180131.606/which-key-autoloads.el b/elpa/which-key-20180131.606/which-key-autoloads.el deleted file mode 100644 index b37747d..0000000 --- a/elpa/which-key-20180131.606/which-key-autoloads.el +++ /dev/null @@ -1,153 +0,0 @@ -;;; which-key-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "which-key" "which-key.el" (23163 15698 0 0)) -;;; Generated autoloads from which-key.el - -(defvar which-key-mode nil "\ -Non-nil if Which-Key mode is enabled. -See the `which-key-mode' command -for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `which-key-mode'.") - -(custom-autoload 'which-key-mode "which-key" nil) - -(autoload 'which-key-mode "which-key" "\ -Toggle which-key-mode. - -\(fn &optional ARG)" t nil) - -(autoload 'which-key-setup-side-window-right "which-key" "\ -Apply suggested settings for side-window that opens on right. - -\(fn)" t nil) - -(autoload 'which-key-setup-side-window-right-bottom "which-key" "\ -Apply suggested settings for side-window that opens on right -if there is space and the bottom otherwise. - -\(fn)" t nil) - -(autoload 'which-key-setup-side-window-bottom "which-key" "\ -Apply suggested settings for side-window that opens on -bottom. - -\(fn)" t nil) - -(autoload 'which-key-setup-minibuffer "which-key" "\ -Apply suggested settings for minibuffer. -Do not use this setup if you use the paging commands. Instead use -`which-key-setup-side-window-bottom', which is nearly identical -but more functional. - -\(fn)" t nil) - -(autoload 'which-key-add-key-based-replacements "which-key" "\ -Replace the description of KEY-SEQUENCE with REPLACEMENT. -KEY-SEQUENCE is a string suitable for use in `kbd'. REPLACEMENT -may either be a string, as in - -\(which-key-add-key-based-replacements \"C-x 1\" \"maximize\") - -a cons of two strings as in - -\(which-key-add-key-based-replacements \"C-x 8\" - '(\"unicode\" . \"Unicode keys\")) - -or a function that takes a (KEY . BINDING) cons and returns a -replacement. - -In the second case, the second string is used to provide a longer -name for the keys under a prefix. - -MORE allows you to specifcy additional KEY REPLACEMENT pairs. All -replacements are added to -`which-key-key-based-description-replacement-alist'. - -\(fn KEY-SEQUENCE REPLACEMENT &rest MORE)" nil nil) - -(autoload 'which-key-add-major-mode-key-based-replacements "which-key" "\ -Functions like `which-key-add-key-based-replacements'. -The difference is that MODE specifies the `major-mode' that must -be active for KEY-SEQUENCE and REPLACEMENT (MORE contains -addition KEY-SEQUENCE REPLACEMENT pairs) to apply. - -\(fn MODE KEY-SEQUENCE REPLACEMENT &rest MORE)" nil nil) - -(autoload 'which-key-reload-key-sequence "which-key" "\ -Simulate entering the key sequence KEY-SEQ. -KEY-SEQ should be a list of events as produced by -`listify-key-sequence'. If nil, KEY-SEQ defaults to -`which-key--current-key-list'. Any prefix arguments that were -used are reapplied to the new key sequence. - -\(fn &optional KEY-SEQ)" nil nil) - -(autoload 'which-key-show-standard-help "which-key" "\ -Call the command in `which-key--prefix-help-cmd-backup'. -Usually this is `describe-prefix-bindings'. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-next-page-no-cycle "which-key" "\ -Show next page of keys unless on the last page, in which case -call `which-key-show-standard-help'. - -\(fn)" t nil) - -(autoload 'which-key-show-previous-page-no-cycle "which-key" "\ -Show previous page of keys unless on the first page, in which -case do nothing. - -\(fn)" t nil) - -(autoload 'which-key-show-next-page-cycle "which-key" "\ -Show the next page of keys, cycling from end to beginning -after last page. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-previous-page-cycle "which-key" "\ -Show the previous page of keys, cycling from beginning to end -after first page. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-top-level "which-key" "\ -Show top-level bindings. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-major-mode "which-key" "\ -Show top-level bindings in the map of the current major mode. - -This function will also detect evil bindings made using -`evil-define-key' in this map. These bindings will depend on the -current evil state. - -\(fn)" t nil) - -(autoload 'which-key-undo-key "which-key" "\ -Undo last keypress and force which-key update. - -\(fn &optional _)" t nil) - -(autoload 'which-key-C-h-dispatch "which-key" "\ -Dispatch C-h commands by looking up key in -`which-key-C-h-map'. This command is always accessible (from any -prefix) if `which-key-use-C-h-commands' is non nil. - -\(fn)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; which-key-autoloads.el ends here diff --git a/elpa/which-key-20180131.606/which-key-pkg.el b/elpa/which-key-20180131.606/which-key-pkg.el deleted file mode 100644 index 9c95dd0..0000000 --- a/elpa/which-key-20180131.606/which-key-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "which-key" "20180131.606" "Display available keybindings in popup" '((emacs "24.4")) :commit "fce520f8af727bd33861f8d0f7655c01ea84ad85" :url "https://github.com/justbur/emacs-which-key") diff --git a/elpa/which-key-20180131.606/which-key.el b/elpa/which-key-20180131.606/which-key.el deleted file mode 100644 index 3cfdafc..0000000 --- a/elpa/which-key-20180131.606/which-key.el +++ /dev/null @@ -1,2520 +0,0 @@ -;;; which-key.el --- Display available keybindings in popup -*- lexical-binding: t; -*- - -;; Copyright (C) 2017 Free Software Foundation, Inc. - -;; Author: Justin Burkett -;; Maintainer: Justin Burkett -;; URL: https://github.com/justbur/emacs-which-key -;; Package-Version: 20180131.606 -;; Version: 3.1.0 -;; Keywords: -;; Package-Requires: ((emacs "24.4")) - -;; 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 . - -;;; Commentary: - -;; which-key provides the minor mode which-key-mode for Emacs. The mode displays -;; the key bindings following your currently entered incomplete command (a -;; prefix) in a popup. For example, after enabling the minor mode if you enter -;; C-x and wait for the default of 1 second the minibuffer will expand with all -;; of the available key bindings that follow C-x (or as many as space allows -;; given your settings). This includes prefixes like C-x 8 which are shown in a -;; different face. Screenshots of what the popup will look like along with -;; information about additional features can be found at -;; https://github.com/justbur/emacs-which-key. -;; - -;;; Code: - -(require 'cl-lib) -(require 'button) -(require 'regexp-opt) - -;; For compiler -(defvar evil-operator-shortcut-map) -(defvar evil-operator-state-map) -(defvar evil-motion-state-map) -(defvar golden-ratio-mode) -(declare-function evil-get-command-property "ext:evil-common.el") - -;;; Options - -(defgroup which-key nil - "Customization options for which-key-mode" - :group 'help - :prefix "which-key-") - -(defcustom which-key-idle-delay 1.0 - "Delay (in seconds) for which-key buffer to popup. A value of zero -might lead to issues, so a non-zero value is recommended -(see https://github.com/justbur/emacs-which-key/issues/134)." - :group 'which-key - :type 'float) - -(defcustom which-key-idle-secondary-delay nil - "Once the which-key buffer shows once for a key sequence reduce -the idle time to this amount (in seconds). This makes it possible -to shorten the delay for subsequent popups in the same key -sequence. The default is for this value to be nil, which disables -this behavior." - :group 'which-key - :type 'float) - -(defcustom which-key-echo-keystrokes (if (and echo-keystrokes - (> (+ echo-keystrokes 0.01) - which-key-idle-delay)) - (/ (float which-key-idle-delay) 4) - echo-keystrokes) - "Value to use for `echo-keystrokes'. -This only applies if `which-key-popup-type' is minibuffer or -`which-key-show-prefix' is echo. It needs to be less than -`which-key-idle-delay' or else the keystroke echo will erase the -which-key popup." - :group 'which-key - :type 'float) - -(defcustom which-key-max-description-length 27 - "Truncate the description of keys to this length. -Also adds \"..\". If nil, disable any truncation." - :group 'which-key - :type 'integer) - -(defcustom which-key-add-column-padding 0 - "Additional padding (number of spaces) to add to the left of -each key column." - :group 'which-key - :type 'integer) - -(defcustom which-key-unicode-correction 3 - "Correction for wide unicode characters. -Since we measure width in terms of the number of characters, -Unicode characters that are wider than ASCII characters throw off -the calculation for available width in the which-key buffer. This -variable allows you to adjust for the wide unicode characters by -artificially reducing the available width in the buffer. - -The default of 3 means allow for the total extra width -contributed by any wide unicode characters to be up to one -additional ASCII character in the which-key buffer. Increase this -number if you are seeing charaters get cutoff on the right side -of the which-key popup." - :group 'which-key - :type 'integer) - -(defcustom which-key-dont-use-unicode nil - "If non-nil, don't use any unicode characters in default setup." - :group 'which-key - :type 'integer) - -(defcustom which-key-separator - (if which-key-dont-use-unicode " : " " → ") - "Separator to use between key and description. Default is \" → -\", unless `which-key-dont-use-unicode' is non nil, in which case -the default is \" : \"." - :group 'which-key - :type 'string) - -(defcustom which-key-prefix-prefix "+" - "String to insert in front of prefix commands (i.e., commands -that represent a sub-map). Default is \"+\"." - :group 'which-key - :type 'string) - -(defcustom which-key-compute-remaps nil - "If non-nil, show remapped command if a command has been -remapped given the currently active keymaps." - :group 'which-key - :type 'boolean) - -(defvar which-key-key-replacement-alist nil) -(make-obsolete-variable 'which-key-key-replacement-alist - 'which-key-replacement-alist "2016-11-21") -(defvar which-key-description-replacement-alist nil) -(make-obsolete-variable 'which-key-description-replacement-alist - 'which-key-replacement-alist "2016-11-21") -(defvar which-key-key-based-description-replacement-alist nil) -(make-obsolete-variable 'which-key-key-based-description-replacement-alist - 'which-key-replacement-alist "2016-11-21") - -(defcustom which-key-replacement-alist - (delq nil - `(((nil . "Prefix Command") . (nil . "prefix")) - ((nil . "\\`\\?\\?\\'") . (nil . "lambda")) - ((nil . "which-key-show-next-page-no-cycle") . (nil . "wk next pg")) - ,@(unless which-key-dont-use-unicode - '((("") . ("←")) - (("") . ("→")))) - (("<\\([[:alnum:]-]+\\)>") . ("\\1")))) - "Association list to determine how to manipulate descriptions -of key bindings in the which-key popup. Each element of the list -is a nested cons cell with the format - -\(MATCH CONS . REPLACEMENT\). - -The MATCH CONS determines when a replacement should occur and -REPLACEMENT determines how the replacement should occur. Each may -have the format \(KEY REGEXP . BINDING REGEXP\). For the -replacement to apply the key binding must match both the KEY -REGEXP and the BINDING REGEXP. A value of nil in either position -can be used to match every possibility. The replacement is -performed by using `replace-regexp-in-string' on the KEY REGEXP -from the MATCH CONS and REPLACEMENT when it is a cons cell, and -then similarly for the BINDING REGEXP. A nil value in the BINDING -REGEXP position cancels the replacement. For example, the entry - -\(\(nil . \"Prefix Command\"\) . \(nil . \"prefix\"\)\) - -matches any binding with the descriptions \"Prefix Command\" and -replaces the description with \"prefix\", ignoring the -corresponding key. - -REPLACEMENT may also be a function taking a cons cell -\(KEY . BINDING\) and producing a new corresponding cons cell. - -If REPLACEMENT is anything other than a cons cell \(and non nil\) -the key binding is ignored by which-key. - -Finally, you can multiple replacements to occur for a given key -binding by setting `which-key-allow-multiple-replacements' to a -non-nil value." - :group 'which-key - :type '(alist :key-type (cons (choice regexp nil) - (choice regexp nil)) - :value-type (cons (choice string nil) - (choice string nil)))) - -(when (bound-and-true-p which-key-key-replacement-alist) - (mapc - (lambda (repl) - (push (cons (cons (car repl) nil) (cons (cdr repl) nil)) - which-key-replacement-alist)) - which-key-key-replacement-alist)) -(when (bound-and-true-p which-key-description-replacement-alist) - (mapc - (lambda (repl) - (push (cons (cons nil (car repl)) (cons nil (cdr repl))) - which-key-replacement-alist)) - which-key-description-replacement-alist)) - -(defcustom which-key-allow-multiple-replacements nil - "Allow a key binding to match and be modified by multiple -elements in `which-key-replacement-alist' if non-nil. When nil, -only the first match is used to perform replacements from -`which-key-replacement-alist'." - :group 'which-key - :type 'boolean) - -(defcustom which-key-show-docstrings nil - "If non-nil, show each command's docstring next to the command -in the which-key buffer. This will only display the docstring up -to the first line break. If you set this variable to the symbol -docstring-only, then the command's name with be omitted. You -probably also want to adjust `which-key-max-description-length' -at the same time if you use this feature." - :group 'which-key - :type '(radio - (const :tag "Do not show docstrings" nil) - (const :tag "Add docstring to command names" t) - (const :tag "Replace command name with docstring" docstring-only))) - -(defcustom which-key-highlighted-command-list '() - "A list of strings and/or cons cells used to highlight certain -commands. If the element is a string, assume it is a regexp -pattern for matching command names and use -`which-key-highlighted-command-face' for any matching names. If -the element is a cons cell, it should take the form (regexp . -face to apply)." - :group 'which-key - :type '(repeat (choice string (cons regexp face)))) - -(defcustom which-key-special-keys '() - "These keys will automatically be truncated to one character -and have `which-key-special-key-face' applied to them. This is -disabled by default. Try this to see the effect. - -\(setq which-key-special-keys '(\"SPC\" \"TAB\" \"RET\" \"ESC\" \"DEL\")\)" - :group 'which-key - :type '(repeat string)) - -(defcustom which-key-buffer-name " *which-key*" - "Name of which-key buffer." - :group 'which-key - :type 'string) - -(defcustom which-key-show-prefix 'echo - "Whether to and where to display the current prefix sequence. -Possible choices are echo for echo area (the default), left, top -and nil. Nil turns the feature off." - :group 'which-key - :type '(radio (const :tag "Left of the keys" left) - (const :tag "In the first line" top) - (const :tag "In the last line" bottom) - (const :tag "In the echo area" echo) - (const :tag "In the mode-line" mode-line) - (const :tag "Hide" nil))) - -(defcustom which-key-popup-type 'side-window - "Supported types are minibuffer, side-window, frame, and custom." - :group 'which-key - :type '(radio (const :tag "Show in minibuffer" minibuffer) - (const :tag "Show in side window" side-window) - (const :tag "Show in popup frame" frame) - (const :tag "Use your custom display functions" custom))) - -(defcustom which-key-min-display-lines 1 - "The minimum number of horizontal lines to display in the - which-key buffer." - :group 'which-key - :type 'integer) - -(defcustom which-key-max-display-columns nil - "The maximum number of columns to display in the which-key -buffer. nil means don't impose a maximum." - :group 'which-key - :type 'integer) - -(defcustom which-key-side-window-location 'bottom - "Location of which-key popup when `which-key-popup-type' is side-window. -Should be one of top, bottom, left or right. You can also specify -a list of two locations, like (right bottom). In this case, the -first location is tried. If there is not enough room, the second -location is tried." - :group 'which-key - :type '(radio (const right) - (const bottom) - (const left) - (const top) - (const (right bottom)) - (const (bottom right)))) - -(defcustom which-key-side-window-slot 0 - "The `slot' to use for `display-buffer-in-side-window' when -`which-key-popup-type' is 'side-window. Quoting from the -docstring of `display-buffer-in-side-window', - -‘slot’ if non-nil, specifies the window slot where to display - BUFFER. A value of zero or nil means use the middle slot on - the specified side. A negative value means use a slot - preceding (that is, above or on the left of) the middle slot. - A positive value means use a slot following (that is, below or - on the right of) the middle slot. The default is zero." - :group 'which-key - :type 'integer) - -(defcustom which-key-side-window-max-width 0.333 - "Maximum width of which-key popup when type is side-window and -location is left or right. -This variable can also be a number between 0 and 1. In that case, it denotes -a percentage out of the frame's width." - :group 'which-key - :type 'float) - -(defcustom which-key-side-window-max-height 0.25 - "Maximum height of which-key popup when type is side-window and -location is top or bottom. -This variable can also be a number between 0 and 1. In that case, it denotes -a percentage out of the frame's height." - :group 'which-key - :type 'float) - -(defcustom which-key-frame-max-width 60 - "Maximum width of which-key popup when type is frame." - :group 'which-key - :type 'integer) - -(defcustom which-key-frame-max-height 20 - "Maximum height of which-key popup when type is frame." - :group 'which-key - :type 'integer) - -(defcustom which-key-allow-imprecise-window-fit nil - "If non-nil allow which-key to use a less intensive method of -fitting the popup window to the buffer. If you are noticing lag -when the which-key popup displays turning this on may help. - -See https://github.com/justbur/emacs-which-key/issues/130" - :group 'which-key - :type 'boolean) - -(defcustom which-key-show-remaining-keys nil - "Show remaining keys in last slot, when keys are hidden." - :group 'which-key - :type '(radio (const :tag "Yes" t) - (const :tag "No" nil))) - -(defcustom which-key-sort-order 'which-key-key-order - "If nil, do not resort the output from -`describe-buffer-bindings' which groups by mode. Ordering options -are - -1. `which-key-key-order': by key (default) -2. `which-key-key-order-alpha': by key using alphabetical order -3. `which-key-description-order': by description -4. `which-key-prefix-then-key-order': prefix (no prefix first) then key -5. `which-key-local-then-key-order': local binding then key - -See the README and the docstrings for those functions for more -information." - :group 'which-key - :type '(choice (function-item which-key-key-order) - (function-item which-key-key-order-alpha) - (function-item which-key-description-order) - (function-item which-key-prefix-then-key-order) - (function-item which-key-local-then-key-order))) - -(defcustom which-key-sort-uppercase-first t - "If non-nil, uppercase comes before lowercase in sorting -function chosen in `which-key-sort-order'. Otherwise, the order -is reversed." - :group 'which-key - :type 'boolean) - -(defcustom which-key-paging-prefixes '() - "Enable paging for these prefixes." - :group 'which-key - :type '(repeat string)) - -(defcustom which-key-paging-key "" - "Key to use for changing pages. Bound after each of the -prefixes in `which-key-paging-prefixes'" - :group 'which-key - :type 'string) - -;; (defcustom which-key-undo-key nil -;; "Key (string) to use for undoing keypresses. Bound recursively -;; in each of the maps in `which-key-undo-keymaps'." -;; :group 'which-key -;; :type 'string) - -;; (defcustom which-key-undo-keymaps '() -;; "Keymaps in which to bind `which-key-undo-key'" -;; :group 'which-key -;; :type '(repeat symbol)) - -(defcustom which-key-use-C-h-commands t - "Use C-h for paging if non-nil. Normally C-h after a prefix - calls `describe-prefix-bindings'. This changes that command to - a which-key paging command when which-key-mode is active." - :group 'which-key - :type 'boolean) - -(defcustom which-key-is-verbose nil - "Whether to warn about potential mistakes in configuration." - :group 'which-key - :type 'boolean) - -(defvar which-key-C-h-map - (let ((map (make-sparse-keymap))) - (dolist (bind '(("\C-a" . which-key-abort) - ("a" . which-key-abort) - ("\C-h" . which-key-show-standard-help) - ("h" . which-key-show-standard-help) - ("\C-n" . which-key-show-next-page-cycle) - ("n" . which-key-show-next-page-cycle) - ("\C-p" . which-key-show-previous-page-cycle) - ("p" . which-key-show-previous-page-cycle) - ("\C-u" . which-key-undo-key) - ("u" . which-key-undo-key) - ("1" . which-key-digit-argument) - ("2" . which-key-digit-argument) - ("3" . which-key-digit-argument) - ("4" . which-key-digit-argument) - ("5" . which-key-digit-argument) - ("6" . which-key-digit-argument) - ("7" . which-key-digit-argument) - ("8" . which-key-digit-argument) - ("9" . which-key-digit-argument))) - (define-key map (car bind) (cdr bind))) - map) - "Keymap for C-h commands.") - -(defvar which-key--paging-functions '(which-key-C-h-dispatch - which-key-turn-page - which-key-show-next-page-cycle - which-key-show-next-page-no-cycle - which-key-show-previous-page-cycle - which-key-show-previous-page-no-cycle - which-key-undo-key - which-key-undo)) - -(defcustom which-key-hide-alt-key-translations t - "Hide key translations using Alt key if non nil. -These translations are not relevant most of the times since a lot -of terminals issue META modifier for the Alt key. - -See http://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html" - :group 'which-key - :type 'boolean) - -(defcustom which-key-delay-functions nil - "A list of functions that may decide whether to delay the -which-key popup based on the current incomplete key -sequence. Each function in the list is run with two arguments, -the current key sequence as produced by `key-description' and the -length of the key sequence. If the popup should be delayed based -on that key sequence, the function should return the delay time -in seconds. Returning nil means no delay. The first function in -this list to return a value is the value that is used. - -The delay time is effectively added to the normal -`which-key-idle-delay'." - :group 'which-key - :type '(repeat function)) - -(defcustom which-key-allow-regexps nil - "A list of regexp strings to use to filter key sequences. When -non-nil, for a key sequence to trigger the which-key popup it -must match one of the regexps in this list. The format of the key -sequences is what is produced by `key-description'." - :group 'which-key - :type '(repeat regexp)) - -(defcustom which-key-inhibit-regexps nil - "Similar to `which-key-allow-regexps', a list of regexp strings -to use to filter key sequences. When non-nil, for a key sequence -to trigger the which-key popup it cannot match one of the regexps -in this list. The format of the key sequences is what is produced -by `key-description'." - :group 'which-key - :type '(repeat regexp)) - -(defcustom which-key-show-transient-maps nil - "Show keymaps created by `set-transient-map' when applicable. - -More specifically, detect when `overriding-terminal-local-map' is -set (this is the keymap used by `set-transient-map') and display -it." - :group 'which-key - :type 'boolean) - -(defcustom which-key-enable-extended-define-key nil - "Advise `define-key' to make which-key aware of definitions of the form - - \(define-key KEYMAP KEY '(\"DESCRIPTION\" . DEF)) - -With the advice, this definition will have the side effect of -creating a replacement in `which-key-replacement-alist' that -replaces DEF with DESCRIPTION when the key sequence ends in -KEY. Using a cons cell like this is a valid definition for -`define-key'. All this does is to make which-key aware of it. - -Since many higher level keybinding functions use `define-key' -internally, this will affect most if not all of those as well. - -This variable must be set before loading which-key." - :group 'which-key - :type 'boolean) - -;; Hooks -(defcustom which-key-init-buffer-hook '() - "Hook run when which-key buffer is initialized." - :group 'which-key - :type 'hook) - -;;;; Faces - -(defgroup which-key-faces nil - "Faces for which-key-mode" - :group 'which-key - :prefix "which-key-") - -(defface which-key-key-face - '((t . (:inherit font-lock-constant-face))) - "Face for which-key keys" - :group 'which-key-faces) - -(defface which-key-separator-face - '((t . (:inherit font-lock-comment-face))) - "Face for the separator (default separator is an arrow)" - :group 'which-key-faces) - -(defface which-key-note-face - '((t . (:inherit which-key-separator-face))) - "Face for notes or hints occasionally provided" - :group 'which-key-faces) - -(defface which-key-command-description-face - '((t . (:inherit font-lock-function-name-face))) - "Face for the key description when it is a command" - :group 'which-key-faces) - -(defface which-key-local-map-description-face - '((t . (:inherit which-key-command-description-face))) - "Face for the key description when it is found in `current-local-map'" - :group 'which-key-faces) - -(defface which-key-highlighted-command-face - '((t . (:inherit which-key-command-description-face :underline t))) - "Default face for the command description when it is a command -and it matches a string in `which-key-highlighted-command-list'." - :group 'which-key-faces) - -(defface which-key-group-description-face - '((t . (:inherit font-lock-keyword-face))) - "Face for the key description when it is a group or prefix" - :group 'which-key-faces) - -(defface which-key-special-key-face - '((t . (:inherit which-key-key-face :inverse-video t :weight bold))) - "Face for special keys (SPC, TAB, RET)" - :group 'which-key-faces) - -(defface which-key-docstring-face - '((t . (:inherit which-key-note-face))) - "Face for docstrings" - :group 'which-key-faces) - -;;;; Custom popup - -(defcustom which-key-custom-popup-max-dimensions-function nil - "Variable to hold a custom max-dimensions function. -Will be passed the width of the active window and is expected to -return the maximum height in lines and width in characters of the -which-key popup in the form a cons cell (height . width)." - :group 'which-key - :type 'function) - -(defcustom which-key-custom-hide-popup-function nil - "Variable to hold a custom hide-popup function. -It takes no arguments and the return value is ignored." - :group 'which-key - :type 'function) - -(defcustom which-key-custom-show-popup-function nil - "Variable to hold a custom show-popup function. -Will be passed the required dimensions in the form (height . -width) in lines and characters respectively. The return value is -ignored." - :group 'which-key - :type 'function) - -(defcustom which-key-lighter " WK" - "Minor mode lighter to use in the mode-line." - :group 'which-key - :type 'string) - -(defvar which-key-inhibit nil - "Prevent which-key from popping up momentarily by setting this -to a non-nil value for the execution of a command. Like this - -\(let \(\(which-key-inhibit t\)\) -...\)") - -(defvar which-key-keymap-history nil - "History of keymap selections in functions like -`which-key-show-keymap'.") - -;;; Internal Vars - -(defvar which-key--buffer nil - "Internal: Holds reference to which-key buffer.") -(defvar which-key--timer nil - "Internal: Holds reference to open window timer.") -(defvar which-key--secondary-timer-active nil - "Internal: Non-nil if the secondary timer is active.") -(defvar which-key--paging-timer nil - "Internal: Holds reference to timer for paging.") -(defvar which-key--frame nil - "Internal: Holds reference to which-key frame. -Used when `which-key-popup-type' is frame.") -(defvar which-key--echo-keystrokes-backup nil - "Internal: Backup the initial value of `echo-keystrokes'.") -(defvar which-key--prefix-help-cmd-backup nil - "Internal: Backup the value of `prefix-help-command'.") -(defvar which-key--pages-plist nil - "Internal: Holds page objects") -(defvar which-key--current-prefix nil - "Internal: Holds current prefix") -(defvar which-key--current-page-n nil - "Internal: Current pages of showing buffer. Nil means no buffer -showing.") -(defvar which-key--on-last-page nil - "Internal: Non-nil if showing last page.") -(defvar which-key--last-try-2-loc nil - "Internal: Last location of side-window when two locations -used.") -(defvar which-key--multiple-locations nil) -(defvar which-key--using-top-level nil) -(defvar which-key--using-show-keymap nil) -(defvar which-key--using-show-operator-keymap nil) -(defvar which-key--inhibit-next-operator-popup nil) -(defvar which-key--current-show-keymap-name nil) -(defvar which-key--prior-show-keymap-args nil) -(defvar which-key--previous-frame-size nil) -(defvar which-key--prefix-title-alist nil) -(defvar which-key--debug nil) - -(make-obsolete-variable 'which-key-prefix-name-alist nil "2016-10-05") -(make-obsolete-variable 'which-key-prefix-title-alist nil "2016-10-05") - -;;; Third-party library support -;;;; Evil - -(defcustom which-key-allow-evil-operators (boundp 'evil-this-operator) - "Allow popup to show for evil operators. The popup is normally - inhibited in the middle of commands, but setting this to - non-nil will override this behavior for evil operators." - :group 'which-key - :type 'boolean) - -(defcustom which-key-show-operator-state-maps nil - "Experimental: Try to show the right keys following an evil -command that reads a motion, such as \"y\", \"d\" and \"c\" from -normal state. This is experimental, because there might be some -valid keys missing and it might be showing some invalid keys." - :group 'which-key - :type 'boolean) - -;;;;; God-mode - -(defvar which-key--god-mode-support-enabled nil - "Support god-mode if non-nil. This is experimental, -so you need to explicitly opt-in for now. Please report any -problems at github.") - -(defvar which-key--god-mode-key-string nil - "Holds key string to use for god-mode support.") - -(defadvice god-mode-lookup-command - (around which-key--god-mode-lookup-command-advice disable) - (setq which-key--god-mode-key-string (ad-get-arg 0)) - (unwind-protect - ad-do-it - (when (bound-and-true-p which-key-mode) - (which-key--hide-popup)))) - -(defun which-key-enable-god-mode-support (&optional disable) - "Enable support for god-mode if non-nil. This is experimental, -so you need to explicitly opt-in for now. Please report any -problems at github. If DISABLE is non-nil disable support." - (interactive "P") - (setq which-key--god-mode-support-enabled (null disable)) - (if disable - (ad-disable-advice - 'god-mode-lookup-command - 'around 'which-key--god-mode-lookup-command-advice) - (ad-enable-advice - 'god-mode-lookup-command - 'around 'which-key--god-mode-lookup-command-advice)) - (ad-activate 'god-mode-lookup-command)) - -;;; Mode - -;;;###autoload -(define-minor-mode which-key-mode - "Toggle which-key-mode." - :global t - :lighter which-key-lighter - :keymap (let ((map (make-sparse-keymap))) - (mapc - (lambda (prefix) - (define-key map - (kbd (concat prefix " " which-key-paging-key)) - #'which-key-C-h-dispatch)) - which-key-paging-prefixes) - map) - (if which-key-mode - (progn - (setq which-key--echo-keystrokes-backup echo-keystrokes) - (when (or (eq which-key-show-prefix 'echo) - (eq which-key-popup-type 'minibuffer)) - (which-key--setup-echo-keystrokes)) - (unless (member prefix-help-command which-key--paging-functions) - (setq which-key--prefix-help-cmd-backup prefix-help-command)) - (when which-key-use-C-h-commands - (setq prefix-help-command #'which-key-C-h-dispatch)) - (when which-key-show-remaining-keys - (add-hook 'pre-command-hook #'which-key--lighter-restore)) - (add-hook 'pre-command-hook #'which-key--hide-popup) - (add-hook 'focus-out-hook #'which-key--stop-timer) - (add-hook 'focus-in-hook #'which-key--start-timer) - (add-hook 'window-configuration-change-hook - 'which-key--hide-popup-on-frame-size-change) - (which-key--start-timer)) - (setq echo-keystrokes which-key--echo-keystrokes-backup) - (when which-key--prefix-help-cmd-backup - (setq prefix-help-command which-key--prefix-help-cmd-backup)) - (when which-key-show-remaining-keys - (remove-hook 'pre-command-hook #'which-key--lighter-restore)) - (remove-hook 'pre-command-hook #'which-key--hide-popup) - (remove-hook 'focus-out-hook #'which-key--stop-timer) - (remove-hook 'focus-in-hook #'which-key--start-timer) - (remove-hook 'window-configuration-change-hook - 'which-key--hide-popup-on-frame-size-change) - (which-key--stop-timer))) - -(defun which-key--init-buffer () - "Initialize which-key buffer" - (unless (buffer-live-p which-key--buffer) - (setq which-key--buffer (get-buffer-create which-key-buffer-name)) - (with-current-buffer which-key--buffer - ;; suppress confusing minibuffer message - (let (message-log-max) - (toggle-truncate-lines 1) - (message "")) - (setq-local cursor-type nil) - (setq-local cursor-in-non-selected-windows nil) - (setq-local mode-line-format nil) - (setq-local word-wrap nil) - (setq-local show-trailing-whitespace nil) - (run-hooks 'which-key-init-buffer-hook)))) - -(defun which-key--setup-echo-keystrokes () - "Reduce `echo-keystrokes' if necessary (it will interfere if -it's set too high)." - (when (and echo-keystrokes - (> (abs (- echo-keystrokes which-key-echo-keystrokes)) 0.000001)) - (if (> which-key-idle-delay which-key-echo-keystrokes) - (setq echo-keystrokes which-key-echo-keystrokes) - (setq which-key-echo-keystrokes (/ (float which-key-idle-delay) 4) - echo-keystrokes which-key-echo-keystrokes)))) - -(defun which-key-remove-default-unicode-chars () - "Use of `which-key-dont-use-unicode' is preferred to this -function, but it's included here in case someone cannot set that -variable early enough in their configuration, if they are using a -starter kit for example." - (when (string-equal which-key-separator " → ") - (setq which-key-separator " : ")) - (setq which-key-key-replacement-alist - (delete '("left" . "←") which-key-key-replacement-alist)) - (setq which-key-key-replacement-alist - (delete '("right" . "→") which-key-key-replacement-alist))) - -;;; Default configuration functions for use by users. - -;;;###autoload -(defun which-key-setup-side-window-right () - "Apply suggested settings for side-window that opens on right." - (interactive) - (setq which-key-popup-type 'side-window - which-key-side-window-location 'right - which-key-show-prefix 'top)) - -;;;###autoload -(defun which-key-setup-side-window-right-bottom () - "Apply suggested settings for side-window that opens on right -if there is space and the bottom otherwise." - (interactive) - (setq which-key-popup-type 'side-window - which-key-side-window-location '(right bottom) - which-key-show-prefix 'top)) - -;;;###autoload -(defun which-key-setup-side-window-bottom () - "Apply suggested settings for side-window that opens on -bottom." - (interactive) - (which-key--setup-echo-keystrokes) - (setq which-key-popup-type 'side-window - which-key-side-window-location 'bottom - which-key-show-prefix 'echo)) - -;;;###autoload -(defun which-key-setup-minibuffer () - "Apply suggested settings for minibuffer. -Do not use this setup if you use the paging commands. Instead use -`which-key-setup-side-window-bottom', which is nearly identical -but more functional." - (interactive) - (which-key--setup-echo-keystrokes) - (setq which-key-popup-type 'minibuffer - which-key-show-prefix 'left)) - -;;; Helper functions to modify replacement lists. - -;;;###autoload -(defun which-key-add-key-based-replacements - (key-sequence replacement &rest more) - "Replace the description of KEY-SEQUENCE with REPLACEMENT. -KEY-SEQUENCE is a string suitable for use in `kbd'. REPLACEMENT -may either be a string, as in - -\(which-key-add-key-based-replacements \"C-x 1\" \"maximize\"\) - -a cons of two strings as in - -\(which-key-add-key-based-replacements \"C-x 8\" - '(\"unicode\" . \"Unicode keys\")\) - -or a function that takes a \(KEY . BINDING\) cons and returns a -replacement. - -In the second case, the second string is used to provide a longer -name for the keys under a prefix. - -MORE allows you to specifcy additional KEY REPLACEMENT pairs. All -replacements are added to -`which-key-key-based-description-replacement-alist'." - ;; TODO: Make interactive - (while key-sequence - ;; normalize key sequences before adding - (let ((key-seq (key-description (kbd key-sequence))) - (replace (or (and (functionp replacement) replacement) - (car-safe replacement) - replacement))) - (push (cons (cons (concat "\\`" (regexp-quote key-seq) "\\'") nil) - (if (functionp replace) replace (cons nil replace))) - which-key-replacement-alist) - (when (and (not (functionp replacement)) (consp replacement)) - (push (cons key-seq (cdr-safe replacement)) - which-key--prefix-title-alist))) - (setq key-sequence (pop more) replacement (pop more)))) -(put 'which-key-add-key-based-replacements 'lisp-indent-function 'defun) - -;;;###autoload -(defun which-key-add-major-mode-key-based-replacements - (mode key-sequence replacement &rest more) - "Functions like `which-key-add-key-based-replacements'. -The difference is that MODE specifies the `major-mode' that must -be active for KEY-SEQUENCE and REPLACEMENT (MORE contains -addition KEY-SEQUENCE REPLACEMENT pairs) to apply." - ;; TODO: Make interactive - (when (not (symbolp mode)) - (error "MODE should be a symbol corresponding to a value of major-mode")) - (let ((mode-alist - (or (cdr-safe (assq mode which-key-replacement-alist)) (list))) - (title-mode-alist - (or (cdr-safe (assq mode which-key--prefix-title-alist)) (list)))) - (while key-sequence - ;; normalize key sequences before adding - (let ((key-seq (key-description (kbd key-sequence))) - (replace (or (and (functionp replacement) replacement) - (car-safe replacement) - replacement))) - (push (cons (cons (concat "\\`" (regexp-quote key-seq) "\\'") nil) - (if (functionp replace) replace (cons nil replace))) - mode-alist) - (when (and (not (functionp replacement)) (consp replacement)) - (push (cons key-seq (cdr-safe replacement)) - title-mode-alist))) - (setq key-sequence (pop more) replacement (pop more))) - (if (assq mode which-key-replacement-alist) - (setcdr (assq mode which-key-replacement-alist) mode-alist) - (push (cons mode mode-alist) which-key-replacement-alist)) - (if (assq mode which-key--prefix-title-alist) - (setcdr (assq mode which-key--prefix-title-alist) title-mode-alist) - (push (cons mode title-mode-alist) which-key--prefix-title-alist)))) -(put 'which-key-add-major-mode-key-based-replacements - 'lisp-indent-function 'defun) - -(defalias 'which-key-add-prefix-title 'which-key-add-key-based-replacements) -(make-obsolete 'which-key-add-prefix-title - 'which-key-add-key-based-replacements - "2016-10-05") - -(defalias 'which-key-declare-prefixes 'which-key-add-key-based-replacements) -(make-obsolete 'which-key-declare-prefixes - 'which-key-add-key-based-replacements - "2016-10-05") - -(defalias 'which-key-declare-prefixes-for-mode - 'which-key-add-major-mode-key-based-replacements) -(make-obsolete 'which-key-declare-prefixes-for-mode - 'which-key-add-major-mode-key-based-replacements - "2016-10-05") - -(defun which-key-define-key-recursively (map key def &optional at-root) - "Recursively bind KEY in MAP to DEF on every level of MAP except the first. -If AT-ROOT is non-nil the binding is also placed at the root of MAP." - (when at-root (define-key map key def)) - (map-keymap - (lambda (_ev df) - (when (keymapp df) - (which-key-define-key-recursively df key def t))) - map)) - -(defun which-key--process-define-key-args (keymap key def) - "When DEF takes the form (\"DESCRIPTION\". DEF), make sure -which-key uses \"DESCRIPTION\" for this binding. This function is -meant to be used as :before advice for `define-key'." - (with-demoted-errors "Which-key extended define-key error: %s" - (when (and (consp def) - (stringp (car def)) - (symbolp (cdr def))) - (define-key keymap (which-key--pseudo-key key) `(which-key ,def))))) - -(when which-key-enable-extended-define-key - (advice-add #'define-key :before #'which-key--process-define-key-args)) - -;;; Functions for computing window sizes - -(defun which-key--text-width-to-total (text-width) - "Convert window text-width to window total-width. -TEXT-WIDTH is the desired text width of the window. The function -calculates what total width is required for a window in the -selected to have a text-width of TEXT-WIDTH columns. The -calculation considers possible fringes and scroll bars. This -function assumes that the desired window has the same character -width as the frame." - (let ((char-width (frame-char-width))) - (+ text-width - (/ (frame-fringe-width) char-width) - (/ (frame-scroll-bar-width) char-width) - (if (which-key--char-enlarged-p) 1 0) - ;; add padding to account for possible wide (unicode) characters - 3))) - -(defun which-key--total-width-to-text (total-width) - "Convert window total-width to window text-width. -TOTAL-WIDTH is the desired total width of the window. The function calculates -what text width fits such a window. The calculation considers possible fringes -and scroll bars. This function assumes that the desired window has the same -character width as the frame." - (let ((char-width (frame-char-width))) - (- total-width - (/ (frame-fringe-width) char-width) - (/ (frame-scroll-bar-width) char-width) - (if (which-key--char-enlarged-p) 1 0) - ;; add padding to account for possible wide (unicode) characters - 3))) - -(defun which-key--char-enlarged-p (&optional _frame) - (> (frame-char-width) - (/ (float (frame-pixel-width)) (window-total-width (frame-root-window))))) - -(defun which-key--char-reduced-p (&optional _frame) - (< (frame-char-width) - (/ (float (frame-pixel-width)) (window-total-width (frame-root-window))))) - -(defun which-key--char-exact-p (&optional _frame) - (= (frame-char-width) - (/ (float (frame-pixel-width)) (window-total-width (frame-root-window))))) - -(defun which-key--width-or-percentage-to-width (width-or-percentage) - "Return window total width. -If WIDTH-OR-PERCENTAGE is a whole number, return it unchanged. Otherwise, it -should be a percentage (a number between 0 and 1) out of the frame's width. -More precisely, it should be a percentage out of the frame's root window's -total width." - (if (wholenump width-or-percentage) - width-or-percentage - (round (* width-or-percentage (window-total-width (frame-root-window)))))) - -(defun which-key--height-or-percentage-to-height (height-or-percentage) - "Return window total height. -If HEIGHT-OR-PERCENTAGE is a whole number, return it unchanged. Otherwise, it -should be a percentage (a number between 0 and 1) out of the frame's height. -More precisely, it should be a percentage out of the frame's root window's -total height." - (if (wholenump height-or-percentage) - height-or-percentage - (round (* height-or-percentage (window-total-height (frame-root-window)))))) - -(defun which-key--frame-size-changed-p () - "Non-nil if a change in frame size is detected." - (let ((new-size (cons (frame-width) (frame-height)))) - (cond ((null which-key--previous-frame-size) - (setq which-key--previous-frame-size new-size) - nil) - ((not (equal which-key--previous-frame-size new-size)) - (setq which-key--previous-frame-size new-size))))) - -;;; Show/hide which-key buffer - -(defun which-key--hide-popup () - "This function is called to hide the which-key buffer." - (unless (member real-this-command which-key--paging-functions) - (setq which-key--current-page-n nil - which-key--current-prefix nil - which-key--using-top-level nil - which-key--using-show-keymap nil - which-key--using-show-operator-keymap nil - which-key--current-show-keymap-name nil - which-key--prior-show-keymap-args nil - which-key--on-last-page nil) - (when (and which-key-idle-secondary-delay - which-key--secondary-timer-active) - (which-key--start-timer)) - (which-key--lighter-restore) - (cl-case which-key-popup-type - ;; Not necessary to hide minibuffer - ;; (minibuffer (which-key--hide-buffer-minibuffer)) - (side-window (which-key--hide-buffer-side-window)) - (frame (which-key--hide-buffer-frame)) - (custom (funcall which-key-custom-hide-popup-function))))) - -(defun which-key--hide-popup-ignore-command () - "Version of `which-key--hide-popup' without the check of -`real-this-command'." - (cl-case which-key-popup-type - (side-window (which-key--hide-buffer-side-window)) - (frame (which-key--hide-buffer-frame)) - (custom (funcall which-key-custom-hide-popup-function)))) - -(defun which-key--hide-popup-on-frame-size-change () - "Hide which-key popup if the frame is resized (to trigger a new -popup)." - (when (which-key--frame-size-changed-p) - (which-key--hide-popup))) - -(defun which-key--hide-buffer-side-window () - "Hide which-key buffer when side-window popup is used." - (when (buffer-live-p which-key--buffer) - ;; in case which-key buffer was shown in an existing window, `quit-window' - ;; will re-show the previous buffer, instead of closing the window - (quit-windows-on which-key--buffer))) - -(defun which-key--hide-buffer-frame () - "Hide which-key buffer when frame popup is used." - (when (frame-live-p which-key--frame) - (delete-frame which-key--frame))) - -(defun which-key--popup-showing-p () - (window-live-p (get-buffer-window which-key--buffer))) - -(defun which-key--show-popup (act-popup-dim) - "Show the which-key buffer. -ACT-POPUP-DIM includes the dimensions, (height . width) of the -buffer text to be displayed in the popup. Return nil if no window -is shown, or if there is no need to start the closing timer." - (when (and (> (car act-popup-dim) 0) (> (cdr act-popup-dim) 0)) - (cl-case which-key-popup-type - ;; Not called for minibuffer - ;; (minibuffer (which-key--show-buffer-minibuffer act-popup-dim)) - (side-window (which-key--show-buffer-side-window act-popup-dim)) - (frame (which-key--show-buffer-frame act-popup-dim)) - (custom (funcall which-key-custom-show-popup-function act-popup-dim))))) - -(defun which-key--fit-buffer-to-window-horizontally - (&optional window &rest params) - "Slightly modified version of `fit-buffer-to-window'. -Use &rest params because `fit-buffer-to-window' has a different -call signature in different emacs versions" - (let ((fit-window-to-buffer-horizontally t)) - (apply #'fit-window-to-buffer window params))) - -(defun which-key--show-buffer-side-window (act-popup-dim) - "Show which-key buffer when popup type is side-window." - (let* ((height (car act-popup-dim)) - (width (cdr act-popup-dim)) - (alist - (if which-key-allow-imprecise-window-fit - `((window-width . ,(which-key--text-width-to-total width)) - (window-height . ,height) - (side . ,which-key-side-window-location) - (slot . ,which-key-side-window-slot)) - `((window-width . which-key--fit-buffer-to-window-horizontally) - (window-height . (lambda (w) (fit-window-to-buffer w nil 1))) - (side . ,which-key-side-window-location) - (slot . ,which-key-side-window-slot))))) - ;; Previously used `display-buffer-in-major-side-window' here, but - ;; apparently that is meant to be an internal function. See emacs bug #24828 - ;; and advice given there. - (cond - ((eq which-key--multiple-locations t) - ;; possibly want to switch sides in this case so we can't reuse the window - (delete-windows-on which-key--buffer) - (display-buffer-in-side-window which-key--buffer alist)) - ((get-buffer-window which-key--buffer) - (display-buffer-reuse-window which-key--buffer alist)) - (t - (display-buffer-in-side-window which-key--buffer alist))))) - -(defun which-key--show-buffer-frame (act-popup-dim) - "Show which-key buffer when popup type is frame." - (let* (;(orig-window (selected-window)) - (frame-height (+ (car act-popup-dim) - (if (with-current-buffer which-key--buffer - mode-line-format) - 1 - 0))) - ;; without adding 2, frame sometimes isn't wide enough for the buffer. - ;; this is probably because of the fringes. however, setting fringes - ;; sizes to 0 (instead of adding 2) didn't always make the frame wide - ;; enough. don't know why it is so. - (frame-width (+ (cdr act-popup-dim) 2)) - (new-window (if (and (frame-live-p which-key--frame) - (eq which-key--buffer - (window-buffer - (frame-root-window which-key--frame)))) - (which-key--show-buffer-reuse-frame - frame-height frame-width) - (which-key--show-buffer-new-frame - frame-height frame-width)))) - (when new-window - ;; display successful - (setq which-key--frame (window-frame new-window)) - new-window))) - -(defun which-key--show-buffer-new-frame (frame-height frame-width) - "Helper for `which-key--show-buffer-frame'." - (let* ((frame-params `((height . ,frame-height) - (width . ,frame-width) - ;; tell the window manager to respect the given sizes - (user-size . t) - ;; which-key frame doesn't need a minibuffer - (minibuffer . nil) - (name . "which-key") - ;; no need for scroll bars in which-key frame - (vertical-scroll-bars . nil) - ;; (left-fringe . 0) - ;; (right-fringe . 0) - ;; (right-divider-width . 0) - ;; make sure frame is visible - (visibility . t))) - (alist `((pop-up-frame-parameters . ,frame-params))) - (orig-frame (selected-frame)) - (new-window (display-buffer-pop-up-frame which-key--buffer alist))) - (when new-window - ;; display successful - (redirect-frame-focus (window-frame new-window) orig-frame) - new-window))) - -(defun which-key--show-buffer-reuse-frame (frame-height frame-width) - "Helper for `which-key--show-buffer-frame'." - (let ((window - (display-buffer-reuse-window - which-key--buffer `((reusable-frames . ,which-key--frame))))) - (when window - ;; display successful - (set-frame-size (window-frame window) frame-width frame-height) - window))) - -;;; Max dimension of available window functions - -(defun which-key--popup-max-dimensions () - "Dimesion functions should return the maximum possible (height -. width) of the intended popup. SELECTED-WINDOW-WIDTH is the -width of currently active window, not the which-key buffer -window." - (cl-case which-key-popup-type - (minibuffer (which-key--minibuffer-max-dimensions)) - (side-window (which-key--side-window-max-dimensions)) - (frame (which-key--frame-max-dimensions)) - (custom (funcall which-key-custom-popup-max-dimensions-function - (window-width))))) - -(defun which-key--minibuffer-max-dimensions () - "Return max-dimensions of minibuffer (height . width). -Measured in lines and characters respectively." - (cons - ;; height - (if (floatp max-mini-window-height) - (floor (* (frame-text-lines) - max-mini-window-height)) - max-mini-window-height) - ;; width - (max 0 (- (frame-text-cols) which-key-unicode-correction)))) - -(defun which-key--side-window-max-dimensions () - "Return max-dimensions of the side-window popup (height . -width) in lines and characters respectively." - (cons - ;; height - (if (member which-key-side-window-location '(left right)) - ;; 1 is a kludge to make sure there is no overlap - (- (frame-height) (window-text-height (minibuffer-window)) 1) - ;; (window-mode-line-height which-key--window)) - ;; FIXME: change to something like - ;; (min which-*-height (calculate-max-height)) - (which-key--height-or-percentage-to-height - which-key-side-window-max-height)) - ;; width - (max 0 - (- (if (member which-key-side-window-location '(left right)) - (which-key--total-width-to-text - (which-key--width-or-percentage-to-width - which-key-side-window-max-width)) - (which-key--total-width-to-text - (which-key--width-or-percentage-to-width - 1.0))) - which-key-unicode-correction)))) - -(defun which-key--frame-max-dimensions () - "Return max-dimensions of the frame popup (height . -width) in lines and characters respectively." - (cons which-key-frame-max-height which-key-frame-max-width)) - -;;; Sorting functions - -(defun which-key--string< (a b &optional alpha) - (let* ((da (downcase a)) - (db (downcase b))) - (cond ((string-equal da db) - (if which-key-sort-uppercase-first - (string-lessp a b) - (not (string-lessp a b)))) - (alpha (string-lessp da db)) - (t (string-lessp a b))))) - -(defun which-key--key-description< (a b &optional alpha) - "Sorting function used for `which-key-key-order' and -`which-key-key-order-alpha'." - (save-match-data - (let* ((rngrgxp "^\\([^ ]+\\) \\.\\. [^ ]+") - (a (if (string-match rngrgxp a) (match-string 1 a) a)) - (b (if (string-match rngrgxp b) (match-string 1 b) b)) - (aem? (string-equal a "")) - (bem? (string-equal b "")) - (a1? (= 1 (length a))) - (b1? (= 1 (length b))) - (srgxp "^\\(RET\\|SPC\\|TAB\\|DEL\\|LFD\\|ESC\\|NUL\\)") - (asp? (string-match-p srgxp a)) - (bsp? (string-match-p srgxp b)) - (prrgxp "^\\(M\\|C\\|S\\|A\\|H\\|s\\)-") - (apr? (string-match-p prrgxp a)) - (bpr? (string-match-p prrgxp b)) - (afn? (string-match-p "" a)) - (bfn? (string-match-p "" b))) - (cond ((or aem? bem?) (and aem? (not bem?))) - ((and asp? bsp?) - (if (string-equal (substring a 0 3) (substring b 0 3)) - (which-key--key-description< - (substring a 3) (substring b 3) alpha) - (which-key--string< a b alpha))) - ((or asp? bsp?) asp?) - ((and a1? b1?) (which-key--string< a b alpha)) - ((or a1? b1?) a1?) - ((and afn? bfn?) - (< (string-to-number - (replace-regexp-in-string "" "\\1" a)) - (string-to-number - (replace-regexp-in-string "" "\\1" b)))) - ((or afn? bfn?) afn?) - ((and apr? bpr?) - (if (string-equal (substring a 0 2) (substring b 0 2)) - (which-key--key-description< - (substring a 2) (substring b 2) alpha) - (which-key--string< a b alpha))) - ((or apr? bpr?) apr?) - (t (which-key--string< a b alpha)))))) - -(defsubst which-key-key-order-alpha (acons bcons) - "Order key descriptions A and B. -Order is lexicographic within a \"class\", where the classes and -the ordering of classes are listed below. - -special (SPC,TAB,...) < single char < mod (C-,M-,...) < other. -Sorts single characters alphabetically with lowercase coming -before upper." - (which-key--key-description< (car acons) (car bcons) t)) - -(defsubst which-key-key-order (acons bcons) - "Order key descriptions A and B. -Order is lexicographic within a \"class\", where the classes and -the ordering of classes are listed below. - -special (SPC,TAB,...) < single char < mod (C-,M-,...) < other." - (which-key--key-description< (car acons) (car bcons))) - -(defsubst which-key-description-order (acons bcons) - "Order descriptions of A and B. -Uses `string-lessp' after applying lowercase." - (string-lessp (downcase (cdr acons)) (downcase (cdr bcons)))) - -(defsubst which-key--group-p (description) - (or (string-match-p "^\\(group:\\|Prefix\\)" description) - (keymapp (intern description)))) - -(defun which-key-prefix-then-key-order (acons bcons) - "Order first by whether A and/or B is a prefix with no prefix -coming before a prefix. Within these categories order using -`which-key-key-order'." - (let ((apref? (which-key--group-p (cdr acons))) - (bpref? (which-key--group-p (cdr bcons)))) - (if (not (eq apref? bpref?)) - (and (not apref?) bpref?) - (which-key-key-order acons bcons)))) - -(defun which-key-prefix-then-key-order-reverse (acons bcons) - "Order first by whether A and/or B is a prefix with prefix -coming before a prefix. Within these categories order using -`which-key-key-order'." - (let ((apref? (which-key--group-p (cdr acons))) - (bpref? (which-key--group-p (cdr bcons)))) - (if (not (eq apref? bpref?)) - (and apref? (not bpref?)) - (which-key-key-order acons bcons)))) - -(defun which-key-local-then-key-order (acons bcons) - "Order first by whether A and/or B is a local binding with -local bindings coming first. Within these categories order using -`which-key-key-order'." - (let ((aloc? (which-key--local-binding-p acons)) - (bloc? (which-key--local-binding-p bcons))) - (if (not (eq aloc? bloc?)) - (and aloc? (not bloc?)) - (which-key-key-order acons bcons)))) - -;;; Functions for retrieving and formatting keys - -(defsubst which-key--string-width (maybe-string) - "If MAYBE-STRING is a string use `which-key--string-width' o/w return 0." - (if (stringp maybe-string) (string-width maybe-string) 0)) - -(defsubst which-key--safe-lookup-key (keymap key) - "Version of `lookup-key' that allows KEYMAP to be nil. KEY is not checked." - (when (keymapp keymap) (lookup-key keymap key))) - -(defsubst which-key--butlast-string (str) - (mapconcat #'identity (butlast (split-string str)) " ")) - -(defun which-key--get-replacements (key-binding &optional use-major-mode) - (let ((alist (or (and use-major-mode - (cdr-safe - (assq major-mode which-key-replacement-alist))) - which-key-replacement-alist)) - res case-fold-search) - (catch 'res - (dolist (replacement alist) - ;; these are mode specific ones to ignore. The mode specific case is - ;; handled in the selection of alist - (unless (symbolp (car replacement)) - (let ((key-regexp (caar replacement)) - (binding-regexp (cdar replacement))) - (when (and (or (null key-regexp) - (string-match-p key-regexp - (car key-binding))) - (or (null binding-regexp) - (string-match-p binding-regexp - (cdr key-binding)))) - (push replacement res) - (when (not which-key-allow-multiple-replacements) - (throw 'res res))))))) - (nreverse res))) - -(defun which-key--get-pseudo-binding (key-binding) - (let* ((pseudo-binding - (key-binding (which-key--pseudo-key (kbd (car key-binding)) t))) - (pseudo-binding (when pseudo-binding (cadr pseudo-binding))) - (pseudo-desc (when pseudo-binding (car pseudo-binding))) - (pseudo-def (when pseudo-binding (cdr pseudo-binding))) - (real-def (key-binding (kbd (car key-binding)))) - ;; treat keymaps as if they're nil bindings. This creates the - ;; possibility that we rename the wrong binding but this seems - ;; unlikely. - (real-def (unless (keymapp real-def) real-def))) - (when (and pseudo-binding - (eq pseudo-def real-def)) - (cons (car key-binding) pseudo-desc)))) - -(defun which-key--maybe-replace (key-binding) - "Use `which-key--replacement-alist' to maybe replace KEY-BINDING. -KEY-BINDING is a cons cell of the form \(KEY . BINDING\) each of -which are strings. KEY is of the form produced by `key-binding'." - (let* ((pseudo-binding (which-key--get-pseudo-binding key-binding))) - (if pseudo-binding - pseudo-binding - (let* ((mode-res (which-key--get-replacements key-binding t)) - (all-repls (or mode-res - (which-key--get-replacements key-binding)))) - (dolist (repl all-repls key-binding) - (setq key-binding - (cond ((or (not (consp repl)) (null (cdr repl))) - key-binding) - ((functionp (cdr repl)) - (funcall (cdr repl) key-binding)) - ((consp (cdr repl)) - (cons - (cond ((and (caar repl) (cadr repl)) - (replace-regexp-in-string - (caar repl) (cadr repl) (car key-binding) t)) - ((cadr repl) (cadr repl)) - (t (car key-binding))) - (cond ((and (cdar repl) (cddr repl)) - (replace-regexp-in-string - (cdar repl) (cddr repl) (cdr key-binding) t)) - ((cddr repl) (cddr repl)) - (t (cdr key-binding)))))))))))) - -(defsubst which-key--current-key-list (&optional key-str) - (append (listify-key-sequence which-key--current-prefix) - (when key-str - (listify-key-sequence (kbd key-str))))) - -(defsubst which-key--current-key-string (&optional key-str) - (key-description (which-key--current-key-list key-str))) - -(defun which-key--local-binding-p (keydesc) - (eq (which-key--safe-lookup-key - (current-local-map) (kbd (which-key--current-key-string (car keydesc)))) - (intern (cdr keydesc)))) - -(defun which-key--map-binding-p (map keydesc) - (or - (when (bound-and-true-p evil-state) - (eq (which-key--safe-lookup-key - map - (kbd (which-key--current-key-string - (format "<%s-state> %s" evil-state (car keydesc))))) - (intern (cdr keydesc)))) - (eq (which-key--safe-lookup-key - map (kbd (which-key--current-key-string (car keydesc)))) - (intern (cdr keydesc))))) - -(defun which-key--pseudo-key (key &optional use-current-prefix) - "Replace the last key in the sequence KEY by a special symbol -in order for which-key to allow looking up a description for the key." - (let* ((seq (listify-key-sequence key)) - (final (intern (format "which-key-%s" (key-description (last seq)))))) - (if use-current-prefix - (vconcat (which-key--current-key-list) (list final)) - (vconcat (butlast seq) (list final))))) - -(defun which-key--maybe-get-prefix-title (keys) - "KEYS is a string produced by `key-description'. -A title is possibly returned using -`which-key--prefix-title-alist'. An empty stiring is returned if -no title exists." - (cond - ((not (string-equal keys "")) - (let* ((title-res - (cdr-safe (assoc-string keys which-key--prefix-title-alist))) - (repl-res - (cdr-safe (which-key--maybe-replace (cons keys "")))) - (binding (key-binding (kbd keys))) - (alternate (when (and binding (symbolp binding)) - (symbol-name binding)))) - (cond (title-res title-res) - ((not (string-equal repl-res "")) repl-res) - ((and (eq which-key-show-prefix 'echo) alternate) - alternate) - ((and (member which-key-show-prefix '(bottom top)) - (eq which-key-side-window-location 'bottom) - echo-keystrokes) - (if alternate alternate - (concat "Following " keys))) - (t "")))) - (which-key--using-top-level which-key--using-top-level) - (which-key--current-show-keymap-name - which-key--current-show-keymap-name) - (t ""))) - -(defun which-key--propertize (string &rest properties) - "Version of `propertize' that checks type of STRING." - (when (stringp string) - (apply #'propertize string properties))) - -(defun which-key--propertize-key (key) - "Add a face to KEY. -If KEY contains any \"special keys\" defined in -`which-key-special-keys' then truncate and add the corresponding -`which-key-special-key-face'." - (let ((key-w-face (which-key--propertize key 'face 'which-key-key-face)) - (regexp (concat "\\(" - (mapconcat 'identity which-key-special-keys - "\\|") "\\)")) - case-fold-search) - (save-match-data - (if (and which-key-special-keys - (string-match regexp key)) - (let ((beg (match-beginning 0)) (end (match-end 0))) - (concat (substring key-w-face 0 beg) - (which-key--propertize (substring key-w-face beg (1+ beg)) - 'face 'which-key-special-key-face) - (substring key-w-face end - (which-key--string-width key-w-face)))) - key-w-face)))) - -(defsubst which-key--truncate-description (desc) - "Truncate DESC description to `which-key-max-description-length'." - (let* ((last-face (get-text-property (1- (length desc)) 'face desc)) - (dots (which-key--propertize ".." 'face last-face))) - (if (and which-key-max-description-length - (> (length desc) which-key-max-description-length)) - (concat (substring desc 0 which-key-max-description-length) dots) - desc))) - -(defun which-key--highlight-face (description) - "Return the highlight face for DESCRIPTION if it has one." - (let (face) - (dolist (el which-key-highlighted-command-list) - (unless face - (cond ((consp el) - (when (string-match-p (car el) description) - (setq face (cdr el)))) - ((stringp el) - (when (string-match-p el description) - (setq face 'which-key-highlighted-command-face))) - (t - (message "which-key: warning: element %s of \ -which-key-highlighted-command-list is not a string or a cons -cell" el))))) - face)) - -(defun which-key--propertize-description - (description group local hl-face &optional original-description) - "Add face to DESCRIPTION where the face chosen depends on -whether the description represents a group or a command. Also -make some minor adjustments to the description string, like -removing a \"group:\" prefix. - -ORIGINAL-DESCRIPTION is the description given by -`describe-buffer-bindings'." - (when description - (let* ((desc description) - (desc (if (string-match-p "^group:" desc) - (substring desc 6) desc)) - (desc (if group (concat which-key-prefix-prefix desc) desc))) - (make-text-button - desc nil - 'face (cond (hl-face hl-face) - (group 'which-key-group-description-face) - (local 'which-key-local-map-description-face) - (t 'which-key-command-description-face)) - 'help-echo (cond - ((and original-description - (fboundp (intern original-description)) - (documentation (intern original-description)) - ;; tooltip-mode doesn't exist in emacs-nox - (boundp 'tooltip-mode) tooltip-mode) - (documentation (intern original-description))) - ((and original-description - (fboundp (intern original-description)) - (documentation (intern original-description)) - (let* ((doc (documentation - (intern original-description))) - (str (replace-regexp-in-string "\n" " " doc)) - (max (floor (* (frame-width) 0.8)))) - (if (> (length str) max) - (concat (substring str 0 max) "...") - str)))))) - desc))) - -(defun which-key--extract-key (key-str) - "Pull the last key (or key range) out of KEY-STR." - (save-match-data - (let ((key-range-regexp "\\`.*\\([^ \t]+ \\.\\. [^ \t]+\\)\\'")) - (if (string-match key-range-regexp key-str) - (match-string 1 key-str) - (car (last (split-string key-str " "))))))) - -(defun which-key--maybe-add-docstring (current original) - "Maybe concat a docstring to CURRENT and return result. -Specifically, do this if ORIGINAL is a command with a docstring -and `which-key-show-docstrings' is non-nil. If -`which-key-show-docstrings' is the symbol docstring-only, just -return the docstring." - (let* ((orig-sym (intern original)) - (doc (when (commandp orig-sym) - (documentation orig-sym))) - (docstring (when doc - (which-key--propertize (car (split-string doc "\n")) - 'face 'which-key-docstring-face)))) - (cond ((not (and which-key-show-docstrings docstring)) - current) - ((eq which-key-show-docstrings 'docstring-only) - docstring) - (t - (format "%s %s" current docstring))))) - -(defun which-key--format-and-replace (unformatted) - "Take a list of (key . desc) cons cells in UNFORMATTED, add -faces and perform replacements according to the three replacement -alists. Returns a list (key separator description)." - (let ((sep-w-face - (which-key--propertize which-key-separator - 'face 'which-key-separator-face)) - (local-map (current-local-map)) - new-list) - (dolist (key-binding unformatted) - (let* ((key (car key-binding)) - (orig-desc (cdr key-binding)) - (group (which-key--group-p orig-desc)) - ;; At top-level prefix is nil - (keys (if which-key--current-prefix - (concat (which-key--current-key-string) " " key) - key)) - (local (eq (which-key--safe-lookup-key local-map (kbd keys)) - (intern orig-desc))) - (hl-face (which-key--highlight-face orig-desc)) - (key-binding (which-key--maybe-replace (cons keys orig-desc))) - (final-desc (which-key--propertize-description - (cdr key-binding) group local hl-face orig-desc))) - (when final-desc - (setq final-desc - (which-key--truncate-description - (which-key--maybe-add-docstring final-desc orig-desc)))) - (when (consp key-binding) - (push - (list (which-key--propertize-key - (which-key--extract-key (car key-binding))) - sep-w-face - final-desc) - new-list)))) - (nreverse new-list))) - -(defun which-key--get-keymap-bindings (keymap) - "Retrieve top-level bindings from KEYMAP." - (let (bindings) - (map-keymap - (lambda (ev def) - (cl-pushnew - (cons (key-description (list ev)) - (cond ((keymapp def) "Prefix Command") - ((symbolp def) (copy-sequence (symbol-name def))) - ((eq 'lambda (car-safe def)) "lambda") - (t (format "%s" def)))) - bindings :test (lambda (a b) (string= (car a) (car b))))) - keymap) - bindings)) - -(defun which-key--compute-binding (binding) - "Replace BINDING with remapped binding if it exists. - -Requires `which-key-compute-remaps' to be non-nil" - (let (remap) - (if (and which-key-compute-remaps - (setq remap (command-remapping (intern binding)))) - (copy-sequence (symbol-name remap)) - binding))) - -(defun which-key--get-current-bindings () - "Generate a list of current active bindings." - (let ((key-str-qt (regexp-quote (key-description which-key--current-prefix))) - (buffer (current-buffer)) - (ignore-bindings '("self-insert-command" "ignore" - "ignore-event" "company-ignore")) - (ignore-keys-regexp - (eval-when-compile - (regexp-opt '("mouse-" "wheel-" "remap" "drag-" "scroll-bar" - "select-window" "switch-frame" "-state" - "which-key-")))) - (ignore-sections-regexp - (eval-when-compile - (regexp-opt '("Key translations" "Function key map translations" - "Input decoding map translations"))))) - (with-temp-buffer - (setq-local indent-tabs-mode t) - (setq-local tab-width 8) - (describe-buffer-bindings buffer which-key--current-prefix) - (goto-char (point-min)) - (let ((header-p (not (= (char-after) ?\f))) - bindings header) - (while (not (eobp)) - (cond - (header-p - (setq header (buffer-substring-no-properties - (point) - (line-end-position))) - (setq header-p nil) - (forward-line 3)) - ((= (char-after) ?\f) - (setq header-p t)) - ((looking-at "^[ \t]*$")) - ((or (not (string-match-p ignore-sections-regexp header)) - which-key--current-prefix) - (let ((binding-start (save-excursion - (and (re-search-forward "\t+" nil t) - (match-end 0)))) - key binding) - (when binding-start - (setq key (buffer-substring-no-properties - (point) binding-start)) - (setq binding (buffer-substring-no-properties - binding-start - (line-end-position))) - (save-match-data - (cond - ((member binding ignore-bindings)) - ((string-match-p ignore-keys-regexp key)) - ((and which-key--current-prefix - (string-match (format "^%s[ \t]\\([^ \t]+\\)[ \t]+$" - key-str-qt) key)) - (unless (assoc-string (match-string 1 key) bindings) - (push (cons (match-string 1 key) - (which-key--compute-binding binding)) - bindings))) - ((and which-key--current-prefix - (string-match - (format - "^%s[ \t]\\([^ \t]+\\) \\.\\. %s[ \t]\\([^ \t]+\\)[ \t]+$" - key-str-qt key-str-qt) key)) - (let ((stripped-key (concat (match-string 1 key) - " \.\. " - (match-string 2 key)))) - (unless (assoc-string stripped-key bindings) - (push (cons stripped-key - (which-key--compute-binding binding)) - bindings)))) - ((string-match - "^\\([^ \t]+\\|[^ \t]+ \\.\\. [^ \t]+\\)[ \t]+$" key) - (unless (assoc-string (match-string 1 key) bindings) - (push (cons (match-string 1 key) - (which-key--compute-binding binding)) - bindings))))))))) - (forward-line)) - (nreverse bindings))))) - -(defun which-key--get-formatted-key-bindings (&optional bindings filter) - "Uses `describe-buffer-bindings' to collect the key bindings in -BUFFER that follow the key sequence KEY-SEQ." - (let* ((unformatted (if bindings bindings (which-key--get-current-bindings)))) - (when filter - (setq unformatted (cl-remove-if-not filter unformatted))) - (when which-key-sort-order - (setq unformatted - (sort unformatted which-key-sort-order))) - (which-key--format-and-replace unformatted))) - -;;; Functions for laying out which-key buffer pages - -(defun which-key--normalize-columns (columns) - "Pad COLUMNS to the same length using empty strings." - (let ((max-len (cl-reduce (lambda (a x) (max a (length x))) columns - :initial-value 0))) - (mapcar - (lambda (c) - (if (< (length c) max-len) - (append c (make-list (- max-len (length c)) "")) - c)) - columns))) - -(defsubst which-key--join-columns (columns) - "Transpose columns into rows, concat rows into lines and rows into page." - (let* ((padded (which-key--normalize-columns (nreverse columns))) - (rows (apply #'cl-mapcar #'list padded))) - (mapconcat (lambda (row) (mapconcat #'identity row " ")) rows "\n"))) - -(defsubst which-key--max-len (keys index) - "Internal function for finding the max length of the INDEX -element in each list element of KEYS." - (cl-reduce - (lambda (x y) (max x (which-key--string-width (nth index y)))) - keys :initial-value 0)) - -(defun which-key--pad-column (col-keys) - "Take a column of (key separator description) COL-KEYS, -calculate the max width in the column and pad all cells out to -that width." - (let* ((col-key-width (+ which-key-add-column-padding - (which-key--max-len col-keys 0))) - (col-sep-width (which-key--max-len col-keys 1)) - (col-desc-width (which-key--max-len col-keys 2)) - (col-width (+ 1 col-key-width col-sep-width col-desc-width))) - (cons col-width - (mapcar (lambda (k) - (format (concat "%" (int-to-string col-key-width) - "s%s%-" (int-to-string col-desc-width) "s") - (nth 0 k) (nth 1 k) (nth 2 k))) - col-keys)))) - -(defun which-key--partition-list (n list) - "Partition LIST into N-sized sublists." - (let (res) - (while list - (setq res (cons (cl-subseq list 0 (min n (length list))) res) - list (nthcdr n list))) - (nreverse res))) - -(defun which-key--list-to-pages (keys avl-lines avl-width) - "Convert list of KEYS to columns based on dimensions AVL-LINES and AVL-WIDTH. -Returns a plist that holds the page strings, as well as -metadata." - (let ((cols-w-widths (mapcar #'which-key--pad-column - (which-key--partition-list avl-lines keys))) - (page-width 0) (n-pages 0) (n-keys 0) (n-columns 0) - page-cols pages page-widths keys/page col) - (if (> (apply #'max (mapcar #'car cols-w-widths)) avl-width) - ;; give up if no columns fit - (list :pages nil :page-height 0 :page-widths '(0) - :keys/page '(0) :n-pages 0 :tot-keys 0) - (while cols-w-widths - ;; start new page - (cl-incf n-pages) - (setq col (pop cols-w-widths)) - (setq page-cols (list (cdr col))) - (setq page-width (car col)) - (setq n-keys (length (cdr col))) - (setq n-columns 1) - ;; add additional columns as long as they fit - (while (and cols-w-widths - (or (null which-key-max-display-columns) - (< n-columns which-key-max-display-columns)) - (<= (+ (caar cols-w-widths) page-width) avl-width)) - (setq col (pop cols-w-widths)) - (push (cdr col) page-cols) - (cl-incf page-width (car col)) - (cl-incf n-keys (length (cdr col))) - (cl-incf n-columns)) - (push (which-key--join-columns page-cols) pages) - (push n-keys keys/page) - (push page-width page-widths)) - (list :pages (nreverse pages) :page-height avl-lines - :page-widths (nreverse page-widths) - :keys/page (reverse keys/page) :n-pages n-pages - :tot-keys (apply #'+ keys/page))))) - -(defun which-key--create-pages-1 - (keys available-lines available-width &optional min-lines vertical) - "Create page strings using `which-key--list-to-pages'. -Will try to find the best number of rows and columns using the -given dimensions and the length and widths of ITEMS. Use VERTICAL -if the ITEMS are laid out vertically and the number of columns -should be minimized." - (let ((result (which-key--list-to-pages - keys available-lines available-width)) - (min-lines (or min-lines 0)) - found prev-result) - (if (or vertical - (> (plist-get result :n-pages) 1) - (= 1 available-lines)) - result - ;; simple search for a fitting page - (while (and (> available-lines min-lines) - (not found)) - (setq available-lines (- available-lines 1) - prev-result result - result (which-key--list-to-pages - keys available-lines available-width) - found (> (plist-get result :n-pages) 1))) - (if found prev-result result)))) - -(defun which-key--create-pages (keys) - "Create page strings using `which-key--list-to-pages'. -Will try to find the best number of rows and columns using the -given dimensions and the length and wdiths of KEYS. SEL-WIN-WIDTH -is the width of the live window." - (let* ((max-dims (which-key--popup-max-dimensions)) - (max-lines (car max-dims)) - (max-width (cdr max-dims)) - (prefix-keys-desc (key-description which-key--current-prefix)) - (full-prefix (which-key--full-prefix prefix-keys-desc)) - (prefix (when (eq which-key-show-prefix 'left) - (+ 2 (which-key--string-width full-prefix)))) - (prefix-top-bottom (member which-key-show-prefix '(bottom top))) - (avl-lines (if prefix-top-bottom (- max-lines 1) max-lines)) - (min-lines (min avl-lines which-key-min-display-lines)) - (avl-width (if prefix (- max-width prefix) max-width)) - (vertical (and (eq which-key-popup-type 'side-window) - (member which-key-side-window-location '(left right))))) - (which-key--create-pages-1 keys avl-lines avl-width min-lines vertical))) - -(defun which-key--lighter-status (page-n) - "Possibly show number of keys and total in the mode line." - (when which-key-show-remaining-keys - (let ((n-shown (nth page-n (plist-get which-key--pages-plist :keys/page))) - (n-tot (plist-get which-key--pages-plist :tot-keys))) - (setcar (cdr (assq 'which-key-mode minor-mode-alist)) - (format " WK: %s/%s keys" n-shown n-tot))))) - -(defun which-key--lighter-restore () - "Restore the lighter for which-key." - (when which-key-show-remaining-keys - (setcar (cdr (assq 'which-key-mode minor-mode-alist)) - which-key-lighter))) - -(defun which-key--echo (text) - "Echo TEXT to minibuffer without logging." - (let (message-log-max) - (message "%s" text))) - -(defun which-key--next-page-hint (prefix-keys) - "Return string for next page hint." - (let* ((paging-key (concat prefix-keys " " which-key-paging-key)) - (paging-key-bound (eq 'which-key-C-h-dispatch - (key-binding (kbd paging-key)))) - (key (if paging-key-bound which-key-paging-key "C-h"))) - (when (and which-key-use-C-h-commands - (or which-key--using-show-operator-keymap - (not (and which-key-allow-evil-operators - (bound-and-true-p evil-this-operator))))) - (which-key--propertize (format "[%s paging/help]" key) - 'face 'which-key-note-face)))) - -(eval-and-compile - (if (fboundp 'universal-argument--description) - (defalias 'which-key--universal-argument--description - 'universal-argument--description) - (defun which-key--universal-argument--description () - ;; Backport of the definition of universal-argument--description in - ;; emacs25 on 2015-12-04 - (when prefix-arg - (concat "C-u" - (pcase prefix-arg - (`(-) " -") - (`(,(and (pred integerp) n)) - (let ((str "")) - (while (and (> n 4) (= (mod n 4) 0)) - (setq str (concat str " C-u")) - (setq n (/ n 4))) - (if (= n 4) str (format " %s" prefix-arg)))) - (_ (format " %s" prefix-arg)))))))) - -(defun which-key--full-prefix (prefix-keys &optional -prefix-arg dont-prop-keys) - "Return a description of the full key sequence up to now, -including prefix arguments." - (let* ((left (eq which-key-show-prefix 'left)) - (prefix-arg (if -prefix-arg -prefix-arg prefix-arg)) - (str (concat - (which-key--universal-argument--description) - (when prefix-arg " ") - prefix-keys)) - (dash (if (and which-key--current-prefix - (null left)) "-" ""))) - (if (or (eq which-key-show-prefix 'echo) dont-prop-keys) - (concat str dash) - (concat (which-key--propertize-key str) - (which-key--propertize dash 'face 'which-key-key-face))))) - -(defun which-key--get-popup-map () - "Generate transient-map for use in the top level binding display." - (unless which-key--current-prefix - (let ((map (make-sparse-keymap))) - (define-key map (kbd which-key-paging-key) #'which-key-C-h-dispatch) - (when which-key-use-C-h-commands - ;; Show next page even when C-h is pressed - (define-key map (kbd "C-h") #'which-key-C-h-dispatch)) - map))) - -(defun which-key--process-page (page-n pages-plist) - "Add information to the basic list of key bindings, including -if applicable the current prefix, the name of the current prefix, -and a page count." - (let* ((page (nth page-n (plist-get pages-plist :pages))) - (height (plist-get pages-plist :page-height)) - (n-pages (plist-get pages-plist :n-pages)) - (prefix-keys (key-description which-key--current-prefix)) - (full-prefix (which-key--full-prefix prefix-keys)) - (nxt-pg-hint (which-key--next-page-hint prefix-keys)) - ;; not used in left case - (status-line - (concat (which-key--propertize (which-key--maybe-get-prefix-title - (which-key--current-key-string)) - 'face 'which-key-note-face) - (when (< 1 n-pages) - (which-key--propertize (format " (%s of %s)" - (1+ page-n) n-pages) - 'face 'which-key-note-face))))) - (pcase which-key-show-prefix - (`left - (let* ((page-cnt (which-key--propertize (format "%s/%s" (1+ page-n) n-pages) - 'face 'which-key-separator-face)) - (first-col-width (+ 2 (max (which-key--string-width full-prefix) - (which-key--string-width page-cnt)))) - (prefix (format (concat "%-" (int-to-string first-col-width) "s") - full-prefix)) - (page-cnt (if (> n-pages 1) - (format - (concat "%-" (int-to-string first-col-width) "s") - page-cnt) - (make-string first-col-width 32))) - lines first-line new-end) - (if (= 1 height) - (cons (concat prefix page) nil) - (setq lines (split-string page "\n") - first-line (concat prefix (car lines) "\n" page-cnt) - new-end (concat "\n" (make-string first-col-width 32))) - (cons - (concat first-line (mapconcat #'identity (cdr lines) new-end)) - nil)))) - (`top - (cons - (concat (when (or (= 0 echo-keystrokes) - (not (eq which-key-side-window-location 'bottom))) - (concat full-prefix " ")) - status-line " " nxt-pg-hint "\n" page) - nil)) - (`bottom - (cons - (concat page "\n" - (when (or (= 0 echo-keystrokes) - (not (eq which-key-side-window-location 'bottom))) - (concat full-prefix " ")) - status-line " " nxt-pg-hint) - nil)) - (`echo - (cons page - (lambda () - (which-key--echo - (concat full-prefix (when prefix-keys " ") - status-line (when status-line " ") - nxt-pg-hint))))) - (`mode-line - (cons page - (lambda () - (with-current-buffer which-key--buffer - (setq-local mode-line-format - (concat " " full-prefix - " " status-line - " " nxt-pg-hint)))))) - (_ (cons page nil))))) - -(defun which-key--show-page (n) - "Show page N, starting from 0." - (which-key--init-buffer) ;; in case it was killed - (let ((n-pages (plist-get which-key--pages-plist :n-pages)) - (prefix-keys (key-description which-key--current-prefix)) - page-n golden-ratio-mode) - (if (= 0 n-pages) - (message "%s- which-key can't show keys: There is not \ -enough space based on your settings and frame size." prefix-keys) - (setq page-n (mod n n-pages)) - (setq which-key--current-page-n page-n) - (when (= n-pages (1+ n)) (setq which-key--on-last-page t)) - (let ((page-echo (which-key--process-page page-n which-key--pages-plist)) - (height (plist-get which-key--pages-plist :page-height)) - (width - (nth page-n (plist-get which-key--pages-plist :page-widths)))) - (which-key--lighter-status page-n) - (if (eq which-key-popup-type 'minibuffer) - (which-key--echo (car page-echo)) - (with-current-buffer which-key--buffer - (erase-buffer) - (insert (car page-echo)) - (goto-char (point-min))) - (when (cdr page-echo) (funcall (cdr page-echo))) - (which-key--show-popup (cons height width))))) - ;; used for paging at top-level - (if (fboundp 'set-transient-map) - (set-transient-map (which-key--get-popup-map)) - (with-no-warnings - (set-temporary-overlay-map (which-key--get-popup-map)))))) - -;;; Paging functions - -;;;###autoload -(defun which-key-reload-key-sequence (&optional key-seq) - "Simulate entering the key sequence KEY-SEQ. -KEY-SEQ should be a list of events as produced by -`listify-key-sequence'. If nil, KEY-SEQ defaults to -`which-key--current-key-list'. Any prefix arguments that were -used are reapplied to the new key sequence." - (let* ((key-seq (or key-seq (which-key--current-key-list))) - (next-event (mapcar (lambda (ev) (cons t ev)) key-seq))) - (setq prefix-arg current-prefix-arg - unread-command-events next-event))) - -(defun which-key-turn-page (delta) - "Show the next page of keys." - (let ((next-page (if which-key--current-page-n - (+ which-key--current-page-n delta) 0))) - (which-key-reload-key-sequence) - (if which-key--last-try-2-loc - (let ((which-key-side-window-location which-key--last-try-2-loc) - (which-key--multiple-locations t)) - (which-key--show-page next-page)) - (which-key--show-page next-page)) - (which-key--start-paging-timer))) - -;;;###autoload -(defun which-key-show-standard-help (&optional _) - "Call the command in `which-key--prefix-help-cmd-backup'. -Usually this is `describe-prefix-bindings'." - (interactive) - (let ((which-key-inhibit t)) - (which-key--hide-popup-ignore-command) - (cond ((eq which-key--prefix-help-cmd-backup - 'describe-prefix-bindings) - ;; This is essentially what `describe-prefix-bindings' does - (describe-bindings - (kbd (which-key--current-key-string)))) - ((functionp which-key--prefix-help-cmd-backup) - (funcall which-key--prefix-help-cmd-backup))))) - -;;;###autoload -(defun which-key-show-next-page-no-cycle () - "Show next page of keys unless on the last page, in which case -call `which-key-show-standard-help'." - (interactive) - (let ((which-key-inhibit t)) - (if (and which-key--current-page-n - which-key--on-last-page) - (which-key-show-standard-help) - (which-key-turn-page 1)))) - -;;;###autoload -(defun which-key-show-previous-page-no-cycle () - "Show previous page of keys unless on the first page, in which -case do nothing." - (interactive) - (let ((which-key-inhibit t)) - (if (and which-key--current-page-n - (eq which-key--current-page-n 0)) - (which-key-turn-page 0) - (which-key-turn-page -1)))) - -;;;###autoload -(defun which-key-show-next-page-cycle (&optional _) - "Show the next page of keys, cycling from end to beginning -after last page." - (interactive) - (let ((which-key-inhibit t)) - (which-key-turn-page 1))) - -;;;###autoload -(defun which-key-show-previous-page-cycle (&optional _) - "Show the previous page of keys, cycling from beginning to end -after first page." - (interactive) - (let ((which-key-inhibit t)) - (which-key-turn-page -1))) - -;;;###autoload -(defun which-key-show-top-level (&optional _) - "Show top-level bindings." - (interactive) - (setq which-key--using-top-level "Top-level bindings") - (which-key--create-buffer-and-show nil)) - -;;;###autoload -(defun which-key-show-major-mode () - "Show top-level bindings in the map of the current major mode. - -This function will also detect evil bindings made using -`evil-define-key' in this map. These bindings will depend on the -current evil state. " - (interactive) - (setq which-key--using-top-level "Major-mode bindings") - (let ((map-sym (intern (format "%s-map" major-mode)))) - (if (and (boundp map-sym) (keymapp (symbol-value map-sym))) - (which-key--create-buffer-and-show - nil nil (apply-partially #'which-key--map-binding-p (symbol-value map-sym))) - (message "which-key: No map named %s" map-sym)))) - -;;;###autoload -(defun which-key-undo-key (&optional _) - "Undo last keypress and force which-key update." - (interactive) - (let* ((key-lst (butlast (which-key--current-key-list))) - (which-key-inhibit t)) - (cond ((stringp which-key--current-show-keymap-name) - (if (keymapp (cdr (car-safe which-key--prior-show-keymap-args))) - (let ((args (pop which-key--prior-show-keymap-args))) - (which-key--show-keymap (car args) (cdr args))) - (which-key--hide-popup))) - (key-lst - (which-key-reload-key-sequence key-lst) - (which-key--create-buffer-and-show (apply #'vector key-lst))) - (t (which-key-show-top-level))))) -(defalias 'which-key-undo 'which-key-undo-key) - -(defun which-key-abort (&optional _) - "Abort key sequence." - (interactive) - (let ((which-key-inhibit t)) - (which-key--hide-popup-ignore-command) - (keyboard-quit))) - -(defun which-key-digit-argument (key) - "Version of `digit-argument' for use in `which-key-C-h-map'." - (interactive) - (let ((last-command-event (string-to-char key))) - (digit-argument key)) - (let ((current-prefix-arg prefix-arg)) - (which-key-reload-key-sequence))) - -;;;###autoload -(defun which-key-C-h-dispatch () - "Dispatch C-h commands by looking up key in -`which-key-C-h-map'. This command is always accessible (from any -prefix) if `which-key-use-C-h-commands' is non nil." - (interactive) - (if (not (which-key--popup-showing-p)) - (which-key-show-standard-help) - (let* ((prefix-keys (key-description which-key--current-prefix)) - (full-prefix (which-key--full-prefix prefix-keys current-prefix-arg t)) - (prompt (concat (when (string-equal prefix-keys "") - (which-key--propertize - (concat " " - (or which-key--current-show-keymap-name - "Top-level bindings")) - 'face 'which-key-note-face)) - full-prefix - (which-key--propertize - (substitute-command-keys - (concat - " \\" - " \\[which-key-show-next-page-cycle]" - which-key-separator "next-page," - " \\[which-key-show-previous-page-cycle]" - which-key-separator "previous-page," - " \\[which-key-undo-key]" - which-key-separator "undo-key," - " \\[which-key-show-standard-help]" - which-key-separator "help," - " \\[which-key-abort]" - which-key-separator "abort" - " 1..9" - which-key-separator "digit-arg")) - 'face 'which-key-note-face))) - (key (string (read-key prompt))) - (cmd (lookup-key which-key-C-h-map key)) - (which-key-inhibit t)) - (if cmd (funcall cmd key) (which-key-turn-page 0))))) - -;;; Update - -(defun which-key--any-match-p (regexps string) - "Non-nil if any of REGEXPS match STRING." - (catch 'match - (dolist (regexp regexps) - (when (string-match-p regexp string) - (throw 'match t))))) - -(defun which-key--try-2-side-windows (keys page-n loc1 loc2 &rest _ignore) - "Try to show KEYS (PAGE-N) in LOC1 first. - -Only if no keys fit fallback to LOC2." - (let (pages1) - (let ((which-key-side-window-location loc1) - (which-key--multiple-locations t)) - (setq pages1 (which-key--create-pages keys))) - (if (< 0 (plist-get pages1 :n-pages)) - (progn - (setq which-key--pages-plist pages1) - (let ((which-key-side-window-location loc1) - (which-key--multiple-locations t)) - (which-key--show-page page-n)) - loc1) - (let ((which-key-side-window-location loc2) - (which-key--multiple-locations t)) - (setq which-key--pages-plist - (which-key--create-pages keys)) - (which-key--show-page page-n) - loc2)))) - -(defun which-key-show-keymap () - "Show the top-level bindings in KEYMAP using which-key. KEYMAP -is selected interactively from all available keymaps." - (interactive) - (let ((keymap-sym (intern - (completing-read - "Keymap: " obarray - (lambda (m) - (and (boundp m) - (keymapp (symbol-value m)) - (not (equal (symbol-value m) - (make-sparse-keymap))))) - t nil 'which-key-keymap-history)))) - (which-key--show-keymap (symbol-name keymap-sym) - (symbol-value keymap-sym)))) - -(defun which-key-show-minor-mode-keymap () - "Show the top-level bindings in KEYMAP using which-key. KEYMAP -is selected interactively by mode in `minor-mode-map-alist'." - (interactive) - (let ((mode-sym - (intern - (completing-read - "Minor Mode: " - (mapcar 'car - (cl-remove-if-not - (lambda (entry) - (and (symbol-value (car entry)) - (not (equal (cdr entry) (make-sparse-keymap))))) - minor-mode-map-alist)) - nil t nil 'which-key-keymap-history)))) - (which-key--show-keymap (symbol-name mode-sym) - (cdr (assq mode-sym minor-mode-map-alist))))) - -(defun which-key--show-keymap (keymap-name keymap &optional prior-args) - (setq which-key--current-prefix nil - which-key--current-show-keymap-name keymap-name - which-key--using-show-keymap t) - (when prior-args (push prior-args which-key--prior-show-keymap-args)) - (when (keymapp keymap) - (let ((formatted-keys (which-key--get-formatted-key-bindings - (which-key--get-keymap-bindings keymap)))) - (cond ((= (length formatted-keys) 0) - (message "which-key: Keymap empty")) - ((listp which-key-side-window-location) - (setq which-key--last-try-2-loc - (apply #'which-key--try-2-side-windows - formatted-keys 0 which-key-side-window-location))) - (t (setq which-key--pages-plist - (which-key--create-pages formatted-keys)) - (which-key--show-page 0))))) - (let* ((key (key-description (list (read-key)))) - (next-def (lookup-key keymap (kbd key)))) - (cond ((and which-key-use-C-h-commands (string= "C-h" key)) - (which-key-C-h-dispatch)) - ((keymapp next-def) - (which-key--hide-popup-ignore-command) - (which-key--show-keymap (concat keymap-name " " key) next-def - (cons keymap-name keymap))) - (t (which-key--hide-popup))))) - -(defun which-key--evil-operator-filter (binding) - (let ((def (intern (cdr binding)))) - (and (functionp def) - (not (evil-get-command-property def :suppress-operator))))) - -(defun which-key--show-evil-operator-keymap () - (if which-key--inhibit-next-operator-popup - (setq which-key--inhibit-next-operator-popup nil) - (let ((keymap - (make-composed-keymap (list evil-operator-shortcut-map - evil-operator-state-map - evil-motion-state-map)))) - (setq which-key--current-prefix nil - which-key--current-show-keymap-name "evil operator/motion keys" - which-key--using-show-operator-keymap t) - (when (keymapp keymap) - (let ((formatted-keys (which-key--get-formatted-key-bindings - (which-key--get-keymap-bindings keymap) - #'which-key--evil-operator-filter))) - (cond ((= (length formatted-keys) 0) - (message "which-key: Keymap empty")) - ((listp which-key-side-window-location) - (setq which-key--last-try-2-loc - (apply #'which-key--try-2-side-windows - formatted-keys 0 which-key-side-window-location))) - (t (setq which-key--pages-plist - (which-key--create-pages formatted-keys)) - (which-key--show-page 0))))) - (let* ((key (key-description (list (read-key))))) - (when (string= key "`") - ;; evil-goto-mark reads the next char manually - (setq which-key--inhibit-next-operator-popup t)) - (cond ((and which-key-use-C-h-commands (string= "C-h" key)) - (which-key-C-h-dispatch)) - ((string= key "ESC") - (which-key--hide-popup) - (keyboard-quit)) - (t - (which-key--hide-popup) - (setq unread-command-events (listify-key-sequence key)))))))) - -(defun which-key--create-buffer-and-show (&optional prefix-keys from-keymap filter) - "Fill `which-key--buffer' with key descriptions and reformat. -Finally, show the buffer." - (setq which-key--current-prefix prefix-keys - which-key--last-try-2-loc nil) - (let ((start-time (when which-key--debug (current-time))) - (formatted-keys (which-key--get-formatted-key-bindings - (when from-keymap - (which-key--get-keymap-bindings from-keymap)) - filter)) - (prefix-keys (key-description which-key--current-prefix))) - (cond ((= (length formatted-keys) 0) - (message "%s- which-key: There are no keys to show" prefix-keys)) - ((listp which-key-side-window-location) - (setq which-key--last-try-2-loc - (apply #'which-key--try-2-side-windows - formatted-keys 0 which-key-side-window-location))) - (t (setq which-key--pages-plist - (which-key--create-pages formatted-keys)) - (which-key--show-page 0))) - (when which-key--debug - (message "On prefix \"%s\" which-key took %.0f ms." prefix-keys - (* 1000 (float-time (time-since start-time))))))) - -(defun which-key--update () - "Function run by timer to possibly trigger -`which-key--create-buffer-and-show'." - (let ((prefix-keys (this-single-command-keys)) - delay-time) - (when (and (equal prefix-keys [key-chord]) - (bound-and-true-p key-chord-mode)) - (setq prefix-keys - (condition-case nil - (let ((rkeys (recent-keys))) - (vector 'key-chord - ;; Take the two preceding the last one, because the - ;; read-event call in key-chord seems to add a - ;; spurious key press to this list. Note this is - ;; different from guide-key's method which didn't work - ;; for me. - (aref rkeys (- (length rkeys) 3)) - (aref rkeys (- (length rkeys) 2)))) - (error (progn - (message "which-key error in key-chord handling") - [key-chord]))))) - (when (and which-key--god-mode-support-enabled - (bound-and-true-p god-local-mode) - (eq this-command 'god-mode-self-insert)) - (setq prefix-keys (when which-key--god-mode-key-string - (kbd which-key--god-mode-key-string)))) - (cond ((and (> (length prefix-keys) 0) - (or (keymapp (key-binding prefix-keys)) - ;; Some keymaps are stored here like iso-transl-ctl-x-8-map - (keymapp (which-key--safe-lookup-key - key-translation-map prefix-keys)) - ;; just in case someone uses one of these - (keymapp (which-key--safe-lookup-key - function-key-map prefix-keys))) - (not which-key-inhibit) - (or (null which-key-allow-regexps) - (which-key--any-match-p - which-key-allow-regexps (key-description prefix-keys))) - (or (null which-key-inhibit-regexps) - (not - (which-key--any-match-p - which-key-inhibit-regexps (key-description prefix-keys)))) - ;; Do not display the popup if a command is currently being - ;; executed - (or (and which-key-allow-evil-operators - (bound-and-true-p evil-this-operator)) - (and which-key--god-mode-support-enabled - (bound-and-true-p god-local-mode) - (eq this-command 'god-mode-self-insert)) - (null this-command))) - (when (and (not (equal prefix-keys which-key--current-prefix)) - (or (null which-key-delay-functions) - (null (setq delay-time - (run-hook-with-args-until-success - 'which-key-delay-functions - (key-description prefix-keys) - (length prefix-keys)))) - (sit-for delay-time))) - (which-key--create-buffer-and-show prefix-keys) - (when (and which-key-idle-secondary-delay - (not which-key--secondary-timer-active)) - (which-key--start-timer which-key-idle-secondary-delay t)))) - ((and which-key-show-transient-maps - (keymapp overriding-terminal-local-map) - ;; basic test for it being a hydra - (not (eq (lookup-key overriding-terminal-local-map "\C-u") - 'hydra--universal-argument))) - (which-key--create-buffer-and-show - nil overriding-terminal-local-map)) - ((and which-key-show-operator-state-maps - (bound-and-true-p evil-state) - (eq evil-state 'operator) - (not which-key--using-show-operator-keymap)) - (which-key--show-evil-operator-keymap)) - ((and which-key--current-page-n - (not which-key--using-top-level) - (not which-key--using-show-operator-keymap) - (not which-key--using-show-keymap)) - (which-key--hide-popup))))) - -;;; Timers - -(defun which-key--start-timer (&optional delay secondary) - "Activate idle timer to trigger `which-key--update'." - (which-key--stop-timer) - (setq which-key--secondary-timer-active secondary) - (setq which-key--timer - (run-with-idle-timer - (if delay - delay - which-key-idle-delay) t #'which-key--update))) - -(defun which-key--stop-timer () - "Deactivate idle timer for `which-key--update'." - (when which-key--timer (cancel-timer which-key--timer))) - -(defun which-key--start-paging-timer () - "Activate timer to restart which-key after paging." - (when which-key--paging-timer (cancel-timer which-key--paging-timer)) - (which-key--stop-timer) - (setq which-key--paging-timer - (run-with-idle-timer - 0.2 t (lambda () - (when (or (not (member real-last-command - which-key--paging-functions)) - (and (< 0 (length (this-single-command-keys))) - (not (equal which-key--current-prefix - (this-single-command-keys))))) - (setq which-key--current-page-n nil - which-key--on-last-page nil) - (cancel-timer which-key--paging-timer) - (which-key--start-timer)))))) - -(provide 'which-key) -;;; which-key.el ends here diff --git a/elpa/which-key-20180131.606/which-key.elc b/elpa/which-key-20180131.606/which-key.elc deleted file mode 100644 index 2625744..0000000 Binary files a/elpa/which-key-20180131.606/which-key.elc and /dev/null differ diff --git a/elpa/which-key-20180608.551/which-key-autoloads.el b/elpa/which-key-20180608.551/which-key-autoloads.el deleted file mode 100644 index 2b0d02b..0000000 --- a/elpa/which-key-20180608.551/which-key-autoloads.el +++ /dev/null @@ -1,171 +0,0 @@ -;;; which-key-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "which-key" "which-key.el" (23330 5950 0 0)) -;;; Generated autoloads from which-key.el - -(defvar which-key-mode nil "\ -Non-nil if Which-Key mode is enabled. -See the `which-key-mode' command -for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `which-key-mode'.") - -(custom-autoload 'which-key-mode "which-key" nil) - -(autoload 'which-key-mode "which-key" "\ -Toggle which-key-mode. - -\(fn &optional ARG)" t nil) - -(autoload 'which-key-setup-side-window-right "which-key" "\ -Apply suggested settings for side-window that opens on right. - -\(fn)" t nil) - -(autoload 'which-key-setup-side-window-right-bottom "which-key" "\ -Apply suggested settings for side-window that opens on right -if there is space and the bottom otherwise. - -\(fn)" t nil) - -(autoload 'which-key-setup-side-window-bottom "which-key" "\ -Apply suggested settings for side-window that opens on -bottom. - -\(fn)" t nil) - -(autoload 'which-key-setup-minibuffer "which-key" "\ -Apply suggested settings for minibuffer. -Do not use this setup if you use the paging commands. Instead use -`which-key-setup-side-window-bottom', which is nearly identical -but more functional. - -\(fn)" t nil) - -(autoload 'which-key-add-key-based-replacements "which-key" "\ -Replace the description of KEY-SEQUENCE with REPLACEMENT. -KEY-SEQUENCE is a string suitable for use in `kbd'. REPLACEMENT -may either be a string, as in - -\(which-key-add-key-based-replacements \"C-x 1\" \"maximize\") - -a cons of two strings as in - -\(which-key-add-key-based-replacements \"C-x 8\" - '(\"unicode\" . \"Unicode keys\")) - -or a function that takes a (KEY . BINDING) cons and returns a -replacement. - -In the second case, the second string is used to provide a longer -name for the keys under a prefix. - -MORE allows you to specifcy additional KEY REPLACEMENT pairs. All -replacements are added to -`which-key-key-based-description-replacement-alist'. - -\(fn KEY-SEQUENCE REPLACEMENT &rest MORE)" nil nil) - -(autoload 'which-key-add-major-mode-key-based-replacements "which-key" "\ -Functions like `which-key-add-key-based-replacements'. -The difference is that MODE specifies the `major-mode' that must -be active for KEY-SEQUENCE and REPLACEMENT (MORE contains -addition KEY-SEQUENCE REPLACEMENT pairs) to apply. - -\(fn MODE KEY-SEQUENCE REPLACEMENT &rest MORE)" nil nil) - -(autoload 'which-key-reload-key-sequence "which-key" "\ -Simulate entering the key sequence KEY-SEQ. -KEY-SEQ should be a list of events as produced by -`listify-key-sequence'. If nil, KEY-SEQ defaults to -`which-key--current-key-list'. Any prefix arguments that were -used are reapplied to the new key sequence. - -\(fn &optional KEY-SEQ)" nil nil) - -(autoload 'which-key-show-standard-help "which-key" "\ -Call the command in `which-key--prefix-help-cmd-backup'. -Usually this is `describe-prefix-bindings'. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-next-page-no-cycle "which-key" "\ -Show next page of keys unless on the last page, in which case -call `which-key-show-standard-help'. - -\(fn)" t nil) - -(autoload 'which-key-show-previous-page-no-cycle "which-key" "\ -Show previous page of keys unless on the first page, in which -case do nothing. - -\(fn)" t nil) - -(autoload 'which-key-show-next-page-cycle "which-key" "\ -Show the next page of keys, cycling from end to beginning -after last page. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-previous-page-cycle "which-key" "\ -Show the previous page of keys, cycling from beginning to end -after first page. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-top-level "which-key" "\ -Show top-level bindings. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-major-mode "which-key" "\ -Show top-level bindings in the map of the current major mode. - -This function will also detect evil bindings made using -`evil-define-key' in this map. These bindings will depend on the -current evil state. - -\(fn)" t nil) - -(autoload 'which-key-undo-key "which-key" "\ -Undo last keypress and force which-key update. - -\(fn &optional _)" t nil) - -(autoload 'which-key-C-h-dispatch "which-key" "\ -Dispatch C-h commands by looking up key in -`which-key-C-h-map'. This command is always accessible (from any -prefix) if `which-key-use-C-h-commands' is non nil. - -\(fn)" t nil) - -(autoload 'which-key-show-keymap "which-key" "\ -Show the top-level bindings in KEYMAP using which-key. KEYMAP -is selected interactively from all available keymaps. - -\(fn KEYMAP)" t nil) - -(autoload 'which-key-show-full-keymap "which-key" "\ -Show all bindings in KEYMAP using which-key. KEYMAP is -selected interactively from all available keymaps. - -\(fn KEYMAP)" t nil) - -(autoload 'which-key-show-minor-mode-keymap "which-key" "\ -Show the top-level bindings in KEYMAP using which-key. KEYMAP -is selected interactively by mode in `minor-mode-map-alist'. - -\(fn)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; which-key-autoloads.el ends here diff --git a/elpa/which-key-20180608.551/which-key-pkg.el b/elpa/which-key-20180608.551/which-key-pkg.el deleted file mode 100644 index a4c4570..0000000 --- a/elpa/which-key-20180608.551/which-key-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "which-key" "20180608.551" "Display available keybindings in popup" '((emacs "24.4")) :commit "a4095e8ee6f932e049cebd90ab41b95b869ce3e4" :url "https://github.com/justbur/emacs-which-key") diff --git a/elpa/which-key-20180608.551/which-key.el b/elpa/which-key-20180608.551/which-key.el deleted file mode 100644 index 7b2586e..0000000 --- a/elpa/which-key-20180608.551/which-key.el +++ /dev/null @@ -1,2632 +0,0 @@ -;;; which-key.el --- Display available keybindings in popup -*- lexical-binding: t; -*- - -;; Copyright (C) 2017 Free Software Foundation, Inc. - -;; Author: Justin Burkett -;; Maintainer: Justin Burkett -;; URL: https://github.com/justbur/emacs-which-key -;; Package-Version: 20180608.551 -;; Version: 3.2.0 -;; Keywords: -;; Package-Requires: ((emacs "24.4")) - -;; 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 . - -;;; Commentary: - -;; which-key provides the minor mode which-key-mode for Emacs. The mode displays -;; the key bindings following your currently entered incomplete command (a -;; prefix) in a popup. For example, after enabling the minor mode if you enter -;; C-x and wait for the default of 1 second the minibuffer will expand with all -;; of the available key bindings that follow C-x (or as many as space allows -;; given your settings). This includes prefixes like C-x 8 which are shown in a -;; different face. Screenshots of what the popup will look like along with -;; information about additional features can be found at -;; https://github.com/justbur/emacs-which-key. -;; - -;;; Code: - -(require 'cl-lib) -(require 'button) -(require 'regexp-opt) - -;; For compiler -(defvar evil-operator-shortcut-map) -(defvar evil-operator-state-map) -(defvar evil-motion-state-map) -(defvar golden-ratio-mode) -(declare-function evil-get-command-property "ext:evil-common.el") - -;;; Options - -(defgroup which-key nil - "Customization options for which-key-mode" - :group 'help - :prefix "which-key-") - -(defcustom which-key-idle-delay 1.0 - "Delay (in seconds) for which-key buffer to popup. A value of zero -might lead to issues, so a non-zero value is recommended -(see https://github.com/justbur/emacs-which-key/issues/134)." - :group 'which-key - :type 'float) - -(defcustom which-key-idle-secondary-delay nil - "Once the which-key buffer shows once for a key sequence reduce -the idle time to this amount (in seconds). This makes it possible -to shorten the delay for subsequent popups in the same key -sequence. The default is for this value to be nil, which disables -this behavior." - :group 'which-key - :type '(choice float (const :tag "Disabled" nil))) - -(defcustom which-key-echo-keystrokes (if (and echo-keystrokes - (> (+ echo-keystrokes 0.01) - which-key-idle-delay)) - (/ (float which-key-idle-delay) 4) - echo-keystrokes) - "Value to use for `echo-keystrokes'. -This only applies if `which-key-popup-type' is minibuffer or -`which-key-show-prefix' is echo. It needs to be less than -`which-key-idle-delay' or else the keystroke echo will erase the -which-key popup." - :group 'which-key - :type 'float) - -(defcustom which-key-max-description-length 27 - "Truncate the description of keys to this length. -Also adds \"..\". If nil, disable any truncation." - :group 'which-key - :type '(choice integer (const :tag "Disable truncation" nil))) - -(defcustom which-key-add-column-padding 0 - "Additional padding (number of spaces) to add to the left of -each key column." - :group 'which-key - :type 'integer) - -(defcustom which-key-unicode-correction 3 - "Correction for wide unicode characters. -Since we measure width in terms of the number of characters, -Unicode characters that are wider than ASCII characters throw off -the calculation for available width in the which-key buffer. This -variable allows you to adjust for the wide unicode characters by -artificially reducing the available width in the buffer. - -The default of 3 means allow for the total extra width -contributed by any wide unicode characters to be up to one -additional ASCII character in the which-key buffer. Increase this -number if you are seeing charaters get cutoff on the right side -of the which-key popup." - :group 'which-key - :type 'integer) - -(defcustom which-key-dont-use-unicode nil - "If non-nil, don't use any unicode characters in default setup." - :group 'which-key - :type 'boolean) - -(defcustom which-key-separator - (if which-key-dont-use-unicode " : " " → ") - "Separator to use between key and description. Default is \" → -\", unless `which-key-dont-use-unicode' is non nil, in which case -the default is \" : \"." - :group 'which-key - :type 'string) - -(defcustom which-key-prefix-prefix "+" - "String to insert in front of prefix commands (i.e., commands -that represent a sub-map). Default is \"+\"." - :group 'which-key - :type 'string) - -(defcustom which-key-compute-remaps nil - "If non-nil, show remapped command if a command has been -remapped given the currently active keymaps." - :group 'which-key - :type 'boolean) - -(defvar which-key-key-replacement-alist nil) -(make-obsolete-variable 'which-key-key-replacement-alist - 'which-key-replacement-alist "2016-11-21") -(defvar which-key-description-replacement-alist nil) -(make-obsolete-variable 'which-key-description-replacement-alist - 'which-key-replacement-alist "2016-11-21") -(defvar which-key-key-based-description-replacement-alist nil) -(make-obsolete-variable 'which-key-key-based-description-replacement-alist - 'which-key-replacement-alist "2016-11-21") - -(defcustom which-key-replacement-alist - (delq nil - `(((nil . "Prefix Command") . (nil . "prefix")) - ((nil . "\\`\\?\\?\\'") . (nil . "lambda")) - ((nil . "which-key-show-next-page-no-cycle") . (nil . "wk next pg")) - ,@(unless which-key-dont-use-unicode - '((("") . ("←")) - (("") . ("→")))) - (("<\\([[:alnum:]-]+\\)>") . ("\\1")))) - "Association list to determine how to manipulate descriptions -of key bindings in the which-key popup. Each element of the list -is a nested cons cell with the format - -\(MATCH CONS . REPLACEMENT\). - -The MATCH CONS determines when a replacement should occur and -REPLACEMENT determines how the replacement should occur. Each may -have the format \(KEY REGEXP . BINDING REGEXP\). For the -replacement to apply the key binding must match both the KEY -REGEXP and the BINDING REGEXP. A value of nil in either position -can be used to match every possibility. The replacement is -performed by using `replace-regexp-in-string' on the KEY REGEXP -from the MATCH CONS and REPLACEMENT when it is a cons cell, and -then similarly for the BINDING REGEXP. A nil value in the BINDING -REGEXP position cancels the replacement. For example, the entry - -\(\(nil . \"Prefix Command\"\) . \(nil . \"prefix\"\)\) - -matches any binding with the descriptions \"Prefix Command\" and -replaces the description with \"prefix\", ignoring the -corresponding key. - -REPLACEMENT may also be a function taking a cons cell -\(KEY . BINDING\) and producing a new corresponding cons cell. - -If REPLACEMENT is anything other than a cons cell \(and non nil\) -the key binding is ignored by which-key. - -Finally, you can multiple replacements to occur for a given key -binding by setting `which-key-allow-multiple-replacements' to a -non-nil value." - :group 'which-key - :type '(alist :key-type (cons (choice regexp (const nil)) - (choice regexp (const nil))) - :value-type (cons (choice string (const nil)) - (choice string (const nil))))) - -(when (bound-and-true-p which-key-key-replacement-alist) - (mapc - (lambda (repl) - (push (cons (cons (car repl) nil) (cons (cdr repl) nil)) - which-key-replacement-alist)) - which-key-key-replacement-alist)) -(when (bound-and-true-p which-key-description-replacement-alist) - (mapc - (lambda (repl) - (push (cons (cons nil (car repl)) (cons nil (cdr repl))) - which-key-replacement-alist)) - which-key-description-replacement-alist)) - -(defcustom which-key-allow-multiple-replacements nil - "Allow a key binding to match and be modified by multiple -elements in `which-key-replacement-alist' if non-nil. When nil, -only the first match is used to perform replacements from -`which-key-replacement-alist'." - :group 'which-key - :type 'boolean) - -(defcustom which-key-show-docstrings nil - "If non-nil, show each command's docstring next to the command -in the which-key buffer. This will only display the docstring up -to the first line break. If you set this variable to the symbol -docstring-only, then the command's name with be omitted. You -probably also want to adjust `which-key-max-description-length' -at the same time if you use this feature." - :group 'which-key - :type '(radio - (const :tag "Do not show docstrings" nil) - (const :tag "Add docstring to command names" t) - (const :tag "Replace command name with docstring" docstring-only))) - -(defcustom which-key-highlighted-command-list '() - "A list of strings and/or cons cells used to highlight certain -commands. If the element is a string, assume it is a regexp -pattern for matching command names and use -`which-key-highlighted-command-face' for any matching names. If -the element is a cons cell, it should take the form (regexp . -face to apply)." - :group 'which-key - :type '(repeat (choice string (cons regexp face)))) - -(defcustom which-key-special-keys '() - "These keys will automatically be truncated to one character -and have `which-key-special-key-face' applied to them. This is -disabled by default. Try this to see the effect. - -\(setq which-key-special-keys '(\"SPC\" \"TAB\" \"RET\" \"ESC\" \"DEL\")\)" - :group 'which-key - :type '(repeat string)) - -(defcustom which-key-buffer-name " *which-key*" - "Name of which-key buffer." - :group 'which-key - :type 'string) - -(defcustom which-key-show-prefix 'echo - "Whether to and where to display the current prefix sequence. -Possible choices are echo for echo area (the default), left, top -and nil. Nil turns the feature off." - :group 'which-key - :type '(radio (const :tag "Left of the keys" left) - (const :tag "In the first line" top) - (const :tag "In the last line" bottom) - (const :tag "In the echo area" echo) - (const :tag "In the mode-line" mode-line) - (const :tag "Hide" nil))) - -(defcustom which-key-popup-type 'side-window - "Supported types are minibuffer, side-window, frame, and custom." - :group 'which-key - :type '(radio (const :tag "Show in minibuffer" minibuffer) - (const :tag "Show in side window" side-window) - (const :tag "Show in popup frame" frame) - (const :tag "Use your custom display functions" custom))) - -(defcustom which-key-min-display-lines 1 - "The minimum number of horizontal lines to display in the - which-key buffer." - :group 'which-key - :type 'integer) - -(defcustom which-key-max-display-columns nil - "The maximum number of columns to display in the which-key -buffer. nil means don't impose a maximum." - :group 'which-key - :type '(choice integer (const :tag "Unbounded" nil))) - -(defcustom which-key-side-window-location 'bottom - "Location of which-key popup when `which-key-popup-type' is side-window. -Should be one of top, bottom, left or right. You can also specify -a list of two locations, like (right bottom). In this case, the -first location is tried. If there is not enough room, the second -location is tried." - :group 'which-key - :type '(radio (const right) - (const bottom) - (const left) - (const top) - (const (right bottom)) - (const (bottom right)))) - -(defcustom which-key-side-window-slot 0 - "The `slot' to use for `display-buffer-in-side-window' when -`which-key-popup-type' is 'side-window. Quoting from the -docstring of `display-buffer-in-side-window', - -‘slot’ if non-nil, specifies the window slot where to display - BUFFER. A value of zero or nil means use the middle slot on - the specified side. A negative value means use a slot - preceding (that is, above or on the left of) the middle slot. - A positive value means use a slot following (that is, below or - on the right of) the middle slot. The default is zero." - :group 'which-key - :type 'integer) - -(defcustom which-key-side-window-max-width 0.333 - "Maximum width of which-key popup when type is side-window and -location is left or right. -This variable can also be a number between 0 and 1. In that case, it denotes -a percentage out of the frame's width." - :group 'which-key - :type 'float) - -(defcustom which-key-side-window-max-height 0.25 - "Maximum height of which-key popup when type is side-window and -location is top or bottom. -This variable can also be a number between 0 and 1. In that case, it denotes -a percentage out of the frame's height." - :group 'which-key - :type 'float) - -(defcustom which-key-frame-max-width 60 - "Maximum width of which-key popup when type is frame." - :group 'which-key - :type 'integer) - -(defcustom which-key-frame-max-height 20 - "Maximum height of which-key popup when type is frame." - :group 'which-key - :type 'integer) - -(defcustom which-key-allow-imprecise-window-fit nil - "If non-nil allow which-key to use a less intensive method of -fitting the popup window to the buffer. If you are noticing lag -when the which-key popup displays turning this on may help. - -See https://github.com/justbur/emacs-which-key/issues/130" - :group 'which-key - :type 'boolean) - -(defcustom which-key-show-remaining-keys nil - "Show remaining keys in last slot, when keys are hidden." - :group 'which-key - :type '(radio (const :tag "Yes" t) - (const :tag "No" nil))) - -(defcustom which-key-sort-order 'which-key-key-order - "If nil, do not resort the output from -`describe-buffer-bindings' which groups by mode. Ordering options -are - -1. `which-key-key-order': by key (default) -2. `which-key-key-order-alpha': by key using alphabetical order -3. `which-key-description-order': by description -4. `which-key-prefix-then-key-order': prefix (no prefix first) then key -5. `which-key-local-then-key-order': local binding then key - -See the README and the docstrings for those functions for more -information." - :group 'which-key - :type '(choice (function-item which-key-key-order) - (function-item which-key-key-order-alpha) - (function-item which-key-description-order) - (function-item which-key-prefix-then-key-order) - (function-item which-key-local-then-key-order))) - -(defcustom which-key-sort-uppercase-first t - "If non-nil, uppercase comes before lowercase in sorting -function chosen in `which-key-sort-order'. Otherwise, the order -is reversed." - :group 'which-key - :type 'boolean) - -(defcustom which-key-paging-prefixes '() - "Enable paging for these prefixes." - :group 'which-key - :type '(repeat string)) - -(defcustom which-key-paging-key "" - "Key to use for changing pages. Bound after each of the -prefixes in `which-key-paging-prefixes'" - :group 'which-key - :type 'string) - -;; (defcustom which-key-undo-key nil -;; "Key (string) to use for undoing keypresses. Bound recursively -;; in each of the maps in `which-key-undo-keymaps'." -;; :group 'which-key -;; :type 'string) - -;; (defcustom which-key-undo-keymaps '() -;; "Keymaps in which to bind `which-key-undo-key'" -;; :group 'which-key -;; :type '(repeat symbol)) - -(defcustom which-key-use-C-h-commands t - "Use C-h for paging if non-nil. Normally C-h after a prefix - calls `describe-prefix-bindings'. This changes that command to - a which-key paging command when which-key-mode is active." - :group 'which-key - :type 'boolean) - -(defcustom which-key-is-verbose nil - "Whether to warn about potential mistakes in configuration." - :group 'which-key - :type 'boolean) - -(defvar which-key-C-h-map - (let ((map (make-sparse-keymap))) - (dolist (bind '(("\C-a" . which-key-abort) - ("a" . which-key-abort) - ("\C-d" . which-key-toggle-docstrings) - ("d" . which-key-toggle-docstrings) - ("\C-h" . which-key-show-standard-help) - ("h" . which-key-show-standard-help) - ("\C-n" . which-key-show-next-page-cycle) - ("n" . which-key-show-next-page-cycle) - ("\C-p" . which-key-show-previous-page-cycle) - ("p" . which-key-show-previous-page-cycle) - ("\C-u" . which-key-undo-key) - ("u" . which-key-undo-key) - ("1" . which-key-digit-argument) - ("2" . which-key-digit-argument) - ("3" . which-key-digit-argument) - ("4" . which-key-digit-argument) - ("5" . which-key-digit-argument) - ("6" . which-key-digit-argument) - ("7" . which-key-digit-argument) - ("8" . which-key-digit-argument) - ("9" . which-key-digit-argument))) - (define-key map (car bind) (cdr bind))) - map) - "Keymap for C-h commands.") - -(defvar which-key--paging-functions '(which-key-C-h-dispatch - which-key-turn-page - which-key-show-next-page-cycle - which-key-show-next-page-no-cycle - which-key-show-previous-page-cycle - which-key-show-previous-page-no-cycle - which-key-undo-key - which-key-undo)) - -(defcustom which-key-hide-alt-key-translations t - "Hide key translations using Alt key if non nil. -These translations are not relevant most of the times since a lot -of terminals issue META modifier for the Alt key. - -See http://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html" - :group 'which-key - :type 'boolean) - -(defcustom which-key-delay-functions nil - "A list of functions that may decide whether to delay the -which-key popup based on the current incomplete key -sequence. Each function in the list is run with two arguments, -the current key sequence as produced by `key-description' and the -length of the key sequence. If the popup should be delayed based -on that key sequence, the function should return the delay time -in seconds. Returning nil means no delay. The first function in -this list to return a value is the value that is used. - -The delay time is effectively added to the normal -`which-key-idle-delay'." - :group 'which-key - :type '(repeat function)) - -(defcustom which-key-allow-regexps nil - "A list of regexp strings to use to filter key sequences. When -non-nil, for a key sequence to trigger the which-key popup it -must match one of the regexps in this list. The format of the key -sequences is what is produced by `key-description'." - :group 'which-key - :type '(repeat regexp)) - -(defcustom which-key-inhibit-regexps nil - "Similar to `which-key-allow-regexps', a list of regexp strings -to use to filter key sequences. When non-nil, for a key sequence -to trigger the which-key popup it cannot match one of the regexps -in this list. The format of the key sequences is what is produced -by `key-description'." - :group 'which-key - :type '(repeat regexp)) - -(defcustom which-key-show-transient-maps nil - "Show keymaps created by `set-transient-map' when applicable. - -More specifically, detect when `overriding-terminal-local-map' is -set (this is the keymap used by `set-transient-map') and display -it." - :group 'which-key - :type 'boolean) - -(defcustom which-key-enable-extended-define-key nil - "Advise `define-key' to make which-key aware of definitions of the form - - \(define-key KEYMAP KEY '(\"DESCRIPTION\" . DEF)) - -With the advice, this definition will have the side effect of -creating a replacement in `which-key-replacement-alist' that -replaces DEF with DESCRIPTION when the key sequence ends in -KEY. Using a cons cell like this is a valid definition for -`define-key'. All this does is to make which-key aware of it. - -Since many higher level keybinding functions use `define-key' -internally, this will affect most if not all of those as well. - -This variable must be set before loading which-key." - :group 'which-key - :type 'boolean) - -;; Hooks -(defcustom which-key-init-buffer-hook '() - "Hook run when which-key buffer is initialized." - :group 'which-key - :type 'hook) - -;;;; Faces - -(defgroup which-key-faces nil - "Faces for which-key-mode" - :group 'which-key - :prefix "which-key-") - -(defface which-key-key-face - '((t . (:inherit font-lock-constant-face))) - "Face for which-key keys" - :group 'which-key-faces) - -(defface which-key-separator-face - '((t . (:inherit font-lock-comment-face))) - "Face for the separator (default separator is an arrow)" - :group 'which-key-faces) - -(defface which-key-note-face - '((t . (:inherit which-key-separator-face))) - "Face for notes or hints occasionally provided" - :group 'which-key-faces) - -(defface which-key-command-description-face - '((t . (:inherit font-lock-function-name-face))) - "Face for the key description when it is a command" - :group 'which-key-faces) - -(defface which-key-local-map-description-face - '((t . (:inherit which-key-command-description-face))) - "Face for the key description when it is found in `current-local-map'" - :group 'which-key-faces) - -(defface which-key-highlighted-command-face - '((t . (:inherit which-key-command-description-face :underline t))) - "Default face for the command description when it is a command -and it matches a string in `which-key-highlighted-command-list'." - :group 'which-key-faces) - -(defface which-key-group-description-face - '((t . (:inherit font-lock-keyword-face))) - "Face for the key description when it is a group or prefix" - :group 'which-key-faces) - -(defface which-key-special-key-face - '((t . (:inherit which-key-key-face :inverse-video t :weight bold))) - "Face for special keys (SPC, TAB, RET)" - :group 'which-key-faces) - -(defface which-key-docstring-face - '((t . (:inherit which-key-note-face))) - "Face for docstrings" - :group 'which-key-faces) - -;;;; Custom popup - -(defcustom which-key-custom-popup-max-dimensions-function nil - "Variable to hold a custom max-dimensions function. -Will be passed the width of the active window and is expected to -return the maximum height in lines and width in characters of the -which-key popup in the form a cons cell (height . width)." - :group 'which-key - :type '(choice function (const nil))) - -(defcustom which-key-custom-hide-popup-function nil - "Variable to hold a custom hide-popup function. -It takes no arguments and the return value is ignored." - :group 'which-key - :type '(choice function (const nil))) - -(defcustom which-key-custom-show-popup-function nil - "Variable to hold a custom show-popup function. -Will be passed the required dimensions in the form (height . -width) in lines and characters respectively. The return value is -ignored." - :group 'which-key - :type '(choice function (const nil))) - -(defcustom which-key-lighter " WK" - "Minor mode lighter to use in the mode-line." - :group 'which-key - :type 'string) - -(defvar which-key-inhibit nil - "Prevent which-key from popping up momentarily by setting this -to a non-nil value for the execution of a command. Like this - -\(let \(\(which-key-inhibit t\)\) -...\)") - -(defvar which-key-keymap-history nil - "History of keymap selections in functions like -`which-key-show-keymap'.") - -;;; Internal Vars - -(defvar which-key--buffer nil - "Internal: Holds reference to which-key buffer.") -(defvar which-key--timer nil - "Internal: Holds reference to open window timer.") -(defvar which-key--secondary-timer-active nil - "Internal: Non-nil if the secondary timer is active.") -(defvar which-key--paging-timer nil - "Internal: Holds reference to timer for paging.") -(defvar which-key--frame nil - "Internal: Holds reference to which-key frame. -Used when `which-key-popup-type' is frame.") -(defvar which-key--echo-keystrokes-backup nil - "Internal: Backup the initial value of `echo-keystrokes'.") -(defvar which-key--prefix-help-cmd-backup nil - "Internal: Backup the value of `prefix-help-command'.") -(defvar which-key--last-try-2-loc nil - "Internal: Last location of side-window when two locations -used.") -(defvar which-key--automatic-display nil - "Internal: Non-nil if popup was triggered with automatic -update.") -(defvar which-key--multiple-locations nil) -(defvar which-key--inhibit-next-operator-popup nil) -(defvar which-key--prior-show-keymap-args nil) -(defvar which-key--previous-frame-size nil) -(defvar which-key--prefix-title-alist nil) -(defvar which-key--debug nil) -(defvar which-key--evil-keys-regexp (eval-when-compile - (regexp-opt '("-state")))) -(defvar which-key--ignore-non-evil-keys-regexp - (eval-when-compile - (regexp-opt '("mouse-" "wheel-" "remap" "drag-" "scroll-bar" - "select-window" "switch-frame" "which-key-")))) -(defvar which-key--ignore-keys-regexp - (eval-when-compile - (regexp-opt '("mouse-" "wheel-" "remap" "drag-" "scroll-bar" - "select-window" "switch-frame" "-state" - "which-key-")))) - -(make-obsolete-variable 'which-key-prefix-name-alist nil "2016-10-05") -(make-obsolete-variable 'which-key-prefix-title-alist nil "2016-10-05") - -(defvar which-key--pages-obj nil) -(cl-defstruct which-key--pages - pages - height - widths - keys/page - page-nums - num-pages - total-keys - prefix - prefix-title) - -(defun which-key--rotate (list n) - (let* ((len (length list)) - (n (if (< n 0) (+ len n) n)) - (n (mod n len))) - (append (last list (- len n)) (butlast list (- len n))))) - -(defun which-key--pages-set-current-page (pages-obj n) - (setf (which-key--pages-pages pages-obj) - (which-key--rotate (which-key--pages-pages pages-obj) n)) - (setf (which-key--pages-widths pages-obj) - (which-key--rotate (which-key--pages-widths pages-obj) n)) - (setf (which-key--pages-keys/page pages-obj) - (which-key--rotate (which-key--pages-keys/page pages-obj) n)) - (setf (which-key--pages-page-nums pages-obj) - (which-key--rotate (which-key--pages-page-nums pages-obj) n)) - pages-obj) - -(defsubst which-key--on-first-page () - (= (which-key--pages-page-nums which-key--pages-obj) 1)) - -(defsubst which-key--on-last-page () - (= (which-key--pages-page-nums which-key--pages-obj) - (which-key--pages-num-pages which-key--pages-obj))) - -(defsubst which-key--current-prefix () - (when which-key--pages-obj - (which-key--pages-prefix which-key--pages-obj))) - -;;; Third-party library support -;;;; Evil - -(defcustom which-key-allow-evil-operators (boundp 'evil-this-operator) - "Allow popup to show for evil operators. The popup is normally - inhibited in the middle of commands, but setting this to - non-nil will override this behavior for evil operators." - :group 'which-key - :type 'boolean) - -(defcustom which-key-show-operator-state-maps nil - "Experimental: Try to show the right keys following an evil -command that reads a motion, such as \"y\", \"d\" and \"c\" from -normal state. This is experimental, because there might be some -valid keys missing and it might be showing some invalid keys." - :group 'which-key - :type 'boolean) - -;;;;; God-mode - -(defvar which-key--god-mode-support-enabled nil - "Support god-mode if non-nil. This is experimental, -so you need to explicitly opt-in for now. Please report any -problems at github.") - -(defvar which-key--god-mode-key-string nil - "Holds key string to use for god-mode support.") - -(defadvice god-mode-lookup-command - (around which-key--god-mode-lookup-command-advice disable) - (setq which-key--god-mode-key-string (ad-get-arg 0)) - (unwind-protect - ad-do-it - (when (bound-and-true-p which-key-mode) - (which-key--hide-popup)))) - -(defun which-key-enable-god-mode-support (&optional disable) - "Enable support for god-mode if non-nil. This is experimental, -so you need to explicitly opt-in for now. Please report any -problems at github. If DISABLE is non-nil disable support." - (interactive "P") - (setq which-key--god-mode-support-enabled (null disable)) - (if disable - (ad-disable-advice - 'god-mode-lookup-command - 'around 'which-key--god-mode-lookup-command-advice) - (ad-enable-advice - 'god-mode-lookup-command - 'around 'which-key--god-mode-lookup-command-advice)) - (ad-activate 'god-mode-lookup-command)) - -;;; Mode - -;;;###autoload -(define-minor-mode which-key-mode - "Toggle which-key-mode." - :global t - :lighter which-key-lighter - :keymap (let ((map (make-sparse-keymap))) - (mapc - (lambda (prefix) - (define-key map - (kbd (concat prefix " " which-key-paging-key)) - #'which-key-C-h-dispatch)) - which-key-paging-prefixes) - map) - (if which-key-mode - (progn - (setq which-key--echo-keystrokes-backup echo-keystrokes) - (when (or (eq which-key-show-prefix 'echo) - (eq which-key-popup-type 'minibuffer)) - (which-key--setup-echo-keystrokes)) - (unless (member prefix-help-command which-key--paging-functions) - (setq which-key--prefix-help-cmd-backup prefix-help-command)) - (when which-key-use-C-h-commands - (setq prefix-help-command #'which-key-C-h-dispatch)) - (when which-key-show-remaining-keys - (add-hook 'pre-command-hook #'which-key--lighter-restore)) - (add-hook 'pre-command-hook #'which-key--hide-popup) - (add-hook 'focus-out-hook #'which-key--stop-timer) - (add-hook 'focus-in-hook #'which-key--start-timer) - (add-hook 'window-size-change-functions - 'which-key--hide-popup-on-frame-size-change) - (which-key--start-timer)) - (setq echo-keystrokes which-key--echo-keystrokes-backup) - (when which-key--prefix-help-cmd-backup - (setq prefix-help-command which-key--prefix-help-cmd-backup)) - (when which-key-show-remaining-keys - (remove-hook 'pre-command-hook #'which-key--lighter-restore)) - (remove-hook 'pre-command-hook #'which-key--hide-popup) - (remove-hook 'focus-out-hook #'which-key--stop-timer) - (remove-hook 'focus-in-hook #'which-key--start-timer) - (remove-hook 'window-size-change-functions - 'which-key--hide-popup-on-frame-size-change) - (which-key--stop-timer))) - -(defun which-key--init-buffer () - "Initialize which-key buffer" - (unless (buffer-live-p which-key--buffer) - (setq which-key--buffer (get-buffer-create which-key-buffer-name)) - (with-current-buffer which-key--buffer - ;; suppress confusing minibuffer message - (let (message-log-max) - (toggle-truncate-lines 1) - (message "")) - (setq-local cursor-type nil) - (setq-local cursor-in-non-selected-windows nil) - (setq-local mode-line-format nil) - (setq-local word-wrap nil) - (setq-local show-trailing-whitespace nil) - (run-hooks 'which-key-init-buffer-hook)))) - -(defun which-key--setup-echo-keystrokes () - "Reduce `echo-keystrokes' if necessary (it will interfere if -it's set too high)." - (when (and echo-keystrokes - (> (abs (- echo-keystrokes which-key-echo-keystrokes)) 0.000001)) - (if (> which-key-idle-delay which-key-echo-keystrokes) - (setq echo-keystrokes which-key-echo-keystrokes) - (setq which-key-echo-keystrokes (/ (float which-key-idle-delay) 4) - echo-keystrokes which-key-echo-keystrokes)))) - -(defun which-key-remove-default-unicode-chars () - "Use of `which-key-dont-use-unicode' is preferred to this -function, but it's included here in case someone cannot set that -variable early enough in their configuration, if they are using a -starter kit for example." - (when (string-equal which-key-separator " → ") - (setq which-key-separator " : ")) - (setq which-key-key-replacement-alist - (delete '("left" . "←") which-key-key-replacement-alist)) - (setq which-key-key-replacement-alist - (delete '("right" . "→") which-key-key-replacement-alist))) - -;;; Default configuration functions for use by users. - -;;;###autoload -(defun which-key-setup-side-window-right () - "Apply suggested settings for side-window that opens on right." - (interactive) - (setq which-key-popup-type 'side-window - which-key-side-window-location 'right - which-key-show-prefix 'top)) - -;;;###autoload -(defun which-key-setup-side-window-right-bottom () - "Apply suggested settings for side-window that opens on right -if there is space and the bottom otherwise." - (interactive) - (setq which-key-popup-type 'side-window - which-key-side-window-location '(right bottom) - which-key-show-prefix 'top)) - -;;;###autoload -(defun which-key-setup-side-window-bottom () - "Apply suggested settings for side-window that opens on -bottom." - (interactive) - (which-key--setup-echo-keystrokes) - (setq which-key-popup-type 'side-window - which-key-side-window-location 'bottom - which-key-show-prefix 'echo)) - -;;;###autoload -(defun which-key-setup-minibuffer () - "Apply suggested settings for minibuffer. -Do not use this setup if you use the paging commands. Instead use -`which-key-setup-side-window-bottom', which is nearly identical -but more functional." - (interactive) - (which-key--setup-echo-keystrokes) - (setq which-key-popup-type 'minibuffer - which-key-show-prefix 'left)) - -;;; Helper functions to modify replacement lists. - -;;;###autoload -(defun which-key-add-key-based-replacements - (key-sequence replacement &rest more) - "Replace the description of KEY-SEQUENCE with REPLACEMENT. -KEY-SEQUENCE is a string suitable for use in `kbd'. REPLACEMENT -may either be a string, as in - -\(which-key-add-key-based-replacements \"C-x 1\" \"maximize\"\) - -a cons of two strings as in - -\(which-key-add-key-based-replacements \"C-x 8\" - '(\"unicode\" . \"Unicode keys\")\) - -or a function that takes a \(KEY . BINDING\) cons and returns a -replacement. - -In the second case, the second string is used to provide a longer -name for the keys under a prefix. - -MORE allows you to specifcy additional KEY REPLACEMENT pairs. All -replacements are added to -`which-key-key-based-description-replacement-alist'." - ;; TODO: Make interactive - (while key-sequence - ;; normalize key sequences before adding - (let ((key-seq (key-description (kbd key-sequence))) - (replace (or (and (functionp replacement) replacement) - (car-safe replacement) - replacement))) - (push (cons (cons (concat "\\`" (regexp-quote key-seq) "\\'") nil) - (if (functionp replace) replace (cons nil replace))) - which-key-replacement-alist) - (when (and (not (functionp replacement)) (consp replacement)) - (push (cons key-seq (cdr-safe replacement)) - which-key--prefix-title-alist))) - (setq key-sequence (pop more) replacement (pop more)))) -(put 'which-key-add-key-based-replacements 'lisp-indent-function 'defun) - -;;;###autoload -(defun which-key-add-major-mode-key-based-replacements - (mode key-sequence replacement &rest more) - "Functions like `which-key-add-key-based-replacements'. -The difference is that MODE specifies the `major-mode' that must -be active for KEY-SEQUENCE and REPLACEMENT (MORE contains -addition KEY-SEQUENCE REPLACEMENT pairs) to apply." - ;; TODO: Make interactive - (when (not (symbolp mode)) - (error "MODE should be a symbol corresponding to a value of major-mode")) - (let ((mode-alist - (or (cdr-safe (assq mode which-key-replacement-alist)) (list))) - (title-mode-alist - (or (cdr-safe (assq mode which-key--prefix-title-alist)) (list)))) - (while key-sequence - ;; normalize key sequences before adding - (let ((key-seq (key-description (kbd key-sequence))) - (replace (or (and (functionp replacement) replacement) - (car-safe replacement) - replacement))) - (push (cons (cons (concat "\\`" (regexp-quote key-seq) "\\'") nil) - (if (functionp replace) replace (cons nil replace))) - mode-alist) - (when (and (not (functionp replacement)) (consp replacement)) - (push (cons key-seq (cdr-safe replacement)) - title-mode-alist))) - (setq key-sequence (pop more) replacement (pop more))) - (if (assq mode which-key-replacement-alist) - (setcdr (assq mode which-key-replacement-alist) mode-alist) - (push (cons mode mode-alist) which-key-replacement-alist)) - (if (assq mode which-key--prefix-title-alist) - (setcdr (assq mode which-key--prefix-title-alist) title-mode-alist) - (push (cons mode title-mode-alist) which-key--prefix-title-alist)))) -(put 'which-key-add-major-mode-key-based-replacements - 'lisp-indent-function 'defun) - -(defalias 'which-key-add-prefix-title 'which-key-add-key-based-replacements) -(make-obsolete 'which-key-add-prefix-title - 'which-key-add-key-based-replacements - "2016-10-05") - -(defalias 'which-key-declare-prefixes 'which-key-add-key-based-replacements) -(make-obsolete 'which-key-declare-prefixes - 'which-key-add-key-based-replacements - "2016-10-05") - -(defalias 'which-key-declare-prefixes-for-mode - 'which-key-add-major-mode-key-based-replacements) -(make-obsolete 'which-key-declare-prefixes-for-mode - 'which-key-add-major-mode-key-based-replacements - "2016-10-05") - -(defun which-key-define-key-recursively (map key def &optional at-root) - "Recursively bind KEY in MAP to DEF on every level of MAP except the first. -If AT-ROOT is non-nil the binding is also placed at the root of MAP." - (when at-root (define-key map key def)) - (map-keymap - (lambda (_ev df) - (when (keymapp df) - (which-key-define-key-recursively df key def t))) - map)) - -(defun which-key--process-define-key-args (keymap key def) - "When DEF takes the form (\"DESCRIPTION\". DEF), make sure -which-key uses \"DESCRIPTION\" for this binding. This function is -meant to be used as :before advice for `define-key'." - (with-demoted-errors "Which-key extended define-key error: %s" - (when (and (consp def) - (stringp (car def)) - (symbolp (cdr def))) - (define-key keymap (which-key--pseudo-key key) `(which-key ,def))))) - -(when which-key-enable-extended-define-key - (advice-add #'define-key :before #'which-key--process-define-key-args)) - -;;; Functions for computing window sizes - -(defun which-key--text-width-to-total (text-width) - "Convert window text-width to window total-width. -TEXT-WIDTH is the desired text width of the window. The function -calculates what total width is required for a window in the -selected to have a text-width of TEXT-WIDTH columns. The -calculation considers possible fringes and scroll bars. This -function assumes that the desired window has the same character -width as the frame." - (let ((char-width (frame-char-width))) - (+ text-width - (/ (frame-fringe-width) char-width) - (/ (frame-scroll-bar-width) char-width) - (if (which-key--char-enlarged-p) 1 0) - ;; add padding to account for possible wide (unicode) characters - 3))) - -(defun which-key--total-width-to-text (total-width) - "Convert window total-width to window text-width. -TOTAL-WIDTH is the desired total width of the window. The function calculates -what text width fits such a window. The calculation considers possible fringes -and scroll bars. This function assumes that the desired window has the same -character width as the frame." - (let ((char-width (frame-char-width))) - (- total-width - (/ (frame-fringe-width) char-width) - (/ (frame-scroll-bar-width) char-width) - (if (which-key--char-enlarged-p) 1 0) - ;; add padding to account for possible wide (unicode) characters - 3))) - -(defun which-key--char-enlarged-p (&optional _frame) - (> (frame-char-width) - (/ (float (frame-pixel-width)) (window-total-width (frame-root-window))))) - -(defun which-key--char-reduced-p (&optional _frame) - (< (frame-char-width) - (/ (float (frame-pixel-width)) (window-total-width (frame-root-window))))) - -(defun which-key--char-exact-p (&optional _frame) - (= (frame-char-width) - (/ (float (frame-pixel-width)) (window-total-width (frame-root-window))))) - -(defun which-key--width-or-percentage-to-width (width-or-percentage) - "Return window total width. -If WIDTH-OR-PERCENTAGE is a whole number, return it unchanged. Otherwise, it -should be a percentage (a number between 0 and 1) out of the frame's width. -More precisely, it should be a percentage out of the frame's root window's -total width." - (if (wholenump width-or-percentage) - width-or-percentage - (round (* width-or-percentage (window-total-width (frame-root-window)))))) - -(defun which-key--height-or-percentage-to-height (height-or-percentage) - "Return window total height. -If HEIGHT-OR-PERCENTAGE is a whole number, return it unchanged. Otherwise, it -should be a percentage (a number between 0 and 1) out of the frame's height. -More precisely, it should be a percentage out of the frame's root window's -total height." - (if (wholenump height-or-percentage) - height-or-percentage - (round (* height-or-percentage (window-total-height (frame-root-window)))))) - -(defun which-key--frame-size-changed-p () - "Non-nil if a change in frame size is detected." - (let ((new-size (cons (frame-width) (frame-height)))) - (cond ((null which-key--previous-frame-size) - (setq which-key--previous-frame-size new-size) - nil) - ((not (equal which-key--previous-frame-size new-size)) - (setq which-key--previous-frame-size new-size))))) - -;;; Show/hide which-key buffer - -(defun which-key--hide-popup () - "This function is called to hide the which-key buffer." - (unless (member real-this-command which-key--paging-functions) - (setq which-key--last-try-2-loc nil) - (setq which-key--pages-obj nil) - (setq which-key--automatic-display nil) - (setq which-key--prior-show-keymap-args nil) - (when (and which-key-idle-secondary-delay - which-key--secondary-timer-active) - (which-key--start-timer)) - (which-key--lighter-restore) - (cl-case which-key-popup-type - ;; Not necessary to hide minibuffer - ;; (minibuffer (which-key--hide-buffer-minibuffer)) - (side-window (which-key--hide-buffer-side-window)) - (frame (which-key--hide-buffer-frame)) - (custom (funcall which-key-custom-hide-popup-function))))) - -(defun which-key--hide-popup-ignore-command () - "Version of `which-key--hide-popup' without the check of -`real-this-command'." - (cl-case which-key-popup-type - (side-window (which-key--hide-buffer-side-window)) - (frame (which-key--hide-buffer-frame)) - (custom (funcall which-key-custom-hide-popup-function)))) - -(defun which-key--hide-popup-on-frame-size-change (&optional _) - "Hide which-key popup if the frame is resized (to trigger a new -popup)." - (when (which-key--frame-size-changed-p) - (which-key--hide-popup))) - -(defun which-key--hide-buffer-side-window () - "Hide which-key buffer when side-window popup is used." - (when (buffer-live-p which-key--buffer) - ;; in case which-key buffer was shown in an existing window, `quit-window' - ;; will re-show the previous buffer, instead of closing the window - (quit-windows-on which-key--buffer))) - -(defun which-key--hide-buffer-frame () - "Hide which-key buffer when frame popup is used." - (when (frame-live-p which-key--frame) - (delete-frame which-key--frame))) - -(defun which-key--popup-showing-p () - (window-live-p (get-buffer-window which-key--buffer))) - -(defun which-key--show-popup (act-popup-dim) - "Show the which-key buffer. -ACT-POPUP-DIM includes the dimensions, (height . width) of the -buffer text to be displayed in the popup. Return nil if no window -is shown, or if there is no need to start the closing timer." - (when (and (> (car act-popup-dim) 0) (> (cdr act-popup-dim) 0)) - (cl-case which-key-popup-type - ;; Not called for minibuffer - ;; (minibuffer (which-key--show-buffer-minibuffer act-popup-dim)) - (side-window (which-key--show-buffer-side-window act-popup-dim)) - (frame (which-key--show-buffer-frame act-popup-dim)) - (custom (funcall which-key-custom-show-popup-function act-popup-dim))))) - -(defun which-key--fit-buffer-to-window-horizontally - (&optional window &rest params) - "Slightly modified version of `fit-buffer-to-window'. -Use &rest params because `fit-buffer-to-window' has a different -call signature in different emacs versions" - (let ((fit-window-to-buffer-horizontally t)) - (apply #'fit-window-to-buffer window params))) - -(defun which-key--show-buffer-side-window (act-popup-dim) - "Show which-key buffer when popup type is side-window." - (let* ((height (car act-popup-dim)) - (width (cdr act-popup-dim)) - (alist - (if which-key-allow-imprecise-window-fit - `((window-width . ,(which-key--text-width-to-total width)) - (window-height . ,height) - (side . ,which-key-side-window-location) - (slot . ,which-key-side-window-slot)) - `((window-width . which-key--fit-buffer-to-window-horizontally) - (window-height . (lambda (w) (fit-window-to-buffer w nil 1))) - (side . ,which-key-side-window-location) - (slot . ,which-key-side-window-slot))))) - ;; Previously used `display-buffer-in-major-side-window' here, but - ;; apparently that is meant to be an internal function. See emacs bug #24828 - ;; and advice given there. - (cond - ((eq which-key--multiple-locations t) - ;; possibly want to switch sides in this case so we can't reuse the window - (delete-windows-on which-key--buffer) - (display-buffer-in-side-window which-key--buffer alist)) - ((get-buffer-window which-key--buffer) - (display-buffer-reuse-window which-key--buffer alist)) - (t - (display-buffer-in-side-window which-key--buffer alist))))) - -(defun which-key--show-buffer-frame (act-popup-dim) - "Show which-key buffer when popup type is frame." - (let* (;(orig-window (selected-window)) - (frame-height (+ (car act-popup-dim) - (if (with-current-buffer which-key--buffer - mode-line-format) - 1 - 0))) - ;; without adding 2, frame sometimes isn't wide enough for the buffer. - ;; this is probably because of the fringes. however, setting fringes - ;; sizes to 0 (instead of adding 2) didn't always make the frame wide - ;; enough. don't know why it is so. - (frame-width (+ (cdr act-popup-dim) 2)) - (new-window (if (and (frame-live-p which-key--frame) - (eq which-key--buffer - (window-buffer - (frame-root-window which-key--frame)))) - (which-key--show-buffer-reuse-frame - frame-height frame-width) - (which-key--show-buffer-new-frame - frame-height frame-width)))) - (when new-window - ;; display successful - (setq which-key--frame (window-frame new-window)) - new-window))) - -(defun which-key--show-buffer-new-frame (frame-height frame-width) - "Helper for `which-key--show-buffer-frame'." - (let* ((frame-params `((height . ,frame-height) - (width . ,frame-width) - ;; tell the window manager to respect the given sizes - (user-size . t) - ;; which-key frame doesn't need a minibuffer - (minibuffer . nil) - (name . "which-key") - ;; no need for scroll bars in which-key frame - (vertical-scroll-bars . nil) - ;; (left-fringe . 0) - ;; (right-fringe . 0) - ;; (right-divider-width . 0) - ;; make sure frame is visible - (visibility . t))) - (alist `((pop-up-frame-parameters . ,frame-params))) - (orig-frame (selected-frame)) - (new-window (display-buffer-pop-up-frame which-key--buffer alist))) - (when new-window - ;; display successful - (redirect-frame-focus (window-frame new-window) orig-frame) - new-window))) - -(defun which-key--show-buffer-reuse-frame (frame-height frame-width) - "Helper for `which-key--show-buffer-frame'." - (let ((window - (display-buffer-reuse-window - which-key--buffer `((reusable-frames . ,which-key--frame))))) - (when window - ;; display successful - (set-frame-size (window-frame window) frame-width frame-height) - window))) - -;;; Max dimension of available window functions - -(defun which-key--popup-max-dimensions () - "Dimesion functions should return the maximum possible (height -. width) of the intended popup. SELECTED-WINDOW-WIDTH is the -width of currently active window, not the which-key buffer -window." - (cl-case which-key-popup-type - (minibuffer (which-key--minibuffer-max-dimensions)) - (side-window (which-key--side-window-max-dimensions)) - (frame (which-key--frame-max-dimensions)) - (custom (funcall which-key-custom-popup-max-dimensions-function - (window-width))))) - -(defun which-key--minibuffer-max-dimensions () - "Return max-dimensions of minibuffer (height . width). -Measured in lines and characters respectively." - (cons - ;; height - (if (floatp max-mini-window-height) - (floor (* (frame-text-lines) - max-mini-window-height)) - max-mini-window-height) - ;; width - (max 0 (- (frame-text-cols) which-key-unicode-correction)))) - -(defun which-key--side-window-max-dimensions () - "Return max-dimensions of the side-window popup (height . -width) in lines and characters respectively." - (cons - ;; height - (if (member which-key-side-window-location '(left right)) - ;; 1 is a kludge to make sure there is no overlap - (- (frame-height) (window-text-height (minibuffer-window)) 1) - ;; (window-mode-line-height which-key--window)) - ;; FIXME: change to something like - ;; (min which-*-height (calculate-max-height)) - (which-key--height-or-percentage-to-height - which-key-side-window-max-height)) - ;; width - (max 0 - (- (if (member which-key-side-window-location '(left right)) - (which-key--total-width-to-text - (which-key--width-or-percentage-to-width - which-key-side-window-max-width)) - (which-key--total-width-to-text - (which-key--width-or-percentage-to-width - 1.0))) - which-key-unicode-correction)))) - -(defun which-key--frame-max-dimensions () - "Return max-dimensions of the frame popup (height . -width) in lines and characters respectively." - (cons which-key-frame-max-height which-key-frame-max-width)) - -;;; Sorting functions - -(defun which-key--string< (a b &optional alpha) - (let* ((da (downcase a)) - (db (downcase b))) - (cond ((string-equal da db) - (if which-key-sort-uppercase-first - (string-lessp a b) - (not (string-lessp a b)))) - (alpha (string-lessp da db)) - (t (string-lessp a b))))) - -(defun which-key--key-description< (a b &optional alpha) - "Sorting function used for `which-key-key-order' and -`which-key-key-order-alpha'." - (save-match-data - (let* ((rngrgxp "^\\([^ ]+\\) \\.\\. [^ ]+") - (a (if (string-match rngrgxp a) (match-string 1 a) a)) - (b (if (string-match rngrgxp b) (match-string 1 b) b)) - (aem? (string-equal a "")) - (bem? (string-equal b "")) - (a1? (= 1 (length a))) - (b1? (= 1 (length b))) - (srgxp "^\\(RET\\|SPC\\|TAB\\|DEL\\|LFD\\|ESC\\|NUL\\)") - (asp? (string-match-p srgxp a)) - (bsp? (string-match-p srgxp b)) - (prrgxp "^\\(M\\|C\\|S\\|A\\|H\\|s\\)-") - (apr? (string-match-p prrgxp a)) - (bpr? (string-match-p prrgxp b)) - (afn? (string-match-p "" a)) - (bfn? (string-match-p "" b))) - (cond ((or aem? bem?) (and aem? (not bem?))) - ((and asp? bsp?) - (if (string-equal (substring a 0 3) (substring b 0 3)) - (which-key--key-description< - (substring a 3) (substring b 3) alpha) - (which-key--string< a b alpha))) - ((or asp? bsp?) asp?) - ((and a1? b1?) (which-key--string< a b alpha)) - ((or a1? b1?) a1?) - ((and afn? bfn?) - (< (string-to-number - (replace-regexp-in-string "" "\\1" a)) - (string-to-number - (replace-regexp-in-string "" "\\1" b)))) - ((or afn? bfn?) afn?) - ((and apr? bpr?) - (if (string-equal (substring a 0 2) (substring b 0 2)) - (which-key--key-description< - (substring a 2) (substring b 2) alpha) - (which-key--string< a b alpha))) - ((or apr? bpr?) apr?) - (t (which-key--string< a b alpha)))))) - -(defsubst which-key-key-order-alpha (acons bcons) - "Order key descriptions A and B. -Order is lexicographic within a \"class\", where the classes and -the ordering of classes are listed below. - -special (SPC,TAB,...) < single char < mod (C-,M-,...) < other. -Sorts single characters alphabetically with lowercase coming -before upper." - (which-key--key-description< (car acons) (car bcons) t)) - -(defsubst which-key-key-order (acons bcons) - "Order key descriptions A and B. -Order is lexicographic within a \"class\", where the classes and -the ordering of classes are listed below. - -special (SPC,TAB,...) < single char < mod (C-,M-,...) < other." - (which-key--key-description< (car acons) (car bcons))) - -(defsubst which-key-description-order (acons bcons) - "Order descriptions of A and B. -Uses `string-lessp' after applying lowercase." - (string-lessp (downcase (cdr acons)) (downcase (cdr bcons)))) - -(defsubst which-key--group-p (description) - (or (string-match-p "^\\(group:\\|Prefix\\)" description) - (keymapp (intern description)))) - -(defun which-key-prefix-then-key-order (acons bcons) - "Order first by whether A and/or B is a prefix with no prefix -coming before a prefix. Within these categories order using -`which-key-key-order'." - (let ((apref? (which-key--group-p (cdr acons))) - (bpref? (which-key--group-p (cdr bcons)))) - (if (not (eq apref? bpref?)) - (and (not apref?) bpref?) - (which-key-key-order acons bcons)))) - -(defun which-key-prefix-then-key-order-reverse (acons bcons) - "Order first by whether A and/or B is a prefix with prefix -coming before a prefix. Within these categories order using -`which-key-key-order'." - (let ((apref? (which-key--group-p (cdr acons))) - (bpref? (which-key--group-p (cdr bcons)))) - (if (not (eq apref? bpref?)) - (and apref? (not bpref?)) - (which-key-key-order acons bcons)))) - -(defun which-key-local-then-key-order (acons bcons) - "Order first by whether A and/or B is a local binding with -local bindings coming first. Within these categories order using -`which-key-key-order'." - (let ((aloc? (which-key--local-binding-p acons)) - (bloc? (which-key--local-binding-p bcons))) - (if (not (eq aloc? bloc?)) - (and aloc? (not bloc?)) - (which-key-key-order acons bcons)))) - -;;; Functions for retrieving and formatting keys - -(defsubst which-key--string-width (maybe-string) - "If MAYBE-STRING is a string use `which-key--string-width' o/w return 0." - (if (stringp maybe-string) (string-width maybe-string) 0)) - -(defsubst which-key--safe-lookup-key (keymap key) - "Version of `lookup-key' that allows KEYMAP to be nil. KEY is not checked." - (when (keymapp keymap) (lookup-key keymap key))) - -(defsubst which-key--butlast-string (str) - (mapconcat #'identity (butlast (split-string str)) " ")) - -(defun which-key--get-replacements (key-binding &optional use-major-mode) - (let ((alist (or (and use-major-mode - (cdr-safe - (assq major-mode which-key-replacement-alist))) - which-key-replacement-alist)) - res case-fold-search) - (catch 'res - (dolist (replacement alist) - ;; these are mode specific ones to ignore. The mode specific case is - ;; handled in the selection of alist - (unless (symbolp (car replacement)) - (let ((key-regexp (caar replacement)) - (binding-regexp (cdar replacement))) - (when (and (or (null key-regexp) - (string-match-p key-regexp - (car key-binding))) - (or (null binding-regexp) - (string-match-p binding-regexp - (cdr key-binding)))) - (push replacement res) - (when (not which-key-allow-multiple-replacements) - (throw 'res res))))))) - (nreverse res))) - -(defun which-key--get-pseudo-binding (key-binding &optional prefix) - (let* ((pseudo-binding - (key-binding (which-key--pseudo-key (kbd (car key-binding)) prefix))) - (pseudo-binding (when pseudo-binding (cadr pseudo-binding))) - (pseudo-desc (when pseudo-binding (car pseudo-binding))) - (pseudo-def (when pseudo-binding (cdr pseudo-binding))) - (real-def (key-binding (kbd (car key-binding)))) - ;; treat keymaps as if they're nil bindings. This creates the - ;; possibility that we rename the wrong binding but this seems - ;; unlikely. - (real-def (unless (keymapp real-def) real-def))) - (when (and pseudo-binding - (eq pseudo-def real-def)) - (cons (car key-binding) pseudo-desc)))) - -(defun which-key--maybe-replace (key-binding &optional prefix) - "Use `which-key--replacement-alist' to maybe replace KEY-BINDING. -KEY-BINDING is a cons cell of the form \(KEY . BINDING\) each of -which are strings. KEY is of the form produced by `key-binding'." - (let* ((pseudo-binding (which-key--get-pseudo-binding key-binding prefix))) - (if pseudo-binding - pseudo-binding - (let* ((mode-res (which-key--get-replacements key-binding t)) - (all-repls (or mode-res - (which-key--get-replacements key-binding)))) - (dolist (repl all-repls key-binding) - (setq key-binding - (cond ((or (not (consp repl)) (null (cdr repl))) - key-binding) - ((functionp (cdr repl)) - (funcall (cdr repl) key-binding)) - ((consp (cdr repl)) - (cons - (cond ((and (caar repl) (cadr repl)) - (replace-regexp-in-string - (caar repl) (cadr repl) (car key-binding) t)) - ((cadr repl) (cadr repl)) - (t (car key-binding))) - (cond ((and (cdar repl) (cddr repl)) - (replace-regexp-in-string - (cdar repl) (cddr repl) (cdr key-binding) t)) - ((cddr repl) (cddr repl)) - (t (cdr key-binding)))))))))))) - -(defsubst which-key--current-key-list (&optional key-str) - (append (listify-key-sequence (which-key--current-prefix)) - (when key-str - (listify-key-sequence (kbd key-str))))) - -(defsubst which-key--current-key-string (&optional key-str) - (key-description (which-key--current-key-list key-str))) - -(defun which-key--local-binding-p (keydesc) - (eq (which-key--safe-lookup-key - (current-local-map) (kbd (which-key--current-key-string (car keydesc)))) - (intern (cdr keydesc)))) - -(defun which-key--map-binding-p (map keydesc) - "Does MAP contain KEYDESC = (key . binding)?" - (or - (when (bound-and-true-p evil-state) - (let ((lookup - (which-key--safe-lookup-key - map - (kbd (which-key--current-key-string - (format "<%s-state> %s" evil-state (car keydesc))))))) - (or (eq lookup (intern (cdr keydesc))) - (and (keymapp lookup) (string= (cdr keydesc) "Prefix Command"))))) - (let ((lookup - (which-key--safe-lookup-key - map (kbd (which-key--current-key-string (car keydesc)))))) - (or (eq lookup (intern (cdr keydesc))) - (and (keymapp lookup) (string= (cdr keydesc) "Prefix Command")))))) - -(defun which-key--pseudo-key (key &optional prefix) - "Replace the last key in the sequence KEY by a special symbol -in order for which-key to allow looking up a description for the key." - (let* ((seq (listify-key-sequence key)) - (final (intern (format "which-key-%s" (key-description (last seq)))))) - (if prefix - (vconcat prefix (list final)) - (vconcat (butlast seq) (list final))))) - -(defun which-key--maybe-get-prefix-title (keys) - "KEYS is a string produced by `key-description'. -A title is possibly returned using -`which-key--prefix-title-alist'. An empty stiring is returned if -no title exists." - (cond - ((not (string-equal keys "")) - (let* ((title-res - (cdr-safe (assoc-string keys which-key--prefix-title-alist))) - (repl-res - (cdr-safe (which-key--maybe-replace (cons keys "")))) - (binding (key-binding (kbd keys))) - (alternate (when (and binding (symbolp binding)) - (symbol-name binding)))) - (cond (title-res title-res) - ((not (string-equal repl-res "")) repl-res) - ((and (eq which-key-show-prefix 'echo) alternate) - alternate) - ((and (member which-key-show-prefix '(bottom top)) - (eq which-key-side-window-location 'bottom) - echo-keystrokes) - (if alternate alternate - (concat "Following " keys))) - (t "")))) - (t ""))) - -(defun which-key--propertize (string &rest properties) - "Version of `propertize' that checks type of STRING." - (when (stringp string) - (apply #'propertize string properties))) - -(defun which-key--propertize-key (key) - "Add a face to KEY. -If KEY contains any \"special keys\" defined in -`which-key-special-keys' then truncate and add the corresponding -`which-key-special-key-face'." - (let ((key-w-face (which-key--propertize key 'face 'which-key-key-face)) - (regexp (concat "\\(" - (mapconcat 'identity which-key-special-keys - "\\|") "\\)")) - case-fold-search) - (save-match-data - (if (and which-key-special-keys - (string-match regexp key)) - (let ((beg (match-beginning 0)) (end (match-end 0))) - (concat (substring key-w-face 0 beg) - (which-key--propertize (substring key-w-face beg (1+ beg)) - 'face 'which-key-special-key-face) - (substring key-w-face end - (which-key--string-width key-w-face)))) - key-w-face)))) - -(defsubst which-key--truncate-description (desc) - "Truncate DESC description to `which-key-max-description-length'." - (let* ((last-face (get-text-property (1- (length desc)) 'face desc)) - (dots (which-key--propertize ".." 'face last-face))) - (if (and which-key-max-description-length - (> (length desc) which-key-max-description-length)) - (concat (substring desc 0 which-key-max-description-length) dots) - desc))) - -(defun which-key--highlight-face (description) - "Return the highlight face for DESCRIPTION if it has one." - (let (face) - (dolist (el which-key-highlighted-command-list) - (unless face - (cond ((consp el) - (when (string-match-p (car el) description) - (setq face (cdr el)))) - ((stringp el) - (when (string-match-p el description) - (setq face 'which-key-highlighted-command-face))) - (t - (message "which-key: warning: element %s of \ -which-key-highlighted-command-list is not a string or a cons -cell" el))))) - face)) - -(defun which-key--propertize-description - (description group local hl-face &optional original-description) - "Add face to DESCRIPTION where the face chosen depends on -whether the description represents a group or a command. Also -make some minor adjustments to the description string, like -removing a \"group:\" prefix. - -ORIGINAL-DESCRIPTION is the description given by -`describe-buffer-bindings'." - (when description - (let* ((desc description) - (desc (if (string-match-p "^group:" desc) - (substring desc 6) desc)) - (desc (if group (concat which-key-prefix-prefix desc) desc))) - (make-text-button - desc nil - 'face (cond (hl-face hl-face) - (group 'which-key-group-description-face) - (local 'which-key-local-map-description-face) - (t 'which-key-command-description-face)) - 'help-echo (cond - ((and original-description - (fboundp (intern original-description)) - (documentation (intern original-description)) - ;; tooltip-mode doesn't exist in emacs-nox - (boundp 'tooltip-mode) tooltip-mode) - (documentation (intern original-description))) - ((and original-description - (fboundp (intern original-description)) - (documentation (intern original-description)) - (let* ((doc (documentation - (intern original-description))) - (str (replace-regexp-in-string "\n" " " doc)) - (max (floor (* (frame-width) 0.8)))) - (if (> (length str) max) - (concat (substring str 0 max) "...") - str)))))) - desc))) - -(defun which-key--extract-key (key-str) - "Pull the last key (or key range) out of KEY-STR." - (save-match-data - (let ((key-range-regexp "\\`.*\\([^ \t]+ \\.\\. [^ \t]+\\)\\'")) - (if (string-match key-range-regexp key-str) - (match-string 1 key-str) - (car (last (split-string key-str " "))))))) - -(defun which-key--maybe-add-docstring (current original) - "Maybe concat a docstring to CURRENT and return result. -Specifically, do this if ORIGINAL is a command with a docstring -and `which-key-show-docstrings' is non-nil. If -`which-key-show-docstrings' is the symbol docstring-only, just -return the docstring." - (let* ((orig-sym (intern original)) - (doc (when (commandp orig-sym) - (documentation orig-sym))) - (docstring (when doc - (which-key--propertize (car (split-string doc "\n")) - 'face 'which-key-docstring-face)))) - (cond ((not (and which-key-show-docstrings docstring)) - current) - ((eq which-key-show-docstrings 'docstring-only) - docstring) - (t - (format "%s %s" current docstring))))) - -(defun which-key--format-and-replace (unformatted &optional prefix preserve-full-key) - "Take a list of (key . desc) cons cells in UNFORMATTED, add -faces and perform replacements according to the three replacement -alists. Returns a list (key separator description)." - (let ((sep-w-face - (which-key--propertize which-key-separator - 'face 'which-key-separator-face)) - (local-map (current-local-map)) - new-list) - (dolist (key-binding unformatted) - (let* ((key (car key-binding)) - (orig-desc (cdr key-binding)) - (group (which-key--group-p orig-desc)) - ;; At top-level prefix is nil - (keys (if prefix - (concat (key-description prefix) " " key) - key)) - (local (eq (which-key--safe-lookup-key local-map (kbd keys)) - (intern orig-desc))) - (hl-face (which-key--highlight-face orig-desc)) - (key-binding (which-key--maybe-replace (cons keys orig-desc) prefix)) - (final-desc (which-key--propertize-description - (cdr key-binding) group local hl-face orig-desc))) - (when final-desc - (setq final-desc - (which-key--truncate-description - (which-key--maybe-add-docstring final-desc orig-desc)))) - (when (consp key-binding) - (push - (list (which-key--propertize-key - (if preserve-full-key - (car key-binding) - (which-key--extract-key (car key-binding)))) - sep-w-face - final-desc) - new-list)))) - (nreverse new-list))) - -(defun which-key--get-keymap-bindings (keymap &optional all prefix) - "Retrieve top-level bindings from KEYMAP. -If ALL is non-nil, get all bindings, not just the top-level -ones. PREFIX is for internal use and should not be used." - (let (bindings) - (map-keymap - (lambda (ev def) - (let* ((key (append prefix (list ev))) - (key-desc (key-description key))) - (cond ((or (string-match-p - which-key--ignore-non-evil-keys-regexp key-desc) - (eq ev 'menu-bar))) - ;; extract evil keys corresponding to current state - ((and (keymapp def) - (boundp 'evil-state) - (bound-and-true-p evil-local-mode) - (string-match-p (format "<%s-state>$" evil-state) key-desc)) - (setq bindings - ;; this function keeps the latter of the two duplicates - ;; which will be the evil binding - (cl-remove-duplicates - (append bindings - (which-key--get-keymap-bindings def all prefix)) - :test (lambda (a b) (string= (car a) (car b)))))) - ((and (keymapp def) - (string-match-p which-key--evil-keys-regexp key-desc))) - ((and (keymapp def) - (or all - ;; event 27 is escape, so this will pick up meta - ;; bindings and hopefully not too much more - (and (numberp ev) (= ev 27)))) - (setq bindings - (append bindings - (which-key--get-keymap-bindings def t key)))) - (t - (when def - (cl-pushnew - (cons key-desc - (cond - ((keymapp def) "Prefix Command") - ((symbolp def) (copy-sequence (symbol-name def))) - ((eq 'lambda (car-safe def)) "lambda") - ((eq 'menu-item (car-safe def)) "menu-item") - ((stringp def) def) - (t "unknown"))) - bindings :test (lambda (a b) (string= (car a) (car b))))))))) - keymap) - bindings)) - -(defun which-key--compute-binding (binding) - "Replace BINDING with remapped binding if it exists. - -Requires `which-key-compute-remaps' to be non-nil" - (let (remap) - (if (and which-key-compute-remaps - (setq remap (command-remapping (intern binding)))) - (copy-sequence (symbol-name remap)) - binding))) - -(defun which-key--get-current-bindings (&optional prefix) - "Generate a list of current active bindings." - (let ((key-str-qt (regexp-quote (key-description prefix))) - (buffer (current-buffer)) - (ignore-bindings '("self-insert-command" "ignore" - "ignore-event" "company-ignore")) - (ignore-sections-regexp - (eval-when-compile - (regexp-opt '("Key translations" "Function key map translations" - "Input decoding map translations"))))) - (with-temp-buffer - (setq-local indent-tabs-mode t) - (setq-local tab-width 8) - (describe-buffer-bindings buffer prefix) - (goto-char (point-min)) - (let ((header-p (not (= (char-after) ?\f))) - bindings header) - (while (not (eobp)) - (cond - (header-p - (setq header (buffer-substring-no-properties - (point) - (line-end-position))) - (setq header-p nil) - (forward-line 3)) - ((= (char-after) ?\f) - (setq header-p t)) - ((looking-at "^[ \t]*$")) - ((or (not (string-match-p ignore-sections-regexp header)) prefix) - (let ((binding-start (save-excursion - (and (re-search-forward "\t+" nil t) - (match-end 0)))) - key binding) - (when binding-start - (setq key (buffer-substring-no-properties - (point) binding-start)) - (setq binding (buffer-substring-no-properties - binding-start - (line-end-position))) - (save-match-data - (cond - ((member binding ignore-bindings)) - ((string-match-p which-key--ignore-keys-regexp key)) - ((and prefix - (string-match (format "^%s[ \t]\\([^ \t]+\\)[ \t]+$" - key-str-qt) key)) - (unless (assoc-string (match-string 1 key) bindings) - (push (cons (match-string 1 key) - (which-key--compute-binding binding)) - bindings))) - ((and prefix - (string-match - (format - "^%s[ \t]\\([^ \t]+\\) \\.\\. %s[ \t]\\([^ \t]+\\)[ \t]+$" - key-str-qt key-str-qt) key)) - (let ((stripped-key (concat (match-string 1 key) - " \.\. " - (match-string 2 key)))) - (unless (assoc-string stripped-key bindings) - (push (cons stripped-key - (which-key--compute-binding binding)) - bindings)))) - ((string-match - "^\\([^ \t]+\\|[^ \t]+ \\.\\. [^ \t]+\\)[ \t]+$" key) - (unless (assoc-string (match-string 1 key) bindings) - (push (cons (match-string 1 key) - (which-key--compute-binding binding)) - bindings))))))))) - (forward-line)) - (nreverse bindings))))) - -(defun which-key--get-bindings (&optional prefix keymap filter recursive) - "Collect key bindings. -If KEYMAP is nil, collect from current buffer using the current -key sequence as a prefix. Otherwise, collect from KEYMAP. FILTER -is a function to use to filter the bindings. If RECURSIVE is -non-nil, then bindings are collected recursively for all prefixes." - (let* ((unformatted - (cond ((keymapp keymap) - (which-key--get-keymap-bindings keymap recursive)) - (keymap - (error "%s is not a keymap" keymap)) - (t - (which-key--get-current-bindings prefix))))) - (when filter - (setq unformatted (cl-remove-if-not filter unformatted))) - (when which-key-sort-order - (setq unformatted - (sort unformatted which-key-sort-order))) - (which-key--format-and-replace unformatted prefix recursive))) - -;;; Functions for laying out which-key buffer pages - -(defun which-key--normalize-columns (columns) - "Pad COLUMNS to the same length using empty strings." - (let ((max-len (cl-reduce (lambda (a x) (max a (length x))) columns - :initial-value 0))) - (mapcar - (lambda (c) - (if (< (length c) max-len) - (append c (make-list (- max-len (length c)) "")) - c)) - columns))) - -(defsubst which-key--join-columns (columns) - "Transpose columns into rows, concat rows into lines and rows into page." - (let* ((padded (which-key--normalize-columns (nreverse columns))) - (rows (apply #'cl-mapcar #'list padded))) - (mapconcat (lambda (row) (mapconcat #'identity row " ")) rows "\n"))) - -(defsubst which-key--max-len (keys index) - "Internal function for finding the max length of the INDEX -element in each list element of KEYS." - (cl-reduce - (lambda (x y) (max x (which-key--string-width (nth index y)))) - keys :initial-value 0)) - -(defun which-key--pad-column (col-keys) - "Take a column of (key separator description) COL-KEYS, -calculate the max width in the column and pad all cells out to -that width." - (let* ((col-key-width (+ which-key-add-column-padding - (which-key--max-len col-keys 0))) - (col-sep-width (which-key--max-len col-keys 1)) - (col-desc-width (which-key--max-len col-keys 2)) - (col-width (+ 1 col-key-width col-sep-width col-desc-width))) - (cons col-width - (mapcar (lambda (k) - (format (concat "%" (int-to-string col-key-width) - "s%s%-" (int-to-string col-desc-width) "s") - (nth 0 k) (nth 1 k) (nth 2 k))) - col-keys)))) - -(defun which-key--partition-list (n list) - "Partition LIST into N-sized sublists." - (let (res) - (while list - (setq res (cons (cl-subseq list 0 (min n (length list))) res) - list (nthcdr n list))) - (nreverse res))) - -(defun which-key--list-to-pages (keys avl-lines avl-width) - "Convert list of KEYS to columns based on dimensions AVL-LINES and AVL-WIDTH. -Returns a `which-key--pages' object that holds the page strings, -as well as metadata." - (let ((cols-w-widths (mapcar #'which-key--pad-column - (which-key--partition-list avl-lines keys))) - (page-width 0) (n-pages 0) (n-keys 0) (n-columns 0) - page-cols pages page-widths keys/page col) - (if (> (apply #'max (mapcar #'car cols-w-widths)) avl-width) - ;; give up if no columns fit - nil - (while cols-w-widths - ;; start new page - (cl-incf n-pages) - (setq col (pop cols-w-widths)) - (setq page-cols (list (cdr col))) - (setq page-width (car col)) - (setq n-keys (length (cdr col))) - (setq n-columns 1) - ;; add additional columns as long as they fit - (while (and cols-w-widths - (or (null which-key-max-display-columns) - (< n-columns which-key-max-display-columns)) - (<= (+ (caar cols-w-widths) page-width) avl-width)) - (setq col (pop cols-w-widths)) - (push (cdr col) page-cols) - (cl-incf page-width (car col)) - (cl-incf n-keys (length (cdr col))) - (cl-incf n-columns)) - (push (which-key--join-columns page-cols) pages) - (push n-keys keys/page) - (push page-width page-widths)) - (make-which-key--pages - :pages (nreverse pages) - :height avl-lines - :widths (nreverse page-widths) - :keys/page (reverse keys/page) - :page-nums (number-sequence 1 n-pages) - :num-pages n-pages - :total-keys (apply #'+ keys/page))))) - -(defun which-key--create-pages-1 - (keys available-lines available-width &optional min-lines vertical) - "Create page strings using `which-key--list-to-pages'. -Will try to find the best number of rows and columns using the -given dimensions and the length and widths of ITEMS. Use VERTICAL -if the ITEMS are laid out vertically and the number of columns -should be minimized." - (let ((result (which-key--list-to-pages - keys available-lines available-width)) - (min-lines (or min-lines 0)) - found prev-result) - (if (or (null result) - vertical - (> (which-key--pages-num-pages result) 1) - (= 1 available-lines)) - result - ;; simple search for a fitting page - (while (and (> available-lines min-lines) - (not found)) - (setq available-lines (- available-lines 1) - prev-result result - result (which-key--list-to-pages - keys available-lines available-width) - found (> (which-key--pages-num-pages result) 1))) - (if found prev-result result)))) - -(defun which-key--create-pages (keys &optional prefix-keys prefix-title) - "Create page strings using `which-key--list-to-pages'. -Will try to find the best number of rows and columns using the -given dimensions and the length and wdiths of KEYS. SEL-WIN-WIDTH -is the width of the live window." - (let* ((max-dims (which-key--popup-max-dimensions)) - (max-lines (car max-dims)) - (max-width (cdr max-dims)) - (prefix-desc (key-description prefix-keys)) - (full-prefix (which-key--full-prefix prefix-desc)) - (prefix (when (eq which-key-show-prefix 'left) - (+ 2 (which-key--string-width full-prefix)))) - (prefix-top-bottom (member which-key-show-prefix '(bottom top))) - (avl-lines (if prefix-top-bottom (- max-lines 1) max-lines)) - (min-lines (min avl-lines which-key-min-display-lines)) - (avl-width (if prefix (- max-width prefix) max-width)) - (vertical (and (eq which-key-popup-type 'side-window) - (member which-key-side-window-location '(left right)))) - result) - (setq result - (which-key--create-pages-1 - keys avl-lines avl-width min-lines vertical)) - (when (and result - (> (which-key--pages-num-pages result) 0)) - (setf (which-key--pages-prefix result) prefix-keys) - (setf (which-key--pages-prefix-title result) - (or prefix-title - (which-key--maybe-get-prefix-title - (key-description prefix-keys)))) - result))) - -(defun which-key--lighter-status () - "Possibly show number of keys and total in the mode line." - (when which-key-show-remaining-keys - (let ((n-shown (car (which-key--pages-keys/page which-key--pages-obj))) - (n-tot (which-key--pages-total-keys which-key--pages-obj))) - (setcar (cdr (assq 'which-key-mode minor-mode-alist)) - (format " WK: %s/%s keys" n-shown n-tot))))) - -(defun which-key--lighter-restore () - "Restore the lighter for which-key." - (when which-key-show-remaining-keys - (setcar (cdr (assq 'which-key-mode minor-mode-alist)) - which-key-lighter))) - -(defun which-key--echo (text) - "Echo TEXT to minibuffer without logging." - (let (message-log-max) - (message "%s" text))) - -(defun which-key--next-page-hint (prefix-keys) - "Return string for next page hint." - (let* ((paging-key (concat prefix-keys " " which-key-paging-key)) - (paging-key-bound (eq 'which-key-C-h-dispatch - (key-binding (kbd paging-key)))) - (key (if paging-key-bound which-key-paging-key "C-h"))) - (when which-key-use-C-h-commands - (which-key--propertize (format "[%s paging/help]" key) - 'face 'which-key-note-face)))) - -(eval-and-compile - (if (fboundp 'universal-argument--description) - (defalias 'which-key--universal-argument--description - 'universal-argument--description) - (defun which-key--universal-argument--description () - ;; Backport of the definition of universal-argument--description in - ;; emacs25 on 2015-12-04 - (when prefix-arg - (concat "C-u" - (pcase prefix-arg - (`(-) " -") - (`(,(and (pred integerp) n)) - (let ((str "")) - (while (and (> n 4) (= (mod n 4) 0)) - (setq str (concat str " C-u")) - (setq n (/ n 4))) - (if (= n 4) str (format " %s" prefix-arg)))) - (_ (format " %s" prefix-arg)))))))) - -(defun which-key--full-prefix (prefix-keys &optional -prefix-arg dont-prop-keys) - "Return a description of the full key sequence up to now, -including prefix arguments." - (let* ((left (eq which-key-show-prefix 'left)) - (prefix-arg (if -prefix-arg -prefix-arg prefix-arg)) - (str (concat - (which-key--universal-argument--description) - (when prefix-arg " ") - prefix-keys)) - (dash (if (and (not (string= prefix-keys "")) - (null left)) "-" ""))) - (if (or (eq which-key-show-prefix 'echo) dont-prop-keys) - (concat str dash) - (concat (which-key--propertize-key str) - (which-key--propertize dash 'face 'which-key-key-face))))) - -(defun which-key--get-popup-map () - "Generate transient-map for use in the top level binding display." - (unless which-key--automatic-display - (let ((map (make-sparse-keymap))) - (define-key map (kbd which-key-paging-key) #'which-key-C-h-dispatch) - (when which-key-use-C-h-commands - ;; Show next page even when C-h is pressed - (define-key map (kbd "C-h") #'which-key-C-h-dispatch)) - map))) - -(defun which-key--process-page (pages-obj) - "Add information to the basic list of key bindings, including -if applicable the current prefix, the name of the current prefix, -and a page count." - (let* ((page (car (which-key--pages-pages pages-obj))) - (height (which-key--pages-height pages-obj)) - (n-pages (which-key--pages-num-pages pages-obj)) - (page-n (car (which-key--pages-page-nums pages-obj))) - (prefix-desc (key-description (which-key--pages-prefix pages-obj))) - (prefix-title (which-key--pages-prefix-title pages-obj)) - (full-prefix (which-key--full-prefix prefix-desc)) - (nxt-pg-hint (which-key--next-page-hint prefix-desc)) - ;; not used in left case - (status-line - (concat (which-key--propertize prefix-title 'face 'which-key-note-face) - (when (< 1 n-pages) - (which-key--propertize (format " (%s of %s)" page-n n-pages) - 'face 'which-key-note-face))))) - (pcase which-key-show-prefix - (`left - (let* ((page-cnt (which-key--propertize (format "%s/%s" page-n n-pages) - 'face 'which-key-separator-face)) - (first-col-width (+ 2 (max (which-key--string-width full-prefix) - (which-key--string-width page-cnt)))) - (prefix (format (concat "%-" (int-to-string first-col-width) "s") - full-prefix)) - (page-cnt (if (> n-pages 1) - (format - (concat "%-" (int-to-string first-col-width) "s") - page-cnt) - (make-string first-col-width 32))) - lines first-line new-end) - (if (= 1 height) - (cons (concat prefix page) nil) - (setq lines (split-string page "\n") - first-line (concat prefix (car lines) "\n" page-cnt) - new-end (concat "\n" (make-string first-col-width 32))) - (cons - (concat first-line (mapconcat #'identity (cdr lines) new-end)) - nil)))) - (`top - (cons - (concat (when (or (= 0 echo-keystrokes) - (not (eq which-key-side-window-location 'bottom))) - (concat full-prefix " ")) - status-line " " nxt-pg-hint "\n" page) - nil)) - (`bottom - (cons - (concat page "\n" - (when (or (= 0 echo-keystrokes) - (not (eq which-key-side-window-location 'bottom))) - (concat full-prefix " ")) - status-line " " nxt-pg-hint) - nil)) - (`echo - (cons page - (lambda () - (which-key--echo - (concat full-prefix (when prefix-desc " ") - status-line (when status-line " ") - nxt-pg-hint))))) - (`mode-line - (cons page - (lambda () - (with-current-buffer which-key--buffer - (setq-local mode-line-format - (concat " " full-prefix - " " status-line - " " nxt-pg-hint)))))) - (_ (cons page nil))))) - -(defun which-key--show-page (&optional n) - "Show current page. N changes the current page to the Nth page -relative to the current one." - (which-key--init-buffer) ;; in case it was killed - (let ((prefix-keys (which-key--current-key-string)) - golden-ratio-mode) - (if (null which-key--pages-obj) - (message "%s- which-key can't show keys: There is not \ -enough space based on your settings and frame size." prefix-keys) - (when n - (setq which-key--pages-obj - (which-key--pages-set-current-page which-key--pages-obj n))) - (let ((page-echo (which-key--process-page which-key--pages-obj)) - (height (which-key--pages-height which-key--pages-obj)) - (width (car (which-key--pages-widths which-key--pages-obj)))) - (which-key--lighter-status) - (if (eq which-key-popup-type 'minibuffer) - (which-key--echo (car page-echo)) - (with-current-buffer which-key--buffer - (erase-buffer) - (insert (car page-echo)) - (goto-char (point-min))) - (when (cdr page-echo) (funcall (cdr page-echo))) - (which-key--show-popup (cons height width))))) - ;; used for paging at top-level - (if (fboundp 'set-transient-map) - (set-transient-map (which-key--get-popup-map)) - (with-no-warnings - (set-temporary-overlay-map (which-key--get-popup-map)))))) - -;;; Paging functions - -;;;###autoload -(defun which-key-reload-key-sequence (&optional key-seq) - "Simulate entering the key sequence KEY-SEQ. -KEY-SEQ should be a list of events as produced by -`listify-key-sequence'. If nil, KEY-SEQ defaults to -`which-key--current-key-list'. Any prefix arguments that were -used are reapplied to the new key sequence." - (let* ((key-seq (or key-seq (which-key--current-key-list))) - (next-event (mapcar (lambda (ev) (cons t ev)) key-seq))) - (setq prefix-arg current-prefix-arg - unread-command-events next-event))) - -(defun which-key-turn-page (delta) - "Show the next page of keys." - (which-key-reload-key-sequence) - (if which-key--last-try-2-loc - (let ((which-key-side-window-location which-key--last-try-2-loc) - (which-key--multiple-locations t)) - (which-key--show-page delta)) - (which-key--show-page delta)) - (which-key--start-paging-timer)) - -;;;###autoload -(defun which-key-show-standard-help (&optional _) - "Call the command in `which-key--prefix-help-cmd-backup'. -Usually this is `describe-prefix-bindings'." - (interactive) - (let ((which-key-inhibit t)) - (which-key--hide-popup-ignore-command) - (cond ((eq which-key--prefix-help-cmd-backup - 'describe-prefix-bindings) - ;; This is essentially what `describe-prefix-bindings' does - (describe-bindings - (kbd (which-key--current-key-string)))) - ((functionp which-key--prefix-help-cmd-backup) - (funcall which-key--prefix-help-cmd-backup))))) - -;;;###autoload -(defun which-key-show-next-page-no-cycle () - "Show next page of keys unless on the last page, in which case -call `which-key-show-standard-help'." - (interactive) - (let ((which-key-inhibit t)) - (if (which-key--on-last-page) - (which-key-show-standard-help) - (which-key-turn-page 1)))) - -;;;###autoload -(defun which-key-show-previous-page-no-cycle () - "Show previous page of keys unless on the first page, in which -case do nothing." - (interactive) - (let ((which-key-inhibit t)) - (unless (which-key--on-first-page) - (which-key-turn-page -1)))) - -;;;###autoload -(defun which-key-show-next-page-cycle (&optional _) - "Show the next page of keys, cycling from end to beginning -after last page." - (interactive) - (let ((which-key-inhibit t)) - (which-key-turn-page 1))) - -;;;###autoload -(defun which-key-show-previous-page-cycle (&optional _) - "Show the previous page of keys, cycling from beginning to end -after first page." - (interactive) - (let ((which-key-inhibit t)) - (which-key-turn-page -1))) - -;;;###autoload -(defun which-key-show-top-level (&optional _) - "Show top-level bindings." - (interactive) - (which-key--create-buffer-and-show nil nil nil "Top-level bindings")) - -;;;###autoload -(defun which-key-show-major-mode () - "Show top-level bindings in the map of the current major mode. - -This function will also detect evil bindings made using -`evil-define-key' in this map. These bindings will depend on the -current evil state. " - (interactive) - (let ((map-sym (intern (format "%s-map" major-mode)))) - (if (and (boundp map-sym) (keymapp (symbol-value map-sym))) - (which-key--create-buffer-and-show - nil nil - (apply-partially #'which-key--map-binding-p (symbol-value map-sym)) - "Major-mode bindings") - (message "which-key: No map named %s" map-sym)))) - -;;;###autoload -(defun which-key-undo-key (&optional _) - "Undo last keypress and force which-key update." - (interactive) - (let* ((key-lst (butlast (which-key--current-key-list))) - (which-key-inhibit t)) - (cond (which-key--prior-show-keymap-args - (if (keymapp (cdr (car-safe which-key--prior-show-keymap-args))) - (let ((args (pop which-key--prior-show-keymap-args))) - (which-key--show-keymap (car args) (cdr args))) - (which-key--hide-popup))) - (key-lst - (which-key-reload-key-sequence key-lst) - (which-key--create-buffer-and-show (apply #'vector key-lst))) - (t (setq which-key--automatic-display nil) - (which-key-show-top-level))))) -(defalias 'which-key-undo 'which-key-undo-key) - -(defun which-key-abort (&optional _) - "Abort key sequence." - (interactive) - (let ((which-key-inhibit t)) - (which-key--hide-popup-ignore-command) - (keyboard-quit))) - -(defun which-key-digit-argument (key) - "Version of `digit-argument' for use in `which-key-C-h-map'." - (interactive) - (let ((last-command-event (string-to-char key))) - (digit-argument key)) - (let ((current-prefix-arg prefix-arg)) - (which-key-reload-key-sequence))) - -(defun which-key-toggle-docstrings (&optional _) - "Toggle the display of docstrings." - (interactive) - (unless (eq which-key-show-docstrings 'docstring-only) - (setq which-key-show-docstrings (null which-key-show-docstrings))) - (which-key-reload-key-sequence) - (which-key--create-buffer-and-show (which-key--current-prefix))) - -;;;###autoload -(defun which-key-C-h-dispatch () - "Dispatch C-h commands by looking up key in -`which-key-C-h-map'. This command is always accessible (from any -prefix) if `which-key-use-C-h-commands' is non nil." - (interactive) - (if (not (which-key--popup-showing-p)) - (which-key-show-standard-help) - (let* ((prefix-keys (which-key--current-key-string)) - (full-prefix (which-key--full-prefix prefix-keys current-prefix-arg t)) - (prompt (concat (when (string-equal prefix-keys "") - (which-key--propertize - (concat " " - (which-key--pages-prefix-title - which-key--pages-obj)) - 'face 'which-key-note-face)) - full-prefix - (which-key--propertize - (substitute-command-keys - (concat - " \\" - " \\[which-key-show-next-page-cycle]" - which-key-separator "next-page," - " \\[which-key-show-previous-page-cycle]" - which-key-separator "previous-page," - " \\[which-key-undo-key]" - which-key-separator "undo-key," - " \\[which-key-toggle-docstrings]" - which-key-separator "toggle-docstrings," - " \\[which-key-show-standard-help]" - which-key-separator "help," - " \\[which-key-abort]" - which-key-separator "abort" - " 1..9" - which-key-separator "digit-arg")) - 'face 'which-key-note-face))) - (key (string (read-key prompt))) - (cmd (lookup-key which-key-C-h-map key)) - (which-key-inhibit t)) - (if cmd (funcall cmd key) (which-key-turn-page 0))))) - -;;; Update - -(defun which-key--any-match-p (regexps string) - "Non-nil if any of REGEXPS match STRING." - (catch 'match - (dolist (regexp regexps) - (when (string-match-p regexp string) - (throw 'match t))))) - -(defun which-key--try-2-side-windows - (bindings prefix-keys prefix-title loc1 loc2 &rest _ignore) - "Try to show BINDINGS (PAGE-N) in LOC1 first. - -Only if no bindings fit fallback to LOC2." - (let (pages1) - (let ((which-key-side-window-location loc1) - (which-key--multiple-locations t)) - (setq pages1 (which-key--create-pages - bindings prefix-keys prefix-title))) - (if pages1 - (progn - (setq which-key--pages-obj pages1) - (let ((which-key-side-window-location loc1) - (which-key--multiple-locations t)) - (which-key--show-page)) - loc1) - (let ((which-key-side-window-location loc2) - (which-key--multiple-locations t)) - (setq which-key--pages-obj - (which-key--create-pages bindings prefix-keys prefix-title)) - (which-key--show-page) - loc2)))) - -(defun which-key--read-keymap () - "Read keymap symbol from minibuffer." - (intern - (completing-read "Keymap: " obarray - (lambda (m) - (and (boundp m) - (keymapp (symbol-value m)) - (not (equal (symbol-value m) - (make-sparse-keymap))))) - t - (let ((sym (symbol-at-point))) - (and (boundp sym) - (keymapp (symbol-value sym)) - (symbol-name sym))) - 'which-key-keymap-history))) - -;;;###autoload -(defun which-key-show-keymap (keymap) - "Show the top-level bindings in KEYMAP using which-key. KEYMAP -is selected interactively from all available keymaps." - (interactive (list (which-key--read-keymap))) - (which-key--show-keymap (symbol-name keymap) - (symbol-value keymap))) - -;;;###autoload -(defun which-key-show-full-keymap (keymap) - "Show all bindings in KEYMAP using which-key. KEYMAP is -selected interactively from all available keymaps." - (interactive (list (which-key--read-keymap))) - (which-key--show-keymap (symbol-name keymap) - (symbol-value keymap) - nil t)) - -;;;###autoload -(defun which-key-show-minor-mode-keymap () - "Show the top-level bindings in KEYMAP using which-key. KEYMAP -is selected interactively by mode in `minor-mode-map-alist'." - (interactive) - (let ((mode-sym - (intern - (completing-read - "Minor Mode: " - (mapcar 'car - (cl-remove-if-not - (lambda (entry) - (and (symbol-value (car entry)) - (not (equal (cdr entry) (make-sparse-keymap))))) - minor-mode-map-alist)) - nil t nil 'which-key-keymap-history)))) - (which-key--show-keymap (symbol-name mode-sym) - (cdr (assq mode-sym minor-mode-map-alist))))) - -(defun which-key--show-keymap (keymap-name keymap &optional prior-args all) - (when prior-args (push prior-args which-key--prior-show-keymap-args)) - (let ((bindings (which-key--get-bindings nil keymap nil all))) - (if (= (length bindings) 0) - (message "which-key: No bindings found in %s" keymap-name) - (cond ((listp which-key-side-window-location) - (setq which-key--last-try-2-loc - (apply #'which-key--try-2-side-windows - bindings nil keymap-name - which-key-side-window-location))) - (t (setq which-key--pages-obj - (which-key--create-pages bindings nil keymap-name)) - (which-key--show-page))) - (let* ((key (key-description (list (read-key)))) - (next-def (lookup-key keymap (kbd key)))) - (cond ((and which-key-use-C-h-commands (string= "C-h" key)) - (which-key-C-h-dispatch)) - ((keymapp next-def) - (which-key--hide-popup-ignore-command) - (which-key--show-keymap (concat keymap-name " " key) next-def - (cons keymap-name keymap))) - (t (which-key--hide-popup))))))) - -(defun which-key--evil-operator-filter (binding) - (let ((def (intern (cdr binding)))) - (and (functionp def) - (not (evil-get-command-property def :suppress-operator))))) - -(defun which-key--show-evil-operator-keymap () - (if which-key--inhibit-next-operator-popup - (setq which-key--inhibit-next-operator-popup nil) - (let ((keymap - (make-composed-keymap (list evil-operator-shortcut-map - evil-operator-state-map - evil-motion-state-map)))) - (when (keymapp keymap) - (let ((formatted-keys - (which-key--get-bindings - nil keymap #'which-key--evil-operator-filter))) - (cond ((= (length formatted-keys) 0) - (message "which-key: Keymap empty")) - ((listp which-key-side-window-location) - (setq which-key--last-try-2-loc - (apply #'which-key--try-2-side-windows - formatted-keys nil "evil operator/motion keys" - which-key-side-window-location))) - (t (setq which-key--pages-obj - (which-key--create-pages - formatted-keys - nil "evil operator/motion keys")) - (which-key--show-page))))) - (let* ((key (key-description (list (read-key))))) - (when (member key '("f" "F" "t" "T" "`")) - ;; these keys trigger commands that read the next char manually - (setq which-key--inhibit-next-operator-popup t)) - (cond ((and which-key-use-C-h-commands (string= "C-h" key)) - (which-key-C-h-dispatch)) - ((string= key "ESC") - (which-key--hide-popup) - (keyboard-quit)) - (t - (which-key--hide-popup) - (setq unread-command-events (listify-key-sequence key)))))))) - -(defun which-key--create-buffer-and-show - (&optional prefix-keys from-keymap filter prefix-title) - "Fill `which-key--buffer' with key descriptions and reformat. -Finally, show the buffer." - (let ((start-time (when which-key--debug (current-time))) - (formatted-keys (which-key--get-bindings - prefix-keys from-keymap filter)) - (prefix-desc (key-description prefix-keys))) - (cond ((= (length formatted-keys) 0) - (message "%s- which-key: There are no keys to show" prefix-desc)) - ((listp which-key-side-window-location) - (setq which-key--last-try-2-loc - (apply #'which-key--try-2-side-windows - formatted-keys prefix-keys prefix-title - which-key-side-window-location))) - (t (setq which-key--pages-obj - (which-key--create-pages - formatted-keys prefix-keys prefix-title)) - (which-key--show-page))) - (when which-key--debug - (message "On prefix \"%s\" which-key took %.0f ms." prefix-desc - (* 1000 (float-time (time-since start-time))))))) - -(defun which-key--this-command-keys () - "Version of `this-single-command-keys' corrected for key-chords and god-mode." - (let ((this-command-keys (this-single-command-keys))) - (when (and (equal this-command-keys [key-chord]) - (bound-and-true-p key-chord-mode)) - (setq this-command-keys - (condition-case nil - (let ((rkeys (recent-keys))) - (vector 'key-chord - ;; Take the two preceding the last one, because the - ;; read-event call in key-chord seems to add a - ;; spurious key press to this list. Note this is - ;; different from guide-key's method which didn't work - ;; for me. - (aref rkeys (- (length rkeys) 3)) - (aref rkeys (- (length rkeys) 2)))) - (error (progn - (message "which-key error in key-chord handling") - [key-chord]))))) - (when (and which-key--god-mode-support-enabled - (bound-and-true-p god-local-mode) - (eq this-command 'god-mode-self-insert)) - (setq this-command-keys (when which-key--god-mode-key-string - (kbd which-key--god-mode-key-string)))) - this-command-keys)) - -(defun which-key--update () - "Function run by timer to possibly trigger -`which-key--create-buffer-and-show'." - (let ((prefix-keys (which-key--this-command-keys)) - delay-time) - (cond ((and (> (length prefix-keys) 0) - (or (keymapp (key-binding prefix-keys)) - ;; Some keymaps are stored here like iso-transl-ctl-x-8-map - (keymapp (which-key--safe-lookup-key - key-translation-map prefix-keys)) - ;; just in case someone uses one of these - (keymapp (which-key--safe-lookup-key - function-key-map prefix-keys))) - (not which-key-inhibit) - (or (null which-key-allow-regexps) - (which-key--any-match-p - which-key-allow-regexps (key-description prefix-keys))) - (or (null which-key-inhibit-regexps) - (not - (which-key--any-match-p - which-key-inhibit-regexps (key-description prefix-keys)))) - ;; Do not display the popup if a command is currently being - ;; executed - (or (and which-key-allow-evil-operators - (bound-and-true-p evil-this-operator)) - (and which-key--god-mode-support-enabled - (bound-and-true-p god-local-mode) - (eq this-command 'god-mode-self-insert)) - (null this-command))) - (when (and (not (equal prefix-keys (which-key--current-prefix))) - (or (null which-key-delay-functions) - (null (setq delay-time - (run-hook-with-args-until-success - 'which-key-delay-functions - (key-description prefix-keys) - (length prefix-keys)))) - (sit-for delay-time))) - (setq which-key--automatic-display t) - (which-key--create-buffer-and-show prefix-keys) - (when (and which-key-idle-secondary-delay - (not which-key--secondary-timer-active)) - (which-key--start-timer which-key-idle-secondary-delay t)))) - ((and which-key-show-transient-maps - (keymapp overriding-terminal-local-map) - ;; basic test for it being a hydra - (not (eq (lookup-key overriding-terminal-local-map "\C-u") - 'hydra--universal-argument))) - (which-key--create-buffer-and-show - nil overriding-terminal-local-map)) - ((and which-key-show-operator-state-maps - (bound-and-true-p evil-state) - (eq evil-state 'operator) - (not (which-key--popup-showing-p))) - (which-key--show-evil-operator-keymap)) - (which-key--automatic-display - (which-key--hide-popup))))) - -;;; Timers - -(defun which-key--start-timer (&optional delay secondary) - "Activate idle timer to trigger `which-key--update'." - (which-key--stop-timer) - (setq which-key--secondary-timer-active secondary) - (setq which-key--timer - (run-with-idle-timer - (if delay - delay - which-key-idle-delay) t #'which-key--update))) - -(defun which-key--stop-timer () - "Deactivate idle timer for `which-key--update'." - (when which-key--timer (cancel-timer which-key--timer))) - -(defun which-key--start-paging-timer () - "Activate timer to restart which-key after paging." - (when which-key--paging-timer (cancel-timer which-key--paging-timer)) - (which-key--stop-timer) - (setq which-key--paging-timer - (run-with-idle-timer - 0.2 t (lambda () - (when (or (not (member real-last-command - which-key--paging-functions)) - (and (< 0 (length (this-single-command-keys))) - (not (equal (which-key--current-prefix) - (which-key--this-command-keys))))) - (cancel-timer which-key--paging-timer) - (which-key--start-timer)))))) - -(provide 'which-key) -;;; which-key.el ends here diff --git a/elpa/which-key-20180608.551/which-key.elc b/elpa/which-key-20180608.551/which-key.elc deleted file mode 100644 index f90c738..0000000 Binary files a/elpa/which-key-20180608.551/which-key.elc and /dev/null differ diff --git a/elpa/which-key-20180621.1238/which-key-autoloads.el b/elpa/which-key-20180621.1238/which-key-autoloads.el deleted file mode 100644 index 4604b44..0000000 --- a/elpa/which-key-20180621.1238/which-key-autoloads.el +++ /dev/null @@ -1,171 +0,0 @@ -;;; which-key-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) - -;;;### (autoloads nil "which-key" "which-key.el" (23353 41747 0 0)) -;;; Generated autoloads from which-key.el - -(defvar which-key-mode nil "\ -Non-nil if Which-Key mode is enabled. -See the `which-key-mode' command -for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `which-key-mode'.") - -(custom-autoload 'which-key-mode "which-key" nil) - -(autoload 'which-key-mode "which-key" "\ -Toggle which-key-mode. - -\(fn &optional ARG)" t nil) - -(autoload 'which-key-setup-side-window-right "which-key" "\ -Apply suggested settings for side-window that opens on right. - -\(fn)" t nil) - -(autoload 'which-key-setup-side-window-right-bottom "which-key" "\ -Apply suggested settings for side-window that opens on right -if there is space and the bottom otherwise. - -\(fn)" t nil) - -(autoload 'which-key-setup-side-window-bottom "which-key" "\ -Apply suggested settings for side-window that opens on -bottom. - -\(fn)" t nil) - -(autoload 'which-key-setup-minibuffer "which-key" "\ -Apply suggested settings for minibuffer. -Do not use this setup if you use the paging commands. Instead use -`which-key-setup-side-window-bottom', which is nearly identical -but more functional. - -\(fn)" t nil) - -(autoload 'which-key-add-key-based-replacements "which-key" "\ -Replace the description of KEY-SEQUENCE with REPLACEMENT. -KEY-SEQUENCE is a string suitable for use in `kbd'. REPLACEMENT -may either be a string, as in - -\(which-key-add-key-based-replacements \"C-x 1\" \"maximize\") - -a cons of two strings as in - -\(which-key-add-key-based-replacements \"C-x 8\" - '(\"unicode\" . \"Unicode keys\")) - -or a function that takes a (KEY . BINDING) cons and returns a -replacement. - -In the second case, the second string is used to provide a longer -name for the keys under a prefix. - -MORE allows you to specifcy additional KEY REPLACEMENT pairs. All -replacements are added to -`which-key-key-based-description-replacement-alist'. - -\(fn KEY-SEQUENCE REPLACEMENT &rest MORE)" nil nil) - -(autoload 'which-key-add-major-mode-key-based-replacements "which-key" "\ -Functions like `which-key-add-key-based-replacements'. -The difference is that MODE specifies the `major-mode' that must -be active for KEY-SEQUENCE and REPLACEMENT (MORE contains -addition KEY-SEQUENCE REPLACEMENT pairs) to apply. - -\(fn MODE KEY-SEQUENCE REPLACEMENT &rest MORE)" nil nil) - -(autoload 'which-key-reload-key-sequence "which-key" "\ -Simulate entering the key sequence KEY-SEQ. -KEY-SEQ should be a list of events as produced by -`listify-key-sequence'. If nil, KEY-SEQ defaults to -`which-key--current-key-list'. Any prefix arguments that were -used are reapplied to the new key sequence. - -\(fn &optional KEY-SEQ)" nil nil) - -(autoload 'which-key-show-standard-help "which-key" "\ -Call the command in `which-key--prefix-help-cmd-backup'. -Usually this is `describe-prefix-bindings'. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-next-page-no-cycle "which-key" "\ -Show next page of keys unless on the last page, in which case -call `which-key-show-standard-help'. - -\(fn)" t nil) - -(autoload 'which-key-show-previous-page-no-cycle "which-key" "\ -Show previous page of keys unless on the first page, in which -case do nothing. - -\(fn)" t nil) - -(autoload 'which-key-show-next-page-cycle "which-key" "\ -Show the next page of keys, cycling from end to beginning -after last page. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-previous-page-cycle "which-key" "\ -Show the previous page of keys, cycling from beginning to end -after first page. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-top-level "which-key" "\ -Show top-level bindings. - -\(fn &optional _)" t nil) - -(autoload 'which-key-show-major-mode "which-key" "\ -Show top-level bindings in the map of the current major mode. - -This function will also detect evil bindings made using -`evil-define-key' in this map. These bindings will depend on the -current evil state. - -\(fn)" t nil) - -(autoload 'which-key-undo-key "which-key" "\ -Undo last keypress and force which-key update. - -\(fn &optional _)" t nil) - -(autoload 'which-key-C-h-dispatch "which-key" "\ -Dispatch C-h commands by looking up key in -`which-key-C-h-map'. This command is always accessible (from any -prefix) if `which-key-use-C-h-commands' is non nil. - -\(fn)" t nil) - -(autoload 'which-key-show-keymap "which-key" "\ -Show the top-level bindings in KEYMAP using which-key. KEYMAP -is selected interactively from all available keymaps. - -\(fn KEYMAP)" t nil) - -(autoload 'which-key-show-full-keymap "which-key" "\ -Show all bindings in KEYMAP using which-key. KEYMAP is -selected interactively from all available keymaps. - -\(fn KEYMAP)" t nil) - -(autoload 'which-key-show-minor-mode-keymap "which-key" "\ -Show the top-level bindings in KEYMAP using which-key. KEYMAP -is selected interactively by mode in `minor-mode-map-alist'. - -\(fn)" t nil) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; which-key-autoloads.el ends here diff --git a/elpa/which-key-20180621.1238/which-key-pkg.el b/elpa/which-key-20180621.1238/which-key-pkg.el deleted file mode 100644 index d5dd538..0000000 --- a/elpa/which-key-20180621.1238/which-key-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "which-key" "20180621.1238" "Display available keybindings in popup" '((emacs "24.4"))) diff --git a/elpa/which-key-20180621.1238/which-key.el b/elpa/which-key-20180621.1238/which-key.el deleted file mode 100644 index a3eaebd..0000000 --- a/elpa/which-key-20180621.1238/which-key.el +++ /dev/null @@ -1,2632 +0,0 @@ -;;; which-key.el --- Display available keybindings in popup -*- lexical-binding: t; -*- - -;; Copyright (C) 2017 Free Software Foundation, Inc. - -;; Author: Justin Burkett -;; Maintainer: Justin Burkett -;; URL: https://github.com/justbur/emacs-which-key -;; Package-Version: 20180621.1238 -;; Version: 3.3.0 -;; Keywords: -;; Package-Requires: ((emacs "24.4")) - -;; 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 . - -;;; Commentary: - -;; which-key provides the minor mode which-key-mode for Emacs. The mode displays -;; the key bindings following your currently entered incomplete command (a -;; prefix) in a popup. For example, after enabling the minor mode if you enter -;; C-x and wait for the default of 1 second the minibuffer will expand with all -;; of the available key bindings that follow C-x (or as many as space allows -;; given your settings). This includes prefixes like C-x 8 which are shown in a -;; different face. Screenshots of what the popup will look like along with -;; information about additional features can be found at -;; https://github.com/justbur/emacs-which-key. -;; - -;;; Code: - -(require 'cl-lib) -(require 'button) -(require 'regexp-opt) - -;; For compiler -(defvar evil-operator-shortcut-map) -(defvar evil-operator-state-map) -(defvar evil-motion-state-map) -(defvar golden-ratio-mode) -(declare-function evil-get-command-property "ext:evil-common.el") - -;;; Options - -(defgroup which-key nil - "Customization options for which-key-mode" - :group 'help - :prefix "which-key-") - -(defcustom which-key-idle-delay 1.0 - "Delay (in seconds) for which-key buffer to popup. A value of zero -might lead to issues, so a non-zero value is recommended -(see https://github.com/justbur/emacs-which-key/issues/134)." - :group 'which-key - :type 'float) - -(defcustom which-key-idle-secondary-delay nil - "Once the which-key buffer shows once for a key sequence reduce -the idle time to this amount (in seconds). This makes it possible -to shorten the delay for subsequent popups in the same key -sequence. The default is for this value to be nil, which disables -this behavior." - :group 'which-key - :type '(choice float (const :tag "Disabled" nil))) - -(defcustom which-key-echo-keystrokes (if (and echo-keystrokes - (> (+ echo-keystrokes 0.01) - which-key-idle-delay)) - (/ (float which-key-idle-delay) 4) - echo-keystrokes) - "Value to use for `echo-keystrokes'. -This only applies if `which-key-popup-type' is minibuffer or -`which-key-show-prefix' is echo. It needs to be less than -`which-key-idle-delay' or else the keystroke echo will erase the -which-key popup." - :group 'which-key - :type 'float) - -(defcustom which-key-max-description-length 27 - "Truncate the description of keys to this length. -Also adds \"..\". If nil, disable any truncation." - :group 'which-key - :type '(choice integer (const :tag "Disable truncation" nil))) - -(defcustom which-key-add-column-padding 0 - "Additional padding (number of spaces) to add to the left of -each key column." - :group 'which-key - :type 'integer) - -(defcustom which-key-unicode-correction 3 - "Correction for wide unicode characters. -Since we measure width in terms of the number of characters, -Unicode characters that are wider than ASCII characters throw off -the calculation for available width in the which-key buffer. This -variable allows you to adjust for the wide unicode characters by -artificially reducing the available width in the buffer. - -The default of 3 means allow for the total extra width -contributed by any wide unicode characters to be up to one -additional ASCII character in the which-key buffer. Increase this -number if you are seeing charaters get cutoff on the right side -of the which-key popup." - :group 'which-key - :type 'integer) - -(defcustom which-key-dont-use-unicode nil - "If non-nil, don't use any unicode characters in default setup." - :group 'which-key - :type 'boolean) - -(defcustom which-key-separator - (if which-key-dont-use-unicode " : " " → ") - "Separator to use between key and description. Default is \" → -\", unless `which-key-dont-use-unicode' is non nil, in which case -the default is \" : \"." - :group 'which-key - :type 'string) - -(defcustom which-key-prefix-prefix "+" - "String to insert in front of prefix commands (i.e., commands -that represent a sub-map). Default is \"+\"." - :group 'which-key - :type 'string) - -(defcustom which-key-compute-remaps nil - "If non-nil, show remapped command if a command has been -remapped given the currently active keymaps." - :group 'which-key - :type 'boolean) - -(defvar which-key-key-replacement-alist nil) -(make-obsolete-variable 'which-key-key-replacement-alist - 'which-key-replacement-alist "2016-11-21") -(defvar which-key-description-replacement-alist nil) -(make-obsolete-variable 'which-key-description-replacement-alist - 'which-key-replacement-alist "2016-11-21") -(defvar which-key-key-based-description-replacement-alist nil) -(make-obsolete-variable 'which-key-key-based-description-replacement-alist - 'which-key-replacement-alist "2016-11-21") - -(defcustom which-key-replacement-alist - (delq nil - `(((nil . "Prefix Command") . (nil . "prefix")) - ((nil . "\\`\\?\\?\\'") . (nil . "lambda")) - ((nil . "which-key-show-next-page-no-cycle") . (nil . "wk next pg")) - ,@(unless which-key-dont-use-unicode - '((("") . ("←")) - (("") . ("→")))) - (("<\\([[:alnum:]-]+\\)>") . ("\\1")))) - "Association list to determine how to manipulate descriptions -of key bindings in the which-key popup. Each element of the list -is a nested cons cell with the format - -\(MATCH CONS . REPLACEMENT\). - -The MATCH CONS determines when a replacement should occur and -REPLACEMENT determines how the replacement should occur. Each may -have the format \(KEY REGEXP . BINDING REGEXP\). For the -replacement to apply the key binding must match both the KEY -REGEXP and the BINDING REGEXP. A value of nil in either position -can be used to match every possibility. The replacement is -performed by using `replace-regexp-in-string' on the KEY REGEXP -from the MATCH CONS and REPLACEMENT when it is a cons cell, and -then similarly for the BINDING REGEXP. A nil value in the BINDING -REGEXP position cancels the replacement. For example, the entry - -\(\(nil . \"Prefix Command\"\) . \(nil . \"prefix\"\)\) - -matches any binding with the descriptions \"Prefix Command\" and -replaces the description with \"prefix\", ignoring the -corresponding key. - -REPLACEMENT may also be a function taking a cons cell -\(KEY . BINDING\) and producing a new corresponding cons cell. - -If REPLACEMENT is anything other than a cons cell \(and non nil\) -the key binding is ignored by which-key. - -Finally, you can multiple replacements to occur for a given key -binding by setting `which-key-allow-multiple-replacements' to a -non-nil value." - :group 'which-key - :type '(alist :key-type (cons (choice regexp (const nil)) - (choice regexp (const nil))) - :value-type (cons (choice string (const nil)) - (choice string (const nil))))) - -(when (bound-and-true-p which-key-key-replacement-alist) - (mapc - (lambda (repl) - (push (cons (cons (car repl) nil) (cons (cdr repl) nil)) - which-key-replacement-alist)) - which-key-key-replacement-alist)) -(when (bound-and-true-p which-key-description-replacement-alist) - (mapc - (lambda (repl) - (push (cons (cons nil (car repl)) (cons nil (cdr repl))) - which-key-replacement-alist)) - which-key-description-replacement-alist)) - -(defcustom which-key-allow-multiple-replacements nil - "Allow a key binding to match and be modified by multiple -elements in `which-key-replacement-alist' if non-nil. When nil, -only the first match is used to perform replacements from -`which-key-replacement-alist'." - :group 'which-key - :type 'boolean) - -(defcustom which-key-show-docstrings nil - "If non-nil, show each command's docstring next to the command -in the which-key buffer. This will only display the docstring up -to the first line break. If you set this variable to the symbol -docstring-only, then the command's name with be omitted. You -probably also want to adjust `which-key-max-description-length' -at the same time if you use this feature." - :group 'which-key - :type '(radio - (const :tag "Do not show docstrings" nil) - (const :tag "Add docstring to command names" t) - (const :tag "Replace command name with docstring" docstring-only))) - -(defcustom which-key-highlighted-command-list '() - "A list of strings and/or cons cells used to highlight certain -commands. If the element is a string, assume it is a regexp -pattern for matching command names and use -`which-key-highlighted-command-face' for any matching names. If -the element is a cons cell, it should take the form (regexp . -face to apply)." - :group 'which-key - :type '(repeat (choice string (cons regexp face)))) - -(defcustom which-key-special-keys '() - "These keys will automatically be truncated to one character -and have `which-key-special-key-face' applied to them. This is -disabled by default. Try this to see the effect. - -\(setq which-key-special-keys '(\"SPC\" \"TAB\" \"RET\" \"ESC\" \"DEL\")\)" - :group 'which-key - :type '(repeat string)) - -(defcustom which-key-buffer-name " *which-key*" - "Name of which-key buffer." - :group 'which-key - :type 'string) - -(defcustom which-key-show-prefix 'echo - "Whether to and where to display the current prefix sequence. -Possible choices are echo for echo area (the default), left, top -and nil. Nil turns the feature off." - :group 'which-key - :type '(radio (const :tag "Left of the keys" left) - (const :tag "In the first line" top) - (const :tag "In the last line" bottom) - (const :tag "In the echo area" echo) - (const :tag "In the mode-line" mode-line) - (const :tag "Hide" nil))) - -(defcustom which-key-popup-type 'side-window - "Supported types are minibuffer, side-window, frame, and custom." - :group 'which-key - :type '(radio (const :tag "Show in minibuffer" minibuffer) - (const :tag "Show in side window" side-window) - (const :tag "Show in popup frame" frame) - (const :tag "Use your custom display functions" custom))) - -(defcustom which-key-min-display-lines 1 - "The minimum number of horizontal lines to display in the - which-key buffer." - :group 'which-key - :type 'integer) - -(defcustom which-key-max-display-columns nil - "The maximum number of columns to display in the which-key -buffer. nil means don't impose a maximum." - :group 'which-key - :type '(choice integer (const :tag "Unbounded" nil))) - -(defcustom which-key-side-window-location 'bottom - "Location of which-key popup when `which-key-popup-type' is side-window. -Should be one of top, bottom, left or right. You can also specify -a list of two locations, like (right bottom). In this case, the -first location is tried. If there is not enough room, the second -location is tried." - :group 'which-key - :type '(radio (const right) - (const bottom) - (const left) - (const top) - (const (right bottom)) - (const (bottom right)))) - -(defcustom which-key-side-window-slot 0 - "The `slot' to use for `display-buffer-in-side-window' when -`which-key-popup-type' is 'side-window. Quoting from the -docstring of `display-buffer-in-side-window', - -‘slot’ if non-nil, specifies the window slot where to display - BUFFER. A value of zero or nil means use the middle slot on - the specified side. A negative value means use a slot - preceding (that is, above or on the left of) the middle slot. - A positive value means use a slot following (that is, below or - on the right of) the middle slot. The default is zero." - :group 'which-key - :type 'integer) - -(defcustom which-key-side-window-max-width 0.333 - "Maximum width of which-key popup when type is side-window and -location is left or right. -This variable can also be a number between 0 and 1. In that case, it denotes -a percentage out of the frame's width." - :group 'which-key - :type 'float) - -(defcustom which-key-side-window-max-height 0.25 - "Maximum height of which-key popup when type is side-window and -location is top or bottom. -This variable can also be a number between 0 and 1. In that case, it denotes -a percentage out of the frame's height." - :group 'which-key - :type 'float) - -(defcustom which-key-frame-max-width 60 - "Maximum width of which-key popup when type is frame." - :group 'which-key - :type 'integer) - -(defcustom which-key-frame-max-height 20 - "Maximum height of which-key popup when type is frame." - :group 'which-key - :type 'integer) - -(defcustom which-key-allow-imprecise-window-fit nil - "If non-nil allow which-key to use a less intensive method of -fitting the popup window to the buffer. If you are noticing lag -when the which-key popup displays turning this on may help. - -See https://github.com/justbur/emacs-which-key/issues/130" - :group 'which-key - :type 'boolean) - -(defcustom which-key-show-remaining-keys nil - "Show remaining keys in last slot, when keys are hidden." - :group 'which-key - :type '(radio (const :tag "Yes" t) - (const :tag "No" nil))) - -(defcustom which-key-sort-order 'which-key-key-order - "If nil, do not resort the output from -`describe-buffer-bindings' which groups by mode. Ordering options -are - -1. `which-key-key-order': by key (default) -2. `which-key-key-order-alpha': by key using alphabetical order -3. `which-key-description-order': by description -4. `which-key-prefix-then-key-order': prefix (no prefix first) then key -5. `which-key-local-then-key-order': local binding then key - -See the README and the docstrings for those functions for more -information." - :group 'which-key - :type '(choice (function-item which-key-key-order) - (function-item which-key-key-order-alpha) - (function-item which-key-description-order) - (function-item which-key-prefix-then-key-order) - (function-item which-key-local-then-key-order))) - -(defcustom which-key-sort-uppercase-first t - "If non-nil, uppercase comes before lowercase in sorting -function chosen in `which-key-sort-order'. Otherwise, the order -is reversed." - :group 'which-key - :type 'boolean) - -(defcustom which-key-paging-prefixes '() - "Enable paging for these prefixes." - :group 'which-key - :type '(repeat string)) - -(defcustom which-key-paging-key "" - "Key to use for changing pages. Bound after each of the -prefixes in `which-key-paging-prefixes'" - :group 'which-key - :type 'string) - -;; (defcustom which-key-undo-key nil -;; "Key (string) to use for undoing keypresses. Bound recursively -;; in each of the maps in `which-key-undo-keymaps'." -;; :group 'which-key -;; :type 'string) - -;; (defcustom which-key-undo-keymaps '() -;; "Keymaps in which to bind `which-key-undo-key'" -;; :group 'which-key -;; :type '(repeat symbol)) - -(defcustom which-key-use-C-h-commands t - "Use C-h for paging if non-nil. Normally C-h after a prefix - calls `describe-prefix-bindings'. This changes that command to - a which-key paging command when which-key-mode is active." - :group 'which-key - :type 'boolean) - -(defcustom which-key-is-verbose nil - "Whether to warn about potential mistakes in configuration." - :group 'which-key - :type 'boolean) - -(defvar which-key-C-h-map - (let ((map (make-sparse-keymap))) - (dolist (bind '(("\C-a" . which-key-abort) - ("a" . which-key-abort) - ("\C-d" . which-key-toggle-docstrings) - ("d" . which-key-toggle-docstrings) - ("\C-h" . which-key-show-standard-help) - ("h" . which-key-show-standard-help) - ("\C-n" . which-key-show-next-page-cycle) - ("n" . which-key-show-next-page-cycle) - ("\C-p" . which-key-show-previous-page-cycle) - ("p" . which-key-show-previous-page-cycle) - ("\C-u" . which-key-undo-key) - ("u" . which-key-undo-key) - ("1" . which-key-digit-argument) - ("2" . which-key-digit-argument) - ("3" . which-key-digit-argument) - ("4" . which-key-digit-argument) - ("5" . which-key-digit-argument) - ("6" . which-key-digit-argument) - ("7" . which-key-digit-argument) - ("8" . which-key-digit-argument) - ("9" . which-key-digit-argument))) - (define-key map (car bind) (cdr bind))) - map) - "Keymap for C-h commands.") - -(defvar which-key--paging-functions '(which-key-C-h-dispatch - which-key-turn-page - which-key-show-next-page-cycle - which-key-show-next-page-no-cycle - which-key-show-previous-page-cycle - which-key-show-previous-page-no-cycle - which-key-undo-key - which-key-undo)) - -(defcustom which-key-hide-alt-key-translations t - "Hide key translations using Alt key if non nil. -These translations are not relevant most of the times since a lot -of terminals issue META modifier for the Alt key. - -See http://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html" - :group 'which-key - :type 'boolean) - -(defcustom which-key-delay-functions nil - "A list of functions that may decide whether to delay the -which-key popup based on the current incomplete key -sequence. Each function in the list is run with two arguments, -the current key sequence as produced by `key-description' and the -length of the key sequence. If the popup should be delayed based -on that key sequence, the function should return the delay time -in seconds. Returning nil means no delay. The first function in -this list to return a value is the value that is used. - -The delay time is effectively added to the normal -`which-key-idle-delay'." - :group 'which-key - :type '(repeat function)) - -(defcustom which-key-allow-regexps nil - "A list of regexp strings to use to filter key sequences. When -non-nil, for a key sequence to trigger the which-key popup it -must match one of the regexps in this list. The format of the key -sequences is what is produced by `key-description'." - :group 'which-key - :type '(repeat regexp)) - -(defcustom which-key-inhibit-regexps nil - "Similar to `which-key-allow-regexps', a list of regexp strings -to use to filter key sequences. When non-nil, for a key sequence -to trigger the which-key popup it cannot match one of the regexps -in this list. The format of the key sequences is what is produced -by `key-description'." - :group 'which-key - :type '(repeat regexp)) - -(defcustom which-key-show-transient-maps nil - "Show keymaps created by `set-transient-map' when applicable. - -More specifically, detect when `overriding-terminal-local-map' is -set (this is the keymap used by `set-transient-map') and display -it." - :group 'which-key - :type 'boolean) - -(defcustom which-key-enable-extended-define-key nil - "Advise `define-key' to make which-key aware of definitions of the form - - \(define-key KEYMAP KEY '(\"DESCRIPTION\" . DEF)) - -With the advice, this definition will have the side effect of -creating a replacement in `which-key-replacement-alist' that -replaces DEF with DESCRIPTION when the key sequence ends in -KEY. Using a cons cell like this is a valid definition for -`define-key'. All this does is to make which-key aware of it. - -Since many higher level keybinding functions use `define-key' -internally, this will affect most if not all of those as well. - -This variable must be set before loading which-key." - :group 'which-key - :type 'boolean) - -;; Hooks -(defcustom which-key-init-buffer-hook '() - "Hook run when which-key buffer is initialized." - :group 'which-key - :type 'hook) - -;;;; Faces - -(defgroup which-key-faces nil - "Faces for which-key-mode" - :group 'which-key - :prefix "which-key-") - -(defface which-key-key-face - '((t . (:inherit font-lock-constant-face))) - "Face for which-key keys" - :group 'which-key-faces) - -(defface which-key-separator-face - '((t . (:inherit font-lock-comment-face))) - "Face for the separator (default separator is an arrow)" - :group 'which-key-faces) - -(defface which-key-note-face - '((t . (:inherit which-key-separator-face))) - "Face for notes or hints occasionally provided" - :group 'which-key-faces) - -(defface which-key-command-description-face - '((t . (:inherit font-lock-function-name-face))) - "Face for the key description when it is a command" - :group 'which-key-faces) - -(defface which-key-local-map-description-face - '((t . (:inherit which-key-command-description-face))) - "Face for the key description when it is found in `current-local-map'" - :group 'which-key-faces) - -(defface which-key-highlighted-command-face - '((t . (:inherit which-key-command-description-face :underline t))) - "Default face for the command description when it is a command -and it matches a string in `which-key-highlighted-command-list'." - :group 'which-key-faces) - -(defface which-key-group-description-face - '((t . (:inherit font-lock-keyword-face))) - "Face for the key description when it is a group or prefix" - :group 'which-key-faces) - -(defface which-key-special-key-face - '((t . (:inherit which-key-key-face :inverse-video t :weight bold))) - "Face for special keys (SPC, TAB, RET)" - :group 'which-key-faces) - -(defface which-key-docstring-face - '((t . (:inherit which-key-note-face))) - "Face for docstrings" - :group 'which-key-faces) - -;;;; Custom popup - -(defcustom which-key-custom-popup-max-dimensions-function nil - "Variable to hold a custom max-dimensions function. -Will be passed the width of the active window and is expected to -return the maximum height in lines and width in characters of the -which-key popup in the form a cons cell (height . width)." - :group 'which-key - :type '(choice function (const nil))) - -(defcustom which-key-custom-hide-popup-function nil - "Variable to hold a custom hide-popup function. -It takes no arguments and the return value is ignored." - :group 'which-key - :type '(choice function (const nil))) - -(defcustom which-key-custom-show-popup-function nil - "Variable to hold a custom show-popup function. -Will be passed the required dimensions in the form (height . -width) in lines and characters respectively. The return value is -ignored." - :group 'which-key - :type '(choice function (const nil))) - -(defcustom which-key-lighter " WK" - "Minor mode lighter to use in the mode-line." - :group 'which-key - :type 'string) - -(defvar which-key-inhibit nil - "Prevent which-key from popping up momentarily by setting this -to a non-nil value for the execution of a command. Like this - -\(let \(\(which-key-inhibit t\)\) -...\)") - -(defvar which-key-keymap-history nil - "History of keymap selections in functions like -`which-key-show-keymap'.") - -;;; Internal Vars - -(defvar which-key--buffer nil - "Internal: Holds reference to which-key buffer.") -(defvar which-key--timer nil - "Internal: Holds reference to open window timer.") -(defvar which-key--secondary-timer-active nil - "Internal: Non-nil if the secondary timer is active.") -(defvar which-key--paging-timer nil - "Internal: Holds reference to timer for paging.") -(defvar which-key--frame nil - "Internal: Holds reference to which-key frame. -Used when `which-key-popup-type' is frame.") -(defvar which-key--echo-keystrokes-backup nil - "Internal: Backup the initial value of `echo-keystrokes'.") -(defvar which-key--prefix-help-cmd-backup nil - "Internal: Backup the value of `prefix-help-command'.") -(defvar which-key--last-try-2-loc nil - "Internal: Last location of side-window when two locations -used.") -(defvar which-key--automatic-display nil - "Internal: Non-nil if popup was triggered with automatic -update.") -(defvar which-key--multiple-locations nil) -(defvar which-key--inhibit-next-operator-popup nil) -(defvar which-key--prior-show-keymap-args nil) -(defvar which-key--previous-frame-size nil) -(defvar which-key--prefix-title-alist nil) -(defvar which-key--debug nil) -(defvar which-key--evil-keys-regexp (eval-when-compile - (regexp-opt '("-state")))) -(defvar which-key--ignore-non-evil-keys-regexp - (eval-when-compile - (regexp-opt '("mouse-" "wheel-" "remap" "drag-" "scroll-bar" - "select-window" "switch-frame" "which-key-")))) -(defvar which-key--ignore-keys-regexp - (eval-when-compile - (regexp-opt '("mouse-" "wheel-" "remap" "drag-" "scroll-bar" - "select-window" "switch-frame" "-state" - "which-key-")))) - -(make-obsolete-variable 'which-key-prefix-name-alist nil "2016-10-05") -(make-obsolete-variable 'which-key-prefix-title-alist nil "2016-10-05") - -(defvar which-key--pages-obj nil) -(cl-defstruct which-key--pages - pages - height - widths - keys/page - page-nums - num-pages - total-keys - prefix - prefix-title) - -(defun which-key--rotate (list n) - (let* ((len (length list)) - (n (if (< n 0) (+ len n) n)) - (n (mod n len))) - (append (last list (- len n)) (butlast list (- len n))))) - -(defun which-key--pages-set-current-page (pages-obj n) - (setf (which-key--pages-pages pages-obj) - (which-key--rotate (which-key--pages-pages pages-obj) n)) - (setf (which-key--pages-widths pages-obj) - (which-key--rotate (which-key--pages-widths pages-obj) n)) - (setf (which-key--pages-keys/page pages-obj) - (which-key--rotate (which-key--pages-keys/page pages-obj) n)) - (setf (which-key--pages-page-nums pages-obj) - (which-key--rotate (which-key--pages-page-nums pages-obj) n)) - pages-obj) - -(defsubst which-key--on-first-page () - (= (which-key--pages-page-nums which-key--pages-obj) 1)) - -(defsubst which-key--on-last-page () - (= (which-key--pages-page-nums which-key--pages-obj) - (which-key--pages-num-pages which-key--pages-obj))) - -(defsubst which-key--current-prefix () - (when which-key--pages-obj - (which-key--pages-prefix which-key--pages-obj))) - -;;; Third-party library support -;;;; Evil - -(defcustom which-key-allow-evil-operators (boundp 'evil-this-operator) - "Allow popup to show for evil operators. The popup is normally - inhibited in the middle of commands, but setting this to - non-nil will override this behavior for evil operators." - :group 'which-key - :type 'boolean) - -(defcustom which-key-show-operator-state-maps nil - "Experimental: Try to show the right keys following an evil -command that reads a motion, such as \"y\", \"d\" and \"c\" from -normal state. This is experimental, because there might be some -valid keys missing and it might be showing some invalid keys." - :group 'which-key - :type 'boolean) - -;;;;; God-mode - -(defvar which-key--god-mode-support-enabled nil - "Support god-mode if non-nil. This is experimental, -so you need to explicitly opt-in for now. Please report any -problems at github.") - -(defvar which-key--god-mode-key-string nil - "Holds key string to use for god-mode support.") - -(defadvice god-mode-lookup-command - (around which-key--god-mode-lookup-command-advice disable) - (setq which-key--god-mode-key-string (ad-get-arg 0)) - (unwind-protect - ad-do-it - (when (bound-and-true-p which-key-mode) - (which-key--hide-popup)))) - -(defun which-key-enable-god-mode-support (&optional disable) - "Enable support for god-mode if non-nil. This is experimental, -so you need to explicitly opt-in for now. Please report any -problems at github. If DISABLE is non-nil disable support." - (interactive "P") - (setq which-key--god-mode-support-enabled (null disable)) - (if disable - (ad-disable-advice - 'god-mode-lookup-command - 'around 'which-key--god-mode-lookup-command-advice) - (ad-enable-advice - 'god-mode-lookup-command - 'around 'which-key--god-mode-lookup-command-advice)) - (ad-activate 'god-mode-lookup-command)) - -;;; Mode - -;;;###autoload -(define-minor-mode which-key-mode - "Toggle which-key-mode." - :global t - :lighter which-key-lighter - :keymap (let ((map (make-sparse-keymap))) - (mapc - (lambda (prefix) - (define-key map - (kbd (concat prefix " " which-key-paging-key)) - #'which-key-C-h-dispatch)) - which-key-paging-prefixes) - map) - (if which-key-mode - (progn - (setq which-key--echo-keystrokes-backup echo-keystrokes) - (when (or (eq which-key-show-prefix 'echo) - (eq which-key-popup-type 'minibuffer)) - (which-key--setup-echo-keystrokes)) - (unless (member prefix-help-command which-key--paging-functions) - (setq which-key--prefix-help-cmd-backup prefix-help-command)) - (when which-key-use-C-h-commands - (setq prefix-help-command #'which-key-C-h-dispatch)) - (when which-key-show-remaining-keys - (add-hook 'pre-command-hook #'which-key--lighter-restore)) - (add-hook 'pre-command-hook #'which-key--hide-popup) - (add-hook 'focus-out-hook #'which-key--stop-timer) - (add-hook 'focus-in-hook #'which-key--start-timer) - (add-hook 'window-size-change-functions - 'which-key--hide-popup-on-frame-size-change) - (which-key--start-timer)) - (setq echo-keystrokes which-key--echo-keystrokes-backup) - (when which-key--prefix-help-cmd-backup - (setq prefix-help-command which-key--prefix-help-cmd-backup)) - (when which-key-show-remaining-keys - (remove-hook 'pre-command-hook #'which-key--lighter-restore)) - (remove-hook 'pre-command-hook #'which-key--hide-popup) - (remove-hook 'focus-out-hook #'which-key--stop-timer) - (remove-hook 'focus-in-hook #'which-key--start-timer) - (remove-hook 'window-size-change-functions - 'which-key--hide-popup-on-frame-size-change) - (which-key--stop-timer))) - -(defun which-key--init-buffer () - "Initialize which-key buffer" - (unless (buffer-live-p which-key--buffer) - (setq which-key--buffer (get-buffer-create which-key-buffer-name)) - (with-current-buffer which-key--buffer - ;; suppress confusing minibuffer message - (let (message-log-max) - (toggle-truncate-lines 1) - (message "")) - (setq-local cursor-type nil) - (setq-local cursor-in-non-selected-windows nil) - (setq-local mode-line-format nil) - (setq-local word-wrap nil) - (setq-local show-trailing-whitespace nil) - (run-hooks 'which-key-init-buffer-hook)))) - -(defun which-key--setup-echo-keystrokes () - "Reduce `echo-keystrokes' if necessary (it will interfere if -it's set too high)." - (when (and echo-keystrokes - (> (abs (- echo-keystrokes which-key-echo-keystrokes)) 0.000001)) - (if (> which-key-idle-delay which-key-echo-keystrokes) - (setq echo-keystrokes which-key-echo-keystrokes) - (setq which-key-echo-keystrokes (/ (float which-key-idle-delay) 4) - echo-keystrokes which-key-echo-keystrokes)))) - -(defun which-key-remove-default-unicode-chars () - "Use of `which-key-dont-use-unicode' is preferred to this -function, but it's included here in case someone cannot set that -variable early enough in their configuration, if they are using a -starter kit for example." - (when (string-equal which-key-separator " → ") - (setq which-key-separator " : ")) - (setq which-key-key-replacement-alist - (delete '("left" . "←") which-key-key-replacement-alist)) - (setq which-key-key-replacement-alist - (delete '("right" . "→") which-key-key-replacement-alist))) - -;;; Default configuration functions for use by users. - -;;;###autoload -(defun which-key-setup-side-window-right () - "Apply suggested settings for side-window that opens on right." - (interactive) - (setq which-key-popup-type 'side-window - which-key-side-window-location 'right - which-key-show-prefix 'top)) - -;;;###autoload -(defun which-key-setup-side-window-right-bottom () - "Apply suggested settings for side-window that opens on right -if there is space and the bottom otherwise." - (interactive) - (setq which-key-popup-type 'side-window - which-key-side-window-location '(right bottom) - which-key-show-prefix 'top)) - -;;;###autoload -(defun which-key-setup-side-window-bottom () - "Apply suggested settings for side-window that opens on -bottom." - (interactive) - (which-key--setup-echo-keystrokes) - (setq which-key-popup-type 'side-window - which-key-side-window-location 'bottom - which-key-show-prefix 'echo)) - -;;;###autoload -(defun which-key-setup-minibuffer () - "Apply suggested settings for minibuffer. -Do not use this setup if you use the paging commands. Instead use -`which-key-setup-side-window-bottom', which is nearly identical -but more functional." - (interactive) - (which-key--setup-echo-keystrokes) - (setq which-key-popup-type 'minibuffer - which-key-show-prefix 'left)) - -;;; Helper functions to modify replacement lists. - -;;;###autoload -(defun which-key-add-key-based-replacements - (key-sequence replacement &rest more) - "Replace the description of KEY-SEQUENCE with REPLACEMENT. -KEY-SEQUENCE is a string suitable for use in `kbd'. REPLACEMENT -may either be a string, as in - -\(which-key-add-key-based-replacements \"C-x 1\" \"maximize\"\) - -a cons of two strings as in - -\(which-key-add-key-based-replacements \"C-x 8\" - '(\"unicode\" . \"Unicode keys\")\) - -or a function that takes a \(KEY . BINDING\) cons and returns a -replacement. - -In the second case, the second string is used to provide a longer -name for the keys under a prefix. - -MORE allows you to specifcy additional KEY REPLACEMENT pairs. All -replacements are added to -`which-key-key-based-description-replacement-alist'." - ;; TODO: Make interactive - (while key-sequence - ;; normalize key sequences before adding - (let ((key-seq (key-description (kbd key-sequence))) - (replace (or (and (functionp replacement) replacement) - (car-safe replacement) - replacement))) - (push (cons (cons (concat "\\`" (regexp-quote key-seq) "\\'") nil) - (if (functionp replace) replace (cons nil replace))) - which-key-replacement-alist) - (when (and (not (functionp replacement)) (consp replacement)) - (push (cons key-seq (cdr-safe replacement)) - which-key--prefix-title-alist))) - (setq key-sequence (pop more) replacement (pop more)))) -(put 'which-key-add-key-based-replacements 'lisp-indent-function 'defun) - -;;;###autoload -(defun which-key-add-major-mode-key-based-replacements - (mode key-sequence replacement &rest more) - "Functions like `which-key-add-key-based-replacements'. -The difference is that MODE specifies the `major-mode' that must -be active for KEY-SEQUENCE and REPLACEMENT (MORE contains -addition KEY-SEQUENCE REPLACEMENT pairs) to apply." - ;; TODO: Make interactive - (when (not (symbolp mode)) - (error "MODE should be a symbol corresponding to a value of major-mode")) - (let ((mode-alist - (or (cdr-safe (assq mode which-key-replacement-alist)) (list))) - (title-mode-alist - (or (cdr-safe (assq mode which-key--prefix-title-alist)) (list)))) - (while key-sequence - ;; normalize key sequences before adding - (let ((key-seq (key-description (kbd key-sequence))) - (replace (or (and (functionp replacement) replacement) - (car-safe replacement) - replacement))) - (push (cons (cons (concat "\\`" (regexp-quote key-seq) "\\'") nil) - (if (functionp replace) replace (cons nil replace))) - mode-alist) - (when (and (not (functionp replacement)) (consp replacement)) - (push (cons key-seq (cdr-safe replacement)) - title-mode-alist))) - (setq key-sequence (pop more) replacement (pop more))) - (if (assq mode which-key-replacement-alist) - (setcdr (assq mode which-key-replacement-alist) mode-alist) - (push (cons mode mode-alist) which-key-replacement-alist)) - (if (assq mode which-key--prefix-title-alist) - (setcdr (assq mode which-key--prefix-title-alist) title-mode-alist) - (push (cons mode title-mode-alist) which-key--prefix-title-alist)))) -(put 'which-key-add-major-mode-key-based-replacements - 'lisp-indent-function 'defun) - -(defalias 'which-key-add-prefix-title 'which-key-add-key-based-replacements) -(make-obsolete 'which-key-add-prefix-title - 'which-key-add-key-based-replacements - "2016-10-05") - -(defalias 'which-key-declare-prefixes 'which-key-add-key-based-replacements) -(make-obsolete 'which-key-declare-prefixes - 'which-key-add-key-based-replacements - "2016-10-05") - -(defalias 'which-key-declare-prefixes-for-mode - 'which-key-add-major-mode-key-based-replacements) -(make-obsolete 'which-key-declare-prefixes-for-mode - 'which-key-add-major-mode-key-based-replacements - "2016-10-05") - -(defun which-key-define-key-recursively (map key def &optional at-root) - "Recursively bind KEY in MAP to DEF on every level of MAP except the first. -If AT-ROOT is non-nil the binding is also placed at the root of MAP." - (when at-root (define-key map key def)) - (map-keymap - (lambda (_ev df) - (when (keymapp df) - (which-key-define-key-recursively df key def t))) - map)) - -(defun which-key--process-define-key-args (keymap key def) - "When DEF takes the form (\"DESCRIPTION\". DEF), make sure -which-key uses \"DESCRIPTION\" for this binding. This function is -meant to be used as :before advice for `define-key'." - (with-demoted-errors "Which-key extended define-key error: %s" - (when (and (consp def) - (stringp (car def)) - (symbolp (cdr def))) - (define-key keymap (which-key--pseudo-key key) `(which-key ,def))))) - -(when which-key-enable-extended-define-key - (advice-add #'define-key :before #'which-key--process-define-key-args)) - -;;; Functions for computing window sizes - -(defun which-key--text-width-to-total (text-width) - "Convert window text-width to window total-width. -TEXT-WIDTH is the desired text width of the window. The function -calculates what total width is required for a window in the -selected to have a text-width of TEXT-WIDTH columns. The -calculation considers possible fringes and scroll bars. This -function assumes that the desired window has the same character -width as the frame." - (let ((char-width (frame-char-width))) - (+ text-width - (/ (frame-fringe-width) char-width) - (/ (frame-scroll-bar-width) char-width) - (if (which-key--char-enlarged-p) 1 0) - ;; add padding to account for possible wide (unicode) characters - 3))) - -(defun which-key--total-width-to-text (total-width) - "Convert window total-width to window text-width. -TOTAL-WIDTH is the desired total width of the window. The function calculates -what text width fits such a window. The calculation considers possible fringes -and scroll bars. This function assumes that the desired window has the same -character width as the frame." - (let ((char-width (frame-char-width))) - (- total-width - (/ (frame-fringe-width) char-width) - (/ (frame-scroll-bar-width) char-width) - (if (which-key--char-enlarged-p) 1 0) - ;; add padding to account for possible wide (unicode) characters - 3))) - -(defun which-key--char-enlarged-p (&optional _frame) - (> (frame-char-width) - (/ (float (frame-pixel-width)) (window-total-width (frame-root-window))))) - -(defun which-key--char-reduced-p (&optional _frame) - (< (frame-char-width) - (/ (float (frame-pixel-width)) (window-total-width (frame-root-window))))) - -(defun which-key--char-exact-p (&optional _frame) - (= (frame-char-width) - (/ (float (frame-pixel-width)) (window-total-width (frame-root-window))))) - -(defun which-key--width-or-percentage-to-width (width-or-percentage) - "Return window total width. -If WIDTH-OR-PERCENTAGE is a whole number, return it unchanged. Otherwise, it -should be a percentage (a number between 0 and 1) out of the frame's width. -More precisely, it should be a percentage out of the frame's root window's -total width." - (if (wholenump width-or-percentage) - width-or-percentage - (round (* width-or-percentage (window-total-width (frame-root-window)))))) - -(defun which-key--height-or-percentage-to-height (height-or-percentage) - "Return window total height. -If HEIGHT-OR-PERCENTAGE is a whole number, return it unchanged. Otherwise, it -should be a percentage (a number between 0 and 1) out of the frame's height. -More precisely, it should be a percentage out of the frame's root window's -total height." - (if (wholenump height-or-percentage) - height-or-percentage - (round (* height-or-percentage (window-total-height (frame-root-window)))))) - -(defun which-key--frame-size-changed-p () - "Non-nil if a change in frame size is detected." - (let ((new-size (cons (frame-width) (frame-height)))) - (cond ((null which-key--previous-frame-size) - (setq which-key--previous-frame-size new-size) - nil) - ((not (equal which-key--previous-frame-size new-size)) - (setq which-key--previous-frame-size new-size))))) - -;;; Show/hide which-key buffer - -(defun which-key--hide-popup () - "This function is called to hide the which-key buffer." - (unless (member real-this-command which-key--paging-functions) - (setq which-key--last-try-2-loc nil) - (setq which-key--pages-obj nil) - (setq which-key--automatic-display nil) - (setq which-key--prior-show-keymap-args nil) - (when (and which-key-idle-secondary-delay - which-key--secondary-timer-active) - (which-key--start-timer)) - (which-key--lighter-restore) - (cl-case which-key-popup-type - ;; Not necessary to hide minibuffer - ;; (minibuffer (which-key--hide-buffer-minibuffer)) - (side-window (which-key--hide-buffer-side-window)) - (frame (which-key--hide-buffer-frame)) - (custom (funcall which-key-custom-hide-popup-function))))) - -(defun which-key--hide-popup-ignore-command () - "Version of `which-key--hide-popup' without the check of -`real-this-command'." - (cl-case which-key-popup-type - (side-window (which-key--hide-buffer-side-window)) - (frame (which-key--hide-buffer-frame)) - (custom (funcall which-key-custom-hide-popup-function)))) - -(defun which-key--hide-popup-on-frame-size-change (&optional _) - "Hide which-key popup if the frame is resized (to trigger a new -popup)." - (when (which-key--frame-size-changed-p) - (which-key--hide-popup))) - -(defun which-key--hide-buffer-side-window () - "Hide which-key buffer when side-window popup is used." - (when (buffer-live-p which-key--buffer) - ;; in case which-key buffer was shown in an existing window, `quit-window' - ;; will re-show the previous buffer, instead of closing the window - (quit-windows-on which-key--buffer))) - -(defun which-key--hide-buffer-frame () - "Hide which-key buffer when frame popup is used." - (when (frame-live-p which-key--frame) - (delete-frame which-key--frame))) - -(defun which-key--popup-showing-p () - (window-live-p (get-buffer-window which-key--buffer))) - -(defun which-key--show-popup (act-popup-dim) - "Show the which-key buffer. -ACT-POPUP-DIM includes the dimensions, (height . width) of the -buffer text to be displayed in the popup. Return nil if no window -is shown, or if there is no need to start the closing timer." - (when (and (> (car act-popup-dim) 0) (> (cdr act-popup-dim) 0)) - (cl-case which-key-popup-type - ;; Not called for minibuffer - ;; (minibuffer (which-key--show-buffer-minibuffer act-popup-dim)) - (side-window (which-key--show-buffer-side-window act-popup-dim)) - (frame (which-key--show-buffer-frame act-popup-dim)) - (custom (funcall which-key-custom-show-popup-function act-popup-dim))))) - -(defun which-key--fit-buffer-to-window-horizontally - (&optional window &rest params) - "Slightly modified version of `fit-buffer-to-window'. -Use &rest params because `fit-buffer-to-window' has a different -call signature in different emacs versions" - (let ((fit-window-to-buffer-horizontally t)) - (apply #'fit-window-to-buffer window params))) - -(defun which-key--show-buffer-side-window (act-popup-dim) - "Show which-key buffer when popup type is side-window." - (let* ((height (car act-popup-dim)) - (width (cdr act-popup-dim)) - (alist - (if which-key-allow-imprecise-window-fit - `((window-width . ,(which-key--text-width-to-total width)) - (window-height . ,height) - (side . ,which-key-side-window-location) - (slot . ,which-key-side-window-slot)) - `((window-width . which-key--fit-buffer-to-window-horizontally) - (window-height . (lambda (w) (fit-window-to-buffer w nil 1))) - (side . ,which-key-side-window-location) - (slot . ,which-key-side-window-slot))))) - ;; Previously used `display-buffer-in-major-side-window' here, but - ;; apparently that is meant to be an internal function. See emacs bug #24828 - ;; and advice given there. - (cond - ((eq which-key--multiple-locations t) - ;; possibly want to switch sides in this case so we can't reuse the window - (delete-windows-on which-key--buffer) - (display-buffer-in-side-window which-key--buffer alist)) - ((get-buffer-window which-key--buffer) - (display-buffer-reuse-window which-key--buffer alist)) - (t - (display-buffer-in-side-window which-key--buffer alist))))) - -(defun which-key--show-buffer-frame (act-popup-dim) - "Show which-key buffer when popup type is frame." - (let* (;(orig-window (selected-window)) - (frame-height (+ (car act-popup-dim) - (if (with-current-buffer which-key--buffer - mode-line-format) - 1 - 0))) - ;; without adding 2, frame sometimes isn't wide enough for the buffer. - ;; this is probably because of the fringes. however, setting fringes - ;; sizes to 0 (instead of adding 2) didn't always make the frame wide - ;; enough. don't know why it is so. - (frame-width (+ (cdr act-popup-dim) 2)) - (new-window (if (and (frame-live-p which-key--frame) - (eq which-key--buffer - (window-buffer - (frame-root-window which-key--frame)))) - (which-key--show-buffer-reuse-frame - frame-height frame-width) - (which-key--show-buffer-new-frame - frame-height frame-width)))) - (when new-window - ;; display successful - (setq which-key--frame (window-frame new-window)) - new-window))) - -(defun which-key--show-buffer-new-frame (frame-height frame-width) - "Helper for `which-key--show-buffer-frame'." - (let* ((frame-params `((height . ,frame-height) - (width . ,frame-width) - ;; tell the window manager to respect the given sizes - (user-size . t) - ;; which-key frame doesn't need a minibuffer - (minibuffer . nil) - (name . "which-key") - ;; no need for scroll bars in which-key frame - (vertical-scroll-bars . nil) - ;; (left-fringe . 0) - ;; (right-fringe . 0) - ;; (right-divider-width . 0) - ;; make sure frame is visible - (visibility . t))) - (alist `((pop-up-frame-parameters . ,frame-params))) - (orig-frame (selected-frame)) - (new-window (display-buffer-pop-up-frame which-key--buffer alist))) - (when new-window - ;; display successful - (redirect-frame-focus (window-frame new-window) orig-frame) - new-window))) - -(defun which-key--show-buffer-reuse-frame (frame-height frame-width) - "Helper for `which-key--show-buffer-frame'." - (let ((window - (display-buffer-reuse-window - which-key--buffer `((reusable-frames . ,which-key--frame))))) - (when window - ;; display successful - (set-frame-size (window-frame window) frame-width frame-height) - window))) - -;;; Max dimension of available window functions - -(defun which-key--popup-max-dimensions () - "Dimesion functions should return the maximum possible (height -. width) of the intended popup. SELECTED-WINDOW-WIDTH is the -width of currently active window, not the which-key buffer -window." - (cl-case which-key-popup-type - (minibuffer (which-key--minibuffer-max-dimensions)) - (side-window (which-key--side-window-max-dimensions)) - (frame (which-key--frame-max-dimensions)) - (custom (funcall which-key-custom-popup-max-dimensions-function - (window-width))))) - -(defun which-key--minibuffer-max-dimensions () - "Return max-dimensions of minibuffer (height . width). -Measured in lines and characters respectively." - (cons - ;; height - (if (floatp max-mini-window-height) - (floor (* (frame-text-lines) - max-mini-window-height)) - max-mini-window-height) - ;; width - (max 0 (- (frame-text-cols) which-key-unicode-correction)))) - -(defun which-key--side-window-max-dimensions () - "Return max-dimensions of the side-window popup (height . -width) in lines and characters respectively." - (cons - ;; height - (if (member which-key-side-window-location '(left right)) - ;; 1 is a kludge to make sure there is no overlap - (- (frame-height) (window-text-height (minibuffer-window)) 1) - ;; (window-mode-line-height which-key--window)) - ;; FIXME: change to something like - ;; (min which-*-height (calculate-max-height)) - (which-key--height-or-percentage-to-height - which-key-side-window-max-height)) - ;; width - (max 0 - (- (if (member which-key-side-window-location '(left right)) - (which-key--total-width-to-text - (which-key--width-or-percentage-to-width - which-key-side-window-max-width)) - (which-key--total-width-to-text - (which-key--width-or-percentage-to-width - 1.0))) - which-key-unicode-correction)))) - -(defun which-key--frame-max-dimensions () - "Return max-dimensions of the frame popup (height . -width) in lines and characters respectively." - (cons which-key-frame-max-height which-key-frame-max-width)) - -;;; Sorting functions - -(defun which-key--string< (a b &optional alpha) - (let* ((da (downcase a)) - (db (downcase b))) - (cond ((string-equal da db) - (if which-key-sort-uppercase-first - (string-lessp a b) - (not (string-lessp a b)))) - (alpha (string-lessp da db)) - (t (string-lessp a b))))) - -(defun which-key--key-description< (a b &optional alpha) - "Sorting function used for `which-key-key-order' and -`which-key-key-order-alpha'." - (save-match-data - (let* ((rngrgxp "^\\([^ ]+\\) \\.\\. [^ ]+") - (a (if (string-match rngrgxp a) (match-string 1 a) a)) - (b (if (string-match rngrgxp b) (match-string 1 b) b)) - (aem? (string-equal a "")) - (bem? (string-equal b "")) - (a1? (= 1 (length a))) - (b1? (= 1 (length b))) - (srgxp "^\\(RET\\|SPC\\|TAB\\|DEL\\|LFD\\|ESC\\|NUL\\)") - (asp? (string-match-p srgxp a)) - (bsp? (string-match-p srgxp b)) - (prrgxp "^\\(M\\|C\\|S\\|A\\|H\\|s\\)-") - (apr? (string-match-p prrgxp a)) - (bpr? (string-match-p prrgxp b)) - (afn? (string-match-p "" a)) - (bfn? (string-match-p "" b))) - (cond ((or aem? bem?) (and aem? (not bem?))) - ((and asp? bsp?) - (if (string-equal (substring a 0 3) (substring b 0 3)) - (which-key--key-description< - (substring a 3) (substring b 3) alpha) - (which-key--string< a b alpha))) - ((or asp? bsp?) asp?) - ((and a1? b1?) (which-key--string< a b alpha)) - ((or a1? b1?) a1?) - ((and afn? bfn?) - (< (string-to-number - (replace-regexp-in-string "" "\\1" a)) - (string-to-number - (replace-regexp-in-string "" "\\1" b)))) - ((or afn? bfn?) afn?) - ((and apr? bpr?) - (if (string-equal (substring a 0 2) (substring b 0 2)) - (which-key--key-description< - (substring a 2) (substring b 2) alpha) - (which-key--string< a b alpha))) - ((or apr? bpr?) apr?) - (t (which-key--string< a b alpha)))))) - -(defsubst which-key-key-order-alpha (acons bcons) - "Order key descriptions A and B. -Order is lexicographic within a \"class\", where the classes and -the ordering of classes are listed below. - -special (SPC,TAB,...) < single char < mod (C-,M-,...) < other. -Sorts single characters alphabetically with lowercase coming -before upper." - (which-key--key-description< (car acons) (car bcons) t)) - -(defsubst which-key-key-order (acons bcons) - "Order key descriptions A and B. -Order is lexicographic within a \"class\", where the classes and -the ordering of classes are listed below. - -special (SPC,TAB,...) < single char < mod (C-,M-,...) < other." - (which-key--key-description< (car acons) (car bcons))) - -(defsubst which-key-description-order (acons bcons) - "Order descriptions of A and B. -Uses `string-lessp' after applying lowercase." - (string-lessp (downcase (cdr acons)) (downcase (cdr bcons)))) - -(defsubst which-key--group-p (description) - (or (string-match-p "^\\(group:\\|Prefix\\)" description) - (keymapp (intern description)))) - -(defun which-key-prefix-then-key-order (acons bcons) - "Order first by whether A and/or B is a prefix with no prefix -coming before a prefix. Within these categories order using -`which-key-key-order'." - (let ((apref? (which-key--group-p (cdr acons))) - (bpref? (which-key--group-p (cdr bcons)))) - (if (not (eq apref? bpref?)) - (and (not apref?) bpref?) - (which-key-key-order acons bcons)))) - -(defun which-key-prefix-then-key-order-reverse (acons bcons) - "Order first by whether A and/or B is a prefix with prefix -coming before a prefix. Within these categories order using -`which-key-key-order'." - (let ((apref? (which-key--group-p (cdr acons))) - (bpref? (which-key--group-p (cdr bcons)))) - (if (not (eq apref? bpref?)) - (and apref? (not bpref?)) - (which-key-key-order acons bcons)))) - -(defun which-key-local-then-key-order (acons bcons) - "Order first by whether A and/or B is a local binding with -local bindings coming first. Within these categories order using -`which-key-key-order'." - (let ((aloc? (which-key--local-binding-p acons)) - (bloc? (which-key--local-binding-p bcons))) - (if (not (eq aloc? bloc?)) - (and aloc? (not bloc?)) - (which-key-key-order acons bcons)))) - -;;; Functions for retrieving and formatting keys - -(defsubst which-key--string-width (maybe-string) - "If MAYBE-STRING is a string use `which-key--string-width' o/w return 0." - (if (stringp maybe-string) (string-width maybe-string) 0)) - -(defsubst which-key--safe-lookup-key (keymap key) - "Version of `lookup-key' that allows KEYMAP to be nil. KEY is not checked." - (when (keymapp keymap) (lookup-key keymap key))) - -(defsubst which-key--butlast-string (str) - (mapconcat #'identity (butlast (split-string str)) " ")) - -(defun which-key--get-replacements (key-binding &optional use-major-mode) - (let ((alist (or (and use-major-mode - (cdr-safe - (assq major-mode which-key-replacement-alist))) - which-key-replacement-alist)) - res case-fold-search) - (catch 'res - (dolist (replacement alist) - ;; these are mode specific ones to ignore. The mode specific case is - ;; handled in the selection of alist - (unless (symbolp (car replacement)) - (let ((key-regexp (caar replacement)) - (binding-regexp (cdar replacement))) - (when (and (or (null key-regexp) - (string-match-p key-regexp - (car key-binding))) - (or (null binding-regexp) - (string-match-p binding-regexp - (cdr key-binding)))) - (push replacement res) - (when (not which-key-allow-multiple-replacements) - (throw 'res res))))))) - (nreverse res))) - -(defun which-key--get-pseudo-binding (key-binding &optional prefix) - (let* ((pseudo-binding - (key-binding (which-key--pseudo-key (kbd (car key-binding)) prefix))) - (pseudo-binding (when pseudo-binding (cadr pseudo-binding))) - (pseudo-desc (when pseudo-binding (car pseudo-binding))) - (pseudo-def (when pseudo-binding (cdr pseudo-binding))) - (real-def (key-binding (kbd (car key-binding)))) - ;; treat keymaps as if they're nil bindings. This creates the - ;; possibility that we rename the wrong binding but this seems - ;; unlikely. - (real-def (unless (keymapp real-def) real-def))) - (when (and pseudo-binding - (eq pseudo-def real-def)) - (cons (car key-binding) pseudo-desc)))) - -(defun which-key--maybe-replace (key-binding &optional prefix) - "Use `which-key--replacement-alist' to maybe replace KEY-BINDING. -KEY-BINDING is a cons cell of the form \(KEY . BINDING\) each of -which are strings. KEY is of the form produced by `key-binding'." - (let* ((pseudo-binding (which-key--get-pseudo-binding key-binding prefix))) - (if pseudo-binding - pseudo-binding - (let* ((mode-res (which-key--get-replacements key-binding t)) - (all-repls (or mode-res - (which-key--get-replacements key-binding)))) - (dolist (repl all-repls key-binding) - (setq key-binding - (cond ((or (not (consp repl)) (null (cdr repl))) - key-binding) - ((functionp (cdr repl)) - (funcall (cdr repl) key-binding)) - ((consp (cdr repl)) - (cons - (cond ((and (caar repl) (cadr repl)) - (replace-regexp-in-string - (caar repl) (cadr repl) (car key-binding) t)) - ((cadr repl) (cadr repl)) - (t (car key-binding))) - (cond ((and (cdar repl) (cddr repl)) - (replace-regexp-in-string - (cdar repl) (cddr repl) (cdr key-binding) t)) - ((cddr repl) (cddr repl)) - (t (cdr key-binding)))))))))))) - -(defsubst which-key--current-key-list (&optional key-str) - (append (listify-key-sequence (which-key--current-prefix)) - (when key-str - (listify-key-sequence (kbd key-str))))) - -(defsubst which-key--current-key-string (&optional key-str) - (key-description (which-key--current-key-list key-str))) - -(defun which-key--local-binding-p (keydesc) - (eq (which-key--safe-lookup-key - (current-local-map) (kbd (which-key--current-key-string (car keydesc)))) - (intern (cdr keydesc)))) - -(defun which-key--map-binding-p (map keydesc) - "Does MAP contain KEYDESC = (key . binding)?" - (or - (when (bound-and-true-p evil-state) - (let ((lookup - (which-key--safe-lookup-key - map - (kbd (which-key--current-key-string - (format "<%s-state> %s" evil-state (car keydesc))))))) - (or (eq lookup (intern (cdr keydesc))) - (and (keymapp lookup) (string= (cdr keydesc) "Prefix Command"))))) - (let ((lookup - (which-key--safe-lookup-key - map (kbd (which-key--current-key-string (car keydesc)))))) - (or (eq lookup (intern (cdr keydesc))) - (and (keymapp lookup) (string= (cdr keydesc) "Prefix Command")))))) - -(defun which-key--pseudo-key (key &optional prefix) - "Replace the last key in the sequence KEY by a special symbol -in order for which-key to allow looking up a description for the key." - (let* ((seq (listify-key-sequence key)) - (final (intern (format "which-key-%s" (key-description (last seq)))))) - (if prefix - (vconcat prefix (list final)) - (vconcat (butlast seq) (list final))))) - -(defun which-key--maybe-get-prefix-title (keys) - "KEYS is a string produced by `key-description'. -A title is possibly returned using -`which-key--prefix-title-alist'. An empty stiring is returned if -no title exists." - (cond - ((not (string-equal keys "")) - (let* ((title-res - (cdr-safe (assoc-string keys which-key--prefix-title-alist))) - (repl-res - (cdr-safe (which-key--maybe-replace (cons keys "")))) - (binding (key-binding (kbd keys))) - (alternate (when (and binding (symbolp binding)) - (symbol-name binding)))) - (cond (title-res title-res) - ((not (string-equal repl-res "")) repl-res) - ((and (eq which-key-show-prefix 'echo) alternate) - alternate) - ((and (member which-key-show-prefix '(bottom top)) - (eq which-key-side-window-location 'bottom) - echo-keystrokes) - (if alternate alternate - (concat "Following " keys))) - (t "")))) - (t ""))) - -(defun which-key--propertize (string &rest properties) - "Version of `propertize' that checks type of STRING." - (when (stringp string) - (apply #'propertize string properties))) - -(defun which-key--propertize-key (key) - "Add a face to KEY. -If KEY contains any \"special keys\" defined in -`which-key-special-keys' then truncate and add the corresponding -`which-key-special-key-face'." - (let ((key-w-face (which-key--propertize key 'face 'which-key-key-face)) - (regexp (concat "\\(" - (mapconcat 'identity which-key-special-keys - "\\|") "\\)")) - case-fold-search) - (save-match-data - (if (and which-key-special-keys - (string-match regexp key)) - (let ((beg (match-beginning 0)) (end (match-end 0))) - (concat (substring key-w-face 0 beg) - (which-key--propertize (substring key-w-face beg (1+ beg)) - 'face 'which-key-special-key-face) - (substring key-w-face end - (which-key--string-width key-w-face)))) - key-w-face)))) - -(defsubst which-key--truncate-description (desc) - "Truncate DESC description to `which-key-max-description-length'." - (let* ((last-face (get-text-property (1- (length desc)) 'face desc)) - (dots (which-key--propertize ".." 'face last-face))) - (if (and which-key-max-description-length - (> (length desc) which-key-max-description-length)) - (concat (substring desc 0 which-key-max-description-length) dots) - desc))) - -(defun which-key--highlight-face (description) - "Return the highlight face for DESCRIPTION if it has one." - (let (face) - (dolist (el which-key-highlighted-command-list) - (unless face - (cond ((consp el) - (when (string-match-p (car el) description) - (setq face (cdr el)))) - ((stringp el) - (when (string-match-p el description) - (setq face 'which-key-highlighted-command-face))) - (t - (message "which-key: warning: element %s of \ -which-key-highlighted-command-list is not a string or a cons -cell" el))))) - face)) - -(defun which-key--propertize-description - (description group local hl-face &optional original-description) - "Add face to DESCRIPTION where the face chosen depends on -whether the description represents a group or a command. Also -make some minor adjustments to the description string, like -removing a \"group:\" prefix. - -ORIGINAL-DESCRIPTION is the description given by -`describe-buffer-bindings'." - (when description - (let* ((desc description) - (desc (if (string-match-p "^group:" desc) - (substring desc 6) desc)) - (desc (if group (concat which-key-prefix-prefix desc) desc))) - (make-text-button - desc nil - 'face (cond (hl-face hl-face) - (group 'which-key-group-description-face) - (local 'which-key-local-map-description-face) - (t 'which-key-command-description-face)) - 'help-echo (cond - ((and original-description - (fboundp (intern original-description)) - (documentation (intern original-description)) - ;; tooltip-mode doesn't exist in emacs-nox - (boundp 'tooltip-mode) tooltip-mode) - (documentation (intern original-description))) - ((and original-description - (fboundp (intern original-description)) - (documentation (intern original-description)) - (let* ((doc (documentation - (intern original-description))) - (str (replace-regexp-in-string "\n" " " doc)) - (max (floor (* (frame-width) 0.8)))) - (if (> (length str) max) - (concat (substring str 0 max) "...") - str)))))) - desc))) - -(defun which-key--extract-key (key-str) - "Pull the last key (or key range) out of KEY-STR." - (save-match-data - (let ((key-range-regexp "\\`.*\\([^ \t]+ \\.\\. [^ \t]+\\)\\'")) - (if (string-match key-range-regexp key-str) - (match-string 1 key-str) - (car (last (split-string key-str " "))))))) - -(defun which-key--maybe-add-docstring (current original) - "Maybe concat a docstring to CURRENT and return result. -Specifically, do this if ORIGINAL is a command with a docstring -and `which-key-show-docstrings' is non-nil. If -`which-key-show-docstrings' is the symbol docstring-only, just -return the docstring." - (let* ((orig-sym (intern original)) - (doc (when (commandp orig-sym) - (documentation orig-sym))) - (docstring (when doc - (which-key--propertize (car (split-string doc "\n")) - 'face 'which-key-docstring-face)))) - (cond ((not (and which-key-show-docstrings docstring)) - current) - ((eq which-key-show-docstrings 'docstring-only) - docstring) - (t - (format "%s %s" current docstring))))) - -(defun which-key--format-and-replace (unformatted &optional prefix preserve-full-key) - "Take a list of (key . desc) cons cells in UNFORMATTED, add -faces and perform replacements according to the three replacement -alists. Returns a list (key separator description)." - (let ((sep-w-face - (which-key--propertize which-key-separator - 'face 'which-key-separator-face)) - (local-map (current-local-map)) - new-list) - (dolist (key-binding unformatted) - (let* ((key (car key-binding)) - (orig-desc (cdr key-binding)) - (group (which-key--group-p orig-desc)) - ;; At top-level prefix is nil - (keys (if prefix - (concat (key-description prefix) " " key) - key)) - (local (eq (which-key--safe-lookup-key local-map (kbd keys)) - (intern orig-desc))) - (hl-face (which-key--highlight-face orig-desc)) - (key-binding (which-key--maybe-replace (cons keys orig-desc) prefix)) - (final-desc (which-key--propertize-description - (cdr key-binding) group local hl-face orig-desc))) - (when final-desc - (setq final-desc - (which-key--truncate-description - (which-key--maybe-add-docstring final-desc orig-desc)))) - (when (consp key-binding) - (push - (list (which-key--propertize-key - (if preserve-full-key - (car key-binding) - (which-key--extract-key (car key-binding)))) - sep-w-face - final-desc) - new-list)))) - (nreverse new-list))) - -(defun which-key--get-keymap-bindings (keymap &optional all prefix) - "Retrieve top-level bindings from KEYMAP. -If ALL is non-nil, get all bindings, not just the top-level -ones. PREFIX is for internal use and should not be used." - (let (bindings) - (map-keymap - (lambda (ev def) - (let* ((key (append prefix (list ev))) - (key-desc (key-description key))) - (cond ((or (string-match-p - which-key--ignore-non-evil-keys-regexp key-desc) - (eq ev 'menu-bar))) - ;; extract evil keys corresponding to current state - ((and (keymapp def) - (boundp 'evil-state) - (bound-and-true-p evil-local-mode) - (string-match-p (format "<%s-state>$" evil-state) key-desc)) - (setq bindings - ;; this function keeps the latter of the two duplicates - ;; which will be the evil binding - (cl-remove-duplicates - (append bindings - (which-key--get-keymap-bindings def all prefix)) - :test (lambda (a b) (string= (car a) (car b)))))) - ((and (keymapp def) - (string-match-p which-key--evil-keys-regexp key-desc))) - ((and (keymapp def) - (or all - ;; event 27 is escape, so this will pick up meta - ;; bindings and hopefully not too much more - (and (numberp ev) (= ev 27)))) - (setq bindings - (append bindings - (which-key--get-keymap-bindings def t key)))) - (t - (when def - (cl-pushnew - (cons key-desc - (cond - ((keymapp def) "Prefix Command") - ((symbolp def) (copy-sequence (symbol-name def))) - ((eq 'lambda (car-safe def)) "lambda") - ((eq 'menu-item (car-safe def)) "menu-item") - ((stringp def) def) - (t "unknown"))) - bindings :test (lambda (a b) (string= (car a) (car b))))))))) - keymap) - bindings)) - -(defun which-key--compute-binding (binding) - "Replace BINDING with remapped binding if it exists. - -Requires `which-key-compute-remaps' to be non-nil" - (let (remap) - (if (and which-key-compute-remaps - (setq remap (command-remapping (intern binding)))) - (copy-sequence (symbol-name remap)) - binding))) - -(defun which-key--get-current-bindings (&optional prefix) - "Generate a list of current active bindings." - (let ((key-str-qt (regexp-quote (key-description prefix))) - (buffer (current-buffer)) - (ignore-bindings '("self-insert-command" "ignore" - "ignore-event" "company-ignore")) - (ignore-sections-regexp - (eval-when-compile - (regexp-opt '("Key translations" "Function key map translations" - "Input decoding map translations"))))) - (with-temp-buffer - (setq-local indent-tabs-mode t) - (setq-local tab-width 8) - (describe-buffer-bindings buffer prefix) - (goto-char (point-min)) - (let ((header-p (not (= (char-after) ?\f))) - bindings header) - (while (not (eobp)) - (cond - (header-p - (setq header (buffer-substring-no-properties - (point) - (line-end-position))) - (setq header-p nil) - (forward-line 3)) - ((= (char-after) ?\f) - (setq header-p t)) - ((looking-at "^[ \t]*$")) - ((or (not (string-match-p ignore-sections-regexp header)) prefix) - (let ((binding-start (save-excursion - (and (re-search-forward "\t+" nil t) - (match-end 0)))) - key binding) - (when binding-start - (setq key (buffer-substring-no-properties - (point) binding-start)) - (setq binding (buffer-substring-no-properties - binding-start - (line-end-position))) - (save-match-data - (cond - ((member binding ignore-bindings)) - ((string-match-p which-key--ignore-keys-regexp key)) - ((and prefix - (string-match (format "^%s[ \t]\\([^ \t]+\\)[ \t]+$" - key-str-qt) key)) - (unless (assoc-string (match-string 1 key) bindings) - (push (cons (match-string 1 key) - (which-key--compute-binding binding)) - bindings))) - ((and prefix - (string-match - (format - "^%s[ \t]\\([^ \t]+\\) \\.\\. %s[ \t]\\([^ \t]+\\)[ \t]+$" - key-str-qt key-str-qt) key)) - (let ((stripped-key (concat (match-string 1 key) - " \.\. " - (match-string 2 key)))) - (unless (assoc-string stripped-key bindings) - (push (cons stripped-key - (which-key--compute-binding binding)) - bindings)))) - ((string-match - "^\\([^ \t]+\\|[^ \t]+ \\.\\. [^ \t]+\\)[ \t]+$" key) - (unless (assoc-string (match-string 1 key) bindings) - (push (cons (match-string 1 key) - (which-key--compute-binding binding)) - bindings))))))))) - (forward-line)) - (nreverse bindings))))) - -(defun which-key--get-bindings (&optional prefix keymap filter recursive) - "Collect key bindings. -If KEYMAP is nil, collect from current buffer using the current -key sequence as a prefix. Otherwise, collect from KEYMAP. FILTER -is a function to use to filter the bindings. If RECURSIVE is -non-nil, then bindings are collected recursively for all prefixes." - (let* ((unformatted - (cond ((keymapp keymap) - (which-key--get-keymap-bindings keymap recursive)) - (keymap - (error "%s is not a keymap" keymap)) - (t - (which-key--get-current-bindings prefix))))) - (when filter - (setq unformatted (cl-remove-if-not filter unformatted))) - (when which-key-sort-order - (setq unformatted - (sort unformatted which-key-sort-order))) - (which-key--format-and-replace unformatted prefix recursive))) - -;;; Functions for laying out which-key buffer pages - -(defun which-key--normalize-columns (columns) - "Pad COLUMNS to the same length using empty strings." - (let ((max-len (cl-reduce (lambda (a x) (max a (length x))) columns - :initial-value 0))) - (mapcar - (lambda (c) - (if (< (length c) max-len) - (append c (make-list (- max-len (length c)) "")) - c)) - columns))) - -(defsubst which-key--join-columns (columns) - "Transpose columns into rows, concat rows into lines and rows into page." - (let* ((padded (which-key--normalize-columns (nreverse columns))) - (rows (apply #'cl-mapcar #'list padded))) - (mapconcat (lambda (row) (mapconcat #'identity row " ")) rows "\n"))) - -(defsubst which-key--max-len (keys index) - "Internal function for finding the max length of the INDEX -element in each list element of KEYS." - (cl-reduce - (lambda (x y) (max x (which-key--string-width (nth index y)))) - keys :initial-value 0)) - -(defun which-key--pad-column (col-keys) - "Take a column of (key separator description) COL-KEYS, -calculate the max width in the column and pad all cells out to -that width." - (let* ((col-key-width (+ which-key-add-column-padding - (which-key--max-len col-keys 0))) - (col-sep-width (which-key--max-len col-keys 1)) - (col-desc-width (which-key--max-len col-keys 2)) - (col-width (+ 1 col-key-width col-sep-width col-desc-width))) - (cons col-width - (mapcar (lambda (k) - (format (concat "%" (int-to-string col-key-width) - "s%s%-" (int-to-string col-desc-width) "s") - (nth 0 k) (nth 1 k) (nth 2 k))) - col-keys)))) - -(defun which-key--partition-list (n list) - "Partition LIST into N-sized sublists." - (let (res) - (while list - (setq res (cons (cl-subseq list 0 (min n (length list))) res) - list (nthcdr n list))) - (nreverse res))) - -(defun which-key--list-to-pages (keys avl-lines avl-width) - "Convert list of KEYS to columns based on dimensions AVL-LINES and AVL-WIDTH. -Returns a `which-key--pages' object that holds the page strings, -as well as metadata." - (let ((cols-w-widths (mapcar #'which-key--pad-column - (which-key--partition-list avl-lines keys))) - (page-width 0) (n-pages 0) (n-keys 0) (n-columns 0) - page-cols pages page-widths keys/page col) - (if (> (apply #'max (mapcar #'car cols-w-widths)) avl-width) - ;; give up if no columns fit - nil - (while cols-w-widths - ;; start new page - (cl-incf n-pages) - (setq col (pop cols-w-widths)) - (setq page-cols (list (cdr col))) - (setq page-width (car col)) - (setq n-keys (length (cdr col))) - (setq n-columns 1) - ;; add additional columns as long as they fit - (while (and cols-w-widths - (or (null which-key-max-display-columns) - (< n-columns which-key-max-display-columns)) - (<= (+ (caar cols-w-widths) page-width) avl-width)) - (setq col (pop cols-w-widths)) - (push (cdr col) page-cols) - (cl-incf page-width (car col)) - (cl-incf n-keys (length (cdr col))) - (cl-incf n-columns)) - (push (which-key--join-columns page-cols) pages) - (push n-keys keys/page) - (push page-width page-widths)) - (make-which-key--pages - :pages (nreverse pages) - :height avl-lines - :widths (nreverse page-widths) - :keys/page (reverse keys/page) - :page-nums (number-sequence 1 n-pages) - :num-pages n-pages - :total-keys (apply #'+ keys/page))))) - -(defun which-key--create-pages-1 - (keys available-lines available-width &optional min-lines vertical) - "Create page strings using `which-key--list-to-pages'. -Will try to find the best number of rows and columns using the -given dimensions and the length and widths of ITEMS. Use VERTICAL -if the ITEMS are laid out vertically and the number of columns -should be minimized." - (let ((result (which-key--list-to-pages - keys available-lines available-width)) - (min-lines (or min-lines 0)) - found prev-result) - (if (or (null result) - vertical - (> (which-key--pages-num-pages result) 1) - (= 1 available-lines)) - result - ;; simple search for a fitting page - (while (and (> available-lines min-lines) - (not found)) - (setq available-lines (- available-lines 1) - prev-result result - result (which-key--list-to-pages - keys available-lines available-width) - found (> (which-key--pages-num-pages result) 1))) - (if found prev-result result)))) - -(defun which-key--create-pages (keys &optional prefix-keys prefix-title) - "Create page strings using `which-key--list-to-pages'. -Will try to find the best number of rows and columns using the -given dimensions and the length and wdiths of KEYS. SEL-WIN-WIDTH -is the width of the live window." - (let* ((max-dims (which-key--popup-max-dimensions)) - (max-lines (car max-dims)) - (max-width (cdr max-dims)) - (prefix-desc (key-description prefix-keys)) - (full-prefix (which-key--full-prefix prefix-desc)) - (prefix (when (eq which-key-show-prefix 'left) - (+ 2 (which-key--string-width full-prefix)))) - (prefix-top-bottom (member which-key-show-prefix '(bottom top))) - (avl-lines (if prefix-top-bottom (- max-lines 1) max-lines)) - (min-lines (min avl-lines which-key-min-display-lines)) - (avl-width (if prefix (- max-width prefix) max-width)) - (vertical (and (eq which-key-popup-type 'side-window) - (member which-key-side-window-location '(left right)))) - result) - (setq result - (which-key--create-pages-1 - keys avl-lines avl-width min-lines vertical)) - (when (and result - (> (which-key--pages-num-pages result) 0)) - (setf (which-key--pages-prefix result) prefix-keys) - (setf (which-key--pages-prefix-title result) - (or prefix-title - (which-key--maybe-get-prefix-title - (key-description prefix-keys)))) - result))) - -(defun which-key--lighter-status () - "Possibly show number of keys and total in the mode line." - (when which-key-show-remaining-keys - (let ((n-shown (car (which-key--pages-keys/page which-key--pages-obj))) - (n-tot (which-key--pages-total-keys which-key--pages-obj))) - (setcar (cdr (assq 'which-key-mode minor-mode-alist)) - (format " WK: %s/%s keys" n-shown n-tot))))) - -(defun which-key--lighter-restore () - "Restore the lighter for which-key." - (when which-key-show-remaining-keys - (setcar (cdr (assq 'which-key-mode minor-mode-alist)) - which-key-lighter))) - -(defun which-key--echo (text) - "Echo TEXT to minibuffer without logging." - (let (message-log-max) - (message "%s" text))) - -(defun which-key--next-page-hint (prefix-keys) - "Return string for next page hint." - (let* ((paging-key (concat prefix-keys " " which-key-paging-key)) - (paging-key-bound (eq 'which-key-C-h-dispatch - (key-binding (kbd paging-key)))) - (key (if paging-key-bound which-key-paging-key "C-h"))) - (when which-key-use-C-h-commands - (which-key--propertize (format "[%s paging/help]" key) - 'face 'which-key-note-face)))) - -(eval-and-compile - (if (fboundp 'universal-argument--description) - (defalias 'which-key--universal-argument--description - 'universal-argument--description) - (defun which-key--universal-argument--description () - ;; Backport of the definition of universal-argument--description in - ;; emacs25 on 2015-12-04 - (when prefix-arg - (concat "C-u" - (pcase prefix-arg - (`(-) " -") - (`(,(and (pred integerp) n)) - (let ((str "")) - (while (and (> n 4) (= (mod n 4) 0)) - (setq str (concat str " C-u")) - (setq n (/ n 4))) - (if (= n 4) str (format " %s" prefix-arg)))) - (_ (format " %s" prefix-arg)))))))) - -(defun which-key--full-prefix (prefix-keys &optional -prefix-arg dont-prop-keys) - "Return a description of the full key sequence up to now, -including prefix arguments." - (let* ((left (eq which-key-show-prefix 'left)) - (prefix-arg (if -prefix-arg -prefix-arg prefix-arg)) - (str (concat - (which-key--universal-argument--description) - (when prefix-arg " ") - prefix-keys)) - (dash (if (and (not (string= prefix-keys "")) - (null left)) "-" ""))) - (if (or (eq which-key-show-prefix 'echo) dont-prop-keys) - (concat str dash) - (concat (which-key--propertize-key str) - (which-key--propertize dash 'face 'which-key-key-face))))) - -(defun which-key--get-popup-map () - "Generate transient-map for use in the top level binding display." - (unless which-key--automatic-display - (let ((map (make-sparse-keymap))) - (define-key map (kbd which-key-paging-key) #'which-key-C-h-dispatch) - (when which-key-use-C-h-commands - ;; Show next page even when C-h is pressed - (define-key map (kbd "C-h") #'which-key-C-h-dispatch)) - map))) - -(defun which-key--process-page (pages-obj) - "Add information to the basic list of key bindings, including -if applicable the current prefix, the name of the current prefix, -and a page count." - (let* ((page (car (which-key--pages-pages pages-obj))) - (height (which-key--pages-height pages-obj)) - (n-pages (which-key--pages-num-pages pages-obj)) - (page-n (car (which-key--pages-page-nums pages-obj))) - (prefix-desc (key-description (which-key--pages-prefix pages-obj))) - (prefix-title (which-key--pages-prefix-title pages-obj)) - (full-prefix (which-key--full-prefix prefix-desc)) - (nxt-pg-hint (which-key--next-page-hint prefix-desc)) - ;; not used in left case - (status-line - (concat (which-key--propertize prefix-title 'face 'which-key-note-face) - (when (< 1 n-pages) - (which-key--propertize (format " (%s of %s)" page-n n-pages) - 'face 'which-key-note-face))))) - (pcase which-key-show-prefix - (`left - (let* ((page-cnt (which-key--propertize (format "%s/%s" page-n n-pages) - 'face 'which-key-separator-face)) - (first-col-width (+ 2 (max (which-key--string-width full-prefix) - (which-key--string-width page-cnt)))) - (prefix (format (concat "%-" (int-to-string first-col-width) "s") - full-prefix)) - (page-cnt (if (> n-pages 1) - (format - (concat "%-" (int-to-string first-col-width) "s") - page-cnt) - (make-string first-col-width 32))) - lines first-line new-end) - (if (= 1 height) - (cons (concat prefix page) nil) - (setq lines (split-string page "\n") - first-line (concat prefix (car lines) "\n" page-cnt) - new-end (concat "\n" (make-string first-col-width 32))) - (cons - (concat first-line (mapconcat #'identity (cdr lines) new-end)) - nil)))) - (`top - (cons - (concat (when (or (= 0 echo-keystrokes) - (not (eq which-key-side-window-location 'bottom))) - (concat full-prefix " ")) - status-line " " nxt-pg-hint "\n" page) - nil)) - (`bottom - (cons - (concat page "\n" - (when (or (= 0 echo-keystrokes) - (not (eq which-key-side-window-location 'bottom))) - (concat full-prefix " ")) - status-line " " nxt-pg-hint) - nil)) - (`echo - (cons page - (lambda () - (which-key--echo - (concat full-prefix (when prefix-desc " ") - status-line (when status-line " ") - nxt-pg-hint))))) - (`mode-line - (cons page - (lambda () - (with-current-buffer which-key--buffer - (setq-local mode-line-format - (concat " " full-prefix - " " status-line - " " nxt-pg-hint)))))) - (_ (cons page nil))))) - -(defun which-key--show-page (&optional n) - "Show current page. N changes the current page to the Nth page -relative to the current one." - (which-key--init-buffer) ;; in case it was killed - (let ((prefix-keys (which-key--current-key-string)) - golden-ratio-mode) - (if (null which-key--pages-obj) - (message "%s- which-key can't show keys: There is not \ -enough space based on your settings and frame size." prefix-keys) - (when n - (setq which-key--pages-obj - (which-key--pages-set-current-page which-key--pages-obj n))) - (let ((page-echo (which-key--process-page which-key--pages-obj)) - (height (which-key--pages-height which-key--pages-obj)) - (width (car (which-key--pages-widths which-key--pages-obj)))) - (which-key--lighter-status) - (if (eq which-key-popup-type 'minibuffer) - (which-key--echo (car page-echo)) - (with-current-buffer which-key--buffer - (erase-buffer) - (insert (car page-echo)) - (goto-char (point-min))) - (when (cdr page-echo) (funcall (cdr page-echo))) - (which-key--show-popup (cons height width))))) - ;; used for paging at top-level - (if (fboundp 'set-transient-map) - (set-transient-map (which-key--get-popup-map)) - (with-no-warnings - (set-temporary-overlay-map (which-key--get-popup-map)))))) - -;;; Paging functions - -;;;###autoload -(defun which-key-reload-key-sequence (&optional key-seq) - "Simulate entering the key sequence KEY-SEQ. -KEY-SEQ should be a list of events as produced by -`listify-key-sequence'. If nil, KEY-SEQ defaults to -`which-key--current-key-list'. Any prefix arguments that were -used are reapplied to the new key sequence." - (let* ((key-seq (or key-seq (which-key--current-key-list))) - (next-event (mapcar (lambda (ev) (cons t ev)) key-seq))) - (setq prefix-arg current-prefix-arg - unread-command-events next-event))) - -(defun which-key-turn-page (delta) - "Show the next page of keys." - (which-key-reload-key-sequence) - (if which-key--last-try-2-loc - (let ((which-key-side-window-location which-key--last-try-2-loc) - (which-key--multiple-locations t)) - (which-key--show-page delta)) - (which-key--show-page delta)) - (which-key--start-paging-timer)) - -;;;###autoload -(defun which-key-show-standard-help (&optional _) - "Call the command in `which-key--prefix-help-cmd-backup'. -Usually this is `describe-prefix-bindings'." - (interactive) - (let ((which-key-inhibit t)) - (which-key--hide-popup-ignore-command) - (cond ((eq which-key--prefix-help-cmd-backup - 'describe-prefix-bindings) - ;; This is essentially what `describe-prefix-bindings' does - (describe-bindings - (kbd (which-key--current-key-string)))) - ((functionp which-key--prefix-help-cmd-backup) - (funcall which-key--prefix-help-cmd-backup))))) - -;;;###autoload -(defun which-key-show-next-page-no-cycle () - "Show next page of keys unless on the last page, in which case -call `which-key-show-standard-help'." - (interactive) - (let ((which-key-inhibit t)) - (if (which-key--on-last-page) - (which-key-show-standard-help) - (which-key-turn-page 1)))) - -;;;###autoload -(defun which-key-show-previous-page-no-cycle () - "Show previous page of keys unless on the first page, in which -case do nothing." - (interactive) - (let ((which-key-inhibit t)) - (unless (which-key--on-first-page) - (which-key-turn-page -1)))) - -;;;###autoload -(defun which-key-show-next-page-cycle (&optional _) - "Show the next page of keys, cycling from end to beginning -after last page." - (interactive) - (let ((which-key-inhibit t)) - (which-key-turn-page 1))) - -;;;###autoload -(defun which-key-show-previous-page-cycle (&optional _) - "Show the previous page of keys, cycling from beginning to end -after first page." - (interactive) - (let ((which-key-inhibit t)) - (which-key-turn-page -1))) - -;;;###autoload -(defun which-key-show-top-level (&optional _) - "Show top-level bindings." - (interactive) - (which-key--create-buffer-and-show nil nil nil "Top-level bindings")) - -;;;###autoload -(defun which-key-show-major-mode () - "Show top-level bindings in the map of the current major mode. - -This function will also detect evil bindings made using -`evil-define-key' in this map. These bindings will depend on the -current evil state. " - (interactive) - (let ((map-sym (intern (format "%s-map" major-mode)))) - (if (and (boundp map-sym) (keymapp (symbol-value map-sym))) - (which-key--create-buffer-and-show - nil nil - (apply-partially #'which-key--map-binding-p (symbol-value map-sym)) - "Major-mode bindings") - (message "which-key: No map named %s" map-sym)))) - -;;;###autoload -(defun which-key-undo-key (&optional _) - "Undo last keypress and force which-key update." - (interactive) - (let* ((key-lst (butlast (which-key--current-key-list))) - (which-key-inhibit t)) - (cond (which-key--prior-show-keymap-args - (if (keymapp (cdr (car-safe which-key--prior-show-keymap-args))) - (let ((args (pop which-key--prior-show-keymap-args))) - (which-key--show-keymap (car args) (cdr args))) - (which-key--hide-popup))) - (key-lst - (which-key-reload-key-sequence key-lst) - (which-key--create-buffer-and-show (apply #'vector key-lst))) - (t (setq which-key--automatic-display nil) - (which-key-show-top-level))))) -(defalias 'which-key-undo 'which-key-undo-key) - -(defun which-key-abort (&optional _) - "Abort key sequence." - (interactive) - (let ((which-key-inhibit t)) - (which-key--hide-popup-ignore-command) - (keyboard-quit))) - -(defun which-key-digit-argument (key) - "Version of `digit-argument' for use in `which-key-C-h-map'." - (interactive) - (let ((last-command-event (string-to-char key))) - (digit-argument key)) - (let ((current-prefix-arg prefix-arg)) - (which-key-reload-key-sequence))) - -(defun which-key-toggle-docstrings (&optional _) - "Toggle the display of docstrings." - (interactive) - (unless (eq which-key-show-docstrings 'docstring-only) - (setq which-key-show-docstrings (null which-key-show-docstrings))) - (which-key-reload-key-sequence) - (which-key--create-buffer-and-show (which-key--current-prefix))) - -;;;###autoload -(defun which-key-C-h-dispatch () - "Dispatch C-h commands by looking up key in -`which-key-C-h-map'. This command is always accessible (from any -prefix) if `which-key-use-C-h-commands' is non nil." - (interactive) - (if (not (which-key--popup-showing-p)) - (which-key-show-standard-help) - (let* ((prefix-keys (which-key--current-key-string)) - (full-prefix (which-key--full-prefix prefix-keys current-prefix-arg t)) - (prompt (concat (when (string-equal prefix-keys "") - (which-key--propertize - (concat " " - (which-key--pages-prefix-title - which-key--pages-obj)) - 'face 'which-key-note-face)) - full-prefix - (which-key--propertize - (substitute-command-keys - (concat - " \\" - " \\[which-key-show-next-page-cycle]" - which-key-separator "next-page," - " \\[which-key-show-previous-page-cycle]" - which-key-separator "previous-page," - " \\[which-key-undo-key]" - which-key-separator "undo-key," - " \\[which-key-toggle-docstrings]" - which-key-separator "toggle-docstrings," - " \\[which-key-show-standard-help]" - which-key-separator "help," - " \\[which-key-abort]" - which-key-separator "abort" - " 1..9" - which-key-separator "digit-arg")) - 'face 'which-key-note-face))) - (key (string (read-key prompt))) - (cmd (lookup-key which-key-C-h-map key)) - (which-key-inhibit t)) - (if cmd (funcall cmd key) (which-key-turn-page 0))))) - -;;; Update - -(defun which-key--any-match-p (regexps string) - "Non-nil if any of REGEXPS match STRING." - (catch 'match - (dolist (regexp regexps) - (when (string-match-p regexp string) - (throw 'match t))))) - -(defun which-key--try-2-side-windows - (bindings prefix-keys prefix-title loc1 loc2 &rest _ignore) - "Try to show BINDINGS (PAGE-N) in LOC1 first. - -Only if no bindings fit fallback to LOC2." - (let (pages1) - (let ((which-key-side-window-location loc1) - (which-key--multiple-locations t)) - (setq pages1 (which-key--create-pages - bindings prefix-keys prefix-title))) - (if pages1 - (progn - (setq which-key--pages-obj pages1) - (let ((which-key-side-window-location loc1) - (which-key--multiple-locations t)) - (which-key--show-page)) - loc1) - (let ((which-key-side-window-location loc2) - (which-key--multiple-locations t)) - (setq which-key--pages-obj - (which-key--create-pages bindings prefix-keys prefix-title)) - (which-key--show-page) - loc2)))) - -(defun which-key--read-keymap () - "Read keymap symbol from minibuffer." - (intern - (completing-read "Keymap: " obarray - (lambda (m) - (and (boundp m) - (keymapp (symbol-value m)) - (not (equal (symbol-value m) - (make-sparse-keymap))))) - t - (let ((sym (symbol-at-point))) - (and (boundp sym) - (keymapp (symbol-value sym)) - (symbol-name sym))) - 'which-key-keymap-history))) - -;;;###autoload -(defun which-key-show-keymap (keymap) - "Show the top-level bindings in KEYMAP using which-key. KEYMAP -is selected interactively from all available keymaps." - (interactive (list (which-key--read-keymap))) - (which-key--show-keymap (symbol-name keymap) - (symbol-value keymap))) - -;;;###autoload -(defun which-key-show-full-keymap (keymap) - "Show all bindings in KEYMAP using which-key. KEYMAP is -selected interactively from all available keymaps." - (interactive (list (which-key--read-keymap))) - (which-key--show-keymap (symbol-name keymap) - (symbol-value keymap) - nil t)) - -;;;###autoload -(defun which-key-show-minor-mode-keymap () - "Show the top-level bindings in KEYMAP using which-key. KEYMAP -is selected interactively by mode in `minor-mode-map-alist'." - (interactive) - (let ((mode-sym - (intern - (completing-read - "Minor Mode: " - (mapcar 'car - (cl-remove-if-not - (lambda (entry) - (and (symbol-value (car entry)) - (not (equal (cdr entry) (make-sparse-keymap))))) - minor-mode-map-alist)) - nil t nil 'which-key-keymap-history)))) - (which-key--show-keymap (symbol-name mode-sym) - (cdr (assq mode-sym minor-mode-map-alist))))) - -(defun which-key--show-keymap (keymap-name keymap &optional prior-args all) - (when prior-args (push prior-args which-key--prior-show-keymap-args)) - (let ((bindings (which-key--get-bindings nil keymap nil all))) - (if (= (length bindings) 0) - (message "which-key: No bindings found in %s" keymap-name) - (cond ((listp which-key-side-window-location) - (setq which-key--last-try-2-loc - (apply #'which-key--try-2-side-windows - bindings nil keymap-name - which-key-side-window-location))) - (t (setq which-key--pages-obj - (which-key--create-pages bindings nil keymap-name)) - (which-key--show-page))) - (let* ((key (key-description (list (read-key)))) - (next-def (lookup-key keymap (kbd key)))) - (cond ((and which-key-use-C-h-commands (string= "C-h" key)) - (which-key-C-h-dispatch)) - ((keymapp next-def) - (which-key--hide-popup-ignore-command) - (which-key--show-keymap (concat keymap-name " " key) next-def - (cons keymap-name keymap))) - (t (which-key--hide-popup))))))) - -(defun which-key--evil-operator-filter (binding) - (let ((def (intern (cdr binding)))) - (and (functionp def) - (not (evil-get-command-property def :suppress-operator))))) - -(defun which-key--show-evil-operator-keymap () - (if which-key--inhibit-next-operator-popup - (setq which-key--inhibit-next-operator-popup nil) - (let ((keymap - (make-composed-keymap (list evil-operator-shortcut-map - evil-operator-state-map - evil-motion-state-map)))) - (when (keymapp keymap) - (let ((formatted-keys - (which-key--get-bindings - nil keymap #'which-key--evil-operator-filter))) - (cond ((= (length formatted-keys) 0) - (message "which-key: Keymap empty")) - ((listp which-key-side-window-location) - (setq which-key--last-try-2-loc - (apply #'which-key--try-2-side-windows - formatted-keys nil "evil operator/motion keys" - which-key-side-window-location))) - (t (setq which-key--pages-obj - (which-key--create-pages - formatted-keys - nil "evil operator/motion keys")) - (which-key--show-page))))) - (let* ((key (key-description (list (read-key))))) - (when (member key '("f" "F" "t" "T" "`")) - ;; these keys trigger commands that read the next char manually - (setq which-key--inhibit-next-operator-popup t)) - (cond ((and which-key-use-C-h-commands (string= "C-h" key)) - (which-key-C-h-dispatch)) - ((string= key "ESC") - (which-key--hide-popup) - (keyboard-quit)) - (t - (which-key--hide-popup) - (setq unread-command-events (listify-key-sequence key)))))))) - -(defun which-key--create-buffer-and-show - (&optional prefix-keys from-keymap filter prefix-title) - "Fill `which-key--buffer' with key descriptions and reformat. -Finally, show the buffer." - (let ((start-time (when which-key--debug (current-time))) - (formatted-keys (which-key--get-bindings - prefix-keys from-keymap filter)) - (prefix-desc (key-description prefix-keys))) - (cond ((= (length formatted-keys) 0) - (message "%s- which-key: There are no keys to show" prefix-desc)) - ((listp which-key-side-window-location) - (setq which-key--last-try-2-loc - (apply #'which-key--try-2-side-windows - formatted-keys prefix-keys prefix-title - which-key-side-window-location))) - (t (setq which-key--pages-obj - (which-key--create-pages - formatted-keys prefix-keys prefix-title)) - (which-key--show-page))) - (when which-key--debug - (message "On prefix \"%s\" which-key took %.0f ms." prefix-desc - (* 1000 (float-time (time-since start-time))))))) - -(defun which-key--this-command-keys () - "Version of `this-single-command-keys' corrected for key-chords and god-mode." - (let ((this-command-keys (this-single-command-keys))) - (when (and (equal this-command-keys [key-chord]) - (bound-and-true-p key-chord-mode)) - (setq this-command-keys - (condition-case nil - (let ((rkeys (recent-keys))) - (vector 'key-chord - ;; Take the two preceding the last one, because the - ;; read-event call in key-chord seems to add a - ;; spurious key press to this list. Note this is - ;; different from guide-key's method which didn't work - ;; for me. - (aref rkeys (- (length rkeys) 3)) - (aref rkeys (- (length rkeys) 2)))) - (error (progn - (message "which-key error in key-chord handling") - [key-chord]))))) - (when (and which-key--god-mode-support-enabled - (bound-and-true-p god-local-mode) - (eq this-command 'god-mode-self-insert)) - (setq this-command-keys (when which-key--god-mode-key-string - (kbd which-key--god-mode-key-string)))) - this-command-keys)) - -(defun which-key--update () - "Function run by timer to possibly trigger -`which-key--create-buffer-and-show'." - (let ((prefix-keys (which-key--this-command-keys)) - delay-time) - (cond ((and (> (length prefix-keys) 0) - (or (keymapp (key-binding prefix-keys)) - ;; Some keymaps are stored here like iso-transl-ctl-x-8-map - (keymapp (which-key--safe-lookup-key - key-translation-map prefix-keys)) - ;; just in case someone uses one of these - (keymapp (which-key--safe-lookup-key - function-key-map prefix-keys))) - (not which-key-inhibit) - (or (null which-key-allow-regexps) - (which-key--any-match-p - which-key-allow-regexps (key-description prefix-keys))) - (or (null which-key-inhibit-regexps) - (not - (which-key--any-match-p - which-key-inhibit-regexps (key-description prefix-keys)))) - ;; Do not display the popup if a command is currently being - ;; executed - (or (and which-key-allow-evil-operators - (bound-and-true-p evil-this-operator)) - (and which-key--god-mode-support-enabled - (bound-and-true-p god-local-mode) - (eq this-command 'god-mode-self-insert)) - (null this-command))) - (when (and (not (equal prefix-keys (which-key--current-prefix))) - (or (null which-key-delay-functions) - (null (setq delay-time - (run-hook-with-args-until-success - 'which-key-delay-functions - (key-description prefix-keys) - (length prefix-keys)))) - (sit-for delay-time))) - (setq which-key--automatic-display t) - (which-key--create-buffer-and-show prefix-keys) - (when (and which-key-idle-secondary-delay - (not which-key--secondary-timer-active)) - (which-key--start-timer which-key-idle-secondary-delay t)))) - ((and which-key-show-transient-maps - (keymapp overriding-terminal-local-map) - ;; basic test for it being a hydra - (not (eq (lookup-key overriding-terminal-local-map "\C-u") - 'hydra--universal-argument))) - (which-key--create-buffer-and-show - nil overriding-terminal-local-map)) - ((and which-key-show-operator-state-maps - (bound-and-true-p evil-state) - (eq evil-state 'operator) - (not (which-key--popup-showing-p))) - (which-key--show-evil-operator-keymap)) - (which-key--automatic-display - (which-key--hide-popup))))) - -;;; Timers - -(defun which-key--start-timer (&optional delay secondary) - "Activate idle timer to trigger `which-key--update'." - (which-key--stop-timer) - (setq which-key--secondary-timer-active secondary) - (setq which-key--timer - (run-with-idle-timer - (if delay - delay - which-key-idle-delay) t #'which-key--update))) - -(defun which-key--stop-timer () - "Deactivate idle timer for `which-key--update'." - (when which-key--timer (cancel-timer which-key--timer))) - -(defun which-key--start-paging-timer () - "Activate timer to restart which-key after paging." - (when which-key--paging-timer (cancel-timer which-key--paging-timer)) - (which-key--stop-timer) - (setq which-key--paging-timer - (run-with-idle-timer - 0.2 t (lambda () - (when (or (not (member real-last-command - which-key--paging-functions)) - (and (< 0 (length (this-single-command-keys))) - (not (equal (which-key--current-prefix) - (which-key--this-command-keys))))) - (cancel-timer which-key--paging-timer) - (which-key--start-timer)))))) - -(provide 'which-key) -;;; which-key.el ends here diff --git a/elpa/which-key-20180621.1238/which-key.elc b/elpa/which-key-20180621.1238/which-key.elc deleted file mode 100644 index f90c738..0000000 Binary files a/elpa/which-key-20180621.1238/which-key.elc and /dev/null differ diff --git a/elpa/window-numbering-20160809.1810/window-numbering-autoloads.el b/elpa/window-numbering-20160809.1810/window-numbering-autoloads.el new file mode 100644 index 0000000..a02ed27 --- /dev/null +++ b/elpa/window-numbering-20160809.1810/window-numbering-autoloads.el @@ -0,0 +1,32 @@ +;;; window-numbering-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "window-numbering" "window-numbering.el" (23391 +;;;;;; 65237 0 0)) +;;; Generated autoloads from window-numbering.el + +(defvar window-numbering-mode nil "\ +Non-nil if Window-Numbering mode is enabled. +See the `window-numbering-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `window-numbering-mode'.") + +(custom-autoload 'window-numbering-mode "window-numbering" nil) + +(autoload 'window-numbering-mode "window-numbering" "\ +A minor mode that assigns a number to each window. + +\(fn &optional ARG)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; window-numbering-autoloads.el ends here diff --git a/elpa/window-numbering-20160809.1810/window-numbering-pkg.el b/elpa/window-numbering-20160809.1810/window-numbering-pkg.el new file mode 100644 index 0000000..abee646 --- /dev/null +++ b/elpa/window-numbering-20160809.1810/window-numbering-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "window-numbering" "20160809.1810" "Numbered window shortcuts" 'nil :commit "10809b3993a97c7b544240bf5d7ce9b1110a1b89" :keywords '("faces" "matching") :authors '(("Nikolaj Schumacher ")) :maintainer '("Nikolaj Schumacher ") :url "http://nschum.de/src/emacs/window-numbering-mode/") diff --git a/elpa/window-numbering-20160809.1810/window-numbering.el b/elpa/window-numbering-20160809.1810/window-numbering.el new file mode 100644 index 0000000..5c1c9dd --- /dev/null +++ b/elpa/window-numbering-20160809.1810/window-numbering.el @@ -0,0 +1,250 @@ +;;; window-numbering.el --- Numbered window shortcuts +;; +;; Copyright (C) 2006-2007, 2013, 2015 Nikolaj Schumacher +;; +;; Author: Nikolaj Schumacher +;; Version: 1.1.2 +;; Package-Version: 20160809.1810 +;; Keywords: faces, matching +;; URL: http://nschum.de/src/emacs/window-numbering-mode/ +;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x, GNU Emacs 24.x +;; +;; 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 2 +;; 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 . +;; +;;; Commentary: +;; +;; Enable window-numbering-mode and use M-1 through M-0 to navigate. +;; +;; If you want to affect the numbers, use window-numbering-before-hook or +;; window-numbering-assign-func. +;; For instance, to always assign the calculator window the number 9, add the +;; following to your .emacs: +;; +;; (setq window-numbering-assign-func +;; (lambda () (when (equal (buffer-name) "*Calculator*") 9))) +;; +;;; Changes Log: +;; +;; Fix numbering of minibuffer for recent Emacs versions. +;; +;; 2013-03-23 (1.1.2) +;; Fix numbering in terminal mode with menu bar visible. +;; Add face for window number. (thanks to Chen Bin) +;; +;; 2008-04-11 (1.1.1) +;; Added possibility to delete window with prefix arg. +;; Cleaned up code and migrated to `defcustom'. +;; +;; 2007-02-18 (1.1) +;; Added window-numbering-before-hook, window-numbering-assign-func. +;; +;;; Code: + +(eval-when-compile (require 'cl)) + +(push "^No window numbered .$" debug-ignored-errors) + +(defgroup window-numbering nil + "Numbered window shortcuts" + :group 'convenience) + +(defcustom window-numbering-auto-assign-0-to-minibuffer t + "*If non-nil, `window-numbering-mode' assigns 0 to the minibuffer if active." + :group 'window-numbering + :type '(choice (const :tag "Off" nil) + (const :tag "On" t))) + +(defcustom window-numbering-before-hook nil + "*Hook called before `window-numbering-mode' starts assigning numbers. +The number of windows that will be numbered is passed as a parameter. +Use `window-numbering-assign' to manually assign some of them a number. +If you want to assign a number to just one buffer, use +`window-numbering-assign-func' instead." + :group 'window-numbering + :type 'hook) + +(defcustom window-numbering-assign-func nil + "*Function called for each window by `window-numbering-mode'. +This is called before automatic assignment begins. The function should +return a number to have it assigned to the current-window, nil otherwise." + :group 'window-numbering + :type 'function) + +(defconst window-numbering-mode-line-position 1 + "The position in the mode-line `window-numbering-mode' displays the number.") + +(defface window-numbering-face + '() + "Face used for the number in the mode-line." + :group 'window-numbering) + +(defvar window-numbering-table nil + "table -> (window vector . number table)") + +(defun select-window-by-number (i &optional arg) + "Select window given number I by `window-numbering-mode'. +If prefix ARG is given, delete the window instead of selecting it." + (interactive "P") + (let ((windows (car (gethash (selected-frame) window-numbering-table))) + window) + (if (and (>= i 0) (< i 10) + (setq window (aref windows i))) + (if arg + (delete-window window) + (select-window window)) + (error "No window numbered %s" i)))) + +;; define interactive functions for keymap +(dotimes (i 10) + (eval `(defun ,(intern (format "select-window-%s" i)) (&optional arg) + ,(format "Select the window with number %i." i) + (interactive "P") + (select-window-by-number ,i arg)))) + +(defun window-numbering-calculate-left (windows) + (let ((i 9) left) + (while (>= i 0) + (let ((window (aref windows i))) + (unless window + (push (% (1+ i) 10) left))) + (decf i)) + left)) + +(defvar window-numbering-windows nil + "A vector listing the window for each number.") +(defvar window-numbering-numbers + "A hash map containing each window's number.") +(defvar window-numbering-left + "A list of unused window numbers.") + +(defun window-numbering-assign (window &optional number) + (if number + (if (aref window-numbering-windows number) + (progn (message "Number %s assigned to two buffers (%s and %s)" + number window (aref window-numbering-windows number)) + nil) + (setf (aref window-numbering-windows number) window) + (puthash window number window-numbering-numbers) + (setq window-numbering-left (delq number window-numbering-left)) + t) + ;; else default adding + (when window-numbering-left + (unless (gethash window window-numbering-numbers) + (let ((number (car window-numbering-left))) + (window-numbering-assign window number) + number))))) + +(defun window-numbering-update () + "Update the window numbering for the current frame. +Optional parameter PREASSIGNED-WINDOWS is a hashmap already mapping some +windows to numbers." + (setq window-numbering-windows (make-vector 10 nil) + window-numbering-numbers (make-hash-table :size 10) + window-numbering-left + (window-numbering-calculate-left window-numbering-windows)) + (puthash (selected-frame) + (cons window-numbering-windows window-numbering-numbers) + window-numbering-table) + (when (and window-numbering-auto-assign-0-to-minibuffer + (active-minibuffer-window)) + (window-numbering-assign (active-minibuffer-window) 0)) + (let ((windows (window-list nil 0 (frame-first-window)))) + (run-hook-with-args 'window-numbering-before-hook windows) + (when window-numbering-assign-func + (mapc (lambda (window) + (with-selected-window window + (with-current-buffer (window-buffer window) + (let ((num (funcall window-numbering-assign-func))) + (when num + (window-numbering-assign window num)))))) + windows)) + (dolist (window windows) + (window-numbering-assign window)))) + +(defun window-numbering-get-number-string (&optional window) + (let ((s (int-to-string (window-numbering-get-number window)))) + (propertize s 'face 'window-numbering-face))) + +(defun window-numbering-get-number (&optional window) + (gethash (or window (selected-window)) + (cdr (gethash (selected-frame) window-numbering-table)))) + +(defvar window-numbering-keymap + (let ((map (make-sparse-keymap))) + (define-key map "\M-0" 'select-window-0) + (define-key map "\M-1" 'select-window-1) + (define-key map "\M-2" 'select-window-2) + (define-key map "\M-3" 'select-window-3) + (define-key map "\M-4" 'select-window-4) + (define-key map "\M-5" 'select-window-5) + (define-key map "\M-6" 'select-window-6) + (define-key map "\M-7" 'select-window-7) + (define-key map "\M-8" 'select-window-8) + (define-key map "\M-9" 'select-window-9) + map) + "Keymap used in by `window-numbering-mode'.") + +;;;###autoload +(define-minor-mode window-numbering-mode + "A minor mode that assigns a number to each window." + nil nil window-numbering-keymap :global t + (if window-numbering-mode + (unless window-numbering-table + (save-excursion + (setq window-numbering-table (make-hash-table :size 16)) + (window-numbering-install-mode-line) + (add-hook 'minibuffer-setup-hook 'window-numbering-update) + (add-hook 'window-configuration-change-hook + 'window-numbering-update) + (dolist (frame (frame-list)) + (select-frame frame) + (window-numbering-update)))) + (window-numbering-clear-mode-line) + (remove-hook 'minibuffer-setup-hook 'window-numbering-update) + (remove-hook 'window-configuration-change-hook + 'window-numbering-update) + (setq window-numbering-table nil))) + +(defun window-numbering-install-mode-line (&optional position) + "Install the window number from `window-numbering-mode' to the mode-line." + (let ((mode-line (default-value 'mode-line-format)) + (res)) + (dotimes (i (min (or position window-numbering-mode-line-position) + (length mode-line))) + (push (car mode-line) res) + (pop mode-line)) + (push '(:eval (window-numbering-get-number-string)) res) + (while mode-line + (push (car mode-line) res) + (pop mode-line)) + (setq-default mode-line-format (nreverse res))) + (force-mode-line-update t)) + +(defun window-numbering-clear-mode-line () + "Remove the window number of `window-numbering-mode' from the mode-line." + (let ((mode-line (default-value 'mode-line-format)) + (res)) + (while mode-line + (let ((item (car mode-line))) + (unless (equal item '(:eval (window-numbering-get-number-string))) + (push item res))) + (pop mode-line)) + (setq-default mode-line-format (nreverse res))) + (force-mode-line-update t)) + +(provide 'window-numbering) + +;;; window-numbering.el ends here diff --git a/elpa/window-numbering-20160809.1810/window-numbering.elc b/elpa/window-numbering-20160809.1810/window-numbering.elc new file mode 100644 index 0000000..58141c7 Binary files /dev/null and b/elpa/window-numbering-20160809.1810/window-numbering.elc differ diff --git a/elpa/with-editor-20180726.2044/with-editor-autoloads.el b/elpa/with-editor-20180726.2044/with-editor-autoloads.el new file mode 100644 index 0000000..fc951cc --- /dev/null +++ b/elpa/with-editor-20180726.2044/with-editor-autoloads.el @@ -0,0 +1,94 @@ +;;; with-editor-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "with-editor" "with-editor.el" (23391 65236 +;;;;;; 0 0)) +;;; Generated autoloads from with-editor.el + +(autoload 'with-editor-export-editor "with-editor" "\ +Teach subsequent commands to use current Emacs instance as editor. + +Set and export the environment variable ENVVAR, by default +\"EDITOR\". The value is automatically generated to teach +commands to use the current Emacs instance as \"the editor\". + +This works in `shell-mode', `term-mode' and `eshell-mode'. + +\(fn &optional (ENVVAR \"EDITOR\"))" t nil) + +(autoload 'with-editor-export-git-editor "with-editor" "\ +Like `with-editor-export-editor' but always set `$GIT_EDITOR'. + +\(fn)" t nil) + +(autoload 'with-editor-export-hg-editor "with-editor" "\ +Like `with-editor-export-editor' but always set `$HG_EDITOR'. + +\(fn)" t nil) + +(defvar shell-command-with-editor-mode nil "\ +Non-nil if Shell-Command-With-Editor mode is enabled. +See the `shell-command-with-editor-mode' command +for a description of this minor mode.") + +(custom-autoload 'shell-command-with-editor-mode "with-editor" nil) + +(autoload 'shell-command-with-editor-mode "with-editor" "\ +Teach `shell-command' to use current Emacs instance as editor. + +Teach `shell-command', and all commands that ultimately call that +command, to use the current Emacs instance as editor by executing +\"EDITOR=CLIENT COMMAND&\" instead of just \"COMMAND&\". + +CLIENT is automatically generated; EDITOR=CLIENT instructs +COMMAND to use to the current Emacs instance as \"the editor\", +assuming no other variable overrides the effect of \"$EDITOR\". +CLIENT may be the path to an appropriate emacsclient executable +with arguments, or a script which also works over Tramp. + +Alternatively you can use the `with-editor-async-shell-command', +which also allows the use of another variable instead of +\"EDITOR\". + +\(fn &optional ARG)" t nil) + +(autoload 'with-editor-async-shell-command "with-editor" "\ +Like `async-shell-command' but with `$EDITOR' set. + +Execute string \"ENVVAR=CLIENT COMMAND\" in an inferior shell; +display output, if any. With a prefix argument prompt for an +environment variable, otherwise the default \"EDITOR\" variable +is used. With a negative prefix argument additionally insert +the COMMAND's output at point. + +CLIENT is automatically generated; ENVVAR=CLIENT instructs +COMMAND to use to the current Emacs instance as \"the editor\", +assuming it respects ENVVAR as an \"EDITOR\"-like variable. +CLIENT may be the path to an appropriate emacsclient executable +with arguments, or a script which also works over Tramp. + +Also see `async-shell-command' and `shell-command'. + +\(fn COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER ENVVAR)" t nil) + +(autoload 'with-editor-shell-command "with-editor" "\ +Like `shell-command' or `with-editor-async-shell-command'. +If COMMAND ends with \"&\" behave like the latter, +else like the former. + +\(fn COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER ENVVAR)" t nil) + +;;;*** + +;;;### (autoloads nil nil ("with-editor-pkg.el") (23391 65236 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; with-editor-autoloads.el ends here diff --git a/elpa/with-editor-20180726.2044/with-editor-pkg.el b/elpa/with-editor-20180726.2044/with-editor-pkg.el new file mode 100644 index 0000000..fec4b7e --- /dev/null +++ b/elpa/with-editor-20180726.2044/with-editor-pkg.el @@ -0,0 +1,13 @@ +(define-package "with-editor" "20180726.2044" "Use the Emacsclient as $EDITOR" + '((emacs "24.4") + (async "1.9")) + :keywords + '("tools") + :authors + '(("Jonas Bernoulli" . "jonas@bernoul.li")) + :maintainer + '("Jonas Bernoulli" . "jonas@bernoul.li") + :url "https://github.com/magit/with-editor") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/with-editor-20180726.2044/with-editor.el b/elpa/with-editor-20180726.2044/with-editor.el new file mode 100644 index 0000000..b61104a --- /dev/null +++ b/elpa/with-editor-20180726.2044/with-editor.el @@ -0,0 +1,822 @@ +;;; with-editor.el --- Use the Emacsclient as $EDITOR -*- lexical-binding: t -*- + +;; Copyright (C) 2014-2018 The Magit Project Contributors +;; +;; You should have received a copy of the AUTHORS.md file. If not, +;; see https://github.com/magit/with-editor/blob/master/AUTHORS.md. + +;; Author: Jonas Bernoulli +;; Maintainer: Jonas Bernoulli + +;; Package-Requires: ((emacs "24.4") (async "1.9")) +;; Keywords: tools +;; Homepage: https://github.com/magit/with-editor + +;; This file is not part of GNU Emacs. + +;; This file 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 file 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 Magit. If not, see http://www.gnu.org/licenses. + +;;; Commentary: + +;; This library makes it possible to reliably use the Emacsclient as +;; the `$EDITOR' of child processes. It makes sure that they know how +;; to call home. For remote processes a substitute is provided, which +;; communicates with Emacs on standard output/input instead of using a +;; socket as the Emacsclient does. + +;; It provides the commands `with-editor-async-shell-command' and +;; `with-editor-shell-command', which are intended as replacements +;; for `async-shell-command' and `shell-command'. They automatically +;; export `$EDITOR' making sure the executed command uses the current +;; Emacs instance as "the editor". With a prefix argument these +;; commands prompt for an alternative environment variable such as +;; `$GIT_EDITOR'. To always use these variants add this to your init +;; file: +;; +;; (define-key (current-global-map) +;; [remap async-shell-command] 'with-editor-async-shell-command) +;; (define-key (current-global-map) +;; [remap shell-command] 'with-editor-shell-command) + +;; Alternatively use the global `shell-command-with-editor-mode', +;; which always sets `$EDITOR' for all Emacs commands which ultimately +;; use `shell-command' to asynchronously run some shell command. + +;; The command `with-editor-export-editor' exports `$EDITOR' or +;; another such environment variable in `shell-mode', `term-mode' and +;; `eshell-mode' buffers. Use this Emacs command before executing a +;; shell command which needs the editor set, or always arrange for the +;; current Emacs instance to be used as editor by adding it to the +;; appropriate mode hooks: +;; +;; (add-hook 'shell-mode-hook 'with-editor-export-editor) +;; (add-hook 'term-exec-hook 'with-editor-export-editor) +;; (add-hook 'eshell-mode-hook 'with-editor-export-editor) + +;; Some variants of this function exist, these two forms are +;; equivalent: +;; +;; (add-hook 'shell-mode-hook +;; (apply-partially 'with-editor-export-editor "GIT_EDITOR")) +;; (add-hook 'shell-mode-hook 'with-editor-export-git-editor) + +;; This library can also be used by other packages which need to use +;; the current Emacs instance as editor. In fact this library was +;; written for Magit and its `git-commit-mode' and `git-rebase-mode'. +;; Consult `git-rebase.el' and the related code in `magit-sequence.el' +;; for a simple example. + +;;; Code: + +(require 'cl-lib) +;; `pcase-dolist' is not autoloaded on Emacs 24. +(eval-when-compile (require 'pcase)) +(require 'server) +(require 'shell) + +(and (require 'async-bytecomp nil t) + (memq 'magit (bound-and-true-p async-bytecomp-allowed-packages)) + (fboundp 'async-bytecomp-package-mode) + (async-bytecomp-package-mode 1)) + +(eval-when-compile + (progn (require 'dired nil t) + (require 'eshell nil t) + (require 'term nil t) + (require 'warnings nil t))) +(declare-function dired-get-filename 'dired) +(declare-function term-emulate-terminal 'term) +(defvar eshell-preoutput-filter-functions) + +;;; Options + +(defgroup with-editor nil + "Use the Emacsclient as $EDITOR." + :group 'external + :group 'server) + +(defun with-editor-locate-emacsclient () + "Search for a suitable Emacsclient executable." + (or (with-editor-locate-emacsclient-1 + (with-editor-emacsclient-path) + (length (split-string emacs-version "\\."))) + (prog1 nil (display-warning 'with-editor "\ +Cannot determine a suitable Emacsclient + +Determining an Emacsclient executable suitable for the +current Emacs instance failed. For more information +please see https://github.com/magit/magit/wiki/Emacsclient.")))) + +(defun with-editor-locate-emacsclient-1 (path depth) + (let* ((version-lst (cl-subseq (split-string emacs-version "\\.") 0 depth)) + (version-reg (concat "^" (mapconcat #'identity version-lst "\\.")))) + (or (locate-file-internal + (if (equal (downcase invocation-name) "remacs") + "remacsclient" + "emacsclient") + path + (cl-mapcan + (lambda (v) (cl-mapcar (lambda (e) (concat v e)) exec-suffixes)) + (nconc (and (boundp 'debian-emacs-flavor) + (list (format ".%s" debian-emacs-flavor))) + (cl-mapcon (lambda (v) + (setq v (mapconcat #'identity (reverse v) ".")) + (list v (concat "-" v) (concat ".emacs" v))) + (reverse version-lst)) + (list "" "-snapshot" ".emacs-snapshot"))) + (lambda (exec) + (ignore-errors + (string-match-p version-reg + (with-editor-emacsclient-version exec))))) + (and (> depth 1) + (with-editor-locate-emacsclient-1 path (1- depth)))))) + +(defun with-editor-emacsclient-version (exec) + (let ((default-directory (file-name-directory exec))) + (ignore-errors + (cadr (split-string (car (process-lines exec "--version"))))))) + +(defun with-editor-emacsclient-path () + (let ((path exec-path)) + (when invocation-directory + (push (directory-file-name invocation-directory) path) + (let* ((linkname (expand-file-name invocation-name invocation-directory)) + (truename (file-chase-links linkname))) + (unless (equal truename linkname) + (push (directory-file-name (file-name-directory truename)) path))) + (when (eq system-type 'darwin) + (let ((dir (expand-file-name "bin" invocation-directory))) + (when (file-directory-p dir) + (push dir path))) + (when (string-match-p "Cellar" invocation-directory) + (let ((dir (expand-file-name "../../../bin" invocation-directory))) + (when (file-directory-p dir) + (push dir path)))))) + (cl-remove-duplicates path :test 'equal))) + +(defcustom with-editor-emacsclient-executable (with-editor-locate-emacsclient) + "The Emacsclient executable used by the `with-editor' macro." + :group 'with-editor + :type '(choice (string :tag "Executable") + (const :tag "Don't use Emacsclient" nil))) + +(defcustom with-editor-sleeping-editor "\ +sh -c '\ +echo \"WITH-EDITOR: $$ OPEN $0\"; \ +sleep 604800 & sleep=$!; \ +trap \"kill $sleep; exit 0\" USR1; \ +trap \"kill $sleep; exit 1\" USR2; \ +wait $sleep'" + "The sleeping editor, used when the Emacsclient cannot be used. + +This fallback is used for asynchronous processes started inside +the macro `with-editor', when the process runs on a remote machine +or for local processes when `with-editor-emacsclient-executable' +is nil (i.e. when no suitable Emacsclient was found, or the user +decided not to use it). + +Where the latter uses a socket to communicate with Emacs' server, +this substitute prints edit requests to its standard output on +which a process filter listens for such requests. As such it is +not a complete substitute for a proper Emacsclient, it can only +be used as $EDITOR of child process of the current Emacs instance. + +Some shells do not execute traps immediately when waiting for a +child process, but by default we do use such a blocking child +process. + +If you use such a shell (e.g. `csh' on FreeBSD, but not Debian), +then you have to edit this option. You can either replace \"sh\" +with \"bash\" (and install that), or you can use the older, less +performant implementation: + + \"sh -c '\\ + echo \\\"WITH-EDITOR: $$ OPEN $0\\\"; \\ + trap \\\"exit 0\\\" USR1; \\ + trap \\\"exit 1\" USR2; \\ + while true; do sleep 1; done'\" + +Note that this leads to a delay of up to a second. The delay can +be shortened by replacing \"sleep 1\" with \"sleep 0.01\", or if your +implementation does not support floats, then by using `nanosleep' +instead." + :group 'with-editor + :type 'string) + +(defcustom with-editor-finish-query-functions nil + "List of functions called to query before finishing session. + +The buffer in question is current while the functions are called. +If any of them returns nil, then the session is not finished and +the buffer is not killed. The user should then fix the issue and +try again. The functions are called with one argument. If it is +non-nil then that indicates that the user used a prefix argument +to force finishing the session despite issues. Functions should +usually honor that and return non-nil." + :group 'with-editor + :type 'hook) +(put 'with-editor-finish-query-functions 'permanent-local t) + +(defcustom with-editor-cancel-query-functions nil + "List of functions called to query before canceling session. + +The buffer in question is current while the functions are called. +If any of them returns nil, then the session is not canceled and +the buffer is not killed. The user should then fix the issue and +try again. The functions are called with one argument. If it is +non-nil then that indicates that the user used a prefix argument +to force canceling the session despite issues. Functions should +usually honor that and return non-nil." + :group 'with-editor + :type 'hook) +(put 'with-editor-cancel-query-functions 'permanent-local t) + +(defcustom with-editor-mode-lighter " WE" + "The mode-line lighter of the With-Editor mode." + :group 'with-editor + :type '(choice (const :tag "No lighter" "") string)) + +(defvar with-editor-server-window-alist nil + "Alist of filename patterns vs corresponding `server-window'. + +Each element looks like (REGEXP . FUNCTION). Files matching +REGEXP are selected using FUNCTION instead of the default in +`server-window'. + +Note that when a package adds an entry here then it probably +has a reason to disrespect `server-window' and it likely is +not a good idea to change such entries.") + +(defvar with-editor-file-name-history-exclude nil + "List of regexps for filenames `server-visit' should not remember. +When a filename matches any of the regexps, then `server-visit' +does not add it to the variable `file-name-history', which is +used when reading a filename in the minibuffer.") + +(defcustom with-editor-shell-command-use-emacsclient t + "Whether to use the emacsclient when running shell commands. + +This affects `with-editor-shell-command-async' and, if the input +ends with \"&\" `with-editor-shell-command' . + +If `shell-command-with-editor-mode' is enabled, then it also +affects `shell-command-async' and, if the input ends with \"&\" +`shell-command'. + +This is a temporary kludge that lets you choose between two +possible defects, the ones described in the issues #23 and #40. + +When t, then use the emacsclient. This has the disadvantage that +`with-editor-mode' won't be enabled because we don't know whether +this package was involved at all in the call to the emacsclient, +and when it is not, then we really should. The problem is that +the emacsclient doesn't pass a long any environment variables to +the server. This will hopefully be fixed in Emacs eventually. + +When nil, then use the sleeping editor. Because in this case we +know that this package is involved, we can enable the mode. But +this makes it necessary that you invoke $EDITOR in shell scripts +like so: + + eval \"$EDITOR\" file + +And some tools that do not handle $EDITOR properly also break." + :package-version '(with-editor . "2.8.0") + :group 'with-editor + :type 'boolean) + +;;; Mode Commands + +(defvar with-editor-pre-finish-hook nil) +(defvar with-editor-pre-cancel-hook nil) +(defvar with-editor-post-finish-hook nil) +(defvar with-editor-post-finish-hook-1 nil) +(defvar with-editor-post-cancel-hook nil) +(defvar with-editor-post-cancel-hook-1 nil) +(defvar with-editor-cancel-alist nil) +(put 'with-editor-pre-finish-hook 'permanent-local t) +(put 'with-editor-pre-cancel-hook 'permanent-local t) +(put 'with-editor-post-finish-hook 'permanent-local t) +(put 'with-editor-post-cancel-hook 'permanent-local t) + +(defvar with-editor-show-usage t) +(defvar with-editor-cancel-message nil) +(defvar with-editor-previous-winconf nil) +(make-variable-buffer-local 'with-editor-show-usage) +(make-variable-buffer-local 'with-editor-cancel-message) +(make-variable-buffer-local 'with-editor-previous-winconf) +(put 'with-editor-cancel-message 'permanent-local t) +(put 'with-editor-previous-winconf 'permanent-local t) + +(defvar-local with-editor--pid nil "For internal use.") +(put 'with-editor--pid 'permanent-local t) + +(defun with-editor-finish (force) + "Finish the current edit session." + (interactive "P") + (when (run-hook-with-args-until-failure + 'with-editor-finish-query-functions force) + (let ((with-editor-post-finish-hook-1 + (ignore-errors (delq t with-editor-post-finish-hook)))) + (run-hooks 'with-editor-pre-finish-hook) + (with-editor-return nil) + (accept-process-output nil 0.1) + (run-hooks 'with-editor-post-finish-hook-1)))) + +(defun with-editor-cancel (force) + "Cancel the current edit session." + (interactive "P") + (when (run-hook-with-args-until-failure + 'with-editor-cancel-query-functions force) + (let ((message with-editor-cancel-message)) + (when (functionp message) + (setq message (funcall message))) + (let ((with-editor-post-cancel-hook-1 + (ignore-errors (delq t with-editor-post-cancel-hook))) + (with-editor-cancel-alist nil)) + (run-hooks 'with-editor-pre-cancel-hook) + (with-editor-return t) + (accept-process-output nil 0.1) + (run-hooks 'with-editor-post-cancel-hook-1)) + (message (or message "Canceled by user"))))) + +(defun with-editor-return (cancel) + (let ((winconf with-editor-previous-winconf) + (clients server-buffer-clients) + (dir default-directory) + (pid with-editor--pid)) + (remove-hook 'kill-buffer-query-functions + 'with-editor-kill-buffer-noop t) + (cond (cancel + (save-buffer) + (if clients + (dolist (client clients) + (ignore-errors + (server-send-string client "-error Canceled by user")) + (delete-process client)) + ;; Fallback for when emacs was used as $EDITOR + ;; instead of emacsclient or the sleeping editor. + ;; See https://github.com/magit/magit/issues/2258. + (ignore-errors (delete-file buffer-file-name)) + (kill-buffer))) + (t + (save-buffer) + (if clients + ;; Don't use `server-edit' because we do not want to + ;; show another buffer belonging to another client. + ;; See https://github.com/magit/magit/issues/2197. + (server-done) + (kill-buffer)))) + (when pid + (let ((default-directory dir)) + (process-file "kill" nil nil nil + "-s" (if cancel "USR2" "USR1") pid))) + (when (and winconf (eq (window-configuration-frame winconf) + (selected-frame))) + (set-window-configuration winconf)))) + +;;; Mode + +(defvar with-editor-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-c\C-c" 'with-editor-finish) + (define-key map [remap server-edit] 'with-editor-finish) + (define-key map [remap evil-save-and-close] 'with-editor-finish) + (define-key map [remap evil-save-modified-and-close] 'with-editor-finish) + (define-key map "\C-c\C-k" 'with-editor-cancel) + (define-key map [remap kill-buffer] 'with-editor-cancel) + (define-key map [remap ido-kill-buffer] 'with-editor-cancel) + (define-key map [remap iswitchb-kill-buffer] 'with-editor-cancel) + (define-key map [remap evil-quit] 'with-editor-cancel) + map)) + +(define-minor-mode with-editor-mode + "Edit a file as the $EDITOR of an external process." + :lighter with-editor-mode-lighter + ;; Protect the user from killing the buffer without using + ;; either `with-editor-finish' or `with-editor-cancel', + ;; and from removing the key bindings for these commands. + (unless with-editor-mode + (user-error "With-Editor mode cannot be turned off")) + (add-hook 'kill-buffer-query-functions + 'with-editor-kill-buffer-noop nil t) + ;; `server-execute' displays a message which is not + ;; correct when using this mode. + (when with-editor-show-usage + (with-editor-usage-message))) + +(put 'with-editor-mode 'permanent-local t) + +(defun with-editor-kill-buffer-noop () + (user-error (substitute-command-keys "\ +Don't kill this buffer. Instead cancel using \\[with-editor-cancel]"))) + +(defun with-editor-usage-message () + ;; Run after `server-execute', which is run using + ;; a timer which starts immediately. + (run-with-timer + 0.01 nil `(lambda () + (with-current-buffer ,(current-buffer) + (message (substitute-command-keys "\ +Type \\[with-editor-finish] to finish, \ +or \\[with-editor-cancel] to cancel")))))) + +;;; Wrappers + +(defvar with-editor--envvar nil "For internal use.") + +(defmacro with-editor (&rest body) + "Use the Emacsclient as $EDITOR while evaluating BODY. +Modify the `process-environment' for processes started in BODY, +instructing them to use the Emacsclient as $EDITOR. If optional +ENVVAR is provided then bind that environment variable instead. +\n(fn [ENVVAR] BODY...)" + (declare (indent defun) (debug (body))) + `(let ((with-editor--envvar ,(if (stringp (car body)) + (pop body) + '(or with-editor--envvar "EDITOR"))) + (process-environment process-environment)) + (with-editor--setup) + ,@body)) + +(defun with-editor--setup () + (if (or (not with-editor-emacsclient-executable) + (file-remote-p default-directory)) + (push (concat with-editor--envvar "=" with-editor-sleeping-editor) + process-environment) + ;; Make sure server-use-tcp's value is valid. + (unless (featurep 'make-network-process '(:family local)) + (setq server-use-tcp t)) + ;; Make sure the server is running. + (unless (process-live-p server-process) + (when (server-running-p server-name) + (setq server-name (format "server%s" (emacs-pid))) + (when (server-running-p server-name) + (server-force-delete server-name))) + (server-start)) + ;; Tell $EDITOR to use the Emacsclient. + (push (concat with-editor--envvar "=" + (shell-quote-argument with-editor-emacsclient-executable) + ;; Tell the process where the server file is. + (and (not server-use-tcp) + (concat " --socket-name=" + (shell-quote-argument + (expand-file-name server-name + server-socket-dir))))) + process-environment) + (when server-use-tcp + (push (concat "EMACS_SERVER_FILE=" + (expand-file-name server-name server-auth-dir)) + process-environment)) + ;; As last resort fallback to the sleeping editor. + (push (concat "ALTERNATE_EDITOR=" with-editor-sleeping-editor) + process-environment))) + +(defun with-editor-server-window () + (or (and buffer-file-name + (cdr (cl-find-if (lambda (cons) + (string-match-p (car cons) buffer-file-name)) + with-editor-server-window-alist))) + server-window)) + +(defun server-switch-buffer--with-editor-server-window-alist + (fn &optional next-buffer killed-one filepos) + "Honor `with-editor-server-window-alist' (which see)." + (let ((server-window (with-current-buffer + (or next-buffer (current-buffer)) + (when with-editor-mode + (setq with-editor-previous-winconf + (current-window-configuration))) + (with-editor-server-window)))) + (funcall fn next-buffer killed-one filepos))) + +(advice-add 'server-switch-buffer :around + 'server-switch-buffer--with-editor-server-window-alist) + +(defun start-file-process--with-editor-process-filter + (fn name buffer program &rest program-args) + "When called inside a `with-editor' form and the Emacsclient +cannot be used, then give the process the filter function +`with-editor-process-filter'. To avoid overriding the filter +being added here you should use `with-editor-set-process-filter' +instead of `set-process-filter' inside `with-editor' forms. + +When the `default-directory' is located on a remote machine, +then also manipulate PROGRAM and PROGRAM-ARGS in order to set +the appropriate editor environment variable." + (if (not with-editor--envvar) + (apply fn name buffer program program-args) + (when (file-remote-p default-directory) + (unless (equal program "env") + (push program program-args) + (setq program "env")) + (push (concat with-editor--envvar "=" with-editor-sleeping-editor) + program-args)) + (let ((process (apply fn name buffer program program-args))) + (set-process-filter process 'with-editor-process-filter) + (process-put process 'default-dir default-directory) + process))) + +(advice-add 'start-file-process :around + 'start-file-process--with-editor-process-filter) + +(defun with-editor-set-process-filter (process filter) + "Like `set-process-filter' but keep `with-editor-process-filter'. +Give PROCESS the new FILTER but keep `with-editor-process-filter' +if that was added earlier by the adviced `start-file-process'. + +Do so by wrapping the two filter functions using a lambda, which +becomes the actual filter. It calls `with-editor-process-filter' +first, passing t as NO-STANDARD-FILTER. Then it calls FILTER, +which may or may not insert the text into the PROCESS' buffer." + (set-process-filter + process + (if (eq (process-filter process) 'with-editor-process-filter) + `(lambda (proc str) + (,filter proc str) + (with-editor-process-filter proc str t)) + filter))) + +(defvar with-editor-filter-visit-hook nil) + +(defun with-editor-output-filter (string) + (save-match-data + (if (string-match "^WITH-EDITOR: \\([0-9]+\\) OPEN \\(.+?\\)\r?$" string) + (let ((pid (match-string 1 string)) + (file (match-string 2 string))) + (with-current-buffer + (find-file-noselect + (if (and (file-name-absolute-p file) default-directory) + (concat (file-remote-p default-directory) file) + (expand-file-name file))) + (with-editor-mode 1) + (setq with-editor--pid pid) + (run-hooks 'with-editor-filter-visit-hook) + (funcall (or (with-editor-server-window) 'switch-to-buffer) + (current-buffer)) + (kill-local-variable 'server-window)) + nil) + string))) + +(defun with-editor-process-filter + (process string &optional no-default-filter) + "Listen for edit requests by child processes." + (let ((default-directory (process-get process 'default-dir))) + (with-editor-output-filter string)) + (unless no-default-filter + (internal-default-process-filter process string))) + +(advice-add 'server-visit-files :after + 'server-visit-files--with-editor-file-name-history-exclude) + +(defun server-visit-files--with-editor-file-name-history-exclude + (files _proc &optional _nowait) + (pcase-dolist (`(,file . ,_) files) + (when (cl-find-if (lambda (regexp) + (string-match-p regexp file)) + with-editor-file-name-history-exclude) + (setq file-name-history (delete file file-name-history))))) + +;;; Augmentations + +;;;###autoload +(cl-defun with-editor-export-editor (&optional (envvar "EDITOR")) + "Teach subsequent commands to use current Emacs instance as editor. + +Set and export the environment variable ENVVAR, by default +\"EDITOR\". The value is automatically generated to teach +commands to use the current Emacs instance as \"the editor\". + +This works in `shell-mode', `term-mode' and `eshell-mode'." + (interactive (list (with-editor-read-envvar))) + (cond + ((derived-mode-p 'comint-mode 'term-mode) + (let ((process (get-buffer-process (current-buffer)))) + (goto-char (process-mark process)) + (process-send-string + process (format " export %s=%s\n" envvar + (shell-quote-argument with-editor-sleeping-editor))) + (while (accept-process-output process 0.1)) + (if (derived-mode-p 'term-mode) + (with-editor-set-process-filter process 'with-editor-emulate-terminal) + (add-hook 'comint-output-filter-functions 'with-editor-output-filter + nil t)))) + ((derived-mode-p 'eshell-mode) + (add-to-list 'eshell-preoutput-filter-functions + 'with-editor-output-filter) + (setenv envvar with-editor-sleeping-editor)) + (t + (error "Cannot export environment variables in this buffer"))) + (message "Successfully exported %s" envvar)) + +;;;###autoload +(defun with-editor-export-git-editor () + "Like `with-editor-export-editor' but always set `$GIT_EDITOR'." + (interactive) + (with-editor-export-editor "GIT_EDITOR")) + +;;;###autoload +(defun with-editor-export-hg-editor () + "Like `with-editor-export-editor' but always set `$HG_EDITOR'." + (interactive) + (with-editor-export-editor "HG_EDITOR")) + +(defun with-editor-emulate-terminal (process string) + "Like `term-emulate-terminal' but also handle edit requests." + (when (with-editor-output-filter string) + (term-emulate-terminal process string))) + +(defvar with-editor-envvars '("EDITOR" "GIT_EDITOR" "HG_EDITOR")) + +(cl-defun with-editor-read-envvar + (&optional (prompt "Set environment variable") + (default "EDITOR")) + (let ((reply (completing-read (if default + (format "%s (%s): " prompt default) + (concat prompt ": ")) + with-editor-envvars nil nil nil nil default))) + (if (string= reply "") (user-error "Nothing selected") reply))) + +;;;###autoload +(define-minor-mode shell-command-with-editor-mode + "Teach `shell-command' to use current Emacs instance as editor. + +Teach `shell-command', and all commands that ultimately call that +command, to use the current Emacs instance as editor by executing +\"EDITOR=CLIENT COMMAND&\" instead of just \"COMMAND&\". + +CLIENT is automatically generated; EDITOR=CLIENT instructs +COMMAND to use to the current Emacs instance as \"the editor\", +assuming no other variable overrides the effect of \"$EDITOR\". +CLIENT may be the path to an appropriate emacsclient executable +with arguments, or a script which also works over Tramp. + +Alternatively you can use the `with-editor-async-shell-command', +which also allows the use of another variable instead of +\"EDITOR\"." + :global t) + +;;;###autoload +(defun with-editor-async-shell-command + (command &optional output-buffer error-buffer envvar) + "Like `async-shell-command' but with `$EDITOR' set. + +Execute string \"ENVVAR=CLIENT COMMAND\" in an inferior shell; +display output, if any. With a prefix argument prompt for an +environment variable, otherwise the default \"EDITOR\" variable +is used. With a negative prefix argument additionally insert +the COMMAND's output at point. + +CLIENT is automatically generated; ENVVAR=CLIENT instructs +COMMAND to use to the current Emacs instance as \"the editor\", +assuming it respects ENVVAR as an \"EDITOR\"-like variable. +CLIENT may be the path to an appropriate emacsclient executable +with arguments, or a script which also works over Tramp. + +Also see `async-shell-command' and `shell-command'." + (interactive (with-editor-shell-command-read-args "Async shell command: " t)) + (let ((with-editor--envvar envvar)) + (with-editor + (async-shell-command command output-buffer error-buffer)))) + +;;;###autoload +(defun with-editor-shell-command + (command &optional output-buffer error-buffer envvar) + "Like `shell-command' or `with-editor-async-shell-command'. +If COMMAND ends with \"&\" behave like the latter, +else like the former." + (interactive (with-editor-shell-command-read-args "Shell command: ")) + (if (string-match "&[ \t]*\\'" command) + (with-editor-async-shell-command + command output-buffer error-buffer envvar) + (shell-command command output-buffer error-buffer))) + +(defun with-editor-shell-command-read-args (prompt &optional async) + (let ((command (read-shell-command + prompt nil nil + (let ((filename (or buffer-file-name + (and (eq major-mode 'dired-mode) + (dired-get-filename nil t))))) + (and filename (file-relative-name filename)))))) + (list command + (if (or async (setq async (string-match-p "&[ \t]*\\'" command))) + (< (prefix-numeric-value current-prefix-arg) 0) + current-prefix-arg) + shell-command-default-error-buffer + (and async current-prefix-arg (with-editor-read-envvar))))) + +(defun shell-command--shell-command-with-editor-mode + (fn command &optional output-buffer error-buffer) + ;; `shell-mode' and its hook are intended for buffers in which an + ;; interactive shell is running, but `shell-command' also turns on + ;; that mode, even though it only runs the shell to run a single + ;; command. The `with-editor-export-editor' hook function is only + ;; intended to be used in buffers in which an interactive shell is + ;; running, so it has to be remove here. + (let ((shell-mode-hook (remove 'with-editor-export-editor shell-mode-hook))) + (cond ((or (not (or with-editor--envvar shell-command-with-editor-mode)) + (not (string-match-p "&\\'" command))) + (funcall fn command output-buffer error-buffer)) + ((and with-editor-shell-command-use-emacsclient + with-editor-emacsclient-executable + (not (file-remote-p default-directory))) + (with-editor (funcall fn command output-buffer error-buffer))) + (t + (apply fn (format "%s=%s %s" + (or with-editor--envvar "EDITOR") + (shell-quote-argument with-editor-sleeping-editor) + command) + output-buffer error-buffer) + (ignore-errors + (let ((process (get-buffer-process + (or output-buffer + (get-buffer "*Async Shell Command*"))))) + (set-process-filter + process (lambda (proc str) + (comint-output-filter proc str) + (with-editor-process-filter proc str t))) + process)))))) + +(advice-add 'shell-command :around + 'shell-command--shell-command-with-editor-mode) + +;;; _ + +(defun with-editor-debug () + "Debug configuration issues. +See info node `(with-editor)Debugging' for instructions." + (interactive) + (with-current-buffer (get-buffer-create "*with-editor-debug*") + (pop-to-buffer (current-buffer)) + (erase-buffer) + (ignore-errors (with-editor)) + (insert + (format "with-editor: %s\n" (locate-library "with-editor.el")) + (format "emacs: %s (%s)\n" + (expand-file-name invocation-name invocation-directory) + emacs-version) + "system:\n" + (format " system-type: %s\n" system-type) + (format " system-configuration: %s\n" system-configuration) + (format " system-configuration-options: %s\n" system-configuration-options) + "server:\n" + (format " server-running-p: %s\n" (server-running-p)) + (format " server-process: %S\n" server-process) + (format " server-use-tcp: %s\n" server-use-tcp) + (format " server-name: %s\n" server-name) + (format " server-socket-dir: %s\n" server-socket-dir)) + (if (and server-socket-dir (file-accessible-directory-p server-socket-dir)) + (dolist (file (directory-files server-socket-dir nil "^[^.]")) + (insert (format " %s\n" file))) + (insert (format " %s: not an accessible directory\n" + (if server-use-tcp "WARNING" "ERROR")))) + (insert (format " server-auth-dir: %s\n" server-auth-dir)) + (if (file-accessible-directory-p server-auth-dir) + (dolist (file (directory-files server-auth-dir nil "^[^.]")) + (insert (format " %s\n" file))) + (insert (format " %s: not an accessible directory\n" + (if server-use-tcp "ERROR" "WARNING")))) + (let ((val with-editor-emacsclient-executable) + (def (default-value 'with-editor-emacsclient-executable)) + (fun (let ((warning-minimum-level :error) + (warning-minimum-log-level :error)) + (with-editor-locate-emacsclient)))) + (insert "with-editor-emacsclient-executable:\n" + (format " value: %s (%s)\n" val + (and val (with-editor-emacsclient-version val))) + (format " default: %s (%s)\n" def + (and def (with-editor-emacsclient-version def))) + (format " funcall: %s (%s)\n" fun + (and fun (with-editor-emacsclient-version fun))))) + (insert "path:\n" + (format " $PATH: %S\n" (getenv "PATH")) + (format " exec-path: %s\n" exec-path)) + (insert (format " with-editor-emacsclient-path:\n")) + (dolist (dir (with-editor-emacsclient-path)) + (insert (format " %s (%s)\n" dir (car (file-attributes dir)))) + (when (file-directory-p dir) + ;; Don't match emacsclientw.exe, it makes popup windows. + (dolist (exec (directory-files dir t "emacsclient\\(?:[^w]\\|\\'\\)")) + (insert (format " %s (%s)\n" exec + (with-editor-emacsclient-version exec)))))))) + +(defconst with-editor-font-lock-keywords + '(("(\\(with-\\(?:git-\\)?editor\\)\\_>" (1 'font-lock-keyword-face)))) +(font-lock-add-keywords 'emacs-lisp-mode with-editor-font-lock-keywords) + +(provide 'with-editor) +;; Local Variables: +;; indent-tabs-mode: nil +;; End: +;;; with-editor.el ends here diff --git a/elpa/with-editor-20180726.2044/with-editor.elc b/elpa/with-editor-20180726.2044/with-editor.elc new file mode 100644 index 0000000..180bccf Binary files /dev/null and b/elpa/with-editor-20180726.2044/with-editor.elc differ diff --git a/elpa/wrap-region-20140117.720/wrap-region-autoloads.el b/elpa/wrap-region-20140117.720/wrap-region-autoloads.el new file mode 100644 index 0000000..385e6cf --- /dev/null +++ b/elpa/wrap-region-20140117.720/wrap-region-autoloads.el @@ -0,0 +1,54 @@ +;;; wrap-region-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "wrap-region" "wrap-region.el" (23391 65235 +;;;;;; 0 0)) +;;; Generated autoloads from wrap-region.el + +(autoload 'wrap-region-mode "wrap-region" "\ +Wrap region with stuff. + +\(fn &optional ARG)" t nil) + +(autoload 'turn-on-wrap-region-mode "wrap-region" "\ +Turn on `wrap-region-mode'. + +\(fn)" t nil) + +(autoload 'turn-off-wrap-region-mode "wrap-region" "\ +Turn off `wrap-region-mode'. + +\(fn)" t nil) + +(defvar wrap-region-global-mode nil "\ +Non-nil if Wrap-Region-Global mode is enabled. +See the `wrap-region-global-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `wrap-region-global-mode'.") + +(custom-autoload 'wrap-region-global-mode "wrap-region" nil) + +(autoload 'wrap-region-global-mode "wrap-region" "\ +Toggle Wrap-Region mode in all buffers. +With prefix ARG, enable Wrap-Region-Global mode if ARG is positive; +otherwise, disable it. If called from Lisp, enable the mode if +ARG is omitted or nil. + +Wrap-Region mode is enabled in all buffers where +`turn-on-wrap-region-mode' would do it. +See `wrap-region-mode' for more information on Wrap-Region mode. + +\(fn &optional ARG)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; wrap-region-autoloads.el ends here diff --git a/elpa/wrap-region-20140117.720/wrap-region-pkg.el b/elpa/wrap-region-20140117.720/wrap-region-pkg.el new file mode 100644 index 0000000..cd71829 --- /dev/null +++ b/elpa/wrap-region-20140117.720/wrap-region-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "wrap-region" "20140117.720" "Wrap text with punctation or tag" '((dash "1.0.3")) :commit "fbae9b0f106187af19823f1a6260b5c68b7252e6" :keywords '("speed" "convenience") :authors '(("Johan Andersson" . "johan.rejeep@gmail.com")) :maintainer '("Johan Andersson" . "johan.rejeep@gmail.com") :url "http://github.com/rejeep/wrap-region") diff --git a/elpa/wrap-region-20140117.720/wrap-region.el b/elpa/wrap-region-20140117.720/wrap-region.el new file mode 100644 index 0000000..15a808d --- /dev/null +++ b/elpa/wrap-region-20140117.720/wrap-region.el @@ -0,0 +1,369 @@ +;;; wrap-region.el --- Wrap text with punctation or tag + +;; Copyright (C) 2008-2012 Johan Andersson + +;; Author: Johan Andersson +;; Maintainer: Johan Andersson +;; Version: 0.7.3 +;; Package-Version: 20140117.720 +;; Keywords: speed, convenience +;; URL: http://github.com/rejeep/wrap-region +;; Package-Requires: ((dash "1.0.3")) + +;; This file is NOT part of GNU Emacs. + + +;;; License: + +;; 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., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + + +;;; Commentary: + +;; wrap-region is a minor mode that wraps a region with +;; punctuations. For tagged markup modes, such as HTML and XML, it +;; wraps with tags. +;; +;; To use wrap-region, make sure that this file is in Emacs load-path: +;; (add-to-list 'load-path "/path/to/directory/or/file") +;; +;; Then require wrap-region: +;; (require 'wrap-region) + +;; To start wrap-region: +;; (wrap-region-mode t) or M-x wrap-region-mode +;; +;; If you only want wrap-region active in some mode, use hooks: +;; (add-hook 'ruby-mode-hook 'wrap-region-mode) +;; +;; Or if you want to activate it in all buffers, use the global mode: +;; (wrap-region-global-mode t) + +;; To wrap a region, select that region and hit one of the punctuation +;; keys. In "tag-modes"" (see `wrap-region-tag-active-modes'), "<" is +;; replaced and wraps the region with a tag. To activate this behavior +;; in a mode that is not default: +;; (add-to-list 'wrap-region-tag-active-modes 'some-tag-mode) +;; +;; `wrap-region-table' contains the default punctuations +;; that wraps. You can add and remove new wrappers by using the +;; functions `wrap-region-add-wrapper' and +;; `wrap-region-remove-wrapper' respectively. +;; (wrap-region-add-wrapper "`" "'") ; hit ` then region -> `region' +;; (wrap-region-add-wrapper "/*" "*/" "/") ; hit / then region -> /*region*/ +;; (wrap-region-add-wrapper "$" "$" nil 'latex-mode) ; hit $ then region -> $region$ in latex-mode +;; (wrap-region-remove-wrapper "(") +;; (wrap-region-remove-wrapper "$" 'latex-mode) +;; +;; Some modes may have conflicting key bindings with wrap-region. To +;; avoid conflicts, the list `wrap-region-except-modes' contains names +;; of modes where wrap-region should not be activated (note, only in +;; the global mode). You can add new modes like this: +;; (add-to-list 'wrap-region-except-modes 'conflicting-mode) + + +;;; Code: + +(require 'edmacro) +(require 'dash) +(eval-when-compile + (require 'cl)) + +(defstruct wrap-region-wrapper key left right modes) + +(defgroup wrap-region nil + "Wrap region with delimiters." + :group 'editing + :link '(url-link :tag "Github" "https://github.com/rejeep/wrap-region")) + +(defcustom wrap-region-except-modes '(calc-mode dired-mode) + "Major modes which should not use `wrap-region-mode'." + :group 'wrap-region + :type '(repeat (symbol :tag "Major mode"))) + +(defcustom wrap-region-tag-active-modes + '(html-mode sgml-mode rhtml-mode nxml-mode nxhtml-mode handlebars-mode web-mode) + "Major modes that use tags." + :group 'wrap-region + :type '(repeat (symbol :tag "Major mode"))) + +(define-obsolete-variable-alias 'wrap-region-hook 'wrap-region-mode-hook "0.8") +(defcustom wrap-region-mode-hook nil + "Functions to run after `wrap-region-mode' is enabled. + +This variable is a normal hook." + :group 'wrap-region + :type 'hook) + +(defcustom wrap-region-before-wrap-hook nil + "Functions to run before wrapping. + +This variable is a normal hook." + :group 'wrap-region + :type 'hook) + +(defcustom wrap-region-after-wrap-hook nil + "Functions to run after wrapping. + +This variable is a normal hook." + :group 'wrap-region + :type 'hook) + +(defcustom wrap-region-only-with-negative-prefix nil + "If non-nil only wrap with negative prefix. + +If this variable is not nil, only wrap the region if the trigger +key is given a negative prefix argument. Otherwise do not wrap. + +If nil, always wrap the region." + :group 'wrap-region + :type 'boolean) + +(defcustom wrap-region-keep-mark nil + "If non-nil, keep the wrapped region active." + :group 'wrap-region + :type 'boolean) + +(defvar wrap-region-mode-map (make-sparse-keymap) + "Keymap for `wrap-region-mode'.") + +(defvar wrap-region-table (make-hash-table :test 'equal) + "Table with wrapper pairs.") + +(defun wrap-region-trigger (arg key) + "Called when trigger key is pressed." + (let* ((wrapper (wrap-region-find key))) + (if (and wrapper + (region-active-p) + (if wrap-region-only-with-negative-prefix (< arg 0) t)) + (if (wrap-region-insert-tag-p key) + (wrap-region-with-tag) + (wrap-region-with-punctuations + (wrap-region-wrapper-left wrapper) + (wrap-region-wrapper-right wrapper))) + (wrap-region-fallback key)))) + +(defun wrap-region-find (key) + "Find first wrapper with trigger KEY that should be active in MAJOR-MODE." + (let ((wrappers (gethash key wrap-region-table))) + (or + (-first + (lambda (wrapper) + (member major-mode (wrap-region-wrapper-modes wrapper))) + wrappers) + (-first + (lambda (wrapper) + (not (wrap-region-wrapper-modes wrapper))) + wrappers)))) + +(defun wrap-region-insert-tag-p (key) + "Check if tag should be inserted or not." + (and + (equal key "<") + (member major-mode wrap-region-tag-active-modes))) + +(defun wrap-region-with-tag () + "Wraps region with tag." + (let* ((tag (read-string "Enter Tag (with optional attributes): ")) + (split (split-string tag " ")) + (tag-name (car split)) + (left (concat "<" tag ">")) + (right (concat ""))) + (wrap-region-with left right))) + +(defun wrap-region-with-punctuations (left right) + "Wraps region with LEFT and RIGHT punctuations." + (wrap-region-with left right)) + +(defun wrap-region-with (left right) + "Wraps region with LEFT and RIGHT." + (run-hooks 'wrap-region-before-wrap-hook) + (let ((beg (region-beginning)) + (end (region-end)) + (pos (point)) + (deactivate-mark nil)) + (save-excursion + (goto-char beg) + (insert left) + (goto-char (+ end (length left))) + (insert right)) + (if (= pos end) (forward-char 1)) + (if wrap-region-keep-mark + (let* ((beg-p (eq beg pos)) + (beg* (+ beg (length left))) + (end* (+ end (length left)))) + (push-mark (if beg-p end* beg*) nil t) + (goto-char (if beg-p beg* end*))) + (deactivate-mark))) + (run-hooks 'wrap-region-after-wrap-hook)) + +(defun wrap-region-fallback (key) + "Execute function that KEY was bound to before `wrap-region-mode'." + (let ((wrap-region-mode nil)) + (call-interactively (key-binding key)))) + +(defun wrap-region-add-wrappers (wrappers) + "Add WRAPPERS by calling `wrap-region-add-wrapper' for each one." + (mapc + (lambda (wrapper) + (apply 'wrap-region-add-wrapper wrapper)) + wrappers)) + +(defun wrap-region-add-wrapper (left right &optional key mode-or-modes) + "Add new LEFT and RIGHT wrapper. + +Optional KEY is the trigger key and MODE-OR-MODES is a single +mode or multiple modes that the wrapper should trigger in." + (or key (setq key left)) + (let ((wrappers (gethash key wrap-region-table)) + (modes + (if mode-or-modes + (if (listp mode-or-modes) + mode-or-modes + (list mode-or-modes))))) + (if wrappers + (let ((wrapper-exactly-same + (-first + (lambda (wrapper) + (and + (equal (wrap-region-wrapper-key wrapper) key) + (equal (wrap-region-wrapper-left wrapper) left) + (equal (wrap-region-wrapper-right wrapper) right))) + wrappers))) + (if wrapper-exactly-same + (when (wrap-region-wrapper-modes wrapper-exactly-same) + (if modes + (setf + (wrap-region-wrapper-modes wrapper-exactly-same) + (-union modes (wrap-region-wrapper-modes wrapper-exactly-same))) + (let ((new-wrapper (make-wrap-region-wrapper :key key :left left :right right))) + (puthash key (cons new-wrapper wrappers) wrap-region-table)))) + (let* ((new-wrapper (make-wrap-region-wrapper :key key :left left :right right :modes modes)) + (wrapper-same-trigger + (-first + (lambda (wrapper) + (equal (wrap-region-wrapper-key wrapper) key)) + wrappers)) + (wrapper-same-trigger-modes + (wrap-region-wrapper-modes wrapper-same-trigger))) + (when (and wrapper-same-trigger wrapper-same-trigger-modes) + (let ((new-modes (-difference (wrap-region-wrapper-modes wrapper-same-trigger) modes))) + (if new-modes + (setf (wrap-region-wrapper-modes wrapper-same-trigger) new-modes) + (setq wrappers (delete wrapper-same-trigger wrappers))))) + (puthash key (cons new-wrapper wrappers) wrap-region-table)))) + (let ((new-wrapper (make-wrap-region-wrapper :key key :left left :right right :modes modes))) + (puthash key (list new-wrapper) wrap-region-table)))) + (wrap-region-define-trigger key)) + +(defun wrap-region-remove-wrapper (key &optional mode-or-modes) + "Remove wrapper with trigger KEY or exclude from MODE-OR-MODES. + +If MODE-OR-MODES is not present, all wrappers for KEY are removed." + (if mode-or-modes + (let ((wrappers (gethash key wrap-region-table)) + (modes + (if mode-or-modes + (if (listp mode-or-modes) + mode-or-modes + (list mode-or-modes))))) + (mapc + (lambda (mode) + (let ((wrapper-including-mode + (-first + (lambda (wrapper) + (member mode (wrap-region-wrapper-modes wrapper))) + wrappers))) + (when wrapper-including-mode + (let ((new-modes (delete mode (wrap-region-wrapper-modes wrapper-including-mode)))) + (if new-modes + (setf (wrap-region-wrapper-modes wrapper-including-mode) new-modes) + (puthash key (delete wrapper-including-mode wrappers) wrap-region-table)))))) + modes)) + (wrap-region-destroy-wrapper key))) + +(defun wrap-region-destroy-wrapper (key) + "Remove the wrapper bound to KEY, no questions asked." + (remhash key wrap-region-table) + (wrap-region-unset-key key)) + +(defun wrap-region-define-wrappers () + "Defines defaults wrappers." + (mapc + (lambda (pair) + (apply 'wrap-region-add-wrapper pair)) + '(("\"" "\"") + ("'" "'") + ("(" ")") + ("{" "}") + ("[" "]") + ("<" ">")))) + +(defun wrap-region-define-trigger (key) + "Defines KEY as wrapper." + (wrap-region-define-key + key + `(lambda (arg) + (interactive "p") + (wrap-region-trigger arg ,key)))) + +(defun wrap-region-unset-key (key) + "Remove KEY from `wrap-region-mode-map'." + (wrap-region-define-key key)) + +(defun wrap-region-define-key (key &optional fn) + "Binds KEY to FN in `wrap-region-mode-map'." + (define-key wrap-region-mode-map (read-kbd-macro key) fn)) + + +;;;###autoload +(define-minor-mode wrap-region-mode + "Wrap region with stuff." + :init-value nil + :lighter " wr" + :keymap wrap-region-mode-map + :group 'wrap-region + :require 'wrap-region + (when wrap-region-mode + (wrap-region-define-wrappers))) + +;;;###autoload +(defun turn-on-wrap-region-mode () + "Turn on `wrap-region-mode'." + (interactive) + (unless (member major-mode wrap-region-except-modes) + (wrap-region-mode +1))) + +;;;###autoload +(defun turn-off-wrap-region-mode () + "Turn off `wrap-region-mode'." + (interactive) + (wrap-region-mode -1)) + +;;;###autoload +(define-globalized-minor-mode wrap-region-global-mode + wrap-region-mode + turn-on-wrap-region-mode + :group 'wrap-region + :require 'wrap-region) + +(provide 'wrap-region) + +;; Local Variables: +;; byte-compile-warnings: (not cl-functions) +;; End: + +;;; wrap-region.el ends here diff --git a/elpa/wrap-region-20140117.720/wrap-region.elc b/elpa/wrap-region-20140117.720/wrap-region.elc new file mode 100644 index 0000000..0903f7e Binary files /dev/null and b/elpa/wrap-region-20140117.720/wrap-region.elc differ diff --git a/elpa/writegood-mode-20180525.1343/writegood-mode-autoloads.el b/elpa/writegood-mode-20180525.1343/writegood-mode-autoloads.el new file mode 100644 index 0000000..eb27ae0 --- /dev/null +++ b/elpa/writegood-mode-20180525.1343/writegood-mode-autoloads.el @@ -0,0 +1,34 @@ +;;; writegood-mode-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "writegood-mode" "writegood-mode.el" (23391 +;;;;;; 65234 0 0)) +;;; Generated autoloads from writegood-mode.el + +(autoload 'writegood-reading-ease "writegood-mode" "\ +Flesch-Kincaid reading ease test in the region bounded by START and END. + +Scores roughly between 0 and 100. + +\(fn &optional START END)" t nil) + +(autoload 'writegood-grade-level "writegood-mode" "\ +Flesch-Kincaid grade level test. Converts reading ease score to a grade level (Score ~ years of school needed to read passage). + +\(fn &optional START END)" t nil) + +(autoload 'writegood-mode "writegood-mode" "\ +Colorize issues with the writing in the buffer. + +\(fn &optional ARG)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; writegood-mode-autoloads.el ends here diff --git a/elpa/writegood-mode-20180525.1343/writegood-mode-pkg.el b/elpa/writegood-mode-20180525.1343/writegood-mode-pkg.el new file mode 100644 index 0000000..69ca91d --- /dev/null +++ b/elpa/writegood-mode-20180525.1343/writegood-mode-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "writegood-mode" "20180525.1343" "Polish up poor writing on the fly" 'nil :commit "b71757ec337e226909fb0422f0224e31acc71733" :keywords '("writing" "weasel-words" "grammar") :authors '(("Benjamin Beckwith")) :maintainer '("Benjamin Beckwith") :url "http://github.com/bnbeckwith/writegood-mode") diff --git a/elpa/writegood-mode-20180525.1343/writegood-mode.el b/elpa/writegood-mode-20180525.1343/writegood-mode.el new file mode 100644 index 0000000..b402ac8 --- /dev/null +++ b/elpa/writegood-mode-20180525.1343/writegood-mode.el @@ -0,0 +1,313 @@ +;;; writegood-mode.el --- Polish up poor writing on the fly +;; +;; Author: Benjamin Beckwith +;; Created: 2010-8-12 +;; Version: 2.0 +;; Package-Version: 20180525.1343 +;; Last-Updated: 2015-03-25 +;; URL: http://github.com/bnbeckwith/writegood-mode +;; Keywords: writing weasel-words grammar +;; Compatability: +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Commentary: +;; +;; This minor mode tries to find and highlight problems with your +;; writing (in english). +;; +;; Behavior inspired by the weaselwords scripts to aid in good +;; writing. +;; http://matt.might.net/articles/shell-scripts-for-passive-voice-weasel-words-duplicates/ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Change Log: +;; +;; 2.0.3 Add in a small decription of the Flesch-Kincaid score +;; 2.0.2 Fix Formatting in Org-mode files, make faces underline +;; 2.0.1 Make user additions to word lists dynamic +;; 2.0.0 Flesch-Kincaid scoring added to functionality +;; 1.3.0 Several pull requests added, comments checked, passive voice regexp fixed +;; 1.2.0 Fixed weasel-words regexp to have word boundaries +;; 1.1.0 Fixed regexps to be multiline. +;; 1.0.0 Initial version +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; 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 this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth +;; Floor, Boston, MA 02110-1301, USA. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Test Text: +;; +;; This mode will improve various aspects of your writing in many ways. +;; With this mode, text within comments will be searched for the +;; the duplicate problem. +;; The text is searched and aspects (even within comments) are +;; highlighted. +;; Another benefit is the the finding of duplicates. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Code: + +(eval-when-compile + (require 'cl)) + +(require 'regexp-opt) +(require 'faces) + +(defgroup writegood nil + "Minor mode for highlighting bad english writing." + :prefix "writegood-" + :group 'help + :link '(url-link "http://github.com/bnbeckwith/writegood-mode")) + +(defconst writegood-version "2.0" + "WriteGood mode version") + +;; Weaselwords +(defface writegood-weasels-face + '((((supports :underline (:style wave))) + :underline (:style wave :color "DarkOrange")) + (((class color) (background light)) + (:inherit font-lock-warning-face :background "moccasin")) + (((class color) (background dark)) + (:inherit font-lock-warning-face :background "DarkOrange"))) + "Writegood face for weasel words" + :group 'writegood) + +(defcustom writegood-weasel-words + '("many" "various" "very" "fairly" "several" "extremely" + "exceedingly" "quite" "remarkably" "few" "surprisingly" + "mostly" "largely" "huge" "tiny" "are a number" "is a number" + "excellent" "interestingly" "significantly" "substantially" + "clearly" "vast" "relatively" "completely" "literally" + "not rocket science" "outside the box") + "The weasel words to use" + :group 'writegood + :type '(repeat string)) + +(defun writegood-weasels-font-lock-keywords-regexp () + "Generate regex that matches weasel-words" + (concat "\\b" (regexp-opt writegood-weasel-words) "\\b")) + +(defun writegood-weasels-font-lock-keywords () + (list (list (writegood-weasels-font-lock-keywords-regexp) + 0 (quote 'writegood-weasels-face) 'prepend))) + +;; Passive Voice +(defface writegood-passive-voice-face + '((((supports :underline (:style wave))) + :underline (:style wave :color "cyan")) + (((class color)) + (:inherit font-lock-warning-face :background "LemonChiffon"))) + "Writegood face for passive-voice" + :group 'writegood) + +(defcustom writegood-passive-voice-irregulars + '("awoken" "been" "born" "beat" "become" "begun" "bent" "beset" + "bet" "bid" "bidden" "bound" "bitten" "bled" "blown" "broken" + "bred" "brought" "broadcast" "built" "burnt" "burst" "bought" + "cast" "caught" "chosen" "clung" "come" "cost" "crept" "cut" + "dealt" "dug" "dived" "done" "drawn" "dreamt" "driven" "drunk" + "eaten" "fallen" "fed" "felt" "fought" "found" "fit" "fled" + "flung" "flown" "forbidden" "forgotten" "foregone" "forgiven" + "forsaken" "frozen" "gotten" "given" "gone" "ground" "grown" + "hung" "heard" "hidden" "hit" "held" "hurt" "kept" "knelt" "knit" + "known" "laid" "led" "leapt" "learnt" "left" "lent" "let" "lain" + "lighted" "lost" "made" "meant" "met" "misspelt" "mistaken" "mown" + "overcome" "overdone" "overtaken" "overthrown" "paid" "pled" "proven" + "put" "quit" "read" "rid" "ridden" "rung" "risen" "run" "sawn" + "said" "seen" "sought" "sold" "sent" "set" "sewn" "shaken" "shaven" + "shorn" "shed" "shone" "shod" "shot" "shown" "shrunk" "shut" + "sung" "sunk" "sat" "slept" "slain" "slid" "slung" "slit" + "smitten" "sown" "spoken" "sped" "spent" "spilt" "spun" "spit" + "split" "spread" "sprung" "stood" "stolen" "stuck" "stung" + "stunk" "stridden" "struck" "strung" "striven" "sworn" "swept" + "swollen" "swum" "swung" "taken" "taught" "torn" "told" "thought" + "thrived" "thrown" "thrust" "trodden" "understood" "upheld" "upset" + "woken" "worn" "woven" "wed" "wept" "wound" "won" "withheld" + "withstood" "wrung" "written") + "List of passive voice irregular verbs" + :group 'writegood + :type '(repeat string)) + +(defcustom writegood-sentence-punctuation + '(?. ?? ?!) + "List of punctuation denoting sentence end" + :group 'writegood + :type '(repeat character)) + +(defun writegood-passive-voice-font-lock-keywords-regexp () + "Generate font-lock keywords regexp for passive-voice" + (concat "\\b\\(am\\|are\\|were\\|being\\|is\\|been\\|was\\|be\\)\\b\\([[:space:]]\\|\\s<\\|\\s>\\)+\\([[:word:]]+ed\\|" + (regexp-opt writegood-passive-voice-irregulars) + "\\)\\b")) + +(defun writegood-passive-voice-font-lock-keywords () + (list (list (writegood-passive-voice-font-lock-keywords-regexp) + 0 (quote 'writegood-passive-voice-face) 'prepend))) + +;; Duplicates +(defface writegood-duplicates-face + '((((supports :underline (:style wave))) + :underline (:style wave :color "DeepPink")) + (((class color) (background light)) + (:inherit font-lock-warning-face :background "MistyRose")) + (((class color) (background dark)) + (:inherit font-lock-warning-face :background "DeepPink"))) + "Writegood face for duplicate words" + :group 'writegood) + +(defvar writegood-duplicates-font-lock-keywords-regexp + "\\b\\([[:word:]]+\\)\\([[:space:]]\\|\\s<\\|\\s>\\)+\\1\\b" + "Font-lock keywords for duplicates") + +(defun writegood-duplicates-font-lock-keywords () + (list (list writegood-duplicates-font-lock-keywords-regexp + 0 (quote 'writegood-duplicates-face) 'prepend))) + +;;;;;;;;;;;;;;;;;;;; Functions: + +(defun writegood-version () + "Tell the version you are using" + (interactive) + (message writegood-version)) + +(defun writegood-weasels-turn-on () + "Turn on syntax highlighting for weasels" + (font-lock-add-keywords nil (writegood-weasels-font-lock-keywords) t)) + +(defun writegood-passive-voice-turn-on () + "Turn on warnings for passive voice" + (font-lock-add-keywords nil (writegood-passive-voice-font-lock-keywords) t)) + +(defun writegood-duplicates-turn-on () + "Turn on warnings for duplicate words" + (font-lock-add-keywords nil (writegood-duplicates-font-lock-keywords) t)) + +(defun writegood-weasels-turn-off () + "Turn on syntax highlighting for weasels" + (font-lock-remove-keywords nil (writegood-weasels-font-lock-keywords))) + +(defun writegood-passive-voice-turn-off () + "Turn on warnings for passive voice" + (font-lock-remove-keywords nil (writegood-passive-voice-font-lock-keywords))) + +(defun writegood-duplicates-turn-off () + "Turn on warnings for duplicate words" + (font-lock-remove-keywords nil (writegood-duplicates-font-lock-keywords))) + +(defun writegood-turn-on () + "Turn on writegood-mode." + (make-local-variable 'font-lock-keywords-case-fold-search) + (setq font-lock-keywords-case-fold-search t) + (writegood-weasels-turn-on) + (writegood-passive-voice-turn-on) + (writegood-duplicates-turn-on)) + +(defun writegood-turn-off () + "Turn off writegood-mode." + (writegood-weasels-turn-off) + (writegood-passive-voice-turn-off) + (writegood-duplicates-turn-off)) + +(defun writegood-count-words (rstart rend) + "Count the words specified by the region bounded by RSTART and REND." + (if (boundp 'count-words) + (count-words rstart rend) + (how-many "[[:word:]]+" rstart rend))) + +(defun writegood-count-sentences (rstart rend) + "Count the sentences specified by the region bounded by RSTART and REND." + (how-many (regexp-opt-charset writegood-sentence-punctuation) rstart rend)) + +(defun writegood-count-syllables (rstart rend) + "Count the (approximate) number of syllables in the region bounded by RSTART and REND. + + Consecutive vowels count as one syllable. The endings -es -ed + and -e are not counted as syllables. + " + (- (how-many "[aeiouy]+" rstart rend) + (how-many "\\(es\\|ed\\|e\\)\\b" rstart rend))) + +(defun writegood-fk-parameters (&optional rstart rend) + "Flesch-Kincaid reading parameters" + (let* ((start (cond (rstart rstart) + ((and transient-mark-mode mark-active) (region-beginning)) + ('t (point-min)))) + (end (cond (rend rend) + ((and transient-mark-mode mark-active) (region-end)) + ('t (point-max)))) + (words (float (writegood-count-words start end))) + (syllables (float (writegood-count-syllables start end))) + (sentences (float (writegood-count-sentences start end)))) + (list sentences words syllables))) + +(defun writegood-reading-ease-score->comment (score) + "Rough interpreation of the Flesch-Kincaid Reading ease SCORE. + +From Wikipedia URL `https://en.wikipedia.org/wiki/Flesch–Kincaid_readability_tests'." + (cond + ((< score 0) "Ouch! (Proust literature)") + ((and (<= 0 score) (< score 30.0)) "Very difficult (college graduate)") + ((and (<= 30.0 score) (< score 50.0)) "Difficult (almost college)") + ((and (<= 50.0 score) (< score 60.0)) "Fairly difficult (10-12th grade)") + ((and (<= 60.0 score) (< score 70.0)) "Plain English (8-9th grade)") + ((and (<= 70.0 score) (< score 80.0)) "Fairly easy (7th grade)") + ((and (<= 80.0 score) (< score 90.0)) "Easy (6th grade)") + ((<= 90.0 score) "Very easy (5th grade)"))) + +;;;###autoload +(defun writegood-reading-ease (&optional start end) + "Flesch-Kincaid reading ease test in the region bounded by START and END. + +Scores roughly between 0 and 100." + (interactive) + (let* ((params (writegood-fk-parameters start end)) + (sentences (nth 0 params)) + (words (nth 1 params)) + (syllables (nth 2 params)) + (score (- 206.835 (* 1.015 (/ words sentences)) (* 84.6 (/ syllables words))))) + (message "Flesch-Kincaid reading ease score: %.2f %s" score + (writegood-reading-ease-score->comment score)))) + +;;;###autoload +(defun writegood-grade-level (&optional start end) + "Flesch-Kincaid grade level test. Converts reading ease score to a grade level (Score ~ years of school needed to read passage)." + (interactive) + (let* ((params (writegood-fk-parameters start end)) + (sentences (nth 0 params)) + (words (nth 1 params)) + (syllables (nth 2 params)) + (score (+ (* 0.39 (/ words sentences)) (* 11.8 (/ syllables words)) -15.59))) + (message "Flesch-Kincaid grade level score: %.2f" score))) + +;;;###autoload +(define-minor-mode writegood-mode + "Colorize issues with the writing in the buffer." + :lighter " Wg" + (progn + (if writegood-mode + (writegood-turn-on) + (writegood-turn-off)) + (font-lock-mode 1))) + +(provide 'writegood-mode) + +;;; writegood-mode.el ends here diff --git a/elpa/writegood-mode-20180525.1343/writegood-mode.elc b/elpa/writegood-mode-20180525.1343/writegood-mode.elc new file mode 100644 index 0000000..8861d0a Binary files /dev/null and b/elpa/writegood-mode-20180525.1343/writegood-mode.elc differ diff --git a/elpa/writeroom-mode-20170623.1027/dir b/elpa/writeroom-mode-20170623.1027/dir new file mode 100644 index 0000000..dbefa9e --- /dev/null +++ b/elpa/writeroom-mode-20170623.1027/dir @@ -0,0 +1,19 @@ +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" 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 +* Writeroom Mode: (writeroom-mode). + Distraction-free writing. diff --git a/elpa/writeroom-mode-20170623.1027/writeroom-mode-autoloads.el b/elpa/writeroom-mode-20170623.1027/writeroom-mode-autoloads.el new file mode 100644 index 0000000..e11f020 --- /dev/null +++ b/elpa/writeroom-mode-20170623.1027/writeroom-mode-autoloads.el @@ -0,0 +1,49 @@ +;;; writeroom-mode-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "writeroom-mode" "writeroom-mode.el" (23391 +;;;;;; 65233 0 0)) +;;; Generated autoloads from writeroom-mode.el + +(autoload 'writeroom-mode "writeroom-mode" "\ +Minor mode for distraction-free writing. + +\(fn &optional ARG)" t nil) + +(defvar global-writeroom-mode nil "\ +Non-nil if Global Writeroom mode is enabled. +See the `global-writeroom-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `global-writeroom-mode'.") + +(custom-autoload 'global-writeroom-mode "writeroom-mode" nil) + +(autoload 'global-writeroom-mode "writeroom-mode" "\ +Toggle Writeroom mode in all buffers. +With prefix ARG, enable Global Writeroom mode if ARG is positive; +otherwise, disable it. If called from Lisp, enable the mode if +ARG is omitted or nil. + +Writeroom mode is enabled in all buffers where +`turn-on-writeroom-mode' would do it. +See `writeroom-mode' for more information on Writeroom mode. + +\(fn &optional ARG)" t nil) + +;;;*** + +;;;### (autoloads nil nil ("writeroom-mode-pkg.el") (23391 65233 +;;;;;; 0 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; writeroom-mode-autoloads.el ends here diff --git a/elpa/writeroom-mode-20170623.1027/writeroom-mode-pkg.el b/elpa/writeroom-mode-20170623.1027/writeroom-mode-pkg.el new file mode 100644 index 0000000..1862059 --- /dev/null +++ b/elpa/writeroom-mode-20170623.1027/writeroom-mode-pkg.el @@ -0,0 +1,12 @@ +(define-package "writeroom-mode" "20170623.1027" "Minor mode for distraction-free writing" + '((emacs "24.1") + (visual-fill-column "1.9")) + :keywords + '("text") + :authors + '(("Joost Kremers" . "joostkremers@fastmail.fm")) + :maintainer + '("Joost Kremers" . "joostkremers@fastmail.fm")) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/writeroom-mode-20170623.1027/writeroom-mode.el b/elpa/writeroom-mode-20170623.1027/writeroom-mode.el new file mode 100644 index 0000000..777b372 --- /dev/null +++ b/elpa/writeroom-mode-20170623.1027/writeroom-mode.el @@ -0,0 +1,468 @@ +;;; writeroom-mode.el --- Minor mode for distraction-free writing -*- lexical-binding: t -*- + +;; Copyright (c) 2012-2017 Joost Kremers + +;; Author: Joost Kremers +;; Maintainer: Joost Kremers +;; Created: 11 July 2012 +;; Package-Requires: ((emacs "24.1") (visual-fill-column "1.9")) +;; Version: 3.7 +;; Keywords: text + +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: +;; +;; 1. Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; 2. Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in the +;; documentation and/or other materials provided with the distribution. +;; 3. The name of the author may not be used to endorse or promote products +;; derived from this software without specific prior written permission. +;; +;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +;; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +;; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +;; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE, +;; DATA, OR PROFITS ; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +;;; Commentary: + +;; writeroom-mode is a minor mode for Emacs that implements a +;; distraction-free writing mode similar to the famous Writeroom editor for +;; OS X. writeroom-mode is meant for GNU Emacs 24 and isn't tested on older +;; versions. +;; +;; See the README or info manual for usage instructions. +;; +;;; Code: + +(require 'visual-fill-column) + +(defvar writeroom--frame nil + "The frame in which `writeroom-mode' is activated. +The global effects only apply to this frame.") + +(defvar writeroom--buffers nil + "List of buffers in which `writeroom-mode' is activated.") + +(defvar writeroom--local-variables '(mode-line-format + header-line-format + line-spacing) + "Local variables whose values need to be saved when `writeroom-mode' is activated.") + +(defvar writeroom--saved-data nil + "Buffer-local data to be stored when `writeroom-mode' is activated. +These settings are restored when `writeroom-mode' is +deactivated.") +(make-variable-buffer-local 'writeroom--saved-data) + +(defvar writeroom--saved-visual-fill-column nil + "Status of `visual-fill-column-mode' before activating `writeroom-mode'.") +(make-variable-buffer-local 'writeroom--saved-visual-fill-column) + +(defvar writeroom--saved-window-config nil + "Window configuration active before `writeroom-mode' is activated.") + +(defgroup writeroom nil "Minor mode for distraction-free writing." + :group 'wp + :prefix "writeroom-") + +(defcustom writeroom-width 80 + "Width of the writeroom writing area. +This can be specified as an absolute width (the number of +characters in a line), or as a fraction of the total window +width, in the latter it should be a number between 0 and 1." + :group 'writeroom + :type '(choice (integer :tag "Absolute width:") + (float :tag "Relative width:" :value 0.5))) + +(defcustom writeroom-mode-line nil + "The mode line format to use with `writeroom-mode'. +By default, this option is set to nil, which disables the mode +line when `writeroom-mode' is activated. By setting this option +to t, the standard mode line is retained. Alternatively, it is +possible to specify a special mode line for `writeroom-mode' +buffers. If this option is chosen, the default is to only show +the buffer's modification status and the buffer name, but the +format can be customized. See the documentation for the variable +`mode-line-format' for further information. Note that if you set +this option, it may be more visually pleasing to set +`writeroom-bottom-divider-width' to 0." + :group 'writeroom + :type '(choice (const :tag "Disable the mode line" nil) + (const :tag "Use default mode line" t) + (sexp :tag "Customize mode line" + :value (" " mode-line-modified " " mode-line-buffer-identification)))) + +(defcustom writeroom-mode-line-toggle-position 'header-line-format + "Position to temporarily show the mode line. +When the mode line is disabled, the function +`writeroom-toggle-mode-line' makes the mode line visible. This +option determines whether it is shown as the mode line or as the +header line." + :group 'writeroom + :type '(choice (const :tag "Use the mode line" 'mode-line-format) + (const :tag "Use the header line" 'header-line-format))) + +(defcustom writeroom-bottom-divider-width 1 + "Width of the bottom window divider in pixels." + :group 'writeroom + :type '(integer :tag "Width")) + +(make-obsolete-variable 'writeroom-disable-fringe + "The variable `writeroom-disable-fringe' is no longer used." + "`writeroom-mode' version 2.9") + +(defcustom writeroom-maximize-window t + "Whether to maximize the current window in its frame. +When set to t, `writeroom-mode' deletes all other windows in +the current frame." + :group 'writeroom + :type '(choice (const :tag "Maximize window" t) + (const :tag "Do not maximize window" nil))) + +(defcustom writeroom-fullscreen-effect 'fullboth + "Effect applied when enabling fullscreen. +The value can be `fullboth', in which case fullscreen is +activated, or `maximized', in which case the relevant frame is +maximized but window decorations are still available." + :group 'writeroom + :type '(choice (const :tag "Fullscreen" fullboth) + (const :tag "Maximized" maximized))) + +(defcustom writeroom-border-width 30 + "Width in pixels of the border. +To use this option, select the option \"Add border\" in `Global +Effects'. This adds a border around the text area." + :group 'writeroom + :type '(integer :tag "Border width")) + +(defcustom writeroom-fringes-outside-margins t + "If set, place the fringes outside the margins." + :group 'writeroom + :type '(choice (const :tag "Place fringes outside margins" t) + (const :tag "Place fringes inside margins" nil))) + +(defcustom writeroom-major-modes '(text-mode) + "List of major modes in which writeroom-mode is activated. +The command `global-writeroom-mode' activates `writeroom-mode' in +every buffer that has one of the major modes listed in this +option. Modes can be specified as symbols or as regular +expressions. If a buffer has one of the specified major modes or +if its major mode name matches one of the regular expressions, +`writeroom-mode' is activated." + :group 'writeroom + :type '(repeat (choice (symbol :tag "Major mode") + (string :tag "Regular expression")))) + +(defcustom writeroom-use-derived-modes t + "Activate `writeroom-mode' in derived modes as well.'. +If this option is set, the command `global-writeroom-mode' +activates `writeroom-mode' in modes that are derived from those +listed in `writeroom-major-modes'. Note that this option applies +only to symbols in `writeroom-major-modes'. Regular expressions +are ignored." + :group 'writeroom + :type '(choice (const :tag "Use derived modes" t) + (const :tag "Do not use derived modes" nil))) + +(defcustom writeroom-major-modes-exceptions nil + "List of major modes in which `writeroom-mode' should not be activated. +This option lists exceptions to `writeroom-major-modes'. Modes +can be specified as symbols or as regular expressions." + :group 'writeroom + :type '(repeat (choice (symbol :tag "Major mode exception") + (string :tag "Regular expression")))) + +(defcustom writeroom-restore-window-config nil + "If set, restore window configuration after disabling `writeroom-mode'. +Setting this option makes sense primarily if `writeroom-mode' is +used in one buffer only. The window configuration that is stored +is the one that exists when `writeroom-mode' is first called, and +it is restored when `writeroom-mode' is deactivated in the last +buffer." + :group 'writeroom + :type '(choice (const :tag "Do not restore window configuration" nil) + (const :tag "Restore window configuration" t))) + +(defcustom writeroom-extra-line-spacing nil + "Additional line spacing for `writeroom-mode`." + :group 'writeroom + :type '(choice (const :tag "Do not add extra line spacing" :value nil) + (integer :tag "Absolute height" :value 5) + (float :tag "Relative height" :value 0.8))) + +(defcustom writeroom-global-effects '(writeroom-set-fullscreen + writeroom-set-alpha + writeroom-set-menu-bar-lines + writeroom-set-tool-bar-lines + writeroom-set-vertical-scroll-bars + writeroom-set-bottom-divider-width) + "List of global effects for `writeroom-mode'. +These effects are enabled when `writeroom-mode' is activated in +the first buffer and disabled when it is deactivated in the last +buffer." + :group 'writeroom + :type '(set (const :tag "Fullscreen" writeroom-set-fullscreen) + (const :tag "Disable transparency" writeroom-set-alpha) + (const :tag "Disable menu bar" writeroom-set-menu-bar-lines) + (const :tag "Disable tool bar" writeroom-set-tool-bar-lines) + (const :tag "Disable scroll bar" writeroom-set-vertical-scroll-bars) + (const :tag "Enable bottom window divider" writeroom-set-bottom-divider-width) + (const :tag "Add border" writeroom-set-internal-border-width) + (const :tag "Display frame on all workspaces" writeroom-set-sticky) + (repeat :inline t :tag "Custom effects" function))) + +(define-obsolete-variable-alias 'writeroom-global-functions 'writeroom-global-effects "`writeroom-mode' version 2.0") + +(defmacro define-writeroom-global-effect (fp value) + "Define a global effect for `writeroom-mode'. +The effect is activated by setting frame parameter FP to VALUE. +FP should be an unquoted symbol, the name of a frame parameter; +VALUE must be quoted (unless it is a string or a number, of +course). It can also be an unquoted symbol, in which case it +should be the name of a global variable whose value is then +assigned to FP. + +This macro defines a function `writeroom-set-' that takes one +argument and activates the effect if this argument is 1 and +deactivates it if it is -1. When the effect is activated, the +original value of frame parameter FP is stored in a frame +parameter `writeroom-', so that it can be restored when the +effect is deactivated." + (declare (indent defun)) + (let ((wfp (intern (format "writeroom-%s" fp)))) + `(fset (quote ,(intern (format "writeroom-set-%s" fp))) + (lambda (&optional arg) + (when (frame-live-p writeroom--frame) + (cond + ((= arg 1) ; activate + (set-frame-parameter writeroom--frame (quote ,wfp) (frame-parameter writeroom--frame (quote ,fp))) + (set-frame-parameter writeroom--frame (quote ,fp) ,value)) + ((= arg -1) ; deactivate + (set-frame-parameter writeroom--frame (quote ,fp) (frame-parameter writeroom--frame (quote ,wfp))) + (set-frame-parameter writeroom--frame (quote ,wfp) nil)))))))) + +(define-writeroom-global-effect fullscreen writeroom-fullscreen-effect) +(define-writeroom-global-effect alpha '(100 100)) +(define-writeroom-global-effect vertical-scroll-bars nil) +(define-writeroom-global-effect menu-bar-lines 0) +(define-writeroom-global-effect tool-bar-lines 0) +(define-writeroom-global-effect internal-border-width writeroom-border-width) +(define-writeroom-global-effect sticky t) +(define-writeroom-global-effect bottom-divider-width writeroom-bottom-divider-width) + +(defun turn-on-writeroom-mode () + "Turn on `writeroom-mode'. +This function activates `writeroom-mode' in a buffer if that +buffer's major mode matchs against one of `writeroom-major-modes'." + (unless (writeroom--match-major-mode writeroom-major-modes-exceptions) + (if (writeroom--match-major-mode writeroom-major-modes writeroom-use-derived-modes) + (writeroom-mode 1)))) + +(defun writeroom--match-major-mode (modes &optional derived) + "Match the current buffer's major mode against MODES. +MODES a list of mode names (symbols) or regular expressions. +Return t if the current major mode matches one of the elements of +MODES, nil otherwise. Comparison is done with `eq` (for symbols +in MODES) or with `string-match-p' (for strings in MODES). That +is, if the major mode is e.g., `emacs-lisp-mode', it will not +match the symbol `lisp-mode', but it will match the string +\"lisp-mode\". + +If DERIVED is non-nil, also return t if the current buffer's +major mode is a derived mode of one of the major mode symbols in +MODES." + (catch 'match + (dolist (elem modes) + (if (cond ((symbolp elem) + (or (eq elem major-mode) + (and derived (derived-mode-p elem)))) + ((string-match-p elem (symbol-name major-mode)))) + (throw 'match t))))) + +(defvar writeroom-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "s-?") #'writeroom-toggle-mode-line) + map) + "Keymap for writeroom-mode.") + +;;;###autoload +(define-minor-mode writeroom-mode + "Minor mode for distraction-free writing." + :init-value nil :lighter nil :global nil + (if writeroom-mode + (writeroom--enable) + (writeroom--disable))) + +;;;###autoload +(define-globalized-minor-mode global-writeroom-mode writeroom-mode turn-on-writeroom-mode + :require 'writeroom-mode + :group 'writeroom) + +(defun writeroom--kill-buffer-function () + "Disable `writeroom-mode' before killing a buffer, if necessary. +This function is for use in `kill-buffer-hook'. It checks whether +`writeroom-mode' is enabled in the buffer to be killed and +adjusts `writeroom--buffers' and the global effects accordingly." + (when writeroom-mode + (setq writeroom--buffers (delq (current-buffer) writeroom--buffers)) + (when (not writeroom--buffers) + (writeroom--set-global-effects -1) + (setq writeroom--frame nil)))) + +(add-hook 'kill-buffer-hook #'writeroom--kill-buffer-function) + +(defun writeroom--set-global-effects (arg) + "Activate or deactivate global effects. +The effects are activated if ARG is 1, deactivated if it is -1." + (mapc (lambda (fn) + (funcall fn arg)) + writeroom-global-effects)) + +(defun writeroom--calculate-width () + "Calculate the width of the writing area." + (if (floatp writeroom-width) + (truncate (* (window-total-width) writeroom-width)) + writeroom-width)) + +(defvar writeroom--mode-line-showing nil + "Flag indicating whether the original mode line is displayed.") +(make-variable-buffer-local 'writeroom--mode-line-showing) + +(defvar writeroom--orig-header-line nil + "Original format of the header line. +When the header line is used to temporarily display the mode +line, its original format is saved here.") +(make-variable-buffer-local 'writeroom--orig-header-line) + +(defun writeroom-toggle-mode-line () + "Toggle display of the original mode." + (interactive) + (unless (eq writeroom-mode-line t) ; This means the original mode-line is displayed already. + (cond + ((not writeroom--mode-line-showing) + (setq writeroom--orig-header-line header-line-format) + (set writeroom-mode-line-toggle-position (or (cdr (assq 'mode-line-format writeroom--saved-data)) + (default-value 'mode-line-format))) + (setq writeroom--mode-line-showing t)) + (writeroom--mode-line-showing + (if (eq writeroom-mode-line-toggle-position 'header-line-format) + (setq header-line-format writeroom--orig-header-line) + (setq mode-line-format writeroom-mode-line)) + (setq writeroom--mode-line-showing nil))) + (force-mode-line-update))) + +(defun writeroom-adjust-width (amount) + "Adjust the width of the writing area on the fly by AMOUNT. +A numeric prefix argument can be used to specify the adjustment. +When called without a prefix, this will reset the width to the default value." + (interactive "P") + (if amount + (setq visual-fill-column-width (max 1 (+ visual-fill-column-width amount))) + (setq visual-fill-column-width (writeroom--calculate-width))) + (visual-fill-column--adjust-window) + (message "Writing area is now %d characters wide" visual-fill-column-width)) + +(defun writeroom-increase-width () + "Increase the width of the writing area by 2 characters." + (interactive) + (writeroom-adjust-width 2)) + +(defun writeroom-decrease-width () + "Decrease the width of the writing area by 2 characters." + (interactive) + (writeroom-adjust-width -2)) + +(defun writeroom--enable () + "Set up writeroom-mode for the current buffer. +Also run the functions in `writeroom-global-effects' if the +current buffer is the first buffer in which `writeroom-mode' is +activated." + ;; save buffer-local variables, if they have a buffer-local binding + (setq writeroom--saved-data (mapcar (lambda (sym) + (if (local-variable-p sym) + (cons sym (buffer-local-value sym (current-buffer))) + sym)) + writeroom--local-variables)) + (setq writeroom--saved-visual-fill-column visual-fill-column-mode) + + ;; activate global effects + (when (not writeroom--buffers) + (setq writeroom--frame (selected-frame)) + (writeroom--set-global-effects 1) + (if writeroom-restore-window-config + (setq writeroom--saved-window-config (current-window-configuration)))) + + (push (current-buffer) writeroom--buffers) + + (when writeroom-maximize-window + (delete-other-windows)) + + (when writeroom-extra-line-spacing + (setq line-spacing writeroom-extra-line-spacing)) + + (unless (eq writeroom-mode-line t) ; if t, use standard mode line + (setq mode-line-format writeroom-mode-line)) + + (setq visual-fill-column-width (writeroom--calculate-width) + visual-fill-column-center-text t + visual-fill-column-fringes-outside-margins writeroom-fringes-outside-margins) + (visual-fill-column-mode 1) + + ;; if the current buffer is displayed in some window, the windows' + ;; margins and fringes must be adjusted. + (mapc (lambda (w) + (with-selected-window w + (visual-fill-column--adjust-window))) + (get-buffer-window-list (current-buffer) nil))) + +(defun writeroom--disable () + "Reset the current buffer to its normal appearance. +Also run the functions in `writeroom-global-effects' to undo +their effects if `writeroom-mode' is deactivated in the last +buffer in which it was active." + ;; disable visual-fill-column-mode + (visual-fill-column-mode -1) + (kill-local-variable 'visual-fill-column-width) + (kill-local-variable 'visual-fill-column-center-text) + (kill-local-variable 'visual-fill-column-fringes-outside-margins) + + ;; restore global effects if necessary + (setq writeroom--buffers (delq (current-buffer) writeroom--buffers)) + (when (not writeroom--buffers) + (writeroom--set-global-effects -1) + (setq writeroom--frame nil) + (if writeroom-restore-window-config + (set-window-configuration writeroom--saved-window-config))) + + ;; restore local variables + (mapc (lambda (val) + (if (symbolp val) + (kill-local-variable val) + (set (car val) (cdr val)))) + writeroom--saved-data) + + ;; if the current buffer is displayed in some window, the windows' + ;; margins and fringes must be adjusted. + (mapc (lambda (w) + (with-selected-window w + (set-window-margins (selected-window) 0 0) + (set-window-fringes (selected-window) nil))) + (get-buffer-window-list (current-buffer) nil)) + + ;; reenable `visual-fill-colummn-mode' with original settings if it was + ;; active before activating `writeroom-mode'. + (if writeroom--saved-visual-fill-column + (visual-fill-column-mode 1))) + +(provide 'writeroom-mode) + +;;; writeroom-mode.el ends here diff --git a/elpa/writeroom-mode-20170623.1027/writeroom-mode.elc b/elpa/writeroom-mode-20170623.1027/writeroom-mode.elc new file mode 100644 index 0000000..ea68c32 Binary files /dev/null and b/elpa/writeroom-mode-20170623.1027/writeroom-mode.elc differ diff --git a/elpa/writeroom-mode-20170623.1027/writeroom-mode.info b/elpa/writeroom-mode-20170623.1027/writeroom-mode.info new file mode 100644 index 0000000..56947bd --- /dev/null +++ b/elpa/writeroom-mode-20170623.1027/writeroom-mode.info @@ -0,0 +1,543 @@ +This is writeroom-mode.info, produced by makeinfo version 6.1 from +writeroom-mode.texi. + +INFO-DIR-SECTION Emacs +START-INFO-DIR-ENTRY +* Writeroom Mode: (writeroom-mode). Distraction-free writing. +END-INFO-DIR-ENTRY + + +File: writeroom-mode.info, Node: Top, Next: Writeroom-mode, Up: (dir) + +Top +*** + +* Menu: + +* Writeroom-mode:: + + +File: writeroom-mode.info, Node: Writeroom-mode, Prev: Top, Up: Top + +1 Writeroom-mode +**************** + +‘writeroom-mode’ is a minor mode for Emacs that implements a +distraction-free writing mode similar to the famous Writeroom editor for +OS X. ‘writeroom-mode’ is meant for GNU Emacs 24, lower versions are not +actively supported. +* Menu: + +* Installation:: +* Usage:: +* Multiple writeroom-mode buffers:: +* Frame effects:: +* Customisation:: +* Changing the width interactively:: +* Text size adjustments:: +* Displaying the mode line:: +* Adding global effects:: +* Other similar modes:: + + +File: writeroom-mode.info, Node: Installation, Next: Usage, Up: Writeroom-mode + +1.1 Installation +================ + +‘writeroom-mode’ can be installed through the package manager from Melpa +(http://melpa.org/). If installing manually, make sure to also install +its dependency ‘visual-fill-column’ +(https://github.com/joostkremers/visual-fill-column). + + +File: writeroom-mode.info, Node: Usage, Next: Multiple writeroom-mode buffers, Prev: Installation, Up: Writeroom-mode + +1.2 Usage +========= + +‘writeroom-mode’ can be activated in a buffer by calling ‘M-x +writeroom-mode RET’. By default, ‘writeroom-mode’ does the following +things: + + • activate fullscreen + • disable transparency + • disable the menu bar + • disable the tool bar + • disable the scroll bar + • enable a bottom window divider of 1 pixel + • maximise the current window (i.e., delete all other windows in the + frame) + • place the fringes outside the margins + • disable the mode line + • add window margins to the current buffer so that the text is 80 + characters wide + +The last three effects are buffer-local. The other effects apply to the +current frame. Because ‘writeroom-mode’ is a minor mode, this isn’t +entirely on the up and up, since minor modes aren’t supposed to have +such global effects. But ‘writeroom-mode’ is meant for distraction-free +writing, so these effects do make sense. + +All these effects can be disabled or customised. In addition, there are +several more options that are disabled by default but can be enabled in +the customisation buffer. + + +File: writeroom-mode.info, Node: Multiple writeroom-mode buffers, Next: Frame effects, Prev: Usage, Up: Writeroom-mode + +1.3 Multiple writeroom-mode buffers +=================================== + +It is possible to activate ‘writeroom-mode’ in more than one buffer. +The global effects are of course activated only once and they remain +active until ‘writeroom-mode’ is deactivated in _all_ buffers. +Alternatively, if you wish to use ‘writeroom-mode’ in all buffers that +have a particular major mode (e.g., ‘text-mode’, ‘markdown-mode’), you +can use the global minor mode ‘global-writeroom-mode’. This function +enables the global effects and activates the buffer-local effects in all +(current and future) buffers that have a major mode listed in the user +option ‘writeroom-major-modes’ (by default only ‘text-mode’). + +When ‘global-writeroom-mode’ is active, the function ‘writeroom-mode’ +can still be called to enable or disable ‘writeroom-mode’ in individual +buffers (regardless of their major mode, of course). Calling +‘global-writeroom-mode’ again disables ‘writeroom-mode’ in all buffers +in which it is active, also those in which it was activated manually. + + +File: writeroom-mode.info, Node: Frame effects, Next: Customisation, Prev: Multiple writeroom-mode buffers, Up: Writeroom-mode + +1.4 Frame effects +================= + +Most of the global effects that ‘writeroom-mode’ enables are handled by +setting specific frame parameters. This means that they apply to the +current frame. If you switch to another frame and display a +‘writeroom-mode’ buffer, only the buffer-local effects will be visible. + +‘writeroom-mode’ tries to make sure that it only affects one frame, and +that it restores that particular frame when it is deactivated in the +last buffer. This means it should be safe to activate ‘writeroom-mode’ +in one frame and deactivate it in another. Killing the ‘writeroom-mode’ +frame should also be safe. + +The affected frame is always restored to its original state, before +‘writeroom-mode’ was activated, even if you change any of the frame +parameters manually while ‘writeroom-mode’ is active. + + +File: writeroom-mode.info, Node: Customisation, Next: Changing the width interactively, Prev: Frame effects, Up: Writeroom-mode + +1.5 Customisation +================= + +* Menu: + +* Global Writeroom Mode:: +* Border Width:: +* Extra Line Spacing:: +* Fringes Outside Margins:: +* Fullscreen Effect:: +* Bottom Divider Width:: +* Global Effects:: +* Major Modes:: +* Use Derived Modes:: +* Major Modes Exceptions:: +* Maximize Window:: +* Mode Line:: +* Mode Line Toggle Position:: +* Restore Window Config:: +* Width:: + + +File: writeroom-mode.info, Node: Global Writeroom Mode, Next: Border Width, Up: Customisation + +1.5.1 Global Writeroom Mode +--------------------------- + +Activate this option to automatically turn on ‘writeroom-mode’ in any +buffer that has one of the major modes matched any mask listed in +‘writeroom-major-modes’ and not in ‘writeroom-major-modes’. + + +File: writeroom-mode.info, Node: Border Width, Next: Extra Line Spacing, Prev: Global Writeroom Mode, Up: Customisation + +1.5.2 Border Width +------------------ + +Width of the border around the text area. Disabled by default, see +‘writeroom-global-effects’ to enable the border. + + +File: writeroom-mode.info, Node: Extra Line Spacing, Next: Fringes Outside Margins, Prev: Border Width, Up: Customisation + +1.5.3 Extra Line Spacing +------------------------ + +Increase the line spacing. Can be an absolute value (the number of +pixels to add to the line) or a number relative to the default line +height. Disabled by default. + + +File: writeroom-mode.info, Node: Fringes Outside Margins, Next: Fullscreen Effect, Prev: Extra Line Spacing, Up: Customisation + +1.5.4 Fringes Outside Margins +----------------------------- + +If set, place the fringes outside the margins. ‘writeroom-mode’ expands +the window margins, causing the fringes to be pushed inside, which may +be visually distracting. This option keeps the fringes at the window’s +edges. Unset it if you prefer to have the fringes close to the text. + + +File: writeroom-mode.info, Node: Fullscreen Effect, Next: Bottom Divider Width, Prev: Fringes Outside Margins, Up: Customisation + +1.5.5 Fullscreen Effect +----------------------- + +Effect to apply when ‘writeroom-mode’ activates fullscreen. Can be +‘fullboth’, which uses the entire screen (i.e., window decorations are +disabled and the window manager’s panel or task bar is covered by the +Emacs frame) or ‘maximized’, in which case the Emacs frame is maximised +but keeps its window decorations and does not cover the panel. + + +File: writeroom-mode.info, Node: Bottom Divider Width, Next: Global Effects, Prev: Fullscreen Effect, Up: Customisation + +1.5.6 Bottom Divider Width +-------------------------- + +Width in pixels of the bottom window divider. Default value is 1. The +bottom window divider helps in distinguishing the minibuffer from the +text area, and also in distinguishing two windows split top-to-bottom. + + +File: writeroom-mode.info, Node: Global Effects, Next: Major Modes, Prev: Bottom Divider Width, Up: Customisation + +1.5.7 Global Effects +-------------------- + +List of global effects: + + • fullscreen + • transparency + • scroll bar + • menu bar + • tool bar + • bottom window divider + • border (add a border around the text area; disabled by default) + • sticky (display the window on all virtual workspaces; disabled by + default) + +Each option can be enabled or disabled individually. + + +File: writeroom-mode.info, Node: Major Modes, Next: Use Derived Modes, Prev: Global Effects, Up: Customisation + +1.5.8 Major Modes +----------------- + +List of major modes in which ‘writeroom-mode’ should be activated +automatically. Use in conjunction with ‘global-writeroom-mode’. + +The elements in this list can be major-mode symbols, or regular +expressions (in which case they must of course be strings). + + +File: writeroom-mode.info, Node: Use Derived Modes, Next: Major Modes Exceptions, Prev: Major Modes, Up: Customisation + +1.5.9 Use Derived Modes +----------------------- + +If this option is set, ‘global-writeroom-mode’ also activates +‘writeroom-mode’ in buffers whose major mode is a derived mode of one of +the modes in ‘writeroom-major-modes’. (Only the major mode symbols in +‘writeroom-major-modes’ are relevant.) + + +File: writeroom-mode.info, Node: Major Modes Exceptions, Next: Maximize Window, Prev: Use Derived Modes, Up: Customisation + +1.5.10 Major Modes Exceptions +----------------------------- + +List of major modes in which ‘writeroom-mode’ should not be activated by +‘global-writeroom-mode’. (It is still possible to activate +‘writeroom-mode’ manually). This can also be a mixed list of major-mode +symbols and regular expressions. + + +File: writeroom-mode.info, Node: Maximize Window, Next: Mode Line, Prev: Major Modes Exceptions, Up: Customisation + +1.5.11 Maximize Window +---------------------- + +Maximise the current window in its frame, i.e., delete all other +windows. + + +File: writeroom-mode.info, Node: Mode Line, Next: Mode Line Toggle Position, Prev: Maximize Window, Up: Customisation + +1.5.12 Mode Line +---------------- + +The mode line format to use. This option can be ‘nil’, which disables +the mode line altogether (which is the default), it can be ‘t’, which +retains the mode line, or it can be set to a customised format to only +show some information. If the latter option is chosen, the mode line +shows only the file name and the file modification status, but the +format can be customised. See the documentation for the variable +‘mode-line-format’ for details. If you set this option, it may be more +visually pleasing to set the option Bottom Divider Width to 0. + + +File: writeroom-mode.info, Node: Mode Line Toggle Position, Next: Restore Window Config, Prev: Mode Line, Up: Customisation + +1.5.13 Mode Line Toggle Position +-------------------------------- + +If you disable or customise the mode line, you may sometimes want to see +the entire mode line. ‘writeroom-mode’ provides the function +‘writeroom-toggle-mode-line’ (see below) to do this. You can specify +where you want to make the mode line visible when using this function: +in the mode line itself, or in the header line. + +Note that the default value of this option is to display the mode line +in the header line, because for some reason that is more reliable. +(Toggling the mode line multiple times in a row does not always work +very well.) + + +File: writeroom-mode.info, Node: Restore Window Config, Next: Width, Prev: Mode Line Toggle Position, Up: Customisation + +1.5.14 Restore Window Config +---------------------------- + +Restore the window configuration that existed before ‘writeroom-mode’ +was activated. This is primarily useful if you use ‘writeroom-mode’ in +only a single buffer, since the window configuration that is restored is +the one that existed at the moment when ‘writeroom-mode’ is called for +the first time. Disabled by default. + + +File: writeroom-mode.info, Node: Width, Prev: Restore Window Config, Up: Customisation + +1.5.15 Width +------------ + +Width of the text area. Can be specified as an absolute value (number +of characters) or as a fraction of the total window width (in which case +it should be a number between 0 and 1). + + +File: writeroom-mode.info, Node: Changing the width interactively, Next: Text size adjustments, Prev: Customisation, Up: Writeroom-mode + +1.6 Changing the width interactively +==================================== + +The width of the text area in the current buffer can be changed +interactively with the commands ‘writeroom-increase-width’ and +‘writeroom-decrease-width’, which increase and decrease the text width +by 2 characters. There is also a more general command +‘writeroom-adjust-width’, which adjusts the width of the text area by +the amount passed as prefix argument. That is, calling it with ‘M-5 M-x +writeroom-adjust-width’ increases the text width by 5 characters. +Calling ‘writeroom-adjust-width’ without prefix argument resets the +width to the default value. + +These commands are not bound to any keys, but you can bind them in the +following manner (the actual keys are just examples, of course; choose +any keys you like): + +(with-eval-after-load 'writeroom-mode + (define-key writeroom-mode-map (kbd "C-M-<") #'writeroom-decrease-width) + (define-key writeroom-mode-map (kbd "C-M->") #'writeroom-increase-width) + (define-key writeroom-mode-map (kbd "C-M-=") #'writeroom-adjust-width)) + + +File: writeroom-mode.info, Node: Text size adjustments, Next: Displaying the mode line, Prev: Changing the width interactively, Up: Writeroom-mode + +1.7 Text size adjustments +========================= + +Text size adjustments are taken into account in calculating the margins, +which means that if the text size is increased, the margins are +decreased, so that the number of characters on the line remains more or +less the same. Since it is not possible to detect interactive text size +adjustments (e.g., with ‘text-size-adjust’), the adjustments of the +margins cannot be made automatically. You need to force a redisplay, +e.g., with the command ‘redraw-display’. + +Alternatively, you can advise the command you use for adjusting the text +size (most likely ‘text-size-adjust’): + +(advice-add 'text-scale-adjust :after + #'visual-fill-column-adjust) + + +File: writeroom-mode.info, Node: Displaying the mode line, Next: Adding global effects, Prev: Text size adjustments, Up: Writeroom-mode + +1.8 Displaying the mode line +============================ + +By default, ‘writeroom-mode’ disables the mode line. If you +occasionally need to see the full mode line, you can use the command +‘writeroom-toggle-mode-line’, which makes the mode line visible. +Calling it again hides the mode line. This command is bound to ‘s-?’ +(‘s’ is the super key, i.e., the Windows key on PCs, the ⌘ key on Macs), +but it can be rebound by putting something like the following in your +‘init.el’: + +(with-eval-after-load 'writeroom-mode + (define-key writeroom-mode-map (kbd "s-?") nil) + (define-key writeroom-mode-map (kbd "") #’writeroom-toggle-mode-line)) + +The first ‘define-key’ disables the binding for ‘s-?’. Substitute your +preferred key binding in the second line to bind +‘writeroom-toggle-mode-line’ to it. + + +File: writeroom-mode.info, Node: Adding global effects, Next: Other similar modes, Prev: Displaying the mode line, Up: Writeroom-mode + +1.9 Adding global effects +========================= + +It is possible to add your own global effects to ‘writeroom-mode’. If +there is a global minor mode that you want turned on when +‘writeroom-mode’ is activated for the first time, you can simply add it +to the user option ‘writeroom-global-effects’ by checking the box +"Custom effects", clicking the [INS] button and adding the function to +the list. + +Alternatively, you can also write your own function. This function +should take one argument and enable the effect if the argument is ‘1’ +and disable it if the argument is ‘-1’. To give an example, if you want +to activate a minimalist colour theme in ‘writeroom-mode’, you can write +the following function: + +(defun my-writeroom-theme (arg) + (cond + ((= arg 1) + (enable-theme 'minimalist-dark)) + ((= arg -1) + (disable-theme 'minimalist-dark)))) + +If your function affects the frame, you should make sure that it only +affects the ‘writeroom-mode’ frame by passing the variable +‘writeroom--frame’ to all frame-changing functions. If your frame +effect involves changing the value of a frame parameter, you may be able +to use the macro ‘define-writeroom-global-effect’; see its doc string +for details. + +In principle, it is not a good idea to define a custom global effect +function as a toggle, but if you are sure you’ll only ever use a single +frame, it should be safe enough. For example, sometimes setting the +‘fullscreen’ frame parameter does not work. In this case, if you’re on +Linux, you could send an X client message directly: + +(defun my-toggle-fullscreen (_) + (x-send-client-message nil 0 nil "_NET_WM_STATE" 32 + '(2 "_NET_WM_STATE_FULLSCREEN" 0))) + + +File: writeroom-mode.info, Node: Other similar modes, Prev: Adding global effects, Up: Writeroom-mode + +1.10 Other similar modes +======================== + +There are two other modes that I know of that also implement a +distraction-free writing environment: Darkroom +(https://github.com/joaotavora/darkroom) and Olivetti +(https://github.com/rnkn/olivetti). Both are narrower in scope than +‘writeroom-mode’. + +In particular, both Darkroom and Olivetti only affect the buffer (or +more precisely, its window), not the frame. They centre the text by +adding window margins, and optionally resize the text and hide the mode +line. They do not make Emacs fullscreen and do not remove the menu and +tool bars, the scroll bar or the window decorations. This is a +conscious choice (see, e.g., this pull request +(https://github.com/joaotavora/darkroom/pull/2) and this issue +(https://github.com/rnkn/olivetti/issues/6)), motivated by the fact that +affecting the frame in this way may lead to problems when using multiple +Emacs frames. + +It is true that changing the appearance of the current frame (the global +effects, as ‘writeroom-mode’ calls them) is risky if you use multiple +frames. ‘writeroom-mode’ applies its global effects to the frame that +is current when it is first activated and tries to make sure that _only_ +this frame is ever affected. Therefore, it should be safe to use +‘writeroom-mode’, even if you use multiple frames. (If you do run into +issues, however, I would welcome a bug report.) Alternatively, you can +turn off all global effects and use ‘writeroom-mode’ in much the same +way as Darkroom or Olivetti. + +Another difference with Darkroom and Olivetti is that ‘writeroom-mode’ +tries to be as customisable as possible. It has a larger number of +customisation options than either of the other modes and also provides a +way to add custom global effects. This may or may not be what you need, +of course. + + + +Tag Table: +Node: Top222 +Node: Writeroom-mode336 +Ref: #writeroom-mode445 +Node: Installation931 +Ref: #installation1051 +Node: Usage1295 +Ref: #usage1441 +Node: Multiple writeroom-mode buffers2547 +Ref: #multiple-writeroom-mode-buffers2746 +Node: Frame effects3764 +Ref: #frame-effects3935 +Node: Customisation4744 +Ref: #customisation4916 +Node: Global Writeroom Mode5251 +Ref: #global-writeroom-mode5408 +Node: Border Width5617 +Ref: #border-width5783 +Node: Extra Line Spacing5905 +Ref: #extra-line-spacing6085 +Node: Fringes Outside Margins6252 +Ref: #fringes-outside-margins6447 +Node: Fullscreen Effect6740 +Ref: #fullscreen-effect6925 +Node: Bottom Divider Width7284 +Ref: #bottom-divider-width7466 +Node: Global Effects7680 +Ref: #global-effects7844 +Node: Major Modes8199 +Ref: #major-modes8354 +Node: Use Derived Modes8619 +Ref: #use-derived-modes8794 +Node: Major Modes Exceptions9056 +Ref: #major-modes-exceptions9247 +Node: Maximize Window9499 +Ref: #maximize-window9668 +Node: Mode Line9743 +Ref: #mode-line9903 +Node: Mode Line Toggle Position10466 +Ref: #mode-line-toggle-position10664 +Node: Restore Window Config11217 +Ref: #restore-window-config11403 +Node: Width11740 +Ref: #width11860 +Node: Changing the width interactively12045 +Ref: #changing-the-width-interactively12263 +Node: Text size adjustments13268 +Ref: #text-size-adjustments13475 +Node: Displaying the mode line14132 +Ref: #displaying-the-mode-line14334 +Node: Adding global effects15120 +Ref: #adding-global-effects15314 +Node: Other similar modes16999 +Ref: #other-similar-modes17158 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/elpa/yasnippet-20180621.50/yasnippet-autoloads.el b/elpa/yasnippet-20180621.50/yasnippet-autoloads.el new file mode 100644 index 0000000..4004c8e --- /dev/null +++ b/elpa/yasnippet-20180621.50/yasnippet-autoloads.el @@ -0,0 +1,55 @@ +;;; yasnippet-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "yasnippet" "yasnippet.el" (23391 65230 0 0)) +;;; Generated autoloads from yasnippet.el + +(autoload 'yas-minor-mode "yasnippet" "\ +Toggle YASnippet mode. + +When YASnippet mode is enabled, `yas-expand', normally bound to +the TAB key, expands snippets of code depending on the major +mode. + +With no argument, this command toggles the mode. +positive prefix argument turns on the mode. +Negative prefix argument turns off the mode. + +Key bindings: +\\{yas-minor-mode-map} + +\(fn &optional ARG)" t nil) + +(defvar yas-global-mode nil "\ +Non-nil if Yas-Global mode is enabled. +See the `yas-global-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `yas-global-mode'.") + +(custom-autoload 'yas-global-mode "yasnippet" nil) + +(autoload 'yas-global-mode "yasnippet" "\ +Toggle Yas minor mode in all buffers. +With prefix ARG, enable Yas-Global mode if ARG is positive; +otherwise, disable it. If called from Lisp, enable the mode if +ARG is omitted or nil. + +Yas minor mode is enabled in all buffers where +`yas-minor-mode-on' would do it. +See `yas-minor-mode' for more information on Yas minor mode. + +\(fn &optional ARG)" t nil) +(autoload 'snippet-mode "yasnippet" "A mode for editing yasnippets" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; yasnippet-autoloads.el ends here diff --git a/elpa/yasnippet-20180621.50/yasnippet-pkg.el b/elpa/yasnippet-20180621.50/yasnippet-pkg.el new file mode 100644 index 0000000..8207b33 --- /dev/null +++ b/elpa/yasnippet-20180621.50/yasnippet-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "yasnippet" "20180621.50" "Yet another snippet extension for Emacs." '((cl-lib "0.5")) :commit "1e713608682685d4a9b78519c84e3196e207c353" :keywords '("convenience" "emulation") :maintainer '("Noam Postavsky" . "npostavs@gmail.com") :url "http://github.com/joaotavora/yasnippet") diff --git a/elpa/yasnippet-20180621.50/yasnippet.el b/elpa/yasnippet-20180621.50/yasnippet.el new file mode 100644 index 0000000..c5c05fa --- /dev/null +++ b/elpa/yasnippet-20180621.50/yasnippet.el @@ -0,0 +1,5106 @@ +;;; yasnippet.el --- Yet another snippet extension for Emacs. + +;; Copyright (C) 2008-2018 Free Software Foundation, Inc. +;; Authors: pluskid , +;; João Távora , +;; Noam Postavsky +;; Maintainer: Noam Postavsky +;; Version: 0.13.0 +;; Package-Version: 20180621.50 +;; X-URL: http://github.com/joaotavora/yasnippet +;; Keywords: convenience, emulation +;; URL: http://github.com/joaotavora/yasnippet +;; Package-Requires: ((cl-lib "0.5")) +;; EmacsWiki: YaSnippetMode + +;; 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 . + +;;; Commentary: +;; +;; Basic steps to setup: +;; +;; (add-to-list 'load-path +;; "~/path-to-yasnippet") +;; (require 'yasnippet) +;; (yas-global-mode 1) +;; +;; +;; Interesting variables are: +;; +;; `yas-snippet-dirs' +;; +;; The directory where user-created snippets are to be +;; stored. Can also be a list of directories. In that case, +;; when used for bulk (re)loading of snippets (at startup or +;; via `yas-reload-all'), directories appearing earlier in +;; the list override other dir's snippets. Also, the first +;; directory is taken as the default for storing the user's +;; new snippets. +;; +;; The deprecated `yas/root-directory' aliases this variable +;; for backward-compatibility. +;; +;; +;; Major commands are: +;; +;; M-x yas-expand +;; +;; Try to expand snippets before point. In `yas-minor-mode', +;; this is normally bound to TAB, but you can customize it in +;; `yas-minor-mode-map'. +;; +;; M-x yas-load-directory +;; +;; Prompts you for a directory hierarchy of snippets to load. +;; +;; M-x yas-activate-extra-mode +;; +;; Prompts you for an extra mode to add snippets for in the +;; current buffer. +;; +;; M-x yas-insert-snippet +;; +;; Prompts you for possible snippet expansion if that is +;; possible according to buffer-local and snippet-local +;; expansion conditions. With prefix argument, ignore these +;; conditions. +;; +;; M-x yas-visit-snippet-file +;; +;; Prompts you for possible snippet expansions like +;; `yas-insert-snippet', but instead of expanding it, takes +;; you directly to the snippet definition's file, if it +;; exists. +;; +;; M-x yas-new-snippet +;; +;; Lets you create a new snippet file in the correct +;; subdirectory of `yas-snippet-dirs', according to the +;; active major mode. +;; +;; M-x yas-load-snippet-buffer +;; +;; When editing a snippet, this loads the snippet. This is +;; bound to "C-c C-c" while in the `snippet-mode' editing +;; mode. +;; +;; M-x yas-tryout-snippet +;; +;; When editing a snippet, this opens a new empty buffer, +;; sets it to the appropriate major mode and inserts the +;; snippet there, so you can see what it looks like. This is +;; bound to "C-c C-t" while in `snippet-mode'. +;; +;; M-x yas-describe-tables +;; +;; Lists known snippets in a separate buffer. User is +;; prompted as to whether only the currently active tables +;; are to be displayed, or all the tables for all major +;; modes. +;; +;; If you have `dropdown-list' installed, you can optionally use it +;; as the preferred "prompting method", putting in your .emacs file, +;; for example: +;; +;; (require 'dropdown-list) +;; (setq yas-prompt-functions '(yas-dropdown-prompt +;; yas-ido-prompt +;; yas-completing-prompt)) +;; +;; Also check out the customization group +;; +;; M-x customize-group RET yasnippet RET +;; +;; If you use the customization group to set variables +;; `yas-snippet-dirs' or `yas-global-mode', make sure the path to +;; "yasnippet.el" is present in the `load-path' *before* the +;; `custom-set-variables' is executed in your .emacs file. +;; +;; For more information and detailed usage, refer to the project page: +;; http://github.com/joaotavora/yasnippet + +;;; Code: + +(require 'cl-lib) +(declare-function cl-progv-after "cl-extra") ; Needed for 23.4. +(require 'easymenu) +(require 'help-mode) + +(defvar yas--editing-template) +(defvar yas--guessed-modes) +(defvar yas--indent-original-column) +(defvar yas--scheduled-jit-loads) +(defvar yas-keymap) +(defvar yas-selected-text) +(defvar yas-verbosity) +(defvar yas--current-template) + + +;;; User customizable variables + +(defgroup yasnippet nil + "Yet Another Snippet extension" + :prefix "yas-" + :group 'editing) + +(defconst yas--loaddir + (file-name-directory (or load-file-name buffer-file-name)) + "Directory that yasnippet was loaded from.") + +(defconst yas-installed-snippets-dir (expand-file-name "snippets" yas--loaddir)) +(make-obsolete-variable 'yas-installed-snippets-dir "\ +Yasnippet no longer comes with installed snippets" "0.13") + +(defconst yas--default-user-snippets-dir + (expand-file-name "snippets" user-emacs-directory)) + +(defcustom yas-snippet-dirs (list yas--default-user-snippets-dir) + "List of top-level snippet directories. + +Each element, a string or a symbol whose value is a string, +designates a top-level directory where per-mode snippet +directories can be found. + +Elements appearing earlier in the list override later elements' +snippets. + +The first directory is taken as the default for storing snippet's +created with `yas-new-snippet'. " + :type '(choice (directory :tag "Single directory") + (repeat :tag "List of directories" + (choice (directory) (variable)))) + :set #'(lambda (symbol new) + (let ((old (and (boundp symbol) + (symbol-value symbol)))) + (set-default symbol new) + (unless (or (not (fboundp 'yas-reload-all)) + (equal old new)) + (yas-reload-all))))) + +(defun yas-snippet-dirs () + "Return variable `yas-snippet-dirs' as list of strings." + (cl-loop for e in (if (listp yas-snippet-dirs) + yas-snippet-dirs + (list yas-snippet-dirs)) + collect + (cond ((stringp e) e) + ((and (symbolp e) + (boundp e) + (stringp (symbol-value e))) + (symbol-value e)) + (t + (error "[yas] invalid element %s in `yas-snippet-dirs'" e))))) + +(defcustom yas-new-snippet-default "\ +# -*- mode: snippet -*- +# name: $1 +# key: ${2:${1:$(yas--key-from-desc yas-text)}} +# -- +$0`(yas-escape-text yas-selected-text)`" + "Default snippet to use when creating a new snippet. +If nil, don't use any snippet." + :type 'string) + +(defcustom yas-prompt-functions '(yas-dropdown-prompt + yas-completing-prompt + yas-maybe-ido-prompt + yas-no-prompt) + "Functions to prompt for keys, templates, etc interactively. + +These functions are called with the following arguments: + +- PROMPT: A string to prompt the user + +- CHOICES: a list of strings or objects. + +- optional DISPLAY-FN : A function that, when applied to each of +the objects in CHOICES will return a string. + +The return value of any function you put here should be one of +the objects in CHOICES, properly formatted with DISPLAY-FN (if +that is passed). + +- To signal that your particular style of prompting is +unavailable at the moment, you can also have the function return +nil. + +- To signal that the user quit the prompting process, you can +signal `quit' with + + (signal \\='quit \"user quit!\")" + :type '(repeat function)) + +(defcustom yas-indent-line 'auto + "Controls indenting applied to a recent snippet expansion. + +The following values are possible: + +- `fixed' Indent the snippet to the current column; + +- `auto' Indent each line of the snippet with `indent-according-to-mode' + +Every other value means don't apply any snippet-side indentation +after expansion (the manual per-line \"$>\" indentation still +applies)." + :type '(choice (const :tag "Nothing" nothing) + (const :tag "Fixed" fixed) + (const :tag "Auto" auto))) + +(defcustom yas-also-auto-indent-first-line nil + "Non-nil means also auto indent first line according to mode. + +Naturally this is only valid when `yas-indent-line' is `auto'." + :type 'boolean) + +(defcustom yas-also-indent-empty-lines nil + "Non-nil means also indent empty lines according to mode." + :type 'boolean) + +(defcustom yas-snippet-revival t + "Non-nil means re-activate snippet fields after undo/redo." + :type 'boolean) + +(defcustom yas-triggers-in-field nil + "If non-nil, allow stacked expansions (snippets inside snippets). + +Otherwise `yas-next-field-or-maybe-expand' just moves on to the +next field" + :type 'boolean) + +(defcustom yas-fallback-behavior 'return-nil + "This option is obsolete. +Now that the conditional keybinding `yas-maybe-expand' is +available, there's no more need for it." + :type '(choice (const :tag "Call previous command" call-other-command) + (const :tag "Do nothing" return-nil))) + +(make-obsolete-variable + 'yas-fallback-behavior + "For `call-other-command' behavior bind to the conditional +command value `yas-maybe-expand', for `return-nil' behavior bind +directly to `yas-expand'." + "0.12") + +(defcustom yas-choose-keys-first nil + "If non-nil, prompt for snippet key first, then for template. + +Otherwise prompts for all possible snippet names. + +This affects `yas-insert-snippet' and `yas-visit-snippet-file'." + :type 'boolean) + +(defcustom yas-choose-tables-first nil + "If non-nil, and multiple eligible snippet tables, prompts user for tables first. + +Otherwise, user chooses between the merging together of all +eligible tables. + +This affects `yas-insert-snippet', `yas-visit-snippet-file'" + :type 'boolean) + +(defcustom yas-use-menu 'abbreviate + "Display a YASnippet menu in the menu bar. + +When non-nil, submenus for each snippet table will be listed +under the menu \"Yasnippet\". + +- If set to `abbreviate', only the current major-mode +menu and the modes set in `yas--extra-modes' are listed. + +- If set to `full', every submenu is listed + +- If set to nil, hide the menu. + +Any other non-nil value, every submenu is listed." + :type '(choice (const :tag "Full" full) + (const :tag "Abbreviate" abbreviate) + (const :tag "No menu" nil))) + +(defcustom yas-trigger-symbol (or (and (eq window-system 'mac) + (ignore-errors + (char-to-string ?\x21E5))) ;; little ->| sign + " =>") + "The text that will be used in menu to represent the trigger." + :type 'string) + +(defcustom yas-wrap-around-region nil + "What to insert for snippet's $0 field. + +If set to a character, insert contents of corresponding register. +If non-nil insert region contents. This can be overridden on a +per-snippet basis. A value of `cua' is considered equivalent to +`?0' for backwards compatibility." + :type '(choice (character :tag "Insert from register") + (const t :tag "Insert region contents") + (const nil :tag "Don't insert anything") + (const cua))) ; backwards compat + +(defcustom yas-good-grace t + "If non-nil, don't raise errors in elisp evaluation. + +This affects both the inline elisp in snippets and the hook +variables such as `yas-after-exit-snippet-hook'. + +If this variable's value is `inline', an error string \"[yas] +error\" is returned instead of raising the error. If this +variable's value is `hooks', a message is output to according to +`yas-verbosity-level'. If this variable's value is t, both are +active." + :type 'boolean) + +(defcustom yas-visit-from-menu nil + "If non-nil visit snippets's files from menu, instead of expanding them. + +This can only work when snippets are loaded from files." + :type 'boolean) + +(defcustom yas-expand-only-for-last-commands nil + "List of `last-command' values to restrict tab-triggering to, or nil. + +Leave this set at nil (the default) to be able to trigger an +expansion simply by placing the cursor after a valid tab trigger, +using whichever commands. + +Optionally, set this to something like (self-insert-command) if +you to wish restrict expansion to only happen when the last +letter of the snippet tab trigger was typed immediately before +the trigger key itself." + :type '(repeat function)) + +(defcustom yas-alias-to-yas/prefix-p t + "If non-nil make aliases for the old style yas/ prefixed symbols. +It must be set to nil before loading yasnippet to take effect." + :type 'boolean + :group 'yasnippet) + +;; Only two faces, and one of them shouldn't even be used... +;; +(defface yas-field-highlight-face + '((t (:inherit 'region))) + "The face used to highlight the currently active field of a snippet") + +(defface yas--field-debug-face + '() + "The face used for debugging some overlays normally hidden") + + +;;; User-visible variables + +(defconst yas-maybe-skip-and-clear-field + '(menu-item "" yas-skip-and-clear-field + :filter yas--maybe-clear-field-filter) + "A conditional key definition. +This can be used as a key definition in keymaps to bind a key to +`yas-skip-and-clear-field' only when at the beginning of an +unmodified snippey field.") + +(defvar yas-keymap (let ((map (make-sparse-keymap))) + (define-key map [(tab)] 'yas-next-field-or-maybe-expand) + (define-key map (kbd "TAB") 'yas-next-field-or-maybe-expand) + (define-key map [(shift tab)] 'yas-prev-field) + (define-key map [backtab] 'yas-prev-field) + (define-key map (kbd "C-g") 'yas-abort-snippet) + (define-key map (kbd "C-d") yas-maybe-skip-and-clear-field) + map) + "The active keymap while a snippet expansion is in progress.") + +(defvar yas-key-syntaxes (list #'yas-try-key-from-whitespace + "w_.()" "w_." "w_" "w") + "Syntaxes and functions to help look for trigger keys before point. + +Each element in this list specifies how to skip buffer positions +backwards and look for the start of a trigger key. + +Each element can be either a string or a function receiving the +original point as an argument. A string element is simply passed +to `skip-syntax-backward' whereas a function element is called +with no arguments and should also place point before the original +position. + +The string between the resulting buffer position and the original +point is matched against the trigger keys in the active snippet +tables. + +If no expandable snippets are found, the next element is the list +is tried, unless a function element returned the symbol `again', +in which case it is called again from the previous position and +may once more reposition point. + +For example, if `yas-key-syntaxes' has the value (\"w\" \"w_\"), +trigger keys composed exclusively of \"word\"-syntax characters +are looked for first. Failing that, longer keys composed of +\"word\" or \"symbol\" syntax are looked for. Therefore, +triggering after + +foo-bar + +will, according to the \"w\" element first try \"barbaz\". If +that isn't a trigger key, \"foo-barbaz\" is tried, respecting the +second \"w_\" element. Notice that even if \"baz\" is a trigger +key for an active snippet, it won't be expanded, unless a +function is added to `yas-key-syntaxes' that eventually places +point between \"bar\" and \"baz\". + +See also Info node `(elisp) Syntax Descriptors'.") + +(defvar yas-after-exit-snippet-hook + '() + "Hooks to run after a snippet exited. + +The hooks will be run in an environment where some variables bound to +proper values: + +`yas-snippet-beg' : The beginning of the region of the snippet. + +`yas-snippet-end' : Similar to beg. + +Attention: These hooks are not run when exiting nested/stacked snippet expansion!") + +(defvar yas-before-expand-snippet-hook + '() + "Hooks to run just before expanding a snippet.") + +(defconst yas-not-string-or-comment-condition + '(if (and (let ((ppss (syntax-ppss))) + (or (nth 3 ppss) (nth 4 ppss))) + (memq this-command '(yas-expand yas-expand-from-trigger-key + yas-expand-from-keymap))) + '(require-snippet-condition . force-in-comment) + t) + "Disables snippet expansion in strings and comments. +To use, set `yas-buffer-local-condition' to this value.") + +(defcustom yas-buffer-local-condition t + "Snippet expanding condition. + +This variable is a Lisp form which is evaluated every time a +snippet expansion is attempted: + + * If it evaluates to nil, no snippets can be expanded. + + * If it evaluates to the a cons (require-snippet-condition + . REQUIREMENT) + + * Snippets bearing no \"# condition:\" directive are not + considered + + * Snippets bearing conditions that evaluate to nil (or + produce an error) won't be considered. + + * If the snippet has a condition that evaluates to non-nil + RESULT: + + * If REQUIREMENT is t, the snippet is considered + + * If REQUIREMENT is `eq' RESULT, the snippet is + considered + + * Otherwise, the snippet is not considered. + + * If it evaluates to the symbol `always', all snippets are + considered for expansion, regardless of any conditions. + + * If it evaluates to t or some other non-nil value + + * Snippet bearing no conditions, or conditions that + evaluate to non-nil, are considered for expansion. + + * Otherwise, the snippet is not considered. + +Here's an example preventing snippets from being expanded from +inside comments, in `python-mode' only, with the exception of +snippets returning the symbol `force-in-comment' in their +conditions. + + (add-hook \\='python-mode-hook + (lambda () + (setq yas-buffer-local-condition + \\='(if (python-syntax-comment-or-string-p) + \\='(require-snippet-condition . force-in-comment) + t))))" + :type + `(choice + (const :tag "Disable snippet expansion inside strings and comments" + ,yas-not-string-or-comment-condition) + (const :tag "Expand all snippets regardless of conditions" always) + (const :tag "Expand snippets unless their condition is nil" t) + (const :tag "Disable all snippet expansion" nil) + sexp)) + +(defcustom yas-overlay-priority 100 + "Priority to use for yasnippets overlays. +This is useful to control whether snippet navigation bindings +override bindings from other packages (e.g., `company-mode')." + :type 'integer) + + +;;; Internal variables + +(defconst yas--version "0.13.0") + +(defvar yas--menu-table (make-hash-table) + "A hash table of MAJOR-MODE symbols to menu keymaps.") + +(defvar yas--escaped-characters + '(?\\ ?` ?\" ?' ?$ ?} ?{ ?\( ?\)) + "List of characters which *might* need to be escaped.") + +(defconst yas--field-regexp + "${\\([0-9]+:\\)?\\([^}]*\\)}" + "A regexp to *almost* recognize a field.") + +(defconst yas--multi-dollar-lisp-expression-regexp + "$+[ \t\n]*\\(([^)]*)\\)" + "A regexp to *almost* recognize a \"$(...)\" expression.") + +(defconst yas--backquote-lisp-expression-regexp + "`\\([^`]*\\)`" + "A regexp to recognize a \"\\=`lisp-expression\\=`\" expression." ) + +(defconst yas--transform-mirror-regexp + "${\\(?:\\([0-9]+\\):\\)?$\\([ \t\n]*([^}]*\\)" + "A regexp to *almost* recognize a mirror with a transform.") + +(defconst yas--simple-mirror-regexp + "$\\([0-9]+\\)" + "A regexp to recognize a simple mirror.") + +(defvar yas--snippet-id-seed 0 + "Contains the next id for a snippet.") + +(defvar yas--original-auto-fill-function nil + "The original value of `auto-fill-function'.") +(make-variable-buffer-local 'yas--original-auto-fill-function) + +(defvar yas--watch-auto-fill-backtrace nil) + +(defun yas--watch-auto-fill (sym newval op _where) + (when (and (or (and (eq sym 'yas--original-auto-fill-function) + (null newval) + (eq auto-fill-function 'yas--auto-fill)) + (and (eq sym 'auto-fill-function) + (eq newval 'yas--auto-fill) + (null yas--original-auto-fill-function))) + (null yas--watch-auto-fill-backtrace) + (fboundp 'backtrace-frames) ; Suppress compiler warning. + ;; If we're about to change `auto-fill-function' too, + ;; it's okay (probably). + (not (and (eq op 'makunbound) + (not (eq (default-value 'auto-fill-function) 'yas--auto-fill)) + (cl-member 'kill-all-local-variables + (backtrace-frames 'yas--watch-auto-fill) + :key (lambda (frame) (nth 1 frame)))))) + (setq yas--watch-auto-fill-backtrace + (backtrace-frames 'yas--watch-auto-fill)))) + +;; Try to get more info on #873/919 (this only works for Emacs 26+). +(when (fboundp 'add-variable-watcher) + (add-variable-watcher 'yas--original-auto-fill-function + #'yas--watch-auto-fill) + (add-variable-watcher 'auto-fill-function + #'yas--watch-auto-fill)) + +(defun yas--snippet-next-id () + (let ((id yas--snippet-id-seed)) + (cl-incf yas--snippet-id-seed) + id)) + + +;;; Minor mode stuff + +(defvar yas--minor-mode-menu nil + "Holds the YASnippet menu.") + +(defvar yas--condition-cache-timestamp nil) + +(defun yas--maybe-expand-key-filter (cmd) + (when (let ((yas--condition-cache-timestamp (current-time))) + (yas--templates-for-key-at-point)) + cmd)) + +(defconst yas-maybe-expand + '(menu-item "" yas-expand :filter yas--maybe-expand-key-filter) + "A conditional key definition. +This can be used as a key definition in keymaps to bind a key to +`yas-expand' only when there is a snippet available to be +expanded.") + +(defvar yas-minor-mode-map + (let ((map (make-sparse-keymap))) + (define-key map [(tab)] yas-maybe-expand) + (define-key map (kbd "TAB") yas-maybe-expand) + (define-key map "\C-c&\C-s" 'yas-insert-snippet) + (define-key map "\C-c&\C-n" 'yas-new-snippet) + (define-key map "\C-c&\C-v" 'yas-visit-snippet-file) + map) + "The keymap used when `yas-minor-mode' is active.") + +(easy-menu-define yas--minor-mode-menu + yas-minor-mode-map + "Menu used when `yas-minor-mode' is active." + '("YASnippet" :visible yas-use-menu + "----" + ["Expand trigger" yas-expand + :help "Possibly expand tab trigger before point"] + ["Insert at point..." yas-insert-snippet + :help "Prompt for an expandable snippet and expand it at point"] + ["New snippet..." yas-new-snippet + :help "Create a new snippet in an appropriate directory"] + ["Visit snippet file..." yas-visit-snippet-file + :help "Prompt for an expandable snippet and find its file"] + "----" + ("Snippet menu behaviour" + ["Visit snippets" (setq yas-visit-from-menu t) + :help "Visit snippets from the menu" + :active t :style radio :selected yas-visit-from-menu] + ["Expand snippets" (setq yas-visit-from-menu nil) + :help "Expand snippets from the menu" + :active t :style radio :selected (not yas-visit-from-menu)] + "----" + ["Show all known modes" (setq yas-use-menu 'full) + :help "Show one snippet submenu for each loaded table" + :active t :style radio :selected (eq yas-use-menu 'full)] + ["Abbreviate according to current mode" (setq yas-use-menu 'abbreviate) + :help "Show only snippet submenus for the current active modes" + :active t :style radio :selected (eq yas-use-menu 'abbreviate)]) + ("Indenting" + ["Auto" (setq yas-indent-line 'auto) + :help "Indent each line of the snippet with `indent-according-to-mode'" + :active t :style radio :selected (eq yas-indent-line 'auto)] + ["Fixed" (setq yas-indent-line 'fixed) + :help "Indent the snippet to the current column" + :active t :style radio :selected (eq yas-indent-line 'fixed)] + ["None" (setq yas-indent-line 'none) + :help "Don't apply any particular snippet indentation after expansion" + :active t :style radio :selected (not (member yas-indent-line '(fixed auto)))] + "----" + ["Also auto indent first line" (setq yas-also-auto-indent-first-line + (not yas-also-auto-indent-first-line)) + :help "When auto-indenting also, auto indent the first line menu" + :active (eq yas-indent-line 'auto) + :style toggle :selected yas-also-auto-indent-first-line] + ) + ("Prompting method" + ["System X-widget" (setq yas-prompt-functions + (cons #'yas-x-prompt + (remove #'yas-x-prompt + yas-prompt-functions))) + :help "Use your windowing system's (gtk, mac, windows, etc...) default menu" + :active t :style radio :selected (eq (car yas-prompt-functions) + #'yas-x-prompt)] + ["Dropdown-list" (setq yas-prompt-functions + (cons #'yas-dropdown-prompt + (remove #'yas-dropdown-prompt + yas-prompt-functions))) + :help "Use a special dropdown list" + :active t :style radio :selected (eq (car yas-prompt-functions) + #'yas-dropdown-prompt)] + ["Ido" (setq yas-prompt-functions + (cons #'yas-ido-prompt + (remove #'yas-ido-prompt + yas-prompt-functions))) + :help "Use an ido-style minibuffer prompt" + :active t :style radio :selected (eq (car yas-prompt-functions) + #'yas-ido-prompt)] + ["Completing read" (setq yas-prompt-functions + (cons #'yas-completing-prompt + (remove #'yas-completing-prompt + yas-prompt-functions))) + :help "Use a normal minibuffer prompt" + :active t :style radio :selected (eq (car yas-prompt-functions) + #'yas-completing-prompt)] + ) + ("Misc" + ["Wrap region in exit marker" + (setq yas-wrap-around-region + (not yas-wrap-around-region)) + :help "If non-nil automatically wrap the selected text in the $0 snippet exit" + :style toggle :selected yas-wrap-around-region] + ["Allow stacked expansions " + (setq yas-triggers-in-field + (not yas-triggers-in-field)) + :help "If non-nil allow snippets to be triggered inside other snippet fields" + :style toggle :selected yas-triggers-in-field] + ["Revive snippets on undo " + (setq yas-snippet-revival + (not yas-snippet-revival)) + :help "If non-nil allow snippets to become active again after undo" + :style toggle :selected yas-snippet-revival] + ["Good grace " + (setq yas-good-grace + (not yas-good-grace)) + :help "If non-nil don't raise errors in bad embedded elisp in snippets" + :style toggle :selected yas-good-grace] + ) + "----" + ["Load snippets..." yas-load-directory + :help "Load snippets from a specific directory"] + ["Reload everything" yas-reload-all + :help "Cleanup stuff, reload snippets, rebuild menus"] + ["About" yas-about + :help "Display some information about YASnippet"])) + +(defvar yas--extra-modes nil + "An internal list of modes for which to also lookup snippets. + +This variable probably makes more sense as buffer-local, so +ensure your use `make-local-variable' when you set it.") +(define-obsolete-variable-alias 'yas-extra-modes 'yas--extra-modes "0.9.1") + +(defvar yas--tables (make-hash-table) + "A hash table of mode symbols to `yas--table' objects.") + +(defvar yas--parents (make-hash-table) + "A hash table of mode symbols do lists of direct parent mode symbols. + +This list is populated when reading the \".yas-parents\" files +found when traversing snippet directories with +`yas-load-directory'. + +There might be additional parenting information stored in the +`derived-mode-parent' property of some mode symbols, but that is +not recorded here.") + +(defvar yas--direct-keymaps (list) + "Keymap alist supporting direct snippet keybindings. + +This variable is placed in `emulation-mode-map-alists'. + +Its elements looks like (TABLE-NAME . KEYMAP). They're +instantiated on `yas-reload-all' but KEYMAP is added to only when +loading snippets. `yas--direct-TABLE-NAME' is then a variable +set buffer-locally when entering `yas-minor-mode'. KEYMAP binds +all defined direct keybindings to `yas-maybe-expand-from-keymap' +which decides on the snippet to expand.") + +(defun yas-direct-keymaps-reload () + "Force reload the direct keybinding for active snippet tables." + (interactive) + (setq yas--direct-keymaps nil) + (maphash #'(lambda (name table) + (push (cons (intern (format "yas--direct-%s" name)) + (yas--table-direct-keymap table)) + yas--direct-keymaps)) + yas--tables)) + +(defun yas--modes-to-activate (&optional mode) + "Compute list of mode symbols that are active for `yas-expand' and friends." + (defvar yas--dfs) ;We rely on dynbind. We could use `letrec' instead! + (let* ((explored (if mode (list mode) ; Building up list in reverse. + (cons major-mode (reverse yas--extra-modes)))) + (yas--dfs + (lambda (mode) + (cl-loop for neighbour + in (cl-list* (get mode 'derived-mode-parent) + ;; NOTE: `fboundp' check is redundant + ;; since Emacs 24.4. + (and (fboundp mode) (symbol-function mode)) + (gethash mode yas--parents)) + when (and neighbour + (not (memq neighbour explored)) + (symbolp neighbour)) + do (push neighbour explored) + (funcall yas--dfs neighbour))))) + (mapc yas--dfs explored) + (nreverse explored))) + +(defvar yas-minor-mode-hook nil + "Hook run when `yas-minor-mode' is turned on.") + +(defun yas--auto-fill-wrapper () + (when (and auto-fill-function + (not (eq auto-fill-function #'yas--auto-fill))) + (setq yas--original-auto-fill-function auto-fill-function) + (setq auto-fill-function #'yas--auto-fill))) + +;;;###autoload +(define-minor-mode yas-minor-mode + "Toggle YASnippet mode. + +When YASnippet mode is enabled, `yas-expand', normally bound to +the TAB key, expands snippets of code depending on the major +mode. + +With no argument, this command toggles the mode. +positive prefix argument turns on the mode. +Negative prefix argument turns off the mode. + +Key bindings: +\\{yas-minor-mode-map}" + :lighter " yas" ;; The indicator for the mode line. + (cond ((and yas-minor-mode (featurep 'yasnippet)) + ;; Install the direct keymaps in `emulation-mode-map-alists' + ;; (we use `add-hook' even though it's not technically a hook, + ;; but it works). Then define variables named after modes to + ;; index `yas--direct-keymaps'. + ;; + ;; Also install the post-command-hook. + ;; + (cl-pushnew 'yas--direct-keymaps emulation-mode-map-alists) + (add-hook 'post-command-hook #'yas--post-command-handler nil t) + ;; Set the `yas--direct-%s' vars for direct keymap expansion + ;; + (dolist (mode (yas--modes-to-activate)) + (let ((name (intern (format "yas--direct-%s" mode)))) + (set-default name nil) + (set (make-local-variable name) t))) + ;; Perform JIT loads + (yas--load-pending-jits) + ;; Install auto-fill handler. + (yas--auto-fill-wrapper) ; Now... + (add-hook 'auto-fill-mode-hook #'yas--auto-fill-wrapper)) ; or later. + (t + ;; Uninstall the direct keymaps, post-command hook, and + ;; auto-fill handler. + (remove-hook 'post-command-hook #'yas--post-command-handler t) + (remove-hook 'auto-fill-mode-hook #'yas--auto-fill-wrapper) + (when (local-variable-p 'yas--original-auto-fill-function) + (setq auto-fill-function yas--original-auto-fill-function)) + (setq emulation-mode-map-alists + (remove 'yas--direct-keymaps emulation-mode-map-alists))))) + +(defun yas-activate-extra-mode (mode) + "Activates the snippets for the given `mode' in the buffer. + +The function can be called in the hook of a minor mode to +activate snippets associated with that mode." + (interactive + (let (modes + symbol) + (maphash (lambda (k _) + (setq modes (cons (list k) modes))) + yas--parents) + (setq symbol (completing-read + "Activate mode: " modes nil t)) + (list + (when (not (string= "" symbol)) + (intern symbol))))) + (when mode + (add-to-list (make-local-variable 'yas--extra-modes) mode) + (yas--load-pending-jits))) + +(defun yas-deactivate-extra-mode (mode) + "Deactivates the snippets for the given `mode' in the buffer." + (interactive + (list (intern + (completing-read + "Deactivate mode: " (mapcar #'list yas--extra-modes) nil t)))) + (set (make-local-variable 'yas--extra-modes) + (remove mode + yas--extra-modes))) + +(define-obsolete-variable-alias 'yas-dont-activate + 'yas-dont-activate-functions "0.9.2") +(defvar yas-dont-activate-functions (list #'minibufferp) + "Special hook to control which buffers `yas-global-mode' affects. +Functions are called with no argument, and should return non-nil to prevent +`yas-global-mode' from enabling yasnippet in this buffer. + +In Emacsen < 24, this variable is buffer-local. Because +`yas-minor-mode-on' is called by `yas-global-mode' after +executing the buffer's major mode hook, setting this variable +there is an effective way to define exceptions to the \"global\" +activation behaviour. + +In Emacsen >= 24, only the global value is used. To define +per-mode exceptions to the \"global\" activation behaviour, call +`yas-minor-mode' with a negative argument directily in the major +mode's hook.") +(unless (> emacs-major-version 23) + (with-no-warnings + (make-variable-buffer-local 'yas-dont-activate))) + + +(defun yas-minor-mode-on () + "Turn on YASnippet minor mode. + +Honour `yas-dont-activate-functions', which see." + (interactive) + (unless (or + ;; The old behavior used for Emacs<24 was to set + ;; `yas-dont-activate-functions' to t buffer-locally. + (not (or (listp yas-dont-activate-functions) + (functionp yas-dont-activate-functions))) + (run-hook-with-args-until-success 'yas-dont-activate-functions)) + (yas-minor-mode 1))) + +;;;###autoload +(define-globalized-minor-mode yas-global-mode yas-minor-mode yas-minor-mode-on) + +(defun yas--global-mode-reload-with-jit-maybe () + "Run `yas-reload-all' when `yas-global-mode' is on." + (when yas-global-mode (yas-reload-all))) + +(add-hook 'yas-global-mode-hook #'yas--global-mode-reload-with-jit-maybe) + + +;;; Major mode stuff + +(defvar yas--font-lock-keywords + (append '(("^#.*$" . font-lock-comment-face)) + (with-temp-buffer + (let ((prog-mode-hook nil) + (emacs-lisp-mode-hook nil)) + (ignore-errors (emacs-lisp-mode))) + (font-lock-set-defaults) + (if (eq t (car-safe font-lock-keywords)) + ;; They're "compiled", so extract the source. + (cadr font-lock-keywords) + font-lock-keywords)) + '(("\\$\\([0-9]+\\)" + (0 font-lock-keyword-face) + (1 font-lock-string-face t)) + ("\\${\\([0-9]+\\):?" + (0 font-lock-keyword-face) + (1 font-lock-warning-face t)) + ("\\(\\$(\\)" 1 font-lock-preprocessor-face) + ("}" + (0 font-lock-keyword-face))))) + +(defvar snippet-mode-map + (let ((map (make-sparse-keymap))) + (easy-menu-define nil + map + "Menu used when snippet-mode is active." + (cons "Snippet" + (mapcar #'(lambda (ent) + (when (nth 2 ent) + (define-key map (nth 2 ent) (nth 1 ent))) + (vector (nth 0 ent) (nth 1 ent) t)) + '(("Load this snippet" yas-load-snippet-buffer "\C-c\C-l") + ("Load and quit window" yas-load-snippet-buffer-and-close "\C-c\C-c") + ("Try out this snippet" yas-tryout-snippet "\C-c\C-t"))))) + map) + "The keymap used when `snippet-mode' is active.") + + + +;;;###autoload(autoload 'snippet-mode "yasnippet" "A mode for editing yasnippets" t nil) +(eval-and-compile + (if (fboundp 'prog-mode) + ;; `prog-mode' is new in 24.1. + (define-derived-mode snippet-mode prog-mode "Snippet" + "A mode for editing yasnippets" + (setq font-lock-defaults '(yas--font-lock-keywords)) + (set (make-local-variable 'require-final-newline) nil) + (set (make-local-variable 'comment-start) "#") + (set (make-local-variable 'comment-start-skip) "#+[\t ]*") + (add-hook 'after-save-hook #'yas-maybe-load-snippet-buffer nil t)) + (define-derived-mode snippet-mode fundamental-mode "Snippet" + "A mode for editing yasnippets" + (setq font-lock-defaults '(yas--font-lock-keywords)) + (set (make-local-variable 'require-final-newline) nil) + (set (make-local-variable 'comment-start) "#") + (set (make-local-variable 'comment-start-skip) "#+[\t ]*") + (add-hook 'after-save-hook #'yas-maybe-load-snippet-buffer nil t)))) + +(defun yas-snippet-mode-buffer-p () + "Return non-nil if current buffer should be in `snippet-mode'. +Meaning it's visiting a file under one of the mode directories in +`yas-snippet-dirs'." + (when buffer-file-name + (cl-member buffer-file-name (yas-snippet-dirs) + :test #'file-in-directory-p))) + +;; We're abusing `magic-fallback-mode-alist' here because +;; `auto-mode-alist' doesn't support function matchers. +(add-to-list 'magic-fallback-mode-alist + `(yas-snippet-mode-buffer-p . snippet-mode)) + + +;;; Internal structs for template management + +(cl-defstruct (yas--template + (:constructor yas--make-template) + ;; Handles `yas-define-snippets' format, plus the + ;; initial TABLE argument. + (:constructor + yas--define-snippets-2 + (table + key content + &optional xname condition group + expand-env load-file xkeybinding xuuid save-file + &aux + (name (or xname + ;; A little redundant: we always get a name + ;; from `yas--parse-template' except when + ;; there isn't a file. + (and load-file (file-name-nondirectory load-file)) + (and save-file (file-name-nondirectory save-file)) + key)) + (keybinding (yas--read-keybinding xkeybinding)) + (uuid (or xuuid name)) + (old (gethash uuid (yas--table-uuidhash table))) + (menu-binding-pair + (and old (yas--template-menu-binding-pair old))) + (perm-group + (and old (yas--template-perm-group old)))))) + "A template for a snippet." + key + content + name + condition + expand-env + load-file + save-file + keybinding + uuid + menu-binding-pair + group ;; as dictated by the #group: directive or .yas-make-groups + perm-group ;; as dictated by `yas-define-menu' + table + ) + +(cl-defstruct (yas--table (:constructor yas--make-snippet-table (name))) + "A table to store snippets for a particular mode. + +Has the following fields: + +`yas--table-name' + + A symbol name normally corresponding to a major mode, but can + also be a pseudo major-mode to be used in + `yas-activate-extra-mode', for example. + +`yas--table-hash' + + A hash table (KEY . NAMEHASH), known as the \"keyhash\". KEY is + a string or a vector, where the former is the snippet's trigger + and the latter means it's a direct keybinding. NAMEHASH is yet + another hash of (NAME . TEMPLATE) where NAME is the snippet's + name and TEMPLATE is a `yas--template' object. + +`yas--table-direct-keymap' + + A keymap for the snippets in this table that have direct + keybindings. This is kept in sync with the keyhash, i.e., all + the elements of the keyhash that are vectors appear here as + bindings to `yas-maybe-expand-from-keymap'. + +`yas--table-uuidhash' + + A hash table mapping snippets uuid's to the same `yas--template' + objects. A snippet uuid defaults to the snippet's name." + name + (hash (make-hash-table :test 'equal)) + (uuidhash (make-hash-table :test 'equal)) + (parents nil) + (direct-keymap (make-sparse-keymap))) + +(defun yas--get-template-by-uuid (mode uuid) + "Find the snippet template in MODE by its UUID." + (let* ((table (gethash mode yas--tables mode))) + (when table + (gethash uuid (yas--table-uuidhash table))))) + +;; Apropos storing/updating in TABLE, this works in two steps: +;; +;; 1. `yas--remove-template-by-uuid' removes any +;; keyhash-namehash-template mappings from TABLE, grabbing the +;; snippet by its uuid. Also removes mappings from TABLE's +;; `yas--table-direct-keymap' (FIXME: and should probably take care +;; of potentially stale menu bindings right?.) +;; +;; 2. `yas--add-template' adds this all over again. +;; +;; Create a new or add to an existing keyhash-namehash mapping. +;; +;; For reference on understanding this, consider three snippet +;; definitions: +;; +;; A: # name: The Foo +;; # key: foo +;; # binding: C-c M-l +;; +;; B: # name: Mrs Foo +;; # key: foo +;; +;; C: # name: The Bar +;; # binding: C-c M-l +;; +;; D: # name: Baz +;; # key: baz +;; +;; keyhash namehashes(3) yas--template structs(4) +;; ----------------------------------------------------- +;; __________ +;; / \ +;; "foo" ---> "The Foo" ---> [yas--template A] | +;; "Mrs Foo" ---> [yas--template B] | +;; | +;; [C-c M-l] ---> "The Foo" -------------------------/ +;; "The Bar" ---> [yas--template C] +;; +;; "baz" ---> "Baz" ---> [yas--template D] +;; +;; Additionally, since uuid defaults to the name, we have a +;; `yas--table-uuidhash' for TABLE +;; +;; uuidhash yas--template structs +;; ------------------------------- +;; "The Foo" ---> [yas--template A] +;; "Mrs Foo" ---> [yas--template B] +;; "The Bar" ---> [yas--template C] +;; "Baz" ---> [yas--template D] +;; +;; FIXME: the more I look at this data-structure the more I think I'm +;; stupid. There has to be an easier way (but beware lots of code +;; depends on this). +;; +(defun yas--remove-template-by-uuid (table uuid) + "Remove from TABLE a template identified by UUID." + (let ((template (gethash uuid (yas--table-uuidhash table)))) + (when template + (let* ((name (yas--template-name template)) + (empty-keys nil)) + ;; Remove the name from each of the targeted namehashes + ;; + (maphash #'(lambda (k v) + (let ((template (gethash name v))) + (when (and template + (equal uuid (yas--template-uuid template))) + (remhash name v) + (when (zerop (hash-table-count v)) + (push k empty-keys))))) + (yas--table-hash table)) + ;; Remove the namehash themselves if they've become empty + ;; + (dolist (key empty-keys) + (when (vectorp key) + (define-key (yas--table-direct-keymap table) key nil)) + (remhash key (yas--table-hash table))) + + ;; Finally, remove the uuid from the uuidhash + ;; + (remhash uuid (yas--table-uuidhash table)))))) + +(defconst yas-maybe-expand-from-keymap + '(menu-item "" yas-expand-from-keymap + :filter yas--maybe-expand-from-keymap-filter)) + +(defun yas--add-template (table template) + "Store in TABLE the snippet template TEMPLATE. + +KEY can be a string (trigger key) of a vector (direct +keybinding)." + (let ((name (yas--template-name template)) + (key (yas--template-key template)) + (keybinding (yas--template-keybinding template)) + (_menu-binding-pair (yas--template-menu-binding-pair-get-create template))) + (dolist (k (remove nil (list key keybinding))) + (puthash name + template + (or (gethash k + (yas--table-hash table)) + (puthash k + (make-hash-table :test 'equal) + (yas--table-hash table)))) + (when (vectorp k) + (define-key (yas--table-direct-keymap table) k yas-maybe-expand-from-keymap))) + + ;; Update TABLE's `yas--table-uuidhash' + (puthash (yas--template-uuid template) + template + (yas--table-uuidhash table)))) + +(defun yas--update-template (table template) + "Add or update TEMPLATE in TABLE. + +Also takes care of adding and updating to the associated menu. +Return TEMPLATE." + ;; Remove from table by uuid + ;; + (yas--remove-template-by-uuid table (yas--template-uuid template)) + ;; Add to table again + ;; + (yas--add-template table template) + ;; Take care of the menu + ;; + (yas--update-template-menu table template) + template) + +(defun yas--update-template-menu (table template) + "Update every menu-related for TEMPLATE." + (let ((menu-binding-pair (yas--template-menu-binding-pair-get-create template)) + (key (yas--template-key template)) + (keybinding (yas--template-keybinding template))) + ;; The snippet might have changed name or keys, so update + ;; user-visible strings + ;; + (unless (eq (cdr menu-binding-pair) :none) + ;; the menu item name + ;; + (setf (cl-cadar menu-binding-pair) (yas--template-name template)) + ;; the :keys information (also visible to the user) + (setf (cl-getf (cdr (car menu-binding-pair)) :keys) + (or (and keybinding (key-description keybinding)) + (and key (concat key yas-trigger-symbol)))))) + (unless (yas--template-menu-managed-by-yas-define-menu template) + (let ((menu-keymap + (yas--menu-keymap-get-create (yas--table-mode table) + (mapcar #'yas--table-mode + (yas--table-parents table)))) + (group (yas--template-group template))) + ;; Remove from menu keymap + ;; + (cl-assert menu-keymap) + (yas--delete-from-keymap menu-keymap (yas--template-uuid template)) + + ;; Add necessary subgroups as necessary. + ;; + (dolist (subgroup group) + (let ((subgroup-keymap (lookup-key menu-keymap (vector (make-symbol subgroup))))) + (unless (and subgroup-keymap + (keymapp subgroup-keymap)) + (setq subgroup-keymap (make-sparse-keymap)) + (define-key menu-keymap (vector (make-symbol subgroup)) + `(menu-item ,subgroup ,subgroup-keymap))) + (setq menu-keymap subgroup-keymap))) + + ;; Add this entry to the keymap + ;; + (define-key menu-keymap + (vector (make-symbol (yas--template-uuid template))) + (car (yas--template-menu-binding-pair template)))))) + +(defun yas--namehash-templates-alist (namehash) + "Return NAMEHASH as an alist." + (let (alist) + (maphash #'(lambda (k v) + (push (cons k v) alist)) + namehash) + alist)) + +(defun yas--fetch (table key) + "Fetch templates in TABLE by KEY. + +Return a list of cons (NAME . TEMPLATE) where NAME is a +string and TEMPLATE is a `yas--template' structure." + (let* ((keyhash (yas--table-hash table)) + (namehash (and keyhash (gethash key keyhash)))) + (when namehash + (yas--filter-templates-by-condition (yas--namehash-templates-alist namehash))))) + + +;;; Filtering/condition logic + +(defun yas--eval-condition (condition) + (condition-case err + (save-excursion + (save-restriction + (save-match-data + (eval condition)))) + (error (progn + (yas--message 1 "Error in condition evaluation: %s" (error-message-string err)) + nil)))) + + +(defun yas--filter-templates-by-condition (templates) + "Filter the templates using the applicable condition. + +TEMPLATES is a list of cons (NAME . TEMPLATE) where NAME is a +string and TEMPLATE is a `yas--template' structure. + +This function implements the rules described in +`yas-buffer-local-condition'. See that variables documentation." + (let ((requirement (yas--require-template-specific-condition-p))) + (if (eq requirement 'always) + templates + (cl-remove-if-not (lambda (pair) + (yas--template-can-expand-p + (yas--template-condition (cdr pair)) requirement)) + templates)))) + +(defun yas--require-template-specific-condition-p () + "Decide if this buffer requests/requires snippet-specific +conditions to filter out potential expansions." + (if (eq 'always yas-buffer-local-condition) + 'always + (let ((local-condition (or (and (consp yas-buffer-local-condition) + (yas--eval-condition yas-buffer-local-condition)) + yas-buffer-local-condition))) + (when local-condition + (if (eq local-condition t) + t + (and (consp local-condition) + (eq 'require-snippet-condition (car local-condition)) + (symbolp (cdr local-condition)) + (cdr local-condition))))))) + +(defun yas--template-can-expand-p (condition requirement) + "Evaluate CONDITION and REQUIREMENT and return a boolean." + (let* ((result (or (null condition) + (yas--eval-condition condition)))) + (cond ((eq requirement t) + result) + (t + (eq requirement result))))) + +(defun yas--table-templates (table) + (when table + (let ((acc (list))) + (maphash #'(lambda (_key namehash) + (maphash #'(lambda (name template) + (push (cons name template) acc)) + namehash)) + (yas--table-hash table)) + (yas--filter-templates-by-condition acc)))) + +(defun yas--templates-for-key-at-point () + "Find `yas--template' objects for any trigger keys preceding point. +Returns (TEMPLATES START END). This function respects +`yas-key-syntaxes', which see." + (save-excursion + (let ((original (point)) + (methods yas-key-syntaxes) + (templates) + (method)) + (while (and methods + (not templates)) + (unless (eq method (car methods)) + ;; TRICKY: `eq'-ness test means we can only be here if + ;; `method' is a function that returned `again', and hence + ;; don't revert back to original position as per + ;; `yas-key-syntaxes'. + (goto-char original)) + (setq method (car methods)) + (cond ((stringp method) + (skip-syntax-backward method) + (setq methods (cdr methods))) + ((functionp method) + (unless (eq (funcall method original) + 'again) + (setq methods (cdr methods)))) + (t + (setq methods (cdr methods)) + (yas--warning "Invalid element `%s' in `yas-key-syntaxes'" method))) + (let ((possible-key (buffer-substring-no-properties (point) original))) + (save-excursion + (goto-char original) + (setq templates + (cl-mapcan (lambda (table) + (yas--fetch table possible-key)) + (yas--get-snippet-tables)))))) + (when templates + (list templates (point) original))))) + +(defun yas--table-all-keys (table) + "Get trigger keys of all active snippets in TABLE." + (let ((acc)) + (maphash #'(lambda (key namehash) + (when (yas--filter-templates-by-condition (yas--namehash-templates-alist namehash)) + (push key acc))) + (yas--table-hash table)) + acc)) + +(defun yas--table-mode (table) + (intern (yas--table-name table))) + + +;;; Internal functions and macros: + +(defun yas--remove-misc-free-from-undo (old-undo-list) + "Tries to work around Emacs Bug#30931. +Helper function for `yas--save-restriction-and-widen'." + ;; If Bug#30931 is unfixed, we get (# . INTEGER) + ;; entries in the undo list. If we call `type-of' on the + ;; Lisp_Misc_Free object then Emacs aborts, so try to find it by + ;; checking that its type is none of the expected ones. + (when (consp buffer-undo-list) + (let* ((prev buffer-undo-list) + (undo-list prev)) + (while (and (consp undo-list) + ;; Only check new entries. + (not (eq undo-list old-undo-list))) + (let ((entry (pop undo-list))) + (when (consp entry) + (let ((head (car entry))) + (unless (or (stringp head) + (markerp head) + (integerp head) + (symbolp head) + (not (integerp (cdr entry)))) + ;; (message "removing misc free %S" entry) + (setcdr prev undo-list))))) + (setq prev undo-list))))) + +(defmacro yas--save-restriction-and-widen (&rest body) + "Equivalent to (save-restriction (widen) BODY). +Also tries to work around Emacs Bug#30931." + (declare (debug (body)) (indent 0)) + ;; Disable garbage collection, since it could cause an abort. + `(let ((gc-cons-threshold most-positive-fixnum) + (old-undo-list buffer-undo-list)) + (prog1 (save-restriction + (widen) + ,@body) + (yas--remove-misc-free-from-undo old-undo-list)))) + +(defun yas--eval-for-string (form) + "Evaluate FORM and convert the result to string." + (let ((debug-on-error (and (not (memq yas-good-grace '(t inline))) + debug-on-error))) + (condition-case oops + (save-excursion + (yas--save-restriction-and-widen + (save-match-data + (let ((result (eval form))) + (when result + (format "%s" result)))))) + ((debug error) (cdr oops))))) + +(defun yas--eval-for-effect (form) + (yas--safely-call-fun (apply-partially #'eval form))) + +(defun yas--read-lisp (string &optional nil-on-error) + "Read STRING as a elisp expression and return it. + +In case STRING in an invalid expression and NIL-ON-ERROR is nil, +return an expression that when evaluated will issue an error." + (condition-case err + (read string) + (error (and (not nil-on-error) + `(error (error-message-string ,err)))))) + +(defun yas--read-keybinding (keybinding) + "Read KEYBINDING as a snippet keybinding, return a vector." + (when (and keybinding + (not (string-match "keybinding" keybinding))) + (condition-case err + (let ((res (or (and (string-match "^\\[.*\\]$" keybinding) + (read keybinding)) + (read-kbd-macro keybinding 'need-vector)))) + res) + (error + (yas--message 2 "warning: keybinding \"%s\" invalid since %s." + keybinding (error-message-string err)) + nil)))) + +(defun yas--table-get-create (mode) + "Get or create the snippet table corresponding to MODE." + (let ((table (gethash mode + yas--tables))) + (unless table + (setq table (yas--make-snippet-table (symbol-name mode))) + (puthash mode table yas--tables) + (push (cons (intern (format "yas--direct-%s" mode)) + (yas--table-direct-keymap table)) + yas--direct-keymaps)) + table)) + +(defun yas--get-snippet-tables (&optional mode) + "Get snippet tables for MODE. + +MODE defaults to the current buffer's `major-mode'. + +Return a list of `yas--table' objects. The list of modes to +consider is returned by `yas--modes-to-activate'" + (remove nil + (mapcar #'(lambda (name) + (gethash name yas--tables)) + (yas--modes-to-activate mode)))) + +(defun yas--menu-keymap-get-create (mode &optional parents) + "Get or create the menu keymap for MODE and its PARENTS. + +This may very well create a plethora of menu keymaps and arrange +them all in `yas--menu-table'" + (let* ((menu-keymap (or (gethash mode yas--menu-table) + (puthash mode (make-sparse-keymap) yas--menu-table)))) + (mapc #'yas--menu-keymap-get-create parents) + (define-key yas--minor-mode-menu (vector mode) + `(menu-item ,(symbol-name mode) ,menu-keymap + :visible (yas--show-menu-p ',mode))) + menu-keymap)) + + +;;; Template-related and snippet loading functions + +(defun yas--parse-template (&optional file) + "Parse the template in the current buffer. + +Optional FILE is the absolute file name of the file being +parsed. + +Optional GROUP is the group where the template is to go, +otherwise we attempt to calculate it from FILE. + +Return a snippet-definition, i.e. a list + + (KEY TEMPLATE NAME CONDITION GROUP VARS LOAD-FILE KEYBINDING UUID) + +If the buffer contains a line of \"# --\" then the contents above +this line are ignored. Directives can set most of these with the syntax: + +# directive-name : directive-value + +Here's a list of currently recognized directives: + + * type + * name + * contributor + * condition + * group + * key + * expand-env + * binding + * uuid" + (goto-char (point-min)) + (let* ((type 'snippet) + (name (and file + (file-name-nondirectory file))) + (key nil) + template + bound + condition + (group (and file + (yas--calculate-group file))) + expand-env + binding + uuid) + (if (re-search-forward "^# --\\s-*\n" nil t) + (progn (setq template + (buffer-substring-no-properties (point) + (point-max))) + (setq bound (point)) + (goto-char (point-min)) + (while (re-search-forward "^# *\\([^ ]+?\\) *: *\\(.*?\\)[[:space:]]*$" bound t) + (when (string= "uuid" (match-string-no-properties 1)) + (setq uuid (match-string-no-properties 2))) + (when (string= "type" (match-string-no-properties 1)) + (setq type (if (string= "command" (match-string-no-properties 2)) + 'command + 'snippet))) + (when (string= "key" (match-string-no-properties 1)) + (setq key (match-string-no-properties 2))) + (when (string= "name" (match-string-no-properties 1)) + (setq name (match-string-no-properties 2))) + (when (string= "condition" (match-string-no-properties 1)) + (setq condition (yas--read-lisp (match-string-no-properties 2)))) + (when (string= "group" (match-string-no-properties 1)) + (setq group (match-string-no-properties 2))) + (when (string= "expand-env" (match-string-no-properties 1)) + (setq expand-env (yas--read-lisp (match-string-no-properties 2) + 'nil-on-error))) + (when (string= "binding" (match-string-no-properties 1)) + (setq binding (match-string-no-properties 2))))) + (setq template + (buffer-substring-no-properties (point-min) (point-max)))) + (unless (or key binding) + (setq key (and file (file-name-nondirectory file)))) + (when (eq type 'command) + (setq template (yas--read-lisp (concat "(progn" template ")")))) + (when group + (setq group (split-string group "\\."))) + (list key template name condition group expand-env file binding uuid))) + +(defun yas--calculate-group (file) + "Calculate the group for snippet file path FILE." + (let* ((dominating-dir (locate-dominating-file file + ".yas-make-groups")) + (extra-path (and dominating-dir + (file-relative-name file dominating-dir))) + (extra-dir (and extra-path + (file-name-directory extra-path))) + (group (and extra-dir + (replace-regexp-in-string "/" + "." + (directory-file-name extra-dir))))) + group)) + +(defun yas--subdirs (directory &optional filep) + "Return subdirs or files of DIRECTORY according to FILEP." + (cl-remove-if (lambda (file) + (or (string-match "\\`\\." + (file-name-nondirectory file)) + (string-match "\\`#.*#\\'" + (file-name-nondirectory file)) + (string-match "~\\'" + (file-name-nondirectory file)) + (if filep + (file-directory-p file) + (not (file-directory-p file))))) + (directory-files directory t))) + +(defun yas--make-menu-binding (template) + (let ((mode (yas--table-mode (yas--template-table template)))) + `(lambda () (interactive) (yas--expand-or-visit-from-menu ',mode ,(yas--template-uuid template))))) + +(defun yas--expand-or-visit-from-menu (mode uuid) + (let* ((table (yas--table-get-create mode)) + (yas--current-template (and table + (gethash uuid (yas--table-uuidhash table))))) + (when yas--current-template + (if yas-visit-from-menu + (yas--visit-snippet-file-1 yas--current-template) + (let ((where (if (region-active-p) + (cons (region-beginning) (region-end)) + (cons (point) (point))))) + (yas-expand-snippet (yas--template-content yas--current-template) + (car where) + (cdr where) + (yas--template-expand-env yas--current-template))))))) + +(defun yas--key-from-desc (text) + "Return a yasnippet key from a description string TEXT." + (replace-regexp-in-string "\\(\\w+\\).*" "\\1" text)) + + +;;; Popping up for keys and templates + +(defun yas--prompt-for-template (templates &optional prompt) + "Interactively choose a template from the list TEMPLATES. + +TEMPLATES is a list of `yas--template'. + +Optional PROMPT sets the prompt to use." + (when templates + (setq templates + (sort templates #'(lambda (t1 t2) + (< (length (yas--template-name t1)) + (length (yas--template-name t2)))))) + (cl-some (lambda (fn) + (funcall fn (or prompt "Choose a snippet: ") + templates + #'yas--template-name)) + yas-prompt-functions))) + +(defun yas--prompt-for-keys (keys &optional prompt) + "Interactively choose a template key from the list KEYS. + +Optional PROMPT sets the prompt to use." + (when keys + (cl-some (lambda (fn) + (funcall fn (or prompt "Choose a snippet key: ") keys)) + yas-prompt-functions))) + +(defun yas--prompt-for-table (tables &optional prompt) + "Interactively choose a table from the list TABLES. + +Optional PROMPT sets the prompt to use." + (when tables + (cl-some (lambda (fn) + (funcall fn (or prompt "Choose a snippet table: ") + tables + #'yas--table-name)) + yas-prompt-functions))) + +(defun yas-x-prompt (prompt choices &optional display-fn) + "Display choices in a x-window prompt." + (when (and window-system choices) + ;; Let window position be recalculated to ensure that + ;; `posn-at-point' returns non-nil. + (redisplay) + (or + (x-popup-menu + (if (fboundp 'posn-at-point) + (let ((x-y (posn-x-y (posn-at-point (point))))) + (list (list (+ (car x-y) 10) + (+ (cdr x-y) 20)) + (selected-window))) + t) + `(,prompt ("title" + ,@(cl-mapcar (lambda (c d) `(,(concat " " d) . ,c)) + choices + (if display-fn (mapcar display-fn choices) + choices))))) + (keyboard-quit)))) + +(defun yas-maybe-ido-prompt (prompt choices &optional display-fn) + (when (bound-and-true-p ido-mode) + (yas-ido-prompt prompt choices display-fn))) + +(defun yas-ido-prompt (prompt choices &optional display-fn) + (require 'ido) + (yas-completing-prompt prompt choices display-fn #'ido-completing-read)) + +(defun yas-dropdown-prompt (_prompt choices &optional display-fn) + (when (fboundp 'dropdown-list) + (let* ((formatted-choices + (if display-fn (mapcar display-fn choices) choices)) + (n (dropdown-list formatted-choices))) + (if n (nth n choices) + (keyboard-quit))))) + +(defun yas-completing-prompt (prompt choices &optional display-fn completion-fn) + (let* ((formatted-choices + (if display-fn (mapcar display-fn choices) choices)) + (chosen (funcall (or completion-fn #'completing-read) + prompt formatted-choices + nil 'require-match nil nil))) + (if (eq choices formatted-choices) + chosen + (nth (or (cl-position chosen formatted-choices :test #'string=) 0) + choices)))) + +(defun yas-no-prompt (_prompt choices &optional _display-fn) + (cl-first choices)) + + +;;; Defining snippets +;; This consists of creating and registering `yas--template' objects in the +;; correct tables. +;; + +(defvar yas--creating-compiled-snippets nil) + +(defun yas--define-snippets-1 (snippet snippet-table) + "Helper for `yas-define-snippets'." + ;; Update the appropriate table. Also takes care of adding the + ;; key indicators in the templates menu entry, if any. + (yas--update-template + snippet-table (apply #'yas--define-snippets-2 snippet-table snippet))) + +(defun yas-define-snippets (mode snippets) + "Define SNIPPETS for MODE. + +SNIPPETS is a list of snippet definitions, each taking the +following form + + (KEY TEMPLATE NAME CONDITION GROUP EXPAND-ENV LOAD-FILE KEYBINDING UUID SAVE-FILE) + +Within these, only KEY and TEMPLATE are actually mandatory. + +TEMPLATE might be a Lisp form or a string, depending on whether +this is a snippet or a snippet-command. + +CONDITION, EXPAND-ENV and KEYBINDING are Lisp forms, they have +been `yas--read-lisp'-ed and will eventually be +`yas--eval-for-string'-ed. + +The remaining elements are strings. + +FILE is probably of very little use if you're programatically +defining snippets. + +UUID is the snippet's \"unique-id\". Loading a second snippet +file with the same uuid would replace the previous snippet. + +You can use `yas--parse-template' to return such lists based on +the current buffers contents." + (if yas--creating-compiled-snippets + (let ((print-length nil)) + (insert ";;; Snippet definitions:\n;;;\n") + (dolist (snippet snippets) + ;; Fill in missing elements with nil. + (setq snippet (append snippet (make-list (- 10 (length snippet)) nil))) + ;; Move LOAD-FILE to SAVE-FILE because we will load from the + ;; compiled file, not LOAD-FILE. + (let ((load-file (nth 6 snippet))) + (setcar (nthcdr 6 snippet) nil) + (setcar (nthcdr 9 snippet) load-file))) + (insert (pp-to-string + `(yas-define-snippets ',mode ',snippets))) + (insert "\n\n")) + ;; Normal case. + (let ((snippet-table (yas--table-get-create mode)) + (template nil)) + (dolist (snippet snippets) + (setq template (yas--define-snippets-1 snippet + snippet-table))) + template))) + + +;;; Loading snippets from files + +(defun yas--template-get-file (template) + "Return TEMPLATE's LOAD-FILE or SAVE-FILE." + (or (yas--template-load-file template) + (let ((file (yas--template-save-file template))) + (when file + (yas--message 3 "%s has no load file, using save file, %s, instead." + (yas--template-name template) file)) + file))) + +(defun yas--load-yas-setup-file (file) + (if (not yas--creating-compiled-snippets) + ;; Normal case. + (load file 'noerror (<= yas-verbosity 4)) + (let ((elfile (concat file ".el"))) + (when (file-exists-p elfile) + (insert ";;; contents of the .yas-setup.el support file:\n;;;\n") + (insert-file-contents elfile) + (goto-char (point-max)))))) + +(defun yas--define-parents (mode parents) + "Add PARENTS to the list of MODE's parents." + (puthash mode (cl-remove-duplicates + (append parents + (gethash mode yas--parents))) + yas--parents)) + +(defun yas-load-directory (top-level-dir &optional use-jit interactive) + "Load snippets in directory hierarchy TOP-LEVEL-DIR. + +Below TOP-LEVEL-DIR each directory should be a mode name. + +With prefix argument USE-JIT do jit-loading of snippets." + (interactive + (list (read-directory-name "Select the root directory: " nil nil t) + current-prefix-arg t)) + (unless yas-snippet-dirs + (setq yas-snippet-dirs top-level-dir)) + (let ((impatient-buffers)) + (dolist (dir (yas--subdirs top-level-dir)) + (let* ((major-mode-and-parents (yas--compute-major-mode-and-parents + (concat dir "/dummy"))) + (mode-sym (car major-mode-and-parents)) + (parents (cdr major-mode-and-parents))) + ;; Attention: The parents and the menus are already defined + ;; here, even if the snippets are later jit-loaded. + ;; + ;; * We need to know the parents at this point since entering a + ;; given mode should jit load for its parents + ;; immediately. This could be reviewed, the parents could be + ;; discovered just-in-time-as well + ;; + ;; * We need to create the menus here to support the `full' + ;; option to `yas-use-menu' (all known snippet menus are shown to the user) + ;; + (yas--define-parents mode-sym parents) + (yas--menu-keymap-get-create mode-sym) + (let ((fun (apply-partially #'yas--load-directory-1 dir mode-sym))) + (if use-jit + (yas--schedule-jit mode-sym fun) + (funcall fun))) + ;; Look for buffers that are already in `mode-sym', and so + ;; need the new snippets immediately... + ;; + (when use-jit + (cl-loop for buffer in (buffer-list) + do (with-current-buffer buffer + (when (eq major-mode mode-sym) + (yas--message 4 "Discovered there was already %s in %s" buffer mode-sym) + (push buffer impatient-buffers))))))) + ;; ...after TOP-LEVEL-DIR has been completely loaded, call + ;; `yas--load-pending-jits' in these impatient buffers. + ;; + (cl-loop for buffer in impatient-buffers + do (with-current-buffer buffer (yas--load-pending-jits)))) + (when interactive + (yas--message 3 "Loaded snippets from %s." top-level-dir))) + +(defun yas--load-directory-1 (directory mode-sym) + "Recursively load snippet templates from DIRECTORY." + (if yas--creating-compiled-snippets + (let ((output-file (expand-file-name ".yas-compiled-snippets.el" + directory))) + (with-temp-file output-file + (insert (format ";;; Compiled snippets and support files for `%s'\n" + mode-sym)) + (yas--load-directory-2 directory mode-sym) + (insert (format ";;; Do not edit! File generated at %s\n" + (current-time-string))))) + ;; Normal case. + (unless (file-exists-p (expand-file-name ".yas-skip" directory)) + (unless (and (load (expand-file-name ".yas-compiled-snippets" directory) 'noerror (<= yas-verbosity 3)) + (progn (yas--message 4 "Loaded compiled snippets from %s" directory) t)) + (yas--message 4 "Loading snippet files from %s" directory) + (yas--load-directory-2 directory mode-sym))))) + +(defun yas--load-directory-2 (directory mode-sym) + ;; Load .yas-setup.el files wherever we find them + ;; + (yas--load-yas-setup-file (expand-file-name ".yas-setup" directory)) + (let* ((default-directory directory) + (snippet-defs nil)) + ;; load the snippet files + ;; + (with-temp-buffer + (dolist (file (yas--subdirs directory 'no-subdirs-just-files)) + (when (file-readable-p file) + ;; Erase the buffer instead of passing non-nil REPLACE to + ;; `insert-file-contents' (avoids Emacs bug #23659). + (erase-buffer) + (insert-file-contents file) + (push (yas--parse-template file) + snippet-defs)))) + (when snippet-defs + (yas-define-snippets mode-sym + snippet-defs)) + ;; now recurse to a lower level + ;; + (dolist (subdir (yas--subdirs directory)) + (yas--load-directory-2 subdir + mode-sym)))) + +(defun yas--load-snippet-dirs (&optional nojit) + "Reload the directories listed in `yas-snippet-dirs' or +prompt the user to select one." + (let (errors) + (if (null yas-snippet-dirs) + (call-interactively 'yas-load-directory) + (when (member yas--default-user-snippets-dir yas-snippet-dirs) + (make-directory yas--default-user-snippets-dir t)) + (dolist (directory (reverse (yas-snippet-dirs))) + (cond ((file-directory-p directory) + (yas-load-directory directory (not nojit)) + (if nojit + (yas--message 4 "Loaded %s" directory) + (yas--message 4 "Prepared just-in-time loading for %s" directory))) + (t + (push (yas--message 1 "Check your `yas-snippet-dirs': %s is not a directory" directory) errors))))) + errors)) + +(defun yas-reload-all (&optional no-jit interactive) + "Reload all snippets and rebuild the YASnippet menu. + +When NO-JIT is non-nil force immediate reload of all known +snippets under `yas-snippet-dirs', otherwise use just-in-time +loading. + +When called interactively, use just-in-time loading when given a +prefix argument." + (interactive (list (not current-prefix-arg) t)) + (catch 'abort + (let ((errors) + (snippet-editing-buffers + (cl-remove-if-not (lambda (buffer) + (with-current-buffer buffer + yas--editing-template)) + (buffer-list)))) + ;; Warn if there are buffers visiting snippets, since reloading will break + ;; any on-line editing of those buffers. + ;; + (when snippet-editing-buffers + (if interactive + (if (y-or-n-p "Some buffers editing live snippets, close them and proceed with reload? ") + (mapc #'kill-buffer snippet-editing-buffers) + (yas--message 1 "Aborted reload...") + (throw 'abort nil)) + ;; in a non-interactive use, at least set + ;; `yas--editing-template' to nil, make it guess it next time around + (mapc #'(lambda (buffer) + (with-current-buffer buffer + (kill-local-variable 'yas--editing-template))) + (buffer-list)))) + + ;; Empty all snippet tables and parenting info + ;; + (setq yas--tables (make-hash-table)) + (setq yas--parents (make-hash-table)) + + ;; Before killing `yas--menu-table' use its keys to cleanup the + ;; mode menu parts of `yas--minor-mode-menu' (thus also cleaning + ;; up `yas-minor-mode-map', which points to it) + ;; + (maphash #'(lambda (menu-symbol _keymap) + (define-key yas--minor-mode-menu (vector menu-symbol) nil)) + yas--menu-table) + ;; Now empty `yas--menu-table' as well + (setq yas--menu-table (make-hash-table)) + + ;; Cancel all pending 'yas--scheduled-jit-loads' + ;; + (setq yas--scheduled-jit-loads (make-hash-table)) + + ;; Reload the directories listed in `yas-snippet-dirs' or prompt + ;; the user to select one. + ;; + (setq errors (yas--load-snippet-dirs no-jit)) + ;; Reload the direct keybindings + ;; + (yas-direct-keymaps-reload) + + (run-hooks 'yas-after-reload-hook) + (let ((no-snippets + (cl-every (lambda (table) (= (hash-table-count table) 0)) + (list yas--scheduled-jit-loads + yas--parents yas--tables)))) + (yas--message (if (or no-snippets errors) 2 3) + (if no-jit "Snippets loaded %s." + "Prepared just-in-time loading of snippets %s.") + (cond (errors + "with some errors. Check *Messages*") + (no-snippets + "(but no snippets found)") + (t + "successfully"))))))) + +(defvar yas-after-reload-hook nil + "Hooks run after `yas-reload-all'.") + +(defun yas--load-pending-jits () + (dolist (mode (yas--modes-to-activate)) + (let ((funs (reverse (gethash mode yas--scheduled-jit-loads)))) + ;; must reverse to maintain coherence with `yas-snippet-dirs' + (dolist (fun funs) + (yas--message 4 "Loading for `%s', just-in-time: %s!" mode fun) + (funcall fun)) + (remhash mode yas--scheduled-jit-loads)))) + +(defun yas-escape-text (text) + "Escape TEXT for snippet." + (when text + (replace-regexp-in-string "[\\$]" "\\\\\\&" text))) + + +;;; Snippet compilation function + +(defun yas-compile-directory (top-level-dir) + "Create .yas-compiled-snippets.el files under subdirs of TOP-LEVEL-DIR. + +This works by stubbing a few functions, then calling +`yas-load-directory'." + (interactive "DTop level snippet directory?") + (let ((yas--creating-compiled-snippets t)) + (yas-load-directory top-level-dir nil))) + +(defun yas-recompile-all () + "Compile every dir in `yas-snippet-dirs'." + (interactive) + (mapc #'yas-compile-directory (yas-snippet-dirs))) + + +;;; JIT loading +;;; + +(defvar yas--scheduled-jit-loads (make-hash-table) + "Alist of mode-symbols to forms to be evaled when `yas-minor-mode' kicks in.") + +(defun yas--schedule-jit (mode fun) + (push fun (gethash mode yas--scheduled-jit-loads))) + + + +;;; Some user level functions + +(defun yas-about () + (interactive) + (message "yasnippet (version %s) -- pluskid/joaotavora/npostavs" + (or (ignore-errors (car (let ((default-directory yas--loaddir)) + (process-lines "git" "describe" + "--tags" "--dirty")))) + (when (and (featurep 'package) + (fboundp 'package-desc-version) + (fboundp 'package-version-join)) + (defvar package-alist) + (ignore-errors + (let* ((yas-pkg (cdr (assq 'yasnippet package-alist))) + (version (package-version-join + (package-desc-version (car yas-pkg))))) + ;; Special case for MELPA's bogus version numbers. + (if (string-match "\\`20..[01][0-9][0-3][0-9][.][0-9]\\{3,4\\}\\'" + version) + (concat yas--version "-snapshot" version) + version)))) + yas--version))) + + +;;; Apropos snippet menu: +;; +;; The snippet menu keymaps are stored by mode in hash table called +;; `yas--menu-table'. They are linked to the main menu in +;; `yas--menu-keymap-get-create' and are initially created empty, +;; reflecting the table hierarchy. +;; +;; They can be populated in two mutually exclusive ways: (1) by +;; reading `yas--template-group', which in turn is populated by the "# +;; group:" directives of the snippets or the ".yas-make-groups" file +;; or (2) by using a separate `yas-define-menu' call, which declares a +;; menu structure based on snippets uuids. +;; +;; Both situations are handled in `yas--update-template-menu', which +;; uses the predicate `yas--template-menu-managed-by-yas-define-menu' +;; that can tell between the two situations. +;; +;; Note: +;; +;; * if `yas-define-menu' is used it must run before +;; `yas-define-snippets' and the UUIDS must match, otherwise we get +;; duplicate entries. The `yas--template' objects are created in +;; `yas-define-menu', holding nothing but the menu entry, +;; represented by a pair of ((menu-item NAME :keys KEYS) TYPE) and +;; stored in `yas--template-menu-binding-pair'. The (menu-item ...) +;; part is then stored in the menu keymap itself which make the item +;; appear to the user. These limitations could probably be revised. +;; +;; * The `yas--template-perm-group' slot is only used in +;; `yas-describe-tables'. +;; +(defun yas--template-menu-binding-pair-get-create (template &optional type) + "Get TEMPLATE's menu binding or assign it a new one. + +TYPE may be `:stay', signaling this menu binding should be +static in the menu." + (or (yas--template-menu-binding-pair template) + (let (;; (key (yas--template-key template)) + ;; (keybinding (yas--template-keybinding template)) + ) + (setf (yas--template-menu-binding-pair template) + (cons `(menu-item ,(or (yas--template-name template) + (yas--template-uuid template)) + ,(yas--make-menu-binding template) + :keys ,nil) + type))))) +(defun yas--template-menu-managed-by-yas-define-menu (template) + "Non-nil if TEMPLATE's menu entry was included in a `yas-define-menu' call." + (cdr (yas--template-menu-binding-pair template))) + + +(defun yas--show-menu-p (mode) + (cond ((eq yas-use-menu 'abbreviate) + (cl-find mode + (mapcar #'yas--table-mode + (yas--get-snippet-tables)))) + (yas-use-menu t))) + +(defun yas--delete-from-keymap (keymap uuid) + "Recursively delete items with UUID from KEYMAP and its submenus." + + ;; XXX: This used to skip any submenus named \"parent mode\" + ;; + ;; First of all, recursively enter submenus, i.e. the tree is + ;; searched depth first so that stale submenus can be found in the + ;; higher passes. + ;; + (mapc #'(lambda (item) + (when (and (consp (cdr-safe item)) + (keymapp (nth 2 (cdr item)))) + (yas--delete-from-keymap (nth 2 (cdr item)) uuid))) + (cdr keymap)) + ;; Set the uuid entry to nil + ;; + (define-key keymap (vector (make-symbol uuid)) nil) + ;; Destructively modify keymap + ;; + (setcdr keymap (cl-delete-if (lambda (item) + (cond ((not (listp item)) nil) + ((null (cdr item))) + ((and (keymapp (nth 2 (cdr item))) + (null (cdr (nth 2 (cdr item)))))))) + (cdr keymap)))) + +(defun yas-define-menu (mode menu &optional omit-items) + "Define a snippet menu for MODE according to MENU, omitting OMIT-ITEMS. + +MENU is a list, its elements can be: + +- (yas-item UUID) : Creates an entry the snippet identified with + UUID. The menu entry for a snippet thus identified is + permanent, i.e. it will never move (be reordered) in the menu. + +- (yas-separator) : Creates a separator + +- (yas-submenu NAME SUBMENU) : Creates a submenu with NAME, + SUBMENU has the same form as MENU. NAME is also added to the + list of groups of the snippets defined thereafter. + +OMIT-ITEMS is a list of snippet uuids that will always be +omitted from MODE's menu, even if they're manually loaded." + (let* ((table (yas--table-get-create mode)) + (hash (yas--table-uuidhash table))) + (yas--define-menu-1 table + (yas--menu-keymap-get-create mode) + menu + hash) + (dolist (uuid omit-items) + (let ((template (or (gethash uuid hash) + (puthash uuid + (yas--make-template :table table + :uuid uuid) + hash)))) + (setf (yas--template-menu-binding-pair template) (cons nil :none)))))) + +(defun yas--define-menu-1 (table menu-keymap menu uuidhash &optional group-list) + "Helper for `yas-define-menu'." + (cl-loop + for (type name submenu) in (reverse menu) + collect (cond + ((or (eq type 'yas-item) + (and yas-alias-to-yas/prefix-p + (eq type 'yas/item))) + (let ((template (or (gethash name uuidhash) + (puthash name + (yas--make-template + :table table + :perm-group group-list + :uuid name) + uuidhash)))) + (car (yas--template-menu-binding-pair-get-create + template :stay)))) + ((or (eq type 'yas-submenu) + (and yas-alias-to-yas/prefix-p + (eq type 'yas/submenu))) + (let ((subkeymap (make-sparse-keymap))) + (yas--define-menu-1 table subkeymap submenu uuidhash + (append group-list (list name))) + `(menu-item ,name ,subkeymap))) + ((or (eq type 'yas-separator) + (and yas-alias-to-yas/prefix-p + (eq type 'yas/separator))) + '(menu-item "----")) + (t (yas--message 1 "Don't know anything about menu entry %s" type) + nil)) + into menu-entries + finally do (push (apply #'vector menu-entries) (cdr menu-keymap)))) + +(defun yas--define (mode key template &optional name condition group) + "Define a snippet. Expanding KEY into TEMPLATE. + +NAME is a description to this template. Also update the menu if +`yas-use-menu' is t. CONDITION is the condition attached to +this snippet. If you attach a condition to a snippet, then it +will only be expanded when the condition evaluated to non-nil." + (yas-define-snippets mode + (list (list key template name condition group)))) + +(defun yas-hippie-try-expand (first-time?) + "Integrate with hippie expand. + +Just put this function in `hippie-expand-try-functions-list'." + (when yas-minor-mode + (if (not first-time?) + (let ((yas-fallback-behavior 'return-nil)) + (yas-expand)) + (undo 1) + nil))) + + +;;; Apropos condition-cache: +;;; +;;; +;;; +;;; +(defmacro yas-define-condition-cache (func doc &rest body) + "Define a function FUNC with doc DOC and body BODY. +BODY is executed at most once every snippet expansion attempt, to check +expansion conditions. + +It doesn't make any sense to call FUNC programatically." + `(defun ,func () ,(if (and doc + (stringp doc)) + (concat doc +"\n\nFor use in snippets' conditions. Within each +snippet-expansion routine like `yas-expand', computes actual +value for the first time then always returns a cached value.") + (setq body (cons doc body)) + nil) + (let ((timestamp-and-value (get ',func 'yas--condition-cache))) + (if (equal (car timestamp-and-value) yas--condition-cache-timestamp) + (cdr timestamp-and-value) + (let ((new-value (progn + ,@body + ))) + (put ',func 'yas--condition-cache (cons yas--condition-cache-timestamp new-value)) + new-value))))) + +(defalias 'yas-expand 'yas-expand-from-trigger-key) +(defun yas-expand-from-trigger-key (&optional field) + "Expand a snippet before point. + +If no snippet expansion is possible, fall back to the behaviour +defined in `yas-fallback-behavior'. + +Optional argument FIELD is for non-interactive use and is an +object satisfying `yas--field-p' to restrict the expansion to." + (interactive) + (setq yas--condition-cache-timestamp (current-time)) + (let (templates-and-pos) + (unless (and yas-expand-only-for-last-commands + (not (member last-command yas-expand-only-for-last-commands))) + (setq templates-and-pos (if field + (save-restriction + (narrow-to-region (yas--field-start field) + (yas--field-end field)) + (yas--templates-for-key-at-point)) + (yas--templates-for-key-at-point)))) + (if templates-and-pos + (yas--expand-or-prompt-for-template + (nth 0 templates-and-pos) + ;; Delete snippet key and active region when expanding. + (min (if (use-region-p) (region-beginning) most-positive-fixnum) + (nth 1 templates-and-pos)) + (max (if (use-region-p) (region-end) most-negative-fixnum) + (nth 2 templates-and-pos))) + (yas--fallback)))) + +(defun yas--maybe-expand-from-keymap-filter (cmd) + (let* ((yas--condition-cache-timestamp (current-time)) + (vec (cl-subseq (this-command-keys-vector) + (if current-prefix-arg + (length (this-command-keys)) + 0))) + (templates (cl-mapcan (lambda (table) + (yas--fetch table vec)) + (yas--get-snippet-tables)))) + (if templates (or cmd templates)))) + +(defun yas-expand-from-keymap () + "Directly expand some snippets, searching `yas--direct-keymaps'." + (interactive) + (setq yas--condition-cache-timestamp (current-time)) + (let* ((templates (yas--maybe-expand-from-keymap-filter nil))) + (when templates + (yas--expand-or-prompt-for-template templates)))) + +(defun yas--expand-or-prompt-for-template (templates &optional start end) + "Expand one of TEMPLATES from START to END. + +Prompt the user if TEMPLATES has more than one element, else +expand immediately. Common gateway for +`yas-expand-from-trigger-key' and `yas-expand-from-keymap'." + (let ((yas--current-template (or (and (cl-rest templates) ;; more than one + (yas--prompt-for-template (mapcar #'cdr templates))) + (cdar templates)))) + (when yas--current-template + (yas-expand-snippet (yas--template-content yas--current-template) + start + end + (yas--template-expand-env yas--current-template))))) + +;; Apropos the trigger key and the fallback binding: +;; +;; When `yas-minor-mode-map' binds , that correctly overrides +;; org-mode's , for example and searching for fallbacks correctly +;; returns `org-cycle'. However, most other modes bind "TAB". TODO, +;; improve this explanation. +;; +(defun yas--fallback () + "Fallback after expansion has failed. + +Common gateway for `yas-expand-from-trigger-key' and +`yas-expand-from-keymap'." + (cond ((eq yas-fallback-behavior 'return-nil) + ;; return nil + nil) + ((eq yas-fallback-behavior 'yas--fallback) + (error (concat "yasnippet fallback loop!\n" + "This can happen when you bind `yas-expand' " + "outside of the `yas-minor-mode-map'."))) + ((eq yas-fallback-behavior 'call-other-command) + (let* ((yas-fallback-behavior 'yas--fallback) + ;; Also bind `yas-minor-mode' to prevent fallback + ;; loops when other extensions use mechanisms similar + ;; to `yas--keybinding-beyond-yasnippet'. (github #525 + ;; and #526) + ;; + (yas-minor-mode nil) + (beyond-yasnippet (yas--keybinding-beyond-yasnippet))) + (yas--message 4 "Falling back to %s" beyond-yasnippet) + (cl-assert (or (null beyond-yasnippet) (commandp beyond-yasnippet))) + (setq this-command beyond-yasnippet) + (when beyond-yasnippet + (call-interactively beyond-yasnippet)))) + ((and (listp yas-fallback-behavior) + (cdr yas-fallback-behavior) + (eq 'apply (car yas-fallback-behavior))) + (let ((command-or-fn (cadr yas-fallback-behavior)) + (args (cddr yas-fallback-behavior)) + (yas-fallback-behavior 'yas--fallback) + (yas-minor-mode nil)) + (if args + (apply command-or-fn args) + (when (commandp command-or-fn) + (setq this-command command-or-fn) + (call-interactively command-or-fn))))) + (t + ;; also return nil if all the other fallbacks have failed + nil))) + +(defun yas--keybinding-beyond-yasnippet () + "Get current keys's binding as if YASsnippet didn't exist." + (let* ((yas-minor-mode nil) + (yas--direct-keymaps nil) + (keys (this-single-command-keys))) + (or (key-binding keys t) + (key-binding (yas--fallback-translate-input keys) t)))) + +(defun yas--fallback-translate-input (keys) + "Emulate `read-key-sequence', at least what I think it does. + +Keys should be an untranslated key vector. Returns a translated +vector of keys. FIXME not thoroughly tested." + (let ((retval []) + (i 0)) + (while (< i (length keys)) + (let ((j i) + (translated local-function-key-map)) + (while (and (< j (length keys)) + translated + (keymapp translated)) + (setq translated (cdr (assoc (aref keys j) (remove 'keymap translated))) + j (1+ j))) + (setq retval (vconcat retval (cond ((symbolp translated) + `[,translated]) + ((vectorp translated) + translated) + (t + (substring keys i j))))) + (setq i j))) + retval)) + + +;;; Utils for snippet development: + +(defun yas--all-templates (tables) + "Get `yas--template' objects in TABLES, applicable for buffer and point. + +Honours `yas-choose-tables-first', `yas-choose-keys-first' and +`yas-buffer-local-condition'" + (when yas-choose-tables-first + (setq tables (list (yas--prompt-for-table tables)))) + (mapcar #'cdr + (if yas-choose-keys-first + (let ((key (yas--prompt-for-keys + (cl-mapcan #'yas--table-all-keys tables)))) + (when key + (cl-mapcan (lambda (table) + (yas--fetch table key)) + tables))) + (cl-remove-duplicates (cl-mapcan #'yas--table-templates tables) + :test #'equal)))) + +(defun yas--lookup-snippet-1 (name mode) + "Get the snippet called NAME in MODE's tables." + (let ((yas-choose-tables-first nil) ; avoid prompts + (yas-choose-keys-first nil)) + (cl-find name (yas--all-templates + (yas--get-snippet-tables mode)) + :key #'yas--template-name :test #'string=))) + +(defun yas-lookup-snippet (name &optional mode noerror) + "Get the snippet named NAME in MODE's tables. + +MODE defaults to the current buffer's `major-mode'. If NOERROR +is non-nil, then don't signal an error if there isn't any snippet +called NAME. + +Honours `yas-buffer-local-condition'." + (cond + ((yas--lookup-snippet-1 name mode)) + (noerror nil) + (t (error "No snippet named: %s" name)))) + +(defun yas-insert-snippet (&optional no-condition) + "Choose a snippet to expand, pop-up a list of choices according +to `yas-prompt-functions'. + +With prefix argument NO-CONDITION, bypass filtering of snippets +by condition." + (interactive "P") + (setq yas--condition-cache-timestamp (current-time)) + (let* ((yas-buffer-local-condition (or (and no-condition + 'always) + yas-buffer-local-condition)) + (templates (yas--all-templates (yas--get-snippet-tables))) + (yas--current-template (and templates + (or (and (cl-rest templates) ;; more than one template for same key + (yas--prompt-for-template templates)) + (car templates)))) + (where (if (region-active-p) + (cons (region-beginning) (region-end)) + (cons (point) (point))))) + (if yas--current-template + (yas-expand-snippet (yas--template-content yas--current-template) + (car where) + (cdr where) + (yas--template-expand-env yas--current-template)) + (yas--message 1 "No snippets can be inserted here!")))) + +(defun yas-visit-snippet-file () + "Choose a snippet to edit, selection like `yas-insert-snippet'. + +Only success if selected snippet was loaded from a file. Put the +visited file in `snippet-mode'." + (interactive) + (let* ((yas-buffer-local-condition 'always) + (templates (yas--all-templates (yas--get-snippet-tables))) + (template (and templates + (or (yas--prompt-for-template templates + "Choose a snippet template to edit: ") + (car templates))))) + + (if template + (yas--visit-snippet-file-1 template) + (message "No snippets tables active!")))) + +(defun yas--visit-snippet-file-1 (template) + "Helper for `yas-visit-snippet-file'." + (let ((file (yas--template-get-file template))) + (cond ((and file (file-readable-p file)) + (find-file-other-window file) + (snippet-mode) + (set (make-local-variable 'yas--editing-template) template)) + (file + (message "Original file %s no longer exists!" file)) + (t + (switch-to-buffer (format "*%s*"(yas--template-name template))) + (let ((type 'snippet)) + (when (listp (yas--template-content template)) + (insert (format "# type: command\n")) + (setq type 'command)) + (insert (format "# key: %s\n" (yas--template-key template))) + (insert (format "# name: %s\n" (yas--template-name template))) + (when (yas--template-keybinding template) + (insert (format "# binding: %s\n" (yas--template-keybinding template)))) + (when (yas--template-expand-env template) + (insert (format "# expand-env: %s\n" (yas--template-expand-env template)))) + (when (yas--template-condition template) + (insert (format "# condition: %s\n" (yas--template-condition template)))) + (insert "# --\n") + (insert (if (eq type 'command) + (pp-to-string (yas--template-content template)) + (yas--template-content template)))) + (snippet-mode) + (set (make-local-variable 'yas--editing-template) template) + (set (make-local-variable 'default-directory) + (car (cdr (car (yas--guess-snippet-directories (yas--template-table template)))))))))) + +(defun yas--guess-snippet-directories-1 (table) + "Guess possible snippet subdirectories for TABLE." + (cons (file-name-as-directory (yas--table-name table)) + (cl-mapcan #'yas--guess-snippet-directories-1 + (yas--table-parents table)))) + +(defun yas--guess-snippet-directories (&optional table) + "Try to guess suitable directories based on the current active +tables (or optional TABLE). + +Returns a list of elements (TABLE . DIRS) where TABLE is a +`yas--table' object and DIRS is a list of all possible directories +where snippets of table might exist." + (let ((main-dir (car (or (yas-snippet-dirs) + (setq yas-snippet-dirs + (list yas--default-user-snippets-dir))))) + (tables (if table (list table) + (yas--get-snippet-tables)))) + ;; HACK! the snippet table created here is actually registered! + (unless table + ;; The major mode is probably the best guess, put it first. + (let ((major-mode-table (yas--table-get-create major-mode))) + (cl-callf2 delq major-mode-table tables) + (push major-mode-table tables))) + + (mapcar #'(lambda (table) + (cons table + (mapcar #'(lambda (subdir) + (expand-file-name subdir main-dir)) + (yas--guess-snippet-directories-1 table)))) + tables))) + +(defun yas--make-directory-maybe (table-and-dirs &optional main-table-string) + "Return a dir inside TABLE-AND-DIRS, prompts for creation if none exists." + (or (cl-some (lambda (dir) (when (file-directory-p dir) dir)) + (cdr table-and-dirs)) + (let ((candidate (cl-first (cdr table-and-dirs)))) + (unless (file-writable-p (file-name-directory candidate)) + (error (yas--format "%s is not writable." candidate))) + (if (y-or-n-p (format "Guessed directory (%s) for%s%s table \"%s\" does not exist! Create? " + candidate + (if (gethash (yas--table-mode (car table-and-dirs)) + yas--tables) + "" + " brand new") + (or main-table-string + "") + (yas--table-name (car table-and-dirs)))) + (progn + (make-directory candidate 'also-make-parents) + ;; create the .yas-parents file here... + candidate))))) + +;; NOTE: Using the traditional "*new snippet*" stops whitespace mode +;; from activating (it doesn't like the leading "*"). +(defconst yas-new-snippet-buffer-name "+new-snippet+") + +(defun yas-new-snippet (&optional no-template) + "Pops a new buffer for writing a snippet. + +Expands a snippet-writing snippet, unless the optional prefix arg +NO-TEMPLATE is non-nil." + (interactive "P") + (let ((guessed-directories (yas--guess-snippet-directories)) + (yas-selected-text (or yas-selected-text + (and (region-active-p) + (buffer-substring-no-properties + (region-beginning) (region-end)))))) + + (switch-to-buffer yas-new-snippet-buffer-name) + (erase-buffer) + (kill-all-local-variables) + (snippet-mode) + (yas-minor-mode 1) + (set (make-local-variable 'yas--guessed-modes) + (mapcar (lambda (d) (yas--table-mode (car d))) + guessed-directories)) + (set (make-local-variable 'default-directory) + (car (cdr (car guessed-directories)))) + (if (and (not no-template) yas-new-snippet-default) + (yas-expand-snippet yas-new-snippet-default)))) + +(defun yas--compute-major-mode-and-parents (file) + "Given FILE, find the nearest snippet directory for a given mode. + +Returns a list (MODE-SYM PARENTS), the mode's symbol and a list +representing one or more of the mode's parents. + +Note that MODE-SYM need not be the symbol of a real major mode, +neither do the elements of PARENTS." + (let* ((file-dir (and file + (directory-file-name + (or (cl-some (lambda (special) + (locate-dominating-file file special)) + '(".yas-setup.el" + ".yas-make-groups" + ".yas-parents")) + (directory-file-name (file-name-directory file)))))) + (parents-file-name (concat file-dir "/.yas-parents")) + (major-mode-name (and file-dir + (file-name-nondirectory file-dir))) + (major-mode-sym (or (and major-mode-name + (intern major-mode-name)))) + (parents (when (file-readable-p parents-file-name) + (mapcar #'intern + (split-string + (with-temp-buffer + (insert-file-contents parents-file-name) + (buffer-substring-no-properties (point-min) + (point-max)))))))) + (when major-mode-sym + (cons major-mode-sym (remove major-mode-sym parents))))) + +(defvar yas--editing-template nil + "Supporting variable for `yas-load-snippet-buffer' and `yas--visit-snippet'.") + +(defvar yas--current-template nil + "Holds the current template being expanded into a snippet.") + +(defvar yas--guessed-modes nil + "List of guessed modes supporting `yas-load-snippet-buffer'.") + +(defun yas--read-table () + "Ask user for a snippet table, help with some guessing." + (let ((prompt (if (and (featurep 'ido) + ido-mode) + 'ido-completing-read 'completing-read))) + (unless yas--guessed-modes + (set (make-local-variable 'yas--guessed-modes) + (or (yas--compute-major-mode-and-parents buffer-file-name)))) + (intern + (funcall prompt (format "Choose or enter a table (yas guesses %s): " + (if yas--guessed-modes + (cl-first yas--guessed-modes) + "nothing")) + (mapcar #'symbol-name yas--guessed-modes) + nil + nil + nil + nil + (if (cl-first yas--guessed-modes) + (symbol-name (cl-first yas--guessed-modes))))))) + +(defun yas-load-snippet-buffer (table &optional interactive) + "Parse and load current buffer's snippet definition into TABLE. +TABLE is a symbol name passed to `yas--table-get-create'. When +called interactively, prompt for the table name. +Return the `yas--template' object created" + (interactive (list (yas--read-table) t)) + (cond + ;; We have `yas--editing-template', this buffer's content comes from a + ;; template which is already loaded and neatly positioned,... + ;; + (yas--editing-template + (yas--define-snippets-1 (yas--parse-template (yas--template-load-file yas--editing-template)) + (yas--template-table yas--editing-template))) + ;; Try to use `yas--guessed-modes'. If we don't have that use the + ;; value from `yas--compute-major-mode-and-parents' + ;; + (t + (unless yas--guessed-modes + (set (make-local-variable 'yas--guessed-modes) (or (yas--compute-major-mode-and-parents buffer-file-name)))) + (let* ((table (yas--table-get-create table))) + (set (make-local-variable 'yas--editing-template) + (yas--define-snippets-1 (yas--parse-template buffer-file-name) + table))))) + (when interactive + (yas--message 3 "Snippet \"%s\" loaded for %s." + (yas--template-name yas--editing-template) + (yas--table-name (yas--template-table yas--editing-template)))) + yas--editing-template) + +(defun yas-maybe-load-snippet-buffer () + "Added to `after-save-hook' in `snippet-mode'." + (let* ((mode (intern (file-name-sans-extension + (file-name-nondirectory + (directory-file-name default-directory))))) + (current-snippet + (apply #'yas--define-snippets-2 (yas--table-get-create mode) + (yas--parse-template buffer-file-name))) + (uuid (yas--template-uuid current-snippet))) + (unless (equal current-snippet + (if uuid (yas--get-template-by-uuid mode uuid) + (yas--lookup-snippet-1 + (yas--template-name current-snippet) mode))) + (yas-load-snippet-buffer mode t)))) + +(defun yas-load-snippet-buffer-and-close (table &optional kill) + "Load and save the snippet, then `quit-window' if saved. +Loading is performed by `yas-load-snippet-buffer'. If the +snippet is new, ask the user whether (and where) to save it. If +the snippet already has a file, just save it. + +The prefix argument KILL is passed to `quit-window'. + +Don't use this from a Lisp program, call `yas-load-snippet-buffer' +and `kill-buffer' instead." + (interactive (list (yas--read-table) current-prefix-arg)) + (let ((template (yas-load-snippet-buffer table t))) + (when (and (buffer-modified-p) + (y-or-n-p + (format "[yas] Loaded for %s. Also save snippet buffer?" + (yas--table-name (yas--template-table template))))) + (let ((default-directory (car (cdr (car (yas--guess-snippet-directories + (yas--template-table template)))))) + (default-file-name (yas--template-name template))) + (unless (or buffer-file-name (not default-file-name)) + (setq buffer-file-name + (read-file-name "File to save snippet in: " + nil nil nil default-file-name)) + (rename-buffer (file-name-nondirectory buffer-file-name) t)) + (save-buffer))) + (quit-window kill))) + +(declare-function yas-debug-snippets "yasnippet-debug") + +(defun yas-tryout-snippet (&optional debug) + "Test current buffer's snippet template in other buffer. +DEBUG is for debugging the YASnippet engine itself." + (interactive "P") + (let* ((major-mode-and-parent (yas--compute-major-mode-and-parents buffer-file-name)) + (parsed (yas--parse-template)) + (test-mode (or (and (car major-mode-and-parent) + (fboundp (car major-mode-and-parent)) + (car major-mode-and-parent)) + (cl-first yas--guessed-modes) + (intern (read-from-minibuffer (yas--format "Please input a mode: "))))) + (yas--current-template + (and parsed + (fboundp test-mode) + (yas--make-template :table nil ;; no tables for ephemeral snippets + :key (nth 0 parsed) + :content (nth 1 parsed) + :name (nth 2 parsed) + :expand-env (nth 5 parsed))))) + (cond (yas--current-template + (let ((buffer-name (format "*testing snippet: %s*" (yas--template-name yas--current-template)))) + (kill-buffer (get-buffer-create buffer-name)) + (switch-to-buffer (get-buffer-create buffer-name)) + (setq buffer-undo-list nil) + (condition-case nil (funcall test-mode) (error nil)) + (yas-minor-mode 1) + (setq buffer-read-only nil) + (yas-expand-snippet (yas--template-content yas--current-template) + (point-min) + (point-max) + (yas--template-expand-env yas--current-template)) + (when (and debug + (require 'yasnippet-debug nil t)) + (yas-debug-snippets "*YASnippet trace*" 'snippet-navigation) + (display-buffer "*YASnippet trace*")))) + (t + (yas--message 1 "Cannot test snippet for unknown major mode"))))) + +(defun yas-active-keys () + "Return all active trigger keys for current buffer and point." + (cl-remove-duplicates + (cl-remove-if-not #'stringp (cl-mapcan #'yas--table-all-keys + (yas--get-snippet-tables))) + :test #'string=)) + +(defun yas--template-fine-group (template) + (car (last (or (yas--template-group template) + (yas--template-perm-group template))))) + +(defun yas-describe-table-by-namehash () + "Display snippet tables by NAMEHASH." + (interactive) + (with-current-buffer (get-buffer-create "*YASnippet Tables by NAMEHASH*") + (let ((inhibit-read-only t)) + (erase-buffer) + (insert "YASnippet tables by NAMEHASH: \n") + (maphash + (lambda (_mode table) + (insert (format "\nSnippet table `%s':\n\n" (yas--table-name table))) + (maphash + (lambda (key _v) + (insert (format " key %s maps snippets: %s\n" key + (let ((names)) + (maphash #'(lambda (k _v) + (push k names)) + (gethash key (yas--table-hash table))) + names)))) + (yas--table-hash table))) + yas--tables)) + (view-mode +1) + (goto-char 1) + (display-buffer (current-buffer)))) + +(defun yas-describe-tables (&optional with-nonactive) + "Display snippets for each table." + (interactive "P") + (let ((original-buffer (current-buffer)) + (tables (yas--get-snippet-tables))) + (with-current-buffer (get-buffer-create "*YASnippet Tables*") + (let ((inhibit-read-only t)) + (when with-nonactive + (maphash #'(lambda (_k v) + (cl-pushnew v tables)) + yas--tables)) + (erase-buffer) + (insert "YASnippet tables:\n") + (dolist (table tables) + (yas--describe-pretty-table table original-buffer)) + (yas--create-snippet-xrefs)) + (help-mode) + (goto-char 1) + (display-buffer (current-buffer))))) + +(defun yas--describe-pretty-table (table &optional original-buffer) + (insert (format "\nSnippet table `%s'" + (yas--table-name table))) + (if (yas--table-parents table) + (insert (format " parents: %s\n" + (mapcar #'yas--table-name + (yas--table-parents table)))) + (insert "\n")) + (insert (make-string 100 ?-) "\n") + (insert "group state name key binding\n") + (let ((groups-hash (make-hash-table :test #'equal))) + (maphash #'(lambda (_k v) + (let ((group (or (yas--template-fine-group v) + "(top level)"))) + (when (yas--template-name v) + (puthash group + (cons v (gethash group groups-hash)) + groups-hash)))) + (yas--table-uuidhash table)) + (maphash + #'(lambda (group templates) + (setq group (truncate-string-to-width group 25 0 ? "...")) + (insert (make-string 100 ?-) "\n") + (dolist (p templates) + (let* ((name (truncate-string-to-width (propertize (format "\\\\snippet `%s'" (yas--template-name p)) + 'yasnippet p) + 50 0 ? "...")) + (group (prog1 group + (setq group (make-string (length group) ? )))) + (condition-string (let ((condition (yas--template-condition p))) + (if (and condition + original-buffer) + (with-current-buffer original-buffer + (if (yas--eval-condition condition) + "(y)" + "(s)")) + "(a)"))) + (key-description-string (key-description (yas--template-keybinding p))) + (template-key-padding (if (string= key-description-string "") nil ? ))) + (insert group " " + condition-string " " + name (if (string-match "\\.\\.\\.$" name) + "'" " ") + " " + (truncate-string-to-width (or (yas--template-key p) "") + 15 0 template-key-padding "...") + (or template-key-padding "") + (truncate-string-to-width key-description-string + 15 0 nil "...") + "\n")))) + groups-hash))) + + + +;;; User convenience functions, for using in `yas-key-syntaxes' + +(defun yas-try-key-from-whitespace (_start-point) + "As `yas-key-syntaxes' element, look for whitespace delimited key. + +A newline will be considered whitespace even if the mode syntax +marks it as something else (typically comment ender)." + (skip-chars-backward "^[:space:]\n")) + +(defun yas-shortest-key-until-whitespace (_start-point) + "Like `yas-longest-key-from-whitespace' but take the shortest key." + (when (/= (skip-chars-backward "^[:space:]\n" (1- (point))) 0) + 'again)) + +(defun yas-longest-key-from-whitespace (start-point) + "As `yas-key-syntaxes' element, look for longest key between point and whitespace. + +A newline will be considered whitespace even if the mode syntax +marks it as something else (typically comment ender)." + (if (= (point) start-point) + (yas-try-key-from-whitespace start-point) + (forward-char)) + (unless (<= start-point (1+ (point))) + 'again)) + + + +;;; User convenience functions, for using in snippet definitions + +(defvar yas-modified-p nil + "Non-nil if field has been modified by user or transformation.") + +(defvar yas-moving-away-p nil + "Non-nil if user is about to exit field.") + +(defvar yas-text nil + "Contains current field text.") + +(defun yas-substr (str pattern &optional subexp) + "Search PATTERN in STR and return SUBEXPth match. + +If found, the content of subexp group SUBEXP (default 0) is + returned, or else the original STR will be returned." + (let ((grp (or subexp 0))) + (save-match-data + (if (string-match pattern str) + (match-string-no-properties grp str) + str)))) + +(defun yas-choose-value (&rest possibilities) + "Prompt for a string in POSSIBILITIES and return it. + +The last element of POSSIBILITIES may be a list of strings." + (unless (or yas-moving-away-p + yas-modified-p) + (let* ((last-link (last possibilities)) + (last-elem (car last-link))) + (when (listp last-elem) + (setcar last-link (car last-elem)) + (setcdr last-link (cdr last-elem)))) + (cl-some (lambda (fn) + (funcall fn "Choose: " possibilities)) + yas-prompt-functions))) + +(defun yas--auto-next () + "Helper for `yas-auto-next'." + (remove-hook 'post-command-hook #'yas--auto-next t) + (yas-next-field)) + +(defmacro yas-auto-next (&rest body) + "Automatically advance to next field after eval'ing BODY." + (declare (indent 0) (debug t)) + `(unless yas-moving-away-p + (prog1 ,@body + (add-hook 'post-command-hook #'yas--auto-next nil t)))) + +(defun yas-key-to-value (alist) + (unless (or yas-moving-away-p + yas-modified-p) + (let ((key (read-key-sequence ""))) + (when (stringp key) + (or (cdr (cl-find key alist :key #'car :test #'string=)) + key))))) + +(defun yas-throw (text) + "Signal `yas-exception' with TEXT as the reason." + (signal 'yas-exception (list text))) +(put 'yas-exception 'error-conditions '(error yas-exception)) +(put 'yas-exception 'error-message "[yas] Exception") + +(defun yas-verify-value (possibilities) + "Verify that the current field value is in POSSIBILITIES. +Otherwise signal `yas-exception'." + (when (and yas-moving-away-p (cl-notany (lambda (pos) (string= pos yas-text)) possibilities)) + (yas-throw (format "Field only allows %s" possibilities)))) + +(defun yas-field-value (number) + "Get the string for field with NUMBER. + +Use this in primary and mirror transformations to get the text of +other fields." + (let* ((snippet (car (yas-active-snippets))) + (field (and snippet + (yas--snippet-find-field snippet number)))) + (when field + (yas--field-text-for-display field)))) + +(defun yas-text () + "Return `yas-text' if that exists and is non-empty, else nil." + (if (and yas-text + (not (string= "" yas-text))) + yas-text)) + +(defun yas-selected-text () + "Return `yas-selected-text' if that exists and is non-empty, else nil." + (if (and yas-selected-text + (not (string= "" yas-selected-text))) + yas-selected-text)) + +(defun yas--get-field-once (number &optional transform-fn) + (unless yas-modified-p + (if transform-fn + (funcall transform-fn (yas-field-value number)) + (yas-field-value number)))) + +(defun yas-default-from-field (number) + (unless yas-modified-p + (yas-field-value number))) + +(defun yas-inside-string () + "Return non-nil if the point is inside a string according to font-lock." + (equal 'font-lock-string-face (get-char-property (1- (point)) 'face))) + +(defun yas-unimplemented (&optional missing-feature) + (if yas--current-template + (if (y-or-n-p (format "This snippet is unimplemented (missing %s) Visit the snippet definition? " + (or missing-feature + "something"))) + (yas--visit-snippet-file-1 yas--current-template)) + (message "No implementation. Missing %s" (or missing-feature "something")))) + + +;;; Snippet expansion and field management + +(defvar yas--active-field-overlay nil + "Overlays the currently active field.") + +(defvar yas--active-snippets nil + "List of currently active snippets") +(make-variable-buffer-local 'yas--active-snippets) + +(defvar yas--field-protection-overlays nil + "Two overlays protect the current active field.") + +(defvar yas-selected-text nil + "The selected region deleted on the last snippet expansion.") + +(defvar yas--start-column nil + "The column where the snippet expansion started.") + +(make-variable-buffer-local 'yas--active-field-overlay) +(make-variable-buffer-local 'yas--field-protection-overlays) +(put 'yas--active-field-overlay 'permanent-local t) +(put 'yas--field-protection-overlays 'permanent-local t) + +(cl-defstruct (yas--snippet (:constructor yas--make-snippet (expand-env))) + "A snippet. + +..." + expand-env + (fields '()) + (exit nil) + (id (yas--snippet-next-id) :read-only t) + (control-overlay nil) + active-field + ;; stacked expansion: the `previous-active-field' slot saves the + ;; active field where the child expansion took place + previous-active-field + force-exit) + +(cl-defstruct (yas--field (:constructor yas--make-field (number start end parent-field))) + "A field. + +NUMBER is the field number. +START and END are mostly buffer markers, but see \"apropos markers-to-points\". +PARENT-FIELD is a `yas--field' this field is nested under, or nil. +MIRRORS is a list of `yas--mirror's +TRANSFORM is a lisp form. +MODIFIED-P is a boolean set to true once user inputs text. +NEXT is another `yas--field' or `yas--mirror' or `yas--exit'. +" + number + start end + parent-field + (mirrors '()) + (transform nil) + (modified-p nil) + next) + + +(cl-defstruct (yas--mirror (:constructor yas--make-mirror (start end transform))) + "A mirror. + +START and END are mostly buffer markers, but see \"apropos markers-to-points\". +TRANSFORM is a lisp form. +PARENT-FIELD is a `yas--field' this mirror is nested under, or nil. +NEXT is another `yas--field' or `yas--mirror' or `yas--exit' +DEPTH is a count of how many nested mirrors can affect this mirror" + start end + (transform nil) + parent-field + next + depth) + +(cl-defstruct (yas--exit (:constructor yas--make-exit (marker))) + marker + next) + +(defmacro yas--letenv (env &rest body) + "Evaluate BODY with bindings from ENV. +ENV is a lisp expression that evaluates to list of elements with +the form (VAR FORM), where VAR is a symbol and FORM is a lisp +expression that evaluates to its value." + (declare (debug (form body)) (indent 1)) + (let ((envvar (make-symbol "envvar"))) + `(let ((,envvar ,env)) + (cl-progv + (mapcar #'car ,envvar) + (mapcar (lambda (v-f) (eval (cadr v-f))) ,envvar) + ,@body)))) + +(defun yas--snippet-map-markers (fun snippet) + "Apply FUN to all marker (sub)fields in SNIPPET. +Update each field with the result of calling FUN." + (dolist (field (yas--snippet-fields snippet)) + (setf (yas--field-start field) (funcall fun (yas--field-start field))) + (setf (yas--field-end field) (funcall fun (yas--field-end field))) + (dolist (mirror (yas--field-mirrors field)) + (setf (yas--mirror-start mirror) (funcall fun (yas--mirror-start mirror))) + (setf (yas--mirror-end mirror) (funcall fun (yas--mirror-end mirror))))) + (let ((snippet-exit (yas--snippet-exit snippet))) + (when snippet-exit + (setf (yas--exit-marker snippet-exit) + (funcall fun (yas--exit-marker snippet-exit)))))) + +(defun yas--snippet-live-p (snippet) + "Return non-nil if SNIPPET hasn't been committed." + (catch 'live + (yas--snippet-map-markers (lambda (m) + (if (markerp m) m + (throw 'live nil))) + snippet) + t)) + +(defun yas--apply-transform (field-or-mirror field &optional empty-on-nil-p) + "Calculate transformed string for FIELD-OR-MIRROR from FIELD. + +If there is no transform for ht field, return nil. + +If there is a transform but it returns nil, return the empty +string iff EMPTY-ON-NIL-P is true." + (let* ((yas-text (yas--field-text-for-display field)) + (yas-modified-p (yas--field-modified-p field)) + (transform (if (yas--mirror-p field-or-mirror) + (yas--mirror-transform field-or-mirror) + (yas--field-transform field-or-mirror))) + (start-point (if (yas--mirror-p field-or-mirror) + (yas--mirror-start field-or-mirror) + (yas--field-start field-or-mirror))) + (transformed (and transform + (save-excursion + (goto-char start-point) + (let ((ret (yas--eval-for-string transform))) + (or ret (and empty-on-nil-p ""))))))) + transformed)) + +(defsubst yas--replace-all (from to &optional text) + "Replace all occurrences from FROM to TO. + +With optional string TEXT do it in that string." + (if text + (replace-regexp-in-string (regexp-quote from) to text t t) + (goto-char (point-min)) + (while (search-forward from nil t) + (replace-match to t t text)))) + +(defun yas--snippet-find-field (snippet number) + (cl-find-if (lambda (field) + (eq number (yas--field-number field))) + (yas--snippet-fields snippet))) + +(defun yas--snippet-sort-fields (snippet) + "Sort the fields of SNIPPET in navigation order." + (setf (yas--snippet-fields snippet) + (sort (yas--snippet-fields snippet) + #'yas--snippet-field-compare))) + +(defun yas--snippet-field-compare (field1 field2) + "Compare FIELD1 and FIELD2. + +The field with a number is sorted first. If they both have a +number, compare through the number. If neither have, compare +through the field's start point" + (let ((n1 (yas--field-number field1)) + (n2 (yas--field-number field2))) + (if n1 + (if n2 + (or (zerop n2) (and (not (zerop n1)) + (< n1 n2))) + (not (zerop n1))) + (if n2 + (zerop n2) + (< (yas--field-start field1) + (yas--field-start field2)))))) + +(defun yas--field-probably-deleted-p (snippet field) + "Guess if SNIPPET's FIELD should be skipped." + (and + ;; field must be zero length + ;; + (zerop (- (yas--field-start field) (yas--field-end field))) + ;; field must have been modified + ;; + (yas--field-modified-p field) + ;; either: + (or + ;; 1) it's a nested field + ;; + (yas--field-parent-field field) + ;; 2) ends just before the snippet end + ;; + (and (eq field (car (last (yas--snippet-fields snippet)))) + (= (yas--field-start field) (overlay-end (yas--snippet-control-overlay snippet))))) + ;; the field numbered 0, just before the exit marker, should + ;; never be skipped + ;; + (not (and (yas--field-number field) + (zerop (yas--field-number field)))))) + +(defun yas-active-snippets (&optional beg end) + "Return a sorted list of active snippets. +The most recently-inserted snippets are returned first. + +Only snippets overlapping the region BEG ... END are returned. +Overlapping has the same meaning as described in `overlays-in'. +If END is omitted, it defaults to (1+ BEG). If BEG is omitted, +it defaults to point. A non-nil, non-buffer position BEG is +equivalent to a range covering the whole buffer." + (unless beg + (setq beg (point))) + (cond ((not (or (integerp beg) (markerp beg))) + (setq beg (point-min) end (point-max))) + ((not end) + (setq end (1+ beg)))) + (if (and (eq beg (point-min)) + (eq end (point-max))) + yas--active-snippets + ;; Note: don't use `mapcar' here, since it would allocate in + ;; proportion to the amount of overlays, even though the list of + ;; active snippets should be very small. + (let ((snippets nil)) + (dolist (ov (overlays-in beg end)) + (let ((snippet (overlay-get ov 'yas--snippet))) + ;; Snippets have multiple overlays, so check for dups. + (when (and snippet (not (memq snippet snippets))) + (push snippet snippets)))) + (cl-sort snippets #'>= :key #'yas--snippet-id)))) + +(define-obsolete-function-alias 'yas--snippets-at-point + 'yas-active-snippets "0.12") + +(defun yas-next-field-or-maybe-expand () + "Try to expand a snippet at a key before point. + +Otherwise delegate to `yas-next-field'." + (interactive) + (if yas-triggers-in-field + (let ((yas-fallback-behavior 'return-nil) + (active-field (overlay-get yas--active-field-overlay 'yas--field))) + (when active-field + (unless (yas-expand-from-trigger-key active-field) + (yas-next-field)))) + (yas-next-field))) + +(defun yas-next-field-will-exit-p (&optional arg) + "Return non-nil if (yas-next-field ARG) would exit the current snippet." + (let ((snippet (car (yas-active-snippets))) + (active (overlay-get yas--active-field-overlay 'yas--field))) + (when snippet + (not (yas--find-next-field arg snippet active))))) + +(defun yas--find-next-field (n snippet active) + "Return the Nth field after the ACTIVE one in SNIPPET." + (let ((live-fields (cl-remove-if + (lambda (field) + (and (not (eq field active)) + (yas--field-probably-deleted-p snippet field))) + (yas--snippet-fields snippet)))) + (nth (abs n) (memq active (if (>= n 0) live-fields (reverse live-fields)))))) + +(defun yas-next-field (&optional arg) + "Navigate to the ARGth next field. + +If there's none, exit the snippet." + (interactive) + (unless arg (setq arg 1)) + (let* ((snippet (car (yas-active-snippets))) + (active-field (overlay-get yas--active-field-overlay 'yas--field)) + (target-field (yas--find-next-field arg snippet active-field))) + (yas--letenv (yas--snippet-expand-env snippet) + ;; Apply transform to active field. + (when active-field + (let ((yas-moving-away-p t)) + (when (yas--field-update-display active-field) + (yas--update-mirrors snippet)))) + ;; Now actually move... + (if target-field + (yas--move-to-field snippet target-field) + (yas-exit-snippet snippet))))) + +(defun yas--place-overlays (snippet field) + "Correctly place overlays for SNIPPET's FIELD." + (yas--make-move-field-protection-overlays snippet field) + ;; Only move active field overlays if this is field is from the + ;; innermost snippet. + (when (eq snippet (car (yas-active-snippets (1- (yas--field-start field)) + (1+ (yas--field-end field))))) + (yas--make-move-active-field-overlay snippet field))) + +(defun yas--move-to-field (snippet field) + "Update SNIPPET to move to field FIELD. + +Also create some protection overlays" + (goto-char (yas--field-start field)) + (yas--place-overlays snippet field) + (overlay-put yas--active-field-overlay 'yas--snippet snippet) + (overlay-put yas--active-field-overlay 'yas--field field) + (let ((number (yas--field-number field))) + ;; check for the special ${0: ...} field + (if (and number (zerop number)) + (progn + (set-mark (yas--field-end field)) + (setf (yas--snippet-force-exit snippet) + (or (yas--field-transform field) + t))) + ;; make this field active + (setf (yas--snippet-active-field snippet) field) + ;; primary field transform: first call to snippet transform + (unless (yas--field-modified-p field) + (if (yas--field-update-display field) + (yas--update-mirrors snippet) + (setf (yas--field-modified-p field) nil)))))) + +(defun yas-prev-field () + "Navigate to prev field. If there's none, exit the snippet." + (interactive) + (yas-next-field -1)) + +(defun yas-abort-snippet (&optional snippet) + (interactive) + (let ((snippet (or snippet + (car (yas-active-snippets))))) + (when snippet + (setf (yas--snippet-force-exit snippet) t)))) + +(defun yas-exit-snippet (snippet) + "Goto exit-marker of SNIPPET." + (interactive (list (cl-first (yas-active-snippets)))) + (when snippet + (setf (yas--snippet-force-exit snippet) t) + (goto-char (if (yas--snippet-exit snippet) + (yas--exit-marker (yas--snippet-exit snippet)) + (overlay-end (yas--snippet-control-overlay snippet)))))) + +(defun yas-exit-all-snippets () + "Exit all snippets." + (interactive) + (mapc #'(lambda (snippet) + (yas-exit-snippet snippet) + (yas--check-commit-snippet)) + (yas-active-snippets 'all))) + + +;;; Some low level snippet-routines: + +(defvar yas--inhibit-overlay-hooks nil + "Bind this temporarily to non-nil to prevent running `yas--on-*-modification'.") + +(defvar yas-snippet-beg nil "Beginning position of the last snippet committed.") +(defvar yas-snippet-end nil "End position of the last snippet committed.") + +(defun yas--commit-snippet (snippet) + "Commit SNIPPET, but leave point as it is. + +This renders the snippet as ordinary text." + + (let ((control-overlay (yas--snippet-control-overlay snippet))) + ;; + ;; Save the end of the moribund snippet in case we need to revive it + ;; its original expansion. + ;; + (when (and control-overlay + (overlay-buffer control-overlay)) + (setq yas-snippet-beg (overlay-start control-overlay)) + (setq yas-snippet-end (overlay-end control-overlay)) + (delete-overlay control-overlay) + (setf (yas--snippet-control-overlay snippet) nil)) + + (let ((yas--inhibit-overlay-hooks t)) + (when yas--active-field-overlay + (delete-overlay yas--active-field-overlay)) + (when yas--field-protection-overlays + (mapc #'delete-overlay yas--field-protection-overlays))) + + ;; stacked expansion: if the original expansion took place from a + ;; field, make sure we advance it here at least to + ;; `yas-snippet-end'... + ;; + (let ((previous-field (yas--snippet-previous-active-field snippet))) + (when (and yas-snippet-end previous-field) + (yas--advance-end-maybe previous-field yas-snippet-end))) + + ;; Convert all markers to points, + ;; + (yas--markers-to-points snippet) + + ;; It's no longer an active snippet. + (cl-callf2 delq snippet yas--active-snippets) + + ;; Take care of snippet revival on undo. + (if (and yas-snippet-revival (listp buffer-undo-list)) + (push `(apply yas--snippet-revive ,yas-snippet-beg ,yas-snippet-end ,snippet) + buffer-undo-list) + ;; Dismember the snippet... this is useful if we get called + ;; again from `yas--take-care-of-redo'.... + (setf (yas--snippet-fields snippet) nil))) + + (yas--message 4 "Snippet %s exited." (yas--snippet-id snippet))) + +(defvar yas--snippets-to-move nil) +(make-variable-buffer-local 'yas--snippets-to-move) + +(defun yas--prepare-snippets-for-move (beg end buf pos) + "Gather snippets in BEG..END for moving to POS in BUF." + (let ((to-move nil) + (snippets (yas-active-snippets beg end)) + (dst-base-line (with-current-buffer buf + (count-lines (point-min) pos)))) + (when snippets + (dolist (snippet snippets) + (yas--snippet-map-markers + (lambda (m) + (goto-char m) + (beginning-of-line) + (prog1 (cons (count-lines (point-min) (point)) + (yas--snapshot-marker-location m)) + (set-marker m nil))) + snippet) + (let ((ctrl-ov (yas--snapshot-overlay-line-location + (yas--snippet-control-overlay snippet)))) + (push (list ctrl-ov dst-base-line snippet) to-move) + (delete-overlay (car ctrl-ov)))) + (with-current-buffer buf + (setq yas--snippets-to-move (nconc to-move yas--snippets-to-move)))))) + +(defun yas--on-buffer-kill () + ;; Org mode uses temp buffers for fontification and "native tab", + ;; move all the snippets to the original org-mode buffer when it's + ;; killed. + (let ((org-marker nil)) + (when (and yas-minor-mode + (or (bound-and-true-p org-edit-src-from-org-mode) + (bound-and-true-p org-src--from-org-mode)) + (markerp + (setq org-marker + (or (bound-and-true-p org-edit-src-beg-marker) + (bound-and-true-p org-src--beg-marker))))) + (yas--prepare-snippets-for-move + (point-min) (point-max) + (marker-buffer org-marker) org-marker)))) + +(add-hook 'kill-buffer-hook #'yas--on-buffer-kill) + +(defun yas--finish-moving-snippets () + "Finish job started in `yas--prepare-snippets-for-move'." + (cl-loop for (ctrl-ov base-line snippet) in yas--snippets-to-move + for base-pos = (progn (goto-char (point-min)) + (forward-line base-line) (point)) + do (yas--snippet-map-markers + (lambda (l-m-r-w) + (goto-char base-pos) + (forward-line (nth 0 l-m-r-w)) + (save-restriction + (narrow-to-region (line-beginning-position) + (line-end-position)) + (yas--restore-marker-location (cdr l-m-r-w))) + (nth 1 l-m-r-w)) + snippet) + (goto-char base-pos) + (yas--restore-overlay-location ctrl-ov) + (yas--maybe-move-to-active-field snippet)) + (setq yas--snippets-to-move nil)) + +(defun yas--safely-call-fun (fun) + "Call FUN and catch any errors." + (condition-case error + (funcall fun) + ((debug error) + (yas--message 2 "Error running %s: %s" fun + (error-message-string error))))) + +(defun yas--safely-run-hook (hook) + "Call HOOK's functions. +HOOK should be a symbol, a hook variable, as in `run-hooks'." + (let ((debug-on-error (and (not (memq yas-good-grace '(t hooks))) + debug-on-error))) + (yas--safely-call-fun (apply-partially #'run-hooks hook)))) + +(defun yas--check-commit-snippet () + "Check if point exited the currently active field of the snippet. + +If so cleans up the whole snippet up." + (let* ((snippet-exit-transform nil) + (exited-snippets-p nil) + ;; Record the custom snippet `yas-after-exit-snippet-hook' + ;; set in the expand-env field. + (snippet-exit-hook yas-after-exit-snippet-hook)) + (dolist (snippet yas--active-snippets) + (let ((active-field (yas--snippet-active-field snippet))) + (yas--letenv (yas--snippet-expand-env snippet) + ;; Note: the `force-exit' field could be a transform in case of + ;; ${0: ...}, see `yas--move-to-field'. + (setq snippet-exit-transform (yas--snippet-force-exit snippet)) + (cond ((or snippet-exit-transform + (not (and active-field (yas--field-contains-point-p active-field)))) + (setf (yas--snippet-force-exit snippet) nil) + (setq snippet-exit-hook yas-after-exit-snippet-hook) + (yas--commit-snippet snippet) + (setq exited-snippets-p t)) + ((and active-field + (or (not yas--active-field-overlay) + (not (overlay-buffer yas--active-field-overlay)))) + ;; + ;; stacked expansion: this case is mainly for recent + ;; snippet exits that place us back int the field of + ;; another snippet + ;; + (save-excursion + (yas--move-to-field snippet active-field) + (yas--update-mirrors snippet))) + (t + nil))))) + (unless (or yas--active-snippets (not exited-snippets-p)) + (when snippet-exit-transform + (yas--eval-for-effect snippet-exit-transform)) + (let ((yas-after-exit-snippet-hook snippet-exit-hook)) + (yas--safely-run-hook 'yas-after-exit-snippet-hook))))) + +;; Apropos markers-to-points: +;; +;; This was found useful for performance reasons, so that an excessive +;; number of live markers aren't kept around in the +;; `buffer-undo-list'. We don't reuse the original marker object +;; because that leaves an unreadable object in the history list and +;; undo-tree persistence has trouble with that. +;; +;; This shouldn't bring horrible problems with undo/redo, but you +;; never know. +;; +(defun yas--markers-to-points (snippet) + "Save all markers of SNIPPET as positions." + (yas--snippet-map-markers (lambda (m) + (prog1 (marker-position m) + (set-marker m nil))) + snippet)) + +(defun yas--points-to-markers (snippet) + "Restore SNIPPET's marker positions, saved by `yas--markers-to-points'." + (yas--snippet-map-markers #'copy-marker snippet)) + +(defun yas--maybe-move-to-active-field (snippet) + "Try to move to SNIPPET's active (or first) field and return it if found." + (let ((target-field (or (yas--snippet-active-field snippet) + (car (yas--snippet-fields snippet))))) + (when target-field + (yas--move-to-field snippet target-field) + target-field))) + +(defun yas--field-contains-point-p (field &optional point) + (let ((point (or point + (point)))) + (and (>= point (yas--field-start field)) + (<= point (yas--field-end field))))) + +(defun yas--field-text-for-display (field) + "Return the propertized display text for field FIELD." + (buffer-substring (yas--field-start field) (yas--field-end field))) + +(defun yas--undo-in-progress () + "True if some kind of undo is in progress." + (or undo-in-progress + (eq this-command 'undo) + (eq this-command 'redo))) + +(defun yas--make-control-overlay (snippet start end) + "Create the control overlay that surrounds the snippet and +holds the keymap." + (let ((overlay (make-overlay start + end + nil + nil + t))) + (overlay-put overlay 'keymap yas-keymap) + (overlay-put overlay 'priority yas-overlay-priority) + (overlay-put overlay 'yas--snippet snippet) + overlay)) + +(defun yas-current-field () + "Return the currently active field." + (and yas--active-field-overlay + (overlay-buffer yas--active-field-overlay) + (overlay-get yas--active-field-overlay 'yas--field))) + +(defun yas--maybe-clear-field-filter (cmd) + "Return CMD if at start of unmodified snippet field. +Use as a `:filter' argument for a conditional keybinding." + (let ((field (yas-current-field))) + (when (and field + (not (yas--field-modified-p field)) + (eq (point) (marker-position (yas--field-start field)))) + cmd))) + +(defun yas-skip-and-clear-field (&optional field) + "Clears unmodified FIELD if at field start, skips to next tab." + (interactive) + (yas--skip-and-clear (or field (yas-current-field))) + (yas-next-field 1)) + +(defun yas-skip-and-clear-or-delete-char (&optional field) + "Clears unmodified field if at field start, skips to next tab. + +Otherwise deletes a character normally by calling `delete-char'." + (interactive) + (declare (obsolete "Bind to `yas-maybe-skip-and-clear-field' instead." "0.13")) + (cond ((yas--maybe-clear-field-filter t) + (yas--skip-and-clear (or field (yas-current-field))) + (yas-next-field 1)) + (t (call-interactively 'delete-char)))) + +(defun yas--skip-and-clear (field &optional from) + "Deletes the region of FIELD and sets it's modified state to t. +If given, FROM indicates position to start at instead of FIELD's beginning." + ;; Just before skipping-and-clearing the field, mark its children + ;; fields as modified, too. If the children have mirrors-in-fields + ;; this prevents them from updating erroneously (we're skipping and + ;; deleting!). + ;; + (yas--mark-this-and-children-modified field) + (unless (= (yas--field-start field) (yas--field-end field)) + (delete-region (or from (yas--field-start field)) (yas--field-end field)))) + +(defun yas--mark-this-and-children-modified (field) + (setf (yas--field-modified-p field) t) + (let ((fom (yas--field-next field))) + (while (and fom + (yas--fom-parent-field fom)) + (when (and (eq (yas--fom-parent-field fom) field) + (yas--field-p fom)) + (yas--mark-this-and-children-modified fom)) + (setq fom (yas--fom-next fom))))) + +(defun yas--make-move-active-field-overlay (snippet field) + "Place the active field overlay in SNIPPET's FIELD. + +Move the overlay, or create it if it does not exit." + (if (and yas--active-field-overlay + (overlay-buffer yas--active-field-overlay)) + (move-overlay yas--active-field-overlay + (yas--field-start field) + (yas--field-end field)) + (setq yas--active-field-overlay + (make-overlay (yas--field-start field) + (yas--field-end field) + nil nil t)) + (overlay-put yas--active-field-overlay 'priority yas-overlay-priority) + (overlay-put yas--active-field-overlay 'face 'yas-field-highlight-face) + (overlay-put yas--active-field-overlay 'yas--snippet snippet) + (overlay-put yas--active-field-overlay 'modification-hooks '(yas--on-field-overlay-modification)) + (overlay-put yas--active-field-overlay 'insert-in-front-hooks + '(yas--on-field-overlay-modification)) + (overlay-put yas--active-field-overlay 'insert-behind-hooks + '(yas--on-field-overlay-modification)))) + +(defun yas--skip-and-clear-field-p (field beg _end length) + "Tell if newly modified FIELD should be cleared and skipped. +BEG, END and LENGTH like overlay modification hooks." + (and (= length 0) ; A 0 pre-change length indicates insertion. + (= beg (yas--field-start field)) ; Insertion at field start? + (not (yas--field-modified-p field)))) + +(defun yas--on-field-overlay-modification (overlay after? beg end &optional length) + "Clears the field and updates mirrors, conditionally. + +Only clears the field if it hasn't been modified and point is at +field start. This hook does nothing if an undo is in progress." + (unless (or (not after?) + yas--inhibit-overlay-hooks + (not (overlayp yas--active-field-overlay)) ; Avoid Emacs bug #21824. + ;; If a single change hits multiple overlays of the same + ;; snippet, then we delete the snippet the first time, + ;; and then subsequent calls get a deleted overlay. + ;; Don't delete the snippet again! + (not (overlay-buffer overlay)) + (yas--undo-in-progress)) + (let* ((inhibit-modification-hooks nil) + (yas--inhibit-overlay-hooks t) + (field (overlay-get overlay 'yas--field)) + (snippet (overlay-get yas--active-field-overlay 'yas--snippet))) + (if (yas--snippet-live-p snippet) + (save-match-data + (yas--letenv (yas--snippet-expand-env snippet) + (when (yas--skip-and-clear-field-p field beg end length) + ;; We delete text starting from the END of insertion. + (yas--skip-and-clear field end)) + (setf (yas--field-modified-p field) t) + (yas--advance-end-maybe field (overlay-end overlay)) + (save-excursion + (yas--field-update-display field)) + (yas--update-mirrors snippet))) + (lwarn '(yasnippet zombie) :warning "Killing zombie snippet!") + (delete-overlay overlay))))) + +(defun yas--auto-fill () + (let* ((orig-point (point)) + (end (progn (forward-paragraph) (point))) + (beg (progn (backward-paragraph) (point))) + (snippets (yas-active-snippets beg end)) + (remarkers nil) + (reoverlays nil)) + (dolist (snippet snippets) + (dolist (m (yas--collect-snippet-markers snippet)) + (when (and (<= beg m) (<= m end)) + (push (yas--snapshot-marker-location m beg end) remarkers))) + (push (yas--snapshot-overlay-location + (yas--snippet-control-overlay snippet) beg end) + reoverlays)) + (goto-char orig-point) + (let ((yas--inhibit-overlay-hooks t)) + (if (null yas--original-auto-fill-function) + ;; Try to get more info on #873/919. + (let ((yas--fill-fun-values `((t ,(default-value 'yas--original-auto-fill-function)))) + (fill-fun-values `((t ,(default-value 'auto-fill-function)))) + ;; Listing 2 buffers with the same value is enough + (print-length 3)) + (save-current-buffer + (dolist (buf (let ((bufs (buffer-list))) + ;; List the current buffer first. + (setq bufs (cons (current-buffer) + (remq (current-buffer) bufs))))) + (set-buffer buf) + (let* ((yf-cell (assq yas--original-auto-fill-function + yas--fill-fun-values)) + (af-cell (assq auto-fill-function fill-fun-values))) + (when (local-variable-p 'yas--original-auto-fill-function) + (if yf-cell (setcdr yf-cell (cons buf (cdr yf-cell))) + (push (list yas--original-auto-fill-function buf) yas--fill-fun-values))) + (when (local-variable-p 'auto-fill-function) + (if af-cell (setcdr af-cell (cons buf (cdr af-cell))) + (push (list auto-fill-function buf) fill-fun-values)))))) + (lwarn '(yasnippet auto-fill bug) :error + "`yas--original-auto-fill-function' unexpectedly nil in %S! Disabling auto-fill. + %S + `auto-fill-function': %S\n%s" + (current-buffer) yas--fill-fun-values fill-fun-values + (if (fboundp 'backtrace--print-frame) + (with-output-to-string + (mapc (lambda (frame) + (apply #'backtrace--print-frame frame)) + yas--watch-auto-fill-backtrace)) + "")) + ;; Try to avoid repeated triggering of this bug. + (auto-fill-mode -1) + ;; Don't pop up more than once in a session (still log though). + (defvar warning-suppress-types) ; `warnings' is autoloaded by `lwarn'. + (add-to-list 'warning-suppress-types '(yasnippet auto-fill bug))) + (funcall yas--original-auto-fill-function))) + (save-excursion + (setq end (progn (forward-paragraph) (point))) + (setq beg (progn (backward-paragraph) (point)))) + (save-excursion + (save-restriction + (narrow-to-region beg end) + (mapc #'yas--restore-marker-location remarkers) + (mapc #'yas--restore-overlay-location reoverlays)) + (mapc (lambda (snippet) + (yas--letenv (yas--snippet-expand-env snippet) + (yas--update-mirrors snippet))) + snippets)))) + + +;;; Apropos protection overlays: +;; +;; These exist for nasty users who will try to delete parts of the +;; snippet outside the active field. Actual protection happens in +;; `yas--on-protection-overlay-modification'. +;; +;; As of github #537 this no longer inhibits the command by issuing an +;; error: all the snippets at point, including nested snippets, are +;; automatically commited and the current command can proceed. +;; +(defun yas--make-move-field-protection-overlays (snippet field) + "Place protection overlays surrounding SNIPPET's FIELD. + +Move the overlays, or create them if they do not exit." + (let ((start (yas--field-start field)) + (end (yas--field-end field))) + ;; First check if the (1+ end) is contained in the buffer, + ;; otherwise we'll have to do a bit of cheating and silently + ;; insert a newline. the `(1+ (buffer-size))' should prevent this + ;; when using stacked expansion + ;; + (when (< (buffer-size) end) + (save-excursion + (let ((yas--inhibit-overlay-hooks t)) + (goto-char (point-max)) + (newline)))) + ;; go on to normal overlay creation/moving + ;; + (cond ((and yas--field-protection-overlays + (cl-every #'overlay-buffer yas--field-protection-overlays)) + (move-overlay (nth 0 yas--field-protection-overlays) + (1- start) start) + (move-overlay (nth 1 yas--field-protection-overlays) end (1+ end))) + (t + (setq yas--field-protection-overlays + (list (make-overlay (1- start) start nil t nil) + (make-overlay end (1+ end) nil t nil))) + (dolist (ov yas--field-protection-overlays) + (overlay-put ov 'face 'yas--field-debug-face) + (overlay-put ov 'yas--snippet snippet) + ;; (overlay-put ov 'evaporate t) + (overlay-put ov 'modification-hooks '(yas--on-protection-overlay-modification))))))) + +(defun yas--on-protection-overlay-modification (_overlay after? beg end &optional length) + "Commit the snippet if the protection overlay is being killed." + (unless (or yas--inhibit-overlay-hooks + (not after?) + (= length (- end beg)) ; deletion or insertion + (yas--undo-in-progress)) + (let ((snippets (yas-active-snippets))) + (yas--message 2 "Committing snippets. Action would destroy a protection overlay.") + (cl-loop for snippet in snippets + do (yas--commit-snippet snippet))))) + +(add-to-list 'debug-ignored-errors "^Exit the snippet first!$") + + +;;; Snippet expansion and "stacked" expansion: +;; +;; Stacked expansion is when you try to expand a snippet when already +;; inside a snippet expansion. +;; +;; The parent snippet does not run its fields modification hooks +;; (`yas--on-field-overlay-modification' and +;; `yas--on-protection-overlay-modification') while the child snippet +;; is active. This means, among other things, that the mirrors of the +;; parent snippet are not updated, this only happening when one exits +;; the child snippet. +;; +;; Unfortunately, this also puts some ugly (and not fully-tested) +;; bits of code in `yas-expand-snippet' and +;; `yas--commit-snippet'. I've tried to mark them with "stacked +;; expansion:". +;; +;; This was thought to be safer in an undo/redo perspective, but +;; maybe the correct implementation is to make the globals +;; `yas--active-field-overlay' and `yas--field-protection-overlays' be +;; snippet-local and be active even while the child snippet is +;; running. This would mean a lot of overlay modification hooks +;; running, but if managed correctly (including overlay priorities) +;; they should account for all situations... + +(defun yas-expand-snippet (snippet &optional start end expand-env) + "Expand SNIPPET at current point. + +Text between START and END will be deleted before inserting +template. EXPAND-ENV is a list of (SYM VALUE) let-style dynamic +bindings considered when expanding the snippet. If omitted, use +SNIPPET's expand-env field. + +SNIPPET may be a snippet structure (e.g., as returned by +`yas-lookup-snippet'), or just a snippet body (which is a string +for normal snippets, and a list for command snippets)." + (cl-assert (and yas-minor-mode + (memq 'yas--post-command-handler post-command-hook)) + nil + "[yas] `yas-expand-snippet' needs properly setup `yas-minor-mode'") + (run-hooks 'yas-before-expand-snippet-hook) + + (let* ((clear-field + (let ((field (and yas--active-field-overlay + (overlay-buffer yas--active-field-overlay) + (overlay-get yas--active-field-overlay 'yas--field)))) + (and field (yas--skip-and-clear-field-p + field (point) (point) 0) + field))) + (start (cond (start) + ((region-active-p) + (region-beginning)) + (clear-field + (yas--field-start clear-field)) + (t (point)))) + (end (cond (end) + ((region-active-p) + (region-end)) + (clear-field + (yas--field-end clear-field)) + (t (point)))) + (to-delete (and (> end start) + (buffer-substring-no-properties start end))) + (yas-selected-text + (cond (yas-selected-text) + ((and (region-active-p) + (not clear-field)) + to-delete)))) + (goto-char start) + (setq yas--indent-original-column (current-column)) + ;; Delete the region to delete, this *does* get undo-recorded. + (when to-delete + (delete-region start end)) + + (let ((content (if (yas--template-p snippet) + (yas--template-content snippet) + snippet))) + (when (and (not expand-env) (yas--template-p snippet)) + (setq expand-env (yas--template-expand-env snippet))) + (cond ((listp content) + ;; x) This is a snippet-command. + (yas--eval-for-effect content)) + (t + ;; x) This is a snippet-snippet :-) + (setq yas--start-column (current-column)) + ;; Stacked expansion: also shoosh the overlay modification hooks. + (let ((yas--inhibit-overlay-hooks t)) + (setq snippet + (yas--snippet-create content expand-env start (point)))) + + ;; Stacked-expansion: This checks for stacked expansion, save the + ;; `yas--previous-active-field' and advance its boundary. + (let ((existing-field (and yas--active-field-overlay + (overlay-buffer yas--active-field-overlay) + (overlay-get yas--active-field-overlay 'yas--field)))) + (when existing-field + (setf (yas--snippet-previous-active-field snippet) existing-field) + (yas--advance-end-maybe existing-field (overlay-end yas--active-field-overlay)))) + + ;; Exit the snippet immediately if no fields. + (unless (yas--snippet-fields snippet) + (yas-exit-snippet snippet)) + + ;; Now, schedule a move to the first field. + (let ((first-field (car (yas--snippet-fields snippet)))) + (when first-field + (sit-for 0) ;; fix issue 125 + (yas--letenv (yas--snippet-expand-env snippet) + (yas--move-to-field snippet first-field)) + (when (and (eq (yas--field-number first-field) 0) + (> (length (yas--field-text-for-display + first-field)) + 0)) + ;; Keep region for ${0:exit text}. + (setq deactivate-mark nil)))) + (yas--message 4 "snippet %d expanded." (yas--snippet-id snippet)) + t))))) + +(defun yas--take-care-of-redo (snippet) + "Commits SNIPPET, which in turn pushes an undo action for reviving it. + +Meant to exit in the `buffer-undo-list'." + ;; slightly optimize: this action is only needed for snippets with + ;; at least one field + (when (yas--snippet-fields snippet) + (yas--commit-snippet snippet))) + +(defun yas--snippet-revive (beg end snippet) + "Revives SNIPPET and creates a control overlay from BEG to END. + +BEG and END are, we hope, the original snippets boundaries. +All the markers/points exiting existing inside SNIPPET should point +to their correct locations *at the time the snippet is revived*. + +After revival, push the `yas--take-care-of-redo' in the +`buffer-undo-list'" + ;; Reconvert all the points to markers + (yas--points-to-markers snippet) + ;; When at least one editable field existed in the zombie snippet, + ;; try to revive the whole thing... + (when (yas--maybe-move-to-active-field snippet) + (setf (yas--snippet-control-overlay snippet) (yas--make-control-overlay snippet beg end)) + (overlay-put (yas--snippet-control-overlay snippet) 'yas--snippet snippet) + (when (listp buffer-undo-list) + (push `(apply yas--take-care-of-redo ,snippet) + buffer-undo-list)))) + +(defun yas--snippet-create (content expand-env begin end) + "Create a snippet from a template inserted at BEGIN to END. + +Returns the newly created snippet." + (save-restriction + (let ((snippet (yas--make-snippet expand-env))) + (yas--letenv expand-env + ;; Put a single undo action for the expanded snippet's + ;; content. + (let ((buffer-undo-list t)) + ;; Some versions of cc-mode fail when inserting snippet + ;; content in a narrowed buffer. + (goto-char begin) + (insert content) + (setq end (+ end (length content))) + (narrow-to-region begin end) + (goto-char (point-min)) + (yas--snippet-parse-create snippet)) + (when (listp buffer-undo-list) + (push (cons (point-min) (point-max)) + buffer-undo-list)) + + ;; Indent, collecting undo information normally. + (yas--indent snippet) + + ;; Follow up with `yas--take-care-of-redo' on the newly + ;; inserted snippet boundaries. + (when (listp buffer-undo-list) + (push `(apply yas--take-care-of-redo ,snippet) + buffer-undo-list)) + + ;; Sort and link each field + (yas--snippet-sort-fields snippet) + + ;; Create keymap overlay for snippet + (setf (yas--snippet-control-overlay snippet) + (yas--make-control-overlay snippet (point-min) (point-max))) + + ;; Move to end + (goto-char (point-max)) + + (push snippet yas--active-snippets) + snippet)))) + + +;;; Apropos adjacencies and "fom's": +;; +;; Once the $-constructs bits like "$n" and "${:n" are deleted in the +;; recently expanded snippet, we might actually have many fields, +;; mirrors (and the snippet exit) in the very same position in the +;; buffer. Therefore we need to single-link the +;; fields-or-mirrors-or-exit (which I have abbreviated to "fom") +;; according to their original positions in the buffer. +;; +;; Then we have operation `yas--advance-end-maybe' and +;; `yas--advance-start-maybe', which conditionally push the starts and +;; ends of these foms down the chain. +;; +;; This allows for like the printf with the magic ",": +;; +;; printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);")} \ +;; $2${1:$(if (string-match "%" text) "\);" "")}$0 +;; +(defun yas--fom-start (fom) + (cond ((yas--field-p fom) + (yas--field-start fom)) + ((yas--mirror-p fom) + (yas--mirror-start fom)) + (t + (yas--exit-marker fom)))) + +(defun yas--fom-end (fom) + (cond ((yas--field-p fom) + (yas--field-end fom)) + ((yas--mirror-p fom) + (yas--mirror-end fom)) + (t + (yas--exit-marker fom)))) + +(defun yas--fom-next (fom) + (cond ((yas--field-p fom) + (yas--field-next fom)) + ((yas--mirror-p fom) + (yas--mirror-next fom)) + (t + (yas--exit-next fom)))) + +(defun yas--fom-parent-field (fom) + (cond ((yas--field-p fom) + (yas--field-parent-field fom)) + ((yas--mirror-p fom) + (yas--mirror-parent-field fom)) + (t + nil))) + +(defun yas--calculate-adjacencies (snippet) + "Calculate adjacencies for fields or mirrors of SNIPPET. + +This is according to their relative positions in the buffer, and +has to be called before the $-constructs are deleted." + (let* ((fom-set-next-fom + (lambda (fom nextfom) + (cond ((yas--field-p fom) + (setf (yas--field-next fom) nextfom)) + ((yas--mirror-p fom) + (setf (yas--mirror-next fom) nextfom)) + (t + (setf (yas--exit-next fom) nextfom))))) + (compare-fom-begs + (lambda (fom1 fom2) + (if (= (yas--fom-start fom2) (yas--fom-start fom1)) + (yas--mirror-p fom2) + (>= (yas--fom-start fom2) (yas--fom-start fom1))))) + (link-foms fom-set-next-fom)) + ;; make some yas--field, yas--mirror and yas--exit soup + (let ((soup)) + (when (yas--snippet-exit snippet) + (push (yas--snippet-exit snippet) soup)) + (dolist (field (yas--snippet-fields snippet)) + (push field soup) + (dolist (mirror (yas--field-mirrors field)) + (push mirror soup))) + (setq soup + (sort soup compare-fom-begs)) + (when soup + (cl-reduce link-foms soup))))) + +(defun yas--calculate-simple-fom-parentage (snippet fom) + "Discover if FOM is parented by some field in SNIPPET. + +Use the tightest containing field if more than one field contains +the mirror. Intended to be called *before* the dollar-regions are +deleted." + (let ((min (point-min)) + (max (point-max))) + (dolist (field (remq fom (yas--snippet-fields snippet))) + (when (and (<= (yas--field-start field) (yas--fom-start fom)) + (<= (yas--fom-end fom) (yas--field-end field)) + (< min (yas--field-start field)) + (< (yas--field-end field) max)) + (setq min (yas--field-start field) + max (yas--field-end field)) + (cond ((yas--field-p fom) + (setf (yas--field-parent-field fom) field)) + ((yas--mirror-p fom) + (setf (yas--mirror-parent-field fom) field)) + (t ; it's an exit, so noop + nil )))))) + +(defun yas--advance-end-maybe (fom newend) + "Maybe advance FOM's end to NEWEND if it needs it. + +If it does, also: + +* call `yas--advance-start-maybe' on FOM's next fom. + +* in case FOM is field call `yas--advance-end-maybe' on its parent + field + +Also, if FOM is an exit-marker, always call +`yas--advance-start-maybe' on its next fom. This is because +exit-marker have identical start and end markers." + (cond ((and fom (< (yas--fom-end fom) newend)) + (set-marker (yas--fom-end fom) newend) + (yas--advance-start-maybe (yas--fom-next fom) newend) + (yas--advance-end-of-parents-maybe (yas--fom-parent-field fom) newend)) + ((yas--exit-p fom) + (yas--advance-start-maybe (yas--fom-next fom) newend)))) + +(defun yas--advance-start-maybe (fom newstart) + "Maybe advance FOM's start to NEWSTART if it needs it. + +If it does, also call `yas--advance-end-maybe' on FOM." + (when (and fom (< (yas--fom-start fom) newstart)) + (set-marker (yas--fom-start fom) newstart) + (yas--advance-end-maybe fom newstart))) + +(defun yas--advance-end-of-parents-maybe (field newend) + "Like `yas--advance-end-maybe' but for parent fields. + +Only works for fields and doesn't care about the start of the +next FOM. Works its way up recursively for parents of parents." + (when (and field + (< (yas--field-end field) newend)) + (set-marker (yas--field-end field) newend) + (yas--advance-end-of-parents-maybe (yas--field-parent-field field) newend))) + +(defvar yas--dollar-regions nil + "When expanding the snippet the \"parse-create\" functions add +cons cells to this var.") + +(defvar yas--indent-markers nil + "List of markers for manual indentation.") + +(defun yas--snippet-parse-create (snippet) + "Parse a recently inserted snippet template, creating all +necessary fields, mirrors and exit points. + +Meant to be called in a narrowed buffer, does various passes" + (let ((saved-quotes nil) + (parse-start (point))) + ;; Avoid major-mode's syntax propertizing function, since we + ;; change the syntax-table while calling `scan-sexps'. + (let ((syntax-propertize-function nil)) + (setq yas--dollar-regions nil) ; Reset the yas--dollar-regions. + (yas--protect-escapes nil '(?`)) ; Protect just the backquotes. + (goto-char parse-start) + (setq saved-quotes (yas--save-backquotes)) ; `expressions`. + (yas--protect-escapes) ; Protect escaped characters. + (goto-char parse-start) + (yas--indent-parse-create) ; Parse indent markers: `$>'. + (goto-char parse-start) + (yas--field-parse-create snippet) ; Parse fields with {}. + (goto-char parse-start) + (yas--simple-fom-create snippet) ; Parse simple mirrors & fields. + (goto-char parse-start) + (yas--transform-mirror-parse-create snippet) ; Parse mirror transforms. + ;; Invalidate any syntax-propertizing done while + ;; `syntax-propertize-function' was nil. + (syntax-ppss-flush-cache parse-start)) + ;; Set "next" links of fields & mirrors. + (yas--calculate-adjacencies snippet) + (yas--save-restriction-and-widen ; Delete $-constructs. + (yas--delete-regions yas--dollar-regions)) + ;; Make sure to do this insertion *after* deleting the dollar + ;; regions, otherwise we invalidate the calculated positions of + ;; all the fields following $0. + (let ((exit (yas--snippet-exit snippet))) + (goto-char (if exit (yas--exit-marker exit) (point-max)))) + (when (eq yas-wrap-around-region 'cua) + (setq yas-wrap-around-region ?0)) + (cond ((and yas-wrap-around-region yas-selected-text) + (insert yas-selected-text)) + ((and (characterp yas-wrap-around-region) + (get-register yas-wrap-around-region)) + (insert (prog1 (get-register yas-wrap-around-region) + (set-register yas-wrap-around-region nil))))) + (yas--restore-backquotes saved-quotes) ; Restore `expression` values. + (goto-char parse-start) + (yas--restore-escapes) ; Restore escapes. + (yas--update-mirrors snippet) ; Update mirrors for the first time. + (goto-char parse-start))) + +;; HACK: Some implementations of `indent-line-function' (called via +;; `indent-according-to-mode') delete text before they insert (like +;; cc-mode), some make complicated regexp replacements (looking at +;; you, org-mode). To find place where the marker "should" go after +;; indentation, we create a regexp based on what the line looks like +;; before, putting a capture group where the marker is. The regexp +;; matches any whitespace with [[:space:]]* to allow for the +;; indentation changing whitespace. Additionally, we try to preserve +;; the amount of whitespace *following* the marker, because +;; indentation generally affects whitespace at the beginning, not the +;; end. +;; +;; Two other cases where we apply a similar strategy: +;; +;; 1. Handling `auto-fill-mode', in this case we need to use the +;; current paragraph instead of line. +;; +;; 2. Moving snippets from an `org-src' temp buffer into the main org +;; buffer, in this case we need to count the line offsets (because org +;; may add indentation on each line making character positions +;; unreliable). +;; +;; This is all best-effort heuristic stuff, but it should cover 99% of +;; use-cases. + +(defun yas--snapshot-marker-location (marker &optional beg end) + "Returns info for restoring MARKER's location after indent. +The returned value is a list of the form (MARKER REGEXP WS-COUNT)." + (unless beg (setq beg (line-beginning-position))) + (unless end (setq end (line-end-position))) + (let ((before (split-string (buffer-substring-no-properties beg marker) + "[[:space:]\n]+" t)) + (after (split-string (buffer-substring-no-properties marker end) + "[[:space:]\n]+" t))) + (list marker + (concat "[[:space:]\n]*" + (mapconcat (lambda (s) + (if (eq s marker) "\\(\\)" + (regexp-quote s))) + (nconc before (list marker) after) + "[[:space:]\n]*")) + (progn (goto-char marker) + (skip-chars-forward "[:space:]\n" end) + (- (point) marker))))) + +(defun yas--snapshot-overlay-location (overlay beg end) + "Like `yas--snapshot-marker-location' for overlays. +The returned format is (OVERLAY (RE WS) (RE WS)). Either of +the (RE WS) lists may be nil if the start or end, respectively, +of the overlay is outside the range BEG .. END." + (let ((obeg (overlay-start overlay)) + (oend (overlay-end overlay))) + (list overlay + (when (and (<= beg obeg) (< obeg end)) + (cdr (yas--snapshot-marker-location obeg beg end))) + (when (and (<= beg oend) (< oend end)) + (cdr (yas--snapshot-marker-location oend beg end)))))) + +(defun yas--snapshot-overlay-line-location (overlay) + "Return info for restoring OVERLAY's line based location. +The returned format is (OVERLAY (LINE RE WS) (LINE RE WS))." + (let ((loc-beg (progn (goto-char (overlay-start overlay)) + (yas--snapshot-marker-location (point)))) + (loc-end (progn (goto-char (overlay-end overlay)) + (yas--snapshot-marker-location (point))))) + (setcar loc-beg (count-lines (point-min) (progn (goto-char (car loc-beg)) + (line-beginning-position)))) + (setcar loc-end (count-lines (point-min) (progn (goto-char (car loc-end)) + (line-beginning-position)))) + (list overlay loc-beg loc-end))) + +(defun yas--goto-saved-location (regexp ws-count) + "Move point to location saved by `yas--snapshot-marker-location'. +Buffer must be narrowed to BEG..END used to create the snapshot info." + (goto-char (point-min)) + (if (not (looking-at regexp)) + (lwarn '(yasnippet re-marker) :warning + "Couldn't find: %S" regexp) + (goto-char (match-beginning 1)) + (skip-chars-forward "[:space:]\n") + (skip-chars-backward "[:space:]\n" (- (point) ws-count)))) + +(defun yas--restore-marker-location (re-marker) + "Restores marker based on info from `yas--snapshot-marker-location'. +Buffer must be narrowed to BEG..END used to create the snapshot info." + (apply #'yas--goto-saved-location (cdr re-marker)) + (set-marker (car re-marker) (point))) + +(defun yas--restore-overlay-location (ov-locations) + "Restores marker based on info from `yas--snapshot-marker-location'. +Buffer must be narrowed to BEG..END used to create the snapshot info." + (cl-destructuring-bind (overlay loc-beg loc-end) ov-locations + (move-overlay overlay + (if (not loc-beg) (overlay-start overlay) + (apply #'yas--goto-saved-location loc-beg) + (point)) + (if (not loc-end) (overlay-end overlay) + (apply #'yas--goto-saved-location loc-end) + (point))))) + + +(defun yas--restore-overlay-line-location (ov-locations) + "Restores overlay based on info from `yas--snapshot-overlay-line-location'." + (save-restriction + (move-overlay (car ov-locations) + (save-excursion + (forward-line (car (nth 1 ov-locations))) + (narrow-to-region (line-beginning-position) (line-end-position)) + (apply #'yas--goto-saved-location (cdr (nth 1 ov-locations))) + (point)) + (save-excursion + (forward-line (car (nth 2 ov-locations))) + (narrow-to-region (line-beginning-position) (line-end-position)) + (apply #'yas--goto-saved-location (cdr (nth 2 ov-locations))) + (point))))) + +(defun yas--indent-region (from to snippet) + "Indent the lines between FROM and TO with `indent-according-to-mode'. +The SNIPPET's markers are preserved." + (save-excursion + (yas--save-restriction-and-widen + (let* ((snippet-markers (yas--collect-snippet-markers snippet)) + (to (set-marker (make-marker) to))) + (goto-char from) + (cl-loop for bol = (line-beginning-position) + for eol = (line-end-position) + if (or yas-also-indent-empty-lines + (/= bol eol)) + do + ;; Indent each non-empty line. + (let ((remarkers nil)) + (dolist (m snippet-markers) + (when (and (<= bol m) (<= m eol)) + (push (yas--snapshot-marker-location m bol eol) + remarkers))) + (unwind-protect + (progn (back-to-indentation) + (indent-according-to-mode)) + (save-restriction + (narrow-to-region bol (line-end-position)) + (mapc #'yas--restore-marker-location remarkers)))) + while (and (zerop (forward-line 1)) + (< (point) to))))))) + +(defvar yas--indent-original-column nil) +(defun yas--indent (snippet) + ;; Indent lines that had indent markers (`$>') on them. + (save-excursion + (dolist (marker yas--indent-markers) + (unless (eq yas-indent-line 'auto) + (goto-char marker) + (yas--indent-region (line-beginning-position) + (line-end-position) + snippet)) + ;; Finished with this marker. + (set-marker marker nil)) + (setq yas--indent-markers nil)) + ;; Now do stuff for `fixed' and `auto'. + (save-excursion + ;; We need to be at end of line, so that `forward-line' will only + ;; report 0 if it actually moves over a newline. + (end-of-line) + (cond ((eq yas-indent-line 'fixed) + (when (= (forward-line 1) 0) + (let ((indent-line-function + (lambda () + ;; We need to be at beginning of line in order to + ;; indent existing whitespace correctly. + (beginning-of-line) + (indent-to-column yas--indent-original-column)))) + (yas--indent-region (line-beginning-position) + (point-max) + snippet)))) + ((eq yas-indent-line 'auto) + (when (or yas-also-auto-indent-first-line + (= (forward-line 1) 0)) + (yas--indent-region (line-beginning-position) + (point-max) + snippet)))))) + +(defun yas--collect-snippet-markers (snippet) + "Make a list of all the markers used by SNIPPET." + (let (markers) + (yas--snippet-map-markers (lambda (m) (push m markers) m) snippet) + markers)) + +(defun yas--escape-string (escaped) + (concat "YASESCAPE" (format "%d" escaped) "PROTECTGUARD")) + +(defun yas--protect-escapes (&optional text escaped) + "Protect all escaped characters with their numeric ASCII value. + +With optional string TEXT do it in string instead of buffer." + (let ((changed-text text) + (text-provided-p text)) + (mapc #'(lambda (escaped) + (setq changed-text + (yas--replace-all (concat "\\" (char-to-string escaped)) + (yas--escape-string escaped) + (when text-provided-p changed-text)))) + (or escaped yas--escaped-characters)) + changed-text)) + +(defun yas--restore-escapes (&optional text escaped) + "Restore all escaped characters from their numeric ASCII value. + +With optional string TEXT do it in string instead of the buffer." + (let ((changed-text text) + (text-provided-p text)) + (mapc #'(lambda (escaped) + (setq changed-text + (yas--replace-all (yas--escape-string escaped) + (char-to-string escaped) + (when text-provided-p changed-text)))) + (or escaped yas--escaped-characters)) + changed-text)) + +(defun yas--save-backquotes () + "Save all \"\\=`(lisp-expression)\\=`\"-style expressions. +Return a list of (MARKER . STRING) entires for each backquoted +Lisp expression." + (let* ((saved-quotes nil) + (yas--snippet-buffer (current-buffer)) + (yas--change-detected nil) + (detect-change (lambda (_beg _end) + (when (eq (current-buffer) yas--snippet-buffer) + (setq yas--change-detected t))))) + (while (re-search-forward yas--backquote-lisp-expression-regexp nil t) + (let ((current-string (match-string-no-properties 1)) transformed) + (yas--save-restriction-and-widen + (delete-region (match-beginning 0) (match-end 0))) + (let ((before-change-functions + (cons detect-change before-change-functions))) + (setq transformed (yas--eval-for-string (yas--read-lisp + (yas--restore-escapes + current-string '(?`)))))) + (goto-char (match-beginning 0)) + (when transformed + (let ((marker (make-marker)) + (before-change-functions (cdr before-change-functions))) + (yas--save-restriction-and-widen + (insert "Y") ;; quite horrendous, I love it :) + (set-marker marker (point)) + (insert "Y")) + (push (cons marker transformed) saved-quotes))))) + (when yas--change-detected + (lwarn '(yasnippet backquote-change) :warning + "`%s' modified buffer in a backquote expression. + To hide this warning, add (yasnippet backquote-change) to `warning-suppress-types'." + (if yas--current-template + (yas--template-name yas--current-template) + "Snippet"))) + saved-quotes)) + +(defun yas--restore-backquotes (saved-quotes) + "Replace markers in SAVED-QUOTES with their values. +SAVED-QUOTES is the in format returned by `yas--save-backquotes'." + (cl-loop for (marker . string) in saved-quotes do + (save-excursion + (goto-char marker) + (yas--save-restriction-and-widen + (delete-char -1) + (insert string) + (delete-char 1)) + (set-marker marker nil)))) + +(defun yas--scan-sexps (from count) + (ignore-errors + (save-match-data ; `scan-sexps' may modify match data. + (with-syntax-table (standard-syntax-table) + (let ((parse-sexp-lookup-properties nil)) + (scan-sexps from count)))))) + +(defun yas--make-marker (pos) + "Create a marker at POS with nil `marker-insertion-type'." + (let ((marker (set-marker (make-marker) pos))) + (set-marker-insertion-type marker nil) + marker)) + +(defun yas--indent-parse-create () + "Parse the \"$>\" indentation markers just inserted." + (setq yas--indent-markers ()) + (while (search-forward "$>" nil t) + (delete-region (match-beginning 0) (match-end 0)) + ;; Mark the beginning of the line. + (push (yas--make-marker (line-beginning-position)) + yas--indent-markers)) + (setq yas--indent-markers (nreverse yas--indent-markers))) + +(defun yas--field-parse-create (snippet &optional parent-field) + "Parse most field expressions in SNIPPET, except for the simple one \"$n\". + +The following count as a field: + +* \"${n: text}\", for a numbered field with default text, as long as N is not 0; + +* \"${n: text$(expression)}, the same with a Lisp expression; + this is caught with the curiously named `yas--multi-dollar-lisp-expression-regexp' + +* the same as above but unnumbered, (no N:) and number is calculated automatically. + +When multiple expressions are found, only the last one counts." + ;; + (save-excursion + (while (re-search-forward yas--field-regexp nil t) + (let* ((real-match-end-0 (yas--scan-sexps (1+ (match-beginning 0)) 1)) + (number (and (match-string-no-properties 1) + (string-to-number (match-string-no-properties 1)))) + (brand-new-field (and real-match-end-0 + ;; break if on "$(" immediately + ;; after the ":", this will be + ;; caught as a mirror with + ;; transform later. + (not (string-match-p "\\`\\$[ \t\n]*(" + (match-string-no-properties 2))) + ;; allow ${0: some exit text} + ;; (not (and number (zerop number))) + (yas--make-field number + (yas--make-marker (match-beginning 2)) + (yas--make-marker (1- real-match-end-0)) + parent-field)))) + (when brand-new-field + (goto-char real-match-end-0) + (push (cons (1- real-match-end-0) real-match-end-0) + yas--dollar-regions) + (push (cons (match-beginning 0) (match-beginning 2)) + yas--dollar-regions) + (push brand-new-field (yas--snippet-fields snippet)) + (save-excursion + (save-restriction + (narrow-to-region (yas--field-start brand-new-field) (yas--field-end brand-new-field)) + (goto-char (point-min)) + (yas--field-parse-create snippet brand-new-field))))))) + ;; if we entered from a parent field, now search for the + ;; `yas--multi-dollar-lisp-expression-regexp'. This is used for + ;; primary field transformations + ;; + (when parent-field + (save-excursion + (while (re-search-forward yas--multi-dollar-lisp-expression-regexp nil t) + (let* ((real-match-end-1 (yas--scan-sexps (match-beginning 1) 1))) + ;; commit the primary field transformation if: + ;; + ;; 1. we don't find it in yas--dollar-regions (a subnested + ;; field) might have already caught it. + ;; + ;; 2. we really make sure we have either two '$' or some + ;; text and a '$' after the colon ':'. This is a FIXME: work + ;; my regular expressions and end these ugly hacks. + ;; + (when (and real-match-end-1 + (not (member (cons (match-beginning 0) + real-match-end-1) + yas--dollar-regions)) + (not (eq ?: + (char-before (1- (match-beginning 1)))))) + (let ((lisp-expression-string (buffer-substring-no-properties (match-beginning 1) + real-match-end-1))) + (setf (yas--field-transform parent-field) + (yas--read-lisp (yas--restore-escapes lisp-expression-string)))) + (push (cons (match-beginning 0) real-match-end-1) + yas--dollar-regions))))))) + +(defun yas--transform-mirror-parse-create (snippet) + "Parse the \"${n:$(lisp-expression)}\" mirror transformations in SNIPPET." + (while (re-search-forward yas--transform-mirror-regexp nil t) + (let* ((real-match-end-0 (yas--scan-sexps (1+ (match-beginning 0)) 1)) + (number (string-to-number (match-string-no-properties 1))) + (field (and number + (not (zerop number)) + (yas--snippet-find-field snippet number))) + (brand-new-mirror + (and real-match-end-0 + field + (yas--make-mirror (yas--make-marker (match-beginning 0)) + (yas--make-marker (match-beginning 0)) + (yas--read-lisp + (yas--restore-escapes + (buffer-substring-no-properties (match-beginning 2) + (1- real-match-end-0)))))))) + (when brand-new-mirror + (push brand-new-mirror + (yas--field-mirrors field)) + (yas--calculate-simple-fom-parentage snippet brand-new-mirror) + (push (cons (match-beginning 0) real-match-end-0) yas--dollar-regions))))) + +(defun yas--simple-fom-create (snippet) + "Parse the simple \"$n\" fields/mirrors/exitmarkers in SNIPPET." + (while (re-search-forward yas--simple-mirror-regexp nil t) + (let ((number (string-to-number (match-string-no-properties 1)))) + (cond ((zerop number) + (setf (yas--snippet-exit snippet) + (yas--make-exit (yas--make-marker (match-end 0)))) + (push (cons (match-beginning 0) (yas--exit-marker (yas--snippet-exit snippet))) + yas--dollar-regions)) + (t + (let ((field (yas--snippet-find-field snippet number)) + (fom)) + (if field + (push + (setq fom (yas--make-mirror + (yas--make-marker (match-beginning 0)) + (yas--make-marker (match-beginning 0)) + nil)) + (yas--field-mirrors field)) + (push + (setq fom (yas--make-field number + (yas--make-marker (match-beginning 0)) + (yas--make-marker (match-beginning 0)) + nil)) + (yas--snippet-fields snippet))) + (yas--calculate-simple-fom-parentage snippet fom)) + (push (cons (match-beginning 0) (match-end 0)) + yas--dollar-regions)))))) + +(defun yas--delete-regions (regions) + "Sort disjuct REGIONS by start point, then delete from the back." + (mapc #'(lambda (reg) + (delete-region (car reg) (cdr reg))) + (sort regions + #'(lambda (r1 r2) + (>= (car r1) (car r2)))))) + +(defun yas--calculate-mirror-depth (mirror &optional traversed) + (let* ((parent (yas--mirror-parent-field mirror)) + (parents-mirrors (and parent + (yas--field-mirrors parent)))) + (or (yas--mirror-depth mirror) + (setf (yas--mirror-depth mirror) + (cond ((memq mirror traversed) 0) + ((and parent parents-mirrors) + (1+ (cl-reduce + #'max parents-mirrors + :key (lambda (m) + (yas--calculate-mirror-depth + m (cons mirror traversed)))))) + (parent 1) + (t 0)))))) + +(defun yas--update-mirrors (snippet) + "Update all the mirrors of SNIPPET." + (yas--save-restriction-and-widen + (save-excursion + (cl-loop + for (field . mirror) + in (cl-sort + ;; Make a list of (FIELD . MIRROR). + (cl-mapcan (lambda (field) + (mapcar (lambda (mirror) + (cons field mirror)) + (yas--field-mirrors field))) + (yas--snippet-fields snippet)) + ;; Then sort this list so that entries with mirrors with + ;; parent fields appear before. This was important for + ;; fixing #290, and also handles the case where a mirror in + ;; a field causes another mirror to need reupdating. + #'> :key (lambda (fm) (yas--calculate-mirror-depth (cdr fm)))) + ;; Before updating a mirror with a parent-field, maybe advance + ;; its start (#290). + do (let ((parent-field (yas--mirror-parent-field mirror))) + (when parent-field + (yas--advance-start-maybe mirror (yas--fom-start parent-field)))) + ;; Update this mirror. + do (yas--mirror-update-display mirror field) + ;; Delay indenting until we're done all mirrors. We must do + ;; this to avoid losing whitespace between fields that are + ;; still empty (i.e., they will be non-empty after updating). + when (eq yas-indent-line 'auto) + collect (cons (yas--mirror-start mirror) (yas--mirror-end mirror)) + into indent-regions + ;; `yas--place-overlays' is needed since the active field and + ;; protected overlays might have been changed because of insertions + ;; in `yas--mirror-update-display'. + do (let ((active-field (yas--snippet-active-field snippet))) + (when active-field (yas--place-overlays snippet active-field))) + finally do + (let ((yas--inhibit-overlay-hooks t)) + (cl-loop for (beg . end) in (cl-sort indent-regions #'< :key #'car) + do (yas--indent-region beg end snippet))))))) + +(defun yas--mirror-update-display (mirror field) + "Update MIRROR according to FIELD (and mirror transform)." + + (let* ((mirror-parent-field (yas--mirror-parent-field mirror)) + (reflection (and (not (and mirror-parent-field + (yas--field-modified-p mirror-parent-field))) + (or (yas--apply-transform mirror field 'empty-on-nil) + (yas--field-text-for-display field))))) + (when (and reflection + (not (string= reflection (buffer-substring-no-properties (yas--mirror-start mirror) + (yas--mirror-end mirror))))) + (goto-char (yas--mirror-start mirror)) + (let ((yas--inhibit-overlay-hooks t)) + (insert reflection)) + (if (> (yas--mirror-end mirror) (point)) + (delete-region (point) (yas--mirror-end mirror)) + (set-marker (yas--mirror-end mirror) (point)) + (yas--advance-start-maybe (yas--mirror-next mirror) (point)) + ;; super-special advance + (yas--advance-end-of-parents-maybe mirror-parent-field (point)))))) + +(defun yas--field-update-display (field) + "Much like `yas--mirror-update-display', but for fields." + (when (yas--field-transform field) + (let ((transformed (and (not (eq (yas--field-number field) 0)) + (yas--apply-transform field field)))) + (when (and transformed + (not (string= transformed (buffer-substring-no-properties (yas--field-start field) + (yas--field-end field))))) + (setf (yas--field-modified-p field) t) + (goto-char (yas--field-start field)) + (let ((yas--inhibit-overlay-hooks t)) + (insert transformed) + (if (> (yas--field-end field) (point)) + (delete-region (point) (yas--field-end field)) + (set-marker (yas--field-end field) (point)) + (yas--advance-start-maybe (yas--field-next field) (point))) + t))))) + + +;;; Post-command hook: +;; +(defun yas--post-command-handler () + "Handles various yasnippet conditions after each command." + (when (and yas--watch-auto-fill-backtrace + (fboundp 'backtrace--print-frame) + (null yas--original-auto-fill-function) + (eq auto-fill-function 'yas--auto-fill)) + (lwarn '(yasnippet auto-fill bug) :error + "`yas--original-auto-fill-function' unexpectedly nil! Please report this backtrace\n%S" + (with-output-to-string + (mapc #'backtrace--print-frame + yas--watch-auto-fill-backtrace))) + ;; Don't pop up more than once in a session (still log though). + (defvar warning-suppress-types) ; `warnings' is autoloaded by `lwarn'. + (add-to-list 'warning-suppress-types '(yasnippet auto-fill bug))) + (condition-case err + (progn (yas--finish-moving-snippets) + (cond ((eq 'undo this-command) + ;; + ;; After undo revival the correct field is sometimes not + ;; restored correctly, this condition handles that + ;; + (let* ((snippet (car (yas-active-snippets))) + (target-field + (and snippet + (cl-find-if-not + (lambda (field) + (yas--field-probably-deleted-p snippet field)) + (remq nil + (cons (yas--snippet-active-field snippet) + (yas--snippet-fields snippet))))))) + (when target-field + (yas--move-to-field snippet target-field)))) + ((not (yas--undo-in-progress)) + ;; When not in an undo, check if we must commit the snippet + ;; (user exited it). + (yas--check-commit-snippet)))) + ((debug error) (signal (car err) (cdr err))))) + +;;; Fancy docs: +;; +;; The docstrings for some functions are generated dynamically +;; depending on the context. +;; +(put 'yas-expand 'function-documentation + '(yas--expand-from-trigger-key-doc t)) +(defun yas--expand-from-trigger-key-doc (context) + "A doc synthesizer for `yas--expand-from-trigger-key-doc'." + (let* ((yas-fallback-behavior (and context yas-fallback-behavior)) + (fallback-description + (cond ((eq yas-fallback-behavior 'call-other-command) + (let* ((fallback (yas--keybinding-beyond-yasnippet))) + (or (and fallback + (format "call command `%s'." + (pp-to-string fallback))) + "do nothing (`yas-expand' doesn't override\nanything)."))) + ((eq yas-fallback-behavior 'return-nil) + "do nothing.") + (t "defer to `yas-fallback-behavior' (which see).")))) + (concat "Expand a snippet before point. If no snippet +expansion is possible, " + fallback-description + "\n\nOptional argument FIELD is for non-interactive use and is an +object satisfying `yas--field-p' to restrict the expansion to."))) + +(put 'yas-expand-from-keymap 'function-documentation + '(yas--expand-from-keymap-doc t)) +(defun yas--expand-from-keymap-doc (context) + "A doc synthesizer for `yas--expand-from-keymap-doc'." + (add-hook 'temp-buffer-show-hook #'yas--snippet-description-finish-runonce) + (concat "Expand/run snippets from keymaps, possibly falling back to original binding.\n" + (when (and context (eq this-command 'describe-key)) + (let* ((vec (this-single-command-keys)) + (templates (cl-mapcan (lambda (table) + (yas--fetch table vec)) + (yas--get-snippet-tables))) + (yas--direct-keymaps nil) + (fallback (key-binding vec))) + (concat "In this case, " + (when templates + (concat "these snippets are bound to this key:\n" + (yas--template-pretty-list templates) + "\n\nIf none of these expands, ")) + (or (and fallback + (format "fallback `%s' will be called." (pp-to-string fallback))) + "no fallback keybinding is called.")))))) + +(defun yas--template-pretty-list (templates) + (let ((acc) + (yas-buffer-local-condition 'always)) + (dolist (plate templates) + (setq acc (concat acc "\n*) " + (propertize (concat "\\\\snippet `" (car plate) "'") + 'yasnippet (cdr plate))))) + acc)) + +(define-button-type 'help-snippet-def + :supertype 'help-xref + 'help-function (lambda (template) (yas--visit-snippet-file-1 template)) + 'help-echo (purecopy "mouse-2, RET: find snippets's definition")) + +(defun yas--snippet-description-finish-runonce () + "Final adjustments for the help buffer when snippets are concerned." + (yas--create-snippet-xrefs) + (remove-hook 'temp-buffer-show-hook + #'yas--snippet-description-finish-runonce)) + +(defun yas--create-snippet-xrefs () + (save-excursion + (goto-char (point-min)) + (while (search-forward-regexp "\\\\\\\\snippet[ \s\t]+`\\([^']+\\)'" nil t) + (let ((template (get-text-property (match-beginning 1) + 'yasnippet))) + (when template + (help-xref-button 1 'help-snippet-def template) + (delete-region (match-end 1) (match-end 0)) + (delete-region (match-beginning 0) (match-beginning 1))))))) + +;;; Utils + +(defvar yas-verbosity 3 + "Log level for `yas--message' 4 means trace most anything, 0 means nothing.") + +(defun yas--message (level message &rest args) + "When LEVEL is at or below `yas-verbosity', log MESSAGE and ARGS." + (when (>= yas-verbosity level) + (message "%s" (apply #'yas--format message args)))) + +(defun yas--warning (format-control &rest format-args) + (let ((msg (apply #'format format-control format-args))) + (display-warning 'yasnippet msg :warning) + (yas--message 1 msg))) + +(defun yas--format (format-control &rest format-args) + (apply #'format (concat "[yas] " format-control) format-args)) + + +;;; Unloading + +(defvar unload-function-defs-list) ; loadhist.el + +(defun yasnippet-unload-function () + "Disable minor modes when calling `unload-feature'." + ;; Disable `yas-minor-mode' everywhere it's enabled. + (yas-global-mode -1) + (save-current-buffer + (dolist (buffer (buffer-list)) + (set-buffer buffer) + (when yas-minor-mode + (yas-minor-mode -1)))) + ;; Remove symbol properties of all our functions, this avoids + ;; Bug#25088 in Emacs 25.1, where the compiler macro on + ;; `cl-defstruct' created functions hang around in the symbol plist + ;; and cause errors when loading again (we don't *need* to clean + ;; *all* symbol plists, but it's easier than being precise). + (dolist (def unload-function-defs-list) + (when (eq (car-safe def) 'defun) + (setplist (cdr def) nil))) + ;; Return nil so that `unload-feature' will take of undefining + ;; functions, and changing any buffers using `snippet-mode'. + nil) + + +;;; Backward compatibility to yasnippet <= 0.7 + +(defun yas-initialize () + "For backward compatibility, enable `yas-minor-mode' globally." + (declare (obsolete "Use (yas-global-mode 1) instead." "0.8")) + (yas-global-mode 1)) + +(defvar yas--backported-syms '(;; `defcustom's + ;; + yas-snippet-dirs + yas-prompt-functions + yas-indent-line + yas-also-auto-indent-first-line + yas-snippet-revival + yas-triggers-in-field + yas-fallback-behavior + yas-choose-keys-first + yas-choose-tables-first + yas-use-menu + yas-trigger-symbol + yas-wrap-around-region + yas-good-grace + yas-visit-from-menu + yas-expand-only-for-last-commands + yas-field-highlight-face + + ;; these vars can be customized as well + ;; + yas-keymap + yas-verbosity + yas-extra-modes + yas-key-syntaxes + yas-after-exit-snippet-hook + yas-before-expand-snippet-hook + yas-buffer-local-condition + yas-dont-activate + + ;; prompting functions + ;; + yas-x-prompt + yas-ido-prompt + yas-no-prompt + yas-completing-prompt + yas-dropdown-prompt + + ;; interactive functions + ;; + yas-expand + yas-minor-mode + yas-global-mode + yas-direct-keymaps-reload + yas-minor-mode-on + yas-load-directory + yas-reload-all + yas-compile-directory + yas-recompile-all + yas-about + yas-expand-from-trigger-key + yas-expand-from-keymap + yas-insert-snippet + yas-visit-snippet-file + yas-new-snippet + yas-load-snippet-buffer + yas-tryout-snippet + yas-describe-tables + yas-next-field-or-maybe-expand + yas-next-field + yas-prev-field + yas-abort-snippet + yas-exit-snippet + yas-exit-all-snippets + yas-skip-and-clear-or-delete-char + yas-initialize + + ;; symbols that I "exported" for use + ;; in snippets and hookage + ;; + yas-expand-snippet + yas-define-snippets + yas-define-menu + yas-snippet-beg + yas-snippet-end + yas-modified-p + yas-moving-away-p + yas-substr + yas-choose-value + yas-key-to-value + yas-throw + yas-verify-value + yas-field-value + yas-text + yas-selected-text + yas-default-from-field + yas-inside-string + yas-unimplemented + yas-define-condition-cache + yas-hippie-try-expand + + ;; debug definitions + ;; yas-debug-snippet-vars + ;; yas-exterminate-package + ;; yas-debug-test + + ;; testing definitions + ;; yas-should-expand + ;; yas-should-not-expand + ;; yas-mock-insert + ;; yas-make-file-or-dirs + ;; yas-variables + ;; yas-saving-variables + ;; yas-call-with-snippet-dirs + ;; yas-with-snippet-dirs +) + "Backported yasnippet symbols. + +They are mapped to \"yas/*\" variants.") + +(when yas-alias-to-yas/prefix-p + (dolist (sym yas--backported-syms) + (let ((backported (intern (replace-regexp-in-string "\\`yas-" "yas/" (symbol-name sym))))) + (when (boundp sym) + (make-obsolete-variable backported sym "yasnippet 0.8") + (defvaralias backported sym)) + (when (fboundp sym) + (make-obsolete backported sym "yasnippet 0.8") + (defalias backported sym)))) + (make-obsolete 'yas/root-directory 'yas-snippet-dirs "yasnippet 0.8") + (defvaralias 'yas/root-directory 'yas-snippet-dirs)) + +(defvar yas--exported-syms + (let (exported) + (mapatoms (lambda (atom) + (if (and (or (and (boundp atom) + (not (get atom 'byte-obsolete-variable))) + (and (fboundp atom) + (not (get atom 'byte-obsolete-info)))) + (string-match-p "\\`yas-[^-]" (symbol-name atom))) + (push atom exported)))) + exported) + "Exported yasnippet symbols. + +i.e. the ones with \"yas-\" single dash prefix. I will try to +keep them in future yasnippet versions and other elisp libraries +can more or less safely rely upon them.") + + +(provide 'yasnippet) +;; Local Variables: +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: +;;; yasnippet.el ends here diff --git a/elpa/yasnippet-20180621.50/yasnippet.elc b/elpa/yasnippet-20180621.50/yasnippet.elc new file mode 100644 index 0000000..f73f192 Binary files /dev/null and b/elpa/yasnippet-20180621.50/yasnippet.elc differ diff --git a/elpa/zencoding-mode-20140213.822/zencoding-mode-autoloads.el b/elpa/zencoding-mode-20140213.822/zencoding-mode-autoloads.el new file mode 100644 index 0000000..3c09344 --- /dev/null +++ b/elpa/zencoding-mode-20140213.822/zencoding-mode-autoloads.el @@ -0,0 +1,63 @@ +;;; zencoding-mode-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "zencoding-mode" "zencoding-mode.el" (23391 +;;;;;; 65226 0 0)) +;;; Generated autoloads from zencoding-mode.el + +(autoload 'zencoding-expand-line "zencoding-mode" "\ +Replace the current line's zencode expression with the corresponding expansion. +If prefix ARG is given or region is visible call `zencoding-preview' to start an +interactive preview. + +Otherwise expand line directly. + +For more information see `zencoding-mode'. + +\(fn ARG)" t nil) + +(autoload 'zencoding-mode "zencoding-mode" "\ +Minor mode for writing HTML and CSS markup. +With zen coding for HTML and CSS you can write a line like + + ul#name>li.item*2 + +and have it expanded to + +
      +
    • +
    • +
    + +This minor mode defines keys for quick access: + +\\{zencoding-mode-keymap} + +Home page URL `http://www.emacswiki.org/emacs/ZenCoding'. + +See also `zencoding-expand-line'. + +\(fn &optional ARG)" t nil) + +(autoload 'zencoding-expand-yas "zencoding-mode" "\ + + +\(fn)" t nil) + +(autoload 'zencoding-preview "zencoding-mode" "\ +Expand zencode between BEG and END interactively. +This will show a preview of the expanded zen code and you can +accept it or skip it. + +\(fn BEG END)" t nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; zencoding-mode-autoloads.el ends here diff --git a/elpa/zencoding-mode-20140213.822/zencoding-mode-pkg.el b/elpa/zencoding-mode-20140213.822/zencoding-mode-pkg.el new file mode 100644 index 0000000..b99f550 --- /dev/null +++ b/elpa/zencoding-mode-20140213.822/zencoding-mode-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "zencoding-mode" "20140213.822" "Unfold CSS-selector-like expressions to markup" 'nil :commit "58e42af182c98cb9941d27cd042d227fbf4e146c" :keywords '("convenience") :authors '(("Chris Done" . "chrisdone@gmail.com")) :maintainer '("Chris Done" . "chrisdone@gmail.com") :url "https://github.com/rooney/zencoding") diff --git a/elpa/zencoding-mode-20140213.822/zencoding-mode.el b/elpa/zencoding-mode-20140213.822/zencoding-mode.el new file mode 100644 index 0000000..0e55241 --- /dev/null +++ b/elpa/zencoding-mode-20140213.822/zencoding-mode.el @@ -0,0 +1,1081 @@ +;;; zencoding-mode.el --- Unfold CSS-selector-like expressions to markup + +;; Copyright (C) 2009, Chris Done + +;; Version: 0.5.1 +;; Package-Version: 20140213.822 +;; Author: Chris Done +;; URL: https://github.com/rooney/zencoding +;; Last-Updated: 2011-12-31 Sat +;; Keywords: convenience + +;; This file 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 file 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., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Commentary: +;; +;; Unfold CSS-selector-like expressions to markup. Intended to be used +;; with sgml-like languages; xml, html, xhtml, xsl, etc. +;; +;; See `zencoding-mode' for more information. +;; +;; Copy zencoding-mode.el to your load-path and add to your .emacs: +;; +;; (require 'zencoding-mode) +;; +;; Example setup: +;; +;; (add-to-list 'load-path "~/Emacs/zencoding/") +;; (require 'zencoding-mode) +;; (add-hook 'sgml-mode-hook 'zencoding-mode) ;; Auto-start on any markup modes +;; +;; Enable the minor mode with M-x zencoding-mode. +;; +;; See ``Test cases'' section for a complete set of expression types. +;; +;; If you are hacking on this project, eval (zencoding-test-cases) to +;; ensure that your changes have not broken anything. Feel free to add +;; new test cases if you add new features. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; History: +;; +;; Modified by Lennart Borgman. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Code: + +(defconst zencoding-mode:version "0.5.1") + +;; Include the trie data structure for caching +;(require 'zencoding-trie) + +(require 'cl) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Generic parsing macros and utilities + +(defmacro zencoding-aif (test-form then-form &rest else-forms) + "Anaphoric if. Temporary variable `it' is the result of test-form." + `(let ((it ,test-form)) + (if it ,then-form ,@(or else-forms '(it))))) + +(defmacro zencoding-pif (test-form then-form &rest else-forms) + "Parser anaphoric if. Temporary variable `it' is the result of test-form." + `(let ((it ,test-form)) + (if (not (eq 'error (car it))) ,then-form ,@(or else-forms '(it))))) + +(defmacro zencoding-parse (regex nums label &rest body) + "Parse according to a regex and update the `input' variable." + `(zencoding-aif (zencoding-regex ,regex input ',(number-sequence 0 nums)) + (let ((input (elt it ,nums))) + ,@body) + `,`(error ,(concat "expected " ,label)))) + +(defmacro zencoding-run (parser then-form &rest else-forms) + "Run a parser and update the input properly, extract the parsed + expression." + `(zencoding-pif (,parser input) + (let ((input (cdr it)) + (expr (car it))) + ,then-form) + ,@(or else-forms '(it)))) + +(defmacro zencoding-por (parser1 parser2 then-form &rest else-forms) + "OR two parsers. Try one parser, if it fails try the next." + `(zencoding-pif (,parser1 input) + (let ((input (cdr it)) + (expr (car it))) + ,then-form) + (zencoding-pif (,parser2 input) + (let ((input (cdr it)) + (expr (car it))) + ,then-form) + ,@else-forms))) + +(defun zencoding-regex (regexp string refs) + "Return a list of (`ref') matches for a `regex' on a `string' or nil." + (if (string-match (concat "^" regexp "\\([^\n]*\\)$") string) + (mapcar (lambda (ref) (match-string ref string)) + (if (sequencep refs) refs (list refs))) + nil)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Zen coding parsers + +(defun zencoding-expr (input) + "Parse a zen coding expression with optional filters." + (zencoding-pif (zencoding-parse "\\(.*?\\)|" 2 "expr|filter" it) + (let ((input (elt it 1)) + (filters (elt it 2))) + (zencoding-pif (zencoding-extract-filters filters) + (zencoding-filter input it) + it)) + (zencoding-filter input (zencoding-default-filter)))) + +(defun zencoding-subexpr (input) + "Parse a zen coding expression with no filter. This pretty much defines precedence." + (zencoding-run zencoding-siblings + it + (zencoding-run zencoding-parent-child + it + (zencoding-run zencoding-multiplier + it + (zencoding-run zencoding-pexpr + it + (zencoding-run zencoding-tag + it + '(error "no match, expecting ( or a-zA-Z0-9"))))))) + +(defun zencoding-extract-filters (input) + "Extract filters from expression." + (zencoding-pif (zencoding-parse "\\([^\\|]+?\\)|" 2 "" it) + (let ((filter-name (elt it 1)) + (more-filters (elt it 2))) + (zencoding-pif (zencoding-extract-filters more-filters) + (cons filter-name it) + it)) + (zencoding-parse "\\([^\\|]+\\)" 1 "filter name" `(,(elt it 1))))) + +(defun zencoding-filter (input filters) + "Construct AST with specified filters." + (zencoding-pif (zencoding-subexpr input) + (let ((result (car it)) + (rest (cdr it))) + `((filter ,filters ,result) . ,rest)) + it)) + +(defun zencoding-default-filter () + "Default filter(s) to be used if none is specified." + (let* ((file-ext (car (zencoding-regex ".*\\(\\..*\\)" (or (buffer-file-name) "") 1))) + (defaults '(".html" ("html") + ".htm" ("html") + ".haml" ("haml") + ".clj" ("hic"))) + (default-else '("html")) + (selected-default (member file-ext defaults))) + (if selected-default + (cadr selected-default) + default-else))) + +(defun zencoding-multiplier (input) + (zencoding-por zencoding-pexpr zencoding-tag + (let ((multiplier expr)) + (zencoding-parse "\\*\\([0-9]+\\)" 2 "*n where n is a number" + (let ((multiplicand (read (elt it 1)))) + `((list ,(make-list multiplicand multiplier)) . ,input)))) + '(error "expected *n multiplier"))) + +(defun zencoding-tag (input) + "Parse a tag." + (zencoding-run zencoding-tagname + (let ((tagname (cadr expr)) + (has-body? (cddr expr))) + (zencoding-pif (zencoding-run zencoding-identifier + (zencoding-tag-classes + `(tag (,tagname ,has-body? ,(cddr expr))) input) + (zencoding-tag-classes + `(tag (,tagname ,has-body? nil)) input)) + (let ((expr (car it)) + (input (cdr it))) + (zencoding-tag-props expr input)))) + (zencoding-default-tag input))) + +(defun zencoding-default-tag (input) + "Parse a #id or .class" + (zencoding-parse "\\([#|\\.]\\)" 1 "tagname" + (zencoding-tag (concat "div" (elt it 0))))) + +(defun zencoding-tag-props (tag input) + (let ((tag-data (cadr tag))) + (zencoding-run zencoding-props + (let ((props (cdr expr))) + `((tag ,(append tag-data (list props))) . ,input)) + `((tag ,(append tag-data '(nil))) . ,input)))) + +(defun zencoding-props (input) + "Parse many props." + (zencoding-run zencoding-prop + (zencoding-pif (zencoding-props input) + `((props . ,(cons expr (cdar it))) . ,(cdr it)) + `((props . ,(list expr)) . ,input)))) + +(defun zencoding-prop (input) + (zencoding-parse + " " 1 "space" + (zencoding-run + zencoding-name + (let ((name (cdr expr))) + (zencoding-pif (zencoding-prop-value name input) + it + `((,(read name) "") . ,input)))))) + +(defun zencoding-prop-value (name input) + (zencoding-pif (zencoding-parse "=\"\\(.*?\\)\"" 2 + "=\"property value\"" + (let ((value (elt it 1)) + (input (elt it 2))) + `((,(read name) ,value) . ,input))) + it + (zencoding-parse "=\\([^\\,\\+\\>\\ )]*\\)" 2 + "=property value" + (let ((value (elt it 1)) + (input (elt it 2))) + `((,(read name) ,value) . ,input))))) + +(defun zencoding-tag-classes (tag input) + (let ((tag-data (cadr tag))) + (zencoding-run zencoding-classes + (let ((classes (mapcar (lambda (cls) (cdadr cls)) + (cdr expr)))) + `((tag ,(append tag-data (list classes))) . ,input)) + `((tag ,(append tag-data '(nil))) . ,input)))) + +(defun zencoding-tagname (input) + "Parse a tagname a-zA-Z0-9 tagname (e.g. html/head/xsl:if/br)." + (zencoding-parse "\\([a-zA-Z][a-zA-Z0-9:-]*\/?\\)" 2 "tagname, a-zA-Z0-9" + (let* ((tag-spec (elt it 1)) + (empty-tag (zencoding-regex "\\([^\/]*\\)\/" tag-spec 1)) + (tag (if empty-tag + (car empty-tag) + tag-spec))) + `((tagname . (,tag . ,(not empty-tag))) . ,input)))) + +(defun zencoding-pexpr (input) + "A zen coding expression with parentheses around it." + (zencoding-parse "(" 1 "(" + (zencoding-run zencoding-subexpr + (zencoding-aif (zencoding-regex ")" input '(0 1)) + `(,expr . ,(elt it 1)) + '(error "expecting `)'"))))) + +(defun zencoding-parent-child (input) + "Parse an tag>e expression, where `n' is an tag and `e' is any + expression." + (zencoding-run zencoding-multiplier + (let* ((items (cadr expr)) + (rest (zencoding-child-sans expr input))) + (if (not (eq (car rest) 'error)) + (let ((child (car rest)) + (input (cdr rest))) + (cons (cons 'list + (cons (mapcar (lambda (parent) + `(parent-child ,parent ,child)) + items) + nil)) + input)) + '(error "expected child"))) + (zencoding-run zencoding-tag + (zencoding-child expr input) + '(error "expected parent")))) + +(defun zencoding-child-sans (parent input) + (zencoding-parse ">" 1 ">" + (zencoding-run zencoding-subexpr + it + '(error "expected child")))) + +(defun zencoding-child (parent input) + (zencoding-parse ">" 1 ">" + (zencoding-run zencoding-subexpr + (let ((child expr)) + `((parent-child ,parent ,child) . ,input)) + '(error "expected child")))) + +(defun zencoding-sibling (input) + (zencoding-por zencoding-pexpr zencoding-multiplier + it + (zencoding-run zencoding-tag + it + '(error "expected sibling")))) + +(defun zencoding-siblings (input) + "Parse an e+e expression, where e is an tag or a pexpr." + (zencoding-run zencoding-sibling + (let ((parent expr)) + (zencoding-parse "\\+" 1 "+" + (zencoding-run zencoding-subexpr + (let ((child expr)) + `((sibling ,parent ,child) . ,input)) + (zencoding-expand parent input)))) + '(error "expected first sibling"))) + +(defvar zencoding-expandable-tags + '("dl" ">(dt+dd)" + "ol" ">li" + "ul" ">li" + "table" ">tr>td")) + +(defun zencoding-expand (parent input) + "Parse an e+ expression, where e is an expandable tag" + (let* ((parent-tag (car (elt parent 1))) + (expandable (member parent-tag zencoding-expandable-tags))) + (if expandable + (let ((expansion (zencoding-child parent (concat (cadr expandable))))) + (zencoding-pif (zencoding-parse "+\\(.*\\)" 1 "+expr" + (zencoding-subexpr (elt it 1))) + `((sibling ,(car expansion) ,(car it))) + expansion)) + '(error "expected second sibling")))) + +(defun zencoding-name (input) + "Parse a class or identifier name, e.g. news, footer, mainimage" + (zencoding-parse "\\([a-zA-Z][a-zA-Z0-9-_:]*\\)" 2 "class or identifer name" + `((name . ,(elt it 1)) . ,input))) + +(defun zencoding-class (input) + "Parse a classname expression, e.g. .foo" + (zencoding-parse "\\." 1 "." + (zencoding-run zencoding-name + `((class ,expr) . ,input) + '(error "expected class name")))) +(defun zencoding-identifier (input) + "Parse an identifier expression, e.g. #foo" + (zencoding-parse "#" 1 "#" + (zencoding-run zencoding-name + `((identifier . ,expr) . ,input)))) + +(defun zencoding-classes (input) + "Parse many classes." + (zencoding-run zencoding-class + (zencoding-pif (zencoding-classes input) + `((classes . ,(cons expr (cdar it))) . ,(cdr it)) + `((classes . ,(list expr)) . ,input)) + '(error "expected class"))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Zen coding transformer from AST to string + +(defvar zencoding-inline-tags + '("a" + "abbr" + "acronym" + "cite" + "code" + "dd" + "dfn" + "dt" + "em" + "h1" "h2" "h3" "h4" "h5" "h6" + "kbd" + "li" + "q" + "span" + "strong" + "var")) + +(defvar zencoding-block-tags + '("p")) + +(defvar zencoding-self-closing-tags + '("br" + "img" + "input")) + +(defvar zencoding-leaf-function nil + "Function to execute when expanding a leaf node in the + Zencoding AST.") + +(defvar zencoding-filters + '("html" (zencoding-primary-filter zencoding-make-html-tag) + "c" (zencoding-primary-filter zencoding-make-commented-html-tag) + "haml" (zencoding-primary-filter zencoding-make-haml-tag) + "hic" (zencoding-primary-filter zencoding-make-hiccup-tag) + "e" (zencoding-escape-xml))) + +(defun zencoding-primary-filter (input proc) + "Process filter that needs to be executed first, ie. not given output from other filter." + (if (listp input) + (let ((tag-maker (cadr proc))) + (zencoding-transform-ast input tag-maker)) + nil)) + +(defun zencoding-process-filter (filters input) + "Process filters, chain one filter output as the input of the next filter." + (let ((filter-data (member (car filters) zencoding-filters)) + (more-filters (cdr filters))) + (if filter-data + (let* ((proc (cadr filter-data)) + (fun (car proc)) + (filter-output (funcall fun input proc))) + (if more-filters + (zencoding-process-filter more-filters filter-output) + filter-output)) + nil))) + +(defun zencoding-make-tag (tag-maker tag-info &optional content) + "Extract tag info and pass them to tag-maker." + (let* ((name (pop tag-info)) + (has-body? (pop tag-info)) + (id (pop tag-info)) + (classes (pop tag-info)) + (props (pop tag-info)) + (self-closing? (not (or content + (and has-body? + (not (member name zencoding-self-closing-tags))))))) + (funcall tag-maker name id classes props self-closing? + (if content content + (if zencoding-leaf-function (funcall zencoding-leaf-function)))))) + +(defun zencoding-make-html-tag (tag-name tag-id tag-classes tag-props self-closing? content) + "Create HTML markup string" + (let* ((id (zencoding-concat-or-empty " id=\"" tag-id "\"")) + (classes (zencoding-mapconcat-or-empty " class=\"" tag-classes " " "\"")) + (props (zencoding-mapconcat-or-empty " " tag-props " " nil + (lambda (prop) + (concat (symbol-name (car prop)) "=\"" (cadr prop) "\"")))) + (content-multiline? (and content (string-match "\n" content))) + (block-tag? (or (member tag-name zencoding-block-tags) + (and (> (length tag-name) 1) + (not (member tag-name zencoding-inline-tags))))) + (lf (if (or content-multiline? block-tag?) + "\n"))) + (concat "<" tag-name id classes props (if self-closing? + "/>" + (concat ">" (if content + (if (or content-multiline? block-tag?) + (zencoding-indent content) + content)) + lf + ""))))) + +(defun zencoding-make-commented-html-tag (tag-name tag-id tag-classes tag-props self-closing? content) + "Create HTML markup string with extra comments for elements with #id or .classes" + (let ((body (zencoding-make-html-tag tag-name tag-id tag-classes tag-props self-closing? content))) + (if (or tag-id tag-classes) + (let ((id (zencoding-concat-or-empty "#" tag-id)) + (classes (zencoding-mapconcat-or-empty "." tag-classes "."))) + (concat "\n" + body + "\n")) + body))) + +(defun zencoding-make-haml-tag (tag-name tag-id tag-classes tag-props self-closing? content) + "Create HAML string" + (let ((name (if (and (equal tag-name "div") + (or tag-id tag-classes)) + "" + (concat "%" tag-name))) + (id (zencoding-concat-or-empty "#" tag-id)) + (classes (zencoding-mapconcat-or-empty "." tag-classes ".")) + (props (zencoding-mapconcat-or-empty "{" tag-props ", " "}" + (lambda (prop) + (concat ":" (symbol-name (car prop)) " => \"" (cadr prop) "\""))))) + (concat name id classes props (if content + (zencoding-indent content))))) + +(defun zencoding-make-hiccup-tag (tag-name tag-id tag-classes tag-props self-closing? content) + "Create Hiccup string" + (let* ((id (zencoding-concat-or-empty "#" tag-id)) + (classes (zencoding-mapconcat-or-empty "." tag-classes ".")) + (props (zencoding-mapconcat-or-empty " {" tag-props ", " "}" + (lambda (prop) + (concat ":" (symbol-name (car prop)) " \"" (cadr prop) "\"")))) + (content-multiline? (and content (string-match "\n" content))) + (block-tag? (or (member tag-name zencoding-block-tags) + (and (> (length tag-name) 1) + (not (member tag-name zencoding-inline-tags)))))) + (concat "[:" tag-name id classes props + (if content + (if (or content-multiline? block-tag?) + (zencoding-indent content) + (concat " " content))) + "]"))) + +(defun zencoding-concat-or-empty (prefix body &optional suffix) + "Return prefixed suffixed text or empty string." + (if body + (concat prefix body suffix) + "")) + +(defun zencoding-mapconcat-or-empty (prefix list-body delimiter &optional suffix map-fun) + "Return prefixed suffixed mapconcated text or empty string." + (if list-body + (let* ((mapper (if map-fun map-fun 'identity)) + (body (mapconcat mapper list-body delimiter))) + (concat prefix body suffix)) + "")) + +(defun zencoding-escape-xml (input proc) + "Escapes XML-unsafe characters: <, > and &." + (replace-regexp-in-string + "<" "<" + (replace-regexp-in-string + ">" ">" + (replace-regexp-in-string + "&" "&" + (if (stringp input) + input + (zencoding-process-filter (zencoding-default-filter) input)))))) + +(defun zencoding-transform (ast-with-filters) + "Transform AST (containing filter data) into string." + (let ((filters (cadr ast-with-filters)) + (ast (caddr ast-with-filters))) + (zencoding-process-filter filters ast))) + +(defun zencoding-transform-ast (ast tag-maker) + "Transform AST (without filter data) into string." + (let ((type (car ast))) + (cond + ((eq type 'list) + (mapconcat (lexical-let ((make-tag-fun tag-maker)) + #'(lambda (sub-ast) + (zencoding-transform-ast sub-ast make-tag-fun))) + (cadr ast) + "\n")) + ((eq type 'tag) + (zencoding-make-tag tag-maker (cadr ast))) + ((eq type 'parent-child) + (let ((parent (cadadr ast)) + (children (zencoding-transform-ast (caddr ast) tag-maker))) + (zencoding-make-tag tag-maker parent children))) + ((eq type 'sibling) + (let ((sib1 (zencoding-transform-ast (cadr ast) tag-maker)) + (sib2 (zencoding-transform-ast (caddr ast) tag-maker))) + (concat sib1 "\n" sib2)))))) + +(defun zencoding-indent-size () + "Calculate indent size using current mode as a guidance" + (let ((mode (with-current-buffer (current-buffer) major-mode))) + (cond + ((string= mode "nxml-mode") nxml-child-indent) + ((string= mode "html-mode") sgml-basic-offset) + ((string= mode "sgml-mode") sgml-basic-offset) + (t 4) + )) + ) + +(defun zencoding-indent (text) + "Indent the text" + (if text + (replace-regexp-in-string + "\n" + (concat + "\n" + (make-string (zencoding-indent-size) ?\ )) + (concat "\n" text)) + nil)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Test-cases + +(defun zencoding-test-cases () + (let ((tests '(;; Tags + ("a" "") + ("a.x" "") + ("a#q.x" "") + ("a#q.x.y.z" "") + ("#q" "
    " + "
    ") + (".x" "
    " + "
    ") + ("#q.x" "
    " + "
    ") + ("#q.x.y.z" "
    " + "
    ") + ;; Empty tags + ("a/" "") + ("a/.x" "") + ("a/#q.x" "") + ("a/#q.x.y.z" "") + ;; Self-closing tags + ("input type=text" "") + ("img" "") + ("img>metadata/*2" "" + " " + " " + "") + ;; Siblings + ("a+b" "" + "") + ("a+b+c" "" + "" + "") + ("a.x+b" "" + "") + ("a#q.x+b" "" + "") + ("a#q.x.y.z+b" "" + "") + ("a#q.x.y.z+b#p.l.m.n" "" + "") + ;; Tag expansion + ("table+" "" + " " + " " + " " + "
    " + "
    ") + ("dl+" "
    " + "
    " + "
    " + "
    ") + ("ul+" "
      " + "
    • " + "
    ") + ("ul++ol+" "
      " + "
    • " + "
    " + "
      " + "
    1. " + "
    ") + ("ul#q.x.y m=l+" "
      " + "
    • " + "
    ") + ;; Parent > child + ("a>b" "") + ("a>b>c" "") + ("a.x>b" "") + ("a#q.x>b" "") + ("a#q.x.y.z>b" "") + ("a#q.x.y.z>b#p.l.m.n" "") + ("#q>.x" "
    " + "
    " + "
    " + "
    ") + ("a>b+c" "" + " " + " " + "") + ("a>b+c>d" "" + " " + " " + "") + ;; Multiplication + ("a*1" "") + ("a*2" "" + "") + ("a/*2" "" + "") + ("a*2+b*2" "" + "" + "" + "") + ("a*2>b*2" "" + " " + " " + "" + "" + " " + " " + "") + ("a>b*2" "" + " " + " " + "") + ("a#q.x>b#q.x*2" "" + " " + " " + "") + ("a#q.x>b/#q.x*2" "" + " " + " " + "") + ;; Properties + ("a x" "") + ("a x=" "") + ("a x=\"\"" "") + ("a x=y" "") + ("a x=\"y\"" "") + ("a x=\"()\"" "") + ("a x m" "") + ("a x= m=\"\"" "") + ("a x=y m=l" "") + ("a/ x=y m=l" "") + ("a#foo x=y m=l" "") + ("a.foo x=y m=l" "") + ("a#foo.bar.mu x=y m=l" "") + ("a/#foo.bar.mu x=y m=l" "") + ("a x=y+b" "" + "") + ("a x=y+b x=y" "" + "") + ("a x=y>b" "") + ("a x=y>b x=y" "") + ("a x=y>b x=y+c x=y" "" + " " + " " + "") + ;; Parentheses + ("(a)" "") + ("(a)+(b)" "" + "") + ("a>(b)" "") + ("(a>b)>c" "") + ("(a>b)+c" "" + "") + ("z+(a>b)+c+k" "" + "" + "" + "") + ("(a)*2" "" + "") + ("((a)*2)" "" + "") + ("((a))*2" "" + "") + ("(a>b)*2" "" + "") + ("(a+b)*2" "" + "" + "" + "") + ;; Filter: comment + ("a.b|c" "" + "" + "") + ("#a>.b|c" "" + "
    " + " " + "
    " + "
    " + " " + "
    " + "") + ;; Filter: HAML + ("a|haml" "%a") + ("a#q.x.y.z|haml" "%a#q.x.y.z") + ("a#q.x x=y m=l|haml" "%a#q.x{:x => \"y\", :m => \"l\"}") + ("div|haml" "%div") + ("div.footer|haml" ".footer") + (".footer|haml" ".footer") + ("p>a href=#+br|haml" "%p" + " %a{:href => \"#\"}" + " %br") + ;; Filter: Hiccup + ("a|hic" "[:a]") + ("a#q.x.y.z|hic" "[:a#q.x.y.z]") + ("a#q.x x=y m=l|hic" "[:a#q.x {:x \"y\", :m \"l\"}]") + (".footer|hic" "[:div.footer]") + ("p>a href=#+br|hic" "[:p" + " [:a {:href \"#\"}]" + " [:br]]") + ("#q>(a*2>b)+p>b|hic" "[:div#q" + " [:a [:b]]" + " [:a [:b]]" + " [:p" + " [:b]]]") + ;; Filter: escape + ("script src="|e" "<script src=\"&quot;\">" + "</script>") + ))) + (mapc (lambda (input) + (let ((expected (mapconcat 'identity (cdr input) "\n")) + (actual (zencoding-transform (car (zencoding-expr (car input)))))) + (if (not (equal expected actual)) + (error (concat "Assertion " (car input) " failed:" + expected + " == " + actual))))) + tests) + (concat (number-to-string (length tests)) " tests performed. All OK."))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Zencoding minor mode + +(defgroup zencoding nil + "Customization group for zencoding-mode." + :group 'convenience) + +(defun zencoding-expr-on-line () + "Extract a zencoding expression and the corresponding bounds + for the current line." + (let* ((start (line-beginning-position)) + (end (line-end-position)) + (line (buffer-substring-no-properties start end)) + (expr (zencoding-regex "\\([ \t]*\\)\\([^\n]+\\)" line 2))) + (if (first expr) + (list (first expr) start end)))) + +(defcustom zencoding-indentation 4 + "Number of spaces used for indentation." + :type '(number :tag "Spaces") + :group 'zencoding) + +(defun zencoding-prettify (markup indent) + (let ((first-col (format (format "%%%ds" indent) "")) + (tab (format (format "%%%ds" zencoding-indentation) ""))) + (concat first-col + (replace-regexp-in-string "\n" (concat "\n" first-col) + (replace-regexp-in-string " " tab markup))))) + +;;;###autoload +(defun zencoding-expand-line (arg) + "Replace the current line's zencode expression with the corresponding expansion. +If prefix ARG is given or region is visible call `zencoding-preview' to start an +interactive preview. + +Otherwise expand line directly. + +For more information see `zencoding-mode'." + (interactive "P") + (let* ((here (point)) + (preview (if zencoding-preview-default (not arg) arg)) + (beg (if preview + (progn + (beginning-of-line) + (skip-chars-forward " \t") + (point)) + (when mark-active (region-beginning)))) + (end (if preview + (progn + (end-of-line) + (skip-chars-backward " \t") + (point)) + (when mark-active (region-end))))) + (if beg + (progn + (goto-char here) + (zencoding-preview beg end)) + (let ((expr (zencoding-expr-on-line))) + (if expr + (let* ((markup (zencoding-transform (car (zencoding-expr (first expr))))) + (pretty (zencoding-prettify markup (current-indentation)))) + (save-excursion + (delete-region (second expr) (third expr)) + (zencoding-insert-and-flash pretty)))))))) + +(defvar zencoding-mode-keymap nil + "Keymap for zencode minor mode.") + +(if zencoding-mode-keymap + nil + (progn + (setq zencoding-mode-keymap (make-sparse-keymap)) + (define-key zencoding-mode-keymap (kbd "C-j") 'zencoding-expand-line) + (define-key zencoding-mode-keymap (kbd "") 'zencoding-expand-line))) + +;;;###autoload +(define-minor-mode zencoding-mode + "Minor mode for writing HTML and CSS markup. +With zen coding for HTML and CSS you can write a line like + + ul#name>li.item*2 + +and have it expanded to + +
      +
    • +
    • +
    + +This minor mode defines keys for quick access: + +\\{zencoding-mode-keymap} + +Home page URL `http://www.emacswiki.org/emacs/ZenCoding'. + +See also `zencoding-expand-line'." + :lighter " Zen" + :keymap zencoding-mode-keymap) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Zencoding yasnippet integration + +(defun zencoding-transform-yas (ast) + (let* ((leaf-count 0) + (zencoding-leaf-function + (lambda () + (format "$%d" (incf leaf-count))))) + (zencoding-transform ast))) + +;;;###autoload +(defun zencoding-expand-yas () + (interactive) + (let ((expr (zencoding-expr-on-line))) + (if expr + (let* ((markup (zencoding-transform-yas (car (zencoding-expr (first expr))))) + (filled (replace-regexp-in-string "><" ">\n<" markup))) + (delete-region (second expr) (third expr)) + (insert filled) + (indent-region (second expr) (point)) + (yas/expand-snippet + (buffer-substring (second expr) (point)) + (second expr) (point)))))) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Real-time preview +;; + +;;;;;;;;;; +;; Lennart's version + +(defvar zencoding-preview-input nil) +(make-local-variable 'zencoding-preview-input) +(defvar zencoding-preview-output nil) +(make-local-variable 'zencoding-preview-output) +(defvar zencoding-old-show-paren nil) +(make-local-variable 'zencoding-old-show-paren) + +(defface zencoding-preview-input + '((default :box t :inherit secondary-selection)) + "Face for preview input field." + :group 'zencoding) + +(defface zencoding-preview-output + '((default :inherit highlight)) + "Face for preview output field." + :group 'zencoding) + +(defvar zencoding-preview-keymap + (let ((map (make-sparse-keymap))) + (define-key map (kbd "RET") 'zencoding-preview-accept) + (define-key map (kbd "") 'zencoding-preview-accept) + (define-key map [(control ?g)] 'zencoding-preview-abort) + map)) + +(defun zencoding-preview-accept () + (interactive) + (let ((ovli zencoding-preview-input)) + (if (not (and (overlayp ovli) + (bufferp (overlay-buffer ovli)))) + (message "Preview is not active") + (let* ((indent (current-indentation)) + (markup (zencoding-preview-transformed indent))) + (when markup + (delete-region (line-beginning-position) (overlay-end ovli)) + (zencoding-insert-and-flash markup))))) + (zencoding-preview-abort)) + +(defvar zencoding-flash-ovl nil) +(make-variable-buffer-local 'zencoding-flash-ovl) + +(defun zencoding-remove-flash-ovl (buf) + (with-current-buffer buf + (when (overlayp zencoding-flash-ovl) + (delete-overlay zencoding-flash-ovl)) + (setq zencoding-flash-ovl nil))) + +(defcustom zencoding-preview-default t + "If non-nil then preview is the default action. +This determines how `zencoding-expand-line' works by default." + :type 'boolean + :group 'zencoding) + +(defcustom zencoding-insert-flash-time 0.5 + "Time to flash insertion. +Set this to a negative number if you do not want flashing the +expansion after insertion." + :type '(number :tag "Seconds") + :group 'zencoding) + +(defun zencoding-insert-and-flash (markup) + (zencoding-remove-flash-ovl (current-buffer)) + (let ((here (point))) + (insert markup) + (setq zencoding-flash-ovl (make-overlay here (point))) + (overlay-put zencoding-flash-ovl 'face 'zencoding-preview-output) + (when (< 0 zencoding-insert-flash-time) + (run-with-idle-timer zencoding-insert-flash-time + nil 'zencoding-remove-flash-ovl (current-buffer))))) + +;;;###autoload +(defun zencoding-preview (beg end) + "Expand zencode between BEG and END interactively. +This will show a preview of the expanded zen code and you can +accept it or skip it." + (interactive (if mark-active + (list (region-beginning) (region-end)) + (list nil nil))) + (zencoding-preview-abort) + (if (not beg) + (message "Region not active") + (setq zencoding-old-show-paren show-paren-mode) + (show-paren-mode -1) + (let ((here (point))) + (goto-char beg) + (forward-line 1) + (unless (= 0 (current-column)) + (insert "\n")) + (let* ((opos (point)) + (ovli (make-overlay beg end nil nil t)) + (ovlo (make-overlay opos opos)) + (info (propertize " Zen preview. Choose with RET. Cancel by stepping out. \n" + 'face 'tooltip))) + (overlay-put ovli 'face 'zencoding-preview-input) + (overlay-put ovli 'keymap zencoding-preview-keymap) + (overlay-put ovlo 'face 'zencoding-preview-output) + (overlay-put ovlo 'before-string info) + (setq zencoding-preview-input ovli) + (setq zencoding-preview-output ovlo) + (add-hook 'before-change-functions 'zencoding-preview-before-change t t) + (goto-char here) + (add-hook 'post-command-hook 'zencoding-preview-post-command t t))))) + +(defvar zencoding-preview-pending-abort nil) +(make-variable-buffer-local 'zencoding-preview-pending-abort) + +(defun zencoding-preview-before-change (beg end) + (when + (or (> beg (overlay-end zencoding-preview-input)) + (< beg (overlay-start zencoding-preview-input)) + (> end (overlay-end zencoding-preview-input)) + (< end (overlay-start zencoding-preview-input))) + (setq zencoding-preview-pending-abort t))) + +(defun zencoding-preview-abort () + "Abort zen code preview." + (interactive) + (setq zencoding-preview-pending-abort nil) + (remove-hook 'before-change-functions 'zencoding-preview-before-change t) + (when (overlayp zencoding-preview-input) + (delete-overlay zencoding-preview-input)) + (setq zencoding-preview-input nil) + (when (overlayp zencoding-preview-output) + (delete-overlay zencoding-preview-output)) + (setq zencoding-preview-output nil) + (remove-hook 'post-command-hook 'zencoding-preview-post-command t) + (when zencoding-old-show-paren (show-paren-mode 1))) + +(defun zencoding-preview-post-command () + (condition-case err + (zencoding-preview-post-command-1) + (error (message "zencoding-preview-post: %s" err)))) + +(defun zencoding-preview-post-command-1 () + (if (and (not zencoding-preview-pending-abort) + (<= (point) (overlay-end zencoding-preview-input)) + (>= (point) (overlay-start zencoding-preview-input))) + (zencoding-update-preview (current-indentation)) + (zencoding-preview-abort))) + +(defun zencoding-preview-transformed (indent) + (let* ((string (buffer-substring-no-properties + (overlay-start zencoding-preview-input) + (overlay-end zencoding-preview-input))) + (ast (car (zencoding-expr string)))) + (when (not (eq ast 'error)) + (let ((output (zencoding-transform ast))) + (when output + (zencoding-prettify output indent)))))) + +(defun zencoding-update-preview (indent) + (let* ((pretty (zencoding-preview-transformed indent)) + (show (when pretty + (propertize pretty 'face 'highlight)))) + (when show + (overlay-put zencoding-preview-output 'after-string + (concat show "\n"))))) + +(provide 'zencoding-mode) + +;;; zencoding-mode.el ends here diff --git a/elpa/zencoding-mode-20140213.822/zencoding-mode.elc b/elpa/zencoding-mode-20140213.822/zencoding-mode.elc new file mode 100644 index 0000000..183f3b9 Binary files /dev/null and b/elpa/zencoding-mode-20140213.822/zencoding-mode.elc differ diff --git a/eshell/history b/eshell/history index 669c163..ed658d5 100644 --- a/eshell/history +++ b/eshell/history @@ -63,3 +63,5 @@ git commit -am " update- talk to Mr. Shell and org-brain for sicp and corporatio git push origin develop git push origin develop cmd +ledger -f test.ledger reg +ledger -f test.ledger bal diff --git a/ido.last b/ido.last index 09fcdb2..07f6d98 100644 --- a/ido.last +++ b/ido.last @@ -22,9 +22,9 @@ ;; ----- ido-dir-file-cache ----- ( - ("k:/MatlabHome/matlab-develop/pressureCode/com.gw.core/cfxPost/CFXGui/" (23381 47045 0 0) "时均suanfa1/" "[neubt]origin去水印补丁.zip" "yaw_average_quality/" "yawVelocityInlet.m" "yawStatiscCp/" "yawcheck/" "yawAverage/" "WithoutWakeModel.rar" "twistAngle.csv" "TS9v.tif" "TS9.tif" "TS9.csv" "TS8v.tif" "TS8.tif" "TS8.csv" "TS7v.tif" "TS7.tif" "TS7.csv" "TS6v.tif" "TS6.tif" "TS6.csv" "TS5v.tif" "TS5.tif" "TS5.csv" "TS4v.tif" "TS4.tif" "TS4.csv" "TS3v.tif" "TS3.tif" "TS3.csv" "TS2v.tif" "TS2.tif" "TS2.csv" "TS1v.tif" "TS1.tif" "TS1.csv" "tools/" "To144.tif" "thirdInterp.m" "testWindShear.m" "TestVariableSpeed.m" "testTwistAngle.m" "testSingleForceNForT.m" "testSingleCSVFileGetPostCnCt.m" "testPlaneCut.m" "testMultiAxis.m" "testGetRecordIndex.m" "testGetDynCnCT.m" "testGenerateImageTanB.m" "testGenerateImageRelocal.m" "testGenerateImageMaxPressure.m" "testGenerateImageInflowAngle.m" "testGenerateImageForceTan.m" "testGenerateImageForceNor.m" "testGenerateImageCzs.m" "testGenerateImageCxs.m" "testGenerateImageCts.m" "testGenerateImageCns.m" "testGenerateImageAxialACompare.m" "testGenerateImageAxialA.m" "testGenerateImage.m" "testCSVCoordinateAngle.m" "testclcd.m" "testCl2.m" "testCl.m" "testChordcsv.m" "testcd2.m" "testcd.m" "tempGetAngleBemToCompareWIthGEOM.m" "tags" "suanfa2withTiploss/" "suanfa1/" "sphereTorque.xlsx" "setup.m" "setup.fig" "sanjiaoFFT.m" "reLayoutCp.m.bak2" "rebuildX2Y2Cp.m" "README.md" "quality/" "processTorquehistory.m" "processPointData.m" "processCSV.m" "processCForceNForceT.m" "printRadiusStatus.m" "position.m" "plotReynoldNumber.m" "plotNacelleYaw.m" "pan.m" "nacelleTorqueBak.xlsx" "nacelleTorque.xlsx" "NAcellaYawcycleGetSectionAngleAtCertainYawFromRecord.m" "na.csv" "moment30v.tif" "moment0v.tif" "modifyCpFiles/" "modifyCp.m" "meng/" "LinShiCeshi/" "lineExtractRr.m" "lineExtractAzimuthAngle.m" "lineAverage.m" "Krylov.m/" "InflowAngleDistribution.tif" "ifvm0.csv" "horns rev坐标.fig" "getYawPosition.m" "getTopFiveValue.m" "getSphereMomentAndForce.m" "getSource.m" "getSectionCnCtAtCertainYawFromRecord.m" "getSectionAngleAtCertainYawFromRecord.m" "getNacelleYawMomentAndForce.m" "getMeanAndRAmpp.m" "getInducingFactor5.m" "getForceAndMoment.m" "getFluentRecordSeries.m" "getFluentAttachAngle.m" "getFadingFrequency.m" "getDYNMomentAndForce.m" "getContour.m" "GetAngleStatistics.m" "generateImage.m" "ForceNT/" "fluentYaw60.tif" "fluentYaw60.csv" "fluentYaw5.csv" "fluentYaw30.csv" "fluentYaw30-point-1.0-1.0r.out.csv" "fluentYaw30-point-1.0-0.5r.out.csv" "fluentYaw30-point-0.75-1.0r.out.csv" "fluentYaw30-point-0.75-0.5r.out.csv" "fluentYaw30-point-0.5-1.0r.out.csv" "fluentYaw30-point-0.5-0.5r.out.csv" "fluentYaw30-point-0.3-1.0r.out.csv" "fluentYaw30-point-0.3-0.5r.out.csv" "fluentYaw30-point-0-1.0r.out.csv" "fluentYaw30-point-0-0.5r.out.csv" "fluentYaw25.csv" "fluentYaw15.csv" "fluentYaw10.csv" "fluentYaw0.csv" "fluentYaw0-point-1.0-1.0r.out.csv" "fluentYaw0-point-1.0-0.5r.out.csv" "fluentYaw0-point-0.75-1.0r.out.csv" "fluentYaw0-point-0.75-0.5r.out.csv" "fluentYaw0-point-0.5-1.0r.out.csv" "fluentYaw0-point-0.5-0.5r.out.csv" "fluentYaw0-point-0.3-1.0r.out.csv" "fluentYaw0-point-0.3-0.5r.out.csv" "fluentYaw0-point-0-1.0r.out.csv" "fluentYaw0-point-0-0.5r.out.csv" "fluentcycleGetSectionAngleAtCertainYawFromRecord.m" "fluentCl/" "fluent60.csv" "fluent5.tif" "fluent45.tif" "fluent45.csv" "fluent30.tif" "fluent30.csv" "fluent30%1r.csv" "fluent25.tif" "fluent20.tif" "fluent20.csv" "fluent15.tif" "fluent15.csv" "fluent10.tif" "fluent0Yaw/" "fluent0.tif" "fluent0.csv" "fluent/" "firstLayerYDistance.m" "FFT_analyer.m" "FFT_analyer.fig" "fb60.tif" "fb30.tif" "fb20.tif" "fb10.tif" "fb0.tif" "FASTWakeDeficitVersion/" "FastDifferentYawAngle/" "fastBeddoes60.csv" "fastBeddoes30.csv" "fastBeddoes20.csv" "fastBeddoes10.csv" "fastBeddoes0.csv" "fast60.csv" "fast30.csv" "fast20.csv" "fast10.csv" "fast0.csv" "fanRecord/" "f60.tif" "f30.tif" "f20.tif" "f10.tif" "f0.tif" "exeFFT.m" "exeFastFFT.m" "exeCFDPointFFT.m" "exeCFDFFT.m" "excelOne_20_2520_15%.csv" "excelOne_0_2097_60%.csv" "excelFuck_30_2034_60%.csv" "excelFuck_0_1818_80%.csv" "dyn.xlsx" "downloadVelocity/" "ding0.csv" "deleteStatisticsCp.m" "deleteAllImageAndCSVfolders.m" "cycleGetSectionAngleAtCertainYawFromRecord.m" "cycleGetAverageResAngle.m" "ctYaw/" "CtUnderYaw.m" "Copy_of_testGenerateImage.m" "cnYaw/" "CnUnderYaw.m" "cnctPhaseImage/" "chord.csv" "checkWithRecycle.m" "checkCld12Result.m" "checkCl12SingleResult.m" "checkCd1singleResult.m" "checkCd12Result.m" "checkAxial_ABResult.m" "checkAxialABCResult.m" "check/" "CharacteristicVelocity.m" "CFXPlanePresureTest.m" "cfx60.tif" "cfx5.tif" "cfx30.tif" "cfx25.tif" "cfx20.tif" "cfx15.tif" "cfx10.tif" "cfx0.tif" "caldata_1_5hz_200712230000 - 副本.csv" "bladeDesign/" "bksvd/" "batchMulAngleProcessForceNForceT60.m" "batchMulAngleProcessForceNForceT45.m" "batchMulAngleProcessForceNForceT30.m" "batchMulAngleProcessForceNForceT20.m" "batchMulAngleProcessForceNForceT15.m" "batchMulAngleProcessForceNForceT0.m" "batchMulAngleProcessForceNForceT.m" "batchMulAngleNacelleYawProcessForceNForceT.m" "batchGetPostCnCtNacelleYaw.m" "batchGetPostCnCtFluentYaw60.m" "batchGetPostCnCtFluentYaw45.m" "batchGetPostCnCtFluentYaw45.asv" "batchGetPostCnCtFluentYaw30.m" "batchGetPostCnCtFluentYaw25.m" "batchGetPostCnCtFluentYaw20.m" "batchGetPostCnCtFluentYaw15.m" "batchGetPostCnCtFluentYaw0.m" "batchGetPostCnCt.m" "axiaB.tif" "axiaA.tif" "averageCpStatistics.m" "averageCpFluent.m" "averageCp.m" "angleDistribution.tif" "a.csv" "8435moment.csv" "8435Immitate.xlsx" "8435forceMoment.csv" "8435All.csv" "60momenttimestep.csv" "5momenttimestep.csv" "30momenttimestep.csv" "30-1.0-1.0r.tif" "30-1.0-0.5r.tif" "30-0.75-1.0r.tif" "30-0.75-0。5r.tif" "30-0.75-0.5r.tif" "30-0.5-1.0r.tif" "30-0.5-0.5r.tif" "30-0.3-1.0r.tif" "30-0.3-0.5r.tif" "30-0-1.0r.tif" "30-0-0.5r.tif" "25momenttimestep.csv" "25.tif" "20momenttimestep.csv" "2.tif" "15momenttimestep.csv" "10momenttimestep.csv" "1.0-1.0r.tif" "1.0-0.5r.tif" "0momenttimestep.csv" "00momenttimestep.csv" "0.75-1.0r.tif" "0.75-0.5r.tif" "0.5-1.0r.tif" "0.5-0.5.tif" "0.3-1.0r.tif" "0.3-0.5r.tif" "0-360transient/" "0-1.0r.tif" "0-0.5r.tif" "../" "./") + ("c:/Users/yzl/AppData/Roaming/.emacs.d/CalendarDairy/" (23207 18728 0 0) "diary.org" "../" "./") - ("c:/Users/yzl/AppData/Roaming/.emacs.d/" (23369 32243 0 0) "vimish-fold/" "url/" "themes/" "testMind3.org" "testMind3.html" "testLisp.lisp" "test.ledger" "test.el" "srecode-map.el" "snippets/" "slidetemplate.org" "slidetemplate.html" "server/" "README.tex" "README.md" "projectile.cache" "projectile-bookmarks.eld" "ncepublack.jpg" "ncepu.jpg" "ledger_3.1.1_win_bin/" "ispell/" "init.el" "ido.last~" "ido.last" "hello-graphviz.png" "GTD/" "geiser-history.racket" "geiser-history.chez" "eshell/" "emms/" "elpa/" "elisp-tutor.el" "diary" "customizations/" "custom.el" "cider-history" "CalendarDairy/" "bookmarks" "backups/" "auto-save-list/" "ag.exe" "abbrev_defs" ".smex-items" ".session" ".recentf~" ".recentf" ".python-environments/" ".orgConf.el" ".org-id-locations" ".mc-lists.el" ".gitmodules" ".gitignore" ".git/" "#init.el#" "../" "./") + ("c:/Users/yzl/AppData/Roaming/.emacs.d/" (23392 9451 0 0) "vimish-fold/" "url/" "themes/" "testMind3.org" "testMind3.html" "testLisp.lisp" "test.ledger" "test.el" "srecode-map.el" "snippets/" "slidetemplate.org" "slidetemplate.html" "server/" "README.tex" "README.md" "projectile.cache" "projectile-bookmarks.eld" "ncepublack.jpg" "ncepu.jpg" "ledger_3.1.1_win_bin/" "ispell/" "init.el" "ido.last~" "ido.last" "hello-graphviz.png" "GTD/" "geiser-history.racket" "geiser-history.chez" "eshell/" "emms/" "elpa/" "elisp-tutor.el" "diary" "customizations/" "custom.el" "cider-history" "CalendarDairy/" "bookmarks" "backups/" "auto-save-list/" "ag.exe" "abbrev_defs" ".smex-items" ".session" ".recentf~" ".recentf" ".python-environments/" ".orgConf.el" ".org-id-locations" ".mc-lists.el" ".gitmodules" ".gitignore" ".git/" "#init.el#" "../" "./") ("c:/Users/yzl/AppData/Roaming/.emacs.d/GTD/org_Brain/" (23370 12731 0 0) "调研.org" "背景.org" "网格无关性.org" "结果.org" "科研论文.org" "湍流模型.org" "方法.org" "参考文献.org" "一个idea.org" "URANS时间步无关性.org" "T-SST.org" "SST.org" "SICP.org" "SA.org" "ReynoldStress.org" "k-omega.org" "K-e.org" "Appendence.org" "../" "./") @@ -34,8 +34,6 @@ ("c:/Users/yzl/AppData/Roaming/.emacs.d/customizations/" (23336 31009 0 0) "ui.el" "shell-integration.el" "setupsbcl.el" "setup-rust.el" "setup-ruby-mode.el" "setup-python.el" "setup-ledger.el" "setup-js.el" "setup-git.el" "setup-find-file-in-project.el" "setup-emms.el" "setup-dashboard.el" "setup-clojure.el" "scheme-editing.el" "ruby-end.el" "quicklisp.lisp" "protocol.reg" "pip/" "perl-editing.el" "org-listcruncher.el" "orca.el" "navigation.el" "misc.el" "magnars/" "img/" "highlight-indentation.el" "git-timemachine.el" "fortran-index-args.el" "fortran-editing.el" "font-lock+.el" "find-file-in-project.el" "emacs-presentation-mode/" "elisp-editing.el" "editing.el" "counsel-org-clock/" "aspell.rar" "alphapapa/" "../" "./") - ("c:/Users/yzl/AppData/Roaming/.emacs.d/CalendarDairy/" (23336 31009 0 0) "diary.org" "../" "./") - ("c:/Users/yzl/AppData/Roaming/.emacs.d/auto-save-list/" (23336 41232 0 0) ".saves-5140-DESKTOP-MVNHR6D~" "../" "./") ("k:/clojure-home/" (23336 28813 0 0) "untitled/" "undead/" "the-joy-of-clojure/" "testClojure.iml" "test-tentacles/" "test-exception/" "test-clojure1/" "src/" "sotclojureAndelisp.clj" "reveal.js/" "parens-of-the-dead/" "mysql/" "my-app/" "luminus-template/" "luminus/" "LightTable/" "lib/" "hello.org" "hello.md" "hello.lisp" "hello.el" "first-example/" "examples/" "emacs-26.1-x86_64/" "emacs-25.3-x86_64/" "emacs-25.2-x86_64/" "emacs-24.5-bin-i686-mingw32/" "emacs-23.4/" "dot-files/" "clojure-snippets/" "clojure-20180110.iws" "clojure-20180110.ipr" "clojure-20180110.iml" "clojure/" "clj-new-github/" "book-source/" "ack" "a.rs" "a.py" "a.org" "a.md" "a.html" "a.el" ".idea/" ".gnus.el" "../" "./") diff --git a/init.el b/init.el index 3a0387c..429d62f 100644 --- a/init.el +++ b/init.el @@ -269,6 +269,7 @@ (load "setup-git.el") ;(load "orca.el") ;(load "org-wiki.el") +(load "doom-todo-ivy.el") (load "org-listcruncher.el") ;(load "org-sidebar.el") @@ -324,7 +325,7 @@ ("~/.emacs.d/GTD/OrgBoss/Journal/2017100011" "~/.emacs.d/GTD/OrgBoss/Journal/20180129" "~/.emacs.d/GTD/OrgBoss/Journal/20180130" "~/.emacs.d/GTD/OrgBoss/Journal/20180131" "~/.emacs.d/GTD/OrgBoss/Journal/20180201" "~/.emacs.d/GTD/OrgBoss/Journal/20180202" "~/.emacs.d/GTD/OrgBoss/Journal/20180203" "~/.emacs.d/GTD/OrgBoss/Journal/20180204" "~/.emacs.d/GTD/OrgBoss/Journal/20180205" "~/.emacs.d/GTD/OrgBoss/Journal/20180206" "~/.emacs.d/GTD/OrgBoss/Journal/20180207" "~/.emacs.d/GTD/OrgBoss/Journal/20180208" "~/.emacs.d/GTD/OrgBoss/Journal/20180209" "~/.emacs.d/GTD/OrgBoss/Journal/20180213" "~/.emacs.d/GTD/OrgBoss/Journal/20180214" "~/.emacs.d/GTD/OrgBoss/Journal/20180215" "~/.emacs.d/GTD/OrgBoss/Journal/20180220" "~/.emacs.d/GTD/OrgBoss/Journal/20180222" "~/.emacs.d/GTD/OrgBoss/Journal/20180225" "~/.emacs.d/GTD/OrgBoss/Journal/20180226" "~/.emacs.d/GTD/OrgBoss/Journal/20180228" "~/.emacs.d/GTD/OrgBoss/Journal/20180303" "~/.emacs.d/GTD/OrgBoss/Journal/20180304" "~/.emacs.d/GTD/OrgBoss/Journal/20180306" "~/.emacs.d/GTD/OrgBoss/Journal/20180307" "~/.emacs.d/GTD/OrgBoss/Journal/20180308" "~/.emacs.d/GTD/OrgBoss/Journal/20180311" "~/.emacs.d/GTD/OrgBoss/Journal/20180313" "~/.emacs.d/GTD/OrgBoss/Journal/20180315" "~/.emacs.d/GTD/OrgBoss/Journal/20180317" "~/.emacs.d/GTD/OrgBoss/Journal/20180318" "~/.emacs.d/GTD/OrgBoss/Journal/20180320" "~/.emacs.d/GTD/OrgBoss/Journal/20180401" "~/.emacs.d/GTD/OrgBoss/Journal/20180402" "~/.emacs.d/GTD/OrgBoss/Journal/20180424" "~/.emacs.d/GTD/OrgBoss/Journal/20180425" "~/.emacs.d/GTD/OrgBoss/Journal/20180426" "~/.emacs.d/GTD/OrgBoss/Journal/20180427" "~/.emacs.d/GTD/OrgBoss/Journal/20180501" "~/.emacs.d/GTD/OrgBoss/Journal/20180502" "~/.emacs.d/GTD/OrgBoss/Journal/20180503" "~/.emacs.d/GTD/OrgBoss/Journal/20180504" "~/.emacs.d/GTD/OrgBoss/Journal/20180507" "~/.emacs.d/GTD/OrgBoss/Journal/20180509" "~/.emacs.d/GTD/OrgBoss/Journal/20180531" "~/.emacs.d/GTD/OrgBoss/Journal/20180601" "~/.emacs.d/GTD/OrgBoss/Journal/20180602" "~/.emacs.d/GTD/OrgBoss/Journal/20180612" "~/.emacs.d/GTD/OrgBoss/Journal/20180613" "~/.emacs.d/GTD/OrgBoss/Journal/20180614" "~/.emacs.d/GTD/OrgBoss/Journal/20180620" "~/.emacs.d/GTD/OrgBoss/Journal/20180621" "~/.emacs.d/GTD/OrgBoss/Journal/20180622" "~/.emacs.d/GTD/OrgBoss/Journal/20180623" "~/.emacs.d/GTD/orgBoss/newgtd.org" "~/.emacs.d/GTD/orgBoss/Book/book.org" "~/.emacs.d/GTD/orgBoss/Clipboard/clipboard.org" "~/.emacs.d/GTD/orgBoss/DailyReview/daily.org" "~/.emacs.d/GTD/orgBoss/Financial/finances.org" "~/.emacs.d/GTD/orgBoss/Film/film.org" "~/.emacs.d/GTD/orgBoss/IDEA/idea.org" "~/.emacs.d/GTD/orgBoss/Journal/journal.org" "~/.emacs.d/GTD/orgBoss/Private/privnotes.org" "~/.emacs.d/GTD/orgBoss/Someday/someday.org" "~/.emacs.d/GTD/orgBoss/Vocab/vocab.org" "~/.emacs.d/GTD/orgBoss/Site/www.site.org" "~/.emacs.d/GTD/orgBoss/writing.org" "~/.emacs.d/GTD/orgBoss/Habit/habits.org" "~/.emacs.d/GTD/Dissertation.org" "~/.emacs.d/GTD/thesis-proposal.org"))) '(package-selected-packages (quote - (wrap-region howm deft ace-link 4clojure evil-vimish-fold origami scribble-mode ac-geiser geiser srcery-theme ascii-art-to-unicode visual-ascii-mode org-brain suggest counsel-world-clock ivy-yasnippet helpful abyss-theme ledger-mode flycheck-ledger org-agenda-property org-link-minor-mode org-dashboard dashboard page-break-lines writeroom-mode writegood-mode poporg org-mru-clock epresent xpm window-numbering evil-matchit evil-visualstar evil-escape git-timemachine git-gutter org-wild-notifier dumb-diff dumb-jump fringe-current-line ag python-mode find-file-in-project highlight-indentation elpy ruby-end ruby-tools ruby-refactor cljr-helm org-bookmark-heading nyan-mode org-alert org-mind-map spaceline dired-narrow dired-ranger dired-rainbow dired-icon dired-subtree emms sotclojure sotlisp ox-reveal org-tree-slide pretty-symbols org-journal org-autolist org-babel-eval-in-repl org-bullets request-deferred fortpy web-mode flycheck-pos-tip flycheck-clojure counsel-projectile spacemacs-theme w3m use-package engine-mode simplezen zencoding-mode js2-mode move-text highlight-escape-sequences htmlize dired-details+ dired+ ace-jump-mode paredit-menu iy-go-to-char key-chord string-edit flycheck-perl6 company-anaconda company cal-china-x image+ 2048-game 0xc ivy-rich all-the-icons-ivy all-the-icons-dired ivy-dired-history ivy smart-mode-line mo-git-blame evil-surround markdown-mode+ scheme-complete chicken-scheme 0blayout org-plus-contrib cl-lib-highlight tagedit smex rainbow-delimiters projectile paredit magit ido-ubiquitous exec-path-from-shell clojure-mode-extra-font-locking cider))) + (clj-refactor doom-todo-ivy wrap-region howm deft ace-link 4clojure evil-vimish-fold origami scribble-mode ac-geiser geiser srcery-theme ascii-art-to-unicode visual-ascii-mode org-brain suggest counsel-world-clock ivy-yasnippet helpful abyss-theme ledger-mode flycheck-ledger org-agenda-property org-link-minor-mode org-dashboard dashboard page-break-lines writeroom-mode writegood-mode poporg org-mru-clock epresent xpm window-numbering evil-visualstar git-timemachine git-gutter org-wild-notifier dumb-diff fringe-current-line ag python-mode find-file-in-project highlight-indentation elpy ruby-end ruby-tools ruby-refactor cljr-helm org-bookmark-heading nyan-mode org-alert org-mind-map spaceline dired-narrow dired-rainbow dired-icon dired-subtree emms sotclojure sotlisp ox-reveal org-tree-slide pretty-symbols org-journal org-autolist org-babel-eval-in-repl org-bullets request-deferred fortpy web-mode flycheck-clojure counsel-projectile spacemacs-theme w3m use-package simplezen zencoding-mode move-text highlight-escape-sequences dired-details+ dired+ ace-jump-mode paredit-menu iy-go-to-char key-chord string-edit flycheck-perl6 company-anaconda company cal-china-x image+ 2048-game 0xc ivy-rich all-the-icons-ivy all-the-icons-dired ivy-dired-history ivy smart-mode-line mo-git-blame evil-surround markdown-mode+ scheme-complete chicken-scheme 0blayout org-plus-contrib cl-lib-highlight tagedit smex rainbow-delimiters projectile paredit magit ido-ubiquitous clojure-mode-extra-font-locking cider))) '(send-mail-function (quote smtpmail-send-it)) '(session-use-package t nil (session)) '(smtpmail-smtp-server "smtp.163.com") diff --git a/projectile.cache b/projectile.cache index 6902385..5e4069b 100644 --- a/projectile.cache +++ b/projectile.cache @@ -1,2 +1,2 @@ -#s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ("c:/Users/yzl/AppData/Roaming/.emacs.d/" ("elpa/wrap-region-20140116.2320/wrap-region-autoloads.el" "GTD/orgBoss/Journal/20180204.org" "GTD/txtSetup.org" "GTD/orgBoss/Journal/2017100011.org" "GTD/orgBoss/Journal/20180214.org" "elpa/deft-20180619.857/deft.el" "elpa/cider-20180723.712/cider-autoloads.el" "elpa/company-20180723.928/company-autoloads.el" "elpa/counsel-20180723.854/counsel-autoloads.el" "elpa/ess-20180723.1428/ess-autoloads.el" "elpa/evil-20180723.543/evil-autoloads.el" "elpa/flycheck-clojure-20180721.712/flycheck-clojure-autoloads.el" "elpa/helpful-20180723.1543/helpful-autoloads.el" "elpa/ivy-20180723.846/ivy-autoloads.el" "elpa/magit-20180723.1158/magit-autoloads.el" "elpa/org-journal-20180723.57/org-journal-autoloads.el" "elpa/projectile-20180721.352/projectile-autoloads.el" "elpa/python-mode-20180721.1147/python-mode-autoloads.el" "elpa/suggest-20180722.350/suggest-autoloads.el" "elpa/howm-20180225.205/howm-autoloads.el" "GTD/orgBoss/Journal/20180724" "GTD/2018-07-24T0431.txt" "elpa/deft-20180619.857/deft-autoloads.el" "elpa/counsel-projectile-20180718.842/counsel-projectile-autoloads.el" "elpa/elisp-refs-20180715.1602/elisp-refs-autoloads.el" "elpa/elpy-20180720.155/elpy-autoloads.el" "elpa/flycheck-20180720.247/flycheck-autoloads.el" "elpa/ghub-20180715.1159/ghub-autoloads.el" "elpa/git-commit-20180713.1444/git-commit-autoloads.el" "elpa/pyvenv-20180720.214/pyvenv-autoloads.el" "elpa/sesman-20180719.213/sesman-autoloads.el" "GTD/orgBoss/myfit.org" "GTD/orgBoss/myWork0.org" "elpa/swiper-20180713.946/swiper-autoloads.el" "elpa/use-package-20180715.1101/use-package-autoloads.el" "GTD/org_Brain/公司.org" "elpa/clj-refactor-20180708.57/clj-refactor-autoloads.el" "elpa/clojure-mode-20180709.648/clojure-mode-autoloads.el" "elpa/dashboard-20180704.2325/dashboard-autoloads.el" "elpa/dracula-theme-20180710.624/dracula-theme-autoloads.el" "elpa/emms-20180708.1823/emms-autoloads.el" "elpa/find-file-in-project-20180705.1832/find-file-in-project-autoloads.el" "elpa/hydra-20180703.802/hydra-autoloads.el" "elpa/ivy-rich-20180704.1845/ivy-rich-autoloads.el" "elpa/ledger-mode-20180705.138/ledger-mode-autoloads.el" "elpa/markdown-mode-20180707.555/markdown-mode-autoloads.el" "elpa/org-brain-20180712.1410/org-brain-autoloads.el" "elpa/sotlisp-20180706.1049/sotlisp-autoloads.el" "GTD/orgBoss/Journal/20180710" "README.tex" "elpa/ace-link-20180308.100/ace-link-autoloads.el" "GTD/orgBoss/Journal/20180709" "GTD/orgBoss/mywork30.org" "GTD/orgBoss/Journal/20180706" "elpa/4clojure-20131014.1507/4clojure-autoloads.el" "GTD/orgBoss/myWork5.org" "GTD/orgBoss/myWork15.org" "GTD/orgBoss/myWorkfluentYaw15.org" "snippets/org-mode/myDir" "snippets/org-mode/myProperty" "GTD/orgBoss/myWork.org" "GTD/orgBoss/Journal/20180705" "elpa/evil-vimish-fold-20171030.451/evil-vimish-fold-autoloads.el" "elpa/vimish-fold-20171231.2212/vimish-fold-autoloads.el" "elpa/origami-20180101.753/origami-autoloads.el" "GTD/scheme/sicp-init.rkt" "GTD/scheme/gstd.scrbl" "elpa/scribble-mode-20160124.1528/scribble-mode-autoloads.el" "GTD/hello.rkt" "GTD/hello.scm" "elpa/ac-geiser-20130928.2347/ac-geiser-autoloads.el" "elpa/geiser-20180626.440/geiser-autoloads.el" "GTD/org_Brain/SICP.org" "GTD/org-ref/bibliography/体验式培训:超级过山车.pdf" "GTD/org-ref/bibliography/references1.bib" "GTD/org-ref/bibliography/references.bib" "elpa/tablist-20170219.1935/tablist-autoloads.el" "elpa/abyss-theme-20170808.645/abyss-theme-autoloads.el" "elpa/cider-20180701.1420/cider-autoloads.el" "elpa/clojure-mode-20180629.1500/clojure-mode-autoloads.el" "elpa/counsel-20180625.634/counsel-autoloads.el" "elpa/elpy-20180629.513/elpy-autoloads.el" "elpa/emms-20180702.257/emms-autoloads.el" "elpa/ess-20180703.54/ess-autoloads.el" "elpa/evil-escape-20180623.2019/evil-escape-autoloads.el" "elpa/expand-region-20180625.939/expand-region-autoloads.el" "elpa/find-file-in-project-20180626.1809/find-file-in-project-autoloads.el" "elpa/helpful-20180630.257/helpful-autoloads.el" "elpa/ido-completing-read+-20180627.1944/ido-completing-read+-autoloads.el" "elpa/ivy-20180626.1345/ivy-autoloads.el" "elpa/ivy-rich-20180621.1920/ivy-rich-autoloads.el" "elpa/ivy-yasnippet-20180620.2336/ivy-yasnippet-autoloads.el" "elpa/js2-mode-20180627.744/js2-mode-autoloads.el" "elpa/ledger-mode-20180622.2148/ledger-mode-autoloads.el" "elpa/srcery-theme-20180623.619/srcery-theme-autoloads.el" "elpa/markdown-mode-20180619.1015/markdown-mode-autoloads.el" "elpa/projectile-20180630.111/projectile-autoloads.el" "elpa/shut-up-20180628.1130/shut-up-autoloads.el" "elpa/web-mode-20180628.422/web-mode-autoloads.el" "elpa/which-key-20180621.1238/which-key-autoloads.el" "elpa/yasnippet-20180620.1750/yasnippet-autoloads.el" "elpa/ascii-art-to-unicode-1.12/ascii-art-to-unicode-autoloads.el" "elpa/visual-ascii-mode-20150129.246/visual-ascii-mode-autoloads.el" "GTD/org_Brain/科研论文.org" "GTD/org_Brain/ReynoldStress.org" "GTD/org_Brain/K-e.org" "GTD/org_Brain/SA.org" "GTD/org_Brain/T-SST.org" "GTD/org_Brain/SST.org" "GTD/org_Brain/k-omega.org" "GTD/org_Brain/URANS时间步无关性.org" "GTD/org_Brain/网格无关性.org" "GTD/org_Brain/湍流模型.org" "elpa/org-brain-20180522.717/org-brain.el" "GTD/org_Brain/Appendence.org" "GTD/org_Brain/参考文献.org" "GTD/org_Brain/结果.org" "GTD/org_Brain/方法.org" "GTD/org_Brain/一个idea.org" "GTD/org_Brain/调研.org" "GTD/org_Brain/背景.org" "GTD/org_Brain/da.org" "GTD/org_Brain/nil.org" "GTD/org_Brain/father.org" "GTD/org_Brain/hi.org" "elpa/org-brain-20180522.717/org-brain-autoloads.el" "test.el" "elpa/counsel-world-clock-20171201.2337/counsel-world-clock-autoloads.el" "elpa/loop-20160813.707/loop-autoloads.el" "elpa/shut-up-20150423.522/shut-up-autoloads.el" "GTD/orgBoss/Journal/20180623" "GTD/orgBoss/Journal/20180622" "GTD/orgBoss/Journal/20180621" "GTD/orgBoss/Journal/20180620" "elpa/avy-20180615.801/avy-autoloads.el" "elpa/company-20180615.1508/company-autoloads.el" "elpa/dumb-jump-20180615.2114/dumb-jump-autoloads.el" "elpa/magit-20180618.1554/magit-autoloads.el" "elpa/magit-popup-20180618.1602/magit-popup-autoloads.el" "elpa/markdown-mode-20180616.1858/markdown-mode-autoloads.el" "elpa/memoize-20180614.1230/memoize-autoloads.el" "elpa/multiple-cursors-20180615.518/multiple-cursors-autoloads.el" "elpa/org-mind-map-20180614.1352/org-mind-map-autoloads.el" "elpa/projectile-20180616.252/projectile-autoloads.el" "elpa/swiper-20180615.1400/swiper-autoloads.el" "elpa/use-package-20180613.2219/use-package-autoloads.el" "elpa/with-editor-20180618.1602/with-editor-autoloads.el" "elpa/ace-window-20180607.1223/ace-window-autoloads.el" "elpa/avy-20180612.212/avy-autoloads.el" "elpa/bind-key-20180512.2130/bind-key-autoloads.el" "elpa/cider-20180611.2335/cider-autoloads.el" "elpa/clj-refactor-20180526.803/clj-refactor-autoloads.el" "elpa/company-20180501.11/company-autoloads.el" "elpa/counsel-20180608.955/counsel-autoloads.el" "elpa/counsel-projectile-20180527.1328/counsel-projectile-autoloads.el" "elpa/dracula-theme-20180517.556/dracula-theme-autoloads.el" "elpa/dumb-jump-20180602.109/dumb-jump-autoloads.el" "elpa/emms-20180613.2043/emms-autoloads.el" "elpa/ess-20180613.1621/ess-autoloads.el" "elpa/evil-matchit-20180526.557/evil-matchit-autoloads.el" "elpa/flycheck-20180611.1549/flycheck-autoloads.el" "elpa/flycheck-pos-tip-20180610.915/flycheck-pos-tip-autoloads.el" "elpa/hlinum-20180421.2112/hlinum-autoloads.el" "elpa/htmlize-20180412.1244/htmlize-autoloads.el" "elpa/hydra-20180508.1008/hydra-autoloads.el" "elpa/ivy-20180613.1343/ivy-autoloads.el" "elpa/magit-20180612.1617/magit-autoloads.el" "elpa/async-20180527.1030/async-autoloads.el" "elpa/ghub-20180607.2101/ghub-autoloads.el" "elpa/dash-20180413.30/dash-autoloads.el" "elpa/magit-popup-20180509.1041/magit-popup-autoloads.el" "elpa/markdown-mode-20180607.913/markdown-mode-autoloads.el" "elpa/org-alert-20180523.1833/org-alert-autoloads.el" "elpa/org-mru-clock-20180419.606/org-mru-clock-autoloads.el" "elpa/org-tree-slide-20180424.1636/org-tree-slide-autoloads.el" "elpa/org-wc-20180609.1953/org-wc-autoloads.el" "elpa/projectile-20180602.2253/projectile-autoloads.el" "elpa/swiper-20180613.1343/swiper-autoloads.el" "elpa/use-package-20180613.1349/use-package-autoloads.el" "elpa/visual-fill-column-20180511.211/visual-fill-column-autoloads.el" "elpa/web-mode-20180608.113/web-mode-autoloads.el" "elpa/which-key-20180608.551/which-key-autoloads.el" "elpa/with-editor-20180414.757/with-editor-autoloads.el" "elpa/writegood-mode-20180525.643/writegood-mode-autoloads.el" "elpa/yasnippet-20180606.1722/yasnippet-autoloads.el" "GTD/orgBoss/Journal/20180614" "GTD/orgBoss/Journal/20180613" "customizations/setup-ledger.el" "test.ledger" "elpa/flycheck-ledger-20180125.31/flycheck-ledger-autoloads.el" "GTD/orgBoss/Journal/20180612" "elpa/define-word-20180327.1935/define-word-autoloads.el" "GTD/orgBoss/Journal/20180602" "GTD/orgBoss/Journal/20180601" "GTD/orgBoss/Journal/20180531" "elpa/dash-functional-20180107.818/dash-functional-autoloads.el" "customizations/alphapapa/org-agenda-ng.el" "elpa/org-agenda-property-20140626.1416/org-agenda-property-autoloads.el" "GTD/orgBoss/dfeich-lisp-babel.org" "GTD/orgBoss/elisp-cal.org" "GTD/orgBoss/dfeich-tables.org" "snippets/org-mode/listcruncher" "GTD/orgBoss/how-to-use-Org-Babel-for-R.org" "GTD/orgBoss/library-of-babel.org" "GTD/orgBoss/listcruncher-grouped.png" "GTD/orgBoss/dfreich-lob.org" "GTD/orgBoss/READMEForListCruncher.org" "GTD/orgBoss/listcrunchertest.org" "elpa/org-link-minor-mode-20170805.1152/org-link-minor-mode-autoloads.el" "elpa/org-caldav-20180403.1336/org-caldav-autoloads.el" "GTD/orgBoss/reproductive-research-and-software-development-methods-for-management-tasks.org" "GTD/orgBoss/org-dashboard.org" "GTD/orgBoss/code-snippets.org" "customizations/setup-dashboard.el" "elpa/org-dashboard-20171223.1124/org-dashboard-autoloads.el" "elpa/dashboard-20180328.807/dashboard-autoloads.el" "elpa/page-break-lines-20171210.31/page-break-lines-autoloads.el" "GTD/dynamicyaw.org" "GTD/staticYaw.org" "GTD/staticYaw.org.gpg" "GTD/NumericaStaticYaw.org" "elpa/writeroom-mode-20170623.327/writeroom-mode-autoloads.el" "test.org" "GTD/writingtest.org" "elpa/wc-mode-20170126.2029/wc-mode-autoloads.el" "GTD/orgBoss/CiteSpace/citeShare.html" "GTD/orgBoss/CiteSpace/citeShare.org" "GTD/newgtd.org" "GTD/orgBoss/Journal/20180509" "elpa/poporg-20170403.51/poporg-autoloads.el" "GTD/orgBoss/Journal/20180507" "GTD/orgBoss/Journal/20180504" "GTD/testSlide.org_archive" "slidetemplate.org" "snippets/org-mode/revealfortitle" "snippets/org-mode/reveal -revealpropertydatastate" "snippets/org-mode/test.org" "GTD/orgBoss/Journal/20180503" "snippets/org-mode/table3" "snippets/org-mode/table2" "hello-graphviz.png" "GTD/orgBoss/Journal/20180502.html" "GTD/orgBoss/Journal/20180502" "testMind3.org" "GTD/testXmind2.org" "GTD/testXmind.org" "GTD/ModifyIntro.org" ".gitignore" ".mc-lists.el" ".orgConf.el" ".python-environments/default/Include/Python-ast.h" ".python-environments/default/Include/Python.h" ".python-environments/default/Include/abstract.h" ".python-environments/default/Include/asdl.h" ".python-environments/default/Include/ast.h" ".python-environments/default/Include/bitset.h" ".python-environments/default/Include/boolobject.h" ".python-environments/default/Include/bufferobject.h" ".python-environments/default/Include/bytearrayobject.h" ".python-environments/default/Include/bytes_methods.h" ".python-environments/default/Include/bytesobject.h" ".python-environments/default/Include/cStringIO.h" ".python-environments/default/Include/cellobject.h" ".python-environments/default/Include/ceval.h" ".python-environments/default/Include/classobject.h" ".python-environments/default/Include/cobject.h" ".python-environments/default/Include/code.h" ".python-environments/default/Include/codecs.h" ".python-environments/default/Include/compile.h" ".python-environments/default/Include/complexobject.h" ".python-environments/default/Include/datetime.h" ".python-environments/default/Include/descrobject.h" ".python-environments/default/Include/dictobject.h" ".python-environments/default/Include/dtoa.h" ".python-environments/default/Include/enumobject.h" ".python-environments/default/Include/errcode.h" ".python-environments/default/Include/eval.h" ".python-environments/default/Include/fileobject.h" ".python-environments/default/Include/floatobject.h" ".python-environments/default/Include/frameobject.h" ".python-environments/default/Include/funcobject.h" ".python-environments/default/Include/genobject.h" ".python-environments/default/Include/graminit.h" ".python-environments/default/Include/grammar.h" ".python-environments/default/Include/import.h" ".python-environments/default/Include/intobject.h" ".python-environments/default/Include/intrcheck.h" ".python-environments/default/Include/iterobject.h" ".python-environments/default/Include/listobject.h" ".python-environments/default/Include/longintrepr.h" ".python-environments/default/Include/longobject.h" ".python-environments/default/Include/marshal.h" ".python-environments/default/Include/memoryobject.h" ".python-environments/default/Include/metagrammar.h" ".python-environments/default/Include/methodobject.h" ".python-environments/default/Include/modsupport.h" ".python-environments/default/Include/moduleobject.h" ".python-environments/default/Include/node.h" ".python-environments/default/Include/object.h" ".python-environments/default/Include/objimpl.h" ".python-environments/default/Include/opcode.h" ".python-environments/default/Include/osdefs.h" ".python-environments/default/Include/parsetok.h" ".python-environments/default/Include/patchlevel.h" ".python-environments/default/Include/pgen.h" ".python-environments/default/Include/pgenheaders.h" ".python-environments/default/Include/py_curses.h" ".python-environments/default/Include/pyarena.h" ".python-environments/default/Include/pycapsule.h" ".python-environments/default/Include/pyconfig.h" ".python-environments/default/Include/pyctype.h" ".python-environments/default/Include/pydebug.h" ".python-environments/default/Include/pyerrors.h" ".python-environments/default/Include/pyexpat.h" ".python-environments/default/Include/pyfpe.h" ".python-environments/default/Include/pygetopt.h" ".python-environments/default/Include/pymacconfig.h" ".python-environments/default/Include/pymactoolbox.h" ".python-environments/default/Include/pymath.h" ".python-environments/default/Include/pymem.h" ".python-environments/default/Include/pyport.h" ".python-environments/default/Include/pystate.h" ".python-environments/default/Include/pystrcmp.h" ".python-environments/default/Include/pystrtod.h" ".python-environments/default/Include/pythonrun.h" ".python-environments/default/Include/pythread.h" ".python-environments/default/Include/rangeobject.h" ".python-environments/default/Include/setobject.h" ".python-environments/default/Include/sliceobject.h" ".python-environments/default/Include/stringobject.h" ".python-environments/default/Include/structmember.h" ".python-environments/default/Include/structseq.h" ".python-environments/default/Include/symtable.h" ".python-environments/default/Include/sysmodule.h" ".python-environments/default/Include/timefuncs.h" ".python-environments/default/Include/token.h" ".python-environments/default/Include/traceback.h" ".python-environments/default/Include/tupleobject.h" ".python-environments/default/Include/ucnhash.h" ".python-environments/default/Include/unicodeobject.h" ".python-environments/default/Include/warnings.h" ".python-environments/default/Include/weakrefobject.h" ".python-environments/default/Lib/UserDict.py" ".python-environments/default/Lib/UserDict.pyc" ".python-environments/default/Lib/_abcoll.py" ".python-environments/default/Lib/_abcoll.pyc" ".python-environments/default/Lib/_weakrefset.py" ".python-environments/default/Lib/_weakrefset.pyc" ".python-environments/default/Lib/abc.py" ".python-environments/default/Lib/abc.pyc" ".python-environments/default/Lib/codecs.py" ".python-environments/default/Lib/codecs.pyc" ".python-environments/default/Lib/copy_reg.py" ".python-environments/default/Lib/copy_reg.pyc" ".python-environments/default/Lib/distutils/__init__.py" ".python-environments/default/Lib/distutils/__init__.pyc" ".python-environments/default/Lib/distutils/distutils.cfg" ".python-environments/default/Lib/encodings/__init__.py" ".python-environments/default/Lib/encodings/__init__.pyc" ".python-environments/default/Lib/encodings/aliases.py" ".python-environments/default/Lib/encodings/aliases.pyc" ".python-environments/default/Lib/encodings/ascii.py" ".python-environments/default/Lib/encodings/ascii.pyc" ".python-environments/default/Lib/encodings/base64_codec.py" ".python-environments/default/Lib/encodings/big5.py" ".python-environments/default/Lib/encodings/big5hkscs.py" ".python-environments/default/Lib/encodings/bz2_codec.py" ".python-environments/default/Lib/encodings/charmap.py" ".python-environments/default/Lib/encodings/cp037.py" ".python-environments/default/Lib/encodings/cp1006.py" ".python-environments/default/Lib/encodings/cp1026.py" ".python-environments/default/Lib/encodings/cp1140.py" ".python-environments/default/Lib/encodings/cp1250.py" ".python-environments/default/Lib/encodings/cp1251.py" ".python-environments/default/Lib/encodings/cp1252.py" ".python-environments/default/Lib/encodings/cp1253.py" ".python-environments/default/Lib/encodings/cp1254.py" ".python-environments/default/Lib/encodings/cp1255.py" ".python-environments/default/Lib/encodings/cp1256.py" ".python-environments/default/Lib/encodings/cp1257.py" ".python-environments/default/Lib/encodings/cp1258.py" ".python-environments/default/Lib/encodings/cp424.py" ".python-environments/default/Lib/encodings/cp437.py" ".python-environments/default/Lib/encodings/cp500.py" ".python-environments/default/Lib/encodings/cp720.py" ".python-environments/default/Lib/encodings/cp737.py" ".python-environments/default/Lib/encodings/cp775.py" ".python-environments/default/Lib/encodings/cp850.py" ".python-environments/default/Lib/encodings/cp852.py" ".python-environments/default/Lib/encodings/cp855.py" ".python-environments/default/Lib/encodings/cp856.py" ".python-environments/default/Lib/encodings/cp857.py" ".python-environments/default/Lib/encodings/cp858.py" ".python-environments/default/Lib/encodings/cp860.py" ".python-environments/default/Lib/encodings/cp861.py" ".python-environments/default/Lib/encodings/cp862.py" ".python-environments/default/Lib/encodings/cp863.py" ".python-environments/default/Lib/encodings/cp864.py" ".python-environments/default/Lib/encodings/cp865.py" ".python-environments/default/Lib/encodings/cp866.py" ".python-environments/default/Lib/encodings/cp869.py" ".python-environments/default/Lib/encodings/cp874.py" ".python-environments/default/Lib/encodings/cp875.py" ".python-environments/default/Lib/encodings/cp932.py" ".python-environments/default/Lib/encodings/cp949.py" ".python-environments/default/Lib/encodings/cp950.py" ".python-environments/default/Lib/encodings/euc_jis_2004.py" ".python-environments/default/Lib/encodings/euc_jisx0213.py" ".python-environments/default/Lib/encodings/euc_jp.py" ".python-environments/default/Lib/encodings/euc_kr.py" ".python-environments/default/Lib/encodings/gb18030.py" ".python-environments/default/Lib/encodings/gb2312.py" ".python-environments/default/Lib/encodings/gbk.py" ".python-environments/default/Lib/encodings/gbk.pyc" ".python-environments/default/Lib/encodings/hex_codec.py" ".python-environments/default/Lib/encodings/hp_roman8.py" ".python-environments/default/Lib/encodings/hz.py" ".python-environments/default/Lib/encodings/idna.py" ".python-environments/default/Lib/encodings/idna.pyc" ".python-environments/default/Lib/encodings/iso2022_jp.py" ".python-environments/default/Lib/encodings/iso2022_jp_1.py" ".python-environments/default/Lib/encodings/iso2022_jp_2.py" ".python-environments/default/Lib/encodings/iso2022_jp_2004.py" ".python-environments/default/Lib/encodings/iso2022_jp_3.py" ".python-environments/default/Lib/encodings/iso2022_jp_ext.py" ".python-environments/default/Lib/encodings/iso2022_kr.py" ".python-environments/default/Lib/encodings/iso8859_1.py" ".python-environments/default/Lib/encodings/iso8859_10.py" ".python-environments/default/Lib/encodings/iso8859_11.py" ".python-environments/default/Lib/encodings/iso8859_13.py" ".python-environments/default/Lib/encodings/iso8859_14.py" ".python-environments/default/Lib/encodings/iso8859_15.py" ".python-environments/default/Lib/encodings/iso8859_16.py" ".python-environments/default/Lib/encodings/iso8859_2.py" ".python-environments/default/Lib/encodings/iso8859_3.py" ".python-environments/default/Lib/encodings/iso8859_4.py" ".python-environments/default/Lib/encodings/iso8859_5.py" ".python-environments/default/Lib/encodings/iso8859_6.py" ".python-environments/default/Lib/encodings/iso8859_7.py" ".python-environments/default/Lib/encodings/iso8859_8.py" ".python-environments/default/Lib/encodings/iso8859_9.py" ".python-environments/default/Lib/encodings/johab.py" ".python-environments/default/Lib/encodings/koi8_r.py" ".python-environments/default/Lib/encodings/koi8_u.py" ".python-environments/default/Lib/encodings/latin_1.py" ".python-environments/default/Lib/encodings/latin_1.pyc" ".python-environments/default/Lib/encodings/mac_arabic.py" ".python-environments/default/Lib/encodings/mac_centeuro.py" ".python-environments/default/Lib/encodings/mac_croatian.py" ".python-environments/default/Lib/encodings/mac_cyrillic.py" ".python-environments/default/Lib/encodings/mac_farsi.py" ".python-environments/default/Lib/encodings/mac_greek.py" ".python-environments/default/Lib/encodings/mac_iceland.py" ".python-environments/default/Lib/encodings/mac_latin2.py" ".python-environments/default/Lib/encodings/mac_roman.py" ".python-environments/default/Lib/encodings/mac_romanian.py" ".python-environments/default/Lib/encodings/mac_turkish.py" ".python-environments/default/Lib/encodings/mbcs.py" ".python-environments/default/Lib/encodings/mbcs.pyc" ".python-environments/default/Lib/encodings/palmos.py" ".python-environments/default/Lib/encodings/ptcp154.py" ".python-environments/default/Lib/encodings/punycode.py" ".python-environments/default/Lib/encodings/quopri_codec.py" ".python-environments/default/Lib/encodings/raw_unicode_escape.py" ".python-environments/default/Lib/encodings/rot_13.py" ".python-environments/default/Lib/encodings/shift_jis.py" ".python-environments/default/Lib/encodings/shift_jis_2004.py" ".python-environments/default/Lib/encodings/shift_jisx0213.py" ".python-environments/default/Lib/encodings/string_escape.py" ".python-environments/default/Lib/encodings/string_escape.pyc" ".python-environments/default/Lib/encodings/tis_620.py" ".python-environments/default/Lib/encodings/undefined.py" ".python-environments/default/Lib/encodings/unicode_escape.py" ".python-environments/default/Lib/encodings/unicode_internal.py" ".python-environments/default/Lib/encodings/utf_16.py" ".python-environments/default/Lib/encodings/utf_16_be.py" ".python-environments/default/Lib/encodings/utf_16_be.pyc" ".python-environments/default/Lib/encodings/utf_16_le.py" ".python-environments/default/Lib/encodings/utf_16_le.pyc" ".python-environments/default/Lib/encodings/utf_32.py" ".python-environments/default/Lib/encodings/utf_32_be.py" ".python-environments/default/Lib/encodings/utf_32_be.pyc" ".python-environments/default/Lib/encodings/utf_32_le.py" ".python-environments/default/Lib/encodings/utf_7.py" ".python-environments/default/Lib/encodings/utf_8.py" ".python-environments/default/Lib/encodings/utf_8.pyc" ".python-environments/default/Lib/encodings/utf_8_sig.py" ".python-environments/default/Lib/encodings/uu_codec.py" ".python-environments/default/Lib/encodings/zlib_codec.py" ".python-environments/default/Lib/fnmatch.py" ".python-environments/default/Lib/fnmatch.pyc" ".python-environments/default/Lib/genericpath.py" ".python-environments/default/Lib/genericpath.pyc" ".python-environments/default/Lib/linecache.py" ".python-environments/default/Lib/linecache.pyc" ".python-environments/default/Lib/locale.py" ".python-environments/default/Lib/locale.pyc" ".python-environments/default/Lib/ntpath.py" ".python-environments/default/Lib/ntpath.pyc" ".python-environments/default/Lib/orig-prefix.txt" ".python-environments/default/Lib/os.py" ".python-environments/default/Lib/os.pyc" ".python-environments/default/Lib/posixpath.py" ".python-environments/default/Lib/posixpath.pyc" ".python-environments/default/Lib/re.py" ".python-environments/default/Lib/re.pyc" ".python-environments/default/Lib/site-packages/dateutil/__init__.py" ".python-environments/default/Lib/site-packages/dateutil/__init__.pyc" ".python-environments/default/Lib/site-packages/dateutil/_common.py" ".python-environments/default/Lib/site-packages/dateutil/_common.pyc" ".python-environments/default/Lib/site-packages/dateutil/_version.py" ".python-environments/default/Lib/site-packages/dateutil/_version.pyc" ".python-environments/default/Lib/site-packages/dateutil/easter.py" ".python-environments/default/Lib/site-packages/dateutil/easter.pyc" ".python-environments/default/Lib/site-packages/dateutil/parser.py" ".python-environments/default/Lib/site-packages/dateutil/parser.pyc" ".python-environments/default/Lib/site-packages/dateutil/relativedelta.py" ".python-environments/default/Lib/site-packages/dateutil/relativedelta.pyc" ".python-environments/default/Lib/site-packages/dateutil/rrule.py" ".python-environments/default/Lib/site-packages/dateutil/rrule.pyc" ".python-environments/default/Lib/site-packages/dateutil/tz/__init__.py" ".python-environments/default/Lib/site-packages/dateutil/tz/__init__.pyc" ".python-environments/default/Lib/site-packages/dateutil/tz/_common.py" ".python-environments/default/Lib/site-packages/dateutil/tz/_common.pyc" ".python-environments/default/Lib/site-packages/dateutil/tz/tz.py" ".python-environments/default/Lib/site-packages/dateutil/tz/tz.pyc" ".python-environments/default/Lib/site-packages/dateutil/tz/win.py" ".python-environments/default/Lib/site-packages/dateutil/tz/win.pyc" ".python-environments/default/Lib/site-packages/dateutil/tzwin.py" ".python-environments/default/Lib/site-packages/dateutil/tzwin.pyc" ".python-environments/default/Lib/site-packages/dateutil/zoneinfo/__init__.py" ".python-environments/default/Lib/site-packages/dateutil/zoneinfo/__init__.pyc" ".python-environments/default/Lib/site-packages/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz" ".python-environments/default/Lib/site-packages/dateutil/zoneinfo/rebuild.py" ".python-environments/default/Lib/site-packages/dateutil/zoneinfo/rebuild.pyc" ".python-environments/default/Lib/site-packages/easy_install.py" ".python-environments/default/Lib/site-packages/easy_install.pyc" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/METADATA" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/RECORD" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/entry_points.txt" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/top_level.txt" ".python-environments/default/Lib/site-packages/fortpyepcserver.py" ".python-environments/default/Lib/site-packages/fortpyepcserver.pyc" ".python-environments/default/Lib/site-packages/pip/__init__.py" ".python-environments/default/Lib/site-packages/pip/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/__main__.py" ".python-environments/default/Lib/site-packages/pip/__main__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/appdirs.py" ".python-environments/default/Lib/site-packages/pip/_vendor/appdirs.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/adapter.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/cache.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/cache.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/compat.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/compat.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/controller.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/controller.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/serialize.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/ansi.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/ansi.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/ansitowin32.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/ansitowin32.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/initialise.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/initialise.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/win32.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/win32.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/winterm.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/winterm.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/misc.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/misc.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/compat.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/compat.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/database.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/database.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/index.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/index.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/locators.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/locators.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/manifest.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/manifest.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/markers.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/markers.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/metadata.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/metadata.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/resources.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/resources.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/scripts.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/scripts.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/t32.exe" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/t64.exe" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/util.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/util.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/version.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/version.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/w32.exe" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/w64.exe" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/wheel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/wheel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distro.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distro.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_ihatexml.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_ihatexml.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_inputstream.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_inputstream.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_tokenizer.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_tokenizer.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/_base.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/_base.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/datrie.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/datrie.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/py.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/py.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_utils.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_utils.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/constants.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/constants.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/base.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/base.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/lint.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/lint.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/optionaltags.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/optionaltags.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/sanitizer.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/sanitizer.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/whitespace.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/whitespace.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/html5parser.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/html5parser.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/serializer.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/serializer.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/genshi.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/sax.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/sax.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/base.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/base.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/dom.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/dom.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/base.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/base.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/dom.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/dom.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree_lxml.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree_lxml.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/genshi.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/genshi.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/ipaddress.py" ".python-environments/default/Lib/site-packages/pip/_vendor/ipaddress.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/linklockfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/linklockfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/mkdirlockfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/mkdirlockfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/pidlockfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/pidlockfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/sqlitelockfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/sqlitelockfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/symlinklockfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/symlinklockfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/ordereddict.py" ".python-environments/default/Lib/site-packages/pip/_vendor/ordereddict.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/__about__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/__about__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/_compat.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/_compat.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/_structures.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/_structures.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/markers.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/markers.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/requirements.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/requirements.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/specifiers.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/specifiers.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/utils.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/utils.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/version.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/version.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/pkg_resources/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/bar.py" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/bar.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/counter.py" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/counter.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/helpers.py" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/helpers.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/spinner.py" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/spinner.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/pyparsing.py" ".python-environments/default/Lib/site-packages/pip/_vendor/pyparsing.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/re-vendor.py" ".python-environments/default/Lib/site-packages/pip/_vendor/re-vendor.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/adapters.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/adapters.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/api.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/api.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/auth.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/auth.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/cacert.pem" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/certs.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/certs.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/compat.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/compat.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/cookies.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/cookies.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/exceptions.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/exceptions.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/hooks.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/hooks.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/models.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/models.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/big5freq.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/big5prober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/big5prober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardetect.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/compat.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/compat.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/constants.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/constants.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/escprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/escprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/escsm.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/escsm.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhungarianmodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhungarianmodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/_collections.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/connection.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/connection.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/fields.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/fields.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/filepost.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/request.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/request.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/response.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/response.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/request.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/response.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/url.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/sessions.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/sessions.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/status_codes.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/status_codes.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/structures.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/structures.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/utils.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/utils.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/retrying.py" ".python-environments/default/Lib/site-packages/pip/_vendor/retrying.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/six.py" ".python-environments/default/Lib/site-packages/pip/_vendor/six.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/labels.py" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/labels.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/mklabels.py" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/mklabels.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/tests.py" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/tests.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/x_user_defined.py" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/x_user_defined.pyc" ".python-environments/default/Lib/site-packages/pip/basecommand.py" ".python-environments/default/Lib/site-packages/pip/basecommand.pyc" ".python-environments/default/Lib/site-packages/pip/baseparser.py" ".python-environments/default/Lib/site-packages/pip/baseparser.pyc" ".python-environments/default/Lib/site-packages/pip/cmdoptions.py" ".python-environments/default/Lib/site-packages/pip/cmdoptions.pyc" ".python-environments/default/Lib/site-packages/pip/commands/__init__.py" ".python-environments/default/Lib/site-packages/pip/commands/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/commands/check.py" ".python-environments/default/Lib/site-packages/pip/commands/check.pyc" ".python-environments/default/Lib/site-packages/pip/commands/completion.py" ".python-environments/default/Lib/site-packages/pip/commands/completion.pyc" ".python-environments/default/Lib/site-packages/pip/commands/download.py" ".python-environments/default/Lib/site-packages/pip/commands/download.pyc" ".python-environments/default/Lib/site-packages/pip/commands/freeze.py" ".python-environments/default/Lib/site-packages/pip/commands/freeze.pyc" ".python-environments/default/Lib/site-packages/pip/commands/hash.py" ".python-environments/default/Lib/site-packages/pip/commands/hash.pyc" ".python-environments/default/Lib/site-packages/pip/commands/help.py" ".python-environments/default/Lib/site-packages/pip/commands/help.pyc" ".python-environments/default/Lib/site-packages/pip/commands/install.py" ".python-environments/default/Lib/site-packages/pip/commands/install.pyc" ".python-environments/default/Lib/site-packages/pip/commands/list.py" ".python-environments/default/Lib/site-packages/pip/commands/list.pyc" ".python-environments/default/Lib/site-packages/pip/commands/search.py" ".python-environments/default/Lib/site-packages/pip/commands/search.pyc" ".python-environments/default/Lib/site-packages/pip/commands/show.py" ".python-environments/default/Lib/site-packages/pip/commands/show.pyc" ".python-environments/default/Lib/site-packages/pip/commands/uninstall.py" ".python-environments/default/Lib/site-packages/pip/commands/uninstall.pyc" ".python-environments/default/Lib/site-packages/pip/commands/wheel.py" ".python-environments/default/Lib/site-packages/pip/commands/wheel.pyc" ".python-environments/default/Lib/site-packages/pip/compat/__init__.py" ".python-environments/default/Lib/site-packages/pip/compat/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/compat/dictconfig.py" ".python-environments/default/Lib/site-packages/pip/compat/dictconfig.pyc" ".python-environments/default/Lib/site-packages/pip/download.py" ".python-environments/default/Lib/site-packages/pip/download.pyc" ".python-environments/default/Lib/site-packages/pip/exceptions.py" ".python-environments/default/Lib/site-packages/pip/exceptions.pyc" ".python-environments/default/Lib/site-packages/pip/index.py" ".python-environments/default/Lib/site-packages/pip/index.pyc" ".python-environments/default/Lib/site-packages/pip/locations.py" ".python-environments/default/Lib/site-packages/pip/locations.pyc" ".python-environments/default/Lib/site-packages/pip/models/__init__.py" ".python-environments/default/Lib/site-packages/pip/models/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/models/index.py" ".python-environments/default/Lib/site-packages/pip/models/index.pyc" ".python-environments/default/Lib/site-packages/pip/operations/__init__.py" ".python-environments/default/Lib/site-packages/pip/operations/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/operations/check.py" ".python-environments/default/Lib/site-packages/pip/operations/check.pyc" ".python-environments/default/Lib/site-packages/pip/operations/freeze.py" ".python-environments/default/Lib/site-packages/pip/operations/freeze.pyc" ".python-environments/default/Lib/site-packages/pip/pep425tags.py" ".python-environments/default/Lib/site-packages/pip/pep425tags.pyc" ".python-environments/default/Lib/site-packages/pip/req/__init__.py" ".python-environments/default/Lib/site-packages/pip/req/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/req/req_file.py" ".python-environments/default/Lib/site-packages/pip/req/req_file.pyc" ".python-environments/default/Lib/site-packages/pip/req/req_install.py" ".python-environments/default/Lib/site-packages/pip/req/req_install.pyc" ".python-environments/default/Lib/site-packages/pip/req/req_set.py" ".python-environments/default/Lib/site-packages/pip/req/req_set.pyc" ".python-environments/default/Lib/site-packages/pip/req/req_uninstall.py" ".python-environments/default/Lib/site-packages/pip/req/req_uninstall.pyc" ".python-environments/default/Lib/site-packages/pip/status_codes.py" ".python-environments/default/Lib/site-packages/pip/status_codes.pyc" ".python-environments/default/Lib/site-packages/pip/utils/__init__.py" ".python-environments/default/Lib/site-packages/pip/utils/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/utils/appdirs.py" ".python-environments/default/Lib/site-packages/pip/utils/appdirs.pyc" ".python-environments/default/Lib/site-packages/pip/utils/build.py" ".python-environments/default/Lib/site-packages/pip/utils/build.pyc" ".python-environments/default/Lib/site-packages/pip/utils/deprecation.py" ".python-environments/default/Lib/site-packages/pip/utils/deprecation.pyc" ".python-environments/default/Lib/site-packages/pip/utils/encoding.py" ".python-environments/default/Lib/site-packages/pip/utils/encoding.pyc" ".python-environments/default/Lib/site-packages/pip/utils/filesystem.py" ".python-environments/default/Lib/site-packages/pip/utils/filesystem.pyc" ".python-environments/default/Lib/site-packages/pip/utils/glibc.py" ".python-environments/default/Lib/site-packages/pip/utils/glibc.pyc" ".python-environments/default/Lib/site-packages/pip/utils/hashes.py" ".python-environments/default/Lib/site-packages/pip/utils/hashes.pyc" ".python-environments/default/Lib/site-packages/pip/utils/logging.py" ".python-environments/default/Lib/site-packages/pip/utils/logging.pyc" ".python-environments/default/Lib/site-packages/pip/utils/outdated.py" ".python-environments/default/Lib/site-packages/pip/utils/outdated.pyc" ".python-environments/default/Lib/site-packages/pip/utils/packaging.py" ".python-environments/default/Lib/site-packages/pip/utils/packaging.pyc" ".python-environments/default/Lib/site-packages/pip/utils/setuptools_build.py" ".python-environments/default/Lib/site-packages/pip/utils/setuptools_build.pyc" ".python-environments/default/Lib/site-packages/pip/utils/ui.py" ".python-environments/default/Lib/site-packages/pip/utils/ui.pyc" ".python-environments/default/Lib/site-packages/pip/vcs/__init__.py" ".python-environments/default/Lib/site-packages/pip/vcs/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/vcs/bazaar.py" ".python-environments/default/Lib/site-packages/pip/vcs/bazaar.pyc" ".python-environments/default/Lib/site-packages/pip/vcs/git.py" ".python-environments/default/Lib/site-packages/pip/vcs/git.pyc" ".python-environments/default/Lib/site-packages/pip/vcs/mercurial.py" ".python-environments/default/Lib/site-packages/pip/vcs/mercurial.pyc" ".python-environments/default/Lib/site-packages/pip/vcs/subversion.py" ".python-environments/default/Lib/site-packages/pip/vcs/subversion.pyc" ".python-environments/default/Lib/site-packages/pip/wheel.py" ".python-environments/default/Lib/site-packages/pip/wheel.pyc" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/METADATA" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/RECORD" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/entry_points.txt" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/top_level.txt" ".python-environments/default/Lib/site-packages/pkg_resources/__init__.py" ".python-environments/default/Lib/site-packages/pkg_resources/__init__.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/__init__.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/__init__.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/appdirs.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/appdirs.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/__about__.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/__about__.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/__init__.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/__init__.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/_compat.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/_compat.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/markers.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/markers.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/utils.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/utils.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/version.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/version.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/pyparsing.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/pyparsing.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/six.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/six.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/extern/__init__.py" ".python-environments/default/Lib/site-packages/pkg_resources/extern/__init__.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/py31compat.py" ".python-environments/default/Lib/site-packages/pkg_resources/py31compat.pyc" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/METADATA" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/RECORD" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/top_level.txt" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/zip-safe" ".python-environments/default/Lib/site-packages/setuptools/__init__.py" ".python-environments/default/Lib/site-packages/setuptools/__init__.pyc" ".python-environments/default/Lib/site-packages/setuptools/archive_util.py" ".python-environments/default/Lib/site-packages/setuptools/archive_util.pyc" ".python-environments/default/Lib/site-packages/setuptools/cli-32.exe" ".python-environments/default/Lib/site-packages/setuptools/cli-64.exe" ".python-environments/default/Lib/site-packages/setuptools/cli.exe" ".python-environments/default/Lib/site-packages/setuptools/command/__init__.py" ".python-environments/default/Lib/site-packages/setuptools/command/__init__.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/alias.py" ".python-environments/default/Lib/site-packages/setuptools/command/alias.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_egg.py" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_egg.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_rpm.py" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_rpm.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_wininst.py" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_wininst.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/build_clib.py" ".python-environments/default/Lib/site-packages/setuptools/command/build_clib.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/build_ext.py" ".python-environments/default/Lib/site-packages/setuptools/command/build_ext.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/build_py.py" ".python-environments/default/Lib/site-packages/setuptools/command/build_py.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/develop.py" ".python-environments/default/Lib/site-packages/setuptools/command/develop.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/easy_install.py" ".python-environments/default/Lib/site-packages/setuptools/command/easy_install.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/egg_info.py" ".python-environments/default/Lib/site-packages/setuptools/command/egg_info.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/install.py" ".python-environments/default/Lib/site-packages/setuptools/command/install.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/install_egg_info.py" ".python-environments/default/Lib/site-packages/setuptools/command/install_egg_info.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/install_lib.py" ".python-environments/default/Lib/site-packages/setuptools/command/install_lib.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/install_scripts.py" ".python-environments/default/Lib/site-packages/setuptools/command/install_scripts.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/launcher manifest.xml" ".python-environments/default/Lib/site-packages/setuptools/command/py36compat.py" ".python-environments/default/Lib/site-packages/setuptools/command/py36compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/register.py" ".python-environments/default/Lib/site-packages/setuptools/command/register.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/rotate.py" ".python-environments/default/Lib/site-packages/setuptools/command/rotate.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/saveopts.py" ".python-environments/default/Lib/site-packages/setuptools/command/saveopts.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/sdist.py" ".python-environments/default/Lib/site-packages/setuptools/command/sdist.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/setopt.py" ".python-environments/default/Lib/site-packages/setuptools/command/setopt.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/test.py" ".python-environments/default/Lib/site-packages/setuptools/command/test.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/upload.py" ".python-environments/default/Lib/site-packages/setuptools/command/upload.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/upload_docs.py" ".python-environments/default/Lib/site-packages/setuptools/command/upload_docs.pyc" ".python-environments/default/Lib/site-packages/setuptools/config.py" ".python-environments/default/Lib/site-packages/setuptools/config.pyc" ".python-environments/default/Lib/site-packages/setuptools/dep_util.py" ".python-environments/default/Lib/site-packages/setuptools/dep_util.pyc" ".python-environments/default/Lib/site-packages/setuptools/depends.py" ".python-environments/default/Lib/site-packages/setuptools/depends.pyc" ".python-environments/default/Lib/site-packages/setuptools/dist.py" ".python-environments/default/Lib/site-packages/setuptools/dist.pyc" ".python-environments/default/Lib/site-packages/setuptools/extension.py" ".python-environments/default/Lib/site-packages/setuptools/extension.pyc" ".python-environments/default/Lib/site-packages/setuptools/extern/__init__.py" ".python-environments/default/Lib/site-packages/setuptools/extern/__init__.pyc" ".python-environments/default/Lib/site-packages/setuptools/glob.py" ".python-environments/default/Lib/site-packages/setuptools/glob.pyc" ".python-environments/default/Lib/site-packages/setuptools/gui-32.exe" ".python-environments/default/Lib/site-packages/setuptools/gui-64.exe" ".python-environments/default/Lib/site-packages/setuptools/gui.exe" ".python-environments/default/Lib/site-packages/setuptools/launch.py" ".python-environments/default/Lib/site-packages/setuptools/launch.pyc" ".python-environments/default/Lib/site-packages/setuptools/lib2to3_ex.py" ".python-environments/default/Lib/site-packages/setuptools/lib2to3_ex.pyc" ".python-environments/default/Lib/site-packages/setuptools/monkey.py" ".python-environments/default/Lib/site-packages/setuptools/monkey.pyc" ".python-environments/default/Lib/site-packages/setuptools/msvc.py" ".python-environments/default/Lib/site-packages/setuptools/msvc.pyc" ".python-environments/default/Lib/site-packages/setuptools/namespaces.py" ".python-environments/default/Lib/site-packages/setuptools/namespaces.pyc" ".python-environments/default/Lib/site-packages/setuptools/package_index.py" ".python-environments/default/Lib/site-packages/setuptools/package_index.pyc" ".python-environments/default/Lib/site-packages/setuptools/py26compat.py" ".python-environments/default/Lib/site-packages/setuptools/py26compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/py27compat.py" ".python-environments/default/Lib/site-packages/setuptools/py27compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/py31compat.py" ".python-environments/default/Lib/site-packages/setuptools/py31compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/py33compat.py" ".python-environments/default/Lib/site-packages/setuptools/py33compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/py36compat.py" ".python-environments/default/Lib/site-packages/setuptools/py36compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/sandbox.py" ".python-environments/default/Lib/site-packages/setuptools/sandbox.pyc" ".python-environments/default/Lib/site-packages/setuptools/script (dev).tmpl" ".python-environments/default/Lib/site-packages/setuptools/script.tmpl" ".python-environments/default/Lib/site-packages/setuptools/site-patch.py" ".python-environments/default/Lib/site-packages/setuptools/site-patch.pyc" ".python-environments/default/Lib/site-packages/setuptools/ssl_support.py" ".python-environments/default/Lib/site-packages/setuptools/ssl_support.pyc" ".python-environments/default/Lib/site-packages/setuptools/unicode_utils.py" ".python-environments/default/Lib/site-packages/setuptools/unicode_utils.pyc" ".python-environments/default/Lib/site-packages/setuptools/version.py" ".python-environments/default/Lib/site-packages/setuptools/version.pyc" ".python-environments/default/Lib/site-packages/setuptools/windows_support.py" ".python-environments/default/Lib/site-packages/setuptools/windows_support.pyc" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/METADATA" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/RECORD" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/dependency_links.txt" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/entry_points.txt" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/top_level.txt" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/zip-safe" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/METADATA" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/RECORD" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/top_level.txt" ".python-environments/default/Lib/site-packages/six.py" ".python-environments/default/Lib/site-packages/six.pyc" ".python-environments/default/Lib/site-packages/wheel/__init__.py" ".python-environments/default/Lib/site-packages/wheel/__init__.pyc" ".python-environments/default/Lib/site-packages/wheel/__main__.py" ".python-environments/default/Lib/site-packages/wheel/__main__.pyc" ".python-environments/default/Lib/site-packages/wheel/archive.py" ".python-environments/default/Lib/site-packages/wheel/archive.pyc" ".python-environments/default/Lib/site-packages/wheel/bdist_wheel.py" ".python-environments/default/Lib/site-packages/wheel/bdist_wheel.pyc" ".python-environments/default/Lib/site-packages/wheel/decorator.py" ".python-environments/default/Lib/site-packages/wheel/decorator.pyc" ".python-environments/default/Lib/site-packages/wheel/egg2wheel.py" ".python-environments/default/Lib/site-packages/wheel/egg2wheel.pyc" ".python-environments/default/Lib/site-packages/wheel/install.py" ".python-environments/default/Lib/site-packages/wheel/install.pyc" ".python-environments/default/Lib/site-packages/wheel/metadata.py" ".python-environments/default/Lib/site-packages/wheel/metadata.pyc" ".python-environments/default/Lib/site-packages/wheel/paths.py" ".python-environments/default/Lib/site-packages/wheel/paths.pyc" ".python-environments/default/Lib/site-packages/wheel/pep425tags.py" ".python-environments/default/Lib/site-packages/wheel/pep425tags.pyc" ".python-environments/default/Lib/site-packages/wheel/pkginfo.py" ".python-environments/default/Lib/site-packages/wheel/pkginfo.pyc" ".python-environments/default/Lib/site-packages/wheel/signatures/__init__.py" ".python-environments/default/Lib/site-packages/wheel/signatures/__init__.pyc" ".python-environments/default/Lib/site-packages/wheel/signatures/djbec.py" ".python-environments/default/Lib/site-packages/wheel/signatures/djbec.pyc" ".python-environments/default/Lib/site-packages/wheel/signatures/ed25519py.py" ".python-environments/default/Lib/site-packages/wheel/signatures/ed25519py.pyc" ".python-environments/default/Lib/site-packages/wheel/signatures/keys.py" ".python-environments/default/Lib/site-packages/wheel/signatures/keys.pyc" ".python-environments/default/Lib/site-packages/wheel/tool/__init__.py" ".python-environments/default/Lib/site-packages/wheel/tool/__init__.pyc" ".python-environments/default/Lib/site-packages/wheel/util.py" ".python-environments/default/Lib/site-packages/wheel/util.pyc" ".python-environments/default/Lib/site-packages/wheel/wininst2wheel.py" ".python-environments/default/Lib/site-packages/wheel/wininst2wheel.pyc" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/LICENSE.txt" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/METADATA" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/RECORD" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/entry_points.txt" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/top_level.txt" ".python-environments/default/Lib/site.py" ".python-environments/default/Lib/site.pyc" ".python-environments/default/Lib/sre.py" ".python-environments/default/Lib/sre_compile.py" ".python-environments/default/Lib/sre_compile.pyc" ".python-environments/default/Lib/sre_constants.py" ".python-environments/default/Lib/sre_constants.pyc" ".python-environments/default/Lib/sre_parse.py" ".python-environments/default/Lib/sre_parse.pyc" ".python-environments/default/Lib/stat.py" ".python-environments/default/Lib/stat.pyc" ".python-environments/default/Lib/types.py" ".python-environments/default/Lib/types.pyc" ".python-environments/default/Lib/warnings.py" ".python-environments/default/Lib/warnings.pyc" ".python-environments/default/Scripts/activate" ".python-environments/default/Scripts/activate.bat" ".python-environments/default/Scripts/activate.ps1" ".python-environments/default/Scripts/activate_this.py" ".python-environments/default/Scripts/deactivate.bat" ".python-environments/default/Scripts/easy_install-2.7.exe" ".python-environments/default/Scripts/easy_install.exe" ".python-environments/default/Scripts/fortpyepcserver.exe" ".python-environments/default/Scripts/pip.exe" ".python-environments/default/Scripts/pip2.7.exe" ".python-environments/default/Scripts/pip2.exe" ".python-environments/default/Scripts/python.exe" ".python-environments/default/Scripts/pythonw.exe" ".python-environments/default/Scripts/wheel.exe" ".python-environments/default/pip-selfcheck.json" ".python-environments/default/tcl/tcl8.5/auto.tcl" ".python-environments/default/tcl/tcl8.5/clock.tcl" ".python-environments/default/tcl/tcl8.5/encoding/ascii.enc" ".python-environments/default/tcl/tcl8.5/encoding/big5.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1250.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1251.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1252.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1253.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1254.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1255.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1256.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1257.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1258.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp437.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp737.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp775.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp850.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp852.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp855.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp857.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp860.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp861.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp862.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp863.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp864.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp865.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp866.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp869.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp874.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp932.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp936.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp949.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp950.enc" ".python-environments/default/tcl/tcl8.5/encoding/dingbats.enc" ".python-environments/default/tcl/tcl8.5/encoding/ebcdic.enc" ".python-environments/default/tcl/tcl8.5/encoding/euc-cn.enc" ".python-environments/default/tcl/tcl8.5/encoding/euc-jp.enc" ".python-environments/default/tcl/tcl8.5/encoding/euc-kr.enc" ".python-environments/default/tcl/tcl8.5/encoding/gb12345.enc" ".python-environments/default/tcl/tcl8.5/encoding/gb1988.enc" ".python-environments/default/tcl/tcl8.5/encoding/gb2312-raw.enc" ".python-environments/default/tcl/tcl8.5/encoding/gb2312.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso2022-jp.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso2022-kr.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso2022.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-1.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-10.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-13.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-14.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-15.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-16.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-2.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-3.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-4.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-5.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-6.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-7.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-8.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-9.enc" ".python-environments/default/tcl/tcl8.5/encoding/jis0201.enc" ".python-environments/default/tcl/tcl8.5/encoding/jis0208.enc" ".python-environments/default/tcl/tcl8.5/encoding/jis0212.enc" ".python-environments/default/tcl/tcl8.5/encoding/koi8-r.enc" ".python-environments/default/tcl/tcl8.5/encoding/koi8-u.enc" ".python-environments/default/tcl/tcl8.5/encoding/ksc5601.enc" ".python-environments/default/tcl/tcl8.5/encoding/macCentEuro.enc" ".python-environments/default/tcl/tcl8.5/encoding/macCroatian.enc" ".python-environments/default/tcl/tcl8.5/encoding/macCyrillic.enc" ".python-environments/default/tcl/tcl8.5/encoding/macDingbats.enc" ".python-environments/default/tcl/tcl8.5/encoding/macGreek.enc" ".python-environments/default/tcl/tcl8.5/encoding/macIceland.enc" ".python-environments/default/tcl/tcl8.5/encoding/macJapan.enc" ".python-environments/default/tcl/tcl8.5/encoding/macRoman.enc" ".python-environments/default/tcl/tcl8.5/encoding/macRomania.enc" ".python-environments/default/tcl/tcl8.5/encoding/macThai.enc" ".python-environments/default/tcl/tcl8.5/encoding/macTurkish.enc" ".python-environments/default/tcl/tcl8.5/encoding/macUkraine.enc" ".python-environments/default/tcl/tcl8.5/encoding/shiftjis.enc" ".python-environments/default/tcl/tcl8.5/encoding/symbol.enc" ".python-environments/default/tcl/tcl8.5/encoding/tis-620.enc" ".python-environments/default/tcl/tcl8.5/history.tcl" ".python-environments/default/tcl/tcl8.5/http1.0/http.tcl" ".python-environments/default/tcl/tcl8.5/http1.0/pkgIndex.tcl" ".python-environments/default/tcl/tcl8.5/init.tcl" ".python-environments/default/tcl/tcl8.5/msgs/af.msg" ".python-environments/default/tcl/tcl8.5/msgs/af_za.msg" ".python-environments/default/tcl/tcl8.5/msgs/ar.msg" ".python-environments/default/tcl/tcl8.5/msgs/ar_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/ar_jo.msg" ".python-environments/default/tcl/tcl8.5/msgs/ar_lb.msg" ".python-environments/default/tcl/tcl8.5/msgs/ar_sy.msg" ".python-environments/default/tcl/tcl8.5/msgs/be.msg" ".python-environments/default/tcl/tcl8.5/msgs/bg.msg" ".python-environments/default/tcl/tcl8.5/msgs/bn.msg" ".python-environments/default/tcl/tcl8.5/msgs/bn_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/ca.msg" ".python-environments/default/tcl/tcl8.5/msgs/cs.msg" ".python-environments/default/tcl/tcl8.5/msgs/da.msg" ".python-environments/default/tcl/tcl8.5/msgs/de.msg" ".python-environments/default/tcl/tcl8.5/msgs/de_at.msg" ".python-environments/default/tcl/tcl8.5/msgs/de_be.msg" ".python-environments/default/tcl/tcl8.5/msgs/el.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_au.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_be.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_bw.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_ca.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_gb.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_hk.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_ie.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_nz.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_ph.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_sg.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_za.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_zw.msg" ".python-environments/default/tcl/tcl8.5/msgs/eo.msg" ".python-environments/default/tcl/tcl8.5/msgs/es.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_ar.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_bo.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_cl.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_co.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_cr.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_do.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_ec.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_gt.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_hn.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_mx.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_ni.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_pa.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_pe.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_pr.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_py.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_sv.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_uy.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_ve.msg" ".python-environments/default/tcl/tcl8.5/msgs/et.msg" ".python-environments/default/tcl/tcl8.5/msgs/eu.msg" ".python-environments/default/tcl/tcl8.5/msgs/eu_es.msg" ".python-environments/default/tcl/tcl8.5/msgs/fa.msg" ".python-environments/default/tcl/tcl8.5/msgs/fa_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/fa_ir.msg" ".python-environments/default/tcl/tcl8.5/msgs/fi.msg" ".python-environments/default/tcl/tcl8.5/msgs/fo.msg" ".python-environments/default/tcl/tcl8.5/msgs/fo_fo.msg" ".python-environments/default/tcl/tcl8.5/msgs/fr.msg" ".python-environments/default/tcl/tcl8.5/msgs/fr_be.msg" ".python-environments/default/tcl/tcl8.5/msgs/fr_ca.msg" ".python-environments/default/tcl/tcl8.5/msgs/fr_ch.msg" ".python-environments/default/tcl/tcl8.5/msgs/ga.msg" ".python-environments/default/tcl/tcl8.5/msgs/ga_ie.msg" ".python-environments/default/tcl/tcl8.5/msgs/gl.msg" ".python-environments/default/tcl/tcl8.5/msgs/gl_es.msg" ".python-environments/default/tcl/tcl8.5/msgs/gv.msg" ".python-environments/default/tcl/tcl8.5/msgs/gv_gb.msg" ".python-environments/default/tcl/tcl8.5/msgs/he.msg" ".python-environments/default/tcl/tcl8.5/msgs/hi.msg" ".python-environments/default/tcl/tcl8.5/msgs/hi_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/hr.msg" ".python-environments/default/tcl/tcl8.5/msgs/hu.msg" ".python-environments/default/tcl/tcl8.5/msgs/id.msg" ".python-environments/default/tcl/tcl8.5/msgs/id_id.msg" ".python-environments/default/tcl/tcl8.5/msgs/is.msg" ".python-environments/default/tcl/tcl8.5/msgs/it.msg" ".python-environments/default/tcl/tcl8.5/msgs/it_ch.msg" ".python-environments/default/tcl/tcl8.5/msgs/ja.msg" ".python-environments/default/tcl/tcl8.5/msgs/kl.msg" ".python-environments/default/tcl/tcl8.5/msgs/kl_gl.msg" ".python-environments/default/tcl/tcl8.5/msgs/ko.msg" ".python-environments/default/tcl/tcl8.5/msgs/ko_kr.msg" ".python-environments/default/tcl/tcl8.5/msgs/kok.msg" ".python-environments/default/tcl/tcl8.5/msgs/kok_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/kw.msg" ".python-environments/default/tcl/tcl8.5/msgs/kw_gb.msg" ".python-environments/default/tcl/tcl8.5/msgs/lt.msg" ".python-environments/default/tcl/tcl8.5/msgs/lv.msg" ".python-environments/default/tcl/tcl8.5/msgs/mk.msg" ".python-environments/default/tcl/tcl8.5/msgs/mr.msg" ".python-environments/default/tcl/tcl8.5/msgs/mr_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/ms.msg" ".python-environments/default/tcl/tcl8.5/msgs/ms_my.msg" ".python-environments/default/tcl/tcl8.5/msgs/mt.msg" ".python-environments/default/tcl/tcl8.5/msgs/nb.msg" ".python-environments/default/tcl/tcl8.5/msgs/nl.msg" ".python-environments/default/tcl/tcl8.5/msgs/nl_be.msg" ".python-environments/default/tcl/tcl8.5/msgs/nn.msg" ".python-environments/default/tcl/tcl8.5/msgs/pl.msg" ".python-environments/default/tcl/tcl8.5/msgs/pt.msg" ".python-environments/default/tcl/tcl8.5/msgs/pt_br.msg" ".python-environments/default/tcl/tcl8.5/msgs/ro.msg" ".python-environments/default/tcl/tcl8.5/msgs/ru.msg" ".python-environments/default/tcl/tcl8.5/msgs/ru_ua.msg" ".python-environments/default/tcl/tcl8.5/msgs/sh.msg" ".python-environments/default/tcl/tcl8.5/msgs/sk.msg" ".python-environments/default/tcl/tcl8.5/msgs/sl.msg" ".python-environments/default/tcl/tcl8.5/msgs/sq.msg" ".python-environments/default/tcl/tcl8.5/msgs/sr.msg" ".python-environments/default/tcl/tcl8.5/msgs/sv.msg" ".python-environments/default/tcl/tcl8.5/msgs/sw.msg" ".python-environments/default/tcl/tcl8.5/msgs/ta.msg" ".python-environments/default/tcl/tcl8.5/msgs/ta_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/te.msg" ".python-environments/default/tcl/tcl8.5/msgs/te_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/th.msg" ".python-environments/default/tcl/tcl8.5/msgs/tr.msg" ".python-environments/default/tcl/tcl8.5/msgs/uk.msg" ".python-environments/default/tcl/tcl8.5/msgs/vi.msg" ".python-environments/default/tcl/tcl8.5/msgs/zh.msg" ".python-environments/default/tcl/tcl8.5/msgs/zh_cn.msg" ".python-environments/default/tcl/tcl8.5/msgs/zh_hk.msg" ".python-environments/default/tcl/tcl8.5/msgs/zh_sg.msg" ".python-environments/default/tcl/tcl8.5/msgs/zh_tw.msg" ".python-environments/default/tcl/tcl8.5/opt0.4/optparse.tcl" ".python-environments/default/tcl/tcl8.5/opt0.4/pkgIndex.tcl" ".python-environments/default/tcl/tcl8.5/package.tcl" ".python-environments/default/tcl/tcl8.5/parray.tcl" ".python-environments/default/tcl/tcl8.5/safe.tcl" ".python-environments/default/tcl/tcl8.5/tclIndex" ".python-environments/default/tcl/tcl8.5/tm.tcl" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Abidjan" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Accra" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Addis_Ababa" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Algiers" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Asmara" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Asmera" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Bamako" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Bangui" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Banjul" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Bissau" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Blantyre" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Brazzaville" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Bujumbura" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Cairo" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Casablanca" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Ceuta" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Conakry" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Dakar" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Dar_es_Salaam" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Djibouti" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Douala" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/El_Aaiun" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Freetown" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Gaborone" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Harare" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Johannesburg" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Juba" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Kampala" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Khartoum" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Kigali" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Kinshasa" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Lagos" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Libreville" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Lome" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Luanda" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Lubumbashi" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Lusaka" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Malabo" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Maputo" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Maseru" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Mbabane" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Mogadishu" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Monrovia" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Nairobi" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Ndjamena" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Niamey" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Nouakchott" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Ouagadougou" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Porto-Novo" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Sao_Tome" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Timbuktu" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Tripoli" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Tunis" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Windhoek" ".python-environments/default/tcl/tcl8.5/tzdata/America/Adak" ".python-environments/default/tcl/tcl8.5/tzdata/America/Anchorage" ".python-environments/default/tcl/tcl8.5/tzdata/America/Anguilla" ".python-environments/default/tcl/tcl8.5/tzdata/America/Antigua" ".python-environments/default/tcl/tcl8.5/tzdata/America/Araguaina" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Buenos_Aires" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Catamarca" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/ComodRivadavia" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Cordoba" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Jujuy" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/La_Rioja" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Mendoza" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Rio_Gallegos" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Salta" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/San_Juan" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/San_Luis" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Tucuman" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Ushuaia" ".python-environments/default/tcl/tcl8.5/tzdata/America/Aruba" ".python-environments/default/tcl/tcl8.5/tzdata/America/Asuncion" ".python-environments/default/tcl/tcl8.5/tzdata/America/Atikokan" ".python-environments/default/tcl/tcl8.5/tzdata/America/Atka" ".python-environments/default/tcl/tcl8.5/tzdata/America/Bahia" ".python-environments/default/tcl/tcl8.5/tzdata/America/Bahia_Banderas" ".python-environments/default/tcl/tcl8.5/tzdata/America/Barbados" ".python-environments/default/tcl/tcl8.5/tzdata/America/Belem" ".python-environments/default/tcl/tcl8.5/tzdata/America/Belize" ".python-environments/default/tcl/tcl8.5/tzdata/America/Blanc-Sablon" ".python-environments/default/tcl/tcl8.5/tzdata/America/Boa_Vista" ".python-environments/default/tcl/tcl8.5/tzdata/America/Bogota" ".python-environments/default/tcl/tcl8.5/tzdata/America/Boise" ".python-environments/default/tcl/tcl8.5/tzdata/America/Buenos_Aires" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cambridge_Bay" ".python-environments/default/tcl/tcl8.5/tzdata/America/Campo_Grande" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cancun" ".python-environments/default/tcl/tcl8.5/tzdata/America/Caracas" ".python-environments/default/tcl/tcl8.5/tzdata/America/Catamarca" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cayenne" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cayman" ".python-environments/default/tcl/tcl8.5/tzdata/America/Chicago" ".python-environments/default/tcl/tcl8.5/tzdata/America/Chihuahua" ".python-environments/default/tcl/tcl8.5/tzdata/America/Coral_Harbour" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cordoba" ".python-environments/default/tcl/tcl8.5/tzdata/America/Costa_Rica" ".python-environments/default/tcl/tcl8.5/tzdata/America/Creston" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cuiaba" ".python-environments/default/tcl/tcl8.5/tzdata/America/Curacao" ".python-environments/default/tcl/tcl8.5/tzdata/America/Danmarkshavn" ".python-environments/default/tcl/tcl8.5/tzdata/America/Dawson" ".python-environments/default/tcl/tcl8.5/tzdata/America/Dawson_Creek" ".python-environments/default/tcl/tcl8.5/tzdata/America/Denver" ".python-environments/default/tcl/tcl8.5/tzdata/America/Detroit" ".python-environments/default/tcl/tcl8.5/tzdata/America/Dominica" ".python-environments/default/tcl/tcl8.5/tzdata/America/Edmonton" ".python-environments/default/tcl/tcl8.5/tzdata/America/Eirunepe" ".python-environments/default/tcl/tcl8.5/tzdata/America/El_Salvador" ".python-environments/default/tcl/tcl8.5/tzdata/America/Ensenada" ".python-environments/default/tcl/tcl8.5/tzdata/America/Fort_Wayne" ".python-environments/default/tcl/tcl8.5/tzdata/America/Fortaleza" ".python-environments/default/tcl/tcl8.5/tzdata/America/Glace_Bay" ".python-environments/default/tcl/tcl8.5/tzdata/America/Godthab" ".python-environments/default/tcl/tcl8.5/tzdata/America/Goose_Bay" ".python-environments/default/tcl/tcl8.5/tzdata/America/Grand_Turk" ".python-environments/default/tcl/tcl8.5/tzdata/America/Grenada" ".python-environments/default/tcl/tcl8.5/tzdata/America/Guadeloupe" ".python-environments/default/tcl/tcl8.5/tzdata/America/Guatemala" ".python-environments/default/tcl/tcl8.5/tzdata/America/Guayaquil" ".python-environments/default/tcl/tcl8.5/tzdata/America/Guyana" ".python-environments/default/tcl/tcl8.5/tzdata/America/Halifax" ".python-environments/default/tcl/tcl8.5/tzdata/America/Havana" ".python-environments/default/tcl/tcl8.5/tzdata/America/Hermosillo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Indianapolis" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Knox" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Marengo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Petersburg" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Tell_City" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Vevay" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Vincennes" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Winamac" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indianapolis" ".python-environments/default/tcl/tcl8.5/tzdata/America/Inuvik" ".python-environments/default/tcl/tcl8.5/tzdata/America/Iqaluit" ".python-environments/default/tcl/tcl8.5/tzdata/America/Jamaica" ".python-environments/default/tcl/tcl8.5/tzdata/America/Jujuy" ".python-environments/default/tcl/tcl8.5/tzdata/America/Juneau" ".python-environments/default/tcl/tcl8.5/tzdata/America/Kentucky/Louisville" ".python-environments/default/tcl/tcl8.5/tzdata/America/Kentucky/Monticello" ".python-environments/default/tcl/tcl8.5/tzdata/America/Knox_IN" ".python-environments/default/tcl/tcl8.5/tzdata/America/Kralendijk" ".python-environments/default/tcl/tcl8.5/tzdata/America/La_Paz" ".python-environments/default/tcl/tcl8.5/tzdata/America/Lima" ".python-environments/default/tcl/tcl8.5/tzdata/America/Los_Angeles" ".python-environments/default/tcl/tcl8.5/tzdata/America/Louisville" ".python-environments/default/tcl/tcl8.5/tzdata/America/Lower_Princes" ".python-environments/default/tcl/tcl8.5/tzdata/America/Maceio" ".python-environments/default/tcl/tcl8.5/tzdata/America/Managua" ".python-environments/default/tcl/tcl8.5/tzdata/America/Manaus" ".python-environments/default/tcl/tcl8.5/tzdata/America/Marigot" ".python-environments/default/tcl/tcl8.5/tzdata/America/Martinique" ".python-environments/default/tcl/tcl8.5/tzdata/America/Matamoros" ".python-environments/default/tcl/tcl8.5/tzdata/America/Mazatlan" ".python-environments/default/tcl/tcl8.5/tzdata/America/Mendoza" ".python-environments/default/tcl/tcl8.5/tzdata/America/Menominee" ".python-environments/default/tcl/tcl8.5/tzdata/America/Merida" ".python-environments/default/tcl/tcl8.5/tzdata/America/Metlakatla" ".python-environments/default/tcl/tcl8.5/tzdata/America/Mexico_City" ".python-environments/default/tcl/tcl8.5/tzdata/America/Miquelon" ".python-environments/default/tcl/tcl8.5/tzdata/America/Moncton" ".python-environments/default/tcl/tcl8.5/tzdata/America/Monterrey" ".python-environments/default/tcl/tcl8.5/tzdata/America/Montevideo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Montreal" ".python-environments/default/tcl/tcl8.5/tzdata/America/Montserrat" ".python-environments/default/tcl/tcl8.5/tzdata/America/Nassau" ".python-environments/default/tcl/tcl8.5/tzdata/America/New_York" ".python-environments/default/tcl/tcl8.5/tzdata/America/Nipigon" ".python-environments/default/tcl/tcl8.5/tzdata/America/Nome" ".python-environments/default/tcl/tcl8.5/tzdata/America/Noronha" ".python-environments/default/tcl/tcl8.5/tzdata/America/North_Dakota/Beulah" ".python-environments/default/tcl/tcl8.5/tzdata/America/North_Dakota/Center" ".python-environments/default/tcl/tcl8.5/tzdata/America/North_Dakota/New_Salem" ".python-environments/default/tcl/tcl8.5/tzdata/America/Ojinaga" ".python-environments/default/tcl/tcl8.5/tzdata/America/Panama" ".python-environments/default/tcl/tcl8.5/tzdata/America/Pangnirtung" ".python-environments/default/tcl/tcl8.5/tzdata/America/Paramaribo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Phoenix" ".python-environments/default/tcl/tcl8.5/tzdata/America/Port-au-Prince" ".python-environments/default/tcl/tcl8.5/tzdata/America/Port_of_Spain" ".python-environments/default/tcl/tcl8.5/tzdata/America/Porto_Acre" ".python-environments/default/tcl/tcl8.5/tzdata/America/Porto_Velho" ".python-environments/default/tcl/tcl8.5/tzdata/America/Puerto_Rico" ".python-environments/default/tcl/tcl8.5/tzdata/America/Rainy_River" ".python-environments/default/tcl/tcl8.5/tzdata/America/Rankin_Inlet" ".python-environments/default/tcl/tcl8.5/tzdata/America/Recife" ".python-environments/default/tcl/tcl8.5/tzdata/America/Regina" ".python-environments/default/tcl/tcl8.5/tzdata/America/Resolute" ".python-environments/default/tcl/tcl8.5/tzdata/America/Rio_Branco" ".python-environments/default/tcl/tcl8.5/tzdata/America/Rosario" ".python-environments/default/tcl/tcl8.5/tzdata/America/Santa_Isabel" ".python-environments/default/tcl/tcl8.5/tzdata/America/Santarem" ".python-environments/default/tcl/tcl8.5/tzdata/America/Santiago" ".python-environments/default/tcl/tcl8.5/tzdata/America/Santo_Domingo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Sao_Paulo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Scoresbysund" ".python-environments/default/tcl/tcl8.5/tzdata/America/Shiprock" ".python-environments/default/tcl/tcl8.5/tzdata/America/Sitka" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Barthelemy" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Johns" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Kitts" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Lucia" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Thomas" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Vincent" ".python-environments/default/tcl/tcl8.5/tzdata/America/Swift_Current" ".python-environments/default/tcl/tcl8.5/tzdata/America/Tegucigalpa" ".python-environments/default/tcl/tcl8.5/tzdata/America/Thule" ".python-environments/default/tcl/tcl8.5/tzdata/America/Thunder_Bay" ".python-environments/default/tcl/tcl8.5/tzdata/America/Tijuana" ".python-environments/default/tcl/tcl8.5/tzdata/America/Toronto" ".python-environments/default/tcl/tcl8.5/tzdata/America/Tortola" ".python-environments/default/tcl/tcl8.5/tzdata/America/Vancouver" ".python-environments/default/tcl/tcl8.5/tzdata/America/Virgin" ".python-environments/default/tcl/tcl8.5/tzdata/America/Whitehorse" ".python-environments/default/tcl/tcl8.5/tzdata/America/Winnipeg" ".python-environments/default/tcl/tcl8.5/tzdata/America/Yakutat" ".python-environments/default/tcl/tcl8.5/tzdata/America/Yellowknife" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Casey" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Davis" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/DumontDUrville" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Macquarie" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Mawson" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/McMurdo" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Palmer" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Rothera" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/South_Pole" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Syowa" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Vostok" ".python-environments/default/tcl/tcl8.5/tzdata/Arctic/Longyearbyen" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Aden" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Almaty" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Amman" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Anadyr" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Aqtau" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Aqtobe" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ashgabat" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ashkhabad" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Baghdad" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Bahrain" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Baku" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Bangkok" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Beirut" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Bishkek" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Brunei" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Calcutta" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Choibalsan" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Chongqing" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Chungking" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Colombo" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Dacca" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Damascus" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Dhaka" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Dili" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Dubai" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Dushanbe" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Gaza" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Harbin" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Hebron" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ho_Chi_Minh" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Hong_Kong" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Hovd" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Irkutsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Istanbul" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Jakarta" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Jayapura" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Jerusalem" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kabul" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kamchatka" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Karachi" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kashgar" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kathmandu" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Katmandu" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Khandyga" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kolkata" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Krasnoyarsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kuala_Lumpur" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kuching" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kuwait" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Macao" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Macau" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Magadan" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Makassar" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Manila" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Muscat" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Nicosia" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Novokuznetsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Novosibirsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Omsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Oral" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Phnom_Penh" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Pontianak" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Pyongyang" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Qatar" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Qyzylorda" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Rangoon" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Riyadh" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Saigon" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Sakhalin" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Samarkand" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Seoul" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Shanghai" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Singapore" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Taipei" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Tashkent" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Tbilisi" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Tehran" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Tel_Aviv" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Thimbu" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Thimphu" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Tokyo" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ujung_Pandang" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ulaanbaatar" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ulan_Bator" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Urumqi" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ust-Nera" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Vientiane" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Vladivostok" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Yakutsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Yekaterinburg" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Yerevan" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Azores" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Bermuda" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Canary" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Cape_Verde" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Faeroe" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Faroe" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Jan_Mayen" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Madeira" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Reykjavik" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/South_Georgia" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/St_Helena" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Stanley" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/ACT" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Adelaide" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Brisbane" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Broken_Hill" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Canberra" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Currie" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Darwin" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Eucla" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Hobart" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/LHI" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Lindeman" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Lord_Howe" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Melbourne" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/NSW" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/North" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Perth" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Queensland" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/South" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Sydney" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Tasmania" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Victoria" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/West" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Yancowinna" ".python-environments/default/tcl/tcl8.5/tzdata/Brazil/Acre" ".python-environments/default/tcl/tcl8.5/tzdata/Brazil/DeNoronha" ".python-environments/default/tcl/tcl8.5/tzdata/Brazil/East" ".python-environments/default/tcl/tcl8.5/tzdata/Brazil/West" ".python-environments/default/tcl/tcl8.5/tzdata/CET" ".python-environments/default/tcl/tcl8.5/tzdata/CST6CDT" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Atlantic" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Central" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/East-Saskatchewan" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Eastern" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Mountain" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Newfoundland" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Pacific" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Saskatchewan" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Yukon" ".python-environments/default/tcl/tcl8.5/tzdata/Chile/Continental" ".python-environments/default/tcl/tcl8.5/tzdata/Chile/EasterIsland" ".python-environments/default/tcl/tcl8.5/tzdata/Cuba" ".python-environments/default/tcl/tcl8.5/tzdata/EET" ".python-environments/default/tcl/tcl8.5/tzdata/EST" ".python-environments/default/tcl/tcl8.5/tzdata/EST5EDT" ".python-environments/default/tcl/tcl8.5/tzdata/Egypt" ".python-environments/default/tcl/tcl8.5/tzdata/Eire" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+0" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+1" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+10" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+11" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+12" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+2" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+3" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+4" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+5" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+6" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+7" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+8" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+9" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-0" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-1" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-10" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-11" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-12" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-13" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-14" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-2" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-3" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-4" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-5" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-6" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-7" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-8" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-9" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT0" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/Greenwich" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/UCT" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/UTC" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/Universal" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/Zulu" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Amsterdam" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Andorra" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Athens" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Belfast" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Belgrade" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Berlin" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Bratislava" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Brussels" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Bucharest" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Budapest" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Busingen" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Chisinau" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Copenhagen" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Dublin" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Gibraltar" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Guernsey" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Helsinki" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Isle_of_Man" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Istanbul" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Jersey" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Kaliningrad" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Kiev" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Lisbon" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Ljubljana" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/London" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Luxembourg" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Madrid" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Malta" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Mariehamn" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Minsk" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Monaco" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Moscow" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Nicosia" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Oslo" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Paris" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Podgorica" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Prague" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Riga" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Rome" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Samara" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/San_Marino" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Sarajevo" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Simferopol" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Skopje" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Sofia" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Stockholm" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Tallinn" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Tirane" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Tiraspol" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Uzhgorod" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Vaduz" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Vatican" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Vienna" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Vilnius" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Volgograd" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Warsaw" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Zagreb" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Zaporozhye" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Zurich" ".python-environments/default/tcl/tcl8.5/tzdata/GB" ".python-environments/default/tcl/tcl8.5/tzdata/GB-Eire" ".python-environments/default/tcl/tcl8.5/tzdata/GMT" ".python-environments/default/tcl/tcl8.5/tzdata/GMT+0" ".python-environments/default/tcl/tcl8.5/tzdata/GMT-0" ".python-environments/default/tcl/tcl8.5/tzdata/GMT0" ".python-environments/default/tcl/tcl8.5/tzdata/Greenwich" ".python-environments/default/tcl/tcl8.5/tzdata/HST" ".python-environments/default/tcl/tcl8.5/tzdata/Hongkong" ".python-environments/default/tcl/tcl8.5/tzdata/Iceland" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Antananarivo" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Chagos" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Christmas" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Cocos" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Comoro" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Kerguelen" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Mahe" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Maldives" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Mauritius" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Mayotte" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Reunion" ".python-environments/default/tcl/tcl8.5/tzdata/Iran" ".python-environments/default/tcl/tcl8.5/tzdata/Israel" ".python-environments/default/tcl/tcl8.5/tzdata/Jamaica" ".python-environments/default/tcl/tcl8.5/tzdata/Japan" ".python-environments/default/tcl/tcl8.5/tzdata/Kwajalein" ".python-environments/default/tcl/tcl8.5/tzdata/Libya" ".python-environments/default/tcl/tcl8.5/tzdata/MET" ".python-environments/default/tcl/tcl8.5/tzdata/MST" ".python-environments/default/tcl/tcl8.5/tzdata/MST7MDT" ".python-environments/default/tcl/tcl8.5/tzdata/Mexico/BajaNorte" ".python-environments/default/tcl/tcl8.5/tzdata/Mexico/BajaSur" ".python-environments/default/tcl/tcl8.5/tzdata/Mexico/General" ".python-environments/default/tcl/tcl8.5/tzdata/NZ" ".python-environments/default/tcl/tcl8.5/tzdata/NZ-CHAT" ".python-environments/default/tcl/tcl8.5/tzdata/Navajo" ".python-environments/default/tcl/tcl8.5/tzdata/PRC" ".python-environments/default/tcl/tcl8.5/tzdata/PST8PDT" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Apia" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Auckland" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Chatham" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Chuuk" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Easter" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Efate" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Enderbury" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Fakaofo" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Fiji" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Funafuti" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Galapagos" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Gambier" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Guadalcanal" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Guam" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Honolulu" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Johnston" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Kiritimati" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Kosrae" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Kwajalein" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Majuro" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Marquesas" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Midway" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Nauru" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Niue" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Norfolk" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Noumea" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Pago_Pago" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Palau" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Pitcairn" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Pohnpei" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Ponape" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Port_Moresby" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Rarotonga" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Saipan" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Samoa" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Tahiti" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Tarawa" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Tongatapu" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Truk" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Wake" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Wallis" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Yap" ".python-environments/default/tcl/tcl8.5/tzdata/Poland" ".python-environments/default/tcl/tcl8.5/tzdata/Portugal" ".python-environments/default/tcl/tcl8.5/tzdata/ROC" ".python-environments/default/tcl/tcl8.5/tzdata/ROK" ".python-environments/default/tcl/tcl8.5/tzdata/Singapore" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/AST4" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/AST4ADT" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/CST6" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/CST6CDT" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/EST5" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/EST5EDT" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/HST10" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/MST7" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/MST7MDT" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/PST8" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/PST8PDT" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/YST9" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/YST9YDT" ".python-environments/default/tcl/tcl8.5/tzdata/Turkey" ".python-environments/default/tcl/tcl8.5/tzdata/UCT" ".python-environments/default/tcl/tcl8.5/tzdata/US/Alaska" ".python-environments/default/tcl/tcl8.5/tzdata/US/Aleutian" ".python-environments/default/tcl/tcl8.5/tzdata/US/Arizona" ".python-environments/default/tcl/tcl8.5/tzdata/US/Central" ".python-environments/default/tcl/tcl8.5/tzdata/US/East-Indiana" ".python-environments/default/tcl/tcl8.5/tzdata/US/Eastern" ".python-environments/default/tcl/tcl8.5/tzdata/US/Hawaii" ".python-environments/default/tcl/tcl8.5/tzdata/US/Indiana-Starke" ".python-environments/default/tcl/tcl8.5/tzdata/US/Michigan" ".python-environments/default/tcl/tcl8.5/tzdata/US/Mountain" ".python-environments/default/tcl/tcl8.5/tzdata/US/Pacific" ".python-environments/default/tcl/tcl8.5/tzdata/US/Pacific-New" ".python-environments/default/tcl/tcl8.5/tzdata/US/Samoa" ".python-environments/default/tcl/tcl8.5/tzdata/UTC" ".python-environments/default/tcl/tcl8.5/tzdata/Universal" ".python-environments/default/tcl/tcl8.5/tzdata/W-SU" ".python-environments/default/tcl/tcl8.5/tzdata/WET" ".python-environments/default/tcl/tcl8.5/tzdata/Zulu" ".python-environments/default/tcl/tcl8.5/word.tcl" ".python-environments/default/tcl/tk8.5/bgerror.tcl" ".python-environments/default/tcl/tk8.5/button.tcl" ".python-environments/default/tcl/tk8.5/choosedir.tcl" ".python-environments/default/tcl/tk8.5/clrpick.tcl" ".python-environments/default/tcl/tk8.5/comdlg.tcl" ".python-environments/default/tcl/tk8.5/console.tcl" ".python-environments/default/tcl/tk8.5/demos/README" ".python-environments/default/tcl/tk8.5/demos/anilabel.tcl" ".python-environments/default/tcl/tk8.5/demos/aniwave.tcl" ".python-environments/default/tcl/tk8.5/demos/arrow.tcl" ".python-environments/default/tcl/tk8.5/demos/bind.tcl" ".python-environments/default/tcl/tk8.5/demos/bitmap.tcl" ".python-environments/default/tcl/tk8.5/demos/browse" ".python-environments/default/tcl/tk8.5/demos/button.tcl" ".python-environments/default/tcl/tk8.5/demos/check.tcl" ".python-environments/default/tcl/tk8.5/demos/clrpick.tcl" ".python-environments/default/tcl/tk8.5/demos/colors.tcl" ".python-environments/default/tcl/tk8.5/demos/combo.tcl" ".python-environments/default/tcl/tk8.5/demos/cscroll.tcl" ".python-environments/default/tcl/tk8.5/demos/ctext.tcl" ".python-environments/default/tcl/tk8.5/demos/dialog1.tcl" ".python-environments/default/tcl/tk8.5/demos/dialog2.tcl" ".python-environments/default/tcl/tk8.5/demos/en.msg" ".python-environments/default/tcl/tk8.5/demos/entry1.tcl" ".python-environments/default/tcl/tk8.5/demos/entry2.tcl" ".python-environments/default/tcl/tk8.5/demos/entry3.tcl" ".python-environments/default/tcl/tk8.5/demos/filebox.tcl" ".python-environments/default/tcl/tk8.5/demos/floor.tcl" ".python-environments/default/tcl/tk8.5/demos/form.tcl" ".python-environments/default/tcl/tk8.5/demos/goldberg.tcl" ".python-environments/default/tcl/tk8.5/demos/hello" ".python-environments/default/tcl/tk8.5/demos/hscale.tcl" ".python-environments/default/tcl/tk8.5/demos/icon.tcl" ".python-environments/default/tcl/tk8.5/demos/image1.tcl" ".python-environments/default/tcl/tk8.5/demos/image2.tcl" ".python-environments/default/tcl/tk8.5/demos/images/earth.gif" ".python-environments/default/tcl/tk8.5/demos/images/earthris.gif" ".python-environments/default/tcl/tk8.5/demos/images/face.xbm" ".python-environments/default/tcl/tk8.5/demos/images/flagdown.xbm" ".python-environments/default/tcl/tk8.5/demos/images/flagup.xbm" ".python-environments/default/tcl/tk8.5/demos/images/gray25.xbm" ".python-environments/default/tcl/tk8.5/demos/images/letters.xbm" ".python-environments/default/tcl/tk8.5/demos/images/noletter.xbm" ".python-environments/default/tcl/tk8.5/demos/images/pattern.xbm" ".python-environments/default/tcl/tk8.5/demos/images/tcllogo.gif" ".python-environments/default/tcl/tk8.5/demos/images/teapot.ppm" ".python-environments/default/tcl/tk8.5/demos/items.tcl" ".python-environments/default/tcl/tk8.5/demos/ixset" ".python-environments/default/tcl/tk8.5/demos/knightstour.tcl" ".python-environments/default/tcl/tk8.5/demos/label.tcl" ".python-environments/default/tcl/tk8.5/demos/labelframe.tcl" ".python-environments/default/tcl/tk8.5/demos/license.terms" ".python-environments/default/tcl/tk8.5/demos/mclist.tcl" ".python-environments/default/tcl/tk8.5/demos/menu.tcl" ".python-environments/default/tcl/tk8.5/demos/menubu.tcl" ".python-environments/default/tcl/tk8.5/demos/msgbox.tcl" ".python-environments/default/tcl/tk8.5/demos/nl.msg" ".python-environments/default/tcl/tk8.5/demos/paned1.tcl" ".python-environments/default/tcl/tk8.5/demos/paned2.tcl" ".python-environments/default/tcl/tk8.5/demos/pendulum.tcl" ".python-environments/default/tcl/tk8.5/demos/plot.tcl" ".python-environments/default/tcl/tk8.5/demos/puzzle.tcl" ".python-environments/default/tcl/tk8.5/demos/radio.tcl" ".python-environments/default/tcl/tk8.5/demos/rmt" ".python-environments/default/tcl/tk8.5/demos/rolodex" ".python-environments/default/tcl/tk8.5/demos/ruler.tcl" ".python-environments/default/tcl/tk8.5/demos/sayings.tcl" ".python-environments/default/tcl/tk8.5/demos/search.tcl" ".python-environments/default/tcl/tk8.5/demos/spin.tcl" ".python-environments/default/tcl/tk8.5/demos/square" ".python-environments/default/tcl/tk8.5/demos/states.tcl" ".python-environments/default/tcl/tk8.5/demos/style.tcl" ".python-environments/default/tcl/tk8.5/demos/tclIndex" ".python-environments/default/tcl/tk8.5/demos/tcolor" ".python-environments/default/tcl/tk8.5/demos/text.tcl" ".python-environments/default/tcl/tk8.5/demos/textpeer.tcl" ".python-environments/default/tcl/tk8.5/demos/timer" ".python-environments/default/tcl/tk8.5/demos/toolbar.tcl" ".python-environments/default/tcl/tk8.5/demos/tree.tcl" ".python-environments/default/tcl/tk8.5/demos/ttkbut.tcl" ".python-environments/default/tcl/tk8.5/demos/ttkmenu.tcl" ".python-environments/default/tcl/tk8.5/demos/ttknote.tcl" ".python-environments/default/tcl/tk8.5/demos/ttkpane.tcl" ".python-environments/default/tcl/tk8.5/demos/ttkprogress.tcl" ".python-environments/default/tcl/tk8.5/demos/ttkscale.tcl" ".python-environments/default/tcl/tk8.5/demos/twind.tcl" ".python-environments/default/tcl/tk8.5/demos/unicodeout.tcl" ".python-environments/default/tcl/tk8.5/demos/vscale.tcl" ".python-environments/default/tcl/tk8.5/demos/widget" ".python-environments/default/tcl/tk8.5/dialog.tcl" ".python-environments/default/tcl/tk8.5/entry.tcl" ".python-environments/default/tcl/tk8.5/focus.tcl" ".python-environments/default/tcl/tk8.5/images/README" ".python-environments/default/tcl/tk8.5/images/logo.eps" ".python-environments/default/tcl/tk8.5/images/logo100.gif" ".python-environments/default/tcl/tk8.5/images/logo64.gif" ".python-environments/default/tcl/tk8.5/images/logoLarge.gif" ".python-environments/default/tcl/tk8.5/images/logoMed.gif" ".python-environments/default/tcl/tk8.5/images/pwrdLogo.eps" ".python-environments/default/tcl/tk8.5/images/pwrdLogo100.gif" ".python-environments/default/tcl/tk8.5/images/pwrdLogo150.gif" ".python-environments/default/tcl/tk8.5/images/pwrdLogo175.gif" ".python-environments/default/tcl/tk8.5/images/pwrdLogo200.gif" ".python-environments/default/tcl/tk8.5/images/pwrdLogo75.gif" ".python-environments/default/tcl/tk8.5/images/tai-ku.gif" ".python-environments/default/tcl/tk8.5/license.terms" ".python-environments/default/tcl/tk8.5/listbox.tcl" ".python-environments/default/tcl/tk8.5/menu.tcl" ".python-environments/default/tcl/tk8.5/mkpsenc.tcl" ".python-environments/default/tcl/tk8.5/msgbox.tcl" ".python-environments/default/tcl/tk8.5/msgs/cs.msg" ".python-environments/default/tcl/tk8.5/msgs/da.msg" ".python-environments/default/tcl/tk8.5/msgs/de.msg" ".python-environments/default/tcl/tk8.5/msgs/el.msg" ".python-environments/default/tcl/tk8.5/msgs/en.msg" ".python-environments/default/tcl/tk8.5/msgs/en_gb.msg" ".python-environments/default/tcl/tk8.5/msgs/eo.msg" ".python-environments/default/tcl/tk8.5/msgs/es.msg" ".python-environments/default/tcl/tk8.5/msgs/fr.msg" ".python-environments/default/tcl/tk8.5/msgs/hu.msg" ".python-environments/default/tcl/tk8.5/msgs/it.msg" ".python-environments/default/tcl/tk8.5/msgs/nl.msg" ".python-environments/default/tcl/tk8.5/msgs/pl.msg" ".python-environments/default/tcl/tk8.5/msgs/pt.msg" ".python-environments/default/tcl/tk8.5/msgs/ru.msg" ".python-environments/default/tcl/tk8.5/msgs/sv.msg" ".python-environments/default/tcl/tk8.5/obsolete.tcl" ".python-environments/default/tcl/tk8.5/optMenu.tcl" ".python-environments/default/tcl/tk8.5/palette.tcl" ".python-environments/default/tcl/tk8.5/panedwindow.tcl" ".python-environments/default/tcl/tk8.5/pkgIndex.tcl" ".python-environments/default/tcl/tk8.5/safetk.tcl" ".python-environments/default/tcl/tk8.5/scale.tcl" ".python-environments/default/tcl/tk8.5/scrlbar.tcl" ".python-environments/default/tcl/tk8.5/spinbox.tcl" ".python-environments/default/tcl/tk8.5/tclIndex" ".python-environments/default/tcl/tk8.5/tearoff.tcl" ".python-environments/default/tcl/tk8.5/text.tcl" ".python-environments/default/tcl/tk8.5/tk.tcl" ".python-environments/default/tcl/tk8.5/tkfbox.tcl" ".python-environments/default/tcl/tk8.5/ttk/altTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/aquaTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/button.tcl" ".python-environments/default/tcl/tk8.5/ttk/clamTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/classicTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/combobox.tcl" ".python-environments/default/tcl/tk8.5/ttk/cursors.tcl" ".python-environments/default/tcl/tk8.5/ttk/defaults.tcl" ".python-environments/default/tcl/tk8.5/ttk/entry.tcl" ".python-environments/default/tcl/tk8.5/ttk/fonts.tcl" ".python-environments/default/tcl/tk8.5/ttk/menubutton.tcl" ".python-environments/default/tcl/tk8.5/ttk/notebook.tcl" ".python-environments/default/tcl/tk8.5/ttk/panedwindow.tcl" ".python-environments/default/tcl/tk8.5/ttk/progress.tcl" ".python-environments/default/tcl/tk8.5/ttk/scale.tcl" ".python-environments/default/tcl/tk8.5/ttk/scrollbar.tcl" ".python-environments/default/tcl/tk8.5/ttk/sizegrip.tcl" ".python-environments/default/tcl/tk8.5/ttk/spinbox.tcl" ".python-environments/default/tcl/tk8.5/ttk/treeview.tcl" ".python-environments/default/tcl/tk8.5/ttk/ttk.tcl" ".python-environments/default/tcl/tk8.5/ttk/utils.tcl" ".python-environments/default/tcl/tk8.5/ttk/vistaTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/winTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/xpTheme.tcl" ".python-environments/default/tcl/tk8.5/unsupported.tcl" ".python-environments/default/tcl/tk8.5/xmfbox.tcl" ".recentf" ".smex-items" "CalendarDairy/diary.org" "GTD/.notes.org" "GTD/Dissertation.org" "GTD/bakupJournal/20171007" "GTD/bakupJournal/20171008" "GTD/bakupJournal/20171009" "GTD/bakupJournal/20171010" "GTD/bakupJournal/20171011" "GTD/bakupJournal/20171012" "GTD/bakupJournal/20171013" "GTD/bakupJournal/20171017" "GTD/bakupJournal/20171019" "GTD/bakupJournal/20171021" "GTD/bakupJournal/20171022" "GTD/bakupJournal/20171023" "GTD/bakupJournal/20171025" "GTD/bakupJournal/20171026" "GTD/bakupJournal/20171027" "GTD/bakupJournal/20171028" "GTD/bakupJournal/20171030" "GTD/bakupJournal/20171031" "GTD/bakupJournal/20171101" "GTD/bakupJournal/20171103" "GTD/bakupJournal/20171125" "GTD/clojureBackup.org" "GTD/current.pdf" "GTD/email.org" "GTD/hello.org" "GTD/hello.org.gpg" "GTD/hello.org.pdf.pdf" "GTD/index.org" "GTD/myPlan/2017.09.13.muse" "GTD/orgBoss/Book/book.html" "GTD/orgBoss/Book/book.org" "GTD/orgBoss/Clipboard/clipboard.org" "GTD/orgBoss/Clipboard/clojureLearn.org" "GTD/orgBoss/DailyReview/daily.org" "GTD/orgBoss/Film/film.org" "GTD/orgBoss/Financial/finances.org" "GTD/orgBoss/Habit/habits.org" "GTD/orgBoss/IDEA/idea.org" "GTD/orgBoss/Journal/2017100011" "GTD/orgBoss/Journal/20180129" "GTD/orgBoss/Journal/20180130" "GTD/orgBoss/Journal/20180131" "GTD/orgBoss/Journal/20180201" "GTD/orgBoss/Journal/20180202" "GTD/orgBoss/Journal/20180203" "GTD/orgBoss/Journal/20180204" "GTD/orgBoss/Journal/20180205" "GTD/orgBoss/Journal/20180206" "GTD/orgBoss/Journal/20180207" "GTD/orgBoss/Journal/20180208" "GTD/orgBoss/Journal/20180209" "GTD/orgBoss/Journal/20180213" "GTD/orgBoss/Journal/20180214" "GTD/orgBoss/Journal/20180215" "GTD/orgBoss/Journal/20180220" "GTD/orgBoss/Journal/20180222" "GTD/orgBoss/Journal/20180225" "GTD/orgBoss/Journal/20180226" "GTD/orgBoss/Journal/20180228" "GTD/orgBoss/Journal/20180303" "GTD/orgBoss/Journal/20180304" "GTD/orgBoss/Journal/20180306" "GTD/orgBoss/Journal/20180307" "GTD/orgBoss/Journal/20180308" "GTD/orgBoss/Journal/20180311" "GTD/orgBoss/Journal/20180313" "GTD/orgBoss/Journal/20180315" "GTD/orgBoss/Journal/20180317" "GTD/orgBoss/Journal/20180318" "GTD/orgBoss/Journal/20180320" "GTD/orgBoss/Journal/20180401" "GTD/orgBoss/Journal/20180402" "GTD/orgBoss/Journal/20180424" "GTD/orgBoss/Journal/20180425" "GTD/orgBoss/Journal/20180426" "GTD/orgBoss/Journal/20180427" "GTD/orgBoss/Journal/20180501" "GTD/orgBoss/Journal/journal-XYZ.org" "GTD/orgBoss/Journal/journal-dailies-end.org" "GTD/orgBoss/Journal/journal-dailies.org" "GTD/orgBoss/Journal/journal-mon.org" "GTD/orgBoss/Journal/journal.org" "GTD/orgBoss/Journal/summaryMonth.pl" "GTD/orgBoss/Note/notes.org" "GTD/orgBoss/Note/notes.org_archive" "GTD/orgBoss/Private/privnotes.html" "GTD/orgBoss/Private/privnotes.org" "GTD/orgBoss/Site/www.site.org" "GTD/orgBoss/Someday/someday.org" "GTD/orgBoss/Vocab/vocab.org" "GTD/orgBoss/hello.org" "GTD/orgBoss/hello.rs" "GTD/orgBoss/newgtd.html" "GTD/orgBoss/newgtd.org" "GTD/orgBoss/newgtd.org_archive" "GTD/orgBoss/writing.html" "GTD/orgBoss/writing.org" "GTD/orgTemplate/.book_template.txt" "GTD/orgTemplate/.daily_review.txt" "GTD/orgTemplate/.film_template.txt" "GTD/package/muse-3.20.tar.gz" "GTD/package/planner-3.42.tar.gz" "GTD/package/remember-2.0.tar.gz" "GTD/phd1.org" "GTD/phd1.org.pgp" "GTD/presentation.org" "GTD/reveal.js/.git/HEAD" "GTD/reveal.js/.git/config" "GTD/reveal.js/.git/description" "GTD/reveal.js/.git/hooks/applypatch-msg.sample" "GTD/reveal.js/.git/hooks/commit-msg.sample" "GTD/reveal.js/.git/hooks/fsmonitor-watchman.sample" "GTD/reveal.js/.git/hooks/post-update.sample" "GTD/reveal.js/.git/hooks/pre-applypatch.sample" "GTD/reveal.js/.git/hooks/pre-commit.sample" "GTD/reveal.js/.git/hooks/pre-push.sample" "GTD/reveal.js/.git/hooks/pre-rebase.sample" "GTD/reveal.js/.git/hooks/pre-receive.sample" "GTD/reveal.js/.git/hooks/prepare-commit-msg.sample" "GTD/reveal.js/.git/hooks/update.sample" "GTD/reveal.js/.git/index" "GTD/reveal.js/.git/info/exclude" "GTD/reveal.js/.git/logs/HEAD" "GTD/reveal.js/.git/logs/refs/heads/master" "GTD/reveal.js/.git/logs/refs/remotes/origin/HEAD" "GTD/reveal.js/.git/objects/pack/pack-a47f2677e274a688ee6d6c3c3d1fa10ce8ca5ac4.idx" "GTD/reveal.js/.git/objects/pack/pack-a47f2677e274a688ee6d6c3c3d1fa10ce8ca5ac4.pack" "GTD/reveal.js/.git/packed-refs" "GTD/reveal.js/.git/refs/heads/master" "GTD/reveal.js/.git/refs/remotes/origin/HEAD" "GTD/reveal.js/.gitignore" "GTD/reveal.js/.travis.yml" "GTD/reveal.js/CONTRIBUTING.md" "GTD/reveal.js/Gruntfile.js" "GTD/reveal.js/LICENSE" "GTD/reveal.js/README.md" "GTD/reveal.js/bower.json" "GTD/reveal.js/css/print/paper.css" "GTD/reveal.js/css/print/pdf.css" "GTD/reveal.js/css/reveal.css" "GTD/reveal.js/css/reveal.scss" "GTD/reveal.js/css/theme/README.md" "GTD/reveal.js/css/theme/beige.css" "GTD/reveal.js/css/theme/black.css" "GTD/reveal.js/css/theme/blood.css" "GTD/reveal.js/css/theme/league.css" "GTD/reveal.js/css/theme/moon.css" "GTD/reveal.js/css/theme/night.css" "GTD/reveal.js/css/theme/serif.css" "GTD/reveal.js/css/theme/simple.css" "GTD/reveal.js/css/theme/sky.css" "GTD/reveal.js/css/theme/solarized.css" "GTD/reveal.js/css/theme/source/beige.scss" "GTD/reveal.js/css/theme/source/black.scss" "GTD/reveal.js/css/theme/source/blood.scss" "GTD/reveal.js/css/theme/source/league.scss" "GTD/reveal.js/css/theme/source/moon.scss" "GTD/reveal.js/css/theme/source/night.scss" "GTD/reveal.js/css/theme/source/serif.scss" "GTD/reveal.js/css/theme/source/simple.scss" "GTD/reveal.js/css/theme/source/sky.scss" "GTD/reveal.js/css/theme/source/solarized.scss" "GTD/reveal.js/css/theme/source/white.scss" "GTD/reveal.js/css/theme/template/mixins.scss" "GTD/reveal.js/css/theme/template/settings.scss" "GTD/reveal.js/css/theme/template/theme.scss" "GTD/reveal.js/css/theme/white.css" "GTD/reveal.js/demo.html" "GTD/reveal.js/index.html" "GTD/reveal.js/js/reveal.js" "GTD/reveal.js/lib/css/zenburn.css" "GTD/reveal.js/lib/font/league-gothic/LICENSE" "GTD/reveal.js/lib/font/league-gothic/league-gothic.css" "GTD/reveal.js/lib/font/league-gothic/league-gothic.eot" "GTD/reveal.js/lib/font/league-gothic/league-gothic.ttf" "GTD/reveal.js/lib/font/league-gothic/league-gothic.woff" "GTD/reveal.js/lib/font/source-sans-pro/LICENSE" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro.css" "GTD/reveal.js/lib/js/classList.js" "GTD/reveal.js/lib/js/head.min.js" "GTD/reveal.js/lib/js/html5shiv.js" "GTD/reveal.js/package.json" "GTD/reveal.js/plugin/highlight/highlight.js" "GTD/reveal.js/plugin/markdown/example.html" "GTD/reveal.js/plugin/markdown/example.md" "GTD/reveal.js/plugin/markdown/markdown.js" "GTD/reveal.js/plugin/markdown/marked.js" "GTD/reveal.js/plugin/math/math.js" "GTD/reveal.js/plugin/multiplex/client.js" "GTD/reveal.js/plugin/multiplex/index.js" "GTD/reveal.js/plugin/multiplex/master.js" "GTD/reveal.js/plugin/multiplex/package.json" "GTD/reveal.js/plugin/notes/notes.html" "GTD/reveal.js/plugin/notes/notes.js" "GTD/reveal.js/plugin/notes-server/client.js" "GTD/reveal.js/plugin/notes-server/index.js" "GTD/reveal.js/plugin/notes-server/notes.html" "GTD/reveal.js/plugin/print-pdf/print-pdf.js" "GTD/reveal.js/plugin/search/search.js" "GTD/reveal.js/plugin/zoom-js/zoom.js" "GTD/reveal.js/test/examples/assets/image1.png" "GTD/reveal.js/test/examples/assets/image2.png" "GTD/reveal.js/test/examples/barebones.html" "GTD/reveal.js/test/examples/embedded-media.html" "GTD/reveal.js/test/examples/math.html" "GTD/reveal.js/test/examples/slide-backgrounds.html" "GTD/reveal.js/test/examples/slide-transitions.html" "GTD/reveal.js/test/qunit-1.12.0.css" "GTD/reveal.js/test/qunit-1.12.0.js" "GTD/reveal.js/test/simple.md" "GTD/reveal.js/test/test-markdown-element-attributes.html" "GTD/reveal.js/test/test-markdown-element-attributes.js" "GTD/reveal.js/test/test-markdown-external.html" "GTD/reveal.js/test/test-markdown-external.js" "GTD/reveal.js/test/test-markdown-options.html" "GTD/reveal.js/test/test-markdown-options.js" "GTD/reveal.js/test/test-markdown-slide-attributes.html" "GTD/reveal.js/test/test-markdown-slide-attributes.js" "GTD/reveal.js/test/test-markdown.html" "GTD/reveal.js/test/test-markdown.js" "GTD/reveal.js/test/test-pdf.html" "GTD/reveal.js/test/test-pdf.js" "GTD/reveal.js/test/test.html" "GTD/reveal.js/test/test.js" "GTD/science.org" "GTD/test.org" "GTD/test.org.pdf" "GTD/testSlide.html" "GTD/testSlide.org" "GTD/thesis-proposal.org" "GTD/thesis-proposal.org.pdf" "README.md" "abbrev_defs" "ag.exe" "auto-save-list/.saves-10680-DESKTOP-YeZhao~" "auto-save-list/.saves-12500-DESKTOP-MKS6PSV~" "auto-save-list/.saves-12892-DESKTOP-MKS6PSV~" "auto-save-list/.saves-14120-DESKTOP-YeZhao~" "auto-save-list/.saves-14432-DESKTOP-YeZhao~" "auto-save-list/.saves-14772-DESKTOP-YeZhao~" "auto-save-list/.saves-180-DESKTOP-MKS6PSV~" "auto-save-list/.saves-18132-DESKTOP-YeZhao~" "auto-save-list/.saves-21756-DESKTOP-MKS6PSV~" "auto-save-list/.saves-24300-DESKTOP-MKS6PSV~" "auto-save-list/.saves-25568-DESKTOP-YeZhao~" "auto-save-list/.saves-25940-DESKTOP-MVNHR6D~" "auto-save-list/.saves-3052-DESKTOP-MKS6PSV~" "auto-save-list/.saves-3952-DESKTOP-YeZhao~" "auto-save-list/.saves-4268-DESKTOP-MKS6PSV~" "auto-save-list/.saves-4592-DESKTOP-YeZhao~" "auto-save-list/.saves-53320-DESKTOP-MVNHR6D~" "auto-save-list/.saves-5704-DESKTOP-YeZhao~" "auto-save-list/.saves-7100-DESKTOP-MVNHR6D~" "auto-save-list/.saves-7780-DESKTOP-MKS6PSV~" "auto-save-list/.saves-8056-DESKTOP-YeZhao~" "auto-save-list/.saves-8672-DESKTOP-YeZhao~" "backups/!drive_c!Users!YeZhao!.vim!colors!dracula.vim~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.authinfo.gpg~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!.git!COMMIT_EDITMSG~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!.gnus.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!.gnus~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!.recentf~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!Dissertation.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!email.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!hello.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!newgtd.html~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Clipboard!clojureLearn.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171007~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171008~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171009~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171011~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171012~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171013~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171017~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171022~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171025~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171027_archive~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171027~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171028~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171030~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171103~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180129~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180130~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180131~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!hello.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!phd1.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!presentation.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!science.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!thesis-proposal.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!orca.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!setup-emms.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!setup-find-file-in-project.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!setup-python.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!setup-ruby-mode.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!setup-rust.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!emms!history~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!ido.last~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.gnus~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.module-starter!config~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.newsrc-dribble~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.newsrc.eld~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!Mail!archive!sent!2017-10~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!Mail!mail!misc~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!Mail!mail!sent!mail~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!Mail!mail!sent!news~" "backups/!drive_c!Users!YeZhao!Desktop!torque.cse~" "backups/!drive_c!Users!YeZhao!perl!testdbi.pl.bak~" "backups/!drive_c!Users!yzl!.ssh!id_rsa.pub~" "backups/!drive_c!Users!yzl!.vim!.git!COMMIT_EDITMSG~" "backups/!drive_c!Users!yzl!.vim!hello.md~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!.git!COMMIT_EDITMSG~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!.recentf~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!IDEA!idea.org~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180201~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180202~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180203~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180204_archive~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180204~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180205~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180206~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180207~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180208~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180222~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180225~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180226~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180304~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180306~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180307~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180308~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180315~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180317~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180318~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180401~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180402~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180424~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180425~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180427~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!newgtd.html~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!testSlide.html~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!testSlide.org~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!customizations!setupsbcl.el~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!elpa!dumb-jump-20180123.1100!dumb-jump.el~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!emms!history~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!ido.last~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!luceneTEst1!pom.xml~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!luceneTEst1!src!main!java!com!rupeng!lucenetest1!FenCiTest1.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!luceneTEst1!src!main!java!com!rupeng!lucenetest1!Main.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!luceneTEst1!src!main!java!com!rupeng!lucenetest1!SearchMain1.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!sousuo!src!main!java!com!rupeng!sousuo!ESSearchTest1.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!sousuo!src!main!java!com!rupeng!sousuo!ESTest1.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!sousuo!src!main!java!com!rupeng!sousuo!InsertAllVeryCdTest1.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!sousuo!src!main!java!com!rupeng!sousuo!SearchSolrTest1.java~" "backups/!drive_c!Users!yzl!Desktop!paperForTorque!frameOfWall!.git!COMMIT_EDITMSG~" "backups/!drive_c!Users!yzl!Desktop!paperForTorque!frameOfWall!Abstract.org~" "backups/!drive_c!Users!yzl!Desktop!paperForTorque!frameOfWall!Intro.org~" "backups/!drive_c!Users!yzl!Desktop!paperForTorque!frameOfWall!paper.org~" "backups/!drive_d!Program Files (x86)!Vim!.vimrc~" "backups/!drive_d!cygwin!home!YeZhao!.todo.actions.d!mit.bak~" "backups/!drive_d!totalcmd!TOTALCMD.INC~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!Test10.fst~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Test10_AD.ipt~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-0.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-10.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-15.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-20.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-25.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-30.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-45.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-5.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-60.wnd~" "backups/!drive_e!a.java~" "backups/!drive_e!a.rb~" "backups/!drive_e!b.py~" "backups/!drive_e!c.py~" "backups/!drive_e!clojure-home!a.py~" "backups/!drive_e!clojure-home!a.rs~" "backups/!drive_e!clojure-home!emacs-25.3-x86_64!share!emacs!25.3!lisp!emacs-lisp!byte-run.el~" "backups/!drive_e!clojure-home!first-example!CHANGELOG.md~" "backups/!drive_e!clojure-home!first-example!project.clj~" "backups/!drive_e!clojure-home!first-example!src!first_example!a.md~" "backups/!drive_e!clojure-home!first-example!src!first_example!anotherNamespace.clj~" "backups/!drive_e!clojure-home!first-example!src!first_example!connectMysql.clj~" "backups/!drive_e!clojure-home!first-example!src!first_example!core.clj~" "backups/!drive_e!clojure-home!first-example!src!first_example!testHello.clj~" "backups/!drive_e!clojure-home!first-example!src!first_example!testmultiMethod.clj~" "backups/!drive_e!clojure-home!mysql!project.clj~" "backups/!drive_e!clojure-home!mysql!src!mysql!core.clj~" "backups/!drive_e!clojure-home!sotclojureAndelisp.clj~" "backups/!drive_e!clojure-home!test-exception!project.clj~" "backups/!drive_e!clojure-home!test-exception!src!test_exception!core.clj~" "backups/!drive_e!clojure-home!undead!project.clj~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!BeddoeSextractCnCt047.m~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!BeddoeSextractCnCt080.m~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!FASTextractCnCt047.m~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!FASTextractCnCt063.m~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!FASTextractCnCt080.m~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!FASTextractCnCt095.m~" "backups/!drive_g!clojure-home!first-example!src!first_example!core.clj~" "backups/!drive_g!clojure-home!test-clojure1!src!test_clojure1!core.clj~" "backups/!drive_j!phaseVI3-11!PileProcess!cp.cse~" "bookmarks" "cider-history" "custom.el" "customizations/aspell.rar" "customizations/editing.el" "customizations/elisp-editing.el" "customizations/emacs-presentation-mode/.git/HEAD" "customizations/emacs-presentation-mode/.git/config" "customizations/emacs-presentation-mode/.git/description" "customizations/emacs-presentation-mode/.git/hooks/applypatch-msg.sample" "customizations/emacs-presentation-mode/.git/hooks/commit-msg.sample" "customizations/emacs-presentation-mode/.git/hooks/fsmonitor-watchman.sample" "customizations/emacs-presentation-mode/.git/hooks/post-update.sample" "customizations/emacs-presentation-mode/.git/hooks/pre-applypatch.sample" "customizations/emacs-presentation-mode/.git/hooks/pre-commit.sample" "customizations/emacs-presentation-mode/.git/hooks/pre-push.sample" "customizations/emacs-presentation-mode/.git/hooks/pre-rebase.sample" "customizations/emacs-presentation-mode/.git/hooks/pre-receive.sample" "customizations/emacs-presentation-mode/.git/hooks/prepare-commit-msg.sample" "customizations/emacs-presentation-mode/.git/hooks/update.sample" "customizations/emacs-presentation-mode/.git/index" "customizations/emacs-presentation-mode/.git/info/exclude" "customizations/emacs-presentation-mode/.git/logs/HEAD" "customizations/emacs-presentation-mode/.git/logs/refs/heads/master" "customizations/emacs-presentation-mode/.git/logs/refs/remotes/origin/HEAD" "customizations/emacs-presentation-mode/.git/objects/01/4b8acf484520cd8038064762529e75ab1686e7" "customizations/emacs-presentation-mode/.git/objects/0d/950740f20d768903bb9952d53b279765f3c8e2" "customizations/emacs-presentation-mode/.git/objects/10/16fa3285c62286afb2272778890935f560e328" "customizations/emacs-presentation-mode/.git/objects/14/7acd719e5c369078bbab5bc1a3f996ab344b47" "customizations/emacs-presentation-mode/.git/objects/18/db317ea1c060801b8b552593ea5dae7d7e13bc" "customizations/emacs-presentation-mode/.git/objects/1c/58566bebaa6955fe8abcc6a0f4daffc459fde0" "customizations/emacs-presentation-mode/.git/objects/1c/67caf3ab160eb1dbf795ff3ae08903f3548728" "customizations/emacs-presentation-mode/.git/objects/29/8385c4ce21b0218d7887765a463a0f4c43245a" "customizations/emacs-presentation-mode/.git/objects/2e/9e5cd593b19fb8e24a68ca59f64de897676f20" "customizations/emacs-presentation-mode/.git/objects/33/6d435e50c51d3702b6b00fab1aaebd5c23b1d2" "customizations/emacs-presentation-mode/.git/objects/38/b239880e3444c79ffaefcbd63451d6394f155c" "customizations/emacs-presentation-mode/.git/objects/3e/f839940c659bfca896c96a70d6f9ad2f66ab91" "customizations/emacs-presentation-mode/.git/objects/43/9c12231a433b721a61f19fcd269aa1fa729aba" "customizations/emacs-presentation-mode/.git/objects/44/8b2d0d51e67718173ec4be090c445d1b4b2b57" "customizations/emacs-presentation-mode/.git/objects/47/c1384ac841a3ba6dda33945549b9fabafe9d33" "customizations/emacs-presentation-mode/.git/objects/4d/85e6984a97181cdf688569d9f2ebdacc2aa557" "customizations/emacs-presentation-mode/.git/objects/4f/d1981e8999f30fa24fbd4fed7fae7c0a5d9421" "customizations/emacs-presentation-mode/.git/objects/51/1478d738139c29879bf18fa99520f9f44e5421" "customizations/emacs-presentation-mode/.git/objects/54/3558b8d66a124765e3a7aba9115490305df10b" "customizations/emacs-presentation-mode/.git/objects/56/d1c2de4e3561192d4c9e270719a8c4314d1342" "customizations/emacs-presentation-mode/.git/objects/5f/8a44fccbfccadbaab9a57b6ef9f3486a13bd74" "customizations/emacs-presentation-mode/.git/objects/62/c82e62a25658be46876b9c5e6690162130ce94" "customizations/emacs-presentation-mode/.git/objects/6a/fd41276f8d097573300afa037dcc9affc906af" "customizations/emacs-presentation-mode/.git/objects/70/252838cdc7767c570ba8563d984db732a62cd9" "customizations/emacs-presentation-mode/.git/objects/70/40134b591ef964a2219768ca983d11fdc34e2d" "customizations/emacs-presentation-mode/.git/objects/74/3592c842da4cf83610c637f33dbef0fa2050e0" "customizations/emacs-presentation-mode/.git/objects/7d/575cd1433d2af84b1112e1575b2cd469e93d18" "customizations/emacs-presentation-mode/.git/objects/82/803a8b40236ee5b772918aafdd8e23d20a92e7" "customizations/emacs-presentation-mode/.git/objects/86/f231a90180f710d53eb5078e0d98b7d087ce7b" "customizations/emacs-presentation-mode/.git/objects/8b/0a445df3dd6b06b55aa04af5ba9475808dc72d" "customizations/emacs-presentation-mode/.git/objects/8b/f334628f5c510534ec08bf5f67ff0bfa2e0ec7" "customizations/emacs-presentation-mode/.git/objects/92/f9df73bfc7aa9aef54ed0f02755c8905c58e79" "customizations/emacs-presentation-mode/.git/objects/94/412b92ba9d6f65f8ffa6d3e15d90a690053ce6" "customizations/emacs-presentation-mode/.git/objects/a0/4fbd3dea30fe480165d7523b444099f92651c6" "customizations/emacs-presentation-mode/.git/objects/a7/61c82e8dae789fbaa0b5c6aa6726659fe2ed4a" "customizations/emacs-presentation-mode/.git/objects/af/cecc605d82fbde18e2ec11a13ca0914abd1a88" "customizations/emacs-presentation-mode/.git/objects/b1/948e6d8b37b6df9290d77d181e1b1d58dd33c0" "customizations/emacs-presentation-mode/.git/objects/b1/cb94120e745641b010d36dff2f5a932f592485" "customizations/emacs-presentation-mode/.git/objects/b7/eb44ad2e97a4871f00fbee66b226ac2d4f722d" "customizations/emacs-presentation-mode/.git/objects/be/688b9bbff7bfaaed7694c793647cbe7304a1dc" "customizations/emacs-presentation-mode/.git/objects/c2/f8306d7166afc3882faeb7f61e3140ff06cd58" "customizations/emacs-presentation-mode/.git/objects/d1/60f15ad55944d2785b20cbc750b85ef271b511" "customizations/emacs-presentation-mode/.git/objects/e5/299432382aae7f482e4d2ba9d9017558ec7f6e" "customizations/emacs-presentation-mode/.git/objects/e7/72915db21ed772db9b90dc6c6d21f2f8d1a0c7" "customizations/emacs-presentation-mode/.git/objects/e9/e402d05a8b6d9e1e7fe853503c92fea4cf65cb" "customizations/emacs-presentation-mode/.git/objects/ed/584b3946717425c2119d03693abe9c0b312f77" "customizations/emacs-presentation-mode/.git/objects/f0/f53447d1a60280c2ef682f72578d4c98ff7b07" "customizations/emacs-presentation-mode/.git/objects/f2/88702d2fa16d3cdf0035b15a9fcbc552cd88e7" "customizations/emacs-presentation-mode/.git/objects/f3/1b5dbaa37c5454919bd8d08eca88c8ae17075c" "customizations/emacs-presentation-mode/.git/objects/fd/f0be3051b6d1ad8bb3e135ddab8026068568c7" "customizations/emacs-presentation-mode/.git/packed-refs" "customizations/emacs-presentation-mode/.git/refs/heads/master" "customizations/emacs-presentation-mode/.git/refs/remotes/origin/HEAD" "customizations/emacs-presentation-mode/COPYING" "customizations/emacs-presentation-mode/README.org" "customizations/emacs-presentation-mode/emacs-presentation.gif" "customizations/emacs-presentation-mode/emacs-presentation.jpg" "customizations/emacs-presentation-mode/presentation.el" "customizations/find-file-in-project.el" "customizations/font-lock+.el" "customizations/fortran-editing.el" "customizations/fortran-index-args.el" "customizations/git-timemachine.el" "customizations/highlight-indentation.el" "customizations/img/ace.png" "customizations/img/baby-org-mode.png" "customizations/img/betterbullet.jpg" "customizations/img/calenar.jpg" "customizations/img/clock-in.png" "customizations/img/crypt.jpg" "customizations/img/dired.jpg" "customizations/img/dumb-diff.png" "customizations/img/f90mode.jpg" "customizations/img/git-gutter.png" "customizations/img/gnucrypt.png" "customizations/img/gnupg.jpg" "customizations/img/gpa.png" "customizations/img/holyshit.jpg" "customizations/img/map.jpg" "customizations/img/music.jpg" "customizations/img/new.jpg" "customizations/img/oo.jpg" "customizations/img/org-bullet.jpg" "customizations/img/projectile.jpg" "customizations/img/purple.jpg" "customizations/img/quicksort.png" "customizations/img/secret.png" "customizations/img/spacemacs.jpg" "customizations/magnars/quantified.el" "customizations/magnars/setup-dired.el" "customizations/magnars/setup-flycheck.el" "customizations/magnars/setup-html-mode.el" "customizations/magnars/setup-js2-mode.el" "customizations/magnars/setup-markdown-mode.el" "customizations/magnars/setup-yasnippet.el" "customizations/misc.el" "customizations/navigation.el" "customizations/orca.el" "customizations/perl-editing.el" "customizations/pip/pip.ini" "customizations/protocol.reg" "customizations/quicklisp.lisp" "customizations/ruby-end.el" "customizations/scheme-editing.el" "customizations/setup-clojure.el" "customizations/setup-emms.el" "customizations/setup-find-file-in-project.el" "customizations/setup-git.el" "customizations/setup-js.el" "customizations/setup-python.el" "customizations/setup-ruby-mode.el" "customizations/setup-rust.el" "customizations/setupsbcl.el" "customizations/shell-integration.el" "customizations/ui.el" "diary" "elpa/0blayout-20161007.2307/0blayout-autoloads.el" "elpa/0blayout-20161007.2307/0blayout-pkg.el" "elpa/0blayout-20161007.2307/0blayout.el" "elpa/0blayout-20161007.2307/0blayout.elc" "elpa/0blayout-readme.txt" "elpa/0xc-20170125.1953/0xc-autoloads.el" "elpa/0xc-20170125.1953/0xc-pkg.el" "elpa/0xc-20170125.1953/0xc.el" "elpa/0xc-20170125.1953/0xc.elc" "elpa/0xc-readme.txt" "elpa/2048-game-20151026.1233/2048-game-autoloads.el" "elpa/2048-game-20151026.1233/2048-game-pkg.el" "elpa/2048-game-20151026.1233/2048-game.el" "elpa/2048-game-20151026.1233/2048-game.elc" "elpa/4clojure-readme.txt" "elpa/a-readme.txt" "elpa/aa-edit-mode-readme.txt" "elpa/ac-anaconda-readme.txt" "elpa/ace-jump-mode-20140616.115/ace-jump-mode-autoloads.el" "elpa/ace-jump-mode-20140616.115/ace-jump-mode-pkg.el" "elpa/ace-jump-mode-20140616.115/ace-jump-mode.el" "elpa/ace-jump-mode-20140616.115/ace-jump-mode.elc" "elpa/ag-20180225.240/ag-autoloads.el" "elpa/ag-20180225.240/ag-pkg.el" "elpa/ag-20180225.240/ag.el" "elpa/ag-20180225.240/ag.elc" "elpa/alert-20180403.38/alert-autoloads.el" "elpa/alert-20180403.38/alert-pkg.el" "elpa/alert-20180403.38/alert.el" "elpa/alert-20180403.38/alert.elc" "elpa/all-the-icons-20180125.757/all-the-icons-autoloads.el" "elpa/all-the-icons-20180125.757/all-the-icons-faces.el" "elpa/all-the-icons-20180125.757/all-the-icons-faces.elc" "elpa/all-the-icons-20180125.757/all-the-icons-pkg.el" "elpa/all-the-icons-20180125.757/all-the-icons.el" "elpa/all-the-icons-20180125.757/all-the-icons.elc" "elpa/all-the-icons-20180125.757/data/data-alltheicons.el" "elpa/all-the-icons-20180125.757/data/data-alltheicons.elc" "elpa/all-the-icons-20180125.757/data/data-faicons.el" "elpa/all-the-icons-20180125.757/data/data-faicons.elc" "elpa/all-the-icons-20180125.757/data/data-fileicons.el" "elpa/all-the-icons-20180125.757/data/data-fileicons.elc" "elpa/all-the-icons-20180125.757/data/data-material.el" "elpa/all-the-icons-20180125.757/data/data-material.elc" "elpa/all-the-icons-20180125.757/data/data-octicons.el" "elpa/all-the-icons-20180125.757/data/data-octicons.elc" "elpa/all-the-icons-20180125.757/data/data-weathericons.el" "elpa/all-the-icons-20180125.757/data/data-weathericons.elc" "elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired-autoloads.el" "elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired-pkg.el" "elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired.el" "elpa/all-the-icons-dired-20170418.1431/all-the-icons-dired.elc" "elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy-autoloads.el" "elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy-pkg.el" "elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy.el" "elpa/all-the-icons-ivy-20180225.630/all-the-icons-ivy.elc" "elpa/angular-snippets-20140513.2223/angular-snippets-autoloads.el" "elpa/angular-snippets-20140513.2223/angular-snippets-pkg.el" "elpa/angular-snippets-20140513.2223/angular-snippets.el" "elpa/angular-snippets-20140513.2223/angular-snippets.elc" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-app.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind-html-unsafe.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind-template.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-bind.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-change.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-checked.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class-even.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class-odd.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-class.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-click.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-cloak.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-controller.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-csp.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-dblclick.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-disabled.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-form.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-hide.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-href.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-include.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-init.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-list.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-model.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mousedown.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseenter.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseleave.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mousemove.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseover.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-mouseup.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-multiple.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-non-bindable.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-options.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-pluralize.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-readonly.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-repeat.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-selected.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-show.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-src.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-style.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-submit.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-switch.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-transclude.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/html-mode/ng-view.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/$b.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/$e.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/$f.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/$on.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/$v.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/$va.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/$w.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/ngc.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/ngd.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/ngfa.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/ngfi.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/ngm.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/ngro.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/ngrw.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/ngrwr.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/ngs.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js-mode/ngw.yasnippet" "elpa/angular-snippets-20140513.2223/snippets/js2-mode/.yas-parents" "elpa/angular-snippets-20140513.2223/snippets/web-mode/.yas-parents" "elpa/archives/gnu/archive-contents" "elpa/archives/gnu/archive-contents.signed" "elpa/archives/marmalada/archive-contents" "elpa/archives/marmalade/archive-contents" "elpa/archives/melpa/archive-contents" "elpa/archives/melpa-stable/archive-contents" "elpa/archives/melpa-stable1/archive-contents" "elpa/archives/org/archive-contents" "elpa/archives/tromey/archive-contents" "elpa/auto-complete-20170124.1845/auto-complete-autoloads.el" "elpa/auto-complete-20170124.1845/auto-complete-config.el" "elpa/auto-complete-20170124.1845/auto-complete-config.elc" "elpa/auto-complete-20170124.1845/auto-complete-pkg.el" "elpa/auto-complete-20170124.1845/auto-complete.el" "elpa/auto-complete-20170124.1845/auto-complete.elc" "elpa/auto-complete-20170124.1845/dict/ada-mode" "elpa/auto-complete-20170124.1845/dict/c++-mode" "elpa/auto-complete-20170124.1845/dict/c-mode" "elpa/auto-complete-20170124.1845/dict/caml-mode" "elpa/auto-complete-20170124.1845/dict/clojure-mode" "elpa/auto-complete-20170124.1845/dict/clojurescript-mode" "elpa/auto-complete-20170124.1845/dict/coq-mode" "elpa/auto-complete-20170124.1845/dict/css-mode" "elpa/auto-complete-20170124.1845/dict/erlang-mode" "elpa/auto-complete-20170124.1845/dict/ess-julia-mode" "elpa/auto-complete-20170124.1845/dict/go-mode" "elpa/auto-complete-20170124.1845/dict/haskell-mode" "elpa/auto-complete-20170124.1845/dict/java-mode" "elpa/auto-complete-20170124.1845/dict/js-mode" "elpa/auto-complete-20170124.1845/dict/julia-mode" "elpa/auto-complete-20170124.1845/dict/lua-mode" "elpa/auto-complete-20170124.1845/dict/nim-mode" "elpa/auto-complete-20170124.1845/dict/objc-mode" "elpa/auto-complete-20170124.1845/dict/octave-mode" "elpa/auto-complete-20170124.1845/dict/php-mode" "elpa/auto-complete-20170124.1845/dict/python-mode" "elpa/auto-complete-20170124.1845/dict/qml-mode" "elpa/auto-complete-20170124.1845/dict/ruby-mode" "elpa/auto-complete-20170124.1845/dict/scala-mode" "elpa/auto-complete-20170124.1845/dict/scheme-mode" "elpa/auto-complete-20170124.1845/dict/sclang-mode" "elpa/auto-complete-20170124.1845/dict/sh-mode" "elpa/auto-complete-20170124.1845/dict/swift-mode" "elpa/auto-complete-20170124.1845/dict/tcl-mode" "elpa/auto-complete-20170124.1845/dict/ts-mode" "elpa/auto-complete-20170124.1845/dict/tuareg-mode" "elpa/auto-complete-20170124.1845/dict/verilog-mode" "elpa/browse-kill-ring-20171219.1108/browse-kill-ring-autoloads.el" "elpa/browse-kill-ring-20171219.1108/browse-kill-ring-pkg.el" "elpa/browse-kill-ring-20171219.1108/browse-kill-ring.el" "elpa/browse-kill-ring-20171219.1108/browse-kill-ring.elc" "elpa/buster-snippets-20151125.210/buster-snippet-helpers.el" "elpa/buster-snippets-20151125.210/buster-snippet-helpers.elc" "elpa/buster-snippets-20151125.210/buster-snippets-autoloads.el" "elpa/buster-snippets-20151125.210/buster-snippets-pkg.el" "elpa/buster-snippets-20151125.210/buster-snippets.el" "elpa/buster-snippets-20151125.210/buster-snippets.elc" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.alwaysCalledOn.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.alwaysCalledWith.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.alwaysCalledWithExactly.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.alwaysThrew.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.callCount.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.callOrder.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.called.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.calledOn.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.calledOnce.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.calledOnceWith.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.calledThrice.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.calledTwice.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.calledWith.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.calledWithExactly.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.className.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.defined.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.equals.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.exception.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.inDelta.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.isArray.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.isArrayLike.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.isBoolean.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.isFunction.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.isNaN.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.isNull.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.isNumber.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.isObject.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.isString.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.match.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.same.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.tagName.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.threw.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.typeOf.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/assert.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/buster.nestedContext.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/buster.setUp.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/buster.tearDown.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/buster.test.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/buster.testCase.browser.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/buster.testCase.mixed.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/buster.testCase.node.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.alwaysCalledOn.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.alwaysCalledWith.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.alwaysCalledWithExactly.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.alwaysThrew.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.callCount.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.callOrder.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.called.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.calledOn.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.calledOnce.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.calledOnceWith.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.calledThrice.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.calledTwice.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.calledWith.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.calledWithExactly.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.className.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.defined.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.equals.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.exception.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.inDelta.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.isArray.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.isArrayLike.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.isBoolean.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.isFunction.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.isNaN.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.isNull.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.isNumber.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.isObject.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.isString.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.match.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.same.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.tagName.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.threw.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.typeOf.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js-mode/refute.yasnippet" "elpa/buster-snippets-20151125.210/snippets/js2-mode/.yas-parents" "elpa/cal-china-x-20180211.1101/cal-china-x-autoloads.el" "elpa/cal-china-x-20180211.1101/cal-china-x-pkg.el" "elpa/cal-china-x-20180211.1101/cal-china-x.el" "elpa/cal-china-x-20180211.1101/cal-china-x.elc" "elpa/cal-china-x-20180211.1101/jieqi.txt" "elpa/chicken-scheme-20141116.1139/chicken-scheme-autoloads.el" "elpa/chicken-scheme-20141116.1139/chicken-scheme-pkg.el" "elpa/chicken-scheme-20141116.1139/chicken-scheme.el" "elpa/cider-readme.txt" "elpa/cl-lib-0.6.1/cl-lib-autoloads.el" "elpa/cl-lib-0.6.1/cl-lib-pkg.el" "elpa/cl-lib-0.6.1/cl-lib.el" "elpa/cl-lib-0.6.1/cl-lib.elc" "elpa/cl-lib-0.6.1.signed" "elpa/cl-lib-highlight-20140127.1312/cl-lib-highlight-autoloads.el" "elpa/cl-lib-highlight-20140127.1312/cl-lib-highlight-pkg.el" "elpa/cl-lib-highlight-20140127.1312/cl-lib-highlight.el" "elpa/cl-lib-highlight-20140127.1312/cl-lib-highlight.elc" "elpa/clojure-mode-extra-font-locking-20180114.911/clojure-mode-extra-font-locking-autoloads.el" "elpa/clojure-mode-extra-font-locking-20180114.911/clojure-mode-extra-font-locking-pkg.el" "elpa/clojure-mode-extra-font-locking-20180114.911/clojure-mode-extra-font-locking.el" "elpa/clojure-mode-extra-font-locking-20180114.911/clojure-mode-extra-font-locking.elc" "elpa/company-readme.txt" "elpa/concurrent-20161228.1930/concurrent-autoloads.el" "elpa/concurrent-20161228.1930/concurrent-pkg.el" "elpa/concurrent-20161228.1930/concurrent.el" "elpa/ctable-20171005.1711/ctable-autoloads.el" "elpa/ctable-20171005.1711/ctable-pkg.el" "elpa/ctable-20171005.1711/ctable.el" "elpa/ctable-20171005.1711/ctable.elc" "elpa/datomic-snippets-20180116.752/datomic-snippets-autoloads.el" "elpa/datomic-snippets-20180116.752/datomic-snippets-pkg.el" "elpa/datomic-snippets-20180116.752/datomic-snippets.el" "elpa/datomic-snippets-20180116.752/datomic-snippets.elc" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-attr-doc" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-attr-fulltext" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-attr-index" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-attr-isComponent" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-attr-noHistory" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-attr-unique" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-attribute" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-function" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-bigdec" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-bigint" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-boolean" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-bytes" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-double" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-float" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-instant" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-keyword" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-long" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-ref" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-string" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-uri" "elpa/datomic-snippets-20180116.752/snippets/clojure-mode/datomic-schema-type-uuid" "elpa/deferred-20170901.630/deferred-autoloads.el" "elpa/deferred-20170901.630/deferred-pkg.el" "elpa/deferred-20170901.630/deferred.el" "elpa/deferred-20170901.630/deferred.elc" "elpa/diminish-20170419.1036/diminish-autoloads.el" "elpa/diminish-20170419.1036/diminish-pkg.el" "elpa/diminish-20170419.1036/diminish.el" "elpa/diminish-20170419.1036/diminish.elc" "elpa/dired+-20170818.1411/dired+-autoloads.el" "elpa/dired+-20170818.1411/dired+-pkg.el" "elpa/dired+-20170818.1411/dired+.el" "elpa/dired+-20170818.1411/dired+.elc" "elpa/dired-details+-20170903.1237/dired-details+-autoloads.el" "elpa/dired-details+-20170903.1237/dired-details+-pkg.el" "elpa/dired-details+-20170903.1237/dired-details+.el" "elpa/dired-details+-20170903.1237/dired-details+.elc" "elpa/dired-details-20130824.458/dired-details-autoloads.el" "elpa/dired-details-20130824.458/dired-details-pkg.el" "elpa/dired-details-20130824.458/dired-details.el" "elpa/dired-details-20130824.458/dired-details.elc" "elpa/dired-hacks-utils-20160527.1436/dired-hacks-utils-autoloads.el" "elpa/dired-hacks-utils-20160527.1436/dired-hacks-utils-pkg.el" "elpa/dired-hacks-utils-20160527.1436/dired-hacks-utils.el" "elpa/dired-hacks-utils-20160527.1436/dired-hacks-utils.elc" "elpa/dired-icon-20170222.2126/dired-icon-autoloads.el" "elpa/dired-icon-20170222.2126/dired-icon-pkg.el" "elpa/dired-icon-20170222.2126/dired-icon.el" "elpa/dired-icon-20170222.2126/dired-icon.elc" "elpa/dired-icon-20170222.2126/get-icon-path-gtk3.py" "elpa/dired-icon-20170222.2126/get-icon-path-macos.m" "elpa/dired-narrow-20170309.329/dired-narrow-autoloads.el" "elpa/dired-narrow-20170309.329/dired-narrow-pkg.el" "elpa/dired-narrow-20170309.329/dired-narrow.el" "elpa/dired-narrow-20170309.329/dired-narrow.elc" "elpa/dired-rainbow-20171202.1448/dired-rainbow-autoloads.el" "elpa/dired-rainbow-20171202.1448/dired-rainbow-pkg.el" "elpa/dired-rainbow-20171202.1448/dired-rainbow.el" "elpa/dired-rainbow-20171202.1448/dired-rainbow.elc" "elpa/dired-ranger-20180401.1506/dired-ranger-autoloads.el" "elpa/dired-ranger-20180401.1506/dired-ranger-pkg.el" "elpa/dired-ranger-20180401.1506/dired-ranger.el" "elpa/dired-ranger-20180401.1506/dired-ranger.elc" "elpa/dired-subtree-20170910.1521/dired-subtree-autoloads.el" "elpa/dired-subtree-20170910.1521/dired-subtree-pkg.el" "elpa/dired-subtree-20170910.1521/dired-subtree.el" "elpa/dumb-diff-20171211.1322/dumb-diff-autoloads.el" "elpa/dumb-diff-20171211.1322/dumb-diff-pkg.el" "elpa/dumb-diff-20171211.1322/dumb-diff.el" "elpa/dumb-diff-20171211.1322/dumb-diff.elc" "elpa/edn-20160215.419/edn-autoloads.el" "elpa/edn-20160215.419/edn-pkg.el" "elpa/edn-20160215.419/edn.el" "elpa/edn-20160215.419/edn.elc" "elpa/engine-mode-20180401.946/engine-mode-autoloads.el" "elpa/engine-mode-20180401.946/engine-mode-pkg.el" "elpa/engine-mode-20180401.946/engine-mode.el" "elpa/engine-mode-20180401.946/engine-mode.elc" "elpa/epc-20140609.2234/epc-autoloads.el" "elpa/epc-20140609.2234/epc-pkg.el" "elpa/epc-20140609.2234/epc.el" "elpa/epc-20140609.2234/epcs.el" "elpa/epl-20180205.1249/epl-autoloads.el" "elpa/epl-20180205.1249/epl-pkg.el" "elpa/epl-20180205.1249/epl.el" "elpa/epl-20180205.1249/epl.elc" "elpa/epresent-20160410.1901/epresent-autoloads.el" "elpa/epresent-20160410.1901/epresent-pkg.el" "elpa/epresent-20160410.1901/epresent.el" "elpa/epresent-20160410.1901/epresent.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-autoloads.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-cider.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-cider.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-elm.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-erlang.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-geiser.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-hy.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-ielm.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-ielm.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-iex.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-javascript.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-lua.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-ocaml.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-pkg.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-prolog.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-prolog.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-python.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-python.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-racket.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-ruby.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-scala.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-scheme.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-scheme.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-shell.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-shell.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-slime.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-sml.el" "elpa/eval-in-repl-20171122.543/eval-in-repl.el" "elpa/eval-in-repl-20171122.543/eval-in-repl.elc" "elpa/evil-surround-20180102.601/evil-surround-autoloads.el" "elpa/evil-surround-20180102.601/evil-surround-pkg.el" "elpa/evil-surround-20180102.601/evil-surround.el" "elpa/evil-surround-20180102.601/evil-surround.elc" "elpa/evil-visualstar-20160222.1648/evil-visualstar-autoloads.el" "elpa/evil-visualstar-20160222.1648/evil-visualstar-pkg.el" "elpa/evil-visualstar-20160222.1648/evil-visualstar.el" "elpa/evil-visualstar-20160222.1648/evil-visualstar.elc" "elpa/exec-path-from-shell-20180323.1904/exec-path-from-shell-autoloads.el" "elpa/exec-path-from-shell-20180323.1904/exec-path-from-shell-pkg.el" "elpa/exec-path-from-shell-20180323.1904/exec-path-from-shell.el" "elpa/exec-path-from-shell-20180323.1904/exec-path-from-shell.elc" "elpa/f-20180106.122/f-autoloads.el" "elpa/f-20180106.122/f-pkg.el" "elpa/f-20180106.122/f.el" "elpa/f-20180106.122/f.elc" "elpa/font-lock+-20170222.1755/font-lock+-autoloads.el" "elpa/font-lock+-20170222.1755/font-lock+-pkg.el" "elpa/font-lock+-20170222.1755/font-lock+.el" "elpa/font-lock+-20170222.1755/font-lock+.elc" "elpa/fortpy-20150715.1332/Makefile" "elpa/fortpy-20150715.1332/fortpy-autoloads.el" "elpa/fortpy-20150715.1332/fortpy-pkg.el" "elpa/fortpy-20150715.1332/fortpy.el" "elpa/fortpy-20150715.1332/fortpyepcserver.py" "elpa/fortpy-20150715.1332/setup.py" "elpa/fringe-current-line-20140110.2011/fringe-current-line-autoloads.el" "elpa/fringe-current-line-20140110.2011/fringe-current-line-pkg.el" "elpa/fringe-current-line-20140110.2011/fringe-current-line.el" "elpa/fringe-current-line-20140110.2011/fringe-current-line.elc" "elpa/git-gutter-20161105.656/git-gutter-autoloads.el" "elpa/git-gutter-20161105.656/git-gutter-pkg.el" "elpa/git-gutter-20161105.656/git-gutter.el" "elpa/git-gutter-20161105.656/git-gutter.elc" "elpa/gntp-20141024.1950/gntp-autoloads.el" "elpa/gntp-20141024.1950/gntp-pkg.el" "elpa/gntp-20141024.1950/gntp.el" "elpa/gntp-20141024.1950/gntp.elc" "elpa/gnupg/pubring.kbx" "elpa/gnupg/pubring.kbx.lock" "elpa/gnupg/pubring.kbx~" "elpa/gnupg/trustdb.gpg" "elpa/goto-chg-20180105.1033/goto-chg-autoloads.el" "elpa/goto-chg-20180105.1033/goto-chg-pkg.el" "elpa/goto-chg-20180105.1033/goto-chg.el" "elpa/goto-chg-20180105.1033/goto-chg.elc" "elpa/highlight-escape-sequences-20171117.437/highlight-escape-sequences-autoloads.el" "elpa/highlight-escape-sequences-20171117.437/highlight-escape-sequences-pkg.el" "elpa/highlight-escape-sequences-20171117.437/highlight-escape-sequences.el" "elpa/highlight-escape-sequences-20171117.437/highlight-escape-sequences.elc" "elpa/highlight-indentation-20171218.137/highlight-indentation-autoloads.el" "elpa/highlight-indentation-20171218.137/highlight-indentation-pkg.el" "elpa/highlight-indentation-20171218.137/highlight-indentation.el" "elpa/highlight-indentation-20171218.137/highlight-indentation.elc" "elpa/ido-ubiquitous-20180216.949/ido-ubiquitous-autoloads.el" "elpa/ido-ubiquitous-20180216.949/ido-ubiquitous-pkg.el" "elpa/ido-ubiquitous-20180216.949/ido-ubiquitous.el" "elpa/ido-ubiquitous-20180216.949/ido-ubiquitous.elc" "elpa/image+-20150707.916/image+-autoloads.el" "elpa/image+-20150707.916/image+-pkg.el" "elpa/image+-20150707.916/image+.el" "elpa/image+-20150707.916/image+.elc" "elpa/inflections-20170913.216/inflections-autoloads.el" "elpa/inflections-20170913.216/inflections-pkg.el" "elpa/inflections-20170913.216/inflections.el" "elpa/inflections-20170913.216/inflections.elc" "elpa/ivy-dired-history-20170625.2256/ivy-dired-history-autoloads.el" "elpa/ivy-dired-history-20170625.2256/ivy-dired-history-pkg.el" "elpa/ivy-dired-history-20170625.2256/ivy-dired-history.el" "elpa/ivy-dired-history-20170625.2256/ivy-dired-history.elc" "elpa/iy-go-to-char-20141029.846/iy-go-to-char-autoloads.el" "elpa/iy-go-to-char-20141029.846/iy-go-to-char-pkg.el" "elpa/iy-go-to-char-20141029.846/iy-go-to-char.el" "elpa/iy-go-to-char-20141029.846/iy-go-to-char.elc" "elpa/julia-mode-20171116.642/julia-mode-autoloads.el" "elpa/julia-mode-20171116.642/julia-mode-pkg.el" "elpa/julia-mode-20171116.642/julia-mode.el" "elpa/julia-mode-20171116.642/julia-mode.elc" "elpa/key-chord-20160227.438/key-chord-autoloads.el" "elpa/key-chord-20160227.438/key-chord-pkg.el" "elpa/key-chord-20160227.438/key-chord.el" "elpa/key-chord-20160227.438/key-chord.elc" "elpa/let-alist-1.0.5/let-alist-autoloads.el" "elpa/let-alist-1.0.5/let-alist-pkg.el" "elpa/let-alist-1.0.5/let-alist.el" "elpa/let-alist-1.0.5/let-alist.elc" "elpa/let-alist-1.0.5.signed" "elpa/log4e-20170401.604/log4e-autoloads.el" "elpa/log4e-20170401.604/log4e-pkg.el" "elpa/log4e-20170401.604/log4e.el" "elpa/log4e-20170401.604/log4e.elc" "elpa/macrostep-20161120.1306/macrostep-autoloads.el" "elpa/macrostep-20161120.1306/macrostep-c.el" "elpa/macrostep-20161120.1306/macrostep-c.elc" "elpa/macrostep-20161120.1306/macrostep-pkg.el" "elpa/macrostep-20161120.1306/macrostep.el" "elpa/macrostep-20161120.1306/macrostep.elc" "elpa/markdown-mode+-20170320.1404/HTML as Markdown in Emacs.applescript" "elpa/markdown-mode+-20170320.1404/markdown-mode+-autoloads.el" "elpa/markdown-mode+-20170320.1404/markdown-mode+-pkg.el" "elpa/markdown-mode+-20170320.1404/markdown-mode+.el" "elpa/markdown-mode+-20170320.1404/markdown-mode+.elc" "elpa/matlab-mode-20180125.1010/cedet-matlab.el" "elpa/matlab-mode-20180125.1010/cedet-matlab.elc" "elpa/matlab-mode-20180125.1010/company-matlab-shell.el" "elpa/matlab-mode-20180125.1010/company-matlab-shell.elc" "elpa/matlab-mode-20180125.1010/dl_emacs_support.m" "elpa/matlab-mode-20180125.1010/linemark.el" "elpa/matlab-mode-20180125.1010/linemark.elc" "elpa/matlab-mode-20180125.1010/matlab-mode-autoloads.el" "elpa/matlab-mode-20180125.1010/matlab-mode-pkg.el" "elpa/matlab-mode-20180125.1010/matlab-publish.el" "elpa/matlab-mode-20180125.1010/matlab-publish.elc" "elpa/matlab-mode-20180125.1010/matlab.el" "elpa/matlab-mode-20180125.1010/matlab.elc" "elpa/matlab-mode-20180125.1010/mlint.el" "elpa/matlab-mode-20180125.1010/mlint.elc" "elpa/matlab-mode-20180125.1010/semantic-matlab.el" "elpa/matlab-mode-20180125.1010/semantic-matlab.elc" "elpa/matlab-mode-20180125.1010/semanticdb-matlab.el" "elpa/matlab-mode-20180125.1010/semanticdb-matlab.elc" "elpa/matlab-mode-20180125.1010/srecode-matlab.el" "elpa/matlab-mode-20180125.1010/srecode-matlab.elc" "elpa/matlab-mode-20180125.1010/templates/srecode-matlab.srt" "elpa/matlab-mode-20180125.1010/tlc.el" "elpa/matlab-mode-20180125.1010/tlc.elc" "elpa/matlab-mode-20180125.1010/toolbox/dbhotlink.m" "elpa/matlab-mode-20180125.1010/toolbox/emacsdocomplete.m" "elpa/matlab-mode-20180125.1010/toolbox/emacsinit.m" "elpa/matlab-mode-20180125.1010/toolbox/opentoline.m" "elpa/memoize-20170720.1802/memoize-autoloads.el" "elpa/memoize-20170720.1802/memoize-pkg.el" "elpa/memoize-20170720.1802/memoize.el" "elpa/memoize-20170720.1802/memoize.elc" "elpa/mo-git-blame-20160129.959/mo-git-blame-autoloads.el" "elpa/mo-git-blame-20160129.959/mo-git-blame-pkg.el" "elpa/mo-git-blame-20160129.959/mo-git-blame.el" "elpa/mo-git-blame-20160129.959/mo-git-blame.elc" "elpa/move-text-20170908.2030/move-text-autoloads.el" "elpa/move-text-20170908.2030/move-text-pkg.el" "elpa/move-text-20170908.2030/move-text.el" "elpa/move-text-20170908.2030/move-text.elc" "elpa/multiple-cursors-20180406.1350/mc-cycle-cursors.el" "elpa/multiple-cursors-20180406.1350/mc-cycle-cursors.elc" "elpa/multiple-cursors-20180406.1350/mc-edit-lines.el" "elpa/multiple-cursors-20180406.1350/mc-edit-lines.elc" "elpa/multiple-cursors-20180406.1350/mc-hide-unmatched-lines-mode.el" "elpa/multiple-cursors-20180406.1350/mc-hide-unmatched-lines-mode.elc" "elpa/multiple-cursors-20180406.1350/mc-mark-more.el" "elpa/multiple-cursors-20180406.1350/mc-mark-more.elc" "elpa/multiple-cursors-20180406.1350/mc-mark-pop.el" "elpa/multiple-cursors-20180406.1350/mc-mark-pop.elc" "elpa/multiple-cursors-20180406.1350/mc-separate-operations.el" "elpa/multiple-cursors-20180406.1350/mc-separate-operations.elc" "elpa/multiple-cursors-20180406.1350/multiple-cursors-autoloads.el" "elpa/multiple-cursors-20180406.1350/multiple-cursors-core.el" "elpa/multiple-cursors-20180406.1350/multiple-cursors-core.elc" "elpa/multiple-cursors-20180406.1350/multiple-cursors-pkg.el" "elpa/multiple-cursors-20180406.1350/multiple-cursors.el" "elpa/multiple-cursors-20180406.1350/multiple-cursors.elc" "elpa/multiple-cursors-20180406.1350/rectangular-region-mode.el" "elpa/multiple-cursors-20180406.1350/rectangular-region-mode.elc" "elpa/multiple-cursors-readme.txt" "elpa/nyan-mode-20170423.40/img/nyan-frame-1.xpm" "elpa/nyan-mode-20170423.40/img/nyan-frame-2.xpm" "elpa/nyan-mode-20170423.40/img/nyan-frame-3.xpm" "elpa/nyan-mode-20170423.40/img/nyan-frame-4.xpm" "elpa/nyan-mode-20170423.40/img/nyan-frame-5.xpm" "elpa/nyan-mode-20170423.40/img/nyan-frame-6.xpm" "elpa/nyan-mode-20170423.40/img/nyan.xpm" "elpa/nyan-mode-20170423.40/img/outerspace.xpm" "elpa/nyan-mode-20170423.40/img/rainbow.xpm" "elpa/nyan-mode-20170423.40/mus/nyanlooped.mp3" "elpa/nyan-mode-20170423.40/nyan-mode-autoloads.el" "elpa/nyan-mode-20170423.40/nyan-mode-pkg.el" "elpa/nyan-mode-20170423.40/nyan-mode.el" "elpa/nyan-mode-20170423.40/nyan-mode.elc" "elpa/org-20170925/COPYING" "elpa/org-20170925/README_ELPA" "elpa/org-20170925/dir" "elpa/org-20170925/etc/ORG-NEWS" "elpa/org-20170925/etc/styles/OrgOdtContentTemplate.xml" "elpa/org-20170925/etc/styles/OrgOdtStyles.xml" "elpa/org-20170925/etc/styles/README" "elpa/org-20170925/ob-C.el" "elpa/org-20170925/ob-C.elc" "elpa/org-20170925/ob-J.el" "elpa/org-20170925/ob-J.elc" "elpa/org-20170925/ob-R.el" "elpa/org-20170925/ob-R.elc" "elpa/org-20170925/ob-abc.el" "elpa/org-20170925/ob-abc.elc" "elpa/org-20170925/ob-asymptote.el" "elpa/org-20170925/ob-asymptote.elc" "elpa/org-20170925/ob-awk.el" "elpa/org-20170925/ob-awk.elc" "elpa/org-20170925/ob-calc.el" "elpa/org-20170925/ob-calc.elc" "elpa/org-20170925/ob-clojure.el" "elpa/org-20170925/ob-clojure.elc" "elpa/org-20170925/ob-comint.el" "elpa/org-20170925/ob-comint.elc" "elpa/org-20170925/ob-coq.el" "elpa/org-20170925/ob-coq.elc" "elpa/org-20170925/ob-core.el" "elpa/org-20170925/ob-core.elc" "elpa/org-20170925/ob-css.el" "elpa/org-20170925/ob-css.elc" "elpa/org-20170925/ob-ditaa.el" "elpa/org-20170925/ob-ditaa.elc" "elpa/org-20170925/ob-dot.el" "elpa/org-20170925/ob-dot.elc" "elpa/org-20170925/ob-ebnf.el" "elpa/org-20170925/ob-ebnf.elc" "elpa/org-20170925/ob-emacs-lisp.el" "elpa/org-20170925/ob-emacs-lisp.elc" "elpa/org-20170925/ob-eval.el" "elpa/org-20170925/ob-eval.elc" "elpa/org-20170925/ob-exp.el" "elpa/org-20170925/ob-exp.elc" "elpa/org-20170925/ob-forth.el" "elpa/org-20170925/ob-forth.elc" "elpa/org-20170925/ob-fortran.el" "elpa/org-20170925/ob-fortran.elc" "elpa/org-20170925/ob-gnuplot.el" "elpa/org-20170925/ob-gnuplot.elc" "elpa/org-20170925/ob-groovy.el" "elpa/org-20170925/ob-groovy.elc" "elpa/org-20170925/ob-haskell.el" "elpa/org-20170925/ob-haskell.elc" "elpa/org-20170925/ob-hledger.el" "elpa/org-20170925/ob-hledger.elc" "elpa/org-20170925/ob-io.el" "elpa/org-20170925/ob-io.elc" "elpa/org-20170925/ob-java.el" "elpa/org-20170925/ob-java.elc" "elpa/org-20170925/ob-js.el" "elpa/org-20170925/ob-js.elc" "elpa/org-20170925/ob-keys.el" "elpa/org-20170925/ob-keys.elc" "elpa/org-20170925/ob-latex.el" "elpa/org-20170925/ob-latex.elc" "elpa/org-20170925/ob-ledger.el" "elpa/org-20170925/ob-ledger.elc" "elpa/org-20170925/ob-lilypond.el" "elpa/org-20170925/ob-lilypond.elc" "elpa/org-20170925/ob-lisp.el" "elpa/org-20170925/ob-lisp.elc" "elpa/org-20170925/ob-lob.el" "elpa/org-20170925/ob-lob.elc" "elpa/org-20170925/ob-lua.el" "elpa/org-20170925/ob-lua.elc" "elpa/org-20170925/ob-makefile.el" "elpa/org-20170925/ob-makefile.elc" "elpa/org-20170925/ob-matlab.el" "elpa/org-20170925/ob-matlab.elc" "elpa/org-20170925/ob-maxima.el" "elpa/org-20170925/ob-maxima.elc" "elpa/org-20170925/ob-mscgen.el" "elpa/org-20170925/ob-mscgen.elc" "elpa/org-20170925/ob-ocaml.el" "elpa/org-20170925/ob-ocaml.elc" "elpa/org-20170925/ob-octave.el" "elpa/org-20170925/ob-octave.elc" "elpa/org-20170925/ob-org.el" "elpa/org-20170925/ob-org.elc" "elpa/org-20170925/ob-perl.el" "elpa/org-20170925/ob-perl.elc" "elpa/org-20170925/ob-picolisp.el" "elpa/org-20170925/ob-picolisp.elc" "elpa/org-20170925/ob-plantuml.el" "elpa/org-20170925/ob-plantuml.elc" "elpa/org-20170925/ob-processing.el" "elpa/org-20170925/ob-processing.elc" "elpa/org-20170925/ob-python.el" "elpa/org-20170925/ob-python.elc" "elpa/org-20170925/ob-ref.el" "elpa/org-20170925/ob-ref.elc" "elpa/org-20170925/ob-ruby.el" "elpa/org-20170925/ob-ruby.elc" "elpa/org-20170925/ob-sass.el" "elpa/org-20170925/ob-sass.elc" "elpa/org-20170925/ob-scheme.el" "elpa/org-20170925/ob-scheme.elc" "elpa/org-20170925/ob-screen.el" "elpa/org-20170925/ob-screen.elc" "elpa/org-20170925/ob-sed.el" "elpa/org-20170925/ob-sed.elc" "elpa/org-20170925/ob-shell.el" "elpa/org-20170925/ob-shell.elc" "elpa/org-20170925/ob-shen.el" "elpa/org-20170925/ob-shen.elc" "elpa/org-20170925/ob-sql.el" "elpa/org-20170925/ob-sql.elc" "elpa/org-20170925/ob-sqlite.el" "elpa/org-20170925/ob-sqlite.elc" "elpa/org-20170925/ob-stan.el" "elpa/org-20170925/ob-stan.elc" "elpa/org-20170925/ob-table.el" "elpa/org-20170925/ob-table.elc" "elpa/org-20170925/ob-tangle.el" "elpa/org-20170925/ob-tangle.elc" "elpa/org-20170925/ob-vala.el" "elpa/org-20170925/ob-vala.elc" "elpa/org-20170925/ob.el" "elpa/org-20170925/ob.elc" "elpa/org-20170925/org" "elpa/org-20170925/org-agenda.el" "elpa/org-20170925/org-agenda.elc" "elpa/org-20170925/org-archive.el" "elpa/org-20170925/org-archive.elc" "elpa/org-20170925/org-attach.el" "elpa/org-20170925/org-attach.elc" "elpa/org-20170925/org-autoloads.el" "elpa/org-20170925/org-bbdb.el" "elpa/org-20170925/org-bbdb.elc" "elpa/org-20170925/org-bibtex.el" "elpa/org-20170925/org-bibtex.elc" "elpa/org-20170925/org-capture.el" "elpa/org-20170925/org-capture.elc" "elpa/org-20170925/org-clock.el" "elpa/org-20170925/org-clock.elc" "elpa/org-20170925/org-colview.el" "elpa/org-20170925/org-colview.elc" "elpa/org-20170925/org-compat.el" "elpa/org-20170925/org-compat.elc" "elpa/org-20170925/org-crypt.el" "elpa/org-20170925/org-crypt.elc" "elpa/org-20170925/org-ctags.el" "elpa/org-20170925/org-ctags.elc" "elpa/org-20170925/org-datetree.el" "elpa/org-20170925/org-datetree.elc" "elpa/org-20170925/org-docview.el" "elpa/org-20170925/org-docview.elc" "elpa/org-20170925/org-duration.el" "elpa/org-20170925/org-duration.elc" "elpa/org-20170925/org-element.el" "elpa/org-20170925/org-element.elc" "elpa/org-20170925/org-entities.el" "elpa/org-20170925/org-entities.elc" "elpa/org-20170925/org-eshell.el" "elpa/org-20170925/org-eshell.elc" "elpa/org-20170925/org-eww.el" "elpa/org-20170925/org-eww.elc" "elpa/org-20170925/org-faces.el" "elpa/org-20170925/org-faces.elc" "elpa/org-20170925/org-feed.el" "elpa/org-20170925/org-feed.elc" "elpa/org-20170925/org-footnote.el" "elpa/org-20170925/org-footnote.elc" "elpa/org-20170925/org-gnus.el" "elpa/org-20170925/org-gnus.elc" "elpa/org-20170925/org-habit.el" "elpa/org-20170925/org-habit.elc" "elpa/org-20170925/org-id.el" "elpa/org-20170925/org-id.elc" "elpa/org-20170925/org-indent.el" "elpa/org-20170925/org-indent.elc" "elpa/org-20170925/org-info.el" "elpa/org-20170925/org-info.elc" "elpa/org-20170925/org-inlinetask.el" "elpa/org-20170925/org-inlinetask.elc" "elpa/org-20170925/org-install.el" "elpa/org-20170925/org-irc.el" "elpa/org-20170925/org-irc.elc" "elpa/org-20170925/org-lint.el" "elpa/org-20170925/org-lint.elc" "elpa/org-20170925/org-list.el" "elpa/org-20170925/org-list.elc" "elpa/org-20170925/org-loaddefs.el" "elpa/org-20170925/org-macro.el" "elpa/org-20170925/org-macro.elc" "elpa/org-20170925/org-macs.el" "elpa/org-20170925/org-macs.elc" "elpa/org-20170925/org-mhe.el" "elpa/org-20170925/org-mhe.elc" "elpa/org-20170925/org-mobile.el" "elpa/org-20170925/org-mobile.elc" "elpa/org-20170925/org-mouse.el" "elpa/org-20170925/org-mouse.elc" "elpa/org-20170925/org-pcomplete.el" "elpa/org-20170925/org-pcomplete.elc" "elpa/org-20170925/org-pkg.el" "elpa/org-20170925/org-pkg.elc" "elpa/org-20170925/org-plot.el" "elpa/org-20170925/org-plot.elc" "elpa/org-20170925/org-protocol.el" "elpa/org-20170925/org-protocol.elc" "elpa/org-20170925/org-rmail.el" "elpa/org-20170925/org-rmail.elc" "elpa/org-20170925/org-src.el" "elpa/org-20170925/org-src.elc" "elpa/org-20170925/org-table.el" "elpa/org-20170925/org-table.elc" "elpa/org-20170925/org-timer.el" "elpa/org-20170925/org-timer.elc" "elpa/org-20170925/org-version.el" "elpa/org-20170925/org-w3m.el" "elpa/org-20170925/org-w3m.elc" "elpa/org-20170925/org.el" "elpa/org-20170925/org.elc" "elpa/org-20170925/orgcard.pdf" "elpa/org-20170925/ox-ascii.el" "elpa/org-20170925/ox-ascii.elc" "elpa/org-20170925/ox-beamer.el" "elpa/org-20170925/ox-beamer.elc" "elpa/org-20170925/ox-html.el" "elpa/org-20170925/ox-html.elc" "elpa/org-20170925/ox-icalendar.el" "elpa/org-20170925/ox-icalendar.elc" "elpa/org-20170925/ox-latex.el" "elpa/org-20170925/ox-latex.elc" "elpa/org-20170925/ox-man.el" "elpa/org-20170925/ox-man.elc" "elpa/org-20170925/ox-md.el" "elpa/org-20170925/ox-md.elc" "elpa/org-20170925/ox-odt.el" "elpa/org-20170925/ox-odt.elc" "elpa/org-20170925/ox-org.el" "elpa/org-20170925/ox-org.elc" "elpa/org-20170925/ox-publish.el" "elpa/org-20170925/ox-publish.elc" "elpa/org-20170925/ox-texinfo.el" "elpa/org-20170925/ox-texinfo.elc" "elpa/org-20170925/ox.el" "elpa/org-20170925/ox.elc" "elpa/org-autolist-20170924.1201/org-autolist-autoloads.el" "elpa/org-autolist-20170924.1201/org-autolist-pkg.el" "elpa/org-autolist-20170924.1201/org-autolist.el" "elpa/org-autolist-20170924.1201/org-autolist.elc" "elpa/org-babel-eval-in-repl-20170511.514/eval-in-repl-ess.el" "elpa/org-babel-eval-in-repl-20170511.514/eval-in-repl-ess.elc" "elpa/org-babel-eval-in-repl-20170511.514/eval-in-repl-matlab.el" "elpa/org-babel-eval-in-repl-20170511.514/eval-in-repl-matlab.elc" "elpa/org-babel-eval-in-repl-20170511.514/org-babel-eval-in-repl-autoloads.el" "elpa/org-babel-eval-in-repl-20170511.514/org-babel-eval-in-repl-pkg.el" "elpa/org-babel-eval-in-repl-20170511.514/org-babel-eval-in-repl.el" "elpa/org-babel-eval-in-repl-20170511.514/org-babel-eval-in-repl.elc" "elpa/org-bookmark-heading-20170510.1008/org-bookmark-heading-autoloads.el" "elpa/org-bookmark-heading-20170510.1008/org-bookmark-heading-pkg.el" "elpa/org-bookmark-heading-20170510.1008/org-bookmark-heading.el" "elpa/org-bookmark-heading-20170510.1008/org-bookmark-heading.elc" "elpa/org-bullets-20171127.526/org-bullets-autoloads.el" "elpa/org-bullets-20171127.526/org-bullets-pkg.el" "elpa/org-bullets-20171127.526/org-bullets.el" "elpa/org-bullets-20171127.526/org-bullets.elc" "elpa/org-mind-map-20171206.645/org-mind-map-autoloads.el" "elpa/org-mind-map-20171206.645/org-mind-map-pkg.el" "elpa/org-mind-map-20171206.645/org-mind-map.el" "elpa/org-mind-map-20171206.645/org-mind-map.elc" "elpa/org-plus-contrib-20170911/COPYING" "elpa/org-plus-contrib-20170911/README_ELPA" "elpa/org-plus-contrib-20170911/dir" "elpa/org-plus-contrib-20170911/etc/ORG-NEWS" "elpa/org-plus-contrib-20170911/etc/styles/OrgOdtContentTemplate.xml" "elpa/org-plus-contrib-20170911/etc/styles/OrgOdtStyles.xml" "elpa/org-plus-contrib-20170911/etc/styles/README" "elpa/org-plus-contrib-20170911/hello.org" "elpa/org-plus-contrib-20170911/ob-C.el" "elpa/org-plus-contrib-20170911/ob-C.elc" "elpa/org-plus-contrib-20170911/ob-J.el" "elpa/org-plus-contrib-20170911/ob-J.elc" "elpa/org-plus-contrib-20170911/ob-R.el" "elpa/org-plus-contrib-20170911/ob-R.elc" "elpa/org-plus-contrib-20170911/ob-abc.el" "elpa/org-plus-contrib-20170911/ob-abc.elc" "elpa/org-plus-contrib-20170911/ob-asymptote.el" "elpa/org-plus-contrib-20170911/ob-asymptote.elc" "elpa/org-plus-contrib-20170911/ob-awk.el" "elpa/org-plus-contrib-20170911/ob-awk.elc" "elpa/org-plus-contrib-20170911/ob-calc.el" "elpa/org-plus-contrib-20170911/ob-calc.elc" "elpa/org-plus-contrib-20170911/ob-clojure.el" "elpa/org-plus-contrib-20170911/ob-clojure.elc" "elpa/org-plus-contrib-20170911/ob-comint.el" "elpa/org-plus-contrib-20170911/ob-comint.elc" "elpa/org-plus-contrib-20170911/ob-coq.el" "elpa/org-plus-contrib-20170911/ob-coq.elc" "elpa/org-plus-contrib-20170911/ob-core.el" "elpa/org-plus-contrib-20170911/ob-core.elc" "elpa/org-plus-contrib-20170911/ob-csharp.el" "elpa/org-plus-contrib-20170911/ob-csharp.elc" "elpa/org-plus-contrib-20170911/ob-css.el" "elpa/org-plus-contrib-20170911/ob-css.elc" "elpa/org-plus-contrib-20170911/ob-ditaa.el" "elpa/org-plus-contrib-20170911/ob-ditaa.elc" "elpa/org-plus-contrib-20170911/ob-dot.el" "elpa/org-plus-contrib-20170911/ob-dot.elc" "elpa/org-plus-contrib-20170911/ob-ebnf.el" "elpa/org-plus-contrib-20170911/ob-ebnf.elc" "elpa/org-plus-contrib-20170911/ob-emacs-lisp.el" "elpa/org-plus-contrib-20170911/ob-emacs-lisp.elc" "elpa/org-plus-contrib-20170911/ob-eukleides.el" "elpa/org-plus-contrib-20170911/ob-eukleides.elc" "elpa/org-plus-contrib-20170911/ob-eval.el" "elpa/org-plus-contrib-20170911/ob-eval.elc" "elpa/org-plus-contrib-20170911/ob-exp.el" "elpa/org-plus-contrib-20170911/ob-exp.elc" "elpa/org-plus-contrib-20170911/ob-fomus.el" "elpa/org-plus-contrib-20170911/ob-fomus.elc" "elpa/org-plus-contrib-20170911/ob-forth.el" "elpa/org-plus-contrib-20170911/ob-forth.elc" "elpa/org-plus-contrib-20170911/ob-fortran.el" "elpa/org-plus-contrib-20170911/ob-fortran.elc" "elpa/org-plus-contrib-20170911/ob-gnuplot.el" "elpa/org-plus-contrib-20170911/ob-gnuplot.elc" "elpa/org-plus-contrib-20170911/ob-groovy.el" "elpa/org-plus-contrib-20170911/ob-groovy.elc" "elpa/org-plus-contrib-20170911/ob-haskell.el" "elpa/org-plus-contrib-20170911/ob-haskell.elc" "elpa/org-plus-contrib-20170911/ob-hledger.el" "elpa/org-plus-contrib-20170911/ob-hledger.elc" "elpa/org-plus-contrib-20170911/ob-io.el" "elpa/org-plus-contrib-20170911/ob-io.elc" "elpa/org-plus-contrib-20170911/ob-java.el" "elpa/org-plus-contrib-20170911/ob-java.elc" "elpa/org-plus-contrib-20170911/ob-js.el" "elpa/org-plus-contrib-20170911/ob-js.elc" "elpa/org-plus-contrib-20170911/ob-julia.el" "elpa/org-plus-contrib-20170911/ob-julia.elc" "elpa/org-plus-contrib-20170911/ob-keys.el" "elpa/org-plus-contrib-20170911/ob-keys.elc" "elpa/org-plus-contrib-20170911/ob-latex.el" "elpa/org-plus-contrib-20170911/ob-latex.elc" "elpa/org-plus-contrib-20170911/ob-ledger.el" "elpa/org-plus-contrib-20170911/ob-ledger.elc" "elpa/org-plus-contrib-20170911/ob-lilypond.el" "elpa/org-plus-contrib-20170911/ob-lilypond.elc" "elpa/org-plus-contrib-20170911/ob-lisp.el" "elpa/org-plus-contrib-20170911/ob-lisp.elc" "elpa/org-plus-contrib-20170911/ob-lob.el" "elpa/org-plus-contrib-20170911/ob-lob.elc" "elpa/org-plus-contrib-20170911/ob-lua.el" "elpa/org-plus-contrib-20170911/ob-lua.elc" "elpa/org-plus-contrib-20170911/ob-makefile.el" "elpa/org-plus-contrib-20170911/ob-makefile.elc" "elpa/org-plus-contrib-20170911/ob-mathematica.el" "elpa/org-plus-contrib-20170911/ob-mathematica.elc" "elpa/org-plus-contrib-20170911/ob-mathomatic.el" "elpa/org-plus-contrib-20170911/ob-mathomatic.elc" "elpa/org-plus-contrib-20170911/ob-matlab.el" "elpa/org-plus-contrib-20170911/ob-matlab.elc" "elpa/org-plus-contrib-20170911/ob-maxima.el" "elpa/org-plus-contrib-20170911/ob-maxima.elc" "elpa/org-plus-contrib-20170911/ob-mscgen.el" "elpa/org-plus-contrib-20170911/ob-mscgen.elc" "elpa/org-plus-contrib-20170911/ob-ocaml.el" "elpa/org-plus-contrib-20170911/ob-ocaml.elc" "elpa/org-plus-contrib-20170911/ob-octave.el" "elpa/org-plus-contrib-20170911/ob-octave.elc" "elpa/org-plus-contrib-20170911/ob-org.el" "elpa/org-plus-contrib-20170911/ob-org.elc" "elpa/org-plus-contrib-20170911/ob-oz.el" "elpa/org-plus-contrib-20170911/ob-oz.elc" "elpa/org-plus-contrib-20170911/ob-perl.el" "elpa/org-plus-contrib-20170911/ob-perl.elc" "elpa/org-plus-contrib-20170911/ob-picolisp.el" "elpa/org-plus-contrib-20170911/ob-picolisp.elc" "elpa/org-plus-contrib-20170911/ob-plantuml.el" "elpa/org-plus-contrib-20170911/ob-plantuml.elc" "elpa/org-plus-contrib-20170911/ob-processing.el" "elpa/org-plus-contrib-20170911/ob-processing.elc" "elpa/org-plus-contrib-20170911/ob-python.el" "elpa/org-plus-contrib-20170911/ob-python.elc" "elpa/org-plus-contrib-20170911/ob-ref.el" "elpa/org-plus-contrib-20170911/ob-ref.elc" "elpa/org-plus-contrib-20170911/ob-ruby.el" "elpa/org-plus-contrib-20170911/ob-ruby.elc" "elpa/org-plus-contrib-20170911/ob-sass.el" "elpa/org-plus-contrib-20170911/ob-sass.elc" "elpa/org-plus-contrib-20170911/ob-scheme.el" "elpa/org-plus-contrib-20170911/ob-scheme.elc" "elpa/org-plus-contrib-20170911/ob-sclang.el" "elpa/org-plus-contrib-20170911/ob-screen.el" "elpa/org-plus-contrib-20170911/ob-screen.elc" "elpa/org-plus-contrib-20170911/ob-sed.el" "elpa/org-plus-contrib-20170911/ob-sed.elc" "elpa/org-plus-contrib-20170911/ob-shell.el" "elpa/org-plus-contrib-20170911/ob-shell.elc" "elpa/org-plus-contrib-20170911/ob-shen.el" "elpa/org-plus-contrib-20170911/ob-shen.elc" "elpa/org-plus-contrib-20170911/ob-sql.el" "elpa/org-plus-contrib-20170911/ob-sql.elc" "elpa/org-plus-contrib-20170911/ob-sqlite.el" "elpa/org-plus-contrib-20170911/ob-sqlite.elc" "elpa/org-plus-contrib-20170911/ob-stan.el" "elpa/org-plus-contrib-20170911/ob-stan.elc" "elpa/org-plus-contrib-20170911/ob-stata.el" "elpa/org-plus-contrib-20170911/ob-stata.elc" "elpa/org-plus-contrib-20170911/ob-table.el" "elpa/org-plus-contrib-20170911/ob-table.elc" "elpa/org-plus-contrib-20170911/ob-tangle.el" "elpa/org-plus-contrib-20170911/ob-tangle.elc" "elpa/org-plus-contrib-20170911/ob-tcl.el" "elpa/org-plus-contrib-20170911/ob-tcl.elc" "elpa/org-plus-contrib-20170911/ob-vala.el" "elpa/org-plus-contrib-20170911/ob-vala.elc" "elpa/org-plus-contrib-20170911/ob-vbnet.el" "elpa/org-plus-contrib-20170911/ob-vbnet.elc" "elpa/org-plus-contrib-20170911/ob.el" "elpa/org-plus-contrib-20170911/ob.elc" "elpa/org-plus-contrib-20170911/org" "elpa/org-plus-contrib-20170911/org-agenda.el" "elpa/org-plus-contrib-20170911/org-agenda.elc" "elpa/org-plus-contrib-20170911/org-annotate-file.el" "elpa/org-plus-contrib-20170911/org-annotate-file.elc" "elpa/org-plus-contrib-20170911/org-archive.el" "elpa/org-plus-contrib-20170911/org-archive.elc" "elpa/org-plus-contrib-20170911/org-attach.el" "elpa/org-plus-contrib-20170911/org-attach.elc" "elpa/org-plus-contrib-20170911/org-bbdb.el" "elpa/org-plus-contrib-20170911/org-bbdb.elc" "elpa/org-plus-contrib-20170911/org-bibtex-extras.el" "elpa/org-plus-contrib-20170911/org-bibtex-extras.elc" "elpa/org-plus-contrib-20170911/org-bibtex.el" "elpa/org-plus-contrib-20170911/org-bibtex.elc" "elpa/org-plus-contrib-20170911/org-bookmark.el" "elpa/org-plus-contrib-20170911/org-bookmark.elc" "elpa/org-plus-contrib-20170911/org-capture.el" "elpa/org-plus-contrib-20170911/org-capture.elc" "elpa/org-plus-contrib-20170911/org-checklist.el" "elpa/org-plus-contrib-20170911/org-checklist.elc" "elpa/org-plus-contrib-20170911/org-choose.el" "elpa/org-plus-contrib-20170911/org-choose.elc" "elpa/org-plus-contrib-20170911/org-clock.el" "elpa/org-plus-contrib-20170911/org-clock.elc" "elpa/org-plus-contrib-20170911/org-collector.el" "elpa/org-plus-contrib-20170911/org-collector.elc" "elpa/org-plus-contrib-20170911/org-colview.el" "elpa/org-plus-contrib-20170911/org-colview.elc" "elpa/org-plus-contrib-20170911/org-compat.el" "elpa/org-plus-contrib-20170911/org-compat.elc" "elpa/org-plus-contrib-20170911/org-contacts.el" "elpa/org-plus-contrib-20170911/org-contacts.elc" "elpa/org-plus-contrib-20170911/org-contribdir.el" "elpa/org-plus-contrib-20170911/org-contribdir.elc" "elpa/org-plus-contrib-20170911/org-crypt.el" "elpa/org-plus-contrib-20170911/org-crypt.elc" "elpa/org-plus-contrib-20170911/org-ctags.el" "elpa/org-plus-contrib-20170911/org-ctags.elc" "elpa/org-plus-contrib-20170911/org-datetree.el" "elpa/org-plus-contrib-20170911/org-datetree.elc" "elpa/org-plus-contrib-20170911/org-depend.el" "elpa/org-plus-contrib-20170911/org-depend.elc" "elpa/org-plus-contrib-20170911/org-docview.el" "elpa/org-plus-contrib-20170911/org-docview.elc" "elpa/org-plus-contrib-20170911/org-drill.el" "elpa/org-plus-contrib-20170911/org-drill.elc" "elpa/org-plus-contrib-20170911/org-duration.el" "elpa/org-plus-contrib-20170911/org-duration.elc" "elpa/org-plus-contrib-20170911/org-effectiveness.el" "elpa/org-plus-contrib-20170911/org-effectiveness.elc" "elpa/org-plus-contrib-20170911/org-eldoc.el" "elpa/org-plus-contrib-20170911/org-eldoc.elc" "elpa/org-plus-contrib-20170911/org-element.el" "elpa/org-plus-contrib-20170911/org-element.elc" "elpa/org-plus-contrib-20170911/org-elisp-symbol.el" "elpa/org-plus-contrib-20170911/org-elisp-symbol.elc" "elpa/org-plus-contrib-20170911/org-entities.el" "elpa/org-plus-contrib-20170911/org-entities.elc" "elpa/org-plus-contrib-20170911/org-eshell.el" "elpa/org-plus-contrib-20170911/org-eshell.elc" "elpa/org-plus-contrib-20170911/org-eval-light.el" "elpa/org-plus-contrib-20170911/org-eval-light.elc" "elpa/org-plus-contrib-20170911/org-eval.el" "elpa/org-plus-contrib-20170911/org-eval.elc" "elpa/org-plus-contrib-20170911/org-eww.el" "elpa/org-plus-contrib-20170911/org-eww.elc" "elpa/org-plus-contrib-20170911/org-expiry.el" "elpa/org-plus-contrib-20170911/org-expiry.elc" "elpa/org-plus-contrib-20170911/org-faces.el" "elpa/org-plus-contrib-20170911/org-faces.elc" "elpa/org-plus-contrib-20170911/org-feed.el" "elpa/org-plus-contrib-20170911/org-feed.elc" "elpa/org-plus-contrib-20170911/org-footnote.el" "elpa/org-plus-contrib-20170911/org-footnote.elc" "elpa/org-plus-contrib-20170911/org-git-link.el" "elpa/org-plus-contrib-20170911/org-git-link.elc" "elpa/org-plus-contrib-20170911/org-gnus.el" "elpa/org-plus-contrib-20170911/org-gnus.elc" "elpa/org-plus-contrib-20170911/org-habit.el" "elpa/org-plus-contrib-20170911/org-habit.elc" "elpa/org-plus-contrib-20170911/org-id.el" "elpa/org-plus-contrib-20170911/org-id.elc" "elpa/org-plus-contrib-20170911/org-indent.el" "elpa/org-plus-contrib-20170911/org-indent.elc" "elpa/org-plus-contrib-20170911/org-index.el" "elpa/org-plus-contrib-20170911/org-index.elc" "elpa/org-plus-contrib-20170911/org-info.el" "elpa/org-plus-contrib-20170911/org-info.elc" "elpa/org-plus-contrib-20170911/org-inlinetask.el" "elpa/org-plus-contrib-20170911/org-inlinetask.elc" "elpa/org-plus-contrib-20170911/org-install.el" "elpa/org-plus-contrib-20170911/org-interactive-query.el" "elpa/org-plus-contrib-20170911/org-interactive-query.elc" "elpa/org-plus-contrib-20170911/org-invoice.el" "elpa/org-plus-contrib-20170911/org-invoice.elc" "elpa/org-plus-contrib-20170911/org-irc.el" "elpa/org-plus-contrib-20170911/org-irc.elc" "elpa/org-plus-contrib-20170911/org-learn.el" "elpa/org-plus-contrib-20170911/org-learn.elc" "elpa/org-plus-contrib-20170911/org-license.el" "elpa/org-plus-contrib-20170911/org-license.elc" "elpa/org-plus-contrib-20170911/org-link-edit.el" "elpa/org-plus-contrib-20170911/org-link-edit.elc" "elpa/org-plus-contrib-20170911/org-lint.el" "elpa/org-plus-contrib-20170911/org-lint.elc" "elpa/org-plus-contrib-20170911/org-list.el" "elpa/org-plus-contrib-20170911/org-list.elc" "elpa/org-plus-contrib-20170911/org-loaddefs.el" "elpa/org-plus-contrib-20170911/org-mac-iCal.el" "elpa/org-plus-contrib-20170911/org-mac-iCal.elc" "elpa/org-plus-contrib-20170911/org-mac-link.el" "elpa/org-plus-contrib-20170911/org-mac-link.elc" "elpa/org-plus-contrib-20170911/org-macro.el" "elpa/org-plus-contrib-20170911/org-macro.elc" "elpa/org-plus-contrib-20170911/org-macs.el" "elpa/org-plus-contrib-20170911/org-macs.elc" "elpa/org-plus-contrib-20170911/org-mairix.el" "elpa/org-plus-contrib-20170911/org-mairix.elc" "elpa/org-plus-contrib-20170911/org-man.el" "elpa/org-plus-contrib-20170911/org-man.elc" "elpa/org-plus-contrib-20170911/org-mew.el" "elpa/org-plus-contrib-20170911/org-mew.elc" "elpa/org-plus-contrib-20170911/org-mhe.el" "elpa/org-plus-contrib-20170911/org-mhe.elc" "elpa/org-plus-contrib-20170911/org-mobile.el" "elpa/org-plus-contrib-20170911/org-mobile.elc" "elpa/org-plus-contrib-20170911/org-mouse.el" "elpa/org-plus-contrib-20170911/org-mouse.elc" "elpa/org-plus-contrib-20170911/org-notify.el" "elpa/org-plus-contrib-20170911/org-notify.elc" "elpa/org-plus-contrib-20170911/org-notmuch.el" "elpa/org-plus-contrib-20170911/org-notmuch.elc" "elpa/org-plus-contrib-20170911/org-panel.el" "elpa/org-plus-contrib-20170911/org-panel.elc" "elpa/org-plus-contrib-20170911/org-passwords.el" "elpa/org-plus-contrib-20170911/org-passwords.elc" "elpa/org-plus-contrib-20170911/org-pcomplete.el" "elpa/org-plus-contrib-20170911/org-pcomplete.elc" "elpa/org-plus-contrib-20170911/org-plot.el" "elpa/org-plus-contrib-20170911/org-plot.elc" "elpa/org-plus-contrib-20170911/org-plus-contrib-autoloads.el" "elpa/org-plus-contrib-20170911/org-plus-contrib-pkg.el" "elpa/org-plus-contrib-20170911/org-plus-contrib-pkg.elc" "elpa/org-plus-contrib-20170911/org-protocol.el" "elpa/org-plus-contrib-20170911/org-protocol.elc" "elpa/org-plus-contrib-20170911/org-registry.el" "elpa/org-plus-contrib-20170911/org-registry.elc" "elpa/org-plus-contrib-20170911/org-rmail.el" "elpa/org-plus-contrib-20170911/org-rmail.elc" "elpa/org-plus-contrib-20170911/org-screen.el" "elpa/org-plus-contrib-20170911/org-screen.elc" "elpa/org-plus-contrib-20170911/org-screenshot.el" "elpa/org-plus-contrib-20170911/org-screenshot.elc" "elpa/org-plus-contrib-20170911/org-secretary.el" "elpa/org-plus-contrib-20170911/org-secretary.elc" "elpa/org-plus-contrib-20170911/org-src.el" "elpa/org-plus-contrib-20170911/org-src.elc" "elpa/org-plus-contrib-20170911/org-static-mathjax.el" "elpa/org-plus-contrib-20170911/org-static-mathjax.elc" "elpa/org-plus-contrib-20170911/org-sudoku.el" "elpa/org-plus-contrib-20170911/org-sudoku.elc" "elpa/org-plus-contrib-20170911/org-table.el" "elpa/org-plus-contrib-20170911/org-table.elc" "elpa/org-plus-contrib-20170911/org-timer.el" "elpa/org-plus-contrib-20170911/org-timer.elc" "elpa/org-plus-contrib-20170911/org-toc.el" "elpa/org-plus-contrib-20170911/org-toc.elc" "elpa/org-plus-contrib-20170911/org-track.el" "elpa/org-plus-contrib-20170911/org-track.elc" "elpa/org-plus-contrib-20170911/org-velocity.el" "elpa/org-plus-contrib-20170911/org-velocity.elc" "elpa/org-plus-contrib-20170911/org-version.el" "elpa/org-plus-contrib-20170911/org-vm.el" "elpa/org-plus-contrib-20170911/org-vm.elc" "elpa/org-plus-contrib-20170911/org-w3m.el" "elpa/org-plus-contrib-20170911/org-w3m.elc" "elpa/org-plus-contrib-20170911/org-wikinodes.el" "elpa/org-plus-contrib-20170911/org-wikinodes.elc" "elpa/org-plus-contrib-20170911/org-wl.el" "elpa/org-plus-contrib-20170911/org-wl.elc" "elpa/org-plus-contrib-20170911/org.el" "elpa/org-plus-contrib-20170911/org.elc" "elpa/org-plus-contrib-20170911/orgcard.pdf" "elpa/org-plus-contrib-20170911/ox-ascii.el" "elpa/org-plus-contrib-20170911/ox-ascii.elc" "elpa/org-plus-contrib-20170911/ox-beamer.el" "elpa/org-plus-contrib-20170911/ox-beamer.elc" "elpa/org-plus-contrib-20170911/ox-bibtex.el" "elpa/org-plus-contrib-20170911/ox-bibtex.elc" "elpa/org-plus-contrib-20170911/ox-confluence.el" "elpa/org-plus-contrib-20170911/ox-confluence.elc" "elpa/org-plus-contrib-20170911/ox-deck.el" "elpa/org-plus-contrib-20170911/ox-deck.elc" "elpa/org-plus-contrib-20170911/ox-extra.el" "elpa/org-plus-contrib-20170911/ox-extra.elc" "elpa/org-plus-contrib-20170911/ox-freemind.el" "elpa/org-plus-contrib-20170911/ox-freemind.elc" "elpa/org-plus-contrib-20170911/ox-groff.el" "elpa/org-plus-contrib-20170911/ox-groff.elc" "elpa/org-plus-contrib-20170911/ox-html.el" "elpa/org-plus-contrib-20170911/ox-html.elc" "elpa/org-plus-contrib-20170911/ox-icalendar.el" "elpa/org-plus-contrib-20170911/ox-icalendar.elc" "elpa/org-plus-contrib-20170911/ox-koma-letter.el" "elpa/org-plus-contrib-20170911/ox-koma-letter.elc" "elpa/org-plus-contrib-20170911/ox-latex.el" "elpa/org-plus-contrib-20170911/ox-latex.elc" "elpa/org-plus-contrib-20170911/ox-man.el" "elpa/org-plus-contrib-20170911/ox-man.elc" "elpa/org-plus-contrib-20170911/ox-md.el" "elpa/org-plus-contrib-20170911/ox-md.elc" "elpa/org-plus-contrib-20170911/ox-odt.el" "elpa/org-plus-contrib-20170911/ox-odt.elc" "elpa/org-plus-contrib-20170911/ox-org.el" "elpa/org-plus-contrib-20170911/ox-org.elc" "elpa/org-plus-contrib-20170911/ox-publish.el" "elpa/org-plus-contrib-20170911/ox-publish.elc" "elpa/org-plus-contrib-20170911/ox-rss.el" "elpa/org-plus-contrib-20170911/ox-rss.elc" "elpa/org-plus-contrib-20170911/ox-s5.el" "elpa/org-plus-contrib-20170911/ox-s5.elc" "elpa/org-plus-contrib-20170911/ox-taskjuggler.el" "elpa/org-plus-contrib-20170911/ox-taskjuggler.elc" "elpa/org-plus-contrib-20170911/ox-texinfo.el" "elpa/org-plus-contrib-20170911/ox-texinfo.elc" "elpa/org-plus-contrib-20170911/ox.el" "elpa/org-plus-contrib-20170911/ox.elc" "elpa/org-wild-notifier-20180221.2025/org-wild-notifier-autoloads.el" "elpa/org-wild-notifier-20180221.2025/org-wild-notifier-pkg.el" "elpa/org-wild-notifier-20180221.2025/org-wild-notifier.el" "elpa/org-wild-notifier-20180221.2025/org-wild-notifier.elc" "elpa/ox-reveal-20161027.226/ox-reveal-autoloads.el" "elpa/ox-reveal-20161027.226/ox-reveal-pkg.el" "elpa/ox-reveal-20161027.226/ox-reveal.el" "elpa/ox-reveal-20161027.226/ox-reveal.elc" "elpa/paredit-20171126.1805/paredit-autoloads.el" "elpa/paredit-20171126.1805/paredit-pkg.el" "elpa/paredit-20171126.1805/paredit.el" "elpa/paredit-20171126.1805/paredit.elc" "elpa/paredit-menu-20160128.933/paredit-menu-autoloads.el" "elpa/paredit-menu-20160128.933/paredit-menu-pkg.el" "elpa/paredit-menu-20160128.933/paredit-menu.el" "elpa/paredit-menu-20160128.933/paredit-menu.elc" "elpa/peg-20150707.2341/peg-autoloads.el" "elpa/peg-20150707.2341/peg-pkg.el" "elpa/peg-20150707.2341/peg.el" "elpa/peg-20150707.2341/peg.elc" "elpa/pkg-info-20150517.443/pkg-info-autoloads.el" "elpa/pkg-info-20150517.443/pkg-info-pkg.el" "elpa/pkg-info-20150517.443/pkg-info.el" "elpa/pkg-info-20150517.443/pkg-info.elc" "elpa/popup-20160709.729/popup-autoloads.el" "elpa/popup-20160709.729/popup-pkg.el" "elpa/popup-20160709.729/popup.el" "elpa/popup-20160709.729/popup.elc" "elpa/pos-tip-20150318.813/pos-tip-autoloads.el" "elpa/pos-tip-20150318.813/pos-tip-pkg.el" "elpa/pos-tip-20150318.813/pos-tip.el" "elpa/pos-tip-20150318.813/pos-tip.elc" "elpa/pretty-symbols-20140814.259/pretty-symbols-autoloads.el" "elpa/pretty-symbols-20140814.259/pretty-symbols-pkg.el" "elpa/pretty-symbols-20140814.259/pretty-symbols.el" "elpa/pretty-symbols-20140814.259/pretty-symbols.elc" "elpa/python-environment-20150310.153/python-environment-autoloads.el" "elpa/python-environment-20150310.153/python-environment-pkg.el" "elpa/python-environment-20150310.153/python-environment.el" "elpa/python-environment-20150310.153/test-python-environment.el" "elpa/queue-0.2/queue-autoloads.el" "elpa/queue-0.2/queue-pkg.el" "elpa/queue-0.2/queue.el" "elpa/queue-0.2/queue.elc" "elpa/queue-0.2.signed" "elpa/rainbow-delimiters-20160430.2358/rainbow-delimiters-autoloads.el" "elpa/rainbow-delimiters-20160430.2358/rainbow-delimiters-pkg.el" "elpa/rainbow-delimiters-20160430.2358/rainbow-delimiters.el" "elpa/rainbow-delimiters-20160430.2358/rainbow-delimiters.elc" "elpa/rainbow-delimiters-20170929.432/rainbow-delimiters-autoloads.el" "elpa/rainbow-delimiters-20170929.432/rainbow-delimiters-pkg.el" "elpa/rainbow-delimiters-20170929.432/rainbow-delimiters.el" "elpa/rainbow-delimiters-20170929.432/rainbow-delimiters.elc" "elpa/request-20170131.1747/request-autoloads.el" "elpa/request-20170131.1747/request-pkg.el" "elpa/request-20170131.1747/request.el" "elpa/request-20170131.1747/request.elc" "elpa/request-deferred-20160419.1605/request-deferred-autoloads.el" "elpa/request-deferred-20160419.1605/request-deferred-pkg.el" "elpa/request-deferred-20160419.1605/request-deferred.el" "elpa/restclient-20180316.851/restclient-autoloads.el" "elpa/restclient-20180316.851/restclient-pkg.el" "elpa/restclient-20180316.851/restclient.el" "elpa/restclient-20180316.851/restclient.elc" "elpa/ruby-end-20141215.423/ruby-end-autoloads.el" "elpa/ruby-end-20141215.423/ruby-end-pkg.el" "elpa/ruby-end-20141215.423/ruby-end.el" "elpa/ruby-end-20141215.423/ruby-end.elc" "elpa/ruby-tools-20151209.815/ruby-tools-autoloads.el" "elpa/ruby-tools-20151209.815/ruby-tools-pkg.el" "elpa/ruby-tools-20151209.815/ruby-tools.el" "elpa/ruby-tools-20151209.815/ruby-tools.elc" "elpa/s-20180406.108/s-autoloads.el" "elpa/s-20180406.108/s-pkg.el" "elpa/s-20180406.108/s.el" "elpa/s-20180406.108/s.elc" "elpa/scheme-complete-20170824.713/scheme-complete-autoloads.el" "elpa/scheme-complete-20170824.713/scheme-complete-pkg.el" "elpa/scheme-complete-20170824.713/scheme-complete.el" "elpa/scheme-complete-20170824.713/scheme-complete.elc" "elpa/seq-2.20/ChangeLog" "elpa/seq-2.20/seq-24.el" "elpa/seq-2.20/seq-24.elc" "elpa/seq-2.20/seq-25.el" "elpa/seq-2.20/seq-25.elc" "elpa/seq-2.20/seq-autoloads.el" "elpa/seq-2.20/seq-pkg.el" "elpa/seq-2.20/seq-pkg.elc" "elpa/seq-2.20/seq.el" "elpa/seq-2.20/seq.elc" "elpa/seq-2.20/tests/seq-tests.el" "elpa/seq-2.20/tests/seq-tests.elc" "elpa/seq-2.20.signed" "elpa/session-20120510.1700/session-autoloads.el" "elpa/session-20120510.1700/session-pkg.el" "elpa/session-20120510.1700/session.el" "elpa/session-20120510.1700/session.elc" "elpa/simplezen-20130421.300/simplezen-autoloads.el" "elpa/simplezen-20130421.300/simplezen-pkg.el" "elpa/simplezen-20130421.300/simplezen.el" "elpa/simplezen-20130421.300/simplezen.elc" "elpa/smex-20151212.1409/smex-autoloads.el" "elpa/smex-20151212.1409/smex-pkg.el" "elpa/smex-20151212.1409/smex.el" "elpa/smex-20151212.1409/smex.elc" "elpa/sotclojure-20170921.1708/sotclojure-autoloads.el" "elpa/sotclojure-20170921.1708/sotclojure-on.el" "elpa/sotclojure-20170921.1708/sotclojure-on.elc" "elpa/sotclojure-20170921.1708/sotclojure-pkg.el" "elpa/sotclojure-20170921.1708/sotclojure.el" "elpa/sotclojure-20170921.1708/sotclojure.elc" "elpa/sotlisp-20170429.1945/sotlisp-autoloads.el" "elpa/sotlisp-20170429.1945/sotlisp-pkg.el" "elpa/sotlisp-20170429.1945/sotlisp.el" "elpa/sotlisp-20170429.1945/sotlisp.elc" "elpa/spinner-1.7.3/spinner-autoloads.el" "elpa/spinner-1.7.3/spinner-pkg.el" "elpa/spinner-1.7.3/spinner.el" "elpa/spinner-1.7.3/spinner.elc" "elpa/spinner-1.7.3.signed" "elpa/string-edit-20160410.2356/string-edit-autoloads.el" "elpa/string-edit-20160410.2356/string-edit-pkg.el" "elpa/string-edit-20160410.2356/string-edit.el" "elpa/string-edit-20160410.2356/string-edit.elc" "elpa/tagedit-20161121.55/tagedit-autoloads.el" "elpa/tagedit-20161121.55/tagedit-pkg.el" "elpa/tagedit-20161121.55/tagedit.el" "elpa/tagedit-20161121.55/tagedit.elc" "elpa/undo-tree-20170706.246/undo-tree-autoloads.el" "elpa/undo-tree-20170706.246/undo-tree-pkg.el" "elpa/undo-tree-20170706.246/undo-tree.el" "elpa/undo-tree-20170706.246/undo-tree.elc" "elpa/window-numbering-20160809.1110/window-numbering-autoloads.el" "elpa/window-numbering-20160809.1110/window-numbering-pkg.el" "elpa/window-numbering-20160809.1110/window-numbering.el" "elpa/window-numbering-20160809.1110/window-numbering.elc" "elpa/xpm-1.0.4/.elpaignore" "elpa/xpm-1.0.4/ChangeLog" "elpa/xpm-1.0.4/NEWS" "elpa/xpm-1.0.4/THANKS" "elpa/xpm-1.0.4/xpm-autoloads.el" "elpa/xpm-1.0.4/xpm-m2z.el" "elpa/xpm-1.0.4/xpm-m2z.elc" "elpa/xpm-1.0.4/xpm-pkg.el" "elpa/xpm-1.0.4/xpm-pkg.elc" "elpa/xpm-1.0.4/xpm.el" "elpa/xpm-1.0.4/xpm.elc" "elpa/xpm-1.0.4.signed" "elpa/zencoding-mode-20140213.22/zencoding-mode-autoloads.el" "elpa/zencoding-mode-20140213.22/zencoding-mode-pkg.el" "elpa/zencoding-mode-20140213.22/zencoding-mode.el" "elpa/zencoding-mode-20140213.22/zencoding-mode.elc" "emms/cache" "emms/history" "emms/scores" "eshell/history" "ido.last" "init.el" "projectile-bookmarks.eld" "snippets/c++-mode/.yas-parents" "snippets/c++-mode/.yas-setup.el" "snippets/c++-mode/acl" "snippets/c++-mode/acm" "snippets/c++-mode/ajf" "snippets/c++-mode/alo" "snippets/c++-mode/ano" "snippets/c++-mode/assert" "snippets/c++-mode/beginend" "snippets/c++-mode/boost_require" "snippets/c++-mode/cerr" "snippets/c++-mode/cin" "snippets/c++-mode/class" "snippets/c++-mode/class11" "snippets/c++-mode/cni" "snippets/c++-mode/cnt" "snippets/c++-mode/const_[]" "snippets/c++-mode/constructor" "snippets/c++-mode/cout" "snippets/c++-mode/cpb" "snippets/c++-mode/cpi" "snippets/c++-mode/cpn" "snippets/c++-mode/cpp" "snippets/c++-mode/cpy" "snippets/c++-mode/cstd" "snippets/c++-mode/d+=" "snippets/c++-mode/d_operator" "snippets/c++-mode/d_operator[]" "snippets/c++-mode/d_operator[]_const" "snippets/c++-mode/d_operator_istream" "snippets/c++-mode/d_operator_ostream" "snippets/c++-mode/delete" "snippets/c++-mode/delete[]" "snippets/c++-mode/doc" "snippets/c++-mode/dynamic_casting" "snippets/c++-mode/enum" "snippets/c++-mode/eql" "snippets/c++-mode/erm" "snippets/c++-mode/ffo" "snippets/c++-mode/fil" "snippets/c++-mode/fin" "snippets/c++-mode/fixture" "snippets/c++-mode/fln" "snippets/c++-mode/fnd" "snippets/c++-mode/fne" "snippets/c++-mode/fni" "snippets/c++-mode/fori" "snippets/c++-mode/fre" "snippets/c++-mode/friend" "snippets/c++-mode/fun_declaration" "snippets/c++-mode/gnn" "snippets/c++-mode/gnr" "snippets/c++-mode/gtest" "snippets/c++-mode/ignore" "snippets/c++-mode/ihp" "snippets/c++-mode/ihu" "snippets/c++-mode/inline" "snippets/c++-mode/io" "snippets/c++-mode/ipr" "snippets/c++-mode/ipt" "snippets/c++-mode/iss" "snippets/c++-mode/isu" "snippets/c++-mode/ita" "snippets/c++-mode/iterator" "snippets/c++-mode/ltr" "snippets/c++-mode/lwr" "snippets/c++-mode/lxc" "snippets/c++-mode/map" "snippets/c++-mode/member_function" "snippets/c++-mode/mkh" "snippets/c++-mode/mme" "snippets/c++-mode/mne" "snippets/c++-mode/module" "snippets/c++-mode/mpb" "snippets/c++-mode/mrg" "snippets/c++-mode/msm" "snippets/c++-mode/mxe" "snippets/c++-mode/namespace" "snippets/c++-mode/nno" "snippets/c++-mode/ns" "snippets/c++-mode/nth" "snippets/c++-mode/nxp" "snippets/c++-mode/oit" "snippets/c++-mode/operator!=" "snippets/c++-mode/operator+" "snippets/c++-mode/operator+=" "snippets/c++-mode/operator=" "snippets/c++-mode/operator==" "snippets/c++-mode/operator[]" "snippets/c++-mode/operator_istream" "snippets/c++-mode/operator_ostream" "snippets/c++-mode/ostream" "snippets/c++-mode/pack" "snippets/c++-mode/phh" "snippets/c++-mode/ppt" "snippets/c++-mode/private" "snippets/c++-mode/protected" "snippets/c++-mode/prp" "snippets/c++-mode/psc" "snippets/c++-mode/pst" "snippets/c++-mode/ptc" "snippets/c++-mode/ptn" "snippets/c++-mode/public" "snippets/c++-mode/rci" "snippets/c++-mode/rmc" "snippets/c++-mode/rmf" "snippets/c++-mode/rmi" "snippets/c++-mode/rmv" "snippets/c++-mode/rpc" "snippets/c++-mode/rpi" "snippets/c++-mode/rpl" "snippets/c++-mode/rtc" "snippets/c++-mode/rte" "snippets/c++-mode/rvc" "snippets/c++-mode/rvr" "snippets/c++-mode/shf" "snippets/c++-mode/spt" "snippets/c++-mode/srh" "snippets/c++-mode/srn" "snippets/c++-mode/srt" "snippets/c++-mode/sstream" "snippets/c++-mode/std" "snippets/c++-mode/std_colon" "snippets/c++-mode/sth" "snippets/c++-mode/sti" "snippets/c++-mode/sto" "snippets/c++-mode/str" "snippets/c++-mode/sts" "snippets/c++-mode/stv" "snippets/c++-mode/swr" "snippets/c++-mode/template" "snippets/c++-mode/test case" "snippets/c++-mode/test_main" "snippets/c++-mode/test_suite" "snippets/c++-mode/tfm" "snippets/c++-mode/this" "snippets/c++-mode/throw" "snippets/c++-mode/trm" "snippets/c++-mode/try" "snippets/c++-mode/tryw" "snippets/c++-mode/ucp" "snippets/c++-mode/upr" "snippets/c++-mode/uqe" "snippets/c++-mode/using" "snippets/c++-mode/vector" "snippets/c-mode/.yas-parents" "snippets/c-mode/assert" "snippets/c-mode/compile" "snippets/c-mode/define" "snippets/c-mode/fopen" "snippets/c-mode/malloc" "snippets/c-mode/packed" "snippets/c-mode/printf" "snippets/c-mode/stdio" "snippets/c-mode/stdlib" "snippets/c-mode/string" "snippets/c-mode/switch" "snippets/c-mode/union" "snippets/c-mode/unistd" "snippets/chef-mode/action" "snippets/chef-mode/bash" "snippets/chef-mode/cookbook_file" "snippets/chef-mode/cron" "snippets/chef-mode/cronf" "snippets/chef-mode/deploy" "snippets/chef-mode/directory" "snippets/chef-mode/directoryf" "snippets/chef-mode/env" "snippets/chef-mode/execute" "snippets/chef-mode/executef" "snippets/chef-mode/file" "snippets/chef-mode/filef" "snippets/chef-mode/git" "snippets/chef-mode/group" "snippets/chef-mode/http_request" "snippets/chef-mode/http_requestp" "snippets/chef-mode/ignore_failure" "snippets/chef-mode/inc" "snippets/chef-mode/link" "snippets/chef-mode/linkf" "snippets/chef-mode/log" "snippets/chef-mode/machine" "snippets/chef-mode/meta" "snippets/chef-mode/not_if" "snippets/chef-mode/notifies" "snippets/chef-mode/only_if" "snippets/chef-mode/pac" "snippets/chef-mode/pak" "snippets/chef-mode/provider" "snippets/chef-mode/python" "snippets/chef-mode/remote_file" "snippets/chef-mode/retries" "snippets/chef-mode/role" "snippets/chef-mode/ruby" "snippets/chef-mode/script" "snippets/chef-mode/service" "snippets/chef-mode/servicep" "snippets/chef-mode/subscribes" "snippets/chef-mode/supports" "snippets/chef-mode/template" "snippets/chef-mode/templatev" "snippets/chef-mode/user" "snippets/cider-repl-mode/.yas-parents" "snippets/clojure-mode/bench" "snippets/clojure-mode/c" "snippets/clojure-mode/cljsbuild" "snippets/clojure-mode/com" "snippets/clojure-mode/cond" "snippets/clojure-mode/condp" "snippets/clojure-mode/def" "snippets/clojure-mode/defm" "snippets/clojure-mode/defmm" "snippets/clojure-mode/defn" "snippets/clojure-mode/defp" "snippets/clojure-mode/defproject" "snippets/clojure-mode/defr" "snippets/clojure-mode/deft" "snippets/clojure-mode/dev" "snippets/clojure-mode/div" "snippets/clojure-mode/div-class" "snippets/clojure-mode/doseq" "snippets/clojure-mode/f" "snippets/clojure-mode/fdef" "snippets/clojure-mode/fn" "snippets/clojure-mode/for" "snippets/clojure-mode/if" "snippets/clojure-mode/ifl" "snippets/clojure-mode/import" "snippets/clojure-mode/is" "snippets/clojure-mode/kwargs" "snippets/clojure-mode/let" "snippets/clojure-mode/letfn" "snippets/clojure-mode/m" "snippets/clojure-mode/main" "snippets/clojure-mode/map" "snippets/clojure-mode/map.lambda" "snippets/clojure-mode/mdoc" "snippets/clojure-mode/namespace" "snippets/clojure-mode/ns" "snippets/clojure-mode/opts" "snippets/clojure-mode/perf" "snippets/clojure-mode/pm" "snippets/clojure-mode/pr" "snippets/clojure-mode/print" "snippets/clojure-mode/reduce" "snippets/clojure-mode/refer" "snippets/clojure-mode/require" "snippets/clojure-mode/rn" "snippets/clojure-mode/test" "snippets/clojure-mode/testcase" "snippets/clojure-mode/testing" "snippets/clojure-mode/thread-first" "snippets/clojure-mode/thread-last" "snippets/clojure-mode/try" "snippets/clojure-mode/use" "snippets/clojure-mode/when" "snippets/clojure-mode/whenl" "snippets/crappy-jsp-mode/elvariable" "snippets/css-mode/bg" "snippets/css-mode/bg.1" "snippets/css-mode/bor" "snippets/css-mode/cl" "snippets/css-mode/disp.block" "snippets/css-mode/disp.inline" "snippets/css-mode/disp.none" "snippets/css-mode/ff" "snippets/css-mode/fs" "snippets/css-mode/mar.bottom" "snippets/css-mode/mar.left" "snippets/css-mode/mar.mar" "snippets/css-mode/mar.margin" "snippets/css-mode/mar.right" "snippets/css-mode/mar.top" "snippets/css-mode/pad.bottom" "snippets/css-mode/pad.left" "snippets/css-mode/pad.pad" "snippets/css-mode/pad.padding" "snippets/css-mode/pad.right" "snippets/css-mode/pad.top" "snippets/css-mode/v" "snippets/emacs-lisp-mode/.read_me" "snippets/emacs-lisp-mode/add-hook" "snippets/emacs-lisp-mode/and" "snippets/emacs-lisp-mode/append" "snippets/emacs-lisp-mode/apply" "snippets/emacs-lisp-mode/aref" "snippets/emacs-lisp-mode/aset" "snippets/emacs-lisp-mode/assq" "snippets/emacs-lisp-mode/autoload" "snippets/emacs-lisp-mode/backward-char" "snippets/emacs-lisp-mode/beginning-of-line" "snippets/emacs-lisp-mode/bounds-of-thing-at-point" "snippets/emacs-lisp-mode/buffer-file-name" "snippets/emacs-lisp-mode/buffer-modified-p" "snippets/emacs-lisp-mode/buffer-substring" "snippets/emacs-lisp-mode/buffer-substring-no-properties" "snippets/emacs-lisp-mode/car" "snippets/emacs-lisp-mode/cdr" "snippets/emacs-lisp-mode/concat" "snippets/emacs-lisp-mode/cond" "snippets/emacs-lisp-mode/condition-case" "snippets/emacs-lisp-mode/cons" "snippets/emacs-lisp-mode/consp" "snippets/emacs-lisp-mode/const" "snippets/emacs-lisp-mode/copy-directory" "snippets/emacs-lisp-mode/copy-file" "snippets/emacs-lisp-mode/current-buffer" "snippets/emacs-lisp-mode/custom-autoload" "snippets/emacs-lisp-mode/defalias" "snippets/emacs-lisp-mode/defcustom" "snippets/emacs-lisp-mode/define-key" "snippets/emacs-lisp-mode/defsubst" "snippets/emacs-lisp-mode/defun" "snippets/emacs-lisp-mode/defvar" "snippets/emacs-lisp-mode/delete-char" "snippets/emacs-lisp-mode/delete-directory" "snippets/emacs-lisp-mode/delete-file" "snippets/emacs-lisp-mode/delete-region" "snippets/emacs-lisp-mode/directory-files" "snippets/emacs-lisp-mode/dired.process_marked" "snippets/emacs-lisp-mode/dolist" "snippets/emacs-lisp-mode/end-of-line" "snippets/emacs-lisp-mode/ends" "snippets/emacs-lisp-mode/eq" "snippets/emacs-lisp-mode/equal" "snippets/emacs-lisp-mode/error" "snippets/emacs-lisp-mode/ert-deftest" "snippets/emacs-lisp-mode/expand-file-name" "snippets/emacs-lisp-mode/fboundp" "snippets/emacs-lisp-mode/file-name-directory" "snippets/emacs-lisp-mode/file-name-extension" "snippets/emacs-lisp-mode/file-name-nondirectory" "snippets/emacs-lisp-mode/file-name-sans-extension" "snippets/emacs-lisp-mode/file-relative-name" "snippets/emacs-lisp-mode/file.process" "snippets/emacs-lisp-mode/file.read-lines" "snippets/emacs-lisp-mode/find-file" "snippets/emacs-lisp-mode/find-replace" "snippets/emacs-lisp-mode/format" "snippets/emacs-lisp-mode/forward-char" "snippets/emacs-lisp-mode/forward-line" "snippets/emacs-lisp-mode/funcall" "snippets/emacs-lisp-mode/function" "snippets/emacs-lisp-mode/get" "snippets/emacs-lisp-mode/global-set-key" "snippets/emacs-lisp-mode/goto-char" "snippets/emacs-lisp-mode/grabstring" "snippets/emacs-lisp-mode/grabthing" "snippets/emacs-lisp-mode/hash" "snippets/emacs-lisp-mode/if" "snippets/emacs-lisp-mode/insert" "snippets/emacs-lisp-mode/insert-file-contents" "snippets/emacs-lisp-mode/interactive" "snippets/emacs-lisp-mode/kbd" "snippets/emacs-lisp-mode/kill-buffer" "snippets/emacs-lisp-mode/lambda" "snippets/emacs-lisp-mode/length" "snippets/emacs-lisp-mode/let" "snippets/emacs-lisp-mode/line-beginning-position" "snippets/emacs-lisp-mode/line-end-position" "snippets/emacs-lisp-mode/list" "snippets/emacs-lisp-mode/looking-at" "snippets/emacs-lisp-mode/make-directory" "snippets/emacs-lisp-mode/make-local-variable" "snippets/emacs-lisp-mode/mapc" "snippets/emacs-lisp-mode/mapcar" "snippets/emacs-lisp-mode/match-beginning" "snippets/emacs-lisp-mode/match-end" "snippets/emacs-lisp-mode/match-string" "snippets/emacs-lisp-mode/memq" "snippets/emacs-lisp-mode/message" "snippets/emacs-lisp-mode/minor_mode" "snippets/emacs-lisp-mode/not" "snippets/emacs-lisp-mode/nth" "snippets/emacs-lisp-mode/null" "snippets/emacs-lisp-mode/number-to-string" "snippets/emacs-lisp-mode/or" "snippets/emacs-lisp-mode/point" "snippets/emacs-lisp-mode/point-max" "snippets/emacs-lisp-mode/point-min" "snippets/emacs-lisp-mode/princ" "snippets/emacs-lisp-mode/print" "snippets/emacs-lisp-mode/progn" "snippets/emacs-lisp-mode/provide.yasnippet" "snippets/emacs-lisp-mode/push" "snippets/emacs-lisp-mode/put" "snippets/emacs-lisp-mode/re-search-backward" "snippets/emacs-lisp-mode/re-search-forward" "snippets/emacs-lisp-mode/region-active-p" "snippets/emacs-lisp-mode/region-beginning" "snippets/emacs-lisp-mode/region-end" "snippets/emacs-lisp-mode/rename-file" "snippets/emacs-lisp-mode/repeat" "snippets/emacs-lisp-mode/replace-regexp" "snippets/emacs-lisp-mode/replace-regexp-in-string" "snippets/emacs-lisp-mode/req" "snippets/emacs-lisp-mode/require" "snippets/emacs-lisp-mode/save-buffer" "snippets/emacs-lisp-mode/save-excursion" "snippets/emacs-lisp-mode/search-backward" "snippets/emacs-lisp-mode/search-backward-regexp" "snippets/emacs-lisp-mode/search-forward" "snippets/emacs-lisp-mode/search-forward-regexp" "snippets/emacs-lisp-mode/set" "snippets/emacs-lisp-mode/set-buffer" "snippets/emacs-lisp-mode/set-file-modes" "snippets/emacs-lisp-mode/set-mark" "snippets/emacs-lisp-mode/setq" "snippets/emacs-lisp-mode/should" "snippets/emacs-lisp-mode/skip-chars-backward" "snippets/emacs-lisp-mode/skip-chars-forward" "snippets/emacs-lisp-mode/split-string" "snippets/emacs-lisp-mode/string" "snippets/emacs-lisp-mode/string-match" "snippets/emacs-lisp-mode/string-to-number" "snippets/emacs-lisp-mode/string=" "snippets/emacs-lisp-mode/stringp" "snippets/emacs-lisp-mode/substring" "snippets/emacs-lisp-mode/thing-at-point" "snippets/emacs-lisp-mode/traverse_dir" "snippets/emacs-lisp-mode/unless" "snippets/emacs-lisp-mode/use-package" "snippets/emacs-lisp-mode/use-package-binding" "snippets/emacs-lisp-mode/vector" "snippets/emacs-lisp-mode/when" "snippets/emacs-lisp-mode/while" "snippets/emacs-lisp-mode/widget-get" "snippets/emacs-lisp-mode/with-current-buffer" "snippets/emacs-lisp-mode/word-or-region" "snippets/emacs-lisp-mode/word_regexp" "snippets/emacs-lisp-mode/x-dired.process_marked" "snippets/emacs-lisp-mode/x-file.process" "snippets/emacs-lisp-mode/x-file.read-lines" "snippets/emacs-lisp-mode/x-find-replace" "snippets/emacs-lisp-mode/x-grabstring" "snippets/emacs-lisp-mode/x-grabthing" "snippets/emacs-lisp-mode/x-traverse_dir" "snippets/emacs-lisp-mode/x-word-or-region" "snippets/emacs-lisp-mode/yes-or-no-p" "snippets/erlang-mode/after" "snippets/erlang-mode/begin" "snippets/erlang-mode/beh" "snippets/erlang-mode/case" "snippets/erlang-mode/compile" "snippets/erlang-mode/def" "snippets/erlang-mode/exp" "snippets/erlang-mode/fun" "snippets/erlang-mode/if" "snippets/erlang-mode/ifdef" "snippets/erlang-mode/ifndef" "snippets/erlang-mode/imp" "snippets/erlang-mode/inc" "snippets/erlang-mode/inc.lib" "snippets/erlang-mode/loop" "snippets/erlang-mode/mod" "snippets/erlang-mode/rcv" "snippets/erlang-mode/rcv.after" "snippets/erlang-mode/rec" "snippets/erlang-mode/try" "snippets/erlang-mode/undef" "snippets/f90-mode/bd" "snippets/f90-mode/c" "snippets/f90-mode/ch" "snippets/f90-mode/cx" "snippets/f90-mode/dc" "snippets/f90-mode/do" "snippets/f90-mode/dp" "snippets/f90-mode/forall" "snippets/f90-mode/function" "snippets/f90-mode/if" "snippets/f90-mode/in" "snippets/f90-mode/inc" "snippets/f90-mode/intr" "snippets/f90-mode/l" "snippets/f90-mode/module" "snippets/f90-mode/pa" "snippets/f90-mode/program" "snippets/f90-mode/puref" "snippets/f90-mode/pures" "snippets/f90-mode/re" "snippets/f90-mode/subroutine" "snippets/f90-mode/until" "snippets/f90-mode/where" "snippets/f90-mode/while" "snippets/f90-mode/wr" "snippets/feature-mode/feature" "snippets/feature-mode/scenario" "snippets/git-commit-mode/.yas-parents" "snippets/git-commit-mode/fixes" "snippets/git-commit-mode/references" "snippets/html-mode/.yas-parents" "snippets/html-mode/c-forEach" "snippets/html-mode/c-if" "snippets/html-mode/code" "snippets/html-mode/dd" "snippets/html-mode/div" "snippets/html-mode/dl" "snippets/html-mode/doctype" "snippets/html-mode/doctype.html5" "snippets/html-mode/doctype.xhtml1" "snippets/html-mode/doctype.xhtml1_1" "snippets/html-mode/doctype.xhtml1_strict" "snippets/html-mode/doctype.xhtml1_transitional" "snippets/html-mode/dt" "snippets/html-mode/em" "snippets/html-mode/form" "snippets/html-mode/html" "snippets/html-mode/html.xmlns" "snippets/html-mode/include" "snippets/html-mode/input" "snippets/html-mode/kbd" "snippets/html-mode/link" "snippets/html-mode/link.import" "snippets/html-mode/link.stylesheet" "snippets/html-mode/link.stylesheet-ie" "snippets/html-mode/mailto" "snippets/html-mode/media" "snippets/html-mode/meta" "snippets/html-mode/meta.http-equiv" "snippets/html-mode/oocss-module" "snippets/html-mode/p" "snippets/html-mode/sandbox" "snippets/html-mode/script" "snippets/html-mode/script.javascript" "snippets/html-mode/script.javascript-src" "snippets/html-mode/strong" "snippets/html-mode/textarea" "snippets/html-mode/th" "snippets/java-mode/@param" "snippets/java-mode/@return" "snippets/java-mode/apr_assert" "snippets/java-mode/class" "snippets/java-mode/constructor" "snippets/java-mode/doc" "snippets/java-mode/equals" "snippets/java-mode/file_class" "snippets/java-mode/for" "snippets/java-mode/foreach" "snippets/java-mode/if" "snippets/java-mode/ife" "snippets/java-mode/import" "snippets/java-mode/interface" "snippets/java-mode/iterator" "snippets/java-mode/javadoc" "snippets/java-mode/main" "snippets/java-mode/method" "snippets/java-mode/method@" "snippets/java-mode/new" "snippets/java-mode/paintComponent" "snippets/java-mode/printf" "snippets/java-mode/println" "snippets/java-mode/private" "snippets/java-mode/protected" "snippets/java-mode/public" "snippets/java-mode/return" "snippets/java-mode/test" "snippets/java-mode/testClass" "snippets/java-mode/this" "snippets/java-mode/toString" "snippets/java-mode/try" "snippets/java-mode/var" "snippets/java-mode/var=" "snippets/java-mode/void" "snippets/java-mode/while" "snippets/js-mode/declare-global.yasnippet" "snippets/js-mode/directive-oiiku-shared" "snippets/js-mode/finn-element-builder" "snippets/js-mode/for" "snippets/js-mode/for-in" "snippets/js-mode/function.yasnippet" "snippets/js-mode/immediately-invoked-function-expression.yasnippet" "snippets/js-mode/jstd-doc" "snippets/js-mode/jstd.additionalTestCase.yasnippet" "snippets/js-mode/jstd.log.yasnippet" "snippets/js-mode/jstd.testCase.yasnippet" "snippets/js-mode/node.ifnode.yasnippet" "snippets/js-mode/node.module.exports.yasnippet" "snippets/js-mode/node.require.yasnippet" "snippets/js-mode/object.create" "snippets/js-mode/object.create-property" "snippets/js-mode/object.create-property+" "snippets/js-mode/this.yasnippet" "snippets/js-mode/try" "snippets/js2-mode/.yas-parents" "snippets/js2-mode/al" "snippets/js2-mode/class" "snippets/js2-mode/com" "snippets/js2-mode/debugger" "snippets/js2-mode/each" "snippets/js2-mode/el" "snippets/js2-mode/ev.add" "snippets/js2-mode/ev.fire" "snippets/js2-mode/for" "snippets/js2-mode/function" "snippets/js2-mode/if" "snippets/js2-mode/init" "snippets/js2-mode/log" "snippets/js2-mode/multiline-comment" "snippets/js2-mode/param-comment" "snippets/js2-mode/req.html" "snippets/js2-mode/req.json" "snippets/js2-mode/return-comment" "snippets/js2-mode/type-inline-comment" "snippets/js2-mode/type-multiline-comment" "snippets/latex-mode/absolute" "snippets/latex-mode/acronym" "snippets/latex-mode/addcolumn" "snippets/latex-mode/alertblock" "snippets/latex-mode/alg" "snippets/latex-mode/algorithm" "snippets/latex-mode/alignedequation" "snippets/latex-mode/alpha" "snippets/latex-mode/alternatingunittensor" "snippets/latex-mode/ampersand" "snippets/latex-mode/andforcolumns" "snippets/latex-mode/approximate" "snippets/latex-mode/baroraverage" "snippets/latex-mode/begin" "snippets/latex-mode/belongsto" "snippets/latex-mode/beta" "snippets/latex-mode/bibliography" "snippets/latex-mode/block" "snippets/latex-mode/bm" "snippets/latex-mode/boldsymbol" "snippets/latex-mode/booktabs" "snippets/latex-mode/bottomrule" "snippets/latex-mode/capgls" "snippets/latex-mode/caption" "snippets/latex-mode/chapter" "snippets/latex-mode/chi" "snippets/latex-mode/choosefrom" "snippets/latex-mode/circ" "snippets/latex-mode/circlecross" "snippets/latex-mode/cite" "snippets/latex-mode/code" "snippets/latex-mode/columns" "snippets/latex-mode/cosine" "snippets/latex-mode/cosineinverse" "snippets/latex-mode/cosinepower" "snippets/latex-mode/costfunction" "snippets/latex-mode/curl" "snippets/latex-mode/cyclicintegral" "snippets/latex-mode/dash" "snippets/latex-mode/definedas" "snippets/latex-mode/delta" "snippets/latex-mode/deltaupper" "snippets/latex-mode/description" "snippets/latex-mode/differential" "snippets/latex-mode/differentialdot" "snippets/latex-mode/differentialfraction" "snippets/latex-mode/differentialpower" "snippets/latex-mode/differentialpowerfraction" "snippets/latex-mode/differentialupper" "snippets/latex-mode/differentialupperfraction" "snippets/latex-mode/differentialupperpower" "snippets/latex-mode/differentialupperpowerfraction" "snippets/latex-mode/divergence" "snippets/latex-mode/dots" "snippets/latex-mode/doubleintegral" "snippets/latex-mode/emph" "snippets/latex-mode/emphasisbox" "snippets/latex-mode/emphasize" "snippets/latex-mode/environment" "snippets/latex-mode/epsilon" "snippets/latex-mode/epsilonupper" "snippets/latex-mode/equation" "snippets/latex-mode/equivalentorsameas" "snippets/latex-mode/eta" "snippets/latex-mode/evaluatedat" "snippets/latex-mode/exampleblock" "snippets/latex-mode/exponential" "snippets/latex-mode/figure" "snippets/latex-mode/forall" "snippets/latex-mode/frac" "snippets/latex-mode/fraction" "snippets/latex-mode/frame" "snippets/latex-mode/framebox" "snippets/latex-mode/gamma" "snippets/latex-mode/gammaupper" "snippets/latex-mode/gls" "snippets/latex-mode/glspl" "snippets/latex-mode/gradient" "snippets/latex-mode/graphicspath" "snippets/latex-mode/greaterthanequalto" "snippets/latex-mode/hat" "snippets/latex-mode/hline" "snippets/latex-mode/hspace" "snippets/latex-mode/hyperboliccosine" "snippets/latex-mode/hyperboliccosineinverse" "snippets/latex-mode/hyperboliccosinepower" "snippets/latex-mode/hyperbolicsine" "snippets/latex-mode/hyperbolicsineinverse" "snippets/latex-mode/hyperbolicsinepower" "snippets/latex-mode/hyperbolictangent" "snippets/latex-mode/hyperbolictangentinverse" "snippets/latex-mode/hyperbolictangentpower" "snippets/latex-mode/hyperlink" "snippets/latex-mode/if" "snippets/latex-mode/ifandonlyif" "snippets/latex-mode/implies" "snippets/latex-mode/includegraphics" "snippets/latex-mode/infinity" "snippets/latex-mode/infinitysubscript" "snippets/latex-mode/inlinemath" "snippets/latex-mode/inputfile" "snippets/latex-mode/intersection" "snippets/latex-mode/interspacing" "snippets/latex-mode/iota" "snippets/latex-mode/item" "snippets/latex-mode/itemize" "snippets/latex-mode/iterintersection" "snippets/latex-mode/iterunion" "snippets/latex-mode/kappa" "snippets/latex-mode/kroeneckerdelta" "snippets/latex-mode/label" "snippets/latex-mode/lambda" "snippets/latex-mode/laplacian" "snippets/latex-mode/leftarrow" "snippets/latex-mode/lessthanorequalto" "snippets/latex-mode/limit" "snippets/latex-mode/linebreak" "snippets/latex-mode/listing" "snippets/latex-mode/listinputlisting" "snippets/latex-mode/listoffigures" "snippets/latex-mode/listoftables" "snippets/latex-mode/lstlanguage" "snippets/latex-mode/mathbotsyms" "snippets/latex-mode/mathcaligraphic" "snippets/latex-mode/matheulerscript" "snippets/latex-mode/mathfonts" "snippets/latex-mode/mathtopsyms" "snippets/latex-mode/matrix" "snippets/latex-mode/maximum" "snippets/latex-mode/midrule" "snippets/latex-mode/minimum" "snippets/latex-mode/movie" "snippets/latex-mode/mu" "snippets/latex-mode/multipartfunction" "snippets/latex-mode/mychapter" "snippets/latex-mode/nabla" "snippets/latex-mode/naturallog" "snippets/latex-mode/newcommand" "snippets/latex-mode/newdescription" "snippets/latex-mode/newglossaryentry" "snippets/latex-mode/newitem" "snippets/latex-mode/newlinbreak" "snippets/latex-mode/newline" "snippets/latex-mode/newlinemath" "snippets/latex-mode/newpage" "snippets/latex-mode/newtablecolumn" "snippets/latex-mode/noindent" "snippets/latex-mode/norm" "snippets/latex-mode/note" "snippets/latex-mode/notequal" "snippets/latex-mode/nu" "snippets/latex-mode/odot" "snippets/latex-mode/omega" "snippets/latex-mode/omegaupper" "snippets/latex-mode/partial" "snippets/latex-mode/partialfraction" "snippets/latex-mode/partialpower" "snippets/latex-mode/partialpowerfraction" "snippets/latex-mode/phi" "snippets/latex-mode/phiupper" "snippets/latex-mode/pi" "snippets/latex-mode/piecewisefunction" "snippets/latex-mode/piupper" "snippets/latex-mode/plusorminus" "snippets/latex-mode/preamble" "snippets/latex-mode/prime" "snippets/latex-mode/primepower" "snippets/latex-mode/probability" "snippets/latex-mode/product" "snippets/latex-mode/proportional" "snippets/latex-mode/psi" "snippets/latex-mode/psiupper" "snippets/latex-mode/python" "snippets/latex-mode/question" "snippets/latex-mode/reference" "snippets/latex-mode/renewcommand" "snippets/latex-mode/rho" "snippets/latex-mode/rightarrow" "snippets/latex-mode/scaledangles" "snippets/latex-mode/scaledbars" "snippets/latex-mode/scaledcurlybraces" "snippets/latex-mode/scaledparenthesis" "snippets/latex-mode/scaledsquarebrackets" "snippets/latex-mode/sec" "snippets/latex-mode/section" "snippets/latex-mode/selectsize" "snippets/latex-mode/sets" "snippets/latex-mode/sigma" "snippets/latex-mode/sigmaupper" "snippets/latex-mode/similar" "snippets/latex-mode/sine" "snippets/latex-mode/sineinverse" "snippets/latex-mode/sinepower" "snippets/latex-mode/singleintegral" "snippets/latex-mode/siunits" "snippets/latex-mode/squareroot" "snippets/latex-mode/starpower" "snippets/latex-mode/subandsuperscript" "snippets/latex-mode/subf" "snippets/latex-mode/subfigure" "snippets/latex-mode/subscript" "snippets/latex-mode/subsec" "snippets/latex-mode/subsection" "snippets/latex-mode/subsubsection" "snippets/latex-mode/summation" "snippets/latex-mode/superandsubscript" "snippets/latex-mode/superscript" "snippets/latex-mode/table" "snippets/latex-mode/tableofcontents" "snippets/latex-mode/tangent" "snippets/latex-mode/tangentinverse" "snippets/latex-mode/tangentpower" "snippets/latex-mode/tau" "snippets/latex-mode/tauupper" "snippets/latex-mode/tensor" "snippets/latex-mode/tensorproduct" "snippets/latex-mode/text" "snippets/latex-mode/textbf" "snippets/latex-mode/texttype" "snippets/latex-mode/therefore" "snippets/latex-mode/theta" "snippets/latex-mode/thetaupper" "snippets/latex-mode/tikzpicture" "snippets/latex-mode/tilde" "snippets/latex-mode/times" "snippets/latex-mode/title" "snippets/latex-mode/toprule" "snippets/latex-mode/tripleintegral" "snippets/latex-mode/underline" "snippets/latex-mode/union" "snippets/latex-mode/usepackage" "snippets/latex-mode/vector" "snippets/latex-mode/vspace" "snippets/latex-mode/vspacenoindent" "snippets/latex-mode/xi" "snippets/lisp-mode/class" "snippets/lisp-mode/comment" "snippets/lisp-mode/defpackage" "snippets/lisp-mode/do" "snippets/lisp-mode/for" "snippets/lisp-mode/foreach" "snippets/lisp-mode/format" "snippets/lisp-mode/if" "snippets/lisp-mode/ifelse" "snippets/lisp-mode/ifnot" "snippets/lisp-mode/slot" "snippets/lisp-mode/switch" "snippets/lisp-mode/typecast" "snippets/makefile-mode/all" "snippets/markdown-mode/+" "snippets/markdown-mode/-" "snippets/markdown-mode/.yas-parents" "snippets/markdown-mode/_" "snippets/markdown-mode/__" "snippets/markdown-mode/`" "snippets/markdown-mode/boldface" "snippets/markdown-mode/codeblock" "snippets/markdown-mode/codeinline" "snippets/markdown-mode/emphasis" "snippets/markdown-mode/githubcodeblock" "snippets/markdown-mode/h1.1" "snippets/markdown-mode/h1.2" "snippets/markdown-mode/h2.1" "snippets/markdown-mode/h2.2" "snippets/markdown-mode/h3" "snippets/markdown-mode/h4" "snippets/markdown-mode/h5" "snippets/markdown-mode/h6" "snippets/markdown-mode/header1" "snippets/markdown-mode/header2" "snippets/markdown-mode/header3" "snippets/markdown-mode/header4" "snippets/markdown-mode/headerequal" "snippets/markdown-mode/headerminus" "snippets/markdown-mode/hexocodeblock" "snippets/markdown-mode/highlight" "snippets/markdown-mode/horizontalrule" "snippets/markdown-mode/hr.1" "snippets/markdown-mode/hr.2" "snippets/markdown-mode/image" "snippets/markdown-mode/img" "snippets/markdown-mode/link" "snippets/markdown-mode/octopress-post" "snippets/markdown-mode/ol" "snippets/markdown-mode/orderedlist" "snippets/markdown-mode/rcodeblock" "snippets/markdown-mode/referenceimage" "snippets/markdown-mode/referencelabel" "snippets/markdown-mode/referencelink" "snippets/markdown-mode/rimg" "snippets/markdown-mode/rlb" "snippets/markdown-mode/rlink" "snippets/markdown-mode/unorderedlist" "snippets/markdown-mode/utf8" "snippets/org-mode/.yas-parents" "snippets/org-mode/angularjs.snippet" "snippets/org-mode/babel-shell.yasnippet" "snippets/org-mode/bibliography" "snippets/org-mode/blog" "snippets/org-mode/coffeescript.snippet" "snippets/org-mode/diary.yasnippet" "snippets/org-mode/dir" "snippets/org-mode/elisp" "snippets/org-mode/exports" "snippets/org-mode/graphviz" "snippets/org-mode/heading1" "snippets/org-mode/heading2" "snippets/org-mode/heading3" "snippets/org-mode/heading4" "snippets/org-mode/heading5" "snippets/org-mode/javascript.snippet" "snippets/org-mode/journal" "snippets/org-mode/lorem ipsum.yasnippet" "snippets/org-mode/openstack.snippet" "snippets/org-mode/orglink" "snippets/org-mode/revealfooter" "snippets/org-mode/revealfragmentstyle" "snippets/org-mode/revealheader" "snippets/org-mode/revealhlevel" "snippets/org-mode/revealmargin" "snippets/org-mode/revealmaxscale" "snippets/org-mode/revealminimumscale" "snippets/org-mode/revealpropertybg" "snippets/org-mode/revealpropertybgrepeat" "snippets/org-mode/revealpropertybgsize" "snippets/org-mode/revealpropertybgtransition" "snippets/org-mode/revealpropertydatastate" "snippets/org-mode/revealroot" "snippets/org-mode/revealslidenum" "snippets/org-mode/revealsplit" "snippets/org-mode/revealtheme" "snippets/org-mode/revealtitlebackground" "snippets/org-mode/revealtitlebg-repeat" "snippets/org-mode/revealtitlebg-size" "snippets/org-mode/revealtransition" "snippets/org-mode/session" "snippets/org-mode/src" "snippets/org-mode/srcexport" "snippets/org-mode/srcfile" "snippets/org-mode/srcresults" "snippets/org-mode/tagkeys" "snippets/org-mode/tagstat" "snippets/org-mode/tangle" "snippets/org-mode/title.yasnippet" "snippets/org-mode/todokey" "snippets/org-mode/todostat" "snippets/org-mode/uml-activity" "snippets/org-mode/uml-class" "snippets/org-mode/uml-component" "snippets/org-mode/uml-sequence" "snippets/org-mode/uml-state" "snippets/org-mode/uml-usecase" "snippets/org-mode/var" "snippets/org-mode/variable" "snippets/php-mode/fun" "snippets/php-mode/funs" "snippets/php-mode/private-function" "snippets/php-mode/public-function" "snippets/php-mode/req" "snippets/python-mode/.yas-parents" "snippets/python-mode/.yas-setup.el" "snippets/python-mode/__contains__" "snippets/python-mode/__enter__" "snippets/python-mode/__exit__" "snippets/python-mode/__getitem__" "snippets/python-mode/__len__" "snippets/python-mode/__new__" "snippets/python-mode/__setitem__" "snippets/python-mode/all" "snippets/python-mode/arg" "snippets/python-mode/arg_positional" "snippets/python-mode/assert" "snippets/python-mode/assertEqual" "snippets/python-mode/assertFalse" "snippets/python-mode/assertIn" "snippets/python-mode/assertNotEqual" "snippets/python-mode/assertNotIn" "snippets/python-mode/assertRaises" "snippets/python-mode/assertRaises.with" "snippets/python-mode/assertTrue" "snippets/python-mode/bang" "snippets/python-mode/celery_pdb" "snippets/python-mode/class" "snippets/python-mode/classmethod" "snippets/python-mode/cls" "snippets/python-mode/dec" "snippets/python-mode/def" "snippets/python-mode/defm" "snippets/python-mode/deftest" "snippets/python-mode/django_test_class" "snippets/python-mode/doc" "snippets/python-mode/doctest" "snippets/python-mode/embed" "snippets/python-mode/eq" "snippets/python-mode/for" "snippets/python-mode/from" "snippets/python-mode/function" "snippets/python-mode/function_docstring" "snippets/python-mode/function_docstring_numpy" "snippets/python-mode/if" "snippets/python-mode/ife" "snippets/python-mode/ifmain" "snippets/python-mode/import" "snippets/python-mode/init" "snippets/python-mode/init_docstring" "snippets/python-mode/interact" "snippets/python-mode/ipdbdebug" "snippets/python-mode/iter" "snippets/python-mode/lambda" "snippets/python-mode/list" "snippets/python-mode/logger_name" "snippets/python-mode/logging" "snippets/python-mode/main" "snippets/python-mode/metaclass" "snippets/python-mode/method" "snippets/python-mode/method_docstring" "snippets/python-mode/not_impl" "snippets/python-mode/np" "snippets/python-mode/parse_args" "snippets/python-mode/parser" "snippets/python-mode/pass" "snippets/python-mode/pl" "snippets/python-mode/pprint.yasnippet" "snippets/python-mode/print" "snippets/python-mode/prop" "snippets/python-mode/reg" "snippets/python-mode/repr" "snippets/python-mode/return" "snippets/python-mode/scls" "snippets/python-mode/script" "snippets/python-mode/self" "snippets/python-mode/self_without_dot" "snippets/python-mode/selfassign" "snippets/python-mode/setdef" "snippets/python-mode/setup" "snippets/python-mode/shebang" "snippets/python-mode/size" "snippets/python-mode/static" "snippets/python-mode/str" "snippets/python-mode/super" "snippets/python-mode/test_class" "snippets/python-mode/test_file" "snippets/python-mode/trace" "snippets/python-mode/try" "snippets/python-mode/tryelse" "snippets/python-mode/unicode" "snippets/python-mode/unicode_literals" "snippets/python-mode/utf8" "snippets/python-mode/while" "snippets/python-mode/with" "snippets/python-mode/with_statement" "snippets/ruby-mode/#" "snippets/ruby-mode/=b" "snippets/ruby-mode/Comp" "snippets/ruby-mode/Enum" "snippets/ruby-mode/GLOB" "snippets/ruby-mode/all" "snippets/ruby-mode/am" "snippets/ruby-mode/any" "snippets/ruby-mode/app" "snippets/ruby-mode/assert_equal" "snippets/ruby-mode/attribute" "snippets/ruby-mode/bench" "snippets/ruby-mode/bm" "snippets/ruby-mode/case" "snippets/ruby-mode/cla" "snippets/ruby-mode/class" "snippets/ruby-mode/cls" "snippets/ruby-mode/collect" "snippets/ruby-mode/dee" "snippets/ruby-mode/def" "snippets/ruby-mode/def.self" "snippets/ruby-mode/deftest" "snippets/ruby-mode/deli" "snippets/ruby-mode/det" "snippets/ruby-mode/do-block" "snippets/ruby-mode/dow" "snippets/ruby-mode/ea" "snippets/ruby-mode/eac" "snippets/ruby-mode/eai" "snippets/ruby-mode/eav" "snippets/ruby-mode/eawi" "snippets/ruby-mode/for" "snippets/ruby-mode/forin" "snippets/ruby-mode/formula" "snippets/ruby-mode/if" "snippets/ruby-mode/ife" "snippets/ruby-mode/inc" "snippets/ruby-mode/init" "snippets/ruby-mode/inject" "snippets/ruby-mode/map" "snippets/ruby-mode/mm" "snippets/ruby-mode/mod" "snippets/ruby-mode/pry" "snippets/ruby-mode/r" "snippets/ruby-mode/rb" "snippets/ruby-mode/red" "snippets/ruby-mode/reject" "snippets/ruby-mode/rel" "snippets/ruby-mode/req" "snippets/ruby-mode/rpry" "snippets/ruby-mode/rw" "snippets/ruby-mode/select" "snippets/ruby-mode/str" "snippets/ruby-mode/test class" "snippets/ruby-mode/testcase" "snippets/ruby-mode/tim" "snippets/ruby-mode/to_" "snippets/ruby-mode/tu" "snippets/ruby-mode/until" "snippets/ruby-mode/upt" "snippets/ruby-mode/w" "snippets/ruby-mode/when" "snippets/ruby-mode/while" "snippets/ruby-mode/y" "snippets/ruby-mode/zip" "snippets/sh-mode/args" "snippets/sh-mode/bang" "snippets/sh-mode/for loop" "snippets/sh-mode/function" "snippets/sh-mode/if" "snippets/sh-mode/ife" "snippets/sh-mode/safe-bang" "snippets/sh-mode/until" "snippets/sh-mode/while" "snippets/snippet-mode/cont" "snippets/snippet-mode/elisp" "snippets/snippet-mode/field" "snippets/snippet-mode/group" "snippets/snippet-mode/mirror" "snippets/snippet-mode/vars" "snippets/sql-mode/column" "snippets/sql-mode/constraint" "snippets/sql-mode/constraint.1" "snippets/sql-mode/create" "snippets/sql-mode/create.1" "snippets/sql-mode/insert" "snippets/sql-mode/references" "snippets/web-mode/.yas-parents" "snippets/web-mode/dd" "snippets/web-mode/div" "snippets/web-mode/dl" "snippets/web-mode/doctype" "snippets/web-mode/doctype.html5" "snippets/web-mode/doctype.xhtml1" "snippets/web-mode/doctype.xhtml1_1" "snippets/web-mode/doctype.xhtml1_strict" "snippets/web-mode/doctype.xhtml1_transitional" "snippets/web-mode/dt" "snippets/web-mode/form" "snippets/web-mode/html" "snippets/web-mode/html.xmlns" "snippets/web-mode/link.import" "snippets/web-mode/link.stylesheet" "snippets/web-mode/link.stylesheet-ie" "snippets/web-mode/mailto" "snippets/web-mode/meta" "snippets/web-mode/meta.http-equiv" "snippets/web-mode/script.javascript" "snippets/web-mode/script.javascript-src" "snippets/web-mode/textarea" "snippets/web-mode/th" "srecode-map.el" "testLisp.lisp" "themes/color-theme-tomorrow.el" "themes/img/guide-extra.png" "themes/img/guide-generic.png" "themes/img/guide-org.png" "themes/img/org.png" "themes/img/preview.png" "themes/img/spacemacs-theme.png" "themes/spacemacs-common.el" "themes/spacemacs-dark-theme.el" "themes/spacemacs-light-theme.el" "themes/spacemacs-theme-pkg.el" "themes/tomorrow-night-blue-theme.el" "themes/tomorrow-night-bright-theme.el" "themes/tomorrow-night-eighties-theme.el" "themes/tomorrow-night-theme.el" "themes/tomorrow-theme.el" "themes/zenburn-theme.el" "url/cookies") "k:/clojure-home/test-clojure1/" (".gitignore" ".hgignore" ".nrepl-port" "CHANGELOG.md" "LICENSE" "README.md" "doc/intro.md" "project.clj" "src/test_clojure1/core.clj" "target/base+system+user+dev/classes/META-INF/maven/test-clojure1/test-clojure1/pom.properties" "target/base+system+user+dev/repl-port" "target/base+system+user+dev/stale/leiningen.core.classpath.extract-native-dependencies" "target/default/classes/META-INF/maven/test-clojure1/test-clojure1/pom.properties" "target/default/repl-port" "target/default/stale/leiningen.core.classpath.extract-native-dependencies" "target/uberjar/classes/META-INF/maven/test-clojure1/test-clojure1/pom.properties" "target/uberjar/classes/test_clojure1/core$_main.class" "target/uberjar/classes/test_clojure1/core$fn__38.class" "target/uberjar/classes/test_clojure1/core$loading__5569__auto____36.class" "target/uberjar/classes/test_clojure1/core.class" "target/uberjar/classes/test_clojure1/core__init.class" "target/uberjar/stale/leiningen.core.classpath.extract-native-dependencies" "target/uberjar/test-clojure1-0.1.0-SNAPSHOT-standalone.jar" "target/uberjar/test-clojure1-0.1.0-SNAPSHOT.jar" "test/test_clojure1/core_test.clj") "c:/Users/yzl/perl/" (".gitignore" ";" "Path.md" "Result/Result.csv" "TXT/testArgv.pl" "Word/word1.docx" "a.pl" "a.pl.html" "accessPeople.pl" "ack" "analysisFeiji.pl" "analysisFeiji2.pl" "analysisSkewdata.pl" "analysisfeijiutf8.pl" "convertword.pl" "diamond_cat.pl" "feiji.txt" "feiji2.txt" "feijichang.pl" "feijichang.pl.bak" "feijiutf8.txt" "generateSqlite.db" "getDataFromKeyword.pl" "getStatistic.pl" "grade.dat" "gradeAnalysis.pl" "keyword.txt" "people.dat" "pod2htmd.tmp" "regex/LICENSE" "regex/README.md" "regex/chapter1/%^amp!20_+.txt" "regex/chapter1/doublename.txt" "regex/chapter1/file.md" "regex/chapter1/helloworld.txt" "regex/chapter1/test2.txt" "regex/chapter1/wildcards.txt" "regex/chapter2/24hrtimes.txt" "regex/chapter2/addingcommas" "regex/chapter2/automatedediting.txt" "regex/chapter2/c2f.pl" "regex/chapter2/convert.pl" "regex/chapter2/convert2.pl" "regex/chapter2/domain.txt" "regex/chapter2/email.txt" "regex/chapter2/event.pl" "regex/chapter2/eventsources.txt" "regex/chapter2/grey.txt" "regex/chapter2/jeffs" "regex/chapter2/jeffsregex" "regex/chapter2/jefftest.txt" "regex/chapter2/king.in" "regex/chapter2/mkreply" "regex/chapter2/replacetxt.pl" "regex/chapter2/test.txt" "regex/chapter2/text-to-html.pl" "regex/chapter2/text.txt" "regex/chapter2/username.txt" "regex/chapter5/csvprocessing.vbs" "regex/chapter5/data.txt" "regex/introduction-to-regex/introduction-to-regex-configs/IntroToRegex.ps1" "regex/introduction-to-regex/introduction-to-regex-configs/IntroToRegex.psd1" "regex/introduction-to-regex/introduction-to-regex-configs/introduction-to-regex-vmSetup.ps1" "regex/introduction-to-regex/introduction-to-regex-m1/introduction-to-regex-m1-demos-02.ps1" "regex/introduction-to-regex/introduction-to-regex-m1/introduction-to-regex-m1-notes.md" "regex/introduction-to-regex/introduction-to-regex-m2/Intro-To-Regex-m2-demos-01.ps1" "runPerlWebQq.pl" "skewEnglish.txt" "skewdata.dat" "skewdata.txt" "skeweng.txt" "sqliteLink.pl" "statistic.dat" "ta.pl" "testAdvancedRegex.pl" "testArgv.pl" "testArgv.pl.bak" "testArray.pl" "testBatModify.pl" "testBatModify.pl.bak" "testDebugTrnAndPhase.pl" "testDotdot.pl" "testG.pl" "testGiven.pl" "testHashEach.pl" "testHashExist.pl" "testHello.pl" "testLWP2.pl" "testLWP20121216.pl" "testLwp.pl" "testMail.pl" "testOut.pl" "testProcessOut.pl" "testRef.pl" "testReference.pl" "testRegexLingKuanduanyan.pl" "testRound.pl" "testSigleOut.pl" "testSplit.pl" "testTrnOut.pl" "testdbi.pl" "testdbi.pl.bak" "testifelsif.pl"))) \ No newline at end of file +#s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ("c:/Users/yzl/AppData/Roaming/.emacs.d/" ("elpa/markdown-mode-20180707.1255/markdown-mode.el" "elpa/clj-refactor-20180725.1258/clj-refactor-autoloads.el" "elpa/multiple-cursors-20180615.1218/multiple-cursors-autoloads.el" "elpa/edn-20160215.1219/edn-autoloads.el" "elpa/peg-20150708.641/peg-autoloads.el" "elpa/inflections-20170913.916/inflections-autoloads.el" "elpa/hydra-20180703.1502/hydra-autoloads.el" "elpa/0blayout-20161008.607/0blayout-autoloads.el" "elpa/0xc-20170126.353/0xc-autoloads.el" "elpa/2048-game-20151026.1933/2048-game-autoloads.el" "elpa/4clojure-20131014.2207/4clojure-autoloads.el" "elpa/abyss-theme-20170808.1345/abyss-theme-autoloads.el" "elpa/ac-geiser-20130929.647/ac-geiser-autoloads.el" "elpa/ace-jump-mode-20140616.815/ace-jump-mode-autoloads.el" "elpa/ace-link-20180308.900/ace-link-autoloads.el" "elpa/ace-window-20180607.1923/ace-window-autoloads.el" "elpa/ag-20180225.1040/ag-autoloads.el" "elpa/alert-20180403.738/alert-autoloads.el" "elpa/all-the-icons-20180125.1557/all-the-icons-autoloads.el" "elpa/all-the-icons-dired-20170418.2131/all-the-icons-dired-autoloads.el" "elpa/all-the-icons-ivy-20180225.1430/all-the-icons-ivy-autoloads.el" "elpa/async-20180527.1730/async-autoloads.el" "elpa/auto-complete-20170125.245/auto-complete-autoloads.el" "elpa/avy-20180615.1501/avy-autoloads.el" "elpa/bind-key-20180513.430/bind-key-autoloads.el" "elpa/cal-china-x-20180211.1901/cal-china-x-autoloads.el" "elpa/chicken-scheme-20141116.1939/chicken-scheme-autoloads.el" "elpa/cider-20180729.911/cider-autoloads.el" "elpa/cl-lib-highlight-20140127.2112/cl-lib-highlight-autoloads.el" "elpa/clojure-mode-20180729.943/clojure-mode-autoloads.el" "elpa/clojure-mode-extra-font-locking-20180114.1711/clojure-mode-extra-font-locking-autoloads.el" "elpa/company-20180723.1628/company-autoloads.el" "elpa/concurrent-20161229.330/concurrent-autoloads.el" "elpa/counsel-20180730.1537/counsel-autoloads.el" "elpa/counsel-projectile-20180718.1542/counsel-projectile-autoloads.el" "elpa/counsel-world-clock-20171202.737/counsel-world-clock-autoloads.el" "elpa/ctable-20171006.11/ctable-autoloads.el" "elpa/dash-functional-20180107.1618/dash-functional-autoloads.el" "elpa/dashboard-20180705.625/dashboard-autoloads.el" "elpa/deferred-20170901.1330/deferred-autoloads.el" "elpa/deft-20180619.1557/deft-autoloads.el" "elpa/dired-hacks-utils-20160527.2136/dired-hacks-utils-autoloads.el" "elpa/dired-icon-20170223.526/dired-icon-autoloads.el" "elpa/dired-narrow-20170309.1129/dired-narrow-autoloads.el" "elpa/dired-rainbow-20171202.2248/dired-rainbow-autoloads.el" "elpa/dired-subtree-20170910.2221/dired-subtree-autoloads.el" "elpa/dumb-diff-20171211.2122/dumb-diff-autoloads.el" "elpa/elisp-refs-20180715.2302/elisp-refs-autoloads.el" "elpa/elpy-20180728.932/elpy-autoloads.el" "elpa/emms-20180709.123/emms-autoloads.el" "elpa/epc-20140610.534/epc-autoloads.el" "elpa/epl-20180205.2049/epl-autoloads.el" "elpa/epresent-20160411.201/epresent-autoloads.el" "elpa/ess-20180730.809/ess-autoloads.el" "elpa/eval-in-repl-20171122.1343/eval-in-repl-autoloads.el" "elpa/evil-20180723.1243/evil-autoloads.el" "elpa/evil-surround-20180102.1401/evil-surround-autoloads.el" "elpa/evil-vimish-fold-20171030.1151/evil-vimish-fold-autoloads.el" "elpa/evil-visualstar-20160223.48/evil-visualstar-autoloads.el" "elpa/f-20180106.922/f-autoloads.el" "elpa/flycheck-20180720.947/flycheck-autoloads.el" "elpa/flycheck-clojure-20180721.1412/flycheck-clojure-autoloads.el" "elpa/flycheck-ledger-20180125.831/flycheck-ledger-autoloads.el" "elpa/fortpy-20150715.2032/fortpy-autoloads.el" "elpa/fringe-current-line-20140111.411/fringe-current-line-autoloads.el" "elpa/geiser-20180626.1140/geiser-autoloads.el" "elpa/ghub-20180725.2122/ghub-autoloads.el" "elpa/git-commit-20180730.2140/git-commit-autoloads.el" "elpa/git-gutter-20161105.1356/git-gutter-autoloads.el" "elpa/gntp-20141025.250/gntp-autoloads.el" "elpa/goto-chg-20180105.1833/goto-chg-autoloads.el" "elpa/helpful-20180728.1805/helpful-autoloads.el" "elpa/highlight-escape-sequences-20171117.1237/highlight-escape-sequences-autoloads.el" "elpa/highlight-indentation-20171218.937/highlight-indentation-autoloads.el" "elpa/ido-completing-read+-20180628.244/ido-completing-read+-autoloads.el" "elpa/image+-20150707.1616/image+-autoloads.el" "elpa/ivy-20180727.1527/ivy-autoloads.el" "elpa/ivy-dired-history-20170626.556/ivy-dired-history-autoloads.el" "elpa/ivy-rich-20180705.145/ivy-rich-autoloads.el" "elpa/ivy-yasnippet-20180621.636/ivy-yasnippet-autoloads.el" "elpa/iy-go-to-char-20141029.1546/iy-go-to-char-autoloads.el" "elpa/key-chord-20160227.1238/key-chord-autoloads.el" "elpa/ledger-mode-20180728.1604/ledger-mode-autoloads.el" "elpa/log4e-20170401.1304/log4e-autoloads.el" "elpa/loop-20160813.1407/loop-autoloads.el" "elpa/magit-20180729.1644/magit-autoloads.el" "elpa/magit-popup-20180726.2037/magit-popup-autoloads.el" "elpa/markdown-mode-20180707.1255/markdown-mode-autoloads.el" "elpa/markdown-mode+-20170320.2104/markdown-mode+-autoloads.el" "elpa/matlab-mode-20180125.1810/matlab-mode-autoloads.el" "elpa/memoize-20180614.1930/memoize-autoloads.el" "elpa/mo-git-blame-20160129.1759/mo-git-blame-autoloads.el" "elpa/move-text-20170909.330/move-text-autoloads.el" "elpa/nyan-mode-20170423.740/nyan-mode-autoloads.el" "elpa/org-agenda-property-20140626.2116/org-agenda-property-autoloads.el" "elpa/org-alert-20180524.133/org-alert-autoloads.el" "elpa/org-autolist-20170924.1901/org-autolist-autoloads.el" "elpa/org-babel-eval-in-repl-20170511.1214/org-babel-eval-in-repl-autoloads.el" "elpa/org-bookmark-heading-20170510.1708/org-bookmark-heading-autoloads.el" "elpa/org-brain-20180712.2110/org-brain-autoloads.el" "elpa/org-bullets-20180208.2343/org-bullets-autoloads.el" "elpa/org-dashboard-20171223.1924/org-dashboard-autoloads.el" "elpa/org-journal-20180723.757/org-journal-autoloads.el" "elpa/org-link-minor-mode-20170805.1852/org-link-minor-mode-autoloads.el" "elpa/org-mind-map-20180614.2052/org-mind-map-autoloads.el" "elpa/org-mru-clock-20180419.1306/org-mru-clock-autoloads.el" "elpa/org-tree-slide-20180424.2336/org-tree-slide-autoloads.el" "elpa/org-wild-notifier-20180222.425/org-wild-notifier-autoloads.el" "elpa/origami-20180101.1553/origami-autoloads.el" "elpa/ox-reveal-20161027.926/ox-reveal-autoloads.el" "elpa/page-break-lines-20171210.831/page-break-lines-autoloads.el" "elpa/paredit-20171127.205/paredit-autoloads.el" "elpa/paredit-menu-20160128.1733/paredit-menu-autoloads.el" "elpa/pkg-info-20150517.1143/pkg-info-autoloads.el" "elpa/poporg-20170403.751/poporg-autoloads.el" "elpa/popup-20160709.1429/popup-autoloads.el" "elpa/pos-tip-20150318.1513/pos-tip-autoloads.el" "elpa/pretty-symbols-20140814.959/pretty-symbols-autoloads.el" "elpa/projectile-20180728.1457/projectile-autoloads.el" "elpa/python-environment-20150310.853/python-environment-autoloads.el" "elpa/python-mode-20180721.1847/python-mode-autoloads.el" "elpa/pyvenv-20180727.1142/pyvenv-autoloads.el" "elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-autoloads.el" "elpa/request-20170201.147/request-autoloads.el" "elpa/request-deferred-20160419.2305/request-deferred-autoloads.el" "elpa/ruby-end-20141215.1223/ruby-end-autoloads.el" "elpa/ruby-tools-20151209.1615/ruby-tools-autoloads.el" "elpa/s-20180406.808/s-autoloads.el" "elpa/scheme-complete-20170824.1413/scheme-complete-autoloads.el" "elpa/scribble-mode-20160124.2328/scribble-mode-autoloads.el" "elpa/sesman-20180727.1016/sesman-autoloads.el" "elpa/shut-up-20180628.1830/shut-up-autoloads.el" "elpa/simplezen-20130421.1000/simplezen-autoloads.el" "elpa/smex-20151212.2209/smex-autoloads.el" "elpa/sotclojure-20170922.8/sotclojure-autoloads.el" "elpa/sotlisp-20180706.1749/sotlisp-autoloads.el" "elpa/srcery-theme-20180729.1444/srcery-theme-autoloads.el" "elpa/string-edit-20160411.656/string-edit-autoloads.el" "elpa/suggest-20180725.2312/suggest-autoloads.el" "elpa/swiper-20180713.1646/swiper-autoloads.el" "elpa/tagedit-20161121.855/tagedit-autoloads.el" "elpa/use-package-20180715.1801/use-package-autoloads.el" "elpa/vimish-fold-20180101.612/vimish-fold-autoloads.el" "elpa/visual-ascii-mode-20150129.1046/visual-ascii-mode-autoloads.el" "elpa/visual-fill-column-20180727.2225/visual-fill-column-autoloads.el" "elpa/web-mode-20180628.1122/web-mode-autoloads.el" "elpa/window-numbering-20160809.1810/window-numbering-autoloads.el" "elpa/with-editor-20180726.2044/with-editor-autoloads.el" "elpa/wrap-region-20140117.720/wrap-region-autoloads.el" "elpa/writegood-mode-20180525.1343/writegood-mode-autoloads.el" "elpa/writeroom-mode-20170623.1027/writeroom-mode-autoloads.el" "elpa/yasnippet-20180621.50/yasnippet-autoloads.el" "elpa/zencoding-mode-20140213.822/zencoding-mode-autoloads.el" "customizations/doom-todo-ivy.el" "GTD/orgBoss/Journal/20180709.org" "GTD/orgBoss/Journal/20180706.org" "GTD/orgBoss/Journal/20180705.org" "GTD/orgBoss/Journal/20180623.org" "GTD/orgBoss/Journal/20180622.org" "GTD/orgBoss/Journal/20180621.org" "GTD/orgBoss/Journal/20180620.org" "GTD/orgBoss/Journal/20180614.org" "GTD/orgBoss/Journal/20180613.org" "GTD/orgBoss/Journal/20180612.org" "GTD/orgBoss/Journal/20180602.org" "GTD/orgBoss/Journal/20180601.org" "GTD/orgBoss/Journal/20180531.org" "GTD/orgBoss/Journal/20180509.org" "GTD/orgBoss/Journal/20180507.org" "GTD/orgBoss/Journal/20180504.org" "GTD/orgBoss/Journal/20180503.org" "GTD/orgBoss/Journal/20180502.org" "GTD/orgBoss/Journal/20180501.org" "GTD/orgBoss/Journal/20180427.org" "GTD/orgBoss/Journal/20180426.org" "GTD/orgBoss/Journal/20180425.org" "GTD/orgBoss/Journal/20180424.org" "GTD/orgBoss/Journal/20180402.org" "GTD/orgBoss/Journal/20180401.org" "GTD/orgBoss/Journal/20180320.org" "GTD/orgBoss/Journal/20180318.org" "GTD/orgBoss/Journal/20180317.org" "GTD/orgBoss/Journal/20180313.org" "GTD/orgBoss/Journal/20180311.org" "GTD/orgBoss/Journal/20180308.org" "GTD/orgBoss/Journal/20180307.org" "GTD/orgBoss/Journal/20180306.org" "GTD/orgBoss/Journal/20180304.org" "GTD/orgBoss/Journal/20180303.org" "GTD/orgBoss/Journal/20180228.org" "GTD/orgBoss/Journal/20180226.org" "GTD/orgBoss/Journal/20180225.org" "GTD/orgBoss/Journal/20180222.org" "GTD/orgBoss/Journal/20180220.org" "GTD/orgBoss/Journal/20180215.org" "GTD/orgBoss/Journal/20180213.org" "GTD/orgBoss/Journal/20180209.org" "GTD/orgBoss/Journal/20180208.org" "GTD/orgBoss/Journal/20180207.org" "GTD/orgBoss/Journal/20180206.org" "GTD/orgBoss/Journal/20180205.org" "GTD/orgBoss/Journal/20180203.org" "GTD/orgBoss/Journal/20180202.org" "GTD/orgBoss/Journal/20180201.org" "GTD/orgBoss/Journal/20180131.org" "GTD/orgBoss/Journal/20180130.org" "GTD/orgBoss/Journal/20180129.org" "elpa/wrap-region-20140116.2320/wrap-region-autoloads.el" "GTD/orgBoss/Journal/20180204.org" "GTD/txtSetup.org" "GTD/orgBoss/Journal/2017100011.org" "GTD/orgBoss/Journal/20180214.org" "elpa/deft-20180619.857/deft.el" "elpa/ess-20180723.1428/ess-autoloads.el" "elpa/evil-20180723.543/evil-autoloads.el" "elpa/flycheck-clojure-20180721.712/flycheck-clojure-autoloads.el" "elpa/helpful-20180723.1543/helpful-autoloads.el" "elpa/ivy-20180723.846/ivy-autoloads.el" "elpa/magit-20180723.1158/magit-autoloads.el" "elpa/org-journal-20180723.57/org-journal-autoloads.el" "elpa/projectile-20180721.352/projectile-autoloads.el" "elpa/python-mode-20180721.1147/python-mode-autoloads.el" "elpa/suggest-20180722.350/suggest-autoloads.el" "elpa/howm-20180225.205/howm-autoloads.el" "GTD/orgBoss/Journal/20180724" "GTD/2018-07-24T0431.txt" "elpa/deft-20180619.857/deft-autoloads.el" "elpa/elisp-refs-20180715.1602/elisp-refs-autoloads.el" "elpa/elpy-20180720.155/elpy-autoloads.el" "elpa/flycheck-20180720.247/flycheck-autoloads.el" "elpa/ghub-20180715.1159/ghub-autoloads.el" "elpa/git-commit-20180713.1444/git-commit-autoloads.el" "elpa/pyvenv-20180720.214/pyvenv-autoloads.el" "elpa/sesman-20180719.213/sesman-autoloads.el" "GTD/orgBoss/myfit.org" "GTD/orgBoss/myWork0.org" "elpa/swiper-20180713.946/swiper-autoloads.el" "elpa/use-package-20180715.1101/use-package-autoloads.el" "GTD/org_Brain/公司.org" "elpa/dashboard-20180704.2325/dashboard-autoloads.el" "elpa/emms-20180708.1823/emms-autoloads.el" "elpa/find-file-in-project-20180705.1832/find-file-in-project-autoloads.el" "elpa/ivy-rich-20180704.1845/ivy-rich-autoloads.el" "elpa/ledger-mode-20180705.138/ledger-mode-autoloads.el" "elpa/markdown-mode-20180707.555/markdown-mode-autoloads.el" "elpa/org-brain-20180712.1410/org-brain-autoloads.el" "elpa/sotlisp-20180706.1049/sotlisp-autoloads.el" "GTD/orgBoss/Journal/20180710" "README.tex" "GTD/orgBoss/Journal/20180709" "GTD/orgBoss/mywork30.org" "GTD/orgBoss/Journal/20180706" "GTD/orgBoss/myWork5.org" "GTD/orgBoss/myWork15.org" "GTD/orgBoss/myWorkfluentYaw15.org" "snippets/org-mode/myDir" "snippets/org-mode/myProperty" "GTD/orgBoss/myWork.org" "GTD/orgBoss/Journal/20180705" "elpa/evil-vimish-fold-20171030.451/evil-vimish-fold-autoloads.el" "elpa/vimish-fold-20171231.2212/vimish-fold-autoloads.el" "elpa/origami-20180101.753/origami-autoloads.el" "GTD/scheme/sicp-init.rkt" "GTD/scheme/gstd.scrbl" "elpa/scribble-mode-20160124.1528/scribble-mode-autoloads.el" "GTD/hello.rkt" "GTD/hello.scm" "elpa/geiser-20180626.440/geiser-autoloads.el" "GTD/org_Brain/SICP.org" "GTD/org-ref/bibliography/体验式培训:超级过山车.pdf" "GTD/org-ref/bibliography/references1.bib" "GTD/org-ref/bibliography/references.bib" "elpa/cider-20180701.1420/cider-autoloads.el" "elpa/clojure-mode-20180629.1500/clojure-mode-autoloads.el" "elpa/counsel-20180625.634/counsel-autoloads.el" "elpa/elpy-20180629.513/elpy-autoloads.el" "elpa/emms-20180702.257/emms-autoloads.el" "elpa/ess-20180703.54/ess-autoloads.el" "elpa/find-file-in-project-20180626.1809/find-file-in-project-autoloads.el" "elpa/helpful-20180630.257/helpful-autoloads.el" "elpa/ido-completing-read+-20180627.1944/ido-completing-read+-autoloads.el" "elpa/ivy-20180626.1345/ivy-autoloads.el" "elpa/ivy-rich-20180621.1920/ivy-rich-autoloads.el" "elpa/ivy-yasnippet-20180620.2336/ivy-yasnippet-autoloads.el" "elpa/ledger-mode-20180622.2148/ledger-mode-autoloads.el" "elpa/srcery-theme-20180623.619/srcery-theme-autoloads.el" "elpa/markdown-mode-20180619.1015/markdown-mode-autoloads.el" "elpa/projectile-20180630.111/projectile-autoloads.el" "elpa/shut-up-20180628.1130/shut-up-autoloads.el" "elpa/web-mode-20180628.422/web-mode-autoloads.el" "elpa/yasnippet-20180620.1750/yasnippet-autoloads.el" "elpa/ascii-art-to-unicode-1.12/ascii-art-to-unicode-autoloads.el" "elpa/visual-ascii-mode-20150129.246/visual-ascii-mode-autoloads.el" "GTD/org_Brain/科研论文.org" "GTD/org_Brain/ReynoldStress.org" "GTD/org_Brain/K-e.org" "GTD/org_Brain/SA.org" "GTD/org_Brain/T-SST.org" "GTD/org_Brain/SST.org" "GTD/org_Brain/k-omega.org" "GTD/org_Brain/URANS时间步无关性.org" "GTD/org_Brain/网格无关性.org" "GTD/org_Brain/湍流模型.org" "elpa/org-brain-20180522.717/org-brain.el" "GTD/org_Brain/Appendence.org" "GTD/org_Brain/参考文献.org" "GTD/org_Brain/结果.org" "GTD/org_Brain/方法.org" "GTD/org_Brain/一个idea.org" "GTD/org_Brain/调研.org" "GTD/org_Brain/背景.org" "GTD/org_Brain/da.org" "GTD/org_Brain/nil.org" "GTD/org_Brain/father.org" "GTD/org_Brain/hi.org" "elpa/org-brain-20180522.717/org-brain-autoloads.el" "test.el" "elpa/loop-20160813.707/loop-autoloads.el" "elpa/shut-up-20150423.522/shut-up-autoloads.el" "GTD/orgBoss/Journal/20180623" "GTD/orgBoss/Journal/20180622" "GTD/orgBoss/Journal/20180621" "GTD/orgBoss/Journal/20180620" "elpa/company-20180615.1508/company-autoloads.el" "elpa/magit-20180618.1554/magit-autoloads.el" "elpa/magit-popup-20180618.1602/magit-popup-autoloads.el" "elpa/markdown-mode-20180616.1858/markdown-mode-autoloads.el" "elpa/memoize-20180614.1230/memoize-autoloads.el" "elpa/org-mind-map-20180614.1352/org-mind-map-autoloads.el" "elpa/projectile-20180616.252/projectile-autoloads.el" "elpa/swiper-20180615.1400/swiper-autoloads.el" "elpa/use-package-20180613.2219/use-package-autoloads.el" "elpa/with-editor-20180618.1602/with-editor-autoloads.el" "elpa/avy-20180612.212/avy-autoloads.el" "elpa/cider-20180611.2335/cider-autoloads.el" "elpa/clj-refactor-20180526.803/clj-refactor-autoloads.el" "elpa/company-20180501.11/company-autoloads.el" "elpa/counsel-20180608.955/counsel-autoloads.el" "elpa/counsel-projectile-20180527.1328/counsel-projectile-autoloads.el" "elpa/dracula-theme-20180517.556/dracula-theme-autoloads.el" "elpa/dumb-jump-20180602.109/dumb-jump-autoloads.el" "elpa/emms-20180613.2043/emms-autoloads.el" "elpa/ess-20180613.1621/ess-autoloads.el" "elpa/flycheck-20180611.1549/flycheck-autoloads.el" "elpa/hydra-20180508.1008/hydra-autoloads.el" "elpa/ivy-20180613.1343/ivy-autoloads.el" "elpa/magit-20180612.1617/magit-autoloads.el" "elpa/ghub-20180607.2101/ghub-autoloads.el" "elpa/magit-popup-20180509.1041/magit-popup-autoloads.el" "elpa/markdown-mode-20180607.913/markdown-mode-autoloads.el" "elpa/org-alert-20180523.1833/org-alert-autoloads.el" "elpa/org-mru-clock-20180419.606/org-mru-clock-autoloads.el" "elpa/org-tree-slide-20180424.1636/org-tree-slide-autoloads.el" "elpa/projectile-20180602.2253/projectile-autoloads.el" "elpa/swiper-20180613.1343/swiper-autoloads.el" "elpa/use-package-20180613.1349/use-package-autoloads.el" "elpa/visual-fill-column-20180511.211/visual-fill-column-autoloads.el" "elpa/web-mode-20180608.113/web-mode-autoloads.el" "elpa/with-editor-20180414.757/with-editor-autoloads.el" "elpa/writegood-mode-20180525.643/writegood-mode-autoloads.el" "elpa/yasnippet-20180606.1722/yasnippet-autoloads.el" "GTD/orgBoss/Journal/20180614" "GTD/orgBoss/Journal/20180613" "customizations/setup-ledger.el" "test.ledger" "elpa/flycheck-ledger-20180125.31/flycheck-ledger-autoloads.el" "GTD/orgBoss/Journal/20180612" "elpa/define-word-20180327.1935/define-word-autoloads.el" "GTD/orgBoss/Journal/20180602" "GTD/orgBoss/Journal/20180601" "GTD/orgBoss/Journal/20180531" "elpa/dash-functional-20180107.818/dash-functional-autoloads.el" "customizations/alphapapa/org-agenda-ng.el" "elpa/org-agenda-property-20140626.1416/org-agenda-property-autoloads.el" "GTD/orgBoss/dfeich-lisp-babel.org" "GTD/orgBoss/elisp-cal.org" "GTD/orgBoss/dfeich-tables.org" "snippets/org-mode/listcruncher" "GTD/orgBoss/how-to-use-Org-Babel-for-R.org" "GTD/orgBoss/library-of-babel.org" "GTD/orgBoss/listcruncher-grouped.png" "GTD/orgBoss/dfreich-lob.org" "GTD/orgBoss/READMEForListCruncher.org" "GTD/orgBoss/listcrunchertest.org" "elpa/org-link-minor-mode-20170805.1152/org-link-minor-mode-autoloads.el" "elpa/org-caldav-20180403.1336/org-caldav-autoloads.el" "GTD/orgBoss/reproductive-research-and-software-development-methods-for-management-tasks.org" "GTD/orgBoss/org-dashboard.org" "GTD/orgBoss/code-snippets.org" "customizations/setup-dashboard.el" "elpa/org-dashboard-20171223.1124/org-dashboard-autoloads.el" "elpa/dashboard-20180328.807/dashboard-autoloads.el" "elpa/page-break-lines-20171210.31/page-break-lines-autoloads.el" "GTD/dynamicyaw.org" "GTD/staticYaw.org" "GTD/staticYaw.org.gpg" "GTD/NumericaStaticYaw.org" "elpa/writeroom-mode-20170623.327/writeroom-mode-autoloads.el" "test.org" "GTD/writingtest.org" "GTD/orgBoss/CiteSpace/citeShare.html" "GTD/orgBoss/CiteSpace/citeShare.org" "GTD/newgtd.org" "GTD/orgBoss/Journal/20180509" "elpa/poporg-20170403.51/poporg-autoloads.el" "GTD/orgBoss/Journal/20180507" "GTD/orgBoss/Journal/20180504" "GTD/testSlide.org_archive" "slidetemplate.org" "snippets/org-mode/revealfortitle" "snippets/org-mode/reveal +revealpropertydatastate" "snippets/org-mode/test.org" "GTD/orgBoss/Journal/20180503" "snippets/org-mode/table3" "snippets/org-mode/table2" "hello-graphviz.png" "GTD/orgBoss/Journal/20180502.html" "GTD/orgBoss/Journal/20180502" "testMind3.org" "GTD/testXmind2.org" "GTD/testXmind.org" "GTD/ModifyIntro.org" ".gitignore" ".mc-lists.el" ".orgConf.el" ".python-environments/default/Include/Python-ast.h" ".python-environments/default/Include/Python.h" ".python-environments/default/Include/abstract.h" ".python-environments/default/Include/asdl.h" ".python-environments/default/Include/ast.h" ".python-environments/default/Include/bitset.h" ".python-environments/default/Include/boolobject.h" ".python-environments/default/Include/bufferobject.h" ".python-environments/default/Include/bytearrayobject.h" ".python-environments/default/Include/bytes_methods.h" ".python-environments/default/Include/bytesobject.h" ".python-environments/default/Include/cStringIO.h" ".python-environments/default/Include/cellobject.h" ".python-environments/default/Include/ceval.h" ".python-environments/default/Include/classobject.h" ".python-environments/default/Include/cobject.h" ".python-environments/default/Include/code.h" ".python-environments/default/Include/codecs.h" ".python-environments/default/Include/compile.h" ".python-environments/default/Include/complexobject.h" ".python-environments/default/Include/datetime.h" ".python-environments/default/Include/descrobject.h" ".python-environments/default/Include/dictobject.h" ".python-environments/default/Include/dtoa.h" ".python-environments/default/Include/enumobject.h" ".python-environments/default/Include/errcode.h" ".python-environments/default/Include/eval.h" ".python-environments/default/Include/fileobject.h" ".python-environments/default/Include/floatobject.h" ".python-environments/default/Include/frameobject.h" ".python-environments/default/Include/funcobject.h" ".python-environments/default/Include/genobject.h" ".python-environments/default/Include/graminit.h" ".python-environments/default/Include/grammar.h" ".python-environments/default/Include/import.h" ".python-environments/default/Include/intobject.h" ".python-environments/default/Include/intrcheck.h" ".python-environments/default/Include/iterobject.h" ".python-environments/default/Include/listobject.h" ".python-environments/default/Include/longintrepr.h" ".python-environments/default/Include/longobject.h" ".python-environments/default/Include/marshal.h" ".python-environments/default/Include/memoryobject.h" ".python-environments/default/Include/metagrammar.h" ".python-environments/default/Include/methodobject.h" ".python-environments/default/Include/modsupport.h" ".python-environments/default/Include/moduleobject.h" ".python-environments/default/Include/node.h" ".python-environments/default/Include/object.h" ".python-environments/default/Include/objimpl.h" ".python-environments/default/Include/opcode.h" ".python-environments/default/Include/osdefs.h" ".python-environments/default/Include/parsetok.h" ".python-environments/default/Include/patchlevel.h" ".python-environments/default/Include/pgen.h" ".python-environments/default/Include/pgenheaders.h" ".python-environments/default/Include/py_curses.h" ".python-environments/default/Include/pyarena.h" ".python-environments/default/Include/pycapsule.h" ".python-environments/default/Include/pyconfig.h" ".python-environments/default/Include/pyctype.h" ".python-environments/default/Include/pydebug.h" ".python-environments/default/Include/pyerrors.h" ".python-environments/default/Include/pyexpat.h" ".python-environments/default/Include/pyfpe.h" ".python-environments/default/Include/pygetopt.h" ".python-environments/default/Include/pymacconfig.h" ".python-environments/default/Include/pymactoolbox.h" ".python-environments/default/Include/pymath.h" ".python-environments/default/Include/pymem.h" ".python-environments/default/Include/pyport.h" ".python-environments/default/Include/pystate.h" ".python-environments/default/Include/pystrcmp.h" ".python-environments/default/Include/pystrtod.h" ".python-environments/default/Include/pythonrun.h" ".python-environments/default/Include/pythread.h" ".python-environments/default/Include/rangeobject.h" ".python-environments/default/Include/setobject.h" ".python-environments/default/Include/sliceobject.h" ".python-environments/default/Include/stringobject.h" ".python-environments/default/Include/structmember.h" ".python-environments/default/Include/structseq.h" ".python-environments/default/Include/symtable.h" ".python-environments/default/Include/sysmodule.h" ".python-environments/default/Include/timefuncs.h" ".python-environments/default/Include/token.h" ".python-environments/default/Include/traceback.h" ".python-environments/default/Include/tupleobject.h" ".python-environments/default/Include/ucnhash.h" ".python-environments/default/Include/unicodeobject.h" ".python-environments/default/Include/warnings.h" ".python-environments/default/Include/weakrefobject.h" ".python-environments/default/Lib/UserDict.py" ".python-environments/default/Lib/UserDict.pyc" ".python-environments/default/Lib/_abcoll.py" ".python-environments/default/Lib/_abcoll.pyc" ".python-environments/default/Lib/_weakrefset.py" ".python-environments/default/Lib/_weakrefset.pyc" ".python-environments/default/Lib/abc.py" ".python-environments/default/Lib/abc.pyc" ".python-environments/default/Lib/codecs.py" ".python-environments/default/Lib/codecs.pyc" ".python-environments/default/Lib/copy_reg.py" ".python-environments/default/Lib/copy_reg.pyc" ".python-environments/default/Lib/distutils/__init__.py" ".python-environments/default/Lib/distutils/__init__.pyc" ".python-environments/default/Lib/distutils/distutils.cfg" ".python-environments/default/Lib/encodings/__init__.py" ".python-environments/default/Lib/encodings/__init__.pyc" ".python-environments/default/Lib/encodings/aliases.py" ".python-environments/default/Lib/encodings/aliases.pyc" ".python-environments/default/Lib/encodings/ascii.py" ".python-environments/default/Lib/encodings/ascii.pyc" ".python-environments/default/Lib/encodings/base64_codec.py" ".python-environments/default/Lib/encodings/big5.py" ".python-environments/default/Lib/encodings/big5hkscs.py" ".python-environments/default/Lib/encodings/bz2_codec.py" ".python-environments/default/Lib/encodings/charmap.py" ".python-environments/default/Lib/encodings/cp037.py" ".python-environments/default/Lib/encodings/cp1006.py" ".python-environments/default/Lib/encodings/cp1026.py" ".python-environments/default/Lib/encodings/cp1140.py" ".python-environments/default/Lib/encodings/cp1250.py" ".python-environments/default/Lib/encodings/cp1251.py" ".python-environments/default/Lib/encodings/cp1252.py" ".python-environments/default/Lib/encodings/cp1253.py" ".python-environments/default/Lib/encodings/cp1254.py" ".python-environments/default/Lib/encodings/cp1255.py" ".python-environments/default/Lib/encodings/cp1256.py" ".python-environments/default/Lib/encodings/cp1257.py" ".python-environments/default/Lib/encodings/cp1258.py" ".python-environments/default/Lib/encodings/cp424.py" ".python-environments/default/Lib/encodings/cp437.py" ".python-environments/default/Lib/encodings/cp500.py" ".python-environments/default/Lib/encodings/cp720.py" ".python-environments/default/Lib/encodings/cp737.py" ".python-environments/default/Lib/encodings/cp775.py" ".python-environments/default/Lib/encodings/cp850.py" ".python-environments/default/Lib/encodings/cp852.py" ".python-environments/default/Lib/encodings/cp855.py" ".python-environments/default/Lib/encodings/cp856.py" ".python-environments/default/Lib/encodings/cp857.py" ".python-environments/default/Lib/encodings/cp858.py" ".python-environments/default/Lib/encodings/cp860.py" ".python-environments/default/Lib/encodings/cp861.py" ".python-environments/default/Lib/encodings/cp862.py" ".python-environments/default/Lib/encodings/cp863.py" ".python-environments/default/Lib/encodings/cp864.py" ".python-environments/default/Lib/encodings/cp865.py" ".python-environments/default/Lib/encodings/cp866.py" ".python-environments/default/Lib/encodings/cp869.py" ".python-environments/default/Lib/encodings/cp874.py" ".python-environments/default/Lib/encodings/cp875.py" ".python-environments/default/Lib/encodings/cp932.py" ".python-environments/default/Lib/encodings/cp949.py" ".python-environments/default/Lib/encodings/cp950.py" ".python-environments/default/Lib/encodings/euc_jis_2004.py" ".python-environments/default/Lib/encodings/euc_jisx0213.py" ".python-environments/default/Lib/encodings/euc_jp.py" ".python-environments/default/Lib/encodings/euc_kr.py" ".python-environments/default/Lib/encodings/gb18030.py" ".python-environments/default/Lib/encodings/gb2312.py" ".python-environments/default/Lib/encodings/gbk.py" ".python-environments/default/Lib/encodings/gbk.pyc" ".python-environments/default/Lib/encodings/hex_codec.py" ".python-environments/default/Lib/encodings/hp_roman8.py" ".python-environments/default/Lib/encodings/hz.py" ".python-environments/default/Lib/encodings/idna.py" ".python-environments/default/Lib/encodings/idna.pyc" ".python-environments/default/Lib/encodings/iso2022_jp.py" ".python-environments/default/Lib/encodings/iso2022_jp_1.py" ".python-environments/default/Lib/encodings/iso2022_jp_2.py" ".python-environments/default/Lib/encodings/iso2022_jp_2004.py" ".python-environments/default/Lib/encodings/iso2022_jp_3.py" ".python-environments/default/Lib/encodings/iso2022_jp_ext.py" ".python-environments/default/Lib/encodings/iso2022_kr.py" ".python-environments/default/Lib/encodings/iso8859_1.py" ".python-environments/default/Lib/encodings/iso8859_10.py" ".python-environments/default/Lib/encodings/iso8859_11.py" ".python-environments/default/Lib/encodings/iso8859_13.py" ".python-environments/default/Lib/encodings/iso8859_14.py" ".python-environments/default/Lib/encodings/iso8859_15.py" ".python-environments/default/Lib/encodings/iso8859_16.py" ".python-environments/default/Lib/encodings/iso8859_2.py" ".python-environments/default/Lib/encodings/iso8859_3.py" ".python-environments/default/Lib/encodings/iso8859_4.py" ".python-environments/default/Lib/encodings/iso8859_5.py" ".python-environments/default/Lib/encodings/iso8859_6.py" ".python-environments/default/Lib/encodings/iso8859_7.py" ".python-environments/default/Lib/encodings/iso8859_8.py" ".python-environments/default/Lib/encodings/iso8859_9.py" ".python-environments/default/Lib/encodings/johab.py" ".python-environments/default/Lib/encodings/koi8_r.py" ".python-environments/default/Lib/encodings/koi8_u.py" ".python-environments/default/Lib/encodings/latin_1.py" ".python-environments/default/Lib/encodings/latin_1.pyc" ".python-environments/default/Lib/encodings/mac_arabic.py" ".python-environments/default/Lib/encodings/mac_centeuro.py" ".python-environments/default/Lib/encodings/mac_croatian.py" ".python-environments/default/Lib/encodings/mac_cyrillic.py" ".python-environments/default/Lib/encodings/mac_farsi.py" ".python-environments/default/Lib/encodings/mac_greek.py" ".python-environments/default/Lib/encodings/mac_iceland.py" ".python-environments/default/Lib/encodings/mac_latin2.py" ".python-environments/default/Lib/encodings/mac_roman.py" ".python-environments/default/Lib/encodings/mac_romanian.py" ".python-environments/default/Lib/encodings/mac_turkish.py" ".python-environments/default/Lib/encodings/mbcs.py" ".python-environments/default/Lib/encodings/mbcs.pyc" ".python-environments/default/Lib/encodings/palmos.py" ".python-environments/default/Lib/encodings/ptcp154.py" ".python-environments/default/Lib/encodings/punycode.py" ".python-environments/default/Lib/encodings/quopri_codec.py" ".python-environments/default/Lib/encodings/raw_unicode_escape.py" ".python-environments/default/Lib/encodings/rot_13.py" ".python-environments/default/Lib/encodings/shift_jis.py" ".python-environments/default/Lib/encodings/shift_jis_2004.py" ".python-environments/default/Lib/encodings/shift_jisx0213.py" ".python-environments/default/Lib/encodings/string_escape.py" ".python-environments/default/Lib/encodings/string_escape.pyc" ".python-environments/default/Lib/encodings/tis_620.py" ".python-environments/default/Lib/encodings/undefined.py" ".python-environments/default/Lib/encodings/unicode_escape.py" ".python-environments/default/Lib/encodings/unicode_internal.py" ".python-environments/default/Lib/encodings/utf_16.py" ".python-environments/default/Lib/encodings/utf_16_be.py" ".python-environments/default/Lib/encodings/utf_16_be.pyc" ".python-environments/default/Lib/encodings/utf_16_le.py" ".python-environments/default/Lib/encodings/utf_16_le.pyc" ".python-environments/default/Lib/encodings/utf_32.py" ".python-environments/default/Lib/encodings/utf_32_be.py" ".python-environments/default/Lib/encodings/utf_32_be.pyc" ".python-environments/default/Lib/encodings/utf_32_le.py" ".python-environments/default/Lib/encodings/utf_7.py" ".python-environments/default/Lib/encodings/utf_8.py" ".python-environments/default/Lib/encodings/utf_8.pyc" ".python-environments/default/Lib/encodings/utf_8_sig.py" ".python-environments/default/Lib/encodings/uu_codec.py" ".python-environments/default/Lib/encodings/zlib_codec.py" ".python-environments/default/Lib/fnmatch.py" ".python-environments/default/Lib/fnmatch.pyc" ".python-environments/default/Lib/genericpath.py" ".python-environments/default/Lib/genericpath.pyc" ".python-environments/default/Lib/linecache.py" ".python-environments/default/Lib/linecache.pyc" ".python-environments/default/Lib/locale.py" ".python-environments/default/Lib/locale.pyc" ".python-environments/default/Lib/ntpath.py" ".python-environments/default/Lib/ntpath.pyc" ".python-environments/default/Lib/orig-prefix.txt" ".python-environments/default/Lib/os.py" ".python-environments/default/Lib/os.pyc" ".python-environments/default/Lib/posixpath.py" ".python-environments/default/Lib/posixpath.pyc" ".python-environments/default/Lib/re.py" ".python-environments/default/Lib/re.pyc" ".python-environments/default/Lib/site-packages/dateutil/__init__.py" ".python-environments/default/Lib/site-packages/dateutil/__init__.pyc" ".python-environments/default/Lib/site-packages/dateutil/_common.py" ".python-environments/default/Lib/site-packages/dateutil/_common.pyc" ".python-environments/default/Lib/site-packages/dateutil/_version.py" ".python-environments/default/Lib/site-packages/dateutil/_version.pyc" ".python-environments/default/Lib/site-packages/dateutil/easter.py" ".python-environments/default/Lib/site-packages/dateutil/easter.pyc" ".python-environments/default/Lib/site-packages/dateutil/parser.py" ".python-environments/default/Lib/site-packages/dateutil/parser.pyc" ".python-environments/default/Lib/site-packages/dateutil/relativedelta.py" ".python-environments/default/Lib/site-packages/dateutil/relativedelta.pyc" ".python-environments/default/Lib/site-packages/dateutil/rrule.py" ".python-environments/default/Lib/site-packages/dateutil/rrule.pyc" ".python-environments/default/Lib/site-packages/dateutil/tz/__init__.py" ".python-environments/default/Lib/site-packages/dateutil/tz/__init__.pyc" ".python-environments/default/Lib/site-packages/dateutil/tz/_common.py" ".python-environments/default/Lib/site-packages/dateutil/tz/_common.pyc" ".python-environments/default/Lib/site-packages/dateutil/tz/tz.py" ".python-environments/default/Lib/site-packages/dateutil/tz/tz.pyc" ".python-environments/default/Lib/site-packages/dateutil/tz/win.py" ".python-environments/default/Lib/site-packages/dateutil/tz/win.pyc" ".python-environments/default/Lib/site-packages/dateutil/tzwin.py" ".python-environments/default/Lib/site-packages/dateutil/tzwin.pyc" ".python-environments/default/Lib/site-packages/dateutil/zoneinfo/__init__.py" ".python-environments/default/Lib/site-packages/dateutil/zoneinfo/__init__.pyc" ".python-environments/default/Lib/site-packages/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz" ".python-environments/default/Lib/site-packages/dateutil/zoneinfo/rebuild.py" ".python-environments/default/Lib/site-packages/dateutil/zoneinfo/rebuild.pyc" ".python-environments/default/Lib/site-packages/easy_install.py" ".python-environments/default/Lib/site-packages/easy_install.pyc" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/METADATA" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/RECORD" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/entry_points.txt" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/fortpyepcserver-0.0.0.dist-info/top_level.txt" ".python-environments/default/Lib/site-packages/fortpyepcserver.py" ".python-environments/default/Lib/site-packages/fortpyepcserver.pyc" ".python-environments/default/Lib/site-packages/pip/__init__.py" ".python-environments/default/Lib/site-packages/pip/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/__main__.py" ".python-environments/default/Lib/site-packages/pip/__main__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/appdirs.py" ".python-environments/default/Lib/site-packages/pip/_vendor/appdirs.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/adapter.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/cache.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/cache.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/compat.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/compat.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/controller.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/controller.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/serialize.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py" ".python-environments/default/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/ansi.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/ansi.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/ansitowin32.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/ansitowin32.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/initialise.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/initialise.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/win32.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/win32.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/winterm.py" ".python-environments/default/Lib/site-packages/pip/_vendor/colorama/winterm.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/misc.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/misc.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/compat.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/compat.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/database.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/database.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/index.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/index.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/locators.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/locators.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/manifest.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/manifest.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/markers.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/markers.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/metadata.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/metadata.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/resources.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/resources.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/scripts.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/scripts.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/t32.exe" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/t64.exe" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/util.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/util.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/version.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/version.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/w32.exe" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/w64.exe" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/wheel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distlib/wheel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/distro.py" ".python-environments/default/Lib/site-packages/pip/_vendor/distro.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_ihatexml.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_ihatexml.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_inputstream.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_inputstream.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_tokenizer.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_tokenizer.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/_base.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/_base.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/datrie.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/datrie.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/py.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_trie/py.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_utils.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/_utils.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/constants.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/constants.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/base.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/base.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/lint.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/lint.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/optionaltags.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/optionaltags.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/sanitizer.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/sanitizer.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/whitespace.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/filters/whitespace.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/html5parser.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/html5parser.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/serializer.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/serializer.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/genshi.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/sax.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treeadapters/sax.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/base.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/base.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/dom.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/dom.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/base.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/base.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/dom.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/dom.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree_lxml.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree_lxml.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/genshi.py" ".python-environments/default/Lib/site-packages/pip/_vendor/html5lib/treewalkers/genshi.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/ipaddress.py" ".python-environments/default/Lib/site-packages/pip/_vendor/ipaddress.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/linklockfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/linklockfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/mkdirlockfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/mkdirlockfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/pidlockfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/pidlockfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/sqlitelockfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/sqlitelockfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/symlinklockfile.py" ".python-environments/default/Lib/site-packages/pip/_vendor/lockfile/symlinklockfile.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/ordereddict.py" ".python-environments/default/Lib/site-packages/pip/_vendor/ordereddict.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/__about__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/__about__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/_compat.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/_compat.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/_structures.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/_structures.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/markers.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/markers.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/requirements.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/requirements.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/specifiers.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/specifiers.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/utils.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/utils.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/version.py" ".python-environments/default/Lib/site-packages/pip/_vendor/packaging/version.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/pkg_resources/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/bar.py" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/bar.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/counter.py" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/counter.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/helpers.py" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/helpers.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/spinner.py" ".python-environments/default/Lib/site-packages/pip/_vendor/progress/spinner.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/pyparsing.py" ".python-environments/default/Lib/site-packages/pip/_vendor/pyparsing.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/re-vendor.py" ".python-environments/default/Lib/site-packages/pip/_vendor/re-vendor.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/adapters.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/adapters.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/api.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/api.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/auth.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/auth.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/cacert.pem" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/certs.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/certs.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/compat.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/compat.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/cookies.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/cookies.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/exceptions.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/exceptions.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/hooks.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/hooks.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/models.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/models.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/big5freq.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/big5prober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/big5prober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardetect.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/compat.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/compat.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/constants.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/constants.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/escprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/escprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/escsm.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/escsm.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhungarianmodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhungarianmodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/_collections.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/connection.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/connection.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/fields.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/fields.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/filepost.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/request.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/request.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/response.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/response.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/request.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/response.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/url.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/sessions.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/sessions.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/status_codes.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/status_codes.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/structures.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/structures.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/utils.py" ".python-environments/default/Lib/site-packages/pip/_vendor/requests/utils.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/retrying.py" ".python-environments/default/Lib/site-packages/pip/_vendor/retrying.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/six.py" ".python-environments/default/Lib/site-packages/pip/_vendor/six.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/__init__.py" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/labels.py" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/labels.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/mklabels.py" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/mklabels.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/tests.py" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/tests.pyc" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/x_user_defined.py" ".python-environments/default/Lib/site-packages/pip/_vendor/webencodings/x_user_defined.pyc" ".python-environments/default/Lib/site-packages/pip/basecommand.py" ".python-environments/default/Lib/site-packages/pip/basecommand.pyc" ".python-environments/default/Lib/site-packages/pip/baseparser.py" ".python-environments/default/Lib/site-packages/pip/baseparser.pyc" ".python-environments/default/Lib/site-packages/pip/cmdoptions.py" ".python-environments/default/Lib/site-packages/pip/cmdoptions.pyc" ".python-environments/default/Lib/site-packages/pip/commands/__init__.py" ".python-environments/default/Lib/site-packages/pip/commands/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/commands/check.py" ".python-environments/default/Lib/site-packages/pip/commands/check.pyc" ".python-environments/default/Lib/site-packages/pip/commands/completion.py" ".python-environments/default/Lib/site-packages/pip/commands/completion.pyc" ".python-environments/default/Lib/site-packages/pip/commands/download.py" ".python-environments/default/Lib/site-packages/pip/commands/download.pyc" ".python-environments/default/Lib/site-packages/pip/commands/freeze.py" ".python-environments/default/Lib/site-packages/pip/commands/freeze.pyc" ".python-environments/default/Lib/site-packages/pip/commands/hash.py" ".python-environments/default/Lib/site-packages/pip/commands/hash.pyc" ".python-environments/default/Lib/site-packages/pip/commands/help.py" ".python-environments/default/Lib/site-packages/pip/commands/help.pyc" ".python-environments/default/Lib/site-packages/pip/commands/install.py" ".python-environments/default/Lib/site-packages/pip/commands/install.pyc" ".python-environments/default/Lib/site-packages/pip/commands/list.py" ".python-environments/default/Lib/site-packages/pip/commands/list.pyc" ".python-environments/default/Lib/site-packages/pip/commands/search.py" ".python-environments/default/Lib/site-packages/pip/commands/search.pyc" ".python-environments/default/Lib/site-packages/pip/commands/show.py" ".python-environments/default/Lib/site-packages/pip/commands/show.pyc" ".python-environments/default/Lib/site-packages/pip/commands/uninstall.py" ".python-environments/default/Lib/site-packages/pip/commands/uninstall.pyc" ".python-environments/default/Lib/site-packages/pip/commands/wheel.py" ".python-environments/default/Lib/site-packages/pip/commands/wheel.pyc" ".python-environments/default/Lib/site-packages/pip/compat/__init__.py" ".python-environments/default/Lib/site-packages/pip/compat/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/compat/dictconfig.py" ".python-environments/default/Lib/site-packages/pip/compat/dictconfig.pyc" ".python-environments/default/Lib/site-packages/pip/download.py" ".python-environments/default/Lib/site-packages/pip/download.pyc" ".python-environments/default/Lib/site-packages/pip/exceptions.py" ".python-environments/default/Lib/site-packages/pip/exceptions.pyc" ".python-environments/default/Lib/site-packages/pip/index.py" ".python-environments/default/Lib/site-packages/pip/index.pyc" ".python-environments/default/Lib/site-packages/pip/locations.py" ".python-environments/default/Lib/site-packages/pip/locations.pyc" ".python-environments/default/Lib/site-packages/pip/models/__init__.py" ".python-environments/default/Lib/site-packages/pip/models/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/models/index.py" ".python-environments/default/Lib/site-packages/pip/models/index.pyc" ".python-environments/default/Lib/site-packages/pip/operations/__init__.py" ".python-environments/default/Lib/site-packages/pip/operations/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/operations/check.py" ".python-environments/default/Lib/site-packages/pip/operations/check.pyc" ".python-environments/default/Lib/site-packages/pip/operations/freeze.py" ".python-environments/default/Lib/site-packages/pip/operations/freeze.pyc" ".python-environments/default/Lib/site-packages/pip/pep425tags.py" ".python-environments/default/Lib/site-packages/pip/pep425tags.pyc" ".python-environments/default/Lib/site-packages/pip/req/__init__.py" ".python-environments/default/Lib/site-packages/pip/req/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/req/req_file.py" ".python-environments/default/Lib/site-packages/pip/req/req_file.pyc" ".python-environments/default/Lib/site-packages/pip/req/req_install.py" ".python-environments/default/Lib/site-packages/pip/req/req_install.pyc" ".python-environments/default/Lib/site-packages/pip/req/req_set.py" ".python-environments/default/Lib/site-packages/pip/req/req_set.pyc" ".python-environments/default/Lib/site-packages/pip/req/req_uninstall.py" ".python-environments/default/Lib/site-packages/pip/req/req_uninstall.pyc" ".python-environments/default/Lib/site-packages/pip/status_codes.py" ".python-environments/default/Lib/site-packages/pip/status_codes.pyc" ".python-environments/default/Lib/site-packages/pip/utils/__init__.py" ".python-environments/default/Lib/site-packages/pip/utils/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/utils/appdirs.py" ".python-environments/default/Lib/site-packages/pip/utils/appdirs.pyc" ".python-environments/default/Lib/site-packages/pip/utils/build.py" ".python-environments/default/Lib/site-packages/pip/utils/build.pyc" ".python-environments/default/Lib/site-packages/pip/utils/deprecation.py" ".python-environments/default/Lib/site-packages/pip/utils/deprecation.pyc" ".python-environments/default/Lib/site-packages/pip/utils/encoding.py" ".python-environments/default/Lib/site-packages/pip/utils/encoding.pyc" ".python-environments/default/Lib/site-packages/pip/utils/filesystem.py" ".python-environments/default/Lib/site-packages/pip/utils/filesystem.pyc" ".python-environments/default/Lib/site-packages/pip/utils/glibc.py" ".python-environments/default/Lib/site-packages/pip/utils/glibc.pyc" ".python-environments/default/Lib/site-packages/pip/utils/hashes.py" ".python-environments/default/Lib/site-packages/pip/utils/hashes.pyc" ".python-environments/default/Lib/site-packages/pip/utils/logging.py" ".python-environments/default/Lib/site-packages/pip/utils/logging.pyc" ".python-environments/default/Lib/site-packages/pip/utils/outdated.py" ".python-environments/default/Lib/site-packages/pip/utils/outdated.pyc" ".python-environments/default/Lib/site-packages/pip/utils/packaging.py" ".python-environments/default/Lib/site-packages/pip/utils/packaging.pyc" ".python-environments/default/Lib/site-packages/pip/utils/setuptools_build.py" ".python-environments/default/Lib/site-packages/pip/utils/setuptools_build.pyc" ".python-environments/default/Lib/site-packages/pip/utils/ui.py" ".python-environments/default/Lib/site-packages/pip/utils/ui.pyc" ".python-environments/default/Lib/site-packages/pip/vcs/__init__.py" ".python-environments/default/Lib/site-packages/pip/vcs/__init__.pyc" ".python-environments/default/Lib/site-packages/pip/vcs/bazaar.py" ".python-environments/default/Lib/site-packages/pip/vcs/bazaar.pyc" ".python-environments/default/Lib/site-packages/pip/vcs/git.py" ".python-environments/default/Lib/site-packages/pip/vcs/git.pyc" ".python-environments/default/Lib/site-packages/pip/vcs/mercurial.py" ".python-environments/default/Lib/site-packages/pip/vcs/mercurial.pyc" ".python-environments/default/Lib/site-packages/pip/vcs/subversion.py" ".python-environments/default/Lib/site-packages/pip/vcs/subversion.pyc" ".python-environments/default/Lib/site-packages/pip/wheel.py" ".python-environments/default/Lib/site-packages/pip/wheel.pyc" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/METADATA" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/RECORD" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/entry_points.txt" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/pip-9.0.1.dist-info/top_level.txt" ".python-environments/default/Lib/site-packages/pkg_resources/__init__.py" ".python-environments/default/Lib/site-packages/pkg_resources/__init__.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/__init__.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/__init__.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/appdirs.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/appdirs.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/__about__.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/__about__.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/__init__.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/__init__.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/_compat.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/_compat.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/markers.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/markers.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/utils.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/utils.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/version.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/packaging/version.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/pyparsing.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/pyparsing.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/six.py" ".python-environments/default/Lib/site-packages/pkg_resources/_vendor/six.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/extern/__init__.py" ".python-environments/default/Lib/site-packages/pkg_resources/extern/__init__.pyc" ".python-environments/default/Lib/site-packages/pkg_resources/py31compat.py" ".python-environments/default/Lib/site-packages/pkg_resources/py31compat.pyc" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/METADATA" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/RECORD" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/top_level.txt" ".python-environments/default/Lib/site-packages/python_dateutil-2.6.1.dist-info/zip-safe" ".python-environments/default/Lib/site-packages/setuptools/__init__.py" ".python-environments/default/Lib/site-packages/setuptools/__init__.pyc" ".python-environments/default/Lib/site-packages/setuptools/archive_util.py" ".python-environments/default/Lib/site-packages/setuptools/archive_util.pyc" ".python-environments/default/Lib/site-packages/setuptools/cli-32.exe" ".python-environments/default/Lib/site-packages/setuptools/cli-64.exe" ".python-environments/default/Lib/site-packages/setuptools/cli.exe" ".python-environments/default/Lib/site-packages/setuptools/command/__init__.py" ".python-environments/default/Lib/site-packages/setuptools/command/__init__.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/alias.py" ".python-environments/default/Lib/site-packages/setuptools/command/alias.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_egg.py" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_egg.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_rpm.py" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_rpm.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_wininst.py" ".python-environments/default/Lib/site-packages/setuptools/command/bdist_wininst.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/build_clib.py" ".python-environments/default/Lib/site-packages/setuptools/command/build_clib.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/build_ext.py" ".python-environments/default/Lib/site-packages/setuptools/command/build_ext.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/build_py.py" ".python-environments/default/Lib/site-packages/setuptools/command/build_py.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/develop.py" ".python-environments/default/Lib/site-packages/setuptools/command/develop.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/easy_install.py" ".python-environments/default/Lib/site-packages/setuptools/command/easy_install.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/egg_info.py" ".python-environments/default/Lib/site-packages/setuptools/command/egg_info.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/install.py" ".python-environments/default/Lib/site-packages/setuptools/command/install.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/install_egg_info.py" ".python-environments/default/Lib/site-packages/setuptools/command/install_egg_info.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/install_lib.py" ".python-environments/default/Lib/site-packages/setuptools/command/install_lib.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/install_scripts.py" ".python-environments/default/Lib/site-packages/setuptools/command/install_scripts.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/launcher manifest.xml" ".python-environments/default/Lib/site-packages/setuptools/command/py36compat.py" ".python-environments/default/Lib/site-packages/setuptools/command/py36compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/register.py" ".python-environments/default/Lib/site-packages/setuptools/command/register.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/rotate.py" ".python-environments/default/Lib/site-packages/setuptools/command/rotate.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/saveopts.py" ".python-environments/default/Lib/site-packages/setuptools/command/saveopts.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/sdist.py" ".python-environments/default/Lib/site-packages/setuptools/command/sdist.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/setopt.py" ".python-environments/default/Lib/site-packages/setuptools/command/setopt.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/test.py" ".python-environments/default/Lib/site-packages/setuptools/command/test.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/upload.py" ".python-environments/default/Lib/site-packages/setuptools/command/upload.pyc" ".python-environments/default/Lib/site-packages/setuptools/command/upload_docs.py" ".python-environments/default/Lib/site-packages/setuptools/command/upload_docs.pyc" ".python-environments/default/Lib/site-packages/setuptools/config.py" ".python-environments/default/Lib/site-packages/setuptools/config.pyc" ".python-environments/default/Lib/site-packages/setuptools/dep_util.py" ".python-environments/default/Lib/site-packages/setuptools/dep_util.pyc" ".python-environments/default/Lib/site-packages/setuptools/depends.py" ".python-environments/default/Lib/site-packages/setuptools/depends.pyc" ".python-environments/default/Lib/site-packages/setuptools/dist.py" ".python-environments/default/Lib/site-packages/setuptools/dist.pyc" ".python-environments/default/Lib/site-packages/setuptools/extension.py" ".python-environments/default/Lib/site-packages/setuptools/extension.pyc" ".python-environments/default/Lib/site-packages/setuptools/extern/__init__.py" ".python-environments/default/Lib/site-packages/setuptools/extern/__init__.pyc" ".python-environments/default/Lib/site-packages/setuptools/glob.py" ".python-environments/default/Lib/site-packages/setuptools/glob.pyc" ".python-environments/default/Lib/site-packages/setuptools/gui-32.exe" ".python-environments/default/Lib/site-packages/setuptools/gui-64.exe" ".python-environments/default/Lib/site-packages/setuptools/gui.exe" ".python-environments/default/Lib/site-packages/setuptools/launch.py" ".python-environments/default/Lib/site-packages/setuptools/launch.pyc" ".python-environments/default/Lib/site-packages/setuptools/lib2to3_ex.py" ".python-environments/default/Lib/site-packages/setuptools/lib2to3_ex.pyc" ".python-environments/default/Lib/site-packages/setuptools/monkey.py" ".python-environments/default/Lib/site-packages/setuptools/monkey.pyc" ".python-environments/default/Lib/site-packages/setuptools/msvc.py" ".python-environments/default/Lib/site-packages/setuptools/msvc.pyc" ".python-environments/default/Lib/site-packages/setuptools/namespaces.py" ".python-environments/default/Lib/site-packages/setuptools/namespaces.pyc" ".python-environments/default/Lib/site-packages/setuptools/package_index.py" ".python-environments/default/Lib/site-packages/setuptools/package_index.pyc" ".python-environments/default/Lib/site-packages/setuptools/py26compat.py" ".python-environments/default/Lib/site-packages/setuptools/py26compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/py27compat.py" ".python-environments/default/Lib/site-packages/setuptools/py27compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/py31compat.py" ".python-environments/default/Lib/site-packages/setuptools/py31compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/py33compat.py" ".python-environments/default/Lib/site-packages/setuptools/py33compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/py36compat.py" ".python-environments/default/Lib/site-packages/setuptools/py36compat.pyc" ".python-environments/default/Lib/site-packages/setuptools/sandbox.py" ".python-environments/default/Lib/site-packages/setuptools/sandbox.pyc" ".python-environments/default/Lib/site-packages/setuptools/script (dev).tmpl" ".python-environments/default/Lib/site-packages/setuptools/script.tmpl" ".python-environments/default/Lib/site-packages/setuptools/site-patch.py" ".python-environments/default/Lib/site-packages/setuptools/site-patch.pyc" ".python-environments/default/Lib/site-packages/setuptools/ssl_support.py" ".python-environments/default/Lib/site-packages/setuptools/ssl_support.pyc" ".python-environments/default/Lib/site-packages/setuptools/unicode_utils.py" ".python-environments/default/Lib/site-packages/setuptools/unicode_utils.pyc" ".python-environments/default/Lib/site-packages/setuptools/version.py" ".python-environments/default/Lib/site-packages/setuptools/version.pyc" ".python-environments/default/Lib/site-packages/setuptools/windows_support.py" ".python-environments/default/Lib/site-packages/setuptools/windows_support.pyc" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/METADATA" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/RECORD" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/dependency_links.txt" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/entry_points.txt" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/top_level.txt" ".python-environments/default/Lib/site-packages/setuptools-36.5.0.dist-info/zip-safe" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/METADATA" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/RECORD" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/six-1.11.0.dist-info/top_level.txt" ".python-environments/default/Lib/site-packages/six.py" ".python-environments/default/Lib/site-packages/six.pyc" ".python-environments/default/Lib/site-packages/wheel/__init__.py" ".python-environments/default/Lib/site-packages/wheel/__init__.pyc" ".python-environments/default/Lib/site-packages/wheel/__main__.py" ".python-environments/default/Lib/site-packages/wheel/__main__.pyc" ".python-environments/default/Lib/site-packages/wheel/archive.py" ".python-environments/default/Lib/site-packages/wheel/archive.pyc" ".python-environments/default/Lib/site-packages/wheel/bdist_wheel.py" ".python-environments/default/Lib/site-packages/wheel/bdist_wheel.pyc" ".python-environments/default/Lib/site-packages/wheel/decorator.py" ".python-environments/default/Lib/site-packages/wheel/decorator.pyc" ".python-environments/default/Lib/site-packages/wheel/egg2wheel.py" ".python-environments/default/Lib/site-packages/wheel/egg2wheel.pyc" ".python-environments/default/Lib/site-packages/wheel/install.py" ".python-environments/default/Lib/site-packages/wheel/install.pyc" ".python-environments/default/Lib/site-packages/wheel/metadata.py" ".python-environments/default/Lib/site-packages/wheel/metadata.pyc" ".python-environments/default/Lib/site-packages/wheel/paths.py" ".python-environments/default/Lib/site-packages/wheel/paths.pyc" ".python-environments/default/Lib/site-packages/wheel/pep425tags.py" ".python-environments/default/Lib/site-packages/wheel/pep425tags.pyc" ".python-environments/default/Lib/site-packages/wheel/pkginfo.py" ".python-environments/default/Lib/site-packages/wheel/pkginfo.pyc" ".python-environments/default/Lib/site-packages/wheel/signatures/__init__.py" ".python-environments/default/Lib/site-packages/wheel/signatures/__init__.pyc" ".python-environments/default/Lib/site-packages/wheel/signatures/djbec.py" ".python-environments/default/Lib/site-packages/wheel/signatures/djbec.pyc" ".python-environments/default/Lib/site-packages/wheel/signatures/ed25519py.py" ".python-environments/default/Lib/site-packages/wheel/signatures/ed25519py.pyc" ".python-environments/default/Lib/site-packages/wheel/signatures/keys.py" ".python-environments/default/Lib/site-packages/wheel/signatures/keys.pyc" ".python-environments/default/Lib/site-packages/wheel/tool/__init__.py" ".python-environments/default/Lib/site-packages/wheel/tool/__init__.pyc" ".python-environments/default/Lib/site-packages/wheel/util.py" ".python-environments/default/Lib/site-packages/wheel/util.pyc" ".python-environments/default/Lib/site-packages/wheel/wininst2wheel.py" ".python-environments/default/Lib/site-packages/wheel/wininst2wheel.pyc" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/DESCRIPTION.rst" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/INSTALLER" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/LICENSE.txt" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/METADATA" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/RECORD" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/WHEEL" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/entry_points.txt" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/metadata.json" ".python-environments/default/Lib/site-packages/wheel-0.30.0.dist-info/top_level.txt" ".python-environments/default/Lib/site.py" ".python-environments/default/Lib/site.pyc" ".python-environments/default/Lib/sre.py" ".python-environments/default/Lib/sre_compile.py" ".python-environments/default/Lib/sre_compile.pyc" ".python-environments/default/Lib/sre_constants.py" ".python-environments/default/Lib/sre_constants.pyc" ".python-environments/default/Lib/sre_parse.py" ".python-environments/default/Lib/sre_parse.pyc" ".python-environments/default/Lib/stat.py" ".python-environments/default/Lib/stat.pyc" ".python-environments/default/Lib/types.py" ".python-environments/default/Lib/types.pyc" ".python-environments/default/Lib/warnings.py" ".python-environments/default/Lib/warnings.pyc" ".python-environments/default/Scripts/activate" ".python-environments/default/Scripts/activate.bat" ".python-environments/default/Scripts/activate.ps1" ".python-environments/default/Scripts/activate_this.py" ".python-environments/default/Scripts/deactivate.bat" ".python-environments/default/Scripts/easy_install-2.7.exe" ".python-environments/default/Scripts/easy_install.exe" ".python-environments/default/Scripts/fortpyepcserver.exe" ".python-environments/default/Scripts/pip.exe" ".python-environments/default/Scripts/pip2.7.exe" ".python-environments/default/Scripts/pip2.exe" ".python-environments/default/Scripts/python.exe" ".python-environments/default/Scripts/pythonw.exe" ".python-environments/default/Scripts/wheel.exe" ".python-environments/default/pip-selfcheck.json" ".python-environments/default/tcl/tcl8.5/auto.tcl" ".python-environments/default/tcl/tcl8.5/clock.tcl" ".python-environments/default/tcl/tcl8.5/encoding/ascii.enc" ".python-environments/default/tcl/tcl8.5/encoding/big5.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1250.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1251.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1252.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1253.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1254.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1255.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1256.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1257.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp1258.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp437.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp737.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp775.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp850.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp852.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp855.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp857.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp860.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp861.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp862.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp863.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp864.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp865.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp866.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp869.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp874.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp932.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp936.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp949.enc" ".python-environments/default/tcl/tcl8.5/encoding/cp950.enc" ".python-environments/default/tcl/tcl8.5/encoding/dingbats.enc" ".python-environments/default/tcl/tcl8.5/encoding/ebcdic.enc" ".python-environments/default/tcl/tcl8.5/encoding/euc-cn.enc" ".python-environments/default/tcl/tcl8.5/encoding/euc-jp.enc" ".python-environments/default/tcl/tcl8.5/encoding/euc-kr.enc" ".python-environments/default/tcl/tcl8.5/encoding/gb12345.enc" ".python-environments/default/tcl/tcl8.5/encoding/gb1988.enc" ".python-environments/default/tcl/tcl8.5/encoding/gb2312-raw.enc" ".python-environments/default/tcl/tcl8.5/encoding/gb2312.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso2022-jp.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso2022-kr.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso2022.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-1.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-10.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-13.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-14.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-15.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-16.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-2.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-3.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-4.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-5.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-6.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-7.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-8.enc" ".python-environments/default/tcl/tcl8.5/encoding/iso8859-9.enc" ".python-environments/default/tcl/tcl8.5/encoding/jis0201.enc" ".python-environments/default/tcl/tcl8.5/encoding/jis0208.enc" ".python-environments/default/tcl/tcl8.5/encoding/jis0212.enc" ".python-environments/default/tcl/tcl8.5/encoding/koi8-r.enc" ".python-environments/default/tcl/tcl8.5/encoding/koi8-u.enc" ".python-environments/default/tcl/tcl8.5/encoding/ksc5601.enc" ".python-environments/default/tcl/tcl8.5/encoding/macCentEuro.enc" ".python-environments/default/tcl/tcl8.5/encoding/macCroatian.enc" ".python-environments/default/tcl/tcl8.5/encoding/macCyrillic.enc" ".python-environments/default/tcl/tcl8.5/encoding/macDingbats.enc" ".python-environments/default/tcl/tcl8.5/encoding/macGreek.enc" ".python-environments/default/tcl/tcl8.5/encoding/macIceland.enc" ".python-environments/default/tcl/tcl8.5/encoding/macJapan.enc" ".python-environments/default/tcl/tcl8.5/encoding/macRoman.enc" ".python-environments/default/tcl/tcl8.5/encoding/macRomania.enc" ".python-environments/default/tcl/tcl8.5/encoding/macThai.enc" ".python-environments/default/tcl/tcl8.5/encoding/macTurkish.enc" ".python-environments/default/tcl/tcl8.5/encoding/macUkraine.enc" ".python-environments/default/tcl/tcl8.5/encoding/shiftjis.enc" ".python-environments/default/tcl/tcl8.5/encoding/symbol.enc" ".python-environments/default/tcl/tcl8.5/encoding/tis-620.enc" ".python-environments/default/tcl/tcl8.5/history.tcl" ".python-environments/default/tcl/tcl8.5/http1.0/http.tcl" ".python-environments/default/tcl/tcl8.5/http1.0/pkgIndex.tcl" ".python-environments/default/tcl/tcl8.5/init.tcl" ".python-environments/default/tcl/tcl8.5/msgs/af.msg" ".python-environments/default/tcl/tcl8.5/msgs/af_za.msg" ".python-environments/default/tcl/tcl8.5/msgs/ar.msg" ".python-environments/default/tcl/tcl8.5/msgs/ar_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/ar_jo.msg" ".python-environments/default/tcl/tcl8.5/msgs/ar_lb.msg" ".python-environments/default/tcl/tcl8.5/msgs/ar_sy.msg" ".python-environments/default/tcl/tcl8.5/msgs/be.msg" ".python-environments/default/tcl/tcl8.5/msgs/bg.msg" ".python-environments/default/tcl/tcl8.5/msgs/bn.msg" ".python-environments/default/tcl/tcl8.5/msgs/bn_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/ca.msg" ".python-environments/default/tcl/tcl8.5/msgs/cs.msg" ".python-environments/default/tcl/tcl8.5/msgs/da.msg" ".python-environments/default/tcl/tcl8.5/msgs/de.msg" ".python-environments/default/tcl/tcl8.5/msgs/de_at.msg" ".python-environments/default/tcl/tcl8.5/msgs/de_be.msg" ".python-environments/default/tcl/tcl8.5/msgs/el.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_au.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_be.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_bw.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_ca.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_gb.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_hk.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_ie.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_nz.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_ph.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_sg.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_za.msg" ".python-environments/default/tcl/tcl8.5/msgs/en_zw.msg" ".python-environments/default/tcl/tcl8.5/msgs/eo.msg" ".python-environments/default/tcl/tcl8.5/msgs/es.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_ar.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_bo.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_cl.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_co.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_cr.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_do.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_ec.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_gt.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_hn.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_mx.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_ni.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_pa.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_pe.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_pr.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_py.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_sv.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_uy.msg" ".python-environments/default/tcl/tcl8.5/msgs/es_ve.msg" ".python-environments/default/tcl/tcl8.5/msgs/et.msg" ".python-environments/default/tcl/tcl8.5/msgs/eu.msg" ".python-environments/default/tcl/tcl8.5/msgs/eu_es.msg" ".python-environments/default/tcl/tcl8.5/msgs/fa.msg" ".python-environments/default/tcl/tcl8.5/msgs/fa_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/fa_ir.msg" ".python-environments/default/tcl/tcl8.5/msgs/fi.msg" ".python-environments/default/tcl/tcl8.5/msgs/fo.msg" ".python-environments/default/tcl/tcl8.5/msgs/fo_fo.msg" ".python-environments/default/tcl/tcl8.5/msgs/fr.msg" ".python-environments/default/tcl/tcl8.5/msgs/fr_be.msg" ".python-environments/default/tcl/tcl8.5/msgs/fr_ca.msg" ".python-environments/default/tcl/tcl8.5/msgs/fr_ch.msg" ".python-environments/default/tcl/tcl8.5/msgs/ga.msg" ".python-environments/default/tcl/tcl8.5/msgs/ga_ie.msg" ".python-environments/default/tcl/tcl8.5/msgs/gl.msg" ".python-environments/default/tcl/tcl8.5/msgs/gl_es.msg" ".python-environments/default/tcl/tcl8.5/msgs/gv.msg" ".python-environments/default/tcl/tcl8.5/msgs/gv_gb.msg" ".python-environments/default/tcl/tcl8.5/msgs/he.msg" ".python-environments/default/tcl/tcl8.5/msgs/hi.msg" ".python-environments/default/tcl/tcl8.5/msgs/hi_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/hr.msg" ".python-environments/default/tcl/tcl8.5/msgs/hu.msg" ".python-environments/default/tcl/tcl8.5/msgs/id.msg" ".python-environments/default/tcl/tcl8.5/msgs/id_id.msg" ".python-environments/default/tcl/tcl8.5/msgs/is.msg" ".python-environments/default/tcl/tcl8.5/msgs/it.msg" ".python-environments/default/tcl/tcl8.5/msgs/it_ch.msg" ".python-environments/default/tcl/tcl8.5/msgs/ja.msg" ".python-environments/default/tcl/tcl8.5/msgs/kl.msg" ".python-environments/default/tcl/tcl8.5/msgs/kl_gl.msg" ".python-environments/default/tcl/tcl8.5/msgs/ko.msg" ".python-environments/default/tcl/tcl8.5/msgs/ko_kr.msg" ".python-environments/default/tcl/tcl8.5/msgs/kok.msg" ".python-environments/default/tcl/tcl8.5/msgs/kok_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/kw.msg" ".python-environments/default/tcl/tcl8.5/msgs/kw_gb.msg" ".python-environments/default/tcl/tcl8.5/msgs/lt.msg" ".python-environments/default/tcl/tcl8.5/msgs/lv.msg" ".python-environments/default/tcl/tcl8.5/msgs/mk.msg" ".python-environments/default/tcl/tcl8.5/msgs/mr.msg" ".python-environments/default/tcl/tcl8.5/msgs/mr_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/ms.msg" ".python-environments/default/tcl/tcl8.5/msgs/ms_my.msg" ".python-environments/default/tcl/tcl8.5/msgs/mt.msg" ".python-environments/default/tcl/tcl8.5/msgs/nb.msg" ".python-environments/default/tcl/tcl8.5/msgs/nl.msg" ".python-environments/default/tcl/tcl8.5/msgs/nl_be.msg" ".python-environments/default/tcl/tcl8.5/msgs/nn.msg" ".python-environments/default/tcl/tcl8.5/msgs/pl.msg" ".python-environments/default/tcl/tcl8.5/msgs/pt.msg" ".python-environments/default/tcl/tcl8.5/msgs/pt_br.msg" ".python-environments/default/tcl/tcl8.5/msgs/ro.msg" ".python-environments/default/tcl/tcl8.5/msgs/ru.msg" ".python-environments/default/tcl/tcl8.5/msgs/ru_ua.msg" ".python-environments/default/tcl/tcl8.5/msgs/sh.msg" ".python-environments/default/tcl/tcl8.5/msgs/sk.msg" ".python-environments/default/tcl/tcl8.5/msgs/sl.msg" ".python-environments/default/tcl/tcl8.5/msgs/sq.msg" ".python-environments/default/tcl/tcl8.5/msgs/sr.msg" ".python-environments/default/tcl/tcl8.5/msgs/sv.msg" ".python-environments/default/tcl/tcl8.5/msgs/sw.msg" ".python-environments/default/tcl/tcl8.5/msgs/ta.msg" ".python-environments/default/tcl/tcl8.5/msgs/ta_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/te.msg" ".python-environments/default/tcl/tcl8.5/msgs/te_in.msg" ".python-environments/default/tcl/tcl8.5/msgs/th.msg" ".python-environments/default/tcl/tcl8.5/msgs/tr.msg" ".python-environments/default/tcl/tcl8.5/msgs/uk.msg" ".python-environments/default/tcl/tcl8.5/msgs/vi.msg" ".python-environments/default/tcl/tcl8.5/msgs/zh.msg" ".python-environments/default/tcl/tcl8.5/msgs/zh_cn.msg" ".python-environments/default/tcl/tcl8.5/msgs/zh_hk.msg" ".python-environments/default/tcl/tcl8.5/msgs/zh_sg.msg" ".python-environments/default/tcl/tcl8.5/msgs/zh_tw.msg" ".python-environments/default/tcl/tcl8.5/opt0.4/optparse.tcl" ".python-environments/default/tcl/tcl8.5/opt0.4/pkgIndex.tcl" ".python-environments/default/tcl/tcl8.5/package.tcl" ".python-environments/default/tcl/tcl8.5/parray.tcl" ".python-environments/default/tcl/tcl8.5/safe.tcl" ".python-environments/default/tcl/tcl8.5/tclIndex" ".python-environments/default/tcl/tcl8.5/tm.tcl" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Abidjan" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Accra" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Addis_Ababa" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Algiers" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Asmara" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Asmera" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Bamako" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Bangui" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Banjul" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Bissau" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Blantyre" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Brazzaville" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Bujumbura" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Cairo" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Casablanca" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Ceuta" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Conakry" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Dakar" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Dar_es_Salaam" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Djibouti" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Douala" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/El_Aaiun" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Freetown" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Gaborone" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Harare" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Johannesburg" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Juba" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Kampala" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Khartoum" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Kigali" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Kinshasa" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Lagos" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Libreville" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Lome" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Luanda" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Lubumbashi" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Lusaka" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Malabo" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Maputo" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Maseru" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Mbabane" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Mogadishu" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Monrovia" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Nairobi" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Ndjamena" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Niamey" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Nouakchott" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Ouagadougou" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Porto-Novo" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Sao_Tome" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Timbuktu" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Tripoli" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Tunis" ".python-environments/default/tcl/tcl8.5/tzdata/Africa/Windhoek" ".python-environments/default/tcl/tcl8.5/tzdata/America/Adak" ".python-environments/default/tcl/tcl8.5/tzdata/America/Anchorage" ".python-environments/default/tcl/tcl8.5/tzdata/America/Anguilla" ".python-environments/default/tcl/tcl8.5/tzdata/America/Antigua" ".python-environments/default/tcl/tcl8.5/tzdata/America/Araguaina" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Buenos_Aires" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Catamarca" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/ComodRivadavia" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Cordoba" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Jujuy" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/La_Rioja" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Mendoza" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Rio_Gallegos" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Salta" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/San_Juan" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/San_Luis" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Tucuman" ".python-environments/default/tcl/tcl8.5/tzdata/America/Argentina/Ushuaia" ".python-environments/default/tcl/tcl8.5/tzdata/America/Aruba" ".python-environments/default/tcl/tcl8.5/tzdata/America/Asuncion" ".python-environments/default/tcl/tcl8.5/tzdata/America/Atikokan" ".python-environments/default/tcl/tcl8.5/tzdata/America/Atka" ".python-environments/default/tcl/tcl8.5/tzdata/America/Bahia" ".python-environments/default/tcl/tcl8.5/tzdata/America/Bahia_Banderas" ".python-environments/default/tcl/tcl8.5/tzdata/America/Barbados" ".python-environments/default/tcl/tcl8.5/tzdata/America/Belem" ".python-environments/default/tcl/tcl8.5/tzdata/America/Belize" ".python-environments/default/tcl/tcl8.5/tzdata/America/Blanc-Sablon" ".python-environments/default/tcl/tcl8.5/tzdata/America/Boa_Vista" ".python-environments/default/tcl/tcl8.5/tzdata/America/Bogota" ".python-environments/default/tcl/tcl8.5/tzdata/America/Boise" ".python-environments/default/tcl/tcl8.5/tzdata/America/Buenos_Aires" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cambridge_Bay" ".python-environments/default/tcl/tcl8.5/tzdata/America/Campo_Grande" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cancun" ".python-environments/default/tcl/tcl8.5/tzdata/America/Caracas" ".python-environments/default/tcl/tcl8.5/tzdata/America/Catamarca" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cayenne" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cayman" ".python-environments/default/tcl/tcl8.5/tzdata/America/Chicago" ".python-environments/default/tcl/tcl8.5/tzdata/America/Chihuahua" ".python-environments/default/tcl/tcl8.5/tzdata/America/Coral_Harbour" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cordoba" ".python-environments/default/tcl/tcl8.5/tzdata/America/Costa_Rica" ".python-environments/default/tcl/tcl8.5/tzdata/America/Creston" ".python-environments/default/tcl/tcl8.5/tzdata/America/Cuiaba" ".python-environments/default/tcl/tcl8.5/tzdata/America/Curacao" ".python-environments/default/tcl/tcl8.5/tzdata/America/Danmarkshavn" ".python-environments/default/tcl/tcl8.5/tzdata/America/Dawson" ".python-environments/default/tcl/tcl8.5/tzdata/America/Dawson_Creek" ".python-environments/default/tcl/tcl8.5/tzdata/America/Denver" ".python-environments/default/tcl/tcl8.5/tzdata/America/Detroit" ".python-environments/default/tcl/tcl8.5/tzdata/America/Dominica" ".python-environments/default/tcl/tcl8.5/tzdata/America/Edmonton" ".python-environments/default/tcl/tcl8.5/tzdata/America/Eirunepe" ".python-environments/default/tcl/tcl8.5/tzdata/America/El_Salvador" ".python-environments/default/tcl/tcl8.5/tzdata/America/Ensenada" ".python-environments/default/tcl/tcl8.5/tzdata/America/Fort_Wayne" ".python-environments/default/tcl/tcl8.5/tzdata/America/Fortaleza" ".python-environments/default/tcl/tcl8.5/tzdata/America/Glace_Bay" ".python-environments/default/tcl/tcl8.5/tzdata/America/Godthab" ".python-environments/default/tcl/tcl8.5/tzdata/America/Goose_Bay" ".python-environments/default/tcl/tcl8.5/tzdata/America/Grand_Turk" ".python-environments/default/tcl/tcl8.5/tzdata/America/Grenada" ".python-environments/default/tcl/tcl8.5/tzdata/America/Guadeloupe" ".python-environments/default/tcl/tcl8.5/tzdata/America/Guatemala" ".python-environments/default/tcl/tcl8.5/tzdata/America/Guayaquil" ".python-environments/default/tcl/tcl8.5/tzdata/America/Guyana" ".python-environments/default/tcl/tcl8.5/tzdata/America/Halifax" ".python-environments/default/tcl/tcl8.5/tzdata/America/Havana" ".python-environments/default/tcl/tcl8.5/tzdata/America/Hermosillo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Indianapolis" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Knox" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Marengo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Petersburg" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Tell_City" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Vevay" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Vincennes" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indiana/Winamac" ".python-environments/default/tcl/tcl8.5/tzdata/America/Indianapolis" ".python-environments/default/tcl/tcl8.5/tzdata/America/Inuvik" ".python-environments/default/tcl/tcl8.5/tzdata/America/Iqaluit" ".python-environments/default/tcl/tcl8.5/tzdata/America/Jamaica" ".python-environments/default/tcl/tcl8.5/tzdata/America/Jujuy" ".python-environments/default/tcl/tcl8.5/tzdata/America/Juneau" ".python-environments/default/tcl/tcl8.5/tzdata/America/Kentucky/Louisville" ".python-environments/default/tcl/tcl8.5/tzdata/America/Kentucky/Monticello" ".python-environments/default/tcl/tcl8.5/tzdata/America/Knox_IN" ".python-environments/default/tcl/tcl8.5/tzdata/America/Kralendijk" ".python-environments/default/tcl/tcl8.5/tzdata/America/La_Paz" ".python-environments/default/tcl/tcl8.5/tzdata/America/Lima" ".python-environments/default/tcl/tcl8.5/tzdata/America/Los_Angeles" ".python-environments/default/tcl/tcl8.5/tzdata/America/Louisville" ".python-environments/default/tcl/tcl8.5/tzdata/America/Lower_Princes" ".python-environments/default/tcl/tcl8.5/tzdata/America/Maceio" ".python-environments/default/tcl/tcl8.5/tzdata/America/Managua" ".python-environments/default/tcl/tcl8.5/tzdata/America/Manaus" ".python-environments/default/tcl/tcl8.5/tzdata/America/Marigot" ".python-environments/default/tcl/tcl8.5/tzdata/America/Martinique" ".python-environments/default/tcl/tcl8.5/tzdata/America/Matamoros" ".python-environments/default/tcl/tcl8.5/tzdata/America/Mazatlan" ".python-environments/default/tcl/tcl8.5/tzdata/America/Mendoza" ".python-environments/default/tcl/tcl8.5/tzdata/America/Menominee" ".python-environments/default/tcl/tcl8.5/tzdata/America/Merida" ".python-environments/default/tcl/tcl8.5/tzdata/America/Metlakatla" ".python-environments/default/tcl/tcl8.5/tzdata/America/Mexico_City" ".python-environments/default/tcl/tcl8.5/tzdata/America/Miquelon" ".python-environments/default/tcl/tcl8.5/tzdata/America/Moncton" ".python-environments/default/tcl/tcl8.5/tzdata/America/Monterrey" ".python-environments/default/tcl/tcl8.5/tzdata/America/Montevideo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Montreal" ".python-environments/default/tcl/tcl8.5/tzdata/America/Montserrat" ".python-environments/default/tcl/tcl8.5/tzdata/America/Nassau" ".python-environments/default/tcl/tcl8.5/tzdata/America/New_York" ".python-environments/default/tcl/tcl8.5/tzdata/America/Nipigon" ".python-environments/default/tcl/tcl8.5/tzdata/America/Nome" ".python-environments/default/tcl/tcl8.5/tzdata/America/Noronha" ".python-environments/default/tcl/tcl8.5/tzdata/America/North_Dakota/Beulah" ".python-environments/default/tcl/tcl8.5/tzdata/America/North_Dakota/Center" ".python-environments/default/tcl/tcl8.5/tzdata/America/North_Dakota/New_Salem" ".python-environments/default/tcl/tcl8.5/tzdata/America/Ojinaga" ".python-environments/default/tcl/tcl8.5/tzdata/America/Panama" ".python-environments/default/tcl/tcl8.5/tzdata/America/Pangnirtung" ".python-environments/default/tcl/tcl8.5/tzdata/America/Paramaribo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Phoenix" ".python-environments/default/tcl/tcl8.5/tzdata/America/Port-au-Prince" ".python-environments/default/tcl/tcl8.5/tzdata/America/Port_of_Spain" ".python-environments/default/tcl/tcl8.5/tzdata/America/Porto_Acre" ".python-environments/default/tcl/tcl8.5/tzdata/America/Porto_Velho" ".python-environments/default/tcl/tcl8.5/tzdata/America/Puerto_Rico" ".python-environments/default/tcl/tcl8.5/tzdata/America/Rainy_River" ".python-environments/default/tcl/tcl8.5/tzdata/America/Rankin_Inlet" ".python-environments/default/tcl/tcl8.5/tzdata/America/Recife" ".python-environments/default/tcl/tcl8.5/tzdata/America/Regina" ".python-environments/default/tcl/tcl8.5/tzdata/America/Resolute" ".python-environments/default/tcl/tcl8.5/tzdata/America/Rio_Branco" ".python-environments/default/tcl/tcl8.5/tzdata/America/Rosario" ".python-environments/default/tcl/tcl8.5/tzdata/America/Santa_Isabel" ".python-environments/default/tcl/tcl8.5/tzdata/America/Santarem" ".python-environments/default/tcl/tcl8.5/tzdata/America/Santiago" ".python-environments/default/tcl/tcl8.5/tzdata/America/Santo_Domingo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Sao_Paulo" ".python-environments/default/tcl/tcl8.5/tzdata/America/Scoresbysund" ".python-environments/default/tcl/tcl8.5/tzdata/America/Shiprock" ".python-environments/default/tcl/tcl8.5/tzdata/America/Sitka" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Barthelemy" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Johns" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Kitts" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Lucia" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Thomas" ".python-environments/default/tcl/tcl8.5/tzdata/America/St_Vincent" ".python-environments/default/tcl/tcl8.5/tzdata/America/Swift_Current" ".python-environments/default/tcl/tcl8.5/tzdata/America/Tegucigalpa" ".python-environments/default/tcl/tcl8.5/tzdata/America/Thule" ".python-environments/default/tcl/tcl8.5/tzdata/America/Thunder_Bay" ".python-environments/default/tcl/tcl8.5/tzdata/America/Tijuana" ".python-environments/default/tcl/tcl8.5/tzdata/America/Toronto" ".python-environments/default/tcl/tcl8.5/tzdata/America/Tortola" ".python-environments/default/tcl/tcl8.5/tzdata/America/Vancouver" ".python-environments/default/tcl/tcl8.5/tzdata/America/Virgin" ".python-environments/default/tcl/tcl8.5/tzdata/America/Whitehorse" ".python-environments/default/tcl/tcl8.5/tzdata/America/Winnipeg" ".python-environments/default/tcl/tcl8.5/tzdata/America/Yakutat" ".python-environments/default/tcl/tcl8.5/tzdata/America/Yellowknife" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Casey" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Davis" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/DumontDUrville" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Macquarie" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Mawson" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/McMurdo" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Palmer" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Rothera" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/South_Pole" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Syowa" ".python-environments/default/tcl/tcl8.5/tzdata/Antarctica/Vostok" ".python-environments/default/tcl/tcl8.5/tzdata/Arctic/Longyearbyen" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Aden" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Almaty" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Amman" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Anadyr" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Aqtau" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Aqtobe" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ashgabat" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ashkhabad" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Baghdad" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Bahrain" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Baku" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Bangkok" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Beirut" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Bishkek" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Brunei" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Calcutta" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Choibalsan" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Chongqing" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Chungking" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Colombo" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Dacca" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Damascus" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Dhaka" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Dili" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Dubai" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Dushanbe" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Gaza" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Harbin" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Hebron" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ho_Chi_Minh" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Hong_Kong" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Hovd" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Irkutsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Istanbul" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Jakarta" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Jayapura" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Jerusalem" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kabul" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kamchatka" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Karachi" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kashgar" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kathmandu" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Katmandu" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Khandyga" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kolkata" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Krasnoyarsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kuala_Lumpur" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kuching" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Kuwait" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Macao" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Macau" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Magadan" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Makassar" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Manila" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Muscat" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Nicosia" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Novokuznetsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Novosibirsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Omsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Oral" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Phnom_Penh" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Pontianak" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Pyongyang" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Qatar" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Qyzylorda" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Rangoon" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Riyadh" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Saigon" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Sakhalin" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Samarkand" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Seoul" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Shanghai" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Singapore" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Taipei" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Tashkent" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Tbilisi" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Tehran" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Tel_Aviv" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Thimbu" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Thimphu" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Tokyo" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ujung_Pandang" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ulaanbaatar" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ulan_Bator" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Urumqi" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Ust-Nera" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Vientiane" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Vladivostok" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Yakutsk" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Yekaterinburg" ".python-environments/default/tcl/tcl8.5/tzdata/Asia/Yerevan" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Azores" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Bermuda" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Canary" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Cape_Verde" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Faeroe" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Faroe" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Jan_Mayen" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Madeira" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Reykjavik" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/South_Georgia" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/St_Helena" ".python-environments/default/tcl/tcl8.5/tzdata/Atlantic/Stanley" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/ACT" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Adelaide" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Brisbane" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Broken_Hill" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Canberra" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Currie" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Darwin" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Eucla" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Hobart" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/LHI" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Lindeman" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Lord_Howe" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Melbourne" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/NSW" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/North" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Perth" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Queensland" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/South" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Sydney" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Tasmania" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Victoria" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/West" ".python-environments/default/tcl/tcl8.5/tzdata/Australia/Yancowinna" ".python-environments/default/tcl/tcl8.5/tzdata/Brazil/Acre" ".python-environments/default/tcl/tcl8.5/tzdata/Brazil/DeNoronha" ".python-environments/default/tcl/tcl8.5/tzdata/Brazil/East" ".python-environments/default/tcl/tcl8.5/tzdata/Brazil/West" ".python-environments/default/tcl/tcl8.5/tzdata/CET" ".python-environments/default/tcl/tcl8.5/tzdata/CST6CDT" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Atlantic" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Central" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/East-Saskatchewan" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Eastern" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Mountain" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Newfoundland" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Pacific" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Saskatchewan" ".python-environments/default/tcl/tcl8.5/tzdata/Canada/Yukon" ".python-environments/default/tcl/tcl8.5/tzdata/Chile/Continental" ".python-environments/default/tcl/tcl8.5/tzdata/Chile/EasterIsland" ".python-environments/default/tcl/tcl8.5/tzdata/Cuba" ".python-environments/default/tcl/tcl8.5/tzdata/EET" ".python-environments/default/tcl/tcl8.5/tzdata/EST" ".python-environments/default/tcl/tcl8.5/tzdata/EST5EDT" ".python-environments/default/tcl/tcl8.5/tzdata/Egypt" ".python-environments/default/tcl/tcl8.5/tzdata/Eire" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+0" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+1" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+10" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+11" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+12" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+2" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+3" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+4" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+5" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+6" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+7" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+8" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT+9" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-0" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-1" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-10" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-11" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-12" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-13" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-14" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-2" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-3" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-4" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-5" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-6" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-7" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-8" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT-9" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/GMT0" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/Greenwich" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/UCT" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/UTC" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/Universal" ".python-environments/default/tcl/tcl8.5/tzdata/Etc/Zulu" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Amsterdam" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Andorra" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Athens" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Belfast" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Belgrade" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Berlin" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Bratislava" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Brussels" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Bucharest" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Budapest" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Busingen" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Chisinau" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Copenhagen" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Dublin" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Gibraltar" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Guernsey" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Helsinki" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Isle_of_Man" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Istanbul" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Jersey" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Kaliningrad" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Kiev" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Lisbon" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Ljubljana" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/London" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Luxembourg" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Madrid" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Malta" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Mariehamn" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Minsk" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Monaco" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Moscow" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Nicosia" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Oslo" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Paris" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Podgorica" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Prague" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Riga" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Rome" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Samara" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/San_Marino" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Sarajevo" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Simferopol" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Skopje" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Sofia" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Stockholm" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Tallinn" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Tirane" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Tiraspol" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Uzhgorod" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Vaduz" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Vatican" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Vienna" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Vilnius" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Volgograd" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Warsaw" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Zagreb" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Zaporozhye" ".python-environments/default/tcl/tcl8.5/tzdata/Europe/Zurich" ".python-environments/default/tcl/tcl8.5/tzdata/GB" ".python-environments/default/tcl/tcl8.5/tzdata/GB-Eire" ".python-environments/default/tcl/tcl8.5/tzdata/GMT" ".python-environments/default/tcl/tcl8.5/tzdata/GMT+0" ".python-environments/default/tcl/tcl8.5/tzdata/GMT-0" ".python-environments/default/tcl/tcl8.5/tzdata/GMT0" ".python-environments/default/tcl/tcl8.5/tzdata/Greenwich" ".python-environments/default/tcl/tcl8.5/tzdata/HST" ".python-environments/default/tcl/tcl8.5/tzdata/Hongkong" ".python-environments/default/tcl/tcl8.5/tzdata/Iceland" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Antananarivo" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Chagos" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Christmas" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Cocos" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Comoro" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Kerguelen" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Mahe" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Maldives" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Mauritius" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Mayotte" ".python-environments/default/tcl/tcl8.5/tzdata/Indian/Reunion" ".python-environments/default/tcl/tcl8.5/tzdata/Iran" ".python-environments/default/tcl/tcl8.5/tzdata/Israel" ".python-environments/default/tcl/tcl8.5/tzdata/Jamaica" ".python-environments/default/tcl/tcl8.5/tzdata/Japan" ".python-environments/default/tcl/tcl8.5/tzdata/Kwajalein" ".python-environments/default/tcl/tcl8.5/tzdata/Libya" ".python-environments/default/tcl/tcl8.5/tzdata/MET" ".python-environments/default/tcl/tcl8.5/tzdata/MST" ".python-environments/default/tcl/tcl8.5/tzdata/MST7MDT" ".python-environments/default/tcl/tcl8.5/tzdata/Mexico/BajaNorte" ".python-environments/default/tcl/tcl8.5/tzdata/Mexico/BajaSur" ".python-environments/default/tcl/tcl8.5/tzdata/Mexico/General" ".python-environments/default/tcl/tcl8.5/tzdata/NZ" ".python-environments/default/tcl/tcl8.5/tzdata/NZ-CHAT" ".python-environments/default/tcl/tcl8.5/tzdata/Navajo" ".python-environments/default/tcl/tcl8.5/tzdata/PRC" ".python-environments/default/tcl/tcl8.5/tzdata/PST8PDT" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Apia" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Auckland" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Chatham" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Chuuk" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Easter" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Efate" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Enderbury" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Fakaofo" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Fiji" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Funafuti" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Galapagos" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Gambier" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Guadalcanal" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Guam" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Honolulu" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Johnston" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Kiritimati" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Kosrae" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Kwajalein" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Majuro" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Marquesas" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Midway" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Nauru" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Niue" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Norfolk" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Noumea" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Pago_Pago" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Palau" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Pitcairn" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Pohnpei" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Ponape" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Port_Moresby" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Rarotonga" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Saipan" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Samoa" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Tahiti" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Tarawa" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Tongatapu" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Truk" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Wake" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Wallis" ".python-environments/default/tcl/tcl8.5/tzdata/Pacific/Yap" ".python-environments/default/tcl/tcl8.5/tzdata/Poland" ".python-environments/default/tcl/tcl8.5/tzdata/Portugal" ".python-environments/default/tcl/tcl8.5/tzdata/ROC" ".python-environments/default/tcl/tcl8.5/tzdata/ROK" ".python-environments/default/tcl/tcl8.5/tzdata/Singapore" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/AST4" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/AST4ADT" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/CST6" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/CST6CDT" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/EST5" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/EST5EDT" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/HST10" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/MST7" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/MST7MDT" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/PST8" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/PST8PDT" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/YST9" ".python-environments/default/tcl/tcl8.5/tzdata/SystemV/YST9YDT" ".python-environments/default/tcl/tcl8.5/tzdata/Turkey" ".python-environments/default/tcl/tcl8.5/tzdata/UCT" ".python-environments/default/tcl/tcl8.5/tzdata/US/Alaska" ".python-environments/default/tcl/tcl8.5/tzdata/US/Aleutian" ".python-environments/default/tcl/tcl8.5/tzdata/US/Arizona" ".python-environments/default/tcl/tcl8.5/tzdata/US/Central" ".python-environments/default/tcl/tcl8.5/tzdata/US/East-Indiana" ".python-environments/default/tcl/tcl8.5/tzdata/US/Eastern" ".python-environments/default/tcl/tcl8.5/tzdata/US/Hawaii" ".python-environments/default/tcl/tcl8.5/tzdata/US/Indiana-Starke" ".python-environments/default/tcl/tcl8.5/tzdata/US/Michigan" ".python-environments/default/tcl/tcl8.5/tzdata/US/Mountain" ".python-environments/default/tcl/tcl8.5/tzdata/US/Pacific" ".python-environments/default/tcl/tcl8.5/tzdata/US/Pacific-New" ".python-environments/default/tcl/tcl8.5/tzdata/US/Samoa" ".python-environments/default/tcl/tcl8.5/tzdata/UTC" ".python-environments/default/tcl/tcl8.5/tzdata/Universal" ".python-environments/default/tcl/tcl8.5/tzdata/W-SU" ".python-environments/default/tcl/tcl8.5/tzdata/WET" ".python-environments/default/tcl/tcl8.5/tzdata/Zulu" ".python-environments/default/tcl/tcl8.5/word.tcl" ".python-environments/default/tcl/tk8.5/bgerror.tcl" ".python-environments/default/tcl/tk8.5/button.tcl" ".python-environments/default/tcl/tk8.5/choosedir.tcl" ".python-environments/default/tcl/tk8.5/clrpick.tcl" ".python-environments/default/tcl/tk8.5/comdlg.tcl" ".python-environments/default/tcl/tk8.5/console.tcl" ".python-environments/default/tcl/tk8.5/demos/README" ".python-environments/default/tcl/tk8.5/demos/anilabel.tcl" ".python-environments/default/tcl/tk8.5/demos/aniwave.tcl" ".python-environments/default/tcl/tk8.5/demos/arrow.tcl" ".python-environments/default/tcl/tk8.5/demos/bind.tcl" ".python-environments/default/tcl/tk8.5/demos/bitmap.tcl" ".python-environments/default/tcl/tk8.5/demos/browse" ".python-environments/default/tcl/tk8.5/demos/button.tcl" ".python-environments/default/tcl/tk8.5/demos/check.tcl" ".python-environments/default/tcl/tk8.5/demos/clrpick.tcl" ".python-environments/default/tcl/tk8.5/demos/colors.tcl" ".python-environments/default/tcl/tk8.5/demos/combo.tcl" ".python-environments/default/tcl/tk8.5/demos/cscroll.tcl" ".python-environments/default/tcl/tk8.5/demos/ctext.tcl" ".python-environments/default/tcl/tk8.5/demos/dialog1.tcl" ".python-environments/default/tcl/tk8.5/demos/dialog2.tcl" ".python-environments/default/tcl/tk8.5/demos/en.msg" ".python-environments/default/tcl/tk8.5/demos/entry1.tcl" ".python-environments/default/tcl/tk8.5/demos/entry2.tcl" ".python-environments/default/tcl/tk8.5/demos/entry3.tcl" ".python-environments/default/tcl/tk8.5/demos/filebox.tcl" ".python-environments/default/tcl/tk8.5/demos/floor.tcl" ".python-environments/default/tcl/tk8.5/demos/form.tcl" ".python-environments/default/tcl/tk8.5/demos/goldberg.tcl" ".python-environments/default/tcl/tk8.5/demos/hello" ".python-environments/default/tcl/tk8.5/demos/hscale.tcl" ".python-environments/default/tcl/tk8.5/demos/icon.tcl" ".python-environments/default/tcl/tk8.5/demos/image1.tcl" ".python-environments/default/tcl/tk8.5/demos/image2.tcl" ".python-environments/default/tcl/tk8.5/demos/images/earth.gif" ".python-environments/default/tcl/tk8.5/demos/images/earthris.gif" ".python-environments/default/tcl/tk8.5/demos/images/face.xbm" ".python-environments/default/tcl/tk8.5/demos/images/flagdown.xbm" ".python-environments/default/tcl/tk8.5/demos/images/flagup.xbm" ".python-environments/default/tcl/tk8.5/demos/images/gray25.xbm" ".python-environments/default/tcl/tk8.5/demos/images/letters.xbm" ".python-environments/default/tcl/tk8.5/demos/images/noletter.xbm" ".python-environments/default/tcl/tk8.5/demos/images/pattern.xbm" ".python-environments/default/tcl/tk8.5/demos/images/tcllogo.gif" ".python-environments/default/tcl/tk8.5/demos/images/teapot.ppm" ".python-environments/default/tcl/tk8.5/demos/items.tcl" ".python-environments/default/tcl/tk8.5/demos/ixset" ".python-environments/default/tcl/tk8.5/demos/knightstour.tcl" ".python-environments/default/tcl/tk8.5/demos/label.tcl" ".python-environments/default/tcl/tk8.5/demos/labelframe.tcl" ".python-environments/default/tcl/tk8.5/demos/license.terms" ".python-environments/default/tcl/tk8.5/demos/mclist.tcl" ".python-environments/default/tcl/tk8.5/demos/menu.tcl" ".python-environments/default/tcl/tk8.5/demos/menubu.tcl" ".python-environments/default/tcl/tk8.5/demos/msgbox.tcl" ".python-environments/default/tcl/tk8.5/demos/nl.msg" ".python-environments/default/tcl/tk8.5/demos/paned1.tcl" ".python-environments/default/tcl/tk8.5/demos/paned2.tcl" ".python-environments/default/tcl/tk8.5/demos/pendulum.tcl" ".python-environments/default/tcl/tk8.5/demos/plot.tcl" ".python-environments/default/tcl/tk8.5/demos/puzzle.tcl" ".python-environments/default/tcl/tk8.5/demos/radio.tcl" ".python-environments/default/tcl/tk8.5/demos/rmt" ".python-environments/default/tcl/tk8.5/demos/rolodex" ".python-environments/default/tcl/tk8.5/demos/ruler.tcl" ".python-environments/default/tcl/tk8.5/demos/sayings.tcl" ".python-environments/default/tcl/tk8.5/demos/search.tcl" ".python-environments/default/tcl/tk8.5/demos/spin.tcl" ".python-environments/default/tcl/tk8.5/demos/square" ".python-environments/default/tcl/tk8.5/demos/states.tcl" ".python-environments/default/tcl/tk8.5/demos/style.tcl" ".python-environments/default/tcl/tk8.5/demos/tclIndex" ".python-environments/default/tcl/tk8.5/demos/tcolor" ".python-environments/default/tcl/tk8.5/demos/text.tcl" ".python-environments/default/tcl/tk8.5/demos/textpeer.tcl" ".python-environments/default/tcl/tk8.5/demos/timer" ".python-environments/default/tcl/tk8.5/demos/toolbar.tcl" ".python-environments/default/tcl/tk8.5/demos/tree.tcl" ".python-environments/default/tcl/tk8.5/demos/ttkbut.tcl" ".python-environments/default/tcl/tk8.5/demos/ttkmenu.tcl" ".python-environments/default/tcl/tk8.5/demos/ttknote.tcl" ".python-environments/default/tcl/tk8.5/demos/ttkpane.tcl" ".python-environments/default/tcl/tk8.5/demos/ttkprogress.tcl" ".python-environments/default/tcl/tk8.5/demos/ttkscale.tcl" ".python-environments/default/tcl/tk8.5/demos/twind.tcl" ".python-environments/default/tcl/tk8.5/demos/unicodeout.tcl" ".python-environments/default/tcl/tk8.5/demos/vscale.tcl" ".python-environments/default/tcl/tk8.5/demos/widget" ".python-environments/default/tcl/tk8.5/dialog.tcl" ".python-environments/default/tcl/tk8.5/entry.tcl" ".python-environments/default/tcl/tk8.5/focus.tcl" ".python-environments/default/tcl/tk8.5/images/README" ".python-environments/default/tcl/tk8.5/images/logo.eps" ".python-environments/default/tcl/tk8.5/images/logo100.gif" ".python-environments/default/tcl/tk8.5/images/logo64.gif" ".python-environments/default/tcl/tk8.5/images/logoLarge.gif" ".python-environments/default/tcl/tk8.5/images/logoMed.gif" ".python-environments/default/tcl/tk8.5/images/pwrdLogo.eps" ".python-environments/default/tcl/tk8.5/images/pwrdLogo100.gif" ".python-environments/default/tcl/tk8.5/images/pwrdLogo150.gif" ".python-environments/default/tcl/tk8.5/images/pwrdLogo175.gif" ".python-environments/default/tcl/tk8.5/images/pwrdLogo200.gif" ".python-environments/default/tcl/tk8.5/images/pwrdLogo75.gif" ".python-environments/default/tcl/tk8.5/images/tai-ku.gif" ".python-environments/default/tcl/tk8.5/license.terms" ".python-environments/default/tcl/tk8.5/listbox.tcl" ".python-environments/default/tcl/tk8.5/menu.tcl" ".python-environments/default/tcl/tk8.5/mkpsenc.tcl" ".python-environments/default/tcl/tk8.5/msgbox.tcl" ".python-environments/default/tcl/tk8.5/msgs/cs.msg" ".python-environments/default/tcl/tk8.5/msgs/da.msg" ".python-environments/default/tcl/tk8.5/msgs/de.msg" ".python-environments/default/tcl/tk8.5/msgs/el.msg" ".python-environments/default/tcl/tk8.5/msgs/en.msg" ".python-environments/default/tcl/tk8.5/msgs/en_gb.msg" ".python-environments/default/tcl/tk8.5/msgs/eo.msg" ".python-environments/default/tcl/tk8.5/msgs/es.msg" ".python-environments/default/tcl/tk8.5/msgs/fr.msg" ".python-environments/default/tcl/tk8.5/msgs/hu.msg" ".python-environments/default/tcl/tk8.5/msgs/it.msg" ".python-environments/default/tcl/tk8.5/msgs/nl.msg" ".python-environments/default/tcl/tk8.5/msgs/pl.msg" ".python-environments/default/tcl/tk8.5/msgs/pt.msg" ".python-environments/default/tcl/tk8.5/msgs/ru.msg" ".python-environments/default/tcl/tk8.5/msgs/sv.msg" ".python-environments/default/tcl/tk8.5/obsolete.tcl" ".python-environments/default/tcl/tk8.5/optMenu.tcl" ".python-environments/default/tcl/tk8.5/palette.tcl" ".python-environments/default/tcl/tk8.5/panedwindow.tcl" ".python-environments/default/tcl/tk8.5/pkgIndex.tcl" ".python-environments/default/tcl/tk8.5/safetk.tcl" ".python-environments/default/tcl/tk8.5/scale.tcl" ".python-environments/default/tcl/tk8.5/scrlbar.tcl" ".python-environments/default/tcl/tk8.5/spinbox.tcl" ".python-environments/default/tcl/tk8.5/tclIndex" ".python-environments/default/tcl/tk8.5/tearoff.tcl" ".python-environments/default/tcl/tk8.5/text.tcl" ".python-environments/default/tcl/tk8.5/tk.tcl" ".python-environments/default/tcl/tk8.5/tkfbox.tcl" ".python-environments/default/tcl/tk8.5/ttk/altTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/aquaTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/button.tcl" ".python-environments/default/tcl/tk8.5/ttk/clamTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/classicTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/combobox.tcl" ".python-environments/default/tcl/tk8.5/ttk/cursors.tcl" ".python-environments/default/tcl/tk8.5/ttk/defaults.tcl" ".python-environments/default/tcl/tk8.5/ttk/entry.tcl" ".python-environments/default/tcl/tk8.5/ttk/fonts.tcl" ".python-environments/default/tcl/tk8.5/ttk/menubutton.tcl" ".python-environments/default/tcl/tk8.5/ttk/notebook.tcl" ".python-environments/default/tcl/tk8.5/ttk/panedwindow.tcl" ".python-environments/default/tcl/tk8.5/ttk/progress.tcl" ".python-environments/default/tcl/tk8.5/ttk/scale.tcl" ".python-environments/default/tcl/tk8.5/ttk/scrollbar.tcl" ".python-environments/default/tcl/tk8.5/ttk/sizegrip.tcl" ".python-environments/default/tcl/tk8.5/ttk/spinbox.tcl" ".python-environments/default/tcl/tk8.5/ttk/treeview.tcl" ".python-environments/default/tcl/tk8.5/ttk/ttk.tcl" ".python-environments/default/tcl/tk8.5/ttk/utils.tcl" ".python-environments/default/tcl/tk8.5/ttk/vistaTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/winTheme.tcl" ".python-environments/default/tcl/tk8.5/ttk/xpTheme.tcl" ".python-environments/default/tcl/tk8.5/unsupported.tcl" ".python-environments/default/tcl/tk8.5/xmfbox.tcl" ".recentf" ".smex-items" "CalendarDairy/diary.org" "GTD/.notes.org" "GTD/Dissertation.org" "GTD/bakupJournal/20171007" "GTD/bakupJournal/20171008" "GTD/bakupJournal/20171009" "GTD/bakupJournal/20171010" "GTD/bakupJournal/20171011" "GTD/bakupJournal/20171012" "GTD/bakupJournal/20171013" "GTD/bakupJournal/20171017" "GTD/bakupJournal/20171019" "GTD/bakupJournal/20171021" "GTD/bakupJournal/20171022" "GTD/bakupJournal/20171023" "GTD/bakupJournal/20171025" "GTD/bakupJournal/20171026" "GTD/bakupJournal/20171027" "GTD/bakupJournal/20171028" "GTD/bakupJournal/20171030" "GTD/bakupJournal/20171031" "GTD/bakupJournal/20171101" "GTD/bakupJournal/20171103" "GTD/bakupJournal/20171125" "GTD/clojureBackup.org" "GTD/current.pdf" "GTD/email.org" "GTD/hello.org" "GTD/hello.org.gpg" "GTD/hello.org.pdf.pdf" "GTD/index.org" "GTD/myPlan/2017.09.13.muse" "GTD/orgBoss/Book/book.html" "GTD/orgBoss/Book/book.org" "GTD/orgBoss/Clipboard/clipboard.org" "GTD/orgBoss/Clipboard/clojureLearn.org" "GTD/orgBoss/DailyReview/daily.org" "GTD/orgBoss/Film/film.org" "GTD/orgBoss/Financial/finances.org" "GTD/orgBoss/Habit/habits.org" "GTD/orgBoss/IDEA/idea.org" "GTD/orgBoss/Journal/2017100011" "GTD/orgBoss/Journal/20180129" "GTD/orgBoss/Journal/20180130" "GTD/orgBoss/Journal/20180131" "GTD/orgBoss/Journal/20180201" "GTD/orgBoss/Journal/20180202" "GTD/orgBoss/Journal/20180203" "GTD/orgBoss/Journal/20180204" "GTD/orgBoss/Journal/20180205" "GTD/orgBoss/Journal/20180206" "GTD/orgBoss/Journal/20180207" "GTD/orgBoss/Journal/20180208" "GTD/orgBoss/Journal/20180209" "GTD/orgBoss/Journal/20180213" "GTD/orgBoss/Journal/20180214" "GTD/orgBoss/Journal/20180215" "GTD/orgBoss/Journal/20180220" "GTD/orgBoss/Journal/20180222" "GTD/orgBoss/Journal/20180225" "GTD/orgBoss/Journal/20180226" "GTD/orgBoss/Journal/20180228" "GTD/orgBoss/Journal/20180303" "GTD/orgBoss/Journal/20180304" "GTD/orgBoss/Journal/20180306" "GTD/orgBoss/Journal/20180307" "GTD/orgBoss/Journal/20180308" "GTD/orgBoss/Journal/20180311" "GTD/orgBoss/Journal/20180313" "GTD/orgBoss/Journal/20180315" "GTD/orgBoss/Journal/20180317" "GTD/orgBoss/Journal/20180318" "GTD/orgBoss/Journal/20180320" "GTD/orgBoss/Journal/20180401" "GTD/orgBoss/Journal/20180402" "GTD/orgBoss/Journal/20180424" "GTD/orgBoss/Journal/20180425" "GTD/orgBoss/Journal/20180426" "GTD/orgBoss/Journal/20180427" "GTD/orgBoss/Journal/20180501" "GTD/orgBoss/Journal/journal-XYZ.org" "GTD/orgBoss/Journal/journal-dailies-end.org" "GTD/orgBoss/Journal/journal-dailies.org" "GTD/orgBoss/Journal/journal-mon.org" "GTD/orgBoss/Journal/journal.org" "GTD/orgBoss/Journal/summaryMonth.pl" "GTD/orgBoss/Note/notes.org" "GTD/orgBoss/Note/notes.org_archive" "GTD/orgBoss/Private/privnotes.html" "GTD/orgBoss/Private/privnotes.org" "GTD/orgBoss/Site/www.site.org" "GTD/orgBoss/Someday/someday.org" "GTD/orgBoss/Vocab/vocab.org" "GTD/orgBoss/hello.org" "GTD/orgBoss/hello.rs" "GTD/orgBoss/newgtd.html" "GTD/orgBoss/newgtd.org" "GTD/orgBoss/newgtd.org_archive" "GTD/orgBoss/writing.html" "GTD/orgBoss/writing.org" "GTD/orgTemplate/.book_template.txt" "GTD/orgTemplate/.daily_review.txt" "GTD/orgTemplate/.film_template.txt" "GTD/package/muse-3.20.tar.gz" "GTD/package/planner-3.42.tar.gz" "GTD/package/remember-2.0.tar.gz" "GTD/phd1.org" "GTD/phd1.org.pgp" "GTD/presentation.org" "GTD/reveal.js/.git/HEAD" "GTD/reveal.js/.git/config" "GTD/reveal.js/.git/description" "GTD/reveal.js/.git/hooks/applypatch-msg.sample" "GTD/reveal.js/.git/hooks/commit-msg.sample" "GTD/reveal.js/.git/hooks/fsmonitor-watchman.sample" "GTD/reveal.js/.git/hooks/post-update.sample" "GTD/reveal.js/.git/hooks/pre-applypatch.sample" "GTD/reveal.js/.git/hooks/pre-commit.sample" "GTD/reveal.js/.git/hooks/pre-push.sample" "GTD/reveal.js/.git/hooks/pre-rebase.sample" "GTD/reveal.js/.git/hooks/pre-receive.sample" "GTD/reveal.js/.git/hooks/prepare-commit-msg.sample" "GTD/reveal.js/.git/hooks/update.sample" "GTD/reveal.js/.git/index" "GTD/reveal.js/.git/info/exclude" "GTD/reveal.js/.git/logs/HEAD" "GTD/reveal.js/.git/logs/refs/heads/master" "GTD/reveal.js/.git/logs/refs/remotes/origin/HEAD" "GTD/reveal.js/.git/objects/pack/pack-a47f2677e274a688ee6d6c3c3d1fa10ce8ca5ac4.idx" "GTD/reveal.js/.git/objects/pack/pack-a47f2677e274a688ee6d6c3c3d1fa10ce8ca5ac4.pack" "GTD/reveal.js/.git/packed-refs" "GTD/reveal.js/.git/refs/heads/master" "GTD/reveal.js/.git/refs/remotes/origin/HEAD" "GTD/reveal.js/.gitignore" "GTD/reveal.js/.travis.yml" "GTD/reveal.js/CONTRIBUTING.md" "GTD/reveal.js/Gruntfile.js" "GTD/reveal.js/LICENSE" "GTD/reveal.js/README.md" "GTD/reveal.js/bower.json" "GTD/reveal.js/css/print/paper.css" "GTD/reveal.js/css/print/pdf.css" "GTD/reveal.js/css/reveal.css" "GTD/reveal.js/css/reveal.scss" "GTD/reveal.js/css/theme/README.md" "GTD/reveal.js/css/theme/beige.css" "GTD/reveal.js/css/theme/black.css" "GTD/reveal.js/css/theme/blood.css" "GTD/reveal.js/css/theme/league.css" "GTD/reveal.js/css/theme/moon.css" "GTD/reveal.js/css/theme/night.css" "GTD/reveal.js/css/theme/serif.css" "GTD/reveal.js/css/theme/simple.css" "GTD/reveal.js/css/theme/sky.css" "GTD/reveal.js/css/theme/solarized.css" "GTD/reveal.js/css/theme/source/beige.scss" "GTD/reveal.js/css/theme/source/black.scss" "GTD/reveal.js/css/theme/source/blood.scss" "GTD/reveal.js/css/theme/source/league.scss" "GTD/reveal.js/css/theme/source/moon.scss" "GTD/reveal.js/css/theme/source/night.scss" "GTD/reveal.js/css/theme/source/serif.scss" "GTD/reveal.js/css/theme/source/simple.scss" "GTD/reveal.js/css/theme/source/sky.scss" "GTD/reveal.js/css/theme/source/solarized.scss" "GTD/reveal.js/css/theme/source/white.scss" "GTD/reveal.js/css/theme/template/mixins.scss" "GTD/reveal.js/css/theme/template/settings.scss" "GTD/reveal.js/css/theme/template/theme.scss" "GTD/reveal.js/css/theme/white.css" "GTD/reveal.js/demo.html" "GTD/reveal.js/index.html" "GTD/reveal.js/js/reveal.js" "GTD/reveal.js/lib/css/zenburn.css" "GTD/reveal.js/lib/font/league-gothic/LICENSE" "GTD/reveal.js/lib/font/league-gothic/league-gothic.css" "GTD/reveal.js/lib/font/league-gothic/league-gothic.eot" "GTD/reveal.js/lib/font/league-gothic/league-gothic.ttf" "GTD/reveal.js/lib/font/league-gothic/league-gothic.woff" "GTD/reveal.js/lib/font/source-sans-pro/LICENSE" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff" "GTD/reveal.js/lib/font/source-sans-pro/source-sans-pro.css" "GTD/reveal.js/lib/js/classList.js" "GTD/reveal.js/lib/js/head.min.js" "GTD/reveal.js/lib/js/html5shiv.js" "GTD/reveal.js/package.json" "GTD/reveal.js/plugin/highlight/highlight.js" "GTD/reveal.js/plugin/markdown/example.html" "GTD/reveal.js/plugin/markdown/example.md" "GTD/reveal.js/plugin/markdown/markdown.js" "GTD/reveal.js/plugin/markdown/marked.js" "GTD/reveal.js/plugin/math/math.js" "GTD/reveal.js/plugin/multiplex/client.js" "GTD/reveal.js/plugin/multiplex/index.js" "GTD/reveal.js/plugin/multiplex/master.js" "GTD/reveal.js/plugin/multiplex/package.json" "GTD/reveal.js/plugin/notes/notes.html" "GTD/reveal.js/plugin/notes/notes.js" "GTD/reveal.js/plugin/notes-server/client.js" "GTD/reveal.js/plugin/notes-server/index.js" "GTD/reveal.js/plugin/notes-server/notes.html" "GTD/reveal.js/plugin/print-pdf/print-pdf.js" "GTD/reveal.js/plugin/search/search.js" "GTD/reveal.js/plugin/zoom-js/zoom.js" "GTD/reveal.js/test/examples/assets/image1.png" "GTD/reveal.js/test/examples/assets/image2.png" "GTD/reveal.js/test/examples/barebones.html" "GTD/reveal.js/test/examples/embedded-media.html" "GTD/reveal.js/test/examples/math.html" "GTD/reveal.js/test/examples/slide-backgrounds.html" "GTD/reveal.js/test/examples/slide-transitions.html" "GTD/reveal.js/test/qunit-1.12.0.css" "GTD/reveal.js/test/qunit-1.12.0.js" "GTD/reveal.js/test/simple.md" "GTD/reveal.js/test/test-markdown-element-attributes.html" "GTD/reveal.js/test/test-markdown-element-attributes.js" "GTD/reveal.js/test/test-markdown-external.html" "GTD/reveal.js/test/test-markdown-external.js" "GTD/reveal.js/test/test-markdown-options.html" "GTD/reveal.js/test/test-markdown-options.js" "GTD/reveal.js/test/test-markdown-slide-attributes.html" "GTD/reveal.js/test/test-markdown-slide-attributes.js" "GTD/reveal.js/test/test-markdown.html" "GTD/reveal.js/test/test-markdown.js" "GTD/reveal.js/test/test-pdf.html" "GTD/reveal.js/test/test-pdf.js" "GTD/reveal.js/test/test.html" "GTD/reveal.js/test/test.js" "GTD/science.org" "GTD/test.org" "GTD/test.org.pdf" "GTD/testSlide.html" "GTD/testSlide.org" "GTD/thesis-proposal.org" "GTD/thesis-proposal.org.pdf" "README.md" "abbrev_defs" "ag.exe" "auto-save-list/.saves-10680-DESKTOP-YeZhao~" "auto-save-list/.saves-12500-DESKTOP-MKS6PSV~" "auto-save-list/.saves-12892-DESKTOP-MKS6PSV~" "auto-save-list/.saves-14120-DESKTOP-YeZhao~" "auto-save-list/.saves-14432-DESKTOP-YeZhao~" "auto-save-list/.saves-14772-DESKTOP-YeZhao~" "auto-save-list/.saves-180-DESKTOP-MKS6PSV~" "auto-save-list/.saves-18132-DESKTOP-YeZhao~" "auto-save-list/.saves-21756-DESKTOP-MKS6PSV~" "auto-save-list/.saves-24300-DESKTOP-MKS6PSV~" "auto-save-list/.saves-25568-DESKTOP-YeZhao~" "auto-save-list/.saves-25940-DESKTOP-MVNHR6D~" "auto-save-list/.saves-3052-DESKTOP-MKS6PSV~" "auto-save-list/.saves-3952-DESKTOP-YeZhao~" "auto-save-list/.saves-4268-DESKTOP-MKS6PSV~" "auto-save-list/.saves-4592-DESKTOP-YeZhao~" "auto-save-list/.saves-53320-DESKTOP-MVNHR6D~" "auto-save-list/.saves-5704-DESKTOP-YeZhao~" "auto-save-list/.saves-7100-DESKTOP-MVNHR6D~" "auto-save-list/.saves-7780-DESKTOP-MKS6PSV~" "auto-save-list/.saves-8056-DESKTOP-YeZhao~" "auto-save-list/.saves-8672-DESKTOP-YeZhao~" "backups/!drive_c!Users!YeZhao!.vim!colors!dracula.vim~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.authinfo.gpg~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!.git!COMMIT_EDITMSG~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!.gnus.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!.gnus~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!.recentf~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!Dissertation.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!email.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!hello.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!newgtd.html~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Clipboard!clojureLearn.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171007~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171008~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171009~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171011~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171012~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171013~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171017~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171022~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171025~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171027_archive~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171027~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171028~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171030~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20171103~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180129~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180130~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180131~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!orgBoss!hello.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!phd1.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!presentation.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!science.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!GTD!thesis-proposal.org~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!orca.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!setup-emms.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!setup-find-file-in-project.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!setup-python.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!setup-ruby-mode.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!customizations!setup-rust.el~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!emms!history~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.emacs.d!ido.last~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.gnus~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.module-starter!config~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.newsrc-dribble~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!.newsrc.eld~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!Mail!archive!sent!2017-10~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!Mail!mail!misc~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!Mail!mail!sent!mail~" "backups/!drive_c!Users!YeZhao!AppData!Roaming!Mail!mail!sent!news~" "backups/!drive_c!Users!YeZhao!Desktop!torque.cse~" "backups/!drive_c!Users!YeZhao!perl!testdbi.pl.bak~" "backups/!drive_c!Users!yzl!.ssh!id_rsa.pub~" "backups/!drive_c!Users!yzl!.vim!.git!COMMIT_EDITMSG~" "backups/!drive_c!Users!yzl!.vim!hello.md~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!.git!COMMIT_EDITMSG~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!.recentf~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!IDEA!idea.org~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180201~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180202~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180203~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180204_archive~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180204~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180205~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180206~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180207~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180208~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180222~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180225~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180226~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180304~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180306~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180307~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180308~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180315~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180317~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180318~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180401~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180402~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180424~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180425~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!Journal!20180427~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!orgBoss!newgtd.html~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!testSlide.html~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!GTD!testSlide.org~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!customizations!setupsbcl.el~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!elpa!dumb-jump-20180123.1100!dumb-jump.el~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!emms!history~" "backups/!drive_c!Users!yzl!AppData!Roaming!.emacs.d!ido.last~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!luceneTEst1!pom.xml~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!luceneTEst1!src!main!java!com!rupeng!lucenetest1!FenCiTest1.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!luceneTEst1!src!main!java!com!rupeng!lucenetest1!Main.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!luceneTEst1!src!main!java!com!rupeng!lucenetest1!SearchMain1.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!sousuo!src!main!java!com!rupeng!sousuo!ESSearchTest1.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!sousuo!src!main!java!com!rupeng!sousuo!ESTest1.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!sousuo!src!main!java!com!rupeng!sousuo!InsertAllVeryCdTest1.java~" "backups/!drive_c!Users!yzl!Desktop!javaImprove!dayCode2!sousuo!src!main!java!com!rupeng!sousuo!SearchSolrTest1.java~" "backups/!drive_c!Users!yzl!Desktop!paperForTorque!frameOfWall!.git!COMMIT_EDITMSG~" "backups/!drive_c!Users!yzl!Desktop!paperForTorque!frameOfWall!Abstract.org~" "backups/!drive_c!Users!yzl!Desktop!paperForTorque!frameOfWall!Intro.org~" "backups/!drive_c!Users!yzl!Desktop!paperForTorque!frameOfWall!paper.org~" "backups/!drive_d!Program Files (x86)!Vim!.vimrc~" "backups/!drive_d!cygwin!home!YeZhao!.todo.actions.d!mit.bak~" "backups/!drive_d!totalcmd!TOTALCMD.INC~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!Test10.fst~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Test10_AD.ipt~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-0.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-10.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-15.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-20.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-25.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-30.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-45.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-5.wnd~" "backups/!drive_e!BaiduYunDownload!FAST!CertTest!UAE_VI!Wind!Shr7-60.wnd~" "backups/!drive_e!a.java~" "backups/!drive_e!a.rb~" "backups/!drive_e!b.py~" "backups/!drive_e!c.py~" "backups/!drive_e!clojure-home!a.py~" "backups/!drive_e!clojure-home!a.rs~" "backups/!drive_e!clojure-home!emacs-25.3-x86_64!share!emacs!25.3!lisp!emacs-lisp!byte-run.el~" "backups/!drive_e!clojure-home!first-example!CHANGELOG.md~" "backups/!drive_e!clojure-home!first-example!project.clj~" "backups/!drive_e!clojure-home!first-example!src!first_example!a.md~" "backups/!drive_e!clojure-home!first-example!src!first_example!anotherNamespace.clj~" "backups/!drive_e!clojure-home!first-example!src!first_example!connectMysql.clj~" "backups/!drive_e!clojure-home!first-example!src!first_example!core.clj~" "backups/!drive_e!clojure-home!first-example!src!first_example!testHello.clj~" "backups/!drive_e!clojure-home!first-example!src!first_example!testmultiMethod.clj~" "backups/!drive_e!clojure-home!mysql!project.clj~" "backups/!drive_e!clojure-home!mysql!src!mysql!core.clj~" "backups/!drive_e!clojure-home!sotclojureAndelisp.clj~" "backups/!drive_e!clojure-home!test-exception!project.clj~" "backups/!drive_e!clojure-home!test-exception!src!test_exception!core.clj~" "backups/!drive_e!clojure-home!undead!project.clj~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!BeddoeSextractCnCt047.m~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!BeddoeSextractCnCt080.m~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!FASTextractCnCt047.m~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!FASTextractCnCt063.m~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!FASTextractCnCt080.m~" "backups/!drive_e!matlab-develop!pressureCode!com.gw.core!cfxPost!CFXGui!FastDifferentYawAngle!FASTextractCnCt095.m~" "backups/!drive_g!clojure-home!first-example!src!first_example!core.clj~" "backups/!drive_g!clojure-home!test-clojure1!src!test_clojure1!core.clj~" "backups/!drive_j!phaseVI3-11!PileProcess!cp.cse~" "bookmarks" "cider-history" "custom.el" "customizations/aspell.rar" "customizations/editing.el" "customizations/elisp-editing.el" "customizations/emacs-presentation-mode/.git/HEAD" "customizations/emacs-presentation-mode/.git/config" "customizations/emacs-presentation-mode/.git/description" "customizations/emacs-presentation-mode/.git/hooks/applypatch-msg.sample" "customizations/emacs-presentation-mode/.git/hooks/commit-msg.sample" "customizations/emacs-presentation-mode/.git/hooks/fsmonitor-watchman.sample" "customizations/emacs-presentation-mode/.git/hooks/post-update.sample" "customizations/emacs-presentation-mode/.git/hooks/pre-applypatch.sample" "customizations/emacs-presentation-mode/.git/hooks/pre-commit.sample" "customizations/emacs-presentation-mode/.git/hooks/pre-push.sample" "customizations/emacs-presentation-mode/.git/hooks/pre-rebase.sample" "customizations/emacs-presentation-mode/.git/hooks/pre-receive.sample" "customizations/emacs-presentation-mode/.git/hooks/prepare-commit-msg.sample" "customizations/emacs-presentation-mode/.git/hooks/update.sample" "customizations/emacs-presentation-mode/.git/index" "customizations/emacs-presentation-mode/.git/info/exclude" "customizations/emacs-presentation-mode/.git/logs/HEAD" "customizations/emacs-presentation-mode/.git/logs/refs/heads/master" "customizations/emacs-presentation-mode/.git/logs/refs/remotes/origin/HEAD" "customizations/emacs-presentation-mode/.git/objects/01/4b8acf484520cd8038064762529e75ab1686e7" "customizations/emacs-presentation-mode/.git/objects/0d/950740f20d768903bb9952d53b279765f3c8e2" "customizations/emacs-presentation-mode/.git/objects/10/16fa3285c62286afb2272778890935f560e328" "customizations/emacs-presentation-mode/.git/objects/14/7acd719e5c369078bbab5bc1a3f996ab344b47" "customizations/emacs-presentation-mode/.git/objects/18/db317ea1c060801b8b552593ea5dae7d7e13bc" "customizations/emacs-presentation-mode/.git/objects/1c/58566bebaa6955fe8abcc6a0f4daffc459fde0" "customizations/emacs-presentation-mode/.git/objects/1c/67caf3ab160eb1dbf795ff3ae08903f3548728" "customizations/emacs-presentation-mode/.git/objects/29/8385c4ce21b0218d7887765a463a0f4c43245a" "customizations/emacs-presentation-mode/.git/objects/2e/9e5cd593b19fb8e24a68ca59f64de897676f20" "customizations/emacs-presentation-mode/.git/objects/33/6d435e50c51d3702b6b00fab1aaebd5c23b1d2" "customizations/emacs-presentation-mode/.git/objects/38/b239880e3444c79ffaefcbd63451d6394f155c" "customizations/emacs-presentation-mode/.git/objects/3e/f839940c659bfca896c96a70d6f9ad2f66ab91" "customizations/emacs-presentation-mode/.git/objects/43/9c12231a433b721a61f19fcd269aa1fa729aba" "customizations/emacs-presentation-mode/.git/objects/44/8b2d0d51e67718173ec4be090c445d1b4b2b57" "customizations/emacs-presentation-mode/.git/objects/47/c1384ac841a3ba6dda33945549b9fabafe9d33" "customizations/emacs-presentation-mode/.git/objects/4d/85e6984a97181cdf688569d9f2ebdacc2aa557" "customizations/emacs-presentation-mode/.git/objects/4f/d1981e8999f30fa24fbd4fed7fae7c0a5d9421" "customizations/emacs-presentation-mode/.git/objects/51/1478d738139c29879bf18fa99520f9f44e5421" "customizations/emacs-presentation-mode/.git/objects/54/3558b8d66a124765e3a7aba9115490305df10b" "customizations/emacs-presentation-mode/.git/objects/56/d1c2de4e3561192d4c9e270719a8c4314d1342" "customizations/emacs-presentation-mode/.git/objects/5f/8a44fccbfccadbaab9a57b6ef9f3486a13bd74" "customizations/emacs-presentation-mode/.git/objects/62/c82e62a25658be46876b9c5e6690162130ce94" "customizations/emacs-presentation-mode/.git/objects/6a/fd41276f8d097573300afa037dcc9affc906af" "customizations/emacs-presentation-mode/.git/objects/70/252838cdc7767c570ba8563d984db732a62cd9" "customizations/emacs-presentation-mode/.git/objects/70/40134b591ef964a2219768ca983d11fdc34e2d" "customizations/emacs-presentation-mode/.git/objects/74/3592c842da4cf83610c637f33dbef0fa2050e0" "customizations/emacs-presentation-mode/.git/objects/7d/575cd1433d2af84b1112e1575b2cd469e93d18" "customizations/emacs-presentation-mode/.git/objects/82/803a8b40236ee5b772918aafdd8e23d20a92e7" "customizations/emacs-presentation-mode/.git/objects/86/f231a90180f710d53eb5078e0d98b7d087ce7b" "customizations/emacs-presentation-mode/.git/objects/8b/0a445df3dd6b06b55aa04af5ba9475808dc72d" "customizations/emacs-presentation-mode/.git/objects/8b/f334628f5c510534ec08bf5f67ff0bfa2e0ec7" "customizations/emacs-presentation-mode/.git/objects/92/f9df73bfc7aa9aef54ed0f02755c8905c58e79" "customizations/emacs-presentation-mode/.git/objects/94/412b92ba9d6f65f8ffa6d3e15d90a690053ce6" "customizations/emacs-presentation-mode/.git/objects/a0/4fbd3dea30fe480165d7523b444099f92651c6" "customizations/emacs-presentation-mode/.git/objects/a7/61c82e8dae789fbaa0b5c6aa6726659fe2ed4a" "customizations/emacs-presentation-mode/.git/objects/af/cecc605d82fbde18e2ec11a13ca0914abd1a88" "customizations/emacs-presentation-mode/.git/objects/b1/948e6d8b37b6df9290d77d181e1b1d58dd33c0" "customizations/emacs-presentation-mode/.git/objects/b1/cb94120e745641b010d36dff2f5a932f592485" "customizations/emacs-presentation-mode/.git/objects/b7/eb44ad2e97a4871f00fbee66b226ac2d4f722d" "customizations/emacs-presentation-mode/.git/objects/be/688b9bbff7bfaaed7694c793647cbe7304a1dc" "customizations/emacs-presentation-mode/.git/objects/c2/f8306d7166afc3882faeb7f61e3140ff06cd58" "customizations/emacs-presentation-mode/.git/objects/d1/60f15ad55944d2785b20cbc750b85ef271b511" "customizations/emacs-presentation-mode/.git/objects/e5/299432382aae7f482e4d2ba9d9017558ec7f6e" "customizations/emacs-presentation-mode/.git/objects/e7/72915db21ed772db9b90dc6c6d21f2f8d1a0c7" "customizations/emacs-presentation-mode/.git/objects/e9/e402d05a8b6d9e1e7fe853503c92fea4cf65cb" "customizations/emacs-presentation-mode/.git/objects/ed/584b3946717425c2119d03693abe9c0b312f77" "customizations/emacs-presentation-mode/.git/objects/f0/f53447d1a60280c2ef682f72578d4c98ff7b07" "customizations/emacs-presentation-mode/.git/objects/f2/88702d2fa16d3cdf0035b15a9fcbc552cd88e7" "customizations/emacs-presentation-mode/.git/objects/f3/1b5dbaa37c5454919bd8d08eca88c8ae17075c" "customizations/emacs-presentation-mode/.git/objects/fd/f0be3051b6d1ad8bb3e135ddab8026068568c7" "customizations/emacs-presentation-mode/.git/packed-refs" "customizations/emacs-presentation-mode/.git/refs/heads/master" "customizations/emacs-presentation-mode/.git/refs/remotes/origin/HEAD" "customizations/emacs-presentation-mode/COPYING" "customizations/emacs-presentation-mode/README.org" "customizations/emacs-presentation-mode/emacs-presentation.gif" "customizations/emacs-presentation-mode/emacs-presentation.jpg" "customizations/emacs-presentation-mode/presentation.el" "customizations/find-file-in-project.el" "customizations/font-lock+.el" "customizations/fortran-editing.el" "customizations/fortran-index-args.el" "customizations/git-timemachine.el" "customizations/highlight-indentation.el" "customizations/img/ace.png" "customizations/img/baby-org-mode.png" "customizations/img/betterbullet.jpg" "customizations/img/calenar.jpg" "customizations/img/clock-in.png" "customizations/img/crypt.jpg" "customizations/img/dired.jpg" "customizations/img/dumb-diff.png" "customizations/img/f90mode.jpg" "customizations/img/git-gutter.png" "customizations/img/gnucrypt.png" "customizations/img/gnupg.jpg" "customizations/img/gpa.png" "customizations/img/holyshit.jpg" "customizations/img/map.jpg" "customizations/img/music.jpg" "customizations/img/new.jpg" "customizations/img/oo.jpg" "customizations/img/org-bullet.jpg" "customizations/img/projectile.jpg" "customizations/img/purple.jpg" "customizations/img/quicksort.png" "customizations/img/secret.png" "customizations/img/spacemacs.jpg" "customizations/magnars/quantified.el" "customizations/magnars/setup-dired.el" "customizations/magnars/setup-flycheck.el" "customizations/magnars/setup-html-mode.el" "customizations/magnars/setup-js2-mode.el" "customizations/magnars/setup-markdown-mode.el" "customizations/magnars/setup-yasnippet.el" "customizations/misc.el" "customizations/navigation.el" "customizations/orca.el" "customizations/perl-editing.el" "customizations/pip/pip.ini" "customizations/protocol.reg" "customizations/quicklisp.lisp" "customizations/ruby-end.el" "customizations/scheme-editing.el" "customizations/setup-clojure.el" "customizations/setup-emms.el" "customizations/setup-find-file-in-project.el" "customizations/setup-git.el" "customizations/setup-js.el" "customizations/setup-python.el" "customizations/setup-ruby-mode.el" "customizations/setup-rust.el" "customizations/setupsbcl.el" "customizations/shell-integration.el" "customizations/ui.el" "diary" "elpa/0blayout-readme.txt" "elpa/0xc-readme.txt" "elpa/4clojure-readme.txt" "elpa/a-readme.txt" "elpa/aa-edit-mode-readme.txt" "elpa/ac-anaconda-readme.txt" "elpa/archives/gnu/archive-contents" "elpa/archives/gnu/archive-contents.signed" "elpa/archives/marmalada/archive-contents" "elpa/archives/marmalade/archive-contents" "elpa/archives/melpa/archive-contents" "elpa/archives/melpa-stable/archive-contents" "elpa/archives/melpa-stable1/archive-contents" "elpa/archives/org/archive-contents" "elpa/archives/tromey/archive-contents" "elpa/cider-readme.txt" "elpa/cl-lib-0.6.1/cl-lib-autoloads.el" "elpa/cl-lib-0.6.1/cl-lib-pkg.el" "elpa/cl-lib-0.6.1/cl-lib.el" "elpa/cl-lib-0.6.1/cl-lib.elc" "elpa/cl-lib-0.6.1.signed" "elpa/company-readme.txt" "elpa/deferred-20170901.630/deferred-autoloads.el" "elpa/deferred-20170901.630/deferred-pkg.el" "elpa/deferred-20170901.630/deferred.el" "elpa/deferred-20170901.630/deferred.elc" "elpa/dired+-20170818.1411/dired+-autoloads.el" "elpa/dired+-20170818.1411/dired+-pkg.el" "elpa/dired+-20170818.1411/dired+.el" "elpa/dired+-20170818.1411/dired+.elc" "elpa/dired-details+-20170903.1237/dired-details+-autoloads.el" "elpa/dired-details+-20170903.1237/dired-details+-pkg.el" "elpa/dired-details+-20170903.1237/dired-details+.el" "elpa/dired-details+-20170903.1237/dired-details+.elc" "elpa/dired-details-20130824.458/dired-details-autoloads.el" "elpa/dired-details-20130824.458/dired-details-pkg.el" "elpa/dired-details-20130824.458/dired-details.el" "elpa/dired-details-20130824.458/dired-details.elc" "elpa/dired-hacks-utils-20160527.1436/dired-hacks-utils-autoloads.el" "elpa/dired-hacks-utils-20160527.1436/dired-hacks-utils-pkg.el" "elpa/dired-hacks-utils-20160527.1436/dired-hacks-utils.el" "elpa/dired-hacks-utils-20160527.1436/dired-hacks-utils.elc" "elpa/dired-icon-20170222.2126/dired-icon-autoloads.el" "elpa/dired-icon-20170222.2126/dired-icon-pkg.el" "elpa/dired-icon-20170222.2126/dired-icon.el" "elpa/dired-icon-20170222.2126/dired-icon.elc" "elpa/dired-icon-20170222.2126/get-icon-path-gtk3.py" "elpa/dired-icon-20170222.2126/get-icon-path-macos.m" "elpa/dired-narrow-20170309.329/dired-narrow-autoloads.el" "elpa/dired-narrow-20170309.329/dired-narrow-pkg.el" "elpa/dired-narrow-20170309.329/dired-narrow.el" "elpa/dired-narrow-20170309.329/dired-narrow.elc" "elpa/dired-rainbow-20171202.1448/dired-rainbow-autoloads.el" "elpa/dired-rainbow-20171202.1448/dired-rainbow-pkg.el" "elpa/dired-rainbow-20171202.1448/dired-rainbow.el" "elpa/dired-rainbow-20171202.1448/dired-rainbow.elc" "elpa/dired-subtree-20170910.1521/dired-subtree-autoloads.el" "elpa/dired-subtree-20170910.1521/dired-subtree-pkg.el" "elpa/dired-subtree-20170910.1521/dired-subtree.el" "elpa/dumb-diff-20171211.1322/dumb-diff-autoloads.el" "elpa/dumb-diff-20171211.1322/dumb-diff-pkg.el" "elpa/dumb-diff-20171211.1322/dumb-diff.el" "elpa/dumb-diff-20171211.1322/dumb-diff.elc" "elpa/epc-20140609.2234/epc-autoloads.el" "elpa/epc-20140609.2234/epc-pkg.el" "elpa/epc-20140609.2234/epc.el" "elpa/epc-20140609.2234/epcs.el" "elpa/epl-20180205.1249/epl-autoloads.el" "elpa/epl-20180205.1249/epl-pkg.el" "elpa/epl-20180205.1249/epl.el" "elpa/epl-20180205.1249/epl.elc" "elpa/epresent-20160410.1901/epresent-autoloads.el" "elpa/epresent-20160410.1901/epresent-pkg.el" "elpa/epresent-20160410.1901/epresent.el" "elpa/epresent-20160410.1901/epresent.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-autoloads.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-cider.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-cider.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-elm.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-erlang.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-geiser.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-hy.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-ielm.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-ielm.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-iex.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-javascript.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-lua.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-ocaml.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-pkg.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-prolog.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-prolog.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-python.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-python.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-racket.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-ruby.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-scala.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-scheme.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-scheme.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-shell.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-shell.elc" "elpa/eval-in-repl-20171122.543/eval-in-repl-slime.el" "elpa/eval-in-repl-20171122.543/eval-in-repl-sml.el" "elpa/eval-in-repl-20171122.543/eval-in-repl.el" "elpa/eval-in-repl-20171122.543/eval-in-repl.elc" "elpa/evil-surround-20180102.601/evil-surround-autoloads.el" "elpa/evil-surround-20180102.601/evil-surround-pkg.el" "elpa/evil-surround-20180102.601/evil-surround.el" "elpa/evil-surround-20180102.601/evil-surround.elc" "elpa/evil-visualstar-20160222.1648/evil-visualstar-autoloads.el" "elpa/evil-visualstar-20160222.1648/evil-visualstar-pkg.el" "elpa/evil-visualstar-20160222.1648/evil-visualstar.el" "elpa/evil-visualstar-20160222.1648/evil-visualstar.elc" "elpa/f-20180106.122/f-autoloads.el" "elpa/f-20180106.122/f-pkg.el" "elpa/f-20180106.122/f.el" "elpa/f-20180106.122/f.elc" "elpa/fortpy-20150715.1332/Makefile" "elpa/fortpy-20150715.1332/fortpy-autoloads.el" "elpa/fortpy-20150715.1332/fortpy-pkg.el" "elpa/fortpy-20150715.1332/fortpy.el" "elpa/fortpy-20150715.1332/fortpyepcserver.py" "elpa/fortpy-20150715.1332/setup.py" "elpa/fringe-current-line-20140110.2011/fringe-current-line-autoloads.el" "elpa/fringe-current-line-20140110.2011/fringe-current-line-pkg.el" "elpa/fringe-current-line-20140110.2011/fringe-current-line.el" "elpa/fringe-current-line-20140110.2011/fringe-current-line.elc" "elpa/git-gutter-20161105.656/git-gutter-autoloads.el" "elpa/git-gutter-20161105.656/git-gutter-pkg.el" "elpa/git-gutter-20161105.656/git-gutter.el" "elpa/git-gutter-20161105.656/git-gutter.elc" "elpa/gntp-20141024.1950/gntp-autoloads.el" "elpa/gntp-20141024.1950/gntp-pkg.el" "elpa/gntp-20141024.1950/gntp.el" "elpa/gntp-20141024.1950/gntp.elc" "elpa/gnupg/pubring.kbx" "elpa/gnupg/pubring.kbx.lock" "elpa/gnupg/pubring.kbx~" "elpa/gnupg/trustdb.gpg" "elpa/goto-chg-20180105.1033/goto-chg-autoloads.el" "elpa/goto-chg-20180105.1033/goto-chg-pkg.el" "elpa/goto-chg-20180105.1033/goto-chg.el" "elpa/goto-chg-20180105.1033/goto-chg.elc" "elpa/highlight-escape-sequences-20171117.437/highlight-escape-sequences-autoloads.el" "elpa/highlight-escape-sequences-20171117.437/highlight-escape-sequences-pkg.el" "elpa/highlight-escape-sequences-20171117.437/highlight-escape-sequences.el" "elpa/highlight-escape-sequences-20171117.437/highlight-escape-sequences.elc" "elpa/highlight-indentation-20171218.137/highlight-indentation-autoloads.el" "elpa/highlight-indentation-20171218.137/highlight-indentation-pkg.el" "elpa/highlight-indentation-20171218.137/highlight-indentation.el" "elpa/highlight-indentation-20171218.137/highlight-indentation.elc" "elpa/ido-ubiquitous-20180216.949/ido-ubiquitous-autoloads.el" "elpa/ido-ubiquitous-20180216.949/ido-ubiquitous-pkg.el" "elpa/ido-ubiquitous-20180216.949/ido-ubiquitous.el" "elpa/ido-ubiquitous-20180216.949/ido-ubiquitous.elc" "elpa/image+-20150707.916/image+-autoloads.el" "elpa/image+-20150707.916/image+-pkg.el" "elpa/image+-20150707.916/image+.el" "elpa/image+-20150707.916/image+.elc" "elpa/ivy-dired-history-20170625.2256/ivy-dired-history-autoloads.el" "elpa/ivy-dired-history-20170625.2256/ivy-dired-history-pkg.el" "elpa/ivy-dired-history-20170625.2256/ivy-dired-history.el" "elpa/ivy-dired-history-20170625.2256/ivy-dired-history.elc" "elpa/iy-go-to-char-20141029.846/iy-go-to-char-autoloads.el" "elpa/iy-go-to-char-20141029.846/iy-go-to-char-pkg.el" "elpa/iy-go-to-char-20141029.846/iy-go-to-char.el" "elpa/iy-go-to-char-20141029.846/iy-go-to-char.elc" "elpa/key-chord-20160227.438/key-chord-autoloads.el" "elpa/key-chord-20160227.438/key-chord-pkg.el" "elpa/key-chord-20160227.438/key-chord.el" "elpa/key-chord-20160227.438/key-chord.elc" "elpa/let-alist-1.0.5/let-alist-autoloads.el" "elpa/let-alist-1.0.5/let-alist-pkg.el" "elpa/let-alist-1.0.5/let-alist.el" "elpa/let-alist-1.0.5/let-alist.elc" "elpa/let-alist-1.0.5.signed" "elpa/log4e-20170401.604/log4e-autoloads.el" "elpa/log4e-20170401.604/log4e-pkg.el" "elpa/log4e-20170401.604/log4e.el" "elpa/log4e-20170401.604/log4e.elc" "elpa/markdown-mode+-20170320.1404/HTML as Markdown in Emacs.applescript" "elpa/markdown-mode+-20170320.1404/markdown-mode+-autoloads.el" "elpa/markdown-mode+-20170320.1404/markdown-mode+-pkg.el" "elpa/markdown-mode+-20170320.1404/markdown-mode+.el" "elpa/markdown-mode+-20170320.1404/markdown-mode+.elc" "elpa/matlab-mode-20180125.1010/cedet-matlab.el" "elpa/matlab-mode-20180125.1010/cedet-matlab.elc" "elpa/matlab-mode-20180125.1010/company-matlab-shell.el" "elpa/matlab-mode-20180125.1010/company-matlab-shell.elc" "elpa/matlab-mode-20180125.1010/dl_emacs_support.m" "elpa/matlab-mode-20180125.1010/linemark.el" "elpa/matlab-mode-20180125.1010/linemark.elc" "elpa/matlab-mode-20180125.1010/matlab-mode-autoloads.el" "elpa/matlab-mode-20180125.1010/matlab-mode-pkg.el" "elpa/matlab-mode-20180125.1010/matlab-publish.el" "elpa/matlab-mode-20180125.1010/matlab-publish.elc" "elpa/matlab-mode-20180125.1010/matlab.el" "elpa/matlab-mode-20180125.1010/matlab.elc" "elpa/matlab-mode-20180125.1010/mlint.el" "elpa/matlab-mode-20180125.1010/mlint.elc" "elpa/matlab-mode-20180125.1010/semantic-matlab.el" "elpa/matlab-mode-20180125.1010/semantic-matlab.elc" "elpa/matlab-mode-20180125.1010/semanticdb-matlab.el" "elpa/matlab-mode-20180125.1010/semanticdb-matlab.elc" "elpa/matlab-mode-20180125.1010/srecode-matlab.el" "elpa/matlab-mode-20180125.1010/srecode-matlab.elc" "elpa/matlab-mode-20180125.1010/templates/srecode-matlab.srt" "elpa/matlab-mode-20180125.1010/tlc.el" "elpa/matlab-mode-20180125.1010/tlc.elc" "elpa/matlab-mode-20180125.1010/toolbox/dbhotlink.m" "elpa/matlab-mode-20180125.1010/toolbox/emacsdocomplete.m" "elpa/matlab-mode-20180125.1010/toolbox/emacsinit.m" "elpa/matlab-mode-20180125.1010/toolbox/opentoline.m" "elpa/memoize-20170720.1802/memoize-autoloads.el" "elpa/memoize-20170720.1802/memoize-pkg.el" "elpa/memoize-20170720.1802/memoize.el" "elpa/memoize-20170720.1802/memoize.elc" "elpa/mo-git-blame-20160129.959/mo-git-blame-autoloads.el" "elpa/mo-git-blame-20160129.959/mo-git-blame-pkg.el" "elpa/mo-git-blame-20160129.959/mo-git-blame.el" "elpa/mo-git-blame-20160129.959/mo-git-blame.elc" "elpa/move-text-20170908.2030/move-text-autoloads.el" "elpa/move-text-20170908.2030/move-text-pkg.el" "elpa/move-text-20170908.2030/move-text.el" "elpa/move-text-20170908.2030/move-text.elc" "elpa/multiple-cursors-20180406.1350/mc-cycle-cursors.el" "elpa/multiple-cursors-20180406.1350/mc-cycle-cursors.elc" "elpa/multiple-cursors-20180406.1350/mc-edit-lines.el" "elpa/multiple-cursors-20180406.1350/mc-edit-lines.elc" "elpa/multiple-cursors-20180406.1350/mc-hide-unmatched-lines-mode.el" "elpa/multiple-cursors-20180406.1350/mc-hide-unmatched-lines-mode.elc" "elpa/multiple-cursors-20180406.1350/mc-mark-more.el" "elpa/multiple-cursors-20180406.1350/mc-mark-more.elc" "elpa/multiple-cursors-20180406.1350/mc-mark-pop.el" "elpa/multiple-cursors-20180406.1350/mc-mark-pop.elc" "elpa/multiple-cursors-20180406.1350/mc-separate-operations.el" "elpa/multiple-cursors-20180406.1350/mc-separate-operations.elc" "elpa/multiple-cursors-20180406.1350/multiple-cursors-autoloads.el" "elpa/multiple-cursors-20180406.1350/multiple-cursors-core.el" "elpa/multiple-cursors-20180406.1350/multiple-cursors-core.elc" "elpa/multiple-cursors-20180406.1350/multiple-cursors-pkg.el" "elpa/multiple-cursors-20180406.1350/multiple-cursors.el" "elpa/multiple-cursors-20180406.1350/multiple-cursors.elc" "elpa/multiple-cursors-20180406.1350/rectangular-region-mode.el" "elpa/multiple-cursors-20180406.1350/rectangular-region-mode.elc" "elpa/multiple-cursors-readme.txt" "elpa/nyan-mode-20170423.40/img/nyan-frame-1.xpm" "elpa/nyan-mode-20170423.40/img/nyan-frame-2.xpm" "elpa/nyan-mode-20170423.40/img/nyan-frame-3.xpm" "elpa/nyan-mode-20170423.40/img/nyan-frame-4.xpm" "elpa/nyan-mode-20170423.40/img/nyan-frame-5.xpm" "elpa/nyan-mode-20170423.40/img/nyan-frame-6.xpm" "elpa/nyan-mode-20170423.40/img/nyan.xpm" "elpa/nyan-mode-20170423.40/img/outerspace.xpm" "elpa/nyan-mode-20170423.40/img/rainbow.xpm" "elpa/nyan-mode-20170423.40/mus/nyanlooped.mp3" "elpa/nyan-mode-20170423.40/nyan-mode-autoloads.el" "elpa/nyan-mode-20170423.40/nyan-mode-pkg.el" "elpa/nyan-mode-20170423.40/nyan-mode.el" "elpa/nyan-mode-20170423.40/nyan-mode.elc" "elpa/org-20170925/COPYING" "elpa/org-20170925/README_ELPA" "elpa/org-20170925/dir" "elpa/org-20170925/etc/ORG-NEWS" "elpa/org-20170925/etc/styles/OrgOdtContentTemplate.xml" "elpa/org-20170925/etc/styles/OrgOdtStyles.xml" "elpa/org-20170925/etc/styles/README" "elpa/org-20170925/ob-C.el" "elpa/org-20170925/ob-C.elc" "elpa/org-20170925/ob-J.el" "elpa/org-20170925/ob-J.elc" "elpa/org-20170925/ob-R.el" "elpa/org-20170925/ob-R.elc" "elpa/org-20170925/ob-abc.el" "elpa/org-20170925/ob-abc.elc" "elpa/org-20170925/ob-asymptote.el" "elpa/org-20170925/ob-asymptote.elc" "elpa/org-20170925/ob-awk.el" "elpa/org-20170925/ob-awk.elc" "elpa/org-20170925/ob-calc.el" "elpa/org-20170925/ob-calc.elc" "elpa/org-20170925/ob-clojure.el" "elpa/org-20170925/ob-clojure.elc" "elpa/org-20170925/ob-comint.el" "elpa/org-20170925/ob-comint.elc" "elpa/org-20170925/ob-coq.el" "elpa/org-20170925/ob-coq.elc" "elpa/org-20170925/ob-core.el" "elpa/org-20170925/ob-core.elc" "elpa/org-20170925/ob-css.el" "elpa/org-20170925/ob-css.elc" "elpa/org-20170925/ob-ditaa.el" "elpa/org-20170925/ob-ditaa.elc" "elpa/org-20170925/ob-dot.el" "elpa/org-20170925/ob-dot.elc" "elpa/org-20170925/ob-ebnf.el" "elpa/org-20170925/ob-ebnf.elc" "elpa/org-20170925/ob-emacs-lisp.el" "elpa/org-20170925/ob-emacs-lisp.elc" "elpa/org-20170925/ob-eval.el" "elpa/org-20170925/ob-eval.elc" "elpa/org-20170925/ob-exp.el" "elpa/org-20170925/ob-exp.elc" "elpa/org-20170925/ob-forth.el" "elpa/org-20170925/ob-forth.elc" "elpa/org-20170925/ob-fortran.el" "elpa/org-20170925/ob-fortran.elc" "elpa/org-20170925/ob-gnuplot.el" "elpa/org-20170925/ob-gnuplot.elc" "elpa/org-20170925/ob-groovy.el" "elpa/org-20170925/ob-groovy.elc" "elpa/org-20170925/ob-haskell.el" "elpa/org-20170925/ob-haskell.elc" "elpa/org-20170925/ob-hledger.el" "elpa/org-20170925/ob-hledger.elc" "elpa/org-20170925/ob-io.el" "elpa/org-20170925/ob-io.elc" "elpa/org-20170925/ob-java.el" "elpa/org-20170925/ob-java.elc" "elpa/org-20170925/ob-js.el" "elpa/org-20170925/ob-js.elc" "elpa/org-20170925/ob-keys.el" "elpa/org-20170925/ob-keys.elc" "elpa/org-20170925/ob-latex.el" "elpa/org-20170925/ob-latex.elc" "elpa/org-20170925/ob-ledger.el" "elpa/org-20170925/ob-ledger.elc" "elpa/org-20170925/ob-lilypond.el" "elpa/org-20170925/ob-lilypond.elc" "elpa/org-20170925/ob-lisp.el" "elpa/org-20170925/ob-lisp.elc" "elpa/org-20170925/ob-lob.el" "elpa/org-20170925/ob-lob.elc" "elpa/org-20170925/ob-lua.el" "elpa/org-20170925/ob-lua.elc" "elpa/org-20170925/ob-makefile.el" "elpa/org-20170925/ob-makefile.elc" "elpa/org-20170925/ob-matlab.el" "elpa/org-20170925/ob-matlab.elc" "elpa/org-20170925/ob-maxima.el" "elpa/org-20170925/ob-maxima.elc" "elpa/org-20170925/ob-mscgen.el" "elpa/org-20170925/ob-mscgen.elc" "elpa/org-20170925/ob-ocaml.el" "elpa/org-20170925/ob-ocaml.elc" "elpa/org-20170925/ob-octave.el" "elpa/org-20170925/ob-octave.elc" "elpa/org-20170925/ob-org.el" "elpa/org-20170925/ob-org.elc" "elpa/org-20170925/ob-perl.el" "elpa/org-20170925/ob-perl.elc" "elpa/org-20170925/ob-picolisp.el" "elpa/org-20170925/ob-picolisp.elc" "elpa/org-20170925/ob-plantuml.el" "elpa/org-20170925/ob-plantuml.elc" "elpa/org-20170925/ob-processing.el" "elpa/org-20170925/ob-processing.elc" "elpa/org-20170925/ob-python.el" "elpa/org-20170925/ob-python.elc" "elpa/org-20170925/ob-ref.el" "elpa/org-20170925/ob-ref.elc" "elpa/org-20170925/ob-ruby.el" "elpa/org-20170925/ob-ruby.elc" "elpa/org-20170925/ob-sass.el" "elpa/org-20170925/ob-sass.elc" "elpa/org-20170925/ob-scheme.el" "elpa/org-20170925/ob-scheme.elc" "elpa/org-20170925/ob-screen.el" "elpa/org-20170925/ob-screen.elc" "elpa/org-20170925/ob-sed.el" "elpa/org-20170925/ob-sed.elc" "elpa/org-20170925/ob-shell.el" "elpa/org-20170925/ob-shell.elc" "elpa/org-20170925/ob-shen.el" "elpa/org-20170925/ob-shen.elc" "elpa/org-20170925/ob-sql.el" "elpa/org-20170925/ob-sql.elc" "elpa/org-20170925/ob-sqlite.el" "elpa/org-20170925/ob-sqlite.elc" "elpa/org-20170925/ob-stan.el" "elpa/org-20170925/ob-stan.elc" "elpa/org-20170925/ob-table.el" "elpa/org-20170925/ob-table.elc" "elpa/org-20170925/ob-tangle.el" "elpa/org-20170925/ob-tangle.elc" "elpa/org-20170925/ob-vala.el" "elpa/org-20170925/ob-vala.elc" "elpa/org-20170925/ob.el" "elpa/org-20170925/ob.elc" "elpa/org-20170925/org" "elpa/org-20170925/org-agenda.el" "elpa/org-20170925/org-agenda.elc" "elpa/org-20170925/org-archive.el" "elpa/org-20170925/org-archive.elc" "elpa/org-20170925/org-attach.el" "elpa/org-20170925/org-attach.elc" "elpa/org-20170925/org-autoloads.el" "elpa/org-20170925/org-bbdb.el" "elpa/org-20170925/org-bbdb.elc" "elpa/org-20170925/org-bibtex.el" "elpa/org-20170925/org-bibtex.elc" "elpa/org-20170925/org-capture.el" "elpa/org-20170925/org-capture.elc" "elpa/org-20170925/org-clock.el" "elpa/org-20170925/org-clock.elc" "elpa/org-20170925/org-colview.el" "elpa/org-20170925/org-colview.elc" "elpa/org-20170925/org-compat.el" "elpa/org-20170925/org-compat.elc" "elpa/org-20170925/org-crypt.el" "elpa/org-20170925/org-crypt.elc" "elpa/org-20170925/org-ctags.el" "elpa/org-20170925/org-ctags.elc" "elpa/org-20170925/org-datetree.el" "elpa/org-20170925/org-datetree.elc" "elpa/org-20170925/org-docview.el" "elpa/org-20170925/org-docview.elc" "elpa/org-20170925/org-duration.el" "elpa/org-20170925/org-duration.elc" "elpa/org-20170925/org-element.el" "elpa/org-20170925/org-element.elc" "elpa/org-20170925/org-entities.el" "elpa/org-20170925/org-entities.elc" "elpa/org-20170925/org-eshell.el" "elpa/org-20170925/org-eshell.elc" "elpa/org-20170925/org-eww.el" "elpa/org-20170925/org-eww.elc" "elpa/org-20170925/org-faces.el" "elpa/org-20170925/org-faces.elc" "elpa/org-20170925/org-feed.el" "elpa/org-20170925/org-feed.elc" "elpa/org-20170925/org-footnote.el" "elpa/org-20170925/org-footnote.elc" "elpa/org-20170925/org-gnus.el" "elpa/org-20170925/org-gnus.elc" "elpa/org-20170925/org-habit.el" "elpa/org-20170925/org-habit.elc" "elpa/org-20170925/org-id.el" "elpa/org-20170925/org-id.elc" "elpa/org-20170925/org-indent.el" "elpa/org-20170925/org-indent.elc" "elpa/org-20170925/org-info.el" "elpa/org-20170925/org-info.elc" "elpa/org-20170925/org-inlinetask.el" "elpa/org-20170925/org-inlinetask.elc" "elpa/org-20170925/org-install.el" "elpa/org-20170925/org-irc.el" "elpa/org-20170925/org-irc.elc" "elpa/org-20170925/org-lint.el" "elpa/org-20170925/org-lint.elc" "elpa/org-20170925/org-list.el" "elpa/org-20170925/org-list.elc" "elpa/org-20170925/org-loaddefs.el" "elpa/org-20170925/org-macro.el" "elpa/org-20170925/org-macro.elc" "elpa/org-20170925/org-macs.el" "elpa/org-20170925/org-macs.elc" "elpa/org-20170925/org-mhe.el" "elpa/org-20170925/org-mhe.elc" "elpa/org-20170925/org-mobile.el" "elpa/org-20170925/org-mobile.elc" "elpa/org-20170925/org-mouse.el" "elpa/org-20170925/org-mouse.elc" "elpa/org-20170925/org-pcomplete.el" "elpa/org-20170925/org-pcomplete.elc" "elpa/org-20170925/org-pkg.el" "elpa/org-20170925/org-pkg.elc" "elpa/org-20170925/org-plot.el" "elpa/org-20170925/org-plot.elc" "elpa/org-20170925/org-protocol.el" "elpa/org-20170925/org-protocol.elc" "elpa/org-20170925/org-rmail.el" "elpa/org-20170925/org-rmail.elc" "elpa/org-20170925/org-src.el" "elpa/org-20170925/org-src.elc" "elpa/org-20170925/org-table.el" "elpa/org-20170925/org-table.elc" "elpa/org-20170925/org-timer.el" "elpa/org-20170925/org-timer.elc" "elpa/org-20170925/org-version.el" "elpa/org-20170925/org-w3m.el" "elpa/org-20170925/org-w3m.elc" "elpa/org-20170925/org.el" "elpa/org-20170925/org.elc" "elpa/org-20170925/orgcard.pdf" "elpa/org-20170925/ox-ascii.el" "elpa/org-20170925/ox-ascii.elc" "elpa/org-20170925/ox-beamer.el" "elpa/org-20170925/ox-beamer.elc" "elpa/org-20170925/ox-html.el" "elpa/org-20170925/ox-html.elc" "elpa/org-20170925/ox-icalendar.el" "elpa/org-20170925/ox-icalendar.elc" "elpa/org-20170925/ox-latex.el" "elpa/org-20170925/ox-latex.elc" "elpa/org-20170925/ox-man.el" "elpa/org-20170925/ox-man.elc" "elpa/org-20170925/ox-md.el" "elpa/org-20170925/ox-md.elc" "elpa/org-20170925/ox-odt.el" "elpa/org-20170925/ox-odt.elc" "elpa/org-20170925/ox-org.el" "elpa/org-20170925/ox-org.elc" "elpa/org-20170925/ox-publish.el" "elpa/org-20170925/ox-publish.elc" "elpa/org-20170925/ox-texinfo.el" "elpa/org-20170925/ox-texinfo.elc" "elpa/org-20170925/ox.el" "elpa/org-20170925/ox.elc" "elpa/org-autolist-20170924.1201/org-autolist-autoloads.el" "elpa/org-autolist-20170924.1201/org-autolist-pkg.el" "elpa/org-autolist-20170924.1201/org-autolist.el" "elpa/org-autolist-20170924.1201/org-autolist.elc" "elpa/org-babel-eval-in-repl-20170511.514/eval-in-repl-ess.el" "elpa/org-babel-eval-in-repl-20170511.514/eval-in-repl-ess.elc" "elpa/org-babel-eval-in-repl-20170511.514/eval-in-repl-matlab.el" "elpa/org-babel-eval-in-repl-20170511.514/eval-in-repl-matlab.elc" "elpa/org-babel-eval-in-repl-20170511.514/org-babel-eval-in-repl-autoloads.el" "elpa/org-babel-eval-in-repl-20170511.514/org-babel-eval-in-repl-pkg.el" "elpa/org-babel-eval-in-repl-20170511.514/org-babel-eval-in-repl.el" "elpa/org-babel-eval-in-repl-20170511.514/org-babel-eval-in-repl.elc" "elpa/org-bookmark-heading-20170510.1008/org-bookmark-heading-autoloads.el" "elpa/org-bookmark-heading-20170510.1008/org-bookmark-heading-pkg.el" "elpa/org-bookmark-heading-20170510.1008/org-bookmark-heading.el" "elpa/org-bookmark-heading-20170510.1008/org-bookmark-heading.elc" "elpa/org-bullets-20171127.526/org-bullets-autoloads.el" "elpa/org-bullets-20171127.526/org-bullets-pkg.el" "elpa/org-bullets-20171127.526/org-bullets.el" "elpa/org-bullets-20171127.526/org-bullets.elc" "elpa/org-mind-map-20171206.645/org-mind-map-autoloads.el" "elpa/org-mind-map-20171206.645/org-mind-map-pkg.el" "elpa/org-mind-map-20171206.645/org-mind-map.el" "elpa/org-mind-map-20171206.645/org-mind-map.elc" "elpa/org-plus-contrib-20170911/COPYING" "elpa/org-plus-contrib-20170911/README_ELPA" "elpa/org-plus-contrib-20170911/dir" "elpa/org-plus-contrib-20170911/etc/ORG-NEWS" "elpa/org-plus-contrib-20170911/etc/styles/OrgOdtContentTemplate.xml" "elpa/org-plus-contrib-20170911/etc/styles/OrgOdtStyles.xml" "elpa/org-plus-contrib-20170911/etc/styles/README" "elpa/org-plus-contrib-20170911/hello.org" "elpa/org-plus-contrib-20170911/ob-C.el" "elpa/org-plus-contrib-20170911/ob-C.elc" "elpa/org-plus-contrib-20170911/ob-J.el" "elpa/org-plus-contrib-20170911/ob-J.elc" "elpa/org-plus-contrib-20170911/ob-R.el" "elpa/org-plus-contrib-20170911/ob-R.elc" "elpa/org-plus-contrib-20170911/ob-abc.el" "elpa/org-plus-contrib-20170911/ob-abc.elc" "elpa/org-plus-contrib-20170911/ob-asymptote.el" "elpa/org-plus-contrib-20170911/ob-asymptote.elc" "elpa/org-plus-contrib-20170911/ob-awk.el" "elpa/org-plus-contrib-20170911/ob-awk.elc" "elpa/org-plus-contrib-20170911/ob-calc.el" "elpa/org-plus-contrib-20170911/ob-calc.elc" "elpa/org-plus-contrib-20170911/ob-clojure.el" "elpa/org-plus-contrib-20170911/ob-clojure.elc" "elpa/org-plus-contrib-20170911/ob-comint.el" "elpa/org-plus-contrib-20170911/ob-comint.elc" "elpa/org-plus-contrib-20170911/ob-coq.el" "elpa/org-plus-contrib-20170911/ob-coq.elc" "elpa/org-plus-contrib-20170911/ob-core.el" "elpa/org-plus-contrib-20170911/ob-core.elc" "elpa/org-plus-contrib-20170911/ob-csharp.el" "elpa/org-plus-contrib-20170911/ob-csharp.elc" "elpa/org-plus-contrib-20170911/ob-css.el" "elpa/org-plus-contrib-20170911/ob-css.elc" "elpa/org-plus-contrib-20170911/ob-ditaa.el" "elpa/org-plus-contrib-20170911/ob-ditaa.elc" "elpa/org-plus-contrib-20170911/ob-dot.el" "elpa/org-plus-contrib-20170911/ob-dot.elc" "elpa/org-plus-contrib-20170911/ob-ebnf.el" "elpa/org-plus-contrib-20170911/ob-ebnf.elc" "elpa/org-plus-contrib-20170911/ob-emacs-lisp.el" "elpa/org-plus-contrib-20170911/ob-emacs-lisp.elc" "elpa/org-plus-contrib-20170911/ob-eukleides.el" "elpa/org-plus-contrib-20170911/ob-eukleides.elc" "elpa/org-plus-contrib-20170911/ob-eval.el" "elpa/org-plus-contrib-20170911/ob-eval.elc" "elpa/org-plus-contrib-20170911/ob-exp.el" "elpa/org-plus-contrib-20170911/ob-exp.elc" "elpa/org-plus-contrib-20170911/ob-fomus.el" "elpa/org-plus-contrib-20170911/ob-fomus.elc" "elpa/org-plus-contrib-20170911/ob-forth.el" "elpa/org-plus-contrib-20170911/ob-forth.elc" "elpa/org-plus-contrib-20170911/ob-fortran.el" "elpa/org-plus-contrib-20170911/ob-fortran.elc" "elpa/org-plus-contrib-20170911/ob-gnuplot.el" "elpa/org-plus-contrib-20170911/ob-gnuplot.elc" "elpa/org-plus-contrib-20170911/ob-groovy.el" "elpa/org-plus-contrib-20170911/ob-groovy.elc" "elpa/org-plus-contrib-20170911/ob-haskell.el" "elpa/org-plus-contrib-20170911/ob-haskell.elc" "elpa/org-plus-contrib-20170911/ob-hledger.el" "elpa/org-plus-contrib-20170911/ob-hledger.elc" "elpa/org-plus-contrib-20170911/ob-io.el" "elpa/org-plus-contrib-20170911/ob-io.elc" "elpa/org-plus-contrib-20170911/ob-java.el" "elpa/org-plus-contrib-20170911/ob-java.elc" "elpa/org-plus-contrib-20170911/ob-js.el" "elpa/org-plus-contrib-20170911/ob-js.elc" "elpa/org-plus-contrib-20170911/ob-julia.el" "elpa/org-plus-contrib-20170911/ob-julia.elc" "elpa/org-plus-contrib-20170911/ob-keys.el" "elpa/org-plus-contrib-20170911/ob-keys.elc" "elpa/org-plus-contrib-20170911/ob-latex.el" "elpa/org-plus-contrib-20170911/ob-latex.elc" "elpa/org-plus-contrib-20170911/ob-ledger.el" "elpa/org-plus-contrib-20170911/ob-ledger.elc" "elpa/org-plus-contrib-20170911/ob-lilypond.el" "elpa/org-plus-contrib-20170911/ob-lilypond.elc" "elpa/org-plus-contrib-20170911/ob-lisp.el" "elpa/org-plus-contrib-20170911/ob-lisp.elc" "elpa/org-plus-contrib-20170911/ob-lob.el" "elpa/org-plus-contrib-20170911/ob-lob.elc" "elpa/org-plus-contrib-20170911/ob-lua.el" "elpa/org-plus-contrib-20170911/ob-lua.elc" "elpa/org-plus-contrib-20170911/ob-makefile.el" "elpa/org-plus-contrib-20170911/ob-makefile.elc" "elpa/org-plus-contrib-20170911/ob-mathematica.el" "elpa/org-plus-contrib-20170911/ob-mathematica.elc" "elpa/org-plus-contrib-20170911/ob-mathomatic.el" "elpa/org-plus-contrib-20170911/ob-mathomatic.elc" "elpa/org-plus-contrib-20170911/ob-matlab.el" "elpa/org-plus-contrib-20170911/ob-matlab.elc" "elpa/org-plus-contrib-20170911/ob-maxima.el" "elpa/org-plus-contrib-20170911/ob-maxima.elc" "elpa/org-plus-contrib-20170911/ob-mscgen.el" "elpa/org-plus-contrib-20170911/ob-mscgen.elc" "elpa/org-plus-contrib-20170911/ob-ocaml.el" "elpa/org-plus-contrib-20170911/ob-ocaml.elc" "elpa/org-plus-contrib-20170911/ob-octave.el" "elpa/org-plus-contrib-20170911/ob-octave.elc" "elpa/org-plus-contrib-20170911/ob-org.el" "elpa/org-plus-contrib-20170911/ob-org.elc" "elpa/org-plus-contrib-20170911/ob-oz.el" "elpa/org-plus-contrib-20170911/ob-oz.elc" "elpa/org-plus-contrib-20170911/ob-perl.el" "elpa/org-plus-contrib-20170911/ob-perl.elc" "elpa/org-plus-contrib-20170911/ob-picolisp.el" "elpa/org-plus-contrib-20170911/ob-picolisp.elc" "elpa/org-plus-contrib-20170911/ob-plantuml.el" "elpa/org-plus-contrib-20170911/ob-plantuml.elc" "elpa/org-plus-contrib-20170911/ob-processing.el" "elpa/org-plus-contrib-20170911/ob-processing.elc" "elpa/org-plus-contrib-20170911/ob-python.el" "elpa/org-plus-contrib-20170911/ob-python.elc" "elpa/org-plus-contrib-20170911/ob-ref.el" "elpa/org-plus-contrib-20170911/ob-ref.elc" "elpa/org-plus-contrib-20170911/ob-ruby.el" "elpa/org-plus-contrib-20170911/ob-ruby.elc" "elpa/org-plus-contrib-20170911/ob-sass.el" "elpa/org-plus-contrib-20170911/ob-sass.elc" "elpa/org-plus-contrib-20170911/ob-scheme.el" "elpa/org-plus-contrib-20170911/ob-scheme.elc" "elpa/org-plus-contrib-20170911/ob-sclang.el" "elpa/org-plus-contrib-20170911/ob-screen.el" "elpa/org-plus-contrib-20170911/ob-screen.elc" "elpa/org-plus-contrib-20170911/ob-sed.el" "elpa/org-plus-contrib-20170911/ob-sed.elc" "elpa/org-plus-contrib-20170911/ob-shell.el" "elpa/org-plus-contrib-20170911/ob-shell.elc" "elpa/org-plus-contrib-20170911/ob-shen.el" "elpa/org-plus-contrib-20170911/ob-shen.elc" "elpa/org-plus-contrib-20170911/ob-sql.el" "elpa/org-plus-contrib-20170911/ob-sql.elc" "elpa/org-plus-contrib-20170911/ob-sqlite.el" "elpa/org-plus-contrib-20170911/ob-sqlite.elc" "elpa/org-plus-contrib-20170911/ob-stan.el" "elpa/org-plus-contrib-20170911/ob-stan.elc" "elpa/org-plus-contrib-20170911/ob-stata.el" "elpa/org-plus-contrib-20170911/ob-stata.elc" "elpa/org-plus-contrib-20170911/ob-table.el" "elpa/org-plus-contrib-20170911/ob-table.elc" "elpa/org-plus-contrib-20170911/ob-tangle.el" "elpa/org-plus-contrib-20170911/ob-tangle.elc" "elpa/org-plus-contrib-20170911/ob-tcl.el" "elpa/org-plus-contrib-20170911/ob-tcl.elc" "elpa/org-plus-contrib-20170911/ob-vala.el" "elpa/org-plus-contrib-20170911/ob-vala.elc" "elpa/org-plus-contrib-20170911/ob-vbnet.el" "elpa/org-plus-contrib-20170911/ob-vbnet.elc" "elpa/org-plus-contrib-20170911/ob.el" "elpa/org-plus-contrib-20170911/ob.elc" "elpa/org-plus-contrib-20170911/org" "elpa/org-plus-contrib-20170911/org-agenda.el" "elpa/org-plus-contrib-20170911/org-agenda.elc" "elpa/org-plus-contrib-20170911/org-annotate-file.el" "elpa/org-plus-contrib-20170911/org-annotate-file.elc" "elpa/org-plus-contrib-20170911/org-archive.el" "elpa/org-plus-contrib-20170911/org-archive.elc" "elpa/org-plus-contrib-20170911/org-attach.el" "elpa/org-plus-contrib-20170911/org-attach.elc" "elpa/org-plus-contrib-20170911/org-bbdb.el" "elpa/org-plus-contrib-20170911/org-bbdb.elc" "elpa/org-plus-contrib-20170911/org-bibtex-extras.el" "elpa/org-plus-contrib-20170911/org-bibtex-extras.elc" "elpa/org-plus-contrib-20170911/org-bibtex.el" "elpa/org-plus-contrib-20170911/org-bibtex.elc" "elpa/org-plus-contrib-20170911/org-bookmark.el" "elpa/org-plus-contrib-20170911/org-bookmark.elc" "elpa/org-plus-contrib-20170911/org-capture.el" "elpa/org-plus-contrib-20170911/org-capture.elc" "elpa/org-plus-contrib-20170911/org-checklist.el" "elpa/org-plus-contrib-20170911/org-checklist.elc" "elpa/org-plus-contrib-20170911/org-choose.el" "elpa/org-plus-contrib-20170911/org-choose.elc" "elpa/org-plus-contrib-20170911/org-clock.el" "elpa/org-plus-contrib-20170911/org-clock.elc" "elpa/org-plus-contrib-20170911/org-collector.el" "elpa/org-plus-contrib-20170911/org-collector.elc" "elpa/org-plus-contrib-20170911/org-colview.el" "elpa/org-plus-contrib-20170911/org-colview.elc" "elpa/org-plus-contrib-20170911/org-compat.el" "elpa/org-plus-contrib-20170911/org-compat.elc" "elpa/org-plus-contrib-20170911/org-contacts.el" "elpa/org-plus-contrib-20170911/org-contacts.elc" "elpa/org-plus-contrib-20170911/org-contribdir.el" "elpa/org-plus-contrib-20170911/org-contribdir.elc" "elpa/org-plus-contrib-20170911/org-crypt.el" "elpa/org-plus-contrib-20170911/org-crypt.elc" "elpa/org-plus-contrib-20170911/org-ctags.el" "elpa/org-plus-contrib-20170911/org-ctags.elc" "elpa/org-plus-contrib-20170911/org-datetree.el" "elpa/org-plus-contrib-20170911/org-datetree.elc" "elpa/org-plus-contrib-20170911/org-depend.el" "elpa/org-plus-contrib-20170911/org-depend.elc" "elpa/org-plus-contrib-20170911/org-docview.el" "elpa/org-plus-contrib-20170911/org-docview.elc" "elpa/org-plus-contrib-20170911/org-drill.el" "elpa/org-plus-contrib-20170911/org-drill.elc" "elpa/org-plus-contrib-20170911/org-duration.el" "elpa/org-plus-contrib-20170911/org-duration.elc" "elpa/org-plus-contrib-20170911/org-effectiveness.el" "elpa/org-plus-contrib-20170911/org-effectiveness.elc" "elpa/org-plus-contrib-20170911/org-eldoc.el" "elpa/org-plus-contrib-20170911/org-eldoc.elc" "elpa/org-plus-contrib-20170911/org-element.el" "elpa/org-plus-contrib-20170911/org-element.elc" "elpa/org-plus-contrib-20170911/org-elisp-symbol.el" "elpa/org-plus-contrib-20170911/org-elisp-symbol.elc" "elpa/org-plus-contrib-20170911/org-entities.el" "elpa/org-plus-contrib-20170911/org-entities.elc" "elpa/org-plus-contrib-20170911/org-eshell.el" "elpa/org-plus-contrib-20170911/org-eshell.elc" "elpa/org-plus-contrib-20170911/org-eval-light.el" "elpa/org-plus-contrib-20170911/org-eval-light.elc" "elpa/org-plus-contrib-20170911/org-eval.el" "elpa/org-plus-contrib-20170911/org-eval.elc" "elpa/org-plus-contrib-20170911/org-eww.el" "elpa/org-plus-contrib-20170911/org-eww.elc" "elpa/org-plus-contrib-20170911/org-expiry.el" "elpa/org-plus-contrib-20170911/org-expiry.elc" "elpa/org-plus-contrib-20170911/org-faces.el" "elpa/org-plus-contrib-20170911/org-faces.elc" "elpa/org-plus-contrib-20170911/org-feed.el" "elpa/org-plus-contrib-20170911/org-feed.elc" "elpa/org-plus-contrib-20170911/org-footnote.el" "elpa/org-plus-contrib-20170911/org-footnote.elc" "elpa/org-plus-contrib-20170911/org-git-link.el" "elpa/org-plus-contrib-20170911/org-git-link.elc" "elpa/org-plus-contrib-20170911/org-gnus.el" "elpa/org-plus-contrib-20170911/org-gnus.elc" "elpa/org-plus-contrib-20170911/org-habit.el" "elpa/org-plus-contrib-20170911/org-habit.elc" "elpa/org-plus-contrib-20170911/org-id.el" "elpa/org-plus-contrib-20170911/org-id.elc" "elpa/org-plus-contrib-20170911/org-indent.el" "elpa/org-plus-contrib-20170911/org-indent.elc" "elpa/org-plus-contrib-20170911/org-index.el" "elpa/org-plus-contrib-20170911/org-index.elc" "elpa/org-plus-contrib-20170911/org-info.el" "elpa/org-plus-contrib-20170911/org-info.elc" "elpa/org-plus-contrib-20170911/org-inlinetask.el" "elpa/org-plus-contrib-20170911/org-inlinetask.elc" "elpa/org-plus-contrib-20170911/org-install.el" "elpa/org-plus-contrib-20170911/org-interactive-query.el" "elpa/org-plus-contrib-20170911/org-interactive-query.elc" "elpa/org-plus-contrib-20170911/org-invoice.el" "elpa/org-plus-contrib-20170911/org-invoice.elc" "elpa/org-plus-contrib-20170911/org-irc.el" "elpa/org-plus-contrib-20170911/org-irc.elc" "elpa/org-plus-contrib-20170911/org-learn.el" "elpa/org-plus-contrib-20170911/org-learn.elc" "elpa/org-plus-contrib-20170911/org-license.el" "elpa/org-plus-contrib-20170911/org-license.elc" "elpa/org-plus-contrib-20170911/org-link-edit.el" "elpa/org-plus-contrib-20170911/org-link-edit.elc" "elpa/org-plus-contrib-20170911/org-lint.el" "elpa/org-plus-contrib-20170911/org-lint.elc" "elpa/org-plus-contrib-20170911/org-list.el" "elpa/org-plus-contrib-20170911/org-list.elc" "elpa/org-plus-contrib-20170911/org-loaddefs.el" "elpa/org-plus-contrib-20170911/org-mac-iCal.el" "elpa/org-plus-contrib-20170911/org-mac-iCal.elc" "elpa/org-plus-contrib-20170911/org-mac-link.el" "elpa/org-plus-contrib-20170911/org-mac-link.elc" "elpa/org-plus-contrib-20170911/org-macro.el" "elpa/org-plus-contrib-20170911/org-macro.elc" "elpa/org-plus-contrib-20170911/org-macs.el" "elpa/org-plus-contrib-20170911/org-macs.elc" "elpa/org-plus-contrib-20170911/org-mairix.el" "elpa/org-plus-contrib-20170911/org-mairix.elc" "elpa/org-plus-contrib-20170911/org-man.el" "elpa/org-plus-contrib-20170911/org-man.elc" "elpa/org-plus-contrib-20170911/org-mew.el" "elpa/org-plus-contrib-20170911/org-mew.elc" "elpa/org-plus-contrib-20170911/org-mhe.el" "elpa/org-plus-contrib-20170911/org-mhe.elc" "elpa/org-plus-contrib-20170911/org-mobile.el" "elpa/org-plus-contrib-20170911/org-mobile.elc" "elpa/org-plus-contrib-20170911/org-mouse.el" "elpa/org-plus-contrib-20170911/org-mouse.elc" "elpa/org-plus-contrib-20170911/org-notify.el" "elpa/org-plus-contrib-20170911/org-notify.elc" "elpa/org-plus-contrib-20170911/org-notmuch.el" "elpa/org-plus-contrib-20170911/org-notmuch.elc" "elpa/org-plus-contrib-20170911/org-panel.el" "elpa/org-plus-contrib-20170911/org-panel.elc" "elpa/org-plus-contrib-20170911/org-passwords.el" "elpa/org-plus-contrib-20170911/org-passwords.elc" "elpa/org-plus-contrib-20170911/org-pcomplete.el" "elpa/org-plus-contrib-20170911/org-pcomplete.elc" "elpa/org-plus-contrib-20170911/org-plot.el" "elpa/org-plus-contrib-20170911/org-plot.elc" "elpa/org-plus-contrib-20170911/org-plus-contrib-autoloads.el" "elpa/org-plus-contrib-20170911/org-plus-contrib-pkg.el" "elpa/org-plus-contrib-20170911/org-plus-contrib-pkg.elc" "elpa/org-plus-contrib-20170911/org-protocol.el" "elpa/org-plus-contrib-20170911/org-protocol.elc" "elpa/org-plus-contrib-20170911/org-registry.el" "elpa/org-plus-contrib-20170911/org-registry.elc" "elpa/org-plus-contrib-20170911/org-rmail.el" "elpa/org-plus-contrib-20170911/org-rmail.elc" "elpa/org-plus-contrib-20170911/org-screen.el" "elpa/org-plus-contrib-20170911/org-screen.elc" "elpa/org-plus-contrib-20170911/org-screenshot.el" "elpa/org-plus-contrib-20170911/org-screenshot.elc" "elpa/org-plus-contrib-20170911/org-secretary.el" "elpa/org-plus-contrib-20170911/org-secretary.elc" "elpa/org-plus-contrib-20170911/org-src.el" "elpa/org-plus-contrib-20170911/org-src.elc" "elpa/org-plus-contrib-20170911/org-static-mathjax.el" "elpa/org-plus-contrib-20170911/org-static-mathjax.elc" "elpa/org-plus-contrib-20170911/org-sudoku.el" "elpa/org-plus-contrib-20170911/org-sudoku.elc" "elpa/org-plus-contrib-20170911/org-table.el" "elpa/org-plus-contrib-20170911/org-table.elc" "elpa/org-plus-contrib-20170911/org-timer.el" "elpa/org-plus-contrib-20170911/org-timer.elc" "elpa/org-plus-contrib-20170911/org-toc.el" "elpa/org-plus-contrib-20170911/org-toc.elc" "elpa/org-plus-contrib-20170911/org-track.el" "elpa/org-plus-contrib-20170911/org-track.elc" "elpa/org-plus-contrib-20170911/org-velocity.el" "elpa/org-plus-contrib-20170911/org-velocity.elc" "elpa/org-plus-contrib-20170911/org-version.el" "elpa/org-plus-contrib-20170911/org-vm.el" "elpa/org-plus-contrib-20170911/org-vm.elc" "elpa/org-plus-contrib-20170911/org-w3m.el" "elpa/org-plus-contrib-20170911/org-w3m.elc" "elpa/org-plus-contrib-20170911/org-wikinodes.el" "elpa/org-plus-contrib-20170911/org-wikinodes.elc" "elpa/org-plus-contrib-20170911/org-wl.el" "elpa/org-plus-contrib-20170911/org-wl.elc" "elpa/org-plus-contrib-20170911/org.el" "elpa/org-plus-contrib-20170911/org.elc" "elpa/org-plus-contrib-20170911/orgcard.pdf" "elpa/org-plus-contrib-20170911/ox-ascii.el" "elpa/org-plus-contrib-20170911/ox-ascii.elc" "elpa/org-plus-contrib-20170911/ox-beamer.el" "elpa/org-plus-contrib-20170911/ox-beamer.elc" "elpa/org-plus-contrib-20170911/ox-bibtex.el" "elpa/org-plus-contrib-20170911/ox-bibtex.elc" "elpa/org-plus-contrib-20170911/ox-confluence.el" "elpa/org-plus-contrib-20170911/ox-confluence.elc" "elpa/org-plus-contrib-20170911/ox-deck.el" "elpa/org-plus-contrib-20170911/ox-deck.elc" "elpa/org-plus-contrib-20170911/ox-extra.el" "elpa/org-plus-contrib-20170911/ox-extra.elc" "elpa/org-plus-contrib-20170911/ox-freemind.el" "elpa/org-plus-contrib-20170911/ox-freemind.elc" "elpa/org-plus-contrib-20170911/ox-groff.el" "elpa/org-plus-contrib-20170911/ox-groff.elc" "elpa/org-plus-contrib-20170911/ox-html.el" "elpa/org-plus-contrib-20170911/ox-html.elc" "elpa/org-plus-contrib-20170911/ox-icalendar.el" "elpa/org-plus-contrib-20170911/ox-icalendar.elc" "elpa/org-plus-contrib-20170911/ox-koma-letter.el" "elpa/org-plus-contrib-20170911/ox-koma-letter.elc" "elpa/org-plus-contrib-20170911/ox-latex.el" "elpa/org-plus-contrib-20170911/ox-latex.elc" "elpa/org-plus-contrib-20170911/ox-man.el" "elpa/org-plus-contrib-20170911/ox-man.elc" "elpa/org-plus-contrib-20170911/ox-md.el" "elpa/org-plus-contrib-20170911/ox-md.elc" "elpa/org-plus-contrib-20170911/ox-odt.el" "elpa/org-plus-contrib-20170911/ox-odt.elc" "elpa/org-plus-contrib-20170911/ox-org.el" "elpa/org-plus-contrib-20170911/ox-org.elc" "elpa/org-plus-contrib-20170911/ox-publish.el" "elpa/org-plus-contrib-20170911/ox-publish.elc" "elpa/org-plus-contrib-20170911/ox-rss.el" "elpa/org-plus-contrib-20170911/ox-rss.elc" "elpa/org-plus-contrib-20170911/ox-s5.el" "elpa/org-plus-contrib-20170911/ox-s5.elc" "elpa/org-plus-contrib-20170911/ox-taskjuggler.el" "elpa/org-plus-contrib-20170911/ox-taskjuggler.elc" "elpa/org-plus-contrib-20170911/ox-texinfo.el" "elpa/org-plus-contrib-20170911/ox-texinfo.elc" "elpa/org-plus-contrib-20170911/ox.el" "elpa/org-plus-contrib-20170911/ox.elc" "elpa/org-wild-notifier-20180221.2025/org-wild-notifier-autoloads.el" "elpa/org-wild-notifier-20180221.2025/org-wild-notifier-pkg.el" "elpa/org-wild-notifier-20180221.2025/org-wild-notifier.el" "elpa/org-wild-notifier-20180221.2025/org-wild-notifier.elc" "elpa/ox-reveal-20161027.226/ox-reveal-autoloads.el" "elpa/ox-reveal-20161027.226/ox-reveal-pkg.el" "elpa/ox-reveal-20161027.226/ox-reveal.el" "elpa/ox-reveal-20161027.226/ox-reveal.elc" "elpa/paredit-20171126.1805/paredit-autoloads.el" "elpa/paredit-20171126.1805/paredit-pkg.el" "elpa/paredit-20171126.1805/paredit.el" "elpa/paredit-20171126.1805/paredit.elc" "elpa/paredit-menu-20160128.933/paredit-menu-autoloads.el" "elpa/paredit-menu-20160128.933/paredit-menu-pkg.el" "elpa/paredit-menu-20160128.933/paredit-menu.el" "elpa/paredit-menu-20160128.933/paredit-menu.elc" "elpa/pkg-info-20150517.443/pkg-info-autoloads.el" "elpa/pkg-info-20150517.443/pkg-info-pkg.el" "elpa/pkg-info-20150517.443/pkg-info.el" "elpa/pkg-info-20150517.443/pkg-info.elc" "elpa/popup-20160709.729/popup-autoloads.el" "elpa/popup-20160709.729/popup-pkg.el" "elpa/popup-20160709.729/popup.el" "elpa/popup-20160709.729/popup.elc" "elpa/pos-tip-20150318.813/pos-tip-autoloads.el" "elpa/pos-tip-20150318.813/pos-tip-pkg.el" "elpa/pos-tip-20150318.813/pos-tip.el" "elpa/pos-tip-20150318.813/pos-tip.elc" "elpa/pretty-symbols-20140814.259/pretty-symbols-autoloads.el" "elpa/pretty-symbols-20140814.259/pretty-symbols-pkg.el" "elpa/pretty-symbols-20140814.259/pretty-symbols.el" "elpa/pretty-symbols-20140814.259/pretty-symbols.elc" "elpa/python-environment-20150310.153/python-environment-autoloads.el" "elpa/python-environment-20150310.153/python-environment-pkg.el" "elpa/python-environment-20150310.153/python-environment.el" "elpa/python-environment-20150310.153/test-python-environment.el" "elpa/queue-0.2/queue-autoloads.el" "elpa/queue-0.2/queue-pkg.el" "elpa/queue-0.2/queue.el" "elpa/queue-0.2/queue.elc" "elpa/queue-0.2.signed" "elpa/rainbow-delimiters-20160430.2358/rainbow-delimiters-autoloads.el" "elpa/rainbow-delimiters-20160430.2358/rainbow-delimiters-pkg.el" "elpa/rainbow-delimiters-20160430.2358/rainbow-delimiters.el" "elpa/rainbow-delimiters-20160430.2358/rainbow-delimiters.elc" "elpa/rainbow-delimiters-20170929.432/rainbow-delimiters-autoloads.el" "elpa/rainbow-delimiters-20170929.432/rainbow-delimiters-pkg.el" "elpa/rainbow-delimiters-20170929.432/rainbow-delimiters.el" "elpa/rainbow-delimiters-20170929.432/rainbow-delimiters.elc" "elpa/request-20170131.1747/request-autoloads.el" "elpa/request-20170131.1747/request-pkg.el" "elpa/request-20170131.1747/request.el" "elpa/request-20170131.1747/request.elc" "elpa/request-deferred-20160419.1605/request-deferred-autoloads.el" "elpa/request-deferred-20160419.1605/request-deferred-pkg.el" "elpa/request-deferred-20160419.1605/request-deferred.el" "elpa/ruby-end-20141215.423/ruby-end-autoloads.el" "elpa/ruby-end-20141215.423/ruby-end-pkg.el" "elpa/ruby-end-20141215.423/ruby-end.el" "elpa/ruby-end-20141215.423/ruby-end.elc" "elpa/ruby-tools-20151209.815/ruby-tools-autoloads.el" "elpa/ruby-tools-20151209.815/ruby-tools-pkg.el" "elpa/ruby-tools-20151209.815/ruby-tools.el" "elpa/ruby-tools-20151209.815/ruby-tools.elc" "elpa/s-20180406.108/s-autoloads.el" "elpa/s-20180406.108/s-pkg.el" "elpa/s-20180406.108/s.el" "elpa/s-20180406.108/s.elc" "elpa/scheme-complete-20170824.713/scheme-complete-autoloads.el" "elpa/scheme-complete-20170824.713/scheme-complete-pkg.el" "elpa/scheme-complete-20170824.713/scheme-complete.el" "elpa/scheme-complete-20170824.713/scheme-complete.elc" "elpa/seq-2.20/ChangeLog" "elpa/seq-2.20/seq-24.el" "elpa/seq-2.20/seq-24.elc" "elpa/seq-2.20/seq-25.el" "elpa/seq-2.20/seq-25.elc" "elpa/seq-2.20/seq-autoloads.el" "elpa/seq-2.20/seq-pkg.el" "elpa/seq-2.20/seq-pkg.elc" "elpa/seq-2.20/seq.el" "elpa/seq-2.20/seq.elc" "elpa/seq-2.20/tests/seq-tests.el" "elpa/seq-2.20/tests/seq-tests.elc" "elpa/seq-2.20.signed" "elpa/simplezen-20130421.300/simplezen-autoloads.el" "elpa/simplezen-20130421.300/simplezen-pkg.el" "elpa/simplezen-20130421.300/simplezen.el" "elpa/simplezen-20130421.300/simplezen.elc" "elpa/smex-20151212.1409/smex-autoloads.el" "elpa/smex-20151212.1409/smex-pkg.el" "elpa/smex-20151212.1409/smex.el" "elpa/smex-20151212.1409/smex.elc" "elpa/sotclojure-20170921.1708/sotclojure-autoloads.el" "elpa/sotclojure-20170921.1708/sotclojure-on.el" "elpa/sotclojure-20170921.1708/sotclojure-on.elc" "elpa/sotclojure-20170921.1708/sotclojure-pkg.el" "elpa/sotclojure-20170921.1708/sotclojure.el" "elpa/sotclojure-20170921.1708/sotclojure.elc" "elpa/sotlisp-20170429.1945/sotlisp-autoloads.el" "elpa/sotlisp-20170429.1945/sotlisp-pkg.el" "elpa/sotlisp-20170429.1945/sotlisp.el" "elpa/sotlisp-20170429.1945/sotlisp.elc" "elpa/spinner-1.7.3/spinner-autoloads.el" "elpa/spinner-1.7.3/spinner-pkg.el" "elpa/spinner-1.7.3/spinner.el" "elpa/spinner-1.7.3/spinner.elc" "elpa/spinner-1.7.3.signed" "elpa/string-edit-20160410.2356/string-edit-autoloads.el" "elpa/string-edit-20160410.2356/string-edit-pkg.el" "elpa/string-edit-20160410.2356/string-edit.el" "elpa/string-edit-20160410.2356/string-edit.elc" "elpa/tagedit-20161121.55/tagedit-autoloads.el" "elpa/tagedit-20161121.55/tagedit-pkg.el" "elpa/tagedit-20161121.55/tagedit.el" "elpa/tagedit-20161121.55/tagedit.elc" "elpa/undo-tree-20170706.246/undo-tree-autoloads.el" "elpa/undo-tree-20170706.246/undo-tree-pkg.el" "elpa/undo-tree-20170706.246/undo-tree.el" "elpa/undo-tree-20170706.246/undo-tree.elc" "elpa/window-numbering-20160809.1110/window-numbering-autoloads.el" "elpa/window-numbering-20160809.1110/window-numbering-pkg.el" "elpa/window-numbering-20160809.1110/window-numbering.el" "elpa/window-numbering-20160809.1110/window-numbering.elc" "elpa/xpm-1.0.4/.elpaignore" "elpa/xpm-1.0.4/ChangeLog" "elpa/xpm-1.0.4/NEWS" "elpa/xpm-1.0.4/THANKS" "elpa/xpm-1.0.4/xpm-autoloads.el" "elpa/xpm-1.0.4/xpm-m2z.el" "elpa/xpm-1.0.4/xpm-m2z.elc" "elpa/xpm-1.0.4/xpm-pkg.el" "elpa/xpm-1.0.4/xpm-pkg.elc" "elpa/xpm-1.0.4/xpm.el" "elpa/xpm-1.0.4/xpm.elc" "elpa/xpm-1.0.4.signed" "elpa/zencoding-mode-20140213.22/zencoding-mode-autoloads.el" "elpa/zencoding-mode-20140213.22/zencoding-mode-pkg.el" "elpa/zencoding-mode-20140213.22/zencoding-mode.el" "elpa/zencoding-mode-20140213.22/zencoding-mode.elc" "emms/cache" "emms/history" "emms/scores" "eshell/history" "ido.last" "init.el" "projectile-bookmarks.eld" "snippets/c++-mode/.yas-parents" "snippets/c++-mode/.yas-setup.el" "snippets/c++-mode/acl" "snippets/c++-mode/acm" "snippets/c++-mode/ajf" "snippets/c++-mode/alo" "snippets/c++-mode/ano" "snippets/c++-mode/assert" "snippets/c++-mode/beginend" "snippets/c++-mode/boost_require" "snippets/c++-mode/cerr" "snippets/c++-mode/cin" "snippets/c++-mode/class" "snippets/c++-mode/class11" "snippets/c++-mode/cni" "snippets/c++-mode/cnt" "snippets/c++-mode/const_[]" "snippets/c++-mode/constructor" "snippets/c++-mode/cout" "snippets/c++-mode/cpb" "snippets/c++-mode/cpi" "snippets/c++-mode/cpn" "snippets/c++-mode/cpp" "snippets/c++-mode/cpy" "snippets/c++-mode/cstd" "snippets/c++-mode/d+=" "snippets/c++-mode/d_operator" "snippets/c++-mode/d_operator[]" "snippets/c++-mode/d_operator[]_const" "snippets/c++-mode/d_operator_istream" "snippets/c++-mode/d_operator_ostream" "snippets/c++-mode/delete" "snippets/c++-mode/delete[]" "snippets/c++-mode/doc" "snippets/c++-mode/dynamic_casting" "snippets/c++-mode/enum" "snippets/c++-mode/eql" "snippets/c++-mode/erm" "snippets/c++-mode/ffo" "snippets/c++-mode/fil" "snippets/c++-mode/fin" "snippets/c++-mode/fixture" "snippets/c++-mode/fln" "snippets/c++-mode/fnd" "snippets/c++-mode/fne" "snippets/c++-mode/fni" "snippets/c++-mode/fori" "snippets/c++-mode/fre" "snippets/c++-mode/friend" "snippets/c++-mode/fun_declaration" "snippets/c++-mode/gnn" "snippets/c++-mode/gnr" "snippets/c++-mode/gtest" "snippets/c++-mode/ignore" "snippets/c++-mode/ihp" "snippets/c++-mode/ihu" "snippets/c++-mode/inline" "snippets/c++-mode/io" "snippets/c++-mode/ipr" "snippets/c++-mode/ipt" "snippets/c++-mode/iss" "snippets/c++-mode/isu" "snippets/c++-mode/ita" "snippets/c++-mode/iterator" "snippets/c++-mode/ltr" "snippets/c++-mode/lwr" "snippets/c++-mode/lxc" "snippets/c++-mode/map" "snippets/c++-mode/member_function" "snippets/c++-mode/mkh" "snippets/c++-mode/mme" "snippets/c++-mode/mne" "snippets/c++-mode/module" "snippets/c++-mode/mpb" "snippets/c++-mode/mrg" "snippets/c++-mode/msm" "snippets/c++-mode/mxe" "snippets/c++-mode/namespace" "snippets/c++-mode/nno" "snippets/c++-mode/ns" "snippets/c++-mode/nth" "snippets/c++-mode/nxp" "snippets/c++-mode/oit" "snippets/c++-mode/operator!=" "snippets/c++-mode/operator+" "snippets/c++-mode/operator+=" "snippets/c++-mode/operator=" "snippets/c++-mode/operator==" "snippets/c++-mode/operator[]" "snippets/c++-mode/operator_istream" "snippets/c++-mode/operator_ostream" "snippets/c++-mode/ostream" "snippets/c++-mode/pack" "snippets/c++-mode/phh" "snippets/c++-mode/ppt" "snippets/c++-mode/private" "snippets/c++-mode/protected" "snippets/c++-mode/prp" "snippets/c++-mode/psc" "snippets/c++-mode/pst" "snippets/c++-mode/ptc" "snippets/c++-mode/ptn" "snippets/c++-mode/public" "snippets/c++-mode/rci" "snippets/c++-mode/rmc" "snippets/c++-mode/rmf" "snippets/c++-mode/rmi" "snippets/c++-mode/rmv" "snippets/c++-mode/rpc" "snippets/c++-mode/rpi" "snippets/c++-mode/rpl" "snippets/c++-mode/rtc" "snippets/c++-mode/rte" "snippets/c++-mode/rvc" "snippets/c++-mode/rvr" "snippets/c++-mode/shf" "snippets/c++-mode/spt" "snippets/c++-mode/srh" "snippets/c++-mode/srn" "snippets/c++-mode/srt" "snippets/c++-mode/sstream" "snippets/c++-mode/std" "snippets/c++-mode/std_colon" "snippets/c++-mode/sth" "snippets/c++-mode/sti" "snippets/c++-mode/sto" "snippets/c++-mode/str" "snippets/c++-mode/sts" "snippets/c++-mode/stv" "snippets/c++-mode/swr" "snippets/c++-mode/template" "snippets/c++-mode/test case" "snippets/c++-mode/test_main" "snippets/c++-mode/test_suite" "snippets/c++-mode/tfm" "snippets/c++-mode/this" "snippets/c++-mode/throw" "snippets/c++-mode/trm" "snippets/c++-mode/try" "snippets/c++-mode/tryw" "snippets/c++-mode/ucp" "snippets/c++-mode/upr" "snippets/c++-mode/uqe" "snippets/c++-mode/using" "snippets/c++-mode/vector" "snippets/c-mode/.yas-parents" "snippets/c-mode/assert" "snippets/c-mode/compile" "snippets/c-mode/define" "snippets/c-mode/fopen" "snippets/c-mode/malloc" "snippets/c-mode/packed" "snippets/c-mode/printf" "snippets/c-mode/stdio" "snippets/c-mode/stdlib" "snippets/c-mode/string" "snippets/c-mode/switch" "snippets/c-mode/union" "snippets/c-mode/unistd" "snippets/chef-mode/action" "snippets/chef-mode/bash" "snippets/chef-mode/cookbook_file" "snippets/chef-mode/cron" "snippets/chef-mode/cronf" "snippets/chef-mode/deploy" "snippets/chef-mode/directory" "snippets/chef-mode/directoryf" "snippets/chef-mode/env" "snippets/chef-mode/execute" "snippets/chef-mode/executef" "snippets/chef-mode/file" "snippets/chef-mode/filef" "snippets/chef-mode/git" "snippets/chef-mode/group" "snippets/chef-mode/http_request" "snippets/chef-mode/http_requestp" "snippets/chef-mode/ignore_failure" "snippets/chef-mode/inc" "snippets/chef-mode/link" "snippets/chef-mode/linkf" "snippets/chef-mode/log" "snippets/chef-mode/machine" "snippets/chef-mode/meta" "snippets/chef-mode/not_if" "snippets/chef-mode/notifies" "snippets/chef-mode/only_if" "snippets/chef-mode/pac" "snippets/chef-mode/pak" "snippets/chef-mode/provider" "snippets/chef-mode/python" "snippets/chef-mode/remote_file" "snippets/chef-mode/retries" "snippets/chef-mode/role" "snippets/chef-mode/ruby" "snippets/chef-mode/script" "snippets/chef-mode/service" "snippets/chef-mode/servicep" "snippets/chef-mode/subscribes" "snippets/chef-mode/supports" "snippets/chef-mode/template" "snippets/chef-mode/templatev" "snippets/chef-mode/user" "snippets/cider-repl-mode/.yas-parents" "snippets/clojure-mode/bench" "snippets/clojure-mode/c" "snippets/clojure-mode/cljsbuild" "snippets/clojure-mode/com" "snippets/clojure-mode/cond" "snippets/clojure-mode/condp" "snippets/clojure-mode/def" "snippets/clojure-mode/defm" "snippets/clojure-mode/defmm" "snippets/clojure-mode/defn" "snippets/clojure-mode/defp" "snippets/clojure-mode/defproject" "snippets/clojure-mode/defr" "snippets/clojure-mode/deft" "snippets/clojure-mode/dev" "snippets/clojure-mode/div" "snippets/clojure-mode/div-class" "snippets/clojure-mode/doseq" "snippets/clojure-mode/f" "snippets/clojure-mode/fdef" "snippets/clojure-mode/fn" "snippets/clojure-mode/for" "snippets/clojure-mode/if" "snippets/clojure-mode/ifl" "snippets/clojure-mode/import" "snippets/clojure-mode/is" "snippets/clojure-mode/kwargs" "snippets/clojure-mode/let" "snippets/clojure-mode/letfn" "snippets/clojure-mode/m" "snippets/clojure-mode/main" "snippets/clojure-mode/map" "snippets/clojure-mode/map.lambda" "snippets/clojure-mode/mdoc" "snippets/clojure-mode/namespace" "snippets/clojure-mode/ns" "snippets/clojure-mode/opts" "snippets/clojure-mode/perf" "snippets/clojure-mode/pm" "snippets/clojure-mode/pr" "snippets/clojure-mode/print" "snippets/clojure-mode/reduce" "snippets/clojure-mode/refer" "snippets/clojure-mode/require" "snippets/clojure-mode/rn" "snippets/clojure-mode/test" "snippets/clojure-mode/testcase" "snippets/clojure-mode/testing" "snippets/clojure-mode/thread-first" "snippets/clojure-mode/thread-last" "snippets/clojure-mode/try" "snippets/clojure-mode/use" "snippets/clojure-mode/when" "snippets/clojure-mode/whenl" "snippets/crappy-jsp-mode/elvariable" "snippets/css-mode/bg" "snippets/css-mode/bg.1" "snippets/css-mode/bor" "snippets/css-mode/cl" "snippets/css-mode/disp.block" "snippets/css-mode/disp.inline" "snippets/css-mode/disp.none" "snippets/css-mode/ff" "snippets/css-mode/fs" "snippets/css-mode/mar.bottom" "snippets/css-mode/mar.left" "snippets/css-mode/mar.mar" "snippets/css-mode/mar.margin" "snippets/css-mode/mar.right" "snippets/css-mode/mar.top" "snippets/css-mode/pad.bottom" "snippets/css-mode/pad.left" "snippets/css-mode/pad.pad" "snippets/css-mode/pad.padding" "snippets/css-mode/pad.right" "snippets/css-mode/pad.top" "snippets/css-mode/v" "snippets/emacs-lisp-mode/.read_me" "snippets/emacs-lisp-mode/add-hook" "snippets/emacs-lisp-mode/and" "snippets/emacs-lisp-mode/append" "snippets/emacs-lisp-mode/apply" "snippets/emacs-lisp-mode/aref" "snippets/emacs-lisp-mode/aset" "snippets/emacs-lisp-mode/assq" "snippets/emacs-lisp-mode/autoload" "snippets/emacs-lisp-mode/backward-char" "snippets/emacs-lisp-mode/beginning-of-line" "snippets/emacs-lisp-mode/bounds-of-thing-at-point" "snippets/emacs-lisp-mode/buffer-file-name" "snippets/emacs-lisp-mode/buffer-modified-p" "snippets/emacs-lisp-mode/buffer-substring" "snippets/emacs-lisp-mode/buffer-substring-no-properties" "snippets/emacs-lisp-mode/car" "snippets/emacs-lisp-mode/cdr" "snippets/emacs-lisp-mode/concat" "snippets/emacs-lisp-mode/cond" "snippets/emacs-lisp-mode/condition-case" "snippets/emacs-lisp-mode/cons" "snippets/emacs-lisp-mode/consp" "snippets/emacs-lisp-mode/const" "snippets/emacs-lisp-mode/copy-directory" "snippets/emacs-lisp-mode/copy-file" "snippets/emacs-lisp-mode/current-buffer" "snippets/emacs-lisp-mode/custom-autoload" "snippets/emacs-lisp-mode/defalias" "snippets/emacs-lisp-mode/defcustom" "snippets/emacs-lisp-mode/define-key" "snippets/emacs-lisp-mode/defsubst" "snippets/emacs-lisp-mode/defun" "snippets/emacs-lisp-mode/defvar" "snippets/emacs-lisp-mode/delete-char" "snippets/emacs-lisp-mode/delete-directory" "snippets/emacs-lisp-mode/delete-file" "snippets/emacs-lisp-mode/delete-region" "snippets/emacs-lisp-mode/directory-files" "snippets/emacs-lisp-mode/dired.process_marked" "snippets/emacs-lisp-mode/dolist" "snippets/emacs-lisp-mode/end-of-line" "snippets/emacs-lisp-mode/ends" "snippets/emacs-lisp-mode/eq" "snippets/emacs-lisp-mode/equal" "snippets/emacs-lisp-mode/error" "snippets/emacs-lisp-mode/ert-deftest" "snippets/emacs-lisp-mode/expand-file-name" "snippets/emacs-lisp-mode/fboundp" "snippets/emacs-lisp-mode/file-name-directory" "snippets/emacs-lisp-mode/file-name-extension" "snippets/emacs-lisp-mode/file-name-nondirectory" "snippets/emacs-lisp-mode/file-name-sans-extension" "snippets/emacs-lisp-mode/file-relative-name" "snippets/emacs-lisp-mode/file.process" "snippets/emacs-lisp-mode/file.read-lines" "snippets/emacs-lisp-mode/find-file" "snippets/emacs-lisp-mode/find-replace" "snippets/emacs-lisp-mode/format" "snippets/emacs-lisp-mode/forward-char" "snippets/emacs-lisp-mode/forward-line" "snippets/emacs-lisp-mode/funcall" "snippets/emacs-lisp-mode/function" "snippets/emacs-lisp-mode/get" "snippets/emacs-lisp-mode/global-set-key" "snippets/emacs-lisp-mode/goto-char" "snippets/emacs-lisp-mode/grabstring" "snippets/emacs-lisp-mode/grabthing" "snippets/emacs-lisp-mode/hash" "snippets/emacs-lisp-mode/if" "snippets/emacs-lisp-mode/insert" "snippets/emacs-lisp-mode/insert-file-contents" "snippets/emacs-lisp-mode/interactive" "snippets/emacs-lisp-mode/kbd" "snippets/emacs-lisp-mode/kill-buffer" "snippets/emacs-lisp-mode/lambda" "snippets/emacs-lisp-mode/length" "snippets/emacs-lisp-mode/let" "snippets/emacs-lisp-mode/line-beginning-position" "snippets/emacs-lisp-mode/line-end-position" "snippets/emacs-lisp-mode/list" "snippets/emacs-lisp-mode/looking-at" "snippets/emacs-lisp-mode/make-directory" "snippets/emacs-lisp-mode/make-local-variable" "snippets/emacs-lisp-mode/mapc" "snippets/emacs-lisp-mode/mapcar" "snippets/emacs-lisp-mode/match-beginning" "snippets/emacs-lisp-mode/match-end" "snippets/emacs-lisp-mode/match-string" "snippets/emacs-lisp-mode/memq" "snippets/emacs-lisp-mode/message" "snippets/emacs-lisp-mode/minor_mode" "snippets/emacs-lisp-mode/not" "snippets/emacs-lisp-mode/nth" "snippets/emacs-lisp-mode/null" "snippets/emacs-lisp-mode/number-to-string" "snippets/emacs-lisp-mode/or" "snippets/emacs-lisp-mode/point" "snippets/emacs-lisp-mode/point-max" "snippets/emacs-lisp-mode/point-min" "snippets/emacs-lisp-mode/princ" "snippets/emacs-lisp-mode/print" "snippets/emacs-lisp-mode/progn" "snippets/emacs-lisp-mode/provide.yasnippet" "snippets/emacs-lisp-mode/push" "snippets/emacs-lisp-mode/put" "snippets/emacs-lisp-mode/re-search-backward" "snippets/emacs-lisp-mode/re-search-forward" "snippets/emacs-lisp-mode/region-active-p" "snippets/emacs-lisp-mode/region-beginning" "snippets/emacs-lisp-mode/region-end" "snippets/emacs-lisp-mode/rename-file" "snippets/emacs-lisp-mode/repeat" "snippets/emacs-lisp-mode/replace-regexp" "snippets/emacs-lisp-mode/replace-regexp-in-string" "snippets/emacs-lisp-mode/req" "snippets/emacs-lisp-mode/require" "snippets/emacs-lisp-mode/save-buffer" "snippets/emacs-lisp-mode/save-excursion" "snippets/emacs-lisp-mode/search-backward" "snippets/emacs-lisp-mode/search-backward-regexp" "snippets/emacs-lisp-mode/search-forward" "snippets/emacs-lisp-mode/search-forward-regexp" "snippets/emacs-lisp-mode/set" "snippets/emacs-lisp-mode/set-buffer" "snippets/emacs-lisp-mode/set-file-modes" "snippets/emacs-lisp-mode/set-mark" "snippets/emacs-lisp-mode/setq" "snippets/emacs-lisp-mode/should" "snippets/emacs-lisp-mode/skip-chars-backward" "snippets/emacs-lisp-mode/skip-chars-forward" "snippets/emacs-lisp-mode/split-string" "snippets/emacs-lisp-mode/string" "snippets/emacs-lisp-mode/string-match" "snippets/emacs-lisp-mode/string-to-number" "snippets/emacs-lisp-mode/string=" "snippets/emacs-lisp-mode/stringp" "snippets/emacs-lisp-mode/substring" "snippets/emacs-lisp-mode/thing-at-point" "snippets/emacs-lisp-mode/traverse_dir" "snippets/emacs-lisp-mode/unless" "snippets/emacs-lisp-mode/use-package" "snippets/emacs-lisp-mode/use-package-binding" "snippets/emacs-lisp-mode/vector" "snippets/emacs-lisp-mode/when" "snippets/emacs-lisp-mode/while" "snippets/emacs-lisp-mode/widget-get" "snippets/emacs-lisp-mode/with-current-buffer" "snippets/emacs-lisp-mode/word-or-region" "snippets/emacs-lisp-mode/word_regexp" "snippets/emacs-lisp-mode/x-dired.process_marked" "snippets/emacs-lisp-mode/x-file.process" "snippets/emacs-lisp-mode/x-file.read-lines" "snippets/emacs-lisp-mode/x-find-replace" "snippets/emacs-lisp-mode/x-grabstring" "snippets/emacs-lisp-mode/x-grabthing" "snippets/emacs-lisp-mode/x-traverse_dir" "snippets/emacs-lisp-mode/x-word-or-region" "snippets/emacs-lisp-mode/yes-or-no-p" "snippets/erlang-mode/after" "snippets/erlang-mode/begin" "snippets/erlang-mode/beh" "snippets/erlang-mode/case" "snippets/erlang-mode/compile" "snippets/erlang-mode/def" "snippets/erlang-mode/exp" "snippets/erlang-mode/fun" "snippets/erlang-mode/if" "snippets/erlang-mode/ifdef" "snippets/erlang-mode/ifndef" "snippets/erlang-mode/imp" "snippets/erlang-mode/inc" "snippets/erlang-mode/inc.lib" "snippets/erlang-mode/loop" "snippets/erlang-mode/mod" "snippets/erlang-mode/rcv" "snippets/erlang-mode/rcv.after" "snippets/erlang-mode/rec" "snippets/erlang-mode/try" "snippets/erlang-mode/undef" "snippets/f90-mode/bd" "snippets/f90-mode/c" "snippets/f90-mode/ch" "snippets/f90-mode/cx" "snippets/f90-mode/dc" "snippets/f90-mode/do" "snippets/f90-mode/dp" "snippets/f90-mode/forall" "snippets/f90-mode/function" "snippets/f90-mode/if" "snippets/f90-mode/in" "snippets/f90-mode/inc" "snippets/f90-mode/intr" "snippets/f90-mode/l" "snippets/f90-mode/module" "snippets/f90-mode/pa" "snippets/f90-mode/program" "snippets/f90-mode/puref" "snippets/f90-mode/pures" "snippets/f90-mode/re" "snippets/f90-mode/subroutine" "snippets/f90-mode/until" "snippets/f90-mode/where" "snippets/f90-mode/while" "snippets/f90-mode/wr" "snippets/feature-mode/feature" "snippets/feature-mode/scenario" "snippets/git-commit-mode/.yas-parents" "snippets/git-commit-mode/fixes" "snippets/git-commit-mode/references" "snippets/html-mode/.yas-parents" "snippets/html-mode/c-forEach" "snippets/html-mode/c-if" "snippets/html-mode/code" "snippets/html-mode/dd" "snippets/html-mode/div" "snippets/html-mode/dl" "snippets/html-mode/doctype" "snippets/html-mode/doctype.html5" "snippets/html-mode/doctype.xhtml1" "snippets/html-mode/doctype.xhtml1_1" "snippets/html-mode/doctype.xhtml1_strict" "snippets/html-mode/doctype.xhtml1_transitional" "snippets/html-mode/dt" "snippets/html-mode/em" "snippets/html-mode/form" "snippets/html-mode/html" "snippets/html-mode/html.xmlns" "snippets/html-mode/include" "snippets/html-mode/input" "snippets/html-mode/kbd" "snippets/html-mode/link" "snippets/html-mode/link.import" "snippets/html-mode/link.stylesheet" "snippets/html-mode/link.stylesheet-ie" "snippets/html-mode/mailto" "snippets/html-mode/media" "snippets/html-mode/meta" "snippets/html-mode/meta.http-equiv" "snippets/html-mode/oocss-module" "snippets/html-mode/p" "snippets/html-mode/sandbox" "snippets/html-mode/script" "snippets/html-mode/script.javascript" "snippets/html-mode/script.javascript-src" "snippets/html-mode/strong" "snippets/html-mode/textarea" "snippets/html-mode/th" "snippets/java-mode/@param" "snippets/java-mode/@return" "snippets/java-mode/apr_assert" "snippets/java-mode/class" "snippets/java-mode/constructor" "snippets/java-mode/doc" "snippets/java-mode/equals" "snippets/java-mode/file_class" "snippets/java-mode/for" "snippets/java-mode/foreach" "snippets/java-mode/if" "snippets/java-mode/ife" "snippets/java-mode/import" "snippets/java-mode/interface" "snippets/java-mode/iterator" "snippets/java-mode/javadoc" "snippets/java-mode/main" "snippets/java-mode/method" "snippets/java-mode/method@" "snippets/java-mode/new" "snippets/java-mode/paintComponent" "snippets/java-mode/printf" "snippets/java-mode/println" "snippets/java-mode/private" "snippets/java-mode/protected" "snippets/java-mode/public" "snippets/java-mode/return" "snippets/java-mode/test" "snippets/java-mode/testClass" "snippets/java-mode/this" "snippets/java-mode/toString" "snippets/java-mode/try" "snippets/java-mode/var" "snippets/java-mode/var=" "snippets/java-mode/void" "snippets/java-mode/while" "snippets/js-mode/declare-global.yasnippet" "snippets/js-mode/directive-oiiku-shared" "snippets/js-mode/finn-element-builder" "snippets/js-mode/for" "snippets/js-mode/for-in" "snippets/js-mode/function.yasnippet" "snippets/js-mode/immediately-invoked-function-expression.yasnippet" "snippets/js-mode/jstd-doc" "snippets/js-mode/jstd.additionalTestCase.yasnippet" "snippets/js-mode/jstd.log.yasnippet" "snippets/js-mode/jstd.testCase.yasnippet" "snippets/js-mode/node.ifnode.yasnippet" "snippets/js-mode/node.module.exports.yasnippet" "snippets/js-mode/node.require.yasnippet" "snippets/js-mode/object.create" "snippets/js-mode/object.create-property" "snippets/js-mode/object.create-property+" "snippets/js-mode/this.yasnippet" "snippets/js-mode/try" "snippets/js2-mode/.yas-parents" "snippets/js2-mode/al" "snippets/js2-mode/class" "snippets/js2-mode/com" "snippets/js2-mode/debugger" "snippets/js2-mode/each" "snippets/js2-mode/el" "snippets/js2-mode/ev.add" "snippets/js2-mode/ev.fire" "snippets/js2-mode/for" "snippets/js2-mode/function" "snippets/js2-mode/if" "snippets/js2-mode/init" "snippets/js2-mode/log" "snippets/js2-mode/multiline-comment" "snippets/js2-mode/param-comment" "snippets/js2-mode/req.html" "snippets/js2-mode/req.json" "snippets/js2-mode/return-comment" "snippets/js2-mode/type-inline-comment" "snippets/js2-mode/type-multiline-comment" "snippets/latex-mode/absolute" "snippets/latex-mode/acronym" "snippets/latex-mode/addcolumn" "snippets/latex-mode/alertblock" "snippets/latex-mode/alg" "snippets/latex-mode/algorithm" "snippets/latex-mode/alignedequation" "snippets/latex-mode/alpha" "snippets/latex-mode/alternatingunittensor" "snippets/latex-mode/ampersand" "snippets/latex-mode/andforcolumns" "snippets/latex-mode/approximate" "snippets/latex-mode/baroraverage" "snippets/latex-mode/begin" "snippets/latex-mode/belongsto" "snippets/latex-mode/beta" "snippets/latex-mode/bibliography" "snippets/latex-mode/block" "snippets/latex-mode/bm" "snippets/latex-mode/boldsymbol" "snippets/latex-mode/booktabs" "snippets/latex-mode/bottomrule" "snippets/latex-mode/capgls" "snippets/latex-mode/caption" "snippets/latex-mode/chapter" "snippets/latex-mode/chi" "snippets/latex-mode/choosefrom" "snippets/latex-mode/circ" "snippets/latex-mode/circlecross" "snippets/latex-mode/cite" "snippets/latex-mode/code" "snippets/latex-mode/columns" "snippets/latex-mode/cosine" "snippets/latex-mode/cosineinverse" "snippets/latex-mode/cosinepower" "snippets/latex-mode/costfunction" "snippets/latex-mode/curl" "snippets/latex-mode/cyclicintegral" "snippets/latex-mode/dash" "snippets/latex-mode/definedas" "snippets/latex-mode/delta" "snippets/latex-mode/deltaupper" "snippets/latex-mode/description" "snippets/latex-mode/differential" "snippets/latex-mode/differentialdot" "snippets/latex-mode/differentialfraction" "snippets/latex-mode/differentialpower" "snippets/latex-mode/differentialpowerfraction" "snippets/latex-mode/differentialupper" "snippets/latex-mode/differentialupperfraction" "snippets/latex-mode/differentialupperpower" "snippets/latex-mode/differentialupperpowerfraction" "snippets/latex-mode/divergence" "snippets/latex-mode/dots" "snippets/latex-mode/doubleintegral" "snippets/latex-mode/emph" "snippets/latex-mode/emphasisbox" "snippets/latex-mode/emphasize" "snippets/latex-mode/environment" "snippets/latex-mode/epsilon" "snippets/latex-mode/epsilonupper" "snippets/latex-mode/equation" "snippets/latex-mode/equivalentorsameas" "snippets/latex-mode/eta" "snippets/latex-mode/evaluatedat" "snippets/latex-mode/exampleblock" "snippets/latex-mode/exponential" "snippets/latex-mode/figure" "snippets/latex-mode/forall" "snippets/latex-mode/frac" "snippets/latex-mode/fraction" "snippets/latex-mode/frame" "snippets/latex-mode/framebox" "snippets/latex-mode/gamma" "snippets/latex-mode/gammaupper" "snippets/latex-mode/gls" "snippets/latex-mode/glspl" "snippets/latex-mode/gradient" "snippets/latex-mode/graphicspath" "snippets/latex-mode/greaterthanequalto" "snippets/latex-mode/hat" "snippets/latex-mode/hline" "snippets/latex-mode/hspace" "snippets/latex-mode/hyperboliccosine" "snippets/latex-mode/hyperboliccosineinverse" "snippets/latex-mode/hyperboliccosinepower" "snippets/latex-mode/hyperbolicsine" "snippets/latex-mode/hyperbolicsineinverse" "snippets/latex-mode/hyperbolicsinepower" "snippets/latex-mode/hyperbolictangent" "snippets/latex-mode/hyperbolictangentinverse" "snippets/latex-mode/hyperbolictangentpower" "snippets/latex-mode/hyperlink" "snippets/latex-mode/if" "snippets/latex-mode/ifandonlyif" "snippets/latex-mode/implies" "snippets/latex-mode/includegraphics" "snippets/latex-mode/infinity" "snippets/latex-mode/infinitysubscript" "snippets/latex-mode/inlinemath" "snippets/latex-mode/inputfile" "snippets/latex-mode/intersection" "snippets/latex-mode/interspacing" "snippets/latex-mode/iota" "snippets/latex-mode/item" "snippets/latex-mode/itemize" "snippets/latex-mode/iterintersection" "snippets/latex-mode/iterunion" "snippets/latex-mode/kappa" "snippets/latex-mode/kroeneckerdelta" "snippets/latex-mode/label" "snippets/latex-mode/lambda" "snippets/latex-mode/laplacian" "snippets/latex-mode/leftarrow" "snippets/latex-mode/lessthanorequalto" "snippets/latex-mode/limit" "snippets/latex-mode/linebreak" "snippets/latex-mode/listing" "snippets/latex-mode/listinputlisting" "snippets/latex-mode/listoffigures" "snippets/latex-mode/listoftables" "snippets/latex-mode/lstlanguage" "snippets/latex-mode/mathbotsyms" "snippets/latex-mode/mathcaligraphic" "snippets/latex-mode/matheulerscript" "snippets/latex-mode/mathfonts" "snippets/latex-mode/mathtopsyms" "snippets/latex-mode/matrix" "snippets/latex-mode/maximum" "snippets/latex-mode/midrule" "snippets/latex-mode/minimum" "snippets/latex-mode/movie" "snippets/latex-mode/mu" "snippets/latex-mode/multipartfunction" "snippets/latex-mode/mychapter" "snippets/latex-mode/nabla" "snippets/latex-mode/naturallog" "snippets/latex-mode/newcommand" "snippets/latex-mode/newdescription" "snippets/latex-mode/newglossaryentry" "snippets/latex-mode/newitem" "snippets/latex-mode/newlinbreak" "snippets/latex-mode/newline" "snippets/latex-mode/newlinemath" "snippets/latex-mode/newpage" "snippets/latex-mode/newtablecolumn" "snippets/latex-mode/noindent" "snippets/latex-mode/norm" "snippets/latex-mode/note" "snippets/latex-mode/notequal" "snippets/latex-mode/nu" "snippets/latex-mode/odot" "snippets/latex-mode/omega" "snippets/latex-mode/omegaupper" "snippets/latex-mode/partial" "snippets/latex-mode/partialfraction" "snippets/latex-mode/partialpower" "snippets/latex-mode/partialpowerfraction" "snippets/latex-mode/phi" "snippets/latex-mode/phiupper" "snippets/latex-mode/pi" "snippets/latex-mode/piecewisefunction" "snippets/latex-mode/piupper" "snippets/latex-mode/plusorminus" "snippets/latex-mode/preamble" "snippets/latex-mode/prime" "snippets/latex-mode/primepower" "snippets/latex-mode/probability" "snippets/latex-mode/product" "snippets/latex-mode/proportional" "snippets/latex-mode/psi" "snippets/latex-mode/psiupper" "snippets/latex-mode/python" "snippets/latex-mode/question" "snippets/latex-mode/reference" "snippets/latex-mode/renewcommand" "snippets/latex-mode/rho" "snippets/latex-mode/rightarrow" "snippets/latex-mode/scaledangles" "snippets/latex-mode/scaledbars" "snippets/latex-mode/scaledcurlybraces" "snippets/latex-mode/scaledparenthesis" "snippets/latex-mode/scaledsquarebrackets" "snippets/latex-mode/sec" "snippets/latex-mode/section" "snippets/latex-mode/selectsize" "snippets/latex-mode/sets" "snippets/latex-mode/sigma" "snippets/latex-mode/sigmaupper" "snippets/latex-mode/similar" "snippets/latex-mode/sine" "snippets/latex-mode/sineinverse" "snippets/latex-mode/sinepower" "snippets/latex-mode/singleintegral" "snippets/latex-mode/siunits" "snippets/latex-mode/squareroot" "snippets/latex-mode/starpower" "snippets/latex-mode/subandsuperscript" "snippets/latex-mode/subf" "snippets/latex-mode/subfigure" "snippets/latex-mode/subscript" "snippets/latex-mode/subsec" "snippets/latex-mode/subsection" "snippets/latex-mode/subsubsection" "snippets/latex-mode/summation" "snippets/latex-mode/superandsubscript" "snippets/latex-mode/superscript" "snippets/latex-mode/table" "snippets/latex-mode/tableofcontents" "snippets/latex-mode/tangent" "snippets/latex-mode/tangentinverse" "snippets/latex-mode/tangentpower" "snippets/latex-mode/tau" "snippets/latex-mode/tauupper" "snippets/latex-mode/tensor" "snippets/latex-mode/tensorproduct" "snippets/latex-mode/text" "snippets/latex-mode/textbf" "snippets/latex-mode/texttype" "snippets/latex-mode/therefore" "snippets/latex-mode/theta" "snippets/latex-mode/thetaupper" "snippets/latex-mode/tikzpicture" "snippets/latex-mode/tilde" "snippets/latex-mode/times" "snippets/latex-mode/title" "snippets/latex-mode/toprule" "snippets/latex-mode/tripleintegral" "snippets/latex-mode/underline" "snippets/latex-mode/union" "snippets/latex-mode/usepackage" "snippets/latex-mode/vector" "snippets/latex-mode/vspace" "snippets/latex-mode/vspacenoindent" "snippets/latex-mode/xi" "snippets/lisp-mode/class" "snippets/lisp-mode/comment" "snippets/lisp-mode/defpackage" "snippets/lisp-mode/do" "snippets/lisp-mode/for" "snippets/lisp-mode/foreach" "snippets/lisp-mode/format" "snippets/lisp-mode/if" "snippets/lisp-mode/ifelse" "snippets/lisp-mode/ifnot" "snippets/lisp-mode/slot" "snippets/lisp-mode/switch" "snippets/lisp-mode/typecast" "snippets/makefile-mode/all" "snippets/markdown-mode/+" "snippets/markdown-mode/-" "snippets/markdown-mode/.yas-parents" "snippets/markdown-mode/_" "snippets/markdown-mode/__" "snippets/markdown-mode/`" "snippets/markdown-mode/boldface" "snippets/markdown-mode/codeblock" "snippets/markdown-mode/codeinline" "snippets/markdown-mode/emphasis" "snippets/markdown-mode/githubcodeblock" "snippets/markdown-mode/h1.1" "snippets/markdown-mode/h1.2" "snippets/markdown-mode/h2.1" "snippets/markdown-mode/h2.2" "snippets/markdown-mode/h3" "snippets/markdown-mode/h4" "snippets/markdown-mode/h5" "snippets/markdown-mode/h6" "snippets/markdown-mode/header1" "snippets/markdown-mode/header2" "snippets/markdown-mode/header3" "snippets/markdown-mode/header4" "snippets/markdown-mode/headerequal" "snippets/markdown-mode/headerminus" "snippets/markdown-mode/hexocodeblock" "snippets/markdown-mode/highlight" "snippets/markdown-mode/horizontalrule" "snippets/markdown-mode/hr.1" "snippets/markdown-mode/hr.2" "snippets/markdown-mode/image" "snippets/markdown-mode/img" "snippets/markdown-mode/link" "snippets/markdown-mode/octopress-post" "snippets/markdown-mode/ol" "snippets/markdown-mode/orderedlist" "snippets/markdown-mode/rcodeblock" "snippets/markdown-mode/referenceimage" "snippets/markdown-mode/referencelabel" "snippets/markdown-mode/referencelink" "snippets/markdown-mode/rimg" "snippets/markdown-mode/rlb" "snippets/markdown-mode/rlink" "snippets/markdown-mode/unorderedlist" "snippets/markdown-mode/utf8" "snippets/org-mode/.yas-parents" "snippets/org-mode/angularjs.snippet" "snippets/org-mode/babel-shell.yasnippet" "snippets/org-mode/bibliography" "snippets/org-mode/blog" "snippets/org-mode/coffeescript.snippet" "snippets/org-mode/diary.yasnippet" "snippets/org-mode/dir" "snippets/org-mode/elisp" "snippets/org-mode/exports" "snippets/org-mode/graphviz" "snippets/org-mode/heading1" "snippets/org-mode/heading2" "snippets/org-mode/heading3" "snippets/org-mode/heading4" "snippets/org-mode/heading5" "snippets/org-mode/javascript.snippet" "snippets/org-mode/journal" "snippets/org-mode/lorem ipsum.yasnippet" "snippets/org-mode/openstack.snippet" "snippets/org-mode/orglink" "snippets/org-mode/revealfooter" "snippets/org-mode/revealfragmentstyle" "snippets/org-mode/revealheader" "snippets/org-mode/revealhlevel" "snippets/org-mode/revealmargin" "snippets/org-mode/revealmaxscale" "snippets/org-mode/revealminimumscale" "snippets/org-mode/revealpropertybg" "snippets/org-mode/revealpropertybgrepeat" "snippets/org-mode/revealpropertybgsize" "snippets/org-mode/revealpropertybgtransition" "snippets/org-mode/revealpropertydatastate" "snippets/org-mode/revealroot" "snippets/org-mode/revealslidenum" "snippets/org-mode/revealsplit" "snippets/org-mode/revealtheme" "snippets/org-mode/revealtitlebackground" "snippets/org-mode/revealtitlebg-repeat" "snippets/org-mode/revealtitlebg-size" "snippets/org-mode/revealtransition" "snippets/org-mode/session" "snippets/org-mode/src" "snippets/org-mode/srcexport" "snippets/org-mode/srcfile" "snippets/org-mode/srcresults" "snippets/org-mode/tagkeys" "snippets/org-mode/tagstat" "snippets/org-mode/tangle" "snippets/org-mode/title.yasnippet" "snippets/org-mode/todokey" "snippets/org-mode/todostat" "snippets/org-mode/uml-activity" "snippets/org-mode/uml-class" "snippets/org-mode/uml-component" "snippets/org-mode/uml-sequence" "snippets/org-mode/uml-state" "snippets/org-mode/uml-usecase" "snippets/org-mode/var" "snippets/org-mode/variable" "snippets/php-mode/fun" "snippets/php-mode/funs" "snippets/php-mode/private-function" "snippets/php-mode/public-function" "snippets/php-mode/req" "snippets/python-mode/.yas-parents" "snippets/python-mode/.yas-setup.el" "snippets/python-mode/__contains__" "snippets/python-mode/__enter__" "snippets/python-mode/__exit__" "snippets/python-mode/__getitem__" "snippets/python-mode/__len__" "snippets/python-mode/__new__" "snippets/python-mode/__setitem__" "snippets/python-mode/all" "snippets/python-mode/arg" "snippets/python-mode/arg_positional" "snippets/python-mode/assert" "snippets/python-mode/assertEqual" "snippets/python-mode/assertFalse" "snippets/python-mode/assertIn" "snippets/python-mode/assertNotEqual" "snippets/python-mode/assertNotIn" "snippets/python-mode/assertRaises" "snippets/python-mode/assertRaises.with" "snippets/python-mode/assertTrue" "snippets/python-mode/bang" "snippets/python-mode/celery_pdb" "snippets/python-mode/class" "snippets/python-mode/classmethod" "snippets/python-mode/cls" "snippets/python-mode/dec" "snippets/python-mode/def" "snippets/python-mode/defm" "snippets/python-mode/deftest" "snippets/python-mode/django_test_class" "snippets/python-mode/doc" "snippets/python-mode/doctest" "snippets/python-mode/embed" "snippets/python-mode/eq" "snippets/python-mode/for" "snippets/python-mode/from" "snippets/python-mode/function" "snippets/python-mode/function_docstring" "snippets/python-mode/function_docstring_numpy" "snippets/python-mode/if" "snippets/python-mode/ife" "snippets/python-mode/ifmain" "snippets/python-mode/import" "snippets/python-mode/init" "snippets/python-mode/init_docstring" "snippets/python-mode/interact" "snippets/python-mode/ipdbdebug" "snippets/python-mode/iter" "snippets/python-mode/lambda" "snippets/python-mode/list" "snippets/python-mode/logger_name" "snippets/python-mode/logging" "snippets/python-mode/main" "snippets/python-mode/metaclass" "snippets/python-mode/method" "snippets/python-mode/method_docstring" "snippets/python-mode/not_impl" "snippets/python-mode/np" "snippets/python-mode/parse_args" "snippets/python-mode/parser" "snippets/python-mode/pass" "snippets/python-mode/pl" "snippets/python-mode/pprint.yasnippet" "snippets/python-mode/print" "snippets/python-mode/prop" "snippets/python-mode/reg" "snippets/python-mode/repr" "snippets/python-mode/return" "snippets/python-mode/scls" "snippets/python-mode/script" "snippets/python-mode/self" "snippets/python-mode/self_without_dot" "snippets/python-mode/selfassign" "snippets/python-mode/setdef" "snippets/python-mode/setup" "snippets/python-mode/shebang" "snippets/python-mode/size" "snippets/python-mode/static" "snippets/python-mode/str" "snippets/python-mode/super" "snippets/python-mode/test_class" "snippets/python-mode/test_file" "snippets/python-mode/trace" "snippets/python-mode/try" "snippets/python-mode/tryelse" "snippets/python-mode/unicode" "snippets/python-mode/unicode_literals" "snippets/python-mode/utf8" "snippets/python-mode/while" "snippets/python-mode/with" "snippets/python-mode/with_statement" "snippets/ruby-mode/#" "snippets/ruby-mode/=b" "snippets/ruby-mode/Comp" "snippets/ruby-mode/Enum" "snippets/ruby-mode/GLOB" "snippets/ruby-mode/all" "snippets/ruby-mode/am" "snippets/ruby-mode/any" "snippets/ruby-mode/app" "snippets/ruby-mode/assert_equal" "snippets/ruby-mode/attribute" "snippets/ruby-mode/bench" "snippets/ruby-mode/bm" "snippets/ruby-mode/case" "snippets/ruby-mode/cla" "snippets/ruby-mode/class" "snippets/ruby-mode/cls" "snippets/ruby-mode/collect" "snippets/ruby-mode/dee" "snippets/ruby-mode/def" "snippets/ruby-mode/def.self" "snippets/ruby-mode/deftest" "snippets/ruby-mode/deli" "snippets/ruby-mode/det" "snippets/ruby-mode/do-block" "snippets/ruby-mode/dow" "snippets/ruby-mode/ea" "snippets/ruby-mode/eac" "snippets/ruby-mode/eai" "snippets/ruby-mode/eav" "snippets/ruby-mode/eawi" "snippets/ruby-mode/for" "snippets/ruby-mode/forin" "snippets/ruby-mode/formula" "snippets/ruby-mode/if" "snippets/ruby-mode/ife" "snippets/ruby-mode/inc" "snippets/ruby-mode/init" "snippets/ruby-mode/inject" "snippets/ruby-mode/map" "snippets/ruby-mode/mm" "snippets/ruby-mode/mod" "snippets/ruby-mode/pry" "snippets/ruby-mode/r" "snippets/ruby-mode/rb" "snippets/ruby-mode/red" "snippets/ruby-mode/reject" "snippets/ruby-mode/rel" "snippets/ruby-mode/req" "snippets/ruby-mode/rpry" "snippets/ruby-mode/rw" "snippets/ruby-mode/select" "snippets/ruby-mode/str" "snippets/ruby-mode/test class" "snippets/ruby-mode/testcase" "snippets/ruby-mode/tim" "snippets/ruby-mode/to_" "snippets/ruby-mode/tu" "snippets/ruby-mode/until" "snippets/ruby-mode/upt" "snippets/ruby-mode/w" "snippets/ruby-mode/when" "snippets/ruby-mode/while" "snippets/ruby-mode/y" "snippets/ruby-mode/zip" "snippets/sh-mode/args" "snippets/sh-mode/bang" "snippets/sh-mode/for loop" "snippets/sh-mode/function" "snippets/sh-mode/if" "snippets/sh-mode/ife" "snippets/sh-mode/safe-bang" "snippets/sh-mode/until" "snippets/sh-mode/while" "snippets/snippet-mode/cont" "snippets/snippet-mode/elisp" "snippets/snippet-mode/field" "snippets/snippet-mode/group" "snippets/snippet-mode/mirror" "snippets/snippet-mode/vars" "snippets/sql-mode/column" "snippets/sql-mode/constraint" "snippets/sql-mode/constraint.1" "snippets/sql-mode/create" "snippets/sql-mode/create.1" "snippets/sql-mode/insert" "snippets/sql-mode/references" "snippets/web-mode/.yas-parents" "snippets/web-mode/dd" "snippets/web-mode/div" "snippets/web-mode/dl" "snippets/web-mode/doctype" "snippets/web-mode/doctype.html5" "snippets/web-mode/doctype.xhtml1" "snippets/web-mode/doctype.xhtml1_1" "snippets/web-mode/doctype.xhtml1_strict" "snippets/web-mode/doctype.xhtml1_transitional" "snippets/web-mode/dt" "snippets/web-mode/form" "snippets/web-mode/html" "snippets/web-mode/html.xmlns" "snippets/web-mode/link.import" "snippets/web-mode/link.stylesheet" "snippets/web-mode/link.stylesheet-ie" "snippets/web-mode/mailto" "snippets/web-mode/meta" "snippets/web-mode/meta.http-equiv" "snippets/web-mode/script.javascript" "snippets/web-mode/script.javascript-src" "snippets/web-mode/textarea" "snippets/web-mode/th" "srecode-map.el" "testLisp.lisp" "themes/color-theme-tomorrow.el" "themes/img/guide-extra.png" "themes/img/guide-generic.png" "themes/img/guide-org.png" "themes/img/org.png" "themes/img/preview.png" "themes/img/spacemacs-theme.png" "themes/spacemacs-common.el" "themes/spacemacs-dark-theme.el" "themes/spacemacs-light-theme.el" "themes/spacemacs-theme-pkg.el" "themes/tomorrow-night-blue-theme.el" "themes/tomorrow-night-bright-theme.el" "themes/tomorrow-night-eighties-theme.el" "themes/tomorrow-night-theme.el" "themes/tomorrow-theme.el" "themes/zenburn-theme.el" "url/cookies") "k:/clojure-home/test-clojure1/" (".gitignore" ".hgignore" ".nrepl-port" "CHANGELOG.md" "LICENSE" "README.md" "doc/intro.md" "project.clj" "src/test_clojure1/core.clj" "target/base+system+user+dev/classes/META-INF/maven/test-clojure1/test-clojure1/pom.properties" "target/base+system+user+dev/repl-port" "target/base+system+user+dev/stale/leiningen.core.classpath.extract-native-dependencies" "target/default/classes/META-INF/maven/test-clojure1/test-clojure1/pom.properties" "target/default/repl-port" "target/default/stale/leiningen.core.classpath.extract-native-dependencies" "target/uberjar/classes/META-INF/maven/test-clojure1/test-clojure1/pom.properties" "target/uberjar/classes/test_clojure1/core$_main.class" "target/uberjar/classes/test_clojure1/core$fn__38.class" "target/uberjar/classes/test_clojure1/core$loading__5569__auto____36.class" "target/uberjar/classes/test_clojure1/core.class" "target/uberjar/classes/test_clojure1/core__init.class" "target/uberjar/stale/leiningen.core.classpath.extract-native-dependencies" "target/uberjar/test-clojure1-0.1.0-SNAPSHOT-standalone.jar" "target/uberjar/test-clojure1-0.1.0-SNAPSHOT.jar" "test/test_clojure1/core_test.clj") "c:/Users/yzl/perl/" (".gitignore" ";" "Path.md" "Result/Result.csv" "TXT/testArgv.pl" "Word/word1.docx" "a.pl" "a.pl.html" "accessPeople.pl" "ack" "analysisFeiji.pl" "analysisFeiji2.pl" "analysisSkewdata.pl" "analysisfeijiutf8.pl" "convertword.pl" "diamond_cat.pl" "feiji.txt" "feiji2.txt" "feijichang.pl" "feijichang.pl.bak" "feijiutf8.txt" "generateSqlite.db" "getDataFromKeyword.pl" "getStatistic.pl" "grade.dat" "gradeAnalysis.pl" "keyword.txt" "people.dat" "pod2htmd.tmp" "regex/LICENSE" "regex/README.md" "regex/chapter1/%^amp!20_+.txt" "regex/chapter1/doublename.txt" "regex/chapter1/file.md" "regex/chapter1/helloworld.txt" "regex/chapter1/test2.txt" "regex/chapter1/wildcards.txt" "regex/chapter2/24hrtimes.txt" "regex/chapter2/addingcommas" "regex/chapter2/automatedediting.txt" "regex/chapter2/c2f.pl" "regex/chapter2/convert.pl" "regex/chapter2/convert2.pl" "regex/chapter2/domain.txt" "regex/chapter2/email.txt" "regex/chapter2/event.pl" "regex/chapter2/eventsources.txt" "regex/chapter2/grey.txt" "regex/chapter2/jeffs" "regex/chapter2/jeffsregex" "regex/chapter2/jefftest.txt" "regex/chapter2/king.in" "regex/chapter2/mkreply" "regex/chapter2/replacetxt.pl" "regex/chapter2/test.txt" "regex/chapter2/text-to-html.pl" "regex/chapter2/text.txt" "regex/chapter2/username.txt" "regex/chapter5/csvprocessing.vbs" "regex/chapter5/data.txt" "regex/introduction-to-regex/introduction-to-regex-configs/IntroToRegex.ps1" "regex/introduction-to-regex/introduction-to-regex-configs/IntroToRegex.psd1" "regex/introduction-to-regex/introduction-to-regex-configs/introduction-to-regex-vmSetup.ps1" "regex/introduction-to-regex/introduction-to-regex-m1/introduction-to-regex-m1-demos-02.ps1" "regex/introduction-to-regex/introduction-to-regex-m1/introduction-to-regex-m1-notes.md" "regex/introduction-to-regex/introduction-to-regex-m2/Intro-To-Regex-m2-demos-01.ps1" "runPerlWebQq.pl" "skewEnglish.txt" "skewdata.dat" "skewdata.txt" "skeweng.txt" "sqliteLink.pl" "statistic.dat" "ta.pl" "testAdvancedRegex.pl" "testArgv.pl" "testArgv.pl.bak" "testArray.pl" "testBatModify.pl" "testBatModify.pl.bak" "testDebugTrnAndPhase.pl" "testDotdot.pl" "testG.pl" "testGiven.pl" "testHashEach.pl" "testHashExist.pl" "testHello.pl" "testLWP2.pl" "testLWP20121216.pl" "testLwp.pl" "testMail.pl" "testOut.pl" "testProcessOut.pl" "testRef.pl" "testReference.pl" "testRegexLingKuanduanyan.pl" "testRound.pl" "testSigleOut.pl" "testSplit.pl" "testTrnOut.pl" "testdbi.pl" "testdbi.pl.bak" "testifelsif.pl"))) \ No newline at end of file diff --git a/srecode-map.el b/srecode-map.el index fea986e..444e8ec 100644 --- a/srecode-map.el +++ b/srecode-map.el @@ -2,5 +2,5 @@ ;; EIEIO PERSISTENT OBJECT (srecode-map "srecode-map" :file "srecode-map.el" - :files '(("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/wisent.srt" . wisent-grammar-mode) ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/texi.srt" . texinfo-mode) ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/template.srt" . srecode-template-mode) ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/make.srt" . makefile-mode) ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/java.srt" . java-mode) ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/el.srt" . emacs-lisp-mode) ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/default.srt" . default) ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/cpp.srt" . c++-mode) ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/c.srt" . c-mode)) - :apps '((tests ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/test.srt" . srecode-template-mode)) (getset ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/getset-cpp.srt" . c++-mode)) (ede ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/ede-make.srt" . makefile-mode) ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/ede-autoconf.srt" . autoconf-mode)) (document ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/doc-java.srt" . java-mode) ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/doc-default.srt" . default) ("g:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/doc-cpp.srt" . c-mode)))) + :files '(("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/wisent.srt" . wisent-grammar-mode) ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/texi.srt" . texinfo-mode) ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/template.srt" . srecode-template-mode) ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/make.srt" . makefile-mode) ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/java.srt" . java-mode) ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/el.srt" . emacs-lisp-mode) ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/default.srt" . default) ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/cpp.srt" . c++-mode) ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/c.srt" . c-mode)) + :apps '((tests ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/test.srt" . srecode-template-mode)) (getset ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/getset-cpp.srt" . c++-mode)) (ede ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/ede-make.srt" . makefile-mode) ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/ede-autoconf.srt" . autoconf-mode)) (document ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/doc-java.srt" . java-mode) ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/doc-default.srt" . default) ("k:/clojure-home/emacs-25.3-x86_64/share/emacs/25.3/etc/srecode/doc-cpp.srt" . c-mode)))) diff --git a/test.ledger b/test.ledger index b1395ec..d3e5944 100644 --- a/test.ledger +++ b/test.ledger @@ -16,18 +16,18 @@ 2018-06-17 妈祖岛吃鱿鱼 Expenses:Food RMB 115 - Liabilities:花呗huabei + Liabilities:花呗Huabei 2018-06-18 海鲜烧烤 Expenses:Food RMB 249 - Liabilities:花呗huabei + Liabilities:花呗Huabei 2018-06-19 两根小香肠 王庆坨服务区 Expenses:Food RMB 10 - Liabilities:花呗huabei + Liabilities:花呗Huabei 2018-06-19 匹夫烧烤 Expenses:Food RMB 83 - Liabilities:花呗huabei + Liabilities:花呗Huabei 2018-06-19 火车票报销收入 Assets:Savings:建行7889 RMB 2160 @@ -173,3 +173,11 @@ 2018-07-16 加氟 Expenses:House-living RMB 650 Assets:Savings:建行7889 + +2018-07-31 水果 + Expenses:Fruits RMB 22 + Liabilities:花呗Huabei + +2018-07-31 龙泽水果 + Expenses:Fruits RMB 30 + Liabilities:花呗Huabei diff --git a/test.md b/test.md new file mode 100644 index 0000000..49a1388 --- /dev/null +++ b/test.md @@ -0,0 +1,2 @@ + +dfdsf diff --git a/vimish-fold/c!!Users!yzl!AppData!Roaming!.emacs.d!README.md b/vimish-fold/c!!Users!yzl!AppData!Roaming!.emacs.d!README.md deleted file mode 100644 index 4345da2..0000000 --- a/vimish-fold/c!!Users!yzl!AppData!Roaming!.emacs.d!README.md +++ /dev/null @@ -1 +0,0 @@ -((173705 173782 t))