Categories: geek » emacs

RSS - Atom - Subscribe via email

Solving the mastodon.el error mastodon-auth--access-token: invalid

| emacs, mastodon

If you get mastodon-auth--handle-token-response: Mastodon-auth--access-token: invalid_grant: The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client. while trying to set up mastodon.el from MELPA, you might have an outdated version. Try the following steps:

  • M-x package-delete mastodon
  • Restart Emacs
  • M-x package-refresh-contents
  • M-x package-install mastodon

If that doesn't work, try installing it from the Git repository: https://codeberg.org/martianh/mastodon.el.git

Posting this here to make it searchable.

Logging sent messages to Org Mode with message-sent-hook

| org, emacs

I wanted to e-mail all the EmacsConf speakers who had already uploaded their videos, and I wanted to keep track of the fact that I'd mailed them by adding a note to the :LOGBOOK: drawer in their talk heading. That way, organizers can just look at the logbook to see if we've mailed someone instead of digging through our mailboxes.

org-store-log-note assumes that it's called from the log buffer created by org-add-log-note. It doesn't seem to have a smaller function that can be called to store notes non-interactively, but that's okay. We can just set up the correct markers and call it from a temporary buffer.

(defun emacsconf-add-to-logbook (note)
  "Add NOTE as a logbook entry for the current subtree."
  (move-marker org-log-note-return-to (point))
  (move-marker org-log-note-marker (point))
  (with-temp-buffer
    (insert note)
    (let ((org-log-note-purpose 'note))
      (org-store-log-note))))

Then it's convenient to have a function that adds a note to a specified talk:

(defun emacsconf-add-to-talk-logbook (talk note)
  "Add NOTE as a logbook entry for TALK."
  (interactive (list (emacsconf-complete-talk) (read-string "Note: ")))
  (save-excursion
    (emacsconf-with-talk-heading talk
      (emacsconf-add-to-logbook note))))

I discard many drafts on the way to finalizing the process, so I want the note to be stored only after I actually send the mail. That's the job of message-sent-hook. My mail merge function calls compose-mail, sets up the body of the buffer, and then adds a lambda function to message-sent-hook to file the note in the logbook when sent.

(add-hook 'message-sent-hook
          `(lambda ()
             (mapc
              (lambda (o)
                (emacsconf-add-to-talk-logbook o "Sent speaker-after-video email"))
              (list ,@(mapcar (lambda (talk) (plist-get talk :slug)) talks))))
          nil t)

To see the mail merge code in context, you can check out the TODO entry at https://emacsconf.org/2022/organizers-notebook/#speaker-after-video . It uses functions from emacsconf.el and emacsconf-mail.el at https://git.emacsconf.org/emacsconf-el/ .

2022-11-14 Emacs news

| emacs, emacs-news

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs. Thanks to Andrés Ramírez for emacs-devel links. Do you have an Emacs-related link or announcement? Please e-mail me at sacha@sachachua.com. Thank you!

On Mastodon: @sachac@emacs.ch

| emacs, geek, mastodon

Now that the kiddo's reasonably well-settled into virtual school and EmacsConf is chugging along nicely, I finally have a little time to explore Mastodon, a federated social network that quite a lot of people have been shifting to (and quite a lot of people have been on all along). When @louis@emacs.ch e-mailed me about including the new emacs.ch Mastodon instance in Emacs News, I figured I'd set up a profile for myself and have a look around.

I like to keep an eye on posts mentioning Emacs once in a while, which might be a little more complicated than it is on Twitter given the distributed nature of Mastodon. Anyway, if you post something you'd like me to include in Emacs News, please mention me at @sachac@emacs.ch. Thanks!

I've also set up a bot that posts things from planet.emacslife.com. It's at https://emacs.ch/@emacslife .

I tend to scroll through Mastodon on my phone or using mastodon.el, which is really nice for keyboard navigation.

Update 2022-11-14: I think I've set it up so that @sacha@sachachua.com resolves to my profile at emacs.ch, so you can use either @sacha@sachachua.com or @sachac@emacs.ch. Useful: https://blog.maartenballiauw.be/post/2022/11/05/mastodon-own-donain-without-hosting-server.html and https://willnorris.com/2014/07/webfinger-with-static-files-nginx/ (thanks, @maartenballiauw@mastodon.online !)

See y'all there!

2022-11-07 Emacs news

| emacs, emacs-news

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs. Do you have an Emacs-related link or announcement? Please e-mail me at sacha@sachachua.com. Thank you!

2022-10-31 Emacs news

| emacs, emacs-news

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, emacs-devel, and lemmy/c/emacs. Thanks to Andrés Ramírez for emacs-devel links. Do you have an Emacs-related link or announcement? Please e-mail me at sacha@sachachua.com. Thank you!

subed.el: Word-level timing improvements, TSV support

| emacs

I figured out how to align the subtitles to get word-level timestamps and generate SRV2 files, so now I'm working on improving the support in subed.el so that it can work with those timestamps.

The subed-word-data-load-from-file function in subed-word-data.el should load the word data from the SRV2 file and attempt to match it up with the text, colouring words if they were successfully matched.

Screenshot_2022-10-26_13-46-31.png

Figure 1: After subed-word-data-load-from-file

I also updated and committed code for working with TSV files like the label export from the Audacity audio editor. The concise format might make editing and reviewing easier. The files look like this:

Screenshot_2022-10-26_13-49-00.png

Figure 2: Tab-separated values

To convert an existing file, use subed-convert (from subed-common.el). You can also manually turn on subed-tsv-mode from subed-tsv.el when you're visitng a TSV subtitle/label file. Tab-separated values can be in any sort of text file and tsv is a common file extension, so I don't automatically add it to auto-mode-alist.

The changes should be in 1.0.16 or the latest version from the Git repository at https://github.com/sachac/subed .