<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>
            
                    elisp on
                
            
            The Neo-Babbage Files</title>
        <link>https://babbagefiles.xyz/categories/elisp/</link>
        <description>Recent content  in elisp
            on The Neo-Babbage Files</description>
        <language>en-gb</language>
        
                <managingEditor>slade@lambda-y.net (Benjamin Slade)</managingEditor>
                <webMaster>slade@lambda-y.net (Benjamin Slade)</webMaster><lastBuildDate>Mon, 29 Dec 2025 11:00:32 +0000</lastBuildDate>
        <generator>Hugo -- gohugo.io</generator>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
            <atom:link href="https://babbagefiles.xyz/categories/elisp/index.xml" rel="self" type="application/rss&#43;xml" />
        
            
            <item>
                <title>Equake: A Geas on Gnomish Smiths</title>
                <link>https://babbagefiles.xyz/equake-geas-on-gnomish-smiths/</link>
                
                
                <description>&lt;p&gt;A new version of &lt;a href=&#34;https://gitlab.com/emacsomancer/equake&#34;&gt;Equake&lt;/a&gt;, the drop-down &amp;ldquo;terminal emulator&amp;rdquo; for Emacs, should be hitting Melpa shortly. This version includes a number of bug fixes, and some new features.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/jeffkowalski&#34;&gt;Jeff Kowalski&lt;/a&gt; added code for a &lt;a href=&#34;https://gitlab.com/emacsomancer/equake/-/merge_requests/8&#34;&gt;&amp;ldquo;close Equake frame on loss of focus
feature&amp;rdquo;&lt;/a&gt; (similar to the &lt;a href=&#34;https://github.com/lanoxx/tilda&#34;&gt;Tilda&lt;/a&gt; feature) and a number of bug fixes and code-cleanup.&lt;/p&gt;
&lt;p&gt;Further: I&amp;rsquo;m (half-)jokingly calling this the &lt;strong&gt;Geas on Gnomish Smiths&lt;/strong&gt; release as I&amp;rsquo;ve finally figured out how to make it behave properly under GNOME Shell Wayland.&lt;/p&gt;
&lt;p&gt;To my knowledge, the only other currently working drop-down terminal
for GNOME Shell Wayland is the JavaScript GNOME extension
&lt;a href=&#34;https://github.com/amezin/gnome-shell-extension-ddterm&#34;&gt;ddterm&lt;/a&gt;. Wayland (at least GNOME Shell&amp;rsquo;s Wayland) seems very
restrictive in how non-user-initiated events can affect window
properties. E.g., it is difficult to programmatically affect window focus in GNOME Shell under Wayland. The default &amp;ldquo;hide window&amp;rdquo; behaviour of Equake doesn&amp;rsquo;t work.&lt;/p&gt;
&lt;p&gt;However, I did have a legacy feature where closing/hiding Equake involved destroying the frame rather than hiding it. This is somewhat complicated, as re-invoking Equake then involves creating a new frame and restoring the tabs and buffer history. This is how Equake originally worked, but it is simpler (and slightly faster) just to hide the frame on &amp;ldquo;close&amp;rdquo; and then unhide it on &amp;ldquo;re-open&amp;rdquo;, and this became the default behaviour for Equake some time ago. But I left the old code in place as another option.&lt;/p&gt;
&lt;p&gt;However, various changes apparently ended up with the restoration behaviour not working quite properly. I have fixed this (more or less, see &lt;a href=&#34;https://gitlab.com/emacsomancer/equake/-/issues/26&#34;&gt;https://gitlab.com/emacsomancer/equake/-/issues/26&lt;/a&gt;). With that fix in place, we can then trick GNOME Shell under Wayland into behaving properly. Rather than hiding the Equake frame on &amp;ldquo;close&amp;rdquo;, we destroy it and then recreate it on &amp;ldquo;open&amp;rdquo;. This involves quite a bit of trickery behind the scenes. Essentially, opening a new window under GNOME Shell Wayland can result in that window being placed on top of any existing windows (though to do it properly, employing a it of Elisp &lt;code&gt;(select-frame-set-input-focus (selected-frame))&lt;/code&gt; seems to result in the new Emacs client frame being on top (and focussed) [this is a potentially useful trick for opening regular new Emacsclient frames as well].&lt;/p&gt;
&lt;p&gt;But, the usual way that Equake frames are created internally is via
Emacs &lt;code&gt;make-frame&lt;/code&gt;, which doesn&amp;rsquo;t automatically focus the new
frame. So rather than doing this, we need to have the user call &lt;code&gt;emacsclient -c&lt;/code&gt; and then transform that frame into an Equake frame. A new Equake function &lt;code&gt;equake--transform-existing-frame-into-equake-frame&lt;/code&gt; takes care of this. The transformation and the old code restoring tabs and history doesn&amp;rsquo;t quite take care of everything though as the point/cursor is left by default at the top of the frame, which is not the user-expected behaviour. So an addition bit of elisp &lt;code&gt;(goto-char (1- (point-max)))&lt;/code&gt; generally moves the point/cursor to the end of the buffer where the user might expect it.&lt;/p&gt;
&lt;p&gt;So I have a bit of shell script as a helper function which is what one should create a keybinding for in GNOME Shell Wayland:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#!/bin/sh
&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&lt;/span&gt;
&lt;span class=&#34;nv&#34;&gt;equakestatus&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;emacsclient -n -e &lt;span class=&#34;s1&#34;&gt;&amp;#39;(frame-live-p (alist-get (equake--get-monitor) equake--frame))&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$equakestatus&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;nil&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;
    emacsclient -c -e &lt;span class=&#34;s2&#34;&gt;&amp;#34;(progn (select-frame-set-input-focus (selected-frame))
&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;                              (equake--transform-existing-frame-into-equake-frame)
&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;                              (goto-char (1- (point-max))))&amp;#34;&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;
    emacsclient -n -e &lt;span class=&#34;s1&#34;&gt;&amp;#39;(progn (setq equake-use-frame-hide nil)
&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;                              (equake-invoke))&amp;#39;&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This checks if there is a live Equake frame; if there is, it is hidden; otherwise a new frame is created and transformed.&lt;/p&gt;
&lt;p&gt;Finally, in order to be able to get the &amp;ldquo;Always on Top&amp;rdquo; behaviour, the new Equake frame transmutation function calls &lt;code&gt;(shell-command &amp;quot;wmctrl -r :ACTIVE: -b toggle,above&amp;quot;)&lt;/code&gt; (so one needs &lt;code&gt;wmctrl&lt;/code&gt; installed), which seems to trigger the &amp;ldquo;Always on Top&amp;rdquo; feature at least for Xwayland windows.&lt;/p&gt;
&lt;p&gt;And, presto, change-o, voilà, we have a version of Equake which
exhibits its normal X11 behaviour in GNOME Shell Wayland.&lt;/p&gt;
&lt;p&gt;(As long as Emacs is run as an Xwayland application; otherwise the
&amp;ldquo;always on top&amp;rdquo; behaviour doesn&amp;rsquo;t work properly.)&lt;/p&gt;
</description>
                
                        <author>Benjamin.Slade@fakeEmailToMakeValidatorHappy.com (Benjamin Slade)</author>
                
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/categories/emacs">emacs</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/equake">equake</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/elisp">elisp</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/eshell">eshell</category>
                                
                            
                        
                     
                        
                     
                        
                    
                
                <guid>https://babbagefiles.xyz/equake-geas-on-gnomish-smiths/</guid>
                <pubDate>Wed, 08 Jun 2022 10:54:00 -0600</pubDate>
            </item>
        
            
            <item>
                <title>Equake: A drop-down console written in Emacs Lisp</title>
                <link>https://babbagefiles.xyz/equake-elisp-console/</link>
                
                
                <description>&lt;p&gt;Over the holiday break I&amp;rsquo;ve been working on developing a Quake-style
drop-down console, dubbed Equake / &lt;code&gt;equake&lt;/code&gt;. It is not yet on Melpa,
but is accessible at
&lt;a href=&#34;https://gitlab.com/emacsomancer/equake&#34;&gt;https://gitlab.com/emacsomancer/equake&lt;/a&gt;.&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;



&lt;figure&gt;
    
        
            &lt;img src=&#34;https://gitlab.com/emacsomancer/equake/raw/master/image/equake.png&#34;/&gt; &lt;/figure&gt;

&lt;p&gt;&lt;code&gt;equake&lt;/code&gt;, written fully in Emacs Lisp, is designed as a &amp;lsquo;classic&amp;rsquo;
drop-down console interface like &lt;a href=&#34;https://en.wikipedia.org/wiki/Yakuake&#34;&gt;Yakuake&lt;/a&gt;, inspired by &amp;lsquo;cheat&amp;rsquo; consoles
in games like &lt;a href=&#34;https://en.wikipedia.org/wiki/Quake_(video_game)&#34;&gt;Quake&lt;/a&gt;. It provides access to various &amp;lsquo;shells&amp;rsquo;
implemented in Emacs, including &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/emacs/Interactive-Shell.html#Interactive-Shell&#34;&gt;&lt;code&gt;shell&lt;/code&gt;&lt;/a&gt; (an Emacs wrapper around the
current system shell), &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/emacs/Terminal-emulator.html#Terminal-emulator&#34;&gt;&lt;code&gt;term&lt;/code&gt; and &lt;code&gt;ansi-term&lt;/code&gt;&lt;/a&gt;, (both terminal
emulators, emulating VT100-style ANSI escape codes, like &lt;code&gt;xterm&lt;/code&gt;
does), and &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_mono/eshell.html&#34;&gt;&lt;code&gt;eshell&lt;/code&gt;&lt;/a&gt; (a shell written entirely in Emacs Lisp). &lt;code&gt;equake&lt;/code&gt;
allows for multiple &amp;lsquo;tabs&amp;rsquo; (which can be running different shells),
and allows tabs to be re-ordered and renamed.&lt;/p&gt;



&lt;figure&gt;
    
        
            &lt;img src=&#34;https://gitlab.com/emacsomancer/equake/raw/master/image/equake-in-kdeplasma5.gif&#34;/&gt; &lt;/figure&gt;

&lt;p&gt;My impetus for creating &lt;code&gt;equake&lt;/code&gt; was to hijack my own workflow into
using John Wiegley&amp;rsquo;s fantastic &lt;code&gt;eshell&lt;/code&gt;, an Emacs module which
&amp;lsquo;translates &amp;ldquo;shell-like&amp;rdquo; syntax into Lisp in order to exercise the
kernel in the same manner as typical system shells&amp;rsquo;, allowing for a
similar working environment even in hostile, alien OSes like &lt;code&gt;w32&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;eshell&lt;/code&gt; is somewhat sparsely documented, but some &lt;a href=&#34;https://www.masteringemacs.org/article/complete-guide-mastering-eshell&#34;&gt;useful&lt;/a&gt; &lt;a href=&#34;http://www.howardism.org/Technical/Emacs/eshell-fun.html&#34;&gt;resources&lt;/a&gt;
&lt;a href=&#34;https://dm.reddit.com/r/emacs/comments/6y3q4k/yes_eshell_is_my_main_shell/&#34;&gt;exist&lt;/a&gt;, including a fairly extensive &lt;a href=&#34;https://www.youtube.com/watch?v=RhYNu6i_uY4&#34;&gt;video overview done by Howard
Abrams&lt;/a&gt; which I highly recommend. It has a number of great features,
either inherently or via additional Emacs packages, including features
from &lt;a href=&#34;https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs&#34;&gt;Plan 9&lt;/a&gt;&amp;lsquo;s terminal, as well as &lt;a href=&#34;https://github.com/dieggsy/esh-autosuggest&#34;&gt;Fish shell-like auto-suggestions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;equake&lt;/code&gt; has been successful in my personal goal of using &lt;code&gt;eshell&lt;/code&gt; for
99% of my terminal work, and I am looking forward to making further
using of a shell which can handle Lisp syntax as well.&lt;/p&gt;
&lt;p&gt;Most of the &lt;code&gt;equake&lt;/code&gt; code is keeping track of tabs, and frames for
multi-monitor set-ups. This is trickier than it would seem at first,
especially as each screen/monitor can have it own set of tabs (this
allows me to recreate at least a part of AwesomeWM&amp;rsquo;s
screen-independence in other environments).  In theory &lt;code&gt;equake&lt;/code&gt; should
work fairly well across platforms, as it makes use of the &lt;code&gt;frame.el&lt;/code&gt;,
which includes code for MacOS and Windows (but I haven&amp;rsquo;t test either
platform). Probably more work needs to be done to get &lt;code&gt;equake&lt;/code&gt; to work
properly on tiling window managers like AwesomeWM or StumpWM. But it
seems to currently work fine in KDE Plasma and Gnome Shell (both X11
and Wayland).&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;I learned a good deal about how Emacs manages frames. I originally
used Emacs&amp;rsquo; &lt;code&gt;make-frame-(in)visible&lt;/code&gt; functions to hide/show the
&lt;code&gt;equake&lt;/code&gt; frames. However, the implementation of these is very
odd. Applying &lt;code&gt;make-frame-invisible&lt;/code&gt; to a frame once appears to render
it invisible, but Emacs still considers it to be visible, which means
that, for instance, &lt;code&gt;frame-visible-p&lt;/code&gt; will still report the frame as
being visible and, worse, functions like &lt;code&gt;make-frame-visible&lt;/code&gt; and
&lt;code&gt;raise-frame&lt;/code&gt; will have no effect whatsoever upon the frame in
question, because Emacs treats it as &amp;lsquo;visible&amp;rsquo;.  Only a second
application of &lt;code&gt;make-frame-invisible&lt;/code&gt; will register the frame as
reportably invisible to Emacs. This is easily enough worked around
simply by using a &amp;lsquo;double tap&amp;rsquo; of &lt;code&gt;make-frame-invisible&lt;/code&gt; to the
relevant frame. However, I ran into numerous other issues in the use
of &lt;code&gt;make-frame-(in)visible&lt;/code&gt;, including the fact that frames set at
less than 100% width end up re-appearing in a position other than
their original position, and frames sometimes spontaneously resize
when re-appearing or being un-fullscreened. I tried for a long time to
work around these issues, but found that even trying to force the
frames into doing what I wanted them to do via applications of
&lt;code&gt;set-frame-position&lt;/code&gt; was a non-starter, as application of this
function to malpositioned frames resulted in significant lag – which
defeated the purpose of using &lt;code&gt;make-frame-(in)visible&lt;/code&gt; in the first
place, which was to gain a slight performance improvement over
destroying and recreating frames. In the end, using &lt;code&gt;destroy-frame&lt;/code&gt;
and &lt;code&gt;make-frame&lt;/code&gt; to &amp;lsquo;hide&amp;rsquo; and &amp;lsquo;show&amp;rsquo; the drop-down console ended up
being the most performent solution.&lt;/p&gt;
&lt;p&gt;Destroying and recreating frames means also worrying about remembering
the last buffer used in a frame as well as the window-history for the
frame, so these also make up a decent part of the &lt;code&gt;equake&lt;/code&gt; code.&lt;/p&gt;
&lt;p&gt;On single-screen set-ups, &lt;code&gt;equake&lt;/code&gt;, once installed, is designed to
have a &lt;code&gt;equake&lt;/code&gt; console frame toggled to drop down or be rolled up by
executing a command which invokes the &lt;code&gt;(equake-invoke)&lt;/code&gt; function bound
to a key like &lt;code&gt;F12&lt;/code&gt; via:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;emacsclient -n -e &lt;span class=&#34;s1&#34;&gt;&amp;#39;(equake-invoke)&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Getting &lt;code&gt;equake&lt;/code&gt; to work well on multi-monitor setups ended up being
rather challenging, since Emacs doesn&amp;rsquo;t know exactly which screen is
&amp;lsquo;active&amp;rsquo; unless that screen also has an active Emacs frame. The
solution, which I managed to get to be nearly as fast as the simpler
non-multi-monitor solution, is to launch &amp;lsquo;Emacs probes&amp;rsquo; which are used
to determine which monitor is &amp;lsquo;active&amp;rsquo; and are then destroyed, invoked
via:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;emacsclient -n -c -e &lt;span class=&#34;s1&#34;&gt;&amp;#39;(equake-invoke)&amp;#39;&lt;/span&gt; -F &lt;span class=&#34;s1&#34;&gt;&amp;#39;((title . &amp;#34;*transient*&amp;#34;) (alpha . (0 . 0)) (width . (text-pixels . 0)) (height . (text-pixels . 0)) (left . 0) (top . 0))&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;(The title is important as it&amp;rsquo;s the key to being able to quickly
destroy these &amp;lsquo;Emacs-probes&amp;rsquo;, and the other frame-settings are there
to minimise the visibility of the probe-frame during its brief
existence.)&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re looking for a drop-down for things other than
shells/terminals, alphapapa has a similar Emacs package designed as a
general-purpose drop-down (e.g. for Org mode buffers etc.); &lt;a href=&#34;https://github.com/alphapapa/yequake&#34;&gt;&lt;code&gt;yequake&lt;/code&gt;&lt;/a&gt;;
and a &lt;a href=&#34;https://github.com/alphapapa/yequake/#org-capture&#34;&gt;specialised version for org-capture&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I hope to add a few more features to &lt;code&gt;equake&lt;/code&gt;, but at this point it
seems stable and is usable for what I wanted to use it for, being a
Lisp console for a Lisp shell. Comments and suggestions are, of
course, most welcome.&lt;/p&gt;
&lt;section class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34; role=&#34;doc-endnote&#34;&gt;
&lt;p&gt;Where installation via
&lt;a href=&#34;https://framagit.org/steckerhalter/quelpa-use-package&#34;&gt;&lt;code&gt;quelpa-use-package&lt;/code&gt;&lt;/a&gt; is described. This method is nearly as easy using
the plain &lt;code&gt;use-package&lt;/code&gt; package to pull from Melpa. &lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:2&#34; role=&#34;doc-endnote&#34;&gt;
&lt;p&gt;Another part of the impetus for &lt;code&gt;equake&lt;/code&gt; is wanting
to increase my machines&amp;rsquo; &amp;lsquo;Lisp quotient&amp;rsquo; after moving a number of
machines from AwesomeWM to KDE Plasma, rather than to StumpWM as I had
originally planned. Of course, I could replace Kwin with StumpWM, and
I plan to experiment with this, but I rather like some the eye-candy
Kwin provides. &lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</description>
                
                        <author>Benjamin.Slade@fakeEmailToMakeValidatorHappy.com (Benjamin Slade)</author>
                
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/categories/emacs">emacs</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/equake">equake</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/elisp">elisp</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/eshell">eshell</category>
                                
                            
                        
                     
                        
                     
                        
                    
                
                <guid>https://babbagefiles.xyz/equake-elisp-console/</guid>
                <pubDate>Thu, 03 Jan 2019 19:06:00 -0700</pubDate>
            </item>
        
            
            <item>
                <title>Grab word etymologies in Emacs</title>
                <link>https://babbagefiles.xyz/emacs_etymologies/</link>
                
                
                <description>&lt;p&gt;On Xah Lee&amp;rsquo;s &lt;a href=&#34;http://ergoemacs.org/emacs/blog.html&#34;&gt;blog&lt;/a&gt; I noticed an entry on linking to word etymologies
from Emacs (2018-08-16: &amp;ldquo;emacs, create link of word etymology&amp;rdquo;). What
his function does is create a html link to the &lt;a href=&#34;http://www.etymonline.com&#34;&gt;Etymonline.com&lt;/a&gt; page on
the currently selected word.&lt;/p&gt;
&lt;p&gt;But I thought: it would be great to have a quick way of pulling up
etymological information within Emacs itself. So, with a little help
from &lt;a href=&#34;http://links.twibright.com&#34;&gt;Links&lt;/a&gt; (i.e. you&amp;rsquo;ll need to have Links installed), here is a first
attempt at such a function:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-emacs-lisp&#34; data-lang=&#34;emacs-lisp&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;slade/etymonbuf&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;Look up word etymology notes from http://www.etymonline.com. Requires [[http://links.twibright.com/][links] to be installed.&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;interactive&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$p1&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$p2&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$input&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$result&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;    &lt;span class=&#34;c1&#34;&gt;;; lifted from Xah Lee&amp;#39;s 2018-08-16: &amp;#34;emacs, create link of word etymology&amp;#34;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;use-region-p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
	&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;progn&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setq&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$p1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;region-beginning&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
	       &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setq&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$p2&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;region-end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;progn&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setq&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$p1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;line-beginning-position&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
	     &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setq&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$p2&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;line-end-position&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;setq&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$input&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;buffer-substring-no-properties&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$p1&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$p2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;;;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;generate-new-buffer&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$input&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;  &lt;span class=&#34;c1&#34;&gt;; generate new buffer titled with entry word&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;switch-to-buffer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;last-buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; switch to that new buffer&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;insert&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;shell-command-to-string&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;concat&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;links -dump http://www.etymonline.com/word/&amp;#34;&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$input&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; dump text via links from etymonline&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;goto-char&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;point-min&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;; go to beginning&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;re-search-forward&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Error 404 (Not Found)&amp;#34;&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;   &lt;span class=&#34;c1&#34;&gt;; for non-word or words with no etymonline entry&lt;/span&gt;
	&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;slade/word-not-found&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;   &lt;span class=&#34;c1&#34;&gt;; if 404, kill buffer and display minibuffer message&lt;/span&gt;
      &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;slade/trim-etymonbuf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))))&lt;/span&gt;  &lt;span class=&#34;c1&#34;&gt;; otherwise trim off unneeded text from header and footer&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;slade/trim-etymonbuf&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;Trim off unneeded text from top and bottom.&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;goto-char&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;point-min&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;		&lt;span class=&#34;c1&#34;&gt;; goto beginning of buffer&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;search-forward&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;[\s\s]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; 		&lt;span class=&#34;c1&#34;&gt;; the text output of links always delivers text with a &amp;#34;[  ]&amp;#34; right before the text we want&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;begdel&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;delete-region&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;begdel&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;		&lt;span class=&#34;c1&#34;&gt;; delete from beginning of buffer until &amp;#34;[  ]&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;goto-char&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;point-max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;  		&lt;span class=&#34;c1&#34;&gt;; goto end of buffer&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;search-backward-regexp&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Share[[:space:]]*Share on FacebookShare&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;   &lt;span class=&#34;c1&#34;&gt;; the unneeded text at the bottom starts with a &amp;#34;Share&amp;#34; section&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;enddel&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;delete-region&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;point-max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;enddel&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;	&lt;span class=&#34;c1&#34;&gt;; delete from end of buffer until Share section&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;goto-char&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;point-min&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;		&lt;span class=&#34;c1&#34;&gt;; move point back to beginning&lt;/span&gt;

&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;defun&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;slade/word-not-found&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;Delete buffer and display minibuffer message.&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;kill-buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;message&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Sorry, word not found.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After &lt;code&gt;eval&lt;/code&gt;&#39;ing the above, one day, if you have an idle fancy to know
the etymology of a word, you can select it and call &lt;code&gt;slade/etymonbuf&lt;/code&gt;
and have a quick peek at what Etymonline has to say.  Here&amp;rsquo;s what you
get if you try this on &amp;ldquo;lisp&amp;rdquo;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;                                lisp (n.)

&amp;#34;act or habit of lisping,&amp;#34; 1620s, from lisp (v.).

lisp (v.)

sometimes lipse, late 14c. alteration of wlisp, from late Old English
awlyspian &amp;#34;to lisp, to pronounce &amp;#39;s&amp;#39; and &amp;#39;z&amp;#39; imperfectly,&amp;#34; from wlisp
(adj.) &amp;#34;lisping,&amp;#34; which is probably imitative (compare Middle Dutch, Old
High German lispen, Danish læspe, Swedish läspa). General sense &amp;#34;speak
imperfectly or childishly&amp;#34; is from 17c. Transitive sense from 1610s.
Related: Lisped; lisping. Suggestive of effeminacy from 14c.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Probably not the lisp you were looking for, but interesting none the
less.&lt;/p&gt;
&lt;p&gt;Of course it would be nice to retain italics and not to have to depend
on an external application, so there&amp;rsquo;s more that can be done.&lt;/p&gt;
</description>
                
                        <author>Benjamin.Slade@fakeEmailToMakeValidatorHappy.com (Benjamin Slade)</author>
                
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/categories/emacs">emacs</category>
                                 
                                    <category domain="https://babbagefiles.xyz/categories/elisp">elisp</category>
                                
                            
                        
                     
                        
                     
                        
                             
                            
                                
                                 
                                    <category domain="https://babbagefiles.xyz/tags/etymology">etymology</category>
                                
                            
                        
                    
                
                <guid>https://babbagefiles.xyz/emacs_etymologies/</guid>
                <pubDate>Sun, 26 Aug 2018 21:49:00 -0600</pubDate>
            </item>
        
    </channel>
</rss>


