Compare commits
27 Commits
pkgs-updat
...
504c2b1bfa
| Author | SHA1 | Date | |
|---|---|---|---|
| 504c2b1bfa | |||
| 156cec64fb | |||
| 8b80ceda39 | |||
| b18d02d8d5 | |||
| ddba0ba9cd | |||
| 94dd0e848e | |||
| 52815c9fe4 | |||
| b11956a890 | |||
| 5e9bb3b882 | |||
| 3894350a6a | |||
| c43933e9f6 | |||
| 3b54a3236d | |||
| e162a12b58 | |||
| f3935715a4 | |||
| a075f93c3e | |||
| 6253368410 | |||
| ce2c9354ed | |||
| 900a4d9928 | |||
| 3476d496a7 | |||
| 1e9910e471 | |||
| a4e15965bb | |||
| 99a0d6a185 | |||
| d95f45d049 | |||
| 4fe9a6b7e1 | |||
| d861ac5e74 | |||
| 4b839a12cd | |||
| 43d61b31d4 |
333
README.md
333
README.md
@@ -2,11 +2,12 @@
|
||||
# Table of Contents
|
||||
|
||||
1. [Installation](#installation)
|
||||
2. [Usage](#usage)
|
||||
3. [Packages](#packages)
|
||||
4. [Information](#information)
|
||||
5. [Errors](#errors)
|
||||
6. [TODOs](#todos)
|
||||
2. [External programs](#programs)
|
||||
3. [Usage](#usage)
|
||||
4. [Packages](#packages)
|
||||
5. [Information](#information)
|
||||
6. [Errors](#errors)
|
||||
7. [TODOs](#todos)
|
||||
|
||||
This is an ongoing evolution of Emacs configuration files, inspired by
|
||||
a bunch of online resources.
|
||||
@@ -16,17 +17,41 @@ a bunch of online resources.
|
||||
|
||||
# Installation
|
||||
|
||||
Download repo and point the emacs `init` (and `early-init.el`) file to
|
||||
this configuration.
|
||||
Different ways to install:
|
||||
|
||||
Or run one of the following install script commands (using curl, wget or fetch).
|
||||
- **arch-linux:** If `emacs-conf` is available in a `custom` `pacman` repository
|
||||
|
||||
sh -c "$(curl -fsSL http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
||||
sh -c "$(wget -O- http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
||||
sh -c "$(fetch -o - http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
||||
pacman -S emacs-conf
|
||||
ln -s /opt/emacs-conf/init ~/.config/emacs/
|
||||
ln -s /opt/emacs-conf/early-init.el ~/.config/emacs/
|
||||
|
||||
Installation path is `~/.config/emacs`. See details and other
|
||||
installed linux packages as requirements inside `sripts/install.sh`.
|
||||
- **debian:** If `emacs-conf` is available in a `custom` `apt` repository
|
||||
|
||||
apt install emacs-conf
|
||||
ln -s /opt/emacs-conf/init ~/.config/emacs/
|
||||
ln -s /opt/emacs-conf/early-init.el ~/.config/emacs/
|
||||
|
||||
- **manual:** Download or clone git repo and point the emacs `init` and
|
||||
`early-init.el` file to this configuration.
|
||||
|
||||
- **old:** Run one of the following install script commands (using curl,
|
||||
wget or fetch).
|
||||
|
||||
sh -c "$(curl -fsSL http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
||||
sh -c "$(wget -O- http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
||||
sh -c "$(fetch -o - http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
||||
|
||||
Installation path is `~/.config/emacs`. See details and other
|
||||
installed linux packages as requirements inside `sripts/install.sh`.
|
||||
|
||||
|
||||
<a id="programs"></a>
|
||||
|
||||
# External programs
|
||||
|
||||
- `ripgrep` (optional) used by `counsel-rg` (package `counsel`)
|
||||
- `texlive-luatex` for `luainputenc.sty` used by org latex export
|
||||
- `texlive-xetex` for `realscripts.sty` for `KpRoman` used by org latex export
|
||||
|
||||
|
||||
<a id="usage"></a>
|
||||
@@ -60,7 +85,7 @@ General key bindings and functions
|
||||
|
||||
- `C-r` (`query-replace-regexp`) replace text
|
||||
- `C-x RET f` (`set-buffer-file-coding-system`) e.g. set to =utf-8
|
||||
- (`decode-coding-region`) e.g. decode to `utf-8` (郭富城Aaron Kwok)
|
||||
- (`decode-coding-region`) e.g. decode to `utf-8` (e.g. 晴天)
|
||||
- (`diff-buffer-with-file`) show a diff between buffer (current state) and file (saved state)
|
||||
|
||||
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
@@ -97,35 +122,42 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">all-the-icons</td>
|
||||
<td class="org-right">20220929.2303</td>
|
||||
<td class="org-right">20230909.2053</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">all-the-icons-ivy-rich</td>
|
||||
<td class="org-right">20230420.1234</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">amx</td>
|
||||
<td class="org-right">20210305.118</td>
|
||||
<td class="org-right">20230413.121</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">anaconda-mode</td>
|
||||
<td class="org-right">20220922.741</td>
|
||||
<td class="org-right">20230821.2131</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">async</td>
|
||||
<td class="org-right">20221217.649</td>
|
||||
<td class="org-right">20230528.622</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">avy</td>
|
||||
<td class="org-right">20220910.1936</td>
|
||||
<td class="org-right">20230420.404</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -139,35 +171,42 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">biblio</td>
|
||||
<td class="org-right">20210418.406</td>
|
||||
<td class="org-right">20230202.1721</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">biblio-core</td>
|
||||
<td class="org-right">20210418.406</td>
|
||||
<td class="org-right">20230202.1721</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">bibtex-completion</td>
|
||||
<td class="org-right">20221024.857</td>
|
||||
<td class="org-right">20230918.953</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">bind-key</td>
|
||||
<td class="org-right">20221209.2013</td>
|
||||
<td class="org-right">20230203.2004</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">cfrs</td>
|
||||
<td class="org-right">20220129.1149</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">citeproc</td>
|
||||
<td class="org-right">20221216.1238</td>
|
||||
<td class="org-right">20230228.1414</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -181,14 +220,14 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">company</td>
|
||||
<td class="org-right">20221206.2122</td>
|
||||
<td class="org-right">20231023.1033</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">company-anaconda</td>
|
||||
<td class="org-right">20200404.1859</td>
|
||||
<td class="org-right">20230821.2126</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -202,7 +241,14 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">company-quickhelp</td>
|
||||
<td class="org-right">20221212.534</td>
|
||||
<td class="org-right">20231026.1714</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">company-statistics</td>
|
||||
<td class="org-right">20170210.1933</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -214,9 +260,16 @@ General key bindings and functions
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">compat</td>
|
||||
<td class="org-right">29.1.4.2</td>
|
||||
<td class="org-left">elpa-gnu</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">counsel</td>
|
||||
<td class="org-right">20221015.936</td>
|
||||
<td class="org-right">20231025.2311</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -237,14 +290,14 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">dash</td>
|
||||
<td class="org-right">20221013.836</td>
|
||||
<td class="org-right">20230714.723</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">dashboard</td>
|
||||
<td class="org-right">20221206.1228</td>
|
||||
<td class="org-right">20231031.359</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -272,7 +325,7 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">diff-hl</td>
|
||||
<td class="org-right">20221007.2147</td>
|
||||
<td class="org-right">20230807.1516</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -286,7 +339,28 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">elisp-refs</td>
|
||||
<td class="org-right">20220704.2141</td>
|
||||
<td class="org-right">20230920.201</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">emacsql</td>
|
||||
<td class="org-right">20230417.1448</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">emacsql-sqlite</td>
|
||||
<td class="org-right">20230225.2205</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">emacsql-sqlite-builtin</td>
|
||||
<td class="org-right">20230409.1847</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -300,7 +374,7 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">ess</td>
|
||||
<td class="org-right">20221204.1348</td>
|
||||
<td class="org-right">20230807.1422</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -314,14 +388,14 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">f</td>
|
||||
<td class="org-right">20220911.711</td>
|
||||
<td class="org-right">20230823.1159</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">flycheck</td>
|
||||
<td class="org-right">20221213.107</td>
|
||||
<td class="org-right">20230813.62</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -363,7 +437,7 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">git-commit</td>
|
||||
<td class="org-right">20221127.2227</td>
|
||||
<td class="org-right">20231030.2243</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -377,21 +451,21 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">gnuplot</td>
|
||||
<td class="org-right">20221112.2049</td>
|
||||
<td class="org-right">20230323.14</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">helpful</td>
|
||||
<td class="org-right">20221209.1743</td>
|
||||
<td class="org-right">20231028.516</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">ht</td>
|
||||
<td class="org-right">20221031.705</td>
|
||||
<td class="org-right">20230703.558</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -426,7 +500,7 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">ivy</td>
|
||||
<td class="org-right">20220926.125</td>
|
||||
<td class="org-right">20231025.2311</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -440,35 +514,35 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">ivy-rich</td>
|
||||
<td class="org-right">20210409.931</td>
|
||||
<td class="org-right">20230425.1422</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">js2-mode</td>
|
||||
<td class="org-right">20221028.1819</td>
|
||||
<td class="org-right">20230628.238</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">key-chord</td>
|
||||
<td class="org-right">20201222.203</td>
|
||||
<td class="org-right">20230522.223</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">langtool</td>
|
||||
<td class="org-right">20200529.23</td>
|
||||
<td class="org-right">20230222.326</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">ledger-mode</td>
|
||||
<td class="org-right">20220623.1125</td>
|
||||
<td class="org-right">20230925.1013</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -482,21 +556,21 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">magit</td>
|
||||
<td class="org-right">20221208.1848</td>
|
||||
<td class="org-right">20231103.1516</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">magit-section</td>
|
||||
<td class="org-right">20221127.2227</td>
|
||||
<td class="org-right">20231014.1405</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">markdown-mode</td>
|
||||
<td class="org-right">20221210.348</td>
|
||||
<td class="org-right">20231028.853</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -510,14 +584,21 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">mu4e-maildirs-extension</td>
|
||||
<td class="org-right">20220517.1852</td>
|
||||
<td class="org-left">melpa</td>
|
||||
<td class="org-right">melpa</td>
|
||||
<td class="org-left"> </td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">multiple-cursors</td>
|
||||
<td class="org-right">20221126.743</td>
|
||||
<td class="org-right">20230728.518</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">notmuch</td>
|
||||
<td class="org-right">20231006.2337</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -529,9 +610,23 @@ General key bindings and functions
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">olivetti</td>
|
||||
<td class="org-right">20231104.538</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">ol-notmuch</td>
|
||||
<td class="org-right">20230511.2048</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">org</td>
|
||||
<td class="org-right">9.6</td>
|
||||
<td class="org-right">9.6.11</td>
|
||||
<td class="org-left">elpa-gnu</td>
|
||||
</tr>
|
||||
|
||||
@@ -545,7 +640,7 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">org-brain</td>
|
||||
<td class="org-right">20210706.1519</td>
|
||||
<td class="org-right">20230217.1908</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -559,7 +654,7 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">org-contrib</td>
|
||||
<td class="org-right">0.4.1</td>
|
||||
<td class="org-right">0.4.2</td>
|
||||
<td class="org-left">elpa-nongnu</td>
|
||||
</tr>
|
||||
|
||||
@@ -587,14 +682,42 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">orgit</td>
|
||||
<td class="org-right">20221127.2228</td>
|
||||
<td class="org-right">20230917.1001</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">org-ref</td>
|
||||
<td class="org-right">20221129.1925</td>
|
||||
<td class="org-right">20231101.2355</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">org-roam</td>
|
||||
<td class="org-right">20230307.1721</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">org-roam-bibtex</td>
|
||||
<td class="org-right">20230628.2036</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">org-roam-timestamps</td>
|
||||
<td class="org-right">20221104.1544</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">org-roam-ui</td>
|
||||
<td class="org-right">20221105.104</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -608,7 +731,7 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">org-superstar</td>
|
||||
<td class="org-right">20210915.1934</td>
|
||||
<td class="org-right">20230116.1358</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -622,14 +745,14 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">ov</td>
|
||||
<td class="org-right">20200326.1042</td>
|
||||
<td class="org-right">20230522.1117</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">ox-pandoc</td>
|
||||
<td class="org-right">20220705.1036</td>
|
||||
<td class="org-right">20230627.643</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -643,28 +766,28 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">ox-tufte</td>
|
||||
<td class="org-right">20160926.1607</td>
|
||||
<td class="org-right">20231022.2117</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">page-break-lines</td>
|
||||
<td class="org-right">20210104.2224</td>
|
||||
<td class="org-right">20230804.658</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">parsebib</td>
|
||||
<td class="org-right">20221007.1402</td>
|
||||
<td class="org-right">20230228.153</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">pdf-tools</td>
|
||||
<td class="org-right">20221202.1104</td>
|
||||
<td class="org-right">20230611.239</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -685,7 +808,14 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">php-mode</td>
|
||||
<td class="org-right">20221112.1616</td>
|
||||
<td class="org-right">20230929.123</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">pkg-info</td>
|
||||
<td class="org-right">20150517.1143</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -699,14 +829,14 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">polymode</td>
|
||||
<td class="org-right">20220820.163</td>
|
||||
<td class="org-right">20230317.1218</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">popup</td>
|
||||
<td class="org-right">20220927.161</td>
|
||||
<td class="org-right">20230819.2306</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -718,9 +848,16 @@ General key bindings and functions
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">posframe</td>
|
||||
<td class="org-right">20230714.227</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">pos-tip</td>
|
||||
<td class="org-right">20220715.102</td>
|
||||
<td class="org-right">20230721.834</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -734,7 +871,7 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">pythonic</td>
|
||||
<td class="org-right">20220723.1741</td>
|
||||
<td class="org-right">20230821.1733</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -767,9 +904,23 @@ General key bindings and functions
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">seq</td>
|
||||
<td class="org-right">2.24</td>
|
||||
<td class="org-left">elpa-gnu</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">simple-httpd</td>
|
||||
<td class="org-right">20230821.1458</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">spacemacs-theme</td>
|
||||
<td class="org-right">20221103.1406</td>
|
||||
<td class="org-right">20230530.1751</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -783,14 +934,14 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">sql-indent</td>
|
||||
<td class="org-right">1.6</td>
|
||||
<td class="org-right">1.7</td>
|
||||
<td class="org-left">elpa-gnu</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">srefactor</td>
|
||||
<td class="org-right">20180703.181</td>
|
||||
<td class="org-right">20230504.617</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -811,42 +962,49 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">swiper</td>
|
||||
<td class="org-right">20220430.2247</td>
|
||||
<td class="org-right">20231025.2311</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">systemd</td>
|
||||
<td class="org-right">20210209.2052</td>
|
||||
<td class="org-right">20230201.302</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">tablist</td>
|
||||
<td class="org-right">20231019.1126</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">transient</td>
|
||||
<td class="org-right">20221202.1727</td>
|
||||
<td class="org-right">20231103.2312</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">treemacs</td>
|
||||
<td class="org-right">20221107.2105</td>
|
||||
<td class="org-right">20231101.115</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">treemacs-magit</td>
|
||||
<td class="org-right">20220917.1026</td>
|
||||
<td class="org-right">20230830.1936</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">use-package</td>
|
||||
<td class="org-right">20221209.2013</td>
|
||||
<td class="org-right">20230426.2324</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -860,14 +1018,14 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">visual-fill-column</td>
|
||||
<td class="org-right">20220519.1959</td>
|
||||
<td class="org-right">20230102.183</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">vterm</td>
|
||||
<td class="org-right">20221118.1354</td>
|
||||
<td class="org-right">20230417.424</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
@@ -881,35 +1039,42 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">web-mode</td>
|
||||
<td class="org-right">20221012.8</td>
|
||||
<td class="org-right">20231025.1927</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">websocket</td>
|
||||
<td class="org-right">20230809.305</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">which-key</td>
|
||||
<td class="org-right">20220811.1616</td>
|
||||
<td class="org-right">20230905.2128</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">with-editor</td>
|
||||
<td class="org-right">20221127.2243</td>
|
||||
<td class="org-right">20230917.958</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">yasnippet</td>
|
||||
<td class="org-right">20200604.246</td>
|
||||
<td class="org-right">20230914.14</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">yasnippet-snippets</td>
|
||||
<td class="org-right">20220713.1234</td>
|
||||
<td class="org-right">20230815.82</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
115
README.org
115
README.org
@@ -9,17 +9,43 @@ a bunch of online resources.
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: installation
|
||||
:END:
|
||||
Download repo and point the emacs =init= (and =early-init.el=) file to
|
||||
this configuration.
|
||||
|
||||
Or run one of the following install script commands (using curl, wget or fetch).
|
||||
#+begin_src sh
|
||||
Different ways to install:
|
||||
|
||||
- arch-linux :: If ~emacs-conf~ is available in a ~custom~ ~pacman~ repository
|
||||
#+begin_src sh
|
||||
pacman -S emacs-conf
|
||||
ln -s /opt/emacs-conf/init ~/.config/emacs/
|
||||
ln -s /opt/emacs-conf/early-init.el ~/.config/emacs/
|
||||
#+end_src
|
||||
|
||||
- debian :: If ~emacs-conf~ is available in a ~custom~ ~apt~ repository
|
||||
#+begin_src sh
|
||||
apt install emacs-conf
|
||||
ln -s /opt/emacs-conf/init ~/.config/emacs/
|
||||
ln -s /opt/emacs-conf/early-init.el ~/.config/emacs/
|
||||
#+end_src
|
||||
|
||||
- manual :: Download or clone git repo and point the emacs =init= and
|
||||
=early-init.el= file to this configuration.
|
||||
|
||||
- old :: Run one of the following install script commands (using curl,
|
||||
wget or fetch).
|
||||
#+begin_src sh
|
||||
sh -c "$(curl -fsSL http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
||||
sh -c "$(wget -O- http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
||||
sh -c "$(fetch -o - http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
||||
#+end_src
|
||||
Installation path is =~/.config/emacs=. See details and other
|
||||
installed linux packages as requirements inside =sripts/install.sh=.
|
||||
#+end_src
|
||||
Installation path is =~/.config/emacs=. See details and other
|
||||
installed linux packages as requirements inside =sripts/install.sh=.
|
||||
|
||||
* External programs
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: programs
|
||||
:END:
|
||||
- =ripgrep= (optional) used by =counsel-rg= (package =counsel=)
|
||||
- =texlive-luatex= for =luainputenc.sty= used by org latex export
|
||||
- =texlive-xetex= for =realscripts.sty= for =KpRoman= used by org latex export
|
||||
|
||||
* Usage
|
||||
:PROPERTIES:
|
||||
@@ -51,14 +77,15 @@ commands and information.
|
||||
General key bindings and functions
|
||||
- =C-r= (=query-replace-regexp=) replace text
|
||||
- =C-x RET f= (=set-buffer-file-coding-system=) e.g. set to =utf-8
|
||||
- (=decode-coding-region=) e.g. decode to =utf-8= (郭富城Aaron Kwok)
|
||||
- (=decode-coding-region=) e.g. decode to =utf-8= (e.g. 晴天)
|
||||
- (=diff-buffer-with-file=) show a diff between buffer (current state) and file (saved state)
|
||||
|
||||
#+begin_src sh :exports results
|
||||
dir=$HOME/repos/emacs-conf/lisp
|
||||
dir=$(pwd)/lisp
|
||||
|
||||
verinfo() {
|
||||
#echo -n $1 ''
|
||||
# $dir: directory of packages
|
||||
# $1: package name (basenaem and w/o extension)
|
||||
if test -f $dir/$1.el; then
|
||||
ver=$(grep -i package-version: $dir/$1.el | cut -d":" -f2 | xargs)
|
||||
if test -z $ver; then
|
||||
@@ -71,31 +98,31 @@ verinfo() {
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_custom=$(
|
||||
for i in $(echo awesome-tray dialog); do
|
||||
map_pkg_ver() {
|
||||
# $1: list of package names, either full path (can include a version) or just the package name
|
||||
# $2: repo name
|
||||
# 1st: get package name: strips list element to basename and removes version and extension
|
||||
# 2nd: get package version (from the installed directory)
|
||||
# 3rd: print info
|
||||
for i in $1; do
|
||||
pkg=$(sed 's/-[0-9].*//' <(basename $i))
|
||||
ver=$(verinfo $pkg)
|
||||
echo $pkg $ver custom
|
||||
done)
|
||||
pkg_elpagnu=$(
|
||||
for i in $(ls -F ~/repos/my-elpa-gnu/archive/*.tar | grep -v @); do
|
||||
pkg=$(sed 's/-[0-9].*//' <(basename $i))
|
||||
ver=$(verinfo $pkg)
|
||||
echo $pkg $ver elpa-gnu
|
||||
done)
|
||||
pkg_elpanongnu=$(
|
||||
for i in $(ls -F ~/repos/my-elpa-nongnu/archive/*.tar | grep -v @); do
|
||||
pkg=$(sed 's/-[0-9].*//' <(basename $i))
|
||||
ver=$(verinfo $pkg)
|
||||
echo $pkg $ver elpa-nongnu
|
||||
done)
|
||||
pkg_melpa=$(
|
||||
for i in $(sort <(ls ~/repos/my-melpa/packages/*.tar | xargs -n1) <(ls ~/repos/my-melpa/packages/*.el | xargs -n1)); do
|
||||
pkg=$(sed 's/-[0-9].*//' <(basename $i))
|
||||
ver=$(verinfo $pkg)
|
||||
echo $pkg $ver melpa
|
||||
done)
|
||||
echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column -t -N PACKAGE_____________________,VERSION______,REPO_______
|
||||
echo $pkg $ver $2
|
||||
done
|
||||
}
|
||||
|
||||
pkg_custom_list=$(echo awesome-tray dialog)
|
||||
pkg_elpagnu_list=$(ls -F ~/repos/my-elpa-gnu/archive/*.tar | grep -v @)
|
||||
pkg_elpanongnu_list=$(ls -F ~/repos/my-elpa-nongnu/archive/*.tar | grep -v @)
|
||||
pkg_melpa_list=$(sort <(ls ~/repos/my-melpa/packages/*.tar | xargs -n1) <(ls ~/repos/my-melpa/packages/*.el | xargs -n1))
|
||||
|
||||
pkg_custom=$(map_pkg_ver "$pkg_custom_list" custom)
|
||||
pkg_elpagnu=$(map_pkg_ver "$pkg_elpagnu_list" elpa-gnu)
|
||||
pkg_elpanongnu=$(map_pkg_ver "$pkg_elpanongnu_list" elpa-nongnu)
|
||||
pkg_melpa=$(map_pkg_ver "$pkg_melpa_list" melpa)
|
||||
echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | \
|
||||
sort | \
|
||||
column -t -N PACKAGE_____________________,VERSION______,REPO_______
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
@@ -103,6 +130,7 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| ace-window | 20220911.358 | melpa |
|
||||
| adaptive-wrap | 0.8 | elpa-gnu |
|
||||
| all-the-icons | 20220929.2303 | melpa |
|
||||
| all-the-icons-ivy-rich | 20221202.1336 | melpa |
|
||||
| amx | 20210305.118 | melpa |
|
||||
| anaconda-mode | 20220922.741 | melpa |
|
||||
| async | 20221217.649 | melpa |
|
||||
@@ -112,13 +140,16 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| biblio-core | 20210418.406 | melpa |
|
||||
| bibtex-completion | 20221024.857 | melpa |
|
||||
| bind-key | 20221209.2013 | melpa |
|
||||
| cfrs | 20220129.1149 | melpa |
|
||||
| citeproc | 20221216.1238 | melpa |
|
||||
| cl-libify | 20181130.23 | melpa |
|
||||
| company | 20221206.2122 | melpa |
|
||||
| company-anaconda | 20200404.1859 | melpa |
|
||||
| company-ledger | 20210910.25 | melpa |
|
||||
| company-quickhelp | 20221212.534 | melpa |
|
||||
| company-statistics | 20170210.1933 | melpa |
|
||||
| company-web | 20220115.2146 | melpa |
|
||||
| compat | 28.1.2.2 | elpa-gnu |
|
||||
| counsel | 20221015.936 | melpa |
|
||||
| crdt | 0.3.5 | elpa-gnu |
|
||||
| ctable | 20210128.629 | melpa |
|
||||
@@ -130,6 +161,9 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| diff-hl | 20221007.2147 | melpa |
|
||||
| dim | 20160818.949 | melpa |
|
||||
| elisp-refs | 20220704.2141 | melpa |
|
||||
| emacsql | 20221127.2146 | melpa |
|
||||
| emacsql-sqlite | 20221127.2146 | melpa |
|
||||
| emacsql-sqlite-builtin | 20221127.2146 | melpa |
|
||||
| emojify | 20210108.1111 | melpa |
|
||||
| ess | 20221204.1348 | melpa |
|
||||
| ess-R-data-view | 20130509.1158 | melpa |
|
||||
@@ -163,7 +197,10 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| memoize | 20200103.2036 | melpa |
|
||||
| mu4e-maildirs-extension | 20220517.1852 | melpa |
|
||||
| multiple-cursors | 20221126.743 | melpa |
|
||||
| notmuch | 20221115.1134 | melpa |
|
||||
| ob-async | 20210428.2052 | melpa |
|
||||
| olivetti | 20220330.635 | melpa |
|
||||
| ol-notmuch | 20220428.1337 | melpa |
|
||||
| org | 9.6 | elpa-gnu |
|
||||
| org-appear | 20220617.2355 | melpa |
|
||||
| org-brain | 20210706.1519 | melpa |
|
||||
@@ -174,6 +211,10 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| org-fragtog | 20220714.2146 | melpa |
|
||||
| orgit | 20221127.2228 | melpa |
|
||||
| org-ref | 20221129.1925 | melpa |
|
||||
| org-roam | 20221205.355 | melpa |
|
||||
| org-roam-bibtex | 20221104.2139 | melpa |
|
||||
| org-roam-timestamps | 20221104.1544 | melpa |
|
||||
| org-roam-ui | 20221105.104 | melpa |
|
||||
| org-sticky-header | 20201223.143 | melpa |
|
||||
| org-superstar | 20210915.1934 | melpa |
|
||||
| org-table-sticky-header | 20190924.506 | melpa |
|
||||
@@ -187,10 +228,12 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| persist | 0.5 | elpa-gnu |
|
||||
| pfuture | 20220913.1401 | melpa |
|
||||
| php-mode | 20221112.1616 | melpa |
|
||||
| pkg-info | 20150517.1143 | melpa |
|
||||
| plantuml-mode | 20191102.2056 | melpa |
|
||||
| polymode | 20220820.163 | melpa |
|
||||
| popup | 20220927.161 | melpa |
|
||||
| popwin | 20210215.1849 | melpa |
|
||||
| posframe | 20221220.544 | melpa |
|
||||
| pos-tip | 20220715.102 | melpa |
|
||||
| powershell | 20220805.1712 | melpa |
|
||||
| pythonic | 20220723.1741 | melpa |
|
||||
@@ -198,6 +241,8 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| rainbow-mode | 1.0.6 | elpa-gnu |
|
||||
| restart-emacs | 20201127.1425 | melpa |
|
||||
| s | 20220902.1511 | melpa |
|
||||
| seq | 2.23 | elpa-gnu |
|
||||
| simple-httpd | 20191103.1446 | melpa |
|
||||
| spacemacs-theme | 20221103.1406 | melpa |
|
||||
| sphinx-doc | 20210213.125 | melpa |
|
||||
| sql-indent | 1.6 | elpa-gnu |
|
||||
@@ -206,8 +251,9 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| string-inflection | 20220910.1306 | melpa |
|
||||
| swiper | 20220430.2247 | melpa |
|
||||
| systemd | 20210209.2052 | melpa |
|
||||
| tablist | 20200427.2205 | melpa |
|
||||
| transient | 20221202.1727 | melpa |
|
||||
| treemacs | 20221107.2105 | melpa |
|
||||
| treemacs | 20221221.1301 | melpa |
|
||||
| treemacs-magit | 20220917.1026 | melpa |
|
||||
| use-package | 20221209.2013 | melpa |
|
||||
| virtual-auto-fill | 20200906.2038 | melpa |
|
||||
@@ -215,6 +261,7 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| vterm | 20221118.1354 | melpa |
|
||||
| web-completion-data | 20160318.848 | melpa |
|
||||
| web-mode | 20221012.8 | melpa |
|
||||
| websocket | 20221218.115 | melpa |
|
||||
| which-key | 20220811.1616 | melpa |
|
||||
| with-editor | 20221127.2243 | melpa |
|
||||
| yasnippet | 20200604.246 | melpa |
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
;; A big contributor to startup times is garbage collection. We up the gc
|
||||
;; threshold to temporarily prevent it from running, then reset it later by
|
||||
;; enabling `gcmh-mode'. Not resetting it will cause stuttering/freezes.
|
||||
(setq gc-cons-threshold (* 50 1000 1000)) ;; Make startup faster by reducing the frequency of garbage collection. The default is 800 kilobytes. Measured in bytes. Will be decreased again at the end.
|
||||
(setq gc-cons-threshold (* 100 1024 1024)) ;; Make startup faster by reducing the frequency of garbage collection. The default is 800 kilobytes. Measured in bytes. Will (and should) be decreased again at the end.
|
||||
|
||||
;; make UTF-8 the default coding system:
|
||||
(set-language-environment "UTF-8")
|
||||
|
||||
1
init
1
init
@@ -54,6 +54,7 @@
|
||||
(require 'shell-settings) ;; sh-script powershell
|
||||
(require 'web-settings) ;; css js2 php web-mode company-web
|
||||
(require 'filetype-settings) ;; markdown sql systemd
|
||||
(require 'dot-settings) ;; graphviz dot
|
||||
(require 'polymode-settings) ;; polymode
|
||||
|
||||
(require 'post-settings)
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
'((avy "0.5.0"))
|
||||
:commit "77115afc1b0b9f633084cf7479c767988106c196" :authors
|
||||
'(("Oleh Krehel" . "ohwoeowho@gmail.com"))
|
||||
:maintainers
|
||||
'(("Oleh Krehel" . "ohwoeowho@gmail.com"))
|
||||
:maintainer
|
||||
'("Oleh Krehel" . "ohwoeowho@gmail.com")
|
||||
:keywords
|
||||
|
||||
16
lisp/all-the-icons-ivy-rich/all-the-icons-ivy-rich-pkg.el
Normal file
16
lisp/all-the-icons-ivy-rich/all-the-icons-ivy-rich-pkg.el
Normal file
@@ -0,0 +1,16 @@
|
||||
(define-package "all-the-icons-ivy-rich" "20230420.1234" "Better experience with icons for ivy"
|
||||
'((emacs "25.1")
|
||||
(ivy-rich "0.1.0")
|
||||
(all-the-icons "2.2.0"))
|
||||
:commit "c098cc85123a401b0ab8f2afd3a25853e61d7d28" :authors
|
||||
'(("Vincent Zhang" . "seagle0128@gmail.com"))
|
||||
:maintainers
|
||||
'(("Vincent Zhang" . "seagle0128@gmail.com"))
|
||||
:maintainer
|
||||
'("Vincent Zhang" . "seagle0128@gmail.com")
|
||||
:keywords
|
||||
'("convenience" "icons" "ivy")
|
||||
:url "https://github.com/seagle0128/all-the-icons-ivy-rich")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
2090
lisp/all-the-icons-ivy-rich/all-the-icons-ivy-rich.el
Normal file
2090
lisp/all-the-icons-ivy-rich/all-the-icons-ivy-rich.el
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,8 @@
|
||||
(define-package "all-the-icons" "20220929.2303" "A library for inserting Developer icons"
|
||||
(define-package "all-the-icons" "20230909.2053" "A library for inserting Developer icons"
|
||||
'((emacs "24.3"))
|
||||
:commit "51bf77da1ebc3c199dfc11f54c0dce67559f5f40" :authors
|
||||
:commit "be9d5dcda9c892e8ca1535e288620eec075eb0be" :authors
|
||||
'(("Dominic Charlesworth" . "dgc336@gmail.com"))
|
||||
:maintainers
|
||||
'(("Dominic Charlesworth" . "dgc336@gmail.com"))
|
||||
:maintainer
|
||||
'("Dominic Charlesworth" . "dgc336@gmail.com")
|
||||
|
||||
@@ -210,6 +210,8 @@
|
||||
("rd" all-the-icons-fileicon "R" :face all-the-icons-lblue)
|
||||
("rdx" all-the-icons-fileicon "R" :face all-the-icons-lblue)
|
||||
("rsx" all-the-icons-fileicon "R" :face all-the-icons-lblue)
|
||||
("beancount" all-the-icons-faicon "credit-card" :face all-the-icons-lgreen)
|
||||
("ledger" all-the-icons-faicon "credit-card" :face all-the-icons-lgreen)
|
||||
("svelte" all-the-icons-fileicon "svelte" :v-adjust 0.0 :face all-the-icons-red)
|
||||
("gql" all-the-icons-fileicon "graphql" :face all-the-icons-dpink)
|
||||
("graphql" all-the-icons-fileicon "graphql" :face all-the-icons-dpink)
|
||||
@@ -247,6 +249,7 @@
|
||||
("sass" all-the-icons-alltheicon "sass" :face all-the-icons-dpink)
|
||||
("less" all-the-icons-alltheicon "less" :height 0.8 :face all-the-icons-dyellow)
|
||||
("postcss" all-the-icons-fileicon "postcss" :face all-the-icons-dred)
|
||||
("pcss" all-the-icons-fileicon "postcss" :face all-the-icons-dred)
|
||||
("sss" all-the-icons-fileicon "postcss" :face all-the-icons-dred)
|
||||
("styl" all-the-icons-alltheicon "stylus" :face all-the-icons-lgreen)
|
||||
("csv" all-the-icons-octicon "graph" :v-adjust 0.0 :face all-the-icons-dblue)
|
||||
@@ -277,11 +280,14 @@
|
||||
("react" all-the-icons-alltheicon "react" :height 1.1 :face all-the-icons-lblue)
|
||||
("ts" all-the-icons-fileicon "typescript" :height 1.0 :v-adjust -0.1 :face all-the-icons-blue-alt)
|
||||
("js" all-the-icons-alltheicon "javascript" :height 1.0 :v-adjust 0.0 :face all-the-icons-yellow)
|
||||
("mjs" all-the-icons-alltheicon "javascript" :height 1.0 :v-adjust 0.0 :face all-the-icons-yellow)
|
||||
("es" all-the-icons-alltheicon "javascript" :height 1.0 :v-adjust 0.0 :face all-the-icons-yellow)
|
||||
("jsx" all-the-icons-fileicon "jsx-2" :height 1.0 :v-adjust -0.1 :face all-the-icons-cyan-alt)
|
||||
("tsx" all-the-icons-fileicon "tsx" :height 1.0 :v-adjust -0.1 :face all-the-icons-cyan-alt)
|
||||
("njs" all-the-icons-alltheicon "nodejs" :height 1.2 :face all-the-icons-lgreen)
|
||||
("vue" all-the-icons-fileicon "vue" :face all-the-icons-lgreen)
|
||||
("wasm" all-the-icons-fileicon "wasm" :height 1.0 :face all-the-icons-purple-alt)
|
||||
("wat" all-the-icons-fileicon "wasm" :height 1.0 :face all-the-icons-purple-alt)
|
||||
|
||||
("sbt" all-the-icons-fileicon "sbt" :face all-the-icons-red)
|
||||
("scala" all-the-icons-alltheicon "scala" :face all-the-icons-red)
|
||||
@@ -380,12 +386,13 @@
|
||||
("mov" all-the-icons-faicon "film" :face all-the-icons-blue)
|
||||
("mp4" all-the-icons-faicon "film" :face all-the-icons-blue)
|
||||
("ogv" all-the-icons-faicon "film" :face all-the-icons-dblue)
|
||||
("mpg" all-the-icons-faicon "film" :face all-the-icons-blue)
|
||||
("mpeg" all-the-icons-faicon "film" :face all-the-icons-blue)
|
||||
("flv" all-the-icons-faicon "film" :face all-the-icons-blue)
|
||||
("ogv" all-the-icons-faicon "film" :face all-the-icons-dblue)
|
||||
("mpg" all-the-icons-faicon "film" :face all-the-icons-blue)
|
||||
("mpeg" all-the-icons-faicon "film" :face all-the-icons-blue)
|
||||
("flv" all-the-icons-faicon "film" :face all-the-icons-blue)
|
||||
("ogv" all-the-icons-faicon "film" :face all-the-icons-dblue)
|
||||
("mkv" all-the-icons-faicon "film" :face all-the-icons-blue)
|
||||
("webm" all-the-icons-faicon "film" :face all-the-icons-blue)
|
||||
("dav" all-the-icons-faicon "film" :face all-the-icons-blue)
|
||||
;; Fonts
|
||||
("ttf" all-the-icons-fileicon "font" :v-adjust 0.0 :face all-the-icons-dcyan)
|
||||
("woff" all-the-icons-fileicon "font" :v-adjust 0.0 :face all-the-icons-cyan)
|
||||
@@ -397,6 +404,8 @@
|
||||
("doc" all-the-icons-fileicon "word" :face all-the-icons-blue)
|
||||
("docx" all-the-icons-fileicon "word" :face all-the-icons-blue)
|
||||
("docm" all-the-icons-fileicon "word" :face all-the-icons-blue)
|
||||
("eml" all-the-icons-faicon "envelope" :face all-the-icons-blue)
|
||||
("msg" all-the-icons-faicon "envelope" :face all-the-icons-blue)
|
||||
("texi" all-the-icons-fileicon "tex" :face all-the-icons-lred)
|
||||
("tex" all-the-icons-fileicon "tex" :face all-the-icons-lred)
|
||||
("md" all-the-icons-octicon "markdown" :v-adjust 0.0 :face all-the-icons-lblue)
|
||||
@@ -405,7 +414,7 @@
|
||||
("pps" all-the-icons-fileicon "powerpoint" :face all-the-icons-orange)
|
||||
("ppt" all-the-icons-fileicon "powerpoint" :face all-the-icons-orange)
|
||||
("pptsx" all-the-icons-fileicon "powerpoint" :face all-the-icons-orange)
|
||||
("ppttx" all-the-icons-fileicon "powerpoint" :face all-the-icons-orange)
|
||||
("pptx" all-the-icons-fileicon "powerpoint" :face all-the-icons-orange)
|
||||
("knt" all-the-icons-fileicon "powerpoint" :face all-the-icons-cyan)
|
||||
("xlsx" all-the-icons-fileicon "excel" :face all-the-icons-dgreen)
|
||||
("xlsm" all-the-icons-fileicon "excel" :face all-the-icons-dgreen)
|
||||
@@ -577,13 +586,17 @@ for performance sake.")
|
||||
(erc-mode all-the-icons-faicon "commenting-o" :height 1.0 :v-adjust 0.0)
|
||||
(inferior-emacs-lisp-mode all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1 :face all-the-icons-lblue)
|
||||
(dired-mode all-the-icons-octicon "file-directory" :v-adjust 0.0)
|
||||
(wdired-mode all-the-icons-octicon "file-directory" :v-adjust 0.0 :face all-the-icons-dcyan)
|
||||
(lisp-interaction-mode all-the-icons-fileicon "lisp" :v-adjust -0.1 :face all-the-icons-orange)
|
||||
(sly-mrepl-mode all-the-icons-fileicon "clisp" :v-adjust -0.1 :face all-the-icons-orange)
|
||||
(slime-repl-mode all-the-icons-fileicon "clisp" :v-adjust -0.1 :face all-the-icons-orange)
|
||||
(org-mode all-the-icons-fileicon "org" :v-adjust 0.0 :face all-the-icons-lgreen)
|
||||
(typescript-mode all-the-icons-fileicon "typescript" :v-adjust -0.1 :face all-the-icons-blue-alt)
|
||||
(typescript-ts-mode all-the-icons-fileicon "typescript" :v-adjust -0.1 :face all-the-icons-blue-alt)
|
||||
(typescript-tsx-mode all-the-icons-fileicon "tsx" :v-adjust -0.1 :face all-the-icons-cyan-alt)
|
||||
(tsx-ts-mode all-the-icons-fileicon "tsx" :v-adjust -0.1 :face all-the-icons-cyan-alt)
|
||||
(js-mode all-the-icons-alltheicon "javascript" :v-adjust -0.1 :face all-the-icons-yellow)
|
||||
(js-ts-mode all-the-icons-alltheicon "javascript" :v-adjust -0.1 :face all-the-icons-yellow)
|
||||
(js-jsx-mode all-the-icons-alltheicon "javascript" :v-adjust -0.1 :face all-the-icons-yellow)
|
||||
(js2-mode all-the-icons-alltheicon "javascript" :v-adjust -0.1 :face all-the-icons-yellow)
|
||||
(js3-mode all-the-icons-alltheicon "javascript" :v-adjust -0.1 :face all-the-icons-yellow)
|
||||
@@ -602,6 +615,7 @@ for performance sake.")
|
||||
(ibuffer-mode all-the-icons-faicon "files-o" :v-adjust 0.0 :face all-the-icons-dsilver)
|
||||
(messages-buffer-mode all-the-icons-faicon "file-o" :v-adjust 0.0 :face all-the-icons-dsilver)
|
||||
(help-mode all-the-icons-faicon "info" :v-adjust -0.1 :face all-the-icons-purple)
|
||||
(helpful-mode all-the-icons-faicon "info" :v-adjust -0.1 :face all-the-icons-purple)
|
||||
(benchmark-init/tree-mode all-the-icons-octicon "dashboard" :v-adjust 0.0)
|
||||
(jenkins-mode all-the-icons-fileicon "jenkins" :face all-the-icons-blue)
|
||||
(magit-popup-mode all-the-icons-alltheicon "git" :face all-the-icons-red)
|
||||
@@ -612,6 +626,10 @@ for performance sake.")
|
||||
(mu4e-main-mode all-the-icons-octicon "mail" :v-adjust 0.0)
|
||||
(mu4e-view-mode all-the-icons-octicon "mail-read" :v-adjust 0.0)
|
||||
(sieve-mode all-the-icons-octicon "mail" :v-adjust 0.0)
|
||||
(gnus-group-mode all-the-icons-octicon "mail" :v-adjust 0.0)
|
||||
(gnus-summary-mode all-the-icons-octicon "mail" :v-adjust 0.0)
|
||||
(gnus-article-mode all-the-icons-octicon "mail-read" :v-adjust 0.0)
|
||||
(message-mode all-the-icons-octicon "pencil" :v-adjust 0.0)
|
||||
(package-menu-mode all-the-icons-faicon "archive" :height 1.0 :v-adjust 0.0 :face all-the-icons-silver)
|
||||
(paradox-menu-mode all-the-icons-faicon "archive" :height 1.0 :v-adjust 0.0 :face all-the-icons-silver)
|
||||
(Custom-mode all-the-icons-octicon "settings" :v-adjust -0.1)
|
||||
@@ -624,30 +642,39 @@ for performance sake.")
|
||||
(text-mode all-the-icons-octicon "file-text" :v-adjust 0.0 :face all-the-icons-cyan)
|
||||
(enh-ruby-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-lred)
|
||||
(ruby-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-lred)
|
||||
(ruby-ts-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-lred)
|
||||
(inf-ruby-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-red)
|
||||
(projectile-rails-compilation-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-red)
|
||||
(rspec-compilation-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-red)
|
||||
(rake-compilation-mode all-the-icons-alltheicon "ruby-alt" :face all-the-icons-red)
|
||||
(sh-mode all-the-icons-alltheicon "terminal" :face all-the-icons-purple)
|
||||
(bash-ts-mode all-the-icons-alltheicon "terminal" :face all-the-icons-purple)
|
||||
(shell-mode all-the-icons-alltheicon "terminal" :face all-the-icons-purple)
|
||||
(fish-mode all-the-icons-alltheicon "terminal" :face all-the-icons-lpink)
|
||||
(nginx-mode all-the-icons-fileicon "nginx" :height 0.9 :face all-the-icons-dgreen)
|
||||
(apache-mode all-the-icons-alltheicon "apache" :height 0.9 :face all-the-icons-dgreen)
|
||||
(makefile-mode all-the-icons-fileicon "gnu" :face all-the-icons-dorange)
|
||||
(cmake-mode all-the-icons-fileicon "cmake" :face all-the-icons-red)
|
||||
(cmake-ts-mode all-the-icons-fileicon "cmake" :face all-the-icons-red)
|
||||
(dockerfile-mode all-the-icons-fileicon "dockerfile" :face all-the-icons-blue)
|
||||
(dockerfile-ts-mode all-the-icons-fileicon "dockerfile" :face all-the-icons-blue)
|
||||
(docker-compose-mode all-the-icons-fileicon "dockerfile" :face all-the-icons-lblue)
|
||||
(nxml-mode all-the-icons-faicon "file-code-o" :height 0.95 :face all-the-icons-lorange)
|
||||
(json-mode all-the-icons-octicon "settings" :face all-the-icons-yellow)
|
||||
(json-ts-mode all-the-icons-octicon "settings" :face all-the-icons-yellow)
|
||||
(jsonian-mode all-the-icons-octicon "settings" :face all-the-icons-yellow)
|
||||
(yaml-mode all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-dyellow)
|
||||
(yaml-ts-mode all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-dyellow)
|
||||
(elisp-byte-code-mode all-the-icons-octicon "file-binary" :v-adjust 0.0 :face all-the-icons-dsilver)
|
||||
(archive-mode all-the-icons-octicon "file-zip" :v-adjust 0.0 :face all-the-icons-lmaroon)
|
||||
(elm-mode all-the-icons-fileicon "elm" :face all-the-icons-blue)
|
||||
(erlang-mode all-the-icons-alltheicon "erlang" :face all-the-icons-red :v-adjust -0.1 :height 0.9)
|
||||
(elixir-mode all-the-icons-alltheicon "elixir" :face all-the-icons-lorange :v-adjust -0.1 :height 0.9)
|
||||
(java-mode all-the-icons-alltheicon "java" :height 1.0 :face all-the-icons-purple)
|
||||
(java-ts-mode all-the-icons-alltheicon "java" :height 1.0 :face all-the-icons-purple)
|
||||
(go-mode all-the-icons-fileicon "go" :height 1.0 :face all-the-icons-blue)
|
||||
(go-ts-mode all-the-icons-fileicon "go" :height 1.0 :face all-the-icons-blue)
|
||||
(go-mod-ts-mode all-the-icons-fileicon "config-go" :height 1.0 :face all-the-icons-blue-alt)
|
||||
(go-dot-mod-mode all-the-icons-fileicon "config-go" :height 1.0 :face all-the-icons-blue-alt)
|
||||
(go-dot-work-mode all-the-icons-fileicon "config-go" :height 1.0 :face all-the-icons-blue-alt)
|
||||
(graphql-mode all-the-icons-fileicon "graphql" :face all-the-icons-dpink)
|
||||
@@ -658,22 +685,29 @@ for performance sake.")
|
||||
(php-mode all-the-icons-fileicon "php" :face all-the-icons-lsilver)
|
||||
(prolog-mode all-the-icons-alltheicon "prolog" :height 1.1 :face all-the-icons-lmaroon)
|
||||
(python-mode all-the-icons-alltheicon "python" :height 1.0 :face all-the-icons-dblue)
|
||||
(python-ts-mode all-the-icons-alltheicon "python" :height 1.0 :face all-the-icons-dblue)
|
||||
(inferior-python-mode all-the-icons-alltheicon "python" :height 1.0 :face all-the-icons-dblue)
|
||||
(racket-mode all-the-icons-fileicon "racket" :height 1.2 :face all-the-icons-red)
|
||||
(rust-mode all-the-icons-alltheicon "rust" :height 1.2 :face all-the-icons-maroon)
|
||||
(rustic-mode all-the-icons-alltheicon "rust" :height 1.2 :face all-the-icons-maroon)
|
||||
(rust-ts-mode all-the-icons-alltheicon "rust" :height 1.2 :face all-the-icons-maroon)
|
||||
(scala-mode all-the-icons-alltheicon "scala" :face all-the-icons-red)
|
||||
(scheme-mode all-the-icons-fileicon "scheme" :height 1.2 :face all-the-icons-red)
|
||||
(swift-mode all-the-icons-alltheicon "swift" :height 1.0 :v-adjust -0.1 :face all-the-icons-green)
|
||||
(svelte-mode all-the-icons-fileicon "svelte" :v-adjust 0.0 :face all-the-icons-red)
|
||||
(c-mode all-the-icons-alltheicon "c-line" :face all-the-icons-blue)
|
||||
(c-ts-mode all-the-icons-alltheicon "c-line" :face all-the-icons-blue)
|
||||
(c++-mode all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
|
||||
(c++-ts-mode all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
|
||||
(csharp-mode all-the-icons-alltheicon "csharp-line" :face all-the-icons-dblue)
|
||||
(csharp-ts-mode all-the-icons-alltheicon "csharp-line" :face all-the-icons-dblue)
|
||||
(clojure-mode all-the-icons-alltheicon "clojure" :height 1.0 :face all-the-icons-blue)
|
||||
(cider-repl-mode all-the-icons-alltheicon "clojure" :height 1.0 :face all-the-icons-green)
|
||||
(clojurescript-mode all-the-icons-fileicon "cljs" :height 1.0 :face all-the-icons-dblue)
|
||||
(coffee-mode all-the-icons-alltheicon "coffeescript" :height 1.0 :face all-the-icons-maroon)
|
||||
(lisp-mode all-the-icons-fileicon "lisp" :face all-the-icons-orange)
|
||||
(css-mode all-the-icons-alltheicon "css3" :face all-the-icons-yellow)
|
||||
(css-ts-mode all-the-icons-alltheicon "css3" :face all-the-icons-yellow)
|
||||
(scss-mode all-the-icons-alltheicon "sass" :face all-the-icons-pink)
|
||||
(sass-mode all-the-icons-alltheicon "sass" :face all-the-icons-dpink)
|
||||
(less-css-mode all-the-icons-alltheicon "less" :height 0.8 :face all-the-icons-dyellow)
|
||||
@@ -684,6 +718,7 @@ for performance sake.")
|
||||
(literate-haskell-mode all-the-icons-alltheicon "haskell" :height 1.0 :face all-the-icons-red)
|
||||
(haml-mode all-the-icons-fileicon "haml" :face all-the-icons-lyellow)
|
||||
(html-mode all-the-icons-alltheicon "html5" :face all-the-icons-orange)
|
||||
(html-ts-mode all-the-icons-alltheicon "html5" :face all-the-icons-orange)
|
||||
(rhtml-mode all-the-icons-alltheicon "html5" :face all-the-icons-lred)
|
||||
(mustache-mode all-the-icons-fileicon "moustache" :face all-the-icons-green)
|
||||
(slim-mode all-the-icons-octicon "dashboard" :v-adjust 0.0 :face all-the-icons-yellow)
|
||||
@@ -703,6 +738,7 @@ for performance sake.")
|
||||
(vhdl-mode all-the-icons-fileicon "vhdl" :face all-the-icons-blue)
|
||||
(haskell-cabal-mode all-the-icons-fileicon "cabal" :face all-the-icons-lblue)
|
||||
(kotlin-mode all-the-icons-fileicon "kotlin" :face all-the-icons-orange)
|
||||
(kotlin-ts-mode all-the-icons-fileicon "kotlin" :face all-the-icons-orange)
|
||||
(nim-mode all-the-icons-fileicon "nimrod" :face all-the-icons-yellow)
|
||||
(sql-mode all-the-icons-octicon "database" :face all-the-icons-silver)
|
||||
(lua-mode all-the-icons-fileicon "lua" :face all-the-icons-dblue)
|
||||
@@ -722,15 +758,26 @@ for performance sake.")
|
||||
(hy-mode all-the-icons-fileicon "hy" :face all-the-icons-blue)
|
||||
(glsl-mode all-the-icons-fileicon "vertex-shader" :face all-the-icons-green)
|
||||
(zig-mode all-the-icons-fileicon "zig" :face all-the-icons-orange)
|
||||
(exwm-mode all-the-icons-octicon "browser" :v-adjust 0.2 :face all-the-icons-purple)
|
||||
(beancount-mode all-the-icons-faicon "credit-card" :face all-the-icons-lgreen)
|
||||
(ledger-mode all-the-icons-faicon "credit-card" :face all-the-icons-lgreen)
|
||||
(odin-mode all-the-icons-fileicon "odin" :height 1.1 :face all-the-icons-lblue)
|
||||
(pdf-view-mode all-the-icons-octicon "file-pdf" :v-adjust 0.0 :face all-the-icons-dred)
|
||||
(spacemacs-buffer-mode all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1 :face all-the-icons-purple)
|
||||
(elfeed-search-mode all-the-icons-faicon "rss-square" :face all-the-icons-orange)
|
||||
(elfeed-show-mode all-the-icons-faicon "rss" :face all-the-icons-orange)
|
||||
(emms-browser-mode all-the-icons-faicon "music" :face all-the-icons-silver)
|
||||
(emms-lyrics-mode all-the-icons-faicon "music" :face all-the-icons-silver)
|
||||
(emms-show-all-mode all-the-icons-faicon "music" :face all-the-icons-silver)
|
||||
(emms-metaplaylist-mode all-the-icons-faicon "music" :face all-the-icons-silver)
|
||||
(emms-tag-editor-mode all-the-icons-faicon "music" :face all-the-icons-silver)
|
||||
(emms-playlist-mode all-the-icons-faicon "music" :face all-the-icons-silver)
|
||||
(lilypond-mode all-the-icons-faicon "music" :face all-the-icons-green)
|
||||
(magik-session-mode all-the-icons-alltheicon "terminal" :face all-the-icons-blue)
|
||||
(magik-cb-mode all-the-icons-faicon "book" :face all-the-icons-blue)
|
||||
(meson-mode all-the-icons-fileicon "meson" :face all-the-icons-purple)
|
||||
(man-common all-the-icons-fileicon "man-page" :face all-the-icons-blue)))
|
||||
(man-common all-the-icons-fileicon "man-page" :face all-the-icons-blue)
|
||||
(ess-r-mode all-the-icons-fileicon "R" :face all-the-icons-lblue)))
|
||||
|
||||
(defvar all-the-icons-url-alist
|
||||
'(
|
||||
@@ -843,8 +890,8 @@ for performance sake.")
|
||||
(eq major-mode auto-mode)))
|
||||
|
||||
(defun all-the-icons-match-to-alist (file alist)
|
||||
"Match FILE against an entry in ALIST using `string-match'."
|
||||
(cdr (cl-find-if (lambda (it) (string-match (car it) file)) alist)))
|
||||
"Match FILE against an entry in ALIST using `string-match-p'."
|
||||
(cdr (cl-find-if (lambda (it) (string-match-p (car it) file)) alist)))
|
||||
|
||||
(defun all-the-icons-dir-is-submodule (dir)
|
||||
"Checker whether or not DIR is a git submodule."
|
||||
@@ -916,20 +963,21 @@ inserting functions.
|
||||
|
||||
Note: You want chevron, please use `all-the-icons-icon-for-dir-with-chevron'."
|
||||
(let* ((dirname (file-name-base (directory-file-name dir)))
|
||||
(path (expand-file-name dir))
|
||||
(icon (all-the-icons-match-to-alist dirname all-the-icons-dir-icon-alist))
|
||||
(args (cdr icon)))
|
||||
(when arg-overrides (setq args (append `(,(car args)) arg-overrides (cdr args))))
|
||||
(cond
|
||||
((file-remote-p path)
|
||||
(apply #'all-the-icons-octicon "terminal" (cdr args)))
|
||||
((file-symlink-p path)
|
||||
(apply #'all-the-icons-octicon "file-symlink-directory" (cdr args)))
|
||||
((all-the-icons-dir-is-submodule path)
|
||||
(apply #'all-the-icons-octicon "file-submodule" (cdr args)))
|
||||
((file-exists-p (format "%s/.git" path))
|
||||
(apply #'all-the-icons-octicon "repo" (cdr args)))
|
||||
(t (apply (car icon) args)))))
|
||||
(if (file-remote-p dir) ;; don't call expand-file-name on a remote dir as this can make emacs hang
|
||||
(apply #'all-the-icons-octicon "terminal" (cdr args))
|
||||
(let
|
||||
((path (expand-file-name dir)))
|
||||
(cond
|
||||
((file-symlink-p path)
|
||||
(apply #'all-the-icons-octicon "file-symlink-directory" (cdr args)))
|
||||
((all-the-icons-dir-is-submodule path)
|
||||
(apply #'all-the-icons-octicon "file-submodule" (cdr args)))
|
||||
((file-exists-p (format "%s/.git" path))
|
||||
(apply #'all-the-icons-octicon "repo" (cdr args)))
|
||||
(t (apply (car icon) args)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun all-the-icons-icon-for-file (file &rest arg-overrides)
|
||||
@@ -1004,7 +1052,7 @@ inserting functions."
|
||||
(defun all-the-icons-icon-family-for-file (file)
|
||||
"Get the icons font family for FILE."
|
||||
(let* ((ext (file-name-extension file))
|
||||
(icon (or (all-the-icons-match-to-alist file all-the-icons-regexp-icon-alist)
|
||||
(icon (or (all-the-icons-match-to-alist file all-the-icons-regexp-icon-alist)
|
||||
(and ext
|
||||
(cdr (assoc (downcase ext)
|
||||
all-the-icons-extension-icon-alist)))
|
||||
@@ -1164,7 +1212,7 @@ pause for DURATION seconds between printing each character."
|
||||
(mapc
|
||||
(lambda (it)
|
||||
(insert (format "%s - %s\n" (funcall insert-f (car it) :height height) (car it)))
|
||||
(when duration (sit-for duration 0)))
|
||||
(when duration (sit-for duration)))
|
||||
data)))
|
||||
|
||||
(defmacro all-the-icons-define-icon (name alist family &optional font-name)
|
||||
@@ -1219,8 +1267,6 @@ FONT-NAME is the name of the .ttf file providing the font, defaults to FAMILY."
|
||||
(interactive "P")
|
||||
(all-the-icons-insert arg (quote ,name)))))
|
||||
|
||||
(define-obsolete-function-alias 'define-icon 'all-the-icons-define-icon "4.0.0")
|
||||
|
||||
(all-the-icons-define-icon alltheicon all-the-icons-data/alltheicons-alist "all-the-icons")
|
||||
(all-the-icons-define-icon fileicon all-the-icons-data/file-icon-alist "file-icons")
|
||||
(all-the-icons-define-icon faicon all-the-icons-data/fa-icon-alist "FontAwesome")
|
||||
|
||||
16
lisp/amx/amx-pkg.el
Normal file
16
lisp/amx/amx-pkg.el
Normal file
@@ -0,0 +1,16 @@
|
||||
(define-package "amx" "20230413.1210" "Alternative M-x with extra features."
|
||||
'((emacs "24.4")
|
||||
(s "0"))
|
||||
:commit "1c2428d21e9d2ee8bee944b572a39ca8c91ca13b" :authors
|
||||
'(("Ryan C. Thompson" . "rct@thompsonclan.org")
|
||||
("Cornelius Mika" . "cornelius.mika@gmail.com"))
|
||||
:maintainers
|
||||
'(("Ryan C. Thompson" . "rct@thompsonclan.org"))
|
||||
:maintainer
|
||||
'("Ryan C. Thompson" . "rct@thompsonclan.org")
|
||||
:keywords
|
||||
'("convenience" "usability" "completion")
|
||||
:url "http://github.com/DarwinAwardWinner/amx/")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
@@ -8,8 +8,6 @@
|
||||
;; Cornelius Mika <cornelius.mika@gmail.com>
|
||||
;; Maintainer: Ryan C. Thompson <rct@thompsonclan.org>
|
||||
;; URL: http://github.com/DarwinAwardWinner/amx/
|
||||
;; Package-Version: 20210305.118
|
||||
;; Package-Commit: 37f9c7ae55eb0331b27200fb745206fc58ceffc0
|
||||
;; Package-Requires: ((emacs "24.4") (s "0"))
|
||||
;; Version: 3.4
|
||||
;; Keywords: convenience, usability, completion
|
||||
@@ -238,6 +236,7 @@ nil) if you don't find it useful."
|
||||
"\\`self-insert-and-exit\\'"
|
||||
"\\`ad-Orig-"
|
||||
"\\`menu-bar"
|
||||
"\\`kill-emacs\\'"
|
||||
amx-command-marked-ignored-p
|
||||
amx-command-obsolete-p
|
||||
amx-command-mouse-interactive-p)
|
||||
@@ -622,7 +621,7 @@ May not work for things like ido and ivy."
|
||||
|
||||
(cl-defun amx-completing-read-helm (choices &key initial-input predicate def)
|
||||
"Amx backend for helm completion."
|
||||
(require 'helm-config)
|
||||
(require 'helm)
|
||||
(require 'helm-mode) ; Provides `helm-comp-read-map'
|
||||
(helm-comp-read (amx-prompt-with-prefix-arg) choices
|
||||
:initial-input initial-input
|
||||
@@ -630,7 +629,7 @@ May not work for things like ido and ivy."
|
||||
:default def
|
||||
:name "Helm M-x Completions"
|
||||
:buffer "Helm M-x Completions"
|
||||
:history extended-command-history
|
||||
:history 'extended-command-history
|
||||
:reverse-history t
|
||||
:must-match t
|
||||
:fuzzy (or (bound-and-true-p helm-mode-fuzzy-match)
|
||||
@@ -675,17 +674,18 @@ May not work for things like ido and ivy."
|
||||
:auto-activate '(bound-and-true-p selectrum-mode))
|
||||
|
||||
(defsubst amx-auto-select-backend ()
|
||||
(cl-loop for (bname b) on amx-known-backends by 'cddr
|
||||
;; Don't auto-select the auto backend, or the
|
||||
;; default backend.
|
||||
unless (memq bname '(auto standard))
|
||||
;; Auto-select a backend if its auto-activate
|
||||
;; condition evaluates to non-nil.
|
||||
if (ignore-errors (eval (amx-backend-auto-activate b)))
|
||||
return b
|
||||
;; If no backend's auto-activate condition is
|
||||
;; fulfilled, auto-select the standard backend.
|
||||
finally return 'standard))
|
||||
(cl-loop
|
||||
for (bname b) on amx-known-backends by 'cddr
|
||||
;; Don't auto-select the auto backend, or the
|
||||
;; default backend.
|
||||
unless (memq bname '(auto standard))
|
||||
;; Auto-select a backend if its auto-activate
|
||||
;; condition evaluates to non-nil.
|
||||
if (ignore-errors (eval (amx-backend-auto-activate b)))
|
||||
return b
|
||||
;; If no backend's auto-activate condition is
|
||||
;; fulfilled, auto-select the standard backend.
|
||||
finally return 'standard))
|
||||
|
||||
(cl-defun amx-completing-read-auto (choices &key initial-input predicate def)
|
||||
"Automatically select the appropriate completion system for M-x.
|
||||
@@ -771,10 +771,10 @@ This should be the name of backend defined using
|
||||
;; This speeds up sorting.
|
||||
(let (new-commands)
|
||||
(mapatoms (lambda (symbol)
|
||||
(when (commandp symbol)
|
||||
(let ((known-command (assq symbol amx-data)))
|
||||
(if known-command
|
||||
(setq amx-cache (cons known-command amx-cache))
|
||||
(let ((known-command (assq symbol amx-data)))
|
||||
(if known-command
|
||||
(setq amx-cache (cons known-command amx-cache))
|
||||
(when (commandp symbol)
|
||||
(setq new-commands (cons (list symbol) new-commands)))))))
|
||||
(if (eq (length amx-cache) 0)
|
||||
(setq amx-cache new-commands)
|
||||
@@ -836,8 +836,8 @@ Otherwise, if optional arg COUNT-COMMANDS is non-nil, count the
|
||||
total number of defined commands in `obarray' and update if it
|
||||
has changed."
|
||||
(if (or (null amx-last-update-time)
|
||||
(and count-commands
|
||||
(amx-detect-new-commands)))
|
||||
(and count-commands
|
||||
(amx-detect-new-commands)))
|
||||
(amx-update)
|
||||
(amx--debug-message "No update needed at this time.")))
|
||||
|
||||
@@ -848,8 +848,8 @@ has changed."
|
||||
This function is normally idempotent, only having an effect the
|
||||
first time it is called, so it is safe to call it at the
|
||||
beginning of any function that expects amx to be initialized.
|
||||
However, optional arg REINIT forces the initialization needs to
|
||||
be re-run. Interactively, reinitialize when a prefix arg is
|
||||
However, optional arg REINIT forces the initialization to be
|
||||
re-run. Interactively, reinitialize when a prefix arg is
|
||||
provided."
|
||||
(interactive "P")
|
||||
(when (or reinit (not amx-initialized))
|
||||
@@ -1350,7 +1350,7 @@ current."
|
||||
(when amx-short-idle-update-timer
|
||||
(cancel-timer amx-short-idle-update-timer))
|
||||
(setq amx-short-idle-update-timer
|
||||
(run-with-idle-timer 1 t 'amx-idle-update)))
|
||||
(run-with-idle-timer 1 t 'amx-idle-update)))
|
||||
|
||||
(provide 'amx)
|
||||
;;; amx.el ends here
|
||||
@@ -1,13 +1,17 @@
|
||||
(define-package "anaconda-mode" "20220922.741" "Code navigation, documentation lookup and completion for Python"
|
||||
(define-package "anaconda-mode" "20230821.2131" "Code navigation, documentation lookup and completion for Python"
|
||||
'((emacs "25.1")
|
||||
(pythonic "0.1.0")
|
||||
(dash "2.6.0")
|
||||
(s "1.9")
|
||||
(f "0.16.2"))
|
||||
:commit "ca8edbaa7662d97e4a4416ec9a8d743863303911" :authors
|
||||
:commit "9dbd65b034cef519c01f63703399ae59651f85ca" :authors
|
||||
'(("Artem Malyshev" . "proofit404@gmail.com"))
|
||||
:maintainers
|
||||
'(("Artem Malyshev" . "proofit404@gmail.com"))
|
||||
:maintainer
|
||||
'("Artem Malyshev" . "proofit404@gmail.com")
|
||||
:keywords
|
||||
'("convenience" "anaconda")
|
||||
:url "https://github.com/proofit404/anaconda-mode")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
;; URL: https://github.com/proofit404/anaconda-mode
|
||||
;; Version: 0.1.15
|
||||
;; Package-Requires: ((emacs "25.1") (pythonic "0.1.0") (dash "2.6.0") (s "1.9") (f "0.16.2"))
|
||||
;; Keywords: convenience anaconda
|
||||
|
||||
;; 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
|
||||
@@ -28,6 +29,7 @@
|
||||
|
||||
(require 'ansi-color)
|
||||
(require 'pythonic)
|
||||
(require 'cl-lib)
|
||||
(require 'tramp)
|
||||
(require 'xref)
|
||||
(require 'json)
|
||||
@@ -77,6 +79,13 @@
|
||||
"Time in seconds `anaconda-mode' waits for a synchronous response."
|
||||
:type 'integer)
|
||||
|
||||
; create a defcustom that only allows for 'never, 'always, or 'remote
|
||||
(defcustom anaconda-mode-disable-rpc 'never
|
||||
"Disable RPC calls to the `anaconda-mode' server when remote."
|
||||
:type '(choice (const :tag "Never" never)
|
||||
(const :tag "Always" always)
|
||||
(const :tag "Remote" remote)))
|
||||
|
||||
;;; Compatibility
|
||||
|
||||
;; Functions from posframe which is an optional dependency
|
||||
@@ -361,8 +370,11 @@ called when `anaconda-mode-port' will be bound."
|
||||
(defun anaconda-mode-call (command callback)
|
||||
"Make remote procedure call for COMMAND.
|
||||
Apply CALLBACK to the result asynchronously."
|
||||
(anaconda-mode-start
|
||||
(lambda () (anaconda-mode-jsonrpc command callback))))
|
||||
(unless (or (eq anaconda-mode-disable-rpc 'always)
|
||||
(and (eq anaconda-mode-disable-rpc 'remote)
|
||||
(pythonic-remote-p)))
|
||||
(anaconda-mode-start
|
||||
(lambda () (anaconda-mode-jsonrpc command callback)))))
|
||||
|
||||
(defun anaconda-mode-call-sync (command callback)
|
||||
"Make remote procedure call for COMMAND.
|
||||
@@ -699,26 +711,29 @@ Show ERROR-MESSAGE if result is empty."
|
||||
|
||||
;;; Eldoc.
|
||||
|
||||
(defun anaconda-mode-eldoc-function ()
|
||||
(defun anaconda-mode-eldoc-function (callback &rest _ignored)
|
||||
"Show eldoc for context at point."
|
||||
(anaconda-mode-call "eldoc" 'anaconda-mode-eldoc-callback)
|
||||
(anaconda-mode-call
|
||||
"eldoc"
|
||||
(lambda (x)
|
||||
(funcall callback (anaconda-mode-eldoc-format x))))
|
||||
;; Don't show response buffer name as ElDoc message.
|
||||
nil)
|
||||
|
||||
(defun anaconda-mode-eldoc-callback (result)
|
||||
"Display eldoc from server RESULT."
|
||||
(eldoc-message (anaconda-mode-eldoc-format result)))
|
||||
|
||||
(defun anaconda-mode-eldoc-format (result)
|
||||
"Format eldoc string from RESULT."
|
||||
(when result
|
||||
(let ((doc (anaconda-mode-eldoc-format-definition
|
||||
(aref result 0)
|
||||
(aref result 1)
|
||||
(aref result 2))))
|
||||
(let ((doc (cl-map 'list
|
||||
(lambda (s)
|
||||
(anaconda-mode-eldoc-format-definition
|
||||
(aref s 0)
|
||||
(aref s 1)
|
||||
(aref s 2)))
|
||||
result)))
|
||||
(if anaconda-mode-eldoc-as-single-line
|
||||
(substring doc 0 (min (frame-width) (length doc)))
|
||||
doc))))
|
||||
(let ((d (mapconcat #'identity doc ", ")))
|
||||
(substring d 0 (min (frame-width) (length d))))
|
||||
(mapconcat #'identity doc "\n")))))
|
||||
|
||||
(defun anaconda-mode-eldoc-format-definition (name index params)
|
||||
"Format function definition from NAME, INDEX and PARAMS."
|
||||
@@ -768,13 +783,14 @@ Show ERROR-MESSAGE if result is empty."
|
||||
|
||||
(defun turn-on-anaconda-eldoc-mode ()
|
||||
"Turn on `anaconda-eldoc-mode'."
|
||||
(make-local-variable 'eldoc-documentation-function)
|
||||
(setq-local eldoc-documentation-function 'anaconda-mode-eldoc-function)
|
||||
(add-hook 'eldoc-documentation-functions
|
||||
'anaconda-mode-eldoc-function nil 't)
|
||||
(eldoc-mode +1))
|
||||
|
||||
(defun turn-off-anaconda-eldoc-mode ()
|
||||
"Turn off `anaconda-eldoc-mode'."
|
||||
(kill-local-variable 'eldoc-documentation-function)
|
||||
(remove-hook 'eldoc-documentation-functions
|
||||
'anaconda-mode-eldoc-function 't)
|
||||
(eldoc-mode -1))
|
||||
|
||||
(provide 'anaconda-mode)
|
||||
|
||||
@@ -192,11 +192,11 @@ def get_references(script, line, column):
|
||||
@script_method
|
||||
def eldoc(script, line, column):
|
||||
signatures = script.get_signatures(line, column)
|
||||
if len(signatures) == 1:
|
||||
signature = signatures[0]
|
||||
return [signature.name,
|
||||
signature.index,
|
||||
[param.description[6:] for param in signature.params]]
|
||||
if len(signatures) >= 1:
|
||||
return [(s.name,
|
||||
s.index,
|
||||
[param.description[6:] for param in s.params])
|
||||
for s in signatures]
|
||||
|
||||
# Run.
|
||||
|
||||
|
||||
12
lisp/anaphora/anaphora-pkg.el
Normal file
12
lisp/anaphora/anaphora-pkg.el
Normal file
@@ -0,0 +1,12 @@
|
||||
(define-package "anaphora" "20240120.1744" "anaphoric macros providing implicit temp variables" 'nil :commit "a755afa7db7f3fa515f8dd2c0518113be0b027f6" :authors
|
||||
'(("Roland Walker" . "walker@pobox.com"))
|
||||
:maintainers
|
||||
'(("Roland Walker" . "walker@pobox.com"))
|
||||
:maintainer
|
||||
'("Roland Walker" . "walker@pobox.com")
|
||||
:keywords
|
||||
'("extensions")
|
||||
:url "http://github.com/rolandwalker/anaphora")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
474
lisp/anaphora/anaphora.el
Normal file
474
lisp/anaphora/anaphora.el
Normal file
@@ -0,0 +1,474 @@
|
||||
;;; anaphora.el --- anaphoric macros providing implicit temp variables -*- lexical-binding: t -*-
|
||||
;;
|
||||
;; This code is in the public domain.
|
||||
;;
|
||||
;; Author: Roland Walker <walker@pobox.com>
|
||||
;; Homepage: http://github.com/rolandwalker/anaphora
|
||||
;; URL: http://raw.githubusercontent.com/rolandwalker/anaphora/master/anaphora.el
|
||||
;; Version: 1.0.4
|
||||
;; Last-Updated: 18 Jun 2018
|
||||
;; EmacsWiki: Anaphora
|
||||
;; Keywords: extensions
|
||||
;;
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Quickstart
|
||||
;;
|
||||
;; (require 'anaphora)
|
||||
;;
|
||||
;; (awhen (big-long-calculation)
|
||||
;; (foo it) ; `it' is provided as
|
||||
;; (bar it)) ; a temporary variable
|
||||
;;
|
||||
;; ;; anonymous function to compute factorial using `self'
|
||||
;; (alambda (x) (if (= x 0) 1 (* x (self (1- x)))))
|
||||
;;
|
||||
;; ;; to fontify `it' and `self'
|
||||
;; (with-eval-after-load "lisp-mode"
|
||||
;; (anaphora-install-font-lock-keywords))
|
||||
;;
|
||||
;; Explanation
|
||||
;;
|
||||
;; Anaphoric expressions implicitly create one or more temporary
|
||||
;; variables which can be referred to during the expression. This
|
||||
;; technique can improve clarity in certain cases. It also enables
|
||||
;; recursion for anonymous functions.
|
||||
;;
|
||||
;; To use anaphora, place the anaphora.el library somewhere
|
||||
;; Emacs can find it, and add the following to your ~/.emacs file:
|
||||
;;
|
||||
;; (require 'anaphora)
|
||||
;;
|
||||
;; The following macros are made available
|
||||
;;
|
||||
;; `aand'
|
||||
;; `ablock'
|
||||
;; `acase'
|
||||
;; `acond'
|
||||
;; `aecase'
|
||||
;; `aetypecase'
|
||||
;; `apcase'
|
||||
;; `aif'
|
||||
;; `alambda'
|
||||
;; `alet'
|
||||
;; `aprog1'
|
||||
;; `aprog2'
|
||||
;; `atypecase'
|
||||
;; `awhen'
|
||||
;; `awhile'
|
||||
;; `a+'
|
||||
;; `a-'
|
||||
;; `a*'
|
||||
;; `a/'
|
||||
;;
|
||||
;; See Also
|
||||
;;
|
||||
;; M-x customize-group RET anaphora RET
|
||||
;; http://en.wikipedia.org/wiki/On_Lisp
|
||||
;; http://en.wikipedia.org/wiki/Anaphoric_macro
|
||||
;;
|
||||
;; Notes
|
||||
;;
|
||||
;; Partially based on examples from the book "On Lisp", by Paul
|
||||
;; Graham.
|
||||
;;
|
||||
;; Compatibility and Requirements
|
||||
;;
|
||||
;; GNU Emacs version 26.1 : yes
|
||||
;; GNU Emacs version 25.x : yes
|
||||
;; GNU Emacs version 24.x : yes
|
||||
;; GNU Emacs version 23.x : yes
|
||||
;; GNU Emacs version 22.x : yes
|
||||
;; GNU Emacs version 21.x and lower : unknown
|
||||
;;
|
||||
;; Bugs
|
||||
;;
|
||||
;; TODO
|
||||
;;
|
||||
;; better face for it and self
|
||||
;;
|
||||
;;; License
|
||||
;;
|
||||
;; All code contributed by the author to this library is placed in the
|
||||
;; public domain. It is the author's belief that the portions adapted
|
||||
;; from examples in "On Lisp" are in the public domain.
|
||||
;;
|
||||
;; Regardless of the copyright status of individual functions, all
|
||||
;; code herein is free software, and is provided without any express
|
||||
;; or implied warranties.
|
||||
;;
|
||||
;;; Code:
|
||||
;;
|
||||
|
||||
;;; requirements
|
||||
|
||||
;; for declare, labels, do, block, case, ecase, typecase, etypecase
|
||||
(require 'cl-lib)
|
||||
|
||||
;;; customizable variables
|
||||
|
||||
;;;###autoload
|
||||
(defgroup anaphora nil
|
||||
"Anaphoric macros providing implicit temp variables"
|
||||
:version "1.0.4"
|
||||
:link '(emacs-commentary-link :tag "Commentary" "anaphora")
|
||||
:link '(url-link :tag "GitHub" "http://github.com/rolandwalker/anaphora")
|
||||
:link '(url-link :tag "EmacsWiki" "http://emacswiki.org/emacs/Anaphora")
|
||||
:prefix "anaphora-"
|
||||
:group 'extensions)
|
||||
|
||||
;;;###autoload
|
||||
(defcustom anaphora-use-long-names-only nil
|
||||
"Use only long names such as `anaphoric-if' instead of traditional `aif'."
|
||||
:type 'boolean
|
||||
:group 'anaphora)
|
||||
|
||||
;;; font-lock
|
||||
|
||||
(defun anaphora-install-font-lock-keywords nil
|
||||
"Fontify keywords `it' and `self'."
|
||||
(font-lock-add-keywords 'emacs-lisp-mode `((,(concat "\\<" (regexp-opt '("it" "self") 'paren) "\\>")
|
||||
1 font-lock-variable-name-face)) 'append))
|
||||
|
||||
;;; aliases
|
||||
|
||||
;;;###autoload
|
||||
(progn
|
||||
(defun anaphora--install-traditional-aliases (&optional arg)
|
||||
"Install traditional short aliases for anaphoric macros.
|
||||
|
||||
With negative numeric ARG, remove traditional aliases."
|
||||
(let ((syms '(
|
||||
(if . t)
|
||||
(prog1 . t)
|
||||
(prog2 . t)
|
||||
(when . when)
|
||||
(while . t)
|
||||
(and . t)
|
||||
(cond . cond)
|
||||
(lambda . lambda)
|
||||
(block . block)
|
||||
(case . case)
|
||||
(ecase . ecase)
|
||||
(typecase . typecase)
|
||||
(etypecase . etypecase)
|
||||
(pcase . pcase)
|
||||
(let . let)
|
||||
(+ . t)
|
||||
(- . t)
|
||||
(* . t)
|
||||
(/ . t)
|
||||
)))
|
||||
(cond
|
||||
((and (numberp arg)
|
||||
(< arg 0))
|
||||
(dolist (cell syms)
|
||||
(when (ignore-errors
|
||||
(eq (symbol-function (intern-soft (format "a%s" (car cell))))
|
||||
(intern-soft (format "anaphoric-%s" (car cell)))))
|
||||
(fmakunbound (intern (format "a%s" (car cell)))))))
|
||||
(t
|
||||
(dolist (cell syms)
|
||||
(let* ((builtin (car cell))
|
||||
(traditional (intern (format "a%s" builtin)))
|
||||
(long (intern (format "anaphoric-%s" builtin))))
|
||||
(defalias traditional long)
|
||||
(put traditional 'lisp-indent-function
|
||||
(get builtin 'lisp-indent-function))
|
||||
(put traditional 'edebug-form-spec (cdr cell)))))))))
|
||||
|
||||
;;;###autoload
|
||||
(unless anaphora-use-long-names-only
|
||||
(anaphora--install-traditional-aliases))
|
||||
|
||||
;;; macros
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-if (cond then &rest else)
|
||||
"Like `if', but the result of evaluating COND is bound to `it'.
|
||||
|
||||
The variable `it' is available within THEN and ELSE.
|
||||
|
||||
COND, THEN, and ELSE are otherwise as documented for `if'."
|
||||
(declare (debug t)
|
||||
(indent 2))
|
||||
`(let ((it ,cond))
|
||||
(if it ,then ,@else)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-prog1 (first &rest body)
|
||||
"Like `prog1', but the result of evaluating FIRST is bound to `it'.
|
||||
|
||||
The variable `it' is available within BODY.
|
||||
|
||||
FIRST and BODY are otherwise as documented for `prog1'."
|
||||
(declare (debug t)
|
||||
(indent 1))
|
||||
`(let ((it ,first))
|
||||
(progn ,@body)
|
||||
it))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-prog2 (form1 form2 &rest body)
|
||||
"Like `prog2', but the result of evaluating FORM2 is bound to `it'.
|
||||
|
||||
The variable `it' is available within BODY.
|
||||
|
||||
FORM1, FORM2, and BODY are otherwise as documented for `prog2'."
|
||||
(declare (debug t)
|
||||
(indent 2))
|
||||
`(progn
|
||||
,form1
|
||||
(let ((it ,form2))
|
||||
(progn ,@body)
|
||||
it)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-when (cond &rest body)
|
||||
"Like `when', but the result of evaluating COND is bound to `it'.
|
||||
|
||||
The variable `it' is available within BODY.
|
||||
|
||||
COND and BODY are otherwise as documented for `when'."
|
||||
(declare (debug when)
|
||||
(indent 1))
|
||||
`(anaphoric-if ,cond
|
||||
(progn ,@body)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-while (test &rest body)
|
||||
"Like `while', but the result of evaluating TEST is bound to `it'.
|
||||
|
||||
The variable `it' is available within BODY.
|
||||
|
||||
TEST and BODY are otherwise as documented for `while'."
|
||||
(declare (debug t)
|
||||
(indent 1))
|
||||
`(do ((it ,test ,test))
|
||||
((not it))
|
||||
,@body))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-and (&rest conditions)
|
||||
"Like `and', but the result of the previous condition is bound to `it'.
|
||||
|
||||
The variable `it' is available within all CONDITIONS after the
|
||||
initial one.
|
||||
|
||||
CONDITIONS are otherwise as documented for `and'.
|
||||
|
||||
Note that some implementations of this macro bind only the first
|
||||
condition to `it', rather than each successive condition."
|
||||
(declare (debug t))
|
||||
(cond
|
||||
((null conditions)
|
||||
t)
|
||||
((null (cdr conditions))
|
||||
(car conditions))
|
||||
(t
|
||||
`(anaphoric-if ,(car conditions) (anaphoric-and ,@(cdr conditions))))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-cond (&rest clauses)
|
||||
"Like `cond', but the result of each condition is bound to `it'.
|
||||
|
||||
The variable `it' is available within the remainder of each of CLAUSES.
|
||||
|
||||
CLAUSES are otherwise as documented for `cond'."
|
||||
(declare (debug cond))
|
||||
(if (null clauses)
|
||||
nil
|
||||
(let ((cl1 (car clauses))
|
||||
(sym (gensym)))
|
||||
`(let ((,sym ,(car cl1)))
|
||||
(if ,sym
|
||||
(if (null ',(cdr cl1))
|
||||
,sym
|
||||
(let ((it ,sym)) ,@(cdr cl1)))
|
||||
(anaphoric-cond ,@(cdr clauses)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-lambda (args &rest body)
|
||||
"Like `lambda', but the function may refer to itself as `self'.
|
||||
|
||||
ARGS and BODY are otherwise as documented for `lambda'."
|
||||
(declare (debug lambda)
|
||||
(indent defun))
|
||||
`(cl-labels ((self ,args ,@body))
|
||||
#'self))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-block (name &rest body)
|
||||
"Like `block', but the result of the previous expression is bound to `it'.
|
||||
|
||||
The variable `it' is available within all expressions of BODY
|
||||
except the initial one.
|
||||
|
||||
NAME and BODY are otherwise as documented for `block'."
|
||||
(declare (debug block)
|
||||
(indent 1))
|
||||
`(cl-block ,name
|
||||
,(funcall (anaphoric-lambda (body)
|
||||
(cl-case (length body)
|
||||
(0 nil)
|
||||
(1 (car body))
|
||||
(t `(let ((it ,(car body)))
|
||||
,(self (cdr body))))))
|
||||
body)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-case (expr &rest clauses)
|
||||
"Like `case', but the result of evaluating EXPR is bound to `it'.
|
||||
|
||||
The variable `it' is available within CLAUSES.
|
||||
|
||||
EXPR and CLAUSES are otherwise as documented for `case'."
|
||||
(declare (debug case)
|
||||
(indent 1))
|
||||
`(let ((it ,expr))
|
||||
(cl-case it ,@clauses)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-ecase (expr &rest clauses)
|
||||
"Like `ecase', but the result of evaluating EXPR is bound to `it'.
|
||||
|
||||
The variable `it' is available within CLAUSES.
|
||||
|
||||
EXPR and CLAUSES are otherwise as documented for `ecase'."
|
||||
(declare (debug ecase)
|
||||
(indent 1))
|
||||
`(let ((it ,expr))
|
||||
(cl-ecase it ,@clauses)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-typecase (expr &rest clauses)
|
||||
"Like `typecase', but the result of evaluating EXPR is bound to `it'.
|
||||
|
||||
The variable `it' is available within CLAUSES.
|
||||
|
||||
EXPR and CLAUSES are otherwise as documented for `typecase'."
|
||||
(declare (debug typecase)
|
||||
(indent 1))
|
||||
`(let ((it ,expr))
|
||||
(cl-typecase it ,@clauses)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-etypecase (expr &rest clauses)
|
||||
"Like `etypecase', but result of evaluating EXPR is bound to `it'.
|
||||
|
||||
The variable `it' is available within CLAUSES.
|
||||
|
||||
EXPR and CLAUSES are otherwise as documented for `etypecase'."
|
||||
(declare (debug etypecase)
|
||||
(indent 1))
|
||||
`(let ((it ,expr))
|
||||
(cl-etypecase it ,@clauses)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-pcase (expr &rest clauses)
|
||||
"Like `pcase', but the result of evaluating EXPR is bound to `it'.
|
||||
|
||||
The variable `it' is available within CLAUSES.
|
||||
|
||||
EXPR and CLAUSES are otherwise as documented for `pcase'."
|
||||
(declare (debug pcase)
|
||||
(indent 1))
|
||||
`(let ((it ,expr))
|
||||
(pcase it ,@clauses)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-let (form &rest body)
|
||||
"Like `let', but the result of evaluating FORM is bound to `it'.
|
||||
|
||||
FORM and BODY are otherwise as documented for `let'."
|
||||
(declare (debug let)
|
||||
(indent 1))
|
||||
`(let ((it ,form))
|
||||
(progn ,@body)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-+ (&rest numbers-or-markers)
|
||||
"Like `+', but the result of evaluating the previous expression is bound to `it'.
|
||||
|
||||
The variable `it' is available within all expressions after the
|
||||
initial one.
|
||||
|
||||
NUMBERS-OR-MARKERS are otherwise as documented for `+'."
|
||||
(declare (debug t))
|
||||
(cond
|
||||
((null numbers-or-markers)
|
||||
0)
|
||||
(t
|
||||
`(let ((it ,(car numbers-or-markers)))
|
||||
(+ it (anaphoric-+ ,@(cdr numbers-or-markers)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-- (&optional number-or-marker &rest numbers-or-markers)
|
||||
"Like `-', but the result of evaluating the previous expression is bound to `it'.
|
||||
|
||||
The variable `it' is available within all expressions after the
|
||||
initial one.
|
||||
|
||||
NUMBER-OR-MARKER and NUMBERS-OR-MARKERS are otherwise as
|
||||
documented for `-'."
|
||||
(declare (debug t))
|
||||
(cond
|
||||
((null number-or-marker)
|
||||
0)
|
||||
((null numbers-or-markers)
|
||||
`(- ,number-or-marker))
|
||||
(t
|
||||
`(let ((it ,(car numbers-or-markers)))
|
||||
(- ,number-or-marker (+ it (anaphoric-+ ,@(cdr numbers-or-markers))))))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-* (&rest numbers-or-markers)
|
||||
"Like `*', but the result of evaluating the previous expression is bound to `it'.
|
||||
|
||||
The variable `it' is available within all expressions after the
|
||||
initial one.
|
||||
|
||||
NUMBERS-OR-MARKERS are otherwise as documented for `*'."
|
||||
(declare (debug t))
|
||||
(cond
|
||||
((null numbers-or-markers)
|
||||
1)
|
||||
(t
|
||||
`(let ((it ,(car numbers-or-markers)))
|
||||
(* it (anaphoric-* ,@(cdr numbers-or-markers)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro anaphoric-/ (dividend divisor &rest divisors)
|
||||
"Like `/', but the result of evaluating the previous divisor is bound to `it'.
|
||||
|
||||
The variable `it' is available within all expressions after the
|
||||
first divisor.
|
||||
|
||||
DIVIDEND, DIVISOR, and DIVISORS are otherwise as documented for `/'."
|
||||
(declare (debug t))
|
||||
(cond
|
||||
((null divisors)
|
||||
`(/ ,dividend ,divisor))
|
||||
(t
|
||||
`(let ((it ,divisor))
|
||||
(/ ,dividend (* it (anaphoric-* ,@divisors)))))))
|
||||
|
||||
(provide 'anaphora)
|
||||
|
||||
;;
|
||||
;; Emacs
|
||||
;;
|
||||
;; Local Variables:
|
||||
;; indent-tabs-mode: nil
|
||||
;; mangle-whitespace: t
|
||||
;; require-final-newline: t
|
||||
;; coding: utf-8
|
||||
;; byte-compile-warnings: (not cl-functions redefine)
|
||||
;; End:
|
||||
;;
|
||||
;; LocalWords: Anaphora EXPR awhen COND ARGS alambda ecase typecase
|
||||
;; LocalWords: etypecase aprog aand acond ablock acase aecase alet
|
||||
;; LocalWords: atypecase aetypecase apcase
|
||||
;;
|
||||
|
||||
;;; anaphora.el ends here
|
||||
@@ -6,7 +6,7 @@
|
||||
;; Thierry Volpiatto <thievol@posteo.net>
|
||||
|
||||
;; Keywords: dired async byte-compile
|
||||
;; X-URL: https://github.com/jwiegley/dired-async
|
||||
;; X-URL: https://github.com/jwiegley/emacs-async
|
||||
|
||||
;; 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
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
(define-package "async" "20221217.649" "Asynchronous processing in Emacs"
|
||||
(define-package "async" "20230528.622" "Asynchronous processing in Emacs"
|
||||
'((emacs "24.4"))
|
||||
:commit "c4772bec684776e93f1b8d845b452dc850ee2315" :authors
|
||||
:commit "3ae74c0a4ba223ba373e0cb636c385e08d8838be" :authors
|
||||
'(("John Wiegley" . "jwiegley@gmail.com"))
|
||||
:maintainers
|
||||
'(("Thierry Volpiatto" . "thievol@posteo.net"))
|
||||
:maintainer
|
||||
'("Thierry Volpiatto" . "thievol@posteo.net")
|
||||
:keywords
|
||||
|
||||
@@ -46,11 +46,17 @@
|
||||
(defvar async-send-over-pipe t)
|
||||
(defvar async-in-child-emacs nil)
|
||||
(defvar async-callback nil)
|
||||
(defvar async-callback-for-process nil)
|
||||
(defvar async-callback-for-process nil
|
||||
"Non-nil if the subprocess is not Emacs executing a lisp form.")
|
||||
(defvar async-callback-value nil)
|
||||
(defvar async-callback-value-set nil)
|
||||
(defvar async-current-process nil)
|
||||
(defvar async--procvar nil)
|
||||
(defvar async-read-marker nil
|
||||
"Position from which we read the last message packet.
|
||||
|
||||
Message packets are delivered from client line-by-line as base64
|
||||
encoded strings.")
|
||||
(defvar async-child-init nil
|
||||
"Initialisation file for async child Emacs.
|
||||
|
||||
@@ -171,12 +177,16 @@ It is intended to be used as follows:
|
||||
(prog1
|
||||
(funcall async-callback proc)
|
||||
(unless async-debug
|
||||
(kill-buffer (current-buffer))))
|
||||
;; we need to check this because theoretically
|
||||
;; `async-callback' could've killed it already
|
||||
(when (buffer-live-p (process-buffer proc))
|
||||
(kill-buffer (process-buffer proc)))))
|
||||
(set (make-local-variable 'async-callback-value) proc)
|
||||
(set (make-local-variable 'async-callback-value-set) t))
|
||||
;; Maybe strip out unreadable "#"; They are replaced by
|
||||
;; empty string unless they are prefixing a special
|
||||
;; object like a marker. See issue #145.
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(save-excursion
|
||||
;; Transform markers in list like
|
||||
@@ -189,22 +199,70 @@ It is intended to be used as follows:
|
||||
(replace-match "(" t t))
|
||||
(goto-char (point-max))
|
||||
(backward-sexp)
|
||||
(async-handle-result async-callback (read (current-buffer))
|
||||
(current-buffer)))
|
||||
(let ((value (read (current-buffer))))
|
||||
(async-handle-result async-callback value (current-buffer))))
|
||||
(set (make-local-variable 'async-callback-value)
|
||||
(list 'error
|
||||
(format "Async process '%s' failed with exit code %d"
|
||||
(process-name proc) (process-exit-status proc))))
|
||||
(set (make-local-variable 'async-callback-value-set) t))))))
|
||||
|
||||
(defun async-read-from-client (proc string)
|
||||
"Process text from client process.
|
||||
|
||||
The string chunks usually arrive in maximum of 4096 bytes, so a
|
||||
long client message might be split into multiple calls of this
|
||||
function.
|
||||
|
||||
We use a marker `async-read-marker' to track the position of the
|
||||
lasts complete line. Every time we get new input, we try to look
|
||||
for newline, and if found, process the entire line and bump the
|
||||
marker position to the end of this next line."
|
||||
(with-current-buffer (process-buffer proc)
|
||||
(goto-char (point-max))
|
||||
(save-excursion
|
||||
(insert string))
|
||||
|
||||
(while (search-forward "\n" nil t)
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(widen)
|
||||
(narrow-to-region async-read-marker (point))
|
||||
(goto-char (point-min))
|
||||
(let (msg)
|
||||
(condition-case nil
|
||||
;; It is safe to throw errors in the read because we
|
||||
;; send messages always on their own line, and they
|
||||
;; are always a base64 encoded string, so a message
|
||||
;; will always read. We will also ignore the rest
|
||||
;; of this line since there won't be anything
|
||||
;; interesting.
|
||||
(while (setq msg (read (current-buffer)))
|
||||
(let ((msg-decoded (ignore-errors (base64-decode-string msg))))
|
||||
(when msg-decoded
|
||||
(setq msg-decoded (car (read-from-string msg-decoded)))
|
||||
(when (and (listp msg-decoded)
|
||||
(async-message-p msg-decoded)
|
||||
async-callback)
|
||||
(funcall async-callback msg-decoded)))))
|
||||
;; This is OK, we reached the end of the chunk subprocess sent
|
||||
;; at this time.
|
||||
(invalid-read-syntax t)
|
||||
(end-of-file t)))
|
||||
(goto-char (point-max))
|
||||
(move-marker async-read-marker (point)))))))
|
||||
|
||||
(defun async--receive-sexp (&optional stream)
|
||||
;; FIXME: Why use `utf-8-auto' instead of `utf-8-unix'? This is
|
||||
;; a communication channel over which we have complete control,
|
||||
;; so we get to choose exactly which encoding and EOL we use, isn't it?
|
||||
;; so we get to choose exactly which encoding and EOL we use, isn't
|
||||
;; it?
|
||||
;; UPDATE: We use now `utf-8-emacs-unix' instead of `utf-8-auto' as
|
||||
;; recommended in bug#165.
|
||||
(let ((sexp (decode-coding-string (base64-decode-string (read stream))
|
||||
'utf-8-auto))
|
||||
'utf-8-emacs-unix))
|
||||
;; Parent expects UTF-8 encoded text.
|
||||
(coding-system-for-write 'utf-8-auto))
|
||||
(coding-system-for-write 'utf-8-emacs-unix))
|
||||
(if async-debug
|
||||
(message "Received sexp {{{%s}}}" (pp-to-string sexp)))
|
||||
(setq sexp (read sexp))
|
||||
@@ -221,7 +279,7 @@ It is intended to be used as follows:
|
||||
(print-symbols-bare t))
|
||||
(prin1 sexp (current-buffer))
|
||||
;; Just in case the string we're sending might contain EOF
|
||||
(encode-coding-region (point-min) (point-max) 'utf-8-auto)
|
||||
(encode-coding-region (point-min) (point-max) 'utf-8-emacs-unix)
|
||||
(base64-encode-region (point-min) (point-max) t)
|
||||
(goto-char (point-min)) (insert ?\")
|
||||
(goto-char (point-max)) (insert ?\" ?\n)))
|
||||
@@ -237,17 +295,27 @@ It is intended to be used as follows:
|
||||
"Called from the child Emacs process' command line."
|
||||
;; Make sure 'message' and 'prin1' encode stuff in UTF-8, as parent
|
||||
;; process expects.
|
||||
(let ((coding-system-for-write 'utf-8-auto)
|
||||
(let ((coding-system-for-write 'utf-8-emacs-unix)
|
||||
(args-left command-line-args-left))
|
||||
(setq async-in-child-emacs t
|
||||
debug-on-error async-debug
|
||||
command-line-args-left nil)
|
||||
(condition-case-unless-debug err
|
||||
(prin1 (funcall
|
||||
(async--receive-sexp (unless async-send-over-pipe
|
||||
args-left))))
|
||||
(let ((ret (funcall
|
||||
(async--receive-sexp (unless async-send-over-pipe
|
||||
args-left)))))
|
||||
;; The newlines makes client messages more robust and also
|
||||
;; handle some weird line-buffering issues on windows.
|
||||
;; Sometimes, the last "chunk" was not read by the filter,
|
||||
;; so a newline here should force a buffer flush.
|
||||
(princ "\n")
|
||||
(prin1 ret)
|
||||
(princ "\n"))
|
||||
(error
|
||||
(prin1 (list 'async-signal err))))))
|
||||
(progn
|
||||
(princ "\n")
|
||||
(prin1 (list 'async-signal err))
|
||||
(princ "\n"))))))
|
||||
|
||||
(defun async-ready (future)
|
||||
"Query a FUTURE to see if it is ready.
|
||||
@@ -277,20 +345,51 @@ its FINISH-FUNC is nil."
|
||||
#'identity async-callback-value (current-buffer))))))
|
||||
|
||||
(defun async-message-p (value)
|
||||
"Return non-nil of VALUE is an async.el message packet."
|
||||
"Return non-nil if VALUE is an async.el message packet."
|
||||
(and (listp value)
|
||||
(plist-get value :async-message)))
|
||||
|
||||
(defun async-send (&rest args)
|
||||
"Send the given messages to the asychronous Emacs PROCESS."
|
||||
(defun async-send (process-or-key &rest args)
|
||||
"Send the given message to the asychronous child or parent Emacs.
|
||||
|
||||
To send messages from the parent to a child, PROCESS-OR-KEY is
|
||||
the child process object. ARGS is a plist. Example:
|
||||
|
||||
(async-send proc :operation :load-file :file \"this file\")
|
||||
|
||||
To send messages from the child to the parent, PROCESS-OR-KEY is
|
||||
the first key of the plist, ARGS is a value followed by
|
||||
optionally more key-value pairs. Example:
|
||||
|
||||
(async-send :status \"finished\" :file-size 123)"
|
||||
(let ((args (append args '(:async-message t))))
|
||||
(if async-in-child-emacs
|
||||
(if async-callback
|
||||
(funcall async-callback args))
|
||||
(async--transmit-sexp (car args) (list 'quote (cdr args))))))
|
||||
;; `princ' because async--insert-sexp already quotes everything.
|
||||
(princ
|
||||
(with-temp-buffer
|
||||
(async--insert-sexp (cons process-or-key args))
|
||||
;; always make sure that one message package has its own
|
||||
;; line as there can be any random debug garbage printed
|
||||
;; above it.
|
||||
(concat "\n" (buffer-string))))
|
||||
(async--transmit-sexp process-or-key (list 'quote args)))))
|
||||
|
||||
(defun async-receive ()
|
||||
"Send the given messages to the asychronous Emacs PROCESS."
|
||||
"Receive message from parent Emacs.
|
||||
|
||||
The child process blocks until a message is received.
|
||||
|
||||
Message is a plist with one key :async-message set to t always
|
||||
automatically added to signify this plist is an async message.
|
||||
|
||||
You can use `async-message-p' to test if the payload was a
|
||||
message.
|
||||
|
||||
Use
|
||||
|
||||
(let ((msg (async-receive))) ...)
|
||||
|
||||
to read and process a message."
|
||||
(async--receive-sexp))
|
||||
|
||||
;;;###autoload
|
||||
@@ -302,11 +401,26 @@ object will return the process object when the program is
|
||||
finished. Set DEFAULT-DIRECTORY to change PROGRAM's current
|
||||
working directory."
|
||||
(let* ((buf (generate-new-buffer (concat "*" name "*")))
|
||||
(buf-err (generate-new-buffer (concat "*" name ":err*")))
|
||||
(proc (let ((process-connection-type nil))
|
||||
(apply #'start-process name buf program program-args))))
|
||||
(make-process
|
||||
:name name
|
||||
:buffer buf
|
||||
:stderr buf-err
|
||||
:command (cons program program-args)))))
|
||||
(set-process-sentinel
|
||||
(get-buffer-process buf-err)
|
||||
(lambda (proc _change)
|
||||
(unless (or async-debug (process-live-p proc))
|
||||
(kill-buffer (process-buffer proc)))))
|
||||
(with-current-buffer buf
|
||||
(set (make-local-variable 'async-callback) finish-func)
|
||||
(set (make-local-variable 'async-read-marker)
|
||||
(set-marker (make-marker) (point-min) buf))
|
||||
(set-marker-insertion-type async-read-marker nil)
|
||||
|
||||
(set-process-sentinel proc #'async-when-done)
|
||||
(set-process-filter proc #'async-read-from-client)
|
||||
(unless (string= name "emacs")
|
||||
(set (make-local-variable 'async-callback-for-process) t))
|
||||
proc)))
|
||||
@@ -348,6 +462,16 @@ When done, the return value is passed to FINISH-FUNC. Example:
|
||||
(message \"Async process done, result should be 222: %s\"
|
||||
result)))
|
||||
|
||||
If you call `async-send' from a child process, the message will
|
||||
be also passed to the FINISH-FUNC. You can test RESULT to see if
|
||||
it is a message by using `async-message-p'. If nil, it means
|
||||
this is the final result. Example of the FINISH-FUNC:
|
||||
|
||||
(lambda (result)
|
||||
(if (async-message-p result)
|
||||
(message \"Received a message from child process: %s\" result)
|
||||
(message \"Async process done, result: %s\" result)))
|
||||
|
||||
If FINISH-FUNC is nil or missing, a future is returned that can
|
||||
be inspected using `async-get', blocking until the value is
|
||||
ready. Example:
|
||||
@@ -392,7 +516,7 @@ returns nil. It can still be useful, however, as an argument to
|
||||
`async-ready' or `async-wait'."
|
||||
(let ((sexp start-func)
|
||||
;; Subordinate Emacs will send text encoded in UTF-8.
|
||||
(coding-system-for-read 'utf-8-auto))
|
||||
(coding-system-for-read 'utf-8-emacs-unix))
|
||||
(setq async--procvar
|
||||
(apply 'async-start-process
|
||||
"emacs" (file-truename
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
;; Thierry Volpiatto <thievol@posteo.net>
|
||||
|
||||
;; Keywords: dired async network
|
||||
;; X-URL: https://github.com/jwiegley/dired-async
|
||||
;; X-URL: https://github.com/jwiegley/emacs-async
|
||||
|
||||
;; 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
|
||||
@@ -251,7 +251,7 @@ See `dired-create-files' for the behavior of arguments."
|
||||
(setq overwrite-query nil)
|
||||
(let ((total (length fn-list))
|
||||
failures async-fn-list skipped callback
|
||||
async-quiet-switch)
|
||||
async-quiet-switch create-dir)
|
||||
(let (to)
|
||||
(dolist (from fn-list)
|
||||
(setq to (funcall name-constructor from))
|
||||
@@ -344,7 +344,17 @@ ESC or `q' to not overwrite any of the remaining files,
|
||||
for destp = (file-exists-p to)
|
||||
do (and bf destp
|
||||
(with-current-buffer bf
|
||||
(set-visited-file-name to t t))))))))
|
||||
(set-visited-file-name to t t)))))))
|
||||
(let ((dirp (file-directory-p to))
|
||||
(dest (file-name-directory to)))
|
||||
(when (boundp 'dired-create-destination-dirs)
|
||||
(setq create-dir
|
||||
(cl-case dired-create-destination-dirs
|
||||
(always 'always)
|
||||
(ask (and (null dirp)
|
||||
(null (file-directory-p dest))
|
||||
(y-or-n-p (format "Create directory `%s'? " dest)))
|
||||
'always))))))
|
||||
;; Start async process.
|
||||
(when async-fn-list
|
||||
(process-put
|
||||
@@ -353,7 +363,8 @@ ESC or `q' to not overwrite any of the remaining files,
|
||||
,(async-inject-variables dired-async-env-variables-regexp)
|
||||
(let ((dired-recursive-copies (quote always))
|
||||
(dired-copy-preserve-time
|
||||
,dired-copy-preserve-time))
|
||||
,dired-copy-preserve-time)
|
||||
(dired-create-destination-dirs ',create-dir))
|
||||
(setq overwrite-backup-query nil)
|
||||
;; Inline `backup-file' as long as it is not
|
||||
;; available in emacs.
|
||||
|
||||
15
lisp/avy/avy-pkg.el
Normal file
15
lisp/avy/avy-pkg.el
Normal file
@@ -0,0 +1,15 @@
|
||||
(define-package "avy" "20230420.404" "Jump to arbitrary positions in visible text and select text quickly."
|
||||
'((emacs "24.1")
|
||||
(cl-lib "0.5"))
|
||||
:commit "be612110cb116a38b8603df367942e2bb3d9bdbe" :authors
|
||||
'(("Oleh Krehel" . "ohwoeowho@gmail.com"))
|
||||
:maintainers
|
||||
'(("Oleh Krehel" . "ohwoeowho@gmail.com"))
|
||||
:maintainer
|
||||
'("Oleh Krehel" . "ohwoeowho@gmail.com")
|
||||
:keywords
|
||||
'("point" "location")
|
||||
:url "https://github.com/abo-abo/avy")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
;; Author: Oleh Krehel <ohwoeowho@gmail.com>
|
||||
;; URL: https://github.com/abo-abo/avy
|
||||
;; Package-Version: 20220910.1936
|
||||
;; Package-Commit: 955c8dedd68c74f3cf692c1249513f048518c4c9
|
||||
;; Version: 0.5.0
|
||||
;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
|
||||
;; Keywords: point, location
|
||||
@@ -397,7 +395,7 @@ SEQ-LEN is how many elements of KEYS it takes to identify a match."
|
||||
|
||||
(defvar avy-command nil
|
||||
"Store the current command symbol.
|
||||
E.g. 'avy-goto-line or 'avy-goto-char.")
|
||||
E.g. `avy-goto-line' or `avy-goto-char'.")
|
||||
|
||||
(defun avy-tree (lst keys)
|
||||
"Coerce LST into a balanced tree.
|
||||
@@ -840,11 +838,11 @@ Set `avy-style' according to COMMAND as well."
|
||||
avy-last-candidates))
|
||||
(min-dist
|
||||
(apply #'min
|
||||
(mapcar (lambda (x) (abs (- (caar x) (point)))) avy-last-candidates)))
|
||||
(mapcar (lambda (x) (abs (- (if (listp (car x)) (caar x) (car x)) (point)))) avy-last-candidates)))
|
||||
(pos
|
||||
(cl-position-if
|
||||
(lambda (x)
|
||||
(= (- (caar x) (point)) min-dist))
|
||||
(= (- (if (listp (car x)) (caar x) (car x)) (point)) min-dist))
|
||||
avy-last-candidates)))
|
||||
(funcall advancer pos avy-last-candidates)))
|
||||
|
||||
@@ -854,7 +852,8 @@ Set `avy-style' according to COMMAND as well."
|
||||
(avy--last-candidates-cycle
|
||||
(lambda (pos lst)
|
||||
(when (> pos 0)
|
||||
(goto-char (caar (nth (1- pos) lst)))))))
|
||||
(let ((candidate (nth (1- pos) lst)))
|
||||
(goto-char (if (listp (car candidate)) (caar candidate) (car candidate))))))))
|
||||
|
||||
(defun avy-next ()
|
||||
"Go to the next candidate of the last `avy-read'."
|
||||
@@ -862,7 +861,8 @@ Set `avy-style' according to COMMAND as well."
|
||||
(avy--last-candidates-cycle
|
||||
(lambda (pos lst)
|
||||
(when (< pos (1- (length lst)))
|
||||
(goto-char (caar (nth (1+ pos) lst)))))))
|
||||
(let ((candidate (nth (1+ pos) lst)))
|
||||
(goto-char (if (listp (car candidate)) (caar candidate) (car candidate))))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun avy-process (candidates &optional overlay-fn cleanup-fn)
|
||||
@@ -935,14 +935,14 @@ multiple OVERLAY-FN invocations."
|
||||
(null (assoc invisible buffer-invisibility-spec)))))
|
||||
|
||||
(defun avy--next-visible-point ()
|
||||
"Return the next closest point without 'invisible property."
|
||||
"Return the next closest point without `invisible' property."
|
||||
(let ((s (point)))
|
||||
(while (and (not (= (point-max) (setq s (next-char-property-change s))))
|
||||
(not (avy--visible-p s))))
|
||||
s))
|
||||
|
||||
(defun avy--next-invisible-point ()
|
||||
"Return the next closest point with 'invisible property."
|
||||
"Return the next closest point with `invisible' property."
|
||||
(let ((s (point)))
|
||||
(while (and (not (= (point-max) (setq s (next-char-property-change s))))
|
||||
(avy--visible-p s)))
|
||||
@@ -1666,6 +1666,7 @@ When BOTTOM-UP is non-nil, display avy candidates from top to bottom"
|
||||
(defvar linum-overlays)
|
||||
(defvar linum-format)
|
||||
(declare-function linum--face-width "linum")
|
||||
(declare-function linum-mode "linum")
|
||||
|
||||
(define-minor-mode avy-linum-mode
|
||||
"Minor mode that uses avy hints for `linum-mode'."
|
||||
17
lisp/biblio-core/biblio-core-pkg.el
Normal file
17
lisp/biblio-core/biblio-core-pkg.el
Normal file
@@ -0,0 +1,17 @@
|
||||
(define-package "biblio-core" "20230202.1721" "A framework for looking up and displaying bibliographic entries"
|
||||
'((emacs "24.3")
|
||||
(let-alist "1.0.4")
|
||||
(seq "1.11")
|
||||
(dash "2.12.1"))
|
||||
:commit "ee52f6cda82ea6fbc3b400e7b12132595cc0374c" :authors
|
||||
'(("Clément Pit-Claudel" . "clement.pitclaudel@live.com"))
|
||||
:maintainers
|
||||
'(("Clément Pit-Claudel" . "clement.pitclaudel@live.com"))
|
||||
:maintainer
|
||||
'("Clément Pit-Claudel" . "clement.pitclaudel@live.com")
|
||||
:keywords
|
||||
'("bib" "tex" "convenience" "hypermedia")
|
||||
:url "https://github.com/cpitclaudel/biblio.el")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
@@ -3,9 +3,7 @@
|
||||
;; Copyright (C) 2016 Clément Pit-Claudel
|
||||
|
||||
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
|
||||
;; Version: 0.2.1
|
||||
;; Package-Version: 20210418.406
|
||||
;; Package-Commit: 517ec18f00f91b61481214b178f7ae0b8fbc499b
|
||||
;; Version: 0.3
|
||||
;; Package-Requires: ((emacs "24.3") (let-alist "1.0.4") (seq "1.11") (dash "2.12.1"))
|
||||
;; Keywords: bib, tex, convenience, hypermedia
|
||||
;; URL: https://github.com/cpitclaudel/biblio.el
|
||||
@@ -215,7 +213,7 @@ URL and CALLBACK; see `url-queue-retrieve'"
|
||||
(if biblio-synchronous
|
||||
(with-current-buffer (url-retrieve-synchronously url)
|
||||
(funcall callback nil))
|
||||
(setq url-queue-timeout 1)
|
||||
(setq url-queue-timeout 5)
|
||||
(url-queue-retrieve url callback)))
|
||||
|
||||
(defun biblio-strip (str)
|
||||
@@ -485,7 +483,10 @@ will be called with the metadata of the current item.")
|
||||
|
||||
(defun biblio--completing-read-function ()
|
||||
"Return ido, unless user picked another completion package."
|
||||
(if (eq completing-read-function #'completing-read-default)
|
||||
(if (and (eq completing-read-function #'completing-read-default)
|
||||
(not (catch 'advised ;; https://github.com/cpitclaudel/biblio.el/issues/55
|
||||
(advice-mapc (lambda (&rest _args) (throw 'advised t))
|
||||
'completing-read-default))))
|
||||
#'ido-completing-read
|
||||
completing-read-function))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(define-package "biblio" "20210418.406" "Browse and import bibliographic references from CrossRef, arXiv, DBLP, HAL, Dissemin, and doi.org"
|
||||
(define-package "biblio" "20230202.1721" "Browse and import bibliographic references from CrossRef, arXiv, DBLP, HAL, Dissemin, and doi.org"
|
||||
'((emacs "24.3")
|
||||
(biblio-core "0.2"))
|
||||
:commit "368f45bf9a64450705a63598224c5af96160af76" :authors
|
||||
:commit "ee52f6cda82ea6fbc3b400e7b12132595cc0374c" :authors
|
||||
'(("Clément Pit-Claudel" . "clement.pitclaudel@live.com"))
|
||||
:maintainer
|
||||
'("Clément Pit-Claudel" . "clement.pitclaudel@live.com")
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
;; Copyright (C) 2016 Clément Pit-Claudel
|
||||
|
||||
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
|
||||
;; Version: 0.2
|
||||
;; Package-Requires: ((emacs "24.3") (biblio-core "0.2"))
|
||||
;; Version: 0.3
|
||||
;; Package-Requires: ((emacs "24.3") (biblio-core "0.3"))
|
||||
;; Keywords: bib, tex, convenience, hypermedia
|
||||
;; URL: https://github.com/cpitclaudel/biblio.el
|
||||
|
||||
|
||||
19
lisp/bibtex-completion/bibtex-completion-pkg.el
Normal file
19
lisp/bibtex-completion/bibtex-completion-pkg.el
Normal file
@@ -0,0 +1,19 @@
|
||||
(define-package "bibtex-completion" "20230918.953" "A BibTeX backend for completion frameworks"
|
||||
'((parsebib "1.0")
|
||||
(s "1.9.0")
|
||||
(dash "2.6.0")
|
||||
(f "0.16.2")
|
||||
(cl-lib "0.5")
|
||||
(biblio "0.2")
|
||||
(emacs "26.1"))
|
||||
:commit "95551744de8210867e9d34feaf47ae639ea04114" :authors
|
||||
'(("Titus von der Malsburg" . "malsburg@posteo.de")
|
||||
("Justin Burkett" . "justin@burkett.cc"))
|
||||
:maintainers
|
||||
'(("Titus von der Malsburg" . "malsburg@posteo.de"))
|
||||
:maintainer
|
||||
'("Titus von der Malsburg" . "malsburg@posteo.de")
|
||||
:url "https://github.com/tmalsburg/helm-bibtex")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
@@ -4,8 +4,6 @@
|
||||
;; Justin Burkett <justin@burkett.cc>
|
||||
;; Maintainer: Titus von der Malsburg <malsburg@posteo.de>
|
||||
;; URL: https://github.com/tmalsburg/helm-bibtex
|
||||
;; Package-Version: 20221024.857
|
||||
;; Package-Commit: 78f5931e1cc82e7ae2bcf0508cf31d0d1629a8dd
|
||||
;; Version: 1.0.0
|
||||
;; Package-Requires: ((parsebib "1.0") (s "1.9.0") (dash "2.6.0") (f "0.16.2") (cl-lib "0.5") (biblio "0.2") (emacs "26.1"))
|
||||
|
||||
@@ -1187,6 +1185,9 @@ string if FIELD is not present in ENTRY and DEFAULT is nil."
|
||||
("editor-abbrev"
|
||||
(when-let ((value (bibtex-completion-get-value "editor" entry)))
|
||||
(bibtex-completion-apa-format-editors-abbrev value)))
|
||||
((or "journal" "journaltitle")
|
||||
(or (bibtex-completion-get-value "journal" entry)
|
||||
(bibtex-completion-get-value "journaltitle" entry)))
|
||||
(_
|
||||
;; Real fields:
|
||||
(let ((value (bibtex-completion-get-value field entry)))
|
||||
@@ -1218,9 +1219,11 @@ string if FIELD is not present in ENTRY and DEFAULT is nil."
|
||||
;; the journal in its title.
|
||||
("pages" (s-join "–" (s-split "[^0-9]+" value t)))
|
||||
("doi" (s-concat " http://dx.doi.org/" value))
|
||||
("year" (or value
|
||||
(car (split-string (bibtex-completion-get-value "date" entry "") "-"))))
|
||||
(_ value))))))
|
||||
("year" value)
|
||||
(_ value))
|
||||
(pcase field
|
||||
("year" (car (split-string (bibtex-completion-get-value "date" entry "") "-"))))
|
||||
))))
|
||||
default ""))
|
||||
|
||||
(defun bibtex-completion-apa-format-authors (value &optional abbrev)
|
||||
14
lisp/bind-key/bind-key-pkg.el
Normal file
14
lisp/bind-key/bind-key-pkg.el
Normal file
@@ -0,0 +1,14 @@
|
||||
(define-package "bind-key" "20230203.2004" "A simple way to manage personal keybindings"
|
||||
'((emacs "24.3"))
|
||||
:commit "77945e002f11440eae72d8730d3de218163d551e" :authors
|
||||
'(("John Wiegley" . "johnw@newartisans.com"))
|
||||
:maintainers
|
||||
'(("John Wiegley" . "johnw@newartisans.com"))
|
||||
:maintainer
|
||||
'("John Wiegley" . "johnw@newartisans.com")
|
||||
:keywords
|
||||
'("keys" "keybinding" "config" "dotemacs" "extensions")
|
||||
:url "https://github.com/jwiegley/use-package")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
@@ -6,8 +6,6 @@
|
||||
;; Maintainer: John Wiegley <johnw@newartisans.com>
|
||||
;; Created: 16 Jun 2012
|
||||
;; Version: 2.4.1
|
||||
;; Package-Version: 20221209.2013
|
||||
;; Package-Commit: bcf0984cf55b70fe6896c6a15f61df92b24f8ffd
|
||||
;; Package-Requires: ((emacs "24.3"))
|
||||
;; Keywords: keys keybinding config dotemacs extensions
|
||||
;; URL: https://github.com/jwiegley/use-package
|
||||
@@ -168,7 +166,8 @@ KEY-NAME may be a vector, in which case it is passed straight to
|
||||
spelled-out keystrokes, e.g., \"C-c C-z\". See the documentation
|
||||
of `edmacro-mode' for details.
|
||||
|
||||
COMMAND must be an interactive function or lambda form.
|
||||
COMMAND must be an interactive function, lambda form, or a cons
|
||||
`(STRING . DEFN)'.
|
||||
|
||||
KEYMAP, if present, should be a keymap variable or symbol.
|
||||
For example:
|
||||
15
lisp/cfrs/cfrs-pkg.el
Normal file
15
lisp/cfrs/cfrs-pkg.el
Normal file
@@ -0,0 +1,15 @@
|
||||
(define-package "cfrs" "20220129.1149" "Child-frame based read-string"
|
||||
'((emacs "26.1")
|
||||
(dash "2.11.0")
|
||||
(s "1.10.0")
|
||||
(posframe "0.6.0"))
|
||||
:commit "f3a21f237b2a54e6b9f8a420a9da42b4f0a63121" :authors
|
||||
'(("Alexander Miller" . "alexanderm@web.de"))
|
||||
:maintainers
|
||||
'(("Alexander Miller" . "alexanderm@web.de"))
|
||||
:maintainer
|
||||
'("Alexander Miller" . "alexanderm@web.de")
|
||||
:url "https://github.com/Alexander-Miller/cfrs")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
@@ -4,9 +4,7 @@
|
||||
|
||||
;; Author: Alexander Miller <alexanderm@web.de>
|
||||
;; Package-Requires: ((emacs "26.1") (dash "2.11.0") (s "1.10.0") (posframe "0.6.0"))
|
||||
;; Package-Commit: f3a21f237b2a54e6b9f8a420a9da42b4f0a63121
|
||||
;; Package-Version: 20220129.1149
|
||||
;; Package-X-Original-Version: 1.6.0
|
||||
;; Package-Version: 1.6.0
|
||||
;; Homepage: https://github.com/Alexander-Miller/cfrs
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
@@ -141,7 +141,7 @@ links else). For legacy reasons, any other value is treated as
|
||||
;; Add cite prefix and suffix
|
||||
(when (s-present-p plain-suff)
|
||||
(push (citeproc-rt-from-str suff) result)
|
||||
(unless (= (aref plain-suff 0) ?\s)
|
||||
(unless (memql (aref plain-suff 0) '(?, ?\s))
|
||||
(push " " result)))
|
||||
(push rendered-varlist result)
|
||||
(when (s-present-p plain-pref)
|
||||
@@ -237,11 +237,11 @@ For the optional INTERNAL-LINKS argument see
|
||||
(cadr first-elt)
|
||||
first-elt))
|
||||
(author-cite
|
||||
(append '((suppress-author . nil) (stop-rendering-at . names))
|
||||
first-cite))
|
||||
(append '((suppress-author . nil) (stop-rendering-at . names)
|
||||
(prefix) (suffix) (locator))
|
||||
first-cite))
|
||||
(rendered-author (citeproc-cite--render author-cite style 'no-links)))
|
||||
(when (and (listp rendered-author)
|
||||
(alist-get 'stopped-rendering (car rendered-author)))
|
||||
(when (listp rendered-author)
|
||||
(setq result `(nil ,rendered-author " " ,result)))))
|
||||
;; Capitalize first
|
||||
(when (citeproc-citation-capitalize-first c)
|
||||
@@ -548,6 +548,7 @@ Possible values are `last', `first' and `subsequent'.")
|
||||
(unless (citeproc-proc-finalized proc)
|
||||
(citeproc-proc-process-uncited proc)
|
||||
(citeproc-sb-add-subbib-info proc)
|
||||
(citeproc-sb-prune-unrendered proc)
|
||||
(citeproc-proc-update-sortkeys proc)
|
||||
(citeproc-proc-sort-itds proc)
|
||||
(citeproc-proc-update-positions proc)
|
||||
|
||||
@@ -164,8 +164,10 @@ Performs finalization by removing unnecessary zero-width spaces."
|
||||
(setq result (citeproc-s-replace-all-seq
|
||||
result '((" " . " ") (" " . " ") ("," . ",") (";" . ";")
|
||||
(":" . ":") ("." . "."))))
|
||||
;; Starting and ending z-w spaces are also removed.
|
||||
(when (= (aref result 0) 8203)
|
||||
;; Starting and ending z-w spaces are also removed, but not before an
|
||||
;; asterisk to avoid creating an Org heading.
|
||||
(when (and (= (aref result 0) 8203)
|
||||
(not (= (aref result 1) ?*)))
|
||||
(setq result (substring result 1)))
|
||||
(when (= (aref result (- (length result) 1)) 8203)
|
||||
(setq result (substring result 0 -1))))
|
||||
@@ -371,7 +373,9 @@ CSL tests."
|
||||
:rt (citeproc-formatter-fun-create citeproc-fmt--org-latex-alist)
|
||||
:bib #'citeproc-fmt--org-latex-bib-formatter))
|
||||
(latex . ,(citeproc-formatter-create
|
||||
:rt (citeproc-formatter-fun-create citeproc-fmt--latex-alist)))
|
||||
:rt (citeproc-formatter-fun-create citeproc-fmt--latex-alist)
|
||||
:bib (lambda (x _) (concat (mapconcat #'identity x "\n\n")
|
||||
"\\bigskip"))))
|
||||
(plain . ,(citeproc-formatter-create :rt #'citeproc-rt-to-plain
|
||||
:no-external-links t)))
|
||||
"Alist mapping supported output formats to formatter structs.")
|
||||
|
||||
@@ -45,9 +45,10 @@ OCCURRED-BEFORE is used during bibliography generation to
|
||||
DISAMB-POS contains the position on which cite disambiguation is
|
||||
based. Possible values are 'first, 'ibid and 'subsequent,
|
||||
SUBBIB-NOS is a list of numeric indexes of sub-bibliographies
|
||||
in which the item occurs."
|
||||
in which the item occurs,
|
||||
UNCITED is t iff the item has no associated citation."
|
||||
varvals rawcite rawbibitem rc-uptodate sort-key occurred-before
|
||||
disamb-pos subbib-nos)
|
||||
disamb-pos subbib-nos uncited)
|
||||
|
||||
(defun citeproc-itd-getvar (itd var)
|
||||
"Return itemdata ITD's value for VAR ."
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(define-package "citeproc" "20221216.1238" "A CSL 1.0.2 Citation Processor"
|
||||
(define-package "citeproc" "20230228.1414" "A CSL 1.0.2 Citation Processor"
|
||||
'((emacs "26")
|
||||
(dash "2.13.0")
|
||||
(s "1.12.0")
|
||||
@@ -7,7 +7,9 @@
|
||||
(string-inflection "1.0")
|
||||
(org "9")
|
||||
(parsebib "2.4"))
|
||||
:commit "3cb83db147bdda208520246e82dbf9878fa3cbd0" :authors
|
||||
:commit "290320fc579f886255f00d7268600df7fa5cc7e8" :authors
|
||||
'(("András Simonyi" . "andras.simonyi@gmail.com"))
|
||||
:maintainers
|
||||
'(("András Simonyi" . "andras.simonyi@gmail.com"))
|
||||
:maintainer
|
||||
'("András Simonyi" . "andras.simonyi@gmail.com")
|
||||
|
||||
@@ -99,11 +99,11 @@ sorted."
|
||||
(push (cons 'editor-translator editor) result))
|
||||
result))
|
||||
|
||||
(defun citeproc-proc--put-item (proc item itemid)
|
||||
(defun citeproc-proc--put-item (proc item itemid &optional uncited)
|
||||
"Put parsed csl-json ITEM with ITEMID into PROC.
|
||||
Return the added itemdata structure."
|
||||
(let* ((int-vars (citeproc-proc--internalize-item proc item))
|
||||
(itemdata (citeproc-itemdata-create :varvals int-vars :rc-uptodate nil)))
|
||||
(itemdata (citeproc-itemdata-create :varvals int-vars :uncited uncited)))
|
||||
(citeproc-proc-put-itd-put itemid itemdata proc)
|
||||
(citeproc-itd-setvar itemdata 'citation-number
|
||||
(number-to-string (hash-table-count
|
||||
@@ -150,7 +150,7 @@ Return the itemdata struct that was added."
|
||||
(citeproc-proc--put-item
|
||||
proc
|
||||
(or item `((unprocessed-with-id . ,id)))
|
||||
id))))))
|
||||
id t))))))
|
||||
|
||||
(defun citeproc-proc-delete-occurrence-info (proc)
|
||||
"Remove all itemdata occurrence info from PROC."
|
||||
@@ -225,6 +225,11 @@ Return the PROC-internal representation of REP."
|
||||
(when bib-sort (setf (citeproc-style-bib-sort style) (byte-compile bib-sort)))
|
||||
(when cite-sort (setf (citeproc-style-cite-sort style) (byte-compile cite-sort)))))
|
||||
|
||||
(defun citeproc-proc-filtered-bib-p (proc)
|
||||
"Return whether PROC has nontrivial filters"
|
||||
(let ((filters (citeproc-proc-bib-filters proc)))
|
||||
(and filters (not (equal filters '(nil))))))
|
||||
|
||||
(provide 'citeproc-proc)
|
||||
|
||||
;;; citeproc-proc.el ends here
|
||||
|
||||
@@ -169,17 +169,17 @@ MODE is either `cite' or `bib'."
|
||||
|
||||
(defun citeproc-proc-sort-itds (proc)
|
||||
"Sort the itemdata in PROC."
|
||||
(let ((sorted-bib-p (citeproc-style-bib-sort (citeproc-proc-style proc)))
|
||||
(filters (citeproc-proc-bib-filters proc)))
|
||||
(when (or sorted-bib-p filters)
|
||||
(let ((is-sorted-bib (citeproc-style-bib-sort (citeproc-proc-style proc)))
|
||||
(is-filtered (citeproc-proc-filtered-bib-p proc)))
|
||||
(when (or is-sorted-bib is-filtered)
|
||||
(let* ((itds (hash-table-values (citeproc-proc-itemdata proc)))
|
||||
(sorted (if sorted-bib-p
|
||||
(sorted (if is-sorted-bib
|
||||
(let ((sort-orders (citeproc-style-bib-sort-orders
|
||||
(citeproc-proc-style proc))))
|
||||
(citeproc-sort-itds itds sort-orders))
|
||||
(citeproc-sort-itds-on-citnum itds))))
|
||||
;; Additionally sort according to subbibliographies if there are filters.
|
||||
(when filters
|
||||
(when is-filtered
|
||||
(setq sorted (sort sorted #'citeproc-sort-itds-on-subbib)))
|
||||
;; Set the CSL citation-number field according to the sort order.
|
||||
(--each-indexed sorted
|
||||
|
||||
@@ -54,17 +54,32 @@ see the documentation of `citeproc-add-subbib-filters'."
|
||||
|
||||
(defun citeproc-sb-add-subbib-info (proc)
|
||||
"Add subbibliography information to the items in PROC."
|
||||
(let ((filters (citeproc-proc-bib-filters proc)))
|
||||
(maphash
|
||||
(lambda (_ itemdata)
|
||||
(let* ((varvals (citeproc-itemdata-varvals itemdata))
|
||||
(subbib-nos
|
||||
(-non-nil
|
||||
(--map-indexed
|
||||
(when (citeproc-sb--match-p varvals it) it-index)
|
||||
filters))))
|
||||
(setf (citeproc-itemdata-subbib-nos itemdata) subbib-nos)))
|
||||
(citeproc-proc-itemdata proc))))
|
||||
(when (citeproc-proc-filtered-bib-p proc)
|
||||
(let ((filters (citeproc-proc-bib-filters proc)))
|
||||
(maphash
|
||||
(lambda (_ itemdata)
|
||||
(let* ((varvals (citeproc-itemdata-varvals itemdata))
|
||||
(subbib-nos
|
||||
(-non-nil
|
||||
(--map-indexed
|
||||
(when (citeproc-sb--match-p varvals it) it-index)
|
||||
filters))))
|
||||
(setf (citeproc-itemdata-subbib-nos itemdata) subbib-nos)))
|
||||
(citeproc-proc-itemdata proc)))))
|
||||
|
||||
(defun citeproc-sb-prune-unrendered (proc)
|
||||
"Remove all itemdata about unrendered items from PROC.
|
||||
An item is unrendered if
|
||||
- there are subbibfilters but none of them matches it, and
|
||||
- it is not cited."
|
||||
(when (citeproc-proc-filtered-bib-p proc)
|
||||
(let ((itemdata (citeproc-proc-itemdata proc)))
|
||||
(maphash
|
||||
(lambda (id data)
|
||||
(when (and (citeproc-itemdata-uncited data)
|
||||
(null (citeproc-itemdata-subbib-nos data)))
|
||||
(remhash id itemdata)))
|
||||
itemdata))))
|
||||
|
||||
(provide 'citeproc-subbibs)
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
;;; citeproc.el --- A CSL 1.0.2 Citation Processor -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2017-2022 András Simonyi
|
||||
;; Copyright (C) 2017-2023 András Simonyi
|
||||
|
||||
;; Author: András Simonyi <andras.simonyi@gmail.com>
|
||||
;; Maintainer: András Simonyi <andras.simonyi@gmail.com>
|
||||
;; URL: https://github.com/andras-simonyi/citeproc-el
|
||||
;; Keywords: bib
|
||||
;; Package-Requires: ((emacs "26") (dash "2.13.0") (s "1.12.0") (f "0.18.0") (queue "0.2") (string-inflection "1.0") (org "9") (parsebib "2.4"))
|
||||
;; Version: 0.9
|
||||
;; Version: 0.9.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
|
||||
@@ -196,8 +196,8 @@ formatting parameters keyed to the parameter names as symbols:
|
||||
punct-in-quote)))
|
||||
itemdata)
|
||||
(let* ((raw-bib
|
||||
(if (cdr filters)
|
||||
;; There are several filters, we need to select and sort the subbibs.
|
||||
(if (citeproc-proc-filtered-bib-p proc)
|
||||
;; There are filters, we need to select and sort the subbibs.
|
||||
(let* ((nr-of-filters (length filters))
|
||||
(result (make-list nr-of-filters nil))
|
||||
;; We store boolean to-be-sorted flags for each sub-bib
|
||||
@@ -228,7 +228,7 @@ formatting parameters keyed to the parameter names as symbols:
|
||||
result))
|
||||
;; Generate the raw bibs.
|
||||
(--map (mapcar #'citeproc-itemdata-rawbibitem it) result))
|
||||
;; No filters, so raw-bib is a list containg a single raw bibliograhy.
|
||||
;; No filters, so raw-bib is a list containing a single raw bibliograhy.
|
||||
(list (mapcar #'citeproc-itemdata-rawbibitem
|
||||
(citeproc-sort-itds-on-citnum (hash-table-values itemdata))))))
|
||||
;; Perform author-substitution.
|
||||
|
||||
14
lisp/cl-libify/cl-libify-pkg.el
Normal file
14
lisp/cl-libify/cl-libify-pkg.el
Normal file
@@ -0,0 +1,14 @@
|
||||
(define-package "cl-libify" "20181130.230" "Update elisp code to use cl-lib instead of cl"
|
||||
'((emacs "25"))
|
||||
:commit "e205b96f944a4f312fd523804cbbaf00027a3c8b" :authors
|
||||
'(("Steve Purcell" . "steve@sanityinc.com"))
|
||||
:maintainers
|
||||
'(("Steve Purcell" . "steve@sanityinc.com"))
|
||||
:maintainer
|
||||
'("Steve Purcell" . "steve@sanityinc.com")
|
||||
:keywords
|
||||
'("lisp")
|
||||
:url "https://github.com/purcell/cl-libify")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
@@ -4,11 +4,9 @@
|
||||
|
||||
;; Author: Steve Purcell <steve@sanityinc.com>
|
||||
;; Keywords: lisp
|
||||
;; Package-Commit: e205b96f944a4f312fd523804cbbaf00027a3c8b
|
||||
;; Homepage: https://github.com/purcell/cl-libify
|
||||
;; Package-Requires: ((emacs "25"))
|
||||
;; Package-Version: 20181130.230
|
||||
;; Package-X-Original-Version: 0
|
||||
;; Package-Version: 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
|
||||
14
lisp/code-cells/code-cells-pkg.el
Normal file
14
lisp/code-cells/code-cells-pkg.el
Normal file
@@ -0,0 +1,14 @@
|
||||
(define-package "code-cells" "20231119.2138" "Lightweight notebooks with support for ipynb files"
|
||||
'((emacs "27.1"))
|
||||
:commit "44546ca256f3da29e3ac884e3d699c8455acbd6e" :authors
|
||||
'(("Augusto Stoffel" . "arstoffel@gmail.com"))
|
||||
:maintainers
|
||||
'(("Augusto Stoffel" . "arstoffel@gmail.com"))
|
||||
:maintainer
|
||||
'("Augusto Stoffel" . "arstoffel@gmail.com")
|
||||
:keywords
|
||||
'("convenience" "outlines")
|
||||
:url "https://github.com/astoff/code-cells.el")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
442
lisp/code-cells/code-cells.el
Normal file
442
lisp/code-cells/code-cells.el
Normal file
@@ -0,0 +1,442 @@
|
||||
;;; code-cells.el --- Lightweight notebooks with support for ipynb files -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2022, 2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Augusto Stoffel <arstoffel@gmail.com>
|
||||
;; Keywords: convenience, outlines
|
||||
;; URL: https://github.com/astoff/code-cells.el
|
||||
;; Package-Requires: ((emacs "27.1"))
|
||||
;; Version: 0.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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; With this package, you can efficiently navigate, edit and execute
|
||||
;; code split into cells according to certain magic comments. It also
|
||||
;; allows you to open ipynb notebook files directly in Emacs. They
|
||||
;; will be automatically converted to a script for editing, and
|
||||
;; converted back to notebook format when saving. An external tool,
|
||||
;; Jupytext by default, is required for this.
|
||||
;;
|
||||
;; A minor mode, `code-cells-mode', provides the following features:
|
||||
;;
|
||||
;; - Fontification of cell boundaries.
|
||||
;;
|
||||
;; - Keybindings for the cell navigation and evaluation commands,
|
||||
;; under the `C-c %' prefix.
|
||||
;;
|
||||
;; - Outline mode integration: cell headers have outline level
|
||||
;; determined by the number of percent signs or asterisks; within a
|
||||
;; cell, outline headings are as determined by the major mode, but
|
||||
;; they are demoted by an amount corresponding to the level of the
|
||||
;; containing cell. This provides code folding and hierarchical
|
||||
;; navigation, among other things, when `outline-minor-mode' is
|
||||
;; active.
|
||||
;;
|
||||
;; This minor mode is automatically activated when opening an ipynb
|
||||
;; file, but you can also activate it in any other buffer, either
|
||||
;; manually or through a hook.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'outline)
|
||||
(require 'pulse)
|
||||
(eval-when-compile
|
||||
(require 'cl-lib)
|
||||
(require 'let-alist)
|
||||
(require 'rx))
|
||||
|
||||
(defgroup code-cells nil
|
||||
"Utilities for code split into cells."
|
||||
:group 'convenience
|
||||
:prefix "code-cells-")
|
||||
|
||||
;;; Cell navigation
|
||||
|
||||
(defcustom code-cells-boundary-regexp
|
||||
(rx line-start
|
||||
(+ (syntax comment-start))
|
||||
(or (seq (* (syntax whitespace)) "%" (group-n 1 (+ "%")))
|
||||
(group-n 1 (+ "*"))
|
||||
(seq " In[" (* (any space digit)) "]:")))
|
||||
"Regular expression specifying cell boundaries.
|
||||
It should match at the beginning of a line. The length of the
|
||||
first capture determines the outline level."
|
||||
:type 'regexp
|
||||
:safe #'stringp)
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-forward-cell (&optional arg)
|
||||
"Move to the next cell boundary, or end of buffer.
|
||||
With ARG, repeat this that many times. If ARG is negative, move
|
||||
backward."
|
||||
(interactive "p")
|
||||
(let ((page-delimiter code-cells-boundary-regexp))
|
||||
(when (and (< 0 arg) (looking-at page-delimiter))
|
||||
(forward-char))
|
||||
(forward-page arg)
|
||||
(unless (eobp)
|
||||
(move-beginning-of-line 1))))
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-backward-cell (&optional arg)
|
||||
"Move to the previous cell boundary, or beginning of buffer.
|
||||
With ARG, repeat this that many times. If ARG is negative, move
|
||||
forward."
|
||||
(interactive "p")
|
||||
(code-cells-forward-cell (- (or arg 1))))
|
||||
|
||||
(defun code-cells--bounds (&optional count use-region no-header)
|
||||
"Return the bounds of the current code cell, as a cons.
|
||||
|
||||
If COUNT is non-nil, return instead a region containing COUNT
|
||||
cells and starting or ending with the current cell, depending on
|
||||
the sign of COUNT.
|
||||
|
||||
If USE-REGION is non-nil and the region is active, return the
|
||||
region bounds instead.
|
||||
|
||||
If NO-HEADER is non-nil, do not include the cell boundary line."
|
||||
(if (and use-region (use-region-p))
|
||||
(list (region-beginning) (region-end))
|
||||
(setq count (or count 1))
|
||||
(save-excursion
|
||||
(let ((end (progn (code-cells-forward-cell (max count 1))
|
||||
(point))))
|
||||
(code-cells-backward-cell (abs count))
|
||||
(when no-header (forward-line))
|
||||
(list (point) end)))))
|
||||
|
||||
(defun code-cells--bounds-of-cell-relative-from (distance)
|
||||
"Return the bounds of the cell DISTANCE cells away from the current one."
|
||||
(save-excursion
|
||||
(when (/= 0 distance)
|
||||
;; Except when at the boundary, `(code-cells-forward-cell -1)' doesn't
|
||||
;; move out of current cell
|
||||
(unless (looking-at-p code-cells-boundary-regexp)
|
||||
(code-cells-backward-cell))
|
||||
(code-cells-forward-cell distance))
|
||||
(code-cells--bounds)))
|
||||
|
||||
(defun code-cells-move-cell-down (arg)
|
||||
"Move current code cell vertically ARG cells.
|
||||
Move up when ARG is negative and move down otherwise."
|
||||
(interactive "p")
|
||||
(pcase-let ((`(,current-beg ,current-end) (code-cells--bounds))
|
||||
(`(,next-beg ,next-end) (code-cells--bounds-of-cell-relative-from arg)))
|
||||
(unless (save-excursion
|
||||
(and (/= current-beg next-beg)
|
||||
(goto-char current-beg)
|
||||
(looking-at-p code-cells-boundary-regexp)
|
||||
(goto-char next-beg)
|
||||
(looking-at-p code-cells-boundary-regexp)))
|
||||
(user-error "Can't move cell"))
|
||||
(transpose-regions current-beg current-end next-beg next-end)))
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-move-cell-up (&optional arg)
|
||||
"Move current code cell vertically up ARG cells."
|
||||
(interactive "p")
|
||||
(code-cells-move-cell-down (- arg)))
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-mark-cell (&optional arg)
|
||||
"Put point at the beginning of this cell, mark at end.
|
||||
If ARG is non-nil, mark that many cells."
|
||||
(interactive "p")
|
||||
(pcase-let ((`(,start ,end) (code-cells--bounds arg)))
|
||||
(goto-char start)
|
||||
(push-mark end nil t)))
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-comment-or-uncomment (&optional arg)
|
||||
"Comment or uncomment the current code cell.
|
||||
|
||||
ARG, if provided, is the number of comment characters to add or
|
||||
remove."
|
||||
(interactive "P")
|
||||
(pcase-let* ((`(,header ,end) (code-cells--bounds arg))
|
||||
(start (save-excursion
|
||||
(goto-char header)
|
||||
(forward-line)
|
||||
(point))))
|
||||
(comment-or-uncomment-region start end)))
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-command (fun &rest options)
|
||||
"Return an anonymous command calling FUN on the current cell.
|
||||
|
||||
FUN is a function that takes two character positions as argument.
|
||||
Most interactive commands that act on a region are of this form
|
||||
and can be used here.
|
||||
|
||||
If OPTIONS contains the keyword :use-region, the command will act
|
||||
on the region instead of the current cell when appropriate.
|
||||
|
||||
If OPTIONS contains the keyword :pulse, provide visual feedback
|
||||
via `pulse-momentary-highlight-region'."
|
||||
(let ((use-region (car (memq :use-region options)))
|
||||
(pulse (car (memq :pulse options))))
|
||||
(lambda ()
|
||||
(interactive)
|
||||
(pcase-let ((`(,start ,end) (code-cells--bounds nil use-region)))
|
||||
(when pulse (pulse-momentary-highlight-region start end))
|
||||
(funcall fun start end)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-speed-key (command)
|
||||
"Return a speed key definition, suitable for passing to `define-key'.
|
||||
The resulting keybinding will only have any effect when the point
|
||||
is at the beginning of a cell heading, in which case it executes
|
||||
COMMAND."
|
||||
(list 'menu-item nil command
|
||||
:filter (lambda (d)
|
||||
(when (and (bolp)
|
||||
(looking-at code-cells-boundary-regexp))
|
||||
d))))
|
||||
|
||||
;;; Code evaluation
|
||||
|
||||
(defcustom code-cells-eval-region-commands
|
||||
`((drepl--current . drepl-eval-region)
|
||||
(jupyter-repl-interaction-mode . ,(apply-partially 'jupyter-eval-region nil))
|
||||
(python-mode . python-shell-send-region)
|
||||
(emacs-lisp-mode . eval-region)
|
||||
(lisp-interaction-mode . eval-region))
|
||||
"Alist of commands to evaluate a region.
|
||||
The keys are major or minor modes and the values are functions
|
||||
taking region bounds as argument."
|
||||
:type '(alist :key-type symbol :value-type symbol))
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-eval (start end)
|
||||
"Evaluate code according to current modes.
|
||||
The first suitable function from `code-cells-eval-region-commands'
|
||||
is used to do the job.
|
||||
|
||||
Interactively, evaluate the region, if active, otherwise the
|
||||
current code cell. With a numeric prefix, evaluate that many
|
||||
code cells.
|
||||
|
||||
Called from Lisp, evaluate region between START and END."
|
||||
(interactive (code-cells--bounds (prefix-numeric-value current-prefix-arg)
|
||||
'use-region
|
||||
'no-header))
|
||||
(funcall
|
||||
(or (seq-some (pcase-lambda (`(,mode . ,fun))
|
||||
(when (or (and (boundp mode) (symbol-value mode))
|
||||
(derived-mode-p mode))
|
||||
fun))
|
||||
code-cells-eval-region-commands)
|
||||
(user-error
|
||||
"No entry for the current modes in `code-cells-eval-region-commands'"))
|
||||
start end)
|
||||
(pulse-momentary-highlight-region start end))
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-eval-above (arg)
|
||||
"Evaluate this and all above cells.
|
||||
ARG (interactively, the prefix argument) specifies how many
|
||||
additional cells after point to include."
|
||||
(interactive "p")
|
||||
(code-cells-eval (point-min) (save-excursion
|
||||
(code-cells-forward-cell arg)
|
||||
(point))))
|
||||
|
||||
;;; Minor mode
|
||||
|
||||
(defvar-local code-cells--saved-vars nil
|
||||
"A place to save variables before activating `code-cells-mode'.")
|
||||
|
||||
(defun code-cells--outline-level ()
|
||||
"Compute the outline level, taking code cells into account.
|
||||
To be used as the value of the variable `outline-level'.
|
||||
|
||||
At a cell boundary, returns the cell outline level, as determined by
|
||||
`code-cells-boundary-regexp'. Otherwise, returns the sum of the
|
||||
outline level as determined by the major mode and the current cell
|
||||
level."
|
||||
(let* ((at-boundary (looking-at-p code-cells-boundary-regexp))
|
||||
(mm-level (if at-boundary
|
||||
0
|
||||
(funcall (car code-cells--saved-vars))))
|
||||
(cell-level (if (or at-boundary
|
||||
(save-excursion
|
||||
(re-search-backward
|
||||
code-cells-boundary-regexp nil t)))
|
||||
(if (match-string 1)
|
||||
(- (match-end 1) (match-beginning 1))
|
||||
1)
|
||||
0)))
|
||||
(+ cell-level mm-level)))
|
||||
|
||||
(defface code-cells-header-line '((t :extend t :overline t :inherit font-lock-comment-face))
|
||||
"Face used by `code-cells-mode' to highlight cell boundaries.")
|
||||
|
||||
(defun code-cells--font-lock-keywords ()
|
||||
"Font lock keywords to highlight cell boundaries."
|
||||
`((,(rx (regexp code-cells-boundary-regexp) (* any) "\n")
|
||||
0 'code-cells-header-line append)))
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode code-cells-mode
|
||||
"Minor mode for cell-oriented code."
|
||||
:keymap (make-sparse-keymap)
|
||||
(if code-cells-mode
|
||||
(progn
|
||||
(setq-local
|
||||
code-cells--saved-vars (list outline-level
|
||||
outline-regexp
|
||||
outline-heading-end-regexp
|
||||
paragraph-start)
|
||||
outline-level 'code-cells--outline-level
|
||||
outline-regexp (rx (or (regexp code-cells-boundary-regexp)
|
||||
(regexp outline-regexp)))
|
||||
outline-heading-end-regexp "\n"
|
||||
paragraph-separate (rx (or (regexp paragraph-separate)
|
||||
(regexp code-cells-boundary-regexp))))
|
||||
(font-lock-add-keywords nil (code-cells--font-lock-keywords)))
|
||||
(setq-local outline-level (pop code-cells--saved-vars)
|
||||
outline-regexp (pop code-cells--saved-vars)
|
||||
outline-heading-end-regexp (pop code-cells--saved-vars)
|
||||
paragraph-separate (pop code-cells--saved-vars))
|
||||
(font-lock-remove-keywords nil (code-cells--font-lock-keywords)))
|
||||
(font-lock-flush))
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-mode-maybe ()
|
||||
"Turn on `code-cells-mode' if the buffer appears to contain cells.
|
||||
This function is useful when added to a major mode hook."
|
||||
(when (save-excursion
|
||||
(goto-char (point-min))
|
||||
(re-search-forward code-cells-boundary-regexp 5000 t))
|
||||
(code-cells-mode)))
|
||||
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key code-cells-mode-map "\C-c%" map)
|
||||
(define-key map ";" 'code-cells-comment-or-uncomment)
|
||||
(define-key map "@" 'code-cells-mark-cell)
|
||||
(define-key map "b" 'code-cells-backward-cell)
|
||||
(define-key map "f" 'code-cells-forward-cell)
|
||||
(define-key map "B" 'code-cells-move-cell-up)
|
||||
(define-key map "F" 'code-cells-move-cell-down)
|
||||
(define-key map "e" 'code-cells-eval))
|
||||
|
||||
;;; Jupyter notebook conversion
|
||||
|
||||
(defcustom code-cells-convert-ipynb-style
|
||||
'(("jupytext" "--to" "ipynb")
|
||||
("jupytext" "--to" "auto:percent")
|
||||
code-cells--guess-mode
|
||||
code-cells-convert-ipynb-hook)
|
||||
"Determines how to convert ipynb files for editing.
|
||||
The first two entries are lists of strings: the command name and
|
||||
arguments used, respectively, to convert to and from ipynb
|
||||
format.
|
||||
|
||||
The third entry is a function called with no arguments to
|
||||
determine the major mode to be called. The default setting tries
|
||||
to guess it from the notebook metadata.
|
||||
|
||||
The fourth entry, also optional, is a hook run after the new
|
||||
major mode is activated."
|
||||
:type '(list (repeat string) (repeat string) function symbol))
|
||||
|
||||
(defvar code-cells-convert-ipynb-hook '(code-cells-mode)
|
||||
"Hook used in the default `code-cells-convert-ipynb-style'.")
|
||||
|
||||
(defun code-cells--call-process (buffer command)
|
||||
"Pipe BUFFER through COMMAND, with output to the current buffer.
|
||||
Returns the process exit code. COMMAND is a list of strings, the
|
||||
program name followed by arguments."
|
||||
(unless (executable-find (car command))
|
||||
(error "Can't find %s" (car command)))
|
||||
(let ((logfile (make-temp-file "emacs-code-cells-")))
|
||||
(unwind-protect
|
||||
(prog1
|
||||
(apply #'call-process-region nil nil (car command) nil
|
||||
(list buffer logfile) nil
|
||||
(cdr command))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents logfile)
|
||||
(unless (zerop (buffer-size))
|
||||
(lwarn 'code-cells :warning
|
||||
"Notebook conversion command %s said:\n%s"
|
||||
command
|
||||
(buffer-substring-no-properties
|
||||
(point-min) (point-max))))))
|
||||
(delete-file logfile))))
|
||||
|
||||
(defun code-cells--guess-mode ()
|
||||
"Guess major mode associated to the current ipynb buffer."
|
||||
(require 'json)
|
||||
(declare-function json-read "json.el")
|
||||
(goto-char (point-min))
|
||||
(let* ((nb (cl-letf ;; Skip over the possibly huge "cells" section
|
||||
(((symbol-function 'json-read-array) 'forward-sexp))
|
||||
(json-read)))
|
||||
(lang (let-alist nb
|
||||
(or .metadata.kernelspec.language
|
||||
.metadata.jupytext.main_language)))
|
||||
(mode (intern (concat lang "-mode"))))
|
||||
(alist-get mode (bound-and-true-p major-mode-remap-alist) mode)))
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-convert-ipynb ()
|
||||
"Convert buffer from ipynb format to a regular script."
|
||||
(interactive)
|
||||
(let* ((mode (funcall (or (nth 2 code-cells-convert-ipynb-style)
|
||||
(progn ;For backwards compatibility with v0.3
|
||||
(lwarn 'code-cells :warning "\
|
||||
The third entry of `code-cells-convert-ipynb-style' should not be nil.")
|
||||
#'code-cells--guess-mode))))
|
||||
(exit (progn
|
||||
(goto-char (point-min))
|
||||
(code-cells--call-process t (nth 1 code-cells-convert-ipynb-style)))))
|
||||
(unless (zerop exit)
|
||||
(delete-region (point-min) (point))
|
||||
(error "Error converting notebook (exit code %s)" exit))
|
||||
(delete-region (point) (point-max))
|
||||
(goto-char (point-min))
|
||||
(set-buffer-modified-p nil)
|
||||
(add-hook 'write-file-functions #'code-cells-write-ipynb 80 t)
|
||||
(when (fboundp mode)
|
||||
(funcall mode)
|
||||
(run-hooks (nth 3 code-cells-convert-ipynb-style)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun code-cells-write-ipynb (&optional file)
|
||||
"Convert buffer to ipynb format and write to FILE.
|
||||
Interactively, asks for the file name. When called from Lisp,
|
||||
FILE defaults to the current buffer file name."
|
||||
(interactive "F")
|
||||
(let* ((file (or file buffer-file-name))
|
||||
(temp (generate-new-buffer " *cells--call-process output*"))
|
||||
(exit (code-cells--call-process temp (nth 0 code-cells-convert-ipynb-style))))
|
||||
(unless (eq 0 exit)
|
||||
(error "Error converting notebook (exit code %s)" exit))
|
||||
(with-current-buffer temp
|
||||
(write-region nil nil file)
|
||||
(kill-buffer))
|
||||
(when (eq file buffer-file-name)
|
||||
(set-buffer-modified-p nil)
|
||||
(set-visited-file-modtime))
|
||||
'job-done))
|
||||
|
||||
;;;###autoload
|
||||
(add-to-list 'auto-mode-alist '("\\.ipynb\\'" . code-cells-convert-ipynb))
|
||||
|
||||
(provide 'code-cells)
|
||||
;;; code-cells.el ends here
|
||||
19
lisp/company-anaconda/company-anaconda-pkg.el
Normal file
19
lisp/company-anaconda/company-anaconda-pkg.el
Normal file
@@ -0,0 +1,19 @@
|
||||
(define-package "company-anaconda" "20230821.2126" "Anaconda backend for company-mode"
|
||||
'((emacs "25.1")
|
||||
(company "0.8.0")
|
||||
(anaconda-mode "0.1.1")
|
||||
(cl-lib "0.5.0")
|
||||
(dash "2.6.0")
|
||||
(s "1.9"))
|
||||
:commit "14867265e474f7a919120bbac74870c3256cbacf" :authors
|
||||
'(("Artem Malyshev" . "proofit404@gmail.com"))
|
||||
:maintainers
|
||||
'(("Artem Malyshev" . "proofit404@gmail.com"))
|
||||
:maintainer
|
||||
'("Artem Malyshev" . "proofit404@gmail.com")
|
||||
:keywords
|
||||
'("convenience" "company" "anaconda")
|
||||
:url "https://github.com/proofit404/anaconda-mode")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
@@ -4,10 +4,9 @@
|
||||
|
||||
;; Author: Artem Malyshev <proofit404@gmail.com>
|
||||
;; URL: https://github.com/proofit404/anaconda-mode
|
||||
;; Package-Version: 20200404.1859
|
||||
;; Package-Commit: da1566db41a68809ef7f91ebf2de28118067c89b
|
||||
;; Version: 0.2.0
|
||||
;; Package-Requires: ((company "0.8.0") (anaconda-mode "0.1.1") (cl-lib "0.5.0") (dash "2.6.0") (s "1.9"))
|
||||
;; Package-Requires: ((emacs "25.1") (company "0.8.0") (anaconda-mode "0.1.1") (cl-lib "0.5.0") (dash "2.6.0") (s "1.9"))
|
||||
;; Keywords: convenience company anaconda
|
||||
|
||||
;; 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
|
||||
15
lisp/company-ledger/company-ledger-pkg.el
Normal file
15
lisp/company-ledger/company-ledger-pkg.el
Normal file
@@ -0,0 +1,15 @@
|
||||
(define-package "company-ledger" "20210910.250" "Fuzzy auto-completion for Ledger & friends"
|
||||
'((emacs "24.3")
|
||||
(company "0.8.0"))
|
||||
:commit "55fdddd6c5e9c061c685b474ef5e148a4ac9b576" :authors
|
||||
'(("Debanjum Singh Solanky" . "debanjumATgmailDOTcom"))
|
||||
:maintainers
|
||||
'(("Debanjum Singh Solanky" . "debanjumATgmailDOTcom"))
|
||||
:maintainer
|
||||
'("Debanjum Singh Solanky" . "debanjumATgmailDOTcom")
|
||||
:keywords
|
||||
'("abbrev" "matching" "auto-complete" "beancount" "ledger" "company")
|
||||
:url "https://github.com/debanjum/company-ledger")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
@@ -5,8 +5,6 @@
|
||||
;; Author: Debanjum Singh Solanky <debanjum AT gmail DOT com>
|
||||
;; Description: Fuzzy auto-completion for ledger & friends
|
||||
;; Keywords: abbrev, matching, auto-complete, beancount, ledger, company
|
||||
;; Package-Version: 20210910.250
|
||||
;; Package-Commit: 55fdddd6c5e9c061c685b474ef5e148a4ac9b576
|
||||
;; Version: 0.1.0
|
||||
;; Package-Requires: ((emacs "24.3") (company "0.8.0"))
|
||||
;; URL: https://github.com/debanjum/company-ledger
|
||||
16
lisp/company-quickhelp/company-quickhelp-pkg.el
Normal file
16
lisp/company-quickhelp/company-quickhelp-pkg.el
Normal file
@@ -0,0 +1,16 @@
|
||||
(define-package "company-quickhelp" "20231026.1714" "Popup documentation for completion candidates"
|
||||
'((emacs "24.3")
|
||||
(company "0.8.9")
|
||||
(pos-tip "0.4.6"))
|
||||
:commit "5bda859577582cc42d16fc0eaf5f7c8bedfd9e69" :authors
|
||||
'(("Lars Andersen" . "expez@expez.com"))
|
||||
:maintainers
|
||||
'(("Lars Andersen" . "expez@expez.com"))
|
||||
:maintainer
|
||||
'("Lars Andersen" . "expez@expez.com")
|
||||
:keywords
|
||||
'("company" "popup" "documentation" "quickhelp")
|
||||
:url "https://www.github.com/expez/company-quickhelp")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
;; Author: Lars Andersen <expez@expez.com>
|
||||
;; URL: https://www.github.com/expez/company-quickhelp
|
||||
;; Package-Version: 20221212.534
|
||||
;; Package-Commit: 9505fb09d064581da142d75c139d48b5cf695bd5
|
||||
;; Keywords: company popup documentation quickhelp
|
||||
;; Version: 2.2.0
|
||||
;; Package-Requires: ((emacs "24.3") (company "0.8.9") (pos-tip "0.4.6"))
|
||||
@@ -55,7 +53,7 @@
|
||||
"Delay, in seconds, before the quickhelp popup appears.
|
||||
|
||||
If set to nil the popup won't automatically appear, but can still
|
||||
be triggered manually using `company-quickhelp-show'."
|
||||
be triggered manually using `company-quickhelp-manual-begin'."
|
||||
:type '(choice (number :tag "Delay in seconds")
|
||||
(const :tag "Don't popup help automatically" nil))
|
||||
:group 'company-quickhelp)
|
||||
@@ -235,7 +233,6 @@ currently active `company' completion candidate."
|
||||
(defun company-quickhelp-hide ()
|
||||
(company-cancel))
|
||||
|
||||
|
||||
(defun company-quickhelp-pos-tip-available-p ()
|
||||
"Return t if and only if pos-tip is expected work in the current frame."
|
||||
(and
|
||||
15
lisp/company-statistics/company-statistics-pkg.el
Normal file
15
lisp/company-statistics/company-statistics-pkg.el
Normal file
@@ -0,0 +1,15 @@
|
||||
(define-package "company-statistics" "20170210.1933" "Sort candidates using completion history"
|
||||
'((emacs "24.3")
|
||||
(company "0.8.5"))
|
||||
:commit "e62157d43b2c874d2edbd547c3bdfb05d0a7ae5c" :authors
|
||||
'(("Ingo Lohmar" . "i.lohmar@gmail.com"))
|
||||
:maintainers
|
||||
'(("Ingo Lohmar" . "i.lohmar@gmail.com"))
|
||||
:maintainer
|
||||
'("Ingo Lohmar" . "i.lohmar@gmail.com")
|
||||
:keywords
|
||||
'("abbrev" "convenience" "matching")
|
||||
:url "https://github.com/company-mode/company-statistics")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
375
lisp/company-statistics/company-statistics.el
Normal file
375
lisp/company-statistics/company-statistics.el
Normal file
@@ -0,0 +1,375 @@
|
||||
;;; company-statistics.el --- Sort candidates using completion history -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2014-2017 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Ingo Lohmar <i.lohmar@gmail.com>
|
||||
;; URL: https://github.com/company-mode/company-statistics
|
||||
;; Version: 0.2.3
|
||||
;; Keywords: abbrev, convenience, matching
|
||||
;; Package-Requires: ((emacs "24.3") (company "0.8.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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Package installed from elpa.gnu.org:
|
||||
;;
|
||||
;; (add-hook 'after-init-hook #'company-statistics-mode)
|
||||
;;
|
||||
;; Manually installed: make sure that this file is in load-path, and
|
||||
;;
|
||||
;; (require 'company-statistics)
|
||||
;; (company-statistics-mode)
|
||||
;;
|
||||
;; Every time a candidate is chosen using company-mode, we keep track of this
|
||||
;; (for a limited amount of recent choices). When presenting completion
|
||||
;; candidates next time, they are sorted according to the score thus acquired.
|
||||
;;
|
||||
;; The same candidate might occur in different modes, projects, files etc., and
|
||||
;; possibly has a different meaning each time. Therefore along with the
|
||||
;; completion, we store some context information. In the default (heavy)
|
||||
;; configuration, we track the overall frequency, the major-mode of the buffer,
|
||||
;; the last preceding keyword, the parent symbol, and the filename (if it
|
||||
;; applies), and the same criteria are used to score all possible candidates.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
|
||||
(defgroup company-statistics nil
|
||||
"Completion candidates ranking by historical statistics."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-statistics-size 400
|
||||
"Number of completion choices that `company-statistics' keeps track of.
|
||||
As this is a global cache, making it too small defeats the purpose."
|
||||
:type 'integer
|
||||
:initialize #'custom-initialize-default
|
||||
:set #'company-statistics--log-resize)
|
||||
|
||||
(defcustom company-statistics-file
|
||||
(concat user-emacs-directory "company-statistics-cache.el")
|
||||
"File to save company-statistics state."
|
||||
:type 'string)
|
||||
|
||||
(defcustom company-statistics-auto-save t
|
||||
"Whether to save the statistics when leaving emacs."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom company-statistics-auto-restore t
|
||||
"Whether to restore statistics when company-statistics is enabled and has
|
||||
not been used before."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom company-statistics-capture-context #'company-statistics-capture-context-heavy
|
||||
"Function called with single argument (t if completion started manually).
|
||||
This is the place to store any context information for a completion run."
|
||||
:type 'function)
|
||||
|
||||
(defcustom company-statistics-score-change #'company-statistics-score-change-heavy
|
||||
"Function called with completion choice. Using arbitrary other info,
|
||||
it should produce an alist, each entry labeling a context and the
|
||||
associated score update: ((ctx-a . 1) (\"str\" . 0.5) (nil . 1)). Nil is
|
||||
the global context."
|
||||
:type 'function)
|
||||
|
||||
(defcustom company-statistics-score-calc #'company-statistics-score-calc-heavy
|
||||
"Function called with completion candidate. Using arbitrary other info,
|
||||
eg, on the current context, it should evaluate to the candidate's score (a
|
||||
number)."
|
||||
:type 'function)
|
||||
|
||||
;; internal vars, persistence
|
||||
|
||||
(defvar company-statistics--scores nil
|
||||
"Store selection frequency of candidates in given contexts.")
|
||||
|
||||
(defvar company-statistics--log nil
|
||||
"Ring keeping a log of statistics updates.")
|
||||
|
||||
(defvar company-statistics--index nil
|
||||
"Index into the log.")
|
||||
|
||||
(defun company-statistics--init ()
|
||||
"Initialize company-statistics."
|
||||
(setq company-statistics--scores
|
||||
(make-hash-table :test #'equal :size company-statistics-size))
|
||||
(setq company-statistics--log (make-vector company-statistics-size nil)
|
||||
company-statistics--index 0))
|
||||
|
||||
(defun company-statistics--initialized-p ()
|
||||
(hash-table-p company-statistics--scores))
|
||||
|
||||
(defun company-statistics--log-resize (_option new-size)
|
||||
(when (company-statistics--initialized-p)
|
||||
;; hash scoresheet auto-resizes, but log does not
|
||||
(let ((new-hist (make-vector new-size nil))
|
||||
;; use actual length, to also work for freshly restored stats
|
||||
(company-statistics-size (length company-statistics--log)))
|
||||
;; copy newest entries (possibly nil) to new-hist
|
||||
(dolist (i (number-sequence 0 (1- (min new-size company-statistics-size))))
|
||||
(let ((old-i (mod (+ (- company-statistics--index new-size) i)
|
||||
company-statistics-size)))
|
||||
(aset new-hist i (aref company-statistics--log old-i))))
|
||||
;; remove discarded log entry (when shrinking) from scores
|
||||
(when (< new-size company-statistics-size)
|
||||
(dolist (i (number-sequence
|
||||
company-statistics--index
|
||||
(+ company-statistics-size
|
||||
company-statistics--index
|
||||
(1- new-size))))
|
||||
(company-statistics--log-revert (mod i company-statistics-size))))
|
||||
(setq company-statistics--log new-hist)
|
||||
(setq company-statistics--index (if (<= new-size company-statistics-size)
|
||||
0
|
||||
company-statistics-size))))
|
||||
(setq company-statistics-size new-size))
|
||||
|
||||
(defun company-statistics--save ()
|
||||
"Save statistics."
|
||||
(with-temp-buffer
|
||||
(set-buffer-multibyte nil)
|
||||
(let (print-level print-length)
|
||||
(encode-coding-string
|
||||
(format
|
||||
"%S"
|
||||
`(setq
|
||||
company-statistics--scores ,company-statistics--scores
|
||||
company-statistics--log ,company-statistics--log
|
||||
company-statistics--index ,company-statistics--index))
|
||||
'utf-8 nil (current-buffer))
|
||||
(let ((coding-system-for-write 'binary))
|
||||
(write-region nil nil company-statistics-file)))))
|
||||
|
||||
(defun company-statistics--maybe-save ()
|
||||
(when (and (company-statistics--initialized-p)
|
||||
company-statistics-auto-save)
|
||||
(company-statistics--save)))
|
||||
|
||||
(defun company-statistics--load ()
|
||||
"Restore statistics."
|
||||
(load company-statistics-file 'noerror nil 'nosuffix))
|
||||
|
||||
;; score calculation for insert/retrieval --- can be changed on-the-fly
|
||||
|
||||
(defun company-statistics-score-change-light (_cand)
|
||||
"Count for global score and mode context."
|
||||
(list (cons nil 1)
|
||||
(cons major-mode 1))) ;major-mode is never nil
|
||||
|
||||
(defun company-statistics-score-calc-light (cand)
|
||||
"Global score, and bonus for matching major mode."
|
||||
(let ((scores (gethash cand company-statistics--scores)))
|
||||
(if scores
|
||||
;; cand may be in scores and still have no global score left
|
||||
(+ (or (cdr (assoc nil scores)) 0)
|
||||
(or (cdr (assoc major-mode scores)) 0))
|
||||
0)))
|
||||
|
||||
(defvar company-statistics--context nil
|
||||
"Current completion context, a list of entries searched using `assoc'.")
|
||||
|
||||
(defun company-statistics--last-keyword ()
|
||||
"Return last keyword, ie, text of region fontified with the
|
||||
font-lock-keyword-face up to point, or nil."
|
||||
(let ((face-pos (point)))
|
||||
(while (and (number-or-marker-p face-pos)
|
||||
(< (point-min) face-pos)
|
||||
(not (eq (get-text-property (1- face-pos) 'face)
|
||||
'font-lock-keyword-face)))
|
||||
(setq face-pos
|
||||
(previous-single-property-change face-pos 'face nil (point-min))))
|
||||
(when (and (number-or-marker-p face-pos)
|
||||
(eq (get-text-property (max (point-min) (1- face-pos)) 'face)
|
||||
'font-lock-keyword-face))
|
||||
(list :keyword
|
||||
(buffer-substring-no-properties
|
||||
(previous-single-property-change face-pos 'face nil (point-min))
|
||||
face-pos)))))
|
||||
|
||||
(defun company-statistics--parent-symbol ()
|
||||
"Return symbol immediately preceding current completion prefix, or nil.
|
||||
May be separated by punctuation, but not by whitespace."
|
||||
;; expects to be at start of company-prefix; little sense for lisps
|
||||
(let ((preceding (save-excursion
|
||||
(unless (zerop (skip-syntax-backward "."))
|
||||
(substring-no-properties (symbol-name (symbol-at-point)))))))
|
||||
(when preceding
|
||||
(list :symbol preceding))))
|
||||
|
||||
(defun company-statistics--file-name ()
|
||||
"Return buffer file name, or nil."
|
||||
(when buffer-file-name
|
||||
(list :file buffer-file-name)))
|
||||
|
||||
(defun company-statistics-capture-context-heavy (_manual)
|
||||
"Calculate some context, once for the whole completion run."
|
||||
(save-excursion
|
||||
(backward-char (length company-prefix))
|
||||
(setq company-statistics--context
|
||||
(delq nil
|
||||
(list (company-statistics--last-keyword)
|
||||
(company-statistics--parent-symbol)
|
||||
(company-statistics--file-name))))))
|
||||
|
||||
(defun company-statistics-score-change-heavy (_cand)
|
||||
"Count for global score, mode context, last keyword, parent symbol,
|
||||
buffer file name."
|
||||
(let ((last-kwd (assoc :keyword company-statistics--context))
|
||||
(parent-symbol (assoc :symbol company-statistics--context))
|
||||
(file (assoc :file company-statistics--context)))
|
||||
(nconc ;when's nil is removed
|
||||
(list (cons nil 1)
|
||||
(cons major-mode 1)) ;major-mode is never nil
|
||||
;; only add pieces of context if non-nil
|
||||
(when last-kwd (list (cons last-kwd 1)))
|
||||
(when parent-symbol (list (cons parent-symbol 1)))
|
||||
(when file (list (cons file 1))))))
|
||||
|
||||
(defun company-statistics-score-calc-heavy (cand)
|
||||
"Global score, and bonus for matching major mode, last keyword, parent
|
||||
symbol, buffer file name."
|
||||
(let ((scores (gethash cand company-statistics--scores))
|
||||
(last-kwd (assoc :keyword company-statistics--context))
|
||||
(parent-symbol (assoc :symbol company-statistics--context))
|
||||
(file (assoc :file company-statistics--context)))
|
||||
(if scores
|
||||
;; cand may be in scores and still have no global score left
|
||||
(+ (or (cdr (assoc nil scores)) 0)
|
||||
(or (cdr (assoc major-mode scores)) 0)
|
||||
;; some context may not apply, make sure to not get nil context
|
||||
(or (cdr (when last-kwd (assoc last-kwd scores))) 0)
|
||||
(or (cdr (when parent-symbol (assoc parent-symbol scores))) 0)
|
||||
(or (cdr (when file (assoc file scores))) 0))
|
||||
0)))
|
||||
|
||||
;; score manipulation in one place --- know about hash value alist structure
|
||||
|
||||
(defun company-statistics--alist-update (alist updates merger &optional filter)
|
||||
"Return new alist with conses from ALIST. Their cdrs are updated
|
||||
to (merger cdr update-cdr) if the UPDATES alist contains an entry with an
|
||||
equal-matching car. If FILTER called with the result is non-nil, remove
|
||||
the cons from the result. If no matching cons exists in ALIST, add the new
|
||||
one. ALIST structure and cdrs may be changed!"
|
||||
(let ((filter (or filter 'ignore))
|
||||
(updated alist)
|
||||
(new nil))
|
||||
(mapc
|
||||
(lambda (upd)
|
||||
(let ((found (assoc (car upd) alist)))
|
||||
(if found
|
||||
(let ((result (funcall merger (cdr found) (cdr upd))))
|
||||
(if (funcall filter result)
|
||||
(setq updated (delete found updated))
|
||||
(setcdr found result)))
|
||||
(push upd new))))
|
||||
updates)
|
||||
(nconc updated new)))
|
||||
|
||||
(defun company-statistics--scores-add (cand score-updates)
|
||||
(puthash cand
|
||||
(company-statistics--alist-update
|
||||
(gethash cand company-statistics--scores)
|
||||
score-updates
|
||||
#'+)
|
||||
company-statistics--scores))
|
||||
|
||||
(defun company-statistics--log-revert (&optional index)
|
||||
"Revert score updates for log entry. INDEX defaults to
|
||||
`company-statistics--index'."
|
||||
(let ((hist-entry
|
||||
(aref company-statistics--log
|
||||
(or index company-statistics--index))))
|
||||
(when hist-entry ;ignore nil entry
|
||||
(let* ((cand (car hist-entry))
|
||||
(score-updates (cdr hist-entry))
|
||||
(new-scores
|
||||
(company-statistics--alist-update
|
||||
(gethash cand company-statistics--scores)
|
||||
score-updates
|
||||
#'-
|
||||
#'zerop)))
|
||||
(if new-scores ;sth left
|
||||
(puthash cand new-scores company-statistics--scores)
|
||||
(remhash cand company-statistics--scores))))))
|
||||
|
||||
(defun company-statistics--log-store (result score-updates)
|
||||
"Insert/overwrite result and associated score updates."
|
||||
(aset company-statistics--log company-statistics--index
|
||||
(cons result score-updates))
|
||||
(setq company-statistics--index
|
||||
(mod (1+ company-statistics--index) company-statistics-size)))
|
||||
|
||||
;; core functions: updater, actual sorting transformer, minor-mode
|
||||
|
||||
(defun company-statistics--start (manual)
|
||||
(funcall company-statistics-capture-context manual))
|
||||
|
||||
(defun company-statistics--finished (result)
|
||||
"After completion, update scores and log."
|
||||
(let* ((score-updates (funcall company-statistics-score-change result))
|
||||
(result (substring-no-properties result)))
|
||||
(company-statistics--scores-add result score-updates)
|
||||
(company-statistics--log-revert)
|
||||
(company-statistics--log-store result score-updates)))
|
||||
|
||||
(defun company-sort-by-statistics (candidates)
|
||||
"Sort candidates by historical statistics. Stable sort, so order is only
|
||||
changed for candidates distinguishable by score."
|
||||
(setq candidates
|
||||
(sort candidates
|
||||
(lambda (cand1 cand2)
|
||||
(> (funcall company-statistics-score-calc cand1)
|
||||
(funcall company-statistics-score-calc cand2))))))
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode company-statistics-mode
|
||||
"Statistical sorting for company-mode. Ranks completion candidates by
|
||||
the frequency with which they have been chosen in recent (as given by
|
||||
`company-statistics-size') history.
|
||||
|
||||
Turning this mode on and off preserves the statistics. They are also
|
||||
preserved automatically between Emacs sessions in the default
|
||||
configuration. You can customize this behavior with
|
||||
`company-statistics-auto-save', `company-statistics-auto-restore' and
|
||||
`company-statistics-file'."
|
||||
nil nil nil
|
||||
:global t
|
||||
(if company-statistics-mode
|
||||
(progn
|
||||
(unless (company-statistics--initialized-p)
|
||||
(if (and company-statistics-auto-restore
|
||||
(company-statistics--load))
|
||||
;; maybe of different size
|
||||
(company-statistics--log-resize nil company-statistics-size)
|
||||
(company-statistics--init)))
|
||||
(add-to-list 'company-transformers
|
||||
'company-sort-by-statistics 'append)
|
||||
(add-hook 'company-completion-started-hook
|
||||
'company-statistics--start)
|
||||
(add-hook 'company-completion-finished-hook
|
||||
'company-statistics--finished))
|
||||
(setq company-transformers
|
||||
(delq 'company-sort-by-statistics company-transformers))
|
||||
(remove-hook 'company-completion-started-hook
|
||||
'company-statistics--start)
|
||||
(remove-hook 'company-completion-finished-hook
|
||||
'company-statistics--finished)))
|
||||
|
||||
(add-hook 'kill-emacs-hook 'company-statistics--maybe-save)
|
||||
|
||||
(provide 'company-statistics)
|
||||
;;; company-statistics.el ends here
|
||||
@@ -5,6 +5,8 @@
|
||||
(web-completion-data "0.1.0"))
|
||||
:commit "e0c6bfa3ae7006c73d0fdfc0fdb69816309baf1b" :authors
|
||||
'(("Olexandr Sydorchuk" . "olexandr.syd@gmail.com"))
|
||||
:maintainers
|
||||
'(("Olexandr Sydorchuk" . "olexandr.syd@gmail.com"))
|
||||
:maintainer
|
||||
'("Olexandr Sydorchuk" . "olexandr.syd@gmail.com")
|
||||
:keywords
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; company-capf.el --- company-mode completion-at-point-functions backend -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2013-2022 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
@@ -135,27 +135,10 @@ so we can't just use the preceding variable instead.")
|
||||
(`match
|
||||
;; Ask the for the `:company-match' function. If that doesn't help,
|
||||
;; fallback to sniffing for face changes to get a suitable value.
|
||||
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
|
||||
:company-match)))
|
||||
(if f (funcall f arg)
|
||||
(let* ((match-start nil) (pos -1)
|
||||
(prop-value nil) (faces nil)
|
||||
(has-face-p nil) chunks
|
||||
(limit (length arg)))
|
||||
(while (< pos limit)
|
||||
(setq pos
|
||||
(if (< pos 0) 0 (next-property-change pos arg limit)))
|
||||
(setq prop-value (or
|
||||
(get-text-property pos 'face arg)
|
||||
(get-text-property pos 'font-lock-face arg))
|
||||
faces (if (listp prop-value) prop-value (list prop-value))
|
||||
has-face-p (memq 'completions-common-part faces))
|
||||
(cond ((and (not match-start) has-face-p)
|
||||
(setq match-start pos))
|
||||
((and match-start (not has-face-p))
|
||||
(push (cons match-start pos) chunks)
|
||||
(setq match-start nil))))
|
||||
(nreverse chunks)))))
|
||||
(let ((f (or (plist-get (nthcdr 4 company-capf--current-completion-data)
|
||||
:company-match)
|
||||
#'company--match-from-capf-face)))
|
||||
(funcall f arg)))
|
||||
(`duplicates t)
|
||||
(`no-cache t) ;Not much can be done here, as long as we handle
|
||||
;non-prefix matches.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; company-clang.el --- company-mode completion backend for Clang -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2021 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2009-2011, 2013-2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
@@ -119,10 +119,9 @@ or automatically through a custom `company-clang-prefix-guesser'."
|
||||
|
||||
;; parsing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; TODO: Handle Pattern (syntactic hints would be neat).
|
||||
;; Do we ever see OVERLOAD (or OVERRIDE)?
|
||||
(defconst company-clang--completion-pattern
|
||||
"^COMPLETION: \\_<\\(%s[a-zA-Z0-9_:]*\\)\\(?:\\(?: (InBase)\\)? : \\(.*\\)$\\)?$")
|
||||
"^COMPLETION: \\_<\\(%s[a-zA-Z0-9_:]*\\|Pattern\\)\\(?:\\(?: (InBase)\\)? : \\(.*\\)$\\)?$")
|
||||
|
||||
(defconst company-clang--error-buffer-name "*clang-error*")
|
||||
|
||||
@@ -138,14 +137,14 @@ or automatically through a custom `company-clang-prefix-guesser'."
|
||||
(regexp-quote prefix)))
|
||||
(case-fold-search nil)
|
||||
(results (make-hash-table :test 'equal :size (/ (point-max) 100)))
|
||||
lines match)
|
||||
lines)
|
||||
(while (re-search-forward pattern nil t)
|
||||
(setq match (match-string-no-properties 1))
|
||||
(unless (equal match "Pattern")
|
||||
(save-match-data
|
||||
(let ((match (match-string-no-properties 1))
|
||||
(meta (match-string-no-properties 2)))
|
||||
(when (equal match "Pattern")
|
||||
(setq match (company-clang--pattern-to-match meta)))
|
||||
(when (string-match ":" match)
|
||||
(setq match (substring match 0 (match-beginning 0)))))
|
||||
(let ((meta (match-string-no-properties 2)))
|
||||
(setq match (substring match 0 (match-beginning 0))))
|
||||
;; Avoiding duplicates:
|
||||
;; https://github.com/company-mode/company-mode/issues/841
|
||||
(cond
|
||||
@@ -154,7 +153,7 @@ or automatically through a custom `company-clang-prefix-guesser'."
|
||||
(puthash match meta results))
|
||||
;; Or it's the first time we see this completion
|
||||
((eq (gethash match results 'none) 'none)
|
||||
(puthash match nil results))))))
|
||||
(puthash match nil results)))))
|
||||
(maphash
|
||||
(lambda (match meta)
|
||||
(when meta
|
||||
@@ -163,6 +162,15 @@ or automatically through a custom `company-clang-prefix-guesser'."
|
||||
results)
|
||||
lines))
|
||||
|
||||
(defun company-clang--pattern-to-match (pat)
|
||||
(let ((start 0)
|
||||
(end nil))
|
||||
(when (string-match "#]" pat)
|
||||
(setq start (match-end 0)))
|
||||
(when (string-match "[ \(]<#" pat start)
|
||||
(setq end (match-beginning 0)))
|
||||
(substring pat start end)))
|
||||
|
||||
(defun company-clang--meta (candidate)
|
||||
(get-text-property 0 'meta candidate))
|
||||
|
||||
@@ -178,6 +186,8 @@ or automatically through a custom `company-clang-prefix-guesser'."
|
||||
(delete-region pt (point)))
|
||||
(buffer-string)))))
|
||||
|
||||
;; TODO: Parse the original formatting here, rather than guess.
|
||||
;; Strip it every time in the `meta' handler instead.
|
||||
(defun company-clang--annotation-1 (candidate)
|
||||
(let ((meta (company-clang--meta candidate)))
|
||||
(cond
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; company-dabbrev-code.el --- dabbrev-like company-mode backend for code -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2016, 2021 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2009-2011, 2013-2016, 2021-2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
@@ -69,11 +69,29 @@ also `company-dabbrev-code-time-limit'."
|
||||
"Non-nil to ignore case when collecting completion candidates."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom company-dabbrev-code-completion-styles nil
|
||||
"Non-nil to use the completion styles for fuzzy matching."
|
||||
:type '(choice (const :tag "Prefix matching only" nil)
|
||||
(const :tag "Matching according to `completion-styles'" t)
|
||||
(list :tag "Custom list of styles" symbol)))
|
||||
|
||||
(defun company-dabbrev-code--make-regexp (prefix)
|
||||
(concat "\\_<" (if (equal prefix "")
|
||||
"\\([a-zA-Z]\\|\\s_\\)"
|
||||
(regexp-quote prefix))
|
||||
"\\(\\sw\\|\\s_\\)*\\_>"))
|
||||
(let ((prefix-re
|
||||
(cond
|
||||
((equal prefix "")
|
||||
"\\([a-zA-Z]\\|\\s_\\)")
|
||||
((not company-dabbrev-code-completion-styles)
|
||||
(regexp-quote prefix))
|
||||
(t
|
||||
;; Use the cache at least after 2 chars. We could also cache
|
||||
;; earlier, for users who set company-min-p-l to 1 or 0.
|
||||
(let ((prefix (if (>= (length prefix) 2)
|
||||
(substring prefix 0 2)
|
||||
prefix)))
|
||||
(mapconcat #'regexp-quote
|
||||
(mapcar #'string prefix)
|
||||
"\\(\\sw\\|\\s_\\)*"))))))
|
||||
(concat "\\_<" prefix-re "\\(\\sw\\|\\s_\\)*\\_>")))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-dabbrev-code (command &optional arg &rest _ignored)
|
||||
@@ -88,18 +106,46 @@ comments or strings."
|
||||
(or company-dabbrev-code-everywhere
|
||||
(not (company-in-string-or-comment)))
|
||||
(or (company-grab-symbol) 'stop)))
|
||||
(candidates (let ((case-fold-search company-dabbrev-code-ignore-case))
|
||||
(company-dabbrev--search
|
||||
(company-dabbrev-code--make-regexp arg)
|
||||
company-dabbrev-code-time-limit
|
||||
(pcase company-dabbrev-code-other-buffers
|
||||
(`t (list major-mode))
|
||||
(`code company-dabbrev-code-modes)
|
||||
(`all `all))
|
||||
(not company-dabbrev-code-everywhere))))
|
||||
(candidates
|
||||
(let* ((case-fold-search company-dabbrev-code-ignore-case)
|
||||
(regexp (company-dabbrev-code--make-regexp arg)))
|
||||
(company-dabbrev-code--filter
|
||||
arg
|
||||
(company-cache-fetch
|
||||
'dabbrev-code-candidates
|
||||
(lambda ()
|
||||
(company-dabbrev--search
|
||||
regexp
|
||||
company-dabbrev-code-time-limit
|
||||
(pcase company-dabbrev-code-other-buffers
|
||||
(`t (list major-mode))
|
||||
(`code company-dabbrev-code-modes)
|
||||
(`all `all))
|
||||
(not company-dabbrev-code-everywhere)))
|
||||
:expire t
|
||||
:check-tag regexp))))
|
||||
(kind 'text)
|
||||
(no-cache t)
|
||||
(ignore-case company-dabbrev-code-ignore-case)
|
||||
(match (when company-dabbrev-code-completion-styles
|
||||
(company--match-from-capf-face arg)))
|
||||
(duplicates t)))
|
||||
|
||||
(defun company-dabbrev-code--filter (prefix table)
|
||||
(let ((completion-ignore-case company-dabbrev-code-ignore-case)
|
||||
(completion-styles (if (listp company-dabbrev-code-completion-styles)
|
||||
company-dabbrev-code-completion-styles
|
||||
completion-styles))
|
||||
res)
|
||||
(if (not company-dabbrev-code-completion-styles)
|
||||
(all-completions prefix table)
|
||||
(setq res (completion-all-completions
|
||||
prefix
|
||||
table
|
||||
nil (length prefix)))
|
||||
(if (numberp (cdr (last res)))
|
||||
(setcdr (last res) nil))
|
||||
res)))
|
||||
|
||||
(provide 'company-dabbrev-code)
|
||||
;;; company-dabbrev-code.el ends here
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; company-dabbrev.el --- dabbrev-like company-mode completion backend -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2018, 2021 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2009-2011, 2013-2018, 2021-2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
@@ -70,10 +70,7 @@ candidate is inserted, even some of its characters have different case."
|
||||
|
||||
The value of nil means keep them as-is.
|
||||
`case-replace' means use the value of `case-replace'.
|
||||
Any other value means downcase.
|
||||
|
||||
If you set this value to nil, you may also want to set
|
||||
`company-dabbrev-ignore-case' to any value other than `keep-prefix'."
|
||||
Any other value means downcase."
|
||||
:type '(choice
|
||||
(const :tag "Keep as-is" nil)
|
||||
(const :tag "Downcase" t)
|
||||
@@ -114,7 +111,7 @@ This variable affects both `company-dabbrev' and `company-dabbrev-code'."
|
||||
(when (and (>= (length match) company-dabbrev-minimum-length)
|
||||
(not (and company-dabbrev-ignore-invisible
|
||||
(invisible-p (match-beginning 0)))))
|
||||
(push match symbols)))))
|
||||
(puthash match t symbols)))))
|
||||
(goto-char (if pos (1- pos) (point-min)))
|
||||
;; Search before pos.
|
||||
(let ((tmp-end (point)))
|
||||
@@ -147,7 +144,9 @@ This variable affects both `company-dabbrev' and `company-dabbrev-code'."
|
||||
(defun company-dabbrev--search (regexp &optional limit other-buffer-modes
|
||||
ignore-comments)
|
||||
(let* ((start (current-time))
|
||||
(symbols (company-dabbrev--search-buffer regexp (point) nil start limit
|
||||
(symbols (company-dabbrev--search-buffer regexp (point)
|
||||
(make-hash-table :test 'equal)
|
||||
start limit
|
||||
ignore-comments)))
|
||||
(when other-buffer-modes
|
||||
(cl-dolist (buffer (delq (current-buffer) (buffer-list)))
|
||||
@@ -175,8 +174,28 @@ This variable affects both `company-dabbrev' and `company-dabbrev-code'."
|
||||
1)))
|
||||
|
||||
(defun company-dabbrev--filter (prefix candidates)
|
||||
(let ((completion-ignore-case company-dabbrev-ignore-case))
|
||||
(all-completions prefix candidates)))
|
||||
(let* ((completion-ignore-case company-dabbrev-ignore-case)
|
||||
(filtered (all-completions prefix candidates))
|
||||
(lp (length prefix))
|
||||
(downcase (if (eq company-dabbrev-downcase 'case-replace)
|
||||
case-replace
|
||||
company-dabbrev-downcase)))
|
||||
(when downcase
|
||||
(let ((ptr filtered))
|
||||
(while ptr
|
||||
(setcar ptr (downcase (car ptr)))
|
||||
(setq ptr (cdr ptr)))))
|
||||
(if (and (eq company-dabbrev-ignore-case 'keep-prefix)
|
||||
(not (= lp 0)))
|
||||
(company-substitute-prefix prefix filtered)
|
||||
filtered)))
|
||||
|
||||
(defun company-dabbrev--fetch ()
|
||||
(company-dabbrev--search (company-dabbrev--make-regexp)
|
||||
company-dabbrev-time-limit
|
||||
(pcase company-dabbrev-other-buffers
|
||||
(`t (list major-mode))
|
||||
(`all `all))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-dabbrev (command &optional arg &rest _ignored)
|
||||
@@ -186,21 +205,13 @@ This variable affects both `company-dabbrev' and `company-dabbrev-code'."
|
||||
(interactive (company-begin-backend 'company-dabbrev))
|
||||
(prefix (company-dabbrev--prefix))
|
||||
(candidates
|
||||
(let* ((case-fold-search company-dabbrev-ignore-case)
|
||||
(words (company-dabbrev--search (company-dabbrev--make-regexp)
|
||||
company-dabbrev-time-limit
|
||||
(pcase company-dabbrev-other-buffers
|
||||
(`t (list major-mode))
|
||||
(`all `all))))
|
||||
(downcase-p (if (eq company-dabbrev-downcase 'case-replace)
|
||||
case-replace
|
||||
company-dabbrev-downcase)))
|
||||
(setq words (company-dabbrev--filter arg words))
|
||||
(if downcase-p
|
||||
(mapcar 'downcase words)
|
||||
words)))
|
||||
(company-dabbrev--filter
|
||||
arg
|
||||
(company-cache-fetch 'dabbrev-candidates #'company-dabbrev--fetch
|
||||
:expire t)))
|
||||
(kind 'text)
|
||||
(ignore-case company-dabbrev-ignore-case)
|
||||
(no-cache t)
|
||||
(ignore-case (and company-dabbrev-ignore-case t))
|
||||
(duplicates t)))
|
||||
|
||||
(provide 'company-dabbrev)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; company-ispell.el --- company-mode completion backend using Ispell
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2016, 2018, 2021 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2009-2011, 2013-2016, 2018, 2021, 2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
@@ -33,30 +33,35 @@
|
||||
"Completion backend using Ispell."
|
||||
:group 'company)
|
||||
|
||||
(defun company--set-dictionary (symbol value)
|
||||
(set-default-toplevel-value symbol value)
|
||||
(company-cache-delete 'ispell-candidates))
|
||||
|
||||
(defcustom company-ispell-dictionary nil
|
||||
"Dictionary to use for `company-ispell'.
|
||||
If nil, use `ispell-complete-word-dict'."
|
||||
:type '(choice (const :tag "default (nil)" nil)
|
||||
(file :tag "dictionary" t)))
|
||||
(file :tag "dictionary" t))
|
||||
:set #'company--set-dictionary)
|
||||
|
||||
(defvar company-ispell-available 'unknown)
|
||||
|
||||
(defalias 'company-ispell--lookup-words
|
||||
(if (fboundp 'ispell-lookup-words)
|
||||
'ispell-lookup-words
|
||||
'lookup-words))
|
||||
|
||||
(defun company-ispell-available ()
|
||||
(when (eq company-ispell-available 'unknown)
|
||||
(condition-case err
|
||||
(progn
|
||||
(company-ispell--lookup-words "WHATEVER")
|
||||
(ispell-lookup-words "WHATEVER")
|
||||
(setq company-ispell-available t))
|
||||
(error
|
||||
(message "Company-Ispell: %s" (error-message-string err))
|
||||
(setq company-ispell-available nil))))
|
||||
company-ispell-available)
|
||||
|
||||
(defun company--ispell-dict ()
|
||||
(or company-ispell-dictionary
|
||||
ispell-complete-word-dict
|
||||
ispell-alternate-dictionary))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-ispell (command &optional arg &rest ignored)
|
||||
"`company-mode' completion backend using Ispell."
|
||||
@@ -66,18 +71,23 @@ If nil, use `ispell-complete-word-dict'."
|
||||
(prefix (when (company-ispell-available)
|
||||
(company-grab-word)))
|
||||
(candidates
|
||||
(let ((words (company-ispell--lookup-words
|
||||
arg
|
||||
(or company-ispell-dictionary ispell-complete-word-dict)))
|
||||
(completion-ignore-case t))
|
||||
(let* ((dict (company--ispell-dict))
|
||||
(all-words
|
||||
(company-cache-fetch 'ispell-candidates
|
||||
(lambda () (ispell-lookup-words "" dict))
|
||||
:check-tag dict))
|
||||
(completion-ignore-case t))
|
||||
(if (string= arg "")
|
||||
;; Small optimization.
|
||||
words
|
||||
;; Work around issue #284.
|
||||
(all-completions arg words))))
|
||||
all-words
|
||||
(company-substitute-prefix
|
||||
arg
|
||||
;; Work around issue #284.
|
||||
(all-completions arg all-words)))))
|
||||
(kind 'text)
|
||||
(no-cache t)
|
||||
(sorted t)
|
||||
(ignore-case 'keep-prefix)))
|
||||
(ignore-case t)))
|
||||
|
||||
(provide 'company-ispell)
|
||||
;;; company-ispell.el ends here
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; company-keywords.el --- A company backend for programming language keywords
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2018, 2020-2021 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2009-2011, 2013-2018, 2020-2022 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
(define-package "company" "20221206.2122" "Modular text completion framework"
|
||||
(define-package "company" "20231023.1033" "Modular text completion framework"
|
||||
'((emacs "25.1"))
|
||||
:commit "6884e3ad717419b4a64a5fab08c8cb9bd20a0b27" :maintainer
|
||||
'("Dmitry Gutov" . "dgutov@yandex.ru")
|
||||
:commit "66201465a962ac003f320a1df612641b2b276ab5" :maintainers
|
||||
'(("Dmitry Gutov" . "dmitry@gutov.dev"))
|
||||
:maintainer
|
||||
'("Dmitry Gutov" . "dmitry@gutov.dev")
|
||||
:keywords
|
||||
'("abbrev" "convenience" "matching")
|
||||
:url "http://company-mode.github.io/")
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
(interactive (company-begin-backend 'company-tempo))
|
||||
(prefix (or (car (tempo-find-match-string tempo-match-finder)) ""))
|
||||
(candidates (all-completions arg (tempo-build-collection)))
|
||||
(kind 'snippet)
|
||||
(meta (company-tempo-meta arg))
|
||||
(post-completion (when company-tempo-expand (company-tempo-insert arg)))
|
||||
(sorted t)))
|
||||
|
||||
@@ -140,7 +140,7 @@ confirm the selection and finish the completion."
|
||||
:type 'boolean)
|
||||
|
||||
;;;###autoload
|
||||
(define-obsolete-function-alias 'company-tng-configure-default 'company-tng-mode "0.9.14"
|
||||
(define-obsolete-function-alias 'company-tng-configure-default 'company-tng-mode "0.10.0"
|
||||
"Applies the default configuration to enable company-tng.")
|
||||
|
||||
(declare-function eglot--snippet-expansion-fn "eglot")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;; company-yasnippet.el --- company-mode completion backend for Yasnippet
|
||||
|
||||
;; Copyright (C) 2014-2015, 2020-2021 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2014-2015, 2020-2022 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Dmitry Gutov
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
;;; company.el --- Modular text completion framework -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2022 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2009-2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
;; Maintainer: Dmitry Gutov <dgutov@yandex.ru>
|
||||
;; Maintainer: Dmitry Gutov <dmitry@gutov.dev>
|
||||
;; URL: http://company-mode.github.io/
|
||||
;; Version: 0.9.13
|
||||
;; Version: 0.10.2
|
||||
;; Keywords: abbrev, convenience, matching
|
||||
;; Package-Requires: ((emacs "25.1"))
|
||||
|
||||
@@ -134,17 +134,17 @@
|
||||
(defface company-tooltip-quick-access
|
||||
'((default :inherit company-tooltip-annotation))
|
||||
"Face used for the quick-access hints shown in the tooltip."
|
||||
:package-version '(company . "0.9.14"))
|
||||
:package-version '(company . "0.10.0"))
|
||||
|
||||
(defface company-tooltip-quick-access-selection
|
||||
'((default :inherit company-tooltip-annotation-selection))
|
||||
"Face used for the selected quick-access hints shown in the tooltip."
|
||||
:package-version '(company . "0.9.14"))
|
||||
:package-version '(company . "0.10.0"))
|
||||
|
||||
(define-obsolete-face-alias
|
||||
'company-scrollbar-fg
|
||||
'company-tooltip-scrollbar-thumb
|
||||
"0.9.14")
|
||||
"0.10.0")
|
||||
|
||||
(defface company-tooltip-scrollbar-thumb
|
||||
'((((background light))
|
||||
@@ -156,7 +156,7 @@
|
||||
(define-obsolete-face-alias
|
||||
'company-scrollbar-bg
|
||||
'company-tooltip-scrollbar-track
|
||||
"0.9.14")
|
||||
"0.10.0")
|
||||
|
||||
(defface company-tooltip-scrollbar-track
|
||||
'((((background light))
|
||||
@@ -286,7 +286,7 @@ This doesn't include the margins and the scroll bar."
|
||||
(defcustom company-tooltip-width-grow-only nil
|
||||
"When non-nil, the tooltip width is not allowed to decrease."
|
||||
:type 'boolean
|
||||
:package-version '(company . "0.9.14"))
|
||||
:package-version '(company . "0.10.0"))
|
||||
|
||||
(defcustom company-tooltip-margin 1
|
||||
"Width of margin columns to show around the toolip."
|
||||
@@ -309,6 +309,16 @@ This doesn't include the margins and the scroll bar."
|
||||
:type 'boolean
|
||||
:package-version '(company . "0.8.1"))
|
||||
|
||||
(defcustom company-tooltip-annotation-padding nil
|
||||
"Non-nil to specify the padding before annotation.
|
||||
|
||||
Depending on the value of `company-tooltip-align-annotations', the default
|
||||
padding is either 0 or 1 space. This variable allows to override that
|
||||
value to increase the padding. When annotations are right-aligned, it sets
|
||||
the minimum padding, and otherwise just the constant one."
|
||||
:type 'number
|
||||
:package-version '(company "0.10.0"))
|
||||
|
||||
(defvar company-safe-backends
|
||||
'((company-abbrev . "Abbrev")
|
||||
(company-bbdb . "BBDB")
|
||||
@@ -577,12 +587,12 @@ this."
|
||||
(define-obsolete-variable-alias
|
||||
'company-auto-complete
|
||||
'company-insertion-on-trigger
|
||||
"0.9.14")
|
||||
"0.10.0")
|
||||
|
||||
(define-obsolete-variable-alias
|
||||
'company-auto-commit
|
||||
'company-insertion-on-trigger
|
||||
"0.9.14")
|
||||
"0.10.0")
|
||||
|
||||
(defcustom company-insertion-on-trigger nil
|
||||
"If enabled, allow triggering insertion of the selected candidate.
|
||||
@@ -596,17 +606,17 @@ triggers."
|
||||
(const :tag "On, if user interaction took place"
|
||||
company-explicit-action-p)
|
||||
(const :tag "On" t))
|
||||
:package-version '(company . "0.9.14"))
|
||||
:package-version '(company . "0.10.0"))
|
||||
|
||||
(define-obsolete-variable-alias
|
||||
'company-auto-complete-chars
|
||||
'company-insertion-triggers
|
||||
"0.9.14")
|
||||
"0.10.0")
|
||||
|
||||
(define-obsolete-variable-alias
|
||||
'company-auto-commit-chars
|
||||
'company-insertion-triggers
|
||||
"0.9.14")
|
||||
"0.10.0")
|
||||
|
||||
(defcustom company-insertion-triggers '(?\ ?\) ?.)
|
||||
"Determine triggers for `company-insertion-on-trigger'.
|
||||
@@ -638,7 +648,7 @@ insertion."
|
||||
(const :tag "Generic string fence." ?|)
|
||||
(const :tag "Generic comment fence." ?!))
|
||||
(function :tag "Predicate function"))
|
||||
:package-version '(company . "0.9.14"))
|
||||
:package-version '(company . "0.10.0"))
|
||||
|
||||
(defcustom company-idle-delay .2
|
||||
"The idle delay in seconds until completion starts automatically.
|
||||
@@ -692,15 +702,18 @@ commands in the `company-' namespace, abort completion."
|
||||
|
||||
(defun company-custom--set-quick-access (option value)
|
||||
"Re-bind quick-access key sequences on OPTION VALUE change."
|
||||
(when (boundp 'company-active-map)
|
||||
(company-keymap--unbind-quick-access company-active-map))
|
||||
(when (boundp 'company-search-map)
|
||||
(company-keymap--unbind-quick-access company-search-map))
|
||||
;; When upgrading from an earlier version of company, might not be.
|
||||
(when (fboundp #'company-keymap--unbind-quick-access)
|
||||
(when (boundp 'company-active-map)
|
||||
(company-keymap--unbind-quick-access company-active-map))
|
||||
(when (boundp 'company-search-map)
|
||||
(company-keymap--unbind-quick-access company-search-map)))
|
||||
(custom-set-default option value)
|
||||
(when (boundp 'company-active-map)
|
||||
(company-keymap--bind-quick-access company-active-map))
|
||||
(when (boundp 'company-search-map)
|
||||
(company-keymap--bind-quick-access company-search-map)))
|
||||
(when (fboundp #'company-keymap--bind-quick-access)
|
||||
(when (boundp 'company-active-map)
|
||||
(company-keymap--bind-quick-access company-active-map))
|
||||
(when (boundp 'company-search-map)
|
||||
(company-keymap--bind-quick-access company-search-map))))
|
||||
|
||||
(defcustom company-quick-access-keys '("1" "2" "3" "4" "5" "6" "7" "8" "9" "0")
|
||||
"Character strings used as a part of quick-access key sequences.
|
||||
@@ -718,7 +731,7 @@ beside the candidates."
|
||||
;; TODO un-comment on removal of `M-n' `company--select-next-and-warn'.
|
||||
;; (const :tag "Dvorak home row" ("a" "o" "e" "u" "i" "d" "h" "t" "n" "s"))
|
||||
(repeat :tag "User defined" string))
|
||||
:package-version '(company . "0.9.14"))
|
||||
:package-version '(company . "0.10.0"))
|
||||
|
||||
(defcustom company-quick-access-modifier 'meta
|
||||
"Modifier key used for quick-access keys sequences.
|
||||
@@ -729,7 +742,7 @@ See `company-quick-access-keys' for more details."
|
||||
(const :tag "Super key" super)
|
||||
(const :tag "Hyper key" hyper)
|
||||
(const :tag "Control key" control))
|
||||
:package-version '(company . "0.9.14"))
|
||||
:package-version '(company . "0.10.0"))
|
||||
|
||||
(defun company-keymap--quick-access-modifier ()
|
||||
"Return string representation of the `company-quick-access-modifier'."
|
||||
@@ -764,7 +777,7 @@ See `company-quick-access-keys' for more details."
|
||||
(define-obsolete-variable-alias
|
||||
'company-show-numbers
|
||||
'company-show-quick-access
|
||||
"0.9.14")
|
||||
"0.10.0")
|
||||
|
||||
(defcustom company-show-quick-access nil
|
||||
"If non-nil, show quick-access hints beside the candidates.
|
||||
@@ -791,7 +804,7 @@ return a string prefixed with one space."
|
||||
'company-show-numbers-function
|
||||
"use `company-quick-access-hint-function' instead,
|
||||
but adjust the expected values appropriately."
|
||||
"0.9.14")
|
||||
"0.10.0")
|
||||
|
||||
(defcustom company-quick-access-hint-function #'company-quick-access-hint-key
|
||||
"Function called to get quick-access hints for the candidates.
|
||||
@@ -1031,10 +1044,10 @@ means that `company-mode' is always turned on except in `message-mode' buffers."
|
||||
(defun company-install-map ()
|
||||
(unless (or (cdar company-emulation-alist)
|
||||
(null company-my-keymap))
|
||||
(setf (cdar company-emulation-alist) company-my-keymap)))
|
||||
(setq-local company-emulation-alist `((t . ,company-my-keymap)))))
|
||||
|
||||
(defun company-uninstall-map ()
|
||||
(setf (cdar company-emulation-alist) nil))
|
||||
(kill-local-variable 'company-emulation-alist))
|
||||
|
||||
(defun company--company-command-p (keys)
|
||||
"Checks if the keys are part of company's overriding keymap"
|
||||
@@ -1051,6 +1064,10 @@ means that `company-mode' is always turned on except in `message-mode' buffers."
|
||||
(row (cdr (or (posn-actual-col-row posn)
|
||||
;; When position is non-visible for some reason.
|
||||
(posn-col-row posn)))))
|
||||
;; posn-col-row return value relative to the left
|
||||
(when (eq (current-bidi-paragraph-direction) 'right-to-left)
|
||||
(let ((ww (window-body-width)))
|
||||
(setq col (- ww col))))
|
||||
(when (bound-and-true-p display-line-numbers)
|
||||
(cl-decf col (+ 2 (line-number-display-width))))
|
||||
(cons (+ col (window-hscroll)) row)))
|
||||
@@ -1116,6 +1133,69 @@ matches IDLE-BEGIN-AFTER-RE, return it wrapped in a cons."
|
||||
(car (setq ppss (cdr ppss)))
|
||||
(nth 3 ppss))))
|
||||
|
||||
(defun company-substitute-prefix (prefix strings)
|
||||
(let ((len (length prefix)))
|
||||
(mapcar
|
||||
(lambda (s)
|
||||
(if (eq t (compare-strings prefix 0 len s 0 len))
|
||||
s
|
||||
(concat prefix (substring s len))))
|
||||
strings)))
|
||||
|
||||
(defun company--match-from-capf-face (str)
|
||||
"Compute `match' result from a CAPF's completion fontification."
|
||||
(let* ((match-start nil) (pos -1)
|
||||
(prop-value nil) (faces nil)
|
||||
(has-face-p nil) chunks
|
||||
(limit (length str)))
|
||||
(while (< pos limit)
|
||||
(setq pos
|
||||
(if (< pos 0) 0 (next-property-change pos str limit)))
|
||||
(setq prop-value (or (get-text-property pos 'face str)
|
||||
(get-text-property pos 'font-lock-face str))
|
||||
faces (if (listp prop-value) prop-value (list prop-value))
|
||||
has-face-p (memq 'completions-common-part faces))
|
||||
(cond ((and (not match-start) has-face-p)
|
||||
(setq match-start pos))
|
||||
((and match-start (not has-face-p))
|
||||
(push (cons match-start pos) chunks)
|
||||
(setq match-start nil))))
|
||||
(nreverse chunks)))
|
||||
|
||||
(defvar company--cache (make-hash-table :test #'equal :size 10))
|
||||
|
||||
(cl-defun company-cache-fetch (key
|
||||
fetcher
|
||||
&key expire check-tag)
|
||||
"Fetch the value assigned to KEY in the cache.
|
||||
When not found, or when found to be stale, calls FETCHER to compute the
|
||||
result. When EXPIRE is non-nil, the value will be deleted at the end of
|
||||
completion. CHECK-TAG, when present, is saved as well, and the entry will
|
||||
be recomputed when this value changes."
|
||||
;; We could make EXPIRE accept a time value as well.
|
||||
(let ((res (gethash key company--cache 'none))
|
||||
value)
|
||||
(if (and (not (eq res 'none))
|
||||
(or (not check-tag)
|
||||
(equal check-tag (assoc-default :check-tag res))))
|
||||
(assoc-default :value res)
|
||||
(setq res (list (cons :value (setq value (funcall fetcher)))))
|
||||
(if expire (push '(:expire . t) res))
|
||||
(if check-tag (push `(:check-tag . ,check-tag) res))
|
||||
(puthash key res company--cache)
|
||||
value)))
|
||||
|
||||
(defun company-cache-delete (key)
|
||||
"Delete KEY from cache."
|
||||
(remhash key company--cache))
|
||||
|
||||
(defun company-cache-expire ()
|
||||
"Delete all keys from the cache that are set to be expired."
|
||||
(maphash (lambda (k v)
|
||||
(when (assoc-default :expire v)
|
||||
(remhash k company--cache)))
|
||||
company--cache))
|
||||
|
||||
(defun company-call-backend (&rest args)
|
||||
(company--force-sync #'company-call-backend-raw args company-backend))
|
||||
|
||||
@@ -1151,6 +1231,9 @@ matches IDLE-BEGIN-AFTER-RE, return it wrapped in a cons."
|
||||
(error (error "Company: backend %s error \"%s\" with args %s"
|
||||
company-backend (error-message-string err) args))))
|
||||
|
||||
(defvar-local company--multi-uncached-backends nil)
|
||||
(defvar-local company--multi-min-prefix nil)
|
||||
|
||||
(defun company--multi-backend-adapter (backends command &rest args)
|
||||
(let ((backends (cl-loop for b in backends
|
||||
when (or (keywordp b)
|
||||
@@ -1165,9 +1248,30 @@ matches IDLE-BEGIN-AFTER-RE, return it wrapped in a cons."
|
||||
|
||||
(pcase command
|
||||
(`candidates
|
||||
(company--multi-backend-adapter-candidates backends (car args) separate))
|
||||
(company--multi-backend-adapter-candidates backends
|
||||
(car args)
|
||||
(or company--multi-min-prefix 0)
|
||||
separate))
|
||||
(`set-min-prefix (setq company--multi-min-prefix (car args)))
|
||||
(`sorted separate)
|
||||
(`duplicates (not separate))
|
||||
((and `no-cache
|
||||
(pred (lambda (_)
|
||||
(let* (found
|
||||
(uncached company--multi-uncached-backends))
|
||||
(dolist (backend backends)
|
||||
(when
|
||||
(and (member backend uncached)
|
||||
(company--good-prefix-p
|
||||
(let ((company-backend backend))
|
||||
(company-call-backend 'prefix))
|
||||
(or company--multi-min-prefix 0)))
|
||||
(setq found t
|
||||
company--multi-uncached-backends
|
||||
(delete backend
|
||||
company--multi-uncached-backends))))
|
||||
found))))
|
||||
t)
|
||||
((or `prefix `ignore-case `no-cache `require-match)
|
||||
(let (value)
|
||||
(cl-dolist (backend backends)
|
||||
@@ -1184,12 +1288,18 @@ matches IDLE-BEGIN-AFTER-RE, return it wrapped in a cons."
|
||||
(car backends))))
|
||||
(apply backend command args))))))))
|
||||
|
||||
(defun company--multi-backend-adapter-candidates (backends prefix separate)
|
||||
(defun company--multi-backend-adapter-candidates (backends prefix min-length separate)
|
||||
(let ((pairs (cl-loop for backend in backends
|
||||
when (equal (company--prefix-str
|
||||
(let ((company-backend backend))
|
||||
(company-call-backend 'prefix)))
|
||||
prefix)
|
||||
when (let ((bp (let ((company-backend backend))
|
||||
(company-call-backend 'prefix))))
|
||||
(and
|
||||
;; It's important that the lengths match.
|
||||
(equal (company--prefix-str bp) prefix)
|
||||
;; One might override min-length, another not.
|
||||
(if (company--good-prefix-p bp min-length)
|
||||
t
|
||||
(push backend company--multi-uncached-backends)
|
||||
nil)))
|
||||
collect (cons (funcall backend 'candidates prefix)
|
||||
(company--multi-candidates-mapper
|
||||
backend
|
||||
@@ -1346,9 +1456,6 @@ To toggle the value of this variable, call `company-show-doc-buffer' with a
|
||||
prefix argument.")
|
||||
|
||||
(defun company-call-frontends (command)
|
||||
(when (and company-auto-update-doc
|
||||
(memq command '(update show)))
|
||||
(company-show-doc-buffer))
|
||||
(cl-loop for frontend in company-frontends collect
|
||||
(condition-case-unless-debug err
|
||||
(funcall frontend command)
|
||||
@@ -1448,7 +1555,9 @@ update if FORCE-UPDATE."
|
||||
(and candidates
|
||||
(not (cdr candidates))
|
||||
(eq t (compare-strings (car candidates) nil nil
|
||||
prefix nil nil ignore-case))))
|
||||
prefix nil nil ignore-case))
|
||||
(not (eq (company-call-backend 'kind (car candidates))
|
||||
'snippet))))
|
||||
|
||||
(defun company--fetch-candidates (prefix)
|
||||
(let* ((non-essential (not (company-explicit-action-p)))
|
||||
@@ -1620,7 +1729,7 @@ end of the match."
|
||||
(let ((base-size (cdr company-icon-size))
|
||||
(dfh (default-font-height)))
|
||||
(min
|
||||
(if (> dfh (* 2 base-size))
|
||||
(if (>= dfh (* 2 base-size))
|
||||
(* 2 base-size)
|
||||
base-size)
|
||||
(* company-icon-margin dfw))))))
|
||||
@@ -1633,10 +1742,21 @@ end of the match."
|
||||
:background (unless (eq bkg 'unspecified)
|
||||
bkg)))
|
||||
(spacer-px-width (- (* company-icon-margin dfw) icon-size)))
|
||||
(concat
|
||||
(propertize " " 'display spec)
|
||||
(propertize (company-space-string (1- company-icon-margin))
|
||||
'display `(space . (:width (,spacer-px-width))))))
|
||||
(cond
|
||||
((<= company-icon-margin 2)
|
||||
(concat
|
||||
(propertize " " 'display spec)
|
||||
(propertize (company-space-string (1- company-icon-margin))
|
||||
'display `(space . (:width (,spacer-px-width))))))
|
||||
(t
|
||||
(let* ((spacer-left (/ spacer-px-width 2))
|
||||
(spacer-right (- spacer-px-width spacer-left)))
|
||||
(concat
|
||||
(propertize (company-space-string 1)
|
||||
'display `(space . (:width (,spacer-left))))
|
||||
(propertize " " 'display spec)
|
||||
(propertize (company-space-string (- company-icon-margin 2))
|
||||
'display `(space . (:width (,spacer-right)))))))))
|
||||
nil))
|
||||
|
||||
(defun company-vscode-dark-icons-margin (candidate selected)
|
||||
@@ -1943,6 +2063,10 @@ prefix match (same case) will be prioritized."
|
||||
|
||||
;;;###autoload
|
||||
(defun company-manual-begin ()
|
||||
"Start the completion interface.
|
||||
|
||||
Unlike `company-complete-selection' or `company-complete', this command
|
||||
doesn't cause any immediate changes to the buffer text."
|
||||
(interactive)
|
||||
(company-assert-enabled)
|
||||
(setq company--manual-action t)
|
||||
@@ -2021,16 +2145,20 @@ For more details see `company-insertion-on-trigger' and
|
||||
company-candidates)
|
||||
(t (company-cancel))))
|
||||
|
||||
(defun company--good-prefix-p (prefix)
|
||||
(defun company--good-prefix-p (prefix min-length)
|
||||
(and (stringp (company--prefix-str prefix)) ;excludes 'stop
|
||||
(or (eq (cdr-safe prefix) t)
|
||||
(let ((len (or (cdr-safe prefix) (length prefix))))
|
||||
(if company--manual-prefix
|
||||
(or (not company-abort-manual-when-too-short)
|
||||
;; Must not be less than minimum or initial length.
|
||||
(>= len (min company-minimum-prefix-length
|
||||
(length company--manual-prefix))))
|
||||
(>= len company-minimum-prefix-length))))))
|
||||
(>= (or (cdr-safe prefix) (length prefix))
|
||||
min-length))))
|
||||
|
||||
(defun company--prefix-min-length ()
|
||||
(if company--manual-prefix
|
||||
(if company-abort-manual-when-too-short
|
||||
;; Must not be less than minimum or initial length.
|
||||
(min company-minimum-prefix-length
|
||||
(length company--manual-prefix))
|
||||
0)
|
||||
company-minimum-prefix-length))
|
||||
|
||||
(defun company--continue ()
|
||||
(when (company-call-backend 'no-cache company-prefix)
|
||||
@@ -2038,7 +2166,8 @@ For more details see `company-insertion-on-trigger' and
|
||||
(setq company-candidates-cache nil))
|
||||
(let* ((new-prefix (company-call-backend 'prefix))
|
||||
(ignore-case (company-call-backend 'ignore-case))
|
||||
(c (when (and (company--good-prefix-p new-prefix)
|
||||
(c (when (and (company--good-prefix-p new-prefix
|
||||
(company--prefix-min-length))
|
||||
(setq new-prefix (company--prefix-str new-prefix))
|
||||
(= (- (point) (length new-prefix))
|
||||
(- company-point (length company-prefix))))
|
||||
@@ -2067,7 +2196,8 @@ For more details see `company-insertion-on-trigger' and
|
||||
(t (company--continue-failed new-prefix)))))
|
||||
|
||||
(defun company--begin-new ()
|
||||
(let (prefix c)
|
||||
(let ((min-prefix (company--prefix-min-length))
|
||||
prefix c)
|
||||
(cl-dolist (backend (if company-backend
|
||||
;; prefer manual override
|
||||
(list company-backend)
|
||||
@@ -2080,8 +2210,10 @@ For more details see `company-insertion-on-trigger' and
|
||||
(company-call-backend 'prefix)))
|
||||
(company--multi-backend-adapter backend 'prefix)))
|
||||
(when prefix
|
||||
(when (company--good-prefix-p prefix)
|
||||
(when (company--good-prefix-p prefix min-prefix)
|
||||
(let ((ignore-case (company-call-backend 'ignore-case)))
|
||||
;; Keep this undocumented, esp. while only 1 backend needs it.
|
||||
(company-call-backend 'set-min-prefix min-prefix)
|
||||
(setq company-prefix (company--prefix-str prefix)
|
||||
company-backend backend
|
||||
c (company-calculate-candidates company-prefix ignore-case))
|
||||
@@ -2136,7 +2268,10 @@ For more details see `company-insertion-on-trigger' and
|
||||
company--manual-action nil
|
||||
company--manual-prefix nil
|
||||
company--point-max nil
|
||||
company--multi-uncached-backends nil
|
||||
company--multi-min-prefix nil
|
||||
company-point nil)
|
||||
(company-cache-expire)
|
||||
(when company-timer
|
||||
(cancel-timer company-timer))
|
||||
(company-echo-cancel t)
|
||||
@@ -2200,7 +2335,14 @@ For more details see `company-insertion-on-trigger' and
|
||||
(let (company-idle-delay) ; Against misbehavior while debugging.
|
||||
(company--perform)))
|
||||
(if company-candidates
|
||||
(company-call-frontends 'post-command)
|
||||
(progn
|
||||
(company-call-frontends 'post-command)
|
||||
(when company-auto-update-doc
|
||||
(condition-case nil
|
||||
(unless (company--electric-command-p)
|
||||
(company-show-doc-buffer))
|
||||
(user-error nil)
|
||||
(quit nil))))
|
||||
(let ((delay (company--idle-delay)))
|
||||
(and (numberp delay)
|
||||
(not defining-kbd-macro)
|
||||
@@ -2688,12 +2830,13 @@ inserted."
|
||||
(call-interactively 'company-complete-selection)
|
||||
(call-interactively 'company-complete-common)
|
||||
(when company-candidates
|
||||
(setq this-command 'company-complete-common)))))
|
||||
(setq this-command 'company-complete-common)))
|
||||
this-command))
|
||||
|
||||
(define-obsolete-function-alias
|
||||
'company-complete-number
|
||||
'company-complete-tooltip-row
|
||||
"0.9.14")
|
||||
"0.10.0")
|
||||
|
||||
(defun company-complete-tooltip-row (number)
|
||||
"Insert a candidate visible on the tooltip's row NUMBER.
|
||||
@@ -2803,16 +2946,19 @@ from the candidates list.")
|
||||
'(scroll-other-window scroll-other-window-down mwheel-scroll)
|
||||
"List of Commands that won't break out of electric commands.")
|
||||
|
||||
(defun company--electric-command-p ()
|
||||
(memq this-command company--electric-commands))
|
||||
|
||||
(defun company--electric-restore-window-configuration ()
|
||||
"Restore window configuration (after electric commands)."
|
||||
(when (and company--electric-saved-window-configuration
|
||||
(not (memq this-command company--electric-commands)))
|
||||
(not (company--electric-command-p)))
|
||||
(set-window-configuration company--electric-saved-window-configuration)
|
||||
(setq company--electric-saved-window-configuration nil)))
|
||||
|
||||
(defmacro company--electric-do (&rest body)
|
||||
(declare (indent 0) (debug t))
|
||||
`(when (company-manual-begin)
|
||||
`(when company-candidates
|
||||
(cl-assert (null company--electric-saved-window-configuration))
|
||||
(setq company--electric-saved-window-configuration (current-window-configuration))
|
||||
(let ((height (window-height))
|
||||
@@ -2835,11 +2981,7 @@ from the candidates list.")
|
||||
(selection (or company-selection 0)))
|
||||
(let* ((selected (nth selection company-candidates))
|
||||
(doc-buffer (or (company-call-backend 'doc-buffer selected)
|
||||
(if company-auto-update-doc
|
||||
(company-doc-buffer
|
||||
(format "%s: No documentation available"
|
||||
selected))
|
||||
(user-error "No documentation available"))))
|
||||
(user-error "No documentation available")))
|
||||
start)
|
||||
(when (consp doc-buffer)
|
||||
(setq start (cdr doc-buffer)
|
||||
@@ -2856,10 +2998,8 @@ automatically show the documentation buffer for each selection."
|
||||
(interactive "P")
|
||||
(when toggle-auto-update
|
||||
(setq company-auto-update-doc (not company-auto-update-doc)))
|
||||
(if company-auto-update-doc
|
||||
(company--show-doc-buffer)
|
||||
(company--electric-do
|
||||
(company--show-doc-buffer))))
|
||||
(company--electric-do
|
||||
(company--show-doc-buffer)))
|
||||
(put 'company-show-doc-buffer 'company-keep t)
|
||||
|
||||
(defun company-show-location ()
|
||||
@@ -3072,21 +3212,23 @@ If SHOW-VERSION is non-nil, show the version in the echo area."
|
||||
(_ (setq value (company-reformat (company--pre-render value))
|
||||
annotation (and annotation (company--pre-render annotation t))))
|
||||
(ann-ralign company-tooltip-align-annotations)
|
||||
(ann-padding (or company-tooltip-annotation-padding 0))
|
||||
(ann-truncate (< width
|
||||
(+ (length value) (length annotation)
|
||||
(if ann-ralign 1 0))))
|
||||
ann-padding)))
|
||||
(ann-start (+ margin
|
||||
(if ann-ralign
|
||||
(if ann-truncate
|
||||
(1+ (length value))
|
||||
(+ (length value) ann-padding)
|
||||
(- width (length annotation)))
|
||||
(length value))))
|
||||
(+ (length value) ann-padding))))
|
||||
(ann-end (min (+ ann-start (length annotation)) (+ margin width)))
|
||||
(line (concat left
|
||||
(if (or ann-truncate (not ann-ralign))
|
||||
(company-safe-substring
|
||||
(concat value
|
||||
(when (and annotation ann-ralign) " ")
|
||||
(when annotation
|
||||
(company-space-string ann-padding))
|
||||
annotation)
|
||||
0 width)
|
||||
(concat
|
||||
@@ -3225,7 +3367,7 @@ If SHOW-VERSION is non-nil, show the version in the echo area."
|
||||
'company--show-numbers
|
||||
"use `company-quick-access-hint-key' instead,
|
||||
but adjust the expected values appropriately."
|
||||
"0.9.14")
|
||||
"0.10.0")
|
||||
|
||||
(defsubst company--window-height ()
|
||||
(if (fboundp 'window-screen-lines)
|
||||
@@ -3314,6 +3456,9 @@ but adjust the expected values appropriately."
|
||||
(defun company--create-lines (selection limit)
|
||||
(let ((len company-candidates-length)
|
||||
(window-width (company--window-width))
|
||||
(company-tooltip-annotation-padding
|
||||
(or company-tooltip-annotation-padding
|
||||
(if company-tooltip-align-annotations 1 0)))
|
||||
left-margins
|
||||
left-margin-size
|
||||
lines
|
||||
@@ -3386,8 +3531,9 @@ but adjust the expected values appropriately."
|
||||
(setq annotation (string-trim-left annotation))))
|
||||
(push (list value annotation left) items)
|
||||
(setq width (max (+ (length value)
|
||||
(if (and annotation company-tooltip-align-annotations)
|
||||
(1+ (length annotation))
|
||||
(if annotation
|
||||
(+ (length annotation)
|
||||
company-tooltip-annotation-padding)
|
||||
(length annotation)))
|
||||
width))))
|
||||
|
||||
@@ -3610,7 +3756,7 @@ Returns a negative number if the tooltip should be displayed above point."
|
||||
(pre-command (company-pseudo-tooltip-hide-temporarily))
|
||||
(unhide
|
||||
(let ((ov company-pseudo-tooltip-overlay))
|
||||
(when (> (overlay-get ov 'company-height) 0)
|
||||
(when (and ov (> (overlay-get ov 'company-height) 0))
|
||||
;; Sleight of hand: if the current line wraps, we adjust the
|
||||
;; start of the overlay so that the popup does not zig-zag,
|
||||
;; but don't update the popup's background. This seems just
|
||||
@@ -3730,6 +3876,10 @@ Delay is determined by `company-tooltip-idle-delay'."
|
||||
(company-strip-prefix completion)
|
||||
completion))
|
||||
|
||||
(when (string-prefix-p "\n" completion)
|
||||
(setq completion (concat (propertize " " 'face 'company-preview) "\n"
|
||||
(substring completion 1))))
|
||||
|
||||
(and (equal pos (point))
|
||||
(not (equal completion ""))
|
||||
(add-text-properties 0 1 '(cursor 1) completion))
|
||||
@@ -3829,13 +3979,18 @@ Delay is determined by `company-tooltip-idle-delay'."
|
||||
:package-version '(company . "0.9.3"))
|
||||
|
||||
(defun company-echo-show (&optional getter)
|
||||
(when getter
|
||||
(setq company-echo-last-msg (funcall getter)))
|
||||
(let ((message-log-max nil)
|
||||
(let ((last-msg company-echo-last-msg)
|
||||
(message-log-max nil)
|
||||
(message-truncate-lines company-echo-truncate-lines))
|
||||
(if company-echo-last-msg
|
||||
(when getter
|
||||
(setq company-echo-last-msg (funcall getter)))
|
||||
;; Avoid modifying the echo area if we don't have anything to say, and we
|
||||
;; didn't put the previous message there (thus there's nothing to clear),
|
||||
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62816#20
|
||||
(if (not (member company-echo-last-msg '(nil "")))
|
||||
(message "%s" company-echo-last-msg)
|
||||
(message ""))))
|
||||
(unless (member last-msg '(nil ""))
|
||||
(message "")))))
|
||||
|
||||
(defun company-echo-show-soon (&optional getter delay)
|
||||
(company-echo-cancel)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
This is company.info, produced by makeinfo version 7.0.1 from
|
||||
This is company.info, produced by makeinfo version 6.8 from
|
||||
company.texi.
|
||||
|
||||
This user manual is for Company version 0.9.14snapshot (12 August 2022).
|
||||
This user manual is for Company version 0.10.0 (16 April 2023).
|
||||
|
||||
Copyright © 2021-2022 Free Software Foundation, Inc.
|
||||
Copyright © 2021-2023 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this
|
||||
document under the terms of the GNU Free Documentation License,
|
||||
@@ -26,9 +26,9 @@ The goal of this document is to lay out the foundational knowledge of
|
||||
the package, so that the readers of the manual could competently start
|
||||
adapting Company to their needs and preferences.
|
||||
|
||||
This user manual is for Company version 0.9.14snapshot (12 August 2022).
|
||||
This user manual is for Company version 0.10.0 (16 April 2023).
|
||||
|
||||
Copyright © 2021-2022 Free Software Foundation, Inc.
|
||||
Copyright © 2021-2023 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this
|
||||
document under the terms of the GNU Free Documentation License,
|
||||
@@ -206,8 +206,8 @@ shown according to the typed characters and the default (until a user
|
||||
specifies otherwise) configurations.
|
||||
|
||||
To have Company always enabled for the following sessions, add the line
|
||||
‘(global-company-mode)’ to the Emacs configuration file
|
||||
(*note (emacs)Init File::).
|
||||
‘(global-company-mode)’ to the Emacs configuration file (*note
|
||||
(emacs)Init File::).
|
||||
|
||||
|
||||
File: company.info, Node: Usage Basics, Next: Commands, Prev: Initial Setup, Up: Getting Started
|
||||
@@ -318,9 +318,9 @@ File: company.info, Node: Customization, Next: Frontends, Prev: Getting Start
|
||||
|
||||
Emacs provides two equally acceptable ways for user preferences
|
||||
configuration: via customization interface (for more details, *note
|
||||
(emacs)Easy Customization::) and a configuration file
|
||||
(*note (emacs)Init File::). Naturally, Company can be configured by
|
||||
both of these approaches.
|
||||
(emacs)Easy Customization::) and a configuration file (*note (emacs)Init
|
||||
File::). Naturally, Company can be configured by both of these
|
||||
approaches.
|
||||
|
||||
* Menu:
|
||||
|
||||
@@ -531,6 +531,14 @@ user options.
|
||||
|
||||
| ||||