<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>GitHub Emacs Lisp Daily Trending</title>
    <description>Daily Trending of Emacs Lisp in GitHub</description>
    <pubDate>Wed, 15 Jul 2026 01:36:04 GMT</pubDate>
    <link>http://mshibanami.github.io/GitHubTrendingRSS</link>
    
    <item>
      <title>dakra/ghostel</title>
      <link>https://github.com/dakra/ghostel</link>
      <description>&lt;p&gt;Terminal emulator powered by libghostty&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;Ghostel&lt;/h1&gt; 
&lt;p&gt;&lt;a href=&quot;https://melpa.org/#/ghostel&quot;&gt;&lt;img src=&quot;https://melpa.org/packages/ghostel-badge.svg?sanitize=true&quot; alt=&quot;MELPA&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://stable.melpa.org/#/ghostel&quot;&gt;&lt;img src=&quot;https://stable.melpa.org/packages/ghostel-badge.svg?sanitize=true&quot; alt=&quot;MELPA Stable&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://github.com/dakra/ghostel/actions/workflows/ci.yml&quot;&gt;&lt;img src=&quot;https://github.com/dakra/ghostel/actions/workflows/ci.yml/badge.svg?sanitize=true&quot; alt=&quot;CI&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://github.com/dakra/ghostel/releases&quot;&gt;&lt;img src=&quot;https://img.shields.io/github/v/release/dakra/ghostel&quot; alt=&quot;Release&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://github.com/dakra/ghostel/raw/main/LICENSE&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/license-GPL--3.0--or--later-blue.svg?sanitize=true&quot; alt=&quot;License: GPL-3.0-or-later&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://ghostty.org/&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/VT%20engine-libghostty--vt-c2a2ff.svg?sanitize=true&quot; alt=&quot;VT engine: libghostty-vt&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Ghostel&lt;/strong&gt; is a terminal emulator for Emacs powered by &lt;a href=&quot;https://ghostty.org/&quot;&gt;libghostty-vt&lt;/a&gt;, the VT engine behind the &lt;a href=&quot;https://ghostty.org/&quot;&gt;Ghostty&lt;/a&gt; terminal.&lt;/p&gt; 
&lt;p&gt;It aims to be featureful, fast, robust and correct.&lt;/p&gt; 
&lt;p&gt;Ghostel&#39;s features include synchronized output, true color, the Kitty keyboard and graphics protocols, hyperlinks, desktop notifications, progress reports and a lot more.&lt;/p&gt; 
&lt;p&gt;Shell integration (directory tracking, prompt navigation) all works out of the box for bash, zsh, fish and nushell.&lt;/p&gt; 
&lt;p&gt;Check the &lt;a href=&quot;https://dakra.github.io/ghostel/#features&quot;&gt;documentation&lt;/a&gt; for a full list of features or how it &lt;a href=&quot;https://dakra.github.io/ghostel/#ghostel-vs-vterm&quot;&gt;compares&lt;/a&gt; to &lt;a href=&quot;https://github.com/akermu/emacs-libvterm&quot;&gt;vterm&lt;/a&gt; or &lt;a href=&quot;https://codeberg.org/akib/emacs-eat&quot;&gt;eat&lt;/a&gt;.&lt;/p&gt; 
&lt;table&gt; 
 &lt;thead&gt; 
  &lt;tr&gt; 
   &lt;th style=&quot;text-align:center&quot;&gt;&lt;/th&gt; 
   &lt;th style=&quot;text-align:center&quot;&gt;&lt;/th&gt; 
  &lt;/tr&gt; 
 &lt;/thead&gt; 
 &lt;tbody&gt; 
  &lt;tr&gt; 
   &lt;td style=&quot;text-align:center&quot;&gt;&lt;img src=&quot;https://raw.githubusercontent.com/dakra/ghostel/main/assets/ghostel-btop.png&quot; alt=&quot;btop running in a Ghostel buffer&quot; /&gt;&lt;/td&gt; 
   &lt;td style=&quot;text-align:center&quot;&gt;&lt;img src=&quot;https://raw.githubusercontent.com/dakra/ghostel/main/assets/ghostel-yazi.png&quot; alt=&quot;yazi previewing an image inside a Ghostel buffer&quot; /&gt;&lt;/td&gt; 
  &lt;/tr&gt; 
  &lt;tr&gt; 
   &lt;td style=&quot;text-align:center&quot;&gt;&lt;code&gt;btop&lt;/code&gt;: true color and full TUI rendering&lt;/td&gt; 
   &lt;td style=&quot;text-align:center&quot;&gt;&lt;code&gt;yazi&lt;/code&gt;: inline image preview via the Kitty graphics&lt;/td&gt; 
  &lt;/tr&gt; 
 &lt;/tbody&gt; 
&lt;/table&gt; 
&lt;h2&gt;Quick Start&lt;/h2&gt; 
&lt;p&gt;&lt;strong&gt;Requirements:&lt;/strong&gt; Emacs 28.1+ with dynamic module support, on macOS, Linux, FreeBSD, or native Windows. The native module is a prebuilt binary that &lt;strong&gt;auto-downloads on first use&lt;/strong&gt;. No toolchain or build step required.&lt;/p&gt; 
&lt;p&gt;Windows release binaries are built for common native Windows Emacs builds on x86_64 and aarch64. Releases include optional ConPTY support files from Microsoft&#39;s redistributable console runtime, which can improve latency and correctness compared with older inbox Windows ConPTY versions.&lt;/p&gt; 
&lt;p&gt;Install from &lt;a href=&quot;https://melpa.org/#/ghostel&quot;&gt;MELPA&lt;/a&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-emacs-lisp&quot;&gt;(use-package ghostel
  :ensure t)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Then &lt;code&gt;M-x ghostel&lt;/code&gt; to open a terminal. That&#39;s it.&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://dakra.github.io/ghostel/#installation&quot;&gt;installation&lt;/a&gt; for different installation instructions.&lt;/p&gt; 
&lt;h2&gt;A fuller example&lt;/h2&gt; 
&lt;p&gt;This example shows more features and how you can add custom keybindings or custom functions that interact with the Ghostel buffer.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-emacs-lisp&quot;&gt;(use-package ghostel
  :bind ((&quot;C-x m&quot; . ghostel)
         :map ghostel-semi-char-mode-map
         (&quot;C-s&quot;  . consult-line)
         (&quot;C-k&quot;  . my/ghostel-send-C-k-and-kill)
         ;; I&#39;m used to go up/down the shell history with M-n/p from eshell
         ;; Simulate this behavior in ghostel by sending C-p and C-n
         (&quot;M-p&quot; . (lambda () (interactive) (ghostel-send-key &quot;p&quot; &quot;ctrl&quot;)))
         (&quot;M-n&quot; . (lambda () (interactive) (ghostel-send-key &quot;n&quot; &quot;ctrl&quot;)))
         :map project-prefix-map
         (&quot;m&quot; . ghostel-project)
         (&quot;M&quot; . ghostel-project-list-buffers))
  :config
  (defun my/ghostel-send-C-k-and-kill ()
    &quot;Send `C-k&#39; to ghostel.
Like normal Emacs `C-k&#39;.  Kill to end of line and put content in kill-ring.&quot;
    (interactive)
    (kill-ring-save (point) (line-end-position))
    (ghostel-send-key &quot;k&quot; &quot;ctrl&quot;))

  (add-to-list &#39;project-switch-commands &#39;(ghostel-project &quot;Ghostel&quot;) t)
  (add-to-list &#39;project-switch-commands &#39;(ghostel-project-list-buffers &quot;Ghostel buffers&quot;) t)
  (add-to-list &#39;ghostel-eval-cmds &#39;(&quot;magit-status-setup-buffer&quot; magit-status-setup-buffer)))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Now you can &lt;code&gt;C-x m&lt;/code&gt; to open a Ghostel buffer, or you can switch to a project (&lt;code&gt;C-x p p&lt;/code&gt;) and then press &lt;code&gt;m&lt;/code&gt; to open a Ghostel buffer in this project. In a project you can press &lt;code&gt;C-x p M&lt;/code&gt; to get a list of Ghostel buffers running in the current project that you can switch to.&lt;/p&gt; 
&lt;h2&gt;Extensions&lt;/h2&gt; 
&lt;p&gt;These ship with the Ghostel package, no separate install necessary. Just enable what you want:&lt;/p&gt; 
&lt;p&gt;Make &lt;code&gt;eshell-visual-commands&lt;/code&gt; run in a Ghostel buffer.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-emacs-lisp&quot;&gt;(use-package ghostel-eshell
  :hook (eshell-load . ghostel-eshell-visual-command-mode))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Run all &lt;code&gt;compile&lt;/code&gt; commands in a Ghostel buffer.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-emacs-lisp&quot;&gt;(use-package ghostel-compile
  :hook (after-init . ghostel-compile-global-mode))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Replace comint&#39;s built-in &lt;code&gt;ansi-color-process-output&lt;/code&gt; with Ghostel&#39;s VT parser.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-emacs-lisp&quot;&gt;(use-package ghostel-comint
  :hook (after-init . ghostel-comint-global-mode))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;If you use an Emacs Lisp input method (e.g. Korean Hangul), add Ghostel support:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-emacs-lisp&quot;&gt;(use-package ghostel-ime
  :hook (ghostel-mode . ghostel-ime-mode))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Evil&lt;/h2&gt; 
&lt;p&gt;If you&#39;re an evil user you can install the &lt;a href=&quot;https://melpa.org/#/evil-ghostel&quot;&gt;evil-ghostel&lt;/a&gt; extension:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-emacs-lisp&quot;&gt;(use-package evil-ghostel
  :after (ghostel evil)
  :hook (ghostel-mode . evil-ghostel-mode))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Shell integration&lt;/h2&gt; 
&lt;p&gt;Directory tracking and prompt navigation are on by default for local bash, zsh, fish or nushell sessions. See &lt;a href=&quot;https://dakra.github.io/ghostel/#shell-integration&quot;&gt;shell integration&lt;/a&gt; for tramp support and more.&lt;/p&gt; 
&lt;p&gt;To call Emacs functions from your shell you have to add them to the &lt;code&gt;ghostel-eval-cmds&lt;/code&gt; whitelist and then add something like this to your bashrc:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;if [[ &quot;$INSIDE_EMACS&quot; = &#39;ghostel&#39; ]]; then
    # Open a file in Emacs from the terminal
    e()   { ghostel_cmd find-file-other-window &quot;$@&quot;; }

    # Open dired in another window
    dow() { ghostel_cmd dired-other-window &quot;$@&quot;; }

    # Open magit for the current directory
    gst() { ghostel_cmd magit-status-setup-buffer &quot;$(pwd)&quot;; }
fi
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Input modes&lt;/h2&gt; 
&lt;p&gt;Ghostel offers five eat.el-style &lt;a href=&quot;https://dakra.github.io/ghostel/#input-modes&quot;&gt;input modes&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;The default is &lt;strong&gt;semi-char mode&lt;/strong&gt; (&lt;code&gt;C-c C-j&lt;/code&gt;), which forwards almost all keys to the terminal besides a few exceptions (e.g. &lt;code&gt;M-x&lt;/code&gt;, &lt;code&gt;C-c&lt;/code&gt;).&lt;/p&gt; 
&lt;p&gt;In &lt;strong&gt;char mode&lt;/strong&gt; (&lt;code&gt;C-c M-d&lt;/code&gt;), &lt;em&gt;all&lt;/em&gt; keys go to the terminal. &lt;code&gt;M-RET&lt;/code&gt; to exit.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;line mode&lt;/strong&gt; (&lt;code&gt;C-c C-l&lt;/code&gt;) is similar to &lt;code&gt;M-x shell&lt;/code&gt; in that Ghostel is like a normal Emacs buffer and &lt;em&gt;no&lt;/em&gt; key gets sent to the terminal. Only after you finish typing a line and press enter, the whole line is sent at once.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;emacs&lt;/strong&gt; (&lt;code&gt;C-c C-e&lt;/code&gt;) and &lt;strong&gt;copy mode&lt;/strong&gt; (&lt;code&gt;C-c C-t&lt;/code&gt;) give you normal Emacs navigation over the read-only terminal buffer so you can look around and copy text. The difference between the two is that &lt;strong&gt;copy mode&lt;/strong&gt; freezes the terminal, so if you have continuous output nothing &quot;scrolls away&quot; while you try to select something. &lt;strong&gt;emacs mode&lt;/strong&gt; is &lt;em&gt;live&lt;/em&gt; so new output keeps coming in while you scroll/select.&lt;/p&gt; 
&lt;p&gt;Those read-only modes have by default &lt;code&gt;ghostel-readonly-fast-exit&lt;/code&gt; set to true, which automatically exits those modes on most keys that you expect to be sent to the terminal. This makes for seamless transitions, e.g. you have some output running and see something you want to copy, you press &lt;code&gt;C-c C-t&lt;/code&gt; and enter &lt;code&gt;copy-mode&lt;/code&gt; navigate like in a normal Emacs buffer and select your text. When you copy something or type any character you&#39;re automatically back in your normal ghostel terminal session. Similarly, some actions automatically activate &lt;strong&gt;copy mode&lt;/strong&gt;, like selecting with the mouse, navigating to hyperlinks (&lt;code&gt;C-c C-p&lt;/code&gt;), activating the mark. In copy mode, mouse selection remains normal Emacs selection even if the terminal app enabled mouse tracking.&lt;/p&gt; 
&lt;h2&gt;Documentation&lt;/h2&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#requirements&quot;&gt;Requirements&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#installation&quot;&gt;Installation&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#building-from-source&quot;&gt;Building from source&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#shell-integration&quot;&gt;Shell Integration&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#input-modes&quot;&gt;Input modes&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#features&quot;&gt;Features&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#tramp-remote-terminals&quot;&gt;TRAMP (Remote Terminals)&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#configuration&quot;&gt;Configuration&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#extensions&quot;&gt;Extensions&lt;/a&gt; 
  &lt;ul&gt; 
   &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#evil-mode&quot;&gt;Evil&lt;/a&gt;&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#compilation-mode&quot;&gt;Compilation mode&lt;/a&gt;&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#eshell-integration&quot;&gt;Eshell integration&lt;/a&gt;&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#comint-integration&quot;&gt;Comint integration&lt;/a&gt;&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#emacs-lisp-input-methods&quot;&gt;Emacs Lisp input methods&lt;/a&gt;&lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#commands&quot;&gt;Commands&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#running-tests&quot;&gt;Running Tests&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#performance&quot;&gt;Performance&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#ghostel-vs-vterm&quot;&gt;Ghostel vs vterm and eat&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#architecture&quot;&gt;Architecture&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#contributing&quot;&gt;Contributing&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/dakra/ghostel/main/CHANGELOG.md&quot;&gt;Changelog&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://dakra.github.io/ghostel/#license&quot;&gt;License&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/137b228e52975cf753f130ed756c643f42a930deeaa2533d09a1134c7afb0b0e/dakra/ghostel" medium="image" />
      
    </item>
    
    <item>
      <title>doomemacs/core</title>
      <link>https://github.com/doomemacs/core</link>
      <description>&lt;p&gt;An Emacs framework for the stubborn martian hacker&lt;/p&gt;&lt;hr&gt;&lt;div align=&quot;center&quot;&gt; 
 &lt;h1&gt;Doom Emacs&lt;/h1&gt; 
 &lt;p&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/#install&quot;&gt;Install&lt;/a&gt; • &lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/index.org&quot;&gt;Documentation&lt;/a&gt; • &lt;a href=&quot;https://github.com/doomemacs/core/raw/master/docs/faq.org&quot;&gt;FAQ&lt;/a&gt; • &lt;a href=&quot;https://github.com/doomemacs/core/tree/screenshots#emacsd-screenshots&quot;&gt;Screenshots&lt;/a&gt; • &lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/#contribute&quot;&gt;Contribute&lt;/a&gt;&lt;/p&gt; 
 &lt;p&gt;&lt;img src=&quot;https://img.shields.io/github/tag/doomemacs/core.svg?style=flat-square&amp;amp;label=release&amp;amp;color=58839b&quot; alt=&quot;Made with Doom Emacs&quot; /&gt; &lt;img src=&quot;https://img.shields.io/badge/Supports-Emacs_27.1%E2%80%9330.2-blueviolet.svg?style=flat-square&amp;amp;logo=GNU%20Emacs&amp;amp;logoColor=white&quot; alt=&quot;Supports Emacs 27.1–30.2&quot; /&gt; &lt;img src=&quot;https://img.shields.io/github/last-commit/doomemacs/core?style=flat-square&quot; alt=&quot;Latest commit&quot; /&gt;&lt;/p&gt; 
 &lt;!-- ![Build status: master](https://img.shields.io/github/workflow/status/doomemacs/core/CI/master?style=flat-square) --&gt; 
 &lt;p&gt;&lt;a href=&quot;https://doomemacs.org/discord&quot;&gt;&lt;img src=&quot;https://img.shields.io/discord/406534637242810369?color=738adb&amp;amp;label=Discord&amp;amp;logo=discord&amp;amp;logoColor=white&amp;amp;style=flat-square&quot; alt=&quot;Discord Server&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://doomemacs.org/discuss&quot;&gt;&lt;img src=&quot;https://img.shields.io/github/discussions/doomemacs/community?label=Discussions&amp;amp;logo=github&amp;amp;style=flat-square&quot; alt=&quot;Discussions board&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
 &lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/doomemacs/core/screenshots/main.png&quot; alt=&quot;Doom Emacs Screenshot&quot; /&gt;&lt;/p&gt; 
&lt;/div&gt; 
&lt;hr /&gt; 
&lt;h3&gt;Table of Contents&lt;/h3&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/#features&quot;&gt;Features&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/#prerequisites&quot;&gt;Prerequisites&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/#install&quot;&gt;Install&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/#roadmap&quot;&gt;Roadmap&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/#getting-help&quot;&gt;Getting help&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/#contribute&quot;&gt;Contribute&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Introduction&lt;/h1&gt; 
&lt;a href=&quot;http://ultravioletbat.deviantart.com/art/Yay-Evil-111710573&quot;&gt; &lt;img src=&quot;https://raw.githubusercontent.com/doomemacs/core/screenshots/cacochan.png&quot; align=&quot;right&quot; /&gt; &lt;/a&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;It is a story as old as time. A stubborn, shell-dwelling, and melodramatic vimmer—envious of the features of modern text editors—spirals into despair before he succumbs to the &lt;a href=&quot;https://github.com/emacs-evil/evil&quot;&gt;dark side&lt;/a&gt;. This is his config.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Doom is a configuration framework for &lt;a href=&quot;https://www.gnu.org/software/emacs/&quot;&gt;GNU Emacs&lt;/a&gt; tailored for Emacs bankruptcy veterans who want less framework in their frameworks, a modicum of stability (and reproducibility) from their package manager, and the performance of a hand rolled config (or better). It can be a foundation for your own config or a resource for Emacs enthusiasts to learn more about our favorite operating system.&lt;/p&gt; 
&lt;p&gt;Its design is guided by these mantras:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;strong&gt;Gotta go fast.&lt;/strong&gt; Startup and run-time performance are priorities. Doom goes beyond by modifying packages to be snappier and load lazier.&lt;/li&gt; 
 &lt;li&gt;&lt;strong&gt;Close to metal.&lt;/strong&gt; There&#39;s less between you and vanilla Emacs by design. That&#39;s less to grok and less to work around when you tinker. Internals ought to be written as if reading them were part of Doom&#39;s UX, and it is!&lt;/li&gt; 
 &lt;li&gt;&lt;strong&gt;Opinionated, but not stubborn.&lt;/strong&gt; Doom is about reasonable defaults and curated opinions, but use as little or as much of it as you like.&lt;/li&gt; 
 &lt;li&gt;&lt;strong&gt;Your system, your rules.&lt;/strong&gt; You know better. At least, Doom hopes so! It won&#39;t &lt;em&gt;automatically&lt;/em&gt; install system dependencies (and will force plugins not to either). Rely on &lt;code&gt;doom doctor&lt;/code&gt; to tell you what&#39;s missing.&lt;/li&gt; 
 &lt;li&gt;&lt;strong&gt;Nix/Guix is a great idea!&lt;/strong&gt; The Emacs ecosystem is temperamental. Things break and they break often. Disaster recovery should be a priority! Doom&#39;s package management should be declarative and your private config reproducible, and comes with a means to roll back releases and updates (still a WIP).&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Check out &lt;a href=&quot;https://github.com/doomemacs/core/raw/master/docs/faq.org&quot;&gt;the FAQ&lt;/a&gt; for answers to common questions about the project.&lt;/p&gt; 
&lt;h1&gt;Features&lt;/h1&gt; 
&lt;ul&gt; 
 &lt;li&gt;Minimalistic good looks inspired by modern editors.&lt;/li&gt; 
 &lt;li&gt;Curated and sane defaults for many packages, (major) OSes, and Emacs itself.&lt;/li&gt; 
 &lt;li&gt;A modular organizational structure for separating concerns in your config.&lt;/li&gt; 
 &lt;li&gt;A standard library designed to simplify your elisp bike shedding.&lt;/li&gt; 
 &lt;li&gt;A declarative &lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/getting_started.org#package-management&quot;&gt;package management system&lt;/a&gt; (powered by &lt;a href=&quot;https://github.com/radian-software/straight.el&quot;&gt;straight.el&lt;/a&gt;) with a command line interface. Install packages from anywhere, not just (M)ELPA, and pin them to any commit.&lt;/li&gt; 
 &lt;li&gt;Optional vim emulation powered by &lt;a href=&quot;https://github.com/emacs-evil/evil&quot;&gt;evil-mode&lt;/a&gt;, including ports of popular vim plugins like &lt;a href=&quot;https://github.com/justinmk/vim-sneak&quot;&gt;vim-sneak&lt;/a&gt;, &lt;a href=&quot;https://github.com/easymotion/vim-easymotion&quot;&gt;vim-easymotion&lt;/a&gt;, &lt;a href=&quot;https://github.com/tpope/vim-unimpaired&quot;&gt;vim-unimpaired&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/modules/editor/evil/README.org#ported-vim-plugins&quot;&gt;more&lt;/a&gt;!&lt;/li&gt; 
 &lt;li&gt;Opt-in LSP integration for many languages, using &lt;a href=&quot;https://github.com/emacs-lsp/lsp-mode&quot;&gt;lsp-mode&lt;/a&gt; or &lt;a href=&quot;https://github.com/joaotavora/eglot&quot;&gt;eglot&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;Support for &lt;em&gt;many&lt;/em&gt; programming languages. Includes syntax highlighting, linters/checker integration, inline code evaluation, code completion (where possible), REPLs, documentation lookups, snippets, and more!&lt;/li&gt; 
 &lt;li&gt;Support for &lt;em&gt;many&lt;/em&gt; tools, like docker, pass, ansible, terraform, and more.&lt;/li&gt; 
 &lt;li&gt;A Spacemacs-esque &lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/modules/config/default/+evil-bindings.el&quot;&gt;keybinding scheme&lt;/a&gt;, centered around leader and localleader prefix keys (&lt;kbd&gt;SPC&lt;/kbd&gt; and &lt;kbd&gt;SPC&lt;/kbd&gt;&lt;kbd&gt;m&lt;/kbd&gt; for evil users, &lt;kbd&gt;C-c&lt;/kbd&gt; and &lt;kbd&gt;C-c l&lt;/kbd&gt; for vanilla users).&lt;/li&gt; 
 &lt;li&gt;A rule-based &lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/modules/ui/popup/README.org&quot;&gt;popup manager&lt;/a&gt; to control how temporary buffers are displayed (and disposed of).&lt;/li&gt; 
 &lt;li&gt;Per-file indentation style detection and &lt;a href=&quot;http://editorconfig.org/&quot;&gt;editorconfig&lt;/a&gt; integration. Let someone else argue about tabs vs &lt;strong&gt;&lt;em&gt;spaces&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt; 
 &lt;li&gt;Project-management tools and framework-specific minor modes with their own snippets libraries.&lt;/li&gt; 
 &lt;li&gt;Project search (and replace) utilities, powered by &lt;a href=&quot;https://github.com/BurntSushi/ripgrep&quot;&gt;ripgrep&lt;/a&gt; and &lt;a href=&quot;https://github.com/abo-abo/swiper&quot;&gt;ivy&lt;/a&gt; or &lt;a href=&quot;https://github.com/emacs-helm/helm&quot;&gt;helm&lt;/a&gt;.&lt;/li&gt; 
 &lt;li&gt;Isolated and persistent workspaces (also substitutes for vim tabs).&lt;/li&gt; 
 &lt;li&gt;Support for Chinese and Japanese input systems.&lt;/li&gt; 
 &lt;li&gt;Save a snapshot of your shell environment to a file for Emacs to load at startup. No more struggling to get Emacs to inherit your &lt;code&gt;PATH&lt;/code&gt;, among other things.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Prerequisites&lt;/h1&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;strong&gt;Required:&lt;/strong&gt; 
  &lt;ul&gt; 
   &lt;li&gt;GNU Emacs 27.1–30.2 (30.2 is recommended) 
    &lt;ul&gt; 
     &lt;li&gt;If only using Doom&#39;s core, 27.1+ is required.&lt;/li&gt; 
     &lt;li&gt;If using Doom&#39;s modules (especially tree-sitter support), 29.1+ is required.&lt;/li&gt; 
    &lt;/ul&gt; &lt;/li&gt; 
   &lt;li&gt;Git &amp;gt;= 2.23&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://github.com/BurntSushi/ripgrep&quot;&gt;ripgrep&lt;/a&gt; &amp;gt;= 11.0&lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;&lt;strong&gt;Optional, but recommended:&lt;/strong&gt; 
  &lt;ul&gt; 
   &lt;li&gt;&lt;a href=&quot;https://github.com/sharkdp/fd&quot;&gt;fd&lt;/a&gt; 7.3.0+ (used to improve file indexing performance)&lt;/li&gt; 
   &lt;li&gt;GNU variants of &lt;code&gt;find&lt;/code&gt;, &lt;code&gt;ls&lt;/code&gt;, and &lt;code&gt;tar&lt;/code&gt; (on MacOS and BSD *nix)&lt;/li&gt; 
   &lt;li&gt;Symbola font (Emacs&#39; fallback font for glyphs it can&#39;t display)&lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;div class=&quot;markdown-alert markdown-alert-warning&quot;&gt;
 &lt;p class=&quot;markdown-alert-title&quot;&gt;
  &lt;svg class=&quot;octicon octicon-alert mr-2&quot; viewbox=&quot;0 0 16 16&quot; version=&quot;1.1&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;
   &lt;path d=&quot;M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z&quot;&gt;&lt;/path&gt;
  &lt;/svg&gt;Warning&lt;/p&gt;
 &lt;p&gt;&lt;strong&gt;Avoid unstable and pre-release builds of Emacs.&lt;/strong&gt; These end in &lt;code&gt;.50&lt;/code&gt;, &lt;code&gt;.60&lt;/code&gt;, or &lt;code&gt;.9X&lt;/code&gt; (e.g. &lt;code&gt;28.1.91&lt;/code&gt;). Doom should generally work on Emacs HEAD (the maintainer dogfoods it), but support lags behind the bleeding edge by at least a month or so.&lt;/p&gt; 
&lt;/div&gt; 
&lt;div class=&quot;markdown-alert markdown-alert-important&quot;&gt;
 &lt;p class=&quot;markdown-alert-title&quot;&gt;
  &lt;svg class=&quot;octicon octicon-report mr-2&quot; viewbox=&quot;0 0 16 16&quot; version=&quot;1.1&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;
   &lt;path d=&quot;M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z&quot;&gt;&lt;/path&gt;
  &lt;/svg&gt;Important&lt;/p&gt;
 &lt;p&gt;Doom is comprised of &lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/modules.org&quot;&gt;~150 optional modules&lt;/a&gt;, some of which may have additional dependencies. &lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/modules.org&quot;&gt;Visit their documentation&lt;/a&gt; or run &lt;code&gt;bin/doom doctor&lt;/code&gt; to check for any that you may have missed.&lt;/p&gt; 
&lt;/div&gt; 
&lt;h1&gt;Install&lt;/h1&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;git clone --depth 1 https://github.com/doomemacs/core ~/.config/emacs
~/.config/emacs/bin/doom install
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Then &lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/getting_started.org&quot;&gt;read our Getting Started guide&lt;/a&gt; to be walked through installing, configuring and maintaining Doom Emacs.&lt;/p&gt; 
&lt;p&gt;It&#39;s a good idea to add &lt;code&gt;~/.config/emacs/bin&lt;/code&gt; to your &lt;code&gt;PATH&lt;/code&gt;! Other &lt;code&gt;bin/doom&lt;/code&gt; commands you should know about:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;doom sync&lt;/code&gt; to synchronize your private config with Doom by installing missing packages, removing orphaned packages, and regenerating caches. Run this whenever you modify your private &lt;code&gt;init.el&lt;/code&gt; or &lt;code&gt;packages.el&lt;/code&gt;, or install/remove an Emacs package through your OS package manager (e.g. mu4e or agda).&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;doom sync --env&lt;/code&gt; to include a snapshot of your shell environment that Doom will load at startup. This allows Emacs to inherit your &lt;code&gt;PATH&lt;/code&gt;, among other things. This replaces &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot;&gt;exec-path-from-shell&lt;/a&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;doom upgrade&lt;/code&gt; to update Doom to the latest release &amp;amp; all installed packages.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;doom doctor&lt;/code&gt; to diagnose common issues with your system and config.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Roadmap&lt;/h1&gt; 
&lt;p&gt;Doom is an active and ongoing project. To make that development more transparent, its roadmap (and other concerns) are published across three github project boards and a newsletter:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://doomemacs.org/roadmap&quot;&gt;Development Roadmap&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://doomemacs.org/packages-under-review&quot;&gt;Packages under review&lt;/a&gt;: lists plugins we are watching and considering for inclusion, and what their status for inclusion is. Please consult this list before requesting new packages/features.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/orgs/doomemacs/projects/7&quot;&gt;Upstream bugs&lt;/a&gt;: lists issues that originate from elsewhere, and whether or not we have local workarounds or temporary fixes for them.&lt;/li&gt; 
 &lt;li&gt;&lt;s&gt;Doom&#39;s newsletter&lt;/s&gt; (not finished) will contain changelogs in between releases.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Getting help&lt;/h1&gt; 
&lt;p&gt;Emacs is no journey of a mere thousand miles. You &lt;em&gt;will&lt;/em&gt; run into problems and mysterious errors. When you do, here are some places you can look for help:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/index.org&quot;&gt;Our documentation&lt;/a&gt; covers many use cases. 
  &lt;ul&gt; 
   &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/getting_started.org#configuring-doom&quot;&gt;The Configuration section&lt;/a&gt; covers how to configure Doom and its packages.&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/getting_started.org#package-management&quot;&gt;The Package Management section&lt;/a&gt; covers how to install and disable packages.&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/getting_started.org#the-bindoom-utility&quot;&gt;This section&lt;/a&gt; explains the &lt;code&gt;bin/doom&lt;/code&gt; script&#39;s most important commands.&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/getting_started.org#common-mistakes-when-configuring-doom-emacs&quot;&gt;This section&lt;/a&gt; lists some common configuration mistakes new users make, when migrating a config from another distro or their own.&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/faq.org#how-do-i-change-the-theme&quot;&gt;This answer&lt;/a&gt; shows you how to add your own themes to your private config.&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/faq.org#how-do-i-change-the-fonts&quot;&gt;This answer&lt;/a&gt; shows you how to change the default font.&lt;/li&gt; 
   &lt;li&gt;Your issue may be documented in the &lt;a href=&quot;https://github.com/doomemacs/core/raw/master/docs/faq.org&quot;&gt;FAQ&lt;/a&gt;.&lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;With Emacs built-in help system documentation is a keystroke away: 
  &lt;ul&gt; 
   &lt;li&gt;For functions: &lt;kbd&gt;SPC h f&lt;/kbd&gt; or &lt;kbd&gt;C-h f&lt;/kbd&gt;&lt;/li&gt; 
   &lt;li&gt;For variables: &lt;kbd&gt;SPC h v&lt;/kbd&gt; or &lt;kbd&gt;C-h v&lt;/kbd&gt;&lt;/li&gt; 
   &lt;li&gt;For a keybind: &lt;kbd&gt;SPC h k&lt;/kbd&gt; or &lt;kbd&gt;C-h k&lt;/kbd&gt;&lt;/li&gt; 
   &lt;li&gt;To search available keybinds: &lt;kbd&gt;SPC h b b&lt;/kbd&gt; or &lt;kbd&gt;C-h b b&lt;/kbd&gt;&lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;Run &lt;code&gt;bin/doom doctor&lt;/code&gt; to detect common issues with your development environment and private config.&lt;/li&gt; 
 &lt;li&gt;Check out the &lt;a href=&quot;https://github.com/doomemacs/core/raw/master/docs/faq.org&quot;&gt;FAQ&lt;/a&gt; or &lt;a href=&quot;https://github.com/doomemacs/community?tab=readme-ov-file#frequently-asked-questions&quot;&gt;Community FAQs&lt;/a&gt;, in case your question has already been answered.&lt;/li&gt; 
 &lt;li&gt;Search &lt;a href=&quot;https://github.com/doomemacs/core/issues&quot;&gt;Doom&#39;s issue tracker&lt;/a&gt; in case your issue was already reported.&lt;/li&gt; 
 &lt;li&gt;Hop on &lt;a href=&quot;https://doomemacs.org/discord&quot;&gt;our Discord server&lt;/a&gt;; it&#39;s active and friendly! Keep an eye on the #announcements channel, where I announce breaking updates and releases.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Contribute&lt;/h1&gt; 
&lt;p&gt;&lt;a href=&quot;http://makeapullrequest.com&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square&quot; alt=&quot;PRs Welcome&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://github.com/bbatsov/emacs-lisp-style-guide&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/elisp-style%20guide-purple?style=flat-square&quot; alt=&quot;Elisp styleguide&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://liberapay.com/hlissner/donate&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/liberapay-donate-1.svg?style=flat-square&amp;amp;logo=liberapay&amp;amp;color=blue&quot; alt=&quot;Donate on liberapay&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://paypal.me/hlissner/10&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/paypal-donate-1?style=flat-square&amp;amp;logo=paypal&amp;amp;color=blue&quot; alt=&quot;Donate on paypal&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;Doom is a labor of love and incurable madness, but I&#39;m only one guy. Doom wouldn&#39;t be where it is today without your help. I welcome contributions of any kind!&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;I ❤️ pull requests and bug reports (see the &lt;a href=&quot;https://raw.githubusercontent.com/doomemacs/core/master/docs/contributing.org&quot;&gt;Contributing Guidelines&lt;/a&gt;)!&lt;/li&gt; 
 &lt;li&gt;Don&#39;t hesitate to &lt;a href=&quot;https://github.com/doomemacs/core/issues/new/choose&quot;&gt;tell me my Elisp-fu sucks&lt;/a&gt;, but please tell me why.&lt;/li&gt; 
 &lt;li&gt;Hop on &lt;a href=&quot;https://doomemacs.org/discord&quot;&gt;our Discord server&lt;/a&gt; and say hi! Help others, hang out or talk to me about Emacs, gamedev, programming, physics, pixel art, anime, gaming -- anything you like. Nourish this lonely soul.&lt;/li&gt; 
 &lt;li&gt;If you&#39;d like to support my work financially, buy me a drink through &lt;a href=&quot;https://liberapay.com/hlissner/donate&quot;&gt;liberapay&lt;/a&gt; or &lt;a href=&quot;https://paypal.me/hlissner/10&quot;&gt;paypal&lt;/a&gt;. My work contends with studies, adventures in indie gamedev and freelance work. Donations help me allocate more time to my Emacs and OSS capers.&lt;/li&gt; 
&lt;/ul&gt;</description>
      
      <media:content url="https://repository-images.githubusercontent.com/21763822/47152a00-a255-11e9-9ca0-37fec3ef82cc" medium="image" />
      
    </item>
    
    <item>
      <title>emacs-mirror/emacs</title>
      <link>https://github.com/emacs-mirror/emacs</link>
      <description>&lt;p&gt;Mirror of GNU Emacs&lt;/p&gt;&lt;hr&gt;&lt;p&gt;Copyright (C) 2001-2026 Free Software Foundation, Inc. See the end of the file for license conditions.&lt;/p&gt; 
&lt;p&gt;This directory tree holds version 32.0.50 of GNU Emacs, the extensible, customizable, self-documenting real-time display editor.&lt;/p&gt; 
&lt;p&gt;The file INSTALL in this directory says how to build and install GNU Emacs on various systems, once you have unpacked or checked out the entire Emacs file tree.&lt;/p&gt; 
&lt;p&gt;See the file etc/NEWS for information on new features and other user-visible changes in recent versions of Emacs.&lt;/p&gt; 
&lt;p&gt;The file etc/PROBLEMS contains information on many common problems that occur in building, installing and running Emacs.&lt;/p&gt; 
&lt;p&gt;The file CONTRIBUTE contains information on contributing to Emacs as a developer.&lt;/p&gt; 
&lt;p&gt;You may encounter bugs in this release. If you do, please report them; your bug reports are valuable contributions to the FSF, since they allow us to notice and fix problems on machines we don&#39;t have, or in code we don&#39;t use often. Please send bug reports to the mailing list &lt;a href=&quot;mailto:bug-gnu-emacs@gnu.org&quot;&gt;bug-gnu-emacs@gnu.org&lt;/a&gt;. If possible, use M-x report-emacs-bug.&lt;/p&gt; 
&lt;p&gt;See the &quot;Bugs&quot; section of the Emacs manual for more information on how to report bugs. (The file &#39;BUGS&#39; in this directory explains how you can find and read that section using the Info files that come with Emacs.) For a list of mailing lists related to Emacs, see &lt;a href=&quot;https://savannah.gnu.org/mail/?group=emacs&quot;&gt;https://savannah.gnu.org/mail/?group=emacs&lt;/a&gt;. For the complete list of GNU mailing lists, see &lt;a href=&quot;https://lists.gnu.org/&quot;&gt;https://lists.gnu.org/&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;The &#39;etc&#39; subdirectory contains several other files, named in capital letters, which you might consider looking at when installing GNU Emacs.&lt;/p&gt; 
&lt;p&gt;The file &#39;configure&#39; is a shell script to acclimate Emacs to the oddities of your processor and operating system. It creates the file &#39;Makefile&#39; (a script for the &#39;make&#39; program), which automates the process of building and installing Emacs. See INSTALL for more detailed information.&lt;/p&gt; 
&lt;p&gt;The file &#39;&lt;a href=&quot;http://configure.ac&quot;&gt;configure.ac&lt;/a&gt;&#39; is the input used by the autoconf program to construct the &#39;configure&#39; script.&lt;/p&gt; 
&lt;p&gt;The shell script &#39;&lt;a href=&quot;http://autogen.sh&quot;&gt;autogen.sh&lt;/a&gt;&#39; generates &#39;configure&#39; and other files by running Autoconf (which in turn uses GNU m4), and configures files in the .git subdirectory if you are using Git. If you want to use it, you will need to install recent versions of these build tools. This should be needed only if you edit files like &#39;&lt;a href=&quot;http://configure.ac&quot;&gt;configure.ac&lt;/a&gt;&#39; that specify Emacs&#39;s autobuild procedure.&lt;/p&gt; 
&lt;p&gt;The file &#39;&lt;a href=&quot;http://Makefile.in&quot;&gt;Makefile.in&lt;/a&gt;&#39; is a template used by &#39;configure&#39; to create &#39;Makefile&#39;.&lt;/p&gt; 
&lt;p&gt;The file &#39;make-dist&#39; is a shell script to build a distribution tar file from the current Emacs tree, containing only those files appropriate for distribution. If you make extensive changes to Emacs, this script will help you distribute your version to others.&lt;/p&gt; 
&lt;p&gt;There are several subdirectories:&lt;/p&gt; 
&lt;p&gt;&#39;src&#39; holds the C code for Emacs (the Emacs Lisp interpreter and its primitives, the redisplay code, and some basic editing functions). &#39;lisp&#39; holds the Emacs Lisp code for Emacs (most everything else). &#39;leim&#39; holds the original source files for the generated files in lisp/leim. These form the library of Emacs input methods, required to type international characters that can&#39;t be directly produced by your keyboard. &#39;lib&#39; holds source code for libraries used by Emacs and its utilities &#39;lib-src&#39; holds the source code for some utility programs for use by or with Emacs, like movemail and etags. &#39;lwlib&#39; holds the sources of the Lucid Widget Library used on X. &#39;oldXMenu&#39; source files from X11R2 XMenu library, used in non-toolkit builds. &#39;etc&#39; holds miscellaneous architecture-independent data files Emacs uses, like the tutorial text and tool bar images. The contents of the &#39;lisp&#39;, &#39;leim&#39;, &#39;info&#39;, and &#39;doc&#39; subdirectories are architecture-independent too. &#39;info&#39; holds the Info documentation tree for Emacs. &#39;doc/emacs&#39; holds the source code for the Emacs Manual. If you modify the manual sources, you will need the &#39;makeinfo&#39; program to produce an updated manual. &#39;makeinfo&#39; is part of the GNU Texinfo package; you need a suitably recent version of Texinfo. &#39;doc/lispref&#39; holds the source code for the Emacs Lisp reference manual. &#39;doc/lispintro&#39; holds the source code for the Introduction to Programming in Emacs Lisp manual. &#39;msdos&#39; holds configuration files for compiling Emacs under MS-DOS. &#39;nextstep&#39; holds instructions and some other files for compiling the Nextstep port of Emacs, for GNUstep and macOS Cocoa. &#39;nt&#39; holds code and documentation for building Emacs on MS-Windows. &#39;test&#39; holds tests for various aspects of Emacs&#39;s functionality. &#39;modules&#39; holds the &lt;a href=&quot;http://modhelp.py&quot;&gt;modhelp.py&lt;/a&gt; helper script. &#39;admin&#39; holds files used by Emacs developers, and Unicode data files. &#39;build-aux&#39; holds auxiliary files used during the build. &#39;m4&#39; holds Autoconf macros used for generating the configure script. &#39;java&#39; holds the Java code for the Emacs port to Android. &#39;cross&#39; holds Makefiles and an additional copy of gnulib used to build Emacs for Android devices. &#39;exec&#39; holds the source code to several helper executables used to run user-installed programs on Android.&lt;/p&gt; 
&lt;p&gt;Building Emacs on non-Posix platforms requires tools that aren&#39;t part of the standard distribution of the OS. The platform-specific README files and installation instructions should list the required tools.&lt;/p&gt; 
&lt;p&gt;NOTE ON COPYRIGHT YEARS&lt;/p&gt; 
&lt;p&gt;In copyright notices where the copyright holder is the Free Software Foundation, then where a range of years appears, this is an inclusive range that applies to every year in the range. For example: 2005-2008 represents the years 2005, 2006, 2007, and 2008.&lt;/p&gt; 
&lt;p&gt;This file is part of GNU Emacs.&lt;/p&gt; 
&lt;p&gt;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.&lt;/p&gt; 
&lt;p&gt;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.&lt;/p&gt; 
&lt;p&gt;You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see &lt;a href=&quot;https://www.gnu.org/licenses/&quot;&gt;https://www.gnu.org/licenses/&lt;/a&gt;.&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/4a3712cc3f73dc6c860375cdbba2696c6faea8f2722963712e87c5bdcbc0a052/emacs-mirror/emacs" medium="image" />
      
    </item>
    
    <item>
      <title>melpa/melpa</title>
      <link>https://github.com/melpa/melpa</link>
      <description>&lt;p&gt;Recipes and build machinery for the biggest Emacs package repo&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;MELPA&lt;/h1&gt; 
&lt;p&gt;&lt;a href=&quot;https://github.com/melpa/melpa/actions/workflows/ci.yml&quot;&gt;&lt;img src=&quot;https://github.com/melpa/melpa/actions/workflows/ci.yml/badge.svg?sanitize=true&quot; alt=&quot;Build Status&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;MELPA is a growing collection of &lt;code&gt;package.el&lt;/code&gt;-compatible Emacs Lisp packages built automatically on our server from the upstream source code using simple recipes. (Think of it as a server-side version of &lt;a href=&quot;https://github.com/dimitri/el-get/&quot;&gt;&lt;code&gt;el-get&lt;/code&gt;&lt;/a&gt;, or even &lt;a href=&quot;https://brew.sh/&quot;&gt;Homebrew&lt;/a&gt;.)&lt;/p&gt; 
&lt;p&gt;Packages are updated at intervals throughout the day.&lt;/p&gt; 
&lt;p&gt;To browse available packages, check out the &lt;a href=&quot;https://melpa.org/&quot;&gt;archive index page&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;Adding packages is as simple as submitting a new recipe as a pull request; read on for details.&lt;/p&gt; 
&lt;h2&gt;Table of Contents&lt;/h2&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/melpa/melpa/master/#usage&quot;&gt;Usage&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/melpa/melpa/master/#contributing&quot;&gt;Contributing&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/melpa/melpa/master/#recipe-format&quot;&gt;Recipe Format&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/melpa/melpa/master/#build-scripts&quot;&gt;Build Scripts&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/melpa/melpa/master/#api&quot;&gt;API&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/melpa/melpa/master/#configuration&quot;&gt;Configuration&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/melpa/melpa/master/#mirrors&quot;&gt;Mirrors&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/melpa/melpa/master/#about&quot;&gt;About&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;Usage&lt;/h2&gt; 
&lt;p&gt;To use the MELPA repository, you&#39;ll need an Emacs with &lt;code&gt;package.el&lt;/code&gt;, i.e., Emacs 24.1 or greater. To test TLS support you can visit a HTTPS URL, for example with &lt;code&gt;M-x eww RET https://wikipedia.org RET&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Enable installation of packages from MELPA by adding an entry to &lt;code&gt;package-archives&lt;/code&gt; after &lt;code&gt;(require &#39;package)&lt;/code&gt; and before the call to &lt;code&gt;package-initialize&lt;/code&gt; in your &lt;code&gt;init.el&lt;/code&gt; or &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(require &#39;package)
(add-to-list &#39;package-archives &#39;(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;) t)
;; Comment/uncomment this line to enable MELPA Stable if desired.
;; See `package-archive-priorities` and `package-pinned-packages`.
;; Most users will not need or want to do this.
;; (add-to-list &#39;package-archives
;;              &#39;(&quot;melpa-stable&quot; . &quot;https://stable.melpa.org/packages/&quot;) t)
(package-initialize)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Then just use &lt;code&gt;M-x package-list-packages&lt;/code&gt; to browse and install packages from MELPA and elsewhere.&lt;/p&gt; 
&lt;p&gt;Note that you&#39;ll need to run &lt;code&gt;M-x package-refresh-contents&lt;/code&gt; or &lt;code&gt;M-x package-list-packages&lt;/code&gt; to ensure that Emacs has fetched the MELPA package list before you can install packages with &lt;code&gt;M-x package-install&lt;/code&gt; or similar.&lt;/p&gt; 
&lt;h3&gt;MELPA Stable&lt;/h3&gt; 
&lt;p&gt;Packages in MELPA are built directly from the latest package source code in the upstream repositories, but we also build and publish packages corresponding to the latest tagged code in those repositories, where version tags exist. These packages are published in a separate package archive called &lt;a href=&quot;https://stable.melpa.org/&quot;&gt;MELPA Stable&lt;/a&gt;. Most users should prefer MELPA over MELPA Stable.&lt;/p&gt; 
&lt;p&gt;Some notes:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;If you leave the original MELPA server in your &lt;code&gt;package-archives&lt;/code&gt; then by default you will get the &lt;em&gt;development&lt;/em&gt; versions of packages and not the stable ones, because the development versions are higher.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;If your Emacs has the variables &lt;code&gt;package-pinned-packages&lt;/code&gt; (available in 24.4 and later) and/or &lt;code&gt;package-archive-priorities&lt;/code&gt;, you can customize or modify those variables as needed.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;You will probably want to remove all packages and then reinstall them. Any packages you already have installed from MELPA will never get &quot;updated&quot; to the stable version because of the way version numbering is handled.&lt;/p&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Note that the MELPA maintainers do not use MELPA Stable themselves, and do not particularly recommend its use.&lt;/p&gt; 
&lt;h2&gt;Contributing&lt;/h2&gt; 
&lt;p&gt;See the &lt;a href=&quot;https://raw.githubusercontent.com/melpa/melpa/master/CONTRIBUTING.org&quot;&gt;CONTRIBUTING.org&lt;/a&gt; document.&lt;/p&gt; 
&lt;h2&gt;Recipe Format&lt;/h2&gt; 
&lt;p&gt;Packages are specified by files in the &lt;code&gt;recipes&lt;/code&gt; directory. You can contribute a new package by adding a new file under &lt;code&gt;recipes&lt;/code&gt; using the following form (&lt;code&gt;[...]&lt;/code&gt; denotes optional or conditional values),&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(&amp;lt;package-name&amp;gt;
 :fetcher [git|github|gitlab|codeberg|sourcehut|hg]
 [:url &quot;&amp;lt;repo url&amp;gt;&quot;]
 [:repo &quot;user-name/repo-name&quot;]
 [:commit &quot;commit&quot;]
 [:branch &quot;branch&quot;]
 [:version-regexp &quot;&amp;lt;regexp&amp;gt;&quot;]
 [:files (&quot;&amp;lt;file1&amp;gt;&quot; ...)]
 [:old-names (&amp;lt;old-name&amp;gt; ...)])
&lt;/code&gt;&lt;/pre&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;package-name&lt;/code&gt; a lisp symbol that has the same name as the package being specified.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;:fetcher&lt;/code&gt; specifies the type of repository the package is being maintained in.&lt;/p&gt; &lt;p&gt;Melpa supports the Git and Mercurial version control systems and provides generic fetcher types for them: &lt;code&gt;git&lt;/code&gt; and &lt;code&gt;hg&lt;/code&gt;. When you use one of these fetchers, you must specify the &lt;code&gt;:url&lt;/code&gt; property.&lt;/p&gt; &lt;p&gt;Melpa also provides dedicated fetchers for certain Git forges (aka &quot;Git repository hosting platforms&quot;), which should always be preferred over the generic &lt;code&gt;git&lt;/code&gt; fetcher. When using a dedicated fetcher, you must specify &lt;code&gt;:repo&lt;/code&gt;, not &lt;code&gt;:url&lt;/code&gt;. Currently these Git forge fetchers exist: &lt;a href=&quot;https://github.com/&quot;&gt;&lt;code&gt;github&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://gitlab.com/&quot;&gt;&lt;code&gt;gitlab&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://codeberg.org/&quot;&gt;&lt;code&gt;codeberg&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://git.sr.ht/&quot;&gt;&lt;code&gt;sourcehut&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;There are no dedicated fetchers for Mercurial. When a forge supports both Git and Mercurial, then the respective fetcher can only be used for Git repositories. For Mercurial repositories always use the &lt;code&gt;hg&lt;/code&gt; fetcher.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;:url&lt;/code&gt; specifies the URL of the version control repository. It is required for the generic &lt;code&gt;git&lt;/code&gt; and &lt;code&gt;hg&lt;/code&gt; fetchers and is invalid for forge-specific fetchers.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;:repo&lt;/code&gt; specifies the repository used by forge-specific fetchers and is of the form &lt;code&gt;user-name/repo-name&lt;/code&gt;. It is required for forge-specific fetchers and is invalid for the generic fetchers.&lt;/p&gt; &lt;p&gt;Note that user names in Sourcehut URLs are prefixed with &lt;code&gt;~&lt;/code&gt;, that has to be omitted in the value of this property.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;:commit&lt;/code&gt; specifies the commit of the Git repository to checkout. The value will be passed to &lt;code&gt;git reset&lt;/code&gt; in a repo where &lt;code&gt;upstream&lt;/code&gt; is the original repository. Can therefore be either a SHA, if pointing at a specific commit, or a full ref prefixed with &quot;origin/&quot;. Only used by the &lt;code&gt;git&lt;/code&gt;-based fetchers.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;:branch&lt;/code&gt; specifies the branch of the Git repository to use. This is like &lt;code&gt;:commit&lt;/code&gt;, but it adds the &quot;origin/&quot; prefix automatically. This must be specified when using a branch other than the default branch.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;:version-regexp&lt;/code&gt; is a regular expression for extracting a version-string from the repository tags. The default matches typical version tags such as &lt;code&gt;1.0&lt;/code&gt;, &lt;code&gt;R16&lt;/code&gt; or &lt;code&gt;v4.3.5&lt;/code&gt;, so you should not override it unless necessary. For an unusual tag like &quot;OTP-18.1.5&quot;, we might add &lt;code&gt;:version-regexp &quot;[^0-9]*\\(.*\\)&quot;&lt;/code&gt; to strip the &quot;OTP-&quot; prefix. The captured portion of the regexp must be parseable by Emacs&#39; &lt;code&gt;version-to-list&lt;/code&gt; function.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;:files&lt;/code&gt; optional property specifying the Emacs Lisp libraries and info files used to build the package. Please do not override this if the default value (below) is adequate, which it should usually be:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;&#39;(&quot;*.el&quot; &quot;lisp/*.el&quot;
  &quot;dir&quot; &quot;*.info&quot; &quot;*.texi&quot; &quot;*.texinfo&quot;
  &quot;doc/dir&quot; &quot;doc/*.info&quot; &quot;doc/*.texi&quot; &quot;doc/*.texinfo&quot;
  &quot;docs/dir&quot; &quot;docs/*.info&quot; &quot;docs/*.texi&quot; &quot;docs/*.texinfo&quot;
  (:exclude
   &quot;.*.el&quot; &quot;lisp/.*.el&quot;
   &quot;test.el&quot; &quot;tests.el&quot; &quot;*-test.el&quot; &quot;*-tests.el&quot;
   &quot;lisp/test.el&quot; &quot;lisp/tests.el&quot; &quot;lisp/*-test.el&quot; &quot;lisp/*-tests.el&quot;))
&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Note that you should place Emacs Lisp libraries in the root of the repository or in the &lt;code&gt;lisp/&lt;/code&gt; directory. Test files should be placed in the &lt;code&gt;test/&lt;/code&gt; directory and they should not provide a feature. Note that all Emacs Lisp files whose name begin with a period are excluded.&lt;/p&gt; &lt;p&gt;No &lt;code&gt;NAME-pkg.el&lt;/code&gt; should be checked into version control. This file is generated from metadata found in the &quot;main library&quot; (&lt;code&gt;NAME.el&lt;/code&gt;). This is true not only for MELPA, but also GNU ELPA and NonGNU ELPA.&lt;/p&gt; &lt;p&gt;Please do not track any third-party libraries and test utilities in your repository. If you absolutely must do it, then place these files in a directory dedicated to that purpose, alongside a file named &lt;code&gt;.nosearch&lt;/code&gt;. The latter prevents various tools from adding the containing directory to the &lt;code&gt;load-path&lt;/code&gt; or from otherwise getting confused.&lt;/p&gt; &lt;p&gt;The elements of the &lt;code&gt;:files&lt;/code&gt; list are glob-expanded to make a list of paths that will be copied into the root of the new package. This means a file like &lt;code&gt;lisp/foo.el&lt;/code&gt; would become &lt;code&gt;foo.el&lt;/code&gt; in the new package. To specify a destination subdirectory, use a list element of the form &lt;code&gt;(TARGET-DIR SOURCE-PATH ...)&lt;/code&gt;.&lt;/p&gt; &lt;p&gt;To exclude certain paths, use &lt;code&gt;(:exclude SOURCE-PATH ...)&lt;/code&gt;. There should only be one element that begins with &lt;code&gt;:exclude&lt;/code&gt; and it should be the last element, though that is not enforced at this time.&lt;/p&gt; &lt;p&gt;If your package requires some additional files, but is otherwise fine with the defaults, use the special element &lt;code&gt;:defaults&lt;/code&gt; as the first element of the &lt;code&gt;:files&lt;/code&gt; list. This causes the default value shown above to be prepended to the specified file list. For example &lt;code&gt;:files (:defaults &quot;snippets&quot;)&lt;/code&gt; would cause the &lt;code&gt;snippets&lt;/code&gt; subdir to be copied in addition to the defaults.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Elements of &lt;code&gt;:files&lt;/code&gt; are (no longer) processed in order because we feed these globs to &lt;code&gt;git log&lt;/code&gt; or &lt;code&gt;hg log&lt;/code&gt; to determine the last commit that touched a relevant file. These commands unfortunately process all exclude globs after all include globs. Therefore it is not possible to override the &lt;code&gt;:exclude&lt;/code&gt; element that appears in &lt;code&gt;:defaults&lt;/code&gt; in a later element of &lt;code&gt;:files&lt;/code&gt;. This means that a package whose name ends with &lt;code&gt;-test&lt;/code&gt; cannot use &lt;code&gt;:defaults&lt;/code&gt;. Likewise if the name of a &lt;em&gt;library&lt;/em&gt; (as opposed to a file implementing tests) ends with &lt;code&gt;-test.el&lt;/code&gt;, then &lt;code&gt;:defaults&lt;/code&gt; cannot be used.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Once the appropriate commit has been determined &lt;code&gt;file-expand-wildcards&lt;/code&gt; is used to determine the files matched by each glob. Unfortunately (unlike in a shell) a glob that begins with &lt;code&gt;*&lt;/code&gt; may also match filenames that begin with &lt;code&gt;.&lt;/code&gt;, so you might have to add exclude globs to prevent those from being included. &lt;code&gt;:defaults&lt;/code&gt; takes care to exclude &lt;code&gt;.dir-locals.el&lt;/code&gt;; if you don&#39;t use &lt;code&gt;:defaults&lt;/code&gt;, then you might have to exclude that explicitly.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;:old-names&lt;/code&gt; specifies former names of the package, if any. The value is a list of symbols.&lt;/p&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Example: Single File Repository&lt;/h3&gt; 
&lt;p&gt;&lt;code&gt;smex&lt;/code&gt; is a repository that contains two files:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;README.markdown&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;smex.el&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Since there is only one &lt;code&gt;.el&lt;/code&gt; file, this package only needs the &lt;code&gt;:fetcher&lt;/code&gt; and &lt;code&gt;:repo&lt;/code&gt; specified,&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(smex :fetcher github :repo &quot;nonsequitur/smex&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h3&gt;Example: Multiple Packages in one Repository&lt;/h3&gt; 
&lt;p&gt;Assume we have a repository containing three libraries &lt;code&gt;mypackage.el&lt;/code&gt;, &lt;code&gt;helm-mypackage.el&lt;/code&gt;, and &lt;code&gt;persp-mypackage.el&lt;/code&gt;. The latter two libraries are optional and users who don&#39;t want to use the packages &lt;code&gt;helm&lt;/code&gt; and/or &lt;code&gt;perspective&lt;/code&gt; should not be forced to install them just so they can install &lt;code&gt;mypackage&lt;/code&gt;. These libraries should therefore be distributed as separate packages.&lt;/p&gt; 
&lt;p&gt;The three packages have to be declared in three separate files &lt;code&gt;recipes/mypackage&lt;/code&gt;, &lt;code&gt;recipes/helm-mypackage&lt;/code&gt;, and &lt;code&gt;recipes/persp-mypackage&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(mypackage
 :fetcher github
 :repo &quot;someuser/mypackage&quot;
 :files (&quot;mypackage.el&quot;))
&lt;/code&gt;&lt;/pre&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(helm-mypackage
 :fetcher github
 :repo &quot;someuser/mypackage&quot;
 :files (&quot;helm-mypackage.el&quot;))
&lt;/code&gt;&lt;/pre&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(persp-mypackage
 :fetcher github
 :repo &quot;someuser/mypackage&quot;
 :files (&quot;persp-mypackage.el&quot;))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h3&gt;Example: Multiple Files in Multiple Directories&lt;/h3&gt; 
&lt;p&gt;There are special cases where creation of the package comes from many different sub-directories in the repository and the destination sub-directories need to be explicitly set.&lt;/p&gt; 
&lt;p&gt;Consider the &lt;code&gt;flymake-perlcritic&lt;/code&gt; recipe,&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(flymake-perlcritic
 :fetcher github
 :repo &quot;illusori/emacs-flymake-perlcritic&quot;
 :files (&quot;*.el&quot; (&quot;bin&quot; &quot;bin/flymake_perlcritic&quot;)))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;which will result in a package structure of,&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;flymake-perlcritic-YYYYMMDD
|-- bin
|   `-- flymake_perlcritic
|-- flymake-perlcritic-pkg.el
`-- flymake-perlcritic.el
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Notice that specifying an entry in &lt;code&gt;:files&lt;/code&gt; that is a list takes the first element to be the destination directory.&lt;/p&gt; 
&lt;p&gt;But a better solution, given that we probably want to copy the &lt;em&gt;entire&lt;/em&gt; &lt;code&gt;snippets&lt;/code&gt; directory to the root of the package, we could just specify that directory. Consider the &lt;code&gt;pony-mode&lt;/code&gt; recipe,&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(pony-mode
 :fetcher github
 :repo &quot;davidmiller/pony-mode&quot;
 :files (&quot;src/*.el&quot; &quot;snippets&quot;))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;which generates the package,&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;pony-mode-YYYYMMDD
|-- pony-mode-pkg.el
|-- pony-mode.el
|-- pony-tpl.el
`-- snippets
    |-- html-mode
    |   |-- bl
    |   |-- ex
    |   |-- for
    |   |-- if
    |   |-- loa
    |   |-- sup
    |   |-- testc
    |   `-- {{
    `-- python-mode
        |-- auth-view
        |-- bn
        |-- model
        |-- modelform
        |-- render-to
        |-- testc
        `-- view
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Build Scripts&lt;/h2&gt; 
&lt;p&gt;Building MELPA is all based around using the &lt;code&gt;Makefile&lt;/code&gt; included in the root repository directory. Described below are the actions that accepted by the &lt;code&gt;Makefile&lt;/code&gt;.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;all&lt;/code&gt; — build all packages under the &lt;code&gt;recipes/&lt;/code&gt; directory and compiles the &lt;code&gt;index.html&lt;/code&gt; file for the &lt;a href=&quot;https://melpa.org/&quot;&gt;MELPA&lt;/a&gt; website.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;recipes/&amp;lt;NAME&amp;gt;&lt;/code&gt; — build individual recipe &lt;code&gt;&amp;lt;NAME&amp;gt;&lt;/code&gt;. Built packages are put in the &lt;code&gt;packages/&lt;/code&gt; folder with version corresponding to the date of the latest commit that modified at least one of the files specified by the recipe; given according to the &lt;code&gt;%Y%m%d&lt;/code&gt; format.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;json&lt;/code&gt; — build all JSON files.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;archive.json&lt;/code&gt; — construct the &lt;code&gt;archive.json&lt;/code&gt; file that will contain a JSON object of all compiled packages.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;recipes.json&lt;/code&gt; — construct the &lt;code&gt;recipes.json&lt;/code&gt; file containing a JSON object of all packages available for building.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;clean&lt;/code&gt; — clean everything.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;html&lt;/code&gt; — build &lt;code&gt;index.html&lt;/code&gt;.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;clean-working&lt;/code&gt; — remove all repositories that have been checked out to the &lt;code&gt;working/&lt;/code&gt; directory.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;clean-packages&lt;/code&gt; — remove all compiled packages from the &lt;code&gt;packages&lt;/code&gt; directory.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;clean-json&lt;/code&gt; — remove all JSON files.&lt;/p&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Note that these scripts require an Emacs with &lt;code&gt;package.el&lt;/code&gt; installed, such as Emacs 24. If you have an older version of Emacs, you can get a suitable &lt;code&gt;package.el&lt;/code&gt; &lt;a href=&quot;https://git.savannah.gnu.org/gitweb/?p=emacs.git;a=blob_plain;hb=ba08b24186711eaeb3748f3d1f23e2c2d9ed0d09;f=lisp/emacs-lisp/package.el&quot;&gt;here&lt;/a&gt;.&lt;/p&gt; 
&lt;h2&gt;API&lt;/h2&gt; 
&lt;p&gt;All repository code is contained in the file &lt;code&gt;package-build/package-build.el&lt;/code&gt;. That code is maintained in a &lt;a href=&quot;https://github.com/melpa/package-build/&quot;&gt;separate repository&lt;/a&gt;: the version in the MELPA repository is imported using &lt;code&gt;git subtree&lt;/code&gt;.&lt;/p&gt; 
&lt;h3&gt;Functions&lt;/h3&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;(package-build-all)&lt;/code&gt; — build packages for all recipes in the directory specified by &lt;code&gt;package-build-recipes-dir&lt;/code&gt;.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;(package-build-archive NAME)&lt;/code&gt; — interactive Emacs Lisp function to build a single archive. NAME is a symbol for the package to be built. Packages are staged in the directory specified by &lt;code&gt;package-build-working-dir&lt;/code&gt; and built packages are placed in the directory specified by &lt;code&gt;package-build-archive-dir&lt;/code&gt;.&lt;/p&gt; &lt;p&gt;Packages are versioned based on the most recent commit date to package files based on commits to upstream package repository.&lt;/p&gt; &lt;p&gt;A file named &lt;code&gt;&amp;lt;NAME&amp;gt;-pkg.el&lt;/code&gt;, which contains &lt;em&gt;description&lt;/em&gt;, &lt;em&gt;version&lt;/em&gt;, and &lt;em&gt;requires&lt;/em&gt; information about the package is automatically generated. The information is extracted from the summary line and headers of &lt;code&gt;&amp;lt;NAME&amp;gt;.el&lt;/code&gt;. For historic reasons, if some of these values cannot be extracted from that file, then Melpa also extracts information from &lt;code&gt;&amp;lt;NAME&amp;gt;-pkg.el&lt;/code&gt; if such a file is tracked in the upstream repository (but this fallback will be removed eventually).&lt;/p&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Variables&lt;/h3&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;package-build-working-dir&lt;/code&gt; — Staging area containing package repositories and package directories being built.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;package-build-archive-dir&lt;/code&gt; — Location to store &lt;code&gt;archive-contents&lt;/code&gt; and any built packages.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;package-build-recipes-dir&lt;/code&gt; — Directory containing MELPA compatible recipes. See &lt;a href=&quot;https://raw.githubusercontent.com/melpa/melpa/master/#recipe-format&quot;&gt;Recipe Format&lt;/a&gt; section for more details.&lt;/p&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;Configuration&lt;/h2&gt; 
&lt;p&gt;Packages end up in the &lt;code&gt;packages/&lt;/code&gt; directory by default. This can be configured using the &lt;code&gt;package-build-archive-dir&lt;/code&gt; variable.&lt;/p&gt; 
&lt;p&gt;Repositories are checked out to the &lt;code&gt;working/&lt;/code&gt; directory by default. This can be configured using the &lt;code&gt;package-build-working-dir&lt;/code&gt; variable.&lt;/p&gt; 
&lt;h2&gt;Mirrors&lt;/h2&gt; 
&lt;p&gt;Official mirrors are available (with many thanks to &lt;a href=&quot;http://mirrorservice.org&quot;&gt;mirrorservice.org&lt;/a&gt;) so that if &lt;a href=&quot;http://melpa.org&quot;&gt;melpa.org&lt;/a&gt; is down, packages can still be installed. The following are the HTTP/HTTPS URLs to use in &lt;code&gt;package-archives&lt;/code&gt; for MELPA and MELPA Stable respectively:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;http://www.mirrorservice.org/sites/melpa.org/packages/&quot;&gt;http://www.mirrorservice.org/sites/melpa.org/packages/&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://www.mirrorservice.org/sites/melpa.org/packages/&quot;&gt;https://www.mirrorservice.org/sites/melpa.org/packages/&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;http://www.mirrorservice.org/sites/stable.melpa.org/packages/&quot;&gt;http://www.mirrorservice.org/sites/stable.melpa.org/packages/&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://www.mirrorservice.org/sites/stable.melpa.org/packages/&quot;&gt;https://www.mirrorservice.org/sites/stable.melpa.org/packages/&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Only the packages are mirrored, not the web site front-end itself.&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;We are NOT responsible for the contents of any UNOFFICIAL mirror of our packages.&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;Use &lt;code&gt;rsync&lt;/code&gt; to get started with your own mirror:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;rsync -avz --delete rsync://melpa.org/packages/ snapshots/
rsync -avz --delete rsync://melpa.org/packages-stable/ releases/
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;About&lt;/h2&gt; 
&lt;p&gt;&lt;em&gt;MELPA&lt;/em&gt; is &lt;em&gt;Milkypostman&#39;s ELPA&lt;/em&gt; or &lt;em&gt;Milkypostman&#39;s Experimental Lisp Package Archive&lt;/em&gt; if you&#39;re not into the whole brevity thing.&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/3f5bc1036b6067fa11378127f6148b3dc516f836bdb8a2cd091f92d5fdc01c76/melpa/melpa" medium="image" />
      
    </item>
    
    <item>
      <title>karthink/gptel</title>
      <link>https://github.com/karthink/gptel</link>
      <description>&lt;p&gt;A simple, extensible LLM client for Emacs&lt;/p&gt;&lt;hr&gt;&lt;p&gt;#+title: gptel: A simple LLM client for Emacs&lt;/p&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://elpa.nongnu.org/nongnu/gptel.html&quot;&gt;https://elpa.nongnu.org/nongnu/gptel.html&lt;/a&gt;][file:&lt;a href=&quot;https://elpa.nongnu.org/nongnu/gptel.svg&quot;&gt;https://elpa.nongnu.org/nongnu/gptel.svg&lt;/a&gt;]] [[&lt;a href=&quot;https://elpa.nongnu.org/nongnu-devel/gptel.html&quot;&gt;https://elpa.nongnu.org/nongnu-devel/gptel.html&lt;/a&gt;][file:&lt;a href=&quot;https://elpa.nongnu.org/nongnu-devel/gptel.svg&quot;&gt;https://elpa.nongnu.org/nongnu-devel/gptel.svg&lt;/a&gt;]] [[&lt;a href=&quot;https://stable.melpa.org/#/gptel&quot;&gt;https://stable.melpa.org/#/gptel&lt;/a&gt;][file:&lt;a href=&quot;https://stable.melpa.org/packages/gptel-badge.svg&quot;&gt;https://stable.melpa.org/packages/gptel-badge.svg&lt;/a&gt;]] [[&lt;a href=&quot;https://melpa.org/#/gptel&quot;&gt;https://melpa.org/#/gptel&lt;/a&gt;][file:&lt;a href=&quot;https://melpa.org/packages/gptel-badge.svg&quot;&gt;https://melpa.org/packages/gptel-badge.svg&lt;/a&gt;]]&lt;/p&gt; 
&lt;p&gt;gptel is a simple Large Language Model chat client for Emacs, with support for multiple models and backends. It works in the spirit of Emacs, available at any time and uniformly in any buffer.&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;General usage&lt;/em&gt;: ([[&lt;a href=&quot;https://www.youtube.com/watch?v=bsRnh_brggM&quot;&gt;https://www.youtube.com/watch?v=bsRnh_brggM&lt;/a&gt;][YouTube Demo]])&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://user-images.githubusercontent.com/8607532/230516812-86510a09-a2fb-4cbd-b53f-cc2522d05a13.mp4&quot;&gt;https://user-images.githubusercontent.com/8607532/230516812-86510a09-a2fb-4cbd-b53f-cc2522d05a13.mp4&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://user-images.githubusercontent.com/8607532/230516816-ae4a613a-4d01-4073-ad3f-b66fa73c6e45.mp4&quot;&gt;https://user-images.githubusercontent.com/8607532/230516816-ae4a613a-4d01-4073-ad3f-b66fa73c6e45.mp4&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;In-place usage&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;p align=&quot;center&quot;&gt; &lt;a href=&quot;https://github.com/user-attachments/assets/cec11aec-52f6-412e-9e7a-9358e8b9b1bf&quot;&gt;https://github.com/user-attachments/assets/cec11aec-52f6-412e-9e7a-9358e8b9b1bf&lt;/a&gt; #+html: &lt;/p&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Tool use&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;p align=&quot;center&quot;&gt; &lt;a href=&quot;https://github.com/user-attachments/assets/5f993659-4cfd-49fa-b5cd-19c55766b9b2&quot;&gt;https://github.com/user-attachments/assets/5f993659-4cfd-49fa-b5cd-19c55766b9b2&lt;/a&gt; #+html: &lt;/p&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;p align=&quot;center&quot;&gt; &lt;a href=&quot;https://github.com/user-attachments/assets/8f57c20b-e1b0-4d86-b972-f46fb90ae1e7&quot;&gt;https://github.com/user-attachments/assets/8f57c20b-e1b0-4d86-b972-f46fb90ae1e7&lt;/a&gt; #+html: &lt;/p&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;See also [[&lt;a href=&quot;https://youtu.be/g1VMGhC5gRU&quot;&gt;https://youtu.be/g1VMGhC5gRU&lt;/a&gt;][this youtube demo (2 minutes)]] by Armin Darvish.&lt;/p&gt; 
&lt;h1&gt;&lt;em&gt;Media support&lt;/em&gt;&lt;/h1&gt; 
&lt;h1&gt;#+html: &lt;p align=&quot;center&quot;&gt;&lt;/p&gt;&lt;/h1&gt; 
&lt;h1&gt;&lt;a href=&quot;https://github.com/user-attachments/assets/1fd947e1-226b-4be2-bc68-7b22b2e3215f&quot;&gt;https://github.com/user-attachments/assets/1fd947e1-226b-4be2-bc68-7b22b2e3215f&lt;/a&gt;&lt;/h1&gt; 
&lt;h1&gt;#+html: &lt;p&gt;&lt;/p&gt;&lt;/h1&gt; 
&lt;h1&gt;&lt;em&gt;Multi-LLM support demo&lt;/em&gt;:&lt;/h1&gt; 
&lt;h1&gt;&lt;a href=&quot;https://github-production-user-asset-6210df.s3.amazonaws.com/8607532/278854024-ae1336c4-5b87-41f2-83e9-e415349d6a43.mp4&quot;&gt;https://github-production-user-asset-6210df.s3.amazonaws.com/8607532/278854024-ae1336c4-5b87-41f2-83e9-e415349d6a43.mp4&lt;/a&gt;&lt;/h1&gt; 
&lt;hr /&gt; 
&lt;ul&gt; 
 &lt;li&gt;Interact with LLMs from anywhere in Emacs (any buffer, shell, minibuffer, wherever).&lt;/li&gt; 
 &lt;li&gt;LLM responses are in Markdown or Org markup.&lt;/li&gt; 
 &lt;li&gt;Supports multiple independent conversations, one-off ad hoc interactions and anything in between.&lt;/li&gt; 
 &lt;li&gt;Supports tool-use to equip LLMs with agentic capabilities.&lt;/li&gt; 
 &lt;li&gt;Supports Model Context Protocol (MCP) integration using [[&lt;a href=&quot;https://github.com/lizqwerscott/mcp.el&quot;&gt;https://github.com/lizqwerscott/mcp.el&lt;/a&gt;][mcp.el]].&lt;/li&gt; 
 &lt;li&gt;Supports multi-modal input (include images, documents).&lt;/li&gt; 
 &lt;li&gt;Supports &quot;reasoning&quot; content in LLM responses.&lt;/li&gt; 
 &lt;li&gt;Save chats as regular Markdown/Org/Text files and resume them later.&lt;/li&gt; 
 &lt;li&gt;Edit your previous prompts or LLM responses when continuing a conversation. These will be fed back to the model.&lt;/li&gt; 
 &lt;li&gt;Supports introspection, so you can see /exactly/ what will be sent. Inspect and modify queries before sending them.&lt;/li&gt; 
 &lt;li&gt;Pause multi-stage requests at an intermediate stage and resume them later.&lt;/li&gt; 
 &lt;li&gt;Don&#39;t like gptel&#39;s workflow? Use it to create your own for any supported model/backend with a [[&lt;a href=&quot;https://github.com/karthink/gptel/wiki/Defining-custom-gptel-commands&quot;&gt;https://github.com/karthink/gptel/wiki/Defining-custom-gptel-commands&lt;/a&gt;][simple API]].&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;gptel uses Curl if available, but falls back to the built-in url-retrieve to work without external dependencies.&lt;/p&gt; 
&lt;p&gt;** Contents :toc:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[#installation][Installation]] 
  &lt;ul&gt; 
   &lt;li&gt;[[#straight][Straight]]&lt;/li&gt; 
   &lt;li&gt;[[#manual][Manual]]&lt;/li&gt; 
   &lt;li&gt;[[#doom-emacs][Doom Emacs]]&lt;/li&gt; 
   &lt;li&gt;[[#spacemacs][Spacemacs]]&lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;[[#setup][Setup]] 
  &lt;ul&gt; 
   &lt;li&gt;[[#openai][OpenAI]]&lt;/li&gt; 
   &lt;li&gt;[[#other-llm-backends][Other LLM backends]] 
    &lt;ul&gt; 
     &lt;li&gt;[[#optional-securing-api-keys-with-authinfo][(Optional) Securing API keys with =authinfo=]]&lt;/li&gt; 
     &lt;li&gt;[[#optional-reading-api-keys-from-environment-variables][(Optional) Reading API keys from environment variables]]&lt;/li&gt; 
     &lt;li&gt;[[#openai-chatgpt-pluspro-subscription][OpenAI (ChatGPT plus/pro subscription)]]&lt;/li&gt; 
     &lt;li&gt;[[#azure][Azure]]&lt;/li&gt; 
     &lt;li&gt;[[#gpt4all][GPT4All]]&lt;/li&gt; 
     &lt;li&gt;[[#ollama][Ollama]]&lt;/li&gt; 
     &lt;li&gt;[[#open-webui][Open WebUI]]&lt;/li&gt; 
     &lt;li&gt;[[#gemini][Gemini]]&lt;/li&gt; 
     &lt;li&gt;[[#llamacpp-or-llamafile][Llama.cpp or Llamafile]]&lt;/li&gt; 
     &lt;li&gt;[[#kagi-fastgpt--summarizer][Kagi (FastGPT &amp;amp; Summarizer)]]&lt;/li&gt; 
     &lt;li&gt;[[#togetherai][&lt;a href=&quot;http://together.ai&quot;&gt;together.ai&lt;/a&gt;]]&lt;/li&gt; 
     &lt;li&gt;[[#anyscale][Anyscale]]&lt;/li&gt; 
     &lt;li&gt;[[#perplexity][Perplexity]]&lt;/li&gt; 
     &lt;li&gt;[[#anthropic-claude][Anthropic (Claude)]]&lt;/li&gt; 
     &lt;li&gt;[[#groq][Groq]]&lt;/li&gt; 
     &lt;li&gt;[[#mistral-le-chat][Mistral Le Chat]]&lt;/li&gt; 
     &lt;li&gt;[[#openrouter][OpenRouter]]&lt;/li&gt; 
     &lt;li&gt;[[#privategpt][PrivateGPT]]&lt;/li&gt; 
     &lt;li&gt;[[#deepseek][DeepSeek]]&lt;/li&gt; 
     &lt;li&gt;[[#sambanova-deepseek][Sambanova (Deepseek)]]&lt;/li&gt; 
     &lt;li&gt;[[#cerebras][Cerebras]]&lt;/li&gt; 
     &lt;li&gt;[[#github-models][Github Models]]&lt;/li&gt; 
     &lt;li&gt;[[#novita-ai][Novita AI]]&lt;/li&gt; 
     &lt;li&gt;[[#xai][xAI]]&lt;/li&gt; 
     &lt;li&gt;[[#aiml-api][AI/ML API]]&lt;/li&gt; 
     &lt;li&gt;[[#github-copilotchat][GitHub CopilotChat]]&lt;/li&gt; 
     &lt;li&gt;[[#aws-bedrock][AWS Bedrock]]&lt;/li&gt; 
     &lt;li&gt;[[#moonshot-kimi][Moonshot (Kimi)]]&lt;/li&gt; 
    &lt;/ul&gt; &lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;[[#usage][Usage]] 
  &lt;ul&gt; 
   &lt;li&gt;[[#in-any-buffer][In any buffer:]]&lt;/li&gt; 
   &lt;li&gt;[[#in-a-dedicated-chat-buffer][In a dedicated chat buffer:]] 
    &lt;ul&gt; 
     &lt;li&gt;[[#including-media-images-documents-or-plain-text-files-with-requests][Including media (images, documents or plain-text files) with requests]]&lt;/li&gt; 
     &lt;li&gt;[[#save-and-restore-your-chat-sessions][Save and restore your chat sessions]]&lt;/li&gt; 
    &lt;/ul&gt; &lt;/li&gt; 
   &lt;li&gt;[[#setting-options-backend-model-request-parameters-system-prompts-and-more][Setting options (backend, model, request parameters, system prompts and more)]]&lt;/li&gt; 
   &lt;li&gt;[[#include-more-context-with-requests][Include more context with requests]]&lt;/li&gt; 
   &lt;li&gt;[[#handle-reasoning-content][Handle &quot;reasoning&quot; content]]&lt;/li&gt; 
   &lt;li&gt;[[#tool-use][Tool use]] 
    &lt;ul&gt; 
     &lt;li&gt;[[#defining-gptel-tools][Defining gptel tools]]&lt;/li&gt; 
     &lt;li&gt;[[#selecting-tools][Selecting tools]]&lt;/li&gt; 
     &lt;li&gt;[[#llm-tool-collections][LLM tool collections]]&lt;/li&gt; 
     &lt;li&gt;[[#model-context-protocol-mcp-integration][Model Context Protocol (MCP) integration]]&lt;/li&gt; 
    &lt;/ul&gt; &lt;/li&gt; 
   &lt;li&gt;[[#rewrite-refactor-or-fill-in-a-region][Rewrite, refactor or fill in a region]]&lt;/li&gt; 
   &lt;li&gt;[[#extra-org-mode-conveniences][Extra Org mode conveniences]]&lt;/li&gt; 
   &lt;li&gt;[[#introspection-examine-debug-or-modify-requests][Introspection (examine, debug or modify requests)]]&lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;[[#faq][FAQ]] 
  &lt;ul&gt; 
   &lt;li&gt;[[#chat-buffer-ui][Chat buffer UI]] 
    &lt;ul&gt; 
     &lt;li&gt;[[#i-want-the-window-to-scroll-automatically-as-the-response-is-inserted][I want the window to scroll automatically as the response is inserted]]&lt;/li&gt; 
     &lt;li&gt;[[#i-want-the-cursor-to-move-to-the-next-prompt-after-the-response-is-inserted][I want the cursor to move to the next prompt after the response is inserted]]&lt;/li&gt; 
     &lt;li&gt;[[#i-want-to-change-the-formatting-of-the-prompt-and-llm-response][I want to change the formatting of the prompt and LLM response]]&lt;/li&gt; 
     &lt;li&gt;[[#how-does-gptel-distinguish-between-user-prompts-and-llm-responses][How does gptel distinguish between user prompts and LLM responses?]]&lt;/li&gt; 
    &lt;/ul&gt; &lt;/li&gt; 
   &lt;li&gt;[[#transient-menu-behavior][Transient menu behavior]] 
    &lt;ul&gt; 
     &lt;li&gt;[[#i-want-to-set-gptel-options-but-only-for-this-buffer][I want to set gptel options but only for this buffer]]&lt;/li&gt; 
     &lt;li&gt;[[#i-want-the-transient-menu-options-to-be-saved-so-i-only-need-to-set-them-once][I want the transient menu options to be saved so I only need to set them once]]&lt;/li&gt; 
     &lt;li&gt;[[#using-the-transient-menu-leaves-behind-extra-windows][Using the transient menu leaves behind extra windows]]&lt;/li&gt; 
     &lt;li&gt;[[#can-i-change-the-transient-menu-key-bindings][Can I change the transient menu key bindings?]]&lt;/li&gt; 
     &lt;li&gt;[[#doom-emacs-sending-a-query-from-the-gptel-menu-fails-because-of-a-key-conflict-with-org-mode][(Doom Emacs) Sending a query from the gptel menu fails because of a key conflict with Org mode]]&lt;/li&gt; 
    &lt;/ul&gt; &lt;/li&gt; 
   &lt;li&gt;[[#miscellaneous][Miscellaneous]] 
    &lt;ul&gt; 
     &lt;li&gt;[[#i-want-to-use-gptel-in-a-way-thats-not-supported-by-gptel-send-or-the-options-menu][I want to use gptel in a way that&#39;s not supported by =gptel-send= or the options menu]]&lt;/li&gt; 
     &lt;li&gt;[[#chatgpt-i-get-the-error-http2-429-you-exceeded-your-current-quota][(ChatGPT) I get the error &quot;(HTTP/2 429) You exceeded your current quota&quot;]]&lt;/li&gt; 
     &lt;li&gt;[[#why-another-llm-client][Why another LLM client?]]&lt;/li&gt; 
    &lt;/ul&gt; &lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;[[#additional-configuration][Additional Configuration]] 
  &lt;ul&gt; 
   &lt;li&gt;[[#option-presets][Option presets]] 
    &lt;ul&gt; 
     &lt;li&gt;[[#applying-presets-to-requests-automatically][Applying presets to requests automatically]]&lt;/li&gt; 
    &lt;/ul&gt; &lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;[[#alternatives][Alternatives]] 
  &lt;ul&gt; 
   &lt;li&gt;[[#packages-using-gptel][Packages using gptel]]&lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;[[#acknowledgments][Acknowledgments]]&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;** Installation&lt;/p&gt; 
&lt;p&gt;Note: gptel requires Transient 0.7.8 or higher. Transient is a built-in package and Emacs does not update it by default. Ensure that =package-install-upgrade-built-in= is true, or update Transient manually.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;em&gt;Release version&lt;/em&gt;: =M-x package-install= ⏎ =gptel= in Emacs.&lt;/li&gt; 
 &lt;li&gt;&lt;em&gt;Development snapshot&lt;/em&gt;: Add MELPA or NonGNU-devel ELPA to your list of package sources, then install with =M-x package-install= ⏎ =gptel=.&lt;/li&gt; 
 &lt;li&gt;&lt;em&gt;Optional:&lt;/em&gt; Install =markdown-mode=.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;details&gt;
 &lt;summary&gt; *** Straight #+html: &lt;/summary&gt; #+begin_src emacs-lisp (straight-use-package &#39;gptel) #+end_src #+html: 
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; *** Manual #+html: &lt;/summary&gt; Note: gptel requires Transient 0.7.8 or higher. Transient is a built-in package and Emacs does not update it by default. Ensure that =package-install-upgrade-built-in= is true, or update Transient manually.
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Clone or download this repository and run =M-x package-install-file⏎= on the repository directory. #+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; *** Doom Emacs #+html: &lt;/summary&gt; In =packages.el=
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (package! gptel :recipe (:nonrecursive t)) #+end_src&lt;/p&gt; 
 &lt;p&gt;In =config.el=&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (use-package! gptel :config (setq! gptel-api-key &quot;your key&quot;)) #+end_src&lt;/p&gt; 
 &lt;p&gt;&quot;your key&quot; can be the API key itself, or (safer) a function that returns the key. Setting =gptel-api-key= is optional, you will be asked for a key if it&#39;s not found.&lt;/p&gt; 
 &lt;p&gt;Alternatively, Doom Emacs provides a built-in =:tools llm= [[&lt;a href=&quot;https://github.com/doomemacs/modules/tree/main/modules/tools/llm&quot;&gt;https://github.com/doomemacs/modules/tree/main/modules/tools/llm&lt;/a&gt;][module]] powered by gptel. Enable it in your =init.el= in the =doom!= block:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (doom! :tools llm) #+end_src&lt;/p&gt; 
 &lt;p&gt;This installs gptel with preconfigured keybindings (=
  &lt;leader&gt;
    o l=), magit integration for generating commit messages (=M-g= in commit buffers), and packages =gptel-quick= and =gptel-magit=. Run =doom/help-modules= (=
   &lt;leader&gt;
     h d m=) and select =:tools llm= for full documentation.
   &lt;/leader&gt;
  &lt;/leader&gt;&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; *** Spacemacs #+html: &lt;/summary&gt; In your =.spacemacs= file, add =llm-client= to =dotspacemacs-configuration-layers=.
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (llm-client :variables llm-client-enable-gptel t) #+end_src #+html: &lt;/p&gt;
&lt;/details&gt; ** Setup
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;gptel supports a number of LLM providers:&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;div align=&quot;center&quot;&gt;
  | LLM Backend | Requires | |----------------------+----------------------------| | OpenAI | [[
 &lt;a href=&quot;https://platform.openai.com/account/api-keys&quot;&gt;https://platform.openai.com/account/api-keys&lt;/a&gt;][API key]] | | OpenAI subscription | ChatGPT plus/pro sub | | Anthropic (Claude) | [[
 &lt;a href=&quot;https://www.anthropic.com/api&quot;&gt;https://www.anthropic.com/api&lt;/a&gt;][API key]] | | Gemini | [[
 &lt;a href=&quot;https://makersuite.google.com/app/apikey&quot;&gt;https://makersuite.google.com/app/apikey&lt;/a&gt;][API key]] | | Ollama | [[
 &lt;a href=&quot;https://ollama.ai/&quot;&gt;https://ollama.ai/&lt;/a&gt;][Ollama running locally]] | | Open WebUI | [[
 &lt;a href=&quot;https://openwebui.com/&quot;&gt;https://openwebui.com/&lt;/a&gt;][Open WebUI running locally]] | | Llama.cpp | [[
 &lt;a href=&quot;https://github.com/ggml-org/llama.cpp/tree/master/tools/server#quick-start&quot;&gt;https://github.com/ggml-org/llama.cpp/tree/master/tools/server#quick-start&lt;/a&gt;][Llama.cpp running locally]] | | Llamafile | [[
 &lt;a href=&quot;https://github.com/Mozilla-Ocho/llamafile#quickstart&quot;&gt;https://github.com/Mozilla-Ocho/llamafile#quickstart&lt;/a&gt;][Local Llamafile server]] | | GPT4All | [[
 &lt;a href=&quot;https://gpt4all.io/index.html&quot;&gt;https://gpt4all.io/index.html&lt;/a&gt;][GPT4All running locally]] | | Kagi FastGPT | [[
 &lt;a href=&quot;https://kagi.com/settings?p=api&quot;&gt;https://kagi.com/settings?p=api&lt;/a&gt;][API key]] | | Kagi Summarizer | [[
 &lt;a href=&quot;https://kagi.com/settings?p=api&quot;&gt;https://kagi.com/settings?p=api&lt;/a&gt;][API key]] | | Azure | Deployment and API key | | Groq | [[
 &lt;a href=&quot;https://console.groq.com/keys&quot;&gt;https://console.groq.com/keys&lt;/a&gt;][API key]] | | Mistral Le Chat | [[
 &lt;a href=&quot;https://console.mistral.ai/api-keys&quot;&gt;https://console.mistral.ai/api-keys&lt;/a&gt;][API key]] | | Perplexity | [[
 &lt;a href=&quot;https://docs.perplexity.ai/docs/getting-started&quot;&gt;https://docs.perplexity.ai/docs/getting-started&lt;/a&gt;][API key]] | | OpenRouter | [[
 &lt;a href=&quot;https://openrouter.ai/keys&quot;&gt;https://openrouter.ai/keys&lt;/a&gt;][API key]] | | AI/ML API | [[
 &lt;a href=&quot;https://aimlapi.com/app/?utm_source=gptel&amp;amp;utm_medium=github&amp;amp;utm_campaign=integration&quot;&gt;https://aimlapi.com/app/?utm_source=gptel&amp;amp;utm_medium=github&amp;amp;utm_campaign=integration&lt;/a&gt;][API key]] | | 
 &lt;a href=&quot;http://together.ai&quot;&gt;together.ai&lt;/a&gt; | [[
 &lt;a href=&quot;https://api.together.xyz/settings/api-keys&quot;&gt;https://api.together.xyz/settings/api-keys&lt;/a&gt;][API key]] | | Anyscale | [[
 &lt;a href=&quot;https://docs.endpoints.anyscale.com/&quot;&gt;https://docs.endpoints.anyscale.com/&lt;/a&gt;][API key]] | | PrivateGPT | [[
 &lt;a href=&quot;https://github.com/zylon-ai/private-gpt#-documentation&quot;&gt;https://github.com/zylon-ai/private-gpt#-documentation&lt;/a&gt;][PrivateGPT running locally]] | | DeepSeek | [[
 &lt;a href=&quot;https://platform.deepseek.com/api_keys&quot;&gt;https://platform.deepseek.com/api_keys&lt;/a&gt;][API key]] | | Sambanova (Deepseek) | [[
 &lt;a href=&quot;https://cloud.sambanova.ai/apis&quot;&gt;https://cloud.sambanova.ai/apis&lt;/a&gt;][API key]] | | Cerebras | [[
 &lt;a href=&quot;https://cloud.cerebras.ai/&quot;&gt;https://cloud.cerebras.ai/&lt;/a&gt;][API key]] | | Github Models | [[
 &lt;a href=&quot;https://github.com/settings/tokens&quot;&gt;https://github.com/settings/tokens&lt;/a&gt;][Token]] | | Novita AI | [[
 &lt;a href=&quot;https://novita.ai/model-api/product/llm-api?utm_source=github_gptel&amp;amp;utm_medium=github_readme&amp;amp;utm_campaign=link&quot;&gt;https://novita.ai/model-api/product/llm-api?utm_source=github_gptel&amp;amp;utm_medium=github_readme&amp;amp;utm_campaign=link&lt;/a&gt;][Token]] | | xAI | [[
 &lt;a href=&quot;https://console.x.ai?utm_source=github_gptel&amp;amp;utm_medium=github_readme&amp;amp;utm_campaign=link&quot;&gt;https://console.x.ai?utm_source=github_gptel&amp;amp;utm_medium=github_readme&amp;amp;utm_campaign=link&lt;/a&gt;][API key]] | | GitHub CopilotChat | GitHub account | | Bedrock | AWS credentials | | Moonshot (Kimi) | API key ([[
 &lt;a href=&quot;https://platform.moonshot.cn/console&quot;&gt;https://platform.moonshot.cn/console&lt;/a&gt;][CN]] or [[
 &lt;a href=&quot;https://platform.moonshot.ai/console&quot;&gt;https://platform.moonshot.ai/console&lt;/a&gt;][Global]]) | #+html: 
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;*** OpenAI Procure an [[&lt;a href=&quot;https://platform.openai.com/account/api-keys&quot;&gt;https://platform.openai.com/account/api-keys&lt;/a&gt;][OpenAI API key]].&lt;/p&gt; 
&lt;p&gt;Optional: Set =gptel-api-key= to the key. Alternatively, you may choose a more secure method such as:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Setting it to a custom function that returns the key.&lt;/li&gt; 
 &lt;li&gt;Leaving it set to the default =gptel-api-key-from-auth-source= function which reads keys from =~/.authinfo=. (See [[#optional-securing-api-keys-with-authinfo][authinfo details]])&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;*** Other LLM backends&lt;/p&gt; 
&lt;p&gt;An OpenAI backend is configured out of the box. If you want to use other LLM backends (like Ollama, Claude/Anthropic or Gemini) you need to register and configure them first.&lt;/p&gt; 
&lt;p&gt;As an example, registering a backend typically looks like the following:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (gptel-make-anthropic &quot;Claude&quot; :stream t :key gptel-api-key) #+end_src&lt;/p&gt; 
&lt;p&gt;Once this backend is registered, you&#39;ll see model names prefixed by &quot;Claude:&quot; appear in gptel&#39;s menu.&lt;/p&gt; 
&lt;p&gt;See below for details on your preferred LLM provider, including local LLMs.&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;details&gt;
 &lt;summary&gt; **** (Optional) Securing API keys with =authinfo= #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;You can use Emacs&#39; built-in support for =authinfo= to store API keys required by gptel. Add your API keys to =~/.authinfo=, and leave =gptel-api-key= set to its default. By default, the API endpoint DNS name (e.g. &quot;&lt;a href=&quot;http://api.openai.com&quot;&gt;api.openai.com&lt;/a&gt;&quot;) is used as HOST and &quot;apikey&quot; as USER.&lt;/p&gt; 
 &lt;p&gt;#+begin_src authinfo machine &lt;a href=&quot;http://api.openai.com&quot;&gt;api.openai.com&lt;/a&gt; login apikey password sk-secret-openai-api-key-goes-here machine &lt;a href=&quot;http://api.anthropic.com&quot;&gt;api.anthropic.com&lt;/a&gt; login apikey password sk-secret-anthropic-api-key-goes-here #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** (Optional) Reading API keys from environment variables #+html: &lt;/summary&gt; Alternatively, you can fetch API keys from variables in Emacs&#39; environment (such as =OPENAI_API_KEY=) using a function like this:
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (defun gptel-api-key-from-environment (&amp;amp;optional var) (lambda () (getenv (or var ;provided key (thread-first ;or fall back to 
  &lt;type&gt;
   _API_KEY (type-of gptel-backend) (symbol-name) (substring 6) (upcase) (concat &quot;_API_KEY&quot;)))))) #+end_src
  &lt;/type&gt;&lt;/p&gt; 
 &lt;p&gt;Then set the =:key= when defining backend to the appropriate environment variable:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-anthropic &quot;My-Claude-backend&quot; :key (gptel-api-key-from-environment &quot;ANTHROPIC_API_KEY&quot;)) #+end_src&lt;/p&gt; 
 &lt;p&gt;If no environment variable is provided:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-gemini &quot;My-Gemini-backend&quot; :key (gptel-api-key-from-environment)) #+end_src&lt;/p&gt; 
 &lt;p&gt;it will try to guess the key from the backend type, /i.e./ try to use =GEMINI_API_KEY= when using the Gemini backend, and so on.&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** OpenAI (ChatGPT plus/pro subscription) #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Includes access to OpenAI Codex models. Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-openai-oauth &quot;OpenAI-sub&quot;) ;Any name of your choosing #+end_src&lt;/p&gt; 
 &lt;p&gt;You will be prompted to log into OpenAI as required. (You can also log in manually with =M-x gptel-openai-oauth-login=.)&lt;/p&gt; 
 &lt;p&gt;If you are using it through a proxy, you can specify the host name, protocol etc:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-openai-oauth &quot;OpenAI-sub&quot; :host &quot;my.openai-proxy.tld&quot; :protocol &quot;http&quot;) #+end_src&lt;/p&gt; 
 &lt;p&gt;Refer to the documentation of =gptel-make-openai-oauth= to set more parameters.&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel. (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (setq gptel-model &#39;gpt-5.4-mini gptel-backend (gptel-make-openai-oauth &quot;OpenAI-sub&quot;)) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Azure #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-azure &quot;Azure-1&quot; ;Name, whatever you&#39;d like :protocol &quot;https&quot; ;Optional -- https is the default :host &quot;YOUR_RESOURCE_NAME.openai.azure.com&quot; :endpoint &quot;/openai/deployments/YOUR_DEPLOYMENT_NAME/chat/completions?api-version=2023-05-15&quot; ;or equivalent :stream t ;Enable streaming responses :key #&#39;gptel-api-key :models &#39;(gpt-3.5-turbo gpt-4)) #+end_src&lt;/p&gt; 
 &lt;p&gt;Refer to the documentation of =gptel-make-azure= to set more parameters.&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel. (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;gpt-3.5-turbo gptel-backend (gptel-make-azure &quot;Azure-1&quot; :protocol &quot;https&quot; :host &quot;YOUR_RESOURCE_NAME.openai.azure.com&quot; :endpoint &quot;/openai/deployments/YOUR_DEPLOYMENT_NAME/chat/completions?api-version=2023-05-15&quot; :stream t :key #&#39;gptel-api-key :models &#39;(gpt-3.5-turbo gpt-4))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** GPT4All #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-gpt4all &quot;GPT4All&quot; ;Name of your choosing :protocol &quot;http&quot; :host &quot;localhost:4891&quot; ;Where it&#39;s running :models &#39;(mistral-7b-openorca.Q4_0.gguf)) ;Available models #+end_src&lt;/p&gt; 
 &lt;p&gt;These are the required parameters, refer to the documentation of =gptel-make-gpt4all= for more.&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above. Additionally you may want to increase the response token size since GPT4All uses very short (often truncated) responses by default.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-max-tokens 500 gptel-model &#39;mistral-7b-openorca.Q4_0.gguf gptel-backend (gptel-make-gpt4all &quot;GPT4All&quot; :protocol &quot;http&quot; :host &quot;localhost:4891&quot; :models &#39;(mistral-7b-openorca.Q4_0.gguf))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Ollama #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with #+begin_src emacs-lisp (gptel-make-ollama &quot;Ollama&quot; ;Any name of your choosing :host &quot;localhost:11434&quot; ;Where it&#39;s running :stream t ;Stream responses :models &#39;(mistral:latest)) ;List of models #+end_src&lt;/p&gt; 
 &lt;p&gt;These are the required parameters, refer to the documentation of =gptel-make-ollama= for more.&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]])&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;mistral:latest gptel-backend (gptel-make-ollama &quot;Ollama&quot; :host &quot;localhost:11434&quot; :stream t :models &#39;(mistral:latest))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;details&gt;
 &lt;summary&gt; **** Open WebUI #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;[[&lt;a href=&quot;https://openwebui.com/&quot;&gt;https://openwebui.com/&lt;/a&gt;][Open WebUI]] is an open source, self-hosted system which provides a multi-user web chat interface and an API endpoint for accessing LLMs, especially LLMs running locally on inference servers like Ollama.&lt;/p&gt; 
 &lt;p&gt;Because it presents an OpenAI-compatible endpoint, you use ~gptel-make-openai~ to register it as a backend.&lt;/p&gt; 
 &lt;p&gt;For instance, you can use this form to register a backend for a local instance of Open Web UI served via http on port 3000:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-openai &quot;OpenWebUI&quot; :host &quot;localhost:3000&quot; :protocol &quot;http&quot; :key &quot;KEY_FOR_ACCESSING_OPENWEBUI&quot; :endpoint &quot;/api/chat/completions&quot; :stream t :models &#39;(&quot;gemma3n:latest&quot;)) #+end_src&lt;/p&gt; 
 &lt;p&gt;Or if you are running Open Web UI on another host on your local network (~box.local~), serving via https with self-signed certificates, this will work:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-openai &quot;OpenWebUI&quot; :host &quot;box.local&quot; :curl-args &#39;(&quot;--insecure&quot;) ; needed for self-signed certs :key &quot;KEY_FOR_ACCESSING_OPENWEBUI&quot; :endpoint &quot;/api/chat/completions&quot; :stream t :models &#39;(&quot;gemma3n:latest&quot;)) #+end_src&lt;/p&gt; 
 &lt;p&gt;To find your API key in Open WebUI, click the user name in the bottom left, Settings, Account, and then Show by API Keys section.&lt;/p&gt; 
 &lt;p&gt;Refer to the documentation of =gptel-make-openai= for more configuration options.&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]])&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &quot;gemma3n:latest&quot; gptel-backend (gptel-make-openai &quot;OpenWebUI&quot; :host &quot;localhost:3000&quot; :protocol &quot;http&quot; :key &quot;KEY_FOR_ACCESSING_OPENWEBUI&quot; :endpoint &quot;/api/chat/completions&quot; :stream t :models &#39;(&quot;gemma3n:latest&quot;))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;details&gt;
 &lt;summary&gt; **** Gemini #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; :key can be a function that returns the API key. (gptel-make-gemini &quot;Gemini&quot; :key &quot;YOUR_GEMINI_API_KEY&quot; :stream t) #+end_src&lt;/p&gt; 
 &lt;p&gt;These are the required parameters, refer to the documentation of =gptel-make-gemini= for more.&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]])&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;gemini-2.5-pro-exp-03-25 gptel-backend (gptel-make-gemini &quot;Gemini&quot; :key &quot;YOUR_GEMINI_API_KEY&quot; :stream t)) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;details&gt;
  #+html: 
 &lt;summary&gt; **** Llama.cpp or Llamafile #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;(If using a llamafile, run a [[&lt;a href=&quot;https://github.com/Mozilla-Ocho/llamafile#other-example-llamafiles&quot;&gt;https://github.com/Mozilla-Ocho/llamafile#other-example-llamafiles&lt;/a&gt;][server llamafile]] instead of a &quot;command-line llamafile&quot;, and a model that supports text generation.)&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; Llama.cpp offers an OpenAI compatible API (gptel-make-openai &quot;llama-cpp&quot; ;Any name :stream t ;Stream responses :protocol &quot;http&quot; :host &quot;localhost:8000&quot; ;Llama.cpp server location :models &#39;(test)) ;Any names, doesn&#39;t matter for Llama #+end_src&lt;/p&gt; 
 &lt;p&gt;These are the required parameters, refer to the documentation of =gptel-make-openai= for more.&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]])&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;test gptel-backend (gptel-make-openai &quot;llama-cpp&quot; :stream t :protocol &quot;http&quot; :host &quot;localhost:8000&quot; :models &#39;(test))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Kagi (FastGPT &amp;amp; Summarizer) #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Kagi&#39;s FastGPT model and the Universal Summarizer are both supported. A couple of notes:&lt;/p&gt; 
 &lt;ol&gt; 
  &lt;li&gt; &lt;p&gt;Universal Summarizer: If there is a URL at point, the summarizer will summarize the contents of the URL. Otherwise the context sent to the model is the same as always: the buffer text upto point, or the contents of the region if the region is active.&lt;/p&gt; &lt;/li&gt; 
  &lt;li&gt; &lt;p&gt;Kagi models do not support multi-turn conversations, interactions are &quot;one-shot&quot;. They also do not support streaming responses.&lt;/p&gt; &lt;/li&gt; 
 &lt;/ol&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-kagi &quot;Kagi&quot; ;any name :key &quot;YOUR_KAGI_API_KEY&quot;) ;can be a function that returns the key #+end_src&lt;/p&gt; 
 &lt;p&gt;These are the required parameters, refer to the documentation of =gptel-make-kagi= for more.&lt;/p&gt; 
 &lt;p&gt;You can pick this backend and the model (fastgpt/summarizer) from the transient menu when using gptel.&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;fastgpt gptel-backend (gptel-make-kagi &quot;Kagi&quot; :key &quot;YOUR_KAGI_API_KEY&quot;)) #+end_src&lt;/p&gt; 
 &lt;p&gt;The alternatives to =fastgpt= include =summarize:cecil=, =summarize:agnes=, =summarize:daphne= and =summarize:muriel=. The difference between the summarizer engines is [[&lt;a href=&quot;https://help.kagi.com/kagi/api/summarizer.html#summarization-engines&quot;&gt;https://help.kagi.com/kagi/api/summarizer.html#summarization-engines&lt;/a&gt;][documented here]].&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** &lt;a href=&quot;http://together.ai&quot;&gt;together.ai&lt;/a&gt; #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; &lt;a href=&quot;http://Together.ai&quot;&gt;Together.ai&lt;/a&gt; offers an OpenAI compatible API (gptel-make-openai &quot;TogetherAI&quot; ;Any name you want :host &quot;api.together.xyz&quot; :key &quot;your-api-key&quot; ;can be a function that returns the key :stream t :models &#39;(;; has many more, check &lt;a href=&quot;http://together.ai&quot;&gt;together.ai&lt;/a&gt; mistralai/Mixtral-8x7B-Instruct-v0.1 codellama/CodeLlama-13b-Instruct-hf codellama/CodeLlama-34b-Instruct-hf)) #+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]])&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;mistralai/Mixtral-8x7B-Instruct-v0.1 gptel-backend (gptel-make-openai &quot;TogetherAI&quot;&lt;br /&gt; :host &quot;api.together.xyz&quot; :key &quot;your-api-key&quot;&lt;br /&gt; :stream t :models &#39;(;; has many more, check &lt;a href=&quot;http://together.ai&quot;&gt;together.ai&lt;/a&gt; mistralai/Mixtral-8x7B-Instruct-v0.1 codellama/CodeLlama-13b-Instruct-hf codellama/CodeLlama-34b-Instruct-hf))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Anyscale #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; Anyscale offers an OpenAI compatible API (gptel-make-openai &quot;Anyscale&quot; ;Any name you want :host &quot;&lt;a href=&quot;http://api.endpoints.anyscale.com&quot;&gt;api.endpoints.anyscale.com&lt;/a&gt;&quot; :key &quot;your-api-key&quot; ;can be a function that returns the key :models &#39;(;; has many more, check anyscale mistralai/Mixtral-8x7B-Instruct-v0.1)) #+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]])&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;mistralai/Mixtral-8x7B-Instruct-v0.1 gptel-backend (gptel-make-openai &quot;Anyscale&quot; :host &quot;&lt;a href=&quot;http://api.endpoints.anyscale.com&quot;&gt;api.endpoints.anyscale.com&lt;/a&gt;&quot; :key &quot;your-api-key&quot; :models &#39;(;; has many more, check anyscale mistralai/Mixtral-8x7B-Instruct-v0.1))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Perplexity #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-perplexity &quot;Perplexity&quot; ;Any name you want :key &quot;your-api-key&quot; ;can be a function that returns the key :stream t) ;If you want responses to be streamed #+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]])&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;sonar gptel-backend (gptel-make-perplexity &quot;Perplexity&quot; :key &quot;your-api-key&quot; :stream t)) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Anthropic (Claude) #+html: &lt;/summary&gt; Register a backend with
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-anthropic &quot;Claude&quot; ;Any name you want :stream t ;Streaming responses :key &quot;your-api-key&quot;) #+end_src The =:key= can be a function that returns the key (more secure).&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;claude-3-sonnet-20240229 ; &quot;claude-3-opus-20240229&quot; also available gptel-backend (gptel-make-anthropic &quot;Claude&quot; :stream t :key &quot;your-api-key&quot;)) #+end_src&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Interim support for Claude 3.7 Sonnet&lt;/p&gt; 
 &lt;p&gt;To use Claude 3.7 Sonnet model in its &quot;thinking&quot; mode, you can define a second Claude backend and select it via the UI or elisp:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-anthropic &quot;Claude-thinking&quot; ;Any name you want :key &quot;your-API-key&quot; :stream t :models &#39;(claude-sonnet-4-20250514 claude-3-7-sonnet-20250219) :request-params &#39;(:thinking (:type &quot;enabled&quot; :budget_tokens 2048) :max_tokens 4096)) #+end_src&lt;/p&gt; 
 &lt;p&gt;You can set the reasoning budget tokens and max tokens for this usage via the =:budget_tokens= and =:max_tokens= keys here, respectively.&lt;/p&gt; 
 &lt;p&gt;You can control whether/how the reasoning output is shown via gptel&#39;s menu or =gptel-include-reasoning=, see [[#handle-reasoning-content][handling reasoning content]].&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Groq #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; Groq offers an OpenAI compatible API (gptel-make-openai &quot;Groq&quot; ;Any name you want :host &quot;&lt;a href=&quot;http://api.groq.com&quot;&gt;api.groq.com&lt;/a&gt;&quot; :endpoint &quot;/openai/v1/chat/completions&quot; :stream t :key &quot;your-api-key&quot; ;can be a function that returns the key :models &#39;(llama-3.3-70b-versatile llama-3.1-8b-instant llama3-70b-8192 llama3-8b-8192 mixtral-8x7b-32768 gemma-7b-it)) #+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]). Note that Groq is fast enough that you could easily set =:stream nil= and still get near-instant responses.&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;mixtral-8x7b-32768 gptel-backend (gptel-make-openai &quot;Groq&quot; :host &quot;&lt;a href=&quot;http://api.groq.com&quot;&gt;api.groq.com&lt;/a&gt;&quot; :endpoint &quot;/openai/v1/chat/completions&quot; :stream t :key &quot;your-api-key&quot; :models &#39;(llama-3.1-70b-versatile llama-3.1-8b-instant llama3-8b-8192 mixtral-8x7b-32768 gemma-7b-it))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Mistral Le Chat #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; Mistral offers an OpenAI compatible API (gptel-make-openai &quot;MistralLeChat&quot; ;Any name you want :host &quot;&lt;a href=&quot;http://api.mistral.ai&quot;&gt;api.mistral.ai&lt;/a&gt;&quot; :endpoint &quot;/v1/chat/completions&quot; :protocol &quot;https&quot; :key &quot;your-api-key&quot; ;can be a function that returns the key :models &#39;(&quot;mistral-small&quot;)) #+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;mistral-small gptel-backend (gptel-make-openai &quot;MistralLeChat&quot; ;Any name you want :host &quot;&lt;a href=&quot;http://api.mistral.ai&quot;&gt;api.mistral.ai&lt;/a&gt;&quot; :endpoint &quot;/v1/chat/completions&quot; :protocol &quot;https&quot; :key &quot;your-api-key&quot; ;can be a function that returns the key :models &#39;(&quot;mistral-small&quot;))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;**** OpenRouter #+html: &lt;/p&gt;&lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OpenRouter offers an OpenAI compatible API (gptel-make-openai &quot;OpenRouter&quot; ;Any name you want :host &quot;&lt;a href=&quot;http://openrouter.ai&quot;&gt;openrouter.ai&lt;/a&gt;&quot; :endpoint &quot;/api/v1/chat/completions&quot; :stream t :key &quot;your-api-key&quot; ;can be a function that returns the key :models &#39;(openai/gpt-3.5-turbo mistralai/mixtral-8x7b-instruct meta-llama/codellama-34b-instruct codellama/codellama-70b-instruct google/palm-2-codechat-bison-32k google/gemini-pro))&lt;/p&gt; 
 &lt;p&gt;#+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;mixtral-8x7b-32768 gptel-backend (gptel-make-openai &quot;OpenRouter&quot; ;Any name you want :host &quot;&lt;a href=&quot;http://openrouter.ai&quot;&gt;openrouter.ai&lt;/a&gt;&quot; :endpoint &quot;/api/v1/chat/completions&quot; :stream t :key &quot;your-api-key&quot; ;can be a function that returns the key :models &#39;(openai/gpt-3.5-turbo mistralai/mixtral-8x7b-instruct meta-llama/codellama-34b-instruct codellama/codellama-70b-instruct google/palm-2-codechat-bison-32k google/gemini-pro)))&lt;/p&gt; 
 &lt;p&gt;#+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** PrivateGPT #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-privategpt &quot;privateGPT&quot; ;Any name you want :protocol &quot;http&quot; :host &quot;localhost:8001&quot; :stream t :context t ;Use context provided by embeddings :sources t ;Return information about source documents :models &#39;(private-gpt))&lt;/p&gt; 
 &lt;p&gt;#+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;private-gpt gptel-backend (gptel-make-privategpt &quot;privateGPT&quot; ;Any name you want :protocol &quot;http&quot; :host &quot;localhost:8001&quot; :stream t :context t ;Use context provided by embeddings :sources t ;Return information about source documents :models &#39;(private-gpt)))&lt;/p&gt; 
 &lt;p&gt;#+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** DeepSeek #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-deepseek &quot;DeepSeek&quot; ;Any name you want :stream t ;for streaming responses :key &quot;your-api-key&quot;) ;can be a function that returns the key #+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;deepseek-reasoner gptel-backend (gptel-make-deepseek &quot;DeepSeek&quot; :stream t :key &quot;your-api-key&quot;)) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;**** Sambanova (Deepseek) #+html: &lt;/p&gt;&lt;/summary&gt; Sambanova offers various LLMs through their Samba Nova Cloud offering, with Deepseek-R1 being one of them. The token speed for Deepseek R1 via Sambanova is about 6 times faster than when accessed through 
 &lt;a href=&quot;http://deepseek.com&quot;&gt;deepseek.com&lt;/a&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-openai &quot;Sambanova&quot; ;Any name you want :host &quot;&lt;a href=&quot;http://api.sambanova.ai&quot;&gt;api.sambanova.ai&lt;/a&gt;&quot; :endpoint &quot;/v1/chat/completions&quot; :stream t ;for streaming responses :key &quot;your-api-key&quot; ;can be a function that returns the key :models &#39;(DeepSeek-R1)) #+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend The code aboves makes the backend available for selection. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Add these two lines to your configuration:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;DeepSeek-R1) (setq gptel-backend (gptel-get-backend &quot;Sambanova&quot;)) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;**** Cerebras #+html: &lt;/p&gt;&lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; Cerebras offers an instant OpenAI compatible API (gptel-make-openai &quot;Cerebras&quot; :host &quot;&lt;a href=&quot;http://api.cerebras.ai&quot;&gt;api.cerebras.ai&lt;/a&gt;&quot; :endpoint &quot;/v1/chat/completions&quot; :stream t ;optionally nil as Cerebras is instant AI :key &quot;your-api-key&quot; ;can be a function that returns the key :models &#39;(llama3.1-70b llama3.1-8b)) #+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;llama3.1-8b gptel-backend (gptel-make-openai &quot;Cerebras&quot; :host &quot;&lt;a href=&quot;http://api.cerebras.ai&quot;&gt;api.cerebras.ai&lt;/a&gt;&quot; :endpoint &quot;/v1/chat/completions&quot; :stream nil :key &quot;your-api-key&quot; :models &#39;(llama3.1-70b llama3.1-8b))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Github Models #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;NOTE: [[&lt;a href=&quot;https://docs.github.com/en/github-models/about-github-models&quot;&gt;https://docs.github.com/en/github-models/about-github-models&lt;/a&gt;][GitHub Models]] is /not/ GitHub Copilot! If you want to use GitHub Copilot chat via gptel, look at the instructions for GitHub CopilotChat below instead.&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; Github Models offers an OpenAI compatible API (gptel-make-openai &quot;Github Models&quot; ;Any name you want :host &quot;&lt;a href=&quot;http://models.inference.ai.azure.com&quot;&gt;models.inference.ai.azure.com&lt;/a&gt;&quot; :endpoint &quot;/chat/completions?api-version=2024-05-01-preview&quot; :stream t :key &quot;your-github-token&quot; :models &#39;(gpt-4o)) #+end_src&lt;/p&gt; 
 &lt;p&gt;You will need to create a github [[&lt;a href=&quot;https://github.com/settings/personal-access-tokens&quot;&gt;https://github.com/settings/personal-access-tokens&lt;/a&gt;][token]].&lt;/p&gt; 
 &lt;p&gt;For all the available models, check the [[&lt;a href=&quot;https://github.com/marketplace/models&quot;&gt;https://github.com/marketplace/models&lt;/a&gt;][marketplace]].&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;gpt-4o gptel-backend (gptel-make-openai &quot;Github Models&quot; ;Any name you want :host &quot;&lt;a href=&quot;http://models.inference.ai.azure.com&quot;&gt;models.inference.ai.azure.com&lt;/a&gt;&quot; :endpoint &quot;/chat/completions?api-version=2024-05-01-preview&quot; :stream t :key &quot;your-github-token&quot; :models &#39;(gpt-4o)) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Novita AI #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; Novita AI offers an OpenAI compatible API (gptel-make-openai &quot;NovitaAI&quot; ;Any name you want :host &quot;&lt;a href=&quot;http://api.novita.ai&quot;&gt;api.novita.ai&lt;/a&gt;&quot; :endpoint &quot;/v3/openai&quot; :key &quot;your-api-key&quot; ;can be a function that returns the key :stream t :models &#39;(;; has many more, check &lt;a href=&quot;https://novita.ai/llm-api&quot;&gt;https://novita.ai/llm-api&lt;/a&gt; gryphe/mythomax-l2-13b meta-llama/llama-3-70b-instruct meta-llama/llama-3.1-70b-instruct)) #+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]])&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;gryphe/mythomax-l2-13b gptel-backend (gptel-make-openai &quot;NovitaAI&quot;&lt;br /&gt; :host &quot;&lt;a href=&quot;http://api.novita.ai&quot;&gt;api.novita.ai&lt;/a&gt;&quot; :endpoint &quot;/v3/openai&quot; :key &quot;your-api-key&quot;&lt;br /&gt; :stream t :models &#39;(;; has many more, check &lt;a href=&quot;https://novita.ai/llm-api&quot;&gt;https://novita.ai/llm-api&lt;/a&gt; mistralai/Mixtral-8x7B-Instruct-v0.1 meta-llama/llama-3-70b-instruct meta-llama/llama-3.1-70b-instruct))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** xAI #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-xai &quot;xAI&quot; ; Any name you want :stream t :key &quot;your-api-key&quot;) ; can be a function that returns the key #+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]])&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (setq gptel-model &#39;grok-3-latest gptel-backend (gptel-make-xai &quot;xAI&quot; ; Any name you want :key &quot;your-api-key&quot; ; can be a function that returns the key :stream t)) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** AI/ML API #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;AI/ML API provides 300+ AI models including Deepseek, Gemini, ChatGPT. The models run at enterprise-grade rate limits and uptimes.&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; AI/ML API offers an OpenAI compatible API (gptel-make-openai &quot;AI/ML API&quot; ;Any name you want :host &quot;&lt;a href=&quot;http://api.aimlapi.com&quot;&gt;api.aimlapi.com&lt;/a&gt;&quot; :endpoint &quot;/v1/chat/completions&quot; :stream t :key &quot;your-api-key&quot; ;can be a function that returns the key :models &#39;(deepseek-chat gemini-pro gpt-4o)) #+end_src&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;gpt-4o gptel-backend (gptel-make-openai &quot;AI/ML API&quot; :host &quot;&lt;a href=&quot;http://api.aimlapi.com&quot;&gt;api.aimlapi.com&lt;/a&gt;&quot; :endpoint &quot;/v1/chat/completions&quot; :stream t :key &quot;your-api-key&quot; :models &#39;(deepseek-chat gemini-pro gpt-4o))) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** GitHub CopilotChat #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-gh-copilot &quot;Copilot&quot;) #+end_src&lt;/p&gt; 
 &lt;p&gt;Github copilot is configured to use the public endpoint =api.githubcopilot.com=. Depending on your plan, you may need to use a different host (see [[&lt;a href=&quot;https://github.blog/changelog/2026-02-13-network-configuration-changes-for-copilot-coding-agent/#whats-changing&quot;&gt;https://github.blog/changelog/2026-02-13-network-configuration-changes-for-copilot-coding-agent/#whats-changing&lt;/a&gt;][Copilot plan changes]]):&lt;/p&gt; 
 &lt;ul&gt; 
  &lt;li&gt;Copilot Business: =api.business.githubcopilot.com=&lt;/li&gt; 
  &lt;li&gt;Copilot Enterprise: =api.enterprise.githubcopilot.com=&lt;/li&gt; 
  &lt;li&gt;Copilot Pro and Pro+: =api.individual.githubcopilot.com=&lt;/li&gt; 
 &lt;/ul&gt; 
 &lt;p&gt;You can do this as follows: #+begin_src emacs-lisp (gptel-make-gh-copilot &quot;Copilot&quot; :host &quot;&lt;a href=&quot;http://api.business.githubcopilot.com&quot;&gt;api.business.githubcopilot.com&lt;/a&gt;&quot;) #+end_src&lt;/p&gt; 
 &lt;p&gt;You will be informed to login into =GitHub= as required. (You can also log in manually with =M-x gptel-gh-login=.)&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;claude-3.7-sonnet gptel-backend (gptel-make-gh-copilot &quot;Copilot&quot;)) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** AWS Bedrock #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-bedrock &quot;AWS&quot; ;; optionally enable streaming :stream t :region &quot;ap-northeast-1&quot; ;; subset of gptel--bedrock-models :models &#39;(claude-sonnet-4-20250514) ;; Model region for cross-region inference profiles. Required for models such ;; as Claude without on-demand throughput support. One of &#39;apac, &#39;eu or &#39;us. ;; &lt;a href=&quot;https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-use.html&quot;&gt;https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-use.html&lt;/a&gt; :model-region &#39;apac) #+end_src&lt;/p&gt; 
 &lt;p&gt;AWS has numerous credential provisions; we follow this order precedence,&lt;/p&gt; 
 &lt;ul&gt; 
  &lt;li&gt;(argument) ~:aws-bearer-token~&lt;/li&gt; 
  &lt;li&gt;(env. variable) ~AWS_BEARER_TOKEN_BEDROCK~&lt;/li&gt; 
  &lt;li&gt;(argument) ~:aws-profile~ If this option is specified, the Bedrock-backend uses the shared AWS config and credentials files to obtain credentials based on the AWS Profile selected. If ~:aws-profile~ is set to the keyword ~:static~, the IAM credentials are imported without a profile argument.&lt;/li&gt; 
  &lt;li&gt;(env. varible) ~AWS_PROFILE~&lt;/li&gt; 
  &lt;li&gt;(env. varible) ~AWS_ACCESS_KEY_ID~, ~AWS_SECRET_ACCESS_KEY~ and ~AWS_SESSION_TOKEN~&lt;/li&gt; 
 &lt;/ul&gt; 
 &lt;p&gt;&lt;em&gt;NOTE:&lt;/em&gt; The Bedrock backend requires ~gptel-use-curl~ to be set to ~t~. When authenticating with an AWS profile or IAM credentials, =curl= computes a SigV4 signature and version 8.10 or newer is required (see [[&lt;a href=&quot;https://github.com/curl/curl/issues/11794&quot;&gt;https://github.com/curl/curl/issues/11794&lt;/a&gt;][curl issue #11794]]). Bearer token authentication does not have this requirement.&lt;/p&gt; 
 &lt;p&gt;You can pick this backend from the menu when using gptel (see [[#usage][Usage]]).&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Set as the default gptel backend&lt;/p&gt; 
 &lt;p&gt;The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; OPTIONAL configuration (setq gptel-model &#39;claude-sonnet-4-20250514 gptel-backend (gptel-make-bedrock &quot;AWS&quot; ;; optionally enable streaming :stream t ;; optionally specify the aws profile ;; :profile :region &quot;ap-northeast-1&quot; ;; subset of gptel--bedrock-models :models &#39;(claude-sonnet-4-20250514) ;; Model region for cross-region inference profiles. Required for models such ;; as Claude without on-demand throughput support. One of &#39;apac, &#39;eu or &#39;us. ;; &lt;a href=&quot;https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-use.html&quot;&gt;https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-use.html&lt;/a&gt; :model-region &#39;apac)) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Moonshot (Kimi) #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Register a backend with&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-openai &quot;Moonshot&quot; :host &quot;&lt;a href=&quot;http://api.moonshot.cn&quot;&gt;api.moonshot.cn&lt;/a&gt;&quot; ;; or &quot;&lt;a href=&quot;http://api.moonshot.ai&quot;&gt;api.moonshot.ai&lt;/a&gt;&quot; for the global site :key &quot;your-api-key&quot; :stream t ;; optionally enable streaming :models &#39;(kimi-latest kimi-k2-0711-preview)) #+end_src&lt;/p&gt; 
 &lt;p&gt;See [[&lt;a href=&quot;https://platform.moonshot.ai/docs/pricing/chat&quot;&gt;https://platform.moonshot.ai/docs/pricing/chat&lt;/a&gt;][&lt;a href=&quot;http://Moonshot.ai&quot;&gt;Moonshot.ai&lt;/a&gt; document]] for a complete list of models.&lt;/p&gt; 
 &lt;p&gt;***** (Optional) Use the builtin search tool&lt;/p&gt; 
 &lt;p&gt;Moonshot supports a builtin search tool that does not requires the user to provide the tool implementation. To use that, you first need to define the tool and add to =gptel-tools= (while it does not requires the client to provide the search implementation, it does expects the client to reply a tool call message with its given argument, to be consistent with other tool calls):&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (setq gptel-tools (list (gptel-make-tool :name &quot;$web_search&quot; :function (lambda (&amp;amp;optional search_result) (json-serialize `(:search_result ,search_result))) :description &quot;Moonshot builtin web search. Only usable by moonshot model (kimi), ignore this if you are not.&quot; :args &#39;((:name &quot;search_result&quot; :type object :optional t)) :category &quot;web&quot;))) #+end_src&lt;/p&gt; 
 &lt;p&gt;Then you also need to add the tool declaration via =:request-params= because it needs a special =builtin_function= type:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-openai &quot;Moonshot&quot; :host &quot;&lt;a href=&quot;http://api.moonshot.cn&quot;&gt;api.moonshot.cn&lt;/a&gt;&quot; ;; or &quot;&lt;a href=&quot;http://api.moonshot.ai&quot;&gt;api.moonshot.ai&lt;/a&gt;&quot; for the global site :key &quot;your-api-key&quot; :stream t ;; optionally enable streaming :models &#39;(kimi-latest kimi-k2-0711-preview) :request-params &#39;(:tools [(:type &quot;builtin_function&quot; :function (:name &quot;$web_search&quot;))])) #+end_src&lt;/p&gt; 
 &lt;p&gt;Now the chat should be able to automatically use search. Try &quot;what&#39;s new today&quot; and you should expect the up-to-date news in response.&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; ** Usage
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;gptel provides a few powerful, general purpose and flexible commands. You can dynamically tweak their behavior to the needs of your task with /directives/ (system prompts), redirection options and more. There is a [[&lt;a href=&quot;https://www.youtube.com/watch?v=bsRnh_brggM&quot;&gt;https://www.youtube.com/watch?v=bsRnh_brggM&lt;/a&gt;][video demo]] showing various uses of gptel -- but =gptel-send= might be all you need.&lt;/p&gt; 
&lt;p&gt;|-------------------+---------------------------------------------------------------------------------------------------| | &lt;em&gt;To send queries&lt;/em&gt; | Description | |-------------------+---------------------------------------------------------------------------------------------------| | =gptel-send= | Send all text up to =(point)=, or the selection if region is active. Works anywhere in Emacs. | | =gptel= | Create a new dedicated chat buffer. Not required to use gptel. | | =gptel-rewrite= | Rewrite, refactor or change the selected region. Can diff/ediff changes before merging/applying. | |-------------------+---------------------------------------------------------------------------------------------------|&lt;/p&gt; 
&lt;p&gt;|---------------------+---------------------------------------------------------------| | &lt;em&gt;To tweak behavior&lt;/em&gt; | | |---------------------+---------------------------------------------------------------| | =C-u= =gptel-send= | Transient menu for preferences, input/output redirection etc. | | =gptel-menu= | /(Same)/ | |---------------------+---------------------------------------------------------------|&lt;/p&gt; 
&lt;p&gt;|------------------+--------------------------------------------------------------------------------------------------------| | &lt;em&gt;To add context&lt;/em&gt; | | |------------------+--------------------------------------------------------------------------------------------------------| | =gptel-add= | Add/remove a region or buffer to gptel&#39;s context. In Dired, add/remove marked files. | | =gptel-add-file= | Add a file (text or supported media type) to gptel&#39;s context. Also available from the transient menu. | |------------------+--------------------------------------------------------------------------------------------------------|&lt;/p&gt; 
&lt;p&gt;|----------------------------+-----------------------------------------------------------------------------------------| | &lt;em&gt;Org mode bonuses&lt;/em&gt; | | |----------------------------+-----------------------------------------------------------------------------------------| | =gptel-org-set-topic= | Limit conversation context to an Org heading. (For branching conversations see below.) | | =gptel-org-set-properties= | Write gptel configuration as Org properties, for per-heading chat configuration. | |----------------------------+-----------------------------------------------------------------------------------------|&lt;/p&gt; 
&lt;p&gt;|----------------------------+-------------------------------------------------------------------------------------------| | &lt;em&gt;Oauth connections&lt;/em&gt; | | |----------------------------+-------------------------------------------------------------------------------------------| | =gptel-gh-login= | Authenticate with GitHub Copilot. (Automatically handled, but can be forced if required.) | | =gptel-openai-oauth-login= | Authenticate with OpenAI (Codex). (Automatically handled, but can be forced if required.) | |----------------------------+-------------------------------------------------------------------------------------------|&lt;/p&gt; 
&lt;p&gt;*** In any buffer:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt; &lt;p&gt;Call =M-x gptel-send= to send the text up to the cursor. The response will be inserted below. Continue the conversation by typing below the response.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;If a region is selected, the conversation will be limited to its contents.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Call =M-x gptel-send= with a prefix argument (~C-u~)&lt;/p&gt; 
  &lt;ul&gt; 
   &lt;li&gt;to set chat parameters (model, backend, system message etc) for this buffer,&lt;/li&gt; 
   &lt;li&gt;include quick instructions for the next request only,&lt;/li&gt; 
   &lt;li&gt;to add additional context -- regions, buffers or files -- to gptel,&lt;/li&gt; 
   &lt;li&gt;to read the prompt from or redirect the response elsewhere,&lt;/li&gt; 
   &lt;li&gt;or to replace the prompt with the response.&lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;#+html: &lt;img src=&quot;https://github.com/karthink/gptel/assets/8607532/3562a6e2-7a5c-4f7e-8e57-bf3c11589c73&quot; align=&quot;center&quot; alt=&quot;Image showing gptel&#39;s menu with some of the available query options.&quot; /&gt;&lt;/p&gt; 
&lt;hr /&gt; 
&lt;p&gt;You can use =gptel-highlight-mode= to highlight LLM responses in different ways:&lt;/p&gt; 
&lt;p&gt;#+html: &lt;img width=&quot;1226&quot; height=&quot;764&quot; alt=&quot;Image&quot; src=&quot;https://github.com/user-attachments/assets/1a3d5411-3cbc-41cf-b9fa-5089a1ffa096&quot; /&gt;&lt;/p&gt; 
&lt;p&gt;You can also define a &quot;preset&quot; bundle of options that are applied together, see [[#option-presets][Option presets]] below.&lt;/p&gt; 
&lt;p&gt;*** In a dedicated chat buffer:&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: gptel works anywhere in Emacs. The dedicated chat buffer only adds some conveniences.&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt; &lt;p&gt;Run =M-x gptel= to start or switch to the chat buffer. It will ask you for the key if you skipped the previous step. Run it with a prefix-arg (=C-u M-x gptel=) to start a new session.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;In the gptel buffer, send your prompt with =M-x gptel-send=, bound to =C-c RET=.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Set chat parameters (LLM provider, model, system prompt etc) for the session by calling =gptel-send= with a prefix argument (=C-u C-c RET=):&lt;/p&gt; &lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;#+html: &lt;img src=&quot;https://github.com/karthink/gptel/assets/8607532/eb4867e5-30ac-455f-999f-e17123afb810&quot; align=&quot;center&quot; alt=&quot;Image showing gptel&#39;s menu with some of the available query options.&quot; /&gt;&lt;/p&gt; 
&lt;p&gt;That&#39;s it. You can go back and edit previous prompts and responses if you want.&lt;/p&gt; 
&lt;p&gt;The default mode is =markdown-mode= if available, else =text-mode=. You can set =gptel-default-mode= to =org-mode= if desired.&lt;/p&gt; 
&lt;p&gt;You can use =gptel-highlight-mode= to highlight LLM responses in different ways.&lt;/p&gt; 
&lt;p&gt;You can also define a &quot;preset&quot; bundle of options that are applied together, see [[#option-presets][Option presets]] below.&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;details&gt;
 &lt;summary&gt; **** Including media (images, documents or plain-text files) with requests #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;gptel supports sending media in Markdown and Org chat buffers, but this feature is disabled by default.&lt;/p&gt; 
 &lt;ul&gt; 
  &lt;li&gt;You can enable it globally, for all models that support it, by setting =gptel-track-media=.&lt;/li&gt; 
  &lt;li&gt;Or you can set it locally, just for the chat buffer, via the header line or gptel&#39;s transient menu:&lt;/li&gt; 
 &lt;/ul&gt; 
 &lt;p&gt;#+html: &lt;img src=&quot;https://github.com/user-attachments/assets/91f6aaab-2ea4-4806-9cc9-39b4b46a8e6c&quot; align=&quot;center&quot; alt=&quot;Image showing a gptel chat buffer&#39;s header line with the button to toggle media support&quot; /&gt;&lt;/p&gt; 
 &lt;hr /&gt; 
 &lt;p&gt;There are two ways to include media or plain-text files with requests:&lt;/p&gt; 
 &lt;ol&gt; 
  &lt;li&gt; &lt;p&gt;Add files to gptel&#39;s context with =gptel-add-file=, described further below.&lt;/p&gt; &lt;/li&gt; 
  &lt;li&gt; &lt;p&gt;Include links to media in chat buffers. gptel will annotate the link to indicate that the linked files will be sent along with the prompt. If a link cannot be sent for some reason, that will be indicated too, and the reason will be shown in a tooltip:&lt;/p&gt; &lt;/li&gt; 
 &lt;/ol&gt; 
 &lt;p&gt;#+html: &lt;img width=&quot;848&quot; height=&quot;336&quot; alt=&quot;Image showing a gptel chat buffer with annotated links, two of which are marked with SEND.  A third link will not be sent, and the echo area contains an explanation for why.&quot; src=&quot;https://github.com/user-attachments/assets/00fd0187-f964-4f55-a392-0a1562bb9118&quot; align=&quot;center&quot; /&gt;&lt;/p&gt; 
 &lt;p&gt;Most ways of specifying links to files/URLs are respected by gptel:&lt;/p&gt; 
 &lt;ul&gt; 
  &lt;li&gt;In Markdown mode: 
   &lt;ul&gt; 
    &lt;li&gt;=[](file:///path/to/file.txt)= and =&lt;a href=&quot;https://raw.githubusercontent.com/karthink/gptel/master/path/to/file.txt&quot;&gt;&lt;/a&gt;=&lt;/li&gt; 
    &lt;li&gt;=[Description](file:///path/to/file.txt)= and =&lt;a href=&quot;https://raw.githubusercontent.com/karthink/gptel/master/path/to/file.txt&quot;&gt;Description&lt;/a&gt;=&lt;/li&gt; 
    &lt;li&gt;=&amp;lt;file:///path/to/file.txt&amp;gt;= &quot;Plain&quot; links of the form =file:///path/to/file.txt= will not be recognized.&lt;/li&gt; 
   &lt;/ul&gt; &lt;/li&gt; 
  &lt;li&gt;In Org mode: 
   &lt;ul&gt; 
    &lt;li&gt;=[[file:/path/to/file.txt]]=&lt;/li&gt; 
    &lt;li&gt;=[[file:/path/to/file.txt][Description]]=&lt;/li&gt; 
    &lt;li&gt;=&amp;lt;file:/path/to/file.txt&amp;gt;=&lt;/li&gt; 
    &lt;li&gt;=[[attachment:data.txt]]= &quot;Plain&quot; links of the form =file:/path/to/file.txt= will not be recognized.&lt;/li&gt; 
   &lt;/ul&gt; &lt;/li&gt; 
 &lt;/ul&gt; 
 &lt;p&gt;Support for custom Org link types is planned.&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Save and restore your chat sessions #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Saving the file will save the state of the conversation as well. To resume the chat, open the file and turn on =gptel-mode= before editing the buffer.&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; *** Setting options (backend, model, request parameters, system prompts and more)
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;Most gptel options can be set from gptel&#39;s transient menu, available by calling =gptel-send= with a prefix-argument, or via =gptel-menu=. To change their default values in your configuration, see [[#additional-configuration][Additional Configuration]]. Chat buffer-specific options are also available via the header-line in chat buffers.&lt;/p&gt; 
&lt;h1&gt;TODO Remove this when writing the manual.&lt;/h1&gt; 
&lt;p&gt;Selecting a model and backend can be done interactively via the =-m= command of =gptel-menu=. Available registered models are prefixed by the name of their backend with a string like =ChatGPT:gpt-4o-mini=, where =ChatGPT= is the backend name you used to register it and =gpt-4o-mini= is the name of the model.&lt;/p&gt; 
&lt;p&gt;*** Include more context with requests :PROPERTIES: :CUSTOM_ID: include-context :END:&lt;/p&gt; 
&lt;p&gt;By default, gptel will query the LLM with the active region or the buffer contents up to the cursor. Often it can be helpful to provide the LLM with additional context from outside the current buffer. For example, when you&#39;re in a chat buffer but want to ask questions about a (possibly changing) code buffer and auxiliary project files.&lt;/p&gt; 
&lt;p&gt;You can include additional text regions, buffers or files with gptel&#39;s queries in two ways. The first is via links in chat buffers, as described above (see &quot;Including media with requests&quot;).&lt;/p&gt; 
&lt;p&gt;The second is globally via dedicated context commands: you can add a selected region, buffer or file to gptel&#39;s context from the menu, or call =gptel-add=. To add a file use =gptel-add= in Dired, or use the dedicated =gptel-add-file= command. Directories will have their files added recursively after prompting for confirmation.&lt;/p&gt; 
&lt;p&gt;This additional context is &quot;live&quot; and not a snapshot. Once added, the regions, buffers or files are scanned and included at the time of each query. When using multi-modal models, added files can be of any supported type -- typically images.&lt;/p&gt; 
&lt;p&gt;You can examine the active context from the menu: #+html: &amp;lt;img src=&quot;&lt;a href=&quot;https://github.com/karthink/gptel/assets/8607532/63cd7fc8-6b3e-42ae-b6ca-06ff935bae9c&quot;&gt;https://github.com/karthink/gptel/assets/8607532/63cd7fc8-6b3e-42ae-b6ca-06ff935bae9c&lt;/a&gt;&quot; align=&quot;center&quot; alt=&quot;Image showing gptel&#39;s menu with the &quot;inspect context&quot; command.&quot;&amp;gt;&lt;/p&gt; 
&lt;p&gt;And then browse through or remove context from the context buffer: #+html: &lt;img src=&quot;https://github.com/karthink/gptel/assets/8607532/79a5ffe8-3d63-4bf7-9bf6-0457ab61bf2a&quot; align=&quot;center&quot; alt=&quot;Image showing gptel&#39;s context buffer.&quot; /&gt;&lt;/p&gt; 
&lt;p&gt;By default, files in a version control system that are not project files (&quot;gitignored&quot; files) will not be added to the context. To be able to add these files, set =gptel-context-restrict-to-project-files= to =nil=. Note that remote files are always included, regardless of the value of =gptel-context-restrict-to-project-files=.&lt;/p&gt; 
&lt;p&gt;*** Handle &quot;reasoning&quot; content&lt;/p&gt; 
&lt;p&gt;Some LLMs include in their response a &quot;thinking&quot; or &quot;reasoning&quot; block. This text improves the quality of the LLM’s final output, but may not be interesting to you by itself. You can decide how you would like this &quot;reasoning&quot; content to be handled by gptel by setting the user option =gptel-include-reasoning=. You can include it in the LLM response (the default), omit it entirely, include it in the buffer but ignore it on subsequent conversation turns, or redirect it to another buffer. As with most options, you can specify this behavior from gptel&#39;s transient menu globally, buffer-locally or for the next request only.&lt;/p&gt; 
&lt;p&gt;When included with the response, reasoning content will be delimited by Org blocks or markdown backticks.&lt;/p&gt; 
&lt;p&gt;*** Tool use&lt;/p&gt; 
&lt;p&gt;gptel can provide the LLM with client-side elisp &quot;tools&quot;, or function specifications, along with the request. If the LLM decides to run the tool, it supplies the tool call arguments, which gptel uses to run the tool in your Emacs session. The result is optionally returned to the LLM to complete the task.&lt;/p&gt; 
&lt;p&gt;This exchange can be used to equip the LLM with capabilities or knowledge beyond what is available out of the box -- for instance, you can get the LLM to control your Emacs frame, create or modify files and directories, or look up information relevant to your request via web search or in a local database. Here is a very simple example:&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;p align=&quot;center&quot;&gt; &lt;a href=&quot;https://github.com/user-attachments/assets/d1f8e2ac-62bb-49bc-850d-0a67aa0cd4c3&quot;&gt;https://github.com/user-attachments/assets/d1f8e2ac-62bb-49bc-850d-0a67aa0cd4c3&lt;/a&gt; #+html: &lt;/p&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;To use tools in gptel, you need&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;a model that supports this usage. All the flagship models support tool use, as do many of the smaller open models.&lt;/li&gt; 
 &lt;li&gt;Tool specifications that gptel understands. gptel does not currently include any tools out of the box.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;details&gt;
 &lt;summary&gt; **** Defining gptel tools #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Defining a gptel tool requires an elisp function and associated metadata. Here are two simple tool definitions:&lt;/p&gt; 
 &lt;p&gt;&lt;em&gt;To read the contents of an Emacs buffer&lt;/em&gt;:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-tool :name &quot;read_buffer&quot; ; javascript-style snake_case name :function (lambda (buffer) ; the function that will run (unless (buffer-live-p (get-buffer buffer)) (error &quot;error: buffer %s is not live.&quot; buffer)) (with-current-buffer buffer (buffer-substring-no-properties (point-min) (point-max)))) :description &quot;return the contents of an emacs buffer&quot; :args (list &#39;(:name &quot;buffer&quot; :type string ; :type value must be a symbol :description &quot;the name of the buffer whose contents are to be retrieved&quot;)) :category &quot;emacs&quot;) ; An arbitrary label for grouping #+end_src&lt;/p&gt; 
 &lt;p&gt;Besides the function itself, which can be named or anonymous (as above), the tool specification requires a =:name=, =:description= and a list of argument specifications in =:args=. Each argument specification is a plist with atleast the keys =:name=, =:type= and =:description=.&lt;/p&gt; 
 &lt;p&gt;&lt;em&gt;To create a text file&lt;/em&gt;:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (gptel-make-tool :name &quot;create_file&quot; ; javascript-style snake_case name :function (lambda (path filename content) ; the function that runs (let ((full-path (expand-file-name filename path))) (with-temp-buffer (insert content) (write-file full-path)) (format &quot;Created file %s in %s&quot; filename path))) :description &quot;Create a new file with the specified content&quot; :args (list &#39;(:name &quot;path&quot; ; a list of argument specifications :type string :description &quot;The directory where to create the file&quot;) &#39;(:name &quot;filename&quot; :type string :description &quot;The name of the file to create&quot;) &#39;(:name &quot;content&quot; :type string :description &quot;The content to write to the file&quot;)) :category &quot;filesystem&quot;) ; An arbitrary label for grouping #+end_src&lt;/p&gt; 
 &lt;p&gt;With some prompting, you can get an LLM to write these tools for you.&lt;/p&gt; 
 &lt;p&gt;Tools can also be asynchronous, use optional arguments and arguments with more structure (enums, arrays, objects etc). See =gptel-make-tool= for details.&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Selecting tools #+html: &lt;/summary&gt; Once defined, tools can be selected (globally, buffer-locally or for the next request only) from gptel&#39;s transient menu:
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;img src=&quot;https://github.com/user-attachments/assets/fd878596-b313-4385-b675-3d6546909d8b&quot; align=&quot;center&quot; alt=&quot;Image showing gptel&#39;s tool selection menu.&quot; /&gt;&lt;/p&gt; 
 &lt;p&gt;From here you can also require confirmation for all tool calls, and decide if tool call results should be included in the LLM response.&lt;/p&gt; 
 &lt;p&gt;Alternatively, you can add/remove tools via&lt;/p&gt; 
 &lt;ul&gt; 
  &lt;li&gt;Elisp, see [[#additional-configuration][Additional Configuration]].&lt;/li&gt; 
  &lt;li&gt;gptel presets, see [[#option-presets][Option presets]].&lt;/li&gt; 
 &lt;/ul&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** LLM tool collections #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;The following repositories provide collections of tools written by gptel users.&lt;/p&gt; 
 &lt;ul&gt; 
  &lt;li&gt;[[&lt;a href=&quot;https://github.com/skissue/llm-tool-collection&quot;&gt;https://github.com/skissue/llm-tool-collection&lt;/a&gt;][llm-tool-collection]] :: A community collection of tools for use with LLM clients in Emacs. Includes LLM tools for interacting with files, Emacs buffers and running system commands.&lt;/li&gt; 
  &lt;li&gt;[[&lt;a href=&quot;https://github.com/karthink/gptel-agent&quot;&gt;https://github.com/karthink/gptel-agent&lt;/a&gt;][gptel-agent]] :: A collection of tools meant for agentic LLM use. Includes tools for filesystem access and manipulation, running Bash commands, Emacs introspection and Elisp evaluation, web search and YouTube.&lt;/li&gt; 
  &lt;li&gt;[[&lt;a href=&quot;https://github.com/ultronozm/codel.el&quot;&gt;https://github.com/ultronozm/codel.el&lt;/a&gt;][codel.el]] :: A collection of code editing tools.&lt;/li&gt; 
  &lt;li&gt;[[&lt;a href=&quot;https://codeberg.org/bajsicki/gptel-org-tools&quot;&gt;https://codeberg.org/bajsicki/gptel-org-tools&lt;/a&gt;][gptel-org-tools]] :: Tools for interacting with Org files.&lt;/li&gt; 
  &lt;li&gt;[[&lt;a href=&quot;https://github.com/positron-solutions/ragmacs&quot;&gt;https://github.com/positron-solutions/ragmacs&lt;/a&gt;][ragmacs]] :: A collection of tools for Emacs introspection.&lt;/li&gt; 
  &lt;li&gt;[[&lt;a href=&quot;https://github.com/munen/emacs.d?tab=readme-ov-file#tool-use&quot;&gt;https://github.com/munen/emacs.d?tab=readme-ov-file#tool-use&lt;/a&gt;][Alain Lafon’s tool collection]]&lt;/li&gt; 
 &lt;/ul&gt; 
 &lt;p&gt;Additionally, the [[&lt;a href=&quot;https://github.com/karthink/gptel/wiki/Tools-collection&quot;&gt;https://github.com/karthink/gptel/wiki/Tools-collection&lt;/a&gt;][wiki has some examples]] of common tools. These are not maintained, but might serve instructional when writing custom tools.&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Model Context Protocol (MCP) integration #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;The [[&lt;a href=&quot;https://modelcontextprotocol.io/introduction&quot;&gt;https://modelcontextprotocol.io/introduction&lt;/a&gt;][Model Context Protocol]] (MCP) is a protocol for providing resources and tools to LLMs, and [[&lt;a href=&quot;https://github.com/appcypher/awesome-mcp-servers&quot;&gt;https://github.com/appcypher/awesome-mcp-servers&lt;/a&gt;][many MCP servers exist]] that provide LLM tools for file access, database connections, API integrations etc. The [[mcp.el]] package for Emacs can act as an MCP client and manage these tool calls for gptel.&lt;/p&gt; 
 &lt;p&gt;To use MCP servers with gptel, you thus need three pieces:&lt;/p&gt; 
 &lt;ol&gt; 
  &lt;li&gt;The [[&lt;a href=&quot;https://github.com/lizqwerscott/mcp.el&quot;&gt;https://github.com/lizqwerscott/mcp.el&lt;/a&gt;][mcp.el]] package for Emacs, [[&lt;a href=&quot;https://melpa.org/#/mcp&quot;&gt;https://melpa.org/#/mcp&lt;/a&gt;][available on MELPA]].&lt;/li&gt; 
  &lt;li&gt;MCP servers configured for and running via mcp.el.&lt;/li&gt; 
  &lt;li&gt;gptel and access to an LLM&lt;/li&gt; 
 &lt;/ol&gt; 
 &lt;p&gt;gptel includes =gptel-integrations=, a small library to make this more convenient. This library is not automatically loaded by gptel, so if you would like to use it you have to require it:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (require &#39;gptel-integrations) #+end_src&lt;/p&gt; 
 &lt;p&gt;Once loaded, you can run the =gptel-mcp-connect= and =gptel-mcp-disconnect= commands to register and unregister MCP-provided tools in gptel. These will also show up in the tools menu in gptel, accessed via =M-x gptel-menu= or =M-x gptel-tools=:&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;img src=&quot;https://github.com/user-attachments/assets/2cbbf8a0-49c7-49a5-ba24-514ad7e08799&quot; align=&quot;center&quot; alt=&quot;Image showing MCP tool registration commands in gptel&#39;s tool selection menu.&quot; /&gt;&lt;/p&gt; 
 &lt;p&gt;MCP-provided tools can be used as normal with gptel. Here is a screencast of the process. (In this example the &quot;github&quot; MCP server is installed separately using npm.)&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
 &lt;p align=&quot;center&quot;&gt; &lt;a href=&quot;https://github.com/user-attachments/assets/f3ea7ac0-a322-4a59-b5b2-b3f592554f8a&quot;&gt;https://github.com/user-attachments/assets/f3ea7ac0-a322-4a59-b5b2-b3f592554f8a&lt;/a&gt; #+html: &lt;/p&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Here&#39;s an example of using these tools:&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
 &lt;p align=&quot;center&quot;&gt; &lt;a href=&quot;https://github.com/user-attachments/assets/b48a6a24-a130-4da7-a2ee-6ea568e10c85&quot;&gt;https://github.com/user-attachments/assets/b48a6a24-a130-4da7-a2ee-6ea568e10c85&lt;/a&gt; #+html: &lt;/p&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;*** Rewrite, refactor or fill in a region&lt;/p&gt; 
&lt;p&gt;In any buffer: with a region selected, you can modify text, rewrite prose or refactor code with =gptel-rewrite=. Example with prose:&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;p align=&quot;center&quot;&gt; &lt;a href=&quot;https://github.com/user-attachments/assets/e3b436b3-9bde-4c1f-b2ce-3f7df1984933&quot;&gt;https://github.com/user-attachments/assets/e3b436b3-9bde-4c1f-b2ce-3f7df1984933&lt;/a&gt; #+html: &lt;/p&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;The result is previewed over the original text. By default, the buffer is not modified.&lt;/p&gt; 
&lt;p&gt;Pressing =RET= or clicking in the rewritten region should give you a list of options: you can &lt;em&gt;iterate&lt;/em&gt; on, &lt;em&gt;diff&lt;/em&gt;, &lt;em&gt;ediff&lt;/em&gt;, &lt;em&gt;merge&lt;/em&gt; or &lt;em&gt;accept&lt;/em&gt; the replacement. Example with code:&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt;
&lt;p align=&quot;center&quot;&gt; &lt;a href=&quot;https://github.com/user-attachments/assets/4067fdb8-85d3-4264-9b64-d727353f68f9&quot;&gt;https://github.com/user-attachments/assets/4067fdb8-85d3-4264-9b64-d727353f68f9&lt;/a&gt; #+html: &lt;/p&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Acting on the LLM response&lt;/em&gt;:&lt;/p&gt; 
&lt;p&gt;If you would like one of these things to happen automatically, you can customize =gptel-rewrite-default-action=.&lt;/p&gt; 
&lt;p&gt;These options are also available from =gptel-rewrite=:&lt;/p&gt; 
&lt;p&gt;#+html: &lt;img src=&quot;https://github.com/user-attachments/assets/589785b9-aa3f-414a-98dd-d26b7509de08&quot; align=&quot;center&quot; /&gt;&lt;/p&gt; 
&lt;p&gt;And you can call them directly when the cursor is in the rewritten region:&lt;/p&gt; 
&lt;p&gt;#+html: &lt;img src=&quot;https://github.com/user-attachments/assets/f5b3ca47-e146-45fe-8584-f11035fa4dbc&quot; align=&quot;center&quot; /&gt;&lt;/p&gt; 
&lt;p&gt;*** Extra Org mode conveniences&lt;/p&gt; 
&lt;p&gt;gptel offers a few extra conveniences in Org mode.&lt;/p&gt; 
&lt;p&gt;***** Limit conversation context to an Org heading&lt;/p&gt; 
&lt;p&gt;You can limit the conversation context to an Org heading with the command =gptel-org-set-topic=.&lt;/p&gt; 
&lt;p&gt;(This sets an Org property (=GPTEL_TOPIC=) under the heading. You can also add this property manually instead.)&lt;/p&gt; 
&lt;p&gt;***** Use branching context in Org mode (tree of conversations)&lt;/p&gt; 
&lt;p&gt;You can have branching conversations in Org mode, where each hierarchical outline path through the document is a separate conversation branch. This is also useful for limiting the context size of each query. See the variable =gptel-org-branching-context=.&lt;/p&gt; 
&lt;p&gt;If this variable is non-nil, you should probably edit =gptel-prompt-prefix-alist= and =gptel-response-prefix-alist= so that the prefix strings for org-mode are not Org headings, e.g.&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setf (alist-get &#39;org-mode gptel-prompt-prefix-alist) &quot;@user\n&quot;) (setf (alist-get &#39;org-mode gptel-response-prefix-alist) &quot;@assistant\n&quot;) #+end_src&lt;/p&gt; 
&lt;p&gt;Otherwise, the default prompt prefix will make successive prompts sibling headings, and therefore on different conversation branches, which probably isn&#39;t what you want.&lt;/p&gt; 
&lt;p&gt;Note: using this option requires Org 9.7 or higher to be available. The [[&lt;a href=&quot;https://github.com/ultronozm/ai-org-chat.el&quot;&gt;https://github.com/ultronozm/ai-org-chat.el&lt;/a&gt;][ai-org-chat]] package uses gptel to provide this branching conversation behavior for older versions of Org.&lt;/p&gt; 
&lt;p&gt;***** Save gptel parameters to Org headings (reproducible chats)&lt;/p&gt; 
&lt;p&gt;You can declare the gptel model, backend, temperature, system message and other parameters as Org properties with the command =gptel-org-set-properties=. gptel queries under the corresponding heading will always use these settings, allowing you to create mostly reproducible LLM chat notebooks, and to have simultaneous chats with different models, model settings and directives (system prompts) under different Org headings.&lt;/p&gt; 
&lt;p&gt;*** Introspection (examine, debug or modify requests)&lt;/p&gt; 
&lt;p&gt;Set =gptel-expert-commands= to =t= to display additional options in gptel&#39;s transient menu. #+html: &lt;img width=&quot;800&quot; height=&quot;403&quot; alt=&quot;Image&quot; src=&quot;https://github.com/user-attachments/assets/636ff77c-73d9-449b-9d49-bb792d8abd45&quot; align=&quot;center&quot; /&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Examining prompts&lt;/em&gt;: you can examine and edit gptel request payloads before sending them.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Pick one of the &quot;dry run&quot; options in the menu to produce a buffer containing the request payload.&lt;/li&gt; 
 &lt;li&gt;You can edit this buffer as you would like and send the request.&lt;/li&gt; 
 &lt;li&gt;You can also copy a Curl command corresponding to the request and invoke it from the shell.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;em&gt;Examining responses&lt;/em&gt;: You can turn on logging to examine the full response from an LLM.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Set =gptel-log-level= to =info= or =debug=.&lt;/li&gt; 
 &lt;li&gt;Send a request.&lt;/li&gt; 
 &lt;li&gt;Open the log buffer from gptel&#39;s transient menu, or switch to the =&lt;em&gt;gptel-log&lt;/em&gt;= buffer.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;** FAQ *** Chat buffer UI #+html: &lt;/p&gt;
&lt;details&gt;
 &lt;summary&gt; **** I want the window to scroll automatically as the response is inserted #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;To be minimally annoying, gptel does not move the cursor by default. Add the following to your configuration to enable auto-scrolling.&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (add-hook &#39;gptel-post-stream-hook &#39;gptel-auto-scroll) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** I want the cursor to move to the next prompt after the response is inserted #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;To be minimally annoying, gptel does not move the cursor by default. Add the following to your configuration to move the cursor:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp (add-hook &#39;gptel-post-response-functions &#39;gptel-end-of-response) #+end_src&lt;/p&gt; 
 &lt;p&gt;You can also call =gptel-end-of-response= as a command at any time.&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** I want to change the formatting of the prompt and LLM response #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Anywhere in Emacs: Turn on =gptel-highlight-mode=. See its documentation for customization options.&lt;/p&gt; 
 &lt;p&gt;In dedicated chat buffers: you can additionally customize =gptel-prompt-prefix-alist= and =gptel-response-prefix-alist=, which are prefixes inserted before the prompt and response. You can set a different pair for each major-mode.&lt;/p&gt; 
 &lt;p&gt;For more custom formatting, use =gptel-pre-response-hook= and =gptel-post-response-functions=.&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** How does gptel distinguish between user prompts and LLM responses? #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;gptel uses [[&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Properties.html&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Properties.html&lt;/a&gt;][text-properties]] to watermark LLM responses. Thus this text is interpreted as a response even if you copy it into another buffer. In regular buffers (buffers without =gptel-mode= enabled), you can turn off this tracking by unsetting =gptel-track-response=.&lt;/p&gt; 
 &lt;p&gt;When restoring a chat state from a file on disk, gptel will apply these properties from saved metadata in the file when you turn on =gptel-mode=.&lt;/p&gt; 
 &lt;p&gt;gptel does /not/ use any prefix or semantic/syntax element in the buffer (such as headings) to separate prompts and responses. The reason for this is that gptel aims to integrate as seamlessly as possible into your regular Emacs usage: LLM interaction is not the objective, it&#39;s just another tool at your disposal. So requiring a bunch of &quot;user&quot; and &quot;assistant&quot; tags in the buffer is noisy and restrictive. If you want these demarcations, you can customize =gptel-prompt-prefix-alist= and =gptel-response-prefix-alist=. Note that these prefixes are for your readability only and purely cosmetic.&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; *** Transient menu behavior #+html: 
&lt;details&gt;
 &lt;summary&gt; **** I want to set gptel options but only for this buffer :PROPERTIES: :ID: 748cbc00-0c92-4705-8839-619b2c80e566 :END: #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;In every menu used to set options, gptel provides a &quot;scope&quot; option, bound to the ~=~ key:&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;img src=&quot;https://github.com/user-attachments/assets/f9904134-2905-4b1d-ad37-b64c777af8ac&quot; align=&quot;center&quot; /&gt;&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;img src=&quot;https://github.com/user-attachments/assets/c0950035-bf65-43ae-b649-8e3b651ce3f1&quot; align=&quot;center&quot; /&gt;&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;img src=&quot;https://github.com/user-attachments/assets/fa3b1246-e00f-4c5e-88c7-46557b3507ef&quot; align=&quot;center&quot; /&gt;&lt;/p&gt; 
 &lt;p&gt;You can flip this switch before setting the option to =buffer= or =oneshot=. You only need to flip this switch once, it&#39;s a persistent setting. =buffer= sets the option buffer-locally, =oneshot= will set it for the next gptel request only. The default scope is global.&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** I want the transient menu options to be saved so I only need to set them once #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Any model options you set are saved according to the scope (see previous question). But the redirection options in the menu are set for the next query only:&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;img src=&quot;https://github.com/karthink/gptel/assets/8607532/2ecc6be9-aa52-4287-a739-ba06e1369ec2&quot; alt=&quot;https://github.com/karthink/gptel/assets/8607532/2ecc6be9-aa52-4287-a739-ba06e1369ec2&quot; /&gt;&lt;/p&gt; 
 &lt;p&gt;You can make them persistent across this Emacs session by pressing ~C-x C-s~:&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;img src=&quot;https://github.com/karthink/gptel/assets/8607532/b8bcb6ad-c974-41e1-9336-fdba0098a2fe&quot; alt=&quot;https://github.com/karthink/gptel/assets/8607532/b8bcb6ad-c974-41e1-9336-fdba0098a2fe&quot; /&gt;&lt;/p&gt; 
 &lt;p&gt;(You can also cycle through presets you&#39;ve saved with ~C-x p~ and ~C-x n~.)&lt;/p&gt; 
 &lt;p&gt;Now these will be enabled whenever you send a query from the transient menu. If you want to use these saved options without invoking the transient menu, you can use a keyboard macro:&lt;/p&gt; 
 &lt;p&gt;#+begin_src emacs-lisp ;; Replace with your key to invoke the transient menu: (keymap-global-set &quot;
  &lt;f6&gt;
   &quot; &quot;C-u C-c 
   &lt;return&gt; 
    &lt;return&gt;
     &quot;) #+end_src
    &lt;/return&gt;
   &lt;/return&gt;
  &lt;/f6&gt;&lt;/p&gt; 
 &lt;p&gt;Or see this [[&lt;a href=&quot;https://github.com/karthink/gptel/wiki/Commonly-requested-features#save-transient-flags&quot;&gt;https://github.com/karthink/gptel/wiki/Commonly-requested-features#save-transient-flags&lt;/a&gt;][wiki entry]].&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Using the transient menu leaves behind extra windows #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;If using gptel&#39;s transient menus causes new/extra window splits to be created, check your value of =transient-display-buffer-action=. [[&lt;a href=&quot;https://github.com/magit/transient/discussions/358&quot;&gt;https://github.com/magit/transient/discussions/358&lt;/a&gt;][See this discussion]] for more context.&lt;/p&gt; 
 &lt;p&gt;If you are using Helm, see [[&lt;a href=&quot;https://github.com/magit/transient/discussions/361&quot;&gt;https://github.com/magit/transient/discussions/361&lt;/a&gt;][Transient#361]].&lt;/p&gt; 
 &lt;p&gt;In general, do not customize this Transient option unless you know what you&#39;re doing!&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Can I change the transient menu key bindings? #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Yes, see =transient-suffix-put=. This changes the key to select a backend/model from &quot;-m&quot; to &quot;M&quot; in gptel&#39;s menu: #+begin_src emacs-lisp (transient-suffix-put &#39;gptel-menu (kbd &quot;-m&quot;) :key &quot;M&quot;) #+end_src&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** (Doom Emacs) Sending a query from the gptel menu fails because of a key conflict with Org mode #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Doom binds ~RET~ in Org mode to =+org/dwim-at-point=, which appears to conflict with gptel&#39;s transient menu bindings for some reason.&lt;/p&gt; 
 &lt;p&gt;Two solutions:&lt;/p&gt; 
 &lt;ul&gt; 
  &lt;li&gt;Press ~C-m~ instead of the return key.&lt;/li&gt; 
  &lt;li&gt;Change the send key from return to a key of your choice: #+begin_src emacs-lisp (transient-suffix-put &#39;gptel-menu (kbd &quot;RET&quot;) :key &quot;
   &lt;f8&gt;
    &quot;) #+end_src
   &lt;/f8&gt;&lt;/li&gt; 
 &lt;/ul&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; *** Miscellaneous #+html: 
&lt;details&gt;
 &lt;summary&gt; **** I want to use gptel in a way that&#39;s not supported by =gptel-send= or the options menu #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;gptel&#39;s default usage pattern is simple, and will stay this way: Read input in any buffer and insert the response below it. Some custom behavior is possible with the transient menu (=C-u M-x gptel-send=).&lt;/p&gt; 
 &lt;p&gt;For more programmable usage, gptel provides a general =gptel-request= function that accepts a custom prompt and a callback to act on the response. You can use this to build custom workflows not supported by =gptel-send=. See the documentation of =gptel-request=, and the [[&lt;a href=&quot;https://github.com/karthink/gptel/wiki/Defining-custom-gptel-commands&quot;&gt;https://github.com/karthink/gptel/wiki/Defining-custom-gptel-commands&lt;/a&gt;][wiki]] for examples.&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** (ChatGPT) I get the error &quot;(HTTP/2 429) You exceeded your current quota&quot; #+html:&lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;#+begin_quote (HTTP/2 429) You exceeded your current quota, please check your plan and billing details. #+end_quote&lt;/p&gt; 
 &lt;p&gt;Using the ChatGPT (or any OpenAI) API requires [[&lt;a href=&quot;https://platform.openai.com/account/billing/overview&quot;&gt;https://platform.openai.com/account/billing/overview&lt;/a&gt;][adding credit to your account]].&lt;/p&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt; #+html: 
&lt;details&gt;
 &lt;summary&gt; **** Why another LLM client? #+html: &lt;/summary&gt;
 &lt;p&gt;&lt;/p&gt; 
 &lt;p&gt;Other Emacs clients for LLMs prescribe the format of the interaction (a comint shell, org-babel blocks, etc). I wanted:&lt;/p&gt; 
 &lt;ol&gt; 
  &lt;li&gt;Something that is as free-form as possible: query the model using any text in any buffer, and redirect the response as required. Using a dedicated =gptel= buffer just adds some visual flair to the interaction.&lt;/li&gt; 
  &lt;li&gt;Integration with org-mode, not using a walled-off org-babel block, but as regular text. This way the model can generate code blocks that I can run.&lt;/li&gt; 
 &lt;/ol&gt; 
 &lt;p&gt;#+html: &lt;/p&gt;
&lt;/details&gt;
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;** Additional Configuration :PROPERTIES: :ID: f885adac-58a3-4eba-a6b7-91e9e7a17829 :END: #+html: &lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp :exports none :results list (let ((all)) (mapatoms (lambda (sym) (when (and (string-match-p &quot;^gptel-[^-]&quot; (symbol-name sym)) (get sym &#39;variable-documentation)) (push sym all)))) all) #+end_src&lt;/p&gt; 
&lt;p&gt;|-------------------------+--------------------------------------------------------------------| | &lt;em&gt;Connection options&lt;/em&gt; | | |-------------------------+--------------------------------------------------------------------| | =gptel-use-curl= | Use Curl? (default), fallback to Emacs&#39; built-in =url=. | | | You can also specify the Curl path here. | | =gptel-proxy= | Proxy server for requests, passed to curl via =--proxy=. | | =gptel-curl-extra-args= | Extra arguments passed to Curl. | | =gptel-api-key= | Variable/function that returns the API key for the active backend. | |-------------------------+--------------------------------------------------------------------|&lt;/p&gt; 
&lt;p&gt;|-----------------------+---------------------------------------------------------| | &lt;em&gt;LLM request options&lt;/em&gt; | /(Note: not supported uniformly across LLMs)/ | |-----------------------+---------------------------------------------------------| | =gptel-backend= | Default LLM Backend. | | =gptel-model= | Default model to use, depends on the backend. | | =gptel-stream= | Enable streaming responses, if the backend supports it. | | =gptel-system-prompt= | Default system prompt used by gptel, can be a function. | | =gptel-directives= | Alist of system prompts, can switch on the fly. | | =gptel-max-tokens= | Maximum token count (in query + response). | | =gptel-temperature= | Randomness in response text, 0 to 2. | | =gptel-cache= | Cache prompts, system message or tools (Anthropic only) | | =gptel-use-context= | How/whether to include additional context | | =gptel-context= | List of context sources (files/buffers) for queries | | =gptel-use-tools= | Disable, allow or force LLM tool-use | | =gptel-tools= | List of tools to include with requests | |-----------------------+---------------------------------------------------------|&lt;/p&gt; 
&lt;p&gt;|--------------------------------+----------------------------------------------------------------| | &lt;em&gt;Chat UI options&lt;/em&gt; | | |--------------------------------+----------------------------------------------------------------| | =gptel-default-mode= | Major mode for dedicated chat buffers. | | =gptel-highlight-methods= | Response highlighting used by =gptel-highlight-mode= | | =gptel-prompt-prefix-alist= | Text inserted before queries. | | =gptel-response-prefix-alist= | Text inserted before responses. | | =gptel-track-response= | Distinguish between user messages and LLM responses? | | =gptel-track-media= | Send text, images or other media from links? | | =gptel-markdown-validate-link= | Function to validate links to include with queries | | =gptel-confirm-tool-calls= | Confirm all tool calls? | | =gptel-include-tool-results= | Include tool results in the LLM response? | | =gptel-use-header-line= | Display status messages in header-line (default) or minibuffer | | =gptel-display-buffer-action= | Placement of the gptel chat buffer. | |--------------------------------+----------------------------------------------------------------|&lt;/p&gt; 
&lt;p&gt;|-------------------------------+-------------------------------------------------------| | &lt;em&gt;Org mode UI options&lt;/em&gt; | | |-------------------------------+-------------------------------------------------------| | =gptel-org-branching-context= | Make each outline path a separate conversation branch | | =gptel-org-ignore-elements= | Ignore parts of the buffer when sending a query | | =gptel-org-validate-link= | Function to validate links to include with queries | |-------------------------------+-------------------------------------------------------|&lt;/p&gt; 
&lt;p&gt;|------------------------------------+-------------------------------------------------------------| | &lt;em&gt;Hooks for customization&lt;/em&gt; | | |------------------------------------+-------------------------------------------------------------| | =gptel-save-state-hook= | Runs before saving the chat state to a file on disk | | =gptel-prompt-transform-functions= | Runs in a temp buffer to transform text before sending | | =gptel-post-request-hook= | Runs immediately after dispatching a =gptel-request=. | | =gptel-pre-response-hook= | Runs before inserting the LLM response into the buffer | | =gptel-post-response-functions= | Runs after inserting the full LLM response into the buffer | | =gptel-post-stream-hook= | Runs after each streaming insertion | | =gptel-pre-tool-call-functions= | Runs before each tool call, can block or modify it | | =gptel-post-tool-call-functions= | Runs after each tool call, can block or modify results | | =gptel-context-wrap-function= | To include additional context formatted your way | | =gptel-rewrite-default-action= | Automatically diff, ediff, merge or replace refactored text | | =gptel-post-rewrite-functions= | Runs after a =gptel-rewrite= request succeeds | |------------------------------------+-------------------------------------------------------------|&lt;/p&gt; 
&lt;p&gt;#+html: &lt;/p&gt; 
&lt;p&gt;*** Option presets&lt;/p&gt; 
&lt;p&gt;If you use several LLMs for different tasks with accompanying system prompts (instructions) and tool configurations, manually adjusting =gptel= settings each time can become tedious. Presets are a bundle of gptel settings -- such as the model, backend, system message, and enabled tools -- that you can switch to at once.&lt;/p&gt; 
&lt;p&gt;Once defined, presets can be applied from gptel&#39;s transient menu:&lt;/p&gt; 
&lt;p&gt;#+html: &lt;img src=&quot;https://github.com/user-attachments/assets/e0cf6a32-d999-4138-8369-23512f5e9311&quot; align=&quot;center&quot; /&gt; #+html: &lt;br /&gt;&lt;/p&gt; 
&lt;p&gt;To define a preset, use the =gptel-make-preset= function, which takes a name and keyword-value pairs of settings.&lt;/p&gt; 
&lt;p&gt;Presets can be used to set individual options. Here is an example of a preset to set the system message (and do nothing else): #+begin_src emacs-lisp (gptel-make-preset &#39;explain :system &quot;Explain what this code does to a novice programmer.&quot;) #+end_src&lt;/p&gt; 
&lt;p&gt;More generally, you can specify a bundle of options: #+begin_src emacs-lisp (gptel-make-preset &#39;gpt4coding ;preset name, a symbol :description &quot;A preset optimized for coding tasks&quot; ;for your reference :backend &quot;Claude&quot; ;gptel backend or backend name :model &#39;claude-3-7-sonnet-20250219.1 :system &quot;You are an expert coding assistant. Your role is to provide high-quality code solutions, refactorings, and explanations.&quot; :tools &#39;(&quot;read_buffer&quot; &quot;modify_buffer&quot;)) ;gptel tools or tool names #+end_src&lt;/p&gt; 
&lt;p&gt;Besides a couple of special keys (=:description=, =:parents= to inherit other presets), there is no predefined list of keys. Instead, the key =:foo= corresponds to setting =gptel-foo= (preferred) or =gptel--foo=. So the preset can include the value of any gptel option. For example, the following preset sets =gptel-temperature=, =gptel-use-context= and =gptel-context=, a list of files to include as context:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (gptel-make-preset &#39;proofreader :description &quot;Preset for proofreading tasks&quot; :backend &quot;ChatGPT&quot; :model &#39;gpt-4.1-mini :tools &#39;(&quot;read_buffer&quot; &quot;spell_check&quot; &quot;grammar_check&quot;) :use-context &#39;system ;sets gptel-use-context :context &#39;(&quot;./.grammar_rules.md&quot; &quot;./jargonfile.md&quot;) ;sets gptel-context :temperature 0.2) ;sets gptel-temperature #+end_src&lt;/p&gt; 
&lt;p&gt;Switching to a preset applies the specified settings without affecting other settings. Depending on the scope option (~=~ in gptel&#39;s transient menu), presets can be applied globally, buffer-locally or for the next request only.&lt;/p&gt; 
&lt;p&gt;**** Applying presets to requests automatically&lt;/p&gt; 
&lt;p&gt;You can apply a preset to a /single/ query by including =@preset-name= in the prompt, where =preset-name= is the name of the preset. (The =oneshot= scope option in gptel&#39;s transient menus is another way to do this, [[id:748cbc00-0c92-4705-8839-619b2c80e566][see the FAQ.]])&lt;/p&gt; 
&lt;p&gt;For example, if you have a preset named =websearch= defined which includes tools for web access and search: #+begin_src emacs-lisp (gptel-make-preset &#39;websearch :description &quot;Haiku with basic web search capability.&quot; :backend &quot;Claude&quot; :model &#39;claude-3-5-haiku-20241022 :tools &#39;(&quot;search_web&quot; &quot;read_url&quot; &quot;get_youtube_meta&quot;)) #+end_src&lt;/p&gt; 
&lt;p&gt;The following query is sent with this preset applied:&lt;/p&gt; 
&lt;p&gt;#+begin_quote @websearch Are there any 13&quot; e-ink monitors on the market? Create a table comparing them, sourcing specs and reviews from online sources. Also do the same for &quot;transreflective-LCD&quot; displays -- I&#39;m not sure what exactly they&#39;re called but they&#39;re comparable to e-ink. #+end_quote&lt;/p&gt; 
&lt;p&gt;This =@preset-name= cookie only applies to the final user turn of the coversation that is sent. So the presence of the cookie in past messages/turns is not significant.&lt;/p&gt; 
&lt;p&gt;The =@preset-name= cookie can be anywhere in the prompt. For example: #+begin_quote 
 &lt;long piece of text&gt;&lt;/long&gt;&lt;/p&gt; 
&lt;p&gt;What do you make of the above description, @proofreader? #+end_quote&lt;/p&gt; 
&lt;p&gt;In chat buffers this prefix will be offered as a completion and fontified, making it easy to use and spot.&lt;/p&gt; 
&lt;p&gt;** Alternatives&lt;/p&gt; 
&lt;p&gt;Other LLM clients for Emacs include&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Libraries&lt;/em&gt;:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/ahyatt/llm&quot;&gt;https://github.com/ahyatt/llm&lt;/a&gt;][llm]]: llm provides a uniform API across language model providers for building LLM clients in Emacs, and is intended as a library for use by package authors. For similar scripting purposes, gptel provides the command =gptel-request=.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;em&gt;Chat clients&lt;/em&gt;:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/s-kostyaev/ellama&quot;&gt;https://github.com/s-kostyaev/ellama&lt;/a&gt;][Ellama]]: A full-fledged LLM client built on llm, that supports many LLM providers (Ollama, Open AI, Vertex, GPT4All and more). Its usage differs from gptel in that it provides separate commands for dozens of common tasks, like general chat, summarizing code/text, refactoring code, improving grammar, translation and so on.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/xenodium/chatgpt-shell&quot;&gt;https://github.com/xenodium/chatgpt-shell&lt;/a&gt;][chatgpt-shell]]: comint-shell based interaction with ChatGPT. Also supports DALL-E, executable code blocks in the responses, and more.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/rksm/org-ai&quot;&gt;https://github.com/rksm/org-ai&lt;/a&gt;][org-ai]]: Interaction through special =#+begin_ai ... #+end_ai= Org-mode blocks. Also supports DALL-E, querying ChatGPT with the contents of project files, and more.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/yibie/superchat&quot;&gt;https://github.com/yibie/superchat&lt;/a&gt;][Superchat]]: A Claude Code style chat UI for gptel in Emacs, focusing on making structured prompts and file‑grounded conversations effortless.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;There are several more: [[&lt;a href=&quot;https://github.com/iwahbe/chat.el&quot;&gt;https://github.com/iwahbe/chat.el&lt;/a&gt;][chat.el]], [[&lt;a href=&quot;https://github.com/stuhlmueller/gpt.el&quot;&gt;https://github.com/stuhlmueller/gpt.el&lt;/a&gt;][gpt.el]], [[&lt;a href=&quot;https://github.com/AnselmC/le-gpt.el&quot;&gt;https://github.com/AnselmC/le-gpt.el&lt;/a&gt;][le-gpt]], [[&lt;a href=&quot;https://github.com/stevemolitor/robby&quot;&gt;https://github.com/stevemolitor/robby&lt;/a&gt;][robby]].&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Coding agents&lt;/em&gt;:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/manzaltu/claude-code-ide.el&quot;&gt;https://github.com/manzaltu/claude-code-ide.el&lt;/a&gt;][claude-code-ide]] and [[&lt;a href=&quot;https://github.com/stevemolitor/claude-code.el&quot;&gt;https://github.com/stevemolitor/claude-code.el&lt;/a&gt;][claude-code.el]]: Emacs interfaces to Claude Code.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/xenodium/agent-shell&quot;&gt;https://github.com/xenodium/agent-shell&lt;/a&gt;][agent-shell]]: Emacs interface to various coding agents, like Claude Code, Gemini, Codex, Opencode, Goose and more.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/MatthewZMD/aidermacs&quot;&gt;https://github.com/MatthewZMD/aidermacs&lt;/a&gt;][Aidermacs]] and [[&lt;a href=&quot;https://github.com/tninja/aider.el&quot;&gt;https://github.com/tninja/aider.el&lt;/a&gt;][aider.el]]: Emacs interfaces to [[&lt;a href=&quot;https://aider.chat/&quot;&gt;https://aider.chat/&lt;/a&gt;][Aider]].&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;em&gt;Completion at point&lt;/em&gt;:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/copilot-emacs/copilot.el&quot;&gt;https://github.com/copilot-emacs/copilot.el&lt;/a&gt;][copilot.el]]: Code completion using Copilot.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/milanglacier/minuet-ai.el&quot;&gt;https://github.com/milanglacier/minuet-ai.el&lt;/a&gt;][Minuet]]: Code-completion using LLM. Supports fill-in-the-middle (FIM) completion for compatible models such as DeepSeek and Codestral.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;*** Packages using gptel&lt;/p&gt; 
&lt;p&gt;gptel is a general-purpose package for chat and ad-hoc LLM interaction. The following packages use gptel to provide additional or specialized functionality:&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Lookup helpers&lt;/em&gt;: Calling gptel quickly for one-off interactions&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/karthink/gptel-quick&quot;&gt;https://github.com/karthink/gptel-quick&lt;/a&gt;][gptel-quick]]: Quickly look up the region or text at point.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;em&gt;Task-driven workflows&lt;/em&gt;: Different interfaces to specify tasks for LLMs.&lt;/p&gt; 
&lt;p&gt;These differ from full &quot;agentic&quot; use in that the interactions are &quot;one-shot&quot;, not chained.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/dolmens/gptel-aibo/&quot;&gt;https://github.com/dolmens/gptel-aibo/&lt;/a&gt;][gptel-aibo]]: A writing assistant system built on top of gptel.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/daedsidog/evedel&quot;&gt;https://github.com/daedsidog/evedel&lt;/a&gt;][Evedel]]: Instructed LLM Programmer/Assistant.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/lanceberge/elysium&quot;&gt;https://github.com/lanceberge/elysium&lt;/a&gt;][Elysium]]: Request AI-generated changes as you code.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/ISouthRain/gptel-watch&quot;&gt;https://github.com/ISouthRain/gptel-watch&lt;/a&gt;][gptel-watch]]: Automatically call gptel when typing lines that indicate intent.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;em&gt;Agentic use&lt;/em&gt;: Use LLMs as agents, with tool-use&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/kmontag/macher&quot;&gt;https://github.com/kmontag/macher&lt;/a&gt;][Macher]]: Project-aware multi-file LLM editing for Emacs.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/karthink/gptel-agent&quot;&gt;https://github.com/karthink/gptel-agent&lt;/a&gt;][gptel-agent]]: Tools, presets and configuration for general agentic LLM use.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;em&gt;Text completion&lt;/em&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/JDNdeveloper/gptel-autocomplete&quot;&gt;https://github.com/JDNdeveloper/gptel-autocomplete&lt;/a&gt;][gptel-autocomplete]]: Inline completions using gptel.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;em&gt;Integration with major-modes&lt;/em&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/jwiegley/ob-gptel&quot;&gt;https://github.com/jwiegley/ob-gptel&lt;/a&gt;][ob-gptel]]: Org-babel backend for running gptel queries.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/kamushadenes/ai-blog.el&quot;&gt;https://github.com/kamushadenes/ai-blog.el&lt;/a&gt;][ai-blog.el]]: Streamline generation of blog posts in Hugo.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/lakkiy/gptel-commit&quot;&gt;https://github.com/lakkiy/gptel-commit&lt;/a&gt;][gptel-commit]]: Generate commit messages using gptel.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/douo/magit-gptcommit&quot;&gt;https://github.com/douo/magit-gptcommit&lt;/a&gt;][magit-gptcommit]]: Generate commit messages within magit-status Buffer using gptel.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/ragnard/gptel-magit/&quot;&gt;https://github.com/ragnard/gptel-magit/&lt;/a&gt;][gptel-magit]]: Generate commit messages for magit using gptel.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/ArthurHeymans/gptel-forge-prs&quot;&gt;https://github.com/ArthurHeymans/gptel-forge-prs&lt;/a&gt;][gptel-forge-prs]]: Generate pull request message for forge using gptel.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;em&gt;Chat interface addons&lt;/em&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/rob137/Corsair&quot;&gt;https://github.com/rob137/Corsair&lt;/a&gt;][Corsair]]: Helps gather text to populate LLM prompts for gptel.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/ultronozm/ai-org-chat.el&quot;&gt;https://github.com/ultronozm/ai-org-chat.el&lt;/a&gt;][ai-org-chat]]: Provides branching conversations in Org buffers using gptel. Note that gptel includes this feature as well (see =gptel-org-branching-context=), but requires a recent version of Org mode 9.7 or later to be installed.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;em&gt;Integration with other packages&lt;/em&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/armindarvish/consult-omni&quot;&gt;https://github.com/armindarvish/consult-omni&lt;/a&gt;][consult-omni]]: Versatile multi-source search package. It includes gptel as one of its many sources.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;em&gt;gptel configuration management&lt;/em&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/jwiegley/gptel-prompts&quot;&gt;https://github.com/jwiegley/gptel-prompts&lt;/a&gt;][gptel-prompts]]: System prompt manager for gptel.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;** COMMENT Older Breaking Changes&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;=gptel-post-response-hook= has been renamed to =gptel-post-response-functions=, and functions in this hook are now called with two arguments: the start and end buffer positions of the response. This should make it easy to act on the response text without having to locate it first.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Possible breakage, see #120: If streaming responses stop working for you after upgrading to v0.5, try reinstalling gptel and deleting its native comp eln cache in =native-comp-eln-load-path=.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;The user option =gptel-host= is deprecated. If the defaults don&#39;t work for you, use =gptel-make-openai= to customize server settings.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;=gptel-api-key-from-auth-source= now searches for the API key using the host address for the active LLM backend, /i.e./ &quot;&lt;a href=&quot;http://api.openai.com&quot;&gt;api.openai.com&lt;/a&gt;&quot; when using ChatGPT. You may need to update your =~/.authinfo=.&lt;/p&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;** Acknowledgments&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/felipeochoa&quot;&gt;https://github.com/felipeochoa&lt;/a&gt;][Felipe Ochoa]] and [[&lt;a href=&quot;https://github.com/akssri&quot;&gt;https://github.com/akssri&lt;/a&gt;][akssri]] for adding AWS Bedrock support to gptel.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/jwiegley&quot;&gt;https://github.com/jwiegley&lt;/a&gt;][John Wiegley]] for the design of gptel&#39;s presets and gptel-request&#39;s async pipeline, but also for loads of general feedback and advice.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/pabl0&quot;&gt;https://github.com/pabl0&lt;/a&gt;][Henrik Ahlgren]] for a keen eye to detail and polish applied to gptel&#39;s UI.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/psionic-k&quot;&gt;https://github.com/psionic-k&lt;/a&gt;][psionic-k]] for extensive testing of the tool use feature and the design of gptel&#39;s in-buffer tool use records.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/jdtsmith&quot;&gt;https://github.com/jdtsmith&lt;/a&gt;][JD Smith]] for feedback and code assistance with gptel-menu&#39;s redesign&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/meain&quot;&gt;https://github.com/meain&lt;/a&gt;][Abin Simon]] for extensive feedback on improving gptel&#39;s directives and UI.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/algal&quot;&gt;https://github.com/algal&lt;/a&gt;][Alexis Gallagher]] and [[&lt;a href=&quot;https://github.com/d1egoaz&quot;&gt;https://github.com/d1egoaz&lt;/a&gt;][Diego Alvarez]] for fixing a nasty multi-byte bug with =url-retrieve=.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/tarsius&quot;&gt;https://github.com/tarsius&lt;/a&gt;][Jonas Bernoulli]] for the Transient library.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/daedsidog&quot;&gt;https://github.com/daedsidog&lt;/a&gt;][daedsidog]] for adding context support to gptel.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/Aquan1412&quot;&gt;https://github.com/Aquan1412&lt;/a&gt;][Aquan1412]] for adding PrivateGPT support to gptel.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/r0man&quot;&gt;https://github.com/r0man&lt;/a&gt;][r0man]] for improving gptel&#39;s Curl integration.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Local Variables:&lt;/h1&gt; 
&lt;h1&gt;toc-org-max-depth: 4&lt;/h1&gt; 
&lt;h1&gt;eval: (and (fboundp &#39;toc-org-mode) (toc-org-mode 1))&lt;/h1&gt; 
&lt;h1&gt;End:&lt;/h1&gt;</description>
      
      <media:content url="https://repository-images.githubusercontent.com/610038902/2af098f1-9230-4166-ad18-f02cc3ca2a85" medium="image" />
      
    </item>
    
    <item>
      <title>rainstormstudio/nerd-icons.el</title>
      <link>https://github.com/rainstormstudio/nerd-icons.el</link>
      <description>&lt;p&gt;#+TITLE: nerd-icons.el - A Library for Nerd Font icons #+AUTHOR: Hongyu Ding #+LANGUAGE: en&lt;/p&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://melpa.org/#/nerd-icons&quot;&gt;https://melpa.org/#/nerd-icons&lt;/a&gt;][file:&lt;a href=&quot;https://melpa.org/packages/nerd-icons-badge.svg&quot;&gt;https://melpa.org/packages/nerd-icons-badge.svg&lt;/a&gt;]]&lt;/p&gt; 
&lt;p&gt;Nerd-icons.el is a library for easily using [[&lt;a href=&quot;https://github.com/ryanoasis/nerd-fonts&quot;&gt;https://github.com/ryanoasis/nerd-fonts&lt;/a&gt;][Nerd Font]] icons inside Emacs, an alternative to [[&lt;a href=&quot;https://github.com/domtronn/all-the-icons.el&quot;&gt;https://github.com/domtronn/all-the-icons.el&lt;/a&gt;][all-the-icons]].&lt;/p&gt; 
&lt;p&gt;It works on both GUI and terminal! You only need a [[&lt;a href=&quot;https://www.nerdfonts.com/#home&quot;&gt;https://www.nerdfonts.com/#home&lt;/a&gt;][Nerd Font]] installed on your system.&lt;/p&gt; 
&lt;p&gt;It is inspired by [[&lt;a href=&quot;https://github.com/domtronn/all-the-icons.el&quot;&gt;https://github.com/domtronn/all-the-icons.el&lt;/a&gt;][all-the-icons]], [[&lt;a href=&quot;https://github.com/seagle0128/icons-in-terminal.el&quot;&gt;https://github.com/seagle0128/icons-in-terminal.el&lt;/a&gt;][icons-in-terminal]], [[&lt;a href=&quot;https://github.com/ryanoasis/vim-devicons&quot;&gt;https://github.com/ryanoasis/vim-devicons&lt;/a&gt;][vim-devicons]], and [[&lt;a href=&quot;https://github.com/nvim-tree/nvim-web-devicons&quot;&gt;https://github.com/nvim-tree/nvim-web-devicons&lt;/a&gt;][nvim-web-devicons]].&lt;/p&gt; 
&lt;p&gt;in GUI: [[file:screenshots/demo.png]]&lt;/p&gt; 
&lt;p&gt;in terminal: [[file:screenshots/demo-terminal.png]]&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Installing Fonts Please go to [[&lt;a href=&quot;https://www.nerdfonts.com/&quot;&gt;https://www.nerdfonts.com/&lt;/a&gt;][Nerd Fonts website]] and get a Nerd font. After installing the font on your machine, you need to set ~nerd-icons-font-family~ to match its font name so that the font can be properly used under GUI. If you want Nerd Fonts to work under a terminal, please change your terminal&#39;s font to a Nerd font.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;If the Nerd Font you installed does not display correctly (e.g. appear cut off), it is recommended to use =Symbols Nerd Font Mono= (Symbols Nerd Font). You can use ~M-x nerd-icons-install-fonts~ to install ~Symbols Nerd Font Mono~ for you. Note that for &lt;em&gt;Windows&lt;/em&gt; you&#39;ll need to manually install the font after you used this function.&lt;/p&gt; 
&lt;p&gt;To automatically install =Symbols Nerd Font Mono=, you can use this elisp in your ~init.el~. On macOS, Linux and BSDs, this will download and install the font directly for you. On Windows, you can specify the folder to download the font to, but you will still have to manually install it after.&lt;/p&gt; 
&lt;p&gt;#+BEGIN_SRC emacs-lisp ;; Linux/macOS/BSDs (when (member system-type &#39;(gnu gnu/linux gnu/kfreebsd darwin)) (unless (find-font (font-spec :name &quot;Symbols Nerd Font Mono&quot;)) (nerd-icons-install-fonts t)))&lt;/p&gt; 
&lt;p&gt;;; Windows (when (string-equal system-type &#39;windows-nt) (unless (find-font (font-spec :name &quot;Symbols Nerd Font Mono&quot;)) (nerd-icons-install-fonts &quot;c:/Users/username/Desktop/&quot;)))&lt;/p&gt; 
&lt;p&gt;;; All-in-one ;; This will install in the default fonts folder for Linux/macOS/BSDs ;; (same as “t”), but for Windows this will download to the specified ;; folder (unless (find-font (font-spec :name &quot;Symbols Nerd Font Mono&quot;)) (nerd-icons-install-fonts &quot;c:/Users/username/Desktop/&quot;)) #+END_SRC&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Usage ~nerd-icons~ is on [[&lt;a href=&quot;https://melpa.org/#/nerd-icons-completion&quot;&gt;https://melpa.org/#/nerd-icons-completion&lt;/a&gt;][Melpa]]. You can install it with built-in ~M-x package-install~ #+begin_src emacs-lisp (require &#39;nerd-icons) #+end_src&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;or using ~use-package~ #+BEGIN_SRC emacs-lisp (use-package nerd-icons ;; :custom ;; The Nerd Font you want to use in GUI ;; &quot;Symbols Nerd Font Mono&quot; is the default and is recommended ;; but you can use any other Nerd Font if you want ;; (nerd-icons-font-family &quot;Symbols Nerd Font Mono&quot;) ) #+END_SRC ** insert icons&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;use icon based on category&lt;/p&gt; 
  &lt;ul&gt; 
   &lt;li&gt;~nerd-icons-icon-for-dir~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-icon-for-file~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-icon-for-extension~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-icon-for-mode~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-icon-for-url~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-icon-for-buffer~&lt;/li&gt; 
  &lt;/ul&gt; &lt;p&gt;example: #+BEGIN_SRC emacs-lisp (insert (nerd-icons-icon-for-file &quot;init.el&quot;)) ;; Inserts an icon for Emacs Lisp #+END_SRC&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;use icon directly&lt;/p&gt; 
  &lt;ul&gt; 
   &lt;li&gt;~nerd-icons-ipsicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-octicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-pomicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-powerline~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-faicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-wicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-sucicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-devicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-codicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-flicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-mdicon~&lt;/li&gt; 
  &lt;/ul&gt; &lt;p&gt;example: #+BEGIN_SRC emacs-lisp (insert (nerd-icons-faicon &quot;nf-fa-gitlab&quot;)) ;; Inserts a Gitlab icon #+END_SRC&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;insert icon interactively (~M-x~ functions)&lt;/p&gt; 
  &lt;ul&gt; 
   &lt;li&gt;~nerd-icons-insert~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-insert-ipsicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-insert-octicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-insert-pomicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-insert-powerline~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-insert-faicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-insert-wicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-insert-sucicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-insert-devicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-insert-codicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-insert-flicon~&lt;/li&gt; 
   &lt;li&gt;~nerd-icons-insert-mdicon~&lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;** customize icons You can customize the icons via ~nerd-icons-extension-icon-alist~, ~nerd-icons-regexp-icon-alist~ and ~nerd-icons-mode-icon-alist~, etc.&lt;/p&gt; 
&lt;p&gt;For example, #+begin_src emacs-lisp (add-to-list &#39;nerd-icons-extension-icon-alist &#39;(&quot;epub&quot; nerd-icons-faicon &quot;nf-fa-book&quot; :face nerd-icons-green)) #+end_src&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Glyph Sets | Glyph Set | prefix | Point Range | insert function | |-------------------------+----------------------+--------------------------------------+----------------------| | Seti-UI + Custom | ~nf-seti-~, ~nf-custom-~ | ~e5fa~ - ~e631~ | ~nerd-icons-sucicon~ | | Devicons | ~nf-dev-~ | ~e700~ - ~e7c5~ | ~nerd-icons-devicon~ | | Font Awesome | ~nf-fa-~ | ~f000~ - ~f2e0~ | ~nerd-icons-faicon~ | | Font Awesome Extension | ~nf-fae-~ | ~e200~ - ~e2a9~ | ~nerd-icons-faicon~ | | Material Design Icons | ~nf-md-~ | ~f500~ - ~fd46~ | ~nerd-icons-mdicon~ | | Weather | ~nf-weather-~ | ~e300~ - ~e3eb~ | ~nerd-icons-wicon~ | | Octicons | ~nf-oct-~ | ~f400~ - ~f4a9~, ~2665~, ~26A1~ | ~nerd-icons-octicon~ | | Powerline Symbols | ~nf-pl-~ | ~e0a0~ - ~e0a2~, ~e0b0~ - ~e0b3~ | ~nerd-icons-powerline~ | | Powerline Extra Symbols | ~nf-ple-~ | ~e0a3~, ~e0b4~ - ~e0c8~, ~e0ca~, ~e0cc~ - ~e0d4~ | ~nerd-icons-powerline~ | | IEC Power Symbols | ~nf-iec-~ | ~23fb~ - ~23fe~, ~2b58~ | ~nerd-icons-ipsicon~ | | Font Logos | ~nf-linux-~ | ~f300~ - ~f32d~ | ~nerd-icons-flicon~ | | Pomicons | ~nf-pom-~ | ~e000~ - ~e00a~ | ~nerd-icons-pomicon~ | | Codicons | ~nf-cod-~ | ~ea60~ - ~ebeb~ | ~nerd-icons-codicon~ |&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Please check [[&lt;a href=&quot;https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points&quot;&gt;https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points&lt;/a&gt;][Nerd Fonts Glyph Sets and Code Points]] for more information.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Related Packages&lt;/li&gt; 
&lt;/ul&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/rainstormstudio/nerd-icons-dired&quot;&gt;https://github.com/rainstormstudio/nerd-icons-dired&lt;/a&gt;][nerd-icons-dired]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/abougouffa/nerd-icons-multimodal&quot;&gt;https://github.com/abougouffa/nerd-icons-multimodal&lt;/a&gt;][nerd-icons-multimodal]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/rainstormstudio/treemacs-nerd-icons&quot;&gt;https://github.com/rainstormstudio/treemacs-nerd-icons&lt;/a&gt;][treemacs-nerd-icons]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/seagle0128/nerd-icons-ivy-rich&quot;&gt;https://github.com/seagle0128/nerd-icons-ivy-rich&lt;/a&gt;][nerd-icons-ivy-rich]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/seagle0128/nerd-icons-ibuffer&quot;&gt;https://github.com/seagle0128/nerd-icons-ibuffer&lt;/a&gt;][nerd-icons-ibuffer]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/rainstormstudio/nerd-icons-completion&quot;&gt;https://github.com/rainstormstudio/nerd-icons-completion&lt;/a&gt;][nerd-icons-completion]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/LuigiPiucco/nerd-icons-corfu&quot;&gt;https://github.com/LuigiPiucco/nerd-icons-corfu&lt;/a&gt;][nerd-icons-corfu]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/alexluigit/dirvish&quot;&gt;https://github.com/alexluigit/dirvish&lt;/a&gt;][dirvish]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/seagle0128/doom-modeline&quot;&gt;https://github.com/seagle0128/doom-modeline&lt;/a&gt;][doom-modeline]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/grolongo/nerd-icons-mode-line&quot;&gt;https://github.com/grolongo/nerd-icons-mode-line&lt;/a&gt;][nerd-icons-mode-line]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/lucius-martius/tab-line-nerd-icons&quot;&gt;https://github.com/lucius-martius/tab-line-nerd-icons&lt;/a&gt;][tab-line-nerd-icons]]&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;** use nerd-icons with dirvish sample configuration: #+BEGIN_SRC emacs-lisp (use-package dirvish :init (dirvish-override-dired-mode) :config (setq dirvish-mode-line-format &#39;(:left (sort symlink) :right (omit yank index))) (setq dirvish-mode-line-height 10) (setq dirvish-attributes &#39;(nerd-icons file-time file-size collapse subtree-state vc-state git-msg)) (setq dirvish-subtree-state-style &#39;nerd) (setq delete-by-moving-to-trash t) (setq dirvish-path-separators (list (format &quot; %s &quot; (nerd-icons-codicon &quot;nf-cod-home&quot;)) (format &quot; %s &quot; (nerd-icons-codicon &quot;nf-cod-root_folder&quot;)) (format &quot; %s &quot; (nerd-icons-faicon &quot;nf-fa-angle_right&quot;)))) (setq dired-listing-switches &quot;-l --almost-all --human-readable --group-directories-first --no-group&quot;) (dirvish-peek-mode) ; Preview files in minibuffer (dirvish-side-follow-mode) ; similar to `treemacs-follow-mode&#39; ) #+END_SRC&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/7ab9a908520d9f986625730ee365f4061283498f230f1497f7c639ac1c3fad93/rainstormstudio/nerd-icons.el" medium="image" />
      
    </item>
    
    <item>
      <title>google-coral/coralnpu</title>
      <link>https://github.com/google-coral/coralnpu</link>
      <description>&lt;p&gt;A machine learning accelerator core designed for energy-efficient AI at the edge.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;Coral NPU&lt;/h1&gt; 
&lt;p&gt;Coral NPU is a hardware accelerator for ML inferencing. Coral NPU is an Open Source IP designed by Google Research and is freely available for integration into ultra-low-power System-on-Chips (SoCs) targeting wearable devices such as hearables, augmented reality (AR) glasses and smart watches.&lt;/p&gt; 
&lt;p&gt;Coral NPU is a neural processing unit (NPU), also known as an AI accelerator or deep-learning processor. Coral NPU is based on the 32-bit RISC-V Instruction Set Architecture (ISA).&lt;/p&gt; 
&lt;p&gt;Coral NPU includes three distinct processor components that work together: matrix, vector (SIMD), and scalar.&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/google-coral/coralnpu/main/doc/images/arch_data_flow.png&quot; alt=&quot;Coral NPU Archicture&quot; /&gt; &lt;a href=&quot;https://developers.google.com/coral/guides/hardware/datasheet&quot;&gt;Coral NPU Architecture Datasheet&lt;/a&gt;&lt;/p&gt; 
&lt;h2&gt;Coral NPU Features&lt;/h2&gt; 
&lt;p&gt;Coral NPU offers the following top-level feature set:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;RV32IMF_Zve32x RISC-V instruction set (specifically &lt;code&gt;rv32imf_zve32x_zicsr_zifencei_zbb&lt;/code&gt;)&lt;/li&gt; 
 &lt;li&gt;32-bit address space for applications and operating system kernels&lt;/li&gt; 
 &lt;li&gt;Four-stage processor, in-order dispatch, out-of-order retire&lt;/li&gt; 
 &lt;li&gt;Four-way scalar, two-way vector dispatch&lt;/li&gt; 
 &lt;li&gt;128-bit SIMD, 256-bit (future) pipeline&lt;/li&gt; 
 &lt;li&gt;8 KB ITCM memory (tightly-coupled memory for instructions)&lt;/li&gt; 
 &lt;li&gt;32 KB DTCM memory (tightly-coupled memory for data)&lt;/li&gt; 
 &lt;li&gt;Both memories are single-cycle-latency SRAM, more efficient than cache memory&lt;/li&gt; 
 &lt;li&gt;AXI4 bus interfaces, functioning as both manager and subordinate, to interact with external memory and allow external CPUs to configure Coral NPU&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;System Requirements&lt;/h2&gt; 
&lt;ul&gt; 
 &lt;li&gt;Bazel 7.4.1&lt;/li&gt; 
 &lt;li&gt;Python 3.9-3.12 (3.13 support is in progress)&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://srecord.sourceforge.net/&quot;&gt;SRecord&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;Verification &amp;amp; Testing&lt;/h2&gt; 
&lt;p&gt;For details on our testing methodologies and how to run or write tests, see the corresponding test READMEs:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/google-coral/coralnpu/main/tests/cocotb/README.md&quot;&gt;Cocotb Tests (RTL &amp;amp; Netlist simulation)&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/google-coral/coralnpu/main/tests/uvm/README.md&quot;&gt;UVM Testbench (Co-simulation)&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;Quick Start&lt;/h2&gt; 
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Ensure that test suite passes
bazel run //tests/cocotb:core_mini_axi_sim_cocotb

# Build a binary
bazel build //examples:coralnpu_v2_hello_world_add_floats

# Build the Simulator (non-RVV for shorter build time):
bazel build //tests/verilator_sim:core_mini_axi_sim

# Run the binary on the simulator:
bazel-bin/tests/verilator_sim/core_mini_axi_sim --binary bazel-out/k8-fastbuild-ST-dd8dc713f32d/bin/examples/coralnpu_v2_hello_world_add_floats.elf
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/google-coral/coralnpu/main/doc/images/Coral_Logo_200px-2x.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/2d73835f5ed3713dbf3012e3bf6469a3ec771fa67e8ba9cf23570529c043c0c9/google-coral/coralnpu" medium="image" />
      
    </item>
    
    <item>
      <title>radian-software/apheleia</title>
      <link>https://github.com/radian-software/apheleia</link>
      <description>&lt;p&gt;🌷 Run code formatter on buffer contents without moving point, using RCS patches and dynamic programming.&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;Apheleia&lt;/h1&gt; 
&lt;p&gt;Good code is automatically formatted by tools like &lt;a href=&quot;https://github.com/python/black&quot;&gt;Black&lt;/a&gt; or &lt;a href=&quot;https://prettier.io/&quot;&gt;Prettier&lt;/a&gt; so that you and your team spend less time on formatting and more time on building features. It&#39;s best if your editor can run code formatters each time you save a file, so that you don&#39;t have to look at badly formatted code or get surprised when things change just before you commit. However, running a code formatter on save suffers from the following two problems:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;It takes some time (e.g. around 200ms for Black on an empty file), which makes the editor feel less responsive.&lt;/li&gt; 
 &lt;li&gt;It invariably moves your cursor (point) somewhere unexpected if the changes made by the code formatter are too close to point&#39;s position.&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;Apheleia is an &lt;a href=&quot;https://www.gnu.org/software/emacs/&quot;&gt;Emacs&lt;/a&gt; package which solves both of these problems comprehensively for all languages, allowing you to say goodbye to language-specific packages such as &lt;a href=&quot;https://github.com/proofit404/blacken&quot;&gt;Blacken&lt;/a&gt; and &lt;a href=&quot;https://github.com/prettier/prettier-emacs&quot;&gt;prettier-js&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;The approach is as follows:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;Run code formatters on &lt;code&gt;after-save-hook&lt;/code&gt;, rather than &lt;code&gt;before-save-hook&lt;/code&gt;, and do so asynchronously. Once the formatter has finished running, check if the buffer has been modified since it started; only apply the changes if not.&lt;/li&gt; 
 &lt;li&gt;After running the code formatter, generate an &lt;a href=&quot;https://web.archive.org/web/20220527003730/https://tools.ietf.org/doc/tcllib/html/rcs.html#section4&quot;&gt;RCS patch&lt;/a&gt; showing the changes and then apply it to the buffer. This prevents changes elsewhere in the buffer from moving point. If a patch region happens to include point, then use a &lt;a href=&quot;https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm&quot;&gt;dynamic programming algorithm for string alignment&lt;/a&gt; to determine where point should be moved so that it remains in the same place relative to its surroundings. Finally, if the vertical position of point relative to the window has changed, adjust the scroll position to maintain maximum visual continuity. (This includes iterating through all windows displaying the buffer, if there are more than one.) The dynamic programming algorithm runs in quadratic time, which is why it is only applied if necessary and to a single patch region.&lt;/li&gt; 
&lt;/ol&gt; 
&lt;h2&gt;Installation&lt;/h2&gt; 
&lt;p&gt;Apheleia is available on &lt;a href=&quot;https://melpa.org/&quot;&gt;MELPA&lt;/a&gt;. It is easiest to install it using &lt;a href=&quot;https://github.com/radian-software/straight.el&quot;&gt;&lt;code&gt;straight.el&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(straight-use-package &#39;apheleia)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;However, you may install using any other package manager if you prefer.&lt;/p&gt; 
&lt;h3&gt;Dependencies&lt;/h3&gt; 
&lt;p&gt;Emacs 27 or later is supported. Apheleia does not include any formatters. You must install any formatter separately that you wish to use. As long as it is on &lt;code&gt;$PATH&lt;/code&gt; then Apheleia will pick it up automatically; missing formatters will silently be skipped, but errors from invoking installed formatters will be reported on buffer save.&lt;/p&gt; 
&lt;p&gt;It is recommended to have Bash installed, as this is used as a dependency for Apheleia to invoke certain formatters (e.g. Node.js-based formatters).&lt;/p&gt; 
&lt;p&gt;Windows support is not guaranteed due to lack of support for common open standards on this platform. Pull requests adjusting Apheleia for improved cross-platform portability will be accepted, but no guarantees are made about stability on Windows.&lt;/p&gt; 
&lt;h2&gt;User guide&lt;/h2&gt; 
&lt;p&gt;To your init-file, add the following form:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(apheleia-global-mode +1)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;The autoloading has been configured so that this will &lt;em&gt;not&lt;/em&gt; cause Apheleia to be loaded until you save a file.&lt;/p&gt; 
&lt;p&gt;By default, Apheleia is configured to format with &lt;a href=&quot;https://github.com/python/black&quot;&gt;Black&lt;/a&gt;, &lt;a href=&quot;https://prettier.io/&quot;&gt;Prettier&lt;/a&gt;, and &lt;a href=&quot;https://golang.org/cmd/gofmt/&quot;&gt;Gofmt&lt;/a&gt; on save in all relevant major modes. To configure this, you can adjust the values of the following variables:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;apheleia-formatters&lt;/code&gt;: Alist mapping names of formatters (symbols like &lt;code&gt;black&lt;/code&gt; and &lt;code&gt;prettier&lt;/code&gt;) to commands used to run those formatters (such as &lt;code&gt;(&quot;black&quot; &quot;-&quot;)&lt;/code&gt; and &lt;code&gt;(npx &quot;prettier&quot; input)&lt;/code&gt;). See the docstring for more information. 
  &lt;ul&gt; 
   &lt;li&gt; &lt;p&gt;You can manipulate this alist using standard Emacs functions. For example, to add some command-line options to Black, you could use:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(setf (alist-get &#39;black apheleia-formatters)
      &#39;(&quot;black&quot; &quot;--option&quot; &quot;...&quot; &quot;-&quot;))
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
   &lt;li&gt; &lt;p&gt;There are a list of symbols that are interpreted by apheleia specially when formatting a command (example: &lt;code&gt;npx&lt;/code&gt;). Any non-string entries in a formatter that doesn&#39;t equal one of these symbols is evaluated and replaced in place. This can be used to pass certain flags to the formatter process depending on the state of the current buffer. For example:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(push &#39;(shfmt . (&quot;beautysh&quot;
                 &quot;-filename&quot; filepath
                 (when-let ((indent (bound-and-true-p sh-basic-offset)))
                   (list &quot;--indent-size&quot; (number-to-string indent)))
                 (when indent-tabs-mode &quot;--tab&quot;)
                 &quot;-&quot;))
      apheleia-formatters)
&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;This adds an entry to &lt;code&gt;apheleia-formatters&lt;/code&gt; for the &lt;code&gt;beautysh&lt;/code&gt; formatter. The evaluated entries makes it so that the &lt;code&gt;--tab&lt;/code&gt; flag is only passed to &lt;code&gt;beautysh&lt;/code&gt; when the value of &lt;code&gt;indent-tabs-mode&lt;/code&gt; is true. Similarly the indent-size flag is passed the exact value of the &lt;code&gt;sh-basic-offset&lt;/code&gt; variable only when it is bound. Observe that one of these evaluations returns a list of flags whereas the other returns a single string. These are substituted into the command as you&#39;d expect.&lt;/p&gt; &lt;/li&gt; 
   &lt;li&gt; &lt;p&gt;You can also use Apheleia to format buffers that have no underlying files. In this case the value of &lt;code&gt;file&lt;/code&gt; and &lt;code&gt;filepath&lt;/code&gt; will be the name of the current buffer with any special characters for the file-system (such as &lt;code&gt;*&lt;/code&gt; on windows) being stripped out.&lt;/p&gt; &lt;p&gt;This is also how the extension for any temporary files apheleia might create will be determined. If you&#39;re using a formatter that determines the file-type from the extension you should name such buffers such that their suffixed with the extension. For example a buffer called &lt;code&gt;*foo-bar.c*&lt;/code&gt; that has no associated file will have an implicit file-name of &lt;code&gt;foo-bar.c&lt;/code&gt; and any temporary files will be suffixed with a &lt;code&gt;.c&lt;/code&gt; extension.&lt;/p&gt; &lt;/li&gt; 
   &lt;li&gt; &lt;p&gt;You can implement formatters as arbitrary Elisp functions which operate directly on a buffer, without needing to invoke an external command. This can be useful to integrate with e.g. language servers. See the docstring for more information on the expected interface for Elisp formatters.&lt;/p&gt; &lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;apheleia-mode-alist&lt;/code&gt;: Alist mapping major modes and filename regexps to names of formatters to use in those modes and files. See the docstring for more information. 
  &lt;ul&gt; 
   &lt;li&gt; &lt;p&gt;You can use this variable to configure multiple formatters for the same buffer by setting the &lt;code&gt;cdr&lt;/code&gt; of an entry to a list of formatters to run instead of a single formatter. For example you may want to run &lt;code&gt;isort&lt;/code&gt; and &lt;code&gt;black&lt;/code&gt; one after the other.&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(setf (alist-get &#39;isort apheleia-formatters)
      &#39;(&quot;isort&quot; &quot;--stdout&quot; &quot;-&quot;))
(setf (alist-get &#39;python-mode apheleia-mode-alist)
      &#39;(isort black))
&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;This will make apheleia run &lt;code&gt;isort&lt;/code&gt; on the current buffer and then &lt;code&gt;black&lt;/code&gt; on the result of &lt;code&gt;isort&lt;/code&gt; and then use the final output to format the current buffer.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;: At the moment there&#39;s no smart or configurable error handling in place. This means if one of the configured formatters fail (for example if &lt;code&gt;isort&lt;/code&gt; isn&#39;t installed) then apheleia just doesn&#39;t format the buffer at all, even if &lt;code&gt;black&lt;/code&gt; is installed.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; If a formatter uses &lt;code&gt;file&lt;/code&gt; (rather than &lt;code&gt;filepath&lt;/code&gt; or &lt;code&gt;input&lt;/code&gt; or none of these keywords), it can&#39;t be chained after another formatter, because &lt;code&gt;file&lt;/code&gt; implies that the formatter must read from the &lt;em&gt;original&lt;/em&gt; file, not an intermediate temporary file. For this reason it&#39;s suggested to avoid the use of &lt;code&gt;file&lt;/code&gt; in general.&lt;/p&gt; &lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;apheleia-formatter&lt;/code&gt;: Optional buffer-local variable specifying the formatter to use in this buffer. Overrides &lt;code&gt;apheleia-mode-alist&lt;/code&gt;. You can set this in a local variables list, or in &lt;code&gt;.dir-locals.el&lt;/code&gt; (e.g. &lt;code&gt;((python-mode . ((apheleia-formatter . (isort black)))))&lt;/code&gt;), or in a custom hook of your own that sets the local variable conditionally.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;apheleia-inhibit&lt;/code&gt;: Optional buffer-local variable, if set to non-nil then Apheleia does not turn on automatically even if &lt;code&gt;apheleia-global-mode&lt;/code&gt; is on.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;You can run &lt;code&gt;M-x apheleia-mode&lt;/code&gt; to toggle automatic formatting on save in a single buffer, or &lt;code&gt;M-x apheleia-global-mode&lt;/code&gt; to toggle the default setting for all buffers. Also, even if &lt;code&gt;apheleia-mode&lt;/code&gt; is not enabled, you can run &lt;code&gt;M-x apheleia-format-buffer&lt;/code&gt; to manually invoke the configured formatter for the current buffer. Running with a prefix argument will cause the command to prompt you for which formatter to run.&lt;/p&gt; 
&lt;p&gt;Apheleia does not currently support TRAMP, and is therefore automatically disabled for remote files.&lt;/p&gt; 
&lt;p&gt;If an error occurs while formatting, a message is displayed in the echo area. You can jump to the error by invoking &lt;code&gt;M-x apheleia-goto-error&lt;/code&gt;, or manually switch to the log buffer mentioned in the message.&lt;/p&gt; 
&lt;p&gt;You can configure error reporting using the following user options:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;apheleia-hide-log-buffers&lt;/code&gt;: By default, errors from formatters are put in buffers named like &lt;code&gt;*apheleia-cmdname-log*&lt;/code&gt;. If you customize this user option to non-nil then a space is prepended to the names of these buffers, hiding them by default in &lt;code&gt;switch-to-buffer&lt;/code&gt; (you must type a space to see them).&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;apheleia-log-only-errors&lt;/code&gt;: By default, only failed formatter runs are logged. If you customize this user option to nil then all runs are logged, along with whether or not they succeeded. This could be helpful in debugging.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;The following user options are also available:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;apheleia-post-format-hook&lt;/code&gt;: Normal hook run after Apheleia formats a buffer. Run if the formatting is successful, even when no changes are made to the buffer.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;apheleia-max-alignment-size&lt;/code&gt;: The maximum number of characters that a diff region can have to be processed using Apheleia&#39;s dynamic programming algorithm for point alignment. This cannot be too big or Emacs will hang noticeably on large reformatting operations, since the DP algorithm is quadratic-time.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;apheleia-mode-lighter&lt;/code&gt;: &lt;code&gt;apheleia-mode&lt;/code&gt; lighter displayed in the mode-line. If you don&#39;t want to display it, use nil. Otherwise, its value must be a string.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Apheleia exposes some hooks for advanced customization:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;apheleia-formatter-exited-hook&lt;/code&gt;: Abnormal hook which is run after a formatter has completely finished running for a buffer. Not run if the formatting was interrupted and no action was taken. Receives two arguments: the symbol for the formatter that was run (e.g. &lt;code&gt;black&lt;/code&gt;, or it could be a list if multiple formatters were run in a chain), and a boolean for whether there was an error.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;apheleia-inhibit-functions&lt;/code&gt;: List of functions to run before turning on Apheleia automatically from &lt;code&gt;apheleia-global-mode&lt;/code&gt;. If one of these returns non-nil then &lt;code&gt;apheleia-mode&lt;/code&gt; is not enabled in the buffer.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;apheleia-skip-functions&lt;/code&gt;: List of functions to run before &lt;em&gt;each&lt;/em&gt; Apheleia formatter invocation. If one of these returns non-nil then the formatter is not run, even if &lt;code&gt;apheleia-mode&lt;/code&gt; is enabled.&lt;/p&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Formatter configuration&lt;/h3&gt; 
&lt;p&gt;There is no configuration interface in Apheleia for formatter behavior. The way to configure a formatter is by editing a standard config file that it reads (e.g. &lt;code&gt;.prettierrc.json&lt;/code&gt;), or setting an environment variable that it reads, or by changing the entry in &lt;code&gt;apheleia-formatters&lt;/code&gt; to customize the command-line arguments.&lt;/p&gt; 
&lt;p&gt;There is one exception to this, which is that Apheleia&#39;s default command-line arguments for the built-in formatters will automatically check Emacs&#39; indentation options for the corresponding major mode, and pass that information to the formatter. This way, the indentation (tabs vs spaces, and how many) applied by the formatter will match what electric indentation in Emacs is doing, preventing a shuffle back and forth as you type.&lt;/p&gt; 
&lt;p&gt;This behavior can be disabled by setting &lt;code&gt;apheleia-formatters-respect-indent-level&lt;/code&gt; to nil.&lt;/p&gt; 
&lt;h2&gt;Troubleshooting&lt;/h2&gt; 
&lt;p&gt;Try running your formatter outside of Emacs to verify it works there. Check what command-line options it is configured with in &lt;code&gt;apheleia-formatters&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;To debug internal bugs, race conditions, or performance issues, try setting &lt;code&gt;apheleia-log-debug-info&lt;/code&gt; to non-nil and check the contents of &lt;code&gt;*apheleia-debug-log*&lt;/code&gt;. It will have detailed trace information about most operations performed by Apheleia.&lt;/p&gt; 
&lt;h3&gt;Known issues&lt;/h3&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;process aphelieia-whatever no longer connected to pipe; closed it&lt;/code&gt;: This happens on older Emacs versions when formatting a buffer with size greater than 65,536 characters. There is no known workaround besides disabling &lt;code&gt;apheleia-mode&lt;/code&gt; for the affected buffer, or upgrading to a more recent version of Emacs. See &lt;a href=&quot;https://github.com/radian-software/apheleia/issues/20&quot;&gt;#20&lt;/a&gt;.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;Contributing&lt;/h2&gt; 
&lt;p&gt;Please see &lt;a href=&quot;https://github.com/radian-software/contributor-guide&quot;&gt;the contributor guide for my projects&lt;/a&gt; for general information, and the following sections for Apheleia-specific details.&lt;/p&gt; 
&lt;p&gt;There&#39;s also a &lt;a href=&quot;https://github.com/radian-software/apheleia/wiki&quot;&gt;wiki&lt;/a&gt; that could do with additions/clarity. Any improvement suggestions should be submitted as an issue.&lt;/p&gt; 
&lt;h3&gt;Adding a formatter&lt;/h3&gt; 
&lt;p&gt;I have done my best to make it straightforward to add a formatter. You just follow these steps:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;Install your formatter on your machine so you can test.&lt;/li&gt; 
 &lt;li&gt;Create an entry in &lt;code&gt;apheleia-formatters&lt;/code&gt; with how to run it. (See the docstring of this variable for explanation about the available keywords.)&lt;/li&gt; 
 &lt;li&gt;Add entries for the relevant major modes in &lt;code&gt;apheleia-mode-alist&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;See if it works for you!&lt;/li&gt; 
 &lt;li&gt;Add a file at &lt;code&gt;test/formatters/installers/yourformatter.bash&lt;/code&gt; which explains how to install the formatter on Ubuntu. This will be used by CI.&lt;/li&gt; 
 &lt;li&gt;Test with &lt;code&gt;make fmt-build FORMATTERS=yourformatter&lt;/code&gt; to do the installation, then &lt;code&gt;make fmt-docker&lt;/code&gt; to start a shell with the formatter available. Verify it runs in this environment.&lt;/li&gt; 
 &lt;li&gt;Add an example input (pre-formatting) and output (post-formatting) file at &lt;code&gt;test/formatters/samplecode/yourformatter/in.whatever&lt;/code&gt; and &lt;code&gt;test/formatters/samplecode/yourformatter/out.whatever&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;Verify that the tests are passing, using &lt;code&gt;make fmt-test FORMATTERS=yourformatter&lt;/code&gt; from inside the &lt;code&gt;fmt-docker&lt;/code&gt; shell.&lt;/li&gt; 
 &lt;li&gt;Submit a pull request, CI should now be passing!&lt;/li&gt; 
&lt;/ol&gt; 
&lt;h2&gt;Acknowledgements&lt;/h2&gt; 
&lt;p&gt;I got the idea for using RCS patches to avoid moving point too much from &lt;a href=&quot;https://github.com/prettier/prettier-emacs&quot;&gt;prettier-js&lt;/a&gt;, although that package does not implement the dynamic programming algorithm which Apheleia uses to guarantee stability of point even within a formatted region.&lt;/p&gt; 
&lt;p&gt;Note that despite this inspiration, Apheleia is a clean-room implementation which is free of the copyright terms of prettier-js.&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/779e3b40e9f2286889a9741fa4ea2cef14517ae360adbf2dc32b8273b2f7537c/radian-software/apheleia" medium="image" />
      
    </item>
    
    <item>
      <title>purcell/exec-path-from-shell</title>
      <link>https://github.com/purcell/exec-path-from-shell</link>
      <description>&lt;p&gt;Make Emacs use the $PATH set up by the user&#39;s shell&lt;/p&gt;&lt;hr&gt;&lt;p&gt;&lt;a href=&quot;https://melpa.org/#/exec-path-from-shell&quot;&gt;&lt;img src=&quot;http://melpa.org/packages/exec-path-from-shell-badge.svg?sanitize=true&quot; alt=&quot;Melpa Status&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://stable.melpa.org/#/exec-path-from-shell&quot;&gt;&lt;img src=&quot;http://stable.melpa.org/packages/exec-path-from-shell-badge.svg?sanitize=true&quot; alt=&quot;Melpa Stable Status&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://elpa.nongnu.org/nongnu/exec-path-from-shell.html&quot;&gt;&lt;img src=&quot;https://elpa.nongnu.org/nongnu/exec-path-from-shell.svg?sanitize=true&quot; alt=&quot;NonGNU ELPA Status&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell/actions/workflows/test.yml&quot;&gt;&lt;img src=&quot;https://github.com/purcell/exec-path-from-shell/actions/workflows/test.yml/badge.svg?sanitize=true&quot; alt=&quot;Build Status&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://www.patreon.com/sanityinc&quot;&gt;&lt;img alt=&quot;Support me&quot; src=&quot;https://img.shields.io/badge/Support%20Me-%F0%9F%92%97-ff69b4.svg?sanitize=true&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;h1&gt;exec-path-from-shell&lt;/h1&gt; 
&lt;p&gt;A GNU Emacs library to ensure environment variables inside Emacs look the same as in the user&#39;s shell.&lt;/p&gt; 
&lt;h2&gt;Motivation&lt;/h2&gt; 
&lt;p&gt;Ever find that a command works in your shell, but not in Emacs?&lt;/p&gt; 
&lt;p&gt;This happens a lot on OS X, where an Emacs instance launched as a GUI app inherits a default minimal set of environment variables that are probably not the ones you see in a terminal window. Similarly, if you start Emacs as a daemon from &lt;code&gt;systemd&lt;/code&gt; or &lt;code&gt;launchd&lt;/code&gt;, it will run with a default set of environment variables.&lt;/p&gt; 
&lt;p&gt;This library solves this problem by copying important environment variables from the user&#39;s shell: it works by asking your shell to print out the variables of interest, then copying them into the Emacs environment.&lt;/p&gt; 
&lt;h2&gt;Compatibility&lt;/h2&gt; 
&lt;p&gt;Supported shells:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;zsh&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;bash&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;tcsh&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;fish&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;nu&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Note that shell variables which have not been exported as environment variables (e.g. using the &quot;export&quot; keyword) may not be visible to &lt;code&gt;exec-path-from-shell&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;If you experience issues, enable the variable &lt;code&gt;exec-path-from-shell-debug&lt;/code&gt; before runnin functions from the package: this will produce detailed logging in &lt;code&gt;*Messages*&lt;/code&gt; about the shell command line and output.&lt;/p&gt; 
&lt;p&gt;There is a &lt;a href=&quot;https://github.com/timfel/exec-path-from-powershell&quot;&gt;compatible package&lt;/a&gt; if you are using &lt;code&gt;powershell&lt;/code&gt; or &lt;code&gt;pwsh&lt;/code&gt; so you can share Emacs config with platforms that use that shell.&lt;/p&gt; 
&lt;h2&gt;Installation&lt;/h2&gt; 
&lt;p&gt;Installable packages are available via MELPA: do &lt;code&gt;M-x package-install RET exec-path-from-shell RET&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Alternatively, &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell/tags&quot;&gt;download&lt;/a&gt; the latest release or clone the repository, and install &lt;code&gt;exec-path-from-shell.el&lt;/code&gt; with &lt;code&gt;M-x package-install-file&lt;/code&gt;.&lt;/p&gt; 
&lt;h2&gt;Usage&lt;/h2&gt; 
&lt;p&gt;Add the following to your &lt;code&gt;init.el&lt;/code&gt; (after calling &lt;code&gt;package-initialize&lt;/code&gt;):&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(when (memq window-system &#39;(mac ns x pgtk))
  (exec-path-from-shell-initialize))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This sets &lt;code&gt;$MANPATH&lt;/code&gt;, &lt;code&gt;$PATH&lt;/code&gt; and &lt;code&gt;exec-path&lt;/code&gt; from your shell, but only when executed in a GUI frame on OS X and Linux.&lt;/p&gt; 
&lt;p&gt;If you launch Emacs as a daemon from &lt;code&gt;systemd&lt;/code&gt; or similar, you might like to use the following snippet:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(when (daemonp)
  (exec-path-from-shell-initialize))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;You can copy values of other environment variables by customizing &lt;code&gt;exec-path-from-shell-variables&lt;/code&gt; before invoking &lt;code&gt;exec-path-from-shell-initialize&lt;/code&gt;, or by calling &lt;code&gt;exec-path-from-shell-copy-env&lt;/code&gt;, e.g.:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(exec-path-from-shell-copy-env &quot;PYTHONPATH&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This function may also be called interactively.&lt;/p&gt; 
&lt;p&gt;The author uses the following configuration snippet before calling &lt;code&gt;exec-path-from-shell-initialize&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(require &#39;exec-path-from-shell)
(dolist (var &#39;(&quot;SSH_AUTH_SOCK&quot; &quot;SSH_AGENT_PID&quot; &quot;GPG_AGENT_INFO&quot; &quot;LANG&quot; &quot;LC_CTYPE&quot; &quot;NIX_SSL_CERT_FILE&quot; &quot;NIX_PATH&quot;))
  (add-to-list &#39;exec-path-from-shell-variables var))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h3&gt;Setting up your shell startup files correctly&lt;/h3&gt; 
&lt;p&gt;Note that your shell will inherit Emacs&#39;s environment variables when it is run by &lt;code&gt;exec-path-from-shell&lt;/code&gt; -- to avoid surprises your config files should therefore set the environment variables to their exact desired final values, i.e. don&#39;t do this:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;export PATH=/usr/local/bin:$PATH
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;but instead do this:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;export PATH=/usr/local/bin:/usr/bin:/bin
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;To be safe, &lt;code&gt;exec-path-from-shell&lt;/code&gt; starts an interactive (and login) shell by default, but this can be much slower than necessary. Interactive shells often have fancy features enabled that are only helpful when one interacts directly with the shell, and this can frequently cause startup time to exceed 750ms. This can be avoided:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Follow best practice by setting your environment variables so that they are available to both interactive and non-interactive shells. In practical terms, for most people this means setting them in &lt;code&gt;~/.profile&lt;/code&gt;, &lt;code&gt;~/.bash_profile&lt;/code&gt;, &lt;code&gt;~/.zshenv&lt;/code&gt; instead of &lt;code&gt;~/.bashrc&lt;/code&gt; and &lt;code&gt;~/.zshrc&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;Once a non-interactive shell sets your environment variables correctly, adjust &lt;code&gt;exec-path-from-shell-arguments&lt;/code&gt; appropriately (often to &lt;code&gt;nil&lt;/code&gt;) before calling &lt;code&gt;exec-path-from-shell-initialize&lt;/code&gt; so that it will start a non-interactive shell.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;To learn more about how popular shells load start-up files, read &lt;a href=&quot;https://blog.flowblok.id.au/2013-02/shell-startup-scripts.html&quot;&gt;this helpful article&lt;/a&gt;.&lt;/p&gt; 
&lt;h2&gt;Making &lt;code&gt;exec-path-from-shell&lt;/code&gt; faster&lt;/h2&gt; 
&lt;p&gt;If evaluation takes more than &lt;code&gt;exec-path-from-shell-warn-duration-millis&lt;/code&gt; (500ms by default) then &lt;code&gt;exec-path-from-shell&lt;/code&gt; will print a warning.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Non-interactive shells start up faster. Follow the steps in the section above so that you can run your shell without &lt;code&gt;-i&lt;/code&gt; and still get the right environment variable settings. When &lt;code&gt;&quot;-i&quot;&lt;/code&gt; is then removed from &lt;code&gt;exec-path-from-shell-arguments&lt;/code&gt;, this package becomes more efficient.&lt;/li&gt; 
 &lt;li&gt;Invoking the shell has a non-trivial overhead in any case. Don&#39;t call &lt;code&gt;exec-path-from-shell-copy-env&lt;/code&gt; repeatedly, since each invocation starts a shell. Instead, set &lt;code&gt;exec-path-from-shell-variables&lt;/code&gt; to the full list of vars you want, and call &lt;code&gt;exec-path-from-shell-initialize&lt;/code&gt; once.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;Further help&lt;/h2&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;C-h f exec-path-from-shell-initialize&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;C-h f exec-path-from-shell-copy-env&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;hr /&gt; 
&lt;p&gt;&lt;a href=&quot;https://www.patreon.com/sanityinc&quot;&gt;💝 Support this project and my other Open Source work via Patreon&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://uk.linkedin.com/in/stevepurcell&quot;&gt;💼 LinkedIn profile&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;http://www.sanityinc.com/&quot;&gt;✍ sanityinc.com&lt;/a&gt;&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/9bfd1e068751ccca762a92c1c6b8d5fe569aafb1a2c8e8cbab7ebbd63f8c9017/purcell/exec-path-from-shell" medium="image" />
      
    </item>
    
    <item>
      <title>company-mode/company-mode</title>
      <link>https://github.com/company-mode/company-mode</link>
      <description>&lt;p&gt;Modular in-buffer completion framework for Emacs&lt;/p&gt;&lt;hr&gt;&lt;p&gt;See the homepage for &lt;a href=&quot;http://company-mode.github.io/&quot;&gt;installation and usage instructions&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;File a bug report in &lt;a href=&quot;https://github.com/company-mode/company-mode/issues&quot;&gt;Issues&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;Ask a question or suggest a feature in &lt;a href=&quot;https://github.com/company-mode/company-mode/discussions/&quot;&gt;Discussions&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://github.com/company-mode/company-mode/raw/master/CONTRIBUTING.md&quot;&gt;Contributing&lt;/a&gt; on other ways to help out.&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://github.com/company-mode/company-mode/actions/workflows/ci.yml&quot;&gt;&lt;img src=&quot;https://github.com/company-mode/company-mode/actions/workflows/ci.yml/badge.svg?sanitize=true&quot; alt=&quot;Build Status&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/&quot;&gt;&lt;img src=&quot;https://img.shields.io/static/v1?logo=gnuemacs&amp;amp;logoColor=fafafa&amp;amp;label=Made%20for&amp;amp;message=GNU%20Emacs&amp;amp;color=7F5AB6&amp;amp;style=flat&quot; alt=&quot;GNU Emacs&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://melpa.org/#/company&quot;&gt;&lt;img src=&quot;https://melpa.org/packages/company-badge.svg?sanitize=true&quot; alt=&quot;MELPA&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://elpa.gnu.org/packages/company.html&quot;&gt;&lt;img src=&quot;https://elpa.gnu.org/packages/company.svg?sanitize=true&quot; alt=&quot;GNU ELPA&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://elpa.gnu.org/devel/company.html&quot;&gt;&lt;img src=&quot;https://elpa.gnu.org/devel/company.svg?sanitize=true&quot; alt=&quot;GNU-devel ELPA&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/79415c38a0d7f8c04fab4813ebf8df84bf97f43605f0128a296e1ed4103639c2/company-mode/company-mode" medium="image" />
      
    </item>
    
    <item>
      <title>Fanael/rainbow-delimiters</title>
      <link>https://github.com/Fanael/rainbow-delimiters</link>
      <description>&lt;p&gt;Emacs rainbow delimiters mode&lt;/p&gt;&lt;hr&gt;&lt;p&gt;&lt;a href=&quot;http://melpa.org/#/rainbow-delimiters&quot;&gt;&lt;img src=&quot;http://melpa.org/packages/rainbow-delimiters-badge.svg?sanitize=true&quot; alt=&quot;MELPA&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://stable.melpa.org/#/rainbow-delimiters&quot;&gt;&lt;img src=&quot;http://stable.melpa.org/packages/rainbow-delimiters-badge.svg?sanitize=true&quot; alt=&quot;MELPA Stable&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://github.com/Fanael/rainbow-delimiters/actions&quot;&gt;&lt;img src=&quot;https://github.com/Fanael/rainbow-delimiters/workflows/CI/badge.svg?sanitize=true&quot; alt=&quot;Build Status&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;h1&gt;rainbow-delimiters&lt;/h1&gt; 
&lt;p&gt;&lt;code&gt;rainbow-delimiters&lt;/code&gt; is a &quot;rainbow parentheses&quot;-like mode which highlights delimiters such as parentheses, brackets or braces according to their depth. Each successive level is highlighted in a different color. This makes it easy to spot matching delimiters, orient yourself in the code, and tell which statements are at a given depth.&lt;/p&gt; 
&lt;p&gt;Great care has been taken to make this mode fast. You shouldn&#39;t see any change in scrolling or editing speed when it&#39;s on even when working in delimiter-rich languages like Clojure or Emacs Lisp. It can be used with any language.&lt;/p&gt; 
&lt;p&gt;You can customize the colors &lt;code&gt;rainbow-delimiters&lt;/code&gt; uses. The default colors are intentionally subtle; they are unobtrusive enough to make the mode worth looking at even if you usually don&#39;t like rainbow parentheses modes. A number of major color themes such as Zenburn and Solarized have added their own faces for the mode.&lt;/p&gt; 
&lt;p&gt;This is the official github repository for &lt;code&gt;rainbow-delimiters&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;The latest &lt;strong&gt;release&lt;/strong&gt; of &lt;code&gt;rainbow-delimiters&lt;/code&gt; is always found at &lt;a href=&quot;https://github.com/Fanael/rainbow-delimiters/tree/master&quot;&gt;https://github.com/Fanael/rainbow-delimiters/tree/master&lt;/a&gt;&lt;/p&gt; 
&lt;h2&gt;Installation&lt;/h2&gt; 
&lt;p&gt;The recommended way is to use &lt;a href=&quot;http://melpa.org/&quot;&gt;MELPA&lt;/a&gt; or &lt;a href=&quot;http://stable.melpa.org/&quot;&gt;MELPA Stable&lt;/a&gt;. If either is in your &lt;code&gt;package-archives&lt;/code&gt;, do&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;M-x package-install RET rainbow-delimiters RET
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Otherwise, open &lt;code&gt;rainbow-delimiters.el&lt;/code&gt; in Emacs and use&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;M-x package-install-from-buffer
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Any other methods of installation are unsupported.&lt;/p&gt; 
&lt;h2&gt;Usage&lt;/h2&gt; 
&lt;p&gt;To toggle the mode in the current buffer:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;M-x rainbow-delimiters-mode
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;To start the mode automatically in &lt;code&gt;foo-mode&lt;/code&gt;, add the following to your init file:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(add-hook &#39;foo-mode-hook #&#39;rainbow-delimiters-mode)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;To start the mode automatically in most programming modes (Emacs 24 and above):&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(add-hook &#39;prog-mode-hook #&#39;rainbow-delimiters-mode)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h3&gt;Global mode&lt;/h3&gt; 
&lt;p&gt;There&#39;s no &lt;code&gt;global-rainbow-delimiters-mode&lt;/code&gt; anymore. It used to exist, but it was impossible to keep it from breaking some major modes. It&#39;s &lt;em&gt;strongly recommended&lt;/em&gt; to use major mode hooks instead, as shown above. There&#39;s nothing stopping you from defining &lt;code&gt;global-rainbow-delimiters-mode&lt;/code&gt; yourself, but if it breaks something, you&#39;re on your own.&lt;/p&gt; 
&lt;h2&gt;Customization&lt;/h2&gt; 
&lt;p&gt;To customize various options, including the color theme:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;M-x customize-group rainbow-delimiters
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;You can specify custom colors by customizing following faces:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Faces take the form &lt;code&gt;rainbow-delimiters-depth-N-face&lt;/code&gt;, with N being the depth. Depth begins at 1, the outermost color. Faces exist for depths 1-9.&lt;/li&gt; 
 &lt;li&gt;The unmatched delimiter face: &lt;code&gt;rainbow-delimiters-unmatched-face&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;The mismatched delimiter face: &lt;code&gt;rainbow-delimiters-mismatched-face&lt;/code&gt;.&lt;/li&gt; 
&lt;/ul&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/517ea199252acbf3a7506bf1a74fcbbec48dcf48be90a6aca5f8c00f478b229c/Fanael/rainbow-delimiters" medium="image" />
      
    </item>
    
    <item>
      <title>magnars/dash.el</title>
      <link>https://github.com/magnars/dash.el</link>
      <description>&lt;p&gt;A modern list library for Emacs&lt;/p&gt;&lt;hr&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/magnars/dash.el/actions/workflows/test.yml&quot;&gt;&lt;img src=&quot;https://github.com/magnars/dash.el/actions/workflows/test.yml/badge.svg?sanitize=true&quot; alt=&quot;CI&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://elpa.gnu.org/packages/dash.html&quot;&gt;&lt;img src=&quot;https://elpa.gnu.org/packages/dash.svg?sanitize=true&quot; alt=&quot;GNU ELPA&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://elpa.gnu.org/devel/dash.html&quot;&gt;&lt;img src=&quot;https://elpa.gnu.org/devel/dash.svg?sanitize=true&quot; alt=&quot;GNU-devel ELPA&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://stable.melpa.org/#/dash&quot;&gt;&lt;img src=&quot;https://stable.melpa.org/packages/dash-badge.svg?sanitize=true&quot; alt=&quot;MELPA Stable&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://melpa.org/#/dash&quot;&gt;&lt;img src=&quot;https://melpa.org/packages/dash-badge.svg?sanitize=true&quot; alt=&quot;MELPA&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;h1&gt;&lt;img align=&quot;right&quot; src=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/rainbow-dash.png&quot; /&gt; dash.el&lt;/h1&gt; 
&lt;p&gt;A modern list API for Emacs. No &lt;a href=&quot;https://gnu.org/software/emacs/manual/html_node/cl/&quot;&gt;&lt;code&gt;&#39;cl&lt;/code&gt;&lt;/a&gt; required.&lt;/p&gt; 
&lt;p&gt;See the end of the file for license conditions.&lt;/p&gt; 
&lt;h2&gt;Contents&lt;/h2&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#change-log&quot;&gt;Change log&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#installation&quot;&gt;Installation&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#functions&quot;&gt;Functions&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#contribute&quot;&gt;Contribute&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#contributors&quot;&gt;Contributors&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#license&quot;&gt;License&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;Change log&lt;/h2&gt; 
&lt;p&gt;See the &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/NEWS.md&quot;&gt;&lt;code&gt;NEWS.md&lt;/code&gt;&lt;/a&gt; file.&lt;/p&gt; 
&lt;h2&gt;Installation&lt;/h2&gt; 
&lt;p&gt;Dash is available on &lt;a href=&quot;https://elpa.gnu.org/&quot;&gt;GNU ELPA&lt;/a&gt;, &lt;a href=&quot;https://elpa.gnu.org/devel/&quot;&gt;GNU-devel ELPA&lt;/a&gt;, and &lt;a href=&quot;https://melpa.org/&quot;&gt;MELPA&lt;/a&gt;, and can be installed with the standard command &lt;code&gt;package-install&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;M-x package-install RET dash RET
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;See &lt;a href=&quot;https://gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html&quot;&gt;&lt;code&gt;(info &quot;(emacs) Package Installation&quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;Alternatively, you can just dump &lt;code&gt;dash.el&lt;/code&gt; in your &lt;code&gt;load-path&lt;/code&gt; somewhere. See &lt;a href=&quot;https://gnu.org/software/emacs/manual/html_node/emacs/Lisp-Libraries.html&quot;&gt;&lt;code&gt;(info &quot;(emacs) Lisp Libraries&quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;h3&gt;Using in a package&lt;/h3&gt; 
&lt;p&gt;Add something like this to the library’s headers:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;;; Package-Requires: ((dash &quot;2.20.0&quot;))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;See &lt;a href=&quot;https://gnu.org/software/emacs/manual/html_node/elisp/Library-Headers.html&quot;&gt;&lt;code&gt;(info &quot;(elisp) Library Headers&quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;h3&gt;Fontification of special variables&lt;/h3&gt; 
&lt;p&gt;Font lock of special Dash variables (&lt;code&gt;it&lt;/code&gt;, &lt;code&gt;acc&lt;/code&gt;, etc.) in Emacs Lisp buffers can optionally be enabled with the autoloaded minor mode &lt;code&gt;dash-fontify-mode&lt;/code&gt;. In older Emacs versions which do not dynamically detect macros, the minor mode also fontifies Dash macro calls.&lt;/p&gt; 
&lt;p&gt;To automatically enable the minor mode in all Emacs Lisp buffers, just call its autoloaded global counterpart &lt;code&gt;global-dash-fontify-mode&lt;/code&gt;, either interactively or from your &lt;code&gt;user-init-file&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(global-dash-fontify-mode)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h3&gt;Info symbol lookup&lt;/h3&gt; 
&lt;p&gt;While editing Elisp files, you can use &lt;code&gt;C-h S&lt;/code&gt; (&lt;code&gt;info-lookup-symbol&lt;/code&gt;) to look up Elisp symbols in the relevant Info manuals (see &lt;a href=&quot;https://gnu.org/software/emacs/manual/html_node/emacs/Info-Lookup.html&quot;&gt;&lt;code&gt;(emacs) Info Lookup&lt;/code&gt;&lt;/a&gt;). To enable the same for Dash symbols, use the command &lt;code&gt;dash-register-info-lookup&lt;/code&gt;. It can be called directly when needed, or automatically from your &lt;code&gt;user-init-file&lt;/code&gt;. For example:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(with-eval-after-load &#39;info-look
  (dash-register-info-lookup))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Functions&lt;/h2&gt; 
&lt;p&gt;All functions and constructs in the library use a dash (&lt;code&gt;-&lt;/code&gt;) prefix.&lt;/p&gt; 
&lt;p&gt;The library also provides anaphoric macro versions of functions where that makes sense. The names of these macros are prefixed with two dashes (&lt;code&gt;--&lt;/code&gt;) instead of one.&lt;/p&gt; 
&lt;p&gt;While &lt;code&gt;-map&lt;/code&gt; applies a function to each element of a list, its anaphoric counterpart &lt;code&gt;--map&lt;/code&gt; evaluates a form with the local variable &lt;code&gt;it&lt;/code&gt; temporarily bound to the current list element instead. For example:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-map (lambda (n) (* n n)) &#39;(1 2 3 4)) ; Normal version.
(--map (* it it) &#39;(1 2 3 4))           ; Anaphoric version.
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;The normal version can of course also be written as follows:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(defun my-square (n)
  &quot;Return N multiplied by itself.&quot;
  (* n n))

(-map #&#39;my-square &#39;(1 2 3 4))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This demonstrates the utility of both versions.&lt;/p&gt; 
&lt;h3&gt;Maps&lt;/h3&gt; 
&lt;p&gt;Functions in this category take a transforming function, which is then applied sequentially to each or selected elements of the input list. The results are collected in order and returned as a new list.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-fn-list&quot;&gt;&lt;code&gt;-map&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-when-pred-rep-list&quot;&gt;&lt;code&gt;-map-when&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred rep list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-first-pred-rep-list&quot;&gt;&lt;code&gt;-map-first&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred rep list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-last-pred-rep-list&quot;&gt;&lt;code&gt;-map-last&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred rep list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-indexed-fn-list&quot;&gt;&lt;code&gt;-map-indexed&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-annotate-fn-list&quot;&gt;&lt;code&gt;-annotate&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-splice-pred-fun-list&quot;&gt;&lt;code&gt;-splice&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred fun list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-splice-list-pred-new-list-list&quot;&gt;&lt;code&gt;-splice-list&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred new-list list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-mapcat-fn-list&quot;&gt;&lt;code&gt;-mapcat&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-copy-list&quot;&gt;&lt;code&gt;-copy&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Sublist selection&lt;/h3&gt; 
&lt;p&gt;Functions returning a sublist of the original list.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-filter-pred-list&quot;&gt;&lt;code&gt;-filter&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-pred-list&quot;&gt;&lt;code&gt;-remove&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-first-pred-list&quot;&gt;&lt;code&gt;-remove-first&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-last-pred-list&quot;&gt;&lt;code&gt;-remove-last&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-item-item-list&quot;&gt;&lt;code&gt;-remove-item&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(item list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-non-nil-list&quot;&gt;&lt;code&gt;-non-nil&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-slice-list-from-optional-to-step&quot;&gt;&lt;code&gt;-slice&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list from &amp;amp;optional to step)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-take-n-list&quot;&gt;&lt;code&gt;-take&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-take-last-n-list&quot;&gt;&lt;code&gt;-take-last&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-drop-n-list&quot;&gt;&lt;code&gt;-drop&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-drop-last-n-list&quot;&gt;&lt;code&gt;-drop-last&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-take-while-pred-list&quot;&gt;&lt;code&gt;-take-while&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-drop-while-pred-list&quot;&gt;&lt;code&gt;-drop-while&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-select-by-indices-indices-list&quot;&gt;&lt;code&gt;-select-by-indices&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(indices list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-select-columns-columns-table&quot;&gt;&lt;code&gt;-select-columns&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(columns table)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-select-column-column-table&quot;&gt;&lt;code&gt;-select-column&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(column table)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;List to list&lt;/h3&gt; 
&lt;p&gt;Functions returning a modified copy of the input list.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-keep-fn-list&quot;&gt;&lt;code&gt;-keep&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-concat-rest-sequences&quot;&gt;&lt;code&gt;-concat&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest sequences)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-flatten-l&quot;&gt;&lt;code&gt;-flatten&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(l)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-flatten-n-num-list&quot;&gt;&lt;code&gt;-flatten-n&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(num list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-replace-old-new-list&quot;&gt;&lt;code&gt;-replace&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(old new list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-replace-first-old-new-list&quot;&gt;&lt;code&gt;-replace-first&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(old new list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-replace-last-old-new-list&quot;&gt;&lt;code&gt;-replace-last&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(old new list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-insert-at-n-x-list&quot;&gt;&lt;code&gt;-insert-at&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n x list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-replace-at-n-x-list&quot;&gt;&lt;code&gt;-replace-at&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n x list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-update-at-n-func-list&quot;&gt;&lt;code&gt;-update-at&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n func list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-at-n-list&quot;&gt;&lt;code&gt;-remove-at&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-at-indices-indices-list&quot;&gt;&lt;code&gt;-remove-at-indices&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(indices list)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Reductions&lt;/h3&gt; 
&lt;p&gt;Functions reducing lists to a single value (which may also be a list).&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-from-fn-init-list&quot;&gt;&lt;code&gt;-reduce-from&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn init list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-from-fn-init-list&quot;&gt;&lt;code&gt;-reduce-r-from&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn init list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-fn-list&quot;&gt;&lt;code&gt;-reduce&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-fn-list&quot;&gt;&lt;code&gt;-reduce-r&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-from-fn-init-list&quot;&gt;&lt;code&gt;-reductions-from&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn init list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-r-from-fn-init-list&quot;&gt;&lt;code&gt;-reductions-r-from&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn init list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-fn-list&quot;&gt;&lt;code&gt;-reductions&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-r-fn-list&quot;&gt;&lt;code&gt;-reductions-r&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-count-pred-list&quot;&gt;&lt;code&gt;-count&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-sum-list&quot;&gt;&lt;code&gt;-sum&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-running-sum-list&quot;&gt;&lt;code&gt;-running-sum&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-product-list&quot;&gt;&lt;code&gt;-product&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-running-product-list&quot;&gt;&lt;code&gt;-running-product&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-inits-list&quot;&gt;&lt;code&gt;-inits&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tails-list&quot;&gt;&lt;code&gt;-tails&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-common-prefix-rest-lists&quot;&gt;&lt;code&gt;-common-prefix&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-common-suffix-rest-lists&quot;&gt;&lt;code&gt;-common-suffix&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-min-list&quot;&gt;&lt;code&gt;-min&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-min-by-comparator-list&quot;&gt;&lt;code&gt;-min-by&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(comparator list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-max-list&quot;&gt;&lt;code&gt;-max&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-max-by-comparator-list&quot;&gt;&lt;code&gt;-max-by&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(comparator list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-frequencies-list&quot;&gt;&lt;code&gt;-frequencies&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Unfolding&lt;/h3&gt; 
&lt;p&gt;Operations dual to reductions, building lists from a seed value rather than consuming a list to produce a single value.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-iterate-fun-init-n&quot;&gt;&lt;code&gt;-iterate&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fun init n)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-unfold-fun-seed&quot;&gt;&lt;code&gt;-unfold&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fun seed)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-repeat-n-x&quot;&gt;&lt;code&gt;-repeat&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n x)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-cycle-list&quot;&gt;&lt;code&gt;-cycle&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Predicates&lt;/h3&gt; 
&lt;p&gt;Reductions of one or more lists to a boolean value.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-some-pred-list&quot;&gt;&lt;code&gt;-some&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-every-pred-list&quot;&gt;&lt;code&gt;-every&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-any-pred-list&quot;&gt;&lt;code&gt;-any?&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-all-pred-list&quot;&gt;&lt;code&gt;-all?&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-none-pred-list&quot;&gt;&lt;code&gt;-none?&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-only-some-pred-list&quot;&gt;&lt;code&gt;-only-some?&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-contains-list-element&quot;&gt;&lt;code&gt;-contains?&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list element)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-is-prefix-prefix-list&quot;&gt;&lt;code&gt;-is-prefix?&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(prefix list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-is-suffix-suffix-list&quot;&gt;&lt;code&gt;-is-suffix?&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(suffix list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-is-infix-infix-list&quot;&gt;&lt;code&gt;-is-infix?&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(infix list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-cons-pair-obj&quot;&gt;&lt;code&gt;-cons-pair?&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(obj)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Partitioning&lt;/h3&gt; 
&lt;p&gt;Functions partitioning the input list into a list of lists.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-split-at-n-list&quot;&gt;&lt;code&gt;-split-at&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-split-with-pred-list&quot;&gt;&lt;code&gt;-split-with&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-split-on-item-list&quot;&gt;&lt;code&gt;-split-on&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(item list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-split-when-fn-list&quot;&gt;&lt;code&gt;-split-when&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-separate-pred-list&quot;&gt;&lt;code&gt;-separate&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-n-list&quot;&gt;&lt;code&gt;-partition&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-all-n-list&quot;&gt;&lt;code&gt;-partition-all&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-in-steps-n-step-list&quot;&gt;&lt;code&gt;-partition-in-steps&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n step list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-all-in-steps-n-step-list&quot;&gt;&lt;code&gt;-partition-all-in-steps&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n step list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-by-fn-list&quot;&gt;&lt;code&gt;-partition-by&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-by-header-fn-list&quot;&gt;&lt;code&gt;-partition-by-header&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-after-pred-pred-list&quot;&gt;&lt;code&gt;-partition-after-pred&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-before-pred-pred-list&quot;&gt;&lt;code&gt;-partition-before-pred&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-before-item-item-list&quot;&gt;&lt;code&gt;-partition-before-item&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(item list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-after-item-item-list&quot;&gt;&lt;code&gt;-partition-after-item&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(item list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-group-by-fn-list&quot;&gt;&lt;code&gt;-group-by&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Indexing&lt;/h3&gt; 
&lt;p&gt;Functions retrieving or sorting based on list indices and related predicates.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-elem-index-elem-list&quot;&gt;&lt;code&gt;-elem-index&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(elem list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-elem-indices-elem-list&quot;&gt;&lt;code&gt;-elem-indices&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(elem list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-find-index-pred-list&quot;&gt;&lt;code&gt;-find-index&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-find-last-index-pred-list&quot;&gt;&lt;code&gt;-find-last-index&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-find-indices-pred-list&quot;&gt;&lt;code&gt;-find-indices&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-grade-up-comparator-list&quot;&gt;&lt;code&gt;-grade-up&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(comparator list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-grade-down-comparator-list&quot;&gt;&lt;code&gt;-grade-down&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(comparator list)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Set operations&lt;/h3&gt; 
&lt;p&gt;Operations pretending lists are sets.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-union-list1-list2&quot;&gt;&lt;code&gt;-union&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list1 list2)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-difference-list1-list2&quot;&gt;&lt;code&gt;-difference&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list1 list2)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-intersection-list1-list2&quot;&gt;&lt;code&gt;-intersection&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list1 list2)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-powerset-list&quot;&gt;&lt;code&gt;-powerset&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-permutations-list&quot;&gt;&lt;code&gt;-permutations&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-distinct-list&quot;&gt;&lt;code&gt;-distinct&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-same-items-list1-list2&quot;&gt;&lt;code&gt;-same-items?&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list1 list2)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Other list operations&lt;/h3&gt; 
&lt;p&gt;Other list functions not fit to be classified elsewhere.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-rotate-n-list&quot;&gt;&lt;code&gt;-rotate&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-cons-rest-args&quot;&gt;&lt;code&gt;-cons*&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest args)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-snoc-list-elem-rest-elements&quot;&gt;&lt;code&gt;-snoc&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list elem &amp;amp;rest elements)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-interpose-sep-list&quot;&gt;&lt;code&gt;-interpose&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(sep list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-interleave-rest-lists&quot;&gt;&lt;code&gt;-interleave&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-iota-count-optional-start-step&quot;&gt;&lt;code&gt;-iota&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(count &amp;amp;optional start step)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-with-fn-list1-list2&quot;&gt;&lt;code&gt;-zip-with&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list1 list2)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-pair-list1-list2&quot;&gt;&lt;code&gt;-zip-pair&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list1 list2)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-lists-rest-lists&quot;&gt;&lt;code&gt;-zip-lists&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-lists-fill-fill-value-rest-lists&quot;&gt;&lt;code&gt;-zip-lists-fill&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fill-value &amp;amp;rest lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-rest-lists&quot;&gt;&lt;code&gt;-zip&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-fill-fill-value-rest-lists&quot;&gt;&lt;code&gt;-zip-fill&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fill-value &amp;amp;rest lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-unzip-lists-lists&quot;&gt;&lt;code&gt;-unzip-lists&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-unzip-lists&quot;&gt;&lt;code&gt;-unzip&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-pad-fill-value-rest-lists&quot;&gt;&lt;code&gt;-pad&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fill-value &amp;amp;rest lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-table-fn-rest-lists&quot;&gt;&lt;code&gt;-table&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn &amp;amp;rest lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-table-flat-fn-rest-lists&quot;&gt;&lt;code&gt;-table-flat&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn &amp;amp;rest lists)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-first-pred-list&quot;&gt;&lt;code&gt;-first&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-last-pred-list&quot;&gt;&lt;code&gt;-last&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-first-item-list&quot;&gt;&lt;code&gt;-first-item&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-second-item-list&quot;&gt;&lt;code&gt;-second-item&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-third-item-list&quot;&gt;&lt;code&gt;-third-item&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-fourth-item-list&quot;&gt;&lt;code&gt;-fourth-item&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-fifth-item-list&quot;&gt;&lt;code&gt;-fifth-item&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-last-item-list&quot;&gt;&lt;code&gt;-last-item&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-butlast-list&quot;&gt;&lt;code&gt;-butlast&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-sort-comparator-list&quot;&gt;&lt;code&gt;-sort&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(comparator list)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-list-arg&quot;&gt;&lt;code&gt;-list&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(arg)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-fix-fn-list&quot;&gt;&lt;code&gt;-fix&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn list)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Tree operations&lt;/h3&gt; 
&lt;p&gt;Functions pretending lists are trees.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tree-seq-branch-children-tree&quot;&gt;&lt;code&gt;-tree-seq&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(branch children tree)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tree-map-fn-tree&quot;&gt;&lt;code&gt;-tree-map&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn tree)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tree-map-nodes-pred-fun-tree&quot;&gt;&lt;code&gt;-tree-map-nodes&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred fun tree)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tree-reduce-fn-tree&quot;&gt;&lt;code&gt;-tree-reduce&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn tree)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tree-reduce-from-fn-init-value-tree&quot;&gt;&lt;code&gt;-tree-reduce-from&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn init-value tree)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tree-mapreduce-fn-folder-tree&quot;&gt;&lt;code&gt;-tree-mapreduce&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn folder tree)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tree-mapreduce-from-fn-folder-init-value-tree&quot;&gt;&lt;code&gt;-tree-mapreduce-from&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn folder init-value tree)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-clone-list&quot;&gt;&lt;code&gt;-clone&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Threading macros&lt;/h3&gt; 
&lt;p&gt;Macros that conditionally combine sequential forms for brevity or readability.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#--x-optional-form-rest-more&quot;&gt;&lt;code&gt;-&amp;gt;&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(x &amp;amp;optional form &amp;amp;rest more)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#--x-optional-form-rest-more&quot;&gt;&lt;code&gt;-&amp;gt;&amp;gt;&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(x &amp;amp;optional form &amp;amp;rest more)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#---x-rest-forms&quot;&gt;&lt;code&gt;--&amp;gt;&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(x &amp;amp;rest forms)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-as--value-variable-rest-forms&quot;&gt;&lt;code&gt;-as-&amp;gt;&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(value variable &amp;amp;rest forms)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-some--x-optional-form-rest-more&quot;&gt;&lt;code&gt;-some-&amp;gt;&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(x &amp;amp;optional form &amp;amp;rest more)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-some--x-optional-form-rest-more&quot;&gt;&lt;code&gt;-some-&amp;gt;&amp;gt;&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(x &amp;amp;optional form &amp;amp;rest more)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-some---expr-rest-forms&quot;&gt;&lt;code&gt;-some--&amp;gt;&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(expr &amp;amp;rest forms)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-doto-init-rest-forms&quot;&gt;&lt;code&gt;-doto&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(init &amp;amp;rest forms)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Binding&lt;/h3&gt; 
&lt;p&gt;Macros that combine &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;let*&lt;/code&gt; with destructuring and flow control.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-when-let-var-val-rest-body&quot;&gt;&lt;code&gt;-when-let&lt;/code&gt;&lt;/a&gt; &lt;code&gt;((var val) &amp;amp;rest body)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-when-let-vars-vals-rest-body&quot;&gt;&lt;code&gt;-when-let*&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(vars-vals &amp;amp;rest body)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-if-let-var-val-then-rest-else&quot;&gt;&lt;code&gt;-if-let&lt;/code&gt;&lt;/a&gt; &lt;code&gt;((var val) then &amp;amp;rest else)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-if-let-vars-vals-then-rest-else&quot;&gt;&lt;code&gt;-if-let*&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(vars-vals then &amp;amp;rest else)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-let-varlist-rest-body&quot;&gt;&lt;code&gt;-let&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(varlist &amp;amp;rest body)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-let-varlist-rest-body&quot;&gt;&lt;code&gt;-let*&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(varlist &amp;amp;rest body)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-lambda-match-form-rest-body&quot;&gt;&lt;code&gt;-lambda&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(match-form &amp;amp;rest body)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-setq-match-form-val&quot;&gt;&lt;code&gt;-setq&lt;/code&gt;&lt;/a&gt; &lt;code&gt;([match-form val] ...)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Side effects&lt;/h3&gt; 
&lt;p&gt;Functions iterating over lists for side effect only.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-each-list-fn&quot;&gt;&lt;code&gt;-each&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list fn)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-each-while-list-pred-fn&quot;&gt;&lt;code&gt;-each-while&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list pred fn)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-each-indexed-list-fn&quot;&gt;&lt;code&gt;-each-indexed&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list fn)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-each-r-list-fn&quot;&gt;&lt;code&gt;-each-r&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list fn)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-each-r-while-list-pred-fn&quot;&gt;&lt;code&gt;-each-r-while&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list pred fn)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-dotimes-num-fn&quot;&gt;&lt;code&gt;-dotimes&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(num fn)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Destructive operations&lt;/h3&gt; 
&lt;p&gt;Macros that modify variables holding lists.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#cons-car-cdr&quot;&gt;&lt;code&gt;!cons&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(car cdr)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#cdr-list&quot;&gt;&lt;code&gt;!cdr&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(list)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Function combinators&lt;/h3&gt; 
&lt;p&gt;Functions that manipulate and compose other functions.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partial-fun-rest-args&quot;&gt;&lt;code&gt;-partial&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fun &amp;amp;rest args)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-rpartial-fn-rest-args&quot;&gt;&lt;code&gt;-rpartial&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn &amp;amp;rest args)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-juxt-rest-fns&quot;&gt;&lt;code&gt;-juxt&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest fns)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-compose-rest-fns&quot;&gt;&lt;code&gt;-compose&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest fns)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-applify-fn&quot;&gt;&lt;code&gt;-applify&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-on-op-trans&quot;&gt;&lt;code&gt;-on&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(op trans)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-flip-fn&quot;&gt;&lt;code&gt;-flip&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-rotate-args-n-fn&quot;&gt;&lt;code&gt;-rotate-args&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(n fn)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-const-c&quot;&gt;&lt;code&gt;-const&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(c)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-cut-rest-params&quot;&gt;&lt;code&gt;-cut&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest params)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-not-pred&quot;&gt;&lt;code&gt;-not&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(pred)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-orfn-rest-preds&quot;&gt;&lt;code&gt;-orfn&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest preds)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-andfn-rest-preds&quot;&gt;&lt;code&gt;-andfn&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest preds)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-iteratefn-fn-n&quot;&gt;&lt;code&gt;-iteratefn&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn n)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-fixfn-fn-optional-equal-test-halt-test&quot;&gt;&lt;code&gt;-fixfn&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(fn &amp;amp;optional equal-test halt-test)&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-prodfn-rest-fns&quot;&gt;&lt;code&gt;-prodfn&lt;/code&gt;&lt;/a&gt; &lt;code&gt;(&amp;amp;rest fns)&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;Maps&lt;/h2&gt; 
&lt;p&gt;Functions in this category take a transforming function, which is then applied sequentially to each or selected elements of the input list. The results are collected in order and returned as a new list.&lt;/p&gt; 
&lt;h4&gt;-map &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Apply &lt;code&gt;fn&lt;/code&gt; to each item in &lt;code&gt;list&lt;/code&gt; and return the list of results.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--map&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-map (lambda (num) (* num num)) &#39;(1 2 3 4)) ;; =&amp;gt; (1 4 9 16)
(-map #&#39;1+ &#39;(1 2 3 4)) ;; =&amp;gt; (2 3 4 5)
(--map (* it it) &#39;(1 2 3 4)) ;; =&amp;gt; (1 4 9 16)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-map-when &lt;code&gt;(pred rep list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Use &lt;code&gt;pred&lt;/code&gt; to conditionally apply &lt;code&gt;rep&lt;/code&gt; to each item in &lt;code&gt;list&lt;/code&gt;. Return a copy of &lt;code&gt;list&lt;/code&gt; where the items for which &lt;code&gt;pred&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt; are unchanged, and the rest are mapped through the &lt;code&gt;rep&lt;/code&gt; function.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-replace-where&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-update-at-n-func-list&quot;&gt;&lt;code&gt;-update-at&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-map-when &#39;even? &#39;square &#39;(1 2 3 4)) ;; =&amp;gt; (1 4 3 16)
(--map-when (&amp;gt; it 2) (* it it) &#39;(1 2 3 4)) ;; =&amp;gt; (1 2 9 16)
(--map-when (= it 2) 17 &#39;(1 2 3 4)) ;; =&amp;gt; (1 17 3 4)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-map-first &lt;code&gt;(pred rep list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Use &lt;code&gt;pred&lt;/code&gt; to determine the first item in &lt;code&gt;list&lt;/code&gt; to call &lt;code&gt;rep&lt;/code&gt; on. Return a copy of &lt;code&gt;list&lt;/code&gt; where the first item for which &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt; is replaced with the result of calling &lt;code&gt;rep&lt;/code&gt; on that item.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-when-pred-rep-list&quot;&gt;&lt;code&gt;-map-when&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-replace-first-old-new-list&quot;&gt;&lt;code&gt;-replace-first&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-map-first &#39;even? &#39;square &#39;(1 2 3 4)) ;; =&amp;gt; (1 4 3 4)
(--map-first (&amp;gt; it 2) (* it it) &#39;(1 2 3 4)) ;; =&amp;gt; (1 2 9 4)
(--map-first (= it 2) 17 &#39;(1 2 3 2)) ;; =&amp;gt; (1 17 3 2)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-map-last &lt;code&gt;(pred rep list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Use &lt;code&gt;pred&lt;/code&gt; to determine the last item in &lt;code&gt;list&lt;/code&gt; to call &lt;code&gt;rep&lt;/code&gt; on. Return a copy of &lt;code&gt;list&lt;/code&gt; where the last item for which &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt; is replaced with the result of calling &lt;code&gt;rep&lt;/code&gt; on that item.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-when-pred-rep-list&quot;&gt;&lt;code&gt;-map-when&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-replace-last-old-new-list&quot;&gt;&lt;code&gt;-replace-last&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-map-last &#39;even? &#39;square &#39;(1 2 3 4)) ;; =&amp;gt; (1 2 3 16)
(--map-last (&amp;gt; it 2) (* it it) &#39;(1 2 3 4)) ;; =&amp;gt; (1 2 3 16)
(--map-last (= it 2) 17 &#39;(1 2 3 2)) ;; =&amp;gt; (1 2 3 17)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-map-indexed &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Apply &lt;code&gt;fn&lt;/code&gt; to each index and item in &lt;code&gt;list&lt;/code&gt; and return the list of results. This is like &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-fn-list&quot;&gt;&lt;code&gt;-map&lt;/code&gt;&lt;/a&gt;, but &lt;code&gt;fn&lt;/code&gt; takes two arguments: the index of the current element within &lt;code&gt;list&lt;/code&gt;, and the element itself.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--map-indexed&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For a side-effecting variant, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-each-indexed-list-fn&quot;&gt;&lt;code&gt;-each-indexed&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-map-indexed (lambda (index item) (- item index)) &#39;(1 2 3 4)) ;; =&amp;gt; (1 1 1 1)
(--map-indexed (- it it-index) &#39;(1 2 3 4)) ;; =&amp;gt; (1 1 1 1)
(-map-indexed #&#39;* &#39;(1 2 3 4)) ;; =&amp;gt; (0 2 6 12)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-annotate &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Pair each item in &lt;code&gt;list&lt;/code&gt; with the result of passing it to &lt;code&gt;fn&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Return an alist of (&lt;code&gt;result&lt;/code&gt; . &lt;code&gt;item&lt;/code&gt;), where each &lt;code&gt;item&lt;/code&gt; is the corresponding element of &lt;code&gt;list&lt;/code&gt;, and &lt;code&gt;result&lt;/code&gt; is the value obtained by calling &lt;code&gt;fn&lt;/code&gt; on &lt;code&gt;item&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--annotate&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-annotate #&#39;1+ &#39;(1 2 3)) ;; =&amp;gt; ((2 . 1) (3 . 2) (4 . 3))
(-annotate #&#39;length &#39;((f o o) (bar baz))) ;; =&amp;gt; ((3 f o o) (2 bar baz))
(--annotate (&amp;gt; it 1) &#39;(0 1 2 3)) ;; =&amp;gt; ((nil . 0) (nil . 1) (t . 2) (t . 3))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-splice &lt;code&gt;(pred fun list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Splice lists generated by &lt;code&gt;fun&lt;/code&gt; in place of items satisfying &lt;code&gt;pred&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Call &lt;code&gt;pred&lt;/code&gt; on each element of &lt;code&gt;list&lt;/code&gt;. Whenever the result of &lt;code&gt;pred&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;, leave that &lt;code&gt;it&lt;/code&gt; as-is. Otherwise, call &lt;code&gt;fun&lt;/code&gt; on the same &lt;code&gt;it&lt;/code&gt; that satisfied &lt;code&gt;pred&lt;/code&gt;. The result should be a (possibly empty) list of items to splice in place of &lt;code&gt;it&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This can be useful as an alternative to the &lt;code&gt;,@&lt;/code&gt; construct in a ``&#39; structure, in case you need to splice several lists at marked positions (for example with keywords).&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--splice&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-splice-list-pred-new-list-list&quot;&gt;&lt;code&gt;-splice-list&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-insert-at-n-x-list&quot;&gt;&lt;code&gt;-insert-at&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-splice #&#39;numberp (lambda (n) (list n n)) &#39;(a 1 b 2)) ;; =&amp;gt; (a 1 1 b 2 2)
(--splice t (list it it) &#39;(1 2 3 4)) ;; =&amp;gt; (1 1 2 2 3 3 4 4)
(--splice (eq it :magic) &#39;((magical) (code)) &#39;((foo) :magic (bar))) ;; =&amp;gt; ((foo) (magical) (code) (bar))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-splice-list &lt;code&gt;(pred new-list list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Splice &lt;code&gt;new-list&lt;/code&gt; in place of elements matching &lt;code&gt;pred&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-splice-pred-fun-list&quot;&gt;&lt;code&gt;-splice&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-insert-at-n-x-list&quot;&gt;&lt;code&gt;-insert-at&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-splice-list &#39;keywordp &#39;(a b c) &#39;(1 :foo 2)) ;; =&amp;gt; (1 a b c 2)
(-splice-list &#39;keywordp nil &#39;(1 :foo 2)) ;; =&amp;gt; (1 2)
(--splice-list (keywordp it) &#39;(a b c) &#39;(1 :foo 2)) ;; =&amp;gt; (1 a b c 2)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-mapcat &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the concatenation of the result of mapping &lt;code&gt;fn&lt;/code&gt; over &lt;code&gt;list&lt;/code&gt;. Thus function &lt;code&gt;fn&lt;/code&gt; should return a list.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-mapcat &#39;list &#39;(1 2 3)) ;; =&amp;gt; (1 2 3)
(-mapcat (lambda (item) (list 0 item)) &#39;(1 2 3)) ;; =&amp;gt; (0 1 0 2 0 3)
(--mapcat (list 0 it) &#39;(1 2 3)) ;; =&amp;gt; (0 1 0 2 0 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-copy &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Create a shallow copy of &lt;code&gt;list&lt;/code&gt;. The elements of &lt;code&gt;list&lt;/code&gt; are not copied; they are shared with the original.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-copy &#39;(1 2 3)) ;; =&amp;gt; (1 2 3)
(let ((a &#39;(1 2 3))) (eq a (-copy a))) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Sublist selection&lt;/h2&gt; 
&lt;p&gt;Functions returning a sublist of the original list.&lt;/p&gt; 
&lt;h4&gt;-filter &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a new list of the items in &lt;code&gt;list&lt;/code&gt; for which &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-select&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--filter&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For similar operations, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-keep-fn-list&quot;&gt;&lt;code&gt;-keep&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-pred-list&quot;&gt;&lt;code&gt;-remove&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-filter (lambda (num) (= 0 (% num 2))) &#39;(1 2 3 4)) ;; =&amp;gt; (2 4)
(-filter #&#39;natnump &#39;(-2 -1 0 1 2)) ;; =&amp;gt; (0 1 2)
(--filter (= 0 (% it 2)) &#39;(1 2 3 4)) ;; =&amp;gt; (2 4)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-remove &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a new list of the items in &lt;code&gt;list&lt;/code&gt; for which &lt;code&gt;pred&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-reject&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--remove&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For similar operations, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-keep-fn-list&quot;&gt;&lt;code&gt;-keep&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-filter-pred-list&quot;&gt;&lt;code&gt;-filter&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-remove (lambda (num) (= 0 (% num 2))) &#39;(1 2 3 4)) ;; =&amp;gt; (1 3)
(-remove #&#39;natnump &#39;(-2 -1 0 1 2)) ;; =&amp;gt; (-2 -1)
(--remove (= 0 (% it 2)) &#39;(1 2 3 4)) ;; =&amp;gt; (1 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-remove-first &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Remove the first item from &lt;code&gt;list&lt;/code&gt; for which &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt;. This is a non-destructive operation, but only the front of &lt;code&gt;list&lt;/code&gt; leading up to the removed item is a copy; the rest is &lt;code&gt;list&lt;/code&gt;&#39;s original tail. If no item is removed, then the result is a complete copy.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-reject-first&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--remove-first&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-first-pred-rep-list&quot;&gt;&lt;code&gt;-map-first&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-item-item-list&quot;&gt;&lt;code&gt;-remove-item&lt;/code&gt;&lt;/a&gt;, and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-last-pred-list&quot;&gt;&lt;code&gt;-remove-last&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-remove-first #&#39;natnump &#39;(-2 -1 0 1 2)) ;; =&amp;gt; (-2 -1 1 2)
(-remove-first #&#39;stringp &#39;(1 2 &quot;first&quot; &quot;second&quot;)) ;; =&amp;gt; (1 2 &quot;second&quot;)
(--remove-first (&amp;gt; it 3) &#39;(1 2 3 4 5 6)) ;; =&amp;gt; (1 2 3 5 6)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-remove-last &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Remove the last item from &lt;code&gt;list&lt;/code&gt; for which &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt;. The result is a copy of &lt;code&gt;list&lt;/code&gt; regardless of whether an element is removed.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-reject-last&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--remove-last&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-last-pred-rep-list&quot;&gt;&lt;code&gt;-map-last&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-item-item-list&quot;&gt;&lt;code&gt;-remove-item&lt;/code&gt;&lt;/a&gt;, and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-first-pred-list&quot;&gt;&lt;code&gt;-remove-first&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-remove-last #&#39;natnump &#39;(1 3 5 4 7 8 10 -11)) ;; =&amp;gt; (1 3 5 4 7 8 -11)
(-remove-last #&#39;stringp &#39;(1 2 &quot;last&quot; &quot;second&quot;)) ;; =&amp;gt; (1 2 &quot;last&quot;)
(--remove-last (&amp;gt; it 3) &#39;(1 2 3 4 5 6 7 8 9 10)) ;; =&amp;gt; (1 2 3 4 5 6 7 8 9)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-remove-item &lt;code&gt;(item list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a copy of &lt;code&gt;list&lt;/code&gt; with all occurrences of &lt;code&gt;item&lt;/code&gt; removed. The comparison is done with &lt;code&gt;equal&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-remove-item 3 &#39;(1 2 3 2 3 4 5 3)) ;; =&amp;gt; (1 2 2 4 5)
(-remove-item &#39;foo &#39;(foo bar baz foo)) ;; =&amp;gt; (bar baz)
(-remove-item &quot;bob&quot; &#39;(&quot;alice&quot; &quot;bob&quot; &quot;eve&quot; &quot;bob&quot;)) ;; =&amp;gt; (&quot;alice&quot; &quot;eve&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-non-nil &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a copy of &lt;code&gt;list&lt;/code&gt; with all &lt;code&gt;nil&lt;/code&gt; items removed.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-non-nil &#39;(nil 1 nil 2 nil nil 3 4 nil 5 nil)) ;; =&amp;gt; (1 2 3 4 5)
(-non-nil &#39;((nil))) ;; =&amp;gt; ((nil))
(-non-nil ()) ;; =&amp;gt; ()
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-slice &lt;code&gt;(list from &amp;amp;optional to step)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return copy of &lt;code&gt;list&lt;/code&gt;, starting from index &lt;code&gt;from&lt;/code&gt; to index &lt;code&gt;to&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;from&lt;/code&gt; or &lt;code&gt;to&lt;/code&gt; may be negative. These values are then interpreted modulo the length of the list.&lt;/p&gt; 
&lt;p&gt;If &lt;code&gt;step&lt;/code&gt; is a number, only each &lt;code&gt;step&lt;/code&gt;th item in the resulting section is returned. Defaults to 1.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-slice &#39;(1 2 3 4 5) 1) ;; =&amp;gt; (2 3 4 5)
(-slice &#39;(1 2 3 4 5) 0 3) ;; =&amp;gt; (1 2 3)
(-slice &#39;(1 2 3 4 5 6 7 8 9) 1 -1 2) ;; =&amp;gt; (2 4 6 8)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-take &lt;code&gt;(n list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a copy of the first &lt;code&gt;n&lt;/code&gt; items in &lt;code&gt;list&lt;/code&gt;. Return a copy of &lt;code&gt;list&lt;/code&gt; if it contains &lt;code&gt;n&lt;/code&gt; items or fewer. Return &lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;n&lt;/code&gt; is zero or less.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-take-last-n-list&quot;&gt;&lt;code&gt;-take-last&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-take 3 &#39;(1 2 3 4 5)) ;; =&amp;gt; (1 2 3)
(-take 17 &#39;(1 2 3 4 5)) ;; =&amp;gt; (1 2 3 4 5)
(-take 0 &#39;(1 2 3 4 5)) ;; =&amp;gt; ()
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-take-last &lt;code&gt;(n list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a copy of the last &lt;code&gt;n&lt;/code&gt; items of &lt;code&gt;list&lt;/code&gt; in order. Return a copy of &lt;code&gt;list&lt;/code&gt; if it contains &lt;code&gt;n&lt;/code&gt; items or fewer. Return &lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;n&lt;/code&gt; is zero or less.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-take-n-list&quot;&gt;&lt;code&gt;-take&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-take-last 3 &#39;(1 2 3 4 5)) ;; =&amp;gt; (3 4 5)
(-take-last 17 &#39;(1 2 3 4 5)) ;; =&amp;gt; (1 2 3 4 5)
(-take-last 1 &#39;(1 2 3 4 5)) ;; =&amp;gt; (5)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-drop &lt;code&gt;(n list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the tail (not a copy) of &lt;code&gt;list&lt;/code&gt; without the first &lt;code&gt;n&lt;/code&gt; items. Return &lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;list&lt;/code&gt; contains &lt;code&gt;n&lt;/code&gt; items or fewer. Return &lt;code&gt;list&lt;/code&gt; if &lt;code&gt;n&lt;/code&gt; is zero or less.&lt;/p&gt; 
&lt;p&gt;For another variant, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-drop-last-n-list&quot;&gt;&lt;code&gt;-drop-last&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-drop 3 &#39;(1 2 3 4 5)) ;; =&amp;gt; (4 5)
(-drop 17 &#39;(1 2 3 4 5)) ;; =&amp;gt; ()
(-drop 0 &#39;(1 2 3 4 5)) ;; =&amp;gt; (1 2 3 4 5)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-drop-last &lt;code&gt;(n list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a copy of &lt;code&gt;list&lt;/code&gt; without its last &lt;code&gt;n&lt;/code&gt; items. Return a copy of &lt;code&gt;list&lt;/code&gt; if &lt;code&gt;n&lt;/code&gt; is zero or less. Return &lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;list&lt;/code&gt; contains &lt;code&gt;n&lt;/code&gt; items or fewer.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-drop-n-list&quot;&gt;&lt;code&gt;-drop&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-drop-last 3 &#39;(1 2 3 4 5)) ;; =&amp;gt; (1 2)
(-drop-last 17 &#39;(1 2 3 4 5)) ;; =&amp;gt; ()
(-drop-last 0 &#39;(1 2 3 4 5)) ;; =&amp;gt; (1 2 3 4 5)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-take-while &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Take successive items from &lt;code&gt;list&lt;/code&gt; for which &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt;. &lt;code&gt;pred&lt;/code&gt; is a function of one argument. Return a new list of the successive elements from the start of &lt;code&gt;list&lt;/code&gt; for which &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--take-while&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For another variant, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-drop-while-pred-list&quot;&gt;&lt;code&gt;-drop-while&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-take-while #&#39;even? &#39;(1 2 3 4)) ;; =&amp;gt; ()
(-take-while #&#39;even? &#39;(2 4 5 6)) ;; =&amp;gt; (2 4)
(--take-while (&amp;lt; it 4) &#39;(1 2 3 4 3 2 1)) ;; =&amp;gt; (1 2 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-drop-while &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Drop successive items from &lt;code&gt;list&lt;/code&gt; for which &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt;. &lt;code&gt;pred&lt;/code&gt; is a function of one argument. Return the tail (not a copy) of &lt;code&gt;list&lt;/code&gt; starting from its first element for which &lt;code&gt;pred&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--drop-while&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For another variant, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-take-while-pred-list&quot;&gt;&lt;code&gt;-take-while&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-drop-while #&#39;even? &#39;(1 2 3 4)) ;; =&amp;gt; (1 2 3 4)
(-drop-while #&#39;even? &#39;(2 4 5 6)) ;; =&amp;gt; (5 6)
(--drop-while (&amp;lt; it 4) &#39;(1 2 3 4 3 2 1)) ;; =&amp;gt; (4 3 2 1)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-select-by-indices &lt;code&gt;(indices list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list whose elements are elements from &lt;code&gt;list&lt;/code&gt; selected as &lt;code&gt;(nth i list)&lt;/code&gt; for all i from &lt;code&gt;indices&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-select-by-indices &#39;(4 10 2 3 6) &#39;(&quot;v&quot; &quot;e&quot; &quot;l&quot; &quot;o&quot; &quot;c&quot; &quot;i&quot; &quot;r&quot; &quot;a&quot; &quot;p&quot; &quot;t&quot; &quot;o&quot; &quot;r&quot;)) ;; =&amp;gt; (&quot;c&quot; &quot;o&quot; &quot;l&quot; &quot;o&quot; &quot;r&quot;)
(-select-by-indices &#39;(2 1 0) &#39;(&quot;a&quot; &quot;b&quot; &quot;c&quot;)) ;; =&amp;gt; (&quot;c&quot; &quot;b&quot; &quot;a&quot;)
(-select-by-indices &#39;(0 1 2 0 1 3 3 1) &#39;(&quot;f&quot; &quot;a&quot; &quot;r&quot; &quot;l&quot;)) ;; =&amp;gt; (&quot;f&quot; &quot;a&quot; &quot;r&quot; &quot;f&quot; &quot;a&quot; &quot;l&quot; &quot;l&quot; &quot;a&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-select-columns &lt;code&gt;(columns table)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Select &lt;code&gt;columns&lt;/code&gt; from &lt;code&gt;table&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;table&lt;/code&gt; is a list of lists where each element represents one row. It is assumed each row has the same length.&lt;/p&gt; 
&lt;p&gt;Each row is transformed such that only the specified &lt;code&gt;columns&lt;/code&gt; are selected.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-select-column-column-table&quot;&gt;&lt;code&gt;-select-column&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-select-by-indices-indices-list&quot;&gt;&lt;code&gt;-select-by-indices&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-select-columns &#39;(0 2) &#39;((1 2 3) (a b c) (:a :b :c))) ;; =&amp;gt; ((1 3) (a c) (:a :c))
(-select-columns &#39;(1) &#39;((1 2 3) (a b c) (:a :b :c))) ;; =&amp;gt; ((2) (b) (:b))
(-select-columns nil &#39;((1 2 3) (a b c) (:a :b :c))) ;; =&amp;gt; (nil nil nil)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-select-column &lt;code&gt;(column table)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Select &lt;code&gt;column&lt;/code&gt; from &lt;code&gt;table&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;table&lt;/code&gt; is a list of lists where each element represents one row. It is assumed each row has the same length.&lt;/p&gt; 
&lt;p&gt;The single selected column is returned as a list.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-select-columns-columns-table&quot;&gt;&lt;code&gt;-select-columns&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-select-by-indices-indices-list&quot;&gt;&lt;code&gt;-select-by-indices&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-select-column 1 &#39;((1 2 3) (a b c) (:a :b :c))) ;; =&amp;gt; (2 b :b)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;List to list&lt;/h2&gt; 
&lt;p&gt;Functions returning a modified copy of the input list.&lt;/p&gt; 
&lt;h4&gt;-keep &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a new list of the non-&lt;code&gt;nil&lt;/code&gt; results of applying &lt;code&gt;fn&lt;/code&gt; to each item in &lt;code&gt;list&lt;/code&gt;. Like &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-filter-pred-list&quot;&gt;&lt;code&gt;-filter&lt;/code&gt;&lt;/a&gt;, but returns the non-&lt;code&gt;nil&lt;/code&gt; results of &lt;code&gt;fn&lt;/code&gt; instead of the corresponding elements of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Its anaphoric counterpart is &lt;code&gt;--keep&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-keep #&#39;cdr &#39;((1 2 3) (4 5) (6))) ;; =&amp;gt; ((2 3) (5))
(-keep (lambda (n) (and (&amp;gt; n 3) (* 10 n))) &#39;(1 2 3 4 5 6)) ;; =&amp;gt; (40 50 60)
(--keep (and (&amp;gt; it 3) (* 10 it)) &#39;(1 2 3 4 5 6)) ;; =&amp;gt; (40 50 60)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-concat &lt;code&gt;(&amp;amp;rest sequences)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Concatenate all &lt;code&gt;sequences&lt;/code&gt; and make the result a list. The result is a list whose elements are the elements of all the arguments. Each argument may be a list, vector or string.&lt;/p&gt; 
&lt;p&gt;All arguments except the last argument are copied. The last argument is just used as the tail of the new list. If the last argument is not a list, this results in a dotted list.&lt;/p&gt; 
&lt;p&gt;As an exception, if all the arguments except the last are &lt;code&gt;nil&lt;/code&gt;, and the last argument is not a list, the return value is that last argument unaltered, not a list.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-concat &#39;(1)) ;; =&amp;gt; (1)
(-concat &#39;(1) &#39;(2)) ;; =&amp;gt; (1 2)
(-concat &#39;(1) &#39;(2 3) &#39;(4)) ;; =&amp;gt; (1 2 3 4)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-flatten &lt;code&gt;(l)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Take a nested list &lt;code&gt;l&lt;/code&gt; and return its contents as a single, flat list.&lt;/p&gt; 
&lt;p&gt;Note that because &lt;code&gt;nil&lt;/code&gt; represents a list of zero elements (an empty list), any mention of &lt;code&gt;nil&lt;/code&gt; in &lt;code&gt;l&lt;/code&gt; will disappear after flattening. If you need to preserve nils, consider &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-flatten-n-num-list&quot;&gt;&lt;code&gt;-flatten-n&lt;/code&gt;&lt;/a&gt; or map them to some unique symbol and then map them back.&lt;/p&gt; 
&lt;p&gt;Conses of two atoms are considered &quot;terminals&quot;, that is, they aren&#39;t flattened further.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-flatten-n-num-list&quot;&gt;&lt;code&gt;-flatten-n&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-flatten &#39;((1))) ;; =&amp;gt; (1)
(-flatten &#39;((1 (2 3) (((4 (5))))))) ;; =&amp;gt; (1 2 3 4 5)
(-flatten &#39;(1 2 (3 . 4))) ;; =&amp;gt; (1 2 (3 . 4))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-flatten-n &lt;code&gt;(num list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Flatten &lt;code&gt;num&lt;/code&gt; levels of a nested &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-flatten-l&quot;&gt;&lt;code&gt;-flatten&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-flatten-n 1 &#39;((1 2) ((3 4) ((5 6))))) ;; =&amp;gt; (1 2 (3 4) ((5 6)))
(-flatten-n 2 &#39;((1 2) ((3 4) ((5 6))))) ;; =&amp;gt; (1 2 3 4 (5 6))
(-flatten-n 3 &#39;((1 2) ((3 4) ((5 6))))) ;; =&amp;gt; (1 2 3 4 5 6)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-replace &lt;code&gt;(old new list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Replace all &lt;code&gt;old&lt;/code&gt; items in &lt;code&gt;list&lt;/code&gt; with &lt;code&gt;new&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Elements are compared using &lt;code&gt;equal&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-replace-at-n-x-list&quot;&gt;&lt;code&gt;-replace-at&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-replace 1 &quot;1&quot; &#39;(1 2 3 4 3 2 1)) ;; =&amp;gt; (&quot;1&quot; 2 3 4 3 2 &quot;1&quot;)
(-replace &quot;foo&quot; &quot;bar&quot; &#39;(&quot;a&quot; &quot;nice&quot; &quot;foo&quot; &quot;sentence&quot; &quot;about&quot; &quot;foo&quot;)) ;; =&amp;gt; (&quot;a&quot; &quot;nice&quot; &quot;bar&quot; &quot;sentence&quot; &quot;about&quot; &quot;bar&quot;)
(-replace 1 2 nil) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-replace-first &lt;code&gt;(old new list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Replace the first occurrence of &lt;code&gt;old&lt;/code&gt; with &lt;code&gt;new&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Elements are compared using &lt;code&gt;equal&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-first-pred-rep-list&quot;&gt;&lt;code&gt;-map-first&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-replace-first 1 &quot;1&quot; &#39;(1 2 3 4 3 2 1)) ;; =&amp;gt; (&quot;1&quot; 2 3 4 3 2 1)
(-replace-first &quot;foo&quot; &quot;bar&quot; &#39;(&quot;a&quot; &quot;nice&quot; &quot;foo&quot; &quot;sentence&quot; &quot;about&quot; &quot;foo&quot;)) ;; =&amp;gt; (&quot;a&quot; &quot;nice&quot; &quot;bar&quot; &quot;sentence&quot; &quot;about&quot; &quot;foo&quot;)
(-replace-first 1 2 nil) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-replace-last &lt;code&gt;(old new list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Replace the last occurrence of &lt;code&gt;old&lt;/code&gt; with &lt;code&gt;new&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Elements are compared using &lt;code&gt;equal&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-last-pred-rep-list&quot;&gt;&lt;code&gt;-map-last&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-replace-last 1 &quot;1&quot; &#39;(1 2 3 4 3 2 1)) ;; =&amp;gt; (1 2 3 4 3 2 &quot;1&quot;)
(-replace-last &quot;foo&quot; &quot;bar&quot; &#39;(&quot;a&quot; &quot;nice&quot; &quot;foo&quot; &quot;sentence&quot; &quot;about&quot; &quot;foo&quot;)) ;; =&amp;gt; (&quot;a&quot; &quot;nice&quot; &quot;foo&quot; &quot;sentence&quot; &quot;about&quot; &quot;bar&quot;)
(-replace-last 1 2 nil) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-insert-at &lt;code&gt;(n x list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list with &lt;code&gt;x&lt;/code&gt; inserted into &lt;code&gt;list&lt;/code&gt; at position &lt;code&gt;n&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-splice-pred-fun-list&quot;&gt;&lt;code&gt;-splice&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-splice-list-pred-new-list-list&quot;&gt;&lt;code&gt;-splice-list&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-insert-at 1 &#39;x &#39;(a b c)) ;; =&amp;gt; (a x b c)
(-insert-at 12 &#39;x &#39;(a b c)) ;; =&amp;gt; (a b c x)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-replace-at &lt;code&gt;(n x list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list with element at &lt;code&gt;n&lt;/code&gt;th position in &lt;code&gt;list&lt;/code&gt; replaced with &lt;code&gt;x&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-replace-old-new-list&quot;&gt;&lt;code&gt;-replace&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-replace-at 0 9 &#39;(0 1 2 3 4 5)) ;; =&amp;gt; (9 1 2 3 4 5)
(-replace-at 1 9 &#39;(0 1 2 3 4 5)) ;; =&amp;gt; (0 9 2 3 4 5)
(-replace-at 4 9 &#39;(0 1 2 3 4 5)) ;; =&amp;gt; (0 1 2 3 9 5)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-update-at &lt;code&gt;(n func list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Use &lt;code&gt;func&lt;/code&gt; to update the &lt;code&gt;n&lt;/code&gt;th element of &lt;code&gt;list&lt;/code&gt;. Return a copy of &lt;code&gt;list&lt;/code&gt; where the &lt;code&gt;n&lt;/code&gt;th element is replaced with the result of calling &lt;code&gt;func&lt;/code&gt; on it.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-when-pred-rep-list&quot;&gt;&lt;code&gt;-map-when&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-update-at 0 (lambda (x) (+ x 9)) &#39;(0 1 2 3 4 5)) ;; =&amp;gt; (9 1 2 3 4 5)
(-update-at 1 (lambda (x) (+ x 8)) &#39;(0 1 2 3 4 5)) ;; =&amp;gt; (0 9 2 3 4 5)
(--update-at 2 (length it) &#39;(&quot;foo&quot; &quot;bar&quot; &quot;baz&quot; &quot;quux&quot;)) ;; =&amp;gt; (&quot;foo&quot; &quot;bar&quot; 3 &quot;quux&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-remove-at &lt;code&gt;(n list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return &lt;code&gt;list&lt;/code&gt; with its element at index &lt;code&gt;n&lt;/code&gt; removed. That is, remove any element selected as (nth &lt;code&gt;n&lt;/code&gt; &lt;code&gt;list&lt;/code&gt;) from &lt;code&gt;list&lt;/code&gt; and return the result.&lt;/p&gt; 
&lt;p&gt;This is a non-destructive operation: parts of &lt;code&gt;list&lt;/code&gt; (but not necessarily all of it) are copied as needed to avoid destructively modifying it.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-at-indices-indices-list&quot;&gt;&lt;code&gt;-remove-at-indices&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-pred-list&quot;&gt;&lt;code&gt;-remove&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-remove-at 0 &#39;(a b c)) ;; =&amp;gt; (b c)
(-remove-at 1 &#39;(a b c)) ;; =&amp;gt; (a c)
(-remove-at 2 &#39;(a b c)) ;; =&amp;gt; (a b)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-remove-at-indices &lt;code&gt;(indices list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return &lt;code&gt;list&lt;/code&gt; with its elements at &lt;code&gt;indices&lt;/code&gt; removed. That is, for each index &lt;code&gt;i&lt;/code&gt; in &lt;code&gt;indices&lt;/code&gt;, remove any element selected as (nth &lt;code&gt;i&lt;/code&gt; &lt;code&gt;list&lt;/code&gt;) from &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This is a non-destructive operation: parts of &lt;code&gt;list&lt;/code&gt; (but not necessarily all of it) are copied as needed to avoid destructively modifying it.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-at-n-list&quot;&gt;&lt;code&gt;-remove-at&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-remove-pred-list&quot;&gt;&lt;code&gt;-remove&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-remove-at-indices &#39;(0) &#39;(a b c d e)) ;; =&amp;gt; (b c d e)
(-remove-at-indices &#39;(1 3) &#39;(a b c d e)) ;; =&amp;gt; (a c e)
(-remove-at-indices &#39;(4 0 2) &#39;(a b c d e)) ;; =&amp;gt; (b d)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Reductions&lt;/h2&gt; 
&lt;p&gt;Functions reducing lists to a single value (which may also be a list).&lt;/p&gt; 
&lt;h4&gt;-reduce-from &lt;code&gt;(fn init list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Reduce the function &lt;code&gt;fn&lt;/code&gt; across &lt;code&gt;list&lt;/code&gt;, starting with &lt;code&gt;init&lt;/code&gt;. Return the result of applying &lt;code&gt;fn&lt;/code&gt; to &lt;code&gt;init&lt;/code&gt; and the first element of &lt;code&gt;list&lt;/code&gt;, then applying &lt;code&gt;fn&lt;/code&gt; to that result and the second element, etc. If &lt;code&gt;list&lt;/code&gt; is empty, return &lt;code&gt;init&lt;/code&gt; without calling &lt;code&gt;fn&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--reduce-from&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For other folds, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-fn-list&quot;&gt;&lt;code&gt;-reduce&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-fn-list&quot;&gt;&lt;code&gt;-reduce-r&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-reduce-from #&#39;- 10 &#39;(1 2 3)) ;; =&amp;gt; 4
(-reduce-from #&#39;list 10 &#39;(1 2 3)) ;; =&amp;gt; (((10 1) 2) 3)
(--reduce-from (concat acc &quot; &quot; it) &quot;START&quot; &#39;(&quot;a&quot; &quot;b&quot; &quot;c&quot;)) ;; =&amp;gt; &quot;START a b c&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-reduce-r-from &lt;code&gt;(fn init list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Reduce the function &lt;code&gt;fn&lt;/code&gt; across &lt;code&gt;list&lt;/code&gt; in reverse, starting with &lt;code&gt;init&lt;/code&gt;. Return the result of applying &lt;code&gt;fn&lt;/code&gt; to the last element of &lt;code&gt;list&lt;/code&gt; and &lt;code&gt;init&lt;/code&gt;, then applying &lt;code&gt;fn&lt;/code&gt; to the second-to-last element and the previous result of &lt;code&gt;fn&lt;/code&gt;, etc. That is, the first argument of &lt;code&gt;fn&lt;/code&gt; is the current element, and its second argument the accumulated value. If &lt;code&gt;list&lt;/code&gt; is empty, return &lt;code&gt;init&lt;/code&gt; without calling &lt;code&gt;fn&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function is like &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-from-fn-init-list&quot;&gt;&lt;code&gt;-reduce-from&lt;/code&gt;&lt;/a&gt; but the operation associates from the right rather than left. In other words, it starts from the end of &lt;code&gt;list&lt;/code&gt; and flips the arguments to &lt;code&gt;fn&lt;/code&gt;. Conceptually, it is like replacing the conses in &lt;code&gt;list&lt;/code&gt; with applications of &lt;code&gt;fn&lt;/code&gt;, and its last link with &lt;code&gt;init&lt;/code&gt;, and evaluating the resulting expression.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--reduce-r-from&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For other folds, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-fn-list&quot;&gt;&lt;code&gt;-reduce-r&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-fn-list&quot;&gt;&lt;code&gt;-reduce&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-reduce-r-from #&#39;- 10 &#39;(1 2 3)) ;; =&amp;gt; -8
(-reduce-r-from #&#39;list 10 &#39;(1 2 3)) ;; =&amp;gt; (1 (2 (3 10)))
(--reduce-r-from (concat it &quot; &quot; acc) &quot;END&quot; &#39;(&quot;a&quot; &quot;b&quot; &quot;c&quot;)) ;; =&amp;gt; &quot;a b c END&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-reduce &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Reduce the function &lt;code&gt;fn&lt;/code&gt; across &lt;code&gt;list&lt;/code&gt;. Return the result of applying &lt;code&gt;fn&lt;/code&gt; to the first two elements of &lt;code&gt;list&lt;/code&gt;, then applying &lt;code&gt;fn&lt;/code&gt; to that result and the third element, etc. If &lt;code&gt;list&lt;/code&gt; contains a single element, return it without calling &lt;code&gt;fn&lt;/code&gt;. If &lt;code&gt;list&lt;/code&gt; is empty, return the result of calling &lt;code&gt;fn&lt;/code&gt; with no arguments.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--reduce&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For other folds, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-from-fn-init-list&quot;&gt;&lt;code&gt;-reduce-from&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-fn-list&quot;&gt;&lt;code&gt;-reduce-r&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-reduce #&#39;- &#39;(1 2 3 4)) ;; =&amp;gt; -8
(-reduce #&#39;list &#39;(1 2 3 4)) ;; =&amp;gt; (((1 2) 3) 4)
(--reduce (format &quot;%s-%d&quot; acc it) &#39;(1 2 3)) ;; =&amp;gt; &quot;1-2-3&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-reduce-r &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Reduce the function &lt;code&gt;fn&lt;/code&gt; across &lt;code&gt;list&lt;/code&gt; in reverse. Return the result of applying &lt;code&gt;fn&lt;/code&gt; to the last two elements of &lt;code&gt;list&lt;/code&gt;, then applying &lt;code&gt;fn&lt;/code&gt; to the third-to-last element and the previous result of &lt;code&gt;fn&lt;/code&gt;, etc. That is, the first argument of &lt;code&gt;fn&lt;/code&gt; is the current element, and its second argument the accumulated value. If &lt;code&gt;list&lt;/code&gt; contains a single element, return it without calling &lt;code&gt;fn&lt;/code&gt;. If &lt;code&gt;list&lt;/code&gt; is empty, return the result of calling &lt;code&gt;fn&lt;/code&gt; with no arguments.&lt;/p&gt; 
&lt;p&gt;This function is like &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-fn-list&quot;&gt;&lt;code&gt;-reduce&lt;/code&gt;&lt;/a&gt; but the operation associates from the right rather than left. In other words, it starts from the end of &lt;code&gt;list&lt;/code&gt; and flips the arguments to &lt;code&gt;fn&lt;/code&gt;. Conceptually, it is like replacing the conses in &lt;code&gt;list&lt;/code&gt; with applications of &lt;code&gt;fn&lt;/code&gt;, ignoring its last link, and evaluating the resulting expression.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--reduce-r&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For other folds, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-from-fn-init-list&quot;&gt;&lt;code&gt;-reduce-r-from&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-fn-list&quot;&gt;&lt;code&gt;-reduce&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-reduce-r #&#39;- &#39;(1 2 3 4)) ;; =&amp;gt; -2
(-reduce-r #&#39;list &#39;(1 2 3 4)) ;; =&amp;gt; (1 (2 (3 4)))
(--reduce-r (format &quot;%s-%d&quot; acc it) &#39;(1 2 3)) ;; =&amp;gt; &quot;3-2-1&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-reductions-from &lt;code&gt;(fn init list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list of &lt;code&gt;fn&lt;/code&gt;&#39;s intermediate reductions across &lt;code&gt;list&lt;/code&gt;. That is, a list of the intermediate values of the accumulator when &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-from-fn-init-list&quot;&gt;&lt;code&gt;-reduce-from&lt;/code&gt;&lt;/a&gt; (which see) is called with the same arguments.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--reductions-from&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For other folds, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-fn-list&quot;&gt;&lt;code&gt;-reductions&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-r-fn-list&quot;&gt;&lt;code&gt;-reductions-r&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-reductions-from #&#39;max 0 &#39;(2 1 4 3)) ;; =&amp;gt; (0 2 2 4 4)
(-reductions-from #&#39;* 1 &#39;(1 2 3 4)) ;; =&amp;gt; (1 1 2 6 24)
(--reductions-from (format &quot;(FN %s %d)&quot; acc it) &quot;INIT&quot; &#39;(1 2 3)) ;; =&amp;gt; (&quot;INIT&quot; &quot;(FN INIT 1)&quot; &quot;(FN (FN INIT 1) 2)&quot; &quot;(FN (FN (FN INIT 1) 2) 3)&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-reductions-r-from &lt;code&gt;(fn init list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list of &lt;code&gt;fn&lt;/code&gt;&#39;s intermediate reductions across reversed &lt;code&gt;list&lt;/code&gt;. That is, a list of the intermediate values of the accumulator when &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-from-fn-init-list&quot;&gt;&lt;code&gt;-reduce-r-from&lt;/code&gt;&lt;/a&gt; (which see) is called with the same arguments.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--reductions-r-from&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For other folds, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-fn-list&quot;&gt;&lt;code&gt;-reductions&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-r-fn-list&quot;&gt;&lt;code&gt;-reductions-r&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-reductions-r-from #&#39;max 0 &#39;(2 1 4 3)) ;; =&amp;gt; (4 4 4 3 0)
(-reductions-r-from #&#39;* 1 &#39;(1 2 3 4)) ;; =&amp;gt; (24 24 12 4 1)
(--reductions-r-from (format &quot;(FN %d %s)&quot; it acc) &quot;INIT&quot; &#39;(1 2 3)) ;; =&amp;gt; (&quot;(FN 1 (FN 2 (FN 3 INIT)))&quot; &quot;(FN 2 (FN 3 INIT))&quot; &quot;(FN 3 INIT)&quot; &quot;INIT&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-reductions &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list of &lt;code&gt;fn&lt;/code&gt;&#39;s intermediate reductions across &lt;code&gt;list&lt;/code&gt;. That is, a list of the intermediate values of the accumulator when &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-fn-list&quot;&gt;&lt;code&gt;-reduce&lt;/code&gt;&lt;/a&gt; (which see) is called with the same arguments.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--reductions&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For other folds, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-fn-list&quot;&gt;&lt;code&gt;-reductions&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-r-fn-list&quot;&gt;&lt;code&gt;-reductions-r&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-reductions #&#39;+ &#39;(1 2 3 4)) ;; =&amp;gt; (1 3 6 10)
(-reductions #&#39;* &#39;(1 2 3 4)) ;; =&amp;gt; (1 2 6 24)
(--reductions (format &quot;(FN %s %d)&quot; acc it) &#39;(1 2 3)) ;; =&amp;gt; (1 &quot;(FN 1 2)&quot; &quot;(FN (FN 1 2) 3)&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-reductions-r &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list of &lt;code&gt;fn&lt;/code&gt;&#39;s intermediate reductions across reversed &lt;code&gt;list&lt;/code&gt;. That is, a list of the intermediate values of the accumulator when &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-fn-list&quot;&gt;&lt;code&gt;-reduce-r&lt;/code&gt;&lt;/a&gt; (which see) is called with the same arguments.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--reductions-r&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For other folds, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-r-from-fn-init-list&quot;&gt;&lt;code&gt;-reductions-r-from&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reductions-fn-list&quot;&gt;&lt;code&gt;-reductions&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-reductions-r #&#39;+ &#39;(1 2 3 4)) ;; =&amp;gt; (10 9 7 4)
(-reductions-r #&#39;* &#39;(1 2 3 4)) ;; =&amp;gt; (24 24 12 4)
(--reductions-r (format &quot;(FN %d %s)&quot; it acc) &#39;(1 2 3)) ;; =&amp;gt; (&quot;(FN 1 (FN 2 3))&quot; &quot;(FN 2 3)&quot; 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-count &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Counts the number of items in &lt;code&gt;list&lt;/code&gt; where (&lt;code&gt;pred&lt;/code&gt; item) is non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-count &#39;even? &#39;(1 2 3 4 5)) ;; =&amp;gt; 2
(--count (&amp;lt; it 4) &#39;(1 2 3 4)) ;; =&amp;gt; 3
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-sum &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the sum of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-sum ()) ;; =&amp;gt; 0
(-sum &#39;(1)) ;; =&amp;gt; 1
(-sum &#39;(1 2 3 4)) ;; =&amp;gt; 10
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-running-sum &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list with running sums of items in &lt;code&gt;list&lt;/code&gt;. &lt;code&gt;list&lt;/code&gt; must be non-empty.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-running-sum &#39;(1 2 3 4)) ;; =&amp;gt; (1 3 6 10)
(-running-sum &#39;(1)) ;; =&amp;gt; (1)
(-running-sum ()) ;; Wrong type argument: consp, nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-product &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the product of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-product ()) ;; =&amp;gt; 1
(-product &#39;(1)) ;; =&amp;gt; 1
(-product &#39;(1 2 3 4)) ;; =&amp;gt; 24
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-running-product &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list with running products of items in &lt;code&gt;list&lt;/code&gt;. &lt;code&gt;list&lt;/code&gt; must be non-empty.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-running-product &#39;(1 2 3 4)) ;; =&amp;gt; (1 2 6 24)
(-running-product &#39;(1)) ;; =&amp;gt; (1)
(-running-product ()) ;; Wrong type argument: consp, nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-inits &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return all prefixes of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-inits &#39;(1 2 3 4)) ;; =&amp;gt; (nil (1) (1 2) (1 2 3) (1 2 3 4))
(-inits nil) ;; =&amp;gt; (nil)
(-inits &#39;(1)) ;; =&amp;gt; (nil (1))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-tails &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return all suffixes of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-tails &#39;(1 2 3 4)) ;; =&amp;gt; ((1 2 3 4) (2 3 4) (3 4) (4) nil)
(-tails nil) ;; =&amp;gt; (nil)
(-tails &#39;(1)) ;; =&amp;gt; ((1) nil)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-common-prefix &lt;code&gt;(&amp;amp;rest lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the longest common prefix of &lt;code&gt;lists&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-common-prefix &#39;(1)) ;; =&amp;gt; (1)
(-common-prefix &#39;(1 2) &#39;(3 4) &#39;(1 2)) ;; =&amp;gt; ()
(-common-prefix &#39;(1 2) &#39;(1 2 3) &#39;(1 2 3 4)) ;; =&amp;gt; (1 2)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-common-suffix &lt;code&gt;(&amp;amp;rest lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the longest common suffix of &lt;code&gt;lists&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-common-suffix &#39;(1)) ;; =&amp;gt; (1)
(-common-suffix &#39;(1 2) &#39;(3 4) &#39;(1 2)) ;; =&amp;gt; ()
(-common-suffix &#39;(1 2 3 4) &#39;(2 3 4) &#39;(3 4)) ;; =&amp;gt; (3 4)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-min &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the smallest value from &lt;code&gt;list&lt;/code&gt; of numbers or markers.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-min &#39;(0)) ;; =&amp;gt; 0
(-min &#39;(3 2 1)) ;; =&amp;gt; 1
(-min &#39;(1 2 3)) ;; =&amp;gt; 1
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-min-by &lt;code&gt;(comparator list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Take a comparison function &lt;code&gt;comparator&lt;/code&gt; and a &lt;code&gt;list&lt;/code&gt; and return the least element of the list by the comparison function.&lt;/p&gt; 
&lt;p&gt;See also combinator &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-on-op-trans&quot;&gt;&lt;code&gt;-on&lt;/code&gt;&lt;/a&gt; which can transform the values before comparing them.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-min-by &#39;&amp;gt; &#39;(4 3 6 1)) ;; =&amp;gt; 1
(--min-by (&amp;gt; (car it) (car other)) &#39;((1 2 3) (2) (3 2))) ;; =&amp;gt; (1 2 3)
(--min-by (&amp;gt; (length it) (length other)) &#39;((1 2 3) (2) (3 2))) ;; =&amp;gt; (2)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-max &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the largest value from &lt;code&gt;list&lt;/code&gt; of numbers or markers.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-max &#39;(0)) ;; =&amp;gt; 0
(-max &#39;(3 2 1)) ;; =&amp;gt; 3
(-max &#39;(1 2 3)) ;; =&amp;gt; 3
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-max-by &lt;code&gt;(comparator list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Take a comparison function &lt;code&gt;comparator&lt;/code&gt; and a &lt;code&gt;list&lt;/code&gt; and return the greatest element of the list by the comparison function.&lt;/p&gt; 
&lt;p&gt;See also combinator &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-on-op-trans&quot;&gt;&lt;code&gt;-on&lt;/code&gt;&lt;/a&gt; which can transform the values before comparing them.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-max-by &#39;&amp;gt; &#39;(4 3 6 1)) ;; =&amp;gt; 6
(--max-by (&amp;gt; (car it) (car other)) &#39;((1 2 3) (2) (3 2))) ;; =&amp;gt; (3 2)
(--max-by (&amp;gt; (length it) (length other)) &#39;((1 2 3) (2) (3 2))) ;; =&amp;gt; (1 2 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-frequencies &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Count the occurrences of each distinct element of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Return an alist of (&lt;code&gt;element&lt;/code&gt; . &lt;code&gt;n&lt;/code&gt;), where each &lt;code&gt;element&lt;/code&gt; occurs &lt;code&gt;n&lt;/code&gt; times in &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;The test for equality is done with &lt;code&gt;equal&lt;/code&gt;, or with &lt;code&gt;-compare-fn&lt;/code&gt; if that is non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-count-pred-list&quot;&gt;&lt;code&gt;-count&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-group-by-fn-list&quot;&gt;&lt;code&gt;-group-by&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-frequencies ()) ;; =&amp;gt; ()
(-frequencies &#39;(1 2 3 1 2 1)) ;; =&amp;gt; ((1 . 3) (2 . 2) (3 . 1))
(let ((-compare-fn #&#39;string=)) (-frequencies &#39;(a &quot;a&quot;))) ;; =&amp;gt; ((a . 2))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Unfolding&lt;/h2&gt; 
&lt;p&gt;Operations dual to reductions, building lists from a seed value rather than consuming a list to produce a single value.&lt;/p&gt; 
&lt;h4&gt;-iterate &lt;code&gt;(fun init n)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list of iterated applications of &lt;code&gt;fun&lt;/code&gt; to &lt;code&gt;init&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This means a list of the form:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(`init` (`fun` `init`) (`fun` (`fun` `init`)) ...)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;code&gt;n&lt;/code&gt; is the length of the returned list.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-iterate #&#39;1+ 1 10) ;; =&amp;gt; (1 2 3 4 5 6 7 8 9 10)
(-iterate (lambda (x) (+ x x)) 2 5) ;; =&amp;gt; (2 4 8 16 32)
(--iterate (* it it) 2 5) ;; =&amp;gt; (2 4 16 256 65536)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-unfold &lt;code&gt;(fun seed)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Build a list from &lt;code&gt;seed&lt;/code&gt; using &lt;code&gt;fun&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This is &quot;dual&quot; operation to &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-fn-list&quot;&gt;&lt;code&gt;-reduce-r&lt;/code&gt;&lt;/a&gt;: while -reduce-r consumes a list to produce a single value, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-unfold-fun-seed&quot;&gt;&lt;code&gt;-unfold&lt;/code&gt;&lt;/a&gt; takes a seed value and builds a (potentially infinite!) list.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;fun&lt;/code&gt; should return &lt;code&gt;nil&lt;/code&gt; to stop the generating process, or a cons (&lt;code&gt;a&lt;/code&gt; . &lt;code&gt;b&lt;/code&gt;), where &lt;code&gt;a&lt;/code&gt; will be prepended to the result and &lt;code&gt;b&lt;/code&gt; is the new seed.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-unfold (lambda (x) (unless (= x 0) (cons x (1- x)))) 10) ;; =&amp;gt; (10 9 8 7 6 5 4 3 2 1)
(--unfold (when it (cons it (cdr it))) &#39;(1 2 3 4)) ;; =&amp;gt; ((1 2 3 4) (2 3 4) (3 4) (4))
(--unfold (when it (cons it (butlast it))) &#39;(1 2 3 4)) ;; =&amp;gt; ((1 2 3 4) (1 2 3) (1 2) (1))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-repeat &lt;code&gt;(n x)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a new list of length &lt;code&gt;n&lt;/code&gt; with each element being &lt;code&gt;x&lt;/code&gt;. Return &lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;n&lt;/code&gt; is less than 1.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-repeat 3 :a) ;; =&amp;gt; (:a :a :a)
(-repeat 1 :a) ;; =&amp;gt; (:a)
(-repeat 0 :a) ;; =&amp;gt; ()
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-cycle &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return an infinite circular copy of &lt;code&gt;list&lt;/code&gt;. The returned list cycles through the elements of &lt;code&gt;list&lt;/code&gt; and repeats from the beginning.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-take 5 (-cycle &#39;(1 2 3))) ;; =&amp;gt; (1 2 3 1 2)
(-take 7 (-cycle &#39;(1 &quot;and&quot; 3))) ;; =&amp;gt; (1 &quot;and&quot; 3 1 &quot;and&quot; 3 1)
(-zip-lists (-cycle &#39;(3)) &#39;(1 2)) ;; =&amp;gt; ((3 1) (3 2))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Predicates&lt;/h2&gt; 
&lt;p&gt;Reductions of one or more lists to a boolean value.&lt;/p&gt; 
&lt;h4&gt;-some &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return (&lt;code&gt;pred&lt;/code&gt; x) for the first &lt;code&gt;list&lt;/code&gt; item where (&lt;code&gt;pred&lt;/code&gt; x) is non-&lt;code&gt;nil&lt;/code&gt;, else &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-any&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--some&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-some #&#39;stringp &#39;(1 &quot;2&quot; 3)) ;; =&amp;gt; t
(--some (string-match-p &quot;x&quot; it) &#39;(&quot;foo&quot; &quot;axe&quot; &quot;xor&quot;)) ;; =&amp;gt; 1
(--some (= it-index 3) &#39;(0 1 2)) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-every &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return non-&lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt; for all items in &lt;code&gt;list&lt;/code&gt;. If so, return the last such result of &lt;code&gt;pred&lt;/code&gt;. Otherwise, once an item is reached for which &lt;code&gt;pred&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, return &lt;code&gt;nil&lt;/code&gt; without calling &lt;code&gt;pred&lt;/code&gt; on any further &lt;code&gt;list&lt;/code&gt; elements.&lt;/p&gt; 
&lt;p&gt;This function is like &lt;code&gt;-every-p&lt;/code&gt;, but on success returns the last non-&lt;code&gt;nil&lt;/code&gt; result of &lt;code&gt;pred&lt;/code&gt; instead of just &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--every&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-every #&#39;numberp &#39;(1 2 3)) ;; =&amp;gt; t
(--every (string-match-p &quot;x&quot; it) &#39;(&quot;axe&quot; &quot;xor&quot;)) ;; =&amp;gt; 0
(--every (= it it-index) &#39;(0 1 3)) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-any? &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return &lt;code&gt;t&lt;/code&gt; if (&lt;code&gt;pred&lt;/code&gt; &lt;code&gt;x&lt;/code&gt;) is non-&lt;code&gt;nil&lt;/code&gt; for any &lt;code&gt;x&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;, else &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-any-p&lt;/code&gt;, &lt;code&gt;-some?&lt;/code&gt;, &lt;code&gt;-some-p&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-any? #&#39;numberp &#39;(nil 0 t)) ;; =&amp;gt; t
(-any? #&#39;numberp &#39;(nil t t)) ;; =&amp;gt; nil
(-any? #&#39;null &#39;(1 3 5)) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-all? &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return &lt;code&gt;t&lt;/code&gt; if (&lt;code&gt;pred&lt;/code&gt; &lt;code&gt;x&lt;/code&gt;) is non-&lt;code&gt;nil&lt;/code&gt; for all &lt;code&gt;x&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;, else &lt;code&gt;nil&lt;/code&gt;. In the latter case, stop after the first &lt;code&gt;x&lt;/code&gt; for which (&lt;code&gt;pred&lt;/code&gt; &lt;code&gt;x&lt;/code&gt;) is &lt;code&gt;nil&lt;/code&gt;, without calling &lt;code&gt;pred&lt;/code&gt; on any subsequent elements of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;The similar function &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-every-pred-list&quot;&gt;&lt;code&gt;-every&lt;/code&gt;&lt;/a&gt; is more widely useful, since it returns the last non-&lt;code&gt;nil&lt;/code&gt; result of &lt;code&gt;pred&lt;/code&gt; instead of just &lt;code&gt;t&lt;/code&gt; on success.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-all-p&lt;/code&gt;, &lt;code&gt;-every-p&lt;/code&gt;, &lt;code&gt;-every?&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--all?&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-all? #&#39;numberp &#39;(1 2 3)) ;; =&amp;gt; t
(-all? #&#39;numberp &#39;(2 t 6)) ;; =&amp;gt; nil
(--all? (= 0 (% it 2)) &#39;(2 4 6)) ;; =&amp;gt; t
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-none? &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return &lt;code&gt;t&lt;/code&gt; if (&lt;code&gt;pred&lt;/code&gt; &lt;code&gt;x&lt;/code&gt;) is &lt;code&gt;nil&lt;/code&gt; for all &lt;code&gt;x&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;, else &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-none-p&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-none? &#39;even? &#39;(1 2 3)) ;; =&amp;gt; nil
(-none? &#39;even? &#39;(1 3 5)) ;; =&amp;gt; t
(--none? (= 0 (% it 2)) &#39;(1 2 3)) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-only-some? &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return &lt;code&gt;t&lt;/code&gt; if different &lt;code&gt;list&lt;/code&gt; items both satisfy and do not satisfy &lt;code&gt;pred&lt;/code&gt;. That is, if &lt;code&gt;pred&lt;/code&gt; returns both &lt;code&gt;nil&lt;/code&gt; for at least one item, and non-&lt;code&gt;nil&lt;/code&gt; for at least one other item in &lt;code&gt;list&lt;/code&gt;. Return &lt;code&gt;nil&lt;/code&gt; if all items satisfy the predicate or none of them do.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-only-some-p&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-only-some? &#39;even? &#39;(1 2 3)) ;; =&amp;gt; t
(-only-some? &#39;even? &#39;(1 3 5)) ;; =&amp;gt; nil
(-only-some? &#39;even? &#39;(2 4 6)) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-contains? &lt;code&gt;(list element)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return non-&lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;list&lt;/code&gt; contains &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;The test for equality is done with &lt;code&gt;equal&lt;/code&gt;, or with &lt;code&gt;-compare-fn&lt;/code&gt; if that is non-&lt;code&gt;nil&lt;/code&gt;. As with &lt;code&gt;member&lt;/code&gt;, the return value is actually the tail of &lt;code&gt;list&lt;/code&gt; whose car is &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-contains-p&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-contains? &#39;(1 2 3) 1) ;; =&amp;gt; (1 2 3)
(-contains? &#39;(1 2 3) 2) ;; =&amp;gt; (2 3)
(-contains? &#39;(1 2 3) 4) ;; =&amp;gt; ()
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-is-prefix? &lt;code&gt;(prefix list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return non-&lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;prefix&lt;/code&gt; is a prefix of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-is-prefix-p&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-is-prefix? &#39;(1 2 3) &#39;(1 2 3 4 5)) ;; =&amp;gt; t
(-is-prefix? &#39;(1 2 3 4 5) &#39;(1 2 3)) ;; =&amp;gt; nil
(-is-prefix? &#39;(1 3) &#39;(1 2 3 4 5)) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-is-suffix? &lt;code&gt;(suffix list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return non-&lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;suffix&lt;/code&gt; is a suffix of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-is-suffix-p&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-is-suffix? &#39;(3 4 5) &#39;(1 2 3 4 5)) ;; =&amp;gt; t
(-is-suffix? &#39;(1 2 3 4 5) &#39;(3 4 5)) ;; =&amp;gt; nil
(-is-suffix? &#39;(3 5) &#39;(1 2 3 4 5)) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-is-infix? &lt;code&gt;(infix list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return non-&lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;infix&lt;/code&gt; is infix of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This operation runs in O(n^2) time&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-is-infix-p&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-is-infix? &#39;(1 2 3) &#39;(1 2 3 4 5)) ;; =&amp;gt; t
(-is-infix? &#39;(2 3 4) &#39;(1 2 3 4 5)) ;; =&amp;gt; t
(-is-infix? &#39;(3 4 5) &#39;(1 2 3 4 5)) ;; =&amp;gt; t
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-cons-pair? &lt;code&gt;(obj)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return non-&lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;obj&lt;/code&gt; is a true cons pair. That is, a cons (&lt;code&gt;a&lt;/code&gt; . &lt;code&gt;b&lt;/code&gt;) where &lt;code&gt;b&lt;/code&gt; is not a list.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-cons-pair-p&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-cons-pair? &#39;(1 . 2)) ;; =&amp;gt; t
(-cons-pair? &#39;(1 2)) ;; =&amp;gt; nil
(-cons-pair? &#39;(1)) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Partitioning&lt;/h2&gt; 
&lt;p&gt;Functions partitioning the input list into a list of lists.&lt;/p&gt; 
&lt;h4&gt;-split-at &lt;code&gt;(n list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Split &lt;code&gt;list&lt;/code&gt; into two sublists after the &lt;code&gt;n&lt;/code&gt;th element. The result is a list of two elements (&lt;code&gt;take&lt;/code&gt; &lt;code&gt;drop&lt;/code&gt;) where &lt;code&gt;take&lt;/code&gt; is a new list of the first &lt;code&gt;n&lt;/code&gt; elements of &lt;code&gt;list&lt;/code&gt;, and &lt;code&gt;drop&lt;/code&gt; is the remaining elements of &lt;code&gt;list&lt;/code&gt; (not a copy). &lt;code&gt;take&lt;/code&gt; and &lt;code&gt;drop&lt;/code&gt; are like the results of &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-take-n-list&quot;&gt;&lt;code&gt;-take&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-drop-n-list&quot;&gt;&lt;code&gt;-drop&lt;/code&gt;&lt;/a&gt;, respectively, but the split is done in a single list traversal.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-split-at 3 &#39;(1 2 3 4 5)) ;; =&amp;gt; ((1 2 3) (4 5))
(-split-at 17 &#39;(1 2 3 4 5)) ;; =&amp;gt; ((1 2 3 4 5) nil)
(-split-at 0 &#39;(1 2 3 4 5)) ;; =&amp;gt; (nil (1 2 3 4 5))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-split-with &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Split &lt;code&gt;list&lt;/code&gt; into a prefix satisfying &lt;code&gt;pred&lt;/code&gt;, and the rest. The first sublist is the prefix of &lt;code&gt;list&lt;/code&gt; with successive elements satisfying &lt;code&gt;pred&lt;/code&gt;, and the second sublist is the remaining elements that do not. The result is like performing&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;((-take-while `pred` `list`) (-drop-while `pred` `list`))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;but in no more than a single pass through &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-split-with &#39;even? &#39;(1 2 3 4)) ;; =&amp;gt; (nil (1 2 3 4))
(-split-with &#39;even? &#39;(2 4 5 6)) ;; =&amp;gt; ((2 4) (5 6))
(--split-with (&amp;lt; it 4) &#39;(1 2 3 4 3 2 1)) ;; =&amp;gt; ((1 2 3) (4 3 2 1))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-split-on &lt;code&gt;(item list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Split the &lt;code&gt;list&lt;/code&gt; each time &lt;code&gt;item&lt;/code&gt; is found.&lt;/p&gt; 
&lt;p&gt;Unlike &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-by-fn-list&quot;&gt;&lt;code&gt;-partition-by&lt;/code&gt;&lt;/a&gt;, the &lt;code&gt;item&lt;/code&gt; is discarded from the results. Empty lists are also removed from the result.&lt;/p&gt; 
&lt;p&gt;Comparison is done by &lt;code&gt;equal&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-split-when-fn-list&quot;&gt;&lt;code&gt;-split-when&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-split-on &#39;| &#39;(Nil | Leaf a | Node [Tree a])) ;; =&amp;gt; ((Nil) (Leaf a) (Node [Tree a]))
(-split-on :endgroup &#39;(&quot;a&quot; &quot;b&quot; :endgroup &quot;c&quot; :endgroup &quot;d&quot; &quot;e&quot;)) ;; =&amp;gt; ((&quot;a&quot; &quot;b&quot;) (&quot;c&quot;) (&quot;d&quot; &quot;e&quot;))
(-split-on :endgroup &#39;(&quot;a&quot; &quot;b&quot; :endgroup :endgroup &quot;d&quot; &quot;e&quot;)) ;; =&amp;gt; ((&quot;a&quot; &quot;b&quot;) (&quot;d&quot; &quot;e&quot;))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-split-when &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Split the &lt;code&gt;list&lt;/code&gt; on each element where &lt;code&gt;fn&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Unlike &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-by-fn-list&quot;&gt;&lt;code&gt;-partition-by&lt;/code&gt;&lt;/a&gt;, the &quot;matched&quot; element is discarded from the results. Empty lists are also removed from the result.&lt;/p&gt; 
&lt;p&gt;This function can be thought of as a generalization of &lt;code&gt;split-string&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-split-when &#39;even? &#39;(1 2 3 4 5 6)) ;; =&amp;gt; ((1) (3) (5))
(-split-when &#39;even? &#39;(1 2 3 4 6 8 9)) ;; =&amp;gt; ((1) (3) (9))
(--split-when (memq it &#39;(&amp;amp;optional &amp;amp;rest)) &#39;(a b &amp;amp;optional c d &amp;amp;rest args)) ;; =&amp;gt; ((a b) (c d) (args))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-separate &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Split &lt;code&gt;list&lt;/code&gt; into two sublists based on whether items satisfy &lt;code&gt;pred&lt;/code&gt;. The result is like performing&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;((-filter `pred` `list`) (-remove `pred` `list`))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;but in a single pass through &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-separate (lambda (num) (= 0 (% num 2))) &#39;(1 2 3 4 5 6 7)) ;; =&amp;gt; ((2 4 6) (1 3 5 7))
(--separate (&amp;lt; it 5) &#39;(3 7 5 9 3 2 1 4 6)) ;; =&amp;gt; ((3 3 2 1 4) (7 5 9 6))
(-separate &#39;cdr &#39;((1 2) (1) (1 2 3) (4))) ;; =&amp;gt; (((1 2) (1 2 3)) ((1) (4)))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-partition &lt;code&gt;(n list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a new list with the items in &lt;code&gt;list&lt;/code&gt; grouped into &lt;code&gt;n&lt;/code&gt;-sized sublists. If there are not enough items to make the last group &lt;code&gt;n&lt;/code&gt;-sized, those items are discarded.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-partition 2 &#39;(1 2 3 4 5 6)) ;; =&amp;gt; ((1 2) (3 4) (5 6))
(-partition 2 &#39;(1 2 3 4 5 6 7)) ;; =&amp;gt; ((1 2) (3 4) (5 6))
(-partition 3 &#39;(1 2 3 4 5 6 7)) ;; =&amp;gt; ((1 2 3) (4 5 6))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-partition-all &lt;code&gt;(n list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a new list with the items in &lt;code&gt;list&lt;/code&gt; grouped into &lt;code&gt;n&lt;/code&gt;-sized sublists. The last group may contain less than &lt;code&gt;n&lt;/code&gt; items.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-partition-all 2 &#39;(1 2 3 4 5 6)) ;; =&amp;gt; ((1 2) (3 4) (5 6))
(-partition-all 2 &#39;(1 2 3 4 5 6 7)) ;; =&amp;gt; ((1 2) (3 4) (5 6) (7))
(-partition-all 3 &#39;(1 2 3 4 5 6 7)) ;; =&amp;gt; ((1 2 3) (4 5 6) (7))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-partition-in-steps &lt;code&gt;(n step list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Partition &lt;code&gt;list&lt;/code&gt; into sublists of length &lt;code&gt;n&lt;/code&gt; that are &lt;code&gt;step&lt;/code&gt; items apart. Like &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partition-all-in-steps-n-step-list&quot;&gt;&lt;code&gt;-partition-all-in-steps&lt;/code&gt;&lt;/a&gt;, but if there are not enough items to make the last group &lt;code&gt;n&lt;/code&gt;-sized, those items are discarded.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-partition-in-steps 2 1 &#39;(1 2 3 4)) ;; =&amp;gt; ((1 2) (2 3) (3 4))
(-partition-in-steps 3 2 &#39;(1 2 3 4)) ;; =&amp;gt; ((1 2 3))
(-partition-in-steps 3 2 &#39;(1 2 3 4 5)) ;; =&amp;gt; ((1 2 3) (3 4 5))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-partition-all-in-steps &lt;code&gt;(n step list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Partition &lt;code&gt;list&lt;/code&gt; into sublists of length &lt;code&gt;n&lt;/code&gt; that are &lt;code&gt;step&lt;/code&gt; items apart. Adjacent groups may overlap if &lt;code&gt;n&lt;/code&gt; exceeds the &lt;code&gt;step&lt;/code&gt; stride. Trailing groups may contain less than &lt;code&gt;n&lt;/code&gt; items.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-partition-all-in-steps 2 1 &#39;(1 2 3 4)) ;; =&amp;gt; ((1 2) (2 3) (3 4) (4))
(-partition-all-in-steps 3 2 &#39;(1 2 3 4)) ;; =&amp;gt; ((1 2 3) (3 4))
(-partition-all-in-steps 3 2 &#39;(1 2 3 4 5)) ;; =&amp;gt; ((1 2 3) (3 4 5) (5))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-partition-by &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Apply &lt;code&gt;fn&lt;/code&gt; to each item in &lt;code&gt;list&lt;/code&gt;, splitting it each time &lt;code&gt;fn&lt;/code&gt; returns a new value.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-partition-by &#39;even? ()) ;; =&amp;gt; ()
(-partition-by &#39;even? &#39;(1 1 2 2 2 3 4 6 8)) ;; =&amp;gt; ((1 1) (2 2 2) (3) (4 6 8))
(--partition-by (&amp;lt; it 3) &#39;(1 2 3 4 3 2 1)) ;; =&amp;gt; ((1 2) (3 4 3) (2 1))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-partition-by-header &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Apply &lt;code&gt;fn&lt;/code&gt; to the first item in &lt;code&gt;list&lt;/code&gt;. That is the header value. Apply &lt;code&gt;fn&lt;/code&gt; to each item in &lt;code&gt;list&lt;/code&gt;, splitting it each time &lt;code&gt;fn&lt;/code&gt; returns the header value, but only after seeing at least one other value (the body).&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(--partition-by-header (= it 1) &#39;(1 2 3 1 2 1 2 3 4)) ;; =&amp;gt; ((1 2 3) (1 2) (1 2 3 4))
(--partition-by-header (&amp;gt; it 0) &#39;(1 2 0 1 0 1 2 3 0)) ;; =&amp;gt; ((1 2 0) (1 0) (1 2 3 0))
(-partition-by-header &#39;even? &#39;(2 1 1 1 4 1 3 5 6 6 1)) ;; =&amp;gt; ((2 1 1 1) (4 1 3 5) (6 6 1))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-partition-after-pred &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Partition &lt;code&gt;list&lt;/code&gt; after each element for which &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--partition-after-pred&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-partition-after-pred #&#39;booleanp ()) ;; =&amp;gt; ()
(-partition-after-pred #&#39;booleanp &#39;(t t)) ;; =&amp;gt; ((t) (t))
(-partition-after-pred #&#39;booleanp &#39;(0 0 t t 0 t)) ;; =&amp;gt; ((0 0 t) (t) (0 t))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-partition-before-pred &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Partition directly before each time &lt;code&gt;pred&lt;/code&gt; is true on an element of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-partition-before-pred #&#39;booleanp ()) ;; =&amp;gt; ()
(-partition-before-pred #&#39;booleanp &#39;(0 t)) ;; =&amp;gt; ((0) (t))
(-partition-before-pred #&#39;booleanp &#39;(0 0 t 0 t t)) ;; =&amp;gt; ((0 0) (t 0) (t) (t))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-partition-before-item &lt;code&gt;(item list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Partition directly before each time &lt;code&gt;item&lt;/code&gt; appears in &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-partition-before-item 3 ()) ;; =&amp;gt; ()
(-partition-before-item 3 &#39;(1)) ;; =&amp;gt; ((1))
(-partition-before-item 3 &#39;(3)) ;; =&amp;gt; ((3))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-partition-after-item &lt;code&gt;(item list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Partition directly after each time &lt;code&gt;item&lt;/code&gt; appears in &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-partition-after-item 3 ()) ;; =&amp;gt; ()
(-partition-after-item 3 &#39;(1)) ;; =&amp;gt; ((1))
(-partition-after-item 3 &#39;(3)) ;; =&amp;gt; ((3))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-group-by &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Separate &lt;code&gt;list&lt;/code&gt; into an alist whose keys are &lt;code&gt;fn&lt;/code&gt; applied to the elements of &lt;code&gt;list&lt;/code&gt;. Keys are compared by &lt;code&gt;equal&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-group-by &#39;even? ()) ;; =&amp;gt; ()
(-group-by &#39;even? &#39;(1 1 2 2 2 3 4 6 8)) ;; =&amp;gt; ((nil 1 1 3) (t 2 2 2 4 6 8))
(--group-by (car (split-string it &quot;/&quot;)) &#39;(&quot;a/b&quot; &quot;c/d&quot; &quot;a/e&quot;)) ;; =&amp;gt; ((&quot;a&quot; &quot;a/b&quot; &quot;a/e&quot;) (&quot;c&quot; &quot;c/d&quot;))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Indexing&lt;/h2&gt; 
&lt;p&gt;Functions retrieving or sorting based on list indices and related predicates.&lt;/p&gt; 
&lt;h4&gt;-elem-index &lt;code&gt;(elem list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the first index of &lt;code&gt;elem&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;. That is, the index within &lt;code&gt;list&lt;/code&gt; of the first element that is &lt;code&gt;equal&lt;/code&gt; to &lt;code&gt;elem&lt;/code&gt;. Return &lt;code&gt;nil&lt;/code&gt; if there is no such element.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-find-index-pred-list&quot;&gt;&lt;code&gt;-find-index&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-elem-index 2 &#39;(6 7 8 3 4)) ;; =&amp;gt; nil
(-elem-index &quot;bar&quot; &#39;(&quot;foo&quot; &quot;bar&quot; &quot;baz&quot;)) ;; =&amp;gt; 1
(-elem-index &#39;(1 2) &#39;((3) (5 6) (1 2) nil)) ;; =&amp;gt; 2
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-elem-indices &lt;code&gt;(elem list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the list of indices at which &lt;code&gt;elem&lt;/code&gt; appears in &lt;code&gt;list&lt;/code&gt;. That is, the indices of all elements of &lt;code&gt;list&lt;/code&gt; &lt;code&gt;equal&lt;/code&gt; to &lt;code&gt;elem&lt;/code&gt;, in the same ascending order as they appear in &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-elem-indices 2 &#39;(6 7 8 3 4 1)) ;; =&amp;gt; ()
(-elem-indices &quot;bar&quot; &#39;(&quot;foo&quot; &quot;bar&quot; &quot;baz&quot;)) ;; =&amp;gt; (1)
(-elem-indices &#39;(1 2) &#39;((3) (1 2) (5 6) (1 2) nil)) ;; =&amp;gt; (1 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-find-index &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the index of the first item satisfying &lt;code&gt;pred&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;. Return &lt;code&gt;nil&lt;/code&gt; if no such item is found.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;pred&lt;/code&gt; is called with one argument, the current list element, until it returns non-&lt;code&gt;nil&lt;/code&gt;, at which point the search terminates.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--find-index&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-first-pred-list&quot;&gt;&lt;code&gt;-first&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-find-last-index-pred-list&quot;&gt;&lt;code&gt;-find-last-index&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-find-index #&#39;numberp &#39;(a b c)) ;; =&amp;gt; nil
(-find-index #&#39;natnump &#39;(1 0 -1)) ;; =&amp;gt; 0
(--find-index (&amp;gt; it 5) &#39;(2 4 1 6 3 3 5 8)) ;; =&amp;gt; 3
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-find-last-index &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the index of the last item satisfying &lt;code&gt;pred&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;. Return &lt;code&gt;nil&lt;/code&gt; if no such item is found.&lt;/p&gt; 
&lt;p&gt;Predicate &lt;code&gt;pred&lt;/code&gt; is called with one argument each time, namely the current list element.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--find-last-index&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-last-pred-list&quot;&gt;&lt;code&gt;-last&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-find-index-pred-list&quot;&gt;&lt;code&gt;-find-index&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-find-last-index #&#39;numberp &#39;(a b c)) ;; =&amp;gt; nil
(--find-last-index (&amp;gt; it 5) &#39;(2 7 1 6 3 8 5 2)) ;; =&amp;gt; 5
(-find-last-index (-partial #&#39;string&amp;lt; &#39;a) &#39;(c b a)) ;; =&amp;gt; 1
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-find-indices &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the list of indices in &lt;code&gt;list&lt;/code&gt; satisfying &lt;code&gt;pred&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Each element of &lt;code&gt;list&lt;/code&gt; in turn is passed to &lt;code&gt;pred&lt;/code&gt;. If the result is non-&lt;code&gt;nil&lt;/code&gt;, the index of that element in &lt;code&gt;list&lt;/code&gt; is included in the result. The returned indices are in ascending order, i.e., in the same order as they appear in &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--find-indices&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-find-index-pred-list&quot;&gt;&lt;code&gt;-find-index&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-elem-indices-elem-list&quot;&gt;&lt;code&gt;-elem-indices&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-find-indices #&#39;numberp &#39;(a b c)) ;; =&amp;gt; ()
(-find-indices #&#39;numberp &#39;(8 1 d 2 b c a 3)) ;; =&amp;gt; (0 1 3 7)
(--find-indices (&amp;gt; it 5) &#39;(2 4 1 6 3 3 5 8)) ;; =&amp;gt; (3 7)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-grade-up &lt;code&gt;(comparator list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Grade elements of &lt;code&gt;list&lt;/code&gt; using &lt;code&gt;comparator&lt;/code&gt; relation. This yields a permutation vector such that applying this permutation to &lt;code&gt;list&lt;/code&gt; sorts it in ascending order.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-grade-up #&#39;&amp;lt; &#39;(3 1 4 2 1 3 3)) ;; =&amp;gt; (1 4 3 0 5 6 2)
(let ((l &#39;(3 1 4 2 1 3 3))) (-select-by-indices (-grade-up #&#39;&amp;lt; l) l)) ;; =&amp;gt; (1 1 2 3 3 3 4)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-grade-down &lt;code&gt;(comparator list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Grade elements of &lt;code&gt;list&lt;/code&gt; using &lt;code&gt;comparator&lt;/code&gt; relation. This yields a permutation vector such that applying this permutation to &lt;code&gt;list&lt;/code&gt; sorts it in descending order.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-grade-down #&#39;&amp;lt; &#39;(3 1 4 2 1 3 3)) ;; =&amp;gt; (2 0 5 6 3 1 4)
(let ((l &#39;(3 1 4 2 1 3 3))) (-select-by-indices (-grade-down #&#39;&amp;lt; l) l)) ;; =&amp;gt; (4 3 3 3 2 1 1)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Set operations&lt;/h2&gt; 
&lt;p&gt;Operations pretending lists are sets.&lt;/p&gt; 
&lt;h4&gt;-union &lt;code&gt;(list1 list2)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a new list of distinct elements appearing in either &lt;code&gt;list1&lt;/code&gt; or &lt;code&gt;list2&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;The test for equality is done with &lt;code&gt;equal&lt;/code&gt;, or with &lt;code&gt;-compare-fn&lt;/code&gt; if that is non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-union &#39;(1 2 3) &#39;(3 4 5)) ;; =&amp;gt; (1 2 3 4 5)
(-union &#39;(1 2 2 4) ()) ;; =&amp;gt; (1 2 4)
(-union &#39;(1 1 2 2) &#39;(4 4 3 2 1)) ;; =&amp;gt; (1 2 4 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-difference &lt;code&gt;(list1 list2)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a new list with the distinct members of &lt;code&gt;list1&lt;/code&gt; that are not in &lt;code&gt;list2&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;The test for equality is done with &lt;code&gt;equal&lt;/code&gt;, or with &lt;code&gt;-compare-fn&lt;/code&gt; if that is non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-difference () ()) ;; =&amp;gt; ()
(-difference &#39;(1 2 3) &#39;(4 5 6)) ;; =&amp;gt; (1 2 3)
(-difference &#39;(1 2 3 4) &#39;(3 4 5 6)) ;; =&amp;gt; (1 2)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-intersection &lt;code&gt;(list1 list2)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a new list of distinct elements appearing in both &lt;code&gt;list1&lt;/code&gt; and &lt;code&gt;list2&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;The test for equality is done with &lt;code&gt;equal&lt;/code&gt;, or with &lt;code&gt;-compare-fn&lt;/code&gt; if that is non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-intersection () ()) ;; =&amp;gt; ()
(-intersection &#39;(1 2 3) &#39;(4 5 6)) ;; =&amp;gt; ()
(-intersection &#39;(1 2 2 3) &#39;(4 3 3 2)) ;; =&amp;gt; (2 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-powerset &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the power set of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-powerset ()) ;; =&amp;gt; (nil)
(-powerset &#39;(x y)) ;; =&amp;gt; ((x y) (x) (y) nil)
(-powerset &#39;(x y z)) ;; =&amp;gt; ((x y z) (x y) (x z) (x) (y z) (y) (z) nil)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-permutations &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the distinct permutations of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Duplicate elements of &lt;code&gt;list&lt;/code&gt; are determined by &lt;code&gt;equal&lt;/code&gt;, or by &lt;code&gt;-compare-fn&lt;/code&gt; if that is non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-permutations ()) ;; =&amp;gt; (nil)
(-permutations &#39;(a a b)) ;; =&amp;gt; ((a a b) (a b a) (b a a))
(-permutations &#39;(a b c)) ;; =&amp;gt; ((a b c) (a c b) (b a c) (b c a) (c a b) (c b a))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-distinct &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a copy of &lt;code&gt;list&lt;/code&gt; with all duplicate elements removed.&lt;/p&gt; 
&lt;p&gt;The test for equality is done with &lt;code&gt;equal&lt;/code&gt;, or with &lt;code&gt;-compare-fn&lt;/code&gt; if that is non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-uniq&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-distinct ()) ;; =&amp;gt; ()
(-distinct &#39;(1 1 2 3 3)) ;; =&amp;gt; (1 2 3)
(-distinct &#39;(t t t)) ;; =&amp;gt; (t)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-same-items? &lt;code&gt;(list1 list2)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return non-&lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;list1&lt;/code&gt; and &lt;code&gt;list2&lt;/code&gt; have the same distinct elements.&lt;/p&gt; 
&lt;p&gt;The order of the elements in the lists does not matter. The lists may be of different lengths, i.e., contain duplicate elements. The test for equality is done with &lt;code&gt;equal&lt;/code&gt;, or with &lt;code&gt;-compare-fn&lt;/code&gt; if that is non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-same-items-p&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-same-items? &#39;(1 2 3) &#39;(1 2 3)) ;; =&amp;gt; t
(-same-items? &#39;(1 1 2 3) &#39;(3 3 2 1)) ;; =&amp;gt; t
(-same-items? &#39;(1 2 3) &#39;(1 2 3 4)) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Other list operations&lt;/h2&gt; 
&lt;p&gt;Other list functions not fit to be classified elsewhere.&lt;/p&gt; 
&lt;h4&gt;-rotate &lt;code&gt;(n list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Rotate &lt;code&gt;list&lt;/code&gt; &lt;code&gt;n&lt;/code&gt; places to the right (left if &lt;code&gt;n&lt;/code&gt; is negative). The time complexity is O(n).&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-rotate 3 &#39;(1 2 3 4 5 6 7)) ;; =&amp;gt; (5 6 7 1 2 3 4)
(-rotate -3 &#39;(1 2 3 4 5 6 7)) ;; =&amp;gt; (4 5 6 7 1 2 3)
(-rotate 16 &#39;(1 2 3 4 5 6 7)) ;; =&amp;gt; (6 7 1 2 3 4 5)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-cons* &lt;code&gt;(&amp;amp;rest args)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Make a new list from the elements of &lt;code&gt;args&lt;/code&gt;. The last 2 elements of &lt;code&gt;args&lt;/code&gt; are used as the final cons of the result, so if the final element of &lt;code&gt;args&lt;/code&gt; is not a list, the result is a dotted list. With no &lt;code&gt;args&lt;/code&gt;, return &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-cons* 1 2) ;; =&amp;gt; (1 . 2)
(-cons* 1 2 3) ;; =&amp;gt; (1 2 . 3)
(-cons* 1) ;; =&amp;gt; 1
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-snoc &lt;code&gt;(list elem &amp;amp;rest elements)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Append &lt;code&gt;elem&lt;/code&gt; to the end of the list.&lt;/p&gt; 
&lt;p&gt;This is like &lt;code&gt;cons&lt;/code&gt;, but operates on the end of list.&lt;/p&gt; 
&lt;p&gt;If any &lt;code&gt;elements&lt;/code&gt; are given, append them to the list as well.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-snoc &#39;(1 2 3) 4) ;; =&amp;gt; (1 2 3 4)
(-snoc &#39;(1 2 3) 4 5 6) ;; =&amp;gt; (1 2 3 4 5 6)
(-snoc &#39;(1 2 3) &#39;(4 5 6)) ;; =&amp;gt; (1 2 3 (4 5 6))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-interpose &lt;code&gt;(sep list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a new list of all elements in &lt;code&gt;list&lt;/code&gt; separated by &lt;code&gt;sep&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-interpose &quot;-&quot; ()) ;; =&amp;gt; ()
(-interpose &quot;-&quot; &#39;(&quot;a&quot;)) ;; =&amp;gt; (&quot;a&quot;)
(-interpose &quot;-&quot; &#39;(&quot;a&quot; &quot;b&quot; &quot;c&quot;)) ;; =&amp;gt; (&quot;a&quot; &quot;-&quot; &quot;b&quot; &quot;-&quot; &quot;c&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-interleave &lt;code&gt;(&amp;amp;rest lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a new list of the first item in each list, then the second etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-interleave &#39;(1 2) &#39;(&quot;a&quot; &quot;b&quot;)) ;; =&amp;gt; (1 &quot;a&quot; 2 &quot;b&quot;)
(-interleave &#39;(1 2) &#39;(&quot;a&quot; &quot;b&quot;) &#39;(&quot;A&quot; &quot;B&quot;)) ;; =&amp;gt; (1 &quot;a&quot; &quot;A&quot; 2 &quot;b&quot; &quot;B&quot;)
(-interleave &#39;(1 2 3) &#39;(&quot;a&quot; &quot;b&quot;)) ;; =&amp;gt; (1 &quot;a&quot; 2 &quot;b&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-iota &lt;code&gt;(count &amp;amp;optional start step)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list containing &lt;code&gt;count&lt;/code&gt; numbers. Starts from &lt;code&gt;start&lt;/code&gt; and adds &lt;code&gt;step&lt;/code&gt; each time. The default &lt;code&gt;start&lt;/code&gt; is zero, the default &lt;code&gt;step&lt;/code&gt; is 1. This function takes its name from the corresponding primitive in the &lt;code&gt;apl&lt;/code&gt; language.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-iota 6) ;; =&amp;gt; (0 1 2 3 4 5)
(-iota 4 2.5 -2) ;; =&amp;gt; (2.5 0.5 -1.5 -3.5)
(-iota -1) ;; Wrong type argument: natnump, -1
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-zip-with &lt;code&gt;(fn list1 list2)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Zip &lt;code&gt;list1&lt;/code&gt; and &lt;code&gt;list2&lt;/code&gt; into a new list using the function &lt;code&gt;fn&lt;/code&gt;. That is, apply &lt;code&gt;fn&lt;/code&gt; pairwise taking as first argument the next element of &lt;code&gt;list1&lt;/code&gt; and as second argument the next element of &lt;code&gt;list2&lt;/code&gt; at the corresponding position. The result is as long as the shorter list.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--zip-with&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For other zips, see also &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-lists-rest-lists&quot;&gt;&lt;code&gt;-zip-lists&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-fill-fill-value-rest-lists&quot;&gt;&lt;code&gt;-zip-fill&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-zip-with #&#39;+ &#39;(1 2 3 4) &#39;(5 6 7)) ;; =&amp;gt; (6 8 10)
(-zip-with #&#39;cons &#39;(1 2 3) &#39;(4 5 6 7)) ;; =&amp;gt; ((1 . 4) (2 . 5) (3 . 6))
(--zip-with (format &quot;%s &amp;amp; %s&quot; it other) &#39;(Batman Jekyll) &#39;(Robin Hyde)) ;; =&amp;gt; (&quot;Batman &amp;amp; Robin&quot; &quot;Jekyll &amp;amp; Hyde&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-zip-pair &lt;code&gt;(list1 list2)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Zip &lt;code&gt;list1&lt;/code&gt; and &lt;code&gt;list2&lt;/code&gt; together.&lt;/p&gt; 
&lt;p&gt;Make a pair with the head of each list, followed by a pair with the second element of each list, and so on. The number of pairs returned is equal to the length of the shorter input list.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-lists-rest-lists&quot;&gt;&lt;code&gt;-zip-lists&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-zip-pair &#39;(1 2 3 4) &#39;(5 6 7)) ;; =&amp;gt; ((1 . 5) (2 . 6) (3 . 7))
(-zip-pair &#39;(1 2 3) &#39;(4 5 6)) ;; =&amp;gt; ((1 . 4) (2 . 5) (3 . 6))
(-zip-pair &#39;(1 2) &#39;(3)) ;; =&amp;gt; ((1 . 3))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-zip-lists &lt;code&gt;(&amp;amp;rest lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Zip &lt;code&gt;lists&lt;/code&gt; together.&lt;/p&gt; 
&lt;p&gt;Group the head of each list, followed by the second element of each list, and so on. The number of returned groupings is equal to the length of the shortest input list, and the length of each grouping is equal to the number of input &lt;code&gt;lists&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;The return value is always a list of proper lists, in contrast to &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-rest-lists&quot;&gt;&lt;code&gt;-zip&lt;/code&gt;&lt;/a&gt; which returns a list of dotted pairs when only two input &lt;code&gt;lists&lt;/code&gt; are provided.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-pair-list1-list2&quot;&gt;&lt;code&gt;-zip-pair&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-zip-lists &#39;(1 2 3) &#39;(4 5 6)) ;; =&amp;gt; ((1 4) (2 5) (3 6))
(-zip-lists &#39;(1 2 3) &#39;(4 5 6 7)) ;; =&amp;gt; ((1 4) (2 5) (3 6))
(-zip-lists &#39;(1 2) &#39;(3 4 5) &#39;(6)) ;; =&amp;gt; ((1 3 6))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-zip-lists-fill &lt;code&gt;(fill-value &amp;amp;rest lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Zip &lt;code&gt;lists&lt;/code&gt; together, padding shorter lists with &lt;code&gt;fill-value&lt;/code&gt;. This is like &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-lists-rest-lists&quot;&gt;&lt;code&gt;-zip-lists&lt;/code&gt;&lt;/a&gt; (which see), except it retains all elements at positions beyond the end of the shortest list. The number of returned groupings is equal to the length of the longest input list, and the length of each grouping is equal to the number of input &lt;code&gt;lists&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-zip-lists-fill 0 &#39;(1 2) &#39;(3 4 5) &#39;(6)) ;; =&amp;gt; ((1 3 6) (2 4 0) (0 5 0))
(-zip-lists-fill 0 &#39;(1 2) &#39;(3 4) &#39;(5 6)) ;; =&amp;gt; ((1 3 5) (2 4 6))
(-zip-lists-fill 0 &#39;(1 2 3) nil) ;; =&amp;gt; ((1 0) (2 0) (3 0))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-zip &lt;code&gt;(&amp;amp;rest lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Zip &lt;code&gt;lists&lt;/code&gt; together.&lt;/p&gt; 
&lt;p&gt;Group the head of each list, followed by the second element of each list, and so on. The number of returned groupings is equal to the length of the shortest input list, and the number of items in each grouping is equal to the number of input &lt;code&gt;lists&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;If only two &lt;code&gt;lists&lt;/code&gt; are provided as arguments, return the groupings as a list of dotted pairs. Otherwise, return the groupings as a list of proper lists.&lt;/p&gt; 
&lt;p&gt;Since the return value changes form depending on the number of arguments, it is generally recommended to use &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-lists-rest-lists&quot;&gt;&lt;code&gt;-zip-lists&lt;/code&gt;&lt;/a&gt; instead, or &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-pair-list1-list2&quot;&gt;&lt;code&gt;-zip-pair&lt;/code&gt;&lt;/a&gt; if a list of dotted pairs is desired.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-unzip-lists&quot;&gt;&lt;code&gt;-unzip&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-zip &#39;(1 2 3 4) &#39;(5 6 7) &#39;(8 9)) ;; =&amp;gt; ((1 5 8) (2 6 9))
(-zip &#39;(1 2 3) &#39;(4 5 6) &#39;(7 8 9)) ;; =&amp;gt; ((1 4 7) (2 5 8) (3 6 9))
(-zip &#39;(1 2 3)) ;; =&amp;gt; ((1) (2) (3))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-zip-fill &lt;code&gt;(fill-value &amp;amp;rest lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Zip &lt;code&gt;lists&lt;/code&gt; together, padding shorter lists with &lt;code&gt;fill-value&lt;/code&gt;. This is like &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-rest-lists&quot;&gt;&lt;code&gt;-zip&lt;/code&gt;&lt;/a&gt; (which see), except it retains all elements at positions beyond the end of the shortest list. The number of returned groupings is equal to the length of the longest input list, and the length of each grouping is equal to the number of input &lt;code&gt;lists&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Since the return value changes form depending on the number of arguments, it is generally recommended to use &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-lists-fill-fill-value-rest-lists&quot;&gt;&lt;code&gt;-zip-lists-fill&lt;/code&gt;&lt;/a&gt; instead, unless a list of dotted pairs is explicitly desired.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-zip-fill 0 &#39;(1 2 3) &#39;(4 5)) ;; =&amp;gt; ((1 . 4) (2 . 5) (3 . 0))
(-zip-fill 0 () &#39;(1 2 3)) ;; =&amp;gt; ((0 . 1) (0 . 2) (0 . 3))
(-zip-fill 0 &#39;(1 2) &#39;(3 4) &#39;(5 6)) ;; =&amp;gt; ((1 3 5) (2 4 6))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-unzip-lists &lt;code&gt;(lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Unzip &lt;code&gt;lists&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This works just like &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-lists-rest-lists&quot;&gt;&lt;code&gt;-zip-lists&lt;/code&gt;&lt;/a&gt; (which see), but takes a list of lists instead of a variable number of arguments, such that&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(-unzip-lists (-zip-lists `args`...))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;is identity (given that the lists comprising &lt;code&gt;args&lt;/code&gt; are of the same length).&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-unzip-lists (-zip-lists &#39;(1 2) &#39;(3 4) &#39;(5 6))) ;; =&amp;gt; ((1 2) (3 4) (5 6))
(-unzip-lists &#39;((1 2 3) (4 5) (6 7) (8 9))) ;; =&amp;gt; ((1 4 6 8) (2 5 7 9))
(-unzip-lists &#39;((1 2 3) (4 5 6))) ;; =&amp;gt; ((1 4) (2 5) (3 6))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-unzip &lt;code&gt;(lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Unzip &lt;code&gt;lists&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This works just like &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-rest-lists&quot;&gt;&lt;code&gt;-zip&lt;/code&gt;&lt;/a&gt; (which see), but takes a list of lists instead of a variable number of arguments, such that&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(-unzip (-zip `l1` `l2` `l3` ...))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;is identity (given that the lists are of the same length, and that &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-zip-rest-lists&quot;&gt;&lt;code&gt;-zip&lt;/code&gt;&lt;/a&gt; is not called with two arguments, because of the caveat described in its docstring).&lt;/p&gt; 
&lt;p&gt;Note in particular that calling &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-unzip-lists&quot;&gt;&lt;code&gt;-unzip&lt;/code&gt;&lt;/a&gt; on a list of two lists will return a list of dotted pairs.&lt;/p&gt; 
&lt;p&gt;Since the return value changes form depending on the number of &lt;code&gt;lists&lt;/code&gt;, it is generally recommended to use &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-unzip-lists-lists&quot;&gt;&lt;code&gt;-unzip-lists&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-unzip (-zip &#39;(1 2) &#39;(3 4) &#39;(5 6))) ;; =&amp;gt; ((1 . 2) (3 . 4) (5 . 6))
(-unzip &#39;((1 2 3) (4 5 6))) ;; =&amp;gt; ((1 . 4) (2 . 5) (3 . 6))
(-unzip &#39;((1 2 3) (4 5) (6 7) (8 9))) ;; =&amp;gt; ((1 4 6 8) (2 5 7 9))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-pad &lt;code&gt;(fill-value &amp;amp;rest lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Pad each of &lt;code&gt;lists&lt;/code&gt; with &lt;code&gt;fill-value&lt;/code&gt; until they all have equal lengths.&lt;/p&gt; 
&lt;p&gt;Ensure all &lt;code&gt;lists&lt;/code&gt; are as long as the longest one by repeatedly appending &lt;code&gt;fill-value&lt;/code&gt; to the shorter lists, and return the resulting &lt;code&gt;lists&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-pad 0 ()) ;; =&amp;gt; (nil)
(-pad 0 &#39;(1 2) &#39;(3 4)) ;; =&amp;gt; ((1 2) (3 4))
(-pad 0 &#39;(1 2) &#39;(3 4 5 6) &#39;(7 8 9)) ;; =&amp;gt; ((1 2 0 0) (3 4 5 6) (7 8 9 0))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-table &lt;code&gt;(fn &amp;amp;rest lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Compute outer product of &lt;code&gt;lists&lt;/code&gt; using function &lt;code&gt;fn&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;The function &lt;code&gt;fn&lt;/code&gt; should have the same arity as the number of supplied lists.&lt;/p&gt; 
&lt;p&gt;The outer product is computed by applying fn to all possible combinations created by taking one element from each list in order. The dimension of the result is (length lists).&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-table-flat-fn-rest-lists&quot;&gt;&lt;code&gt;-table-flat&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-table &#39;* &#39;(1 2 3) &#39;(1 2 3)) ;; =&amp;gt; ((1 2 3) (2 4 6) (3 6 9))
(-table (lambda (a b) (-sum (-zip-with &#39;* a b))) &#39;((1 2) (3 4)) &#39;((1 3) (2 4))) ;; =&amp;gt; ((7 15) (10 22))
(apply &#39;-table &#39;list (-repeat 3 &#39;(1 2))) ;; =&amp;gt; ((((1 1 1) (2 1 1)) ((1 2 1) (2 2 1))) (((1 1 2) (2 1 2)) ((1 2 2) (2 2 2))))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-table-flat &lt;code&gt;(fn &amp;amp;rest lists)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Compute flat outer product of &lt;code&gt;lists&lt;/code&gt; using function &lt;code&gt;fn&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;The function &lt;code&gt;fn&lt;/code&gt; should have the same arity as the number of supplied lists.&lt;/p&gt; 
&lt;p&gt;The outer product is computed by applying fn to all possible combinations created by taking one element from each list in order. The results are flattened, ignoring the tensor structure of the result. This is equivalent to calling:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(-flatten-n (1- (length lists)) (apply &#39;-table fn lists))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;but the implementation here is much more efficient.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-flatten-n-num-list&quot;&gt;&lt;code&gt;-flatten-n&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-table-fn-rest-lists&quot;&gt;&lt;code&gt;-table&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-table-flat &#39;list &#39;(1 2 3) &#39;(a b c)) ;; =&amp;gt; ((1 a) (2 a) (3 a) (1 b) (2 b) (3 b) (1 c) (2 c) (3 c))
(-table-flat &#39;* &#39;(1 2 3) &#39;(1 2 3)) ;; =&amp;gt; (1 2 3 2 4 6 3 6 9)
(apply &#39;-table-flat &#39;list (-repeat 3 &#39;(1 2))) ;; =&amp;gt; ((1 1 1) (2 1 1) (1 2 1) (2 2 1) (1 1 2) (2 1 2) (1 2 2) (2 2 2))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-first &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the first item in &lt;code&gt;list&lt;/code&gt; for which &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt;. Return &lt;code&gt;nil&lt;/code&gt; if no such element is found.&lt;/p&gt; 
&lt;p&gt;To get the first item in the list no questions asked, use &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-first-item-list&quot;&gt;&lt;code&gt;-first-item&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;Alias: &lt;code&gt;-find&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--first&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-first #&#39;natnump &#39;(-1 0 1)) ;; =&amp;gt; 0
(-first #&#39;null &#39;(1 2 3)) ;; =&amp;gt; nil
(--first (&amp;gt; it 2) &#39;(1 2 3)) ;; =&amp;gt; 3
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-last &lt;code&gt;(pred list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the last x in &lt;code&gt;list&lt;/code&gt; where (&lt;code&gt;pred&lt;/code&gt; x) is non-&lt;code&gt;nil&lt;/code&gt;, else &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-last &#39;even? &#39;(1 2 3 4 5 6 3 3 3)) ;; =&amp;gt; 6
(-last &#39;even? &#39;(1 3 7 5 9)) ;; =&amp;gt; nil
(--last (&amp;gt; (length it) 3) &#39;(&quot;a&quot; &quot;looong&quot; &quot;word&quot; &quot;and&quot; &quot;short&quot; &quot;one&quot;)) ;; =&amp;gt; &quot;short&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-first-item &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the first item of &lt;code&gt;list&lt;/code&gt;, or &lt;code&gt;nil&lt;/code&gt; on an empty list.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-second-item-list&quot;&gt;&lt;code&gt;-second-item&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-last-item-list&quot;&gt;&lt;code&gt;-last-item&lt;/code&gt;&lt;/a&gt;, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-first-item ()) ;; =&amp;gt; ()
(-first-item &#39;(1 2 3 4 5)) ;; =&amp;gt; 1
(let ((list (list 1 2 3))) (setf (-first-item list) 5) list) ;; =&amp;gt; (5 2 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-second-item &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the second item of &lt;code&gt;list&lt;/code&gt;, or &lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;list&lt;/code&gt; is too short.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-first-item-list&quot;&gt;&lt;code&gt;-first-item&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-third-item-list&quot;&gt;&lt;code&gt;-third-item&lt;/code&gt;&lt;/a&gt;, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-second-item ()) ;; =&amp;gt; ()
(-second-item &#39;(1 2 3 4 5)) ;; =&amp;gt; 2
(let ((list (list 1 2))) (setf (-second-item list) 5) list) ;; =&amp;gt; (1 5)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-third-item &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the third item of &lt;code&gt;list&lt;/code&gt;, or &lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;list&lt;/code&gt; is too short.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-second-item-list&quot;&gt;&lt;code&gt;-second-item&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-fourth-item-list&quot;&gt;&lt;code&gt;-fourth-item&lt;/code&gt;&lt;/a&gt;, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-third-item ()) ;; =&amp;gt; ()
(-third-item &#39;(1 2)) ;; =&amp;gt; ()
(-third-item &#39;(1 2 3 4 5)) ;; =&amp;gt; 3
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-fourth-item &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the fourth item of &lt;code&gt;list&lt;/code&gt;, or &lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;list&lt;/code&gt; is too short.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-third-item-list&quot;&gt;&lt;code&gt;-third-item&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-fifth-item-list&quot;&gt;&lt;code&gt;-fifth-item&lt;/code&gt;&lt;/a&gt;, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-fourth-item ()) ;; =&amp;gt; ()
(-fourth-item &#39;(1 2 3)) ;; =&amp;gt; ()
(-fourth-item &#39;(1 2 3 4 5)) ;; =&amp;gt; 4
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-fifth-item &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the fifth item of &lt;code&gt;list&lt;/code&gt;, or &lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;list&lt;/code&gt; is too short.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-fourth-item-list&quot;&gt;&lt;code&gt;-fourth-item&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-last-item-list&quot;&gt;&lt;code&gt;-last-item&lt;/code&gt;&lt;/a&gt;, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-fifth-item ()) ;; =&amp;gt; ()
(-fifth-item &#39;(1 2 3 4)) ;; =&amp;gt; ()
(-fifth-item &#39;(1 2 3 4 5)) ;; =&amp;gt; 5
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-last-item &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return the last item of &lt;code&gt;list&lt;/code&gt;, or &lt;code&gt;nil&lt;/code&gt; on an empty list.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-first-item-list&quot;&gt;&lt;code&gt;-first-item&lt;/code&gt;&lt;/a&gt;, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-last-item ()) ;; =&amp;gt; ()
(-last-item &#39;(1 2 3 4 5)) ;; =&amp;gt; 5
(let ((list (list 1 2 3))) (setf (-last-item list) 5) list) ;; =&amp;gt; (1 2 5)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-butlast &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a list of all items in list except for the last.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-butlast &#39;(1 2 3)) ;; =&amp;gt; (1 2)
(-butlast &#39;(1 2)) ;; =&amp;gt; (1)
(-butlast &#39;(1)) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-sort &lt;code&gt;(comparator list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Sort &lt;code&gt;list&lt;/code&gt;, stably, comparing elements using &lt;code&gt;comparator&lt;/code&gt;. Return the sorted list. &lt;code&gt;list&lt;/code&gt; is &lt;code&gt;not&lt;/code&gt; modified by side effects. &lt;code&gt;comparator&lt;/code&gt; is called with two elements of &lt;code&gt;list&lt;/code&gt;, and should return non-&lt;code&gt;nil&lt;/code&gt; if the first element should sort before the second.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-sort #&#39;&amp;lt; &#39;(3 1 2)) ;; =&amp;gt; (1 2 3)
(-sort #&#39;&amp;gt; &#39;(3 1 2)) ;; =&amp;gt; (3 2 1)
(--sort (&amp;lt; it other) &#39;(3 1 2)) ;; =&amp;gt; (1 2 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-list &lt;code&gt;(arg)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Ensure &lt;code&gt;arg&lt;/code&gt; is a list. If &lt;code&gt;arg&lt;/code&gt; is already a list, return it as is (not a copy). Otherwise, return a new list with &lt;code&gt;arg&lt;/code&gt; as its only element.&lt;/p&gt; 
&lt;p&gt;Another supported calling convention is (-list &amp;amp;rest &lt;code&gt;args&lt;/code&gt;). In this case, if &lt;code&gt;arg&lt;/code&gt; is not a list, a new list with all of &lt;code&gt;args&lt;/code&gt; as elements is returned. This use is supported for backward compatibility and is otherwise deprecated.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-list 1) ;; =&amp;gt; (1)
(-list ()) ;; =&amp;gt; ()
(-list &#39;(1 2 3)) ;; =&amp;gt; (1 2 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-fix &lt;code&gt;(fn list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Compute the (least) fixpoint of &lt;code&gt;fn&lt;/code&gt; with initial input &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;fn&lt;/code&gt; is called at least once, results are compared with &lt;code&gt;equal&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-fix (lambda (l) (-non-nil (--mapcat (-split-at (/ (length it) 2) it) l))) &#39;((1 2 3))) ;; =&amp;gt; ((1) (2) (3))
(let ((l &#39;((starwars scifi) (jedi starwars warrior)))) (--fix (-uniq (--mapcat (cons it (cdr (assq it l))) it)) &#39;(jedi book))) ;; =&amp;gt; (jedi starwars warrior scifi book)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Tree operations&lt;/h2&gt; 
&lt;p&gt;Functions pretending lists are trees.&lt;/p&gt; 
&lt;h4&gt;-tree-seq &lt;code&gt;(branch children tree)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a sequence of the nodes in &lt;code&gt;tree&lt;/code&gt;, in depth-first search order.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;branch&lt;/code&gt; is a predicate of one argument that returns non-&lt;code&gt;nil&lt;/code&gt; if the passed argument is a branch, that is, a node that can have children.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;children&lt;/code&gt; is a function of one argument that returns the children of the passed branch node.&lt;/p&gt; 
&lt;p&gt;Non-branch nodes are simply copied.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-tree-seq &#39;listp &#39;identity &#39;(1 (2 3) 4 (5 (6 7)))) ;; =&amp;gt; ((1 (2 3) 4 (5 (6 7))) 1 (2 3) 2 3 4 (5 (6 7)) 5 (6 7) 6 7)
(-tree-seq &#39;listp &#39;reverse &#39;(1 (2 3) 4 (5 (6 7)))) ;; =&amp;gt; ((1 (2 3) 4 (5 (6 7))) (5 (6 7)) (6 7) 7 6 5 4 (2 3) 3 2 1)
(--tree-seq (vectorp it) (append it nil) [1 [2 3] 4 [5 [6 7]]]) ;; =&amp;gt; ([1 [2 3] 4 [5 [6 7]]] 1 [2 3] 2 3 4 [5 [6 7]] 5 [6 7] 6 7)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-tree-map &lt;code&gt;(fn tree)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Apply &lt;code&gt;fn&lt;/code&gt; to each element of &lt;code&gt;tree&lt;/code&gt; while preserving the tree structure.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-tree-map &#39;1+ &#39;(1 (2 3) (4 (5 6) 7))) ;; =&amp;gt; (2 (3 4) (5 (6 7) 8))
(-tree-map &#39;(lambda (x) (cons x (expt 2 x))) &#39;(1 (2 3) 4)) ;; =&amp;gt; ((1 . 2) ((2 . 4) (3 . 8)) (4 . 16))
(--tree-map (length it) &#39;(&quot;&amp;lt;body&amp;gt;&quot; (&quot;&amp;lt;p&amp;gt;&quot; &quot;text&quot; &quot;&amp;lt;/p&amp;gt;&quot;) &quot;&amp;lt;/body&amp;gt;&quot;)) ;; =&amp;gt; (6 (3 4 4) 7)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-tree-map-nodes &lt;code&gt;(pred fun tree)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Call &lt;code&gt;fun&lt;/code&gt; on each node of &lt;code&gt;tree&lt;/code&gt; that satisfies &lt;code&gt;pred&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;If &lt;code&gt;pred&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, continue descending down this node. If &lt;code&gt;pred&lt;/code&gt; returns non-&lt;code&gt;nil&lt;/code&gt;, apply &lt;code&gt;fun&lt;/code&gt; to this node and do not descend further.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-tree-map-nodes &#39;vectorp (lambda (x) (-sum (append x nil))) &#39;(1 [2 3] 4 (5 [6 7] 8))) ;; =&amp;gt; (1 5 4 (5 13 8))
(-tree-map-nodes &#39;keywordp (lambda (x) (symbol-name x)) &#39;(1 :foo 4 ((5 6 :bar) :baz 8))) ;; =&amp;gt; (1 &quot;:foo&quot; 4 ((5 6 &quot;:bar&quot;) &quot;:baz&quot; 8))
(--tree-map-nodes (eq (car-safe it) &#39;add-mode) (-concat it (list :mode &#39;emacs-lisp-mode)) &#39;(with-mode emacs-lisp-mode (foo bar) (add-mode a b) (baz (add-mode c d)))) ;; =&amp;gt; (with-mode emacs-lisp-mode (foo bar) (add-mode a b :mode emacs-lisp-mode) (baz (add-mode c d :mode emacs-lisp-mode)))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-tree-reduce &lt;code&gt;(fn tree)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Use &lt;code&gt;fn&lt;/code&gt; to reduce elements of list &lt;code&gt;tree&lt;/code&gt;. If elements of &lt;code&gt;tree&lt;/code&gt; are lists themselves, apply the reduction recursively.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;fn&lt;/code&gt; is first applied to first element of the list and second element, then on this result and third element from the list etc.&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-fn-list&quot;&gt;&lt;code&gt;-reduce-r&lt;/code&gt;&lt;/a&gt; for how exactly are lists of zero or one element handled.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-tree-reduce &#39;+ &#39;(1 (2 3) (4 5))) ;; =&amp;gt; 15
(-tree-reduce &#39;concat &#39;(&quot;strings&quot; (&quot; on&quot; &quot; various&quot;) ((&quot; levels&quot;)))) ;; =&amp;gt; &quot;strings on various levels&quot;
(--tree-reduce (cond ((stringp it) (concat it &quot; &quot; acc)) (t (let ((sn (symbol-name it))) (concat &quot;&amp;lt;&quot; sn &quot;&amp;gt;&quot; acc &quot;&amp;lt;/&quot; sn &quot;&amp;gt;&quot;)))) &#39;(body (p &quot;some words&quot;) (div &quot;more&quot; (b &quot;bold&quot;) &quot;words&quot;))) ;; =&amp;gt; &quot;&amp;lt;body&amp;gt;&amp;lt;p&amp;gt;some words&amp;lt;/p&amp;gt; &amp;lt;div&amp;gt;more &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt; words&amp;lt;/div&amp;gt;&amp;lt;/body&amp;gt;&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-tree-reduce-from &lt;code&gt;(fn init-value tree)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Use &lt;code&gt;fn&lt;/code&gt; to reduce elements of list &lt;code&gt;tree&lt;/code&gt;. If elements of &lt;code&gt;tree&lt;/code&gt; are lists themselves, apply the reduction recursively.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;fn&lt;/code&gt; is first applied to &lt;code&gt;init-value&lt;/code&gt; and first element of the list, then on this result and second element from the list etc.&lt;/p&gt; 
&lt;p&gt;The initial value is ignored on cons pairs as they always contain two elements.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-tree-reduce-from &#39;+ 1 &#39;(1 (1 1) ((1)))) ;; =&amp;gt; 8
(--tree-reduce-from (-concat acc (list it)) nil &#39;(1 (2 3 (4 5)) (6 7))) ;; =&amp;gt; ((7 6) ((5 4) 3 2) 1)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-tree-mapreduce &lt;code&gt;(fn folder tree)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Apply &lt;code&gt;fn&lt;/code&gt; to each element of &lt;code&gt;tree&lt;/code&gt;, and make a list of the results. If elements of &lt;code&gt;tree&lt;/code&gt; are lists themselves, apply &lt;code&gt;fn&lt;/code&gt; recursively to elements of these nested lists.&lt;/p&gt; 
&lt;p&gt;Then reduce the resulting lists using &lt;code&gt;folder&lt;/code&gt; and initial value &lt;code&gt;init-value&lt;/code&gt;. See &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-from-fn-init-list&quot;&gt;&lt;code&gt;-reduce-r-from&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;This is the same as calling &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tree-reduce-fn-tree&quot;&gt;&lt;code&gt;-tree-reduce&lt;/code&gt;&lt;/a&gt; after &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tree-map-fn-tree&quot;&gt;&lt;code&gt;-tree-map&lt;/code&gt;&lt;/a&gt; but is twice as fast as it only traverse the structure once.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-tree-mapreduce &#39;list &#39;append &#39;(1 (2 (3 4) (5 6)) (7 (8 9)))) ;; =&amp;gt; (1 2 3 4 5 6 7 8 9)
(--tree-mapreduce 1 (+ it acc) &#39;(1 (2 (4 9) (2 1)) (7 (4 3)))) ;; =&amp;gt; 9
(--tree-mapreduce 0 (max acc (1+ it)) &#39;(1 (2 (4 9) (2 1)) (7 (4 3)))) ;; =&amp;gt; 3
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-tree-mapreduce-from &lt;code&gt;(fn folder init-value tree)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Apply &lt;code&gt;fn&lt;/code&gt; to each element of &lt;code&gt;tree&lt;/code&gt;, and make a list of the results. If elements of &lt;code&gt;tree&lt;/code&gt; are lists themselves, apply &lt;code&gt;fn&lt;/code&gt; recursively to elements of these nested lists.&lt;/p&gt; 
&lt;p&gt;Then reduce the resulting lists using &lt;code&gt;folder&lt;/code&gt; and initial value &lt;code&gt;init-value&lt;/code&gt;. See &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-reduce-r-from-fn-init-list&quot;&gt;&lt;code&gt;-reduce-r-from&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;This is the same as calling &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tree-reduce-from-fn-init-value-tree&quot;&gt;&lt;code&gt;-tree-reduce-from&lt;/code&gt;&lt;/a&gt; after &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-tree-map-fn-tree&quot;&gt;&lt;code&gt;-tree-map&lt;/code&gt;&lt;/a&gt; but is twice as fast as it only traverse the structure once.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-tree-mapreduce-from &#39;identity &#39;* 1 &#39;(1 (2 (3 4) (5 6)) (7 (8 9)))) ;; =&amp;gt; 362880
(--tree-mapreduce-from (+ it it) (cons it acc) nil &#39;(1 (2 (4 9) (2 1)) (7 (4 3)))) ;; =&amp;gt; (2 (4 (8 18) (4 2)) (14 (8 6)))
(concat &quot;{&quot; (--tree-mapreduce-from (cond ((-cons-pair? it) (concat (symbol-name (car it)) &quot; -&amp;gt; &quot; (symbol-name (cdr it)))) (t (concat (symbol-name it) &quot; : {&quot;))) (concat it (unless (or (equal acc &quot;}&quot;) (equal (substring it (1- (length it))) &quot;{&quot;)) &quot;, &quot;) acc) &quot;}&quot; &#39;((elisp-mode (foo (bar . booze)) (baz . qux)) (c-mode (foo . bla) (bum . bam))))) ;; =&amp;gt; &quot;{elisp-mode : {foo : {bar -&amp;gt; booze}, baz -&amp;gt; qux}, c-mode : {foo -&amp;gt; bla, bum -&amp;gt; bam}}&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-clone &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Create a deep copy of &lt;code&gt;list&lt;/code&gt;. The new list has the same elements and structure but all cons are replaced with new ones. This is useful when you need to clone a structure such as plist or alist.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(let* ((a (list (list 1))) (b (-clone a))) (setcar (car a) 2) b) ;; =&amp;gt; ((1))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Threading macros&lt;/h2&gt; 
&lt;p&gt;Macros that conditionally combine sequential forms for brevity or readability.&lt;/p&gt; 
&lt;h4&gt;-&amp;gt; &lt;code&gt;(x &amp;amp;optional form &amp;amp;rest more)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Thread the expr through the forms. Insert &lt;code&gt;x&lt;/code&gt; as the second item in the first form, making a list of it if it is not a list already. If there are more forms, insert the first form as the second item in second form, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-&amp;gt; &#39;(2 3 5)) ;; =&amp;gt; (2 3 5)
(-&amp;gt; &#39;(2 3 5) (append &#39;(8 13))) ;; =&amp;gt; (2 3 5 8 13)
(-&amp;gt; &#39;(2 3 5) (append &#39;(8 13)) (-slice 1 -1)) ;; =&amp;gt; (3 5 8)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-&amp;gt;&amp;gt; &lt;code&gt;(x &amp;amp;optional form &amp;amp;rest more)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Thread the expr through the forms. Insert &lt;code&gt;x&lt;/code&gt; as the last item in the first form, making a list of it if it is not a list already. If there are more forms, insert the first form as the last item in second form, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-&amp;gt;&amp;gt; &#39;(1 2 3) (-map &#39;square)) ;; =&amp;gt; (1 4 9)
(-&amp;gt;&amp;gt; &#39;(1 2 3) (-map &#39;square) (-remove &#39;even?)) ;; =&amp;gt; (1 9)
(-&amp;gt;&amp;gt; &#39;(1 2 3) (-map &#39;square) (-reduce &#39;+)) ;; =&amp;gt; 14
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;--&amp;gt; &lt;code&gt;(x &amp;amp;rest forms)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Starting with the value of &lt;code&gt;x&lt;/code&gt;, thread each expression through &lt;code&gt;forms&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Insert &lt;code&gt;x&lt;/code&gt; at the position signified by the symbol &lt;code&gt;it&lt;/code&gt; in the first form. If there are more forms, insert the first form at the position signified by &lt;code&gt;it&lt;/code&gt; in the second form, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(--&amp;gt; &quot;def&quot; (concat &quot;abc&quot; it &quot;ghi&quot;)) ;; =&amp;gt; &quot;abcdefghi&quot;
(--&amp;gt; &quot;def&quot; (concat &quot;abc&quot; it &quot;ghi&quot;) (upcase it)) ;; =&amp;gt; &quot;ABCDEFGHI&quot;
(--&amp;gt; &quot;def&quot; (concat &quot;abc&quot; it &quot;ghi&quot;) upcase) ;; =&amp;gt; &quot;ABCDEFGHI&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-as-&amp;gt; &lt;code&gt;(value variable &amp;amp;rest forms)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Starting with &lt;code&gt;value&lt;/code&gt;, thread &lt;code&gt;variable&lt;/code&gt; through &lt;code&gt;forms&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;In the first form, bind &lt;code&gt;variable&lt;/code&gt; to &lt;code&gt;value&lt;/code&gt;. In the second form, bind &lt;code&gt;variable&lt;/code&gt; to the result of the first form, and so forth.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-as-&amp;gt; 3 my-var (1+ my-var) (list my-var) (mapcar (lambda (ele) (* 2 ele)) my-var)) ;; =&amp;gt; (8)
(-as-&amp;gt; 3 my-var 1+) ;; =&amp;gt; 4
(-as-&amp;gt; 3 my-var) ;; =&amp;gt; 3
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-some-&amp;gt; &lt;code&gt;(x &amp;amp;optional form &amp;amp;rest more)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;When expr is non-&lt;code&gt;nil&lt;/code&gt;, thread it through the first form (via &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#--x-optional-form-rest-more&quot;&gt;&lt;code&gt;-&amp;gt;&lt;/code&gt;&lt;/a&gt;), and when that result is non-&lt;code&gt;nil&lt;/code&gt;, through the next form, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-some-&amp;gt; &#39;(2 3 5)) ;; =&amp;gt; (2 3 5)
(-some-&amp;gt; 5 square) ;; =&amp;gt; 25
(-some-&amp;gt; 5 even? square) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-some-&amp;gt;&amp;gt; &lt;code&gt;(x &amp;amp;optional form &amp;amp;rest more)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;When expr is non-&lt;code&gt;nil&lt;/code&gt;, thread it through the first form (via &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#--x-optional-form-rest-more&quot;&gt;&lt;code&gt;-&amp;gt;&amp;gt;&lt;/code&gt;&lt;/a&gt;), and when that result is non-&lt;code&gt;nil&lt;/code&gt;, through the next form, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-some-&amp;gt;&amp;gt; &#39;(1 2 3) (-map &#39;square)) ;; =&amp;gt; (1 4 9)
(-some-&amp;gt;&amp;gt; &#39;(1 3 5) (-last &#39;even?) (+ 100)) ;; =&amp;gt; nil
(-some-&amp;gt;&amp;gt; &#39;(2 4 6) (-last &#39;even?) (+ 100)) ;; =&amp;gt; 106
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-some--&amp;gt; &lt;code&gt;(expr &amp;amp;rest forms)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Thread &lt;code&gt;expr&lt;/code&gt; through &lt;code&gt;forms&lt;/code&gt; via &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#---x-rest-forms&quot;&gt;&lt;code&gt;--&amp;gt;&lt;/code&gt;&lt;/a&gt;, while the result is non-&lt;code&gt;nil&lt;/code&gt;. When &lt;code&gt;expr&lt;/code&gt; evaluates to non-&lt;code&gt;nil&lt;/code&gt;, thread the result through the first of &lt;code&gt;forms&lt;/code&gt;, and when that result is non-&lt;code&gt;nil&lt;/code&gt;, thread it through the next form, etc.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-some--&amp;gt; &quot;def&quot; (concat &quot;abc&quot; it &quot;ghi&quot;)) ;; =&amp;gt; &quot;abcdefghi&quot;
(-some--&amp;gt; nil (concat &quot;abc&quot; it &quot;ghi&quot;)) ;; =&amp;gt; nil
(-some--&amp;gt; &#39;(0 1) (-remove #&#39;natnump it) (append it it) (-map #&#39;1+ it)) ;; =&amp;gt; ()
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-doto &lt;code&gt;(init &amp;amp;rest forms)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Evaluate &lt;code&gt;init&lt;/code&gt; and pass it as argument to &lt;code&gt;forms&lt;/code&gt; with &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#--x-optional-form-rest-more&quot;&gt;&lt;code&gt;-&amp;gt;&lt;/code&gt;&lt;/a&gt;. The &lt;code&gt;result&lt;/code&gt; of evaluating &lt;code&gt;init&lt;/code&gt; is threaded through each of &lt;code&gt;forms&lt;/code&gt; individually using &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#--x-optional-form-rest-more&quot;&gt;&lt;code&gt;-&amp;gt;&lt;/code&gt;&lt;/a&gt;, which see. The return value is &lt;code&gt;result&lt;/code&gt;, which &lt;code&gt;forms&lt;/code&gt; may have modified by side effect.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-doto (list 1 2 3) pop pop) ;; =&amp;gt; (3)
(-doto (cons 1 2) (setcar 3) (setcdr 4)) ;; =&amp;gt; (3 . 4)
(gethash &#39;k (--doto (make-hash-table) (puthash &#39;k &#39;v it))) ;; =&amp;gt; v
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Binding&lt;/h2&gt; 
&lt;p&gt;Macros that combine &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;let*&lt;/code&gt; with destructuring and flow control.&lt;/p&gt; 
&lt;h4&gt;-when-let &lt;code&gt;((var val) &amp;amp;rest body)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;If &lt;code&gt;val&lt;/code&gt; evaluates to non-&lt;code&gt;nil&lt;/code&gt;, bind it to &lt;code&gt;var&lt;/code&gt; and execute body.&lt;/p&gt; 
&lt;p&gt;Note: binding is done according to &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-let-varlist-rest-body&quot;&gt;&lt;code&gt;-let&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-when-let (match-index (string-match &quot;d&quot; &quot;abcd&quot;)) (+ match-index 2)) ;; =&amp;gt; 5
(-when-let ((&amp;amp;plist :foo foo) (list :foo &quot;foo&quot;)) foo) ;; =&amp;gt; &quot;foo&quot;
(-when-let ((&amp;amp;plist :foo foo) (list :bar &quot;bar&quot;)) foo) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-when-let* &lt;code&gt;(vars-vals &amp;amp;rest body)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;If all &lt;code&gt;vals&lt;/code&gt; evaluate to true, bind them to their corresponding &lt;code&gt;vars&lt;/code&gt; and execute body. &lt;code&gt;vars-vals&lt;/code&gt; should be a list of (&lt;code&gt;var&lt;/code&gt; &lt;code&gt;val&lt;/code&gt;) pairs.&lt;/p&gt; 
&lt;p&gt;Note: binding is done according to &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-let-varlist-rest-body&quot;&gt;&lt;code&gt;-let*&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;vals&lt;/code&gt; are evaluated sequentially, and evaluation stops after the first &lt;code&gt;nil&lt;/code&gt; &lt;code&gt;val&lt;/code&gt; is encountered.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-when-let* ((x 5) (y 3) (z (+ y 4))) (+ x y z)) ;; =&amp;gt; 15
(-when-let* ((x 5) (y nil) (z 7)) (+ x y z)) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-if-let &lt;code&gt;((var val) then &amp;amp;rest else)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;If &lt;code&gt;val&lt;/code&gt; evaluates to non-&lt;code&gt;nil&lt;/code&gt;, bind it to &lt;code&gt;var&lt;/code&gt; and do &lt;code&gt;then&lt;/code&gt;, otherwise do &lt;code&gt;else&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Note: binding is done according to &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-let-varlist-rest-body&quot;&gt;&lt;code&gt;-let&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-if-let (match-index (string-match &quot;d&quot; &quot;abc&quot;)) (+ match-index 3) 7) ;; =&amp;gt; 7
(--if-let (even? 4) it nil) ;; =&amp;gt; t
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-if-let* &lt;code&gt;(vars-vals then &amp;amp;rest else)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;If all &lt;code&gt;vals&lt;/code&gt; evaluate to true, bind them to their corresponding &lt;code&gt;vars&lt;/code&gt; and do &lt;code&gt;then&lt;/code&gt;, otherwise do &lt;code&gt;else&lt;/code&gt;. &lt;code&gt;vars-vals&lt;/code&gt; should be a list of (&lt;code&gt;var&lt;/code&gt; &lt;code&gt;val&lt;/code&gt;) pairs.&lt;/p&gt; 
&lt;p&gt;Note: binding is done according to &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-let-varlist-rest-body&quot;&gt;&lt;code&gt;-let*&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;vals&lt;/code&gt; are evaluated sequentially, and evaluation stops after the first &lt;code&gt;nil&lt;/code&gt; &lt;code&gt;val&lt;/code&gt; is encountered.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-if-let* ((x 5) (y 3) (z 7)) (+ x y z) &quot;foo&quot;) ;; =&amp;gt; 15
(-if-let* ((x 5) (y nil) (z 7)) (+ x y z) &quot;foo&quot;) ;; =&amp;gt; &quot;foo&quot;
(-if-let* (((_ _ x) &#39;(nil nil 7))) x) ;; =&amp;gt; 7
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-let &lt;code&gt;(varlist &amp;amp;rest body)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Bind variables according to &lt;code&gt;varlist&lt;/code&gt; then eval &lt;code&gt;body&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;varlist&lt;/code&gt; is a list of lists of the form (&lt;code&gt;pattern&lt;/code&gt; &lt;code&gt;source&lt;/code&gt;). Each &lt;code&gt;pattern&lt;/code&gt; is matched against the &lt;code&gt;source&lt;/code&gt; &quot;structurally&quot;. &lt;code&gt;source&lt;/code&gt; is only evaluated once for each &lt;code&gt;pattern&lt;/code&gt;. Each &lt;code&gt;pattern&lt;/code&gt; is matched recursively, and can therefore contain sub-patterns which are matched against corresponding sub-expressions of &lt;code&gt;source&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;All the SOURCEs are evalled before any symbols are bound (i.e. &quot;in parallel&quot;).&lt;/p&gt; 
&lt;p&gt;If &lt;code&gt;varlist&lt;/code&gt; only contains one (&lt;code&gt;pattern&lt;/code&gt; &lt;code&gt;source&lt;/code&gt;) element, you can optionally specify it using a vector and discarding the outer-most parens. Thus&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(-let ((`pattern` `source`)) ...)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;becomes&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(-let [`pattern` `source`] ...).
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-let-varlist-rest-body&quot;&gt;&lt;code&gt;-let&lt;/code&gt;&lt;/a&gt; uses a convention of not binding places (symbols) starting with _ whenever it&#39;s possible. You can use this to skip over entries you don&#39;t care about. However, this is not &lt;em&gt;always&lt;/em&gt; possible (as a result of implementation) and these symbols might get bound to undefined values.&lt;/p&gt; 
&lt;p&gt;Following is the overview of supported patterns. Remember that patterns can be matched recursively, so every a, b, aK in the following can be a matching construct and not necessarily a symbol/variable.&lt;/p&gt; 
&lt;p&gt;Symbol:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;a - bind the `source` to `a`.  This is just like regular `let`.
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Conses and lists:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(a) - bind `car` of cons/list to `a`

(a . b) - bind car of cons to `a` and `cdr` to `b`

(a b) - bind car of list to `a` and `cadr` to `b`

(a1 a2 a3 ...) - bind 0th car of list to `a1`, 1st to `a2`, 2nd to `a3`...

(a1 a2 a3 ... aN . rest) - as above, but bind the `n`th cdr to `rest`.
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Vectors:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;[a] - bind 0th element of a non-list sequence to `a` (works with
      vectors, strings, bit arrays...)

[a1 a2 a3 ...] - bind 0th element of non-list sequence to `a0`, 1st to
                 `a1`, 2nd to `a2`, ...
                 If the `pattern` is shorter than `source`, the values at
                 places not in `pattern` are ignored.
                 If the `pattern` is longer than `source`, an `error` is
                 thrown.

[a1 a2 a3 ... &amp;amp;rest rest] - as above, but bind the rest of
                            the sequence to `rest`.  This is
                            conceptually the same as improper list
                            matching (a1 a2 ... aN . rest)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Key/value stores:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(&amp;amp;plist key0 a0 ... keyN aN) - bind value mapped by keyK in the
                               `source` plist to aK.  If the
                               value is not found, aK is `nil`.
                               Uses `plist-get` to fetch values.

(&amp;amp;alist key0 a0 ... keyN aN) - bind value mapped by keyK in the
                               `source` alist to aK.  If the
                               value is not found, aK is `nil`.
                               Uses `assoc` to fetch values.

(&amp;amp;hash key0 a0 ... keyN aN) - bind value mapped by keyK in the
                              `source` hash table to aK.  If the
                              value is not found, aK is `nil`.
                              Uses `gethash` to fetch values.
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Further, special keyword &amp;amp;keys supports &quot;inline&quot; matching of plist-like key-value pairs, similarly to &amp;amp;keys keyword of &lt;code&gt;cl-defun&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(a1 a2 ... aN &amp;amp;keys key1 b1 ... keyN bK)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This binds &lt;code&gt;n&lt;/code&gt; values from the list to a1 ... aN, then interprets the cdr as a plist (see key/value matching above).&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;a&lt;/code&gt; shorthand notation for kv-destructuring exists which allows the patterns be optionally left out and derived from the key name in the following fashion:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;a key :foo is converted into &lt;code&gt;foo&lt;/code&gt; pattern,&lt;/li&gt; 
 &lt;li&gt;a key &#39;bar is converted into &lt;code&gt;bar&lt;/code&gt; pattern,&lt;/li&gt; 
 &lt;li&gt;a key &quot;baz&quot; is converted into &lt;code&gt;baz&lt;/code&gt; pattern.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;That is, the entire value under the key is bound to the derived variable without any further destructuring.&lt;/p&gt; 
&lt;p&gt;This is possible only when the form following the key is not a valid pattern (i.e. not a symbol, a cons cell or a vector). Otherwise the matching proceeds as usual and in case of an invalid spec fails with an error.&lt;/p&gt; 
&lt;p&gt;Thus the patterns are normalized as follows:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; ;; derive all the missing patterns
 (&amp;amp;plist :foo &#39;bar &quot;baz&quot;) =&amp;gt; (&amp;amp;plist :foo foo &#39;bar bar &quot;baz&quot; baz)

 ;; we can specify some but not others
 (&amp;amp;plist :foo &#39;bar explicit-bar) =&amp;gt; (&amp;amp;plist :foo foo &#39;bar explicit-bar)

 ;; nothing happens, we store :foo in x
 (&amp;amp;plist :foo x) =&amp;gt; (&amp;amp;plist :foo x)

 ;; nothing happens, we match recursively
 (&amp;amp;plist :foo (a b c)) =&amp;gt; (&amp;amp;plist :foo (a b c))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;You can name the source using the syntax &lt;code&gt;symbol&lt;/code&gt; &amp;amp;as &lt;code&gt;pattern&lt;/code&gt;. This syntax works with lists (proper or improper), vectors and all types of maps.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(list &amp;amp;as a b c) (list 1 2 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;binds &lt;code&gt;a&lt;/code&gt; to 1, &lt;code&gt;b&lt;/code&gt; to 2, &lt;code&gt;c&lt;/code&gt; to 3 and &lt;code&gt;list&lt;/code&gt; to (1 2 3).&lt;/p&gt; 
&lt;p&gt;Similarly:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(bounds &amp;amp;as beg . end) (cons 1 2)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;binds &lt;code&gt;beg&lt;/code&gt; to 1, &lt;code&gt;end&lt;/code&gt; to 2 and &lt;code&gt;bounds&lt;/code&gt; to (1 . 2).&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(items &amp;amp;as first . rest) (list 1 2 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;binds &lt;code&gt;first&lt;/code&gt; to 1, &lt;code&gt;rest&lt;/code&gt; to (2 3) and &lt;code&gt;items&lt;/code&gt; to (1 2 3)&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;[vect &amp;amp;as _ b c] [1 2 3]
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;binds &lt;code&gt;b&lt;/code&gt; to 2, &lt;code&gt;c&lt;/code&gt; to 3 and &lt;code&gt;vect&lt;/code&gt; to [1 2 3] (_ avoids binding as usual).&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(plist &amp;amp;as &amp;amp;plist :b b) (list :a 1 :b 2 :c 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;binds &lt;code&gt;b&lt;/code&gt; to 2 and &lt;code&gt;plist&lt;/code&gt; to (:a 1 :b 2 :c 3). Same for &amp;amp;alist and &amp;amp;hash.&lt;/p&gt; 
&lt;p&gt;This is especially useful when we want to capture the result of a computation and destructure at the same time. Consider the form (function-returning-complex-structure) returning a list of two vectors with two items each. We want to capture this entire result and pass it to another computation, but at the same time we want to get the second item from each vector. We can achieve it with pattern&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(result &amp;amp;as [_ a] [_ b]) (function-returning-complex-structure)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Note: Clojure programmers may know this feature as the &quot;:as binding&quot;. The difference is that we put the &amp;amp;as at the front because we need to support improper list binding.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-let (([a (b c) d] [1 (2 3) 4])) (list a b c d)) ;; =&amp;gt; (1 2 3 4)
(-let [(a b c . d) (list 1 2 3 4 5 6)] (list a b c d)) ;; =&amp;gt; (1 2 3 (4 5 6))
(-let [(&amp;amp;plist :foo foo :bar bar) (list :baz 3 :foo 1 :qux 4 :bar 2)] (list foo bar)) ;; =&amp;gt; (1 2)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-let* &lt;code&gt;(varlist &amp;amp;rest body)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Bind variables according to &lt;code&gt;varlist&lt;/code&gt; then eval &lt;code&gt;body&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;varlist&lt;/code&gt; is a list of lists of the form (&lt;code&gt;pattern&lt;/code&gt; &lt;code&gt;source&lt;/code&gt;). Each &lt;code&gt;pattern&lt;/code&gt; is matched against the &lt;code&gt;source&lt;/code&gt; structurally. &lt;code&gt;source&lt;/code&gt; is only evaluated once for each &lt;code&gt;pattern&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Each &lt;code&gt;source&lt;/code&gt; can refer to the symbols already bound by this &lt;code&gt;varlist&lt;/code&gt;. This is useful if you want to destructure &lt;code&gt;source&lt;/code&gt; recursively but also want to name the intermediate structures.&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-let-varlist-rest-body&quot;&gt;&lt;code&gt;-let&lt;/code&gt;&lt;/a&gt; for the list of all possible patterns.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-let* (((a . b) (cons 1 2)) ((c . d) (cons 3 4))) (list a b c d)) ;; =&amp;gt; (1 2 3 4)
(-let* (((a . b) (cons 1 (cons 2 3))) ((c . d) b)) (list a b c d)) ;; =&amp;gt; (1 (2 . 3) 2 3)
(-let* (((&amp;amp;alist &quot;foo&quot; foo &quot;bar&quot; bar) (list (cons &quot;foo&quot; 1) (cons &quot;bar&quot; (list &#39;a &#39;b &#39;c)))) ((a b c) bar)) (list foo a b c bar)) ;; =&amp;gt; (1 a b c (a b c))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-lambda &lt;code&gt;(match-form &amp;amp;rest body)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a lambda which destructures its input as &lt;code&gt;match-form&lt;/code&gt; and executes &lt;code&gt;body&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Note that you have to enclose the &lt;code&gt;match-form&lt;/code&gt; in a pair of parens, such that:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(-lambda (x) body)
(-lambda (x y ...) body)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;has the usual semantics of &lt;code&gt;lambda&lt;/code&gt;. Furthermore, these get translated into normal &lt;code&gt;lambda&lt;/code&gt;, so there is no performance penalty.&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-let-varlist-rest-body&quot;&gt;&lt;code&gt;-let&lt;/code&gt;&lt;/a&gt; for a description of the destructuring mechanism.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-map (-lambda ((x y)) (+ x y)) &#39;((1 2) (3 4) (5 6))) ;; =&amp;gt; (3 7 11)
(-map (-lambda ([x y]) (+ x y)) &#39;([1 2] [3 4] [5 6])) ;; =&amp;gt; (3 7 11)
(funcall (-lambda ((_ . a) (_ . b)) (-concat a b)) &#39;(1 2 3) &#39;(4 5 6)) ;; =&amp;gt; (2 3 5 6)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-setq &lt;code&gt;([match-form val] ...)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Bind each &lt;code&gt;match-form&lt;/code&gt; to the value of its &lt;code&gt;val&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;match-form&lt;/code&gt; destructuring is done according to the rules of &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-let-varlist-rest-body&quot;&gt;&lt;code&gt;-let&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;This macro allows you to bind multiple variables by destructuring the value, so for example:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(-setq (a b) x
       (&amp;amp;plist :c c) plist)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;expands roughly speaking to the following code&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(setq a (car x)
      b (cadr x)
      c (plist-get plist :c))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Care is taken to only evaluate each &lt;code&gt;val&lt;/code&gt; once so that in case of multiple assignments it does not cause unexpected side effects.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(let (a) (-setq a 1) a) ;; =&amp;gt; 1
(let (a b) (-setq (a b) (list 1 2)) (list a b)) ;; =&amp;gt; (1 2)
(let (c) (-setq (&amp;amp;plist :c c) (list :c &quot;c&quot;)) c) ;; =&amp;gt; &quot;c&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Side effects&lt;/h2&gt; 
&lt;p&gt;Functions iterating over lists for side effect only.&lt;/p&gt; 
&lt;h4&gt;-each &lt;code&gt;(list fn)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Call &lt;code&gt;fn&lt;/code&gt; on each element of &lt;code&gt;list&lt;/code&gt;. Return &lt;code&gt;nil&lt;/code&gt;; this function is intended for side effects.&lt;/p&gt; 
&lt;p&gt;Its anaphoric counterpart is &lt;code&gt;--each&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For access to the current element&#39;s index in &lt;code&gt;list&lt;/code&gt;, see &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-each-indexed-list-fn&quot;&gt;&lt;code&gt;-each-indexed&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(let (l) (-each &#39;(1 2 3) (lambda (x) (push x l))) l) ;; =&amp;gt; (3 2 1)
(let (l) (--each &#39;(1 2 3) (push it l)) l) ;; =&amp;gt; (3 2 1)
(-each &#39;(1 2 3) #&#39;identity) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-each-while &lt;code&gt;(list pred fn)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Call &lt;code&gt;fn&lt;/code&gt; on each &lt;code&gt;item&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;, while (&lt;code&gt;pred&lt;/code&gt; &lt;code&gt;item&lt;/code&gt;) is non-&lt;code&gt;nil&lt;/code&gt;. Once an &lt;code&gt;item&lt;/code&gt; is reached for which &lt;code&gt;pred&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, &lt;code&gt;fn&lt;/code&gt; is no longer called. Return &lt;code&gt;nil&lt;/code&gt;; this function is intended for side effects.&lt;/p&gt; 
&lt;p&gt;Its anaphoric counterpart is &lt;code&gt;--each-while&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(let (l) (-each-while &#39;(2 4 5 6) #&#39;even? (lambda (x) (push x l))) l) ;; =&amp;gt; (4 2)
(let (l) (--each-while &#39;(1 2 3 4) (&amp;lt; it 3) (push it l)) l) ;; =&amp;gt; (2 1)
(let ((s 0)) (--each-while &#39;(1 3 4 5) (&amp;lt; it 5) (setq s (+ s it))) s) ;; =&amp;gt; 8
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-each-indexed &lt;code&gt;(list fn)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Call &lt;code&gt;fn&lt;/code&gt; on each index and element of &lt;code&gt;list&lt;/code&gt;. For each &lt;code&gt;item&lt;/code&gt; at &lt;code&gt;index&lt;/code&gt; in &lt;code&gt;list&lt;/code&gt;, call (funcall &lt;code&gt;fn&lt;/code&gt; &lt;code&gt;index&lt;/code&gt; &lt;code&gt;item&lt;/code&gt;). Return &lt;code&gt;nil&lt;/code&gt;; this function is intended for side effects.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-map-indexed-fn-list&quot;&gt;&lt;code&gt;-map-indexed&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(let (l) (-each-indexed &#39;(a b c) (lambda (i x) (push (list x i) l))) l) ;; =&amp;gt; ((c 2) (b 1) (a 0))
(let (l) (--each-indexed &#39;(a b c) (push (list it it-index) l)) l) ;; =&amp;gt; ((c 2) (b 1) (a 0))
(let (l) (--each-indexed () (push it l)) l) ;; =&amp;gt; ()
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-each-r &lt;code&gt;(list fn)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Call &lt;code&gt;fn&lt;/code&gt; on each element of &lt;code&gt;list&lt;/code&gt; in reversed order. Return &lt;code&gt;nil&lt;/code&gt;; this function is intended for side effects.&lt;/p&gt; 
&lt;p&gt;Its anaphoric counterpart is &lt;code&gt;--each-r&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(let (l) (-each-r &#39;(1 2 3) (lambda (x) (push x l))) l) ;; =&amp;gt; (1 2 3)
(let (l) (--each-r &#39;(1 2 3) (push it l)) l) ;; =&amp;gt; (1 2 3)
(-each-r &#39;(1 2 3) #&#39;identity) ;; =&amp;gt; nil
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-each-r-while &lt;code&gt;(list pred fn)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Call &lt;code&gt;fn&lt;/code&gt; on each &lt;code&gt;item&lt;/code&gt; in reversed &lt;code&gt;list&lt;/code&gt;, while (&lt;code&gt;pred&lt;/code&gt; &lt;code&gt;item&lt;/code&gt;) is non-&lt;code&gt;nil&lt;/code&gt;. Once an &lt;code&gt;item&lt;/code&gt; is reached for which &lt;code&gt;pred&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, &lt;code&gt;fn&lt;/code&gt; is no longer called. Return &lt;code&gt;nil&lt;/code&gt;; this function is intended for side effects.&lt;/p&gt; 
&lt;p&gt;Its anaphoric counterpart is &lt;code&gt;--each-r-while&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(let (l) (-each-r-while &#39;(2 4 5 6) #&#39;even? (lambda (x) (push x l))) l) ;; =&amp;gt; (6)
(let (l) (--each-r-while &#39;(1 2 3 4) (&amp;gt;= it 3) (push it l)) l) ;; =&amp;gt; (3 4)
(let ((s 0)) (--each-r-while &#39;(1 2 3 5) (&amp;gt; it 1) (setq s (+ s it))) s) ;; =&amp;gt; 10
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-dotimes &lt;code&gt;(num fn)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Call &lt;code&gt;fn&lt;/code&gt; &lt;code&gt;num&lt;/code&gt; times, presumably for side effects. &lt;code&gt;fn&lt;/code&gt; is called with a single argument on successive integers running from 0, inclusive, to &lt;code&gt;num&lt;/code&gt;, exclusive. &lt;code&gt;fn&lt;/code&gt; is not called if &lt;code&gt;num&lt;/code&gt; is less than 1.&lt;/p&gt; 
&lt;p&gt;This function&#39;s anaphoric counterpart is &lt;code&gt;--dotimes&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(let (s) (-dotimes 3 (lambda (n) (push n s))) s) ;; =&amp;gt; (2 1 0)
(let (s) (-dotimes 0 (lambda (n) (push n s))) s) ;; =&amp;gt; ()
(let (s) (--dotimes 5 (push it s)) s) ;; =&amp;gt; (4 3 2 1 0)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Destructive operations&lt;/h2&gt; 
&lt;p&gt;Macros that modify variables holding lists.&lt;/p&gt; 
&lt;h4&gt;!cons &lt;code&gt;(car cdr)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Destructive: Set &lt;code&gt;cdr&lt;/code&gt; to the cons of &lt;code&gt;car&lt;/code&gt; and &lt;code&gt;cdr&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(let (l) (!cons 5 l) l) ;; =&amp;gt; (5)
(let ((l &#39;(3))) (!cons 5 l) l) ;; =&amp;gt; (5 3)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;!cdr &lt;code&gt;(list)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Destructive: Set &lt;code&gt;list&lt;/code&gt; to the cdr of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(let ((l &#39;(3))) (!cdr l) l) ;; =&amp;gt; ()
(let ((l &#39;(3 5))) (!cdr l) l) ;; =&amp;gt; (5)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Function combinators&lt;/h2&gt; 
&lt;p&gt;Functions that manipulate and compose other functions.&lt;/p&gt; 
&lt;h4&gt;-partial &lt;code&gt;(fun &amp;amp;rest args)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a function that is a partial application of &lt;code&gt;fun&lt;/code&gt; to &lt;code&gt;args&lt;/code&gt;. &lt;code&gt;args&lt;/code&gt; is a list of the first &lt;code&gt;n&lt;/code&gt; arguments to pass to &lt;code&gt;fun&lt;/code&gt;. The result is a new function which does the same as &lt;code&gt;fun&lt;/code&gt;, except that the first &lt;code&gt;n&lt;/code&gt; arguments are fixed at the values with which this function was called.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-partial #&#39;+ 5)) ;; =&amp;gt; 5
(funcall (-partial #&#39;- 5) 3) ;; =&amp;gt; 2
(funcall (-partial #&#39;+ 5 2) 3) ;; =&amp;gt; 10
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-rpartial &lt;code&gt;(fn &amp;amp;rest args)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a function that is a partial application of &lt;code&gt;fn&lt;/code&gt; to &lt;code&gt;args&lt;/code&gt;. &lt;code&gt;args&lt;/code&gt; is a list of the last &lt;code&gt;n&lt;/code&gt; arguments to pass to &lt;code&gt;fn&lt;/code&gt;. The result is a new function which does the same as &lt;code&gt;fn&lt;/code&gt;, except that the last &lt;code&gt;n&lt;/code&gt; arguments are fixed at the values with which this function was called. This is like &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-partial-fun-rest-args&quot;&gt;&lt;code&gt;-partial&lt;/code&gt;&lt;/a&gt;, except the arguments are fixed starting from the right rather than the left.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-rpartial #&#39;- 5)) ;; =&amp;gt; -5
(funcall (-rpartial #&#39;- 5) 8) ;; =&amp;gt; 3
(funcall (-rpartial #&#39;- 5 2) 10) ;; =&amp;gt; 3
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-juxt &lt;code&gt;(&amp;amp;rest fns)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a function that is the juxtaposition of &lt;code&gt;fns&lt;/code&gt;. The returned function takes a variable number of &lt;code&gt;args&lt;/code&gt;, applies each of &lt;code&gt;fns&lt;/code&gt; in turn to &lt;code&gt;args&lt;/code&gt;, and returns the list of results.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-juxt) 1 2) ;; =&amp;gt; ()
(funcall (-juxt #&#39;+ #&#39;- #&#39;* #&#39;/) 7 5) ;; =&amp;gt; (12 2 35 1)
(mapcar (-juxt #&#39;number-to-string #&#39;1+) &#39;(1 2)) ;; =&amp;gt; ((&quot;1&quot; 2) (&quot;2&quot; 3))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-compose &lt;code&gt;(&amp;amp;rest fns)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Compose &lt;code&gt;fns&lt;/code&gt; into a single composite function. Return a function that takes a variable number of &lt;code&gt;args&lt;/code&gt;, applies the last function in &lt;code&gt;fns&lt;/code&gt; to &lt;code&gt;args&lt;/code&gt;, and returns the result of calling each remaining function on the result of the previous function, right-to-left. If no &lt;code&gt;fns&lt;/code&gt; are given, return a variadic &lt;code&gt;identity&lt;/code&gt; function.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-compose #&#39;- #&#39;1+ #&#39;+) 1 2 3) ;; =&amp;gt; -7
(funcall (-compose #&#39;identity #&#39;1+) 3) ;; =&amp;gt; 4
(mapcar (-compose #&#39;not #&#39;stringp) &#39;(nil &quot;&quot;)) ;; =&amp;gt; (t nil)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-applify &lt;code&gt;(fn)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a function that applies &lt;code&gt;fn&lt;/code&gt; to a single list of args. This changes the arity of &lt;code&gt;fn&lt;/code&gt; from taking &lt;code&gt;n&lt;/code&gt; distinct arguments to taking 1 argument which is a list of &lt;code&gt;n&lt;/code&gt; arguments.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-applify #&#39;+) nil) ;; =&amp;gt; 0
(mapcar (-applify #&#39;+) &#39;((1 1 1) (1 2 3) (5 5 5))) ;; =&amp;gt; (3 6 15)
(funcall (-applify #&#39;&amp;lt;) &#39;(3 6)) ;; =&amp;gt; t
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-on &lt;code&gt;(op trans)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a function that calls &lt;code&gt;trans&lt;/code&gt; on each arg and &lt;code&gt;op&lt;/code&gt; on the results. The returned function takes a variable number of arguments, calls the function &lt;code&gt;trans&lt;/code&gt; on each one in turn, and then passes those results as the list of arguments to &lt;code&gt;op&lt;/code&gt;, in the same order.&lt;/p&gt; 
&lt;p&gt;For example, the following pairs of expressions are morally equivalent:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(funcall (-on #&#39;+ #&#39;1+) 1 2 3) = (+ (1+ 1) (1+ 2) (1+ 3))
(funcall (-on #&#39;+ #&#39;1+))       = (+)
&lt;/code&gt;&lt;/pre&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-sort (-on #&#39;&amp;lt; #&#39;length) &#39;((1 2 3) (1) (1 2))) ;; =&amp;gt; ((1) (1 2) (1 2 3))
(funcall (-on #&#39;min #&#39;string-to-number) &quot;22&quot; &quot;2&quot; &quot;1&quot; &quot;12&quot;) ;; =&amp;gt; 1
(-min-by (-on #&#39;&amp;gt; #&#39;length) &#39;((1 2 3) (4) (1 2))) ;; =&amp;gt; (4)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-flip &lt;code&gt;(fn)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a function that calls &lt;code&gt;fn&lt;/code&gt; with its arguments reversed. The returned function takes the same number of arguments as &lt;code&gt;fn&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For example, the following two expressions are morally equivalent:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(funcall (-flip #&#39;-) 1 2) = (- 2 1)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-rotate-args-n-fn&quot;&gt;&lt;code&gt;-rotate-args&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-sort (-flip #&#39;&amp;lt;) &#39;(4 3 6 1)) ;; =&amp;gt; (6 4 3 1)
(funcall (-flip #&#39;-) 3 2 1 10) ;; =&amp;gt; 4
(funcall (-flip #&#39;1+) 1) ;; =&amp;gt; 2
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-rotate-args &lt;code&gt;(n fn)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a function that calls &lt;code&gt;fn&lt;/code&gt; with args rotated &lt;code&gt;n&lt;/code&gt; places to the right. The returned function takes the same number of arguments as &lt;code&gt;fn&lt;/code&gt;, rotates the list of arguments &lt;code&gt;n&lt;/code&gt; places to the right (left if &lt;code&gt;n&lt;/code&gt; is negative) just like &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-rotate-n-list&quot;&gt;&lt;code&gt;-rotate&lt;/code&gt;&lt;/a&gt;, and applies &lt;code&gt;fn&lt;/code&gt; to the result.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-flip-fn&quot;&gt;&lt;code&gt;-flip&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-rotate-args -1 #&#39;list) 1 2 3 4) ;; =&amp;gt; (2 3 4 1)
(funcall (-rotate-args 1 #&#39;-) 1 10 100) ;; =&amp;gt; 89
(funcall (-rotate-args 2 #&#39;list) 3 4 5 1 2) ;; =&amp;gt; (1 2 3 4 5)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-const &lt;code&gt;(c)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a function that returns &lt;code&gt;c&lt;/code&gt; ignoring any additional arguments.&lt;/p&gt; 
&lt;p&gt;In types: a -&amp;gt; b -&amp;gt; a&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-const 2) 1 3 &quot;foo&quot;) ;; =&amp;gt; 2
(mapcar (-const 1) &#39;(&quot;a&quot; &quot;b&quot; &quot;c&quot; &quot;d&quot;)) ;; =&amp;gt; (1 1 1 1)
(-sum (mapcar (-const 1) &#39;(&quot;a&quot; &quot;b&quot; &quot;c&quot; &quot;d&quot;))) ;; =&amp;gt; 4
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-cut &lt;code&gt;(&amp;amp;rest params)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Take n-ary function and n arguments and specialize some of them. Arguments denoted by &amp;lt;&amp;gt; will be left unspecialized.&lt;/p&gt; 
&lt;p&gt;See &lt;code&gt;srfi-26&lt;/code&gt; for detailed description.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-cut list 1 &amp;lt;&amp;gt; 3 &amp;lt;&amp;gt; 5) 2 4) ;; =&amp;gt; (1 2 3 4 5)
(-map (-cut funcall &amp;lt;&amp;gt; 5) `(1+ 1- ,(lambda (x) (/ 1.0 x)))) ;; =&amp;gt; (6 4 0.2)
(-map (-cut &amp;lt;&amp;gt; 1 2 3) &#39;(list vector string)) ;; =&amp;gt; ((1 2 3) [1 2 3] &quot;\1\2\3&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-not &lt;code&gt;(pred)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a predicate that negates the result of &lt;code&gt;pred&lt;/code&gt;. The returned predicate passes its arguments to &lt;code&gt;pred&lt;/code&gt;. If &lt;code&gt;pred&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, the result is non-&lt;code&gt;nil&lt;/code&gt;; otherwise the result is &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-andfn-rest-preds&quot;&gt;&lt;code&gt;-andfn&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-orfn-rest-preds&quot;&gt;&lt;code&gt;-orfn&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-not #&#39;numberp) &quot;5&quot;) ;; =&amp;gt; t
(-sort (-not #&#39;&amp;lt;) &#39;(5 2 1 0 6)) ;; =&amp;gt; (6 5 2 1 0)
(-filter (-not (-partial #&#39;&amp;lt; 4)) &#39;(1 2 3 4 5 6 7 8)) ;; =&amp;gt; (1 2 3 4)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-orfn &lt;code&gt;(&amp;amp;rest preds)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a predicate that returns the first non-&lt;code&gt;nil&lt;/code&gt; result of &lt;code&gt;preds&lt;/code&gt;. The returned predicate takes a variable number of arguments, passes them to each predicate in &lt;code&gt;preds&lt;/code&gt; in turn until one of them returns non-&lt;code&gt;nil&lt;/code&gt;, and returns that non-&lt;code&gt;nil&lt;/code&gt; result without calling the remaining &lt;code&gt;preds&lt;/code&gt;. If all &lt;code&gt;preds&lt;/code&gt; return &lt;code&gt;nil&lt;/code&gt;, or if no &lt;code&gt;preds&lt;/code&gt; are given, the returned predicate returns &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-andfn-rest-preds&quot;&gt;&lt;code&gt;-andfn&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-not-pred&quot;&gt;&lt;code&gt;-not&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-filter (-orfn #&#39;natnump #&#39;booleanp) &#39;(1 nil &quot;a&quot; -4 b c t)) ;; =&amp;gt; (1 nil t)
(funcall (-orfn #&#39;symbolp (-cut string-match-p &quot;x&quot; &amp;lt;&amp;gt;)) &quot;axe&quot;) ;; =&amp;gt; 1
(funcall (-orfn #&#39;= #&#39;+) 1 1) ;; =&amp;gt; t
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-andfn &lt;code&gt;(&amp;amp;rest preds)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a predicate that returns non-&lt;code&gt;nil&lt;/code&gt; if all &lt;code&gt;preds&lt;/code&gt; do so. The returned predicate &lt;code&gt;p&lt;/code&gt; takes a variable number of arguments and passes them to each predicate in &lt;code&gt;preds&lt;/code&gt; in turn. If any one of &lt;code&gt;preds&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, &lt;code&gt;p&lt;/code&gt; also returns &lt;code&gt;nil&lt;/code&gt; without calling the remaining &lt;code&gt;preds&lt;/code&gt;. If all &lt;code&gt;preds&lt;/code&gt; return non-&lt;code&gt;nil&lt;/code&gt;, &lt;code&gt;p&lt;/code&gt; returns the last such value. If no &lt;code&gt;preds&lt;/code&gt; are given, &lt;code&gt;p&lt;/code&gt; always returns non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;See also: &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-orfn-rest-preds&quot;&gt;&lt;code&gt;-orfn&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-not-pred&quot;&gt;&lt;code&gt;-not&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(-filter (-andfn #&#39;numberp (-cut &amp;lt; &amp;lt;&amp;gt; 5)) &#39;(a 1 b 6 c 2)) ;; =&amp;gt; (1 2)
(mapcar (-andfn #&#39;numberp #&#39;1+) &#39;(a 1 b 6)) ;; =&amp;gt; (nil 2 nil 7)
(funcall (-andfn #&#39;= #&#39;+) 1 1) ;; =&amp;gt; 2
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-iteratefn &lt;code&gt;(fn n)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a function &lt;code&gt;fn&lt;/code&gt; composed &lt;code&gt;n&lt;/code&gt; times with itself.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;fn&lt;/code&gt; is a unary function. If you need to use a function of higher arity, use &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#-applify-fn&quot;&gt;&lt;code&gt;-applify&lt;/code&gt;&lt;/a&gt; first to turn it into a unary function.&lt;/p&gt; 
&lt;p&gt;With n = 0, this acts as identity function.&lt;/p&gt; 
&lt;p&gt;In types: (a -&amp;gt; a) -&amp;gt; Int -&amp;gt; a -&amp;gt; a.&lt;/p&gt; 
&lt;p&gt;This function satisfies the following law:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(funcall (-iteratefn fn n) init) = (-last-item (-iterate fn init (1+ n))).
&lt;/code&gt;&lt;/pre&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-iteratefn (lambda (x) (* x x)) 3) 2) ;; =&amp;gt; 256
(funcall (-iteratefn &#39;1+ 3) 1) ;; =&amp;gt; 4
(funcall (-iteratefn &#39;cdr 3) &#39;(1 2 3 4 5)) ;; =&amp;gt; (4 5)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-fixfn &lt;code&gt;(fn &amp;amp;optional equal-test halt-test)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a function that computes the (least) fixpoint of &lt;code&gt;fn&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;fn&lt;/code&gt; must be a unary function. The returned lambda takes a single argument, &lt;code&gt;x&lt;/code&gt;, the initial value for the fixpoint iteration. The iteration halts when either of the following conditions is satisfied:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt; &lt;p&gt;Iteration converges to the fixpoint, with equality being tested using &lt;code&gt;equal-test&lt;/code&gt;. If &lt;code&gt;equal-test&lt;/code&gt; is not specified, &lt;code&gt;equal&lt;/code&gt; is used. For functions over the floating point numbers, it may be necessary to provide an appropriate approximate comparison test.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;halt-test&lt;/code&gt; returns a non-&lt;code&gt;nil&lt;/code&gt; value. &lt;code&gt;halt-test&lt;/code&gt; defaults to a simple counter that returns &lt;code&gt;t&lt;/code&gt; after &lt;code&gt;-fixfn-max-iterations&lt;/code&gt;, to guard against infinite iteration. Otherwise, &lt;code&gt;halt-test&lt;/code&gt; must be a function that accepts a single argument, the current value of &lt;code&gt;x&lt;/code&gt;, and returns non-&lt;code&gt;nil&lt;/code&gt; as long as iteration should continue. In this way, a more sophisticated convergence test may be supplied by the caller.&lt;/p&gt; &lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;The return value of the lambda is either the fixpoint or, if iteration halted before converging, a cons with car &lt;code&gt;halted&lt;/code&gt; and cdr the final output from &lt;code&gt;halt-test&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;In types: (a -&amp;gt; a) -&amp;gt; a -&amp;gt; a.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-fixfn #&#39;cos #&#39;approx=) 0.7) ;; ~&amp;gt; 0.7390851332151607
(funcall (-fixfn (lambda (x) (expt (+ x 10) 0.25))) 2.0) ;; =&amp;gt; 1.8555845286409378
(funcall (-fixfn #&#39;sin #&#39;approx=) 0.1) ;; =&amp;gt; (halted . t)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;-prodfn &lt;code&gt;(&amp;amp;rest fns)&lt;/code&gt;&lt;/h4&gt; 
&lt;p&gt;Return a function that applies each of &lt;code&gt;fns&lt;/code&gt; to each of a list of arguments.&lt;/p&gt; 
&lt;p&gt;Takes a list of &lt;code&gt;n&lt;/code&gt; functions and returns a function that takes a list of length &lt;code&gt;n&lt;/code&gt;, applying &lt;code&gt;i&lt;/code&gt;th function to &lt;code&gt;i&lt;/code&gt;th element of the input list. Returns a list of length &lt;code&gt;n&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;In types (for &lt;code&gt;n&lt;/code&gt;=2): ((a -&amp;gt; b), (c -&amp;gt; d)) -&amp;gt; (a, c) -&amp;gt; (b, d)&lt;/p&gt; 
&lt;p&gt;This function satisfies the following laws:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;  (-compose (-prodfn f g ...)
            (-prodfn f&#39; g&#39; ...))
= (-prodfn (-compose f f&#39;)
           (-compose g g&#39;)
           ...)

  (-prodfn f g ...)
= (-juxt (-compose f (-partial #&#39;nth 0))
         (-compose g (-partial #&#39;nth 1))
         ...)

  (-compose (-prodfn f g ...)
            (-juxt f&#39; g&#39; ...))
= (-juxt (-compose f f&#39;)
         (-compose g g&#39;)
         ...)

  (-compose (-partial #&#39;nth n)
            (-prod f1 f2 ...))
= (-compose fn (-partial #&#39;nth n))
&lt;/code&gt;&lt;/pre&gt; 
&lt;pre&gt;&lt;code class=&quot;language-el&quot;&gt;(funcall (-prodfn #&#39;1+ #&#39;1- #&#39;number-to-string) &#39;(1 2 3)) ;; =&amp;gt; (2 1 &quot;3&quot;)
(-map (-prodfn #&#39;1- #&#39;1+) &#39;((1 2) (3 4) (5 6))) ;; =&amp;gt; ((0 3) (2 5) (4 7))
(apply #&#39;+ (funcall (-prodfn #&#39;length #&#39;string-to-number) &#39;((t) &quot;5&quot;))) ;; =&amp;gt; 6
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Contribute&lt;/h2&gt; 
&lt;p&gt;Yes, please do. Pure functions in the list manipulation realm only, please. There’s a suite of examples/tests in &lt;code&gt;dev/examples.el&lt;/code&gt;, so remember to add tests for your additions, or I might break them later.&lt;/p&gt; 
&lt;p&gt;You’ll find the repo at:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;https://github.com/magnars/dash.el
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Run the tests with:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;make check
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Regenerate the docs with:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;make docs
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;I highly recommend that you install these as a pre-commit hook, so that the tests are always running and the docs are always in sync:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;cp dev/pre-commit.sh .git/hooks/pre-commit
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Oh, and don’t edit &lt;code&gt;README.md&lt;/code&gt; or &lt;code&gt;dash.texi&lt;/code&gt; directly; they are auto-generated. Change &lt;code&gt;readme-template.md&lt;/code&gt; or &lt;code&gt;dash-template.texi&lt;/code&gt; instead, respectively.&lt;/p&gt; 
&lt;p&gt;To ensure that &lt;code&gt;dash.el&lt;/code&gt; can be distributed with GNU ELPA or Emacs, we require that all contributors assign copyright to the Free Software Foundation. For more on this, see &lt;a href=&quot;https://gnu.org/software/emacs/manual/html_node/emacs/Copyright-Assignment.html&quot;&gt;&lt;code&gt;(info &quot;(emacs) Copyright Assignment&quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;h2&gt;Contributors&lt;/h2&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/Fuco1&quot;&gt;Matus Goljer&lt;/a&gt; contributed lots of features and functions.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/tkf&quot;&gt;Takafumi Arakaki&lt;/a&gt; contributed &lt;code&gt;-group-by&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/tali713&quot;&gt;tali713&lt;/a&gt; is the author of &lt;code&gt;-applify&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/vemv&quot;&gt;Víctor M. Valenzuela&lt;/a&gt; contributed &lt;code&gt;-repeat&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/nicferrier&quot;&gt;Nic Ferrier&lt;/a&gt; contributed &lt;code&gt;-cons*&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/Wilfred&quot;&gt;Wilfred Hughes&lt;/a&gt; contributed &lt;code&gt;-slice&lt;/code&gt;, &lt;code&gt;-first-item&lt;/code&gt;, and &lt;code&gt;-last-item&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/shosti&quot;&gt;Emanuel Evans&lt;/a&gt; contributed &lt;code&gt;-if-let&lt;/code&gt;, &lt;code&gt;-when-let&lt;/code&gt;, and &lt;code&gt;-insert-at&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/rejeep&quot;&gt;Johan Andersson&lt;/a&gt; contributed &lt;code&gt;-sum&lt;/code&gt;, &lt;code&gt;-product&lt;/code&gt;, and &lt;code&gt;-same-items?&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/kurisuwhyte&quot;&gt;Christina Whyte&lt;/a&gt; contributed &lt;code&gt;-compose&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/steventlamb&quot;&gt;Steve Lamb&lt;/a&gt; contributed &lt;code&gt;-cycle&lt;/code&gt;, &lt;code&gt;-pad&lt;/code&gt;, &lt;code&gt;-annotate&lt;/code&gt;, &lt;code&gt;-zip-fill&lt;/code&gt;, and a variadic version of &lt;code&gt;-zip&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/fbergroth&quot;&gt;Fredrik Bergroth&lt;/a&gt; made the &lt;code&gt;-if-let&lt;/code&gt; family use &lt;code&gt;-let&lt;/code&gt; destructuring and improved the script for generating documentation.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/holomorph&quot;&gt;Mark Oteiza&lt;/a&gt; contributed &lt;code&gt;-iota&lt;/code&gt; and the script to create an Info manual.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/wasamasa&quot;&gt;Vasilij Schneidermann&lt;/a&gt; contributed &lt;code&gt;-some&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/occidens&quot;&gt;William West&lt;/a&gt; made &lt;code&gt;-fixfn&lt;/code&gt; more robust at handling floats.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/camsaul&quot;&gt;Cam Saul&lt;/a&gt; contributed &lt;code&gt;-some-&amp;gt;&lt;/code&gt;, &lt;code&gt;-some-&amp;gt;&amp;gt;&lt;/code&gt;, and &lt;code&gt;-some--&amp;gt;&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/basil-conto&quot;&gt;Basil L. Contovounesios&lt;/a&gt; contributed &lt;code&gt;-common-prefix&lt;/code&gt;, &lt;code&gt;-common-suffix&lt;/code&gt;, and various other improvements.&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/doublep&quot;&gt;Paul Pogonyshev&lt;/a&gt; contributed &lt;code&gt;-each-r&lt;/code&gt; and &lt;code&gt;-each-r-while&lt;/code&gt;.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Thanks!&lt;/p&gt; 
&lt;p&gt;New contributors are very welcome. See the &lt;a href=&quot;https://raw.githubusercontent.com/magnars/dash.el/master/#contribute&quot;&gt;&lt;code&gt;Contribute&lt;/code&gt;&lt;/a&gt; section above.&lt;/p&gt; 
&lt;h2&gt;License&lt;/h2&gt; 
&lt;p&gt;Copyright (C) 2012-2026 Free Software Foundation, Inc.&lt;/p&gt; 
&lt;p&gt;Author: Magnar Sveen &lt;a href=&quot;mailto:magnars@gmail.com&quot;&gt;magnars@gmail.com&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;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.&lt;/p&gt; 
&lt;p&gt;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.&lt;/p&gt; 
&lt;p&gt;You should have received a copy of the GNU General Public License along with this program. If not, see &lt;a href=&quot;https://www.gnu.org/licenses/&quot;&gt;https://www.gnu.org/licenses/&lt;/a&gt;.&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/43a1a6a4a9d9c1c3b330ffb82cc63441a5e579a60e3842469478cd913ecb4c6c/magnars/dash.el" medium="image" />
      
    </item>
    
    <item>
      <title>syl20bnr/spacemacs</title>
      <link>https://github.com/syl20bnr/spacemacs</link>
      <description>&lt;p&gt;A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it&#39;s Emacs *and* Vim!&lt;/p&gt;&lt;hr&gt;&lt;p&gt;&lt;a name=&quot;top&quot; id=&quot;fork-destination-box&quot;&gt;&lt;/a&gt; &lt;a href=&quot;https://spacemacs.org&quot;&gt;&lt;img src=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/assets/spacemacs-badge.svg?sanitize=true&quot; alt=&quot;Made with Spacemacs&quot; height=&quot;20&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.en.html&quot;&gt;&lt;img src=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/assets/gplv3.png&quot; alt=&quot;GPLv3 Software&quot; align=&quot;right&quot; height=&quot;20&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://www.twitter.com/spacemacs&quot;&gt;&lt;img src=&quot;https://i.imgur.com/tXSoThF.png&quot; alt=&quot;Twitter&quot; align=&quot;right&quot; height=&quot;20&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;!-- logo and links --&gt; 
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/doc/img/title2.png&quot; alt=&quot;Spacemacs&quot; /&gt;&lt;/p&gt; 
&lt;p align=&quot;center&quot;&gt; &lt;b&gt;&lt;a href=&quot;https://spacemacs.org/doc/DOCUMENTATION#core-pillars&quot;&gt;philosophy&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href=&quot;https://spacemacs.org/doc/DOCUMENTATION#who-can-benefit-from-this&quot;&gt;for whom?&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href=&quot;https://spacemacs.org/doc/DOCUMENTATION#screenshots&quot;&gt;screenshots&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href=&quot;https://spacemacs.org/doc/DOCUMENTATION.html&quot;&gt;documentation&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/CONTRIBUTING.org&quot;&gt;contribute&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href=&quot;https://spacemacs.org/doc/DOCUMENTATION#achievements&quot;&gt;achievements&lt;/a&gt;&lt;/b&gt; | &lt;b&gt;&lt;a href=&quot;https://spacemacs.org/doc/FAQ&quot;&gt;FAQ&lt;/a&gt;&lt;/b&gt; &lt;/p&gt; 
&lt;!-- badges --&gt; 
&lt;p align=&quot;center&quot;&gt; &lt;a href=&quot;https://gitter.im/syl20bnr/spacemacs?utm_source=badge&amp;amp;utm_medium=badge&amp;amp;utm_campaign=pr-badge&amp;amp;utm_content=badge&quot;&gt;&lt;img src=&quot;https://badges.gitter.im/Join%20Chat.svg?sanitize=true&quot; alt=&quot;Gitter&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://discord.gg/p4MddFu6Ag&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/chat-on%20discord-7289da.svg?sanitize=true&quot; alt=&quot;Discord&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/actions/workflows/elisp_test.yml&quot;&gt;&lt;img src=&quot;https://github.com/syl20bnr/spacemacs/actions/workflows/elisp_test.yml/badge.svg?branch=develop&quot; alt=&quot;elisp state&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;amp;hosted_button_id=ESFVNPKP4Y742&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/Paypal-Donate-blue.svg?sanitize=true&quot; alt=&quot;Donate&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://shop.spreadshirt.com/spacemacs-shop&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/Shop-T--Shirts-blue.svg?sanitize=true&quot; alt=&quot;Merchandise&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://www.slant.co/topics/12/~what-are-the-best-programming-text-editors&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/Slant-Recommend-ff69b4.svg?sanitize=true&quot; alt=&quot;Recommend it&quot; /&gt;&lt;/a&gt; &lt;/p&gt; 
&lt;hr /&gt; 
&lt;p&gt;&lt;strong&gt;Quick Start&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;If you &lt;em&gt;don&#39;t&lt;/em&gt; have an existing Emacs setup and want to run Spacemacs as your configuration, and if you have all &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/#prerequisites&quot;&gt;prerequisites&lt;/a&gt; installed, you can install Spacemacs with one line:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;shell:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;git clone https://github.com/syl20bnr/spacemacs $HOME/.emacs.d
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Windows PowerShell:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;git clone https://github.com/syl20bnr/spacemacs $HOME/.emacs.d
&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;If &lt;code&gt;HOME&lt;/code&gt; is not set in environment or in registry:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;git clone https://github.com/syl20bnr/spacemacs $env:APPDATA/.emacs.d
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;If you do have an existing Emacs configuration, look at the &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/#install&quot;&gt;full installation instructions&lt;/a&gt; for other options.&lt;/p&gt; 
&lt;h1&gt;Introduction&lt;/h1&gt; 
&lt;p&gt;Spacemacs is a new way of experiencing Emacs -- it&#39;s a sophisticated and polished set-up, focused on &lt;em&gt;ergonomics&lt;/em&gt;, &lt;em&gt;mnemonics&lt;/em&gt; and &lt;em&gt;consistency&lt;/em&gt;.&lt;/p&gt; 
&lt;p&gt;Just clone and launch it, then press the space bar to explore the interactive list of carefully-chosen key bindings. You can also press the home buffer&#39;s &lt;code&gt;[?]&lt;/code&gt; button for some great first key bindings to try.&lt;/p&gt; 
&lt;p&gt;Spacemacs can be used naturally by both Emacs and Vim users -- you can even mix the two editing styles. Being able to quickly switch between input styles, makes Spacemacs a great tool for pair-programming.&lt;/p&gt; 
&lt;p&gt;Spacemacs is currently in beta, and any contributions are very welcome.&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/doc/img/spacemacs-python.png&quot; alt=&quot;spacemacs_python&quot; /&gt;&lt;/p&gt; 
&lt;h1&gt;Features&lt;/h1&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;strong&gt;Great documentation:&lt;/strong&gt; access the Spacemacs documentation with &lt;kbd&gt;SPC h SPC&lt;/kbd&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;strong&gt;Beautiful GUI:&lt;/strong&gt; you&#39;ll love the distraction free UI and its functional mode-line.&lt;/li&gt; 
 &lt;li&gt;&lt;strong&gt;Excellent ergonomics:&lt;/strong&gt; all the key bindings are accessible by pressing the &lt;kbd&gt;SPC&lt;/kbd&gt; or &lt;kbd&gt;Alt-m&lt;/kbd&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;strong&gt;Mnemonic key bindings:&lt;/strong&gt; commands have mnemonic prefixes like &lt;kbd&gt;SPC b&lt;/kbd&gt; for all the buffer commands or &lt;kbd&gt;SPC p&lt;/kbd&gt; for the project commands.&lt;/li&gt; 
 &lt;li&gt;&lt;strong&gt;Batteries included:&lt;/strong&gt; discover hundreds of ready-to-use packages nicely organized in configuration layers following a set of &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/doc/CONVENTIONS.org&quot;&gt;conventions &lt;/a&gt;.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Documentation&lt;/h1&gt; 
&lt;p&gt;Comprehensive documentation is available for each layer by pressing &lt;kbd&gt;SPC h SPC&lt;/kbd&gt;.&lt;/p&gt; 
&lt;p&gt;You can also check the &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/doc/DOCUMENTATION.org&quot;&gt;general documentation&lt;/a&gt;, &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/doc/QUICK_START.org&quot;&gt;quick start guide&lt;/a&gt; and the &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/doc/FAQ.org&quot;&gt;FAQ&lt;/a&gt;.&lt;/p&gt; 
&lt;h1&gt;Getting Help&lt;/h1&gt; 
&lt;p&gt;If you need help, ask your questions in the &lt;a href=&quot;https://gitter.im/syl20bnr/spacemacs&quot;&gt;Gitter Chat&lt;/a&gt; and a member of the community will help you out.&lt;/p&gt; 
&lt;p&gt;If you prefer IRC, connect to the &lt;a href=&quot;https://irc.gitter.im/&quot;&gt;Gitter Chat IRC server&lt;/a&gt; and join the &lt;code&gt;#syl20bnr/spacemacs&lt;/code&gt; channel.&lt;/p&gt; 
&lt;p&gt;Last but not least there are a lot of high class tutorials available on YouTube:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Jack of Some&#39;s &lt;a href=&quot;https://www.youtube.com/watch?v=r-BHx7VNX5s&amp;amp;list=PLd_Oyt6lAQ8Rxb0HUnGbRrn6R4Cdt2yoI&quot;&gt;Spacemacs tutorial videos&lt;/a&gt;.&lt;/li&gt; 
 &lt;li&gt;GDQuest&#39;s &lt;a href=&quot;https://www.youtube.com/watch?v=hCNOB5jjtmc&amp;amp;list=PLhqJJNjsQ7KFkMVBunWWzFD8SlH714qm4&quot;&gt;Game Design oriented tutorials &lt;/a&gt; to Spacemacs.&lt;/li&gt; 
 &lt;li&gt;Practicalli&#39;s &lt;a href=&quot;https://www.youtube.com/watch?v=jMJ58Gcc1RI&amp;amp;list=PLpr9V-R8ZxiCHMl2_dn1Fovcd34Oz45su&quot;&gt;Clojure tutorials based on Spacemacs&lt;/a&gt;.&lt;/li&gt; 
 &lt;li&gt;Eivind Fonn&#39;s classic &lt;a href=&quot;https://www.youtube.com/watch?v=ZFV5EqpZ6_s&amp;amp;list=PLrJ2YN5y27KLhd3yNs2dR8_inqtEiEweE&quot;&gt;Spacemacs ABC&lt;/a&gt;.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Prerequisites&lt;/h1&gt; 
&lt;ol&gt; 
 &lt;li&gt; &lt;p&gt;A package manager if the OS doesn&#39;t have one already.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Spacemacs is an extension of a popular text editor called &lt;a href=&quot;https://www.gnu.org/software/emacs/&quot;&gt;Emacs&lt;/a&gt;. So you&#39;ll need Emacs installed first.&lt;/p&gt; &lt;p&gt;Spacemacs requires Emacs 28.2 or above. The development version of Emacs is not &lt;em&gt;officially&lt;/em&gt; supported, but it should nevertheless be expected to work.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;a href=&quot;https://git-scm.com/downloads&quot;&gt;git&lt;/a&gt; is required to download and update Spacemacs.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Tar, in particular &lt;a href=&quot;https://www.gnu.org/software/tar/&quot;&gt;GNU Tar&lt;/a&gt;, is required to install and update Emacs packages used by Spacemacs.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;em&gt;(Optional)&lt;/em&gt; The default font used by Spacemacs is &lt;a href=&quot;https://adobe-fonts.github.io/source-code-pro/&quot;&gt;Source Code Pro&lt;/a&gt;. You may customize your own font settings and choose another font. If you want to use this default font, it must be installed.&lt;/p&gt; &lt;p&gt;Spacemacs also uses fallback fonts to ensure certain Unicode symbols it uses symbols appear correctly. The fonts used are determined by the OS:&lt;/p&gt; 
  &lt;ul&gt; 
   &lt;li&gt;Linux: &lt;a href=&quot;https://fonts.google.com/specimen/Nanum+Gothic&quot;&gt;Nanum Gothic&lt;/a&gt;&lt;/li&gt; 
   &lt;li&gt;macOS: &lt;a href=&quot;https://docs.microsoft.com/en-us/typography/font-list/arial-unicode-ms&quot;&gt;Arial Unicode MS&lt;/a&gt;&lt;/li&gt; 
   &lt;li&gt;Windows: &lt;a href=&quot;https://docs.microsoft.com/en-us/typography/font-list/ms-gothic&quot;&gt;MS Gothic&lt;/a&gt; and &lt;a href=&quot;https://docs.microsoft.com/en-us/typography/font-list/lucida-sans-unicode&quot;&gt;Lucida Sans Unicode&lt;/a&gt;&lt;/li&gt; 
  &lt;/ul&gt; &lt;p&gt;If the mode-line doesn&#39;t look similar to the &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/#introduction&quot;&gt;picture at the top of this page&lt;/a&gt;, make sure you have the correct fallback font installed.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;em&gt;(Optional)&lt;/em&gt; Various commands in Spacemacs needs one of the following line searching program:&lt;/p&gt; 
  &lt;ul&gt; 
   &lt;li&gt;&lt;a href=&quot;https://github.com/BurntSushi/ripgrep&quot;&gt;ripgrep (rg)&lt;/a&gt;&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://github.com/ggreer/the_silver_searcher&quot;&gt;The silver searcher (ag)&lt;/a&gt;&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://github.com/beyondgrep/ack3&quot;&gt;ack&lt;/a&gt;&lt;/li&gt; 
   &lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/grep/&quot;&gt;GNU Grep&lt;/a&gt; or &lt;a href=&quot;https://man.openbsd.org/grep&quot;&gt;BSD Grep&lt;/a&gt;&lt;/li&gt; 
  &lt;/ul&gt; &lt;p&gt;Grep is very slow but it&#39;s widely available on most systems and is used as an fallback option.&lt;/p&gt; &lt;p&gt;We strongly recommend &lt;a href=&quot;https://github.com/BurntSushi/ripgrep&quot;&gt;ripgrep&lt;/a&gt; over other line searching programs, for its blazing fast speed. The following subsections helps you to install it.&lt;/p&gt; &lt;/li&gt; 
&lt;/ol&gt; 
&lt;h3&gt;Linux&lt;/h3&gt; 
&lt;ol&gt; 
 &lt;li&gt; &lt;p&gt;Most Linux distribution ships a package manager already and if this is the case you are all set for this step.&lt;/p&gt; &lt;p&gt;If it doesn&#39;t, you may need to build the softwares mentioned below from their sources.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;In most distributions, Emacs is installed via an &lt;code&gt;emacs&lt;/code&gt; package from the package manager.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;N.B.&lt;/strong&gt; DO not install &lt;a href=&quot;https://www.xemacs.org&quot;&gt;XEmacs&lt;/a&gt; because it&#39;s not supported by Spacemacs. XEmacs is an old fork of Emacs with various &lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsAndXEmacs&quot;&gt;subtle differences&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;N.B.&lt;/strong&gt; Some Linux distributions support only Emacs versions older than 28.2. In this case you should &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/efaq/Installing-Emacs.html&quot;&gt;build it from source&lt;/a&gt; instead.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Very likely Git is already installed on your system. Otherwise, you should be able to install &lt;code&gt;git&lt;/code&gt; from your system&#39;s package manager.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Very likely Tar is already installed on your system. Otherwise, you should be able to install &lt;code&gt;tar&lt;/code&gt; from your system&#39;s package manager.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;em&gt;(Optional)&lt;/em&gt; If Nerd Fonts and Nanum Gothic are available from your distribution&#39;s package manager, you should install it there.&lt;/p&gt; &lt;p&gt;Otherwise, the generic way to install it is:&lt;/p&gt; 
  &lt;ol&gt; 
   &lt;li&gt; &lt;p&gt;Download the latest pre-built &lt;code&gt;TTF&lt;/code&gt; font from &lt;a href=&quot;https://github.com/adobe-fonts/source-code-pro/releases/latest&quot;&gt;https://github.com/adobe-fonts/source-code-pro/releases/latest&lt;/a&gt; and &lt;a href=&quot;https://fonts.google.com/specimen/Nanum+Gothic&quot;&gt;https://fonts.google.com/specimen/Nanum+Gothic&lt;/a&gt;.&lt;/p&gt; &lt;/li&gt; 
   &lt;li&gt; &lt;p&gt;Extract the archive and move the font files to &lt;code&gt;~/.fonts&lt;/code&gt;.&lt;/p&gt; &lt;/li&gt; 
   &lt;li&gt; &lt;p&gt;Refresh font cache with:&lt;/p&gt; &lt;/li&gt; 
  &lt;/ol&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;fc-cache -fv
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;em&gt;(Optional)&lt;/em&gt; If your distribution is listed &lt;a href=&quot;https://github.com/BurntSushi/ripgrep#installation=&quot;&gt;here&lt;/a&gt;, follow the instructions. Otherwise, you can download its pre-built binary or build it from source.&lt;/p&gt; &lt;/li&gt; 
&lt;/ol&gt; 
&lt;h3&gt;macOS&lt;/h3&gt; 
&lt;ol&gt; 
 &lt;li&gt; &lt;p&gt;The most popular package manager on macOS is &lt;a href=&quot;https://brew.sh&quot;&gt;Homebrew&lt;/a&gt;, to install it:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;/bin/bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&quot;
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Several options exist for installing Emacs on macOS:&lt;/p&gt; 
  &lt;ol&gt; 
   &lt;li&gt; &lt;p&gt;&lt;a href=&quot;https://github.com/d12frosted/homebrew-emacs-plus&quot;&gt;Emacs Plus&lt;/a&gt; features &lt;a href=&quot;https://github.com/d12frosted/homebrew-emacs-plus#features-explained&quot;&gt;additional functionalities&lt;/a&gt; over base Emacs.&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;brew tap d12frosted/emacs-plus

# install latest stable release, with Spacemacs icon and native compilation
brew install emacs-plus --with-spacemacs-icon --with-native-comp
&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;You will require the latest version of Xcode Command Line tools, which can be downloaded from the &lt;a href=&quot;https://developer.apple.com/download/all/&quot;&gt;Apple Developer Portal&lt;/a&gt; or by running the following command:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;softwareupdate --all --install --force
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
   &lt;li&gt; &lt;p&gt;&lt;a href=&quot;https://github.com/railwaycat/homebrew-emacsmacport&quot;&gt;Emacs Mac Port&lt;/a&gt; adds native GUI support to Emacs 28. And the full list of features is available &lt;a href=&quot;https://bitbucket.org/mituharu/emacs-mac/src/master/README-mac&quot;&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;brew tap railwaycat/emacsmacport
brew install emacs-mac
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
   &lt;li&gt; &lt;p&gt;&lt;a href=&quot;https://emacsformacosx.com/&quot;&gt;Emacs for Mac OS X&lt;/a&gt; is the binary build of GNU Emacs, &lt;em&gt;without&lt;/em&gt; any extra feature.&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;brew install --cask emacs
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
  &lt;/ol&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;To install &lt;code&gt;git&lt;/code&gt;:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;brew install git
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;macOS ships with &lt;a href=&quot;https://man.openbsd.org/tar&quot;&gt;BSD Tar&lt;/a&gt;, but there are reports of weird issues so we require &lt;a href=&quot;https://www.gnu.org/software/tar/&quot;&gt;GNU Tar&lt;/a&gt; instead.&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;brew install gnu-tar
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;em&gt;(Optional)&lt;/em&gt; To install Source Code Pro Font:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;brew tap homebrew/cask-fonts
brew install --cask font-source-code-pro
&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Arial Unicode MS is shipped with macOS v10.5 and later so you don&#39;t need to install it manually.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;em&gt;(Optional)&lt;/em&gt; You can install &lt;code&gt;ripgrep&lt;/code&gt; via &lt;code&gt;Homebrew&lt;/code&gt;:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;brew install ripgrep
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
&lt;/ol&gt; 
&lt;h3&gt;Windows&lt;/h3&gt; 
&lt;p&gt;We recommend using wsl2 with wslg support especially with a pgtk build of emacs and wayland. For the installation please refer to the linux installation section. When running emacs within your wsl2 environment emacs will be handled like any other windows application.&lt;/p&gt; 
&lt;p&gt;If this is not possible you can fallback to a native windows installation, however note that this will create a lot of subtle bugs especially with tls which we will most likely not be able to help with.&lt;/p&gt; 
&lt;p&gt;If you need to follow that path we recommend to at least use a package manager like &lt;a href=&quot;https://scoop.sh&quot;&gt;Scoop&lt;/a&gt; to install the needed packages.&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt; &lt;p&gt;You can install &lt;a href=&quot;https://scoop.sh&quot;&gt;Scoop&lt;/a&gt; via PowerShell:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;Set-ExecutionPolicy RemoteSigned -Scope CurrentUser # Optional: Needed to run a remote script the first time
irm get.scoop.sh | iex
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Emacs can be installed in PowerShell:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;scoop bucket add extras
scoop install emacs
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;To install &lt;code&gt;git&lt;/code&gt; in PowerShell:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;scoop bucket add main
scoop install git
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Windows 10 build 17063 and later ships with &lt;a href=&quot;https://man.openbsd.org/tar&quot;&gt;BSD Tar&lt;/a&gt;, but it&#39;s required to install &lt;a href=&quot;https://www.gnu.org/software/tar/&quot;&gt;GNU Tar&lt;/a&gt; instead to avoid possible issues. Alternatively, if you are running an earlier version of Windows, Tar isn&#39;t installed. In either case, you can install GNU Tar via:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;scoop bucket add main
scoop install tar
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;To install Source Code Pro Font in PowerShell:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;scoop bucket add KnotUntied_scoop-fonts https://github.com/KnotUntied/scoop-fonts
scoop install sourcecodepro
&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;MS Gothic and Lucida Sans Unicode are shipped with Windows 2003 and later so you don&#39;t need to install it manually.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;em&gt;(Optional)&lt;/em&gt; You can install &lt;code&gt;ripgrep&lt;/code&gt; in PowerShell:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;scoop bucket add main
scoop install ripgrep
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
&lt;/ol&gt; 
&lt;h1&gt;Install&lt;/h1&gt; 
&lt;h2&gt;Default Install&lt;/h2&gt; 
&lt;ol&gt; 
 &lt;li&gt; &lt;p&gt;The default installation downloads Spacemacs to the &lt;code&gt;.emacs.d&lt;/code&gt; directory in your &lt;code&gt;HOME&lt;/code&gt; directory.&lt;/p&gt; &lt;p&gt;But in the case of Windows, &lt;code&gt;HOME&lt;/code&gt; is not set out-of-box. We recommend you to set it as an environment variable, with the same value as environment variable &lt;code&gt;HOMEPATH&lt;/code&gt;, which usually looks like &lt;code&gt;C:\Users\&amp;lt;username&amp;gt;&lt;/code&gt;.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Since Spacemacs will now be downloaded at &lt;code&gt;$HOME/.emacs.d&lt;/code&gt;, if it already exists it&#39;ll be overridden.&lt;/p&gt; &lt;p&gt;Also, if you have either &lt;code&gt;$HOME/.emacs.el&lt;/code&gt; or &lt;code&gt;$HOME/.emacs&lt;/code&gt;, they will appear before Spacemacs in Emacs&#39;s initialization steps. Thus they must be renamed in order for Spacemacs to load correctly.&lt;/p&gt; &lt;p&gt;To backup/rename the aforementioned files/directory, in shell:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;[ -d $HOME/.emacs.d ] &amp;amp;&amp;amp; mv $HOME/.emacs.d $HOME/.emacs.d.bak
[ -f $HOME/.emacs.el ] &amp;amp;&amp;amp; mv $HOME/.emacs.el .emacs.el.bak
[ -f $HOME/.emacs ] &amp;amp;&amp;amp; mv $HOME/.emacs $HOME/.emacs.bak
&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;or in PowerShell:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;if( Test-Path -Path $HOME/.emacs.d )
{
    Rename-Item $HOME/.emacs.d $HOME/.emacs.d.bak
}
if( Test-Path -Path $HOME/.emacs.el )
{
    Rename-Item $HOME/.emacs.el $HOME/.emacs.el.bak
}
if( Test-Path -Path $HOME/.emacs )
{
    Rename-Item $HOME/.emacs $HOME/.emacs.bak
}
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Now clone this repository with Git. The following work for both shell and PowerShell:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;git clone https://github.com/syl20bnr/spacemacs $HOME/.emacs.d
&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;In case you have a limited internet connection or limited speed:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;git clone --depth 1 https://github.com/syl20bnr/spacemacs ~/.emacs.d
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Now you can launch Emacs and Spacemacs will be loaded.&lt;/p&gt; &lt;/li&gt; 
&lt;/ol&gt; 
&lt;h2&gt;Alternative Install Location&lt;/h2&gt; 
&lt;p&gt;To install Spacemacs in a different location, we first need to introduce how Spacemacs is loaded:&lt;/p&gt; 
&lt;p&gt;When Emacs is started, it looks for the init file &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html&quot;&gt;in a deterministic way&lt;/a&gt;. The &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/#default-install&quot;&gt;default installation&lt;/a&gt; exploits it by occupying &lt;code&gt;$HOME/.emacs.d/init.el&lt;/code&gt; and let Emacs use it as its init file.&lt;/p&gt; 
&lt;p&gt;In other word, in default installation, Emacs find and load &lt;code&gt;$HOME/.emacs.d/init.el&lt;/code&gt;, which is then responsible to load other files in &lt;code&gt;$HOME/.emacs.d&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;If you want to install Spacemacs to a different location, you need to make sure it&#39;s loaded by Emacs in one of its &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html&quot;&gt;init file&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;For example, if you&#39;ve cloned Spacemacs to &lt;code&gt;$HOME/Spacemacs&lt;/code&gt;, and if you use &lt;code&gt;$HOME/.emacs.el&lt;/code&gt; as Emacs init file, then the following lines in &lt;code&gt;$HOME/.emacs.el&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;;; load Spacemacs&#39;s initialization file, &quot;~&quot; is equivalent to &quot;$HOME&quot;
(load-file &quot;~/Spacemacs/init.el&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h1&gt;First Launch and Configuration&lt;/h1&gt; 
&lt;ol&gt; 
 &lt;li&gt; &lt;p&gt;After cloning Spacemacs, the first time when you launch Emacs, Spacemacs will automatically install the essential packages it requires. This step is the bootstrap.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Once the bootstrap packages are installed, Spacemacs checks whether you have an customization file &lt;code&gt;$HOME/.spacemacs&lt;/code&gt;, known as &lt;code&gt;dotspacemacs&lt;/code&gt;:&lt;/p&gt; 
  &lt;ul&gt; 
   &lt;li&gt;If it already exists, Spacemacs loads it as the configuration.&lt;/li&gt; 
   &lt;li&gt;Otherwise, you need to answer a few questions and Spacemacs will generate the &lt;code&gt;dotspacemacs&lt;/code&gt; file for you.&lt;/li&gt; 
  &lt;/ul&gt; &lt;p&gt;If you are new to Emacs and/or Spacemacs, it&#39;s fine to just accept the default choices. They can be changed in the &lt;code&gt;dotspacemacs&lt;/code&gt; file later.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Spacemacs will download and install remaining packages it will require, according to your &lt;code&gt;dotspacemacs&lt;/code&gt;. When the all the packages have been installed, restart Emacs to complete the installation.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;&lt;code&gt;dotspacemacs&lt;/code&gt; is the configuration file for Spacemacs, it&#39;s self explanatory and is written in Emacs Lisp. Read &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/doc/DOCUMENTATION.org&quot;&gt;general documentation&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/doc/QUICK_START.org&quot;&gt;quick start guide&lt;/a&gt; for more information.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;In case you want to store your &lt;code&gt;dotspacemacs&lt;/code&gt; at another location, say under &lt;code&gt;$HOME/.spacemacs.d&lt;/code&gt;:&lt;/p&gt; 
  &lt;ul&gt; 
   &lt;li&gt;First set the environment variable &lt;code&gt;SPACEMACSDIR&lt;/code&gt; to &lt;code&gt;$HOME/.spacemacs.d&lt;/code&gt;.&lt;/li&gt; 
   &lt;li&gt;Move &lt;code&gt;$HOME/.spacemacs&lt;/code&gt; to &lt;code&gt;$HOME/.spacemacs.d/init.el&lt;/code&gt;.&lt;/li&gt; 
  &lt;/ul&gt; &lt;p&gt;In other word, set &lt;code&gt;SPACEMACSDIR&lt;/code&gt; to the parent directory of your &lt;code&gt;dotspacemacs&lt;/code&gt;, and move &lt;code&gt;dotspacemacs&lt;/code&gt; to the said directory.&lt;/p&gt; &lt;/li&gt; 
&lt;/ol&gt; 
&lt;h2&gt;Spacemacs logo&lt;/h2&gt; 
&lt;p&gt;For Linux users, create &lt;code&gt;spacemacs.desktop&lt;/code&gt; in &lt;code&gt;~/.local/share/applications/&lt;/code&gt; using &lt;a href=&quot;https://github.com/emacs-mirror/emacs/raw/master/etc/emacs.desktop&quot;&gt;this .desktop file&lt;/a&gt; as a reference. Change the &lt;code&gt;Name&lt;/code&gt; parameter to &lt;code&gt;Name=Spacemacs&lt;/code&gt; and the &lt;code&gt;Icon&lt;/code&gt; parameter to &lt;code&gt;Icon=/PATH/TO/EMACSD/core/banners/img/spacemacs.png&lt;/code&gt; where &lt;code&gt;PATH/TO/EMACSD&lt;/code&gt; is the path to your &lt;code&gt;.emacs.d&lt;/code&gt; directory, by default &lt;code&gt;~/.emacs.d&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For macOS users, you need to &lt;a href=&quot;https://github.com/nashamri/spacemacs-logo&quot;&gt;download the .icns version of the logo&lt;/a&gt; and simply &lt;a href=&quot;https://www.idownloadblog.com/2014/07/16/how-to-change-app-icon-mac/&quot;&gt;change the logo on the Dock&lt;/a&gt;.&lt;/p&gt; 
&lt;h2&gt;Notes&lt;/h2&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;Depending on the installed version of GnuTLS, securely installing Emacs packages may fail. If this happens to you please update your OS and Emacs. If you are behind a company proxy please trust the company firewall cert. We do not longer support disabling https due to security reasons.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;(&lt;em&gt;Windows)&lt;/em&gt; If the following error occurs after starting Emacs:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;The directory ~/.emacs.d/server is unsafe
&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Fix it by changing the owner of the directory &lt;code&gt;~/.emacs.d/server&lt;/code&gt;:&lt;/p&gt; 
  &lt;ul&gt; 
   &lt;li&gt;From Properties select the Tab “Security”,&lt;/li&gt; 
   &lt;li&gt;Select the button “Advanced”,&lt;/li&gt; 
   &lt;li&gt;Select the Tab “Owner”&lt;/li&gt; 
   &lt;li&gt;Change the owner to your account name&lt;/li&gt; 
  &lt;/ul&gt; &lt;p&gt;Source: &lt;a href=&quot;https://stackoverflow.com/questions/885793/emacs-error-when-calling-server-start&quot;&gt;Stack Overflow&lt;/a&gt;&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;(&lt;em&gt;Windows&lt;/em&gt;) The period (dot) before a file or folder name means that it&#39;s a hidden file or folder. To show hidden files and folders:&lt;/p&gt; 
  &lt;ul&gt; 
   &lt;li&gt;Press the Windows key&lt;/li&gt; 
   &lt;li&gt;Type &lt;code&gt;File explorer options&lt;/code&gt;&lt;/li&gt; 
   &lt;li&gt;Select the &lt;code&gt;View&lt;/code&gt; tab at the top&lt;/li&gt; 
   &lt;li&gt;Check &lt;code&gt;Show hidden files, folders and drives&lt;/code&gt;&lt;/li&gt; 
   &lt;li&gt;Click &lt;code&gt;OK&lt;/code&gt;&lt;/li&gt; 
  &lt;/ul&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Update&lt;/h1&gt; 
&lt;p&gt;Spacemacs relies solely on a rolling update scheme based on the latest changes available. To update Spacemacs, simply pull the latest changes from the &lt;code&gt;develop&lt;/code&gt; branch:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt; &lt;p&gt;Close Emacs and update the git repository:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;git pull --rebase
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Restart Emacs to complete the upgrade.&lt;/p&gt; &lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;strong&gt;After updating Spacemacs, you should also check if any updates are available for your packages. On the Spacemacs Home Buffer &lt;kbd&gt;SPC b h&lt;/kbd&gt;, click (press &lt;kbd&gt;RET&lt;/kbd&gt;) on the &lt;code&gt;[Update Packages]&lt;/code&gt; button, or use the convenient keybinding &lt;kbd&gt;SPC f e U&lt;/kbd&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;h2&gt;Upgrading from the deprecated &lt;code&gt;master&lt;/code&gt; branch&lt;/h2&gt; 
&lt;p&gt;If you are still on the old &lt;code&gt;master&lt;/code&gt; branch (i.e., if &lt;code&gt;git branch --show-current&lt;/code&gt; shows &lt;code&gt;master&lt;/code&gt; instead of &lt;code&gt;develop&lt;/code&gt;), you need to &lt;a href=&quot;https://practical.li/spacemacs/reference/switch-to-develop/&quot;&gt;upgrade to &lt;code&gt;develop&lt;/code&gt;&lt;/a&gt; first.&lt;/p&gt; 
&lt;h1&gt;Quotes&lt;/h1&gt; 
&lt;p&gt;&lt;a href=&quot;https://gitter.im/syl20bnr/spacemacs?at=568e627a0cdaaa62045a7df6&quot;&gt;Quote&lt;/a&gt; by &lt;a href=&quot;https://github.com/ashnur&quot;&gt;ashnur&lt;/a&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;«I feel that spacemacs is an aircraft carrier and I am playing table tennis
on the deck as a freerider.»
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;a href=&quot;https://gitter.im/syl20bnr/spacemacs?at=5768456c6577f032450cfedb&quot;&gt;Quote&lt;/a&gt; by &lt;a href=&quot;https://github.com/deuill&quot;&gt;deuill&lt;/a&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;«I LOVE SPACEMACS AND MAGIT

 That is all»
&lt;/code&gt;&lt;/pre&gt; 
&lt;h1&gt;Contributions&lt;/h1&gt; 
&lt;p&gt;Spacemacs is a community-driven project, it needs &lt;em&gt;you&lt;/em&gt; to keep it up to date and to propose great and useful configurations for all the things!&lt;/p&gt; 
&lt;p&gt;Before contributing, be sure to consult the &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/CONTRIBUTING.org&quot;&gt;contribution guidelines&lt;/a&gt; and &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/doc/CONVENTIONS.org&quot;&gt;conventions&lt;/a&gt;.&lt;/p&gt; 
&lt;h1&gt;Communities&lt;/h1&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://gitter.im/syl20bnr/spacemacs&quot;&gt;Gitter Chat&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/tagged/spacemacs&quot;&gt;Stack Exchange&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://www.reddit.com/r/spacemacs&quot;&gt;Reddit&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Spacemacs Everywhere&lt;/h1&gt; 
&lt;p&gt;Once you&#39;ve learned the Spacemacs key bindings, you can use them in other IDEs/tools, thanks to the following projects:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/MarcoIeni/intellimacs&quot;&gt;Intellimacs&lt;/a&gt; - Spacemacs&#39; like key bindings for IntelliJ platform&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/MarcoIeni/spaceclipse&quot;&gt;Spaceclipse&lt;/a&gt; - Spacemacs’ like key bindings for Eclipse&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/SpaceVim/SpaceVim&quot;&gt;SpaceVim&lt;/a&gt; - A community-driven modular vim distribution&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/VSpaceCode/VSpaceCode&quot;&gt;VSpaceCode&lt;/a&gt; - Spacemacs’ like key bindings for Visual Studio Code&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;License&lt;/h1&gt; 
&lt;p&gt;The license is GPLv3 for all parts specific to Spacemacs, this includes:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;the initialization and core files&lt;/li&gt; 
 &lt;li&gt;all the layer files&lt;/li&gt; 
 &lt;li&gt;the documentation&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;For the packages shipped in this repository, you can refer to the files header.&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://github.com/nashamri/spacemacs-logo&quot;&gt;Spacemacs logo&lt;/a&gt; by &lt;a href=&quot;https://github.com/nashamri&quot;&gt;Nasser Alshammari&lt;/a&gt; released under a &lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0/&quot;&gt;Creative Commons Attribution-ShareAlike 4.0 International License.&lt;/a&gt;&lt;/p&gt; 
&lt;h1&gt;Supporting Spacemacs&lt;/h1&gt; 
&lt;p&gt;The best way to support Spacemacs is to contribute to it either by reporting bugs, helping the community on the &lt;a href=&quot;https://gitter.im/syl20bnr/spacemacs&quot;&gt;Gitter Chat&lt;/a&gt; or sending pull requests.&lt;/p&gt; 
&lt;p&gt;You can show your love for the project by getting cool Spacemacs t-shirts, mugs and more in the &lt;a href=&quot;https://shop.spreadshirt.com/spacemacs-shop&quot;&gt;Spacemacs Shop&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;If you want to show your support financially, then you can contribute to &lt;a href=&quot;https://salt.bountysource.com/teams/spacemacs&quot;&gt;Bountysource&lt;/a&gt;, or buy a drink for the maintainer by clicking on the &lt;a href=&quot;https://raw.githubusercontent.com/syl20bnr/spacemacs/develop/#top&quot;&gt;Paypal badge&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;If you used Spacemacs in a project, and you want to show that fact, you can use the Spacemacs badge: &lt;a href=&quot;https://spacemacs.org&quot;&gt;&lt;img src=&quot;https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg?sanitize=true&quot; alt=&quot;Built with
Spacemacs&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;For Markdown:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-markdown&quot;&gt;[![Built with Spacemacs](https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg)](https://spacemacs.org)
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;For HTML:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;a href=&quot;https://spacemacs.org&quot;&amp;gt;&amp;lt;img alt=&quot;Built with Spacemacs&quot; src=&quot;https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg&quot; /&amp;gt;&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;For Org-mode:&lt;/p&gt; &lt;pre&gt;&lt;code class=&quot;language-org&quot;&gt;[[https://spacemacs.org][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]]
&lt;/code&gt;&lt;/pre&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Thank you!&lt;/p&gt;</description>
      
      <media:content url="https://repository-images.githubusercontent.com/7212645/2911bf00-6169-11e9-96b0-2f3dbe77ffb5" medium="image" />
      
    </item>
    
    <item>
      <title>akermu/emacs-libvterm</title>
      <link>https://github.com/akermu/emacs-libvterm</link>
      <description>&lt;p&gt;Emacs libvterm integration&lt;/p&gt;&lt;hr&gt;&lt;p&gt;&lt;a href=&quot;https://melpa.org/#/vterm&quot;&gt;&lt;img src=&quot;https://melpa.org/packages/vterm-badge.svg?sanitize=true&quot; alt=&quot;MELPA&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;h1&gt;Introduction&lt;/h1&gt; 
&lt;p&gt;Emacs-libvterm (&lt;em&gt;vterm&lt;/em&gt;) is fully-fledged terminal emulator inside GNU Emacs based on &lt;a href=&quot;https://github.com/neovim/libvterm&quot;&gt;&lt;code&gt;libvterm&lt;/code&gt;&lt;/a&gt;, a C library. As a result of using compiled code (instead of elisp), emacs-libvterm is fully capable, fast, and it can seamlessly handle large outputs.&lt;/p&gt; 
&lt;h2&gt;Warning&lt;/h2&gt; 
&lt;p&gt;This package is in active development and, while being stable enough to be used as a daily-driver, it is currently in &lt;strong&gt;alpha&lt;/strong&gt; stage. This means that occasionally the public interface will change (for example names of options or functions). A list of recent breaking changes is in &lt;a href=&quot;https://raw.githubusercontent.com/akermu/emacs-libvterm/master/#breaking-changes&quot;&gt;appendix&lt;/a&gt;. Moreover, emacs-libvterm deals directly with some low-level operations, hence, bugs can lead to segmentation faults and crashes. If that happens, please &lt;a href=&quot;https://github.com/akermu/emacs-libvterm/issues/new&quot;&gt;report the problem&lt;/a&gt;.&lt;/p&gt; 
&lt;h2&gt;Given that eshell, shell, and (ansi-)term are Emacs built-in, why should I use vterm?&lt;/h2&gt; 
&lt;p&gt;The short answer is: unparalleled performance and compatibility with standard command-line tools.&lt;/p&gt; 
&lt;p&gt;For the long answer, let us discuss the differences between &lt;code&gt;eshell&lt;/code&gt;, &lt;code&gt;shell&lt;/code&gt;, &lt;code&gt;term&lt;/code&gt; and &lt;code&gt;vterm&lt;/code&gt;:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;eshell&lt;/code&gt;: it is a shell completely implemented in Emacs Lisp. It is well-integrated in Emacs and it runs on Windows. It does not support command line tools that require terminal manipulation capabilities (e.g., &lt;code&gt;ncdu&lt;/code&gt;, &lt;code&gt;nmtui&lt;/code&gt;, ...).&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;shell&lt;/code&gt;: it interfaces with a standard shell (e.g., &lt;code&gt;bash&lt;/code&gt;). It reads an input from Emacs, sends it to the shell, and reports back the output from the shell. As such, like &lt;code&gt;eshell&lt;/code&gt;, it does not support interactive commands, especially those that directly handle how the output should be displayed (e.g., &lt;code&gt;htop&lt;/code&gt;).&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;term&lt;/code&gt;: it is a terminal emulator written in elisp. &lt;code&gt;term&lt;/code&gt; runs a shell (similarly to other terminal emulators like Gnome Terminal) and programs can directly manipulate the output using escape codes. Hence, many interactive applications (like the one aforementioned) work with &lt;code&gt;term&lt;/code&gt;. However, &lt;code&gt;term&lt;/code&gt; and &lt;code&gt;ansi-term&lt;/code&gt; do not implement all the escapes codes needed, so some programs do not work properly. Moreover, &lt;code&gt;term&lt;/code&gt; has inferior performance compared to standalone terminals, especially with large bursts of output.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;vterm&lt;/code&gt;: like &lt;code&gt;term&lt;/code&gt; it is a terminal emulator. Unlike &lt;code&gt;term&lt;/code&gt;, the core of &lt;code&gt;vterm&lt;/code&gt; is an external library written in C, &lt;code&gt;libvterm&lt;/code&gt;. For this reason, &lt;code&gt;vterm&lt;/code&gt; outperforms &lt;code&gt;term&lt;/code&gt; and has a nearly universal compatibility with terminal applications.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Vterm is not for you &lt;a href=&quot;https://github.com/akermu/emacs-libvterm/issues/12&quot;&gt;if you are using Windows&lt;/a&gt;, or if you cannot set up Emacs with support for modules. Otherwise, you should try vterm, as it provides a superior terminal experience in Emacs.&lt;/p&gt; 
&lt;p&gt;Using &lt;code&gt;vterm&lt;/code&gt; is like using Gnome Terminal inside Emacs: Vterm is fully-featured and fast, but is not as well integrated in Emacs as &lt;code&gt;eshell&lt;/code&gt; (yet), so some of the editing keybinding you are used to using may not work. For example, &lt;code&gt;evil-mode&lt;/code&gt; is currently not supported (though, users can enable VI emulation in their shells). This is because keys are sent directly to the shell. We are constantly working to improve this.&lt;/p&gt; 
&lt;h1&gt;Installation&lt;/h1&gt; 
&lt;h2&gt;Requirements&lt;/h2&gt; 
&lt;p&gt;Before installing emacs-libvterm, you need to make sure you have installed&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;GNU Emacs (&amp;gt;= 25.1) with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Dynamic-Modules.html&quot;&gt;module support&lt;/a&gt;. You can check that, by verifying that &lt;code&gt;module-file-suffix&lt;/code&gt; is not &lt;code&gt;nil&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;cmake (&amp;gt;= 3.11)&lt;/li&gt; 
 &lt;li&gt;libtool-bin (related issues: &lt;a href=&quot;https://github.com/akermu/emacs-libvterm/issues/66&quot;&gt;#66&lt;/a&gt; &lt;a href=&quot;https://github.com/akermu/emacs-libvterm/issues/85#issuecomment-491845136&quot;&gt;#85&lt;/a&gt;)&lt;/li&gt; 
 &lt;li&gt;OPTIONAL: &lt;a href=&quot;https://github.com/Sbozzolo/libvterm-mirror.git&quot;&gt;libvterm&lt;/a&gt; (&amp;gt;= 0.2). This library can be found in the official repositories of most distributions (e.g., Arch, Debian, Fedora, Gentoo, openSUSE, Ubuntu). Typical names are &lt;code&gt;libvterm&lt;/code&gt; (Arch, Fedora, Gentoo, openSUSE), or &lt;code&gt;libvterm-dev&lt;/code&gt; (Debian, Ubuntu). If not available, &lt;code&gt;libvterm&lt;/code&gt; will be downloaded during the compilation process. Some distributions (e.g. Ubuntu &amp;lt; 20.04, Debian &amp;lt; 11) have versions of &lt;code&gt;libvterm&lt;/code&gt; that are too old. If you find compilation errors related to &lt;code&gt;VTERM_COLOR&lt;/code&gt;, you should not use your system libvterm. See &lt;a href=&quot;https://raw.githubusercontent.com/akermu/emacs-libvterm/master/#frequently-asked-questions-and-problems&quot;&gt;FAQ&lt;/a&gt; for more details.&lt;/li&gt; 
&lt;/ol&gt; 
&lt;h2&gt;From MELPA&lt;/h2&gt; 
&lt;p&gt;&lt;code&gt;vterm&lt;/code&gt; is available on &lt;a href=&quot;https://melpa.org/&quot;&gt;MELPA&lt;/a&gt;, and it can be installed as a normal package. If the requirements are satisfied (mainly, Emacs was built with support for modules), &lt;code&gt;vterm&lt;/code&gt; will compile the module the first time it is run. This is the recommended way to install &lt;code&gt;vterm&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;vterm&lt;/code&gt; can be installed from MELPA with &lt;code&gt;use-package&lt;/code&gt; by adding the following lines to your &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(use-package vterm
    :ensure t)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;To take full advantage of the capabilities of &lt;code&gt;vterm&lt;/code&gt;, you should configure your shell too. Read about this in the section &lt;a href=&quot;https://raw.githubusercontent.com/akermu/emacs-libvterm/master/#shell-side-configuration&quot;&gt;shell-side configuration&lt;/a&gt;.&lt;/p&gt; 
&lt;h2&gt;Manual installation&lt;/h2&gt; 
&lt;p&gt;Clone the repository:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;git clone https://github.com/akermu/emacs-libvterm.git
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;By default, vterm will try to find if &lt;code&gt;libvterm&lt;/code&gt; is installed. If it is not found, emacs-libvterm will download the latest version available of &lt;code&gt;libvterm&lt;/code&gt; (from &lt;a href=&quot;https://github.com/neovim/libvterm&quot;&gt;here&lt;/a&gt;), compile it, and use it. If you always want to use the vendored version as opposed to the one on you system, set &lt;code&gt;USE_SYSTEM_LIBVTERM&lt;/code&gt; to &lt;code&gt;no&lt;/code&gt;. To do this, change &lt;code&gt;cmake ..&lt;/code&gt; with &lt;code&gt;cmake -DUSE_SYSTEM_LIBVTERM=no ..&lt;/code&gt; in the following instructions.&lt;/p&gt; 
&lt;p&gt;Build the module with:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;cd emacs-libvterm
mkdir -p build
cd build
cmake ..
make
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;And add this to your &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(add-to-list &#39;load-path &quot;path/to/emacs-libvterm&quot;)
(require &#39;vterm)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Or, with &lt;code&gt;use-package&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(use-package vterm
  :load-path  &quot;path/to/emacs-libvterm/&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;vterm and Ubuntu&lt;/h2&gt; 
&lt;h3&gt;20.04&lt;/h3&gt; 
&lt;p&gt;Using &lt;code&gt;vterm&lt;/code&gt; on Ubuntu requires additional steps. The latest LTS version (20.04) ships without CMake installed and Emacs27 is not yet available from Ubuntu&#39;s package repository.&lt;/p&gt; 
&lt;p&gt;The basic steps for getting vterm to work on Ubuntu 20.04 are:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Ensure Emacs27 is installed&lt;/li&gt; 
 &lt;li&gt;Install &lt;code&gt;cmake&lt;/code&gt;, &lt;code&gt;libtool&lt;/code&gt;, and &lt;code&gt;libtool-bin&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;There are a few options for installing Emacs27 on Ubuntu 20.04:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Compile Emacs27 from source&lt;/li&gt; 
 &lt;li&gt;Install Emacs27 from Snap&lt;/li&gt; 
 &lt;li&gt;Install Emacs27 from Kevin Kelley&#39;s PPA&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;In any case, if you have an older Emacs version you will need to purge it before proceeding:&lt;/p&gt; 
&lt;h4&gt;Purge Emacs&lt;/h4&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;sudo apt --purge remove emacs
sudo apt autoremove
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;Installing Emacs27 from Kevin Kelley PPA&lt;/h4&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;sudo add-apt-repository ppa:kelleyk/emacs
sudo apt install emacs27
&lt;/code&gt;&lt;/pre&gt; 
&lt;h5&gt;If you get an error about emacs27_common during the install process:&lt;/h5&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;Errors were encountered while processing:
 /tmp/apt-dpkg-install-RVK8CA/064-emacs27-common_27.1~1.git86d8d76aa3-kk2+20.04_all.deb
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;run&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;sudo apt --purge remove emacs-common
sudo apt --fix-broken install
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;Installing Emacs27 from Snap&lt;/h4&gt; 
&lt;p&gt;I hesitate to include SNAP here, because I ran into a number of GTK Theme parsing errors, and Fontconfig errors when I tested it, and reverted to installing from Kevin Kelley&#39;s PPA. YMMV&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;sudo snap install emacs --classic
&lt;/code&gt;&lt;/pre&gt; 
&lt;h4&gt;Install CMake and Libtool&lt;/h4&gt; 
&lt;p&gt;In Ubuntu 20.04 CMake (v3.16.3-1ubuntu1) and Libtool can be installed with&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;sudo apt install cmake
sudo apt install libtool
sudo apt install libtool-bin
&lt;/code&gt;&lt;/pre&gt; 
&lt;h3&gt;18.04&lt;/h3&gt; 
&lt;p&gt;Using &lt;code&gt;vterm&lt;/code&gt; on Ubuntu 18.04 requires additional steps. 18.04 ships with a version of CMake that is too old for &lt;code&gt;vterm&lt;/code&gt; and GNU Emacs is not compiled with support for dynamical module loading.&lt;/p&gt; 
&lt;p&gt;It is possible to install GNU Emacs with module support from Kevin Kelley&#39;s PPA. The binary in Ubuntu Emacs Lisp PPA is currently broken and leads to segmentation faults (see &lt;a href=&quot;https://github.com/akermu/emacs-libvterm/issues/185#issuecomment-562237077&quot;&gt;#185&lt;/a&gt;). In case Emacs is already on the system, you need to purge it before proceeding with the following commands.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;sudo add-apt-repository ppa:kelleyk/emacs
sudo apt update
sudo apt-get install emacs26
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;A way to install a recent version of CMake (&amp;gt;= 3.11) is with linuxbrew.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;brew install cmake
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;In some cases, &lt;code&gt;/bin/sh&lt;/code&gt; needs to be relinked to &lt;code&gt;/bin/bash&lt;/code&gt; for the compilation to work (see, &lt;a href=&quot;https://github.com/akermu/emacs-libvterm/issues/216#issuecomment-575934593&quot;&gt;#216&lt;/a&gt;).&lt;/p&gt; 
&lt;p&gt;Pull requests to improve support for Ubuntu are welcome (e.g., simplifying the installation).&lt;/p&gt; 
&lt;p&gt;Some releases of Ubuntu (e.g., 18.04) ship with a old version of &lt;code&gt;libvterm&lt;/code&gt; that can lead to compilation errors. If you have this problem, see the &lt;a href=&quot;https://raw.githubusercontent.com/akermu/emacs-libvterm/master/#frequently-asked-questions-and-problems&quot;&gt;FAQ&lt;/a&gt; for a solution.&lt;/p&gt; 
&lt;h2&gt;GNU Guix&lt;/h2&gt; 
&lt;p&gt;&lt;code&gt;vterm&lt;/code&gt; and its dependencies are available in GNU Guix as &lt;a href=&quot;https://guix.gnu.org/packages/emacs-vterm-0-1.7d7381f/&quot;&gt;emacs-vterm&lt;/a&gt;. The package can be installed with &lt;code&gt;guix package -i emacs-vterm&lt;/code&gt;.&lt;/p&gt; 
&lt;h2&gt;Shell-side configuration&lt;/h2&gt; 
&lt;p&gt;Some of the most useful features in &lt;code&gt;vterm&lt;/code&gt; (e.g., &lt;a href=&quot;https://raw.githubusercontent.com/akermu/emacs-libvterm/master/#directory-tracking-and-prompt-tracking&quot;&gt;directory-tracking and prompt-tracking&lt;/a&gt; or &lt;a href=&quot;https://raw.githubusercontent.com/akermu/emacs-libvterm/master/#message-passing&quot;&gt;message passing&lt;/a&gt;) require shell-side configurations. The main goal of these additional functions is to enable the shell to send information to &lt;code&gt;vterm&lt;/code&gt; via properly escaped sequences. A function that helps in this task, &lt;code&gt;vterm_printf&lt;/code&gt;, is defined below. This function is widely used throughout this readme.&lt;/p&gt; 
&lt;p&gt;For &lt;code&gt;bash&lt;/code&gt; or &lt;code&gt;zsh&lt;/code&gt;, put this in your &lt;code&gt;.zshrc&lt;/code&gt; or &lt;code&gt;.bashrc&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;vterm_printf() {
    if [ -n &quot;$TMUX&quot; ] \
        &amp;amp;&amp;amp; { [ &quot;${TERM%%-*}&quot; = &quot;tmux&quot; ] \
            || [ &quot;${TERM%%-*}&quot; = &quot;screen&quot; ]; }; then
        # Tell tmux to pass the escape sequences through
        printf &quot;\ePtmux;\e\e]%s\007\e\\&quot; &quot;$1&quot;
    elif [ &quot;${TERM%%-*}&quot; = &quot;screen&quot; ]; then
        # GNU screen (screen, screen-256color, screen-256color-bce)
        printf &quot;\eP\e]%s\007\e\\&quot; &quot;$1&quot;
    else
        printf &quot;\e]%s\e\\&quot; &quot;$1&quot;
    fi
}
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This works also for &lt;code&gt;dash&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;For &lt;code&gt;fish&lt;/code&gt; put this in your &lt;code&gt;~/.config/fish/config.fish&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-fish&quot;&gt;function vterm_printf;
    if begin; [  -n &quot;$TMUX&quot; ]  ; and  string match -q -r &quot;screen|tmux&quot; &quot;$TERM&quot;; end
        # tell tmux to pass the escape sequences through
        printf &quot;\ePtmux;\e\e]%s\007\e\\&quot; &quot;$argv&quot;
    else if string match -q -- &quot;screen*&quot; &quot;$TERM&quot;
        # GNU screen (screen, screen-256color, screen-256color-bce)
        printf &quot;\eP\e]%s\007\e\\&quot; &quot;$argv&quot;
    else
        printf &quot;\e]%s\e\\&quot; &quot;$argv&quot;
    end
end
&lt;/code&gt;&lt;/pre&gt; 
&lt;h1&gt;Debugging and testing&lt;/h1&gt; 
&lt;p&gt;If you have successfully built the module, you can test it by executing the following command in the &lt;code&gt;build&lt;/code&gt; directory:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;make run
&lt;/code&gt;&lt;/pre&gt; 
&lt;h1&gt;Usage&lt;/h1&gt; 
&lt;h2&gt;&lt;code&gt;vterm&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;Open a terminal in the current window.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-other-window&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;Open a terminal in another window.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-copy-mode&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;When you enable &lt;code&gt;vterm-copy-mode&lt;/code&gt;, the terminal buffer behaves like a normal &lt;code&gt;read-only&lt;/code&gt; text buffer: you can search, copy text, etc. The default keybinding to toggle &lt;code&gt;vterm-copy-mode&lt;/code&gt; is &lt;code&gt;C-c C-t&lt;/code&gt;. When a region is selected, it is possible to copy the text and leave &lt;code&gt;vterm-copy-mode&lt;/code&gt; with the enter key.&lt;/p&gt; 
&lt;p&gt;If no region is selected when the enter key is pressed it will copy the current line from start to end. If &lt;code&gt;vterm-copy-exclude-prompt&lt;/code&gt; is true it will skip the prompt and not include it in the copy.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-clear-scrollback&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;&lt;code&gt;vterm-clear-scrollback&lt;/code&gt; does exactly what the name suggests: it clears the current buffer from the data that it is not currently visible. &lt;code&gt;vterm-clear-scrollback&lt;/code&gt; is bound to &lt;code&gt;C-c C-l&lt;/code&gt;. This function is typically used with the &lt;code&gt;clear&lt;/code&gt; function provided by the shell to clear both screen and scrollback. In order to achieve this behavior, you need to add a new shell alias.&lt;/p&gt; 
&lt;p&gt;For &lt;code&gt;zsh&lt;/code&gt;, put this in your &lt;code&gt;.zshrc&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-zsh&quot;&gt;if [[ &quot;$INSIDE_EMACS&quot; = &#39;vterm&#39; ]]; then
    alias clear=&#39;vterm_printf &quot;51;Evterm-clear-scrollback&quot;;tput clear&#39;
fi
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;For &lt;code&gt;bash&lt;/code&gt;, put this in your &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;if [ &quot;$INSIDE_EMACS&quot; = &#39;vterm&#39; ]; then
    clear() {
        vterm_printf &quot;51;Evterm-clear-scrollback&quot;;
        tput clear;
    }
fi
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;For &lt;code&gt;fish&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-fish&quot;&gt;if [ &quot;$INSIDE_EMACS&quot; = &#39;vterm&#39; ]
    function clear
        vterm_printf &quot;51;Evterm-clear-scrollback&quot;;
        tput clear;
    end
end
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;These aliases take advantage of the fact that &lt;code&gt;vterm&lt;/code&gt; can execute &lt;code&gt;elisp&lt;/code&gt; commands, as explained below.&lt;/p&gt; 
&lt;p&gt;If it possible to automatically clear the scrollback when the screen is cleared by setting the variable &lt;code&gt;vterm-clear-scrollback-when-clearing&lt;/code&gt;: When &lt;code&gt;vterm-clear-scrollback-when-clearing&lt;/code&gt; is non nil, &lt;code&gt;C-l&lt;/code&gt; clears both the screen and the scrollback. When is nil, &lt;code&gt;C-l&lt;/code&gt; only clears the screen. The opposite behavior can be achieved by using the universal prefix (i.e., calling &lt;code&gt;C-u C-l&lt;/code&gt;).&lt;/p&gt; 
&lt;h1&gt;Customization&lt;/h1&gt; 
&lt;h2&gt;&lt;code&gt;vterm-shell&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;Shell to run in a new vterm. It defaults to &lt;code&gt;$SHELL&lt;/code&gt;.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-environment&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;To add more environment variables there is the custom &lt;code&gt;vterm-environment&lt;/code&gt; which has a similar format to the internal Emacs variable &lt;code&gt;process-environment&lt;/code&gt;. You can check the documentation with &lt;code&gt;C-h v process-environment&lt;/code&gt; for more details.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-term-environment-variable&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;Value for the &lt;code&gt;TERM&lt;/code&gt; environment variable. It defaults to &lt;code&gt;xterm-256color&lt;/code&gt;. If &lt;a href=&quot;https://github.com/dieggsy/eterm-256color&quot;&gt;eterm-256color&lt;/a&gt; is installed, setting &lt;code&gt;vterm-term-environment-variable&lt;/code&gt; to &lt;code&gt;eterm-color&lt;/code&gt; improves the rendering of colors in some systems.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-kill-buffer-on-exit&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;If set to &lt;code&gt;t&lt;/code&gt;, buffers are killed when the associated process is terminated (for example, by logging out the shell). Keeping buffers around it is useful if you need to copy or manipulate the content.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-module-cmake-args&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;Compilation flags and arguments to be given to CMake when compiling the module. This string is directly passed to CMake, so it uses the same syntax. At the moment, its main use is for compiling vterm using the system &lt;code&gt;libvterm&lt;/code&gt; instead of the one downloaded from GitHub. You can find all the arguments and flags available with &lt;code&gt;cmake -LA&lt;/code&gt; in the build directory.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-copy-exclude-prompt&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;Controls whether or not to exclude the prompt when copying a line in &lt;code&gt;vterm-copy-mode&lt;/code&gt;. Using the universal prefix before calling &lt;code&gt;vterm-copy-mode-done&lt;/code&gt; will invert the value for that call, allowing you to temporarily override the setting. When a prompt is not found, the whole line is copied.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-use-vterm-prompt-detection-method&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;The variable &lt;code&gt;vterm-use-vterm-prompt-detection-method&lt;/code&gt; determines whether to use the vterm prompt tracking, if false it use the regexp in &lt;code&gt;vterm-copy-prompt-regexp&lt;/code&gt; to search for the prompt.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-enable-manipulate-selection-data-by-osc52&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;Vterm support copy text to Emacs kill ring and system clipboard by using OSC 52. See &lt;a href=&quot;https://invisible-island.net/xterm/ctlseqs/ctlseqs.html&quot;&gt;https://invisible-island.net/xterm/ctlseqs/ctlseqs.html&lt;/a&gt; for more info about OSC 52. For example: send &lt;code&gt;&quot;blabla&quot;&lt;/code&gt; to kill ring: &lt;code&gt;printf &quot;\033]52;c;$(printf &quot;%s&quot; &quot;blabla&quot; | base64)\a&quot;&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;tmux can share its copy buffer to terminals by supporting OSC 52 (like iterm2 and xterm), you can enable this feature for tmux by:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;set -g set-clipboard on         #osc 52 copy paste share with iterm
set -ga terminal-overrides &#39;,xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007&#39;
set -ga terminal-overrides &#39;,screen*:XT:Ms=\E]52;%p1%s;%p2%s\007&#39;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;The clipboard querying/clearing functionality offered by OSC 52 is not implemented here, And for security reason, this feature is disabled by default.&lt;/p&gt; 
&lt;p&gt;This feature needs the new way of handling strings with a struct &lt;code&gt;VTermStringFragment&lt;/code&gt; in &lt;code&gt;libvterm&lt;/code&gt;. You&#39;d better compile &lt;code&gt;emacs-libvterm&lt;/code&gt; with &lt;code&gt;cmake -DUSE_SYSTEM_LIBVTERM=no ..&lt;/code&gt;. If you don&#39;t do that, when the content you want to copy is too long, it would be truncated by a bug in &lt;code&gt;libvterm&lt;/code&gt;.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-buffer-name-string&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;When &lt;code&gt;vterm-buffer-name-string&lt;/code&gt; is not nil, vterm renames automatically its own buffers with &lt;code&gt;vterm-buffer-name-string&lt;/code&gt;. This string can contain the character &lt;code&gt;%s&lt;/code&gt;, which is substituted with the &lt;em&gt;title&lt;/em&gt; (as defined by the shell, see below). A possible value for &lt;code&gt;vterm-buffer-name-string&lt;/code&gt; is &lt;code&gt;vterm %s&lt;/code&gt;, according to which all the vterm buffers will be named &quot;vterm TITLE&quot;.&lt;/p&gt; 
&lt;p&gt;This requires some shell-side configuration to print the title. For example to set the name &quot;HOSTNAME:PWD&quot;, you can use the following:&lt;/p&gt; 
&lt;p&gt;For &lt;code&gt;zsh&lt;/code&gt;,&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-zsh&quot;&gt;autoload -U add-zsh-hook
add-zsh-hook -Uz chpwd (){ print -Pn &quot;\e]2;%m:%2~\a&quot; }
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;For &lt;code&gt;bash&lt;/code&gt;,&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;PROMPT_COMMAND=&quot;${PROMPT_COMMAND:+$PROMPT_COMMAND; }&quot;&#39;echo -ne &quot;\033]0;${HOSTNAME}:${PWD}\007&quot;&#39;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;For &lt;code&gt;fish&lt;/code&gt;,&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-fish&quot;&gt;function fish_title
    hostname
    echo &quot;:&quot;
    prompt_pwd
end
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;See &lt;a href=&quot;http://tldp.org/HOWTO/Xterm-Title-4.html&quot;&gt;zsh and bash&lt;/a&gt; and &lt;a href=&quot;https://fishshell.com/docs/current/#programmable-title&quot;&gt;fish documentations&lt;/a&gt;.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-always-compile-module&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;Vterm needs &lt;code&gt;vterm-module&lt;/code&gt; to work. This can be compiled externally, or &lt;code&gt;vterm&lt;/code&gt; will ask the user whether to build the module when &lt;code&gt;vterm&lt;/code&gt; is first called. To avoid this question and always compile the module, set &lt;code&gt;vterm-always-compile-module&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-copy-mode-remove-fake-newlines&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;When not-nil fake newlines are removed on entering copy mode. vterm inserts fake-newlines purely for rendering. When using &lt;code&gt;vterm-copy-mode&lt;/code&gt; these are in conflict with many emacs functions like &lt;code&gt;isearch-forward&lt;/code&gt;. if this variable is not-nil the fake-newlines are removed on entering copy-mode and re-inserted on leaving copy mode. Also &lt;code&gt;truncate-lines&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt; on entering copy-mode and set to &lt;code&gt;nil&lt;/code&gt; on leaving.&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;vterm-tramp-shells&lt;/code&gt;&lt;/h2&gt; 
&lt;p&gt;The shell that gets run in the vterm for tramp.&lt;/p&gt; 
&lt;p&gt;This has to be a list of pairs of the format: &lt;code&gt;(TRAMP-METHOD SHELL)&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;The &lt;code&gt;TRAMP-METHOD&lt;/code&gt; is a method string as used by tramp (e.g., &lt;code&gt;&quot;ssh&quot;&lt;/code&gt;). Use &lt;code&gt;t&lt;/code&gt; as &lt;code&gt;TRAMP-METHOD&lt;/code&gt; to specify a default shell for all methods. Specific methods always take precedence over &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Set &lt;code&gt;SHELL&lt;/code&gt; to &lt;code&gt;&#39;login-shell&lt;/code&gt; to use the user&#39;s login shell on the remote host. The login-shell detection currently works for POSIX-compliant remote hosts that have the &lt;code&gt;getent&lt;/code&gt; command (regular GNU/Linux distros, *BSDs, but not MacOS X unfortunately). You can specify an additional second &lt;code&gt;SHELL&lt;/code&gt; command as a fallback that is used when the login-shell detection fails, e.g., &lt;code&gt;&#39;((&quot;ssh&quot; login-shell &quot;/bin/bash&quot;) ...)&lt;/code&gt; If no second &lt;code&gt;SHELL&lt;/code&gt; command is specified with &lt;code&gt;&#39;login-shell&lt;/code&gt;, vterm will fall back to tramp&#39;s shell.&lt;/p&gt; 
&lt;p&gt;Examples:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Use the default login shell for all methods, except for docker. &lt;code&gt;&#39;((t login-shell) (&quot;docker&quot; &quot;/bin/sh&quot;))&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;Use the default login shell for ssh and scp, fall back to &quot;/bin/bash&quot;. Use tramp&#39;s default shell for all other methods. &lt;code&gt;&#39;((&quot;ssh&quot; login-shell &quot;/bin/bash&quot;) (&quot;scp&quot; login-shell &quot;/bin/bash&quot;))&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;Keybindings&lt;/h2&gt; 
&lt;p&gt;If you want a key to be sent to the terminal, bind it to &lt;code&gt;vterm--self-insert&lt;/code&gt;, or remove it from &lt;code&gt;vterm-mode-map&lt;/code&gt;. By default, &lt;code&gt;vterm.el&lt;/code&gt; binds most of the &lt;code&gt;C-&amp;lt;char&amp;gt;&lt;/code&gt; and &lt;code&gt;M-&amp;lt;char&amp;gt;&lt;/code&gt; keys, &lt;code&gt;&amp;lt;f1&amp;gt;&lt;/code&gt; through &lt;code&gt;&amp;lt;f12&amp;gt;&lt;/code&gt; and some special keys like &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt;. Sending a keyboard interrupt is bound to &lt;code&gt;C-c C-c&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;In order to send a keypress that is already recognized by Emacs, such as &lt;code&gt;C-g&lt;/code&gt;, use the interactive function &lt;code&gt;vterm-send-next-key&lt;/code&gt;. This can be bound to a key in the &lt;code&gt;vterm-mode-map&lt;/code&gt; like &lt;code&gt;C-q&lt;/code&gt;, in which case pressing &lt;code&gt;C-q C-g&lt;/code&gt; will send a &lt;code&gt;C-g&lt;/code&gt; key to the terminal, and so on for other modified keys:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(define-key vterm-mode-map (kbd &quot;C-q&quot;) #&#39;vterm-send-next-key)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This can be useful for controlling an application running in the terminal, such as Emacs or Nano.&lt;/p&gt; 
&lt;h2&gt;Fonts&lt;/h2&gt; 
&lt;p&gt;You can change the font (the &lt;em&gt;face&lt;/em&gt;) used in a vterm with the following code:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(add-hook &#39;vterm-mode-hook
          (lambda ()
            (set (make-local-variable &#39;buffer-face-mode-face) &#39;fixed-pitch)
                 (buffer-face-mode t)))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Where instead of &lt;code&gt;&#39;fixed-pitch&lt;/code&gt; you specify the face you want to use. The example reported here can be used to force vterm to use a mono-spaced font (the &lt;code&gt;fixed-pitch&lt;/code&gt; face). This is useful when your default font in Emacs is a proportional font.&lt;/p&gt; 
&lt;p&gt;In addition to that, you can disable some text properties (bold, underline, reverse video) setting the relative option to &lt;code&gt;t&lt;/code&gt; (&lt;code&gt;vterm-disable-bold&lt;/code&gt;, &lt;code&gt;vterm-disable-underline&lt;/code&gt;, or &lt;code&gt;vterm-disable-inverse-video&lt;/code&gt;).&lt;/p&gt; 
&lt;p&gt;You can use another font for vterm buffer&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(add-hook &#39;vterm-mode-hook
          (lambda ()
               (set (make-local-variable &#39;buffer-face-mode-face) &#39;(:family &quot;IosevkaTerm Nerd Font&quot;))
               (buffer-face-mode t))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Blink cursor&lt;/h2&gt; 
&lt;p&gt;When &lt;code&gt;vterm-ignore-blink-cursor&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;, vterm will ignore request from application to turn on or off cursor blink.&lt;/p&gt; 
&lt;p&gt;If &lt;code&gt;nil&lt;/code&gt;, cursor in any window may begin to blink or not blink because &lt;code&gt;blink-cursor-mode&lt;/code&gt; is a global minor mode in Emacs, you can use &lt;code&gt;M-x blink-cursor-mode&lt;/code&gt; to toggle.&lt;/p&gt; 
&lt;h2&gt;Colors&lt;/h2&gt; 
&lt;p&gt;Customize the following faces to your liking. It is possible to specify different colors for foreground and background via the &lt;code&gt;:foreground&lt;/code&gt; and &lt;code&gt;:background&lt;/code&gt; attributes.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;vterm-color-black&lt;/li&gt; 
 &lt;li&gt;vterm-color-red&lt;/li&gt; 
 &lt;li&gt;vterm-color-green&lt;/li&gt; 
 &lt;li&gt;vterm-color-yellow&lt;/li&gt; 
 &lt;li&gt;vterm-color-blue&lt;/li&gt; 
 &lt;li&gt;vterm-color-magenta&lt;/li&gt; 
 &lt;li&gt;vterm-color-cyan&lt;/li&gt; 
 &lt;li&gt;vterm-color-white&lt;/li&gt; 
 &lt;li&gt;vterm-color-bright-black&lt;/li&gt; 
 &lt;li&gt;vterm-color-bright-red&lt;/li&gt; 
 &lt;li&gt;vterm-color-bright-green&lt;/li&gt; 
 &lt;li&gt;vterm-color-bright-yellow&lt;/li&gt; 
 &lt;li&gt;vterm-color-bright-blue&lt;/li&gt; 
 &lt;li&gt;vterm-color-bright-magenta&lt;/li&gt; 
 &lt;li&gt;vterm-color-bright-cyan&lt;/li&gt; 
 &lt;li&gt;vterm-color-bright-white&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;Directory tracking and Prompt tracking&lt;/h2&gt; 
&lt;p&gt;&lt;code&gt;vterm&lt;/code&gt; supports &lt;em&gt;directory tracking&lt;/em&gt;. If this feature is enabled, the default directory in Emacs and the current working directory in &lt;code&gt;vterm&lt;/code&gt; are synced. As a result, interactive functions that ask for a path or a file (e.g., &lt;code&gt;dired&lt;/code&gt; or &lt;code&gt;find-file&lt;/code&gt;) will do so starting from the current location.&lt;/p&gt; 
&lt;p&gt;And &lt;code&gt;vterm&lt;/code&gt; supports &lt;em&gt;prompt tracking&lt;/em&gt;. If this feature is enabled, Emacs knows where the prompt ends, you needn&#39;t customize &lt;code&gt;term-prompt-regexp&lt;/code&gt; any more. Then you can use &lt;code&gt;vterm-next-prompt&lt;/code&gt; and &lt;code&gt;vterm-previous-prompt&lt;/code&gt; moving to end of next/previous prompt. The default keybinding is &lt;code&gt;C-c C-n&lt;/code&gt; and &lt;code&gt;C-c C-p&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;And &lt;code&gt;vterm-beginning-of-line&lt;/code&gt; would move the point to the first character after the shell prompt on this line. If the point is already there, move to the beginning of the line. The default keybinding is &lt;code&gt;C-a&lt;/code&gt; in &lt;code&gt;vterm-copy-mode&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;And &lt;code&gt;vterm--at-prompt-p&lt;/code&gt; would check whether the cursor is at the point just after the shell prompt.&lt;/p&gt; 
&lt;p&gt;Directory tracking and Prompt tracking requires some configuration, as the shell has to be instructed to share the relevant information with Emacs. The following pieces of code assume that you have the function &lt;code&gt;vterm_printf&lt;/code&gt; as defined in section &lt;a href=&quot;https://raw.githubusercontent.com/akermu/emacs-libvterm/master/#shell-side-configuration&quot;&gt;shell-side configuration&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;For &lt;code&gt;zsh&lt;/code&gt;, put this at the end of your &lt;code&gt;.zshrc&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-zsh&quot;&gt;vterm_prompt_end() {
    vterm_printf &quot;51;A$(whoami)@$(hostname):$(pwd)&quot;
}
setopt PROMPT_SUBST
PROMPT=$PROMPT&#39;%{$(vterm_prompt_end)%}&#39;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;For &lt;code&gt;bash&lt;/code&gt;, put this at the end of your &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;vterm_prompt_end(){
    vterm_printf &quot;51;A$(whoami)@$(hostname):$(pwd)&quot;
}
PS1=$PS1&#39;\[$(vterm_prompt_end)\]&#39;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;For &lt;code&gt;fish&lt;/code&gt;, put this in your &lt;code&gt;~/.config/fish/config.fish&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-fish&quot;&gt;function vterm_prompt_end;
    vterm_printf &#39;51;A&#39;(whoami)&#39;@&#39;(hostname)&#39;:&#39;(pwd)
end
functions --copy fish_prompt vterm_old_fish_prompt
function fish_prompt --description &#39;Write out the prompt; do not replace this. Instead, put this at end of your file.&#39;
    # Remove the trailing newline from the original prompt. This is done
    # using the string builtin from fish, but to make sure any escape codes
    # are correctly interpreted, use %b for printf.
    printf &quot;%b&quot; (string join &quot;\n&quot; (vterm_old_fish_prompt))
    vterm_prompt_end
end
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Here we are using the function &lt;code&gt;vterm_printf&lt;/code&gt; that we have discussed above, so make sure that this function is defined in your configuration file.&lt;/p&gt; 
&lt;p&gt;Directory tracking works on remote servers too. In case the hostname of your remote machine does not match the actual hostname needed to connect to that server, change &lt;code&gt;$(hostname)&lt;/code&gt; with the correct one. For example, if the correct hostname is &lt;code&gt;foo&lt;/code&gt; and the username is &lt;code&gt;bar&lt;/code&gt;, you should have something like&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;HOSTNAME=foo
USER=baz
vterm_printf &quot;51;A$USER@$HOSTNAME:$(pwd)&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Message passing&lt;/h2&gt; 
&lt;p&gt;&lt;code&gt;vterm&lt;/code&gt; can read and execute commands. At the moment, a command is passed by providing a specific escape sequence. For example, to evaluate&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(message &quot;Hello!&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;use&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;printf &quot;\e]51;Emessage \&quot;Hello\!\&quot;\e\\&quot;
# or
vterm_printf &quot;51;Emessage \&quot;Hello\!\&quot;&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;The commands that are understood are defined in the setting &lt;code&gt;vterm-eval-cmds&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;As &lt;code&gt;split-string-and-unquote&lt;/code&gt; is used the parse the passed string, double quotes and backslashes need to be escaped via backslash. A convenient shell function to automate the substitution is&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;bash&lt;/code&gt; or &lt;code&gt;zsh&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;vterm_cmd() {
    local vterm_elisp
    vterm_elisp=&quot;&quot;
    while [ $# -gt 0 ]; do
        vterm_elisp=&quot;$vterm_elisp&quot;&quot;$(printf &#39;&quot;%s&quot; &#39; &quot;$(printf &quot;%s&quot; &quot;$1&quot; | sed -e &#39;s|\\|\\\\|g&#39; -e &#39;s|&quot;|\\&quot;|g&#39;)&quot;)&quot;
        shift
    done
    vterm_printf &quot;51;E$vterm_elisp&quot;
}
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;code&gt;fish&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-fish&quot;&gt;function vterm_cmd --description &#39;Run an Emacs command among the ones been defined in vterm-eval-cmds.&#39;
    set -l vterm_elisp ()
    for arg in $argv
        set -a vterm_elisp (printf &#39;&quot;%s&quot; &#39; (string replace -a -r &#39;([\\\\&quot;])&#39; &#39;\\\\\\\\$1&#39; $arg))
    end
    vterm_printf &#39;51;E&#39;(string join &#39;&#39; $vterm_elisp)
end
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Now we can write shell functions to call the ones defined in &lt;code&gt;vterm-eval-cmds&lt;/code&gt;.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;find_file() {
    vterm_cmd find-file &quot;$(realpath &quot;${@:-.}&quot;)&quot;
}

say() {
    vterm_cmd message &quot;%s&quot; &quot;$*&quot;
}
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Or for &lt;code&gt;fish&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-fish&quot;&gt;function find_file
    set -q argv[1]; or set argv[1] &quot;.&quot;
    vterm_cmd find-file (realpath &quot;$argv&quot;)
end

function say
    vterm_cmd message &quot;%s&quot; &quot;$argv&quot;
end
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This newly defined &lt;code&gt;find_file&lt;/code&gt; function can now be used inside &lt;code&gt;vterm&lt;/code&gt; as&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;find_file name_of_file_in_local_directory
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;If you call &lt;code&gt;find_file&lt;/code&gt; without specifying any file (you just execute &lt;code&gt;find_file&lt;/code&gt; in your shell), &lt;code&gt;dired&lt;/code&gt; will open with the current directory.&lt;/p&gt; 
&lt;p&gt;As an example, say you like having files opened below the current window. You could add the command to do it on the lisp side like so:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(push (list &quot;find-file-below&quot;
            (lambda (path)
              (if-let* ((buf (find-file-noselect path))
                        (window (display-buffer-below-selected buf nil)))
                  (select-window window)
                (message &quot;Failed to open file: %s&quot; path))))
      vterm-eval-cmds)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Then add the command in your &lt;code&gt;.bashrc&lt;/code&gt; file.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;open_file_below() {
    vterm_cmd find-file-below &quot;$(realpath &quot;${@:-.}&quot;)&quot;
}
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Then you can open any file from inside your shell.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;open_file_below ~/Documents
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Shell-side configuration files&lt;/h2&gt; 
&lt;p&gt;The configurations described in earlier sections are combined in &lt;a href=&quot;https://raw.githubusercontent.com/akermu/emacs-libvterm/master/etc/&quot;&gt;&lt;code&gt;etc/&lt;/code&gt;&lt;/a&gt;. These can be appended to or loaded into your user configuration file. Alternatively, they can be installed system-wide, for example in &lt;code&gt;/etc/bash/bashrc.d/&lt;/code&gt;, &lt;code&gt;/etc/profile.d/&lt;/code&gt; (for &lt;code&gt;zsh&lt;/code&gt;), or &lt;code&gt;/etc/fish/conf.d/&lt;/code&gt; for &lt;code&gt;fish&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;When using vterm Emacs sets the environment variable INSIDE_EMACS in the subshell to ‘vterm’. Usually the programs check this variable to determine whether they are running inside Emacs.&lt;/p&gt; 
&lt;p&gt;Vterm also sets an extra variable EMACS_VTERM_PATH to the place where the vterm library is installed. This is very useful because when vterm is installed from melpa the Shell-side configuration files are in the EMACS_VTERM_PATH inside the /etc sub-directory. After a package update, the directory name changes, so, a code like this in your bashrc could be enough to load always the latest version of the file from the right location without coping any file manually.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;if [[ &quot;$INSIDE_EMACS&quot; = &#39;vterm&#39; ]] \
    &amp;amp;&amp;amp; [[ -n ${EMACS_VTERM_PATH} ]] \
    &amp;amp;&amp;amp; [[ -f ${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh ]]; then
	source ${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh
fi
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Frequently Asked Questions and Problems&lt;/h2&gt; 
&lt;h3&gt;How can I increase the size of the scrollback?&lt;/h3&gt; 
&lt;p&gt;By default, the scrollback can contain up to 1000 lines per each vterm buffer. You can increase this up to 100000 by changing the variable &lt;code&gt;vterm-max-scrollback&lt;/code&gt;. If you want to increase it further, you have to edit the file &lt;code&gt;vterm-module.h&lt;/code&gt;, change the variable &lt;code&gt;SB_MAX&lt;/code&gt;, and set the new value for &lt;code&gt;vterm-max-scrollback&lt;/code&gt;. The potential maximum memory consumption of vterm buffers increases with &lt;code&gt;vterm-max-scrollback&lt;/code&gt;, so setting &lt;code&gt;SB_MAX&lt;/code&gt; to extreme values may lead to system instabilities and crashes.&lt;/p&gt; 
&lt;h3&gt;How can I automatically close vterm buffers when the process is terminated?&lt;/h3&gt; 
&lt;p&gt;There is an option for that: set &lt;code&gt;vterm-kill-buffer-on-exit&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt; 
&lt;h3&gt;The package does not compile, I have errors related to &lt;code&gt;VTERM_COLOR&lt;/code&gt;.&lt;/h3&gt; 
&lt;p&gt;The version of &lt;code&gt;libvterm&lt;/code&gt; installed on your system is too old. You should let &lt;code&gt;emacs-libvterm&lt;/code&gt; download &lt;code&gt;libvterm&lt;/code&gt; for you. You can either uninstall your &lt;code&gt;libvterm&lt;/code&gt;, or instruct Emacs to ignore the system &lt;code&gt;libvterm&lt;/code&gt;. If you are compiling from Emacs, you can do this by setting:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(setq vterm-module-cmake-args &quot;-DUSE_SYSTEM_LIBVTERM=no&quot;)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;and compile again. If you are compiling with CMake, use the flag &lt;code&gt;-DUSE_SYSTEM_LIBVTERM=no&lt;/code&gt;.&lt;/p&gt; 
&lt;h3&gt;&lt;code&gt;&amp;lt;C-backspace&amp;gt;&lt;/code&gt; doesn&#39;t kill previous word.&lt;/h3&gt; 
&lt;p&gt;This can be fixed by rebinding the key to what &lt;code&gt;C-w&lt;/code&gt; does:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(define-key vterm-mode-map (kbd &quot;&amp;lt;C-backspace&amp;gt;&quot;)
    (lambda () (interactive) (vterm-send-key (kbd &quot;C-w&quot;))))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h3&gt;&lt;code&gt;counsel-yank-pop&lt;/code&gt; doesn&#39;t work.&lt;/h3&gt; 
&lt;p&gt;Add this piece of code to your configuration file to make &lt;code&gt;counsel&lt;/code&gt; use the correct function to yank in vterm buffers.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(defun vterm-counsel-yank-pop-action (orig-fun &amp;amp;rest args)
  (if (equal major-mode &#39;vterm-mode)
      (let ((inhibit-read-only t)
            (yank-undo-function (lambda (_start _end) (vterm-undo))))
        (cl-letf (((symbol-function &#39;insert-for-yank)
               (lambda (str) (vterm-send-string str t))))
            (apply orig-fun args)))
    (apply orig-fun args)))

(advice-add &#39;counsel-yank-pop-action :around #&#39;vterm-counsel-yank-pop-action)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h3&gt;How can I get the local directory without shell-side configuration?&lt;/h3&gt; 
&lt;p&gt;We recommend that you set up shell-side configuration for reliable directory tracking. If you cannot do it, a possible workaround is the following.&lt;/p&gt; 
&lt;p&gt;On most GNU/Linux systems, you can read current directory from &lt;code&gt;/proc&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(defun vterm-directory-sync ()
  &quot;Synchronize current working directory.&quot;
  (interactive)
  (when vterm--process
    (let* ((pid (process-id vterm--process))
           (dir (file-truename (format &quot;/proc/%d/cwd/&quot; pid))))
      (setq default-directory dir))))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;A possible application of this function is in combination with &lt;code&gt;find-file&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(advice-add #&#39;find-file :before #&#39;vterm-directory-sync)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This method does not work on remote machines.&lt;/p&gt; 
&lt;h3&gt;How can I get the directory tracking in a more understandable way?&lt;/h3&gt; 
&lt;p&gt;If you looked at the recommended way to set-up directory tracking, you will have noticed that it requires printing obscure code like &lt;code&gt;\e]2;%m:%2~\a&lt;/code&gt; (unless you are using &lt;code&gt;fish&lt;/code&gt;).&lt;/p&gt; 
&lt;p&gt;There is another way to achieve this behavior. Define a shell function, on a local host you can simply use&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;vterm_set_directory() {
    vterm_cmd update-pwd &quot;$PWD/&quot;
}
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;On a remote one, use instead&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;vterm_set_directory() {
    vterm_cmd update-pwd &quot;/-:&quot;&quot;$USER&quot;&quot;@&quot;&quot;$HOSTNAME&quot;&quot;:&quot;&quot;$PWD/&quot;
}
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Then, for &lt;code&gt;zsh&lt;/code&gt;, add this function to the &lt;code&gt;chpwd&lt;/code&gt; hook:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-zsh&quot;&gt;autoload -U add-zsh-hook
add-zsh-hook -Uz chpwd (){ vterm_set_directory }
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;For &lt;code&gt;bash&lt;/code&gt;, append it to the prompt:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;PROMPT_COMMAND=&quot;${PROMPT_COMMAND:+$PROMPT_COMMAND; }vterm_set_directory&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Finally, add &lt;code&gt;update-pwd&lt;/code&gt; to the list of commands that Emacs is allowed to execute from vterm:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(add-to-list &#39;vterm-eval-cmds &#39;(&quot;update-pwd&quot; (lambda (path) (setq default-directory path))))
&lt;/code&gt;&lt;/pre&gt; 
&lt;h3&gt;When evil-mode is enabled, the cursor moves back in normal state, and this messes directory tracking&lt;/h3&gt; 
&lt;p&gt;&lt;code&gt;evil-collection&lt;/code&gt; provides a solution for this problem. If you do not want to use &lt;code&gt;evil-collection&lt;/code&gt;, you can add the following code:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(defun evil-collection-vterm-escape-stay ()
&quot;Go back to normal state but don&#39;t move
cursor backwards. Moving cursor backwards is the default vim behavior but it is
not appropriate in some cases like terminals.&quot;
(setq-local evil-move-cursor-back nil))

(add-hook &#39;vterm-mode-hook #&#39;evil-collection-vterm-escape-stay)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Related packages&lt;/h2&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/jixiuf/vterm-toggle&quot;&gt;vterm-toggle&lt;/a&gt;: Toggles between a vterm and the current buffer&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;https://github.com/suonlight/multi-libvterm&quot;&gt;multi-libvterm&lt;/a&gt;: Multiterm for emacs-libvterm&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h2&gt;Appendix&lt;/h2&gt; 
&lt;h3&gt;Breaking changes&lt;/h3&gt; 
&lt;p&gt;Obsolete variables will be removed in version 0.1.&lt;/p&gt; 
&lt;h4&gt;August 2022&lt;/h4&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;vterm-send-C-[a-z]&lt;/code&gt; &lt;code&gt;vterm-send-M-[a-z]&lt;/code&gt; &lt;code&gt;vterm-define-key&lt;/code&gt; &lt;code&gt;vterm-send-{up/down/left/right/prior/next/meta-dot/meta-comma/ctrl-slash}&lt;/code&gt; were obsolete, please use &lt;code&gt;vterm-send&lt;/code&gt; or &lt;code&gt;vterm-send-key&lt;/code&gt; or &lt;code&gt;vterm--self-insert&lt;/code&gt; instead.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h4&gt;October 2020&lt;/h4&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;vterm-disable-bold-font&lt;/code&gt; was renamed to &lt;code&gt;vterm-disable-bold&lt;/code&gt; to uniform it with the other similar options.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h4&gt;July 2020&lt;/h4&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;vterm-use-vterm-prompt&lt;/code&gt; was renamed to &lt;code&gt;vterm-use-vterm-prompt-detection-method&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;vterm-kill-buffer-on-exit&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt; by default.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h4&gt;April 2020&lt;/h4&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;vterm-clear-scrollback&lt;/code&gt; was renamed to &lt;code&gt;vterm-clear-scrollback-when-clearning&lt;/code&gt;.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;vterm-set-title-functions&lt;/code&gt; was removed. In its place, there is a new custom option &lt;code&gt;vterm-buffer-name-string&lt;/code&gt;. See &lt;a href=&quot;https://raw.githubusercontent.com/akermu/emacs-libvterm/master/vterm-buffer-name-string&quot;&gt;vterm-buffer-name-string&lt;/a&gt; for documentation.&lt;/li&gt; 
&lt;/ul&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/de06296c9221b384ae00df9f7ce91178f21b04452e5259f63f809d8eb685eb26/akermu/emacs-libvterm" medium="image" />
      
    </item>
    
    <item>
      <title>renzmann/treesit-auto</title>
      <link>https://github.com/renzmann/treesit-auto</link>
      <description>&lt;p&gt;Automatic installation, usage, and fallback for tree-sitter major modes in Emacs 29&lt;/p&gt;&lt;hr&gt;&lt;p&gt;#+TITLE: treesit-auto #+AUTHOR: Robb Enzmann&lt;/p&gt; 
&lt;p&gt;#+html: &lt;a href=&quot;https://www.gnu.org/software/emacs/&quot;&gt;&lt;img alt=&quot;GNU Emacs&quot; src=&quot;https://github.com/minad/corfu/raw/screenshots/emacs.svg?raw=true&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://melpa.org/#/treesit-auto&quot;&gt;&lt;img alt=&quot;Melpa&quot; src=&quot;https://melpa.org/packages/treesit-auto-badge.svg?raw=true&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://stable.melpa.org/#/treesit-auto&quot;&gt;&lt;img alt=&quot;Melpa&quot; src=&quot;https://stable.melpa.org/packages/treesit-auto-badge.svg?raw=true&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;Automatically install and use tree-sitter major modes in Emacs 29+. If the tree-sitter version can&#39;t be used, fall back to the original major mode.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Features Each of these behaviors are configurable and documented under the &quot;Configuration&quot; section. By activating =global-treesit-auto-mode=, Emacs will:&lt;/li&gt; 
&lt;/ul&gt; 
&lt;ul&gt; 
 &lt;li&gt;Automatically switch to =
  &lt;name&gt;
   -ts-mode= when the grammar for =
   &lt;name&gt;
    = is installed
   &lt;/name&gt;
  &lt;/name&gt;&lt;/li&gt; 
 &lt;li&gt;Stick with =
  &lt;name&gt;
   -mode= if the grammar isn&#39;t installed
  &lt;/name&gt;&lt;/li&gt; 
 &lt;li&gt;Automatically install a grammar before opening a compatible file&lt;/li&gt; 
 &lt;li&gt;Modify =auto-mode-alist= for tree-sitter modes&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;There is also a convenience function =M-x treesit-auto-install-all=, which will install all (or a selected subset) of the maintained and compatible grammars. You can add these grammars to your =auto-mode-alist= automatically by invoking the =treesit-auto-add-to-auto-mode-alist= function in your configuration.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Installation ~treesit-auto~ is available from [[&lt;a href=&quot;https://melpa.org/&quot;&gt;https://melpa.org/&lt;/a&gt;][MELPA]]. After following [[&lt;a href=&quot;https://melpa.org/#/getting-started&quot;&gt;https://melpa.org/#/getting-started&lt;/a&gt;][their setup]], you can use your preferred package manager. If that&#39;s the default =package.el=, simply =M-x package-refresh-contents= and then&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;#+begin_example M-x package-install RET treesit-auto #+end_example&lt;/p&gt; 
&lt;p&gt;If you want a local clone of the repository, rather than just a copy of the source, you might instead use =package-vc-install=&lt;/p&gt; 
&lt;p&gt;#+begin_src example M-x package-vc-install RET &lt;a href=&quot;https://github.com/renzmann/treesit-auto.git&quot;&gt;https://github.com/renzmann/treesit-auto.git&lt;/a&gt; #+end_src&lt;/p&gt; 
&lt;p&gt;Then, in your Emacs configuration file (=~/.emacs.d/init.el=),&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (use-package treesit-auto :config (global-treesit-auto-mode)) #+end_src&lt;/p&gt; 
&lt;p&gt;For most users, this will be enough. There are some nifty things you might want to enable, though, which are covered in the &quot;Configuration&quot; section below.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Configuration example This is how I configure =treesit-auto= for my own personal use.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;#+begin_src emacs-lisp (use-package treesit-auto :custom (treesit-auto-install &#39;prompt) :config (treesit-auto-add-to-auto-mode-alist &#39;all) (global-treesit-auto-mode)) #+end_src&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;What this package does Emacs 29, while featuring =treesit.el= and a convenient =treesit-install-language-grammar=, [[&lt;a href=&quot;https://archive.casouri.cc/note/2023/tree-sitter-in-emacs-29/index.html&quot;&gt;https://archive.casouri.cc/note/2023/tree-sitter-in-emacs-29/index.html&lt;/a&gt;][will not feature an intelligent way to choose]] between a default mode, such as =python-mode=, and its tree-sitter enhanced version, =python-ts-mode=. This package attempts to remedy that by adjusting the =major-mode-remap-alist= and =treesit-language-source-alist= variables in order to get the following behavior:&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;em&gt;1. If the grammar is installed, then switch to the appropriate tree-sitter mode:&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;In this case, assuming we open a Python buffer, and the [[&lt;a href=&quot;https://github.com/tree-sitter/tree-sitter-python&quot;&gt;https://github.com/tree-sitter/tree-sitter-python&lt;/a&gt;][Python tree-sitter grammar]] is installed, then Emacs will use =python-ts-mode= instead of =python-mode=.&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;2. The grammar is NOT installed and treesit-auto-install is non-nil:&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;When the grammar is not installed and ~treesit-auto-install~ is t, then upon activating any major mode that has a corresponding tree-sitter mode, the grammar will be downloaded and compiled using ~treesit-install-language-grammar~. Emacs will then activate the tree-sitter major mode for that buffer.&lt;/p&gt; 
&lt;p&gt;~prompt~ is like t, except a message will be displayed in the echo area asking for a yes/no response before attempting the installation.&lt;/p&gt; 
&lt;p&gt;As an example for both cases: if I visit a Python file and didn&#39;t already have the grammar installed, I wind up with an installed grammar and a buffer using ~python-ts-mode~.&lt;/p&gt; 
&lt;p&gt;Otherwise, when ~treesit-auto-install~ is nil, it will try to fall back to another major mode as described in the following two rules.&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;3. If the grammar is NOT installed, and a fallback is specified&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;Most languages will have a fallback mode specified, such as =python-ts-mode= falling back to =python-mode=, if the grammar is not installed. If you ever need to double-check what that fallback will be, you can double check what&#39;s in the recipe for that language like this:&lt;/p&gt; 
&lt;p&gt;#+begin_example (treesit-auto-recipe-remap (alist-get &#39;python treesit-auto-lang-recipe-alist)) ⇒ python-mode #+end_example&lt;/p&gt; 
&lt;p&gt;See &quot;Configuration/Configuring behavior for a specific language&quot; in case you would like to specify different fallback modes than the default.&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;4. The grammar is installed, but there is no fallback mode&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;You can optionally use the =treesit-auto-add-to-auto-mode-alist= function to ensure that your installed tree-sitter languages have their corresponding =...-ts-mode= added to =auto-mode-alist=, so that Emacs opens the buffer in that =...-ts-mode=, rather than the default =Fundamental= mode.&lt;/p&gt; 
&lt;p&gt;Supposing for instance we don&#39;t have =typescript-mode= installed, then even if we /do/ have =typescript-ts-mode= installed along with the typescript grammar compiled in =~/.emacs.d/tree-sitter/=, Emacs still won&#39;t use =typescript-ts-mode= unless you also added =&#39;(&quot;\.ts\&#39;&quot; . typescript-ts-mode)= to =auto-mode-alist=. By calling =(treesit-auto-add-to-auto-mode-alist)= in your configuration, this modification to =auto-mode-alist= is done automatically for you.&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;5. All other cases...&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;This is the most general case, where the grammar is not installed, ~treesit-auto-install~ is nil, and no fallback mode is specified in the language recipe present on =treesit-auto-recipe-list=. In this case, we still gain the benefit of quickly installing grammars through =treesit-install-language-grammar= without having the build the recipe interactively, but =treesit-auto= will make no attempt to switch away from the tree-sitter mode.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Configuration If you have modified =treesit-language-source-alist= through =setq=, then it is recommended to put any configuration of this package AFTER that =setq=.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;** Choose which languages =treesit-auto= should consider&lt;/p&gt; 
&lt;p&gt;You can globally alter the behavior of =treesit-auto= to only consider a specific set of languages by setting the =treesit-auto-langs= list to a set of language symbols. By default, this list includes every possible language that =treesit-auto= supports, so you can use =M-x describe-variable RET treesit-auto-langs= to see what the options are.&lt;/p&gt; 
&lt;p&gt;One way to use this variable is to just set it manually:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq treesit-auto-langs &#39;(python rust go)) #+end_src&lt;/p&gt; 
&lt;p&gt;Now, =treesit-auto= features will only ever affect Python, Rust, and Go files. Running =treesit-auto-install-all= will only install these three grammars, and no automatic prompting/installation will occur when visiting a buffer that is not one of these three, either.&lt;/p&gt; 
&lt;p&gt;Another method is to disable specific languages by just removing them from this list:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (delete &#39;awk treesit-auto-langs) #+end_src&lt;/p&gt; 
&lt;p&gt;Here, =treesit-auto= behaves as it normally would for all languages /except/ AWK.&lt;/p&gt; 
&lt;p&gt;** Automatically install grammars if they are missing The =treesit-auto-install= variable controls whether a grammar should be installed automatically when activating a major mode compatible with tree-sitter.&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;=nil=, the default, means =treesit-auto= won&#39;t try to install anything, and will rely on the fallback logic outlined above&lt;/li&gt; 
 &lt;li&gt;=t= means =treesit-auto= should always try to clone and install a grammar when missing&lt;/li&gt; 
 &lt;li&gt;~prompt~ will cause a yes/no prompt to appear in the minibuffer before attempting installation&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq treesit-auto-install &#39;prompt) #+end_src&lt;/p&gt; 
&lt;p&gt;Then, supposing I don&#39;t have =libtree-sitter-python.so= (or its mac/Windows equivalent) under =~/.emacs.d/tree-sitter= (or anywhere else in =treesit-extra-load-path=), visiting a Python file or calling =M-x python-ts-mode= will generate this prompt:&lt;/p&gt; 
&lt;p&gt;#+begin_example Tree-sitter grammar for python is missing. Would you like to install it from &lt;a href=&quot;https://github.com/tree-sitter/tree-sitter-python&quot;&gt;https://github.com/tree-sitter/tree-sitter-python&lt;/a&gt;? (y or n) #+end_example&lt;/p&gt; 
&lt;p&gt;Responding with &quot;yes&quot; will use =treesit-install-language-grammar= to go fetch and compile the missing grammar.&lt;/p&gt; 
&lt;p&gt;The other function that respects this variable is =treesit-auto-install-all=. When =treesit-auto-install= is t, using =M-x treesit-auto-install-all= will skip all prompts. Otherwise, it will ask before attempting the installation.&lt;/p&gt; 
&lt;p&gt;** Configuring behavior for a specific language The variable =treesit-auto-recipe-list= keeps track of all the language &quot;recipes.&quot; These control how =treesit-auto= decides which modes to upgrade/downgrade to/from, where the source code of the language grammar is hosted, and which C/C++ compiler to use. Each recipe can take these arguments:&lt;/p&gt; 
&lt;p&gt;#+begin_example :lang :ts-mode :remap :url :revision :abi14-revision :requires :source-dir :cc :c++ #+end_example&lt;/p&gt; 
&lt;p&gt;To create a recipe, use =make-treesit-auto-recipe=:&lt;/p&gt; 
&lt;p&gt;#+begin_src elisp (setq my-js-tsauto-config (make-treesit-auto-recipe :lang &#39;javascript :ts-mode &#39;js-ts-mode :remap &#39;(js2-mode js-mode javascript-mode) :url &quot;&lt;a href=&quot;https://github.com/tree-sitter/tree-sitter-javascript&quot;&gt;https://github.com/tree-sitter/tree-sitter-javascript&lt;/a&gt;&quot; :revision &quot;master&quot; :source-dir &quot;src&quot; :ext &quot;\.js\&#39;&quot;))&lt;/p&gt; 
&lt;p&gt;(add-to-list &#39;treesit-auto-recipe-list my-js-tsauto-config) #+end_src&lt;/p&gt; 
&lt;p&gt;Here, we&#39;ve specified that the tree-sitter compiler will be creating a file named =libtree-sitter-javascript.so= (or =.dylib= or =.dll=), based on the =:lang= field. The corresponding tree-sitter mode in Emacs is called =js-ts-mode=, and all of =js2-mode=, =js-mode=, and =javascript-mode= should attempt switching to the =js-ts-mode=, if possible.&lt;/p&gt; 
&lt;p&gt;Moreover, since =js-2-mode= is first under the =:remap= section, that is the &quot;primary fallback.&quot; Meaning that if the tree-sitter grammar is not available, it will be the first mode tried. If that doesn&#39;t work, it will try =js-mode=, and =javascript-mode=, in that order, until one /does/ work. If only one fallback needs to be specified, a single quoted symbol is also acceptable. For instance, =python-ts-mode= just uses =:remap &#39;python-mode= in this argument position.&lt;/p&gt; 
&lt;p&gt;If a grammar mandates any other grammars be installed as a dependency, the =:requires= keyword can specify a language symbol or list of symbols that should be installed. One example of this is found in the TypeScript recipe, which specifies =:requires &#39;tsx=, since activating =typescript-ts-mode= on some Emacs builds will attempt to load the TSX grammar.&lt;/p&gt; 
&lt;p&gt;The =:url=, =:revision=, =:source-dir=, =:cc=, and =:c++= arguments are all documented under =treesit-language-source-alist=, which is part of base Emacs, not this package.&lt;/p&gt; 
&lt;p&gt;*** =:abi14-revision= and =version-mismatch= errors If treesit reports reports =(treesit): The installed language grammar for foo cannot be located or has problems (version-mismatch): 15= it means that the grammar is using ABI 15, but Emacs only supports earlier versions (e.g. Emacs 30.1 supports ABI versions 13 and 14). To fix this, set =:abi14-revision= to a git tag that corresponds to an ABI 14 version in the grammar repository.&lt;/p&gt; 
&lt;p&gt;Finding the right tag can require some trial and error, by checking out different revisions of the grammar and building them. Once you&#39;ve built a grammar you can use the script =check_treesit_abi.py= to print its ABI version.&lt;/p&gt; 
&lt;p&gt;Once you find the tag for the ABI 14 revision of a grammar, please submit a pull request to add it to the default value of =treesit-auto-recipe-list=.&lt;/p&gt; 
&lt;p&gt;Setting =:abi14-revision= is preferable to changing =:revision=, because changing =:revision= would force the ABI 14 version even after Emacs starts supporting ABI 15.&lt;/p&gt; 
&lt;p&gt;** Keep track of your hooks This package does not modify any of your major mode hooks. That is, if you have functions in =python-mode-hook=, but not in =python-ts-mode-hook=, then your hook from =python-mode= will not be applied, assuming =python-ts-mode= is what gets loaded. For major modes in which this is a concern, the current recommendation is to address this as part of your configuration.&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq rust-ts-mode-hook rust-mode-hook) #+end_src&lt;/p&gt; 
&lt;p&gt;Some modes have a shared base, such as =python-ts-mode= and =python-mode= both deriving from =python-base-mode=. For these languages, you can opt to hook into =python-base-mode-hook= instead of explicitly setting the tree-sitter mode&#39;s hook.&lt;/p&gt; 
&lt;p&gt;** Automatically register extensions for =auto-mode-alist= You can register tree-sitter modes to =auto-mode-alist= by calling =treesit-auto-add-to-auto-mode-alist=. Depending on the optional argument =langs=, this function can behave in three different ways:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;=nil=, the default - Only add tree-sitter modes to =auto-mode-alist= if the tree-sitter mode is available to Emacs /and/ the grammar is installed.&lt;/li&gt; 
 &lt;li&gt;=&#39;all= - For every tree-sitter mode available to Emacs and in =treesit-auto-langs=, add it to =auto-mode-alist= regardless of whether the grammar is installed. This has the beneficial side effect of installing grammars for you when opening files that have a tree-sitter mode that comes with Emacs, but have no fallback mode. Examples of this are =rust-ts-mode=, =go-ts-mode=, and a few others in Emacs 29+.&lt;/li&gt; 
 &lt;li&gt;&lt;em&gt;A list of language symbols&lt;/em&gt; - behaves like =&#39;all=, but only for the listed languages&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;For instance, you might run this function as:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (treesit-auto-add-to-auto-mode-alist &#39;(rust go toml)) #+end_src&lt;/p&gt; 
&lt;p&gt;This registers your tree-sitter modes according to the common file extension for Rust, Go, and TOML, but no other modes. Most users will probably want to use =(treesit-auto-add-to-auto-mode-alist &#39;all)= for the easiest general behavior; always prompting/installing grammars when we can.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;A rough vanilla equivalent I find it a good practice to be skeptical of adding any new dependency to my Emacs configuration. So, what would you have to do to get similar behavior in your Emacs configuration without the =treesit-auto= package?&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;We&#39;ll take two examples: TypeScript and Python.&lt;/p&gt; 
&lt;p&gt;Emacs 29 ships with =typescript-ts-mode= and =tsx-ts-mode=, but no equivalent =typescript-mode= or =tsx-mode=. =python-ts-mode= and =python-mode=, on the other hand, are both available out of the box. If you wanted these grammars to automatically install on launch, and then use the tree-sitter modes instead of the base modes for every file, you&#39;d need the following code in your init file:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq treesit-language-source-alist &#39;((typescript . (&quot;&lt;a href=&quot;https://github.com/tree-sitter/tree-sitter-typescript&quot;&gt;https://github.com/tree-sitter/tree-sitter-typescript&lt;/a&gt;&quot; &quot;master&quot; &quot;typescript/src&quot;)) (tsx . (&quot;&lt;a href=&quot;https://github.com/tree-sitter/tree-sitter-typescript&quot;&gt;https://github.com/tree-sitter/tree-sitter-typescript&lt;/a&gt;&quot; &quot;master&quot; &quot;tsx/src&quot;)) (python . (&quot;&lt;a href=&quot;https://github.com/tree-sitter/tree-sitter-python&quot;&gt;https://github.com/tree-sitter/tree-sitter-python&lt;/a&gt;&quot;))))&lt;/p&gt; 
&lt;p&gt;(dolist (source treesit-language-source-alist) (unless (treesit-ready-p (car source)) (treesit-install-language-grammar (car source))))&lt;/p&gt; 
&lt;p&gt;(add-to-list &#39;auto-mode-alist &#39;(&quot;\.ts\&#39;&quot; . typescript-ts-mode)) (add-to-list &#39;auto-mode-alist &#39;(&quot;\.tsx\&#39;&quot; . tsx-ts-mode)) (add-to-list &#39;major-mode-remap-alist &#39;(python-mode . python-ts-mode))&lt;/p&gt; 
&lt;p&gt;#+end_src&lt;/p&gt; 
&lt;p&gt;There are plenty of reasons why some users would prefer to take this type of hand-tuned approach to their tree-sitter modes. For most Emacs people, though, you can see the natural progression of where a config like the above would go:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;You need to maintain a library of language symbols (which /must/ match the language&#39;s =grammar.js=), URLs, revisions, and sub-directories for =treesit-language-source-alist=. Additionally, you&#39;d need to know that =typescript-ts-mode= relies on the tree-sitter grammar for =tsx=, which must be installed alongside the grammar for TypeScript. This is probably the main value proposition of this package, since all of this information is stored under the community-contributed =treesit-auto-recipe-list=&lt;/li&gt; 
 &lt;li&gt;You need to be aware of when to use =auto-mode-alist= and =major-mode-remap-alist=, depending on what modes are installed into Emacs&lt;/li&gt; 
 &lt;li&gt;If you want lazy installation of grammars, rather than installing them all up-front in your =init.el=, you&#39;d need to write some hooks or derived modes to check =treesit-ready-p= for the current buffer, and install the language before loading the main tree-sitter mode&lt;/li&gt; 
 &lt;li&gt;After a certain number of langauges, it becomes unweildy to do these =add-to-list= calls for every single one, and it&#39;s better to programmatically operate on a list of selected languages&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;If you were to follow this chain yourself, you&#39;d probably wind up with something in your =init.el= that looks very similar to the code in this package.&lt;/p&gt; 
&lt;p&gt;All in all, this is a small package. Roughly half of it is just maintaining a library of information for =treesit-language-source-alist=, and the other half works through the logic of handling edge cases related to the remaining bullets above.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;Caveats This package is, admittedly, a hack. =treesit.el= provides an excellent foundation to incremental source code parsing for Emacs 29, and over time that foundation /will/ expand into an improved core editing experience. With that in mind, I fully expect this package to eventually be obsolesced by the default options in Emacs 30 and beyond. That does not preclude us from adding a few quality of life improvements to Emacs 29, though, and so it still seems prudent to have this plugin available in the meantime.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Known bugs =treesit-auto= doesn&#39;t play super well with Org-babel, since Org has its own methods of hooking into and using languages. In particular, you may need to set =org-src-lang-modes= yourself to get tree-sitter modes working correctly.&lt;/p&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Another side behavior you may encounter is when opening an Org document with shell scripts inside and =treesit-auto-install= is non-nil, then =treesit-auto= will prompt to install the Bash grammar, but won&#39;t display the prompt until you interact with Emacs in some way, such as using =next-line= (=C-n= by default) or hovering over Emacs with your mouse.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Contributing Bug reports, feature requests, and contributions are most welcome. Even though this is a small project, there is always room for improvement. I also appreciate &quot;nitpicky&quot; contributions, such as formatting, conventions, variable naming, code simplification, and improvements to language in documentation.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Issues are tracked on [[&lt;a href=&quot;https://github.com/renzmann/treesit-auto/issues&quot;&gt;https://github.com/renzmann/treesit-auto/issues&lt;/a&gt;][GitHub]], which is also where patches and pull requests should be submitted.&lt;/p&gt; 
&lt;p&gt;If you would like to submit a new language recipe to be distributed as part of this package, see [[&lt;a href=&quot;http://CONTRIBUTING.org&quot;&gt;CONTRIBUTING.org&lt;/a&gt;][&lt;a href=&quot;http://CONTRIBUTING.org&quot;&gt;CONTRIBUTING.org&lt;/a&gt;]] for a quick guide on how to write and submit the new recipe.&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/95d2e1fbed09254eff6413b1adf20e48d1917905d49b3cdcaf78a673773212e0/renzmann/treesit-auto" medium="image" />
      
    </item>
    
    <item>
      <title>magit/magit</title>
      <link>https://github.com/magit/magit</link>
      <description>&lt;p&gt;It&#39;s Magit! A Git Porcelain inside Emacs.&lt;/p&gt;&lt;hr&gt;&lt;div align=&quot;center&quot;&gt;
 &lt;img src=&quot;https://magit.vc/assets/magit-168x200px.png&quot; /&gt;
&lt;/div&gt; 
&lt;h2 align=&quot;center&quot;&gt;A Git Porcelain inside Emacs&lt;/h2&gt; 
&lt;p align=&quot;center&quot;&gt; &lt;a href=&quot;https://magit.vc&quot;&gt;&lt;b&gt;homepage&lt;/b&gt;&lt;/a&gt; | &lt;a href=&quot;https://docs.magit.vc&quot;&gt;&lt;b&gt;manual&lt;/b&gt;&lt;/a&gt; | &lt;a href=&quot;https://docs.magit.vc/magit/FAQ.html&quot;&gt;&lt;b&gt;faq&lt;/b&gt;&lt;/a&gt; | &lt;a href=&quot;https://github.com/magit/magit/wiki&quot;&gt;&lt;b&gt;wiki&lt;/b&gt;&lt;/a&gt; | &lt;a href=&quot;https://fosstodon.org/@tarsius&quot;&gt;&lt;b&gt;mastodon&lt;/b&gt;&lt;/a&gt; &lt;/p&gt; 
&lt;hr /&gt; 
&lt;p align=&quot;justify&quot;&gt; Magit is an interface to the version control system &lt;a href=&quot;https://git-scm.com&quot;&gt;Git&lt;/a&gt;, implemented as an &lt;a href=&quot;https://www.gnu.org/software/emacs&quot;&gt;Emacs&lt;/a&gt; package. Magit aspires to be a complete Git porcelain. While we cannot (yet) claim that Magit wraps and improves upon each and every Git command, it is complete enough to allow even experienced Git users to perform almost all of their daily version control tasks directly from within Emacs. While many fine Git clients exist, only Magit and Git itself deserve to be called porcelains. &lt;/p&gt; 
&lt;hr /&gt; 
&lt;div align=&quot;center&quot;&gt;
  Keeping its users 
 &lt;a href=&quot;https://magit.vc/quotes/&quot;&gt;this excited&lt;/a&gt; is 
 &lt;a href=&quot;https://stats.magit.vc/magit/authors.html&quot;&gt; a lot of work&lt;/a&gt;. If Magit makes you 
 &lt;br /&gt; more productive too, then 
 &lt;b&gt;please consider making a donation&lt;/b&gt;. 
&lt;/div&gt; 
&lt;div align=&quot;center&quot;&gt; 
 &lt;em&gt;Thank you! — Jonas Bernoulli&lt;/em&gt; 
&lt;/div&gt; 
&lt;br /&gt; 
&lt;div align=&quot;center&quot;&gt; 
 &lt;a href=&quot;https://github.com/sponsors/tarsius/&quot;&gt; &lt;img title=&quot;Sponsor my work using Github Sponsors&quot; alt=&quot;Sponsor my work using Github Sponsors&quot; src=&quot;https://magit.vc/assets/donate/github-sponsors-50px.png&quot; /&gt;&lt;/a&gt; &amp;nbsp;&amp;nbsp; 
 &lt;a href=&quot;https://liberapay.com/magit/&quot;&gt; &lt;img title=&quot;Sponsor my work using Liberapay&quot; alt=&quot;Sponsor my work using Liberapay&quot; src=&quot;https://magit.vc/assets/donate/liberapay-50px.png&quot; /&gt;&lt;/a&gt; 
 &lt;br /&gt; 
 &lt;a href=&quot;https://opencollective.com/magit/&quot;&gt; &lt;img title=&quot;Sponsor my work using Opencollective&quot; alt=&quot;Sponsor my work using Opencollective&quot; src=&quot;https://magit.vc/assets/donate/opencollective-50px.png&quot; /&gt;&lt;/a&gt; &amp;nbsp;&amp;nbsp; 
 &lt;a href=&quot;https://magit.vc/donate/paypal.html&quot;&gt; &lt;img title=&quot;Sponsor my work using PayPal&quot; alt=&quot;Sponsor my work using PayPal&quot; src=&quot;https://magit.vc/assets/donate/paypal-50px.png&quot; /&gt;&lt;/a&gt; 
&lt;/div&gt; 
&lt;br /&gt; 
&lt;div align=&quot;center&quot;&gt;
  Some alternative donation methods are 
 &lt;a href=&quot;https://magit.vc/donate/&quot;&gt;available&lt;/a&gt;. 
&lt;/div&gt; 
&lt;hr /&gt; 
&lt;h3&gt;Getting Started&lt;/h3&gt; 
&lt;p&gt;If you are new to Magit, then either one of the following two articles should help understanding how it differs from other Git clients.&lt;/p&gt; 
&lt;h4&gt;&lt;a href=&quot;https://emacsair.me/2017/09/01/magit-walk-through&quot;&gt;Visual Magit walk-through&lt;/a&gt;&lt;/h4&gt; 
&lt;p&gt;If you are completely new to Magit, then this article is a good visual introduction.&lt;/p&gt; 
&lt;p&gt;Almost everything that you see in Magit can be acted on by pressing some key, but that&#39;s not obvious from just seeing how Magit looks. The screenshots and accompanying text of this article explain how to perform a variety of actions on Magit&#39;s output.&lt;/p&gt; 
&lt;h4&gt;&lt;a href=&quot;https://emacsair.me/2017/09/01/the-magical-git-interface&quot;&gt;Magit, the magical Git interface&lt;/a&gt;&lt;/h4&gt; 
&lt;p&gt;Magit differs significantly from other Git interfaces, and its advantages are not immediately obvious simply from looking at a few screenshots as presented in the preceding article.&lt;/p&gt; 
&lt;p&gt;This article discusses Magit&#39;s properties in somewhat more abstract terms.&lt;/p&gt; 
&lt;h4&gt;Video introductions&lt;/h4&gt; 
&lt;p&gt;If you prefer &lt;a href=&quot;https://magit.vc/screencasts/&quot;&gt;video&lt;/a&gt; introductions, head over to that page, where find a collection of such introductions and other videos about Magit, by various creators.&lt;/p&gt; 
&lt;hr /&gt; 
&lt;h3&gt;Support and Contributing&lt;/h3&gt; 
&lt;p&gt;Magit has many users and very few maintainers, so we kindly ask to read the appropriate guidelines before getting in contact. — Thanks!&lt;/p&gt; 
&lt;p&gt;Please use your own words. No stochastic parrots.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;🆘 &lt;a href=&quot;https://github.com/magit/magit/discussions/4630&quot;&gt;How to ask for help&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;🪳 &lt;a href=&quot;https://github.com/magit/magit/wiki/How-to-report-a-bug&quot;&gt;How to report a bug&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;💡 &lt;a href=&quot;https://github.com/magit/magit/discussions/4631&quot;&gt;How to suggest a feature&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;🏗️ &lt;a href=&quot;https://github.com/magit/magit/wiki/Pull-request-guidelines&quot;&gt;Pull request guidelines&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;ℹ️ &lt;a href=&quot;https://docs.magit.vc/magit/FAQ.html&quot;&gt;FAQ&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;ℹ️ &lt;a href=&quot;https://docs.magit.vc/magit&quot;&gt;Manual&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;We use &lt;a href=&quot;https://github.com/magit/magit/discussions&quot;&gt;discussions&lt;/a&gt; (not issues) for feature requests. Please consider asking other users for help, where ever you like to hang out with other Emacs users. not every question can only be answered by the maintainer.&lt;/p&gt; 
&lt;p&gt;Please consider supporting the maintainer, who makes a living maintaining this and other packages, with a &lt;a href=&quot;https://magit.vc/donate&quot;&gt;donation&lt;/a&gt;. — Thanks!&lt;/p&gt; 
&lt;hr /&gt; 
&lt;h3&gt;Acknowledgments&lt;/h3&gt; 
&lt;p&gt;Magit was started by &lt;a href=&quot;https://github.com/mvollmer&quot;&gt;Marius Vollmer&lt;/a&gt;, and is now maintained by &lt;a href=&quot;https://emacsair.me&quot;&gt;Jonas Bernoulli&lt;/a&gt; and &lt;a href=&quot;https://kyleam.com&quot;&gt;Kyle Meyer&lt;/a&gt;. Former maintainers are &lt;a href=&quot;https://github.com/dudebout&quot;&gt;Nicolas Dudebout&lt;/a&gt;, &lt;a href=&quot;https://github.com/npostavs&quot;&gt;Noam Postavsky&lt;/a&gt;, &lt;a href=&quot;https://github.com/peweisberg-fadv&quot;&gt;Peter J. Weisberg&lt;/a&gt;, &lt;a href=&quot;https://github.com/philjackson&quot;&gt;Phil Jackson&lt;/a&gt;, &lt;a href=&quot;https://github.com/vanicat&quot;&gt;Rémi Vanicat&lt;/a&gt; and &lt;a href=&quot;https://yann.hodique.info&quot;&gt;Yann Hodique&lt;/a&gt;. Many more people have &lt;a href=&quot;https://stats.magit.vc/magit/authors.html&quot;&gt;contributed code&lt;/a&gt;, suggested features or made monetary contributions.&lt;/p&gt; 
&lt;hr /&gt; 
&lt;p&gt;&lt;a href=&quot;https://github.com/magit/magit/actions/workflows/compile.yml&quot;&gt;&lt;img src=&quot;https://github.com/magit/magit/actions/workflows/compile.yml/badge.svg?sanitize=true&quot; alt=&quot;Compile&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://github.com/magit/magit/actions/workflows/test.yml&quot;&gt;&lt;img src=&quot;https://github.com/magit/magit/actions/workflows/test.yml/badge.svg?sanitize=true&quot; alt=&quot;Test&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://github.com/magit/magit/actions/workflows/manual.yml&quot;&gt;&lt;img src=&quot;https://github.com/magit/magit/actions/workflows/manual.yml/badge.svg?sanitize=true&quot; alt=&quot;Manual&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://elpa.nongnu.org/nongnu/magit.html&quot;&gt;&lt;img src=&quot;https://emacsair.me/assets/badges/nongnu-elpa.svg?sanitize=true&quot; alt=&quot;NonGNU ELPA&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://melpa.org/#/magit&quot;&gt;&lt;img src=&quot;https://melpa.org/packages/magit-badge.svg?sanitize=true&quot; alt=&quot;Melpa&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://stable.melpa.org/#/magit&quot;&gt;&lt;img src=&quot;https://stable.melpa.org/packages/magit-badge.svg?sanitize=true&quot; alt=&quot;Melpa Stable&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://repology.org/project/emacs%3Amagit/versions&quot;&gt;&lt;img src=&quot;https://repology.org/badge/vertical-allrepos/emacs%3Amagit.svg?header=&amp;amp;columns=4&amp;amp;minversion=4.5&amp;amp;exclude_unsupported=1&quot; alt=&quot;Packaging status&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/51e4379abcf32aab22349980029daf0d3ffbdc0a3ec52b97182adca5a06052eb/magit/magit" medium="image" />
      
    </item>
    
    <item>
      <title>abo-abo/avy</title>
      <link>https://github.com/abo-abo/avy</link>
      <description>&lt;p&gt;Jump to things in Emacs tree-style&lt;/p&gt;&lt;hr&gt;&lt;p&gt;&lt;a href=&quot;https://elpa.gnu.org/packages/avy.html&quot;&gt;&lt;img src=&quot;https://elpa.gnu.org/packages/avy.svg?sanitize=true&quot; alt=&quot;GNU ELPA&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://melpa.org/#/avy&quot;&gt;&lt;img src=&quot;https://melpa.org/packages/avy-badge.svg?sanitize=true&quot; alt=&quot;MELPA&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://stable.melpa.org/#/avy&quot;&gt;&lt;img src=&quot;https://stable.melpa.org/packages/avy-badge.svg?sanitize=true&quot; alt=&quot;MELPA Stable&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;h2&gt;Introduction&lt;/h2&gt; 
&lt;p&gt;&lt;code&gt;avy&lt;/code&gt; is a GNU Emacs package for jumping to visible text using a char-based decision tree. See also &lt;a href=&quot;https://github.com/winterTTr/ace-jump-mode&quot;&gt;ace-jump-mode&lt;/a&gt; and &lt;a href=&quot;https://github.com/Lokaltog/vim-easymotion&quot;&gt;vim-easymotion&lt;/a&gt; - &lt;code&gt;avy&lt;/code&gt; uses the same idea.&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/wiki/abo-abo/avy/images/avy-avatar-1.png&quot; alt=&quot;logo&quot; /&gt;&lt;/p&gt; 
&lt;h2&gt;Command overview&lt;/h2&gt; 
&lt;p&gt;You can bind some of these useful commands in your config.&lt;/p&gt; 
&lt;h3&gt;&lt;code&gt;avy-goto-char&lt;/code&gt;&lt;/h3&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Input one char, jump to it with a tree.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(global-set-key (kbd &quot;C-:&quot;) &#39;avy-goto-char)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;After &lt;kbd&gt;C-: b&lt;/kbd&gt;:&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/wiki/nloyola/avy/images/avy-goto-char.png&quot; alt=&quot;avy-goto-char&quot; /&gt;&lt;/p&gt; 
&lt;h3&gt;&lt;code&gt;avy-goto-char-2&lt;/code&gt;&lt;/h3&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Input two consecutive chars, jump to the first one with a tree.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;The advantage over the previous one is less candidates for the tree search. And it&#39;s not too inconvenient to enter two consecutive chars instead of one.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(global-set-key (kbd &quot;C-&#39;&quot;) &#39;avy-goto-char-2)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;After &lt;kbd&gt;C-&#39; bu&lt;/kbd&gt;:&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;http://oremacs.com/download/avi-goto-char-2.png&quot; alt=&quot;avy-goto-char-2&quot; /&gt;&lt;/p&gt; 
&lt;h3&gt;&lt;code&gt;avy-goto-char-timer&lt;/code&gt;&lt;/h3&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Input an arbitrary amount of consecutive chars, jump to the first one with a tree.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;This is a more flexible version of &lt;code&gt;avy-goto-char-2&lt;/code&gt;. First part works similarly to &lt;code&gt;isearch&lt;/code&gt;: you type a query and it&#39;s highlighted dynamically on the screen. When you stop typing for &lt;code&gt;avy-timeout-seconds&lt;/code&gt; (0.5s by default), you&#39;ll be able to select one of the candidates with &lt;code&gt;avy&lt;/code&gt;. As you&#39;re inputting characters, you can use &lt;code&gt;C-h&lt;/code&gt; (backspace) or &lt;code&gt;DEL&lt;/code&gt; (delete) to forget the last typed character and &lt;code&gt;RET&lt;/code&gt; to end the input sequence immediately and select a candidate.&lt;/p&gt; 
&lt;h3&gt;&lt;code&gt;avy-goto-line&lt;/code&gt;&lt;/h3&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Input zero chars, jump to a line start with a tree.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(global-set-key (kbd &quot;M-g f&quot;) &#39;avy-goto-line)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;After &lt;kbd&gt;M-g f&lt;/kbd&gt;:&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;http://oremacs.com/download/avi-goto-line.png&quot; alt=&quot;avy-goto-line&quot; /&gt;&lt;/p&gt; 
&lt;p&gt;You can actually replace the &lt;kbd&gt;M-g g&lt;/kbd&gt; binding of &lt;code&gt;goto-line&lt;/code&gt;, since if you enter a digit for &lt;code&gt;avy-goto-line&lt;/code&gt;, it will switch to &lt;code&gt;goto-line&lt;/code&gt; with that digit already entered.&lt;/p&gt; 
&lt;h3&gt;&lt;code&gt;avy-goto-word-1&lt;/code&gt;&lt;/h3&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Input one char at word start, jump to a word start with a tree.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(global-set-key (kbd &quot;M-g w&quot;) &#39;avy-goto-word-1)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;After &lt;kbd&gt;M-g wb&lt;/kbd&gt;:&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;http://oremacs.com/download/avi-goto-word-1.png&quot; alt=&quot;avy-goto-word-1&quot; /&gt;&lt;/p&gt; 
&lt;h3&gt;&lt;code&gt;avy-goto-word-0&lt;/code&gt;&lt;/h3&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Input zero chars, jump to a word start with a tree.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Compared to &lt;code&gt;avy-goto-word-1&lt;/code&gt;, there are a lot more candidates. But at a least there&#39;s not need to input the initial char.&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(global-set-key (kbd &quot;M-g e&quot;) &#39;avy-goto-word-0)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;After &lt;kbd&gt;M-g e&lt;/kbd&gt;:&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;http://oremacs.com/download/avi-goto-word-0.png&quot; alt=&quot;avy-goto-word-0&quot; /&gt;&lt;/p&gt; 
&lt;h3&gt;Org-mode commands&lt;/h3&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;avy-org-goto-heading-timer&lt;/code&gt;: Type part of an Org heading. When you stop typing, if only one heading on the screen matches, it will be jumped to; if more than one matches, you can jump to a heading with Avy. This is like &lt;code&gt;avy-goto-char-timer&lt;/code&gt; but for Org headings.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;avy-org-refile-as-child&lt;/code&gt;: With point in an entry you want to refile, run this command, select a heading with Avy, and the entry will be refiled as its first child heading. This makes it quick and easy to refile to headings that are visible on-screen, even to other windows or buffers.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;Other commands&lt;/h3&gt; 
&lt;p&gt;There are some more commands which you can explore yourself by looking at the code.&lt;/p&gt; 
&lt;h3&gt;Bindings&lt;/h3&gt; 
&lt;p&gt;You add this to your config to bind some stuff:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-elisp&quot;&gt;(avy-setup-default)
(global-set-key (kbd &quot;C-c C-j&quot;) &#39;avy-resume)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;It will bind, for example, &lt;code&gt;avy-isearch&lt;/code&gt; to &lt;kbd&gt;C-&#39;&lt;/kbd&gt; in &lt;code&gt;isearch-mode-map&lt;/code&gt;, so that you can select one of the currently visible &lt;code&gt;isearch&lt;/code&gt; candidates using &lt;code&gt;avy&lt;/code&gt;.&lt;/p&gt; 
&lt;h3&gt;Customization&lt;/h3&gt; 
&lt;p&gt;See the comprehensive custom variable list on &lt;a href=&quot;https://github.com/abo-abo/avy/wiki/defcustom&quot;&gt;the defcustom wiki page&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;See how to write your own avy commands on &lt;a href=&quot;https://github.com/abo-abo/avy/wiki/custom-commands&quot;&gt;the custom-commands wiki page&lt;/a&gt;.&lt;/p&gt; 
&lt;h2&gt;Contributing&lt;/h2&gt; 
&lt;h3&gt;Copyright Assignment&lt;/h3&gt; 
&lt;p&gt;Avy is subject to the same &lt;a href=&quot;http://www.gnu.org/prep/maintain/html_node/Copyright-Papers.html&quot;&gt;copyright assignment&lt;/a&gt; policy as Emacs itself, org-mode, CEDET and other packages in &lt;a href=&quot;http://elpa.gnu.org/packages/&quot;&gt;GNU ELPA&lt;/a&gt;. Any &lt;a href=&quot;http://www.gnu.org/prep/maintain/html_node/Legally-Significant.html#Legally-Significant&quot;&gt;legally significant&lt;/a&gt; contributions can only be accepted after the author has completed their paperwork. Please see &lt;a href=&quot;http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.future&quot;&gt;the request form&lt;/a&gt; if you want to proceed.&lt;/p&gt; 
&lt;p&gt;The copyright assignment isn&#39;t a big deal, it just says that the copyright for your submitted changes to Emacs belongs to the FSF. This assignment works for all projects related to Emacs. To obtain it, you need to send one email, then send one letter (if you live in the US, it&#39;s digital), and wait for some time (in my case, I had to wait for one month).&lt;/p&gt; 
&lt;h3&gt;Style&lt;/h3&gt; 
&lt;p&gt;The basic code style guide is to use &lt;code&gt;(setq indent-tabs-mode nil)&lt;/code&gt;. It is provided for you in &lt;a href=&quot;https://github.com/abo-abo/avy/raw/master/.dir-locals.el&quot;&gt;.dir-locals.el&lt;/a&gt;, please obey it.&lt;/p&gt; 
&lt;p&gt;Before submitting the change, run &lt;code&gt;make compile&lt;/code&gt; and &lt;code&gt;make test&lt;/code&gt; to make sure that it doesn&#39;t introduce new compile warnings or test failures. Also run &lt;code&gt;make checkdoc&lt;/code&gt; to see that your changes obey the documentation guidelines.&lt;/p&gt; 
&lt;p&gt;Use your own judgment for the commit messages, I recommend a verbose style using &lt;code&gt;magit-commit-add-log&lt;/code&gt;.&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/8064abe84c76b0615d1ab6830d43720c81cf5ff01f5747c2c0871f58ab758ec0/abo-abo/avy" medium="image" />
      
    </item>
    
    <item>
      <title>doomemacs/modules</title>
      <link>https://github.com/doomemacs/modules</link>
      <description>&lt;p&gt;Official module library for Doom Emacs&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;Doom Emacs Official Modules&lt;/h1&gt; 
&lt;p&gt;&lt;img src=&quot;https://img.shields.io/github/tag/doomemacs/modules.svg?style=flat-square&amp;amp;label=release&amp;amp;color=58839b&quot; alt=&quot;Latest release&quot; /&gt; &lt;img src=&quot;https://img.shields.io/badge/Doom-v2.2.0+-blue.svg?style=flat-square&quot; alt=&quot;Minimum supported version of Doom&quot; /&gt; &lt;img src=&quot;https://img.shields.io/badge/Emacs-v29.1+-blueviolet.svg?style=flat-square&amp;amp;logo=GNU%20Emacs&amp;amp;logoColor=white&quot; alt=&quot;Minimum supported versions of Emacs&quot; /&gt; &amp;nbsp; &lt;a href=&quot;https://doomemacs.org/discord&quot;&gt;&lt;img src=&quot;https://img.shields.io/discord/406534637242810369?color=738adb&amp;amp;label=Discord&amp;amp;logo=discord&amp;amp;logoColor=white&amp;amp;style=flat-square&quot; alt=&quot;Discord Server&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://doomemacs.org/discuss&quot;&gt;&lt;img src=&quot;https://img.shields.io/github/discussions/doomemacs/community?style=flat-square&amp;amp;color=9cf&amp;amp;label=Discuss&amp;amp;logo=Github&quot; alt=&quot;Github Discussions&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;This repository houses &lt;a href=&quot;https://doomemacs.org&quot;&gt;Doom Emacs&lt;/a&gt;&#39; official starter kit: a library of official modules that can serve as a foundation for your Emacs configuration by:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Pre-configuring support for a variety of programming languages, tools, and operating systems,&lt;/li&gt; 
 &lt;li&gt;Fixing common issues with Emacs packages or their interopability with other packages.&lt;/li&gt; 
 &lt;li&gt;Optimizing Emacs and third party packages,&lt;/li&gt; 
 &lt;li&gt;Providing sensible defaults for packages and features to spare you the months, maybe years, you&#39;d otherwise spend discovering yourself.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Modules here are carefully curated by Doom&#39;s author and core maintainers.&lt;/p&gt; 
&lt;div class=&quot;markdown-alert markdown-alert-important&quot;&gt;
 &lt;p class=&quot;markdown-alert-title&quot;&gt;
  &lt;svg class=&quot;octicon octicon-report mr-2&quot; viewbox=&quot;0 0 16 16&quot; version=&quot;1.1&quot; width=&quot;16&quot; height=&quot;16&quot; aria-hidden=&quot;true&quot;&gt;
   &lt;path d=&quot;M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z&quot;&gt;&lt;/path&gt;
  &lt;/svg&gt;Important&lt;/p&gt;
 &lt;p&gt;Each module possesses their own documentation, accessible within Doom via &lt;code&gt;M-x doom/help-modules&lt;/code&gt; (or &lt;code&gt;M-x +lookup/documentation&lt;/code&gt; while your cursor is on a module&#39;s name in &lt;code&gt;$DOOMDIR/init.el&lt;/code&gt;).&lt;/p&gt; 
&lt;/div&gt; 
&lt;h2&gt;Install&lt;/h2&gt; 
&lt;p&gt;Until Doom core v3 is released, this repo exists as a git submodule of doomemacs/core and doesn&#39;t need to be directly installed (yet).&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/32f09ce9c5e5592c623e6d8923d27960a8190868e33d328a535d8a54de494d75/doomemacs/modules" medium="image" />
      
    </item>
    
    <item>
      <title>xenodium/agent-shell</title>
      <link>https://github.com/xenodium/agent-shell</link>
      <description>&lt;p&gt;A native Emacs buffer to interact with LLM agents powered by ACP&lt;/p&gt;&lt;hr&gt;&lt;p&gt;#+TITLE: Emacs Agent Shell #+AUTHOR: Álvaro Ramírez&lt;/p&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://melpa.org/#/agent-shell&quot;&gt;https://melpa.org/#/agent-shell&lt;/a&gt;][file:&lt;a href=&quot;https://melpa.org/packages/agent-shell-badge.svg&quot;&gt;https://melpa.org/packages/agent-shell-badge.svg&lt;/a&gt;]]&lt;/p&gt; 
&lt;p&gt;👉 [[&lt;a href=&quot;https://github.com/sponsors/xenodium&quot;&gt;https://github.com/sponsors/xenodium&lt;/a&gt;][Support this work via GitHub Sponsors]] by [[&lt;a href=&quot;https://github.com/xenodium&quot;&gt;https://github.com/xenodium&lt;/a&gt;][@xenodium]] (check out my [[&lt;a href=&quot;https://xenodium.com&quot;&gt;https://xenodium.com&lt;/a&gt;][blog]])&lt;/p&gt; 
&lt;p&gt;[[file:agent-shell.png]]&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;This project needs your funding&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;As you pay for those useful LLM tokens, consider [[&lt;a href=&quot;https://github.com/sponsors/xenodium&quot;&gt;https://github.com/sponsors/xenodium&lt;/a&gt;][sponsoring]] development and maintenance of this project. With your help, I can make this effort more [[&lt;a href=&quot;https://github.com/sponsors/xenodium&quot;&gt;https://github.com/sponsors/xenodium&lt;/a&gt;][sustainable]].&lt;/p&gt; 
&lt;p&gt;Thank you!&lt;/p&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://xenodium.com/&quot;&gt;https://xenodium.com/&lt;/a&gt;][Alvaro]]&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;agent-shell&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;A native Emacs shell to interact with LLM agents powered by ACP ([[&lt;a href=&quot;https://agentclientprotocol.com&quot;&gt;https://agentclientprotocol.com&lt;/a&gt;][Agent Client Protocol]]).&lt;/p&gt; 
&lt;p&gt;With agent-shell, you can interact with any ACP-driven agent like:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://code.claude.com/docs/en/overview&quot;&gt;https://code.claude.com/docs/en/overview&lt;/a&gt;][Claude Agent]] (Anthropic)&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/agentclientprotocol/codex-acp&quot;&gt;https://github.com/agentclientprotocol/codex-acp&lt;/a&gt;][Codex]] (OpenAI)&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/google-gemini/gemini-cli&quot;&gt;https://github.com/google-gemini/gemini-cli&lt;/a&gt;][Gemini CLI]] (Google)&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://goose-docs.ai/docs/getting-started/installation&quot;&gt;https://goose-docs.ai/docs/getting-started/installation&lt;/a&gt;][Goose]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://cursor.com/docs/cli&quot;&gt;https://cursor.com/docs/cli&lt;/a&gt;][Cursor]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://www.kimi.com/code&quot;&gt;https://www.kimi.com/code&lt;/a&gt;][Kimi Code CLI]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://www.codebuddy.ai&quot;&gt;https://www.codebuddy.ai&lt;/a&gt;][CodeBuddy]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://kiro.dev&quot;&gt;https://kiro.dev&lt;/a&gt;][Kiro CLI]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/QwenLM/qwen-code&quot;&gt;https://github.com/QwenLM/qwen-code&lt;/a&gt;][Qwen Code]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://docs.augmentcode.com/cli/overview&quot;&gt;https://docs.augmentcode.com/cli/overview&lt;/a&gt;][Auggie]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/mistralai/mistral-vibe&quot;&gt;https://github.com/mistralai/mistral-vibe&lt;/a&gt;][Mistral Vibe]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://factory.ai&quot;&gt;https://factory.ai&lt;/a&gt;][Factory Droid]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/svkozak/pi-acp&quot;&gt;https://github.com/svkozak/pi-acp&lt;/a&gt;][Pi]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/can1357/oh-my-pi&quot;&gt;https://github.com/can1357/oh-my-pi&lt;/a&gt;][Oh My Pi]]&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://opencode.ai&quot;&gt;https://opencode.ai&lt;/a&gt;][Opencode]]&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://www.youtube.com/watch?v=R2Ucr3amgGg&quot;&gt;https://www.youtube.com/watch?v=R2Ucr3amgGg&lt;/a&gt;][agent-shell - YouTube]]&lt;/p&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://www.youtube.com/watch?v=R2Ucr3amgGg&quot;&gt;https://www.youtube.com/watch?v=R2Ucr3amgGg&lt;/a&gt;][file:yt.png]]&lt;/p&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://www.youtube.com/watch?v=ymMlftdGx4I&quot;&gt;https://www.youtube.com/watch?v=ymMlftdGx4I&lt;/a&gt;][agent-shell + Claude Skills - YouTube]]&lt;/p&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://www.youtube.com/watch?v=ymMlftdGx4I&quot;&gt;https://www.youtube.com/watch?v=ymMlftdGx4I&lt;/a&gt;][&lt;a href=&quot;https://img.youtube.com/vi/ymMlftdGx4I/0.jpg&quot;&gt;https://img.youtube.com/vi/ymMlftdGx4I/0.jpg&lt;/a&gt;]]&lt;/p&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://www.youtube.com/watch?v=HJQ86HuSIJI&quot;&gt;https://www.youtube.com/watch?v=HJQ86HuSIJI&lt;/a&gt;][agent-shell + Claude Skills + Charts - YouTube]]&lt;/p&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://www.youtube.com/watch?v=HJQ86HuSIJI&quot;&gt;https://www.youtube.com/watch?v=HJQ86HuSIJI&lt;/a&gt;][&lt;a href=&quot;https://img.youtube.com/vi/HJQ86HuSIJI/0.jpg&quot;&gt;https://img.youtube.com/vi/HJQ86HuSIJI/0.jpg&lt;/a&gt;]]&lt;/p&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://www.youtube.com/watch?v=7fdHeUoRRgg&quot;&gt;https://www.youtube.com/watch?v=7fdHeUoRRgg&lt;/a&gt;][Bending Emacs Episode 14: Prototyping iOS apps with agent-shell, artist-mode, and Claude Skills - YouTube]]&lt;/p&gt; 
&lt;p&gt;[[&lt;a href=&quot;https://www.youtube.com/watch?v=7fdHeUoRRgg&quot;&gt;https://www.youtube.com/watch?v=7fdHeUoRRgg&lt;/a&gt;][&lt;a href=&quot;https://img.youtube.com/vi/7fdHeUoRRgg/0.jpg&quot;&gt;https://img.youtube.com/vi/7fdHeUoRRgg/0.jpg&lt;/a&gt;]]&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;News&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Do take a look at all these blog posts as they showcase most =agent-shell= features.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://xenodium.com/agent-shell-0-55-updates&quot;&gt;https://xenodium.com/agent-shell-0-55-updates&lt;/a&gt;][agent-shell 0.55 updates]].&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://xenodium.com/agent-shell-0-47-1-updates&quot;&gt;https://xenodium.com/agent-shell-0-47-1-updates&lt;/a&gt;][agent-shell 0.47 updates]].&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://xenodium.com/agent-shell-0-25-updates&quot;&gt;https://xenodium.com/agent-shell-0-25-updates&lt;/a&gt;][agent-shell 0.25 updates]].&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://xenodium.com/agent-shell-016-improvements-melpa&quot;&gt;https://xenodium.com/agent-shell-016-improvements-melpa&lt;/a&gt;][agent-shell 0.17 improvements + MELPA]].&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://xenodium.com/agent-shell-0-5-improvements&quot;&gt;https://xenodium.com/agent-shell-0-5-improvements&lt;/a&gt;][agent-shell 0.5 improvements]].&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://xenodium.com/introducing-agent-shell&quot;&gt;https://xenodium.com/introducing-agent-shell&lt;/a&gt;][Introducing Emacs agent-shell (powered by ACP)]].&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://xenodium.com/introducing-acpel&quot;&gt;https://xenodium.com/introducing-acpel&lt;/a&gt;][Introducing acp.el]].&lt;/li&gt; 
&lt;/ul&gt; 
&lt;ul&gt; 
 &lt;li&gt;Related projects&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;=agent-shell= relies on [[&lt;a href=&quot;https://github.com/xenodium/acp.el&quot;&gt;https://github.com/xenodium/acp.el&lt;/a&gt;][acp.el]] to communicate with agents via ACP ([[&lt;a href=&quot;https://agentclientprotocol.com/&quot;&gt;https://agentclientprotocol.com/&lt;/a&gt;][Agent Client Protocol]]).&lt;/p&gt; 
&lt;p&gt;We now have a handful of additional packages to extend the =agent-shell= experience:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/xenodium/emacs-skills&quot;&gt;https://github.com/xenodium/emacs-skills&lt;/a&gt;][emacs-skills]]: Claude Agent skills for Emacs.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/ElleNajt/agent-shell-to-go&quot;&gt;https://github.com/ElleNajt/agent-shell-to-go&lt;/a&gt;][agent-shell-to-go]]: Interact with =agent-shell= sessions from your mobile or any other device via Slack.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/Embedded-Focus/agent-circus&quot;&gt;https://github.com/Embedded-Focus/agent-circus&lt;/a&gt;][agent-circus]]: Run AI coding agents in sandboxed Docker containers.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/cmacrae/agent-shell-sidebar&quot;&gt;https://github.com/cmacrae/agent-shell-sidebar&lt;/a&gt;][agent-shell-sidebar]]: A sidebar add-on for =agent-shell=.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/dcluna/agent-shell-bookmark&quot;&gt;https://github.com/dcluna/agent-shell-bookmark&lt;/a&gt;][agent-shell-bookmark]]: Bookmark support for agent-shell sessions.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/gveres/agent-shell-workspace&quot;&gt;https://github.com/gveres/agent-shell-workspace&lt;/a&gt;][agent-shell-workspace]]: Dedicated tab-bar workspace for managing multiple =agent-shell= sessions.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/jethrokuan/agent-shell-manager&quot;&gt;https://github.com/jethrokuan/agent-shell-manager&lt;/a&gt;][agent-shell-manager]]: Tabulated view and management of =agent-shell= buffers.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/nineluj/agent-review&quot;&gt;https://github.com/nineluj/agent-review&lt;/a&gt;][agent-review]]: Code review interface for =agent-shell=.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/ultronozm/agent-shell-attention.el&quot;&gt;https://github.com/ultronozm/agent-shell-attention.el&lt;/a&gt;][agent-shell-attention.el]]: Mode-line attention tracker for =agent-shell=.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/xenodium/agent-shell-knockknock&quot;&gt;https://github.com/xenodium/agent-shell-knockknock&lt;/a&gt;][agent-shell-knockknock]]: Notifications for =agent-shell= via [[&lt;a href=&quot;https://github.com/konrad1977/knockknock&quot;&gt;https://github.com/konrad1977/knockknock&lt;/a&gt;][knockknock.el]].&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/zackattackz/agent-shell-notifications&quot;&gt;https://github.com/zackattackz/agent-shell-notifications&lt;/a&gt;][agent-shell-notifications]]: Desktop notifications for =agent-shell= events.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/ElleNajt/meta-agent-shell&quot;&gt;https://github.com/ElleNajt/meta-agent-shell&lt;/a&gt;][meta-agent-shell]]: Multi-agent coordination system for =agent-shell= with inter-agent communication, task tracking, and project-level dispatching.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/cxa/agent-shell-macext&quot;&gt;https://github.com/cxa/agent-shell-macext&lt;/a&gt;][agent-shell-macext]]: macOS-specific enhancements for =agent-shell=.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/lllShamanlll/agent-shell-org-transcript&quot;&gt;https://github.com/lllShamanlll/agent-shell-org-transcript&lt;/a&gt;][agent-shell-org-transcript]]: Org-mode transcripts for =agent-shell= sessions, with org-roam integration.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/eddof13/ob-agent-shell&quot;&gt;https://github.com/eddof13/ob-agent-shell&lt;/a&gt;][ob-agent-shell]]: Org Babel backend for executing =agent-shell= source blocks.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/Marx-A00/agent-recall&quot;&gt;https://github.com/Marx-A00/agent-recall&lt;/a&gt;][agent-recall]]: Search, browse, and resume =agent-shell= conversation transcripts.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/lgmoneda/agent-shell-pet&quot;&gt;https://github.com/lgmoneda/agent-shell-pet&lt;/a&gt;][agent-shell-pet]]: Codex-like pets that broadcast agent-shell session states.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/alberti42/agent-shell-math-renderer&quot;&gt;https://github.com/alberti42/agent-shell-math-renderer&lt;/a&gt;][agent-shell-math-renderer]]: Render LaTeX math equations as SVGs in =agent-shell=.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/junyi-hou/agent-shell-tramp&quot;&gt;https://github.com/junyi-hou/agent-shell-tramp&lt;/a&gt;][agent-shell-tramp]]: Tramp integration for =agent-shell=.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/nohzafk/agent-shell-hud&quot;&gt;https://github.com/nohzafk/agent-shell-hud&lt;/a&gt;][agent-shell-hud]]: Real-time =agent-shell= status overlay via a floating dashboard.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/timfel/agent-shell-desktop.el&quot;&gt;https://github.com/timfel/agent-shell-desktop.el&lt;/a&gt;][agent-shell-desktop]]: Desktop save mode integration for =agent-shell=. Saves and resumes shells by folder, config, and session id.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/ultronozm/agent-shell-links.el&quot;&gt;https://github.com/ultronozm/agent-shell-links.el&lt;/a&gt;][agent-shell-links.el]]: Bookmarks and Org links for =agent-shell= sessions.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/wandersoncferreira/agent-shell-dashboard&quot;&gt;https://github.com/wandersoncferreira/agent-shell-dashboard&lt;/a&gt;][agent-shell-dashboard]]: A landing page for =agent-shell=.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;ul&gt; 
 &lt;li&gt;Articles&lt;/li&gt; 
&lt;/ul&gt; 
&lt;ul&gt; 
 &lt;li&gt;20Y: [[&lt;a href=&quot;https://20y.hu/~slink/journal/agent-shell/index.html&quot;&gt;https://20y.hu/~slink/journal/agent-shell/index.html&lt;/a&gt;][Agentic development workflow in Emacs]]&lt;/li&gt; 
 &lt;li&gt;Skye: [[&lt;a href=&quot;https://skyefreeman.com/blog/2026/04/15/how-im-using-llms-with-emacs&quot;&gt;https://skyefreeman.com/blog/2026/04/15/how-im-using-llms-with-emacs&lt;/a&gt;][How I&#39;m using LLM&#39;s via Emacs]].&lt;/li&gt; 
 &lt;li&gt;sincebyte: [[&lt;a href=&quot;https://neoemacs.com/posts/agent-shell-cursor-agent-cli/&quot;&gt;https://neoemacs.com/posts/agent-shell-cursor-agent-cli/&lt;/a&gt;][Agent Shell Cursor Agent Cli]].&lt;/li&gt; 
 &lt;li&gt;Naputo: [[&lt;a href=&quot;https://blog.n-daisuke897.com/posts/2026-03-01-agent-shell-session-selection/&quot;&gt;https://blog.n-daisuke897.com/posts/2026-03-01-agent-shell-session-selection/&lt;/a&gt;][How to Select Sessions When Starting the agent-shell ACP Client Running on Emacs]]&lt;/li&gt; 
 &lt;li&gt;vandee: [[&lt;a href=&quot;https://www.vandee.art/blog/2026-01-23-my-agent-practice-with-opencode-in-emacs.html&quot;&gt;https://www.vandee.art/blog/2026-01-23-my-agent-practice-with-opencode-in-emacs.html&lt;/a&gt;][My Agent Practice with OpenCode in Emacs]].&lt;/li&gt; 
 &lt;li&gt;Fedora Project Wiki: [[&lt;a href=&quot;https://fedoraproject.org/wiki/SIGs/AI-ML#agent-shell&quot;&gt;https://fedoraproject.org/wiki/SIGs/AI-ML#agent-shell&lt;/a&gt;][AI/ML Special Interest Group]].&lt;/li&gt; 
&lt;/ul&gt; 
&lt;ul&gt; 
 &lt;li&gt;Icons&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Thanks to [[&lt;a href=&quot;https://github.com/lobehub/lobe-icons&quot;&gt;https://github.com/lobehub/lobe-icons&lt;/a&gt;][Lobe Icons]] for the lovely icons.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Setup&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;** External dependencies&lt;/p&gt; 
&lt;p&gt;*** Claude Agent SDK&lt;/p&gt; 
&lt;p&gt;For Anthropic&#39;s [[&lt;a href=&quot;https://code.claude.com/docs/en/overview&quot;&gt;https://code.claude.com/docs/en/overview&lt;/a&gt;][Claude Agent]] (formerly known as the Claude Code), follow [[&lt;a href=&quot;https://github.com/agentclientprotocol/claude-agent-acp&quot;&gt;https://github.com/agentclientprotocol/claude-agent-acp&lt;/a&gt;][claude-agent-acp instructions]], typically something like:&lt;/p&gt; 
&lt;p&gt;#+begin_src bash npm install -g @agentclientprotocol/claude-agent-acp #+end_src&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; The =-g= flag is required to install the binary globally so it&#39;s available in your PATH. After installation, verify it&#39;s available by running =which claude-agent-acp= in your terminal.&lt;/p&gt; 
&lt;p&gt;Optionally: You may also need [[&lt;a href=&quot;https://code.claude.com/docs/en/overview&quot;&gt;https://code.claude.com/docs/en/overview&lt;/a&gt;][Claude Agent]] itself if you want to use a Claude subscription (run the CLI outside of Emacs at least once to log in to your subscription and then use =agent-shell= from Emacs). Follow Claude Agent&#39;s [[&lt;a href=&quot;https://code.claude.com/docs/en/overview#get-started&quot;&gt;https://code.claude.com/docs/en/overview#get-started&lt;/a&gt;][get started]] for installation.&lt;/p&gt; 
&lt;p&gt;*** Codex&lt;/p&gt; 
&lt;p&gt;For OpenAI&#39;s Codex, install [[&lt;a href=&quot;https://github.com/agentclientprotocol/codex-acp&quot;&gt;https://github.com/agentclientprotocol/codex-acp&lt;/a&gt;][@agentclientprotocol/codex-acp]] (=npm install -g @agentclientprotocol/codex-acp=) and ensure the =codex-acp= executable is in PATH.&lt;/p&gt; 
&lt;p&gt;*** Gemini CLI&lt;/p&gt; 
&lt;p&gt;For Google&#39;s [[&lt;a href=&quot;https://github.com/google-gemini/gemini-cli&quot;&gt;https://github.com/google-gemini/gemini-cli&lt;/a&gt;][Gemini CLI]], be sure to get a recent release supporting the =--experimental-acp= flag.&lt;/p&gt; 
&lt;p&gt;*** Goose&lt;/p&gt; 
&lt;p&gt;For Goose CLI, install [[&lt;a href=&quot;https://goose-docs.ai/docs/getting-started/installation&quot;&gt;https://goose-docs.ai/docs/getting-started/installation&lt;/a&gt;][goose]] and ensure the =goose= executable is in PATH.&lt;/p&gt; 
&lt;p&gt;*** Cursor&lt;/p&gt; 
&lt;p&gt;For Cursor agent, install the official [[&lt;a href=&quot;https://cursor.com/docs/cli&quot;&gt;https://cursor.com/docs/cli&lt;/a&gt;][Cursor CLI]] and ensure the =agent= executable is in PATH. =agent-shell= uses its official ACP server (=agent acp=).&lt;/p&gt; 
&lt;p&gt;A recent Cursor CLI is required (the =acp= subcommand was added in 2026). Older CLIs won&#39;t expose =agent acp=.&lt;/p&gt; 
&lt;p&gt;*** Kimi Code CLI&lt;/p&gt; 
&lt;p&gt;For Kimi Code CLI, install with:&lt;/p&gt; 
&lt;p&gt;#+begin_src bash curl -L &lt;a href=&quot;http://code.kimi.com/install.sh&quot;&gt;code.kimi.com/install.sh&lt;/a&gt; | bash #+end_src&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://www.kimi.com/code&quot;&gt;https://www.kimi.com/code&lt;/a&gt; for details.&lt;/p&gt; 
&lt;p&gt;*** CodeBuddy&lt;/p&gt; 
&lt;p&gt;For CodeBuddy agent, install the CodeBuddy CLI and ensure ACP mode is available. For example:&lt;/p&gt; 
&lt;p&gt;#+begin_src bash codebuddy --acp #+end_src&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://www.codebuddy.ai/docs/zh/ide/Getting-Started/Installation&quot;&gt;https://www.codebuddy.ai/docs/zh/ide/Getting-Started/Installation&lt;/a&gt; for details.&lt;/p&gt; 
&lt;p&gt;*** Kiro CLI&lt;/p&gt; 
&lt;p&gt;For Kiro CLI, install with:&lt;/p&gt; 
&lt;p&gt;#+begin_src bash curl -fsSL &lt;a href=&quot;https://cli.kiro.dev/install&quot;&gt;https://cli.kiro.dev/install&lt;/a&gt; | bash #+end_src&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://kiro.dev/docs/cli/acp/&quot;&gt;https://kiro.dev/docs/cli/acp/&lt;/a&gt; for details.&lt;/p&gt; 
&lt;p&gt;*** Qwen Code&lt;/p&gt; 
&lt;p&gt;For Qwen Code, install with:&lt;/p&gt; 
&lt;p&gt;#+begin_src bash npm install -g @qwen-code/qwen-code@latest #+end_src&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://github.com/QwenLM/qwen-code&quot;&gt;https://github.com/QwenLM/qwen-code&lt;/a&gt; for details.&lt;/p&gt; 
&lt;p&gt;*** Auggie&lt;/p&gt; 
&lt;p&gt;For Auggie CLI, install with:&lt;/p&gt; 
&lt;p&gt;#+begin_src bash npm install -g @augmentcode/auggie #+end_src&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://docs.augmentcode.com/cli/overview&quot;&gt;https://docs.augmentcode.com/cli/overview&lt;/a&gt; for details. *** Mistral Vibe&lt;/p&gt; 
&lt;p&gt;For Mistral Vibe, install with:&lt;/p&gt; 
&lt;p&gt;#+begin_src bash uv tool install mistral-vibe #+end_src&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://github.com/mistralai/mistral-vibe&quot;&gt;https://github.com/mistralai/mistral-vibe&lt;/a&gt; for details.&lt;/p&gt; 
&lt;p&gt;*** Factory Droid&lt;/p&gt; 
&lt;p&gt;For Factory Droid, install Droid:&lt;/p&gt; 
&lt;p&gt;#+begin_src bash curl -fsSL &lt;a href=&quot;https://app.factory.ai/cli&quot;&gt;https://app.factory.ai/cli&lt;/a&gt; | sh #+end_src&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://factory.ai&quot;&gt;https://factory.ai&lt;/a&gt; for details.&lt;/p&gt; 
&lt;p&gt;*** Pi&lt;/p&gt; 
&lt;p&gt;For Pi coding agent, install the =pi-acp= adapter:&lt;/p&gt; 
&lt;p&gt;#+begin_src bash npm install -g pi-acp #+end_src&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://github.com/svkozak/pi-acp&quot;&gt;https://github.com/svkozak/pi-acp&lt;/a&gt; for details. *** Oh My Pi (=omp=)&lt;/p&gt; 
&lt;p&gt;For the =omp= agent, install with:&lt;/p&gt; 
&lt;p&gt;#+begin_src bash bun install -g @oh-my-pi/pi-coding-agent #+end_src&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://github.com/can1357/oh-my-pi&quot;&gt;https://github.com/can1357/oh-my-pi&lt;/a&gt; for details.&lt;/p&gt; 
&lt;p&gt;*** Opencode + local ollama models&lt;/p&gt; 
&lt;p&gt;For opencode coding agent, install with:&lt;/p&gt; 
&lt;p&gt;#+begin_src bash curl -fsSL &lt;a href=&quot;https://opencode.ai/install&quot;&gt;https://opencode.ai/install&lt;/a&gt; | bash #+end_src&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://opencode.ai/&quot;&gt;https://opencode.ai/&lt;/a&gt; for details.&lt;/p&gt; 
&lt;p&gt;For local ollama models, sudo permission is needed to initialize ~ollama.service~. The following will install ollama and a local Qwen2.5:7b model.&lt;/p&gt; 
&lt;p&gt;#+begin_src bash curl -fsSL &lt;a href=&quot;https://ollama.com/install.sh&quot;&gt;https://ollama.com/install.sh&lt;/a&gt; | sh ollama pull qwen2.5:7b #+end_src&lt;/p&gt; 
&lt;p&gt;If you are behind a network proxy, ~ollama pull~ will timeout. You then need to add proxy settings inside ~/etc/systemd/system/ollama.service~&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;https://ollama.com/&quot;&gt;https://ollama.com/&lt;/a&gt; for details&lt;/p&gt; 
&lt;p&gt;** Installation&lt;/p&gt; 
&lt;p&gt;=agent-shell= is powered by built-in =comint-shell=, via [[&lt;a href=&quot;https://github.com/xenodium/shell-maker&quot;&gt;https://github.com/xenodium/shell-maker&lt;/a&gt;][shell-maker]], available on [[&lt;a href=&quot;https://melpa.org/#/shell-maker&quot;&gt;https://melpa.org/#/shell-maker&lt;/a&gt;][MELPA]].&lt;/p&gt; 
&lt;p&gt;Both [[&lt;a href=&quot;https://melpa.org/#/agent-shell&quot;&gt;https://melpa.org/#/agent-shell&lt;/a&gt;][agent-shell]] and its dependency [[&lt;a href=&quot;https://melpa.org/#/acp&quot;&gt;https://melpa.org/#/acp&lt;/a&gt;][acp.el]] are now available on MELPA.&lt;/p&gt; 
&lt;p&gt;You can install via:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (use-package agent-shell :ensure t :ensure-system-package ;; Add agent installation configs here ((claude . &quot;brew install claude-code&quot;) (claude-agent-acp . &quot;npm install -g @agentclientprotocol/claude-agent-acp&quot;))) #+end_src&lt;/p&gt; 
&lt;p&gt;This will automatically install the required dependencies ([[&lt;a href=&quot;https://melpa.org/#/acp&quot;&gt;https://melpa.org/#/acp&lt;/a&gt;][acp.el]] and [[&lt;a href=&quot;https://melpa.org/#/shell-maker&quot;&gt;https://melpa.org/#/shell-maker&lt;/a&gt;][shell-maker]]).&lt;/p&gt; 
&lt;p&gt;*** Optional: image utilities&lt;/p&gt; 
&lt;p&gt;Pasting images from the clipboard (=agent-shell-send-clipboard-image= or =yank= or =C-y=) and capturing screenshots (=agent-shell-send-screenshot=) rely on external tools. Install the ones for your platform:&lt;/p&gt; 
&lt;p&gt;| Platform | Clipboard paste | Screenshot capture | |-----------------+------------------------------------------+------------------------------| | macOS | =brew install pngpaste= | =screencapture= (preinstalled) | | Linux (Wayland) | =wl-paste= (e.g. =apt install wl-clipboard=) | =import= (from ImageMagick) | | Linux (X11) | =apt install xclip= | =import= (from ImageMagick) | | Windows | =powershell= | (not bundled) |&lt;/p&gt; 
&lt;p&gt;Handlers are detected at runtime via =executable-find=. See =agent-shell-clipboard-image-handlers= and =agent-shell-screenshot-command= to customize.&lt;/p&gt; 
&lt;p&gt;*** Doom Emacs&lt;/p&gt; 
&lt;p&gt;If you are using Doom Emacs and would like to use the =package!= macro:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (package! shell-maker) (package! acp) (package! agent-shell) #+end_src&lt;/p&gt; 
&lt;p&gt;Run =doom sync= and restart.&lt;/p&gt; 
&lt;p&gt;Include =require= before configuration:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (require &#39;acp) (require &#39;agent-shell) ;; rest of config... #+end_src&lt;/p&gt; 
&lt;p&gt;** Configuration&lt;/p&gt; 
&lt;p&gt;Configure authentication for the agent providers you want to use.&lt;/p&gt; 
&lt;p&gt;*** Environment variables&lt;/p&gt; 
&lt;p&gt;Pass environment variables to the spawned agent process by customizing the &lt;code&gt;agent-shell-*-environment&lt;/code&gt; variable with &lt;code&gt;agent-shell-make-environment-variables&lt;/code&gt;. The helper accepts key/value pairs and exports them when the agent starts.&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-anthropic-claude-environment (agent-shell-make-environment-variables &quot;ANTHROPIC_API_KEY&quot; (auth-source-pass-get &#39;secret &quot;anthropic-api-key&quot;) &quot;HTTPS_PROXY&quot; &quot;&lt;a href=&quot;http://proxy.example.com:8080&quot;&gt;http://proxy.example.com:8080&lt;/a&gt;&quot;)) #+end_src&lt;/p&gt; 
&lt;p&gt;**** Inheriting environment variables&lt;/p&gt; 
&lt;p&gt;By default, the agent process starts with a minimal environment. To inherit environment variables from the parent Emacs process, use the &lt;code&gt;:inherit-env t&lt;/code&gt; parameter in &lt;code&gt;agent-shell-make-environment-variables&lt;/code&gt;:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setenv &quot;ANTHROPIC_API_KEY&quot; (auth-source-pass-get &#39;secret &quot;anthropic-api-key&quot;))&lt;/p&gt; 
&lt;p&gt;(setq agent-shell-anthropic-claude-environment (agent-shell-make-environment-variables :inherit-env t)) #+end_src&lt;/p&gt; 
&lt;p&gt;This ensures that environment variables like &lt;code&gt;PATH&lt;/code&gt;, &lt;code&gt;HOME&lt;/code&gt;, and others from your Emacs session are available to the agent process, while still allowing you to override or add specific variables.&lt;/p&gt; 
&lt;p&gt;**** Loading environment variables from files&lt;/p&gt; 
&lt;p&gt;You can load environment variables from .env files using the &lt;code&gt;:load-env&lt;/code&gt; parameter. This supports both single and multiple files:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp ;; Load from a single .env file (setq agent-shell-anthropic-claude-environment (agent-shell-make-environment-variables :load-env &quot;~/.env&quot; &quot;CUSTOM_VAR&quot; &quot;custom_value&quot;))&lt;/p&gt; 
&lt;p&gt;;; Load from multiple .env files (setq agent-shell-anthropic-claude-environment (agent-shell-make-environment-variables :load-env &#39;(&quot;~/.env&quot; &quot;.env.local&quot;) :inherit-env t)) #+end_src&lt;/p&gt; 
&lt;p&gt;The .env files should contain variables in the format &lt;code&gt;KEY=value&lt;/code&gt;, with one variable per line. Comments (lines starting with &lt;code&gt;#&lt;/code&gt;) and empty lines are ignored.&lt;/p&gt; 
&lt;p&gt;*** Anthropic Claude&lt;/p&gt; 
&lt;p&gt;For login-based authentication (default):&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-anthropic-authentication (agent-shell-anthropic-make-authentication :login t)) #+end_src&lt;/p&gt; 
&lt;p&gt;For API key authentication:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp ;; With string (setq agent-shell-anthropic-authentication (agent-shell-anthropic-make-authentication :api-key &quot;your-anthropic-api-key-here&quot;))&lt;/p&gt; 
&lt;p&gt;;; With function (setq agent-shell-anthropic-authentication (agent-shell-anthropic-make-authentication :api-key (lambda () (auth-source-pass-get &#39;secret &quot;anthropic-api-key&quot;)))) #+end_src&lt;/p&gt; 
&lt;p&gt;For OAuth token authentication (the =CLAUDE_CODE_OAUTH_TOKEN= we get from =claude setup-token=):&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp ;; With string (setq agent-shell-anthropic-authentication (agent-shell-anthropic-make-authentication :oauth &quot;your-oauth-token-here&quot;))&lt;/p&gt; 
&lt;p&gt;;; With function (setq agent-shell-anthropic-authentication (agent-shell-anthropic-make-authentication :oauth (lambda () (auth-source-pass-get &quot;secret&quot; &quot;anthropic-oauth-token&quot;)))) #+end_src&lt;/p&gt; 
&lt;p&gt;For alternative Anthropic-compatible API endpoints, configure via environment variables:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-anthropic-claude-environment (agent-shell-make-environment-variables &quot;ANTHROPIC_BASE_URL&quot; &quot;&lt;a href=&quot;https://api.moonshot.cn/anthropic&quot;&gt;https://api.moonshot.cn/anthropic&lt;/a&gt;&quot; &quot;ANTHROPIC_MODEL&quot; &quot;kimi-k2-turbo-preview&quot; &quot;ANTHROPIC_SMALL_FAST_MODEL&quot; &quot;kimi-k2-turbo-preview&quot;)) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Google Gemini&lt;/p&gt; 
&lt;p&gt;For login-based authentication (default):&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-google-authentication (agent-shell-google-make-authentication :login t)) #+end_src&lt;/p&gt; 
&lt;p&gt;For API key authentication:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp ;; With string (setq agent-shell-google-authentication (agent-shell-google-make-authentication :api-key &quot;your-google-api-key-here&quot;))&lt;/p&gt; 
&lt;p&gt;;; With function (setq agent-shell-google-authentication (agent-shell-google-make-authentication :api-key (lambda () (auth-source-pass-get &#39;secret &quot;google-api-key&quot;)))) #+end_src&lt;/p&gt; 
&lt;p&gt;For Vertex AI authentication:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-google-authentication (agent-shell-google-make-authentication :vertex-ai t)) #+end_src&lt;/p&gt; 
&lt;p&gt;*** OpenAI Codex&lt;/p&gt; 
&lt;p&gt;For login-based authentication (default):&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-openai-authentication (agent-shell-openai-make-authentication :login t)) #+end_src&lt;/p&gt; 
&lt;p&gt;For API key authentication:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp ;; With string (setq agent-shell-openai-authentication (agent-shell-openai-make-authentication :api-key &quot;your-openai-api-key-here&quot;))&lt;/p&gt; 
&lt;p&gt;;; With function (setq agent-shell-openai-authentication (agent-shell-openai-make-authentication :api-key (lambda () (auth-source-pass-get &#39;secret &quot;openai-api-key&quot;)))) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Goose&lt;/p&gt; 
&lt;p&gt;By default, authentication is handled by Goose&#39;s built-in configuration. This needs no =agent-shell= configuration.&lt;/p&gt; 
&lt;p&gt;Optionally, pass an OpenAI API key from =agent-shell= instead:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp ;; With string (setq agent-shell-goose-authentication (agent-shell-make-goose-authentication :openai-api-key &quot;your-openai-api-key-here&quot;))&lt;/p&gt; 
&lt;p&gt;;; With function (setq agent-shell-goose-authentication (agent-shell-make-goose-authentication :openai-api-key (lambda () (auth-source-pass-get &#39;secret &quot;openai-api-key&quot;)))) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Qwen Code&lt;/p&gt; 
&lt;p&gt;For OAuth login-based authentication:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-qwen-authentication (agent-shell-qwen-make-authentication :login t)) #+end_src&lt;/p&gt; 
&lt;p&gt;For an OpenAI-compatible provider (for example OpenRouter), pass the API key and set the base URL and model via =agent-shell-qwen-environment=:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp ;; With string (setq agent-shell-qwen-authentication (agent-shell-qwen-make-authentication :openai-api-key &quot;your-openai-api-key-here&quot;))&lt;/p&gt; 
&lt;p&gt;;; With function (setq agent-shell-qwen-authentication (agent-shell-qwen-make-authentication :openai-api-key (lambda () (auth-source-pass-get &#39;secret &quot;openrouter-api-key&quot;))))&lt;/p&gt; 
&lt;p&gt;(setq agent-shell-qwen-environment (agent-shell-make-environment-variables &quot;OPENAI_BASE_URL&quot; &quot;&lt;a href=&quot;https://openrouter.ai/api/v1&quot;&gt;https://openrouter.ai/api/v1&lt;/a&gt;&quot; &quot;OPENAI_MODEL&quot; &quot;x-ai/grok-4.3&quot;)) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Cursor&lt;/p&gt; 
&lt;p&gt;By default authentication is handled externally: run =agent login= once outside Emacs and agent-shell uses that existing login (it sends no ACP authenticate request). This needs no configuration.&lt;/p&gt; 
&lt;p&gt;Optionally, have agent-shell drive login-based authentication (=cursor_login=):&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-cursor-authentication (agent-shell-cursor-make-authentication :login t)) #+end_src&lt;/p&gt; 
&lt;p&gt;For API key authentication (passed via the =CURSOR_API_KEY= environment variable):&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp ;; With string (setq agent-shell-cursor-authentication (agent-shell-cursor-make-authentication :api-key &quot;your-cursor-api-key-here&quot;))&lt;/p&gt; 
&lt;p&gt;;; With function (setq agent-shell-cursor-authentication (agent-shell-cursor-make-authentication :api-key (lambda () (auth-source-pass-get &#39;secret &quot;cursor-api-key&quot;)))) #+end_src&lt;/p&gt; 
&lt;p&gt;For auth token authentication (passed via the =CURSOR_AUTH_TOKEN= environment variable):&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-cursor-authentication (agent-shell-cursor-make-authentication :auth-token &quot;your-cursor-auth-token&quot;)) #+end_src&lt;/p&gt; 
&lt;p&gt;For no authentication (already authenticated externally):&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-cursor-authentication (agent-shell-cursor-make-authentication :none t)) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Auggie&lt;/p&gt; 
&lt;p&gt;For login-based authentication (default):&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-auggie-authentication (agent-shell-make-auggie-authentication :login t)) #+end_src&lt;/p&gt; 
&lt;p&gt;For no authentication (when using alternative authentication methods):&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-auggie-authentication (agent-shell-make-auggie-authentication :none t)) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Mistral Vibe&lt;/p&gt; 
&lt;p&gt;For API key authentication:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp ;; With string (setq agent-shell-mistral-authentication (agent-shell-mistral-make-authentication :api-key &quot;your-mistral-api-key-here&quot;))&lt;/p&gt; 
&lt;p&gt;;; With function (reusing the API key configured in vibe) (setq agent-shell-mistral-authentication (agent-shell-mistral-make-authentication :api-key (lambda () (string-trim (shell-command-to-string &quot;source ~/.vibe/.env; echo $MISTRAL_API_KEY&quot;))))) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Opencode + local ollama Qwen2.5&lt;/p&gt; 
&lt;p&gt;If ~opencode~ is not found by ~agent-shell~, you can add it to the search path&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (use-package agent-shell :ensure t :config (add-to-list &#39;exec-path &quot;~/.opencode/bin/&quot;)) #+end_src&lt;/p&gt; 
&lt;p&gt;To register the local Qwen2.5:7b model in opencode, two files needs to be edited:&lt;/p&gt; 
&lt;p&gt;~/.config/opencode/opencode.json~ #+BEGIN_SRC js { &quot;$schema&quot;: &quot;&lt;a href=&quot;https://opencode.ai/config.json&quot;&gt;https://opencode.ai/config.json&lt;/a&gt;&quot;, &quot;permission&quot;: { &quot;edit&quot;: &quot;ask&quot;, &quot;bash&quot;: &quot;ask&quot;, &quot;webfetch&quot;: &quot;allow&quot; }, &quot;provider&quot;: { &quot;ollama&quot;: { &quot;name&quot;: &quot;qwen2.5:7b&quot;, &quot;npm&quot;: &quot;@ai-sdk/openai-compatible&quot;, &quot;options&quot;: { &quot;baseURL&quot;: &quot;&lt;a href=&quot;http://localhost:11434/v1&quot;&gt;http://localhost:11434/v1&lt;/a&gt;&quot; }, &quot;models&quot;: { &quot;qwen2.5:7b&quot;: { &quot;name&quot;: &quot;Qwen2.5 7b&quot; } } } } } #+END_SRC&lt;/p&gt; 
&lt;p&gt;and a dummy auth file ~/.local/share/opencode/auth.json~&lt;/p&gt; 
&lt;p&gt;#+begin_src js { &quot;ollama&quot;: { &quot;type&quot;: &quot;api&quot;, &quot;key&quot;: &quot;ollama&quot; } } #+end_src&lt;/p&gt; 
&lt;p&gt;Huge thanks for /gdindi/ for finding and and describing this in &lt;a href=&quot;https://github.com/xenodium/agent-shell/issues/526&quot;&gt;https://github.com/xenodium/agent-shell/issues/526&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;*** Customizing Available Agents&lt;/p&gt; 
&lt;p&gt;By default, =agent-shell= includes configurations for all supported agents (Claude Agent, Gemini CLI, Codex, Goose, Cursor, CodeBuddy, Qwen Code, and Auggie). You can customize which agents are available through the =agent-shell-agent-configs= variable.&lt;/p&gt; 
&lt;p&gt;** Usage&lt;/p&gt; 
&lt;p&gt;*** Quick Start&lt;/p&gt; 
&lt;p&gt;=M-x agent-shell= - Start or reuse any of the known agents.&lt;/p&gt; 
&lt;p&gt;You can select and start any of the known agent shells (see =agent-shell-agent-configs=) via the =agent-shell= interactive command and enables reusing existing shells when available. With a prefix argument (=C-u M-x agent-shell=), it forces starting a new shell session, thus instantiating multiple agent shells.&lt;/p&gt; 
&lt;p&gt;*** Specific Agent Commands&lt;/p&gt; 
&lt;p&gt;Start a specific agent shell session directly:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;=M-x agent-shell-anthropic-start-claude-code= - Start a Claude Agent session&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-auggie-start-agent= - Start an Auggie agent session&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-codebuddy-start-agent= - Start a CodeBuddy agent session&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-openai-start-codex= - Start a Codex agent session&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-google-start-gemini= - Start a Gemini agent session&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-goose-start-agent= - Start a Goose agent session&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-cursor-start-agent= - Start a Cursor agent session&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-kiro-start-agent= - Start a Kiro CLI agent session&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-mistral-start-vibe= - Start a Mistral Vibe agent session&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-qwen-start= - Start a Qwen Code agent session&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-droid-start-agent= - Start a Factory Droid agent session&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-pi-start-agent= - Start a Pi coding agent session&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;*** Setting a default agent for all new shells&lt;/p&gt; 
&lt;p&gt;You can set a default agent to use for all new shells started via =agent-shell= like so:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-preferred-agent-config (agent-shell-anthropic-make-claude-code-config)) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Configuring MCP servers&lt;/p&gt; 
&lt;p&gt;You can configure MCP servers directly via =agent-shell=. This allows you to avoid having to repeat configurations across every agent that you use.&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-mcp-servers &#39;(((name . &quot;notion&quot;) (type . &quot;http&quot;) (headers . []) (url . &quot;&lt;a href=&quot;https://mcp.notion.com/mcp&quot;&gt;https://mcp.notion.com/mcp&lt;/a&gt;&quot;)))) #+end_src&lt;/p&gt; 
&lt;p&gt;** Running agents in Devcontainers / Docker containers (Experimental)&lt;/p&gt; 
&lt;p&gt;=agent-shell= provides rudimentary support for running agents and shell commands in containers.&lt;/p&gt; 
&lt;p&gt;Use =agent-shell-command-prefix= to prefix the command that starts the agent, or a shell command that should be run so it is executed inside the container.&lt;/p&gt; 
&lt;p&gt;*** Static command list&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-command-prefix &#39;(&quot;devcontainer&quot; &quot;exec&quot; &quot;--workspace-folder&quot; &quot;.&quot;)) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Function-based configuration&lt;/p&gt; 
&lt;p&gt;For dynamic per-agent containers, provide a function that takes the current agent-shell buffer and returns the command list:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-command-prefix (lambda (buffer) (let ((config (agent-shell-get-config buffer))) (pcase (map-elt config :identifier) (&#39;claude-code &#39;(&quot;docker&quot; &quot;exec&quot; &quot;claude-dev&quot; &quot;--&quot;)) (&#39;gemini-cli &#39;(&quot;docker&quot; &quot;exec&quot; &quot;gemini-dev&quot; &quot;--&quot;)) (_ &#39;(&quot;devcontainer&quot; &quot;exec&quot; &quot;.&quot;)))))) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Per-session containers&lt;/p&gt; 
&lt;p&gt;You can use different containers for different shell sessions, even of the same agent type:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-command-prefix (lambda (buffer) ;; Different container based on project (if (string-match &quot;project-a&quot; (buffer-name buffer)) &#39;(&quot;docker&quot; &quot;exec&quot; &quot;project-a-dev&quot; &quot;--&quot;) &#39;(&quot;docker&quot; &quot;exec&quot; &quot;project-b-dev&quot; &quot;--&quot;)))) #+end_src&lt;/p&gt; 
&lt;p&gt;Note that any =:environment-variables= you may have passed to =acp-make-client= will not apply to the agent process running inside the container. It&#39;s expected to inject environment variables by means of your devcontainer configuration / Dockerfile.&lt;/p&gt; 
&lt;p&gt;Next, set an =agent-shell-path-resolver-function= that resolves container paths in the local working directory, and vice versa. Agent shell provides the =agent-shell-devcontainer-resolve-path= function for use with devcontainers specifically: it reads the =workspaceFolder= specified in =.devcontainer/devcontainer.json=, or uses the default value of =/workspaces/
 &lt;repository-name&gt;
  = otherwise.
 &lt;/repository-name&gt;&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-path-resolver-function #&#39;agent-shell-devcontainer-resolve-path) #+end_src&lt;/p&gt; 
&lt;p&gt;Note that this allows the agent to access files on your local file-system. While care has been taken to restrict access to files in the local working directory, it&#39;s probably possible for a malicious agent to circumvent this restriction.&lt;/p&gt; 
&lt;p&gt;Optional: to prevent the agent running inside the container to access your local file-system altogether and to have it read/modify files inside the container directly, in addition to setting the resolver function, disable the &quot;read/write text file&quot; client capabilities:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setq agent-shell-text-file-capabilities nil) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Data storage location&lt;/p&gt; 
&lt;p&gt;By default, agent-shell stores per-project data (transcripts, screenshots, etc.) under a =.agent-shell/= directory in the project root, and automatically adds that directory to =.gitignore= the first time it is created. This is a one-time operation: removing the entry from =.gitignore= will not cause it to be re-added. If you configure =agent-shell-dot-subdir-function= to store data outside the project =.agent-shell/= directory, agent-shell will not update the project&#39;s =.gitignore=.&lt;/p&gt; 
&lt;p&gt;You can change where this data is stored by setting =agent-shell-dot-subdir-function= to a custom function. The function receives one argument, SUBDIR (e.g. =&quot;screenshots&quot;=), and must return the absolute path to that subdirectory (without creating it).&lt;/p&gt; 
&lt;p&gt;For example, to store data under =user-emacs-directory= instead of the project tree, flattening the project path into a directory name:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (defun my/agent-shell-dot-subdir (subdir) (let* ((cwd (string-remove-suffix &quot;/&quot; (agent-shell-cwd))) (sanitized (replace-regexp-in-string &quot;/&quot; &quot;-&quot; (string-remove-prefix &quot;/&quot; cwd)))) (expand-file-name subdir (locate-user-emacs-file (concat &quot;agent-shell/&quot; sanitized)))))&lt;/p&gt; 
&lt;p&gt;(setopt agent-shell-dot-subdir-function #&#39;my/agent-shell-dot-subdir) #+end_src&lt;/p&gt; 
&lt;p&gt;This stores data at a path like =~/.emacs.d/agent-shell/home-user-src-myproject/screenshots/=.&lt;/p&gt; 
&lt;p&gt;*** Screenshots from clipboard&lt;/p&gt; 
&lt;p&gt;You can send a screenshot from your clipboard to your shell with =agent-shell-send-clipboard-image=. Call with =C-u= to =agent-shell-send-clipboard-image-to= to select from your shells. agent-shell relies on external programs to write an image from clipboard to file as configured in =agent-shell-clipboard-image-handlers=. Preconfigured handlers are&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;=wl-paste= for Wayland desktops,&lt;/li&gt; 
 &lt;li&gt;=xclip= for Xorg,&lt;/li&gt; 
 &lt;li&gt;=pngpaste= for MacOS.&lt;/li&gt; 
 &lt;li&gt;=powershell= for Windows.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;*** Inhibiting minor modes during file writes&lt;/p&gt; 
&lt;p&gt;Some minor modes (for example, =aggressive-indent-mode=) can interfere with an agent&#39;s edits. Agent Shell can temporarily disable selected per-buffer minor modes while applying edits.&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setopt agent-shell-write-inhibit-minor-modes &#39;(aggressive-indent-mode)) #+end_src&lt;/p&gt; 
&lt;p&gt;*** Keeping the system awake during long turns&lt;/p&gt; 
&lt;p&gt;Long agent turns can outlast the system idle-sleep timeout, suspending the machine (and the agent) before the turn completes. On Emacs 31.1 or later, =agent-shell-inhibit-system-sleep= (enabled by default) keeps the system awake for the duration of each turn and releases the block once the turn finishes, so the system is only kept awake while there is work in progress (the display is still allowed to blank). This relies on the built-in [[&lt;a href=&quot;https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/system-sleep.el&quot;&gt;https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/system-sleep.el&lt;/a&gt;][=system-sleep=]] library and has no effect on earlier Emacs versions. It does not prevent &quot;hard&quot; sleep such as closing a laptop lid.&lt;/p&gt; 
&lt;p&gt;To turn it off:&lt;/p&gt; 
&lt;p&gt;#+begin_src emacs-lisp (setopt agent-shell-inhibit-system-sleep nil) #+end_src&lt;/p&gt; 
&lt;p&gt;All of the above settings can be applied on a per-project basis using [[&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&lt;/a&gt;][directory-local variables]].&lt;/p&gt; 
&lt;p&gt;** Key bindings&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;=RET= - Submits prompt.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;=M-J= - Iserts newline.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;=C-c C-c= - Interrupt current agent operation&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;=TAB and Shift-TAB= - Navigate interactive elements&lt;/p&gt; &lt;p&gt;To customize =RET= binding behaviour, you can use something like:&lt;/p&gt; &lt;p&gt;#+begin_src emacs-lisp :lexical no (use-package agent-shell :bind (:map agent-shell-mode-map (&quot;RET&quot; . newline) (&quot;M-RET&quot; . shell-maker-submit))) #+end_src&lt;/p&gt; &lt;p&gt;Or if you prefer C-c C-c to send and C-c C-k to interrupt, use the following:&lt;/p&gt; &lt;p&gt;#+begin_src emacs-lisp :lexical no (use-package agent-shell :bind (:map agent-shell-mode-map (&quot;RET&quot; . newline) (&quot;C-c C-c&quot; . shell-maker-submit) (&quot;C-c C-k&quot; . agent-shell-interrupt))) #+end_src&lt;/p&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;*** Session controls&lt;/p&gt; 
&lt;p&gt;When the active agent advertises the corresponding session option, you can switch it from the shell buffer:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;=C-c C-v= - Set model.&lt;/li&gt; 
 &lt;li&gt;=C-c C-m= - Set session mode.&lt;/li&gt; 
 &lt;li&gt;=C-c C-t= - Set thought level (reasoning effort).&lt;/li&gt; 
 &lt;li&gt;=C-
  &lt;tab&gt;
   = - Cycle session mode.
  &lt;/tab&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;The current selections are shown in the header right after the agent name; click any segment to open a popup menu. The thought level segment only appears for models that expose it (e.g. Claude Sonnet/Opus with effort levels; Codex&#39;s reasoning_effort).&lt;/p&gt; 
&lt;p&gt;From the viewport (=agent-shell-viewport-view-mode= / =agent-shell-viewport-edit-mode=), the same controls are bound to:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;View mode: =v= (model), =s= (mode), =t= (thought level).&lt;/li&gt; 
 &lt;li&gt;Edit mode: =C-c C-v=, =C-c C-m=, =C-c C-t=.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;*** Evil Evil users may want to rebind ~RET~ for inserting a new line in =insert mode= and sending the prompt in =normal mode=.&lt;/p&gt; 
&lt;p&gt;Also, when viewing diffs (before accepting changes) it may be annoying having to enter =insert mode= to send keys (~y/n/p/q/etc~). If this is your case, you can make these buffers start in Emacs mode (you can always go to Evil modes if you need to with ~C-z~). #+begin_src emacs-lisp (use-package agent-shell :config ;; Evil state-specific RET behavior: insert mode = newline, normal mode = send (evil-define-key &#39;insert agent-shell-mode-map (kbd &quot;RET&quot;) #&#39;newline) (evil-define-key &#39;normal agent-shell-mode-map (kbd &quot;RET&quot;) #&#39;comint-send-input)&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;;; Configure *agent-shell-diff* buffers to start in Emacs state
(add-hook &#39;diff-mode-hook
    (lambda ()
      (when (string-match-p &quot;\\*agent-shell-diff\\*&quot; (buffer-name))
	(evil-emacs-state)))))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;#+end_src&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Customizations&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;#+BEGIN_SRC emacs-lisp :results table :colnames &#39;(&quot;Custom variable&quot; &quot;Description&quot;) :exports results (let ((rows)) (mapatoms (lambda (symbol) (when (and (string-match &quot;^agent-shell&quot; (symbol-name symbol)) (custom-variable-p symbol)) (push `(,symbol ,(car (split-string (or (documentation-property symbol &#39;variable-documentation) (get (indirect-variable symbol) &#39;variable-documentation) (get symbol &#39;variable-documentation) &quot;&quot;) &quot;\n&quot;))) rows)))) (sort rows (lambda (a b) (string&amp;lt; (symbol-name (car a)) (symbol-name (car b)))))) #+END_SRC&lt;/p&gt; 
&lt;p&gt;#+RESULTS: | Custom variable | Description | |-----------------------------------------------+---------------------------------------------------------------------------------| | agent-shell-agent-configs | The list of known agent configurations. | | agent-shell-anthropic-authentication | Configuration for Anthropic authentication. | | agent-shell-anthropic-claude-acp-command | Command and parameters for the Anthropic Claude client. | | agent-shell-anthropic-claude-command | Command and parameters for the Anthropic Claude client. | | agent-shell-anthropic-claude-environment | Environment variables for the Anthropic Claude client. | | agent-shell-anthropic-default-model-id | Default Anthropic model ID. | | agent-shell-anthropic-default-session-mode-id | Default Anthropic session mode ID. | | agent-shell-auggie-acp-command | Command and parameters for the Auggie client. | | agent-shell-auggie-authentication | Configuration for Auggie authentication. | | agent-shell-auggie-environment | Environment variables for the Auggie client. | | agent-shell-buffer-name-format | Format to use when generating agent shell buffer names. | | agent-shell-busy-indicator-frames | Frames for the busy indicator animation. | | agent-shell-clipboard-image-handlers | Handlers for saving clipboard images to a file. | | agent-shell-completion-mode-hook | Hook run after entering or leaving ‘agent-shell-completion-mode’. | | agent-shell-command-prefix | Command prefix for executing commands in a container. | | agent-shell-context-sources | Sources to consider when determining M-x agent-shell automatic context. | | agent-shell-cursor-acp-command | Command and parameters for the Cursor agent client. | | agent-shell-cursor-environment | Environment variables for the Cursor agent client. | | agent-shell-display-action | Display action for agent shell buffers. | | agent-shell-droid-acp-command | Command and parameters for the Factory Droid ACP client. | | agent-shell-droid-authentication | Configuration for Factory Droid authentication. | | agent-shell-droid-environment | Environment variables for the Factory Droid ACP client. | | agent-shell-embed-file-size-limit | Maximum file size in bytes for embedding with ContentBlock::Resource. | | agent-shell-file-completion-enabled | Non-nil automatically enables file completion when starting shells. | | agent-shell-github-acp-command | Command and parameters for the GitHub Copilot agent client. | | agent-shell-github-default-model-id | Default GitHub Copilot model ID. | | agent-shell-github-default-session-mode-id | Default GitHub Copilot session mode ID. | | agent-shell-github-environment | Environment variables for the GitHub Copilot agent client. | | agent-shell-google-authentication | Configuration for Google authentication. | | agent-shell-google-gemini-acp-command | Command and parameters for the Gemini client. | | agent-shell-google-gemini-environment | Environment variables for the Google Gemini client. | | agent-shell-goose-acp-command | Command and parameters for the Goose client. | | agent-shell-goose-authentication | Configuration for Goose authentication. | | agent-shell-goose-environment | Environment variables for the Goose client. | | agent-shell-header-style | Style for agent shell buffer headers. | | agent-shell-highlight-blocks | Whether or not to highlight source blocks. | | agent-shell-mcp-servers | List of MCP servers to initialize when creating a new session. | | agent-shell-mistral-acp-command | Command and parameters for the Mistral Vibe client. | | agent-shell-mistral-authentication | Configuration for Mistral AI authentication. | | agent-shell-mistral-default-model-id | Default Mistral AI model ID. | | agent-shell-mistral-default-session-mode-id | Default Mistral AI session mode ID. | | agent-shell-mistral-environment | Environment variables for the Mistral Vibe client. | | agent-shell-openai-authentication | Configuration for OpenAI authentication. | | agent-shell-openai-codex-acp-command | Command and parameters for the OpenAI Codex client. | | agent-shell-openai-codex-environment | Environment variables for the OpenAI Codex client. | | agent-shell-openai-default-model-id | Default Codex model ID. | | agent-shell-openai-default-session-mode-id | Default Codex session mode ID. | | agent-shell-opencode-acp-command | Command and parameters for the OpenCode client. | | agent-shell-opencode-authentication | Configuration for OpenCode authentication. | | agent-shell-opencode-default-model-id | Default OpenCode model ID. | | agent-shell-opencode-default-session-mode-id | Default OpenCode session mode ID. | | agent-shell-opencode-environment | Environment variables for the OpenCode client. | | agent-shell-path-resolver-function | Function for resolving remote paths on the local file-system, and vice versa. | | agent-shell-permission-icon | Icon displayed when shell commands require permission to execute. | | agent-shell-pi-acp-command | Command and parameters for the Pi ACP client. | | agent-shell-pi-environment | Environment variables for the Pi client. | | agent-shell-prefer-viewport-interaction | Non-nil makes ‘agent-shell’ prefer viewport interaction over shell interaction. | | agent-shell-preferred-agent-config | Default agent to use for all new shells. | | agent-shell-qwen-acp-command | Command and parameters for the Qwen Code client. | | agent-shell-qwen-authentication | Configuration for Qwen Code authentication. | | agent-shell-qwen-environment | Environment variables for the Qwen Code client. | | agent-shell-session-restore-verbosity | How much prior context to show when restoring a session. | | agent-shell-screenshot-command | The program to use for capturing screenshots. | | agent-shell-section-functions | Abnormal hook run after overlays are applied (experimental). | | agent-shell-session-strategy | How to handle sessions when starting a new shell. | | agent-shell-show-busy-indicator | Non-nil to show the busy indicator animation in the header and mode line. | | agent-shell-show-config-icons | Whether to show icons in agent config selection. | | agent-shell-show-context-usage-indicator | Non-nil to show the context usage indicator in the header and mode line. | | agent-shell-show-usage-at-turn-end | Whether to display usage information when agent turn ends. | | agent-shell-show-welcome-message | Non-nil to show welcome message. | | agent-shell-text-file-capabilities | Whether agents are initialized with read/write text file capabilities. | | agent-shell-thought-process-expand-by-default | Whether thought process sections should be expanded by default. | | agent-shell-thought-process-icon | Icon displayed during the AI’s thought process. | | agent-shell-tool-use-expand-by-default | Whether tool use sections should be expanded by default. | | agent-shell-transcript-file-path-function | Function to generate the full transcript file path. | | agent-shell-ui-mode-hook | Hook run after entering or leaving ‘agent-shell-ui-mode’. | | agent-shell-user-message-expand-by-default | Whether user message sections should be expanded by default. | | agent-shell-write-inhibit-minor-modes | List of minor mode commands to inhibit during ‘fs/write_text_file’ edits. |&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Commands #+BEGIN_SRC emacs-lisp :results table :colnames &#39;(&quot;Binding&quot; &quot;Command&quot; &quot;Description&quot;) :exports results (let ((rows)) (mapatoms (lambda (symbol) (when (and (string-match &quot;^agent-shell&quot; (symbol-name symbol)) (commandp symbol)) (push `(,(string-join (seq-filter (lambda (symbol) (not (string-match &quot;menu&quot; symbol))) (mapcar (lambda (keys) (key-description keys)) (or (where-is-internal (symbol-function symbol) comint-mode-map nil nil (command-remapping &#39;comint-next-input)) (where-is-internal symbol agent-shell-mode-map nil nil (command-remapping symbol)) (where-is-internal (symbol-function symbol) agent-shell-mode-map nil nil (command-remapping symbol))))) &quot; or &quot;) ,(symbol-name symbol) ,(car (split-string (or (documentation symbol t) &quot;&quot;) &quot;\n&quot;))) rows)))) (sort rows (lambda (a b) (string&amp;lt; (cadr a) (cadr b))))) #+END_SRC&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;#+RESULTS: | Binding | Command | Description | |-----------------+---------------------------------------------------------+-------------------------------------------------------------------------------| | | agent-shell | Start or reuse an existing agent shell. | | | agent-shell--display-buffer | Toggle agent SHELL-BUFFER display. | | | agent-shell-anthropic-start-claude-code | Start an interactive Claude Agent shell. | | | agent-shell-auggie-start-agent | Start an interactive Auggie agent shell. | | | agent-shell-clear-buffer | Clear the current shell buffer. | | | agent-shell-completion-mode | Toggle agent shell completion with @ or / prefix. | | | agent-shell-cursor-start-agent | Start an interactive Cursor agent shell. | | C-
 &lt;tab&gt;
   | agent-shell-cycle-session-mode | Cycle through available session modes for the current 
  &lt;code&gt;agent-shell&#39; session. | | | agent-shell-delete-interaction-at-point | Delete interaction (request and response) at point. | | | agent-shell-droid-start-agent | Start an interactive Factory Droid agent shell. | | | agent-shell-fakes-load-session | Load and replay a traffic session from file. | | | agent-shell-github-start-copilot | Start an interactive GitHub Copilot agent shell. | | | agent-shell-google-start-gemini | Start an interactive Gemini CLI agent shell. | | | agent-shell-goose-start-agent | Start an interactive Goose agent shell. | | | agent-shell-help-menu | Transient menu for &lt;/code&gt;agent-shell&#39; commands. | | | agent-shell-insert-file | Insert a file into 
  &lt;code&gt;agent-shell&#39;. | | | agent-shell-insert-shell-command-output | Execute a shell command and insert output as a code block. | | C-c C-c | agent-shell-interrupt | Interrupt in-progress request and reject all pending permissions. | | | agent-shell-jump-to-latest-permission-button-row | Jump to the latest permission button row. | | | agent-shell-mistral-start-vibe | Start an interactive Mistral Vibe agent shell. | | | agent-shell-mode | Major mode for agent shell. | | | agent-shell-new-shell | Start a new agent shell. | | S-&amp;lt;return&amp;gt; | agent-shell-newline | Insert a newline, and move to left margin of the new line. | | C-&amp;lt;down&amp;gt; or M-n | agent-shell-next-input | Cycle forwards through input history. | | n or TAB | agent-shell-next-item | Go to next item. | | | agent-shell-next-permission-button | Jump to the next button. | | | agent-shell-open-transcript | Open the transcript file for the current &lt;/code&gt;agent-shell&#39; buffer. | | | agent-shell-openai-start-codex | Start an interactive Codex agent shell. | | | agent-shell-opencode-start-agent | Start an interactive OpenCode agent shell. | | C-c C-o | agent-shell-other-buffer | Switch to other associated buffer (viewport vs shell). | | C-
  &lt;up&gt;
    or M-p | agent-shell-previous-input | Cycle backwards through input history, saving input. | | p or 
   &lt;backtab&gt;
     | agent-shell-previous-item | Go to previous item. | | | agent-shell-previous-permission-button | Jump to the previous button. | | | agent-shell-prompt-compose | Compose an 
    &lt;code&gt;agent-shell&#39; prompt in a dedicated buffer. | | | agent-shell-queue-request | Queue or immediately send a request depending on shell busy state. | | r | agent-shell-quote-region | Quote the active region into the shell&#39;s latest prompt. | | | agent-shell-qwen-start | Start an interactive Qwen Code CLI agent shell. | | | agent-shell-remove-pending-request | Remove all pending requests or a specific request by REMOVE-INDEX. | | C-x x r | agent-shell-rename-buffer | Rename current shell buffer. | | | agent-shell-reset-logs | Reset all log buffers. | | | agent-shell-resume-pending-requests | Resume processing pending requests in the queue. | | | agent-shell-run-all-tests | Run all agent-shell tests in batch mode. | | M-r | agent-shell-search-history | Search previous input history. | | | agent-shell-send-current-file | Insert a file into &lt;/code&gt;agent-shell&#39;. | | | agent-shell-send-dwim | Send region or error at point to last accessed shell buffer in project. | | | agent-shell-send-file | Insert a file into 
    &lt;code&gt;agent-shell&#39;. | | | agent-shell-send-other-file | Prompt to send a file into &lt;/code&gt;agent-shell&#39;. | | | agent-shell-send-region | Send region to last accessed shell buffer in project. | | | agent-shell-send-screenshot | Capture a screenshot and insert it into 
    &lt;code&gt;agent-shell&#39;. | | C-c RET | agent-shell-set-session-mode | Set session mode (if any available). | | C-c C-v | agent-shell-set-session-model | Set session model. | | RET | agent-shell-submit | Submit current input. | | | agent-shell-toggle | Toggle agent shell display. | | | agent-shell-toggle-logging | Toggle logging. | | | agent-shell-ui-backward-block | Jump to the previous block. | | | agent-shell-ui-forward-block | Jump to the next block. | | | agent-shell-ui-mode | Minor mode for SUI block navigation. | | | agent-shell-ui-toggle-fragment | Toggle fragment fold at or near point. | | | agent-shell-ui-toggle-all-fragments | Toggle global fold state: all-expanded ↔ all-collapsed. | | | agent-shell-version | Show &lt;/code&gt;agent-shell&#39; mode version. | | | agent-shell-view-acp-logs | View agent shell ACP logs buffer. | | | agent-shell-view-traffic | View agent shell traffic buffer. | | | agent-shell-viewport-compose-cancel | Cancel prompt composition. | | | agent-shell-viewport-compose-send | Send the viewport composed prompt to the agent shell. | | | agent-shell-viewport-compose-send-and-kill | Send the viewport composed prompt to the agent shell and kill compose buffer. | | | agent-shell-viewport-compose-send-and-wait-for-response | Send the viewport composed prompt and display response in viewport. | | | agent-shell-viewport-cycle-session-mode | Cycle through available session modes. | | | agent-shell-viewport-edit-mode | Major mode for composing agent shell prompts. | | | agent-shell-viewport-interrupt | Interrupt active agent shell request. | | | agent-shell-viewport-next-item | Go to next item. | | | agent-shell-viewport-next-page | Show next interaction (request / response). | | | agent-shell-viewport-previous-item | Go to previous item. | | | agent-shell-viewport-previous-page | Show previous interaction (request / response). | | | agent-shell-viewport-refresh | Refresh viewport buffer content with current item from shell. | | | agent-shell-viewport-reply | Reply as a follow-up and compose another prompt/query. | | | agent-shell-viewport-quote-reply | Reply with the entire response block-quoted. | | | agent-shell-viewport-set-session-mode | Set session mode. | | | agent-shell-viewport-set-session-model | Set session model. | | | agent-shell-viewport-view-last | Display the last request/response interaction. | | | agent-shell-viewport-view-mode | Major mode for viewing agent shell prompts (read-only). |
   &lt;/backtab&gt;
  &lt;/up&gt;
 &lt;/tab&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Filing issues When filing an issue, please keep the checkboxes from the [[&lt;a href=&quot;https://github.com/xenodium/agent-shell/raw/main/.github/ISSUE_TEMPLATE/issue.md&quot;&gt;https://github.com/xenodium/agent-shell/blob/main/.github/ISSUE_TEMPLATE/issue.md&lt;/a&gt;][issue template]] and check them off as applicable. They help ensure I have enough information to help.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Please read through this section before filing issues or feature requests. I won&#39;t be able to help unless I have enough information to help. This section shows how to get the details I need.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;em&gt;Versions&lt;/em&gt;: What version of =agent-shell=, =acp.el=, the ACP package (e.g. =claude-code-acp=), and the agent CLI (e.g. =claude=, =gemini=) are you running?&lt;/li&gt; 
 &lt;li&gt;&lt;em&gt;Steps to reproduce&lt;/em&gt;: What exact steps lead to the issue? Be specific about what you did and in what order.&lt;/li&gt; 
 &lt;li&gt;&lt;em&gt;ACP traffic&lt;/em&gt;: See [[&lt;a href=&quot;https://github.com/xenodium/agent-shell?tab=readme-ov-file#how-do-i-viewget-agent-client-protocol-traffic&quot;&gt;https://github.com/xenodium/agent-shell?tab=readme-ov-file#how-do-i-viewget-agent-client-protocol-traffic&lt;/a&gt;][how to get ACP traffic]] above. This is the most useful piece of information for diagnosing issues.&lt;/li&gt; 
 &lt;li&gt;&lt;em&gt;Screenshots&lt;/em&gt;: A screenshot helps correlate what you see with the protocol data.&lt;/li&gt; 
 &lt;li&gt;&lt;em&gt;Your agent-shell config&lt;/em&gt;: Share any relevant =agent-shell= variable settings from your Emacs config.&lt;/li&gt; 
 &lt;li&gt;&lt;em&gt;Profiling data&lt;/em&gt; (for performance issues): Use =M-x profiler-start=, reproduce the issue, then =M-x profiler-report= (and =M-x profiler-stop=). Share the report.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;ul&gt; 
 &lt;li&gt;FAQ&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;** Why doesn&#39;t =agent-shell= offer all slash commands/skills available in CLI agent?&lt;/p&gt; 
&lt;p&gt;=agent-shell= can only offer the slash commands/skills advertised by the agent via [[&lt;a href=&quot;https://agentclientprotocol.com&quot;&gt;https://agentclientprotocol.com&lt;/a&gt;][Agent Client Protocol]]. To view what&#39;s exposed by your agent, expand the &quot;Available /commands&quot; section. Is the command you&#39;re after missing? Please consider filing a feature-request with the respective agent (ie. Gemini CLI) or their ACP layer (claude-code-acp).&lt;/p&gt; 
&lt;p&gt;[[file:slash-commands.png]]&lt;/p&gt; 
&lt;p&gt;** Can you add support for another agent?&lt;/p&gt; 
&lt;p&gt;Does the agent support ACP ([[&lt;a href=&quot;https://agentclientprotocol.com&quot;&gt;https://agentclientprotocol.com&lt;/a&gt;][Agent Client Protocol]])? If so, =agent-shell= can likely support this agent. Some agents have ACP support built-in (like [[&lt;a href=&quot;https://github.com/google-gemini/gemini-cli&quot;&gt;https://github.com/google-gemini/gemini-cli&lt;/a&gt;][gemini-cli]]). Others require a separate ACP package (like [[&lt;a href=&quot;https://github.com/zed-industries/claude-code-acp&quot;&gt;https://github.com/zed-industries/claude-code-acp&lt;/a&gt;][claude-code-acp]] for [[&lt;a href=&quot;https://github.com/anthropics/claude-code&quot;&gt;https://github.com/anthropics/claude-code&lt;/a&gt;][claude-code]]). When filing a feature request to add a new agent, please include a link to the project supporting [[&lt;a href=&quot;https://agentclientprotocol.com&quot;&gt;https://agentclientprotocol.com&lt;/a&gt;][Agent Client Protocol]] (built-in or otherwise).&lt;/p&gt; 
&lt;p&gt;Agents without ACP support are out of scope for integrating with =agent-shell=. Having said that, if you do build an ACP layer like =claude-agent-acp=, then =agent-shell= can work with it.&lt;/p&gt; 
&lt;p&gt;** =agent-shell= not behaving as expected?&lt;/p&gt; 
&lt;p&gt;Could be the agent itself missing an [[&lt;a href=&quot;https://agentclientprotocol.com&quot;&gt;https://agentclientprotocol.com&lt;/a&gt;][Agent Client Protocol]] feature, =agent-shell= missing the feature, or both 😃 So which one is it? It&#39;s hard to tell unless we look at [[&lt;a href=&quot;https://agentclientprotocol.com&quot;&gt;https://agentclientprotocol.com&lt;/a&gt;][Agent Client Protocol]] traffic between the two.&lt;/p&gt; 
&lt;p&gt;** Is shx supported? No. There are reports that [[&lt;a href=&quot;https://github.com/xenodium/agent-shell/issues/543&quot;&gt;https://github.com/xenodium/agent-shell/issues/543&lt;/a&gt;][it does not work]] with agent-shell. ** How do I view/get [[&lt;a href=&quot;https://agentclientprotocol.com&quot;&gt;https://agentclientprotocol.com&lt;/a&gt;][Agent Client Protocol]] traffic?&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;=M-x agent-shell-toggle-logging= (make sure logging is ON).&lt;/li&gt; 
 &lt;li&gt;Reproduce the issue&lt;/li&gt; 
 &lt;li&gt;=M-x agent-shell-view-traffic=&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;Browse through traffic and see if you can spot the issue. For example, if you see a request sent by the agent asking for user permission, but =agent-shell= isn&#39;t surfacing this permission, it looks like perhaps =agent-shell= is missing a feature.&lt;/p&gt; 
&lt;p&gt;For example, here&#39;s what a [[&lt;a href=&quot;https://agentclientprotocol.com/protocol/schema#session%2Frequest-permission&quot;&gt;https://agentclientprotocol.com/protocol/schema#session%2Frequest-permission&lt;/a&gt;][session/request_permission]] request would look like from the traffic viewer.&lt;/p&gt; 
&lt;p&gt;[[file:traffic.png]]&lt;/p&gt; 
&lt;p&gt;Sometimes including a traffic screenshot in an issue is enough. Other times including the full traffic is needed. From the traffic viewer, you can =M-x acp-traffic-save-to= to save as =.traffic=.&lt;/p&gt; 
&lt;p&gt;** Where should I file bug or feature request?&lt;/p&gt; 
&lt;p&gt;*** Agent issues or feature requests&lt;/p&gt; 
&lt;p&gt;If you&#39;re able to determine the agent is missing a feature (or a bug is present) in their [[&lt;a href=&quot;https://agentclientprotocol.com&quot;&gt;https://agentclientprotocol.com&lt;/a&gt;][Agent Client Protocol]] implementation, please file an issue directly with the agent folks. For example:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/agentclientprotocol/claude-agent-acp&quot;&gt;https://github.com/agentclientprotocol/claude-agent-acp&lt;/a&gt;][claude-agent-acp]]: For Claude Agent.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/zed-industries/codex-acp&quot;&gt;https://github.com/zed-industries/codex-acp&lt;/a&gt;][codex-acp]]: For Codex.&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/google-gemini/gemini-cli&quot;&gt;https://github.com/google-gemini/gemini-cli&lt;/a&gt;][Gemini CLI]].&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://block.github.io/goose/docs/getting-started/installation&quot;&gt;https://block.github.io/goose/docs/getting-started/installation&lt;/a&gt;][Goose]].&lt;/li&gt; 
 &lt;li&gt;[[&lt;a href=&quot;https://github.com/QwenLM/qwen-code&quot;&gt;https://github.com/QwenLM/qwen-code&lt;/a&gt;][Qwen Code]].&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;*** =agent-shell= issues or feature requests&lt;/p&gt; 
&lt;p&gt;Alternatively, if you noticed =agent-shell= is missing a feature (or has a bug), please [[&lt;a href=&quot;https://github.com/xenodium/agent-shell/issues&quot;&gt;https://github.com/xenodium/agent-shell/issues&lt;/a&gt;][file an agent-shell issue]].&lt;/p&gt; 
&lt;p&gt;*** Not sure where to file an issue?&lt;/p&gt; 
&lt;p&gt;File [[&lt;a href=&quot;https://github.com/xenodium/agent-shell/issues&quot;&gt;https://github.com/xenodium/agent-shell/issues&lt;/a&gt;][in agent-shell]], but please try to provide details, so I can determine whether =agent-shell= or the agent itself needs work. Traffic data would be very useful here. Provide a screenshot or a .traffic file if you think it&#39;ll help. See [[&lt;a href=&quot;https://github.com/xenodium/agent-shell?tab=readme-ov-file#how-do-i-viewget-agent-client-protocol-traffic&quot;&gt;https://github.com/xenodium/agent-shell?tab=readme-ov-file#how-do-i-viewget-agent-client-protocol-traffic&lt;/a&gt;][how to get ACP traffic]].&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Contributing&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;See [[file:CONTRIBUTING.org][&lt;a href=&quot;http://CONTRIBUTING.org&quot;&gt;CONTRIBUTING.org&lt;/a&gt;]].&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Contributors&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;#+HTML: &lt;a href=&quot;https://github.com/xenodium/agent-shell/graphs/contributors&quot;&gt; #+HTML: &lt;img src=&quot;https://contrib.rocks/image?repo=xenodium/agent-shell&quot; /&gt; #+HTML: &lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;Made with [[&lt;a href=&quot;https://contrib.rocks&quot;&gt;https://contrib.rocks&lt;/a&gt;][contrib.rocks]].&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/c0a4d554fa14dd201e535fccd8ab0d4860b973f044a80a7d821fc5c735eca0b8/xenodium/agent-shell" medium="image" />
      
    </item>
    
    <item>
      <title>dgutov/diff-hl</title>
      <link>https://github.com/dgutov/diff-hl</link>
      <description>&lt;p&gt;Emacs package for highlighting uncommitted changes&lt;/p&gt;&lt;hr&gt;&lt;h1&gt;About &lt;a href=&quot;https://github.com/dgutov/diff-hl/actions/workflows/ci.yml&quot;&gt;&lt;img src=&quot;https://github.com/dgutov/diff-hl/actions/workflows/ci.yml/badge.svg?sanitize=true&quot; alt=&quot;Build Status&quot; /&gt;&lt;/a&gt;&lt;/h1&gt; 
&lt;p&gt;&lt;code&gt;diff-hl-mode&lt;/code&gt; highlights uncommitted changes on the side of the window, allows you to jump between and revert them selectively.&lt;/p&gt; 
&lt;p&gt;This feature is also known as &quot;source control gutter indicators&quot;.&lt;/p&gt; 
&lt;p&gt;In buffers controlled by Git, you can stage and unstage the changes.&lt;/p&gt; 
&lt;p&gt;For the usage instructions and the list of commands, see the Commentary section inside the file.&lt;/p&gt; 
&lt;p&gt;Tested with Git, Mercurial, Bazaar and SVN. May work with other VC backends, too.&lt;/p&gt; 
&lt;p&gt;The package also contains auxiliary modes:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;diff-hl-dired-mode&lt;/code&gt; provides similar functionality in Dired.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;diff-hl-margin-mode&lt;/code&gt; changes the highlighting function to use the margin instead of the fringe.&lt;/li&gt; 
 &lt;li&gt;But if you use a non-graphical terminal, the package will fall back to using the margins anyway, as long as &lt;code&gt;diff-hl-fallback-to-margin&lt;/code&gt; is non-nil and the margin width is non-zero.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;diff-hl-amend-mode&lt;/code&gt; sets the reference revision to the one before recent one. Also, you could use &lt;code&gt;diff-hl-set-reference-rev&lt;/code&gt; to set it to any revision, see its docstring for details.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;diff-hl-flydiff-mode&lt;/code&gt; implements highlighting changes on the fly.&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;diff-hl-show-hunk-mouse-mode&lt;/code&gt; makes fringe and margin react to mouse clicks to show the corresponding hunk. That&#39;s the alternative to using &lt;code&gt;diff-hl-show-hunk&lt;/code&gt; and friends.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Usage&lt;/h1&gt; 
&lt;p&gt;Put this into your init script:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-lisp&quot;&gt;(global-diff-hl-mode)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;You must also ensure that VC is enabled (e.g. &lt;code&gt;vc-handled-backends&lt;/code&gt; is not nil).&lt;/p&gt; 
&lt;p&gt;Check out the Commentary section in each file for more detailed usage instructions.&lt;/p&gt; 
&lt;h1&gt;Screenshots&lt;/h1&gt; 
&lt;h2&gt;diff-hl-mode&lt;/h2&gt; 
&lt;p&gt;Top window: a buffer in this minor mode, bottom window: the corresponding diff.&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/dgutov/diff-hl/master/screenshot.png&quot; alt=&quot;screenie&quot; /&gt;&lt;/p&gt; 
&lt;h2&gt;diff-hl-dired-mode&lt;/h2&gt; 
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/dgutov/diff-hl/master/screenshot-dired.png&quot; alt=&quot;screenie&quot; /&gt;&lt;/p&gt; 
&lt;h2&gt;diff-hl-margin-mode&lt;/h2&gt; 
&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/dgutov/diff-hl/master/screenshot-margin.png&quot; alt=&quot;screenie&quot; /&gt;&lt;/p&gt; 
&lt;h1&gt;Requirements&lt;/h1&gt; 
&lt;p&gt;Emacs 27.1+.&lt;/p&gt; 
&lt;h1&gt;Notes&lt;/h1&gt; 
&lt;ul&gt; 
 &lt;li&gt; &lt;p&gt;By default &lt;code&gt;diff-hl-mode&lt;/code&gt; only updates the display when the buffer is in saved state. For a different tradeoff, also enable &lt;code&gt;diff-hl-flydiff-mode&lt;/code&gt;, which makes the updates happen on a timer.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;To use an &lt;a href=&quot;http://stackoverflow.com/questions/32365271/whats-the-difference-between-git-diff-patience-and-git-diff-histogram&quot;&gt;alternative diff algorithm&lt;/a&gt; with Git, add a corresponding argument to &lt;code&gt;vc-git-diff-switches&lt;/code&gt;, e.g. &lt;code&gt;(setq vc-git-diff-switches &#39;(&quot;--histogram&quot;))&lt;/code&gt;. Using the &lt;code&gt;diff.algorithm&lt;/code&gt; option doesn&#39;t work &lt;a href=&quot;http://article.gmane.org/gmane.comp.version-control.git/294622&quot;&gt;because&lt;/a&gt; &lt;code&gt;vc-git-diff&lt;/code&gt; calls &lt;code&gt;git diff-index&lt;/code&gt;. &lt;code&gt;diff-hl-flydiff-mode&lt;/code&gt; does not support alternative algorithms, because it uses the external &lt;code&gt;diff&lt;/code&gt; program.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;We conflict with other modes when they put indicators on the fringe, such as &lt;a href=&quot;https://github.com/flycheck/flycheck&quot;&gt;Flycheck&lt;/a&gt;. This is rarely a significant problem, since if you&#39;re using such a mode, you&#39;d usually want to fix all errors and warnings before continuing, and then the conflicting indicators go away.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;There&#39;s no fringe when Emacs is running in the console, but the navigation and revert commands still work. Consider turning &lt;code&gt;diff-hl-margin-mode&lt;/code&gt; on, to show the indicators in the margin instead. It also helps avoid the conflict with Flycheck/Flymake even on graphical frames.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Frame-local and buffer-local values of &lt;code&gt;line-spacing&lt;/code&gt; are not supported.&lt;/p&gt; &lt;/li&gt; 
 &lt;li&gt; &lt;p&gt;Fringe width up to 16 works best (because we can&#39;t define a bitmap with width above that number).&lt;/p&gt; &lt;/li&gt; 
&lt;/ul&gt; 
&lt;h1&gt;Integration&lt;/h1&gt; 
&lt;p&gt;If you&#39;re using some package other than &lt;code&gt;vc&lt;/code&gt; to commit changes, it might not run &lt;code&gt;vc-checkin-hook&lt;/code&gt; after commits. In that case, you&#39;ll need to either add &lt;code&gt;diff-hl-update&lt;/code&gt; to the hook it does run, or advise some function that&#39;s called in the buffer after its state has changed.&lt;/p&gt; 
&lt;h2&gt;psvn&lt;/h2&gt; 
&lt;pre&gt;&lt;code class=&quot;language-lisp&quot;&gt;(advice-add &#39;svn-status-update-modeline :after #&#39;diff-hl-update)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Magit&lt;/h2&gt; 
&lt;p&gt;If you&#39;re using a version before 2.4.0, it defines &lt;code&gt;magit-revert-buffer-hook&lt;/code&gt; (or &lt;code&gt;magit-not-reverted-hook&lt;/code&gt;), which we use.&lt;/p&gt; 
&lt;p&gt;When using Magit 2.4 or newer, add this to your init script:&lt;/p&gt; 
&lt;pre&gt;&lt;code class=&quot;language-lisp&quot;&gt;(add-hook &#39;magit-post-refresh-hook &#39;diff-hl-magit-post-refresh)
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Tramp&lt;/h2&gt; 
&lt;p&gt;&lt;code&gt;diff-hl&lt;/code&gt; should just work with Tramp. But slow or high latency connections can cause performance problems. If you experience such issues, customize &lt;code&gt;diff-hl-disable-on-remote&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. This will change the behavior of both &lt;code&gt;turn-on-diff-hl-mode&lt;/code&gt; and &lt;code&gt;global-diff-hl-mode&lt;/code&gt; (whichever you prefer to use).&lt;/p&gt;</description>
      
      <media:content url="https://opengraph.githubassets.com/36743526ce041c0f3403a62a6a1de96998d84c8c123fb3640ef4db156ee63146/dgutov/diff-hl" medium="image" />
      
    </item>
    
  </channel>
</rss>
