<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Emacs on The Lone C++ Coder's Blog</title><link>https://www.lonecpluspluscoder.com/tags/emacs/</link><description>Recent content in Emacs on The Lone C++ Coder's Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sat, 22 Oct 2022 15:10:00 -0500</lastBuildDate><atom:link href="https://www.lonecpluspluscoder.com/tags/emacs/index.xml" rel="self" type="application/rss+xml"/><item><title>How to build/upgrade emacs-mac using homebrew</title><link>https://www.lonecpluspluscoder.com/2022/10/22/homebrew-emacs-mac-cask-from-source/</link><pubDate>Sat, 22 Oct 2022 15:10:00 -0500</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2022/10/22/homebrew-emacs-mac-cask-from-source/</guid><description>&lt;p&gt;In the time honored tradition of using one&amp;rsquo;s blog as an Internet-enabled notepad, here&amp;rsquo;s a quick not on how I build GNU Emacs on macOS using homebrew and the emacs-mac port cask:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;brew upgrade -s railwaycat/emacsmacport/emacs-mac --with-mac-metal --with-imagemagick --with-native-comp --with-modern-icon --with-natural-title-bar&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This - amongst other features - turns on some experimental macOS-relevant features and most importantly, the optional native compilation of Elisp code.&lt;/p&gt;</description></item><item><title>How can I pin dependent packages when using use-package?</title><link>https://www.lonecpluspluscoder.com/2022/02/20/can-i-pin-dependent-packages-use-package/</link><pubDate>Sun, 20 Feb 2022 21:15:00 -0500</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2022/02/20/can-i-pin-dependent-packages-use-package/</guid><description>&lt;p&gt;I&amp;rsquo;ve been trying to up my &lt;code&gt;use-package&lt;/code&gt; game recently and converted my hand rolled package check and installer to &lt;code&gt;use-package&lt;/code&gt;. I usually prefer to use packages from &lt;code&gt;melpa-stable&lt;/code&gt; so I pin the default package source used by &lt;code&gt;use-package&lt;/code&gt; to &lt;code&gt;melpa-stable&lt;/code&gt; and override it where necessary That&amp;rsquo;s working well in general and looks something like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-elisp" data-lang="elisp"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;(&lt;span style="color:#366"&gt;setq&lt;/span&gt; &lt;span style="color:#033"&gt;use-package-always-pin&lt;/span&gt; &lt;span style="color:#c30"&gt;&amp;#34;melpa-stable&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;(&lt;span style="color:#366"&gt;use-package&lt;/span&gt; &lt;span style="color:#033"&gt;js2-mode&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#366"&gt;:ensure&lt;/span&gt; &lt;span style="color:#360"&gt;t&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#366"&gt;:defer&lt;/span&gt; &lt;span style="color:#360"&gt;t&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#366"&gt;:custom&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; (&lt;span style="color:#366"&gt;progn&lt;/span&gt; (&lt;span style="color:#033"&gt;js-indent-level&lt;/span&gt; &lt;span style="color:#f60"&gt;2&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; (&lt;span style="color:#033"&gt;js2-include-node-externs&lt;/span&gt; &lt;span style="color:#360"&gt;t&lt;/span&gt;)))
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;(&lt;span style="color:#366"&gt;use-package&lt;/span&gt; &lt;span style="color:#033"&gt;kotlin-mode&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#366"&gt;:ensure&lt;/span&gt; &lt;span style="color:#360"&gt;t&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#366"&gt;:pin&lt;/span&gt; &lt;span style="color:#033"&gt;melpa&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;So in other words, if I&amp;rsquo;m on a machine that doesn&amp;rsquo;t have &lt;code&gt;js2-mode&lt;/code&gt; and &lt;code&gt;kotlin-mode&lt;/code&gt; installed, &lt;code&gt;use-package&lt;/code&gt; will install &lt;code&gt;js2-mode&lt;/code&gt; from &lt;code&gt;melpa-stable&lt;/code&gt; and &lt;code&gt;kotlin-mode&lt;/code&gt; from &lt;code&gt;melpa&lt;/code&gt;. So far, so good.&lt;/p&gt;</description></item><item><title>Automatically enabling multiple Emacs minor modes via a major mode hook</title><link>https://www.lonecpluspluscoder.com/2021/09/07/emacs-enable-multiple-minor-modes-from-major-mode/</link><pubDate>Tue, 07 Sep 2021 19:15:00 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2021/09/07/emacs-enable-multiple-minor-modes-from-major-mode/</guid><description>&lt;p&gt;In Emacs, I usually end up enabling the same set of minor modes when I use one of my &amp;ldquo;writing modes&amp;rdquo;, namely modes like markdown-mode and org-mode. Enabling a single minor mode automatically is generally pretty easy via the appropriate mode hook, but enabling more than one minor mode requires one more level of indirection. Of course it does, because everything in computer science requires one more level of indirection :).&lt;/p&gt;</description></item><item><title>[HOWTO] Installing Emacs 26.3 on Ubuntu or XUbuntu 19.04</title><link>https://www.lonecpluspluscoder.com/2019/10/13/howto-installing-emacs-26-3-on-ubuntu-or-xubuntu-19-04/</link><pubDate>Sun, 13 Oct 2019 12:19:03 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2019/10/13/howto-installing-emacs-26-3-on-ubuntu-or-xubuntu-19-04/</guid><description>&lt;p&gt;My &lt;a href="https://www.lonecpluspluscoder.com/2017/07/30/building-emacs-25-2-on-xubuntu-17-04/"&gt;previous instructions&lt;/a&gt; for installing a newer Emacs version on Ubuntu still work. Ubuntu (and in my case, XUbuntu) 19.04 ships with Emacs 26.1 out of the box. As usual I want to run the latest version - &lt;a href="https://lists.gnu.org/archive/html/emacs-devel/2019-08/msg00577.html"&gt;Emacs 26.3&lt;/a&gt; - as I run that on my other Linux, FreeBSD and macOS machines.&lt;/p&gt;
&lt;p&gt;I only had to make one small change compared to the older instructions. Instead of running the versioned &lt;code&gt;sudo apt-get build-dep emacs25&lt;/code&gt; I ran &lt;code&gt;sudo apt-get build-dep emacs&lt;/code&gt;. Once the dependencies are installed, you&amp;rsquo;re a configure/make/make install away from having a working Emacs 26.3:&lt;/p&gt;</description></item><item><title>Wrapping up the Emacs on Mac OS X saga</title><link>https://www.lonecpluspluscoder.com/2019/04/14/wrapping-up-the-emacs-on-mac-os-x-saga/</link><pubDate>Sun, 14 Apr 2019 10:15:00 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2019/04/14/wrapping-up-the-emacs-on-mac-os-x-saga/</guid><description>&lt;p&gt;In a previous &lt;a href="https://www.lonecpluspluscoder.com/2019/04/08/unwelcome-surprise-homebrew-emacs-has-no-gui-after-os-x-mojave-update/"&gt;post&lt;/a&gt; I mentioned that I upgraded my homebrew install of Emacs after Emacs 26.2 was released, and noticed that I had lost its GUI functionality. That&amp;rsquo;s a pretty serious restriction for me as I usually end up with multiple frames across my desktop. I did end up installing the homebrew &lt;a href="https://github.com/railwaycat/homebrew-emacsmacport"&gt;Emacs for Mac tap&lt;/a&gt; which restored the GUI functionality. It had have one niggling problem for me, though. My muscle memory says that I use Shift-Meta-7 (aka Meta-/ ) for keyword expansion as I use a German keyboard layout most of the time. Unfortunately, with Meta mapped to the Apple Command key, Shift-Meta-7 is a menu shortcut. Instead of expanding keywords, I kept opening menus. That clearly wouldn&amp;rsquo;t do.&lt;/p&gt;</description></item><item><title>Emacs 26.2 on WSL with working X-Windows UI</title><link>https://www.lonecpluspluscoder.com/2019/04/12/emacs-26-2-on-wsl-with-working-x-windows-ui/</link><pubDate>Fri, 12 Apr 2019 23:00:00 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2019/04/12/emacs-26-2-on-wsl-with-working-x-windows-ui/</guid><description>&lt;p&gt;I&amp;rsquo;ve blogged about building &lt;a href="https://www.lonecpluspluscoder.com/2018/04/19/emacs-26-1-rc1-on-windows-subsystem-for-linux/"&gt;Emacs 26 on WSL before&lt;/a&gt;. The text mode version of my WSL build always worked for me out of the box, but the last time I tried running an X-Windows version, I ran into rendering issues. Those rendering issues unfortunately made the GUI version of Emacs unusable on WSL. Nothing like missing the bottom third of your buffer to cramp your style. Or your editing.&lt;/p&gt;
&lt;h2 id="going-all-in-with-emacs-262-with-cairo"&gt;Going all in with Emacs 26.2 with Cairo&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve just built the newly &lt;a href="https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00503.html"&gt;released Emacs 26.2&lt;/a&gt; on my Ubuntu WSL with the options &lt;code&gt;–with-cairo –with-x-toolkit=gtk&lt;/code&gt; and it looks like the rendering has improved massively. I&amp;rsquo;ve also recently upgraded VcXsrv to version 1.20.1.1, so it&amp;rsquo;s not quite clear to me if this is due to improved compatibility of WSL itself, changes between Emacs 26.1 and 26.2, or the fact that I turned on Cairo or VcXSrv upgrade.&lt;/p&gt;</description></item><item><title>Unwelcome surprise - homebrew Emacs has no GUI after OS X Mojave update</title><link>https://www.lonecpluspluscoder.com/2019/04/08/unwelcome-surprise-homebrew-emacs-has-no-gui-after-os-x-mojave-update/</link><pubDate>Mon, 08 Apr 2019 21:17:20 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2019/04/08/unwelcome-surprise-homebrew-emacs-has-no-gui-after-os-x-mojave-update/</guid><description>&lt;p&gt;I finally got around to upgrading my OS X installation from Mojave to High Sierra - my OS update schedule is usually based on the old pilot wisdom of &amp;ldquo;don&amp;rsquo;t fly the A model of anything&amp;rdquo;. As part of the upgrade, I ended up reinstalling all homebrew packages including Emacs to make sure I was all up to date. That proved to be a big mistake as I suddenly had a GUI-less Emacs. Of course I found the post on &lt;a href="https://irreal.org/blog/?p=7506"&gt;Irreal&lt;/a&gt; about the Emacs homebrew package being broken on Mojave after, well, I noticed that my Emacs GUI wasn&amp;rsquo;t working. Oops.&lt;/p&gt;</description></item><item><title>Running Emacs from inside Emacs</title><link>https://www.lonecpluspluscoder.com/2017/12/13/running-emacs-inside-emacs/</link><pubDate>Wed, 13 Dec 2017 21:44:52 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2017/12/13/running-emacs-inside-emacs/</guid><description>&lt;p&gt;I&amp;rsquo;m experimenting with screen recordings at the moment and just out of curiosity decided to see if I can load and edit a text file inside the main Emacs process from inside an ansi-term using emacsclient.&lt;/p&gt;
&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/l6T7kLefjAc" frameborder="0" allow="autoplay; encrypted-media"&gt; &lt;/iframe&gt;
&lt;p&gt;Spoiler alert - yes, you can. At least the way it is set up on my system, emacsclient doesn&amp;rsquo;t play with text mode (-nw) as it doesn&amp;rsquo;t recognise eterm-color as a valid terminal type, but loading and editing the file into the GUI works flawlessly.&lt;/p&gt;</description></item><item><title>Emacs on the Linux Subsystem for Windows</title><link>https://www.lonecpluspluscoder.com/2017/11/15/emacs-on-the-linux-subsystem-for-windows/</link><pubDate>Wed, 15 Nov 2017 05:48:00 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2017/11/15/emacs-on-the-linux-subsystem-for-windows/</guid><description>&lt;p&gt;I&amp;rsquo;ve had the Linux Subsystem for Windows enabled for quite a while during the time it was in Beta. With the release of the Fall Creators Update, I ended up redoing my setup from scratch. As usual I grabbed Emacs and a bunch of other packages and was initially disappointed that I was looking at a text-mode only Emacs. That might have something to do with the lack of an X Server…&lt;/p&gt;
&lt;p&gt;For a free X Server on Windows, I had a choice of &lt;a href="http://www.straightrunning.com/XmingNotes/"&gt;Xming&lt;/a&gt; and &lt;a href="https://sourceforge.net/projects/vcxsrv/"&gt;VcXsrv&lt;/a&gt;. I used Xming a long time ago and I&amp;rsquo;m happy to pay for software, but decided to go with something free for this initial proof of concept. Plus, I was curious about VcXsrv, so I picked that. I really like that its installer includes everything I needed right out of the box, including the fonts.&lt;/p&gt;</description></item><item><title>Emacs 25.3 released</title><link>https://www.lonecpluspluscoder.com/2017/09/14/emacs-25-3-released/</link><pubDate>Thu, 14 Sep 2017 21:20:27 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2017/09/14/emacs-25-3-released/</guid><description>&lt;p&gt;Emacs 25.3 has been &lt;a href="https://lists.gnu.org/archive/html/info-gnu/2017-09/msg00006.html"&gt;released&lt;/a&gt; on Monday. Given that it&amp;rsquo;s a security fix I&amp;rsquo;m downloading the source as I write this. If you&amp;rsquo;re using the latest Emacs I&amp;rsquo;d recommend you update your Emacs. The vulnerability as been around since Emacs 19.29, you probably want to upgrade anyway.&lt;/p&gt;
&lt;p&gt;Build instructions for Ubuntu and friends are the &lt;a href="https://www.lonecpluspluscoder.com/2017/07/30/building-emacs-25-2-on-xubuntu-17-04/"&gt;same as before&lt;/a&gt;, the FreeBSD port appears to have been updated already and I&amp;rsquo;m sure homebrew is soon to follow if they haven&amp;rsquo;t updated it already.&lt;/p&gt;</description></item><item><title>Building Emacs 25.2 on XUbuntu 17.04</title><link>https://www.lonecpluspluscoder.com/2017/07/30/building-emacs-25-2-on-xubuntu-17-04/</link><pubDate>Sun, 30 Jul 2017 16:03:00 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2017/07/30/building-emacs-25-2-on-xubuntu-17-04/</guid><description>&lt;p&gt;I haven&amp;rsquo;t used Ubuntu much recently after switching several systems to Manjaro, but had to set up a laptop with XUbuntu 17.04. That came with Emacs 24.5 as the default emacs package, and as skeeto pointed out in the comments, with a separate emacs25 package for Emacs 25.1. I tend to run the latest release Emacs everywhere out of habit, so I revisited my build instructions to build a current Emacs on Ubuntu and its derivates. The good news is that in thanks to some changes in the Emacs build, the build is as straightforward as it used to be prior to the combination of Ubuntu 16.10 and Emacs 25.1. In other words, no need to remember to switch off PIE as was necessary &lt;a href="https://www.lonecpluspluscoder.com/2016/10/08/how-to-build-gnu-emacs-25-1-on-xubuntu-16-04/"&gt;when building GNU Emacs 25.1 on Ubuntu 16.10.&lt;/a&gt;&lt;/p&gt;</description></item><item><title>RTFM, or how to make unnecessary work for yourself editing inf-mongo</title><link>https://www.lonecpluspluscoder.com/2017/05/09/rtfm-make-unnecessary-work-editing-inf-mongo/</link><pubDate>Tue, 09 May 2017 18:31:39 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2017/05/09/rtfm-make-unnecessary-work-editing-inf-mongo/</guid><description>&lt;p&gt;Turns out I made some unnecessary &amp;ldquo;work&amp;rdquo; for myself when I tried to &lt;a href="https://www.lonecpluspluscoder.com/2017/05/07/extending-inf-mongo-to-support-scrolling-through-command-history/"&gt;add support for command history to inf-mongo&lt;/a&gt;. As Mickey over at Mastering Emacs points out in a blog post, comint mode already comes with &lt;em&gt;M-n&lt;/em&gt; and &lt;em&gt;M-p&lt;/em&gt; mapped to &lt;em&gt;comint-next-input&lt;/em&gt; and &lt;em&gt;comint-previous-input&lt;/em&gt;. And of course they work in &lt;a href="https://github.com/endofunky/inf-mongo"&gt;inf-mongo&lt;/a&gt; right out of the box. I still prefer using M-up and M-down, plus I learned a bit about sparse key maps and general interaction with comint-mode. So from that perspective, no time was wasted although it wasn&amp;rsquo;t strictly necessary to put in the work.&lt;/p&gt;</description></item><item><title>Extending inf-mongo to support scrolling through command history</title><link>https://www.lonecpluspluscoder.com/2017/05/07/extending-inf-mongo-to-support-scrolling-through-command-history/</link><pubDate>Sun, 07 May 2017 20:30:00 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2017/05/07/extending-inf-mongo-to-support-scrolling-through-command-history/</guid><description>&lt;p&gt;I&amp;rsquo;m spending a lot of time in the MongoDB shell at the moment, so of course I went to see if someone had built an Emacs mode to support the MongoDB shell. Google very quickly pointed me at &lt;a href="https://github.com/endofunky/inf-mongo"&gt;endofunky&amp;rsquo;s inf-mongo mode&lt;/a&gt;, which implements a basic shell interaction mode with MongoDB using comint. We have a winner, well, almost. The mode does exactly what it says on the tin, but I wanted a little more, namely being able to scroll through my command history. Other repl modes like &lt;a href="https://github.com/clojure-emacs/cider"&gt;Cider&lt;/a&gt; have this functionality already, so it couldn&amp;rsquo;t be too hard to implement, could it?&lt;/p&gt;</description></item><item><title>What happened to XEmacs?</title><link>https://www.lonecpluspluscoder.com/2016/12/03/what-happened-to-xemacs/</link><pubDate>Sat, 03 Dec 2016 10:40:41 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2016/12/03/what-happened-to-xemacs/</guid><description>&lt;p&gt;I used XEmacs quite a lot in the 2000s before I switched back to the more stable GNU Emacs. That was back then before GNU Emacs offered a stable official Windows build when XEmacs did, and at the time I was doing a lot of Windows development.&lt;/p&gt;
&lt;p&gt;Out of curiosity and for some research I tried to look into the current state of the project and found that the &lt;a href="https://www.xemacs.org"&gt;www.xemacs.org&lt;/a&gt; appears to be unreachable. The domain still exists and according to whois was last updated in September 2015. The &lt;a href="http://xemacs.sourceforge.net/index.html"&gt;XEmacs Sourceforge page&lt;/a&gt; is still around, but appears to have received its last set of updates in 2009. Obviously a lot of links to the bug tracker, mailing list hosts etc are dead as they&amp;rsquo;re point to subdomains of xemacs.org.&lt;/p&gt;</description></item><item><title>Switching to Manjaro Linux and getting an AMD RX 470 to work</title><link>https://www.lonecpluspluscoder.com/2016/11/19/switching-to-manjaro-linux-and-getting-an-amd-rx-470-to-work/</link><pubDate>Sat, 19 Nov 2016 16:00:08 +0000</pubDate><author>Timo Geusch</author><guid>https://www.lonecpluspluscoder.com/2016/11/19/switching-to-manjaro-linux-and-getting-an-amd-rx-470-to-work/</guid><description>&lt;p&gt;I&amp;rsquo;ve been a Xubuntu user for years after switching from OpenSuse. I liked its simplicity and the fact that it just worked out of the box, but I was getting more and more disappointed with Ubuntu packages being out of date, sorry, stable. Having to rebuild a bunch of packages on every install was getting a little old. Well, they did provide material for all those &amp;ldquo;build XXX on Ubuntu&amp;rdquo; posts. Recently I&amp;rsquo;ve been playing with &lt;a href="https://manjaro.org/"&gt;Manjaro Linux&lt;/a&gt; in a VM as I had been looking for an &lt;a href="https://www.archlinux.org/"&gt;Arch Linux&lt;/a&gt; based distribution that gave me the right balance between DIY and convenience. I ended up liking it so much that I did a proper bare metal install on my main desktop. The install was pretty smooth apart from a issue with getting my AMD RX 470 graphics card to work.&lt;/p&gt;</description></item></channel></rss>