<?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 Andrew's Memory Blog</title><link>https://andrewmemory.acornwall.net/tags/emacs/</link><description>Recent content in Emacs on Andrew's Memory Blog</description><generator>Hugo -- gohugo.io</generator><image><url>https://andrewmemory.acornwall.net/img/rss_image.png</url><title>Emacs on Andrew's Memory Blog</title><link>https://andrewmemory.acornwall.net/</link></image><language>en</language><managingEditor>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</managingEditor><webMaster>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</webMaster><copyright>Copyright 2009--2025</copyright><lastBuildDate>Sat, 24 Aug 2024 20:10:15 -0700</lastBuildDate><atom:link href="https://andrewmemory.acornwall.net/tags/emacs/index.xml" rel="self" type="application/rss+xml"/><item><title>Building Emacs 29.4 on Ubuntu 22.04</title><link>https://andrewmemory.acornwall.net/blog/2024-08-24-building-emacs-29-4-on-ubuntu-22-04/</link><pubDate>Sat, 24 Aug 2024 20:10:15 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2024-08-24-building-emacs-29-4-on-ubuntu-22-04/</guid><description>&lt;p&gt;I recently had to rebuild Emacs to &lt;a href="https://andrewmemory.acornwall.net/blog/2024-08-24-locking-weirdness-between-ubuntu-cifs-and-emacs/" &gt;diagnose a problem&lt;/a&gt;. It turned out the problem wasn&amp;rsquo;t the Ubuntu Emacs build, but since I had to figure it out, I&amp;rsquo;m writing it down so I will remember next time.&lt;/p&gt;
&lt;h2 class="relative group"&gt;Grab the GNU public keys
&lt;div id="grab-the-gnu-public-keys" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#grab-the-gnu-public-keys" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;GNU has to be different. Rather than signing with some sane thing, they sign their files with gpg. 🙄 Anyway, here&amp;rsquo;s how to do that:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ curl https://ftp.gnu.org/gnu/gnu-keyring.gpg --output gnu-keyring.gpg$ gpg --import gnu-keyring.gpg
# Yes, it just imported 552 keys.&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;h2 class="relative group"&gt;Download Emacs and validate the signature
&lt;div id="download-emacs-and-validate-the-signature" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#download-emacs-and-validate-the-signature" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Feel free to substitute your favorite &lt;a href="https://www.gnu.org/prep/ftp.en.html#gnu_mirror_list" target="_blank" rel="noreferrer"&gt;mirror&lt;/a&gt; for ftp.gnu.org&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ curl https://ftp.gnu.org/gnu/emacs/emacs-29.4.tar.gz.sig --output emacs-29.4.tar.gz.sig
$ curl https://ftp.gnu.org/gnu/emacs/emacs-29.4.tar.gz --output emacs-29.4.tar.gz
$ gpg --verify emacs-29.4.tar.gz.sig
emacs-29.4.tar.gz
gpg: Signature made Sat 22 Jun 2024 08:04:31 AM MST
gpg: using RSA key BB02E407AE9EAA87C9E72A1D2D4E1FE95957135D
gpg: issuer &amp;#34;stefankangas@gmail.com&amp;#34;gpg: Good signature from &amp;#34;Stefan Kangas &amp;lt;stefan@marxist.se&amp;gt;&amp;#34; [expired]
gpg: aka &amp;#34;Stefan Kangas &amp;lt;skangas@skangas.se&amp;gt;&amp;#34; [expired]
gpg: Note: This key has expired!
Primary key fingerprint: CEA1 DE21 AB10 8493 CC9C 6574 2E82 323B 8F43 53EE
Subkey fingerprint: BB02 E407 AE9E AA87 C9E7 2A1D 2D4E 1FE9 5957 135D&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;I guess? that means it&amp;rsquo;s trustworthy?&lt;/p&gt;
&lt;h2 class="relative group"&gt;Install dependencies
&lt;div id="install-dependencies" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#install-dependencies" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;In order to build you&amp;rsquo;ll need some dependencies, so install those using apt.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ sudo apt install libgtk-3-dev libgif-dev libgnutls28-dev texinfo&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;h2 class="relative group"&gt;Extract, build and install Emacs
&lt;div id="extract-build-and-install-emacs" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#extract-build-and-install-emacs" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Next, extract the files. Then configure Emacs for your environment, build it and finally install it.&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;$ tar xzvf emacs-29.4.tar.gz
$ cd emacs-29.4/
$ ./configure (or use ./configure --with-x-toolkit=no if you don&amp;#39;t want X support)
$ make clean; make
$ sudo make install (this installs emacs in /usr/local/bin)
$ /usr/local/bin/emacs
(if you want to uninstall)
$ sudo make uninstall&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;This build installed Emacs in /usr/local/bin, which is ahead of /usr/bin in my path, so I can have both the version I built and the package version installed at the same time. Either change your path, alias emacs=/usr/local/bin/emacs, or uninstall the Ubuntu emacs package.&lt;/p&gt;
&lt;h2 class="relative group"&gt;Clean up
&lt;div id="clean-up" class="anchor"&gt;&lt;/div&gt;
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
&lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#clean-up" aria-label="Anchor"&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Once you&amp;rsquo;re done, you can remove libgtk-3-dev, libgif-dev, libgnutls28-dev and texinfo. Or keep &amp;rsquo;em around, they won&amp;rsquo;t hurt anything.&lt;/p&gt;</description></item><item><title>Locking weirdness between Ubuntu, CIFS and Emacs</title><link>https://andrewmemory.acornwall.net/blog/2024-08-24-locking-weirdness-between-ubuntu-cifs-and-emacs/</link><pubDate>Sat, 24 Aug 2024 01:37:20 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2024-08-24-locking-weirdness-between-ubuntu-cifs-and-emacs/</guid><description>&lt;p&gt;I&amp;rsquo;d run into a strange problem that made working with Emacs really painful. Any time I edited a file with Emacs on my CIFS mounted drive on Ubuntu 22.04, I&amp;rsquo;d see:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;Unlocking file: Invalid argument&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;&amp;hellip; when I opened it. Then, when I tried to save, I&amp;rsquo;d get a message that the save failed. I couldn&amp;rsquo;t exit Emacs, even when I said to abandon changes. (The changes themselves got saved successfully.) I could kill with a SIGTERM, but that left the file locked so I couldn&amp;rsquo;t edit it again.&lt;/p&gt;
&lt;p&gt;I tried rebuilding Emacs from source. Same issue. I suspect there&amp;rsquo;s a problem with CIFS file locking everywhere on Ubuntu, not just Emacs. Some day I&amp;rsquo;ll turf the Ubuntu built-in CIFS and go back to Samba. In the meantime, sometimes all you have is a rock when you want to pound in a nail. Adding:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;;; Something weird going on with file locking on CIFS. Disable it.
(setq create-lockfiles nil)&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;to my ~/.emacs solved the problem.&lt;/p&gt;</description></item><item><title>Inserting current date and time with EMACS</title><link>https://andrewmemory.acornwall.net/blog/2011-01-02-inserting-current-date-and-time-with-emacs/</link><pubDate>Sun, 02 Jan 2011 00:16:06 -0700</pubDate><author>andrewmemoryblog@gmail.com (Andrew's Memory Blog)</author><guid>https://andrewmemory.acornwall.net/blog/2011-01-02-inserting-current-date-and-time-with-emacs/</guid><description>&lt;p&gt;I was recently involved in an activity that required keeping track of notes with timestamps. I decided to do it in EMACS. Here&amp;rsquo;s what I stuffed in my .emacs init file:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;;; Insert the current time in the current buffer
(defun
timestamp()
(interactive)
; If you want to insert date and time, you can use:
(insert(format-time-string &amp;#34;%Y-%m-%d %H:%M:%S &amp;#34;)))
;; Bind Ctrl-T (&amp;#34;transpose&amp;#34;) to the timestamp function - need a better key binding
(global-set-key (kbd &amp;#34;C-t&amp;#34;) &amp;#39;timestamp)&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;Incidentally, I also needed to save the file to DOS format instead of Unix format. To do that:&lt;/p&gt;
&lt;figure class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;M-x set-buffer-file-coding-system&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;
&lt;p&gt;then use &amp;ldquo;dos&amp;rdquo; (or &amp;ldquo;mac&amp;rdquo; or &amp;ldquo;unix&amp;rdquo;).&lt;/p&gt;</description></item></channel></rss>