Status Update June 2022 — GNUcode.me

Status Update June 2022

by Joshua Branson — July 07, 2022

Sorry for the belated status update.

For June I finally submitted my opensmtpd-records code to be reviewed by guix properly. I am fairly happy about that. Here is the url:

https://issues.guix.gnu.org/56046

I also created a short video showing people how you could play with the current code base.

https://video.hardlimit.com/w/p/bmbYAkQ84BBfF4aAZNAPcR?playlistPosition=8&resume=true

I also fixed Emacs again. Somehow I lost the ability to send email via Emacs,

which is super annoying. I committed everything to git, so hopefully I won’t do that again anytime soon. Here is the gist of how I set up email again:

;; I need to use imap to read my dismail inbox...for some reason, my local gnus
;; cannot read my local dovecot Inbox...No idea why.
(setq gnus-select-method '(nnimap "imap.dismail.de"))

(setq gnus-secondary-select-methods
      '(
        ;; I would like to use gnus as my maildir, but imap works just fine for now.
        ;; (nnmaildir "dismail.de"
        ;;            (nnir-search-engine notmuch)
        ;;            (nnir-notmuch-additional-switches "search")
        ;;            (directory "~/.mail/dismail/"))
        ;; (nnmaildir "fastmail" (directory "~/.mail/"))
        ;; (nntp "news.gwene.org")
        (nntp "news.gmane.io")
        ;; this makes gnus startup super slow!!! (nnmaildir
        ;; "dismail.de" (directory "~/.mail/dismail.de/"))

        (nnimap "gnucode.me"
                (nnimap-stream ssl)
                (nnimap-address "imap.gnucode.me")
                (nnimap-user "joshua"))

        ;; this is the right config, but I'm not certain how to set up a dovecot username and password
        (nnimap "localDismail"
                (nnimap-address "localhost")
                (nnimap-stream network)
                (nnimap-server-port 143)
                )))

;; use msmtp
;; from the emacs wiki: https://www.emacswiki.org/emacs/GnusMSMTP
(setq message-send-mail-function 'message-send-mail-with-sendmail)
;; we substitute sendmail with msmtp
(setq sendmail-program "/home/joshua/.guix-profile/bin/msmtp")
;; This is needed to allow msmtp to do its magic:
(setq message-sendmail-f-is-evil 't)
;;need to tell msmtp which account we're using
(setq message-sendmail-extra-arguments '("--read-envelope-from"))

I created a simple debbugs function to help me search for guix packages:

;; setting up debbugs
(require 'debbugs-autoloads)
;; send mail function so "C" in the debbugs-gnu-mode works
(setq send-mail-function 'message-send-mail-with-sendmail)
;; the below doesn't seem to work
(setq debbugs-gnu-default-packages '("guix" "guix-patches"))
;; my defun for searching for a package my bug #
;; TODO make this seach by default NOT search for closed bugs
;; press x for now.
(defun my-debbugs-search ()
  (interactive)
  (let (string)
    (setq debbugs-gnu-suppress-closed t)
    (setq string (read-string "Search String: "))
    (debbugs-gnu-search string nil nil "guix" nil)))

(defalias 'my-open-bugs 'debbugs-gnu-tagged)

my-open-bugs

M-x my-dubbugs-search RET 56046 RET is a pretty cool way to search for open guix bug reports. Also M-x debbugs-gnu-search is broken on doom emacs. It keeps prompting you for more input. It never lets you search. Weird.

I also found out that in the debbugs-gnu-mode (the buffer that appears after you search for bugs), you can type in “t” to tag yourself to open bugs. This is an easy way to remind yourself, which buys you want. Then M-x my-open-bugs or M-x debbugs-gnu-tagged shows you a buffer of bugs that you are currently interested in.

I also learned that I can unarchive, tag, close, and do various other things to bugs by pressing the "C" key inside a debbugs-gnu-mode buffer. I actually closed one of my old bug reports from inside emacs the other day: M-x my-debbugs-search RET 39271

I also played with a proposed patch from Ludo yesterday:

M-x my-debbugs-search 56114. Basically, it lets you build a gexp and show the output file from the repl. It’s a really nifty patch, and I hope it gets merged soon.

In order to play with the proposed patch, I had to learn how to apply patches from debbugs to my local guix-src branch:

First find the patch via issues.guix.gnu.org or debbugs.

guix install emacs-debbugs

M-x my-debbugs-search BugNumber RET

Find the email via debbugs, and type in O m to save the file.

Then open up M-x magit-status RET w m to apply the patch.

magit may give you an odd error. But you can always check the log. Sometimes it applies the patch, and still gives you an error. In my case, it applied the patch that I wanted to play with, but then magit thought there were other patches that I may want to apply. Magit was stuck in "applying patches mode", and would not let me re-order commits. My fixed this error by typing "w s". "w" is appylying patches mode. "s" is skip. This fixed the error, and applied the patch successfully.

This method works fairly well, if you are applying one patch. But to apply a patch series, it may be a be a tedious process.

That’s where this irc conversation comes in handy:

      gnucode │ is there an easy way to apply a patch from debbugs-gnu to my local guix repository?
unmatched-paren │ gnucode: download the mbox and `git am` away :)
      gnucode │ unmatched-paren that seems very tedious...
unmatched-paren │ curl might be able to make it easier
      gnucode │ It would be nice if I could apply the patch from emacs and debbugs...just my 2 cents.
      morganw │ I think there is an Emacs package which can apply git patches that are in a mail message.
unmatched-paren │ I use aerc which allows me to download and apply the mbox automatically, not sure whether $EMACS_MAIL_CLIENT can do that
unmatched-paren │ aerc command is :pipe -mb git am -3<Enter>
unmatched-paren │ "pipe the mbox into git am three-way"
      gnucode │ unmatched-paren are you using mbox to read the guix email achives?
unmatched-paren │ gnucode: what do you mean?
unmatched-paren │ i think aerc uses maildir by default
      gnucode │ ok.  Maybe I should give aerc a try.  I keep wanting to use emacs for most of my email and everything needs.  But I have a really hard time figuring out how to use it.
      gnucode │ I used to be able to send email via emacs...now I can't.
      morganw │ gnucode: I think this is one some people use: https://git.kyleam.com/piem
unmatched-paren │ aerc uses vi commands, fyi
      gnucode │ I am using evil-mode
unmatched-paren │ ah
unmatched-paren │ gnucode: I'm afraid my patch adding aerc hasn't been merged yet though
unmatched-paren │ because of the general lack of vi users around here :)
      morganw │ It believe that if you use Gnus there is also a built in command to send the message buffer to a pipe and so something with it.
      morganw │ *do something
      morganw │ Or possibly it was built into message mode, I think I tried it once but I don't remember the exact process.
unmatched-paren │ maybe there's a way to pipe the mbox too
      gnucode │ I just found this: https://emacs.stackexchange.com/questions/36885/how-do-i-apply-a-patch-from-gnus-to-a-git-repo
      gnucode │ seems promising
unmatched-paren │ nice!
  ulfvonbelow │ M-> C-<space> M-< M-| <your command here>
  ulfvonbelow │ that works with any buffer btw
      rekado_ │ gnucode: I use mu4e (which uses gnus message mode to display emails) and wired up the mu4e-action-git-apply-mbox action.
      gnucode │ rekado_: do you ever use debbugs?
      rekado_ │ I dog-food mumi / issues.guix.gnu.org
      gnucode │ rekado_: hahah.

See you next time!