Next steps: I want to find out how to get :sort nil to be respected so that more recent blog posts are listed first. Also, it might be fun to define a similar source for the sections of my Emacs configuration, like the way I can use my dotemacs: Org Mode link type with completion.
[2025-07-12 Sat]: Use cl-pushnew instead of add-to-list, correct browse-url-browser-browser-function to browse-url-browser-function, and add an example for eww.
On IRC, someone asked for help configuring Emacs
to have a keyboard shortcut that would either open
the URL at point or search the web for the region
or the word at point. I thought this was a great
idea that I would find pretty handy too.
Let's write the interactive function that
I'll call from my keyboard shortcut.
First, let's check if there's an active region.
If there isn't, let's assume we're looking at
the thing at point (could be a URL, an e-mail
address, a filename, or a word).
If there are links, open them.
Otherwise, if there are e-mail addresses,
compose a message with all those email addresses
in the "To" header.
Are we at a filename? Let's open that.
Otherwise, do a web search. Let's make that
configurable. Most people will want to use a web
browser to search their favorite search engine,
such as DuckDuckGo or Google, so we'll make that
the default.
(defcustommy-search-web-handler"https://duckduckgo.com/html/?q=""How to search. Could be a string that accepts the search query at the end (URL-encoded)or a function that accepts the text (unencoded).":type'(choice (string :tag"Prefix URL to search engine.")
(function:tag"Handler function.")))
(defunmy-open-url-or-search-web (&optional text-or-url)
(interactive (list (if (region-active-p)
(buffer-substring (region-beginning) (region-end))
(or
(and (derived-mode-p 'org-mode)
(let ((elem (org-element-context)))
(and (eq (org-element-type elem) 'link)
(buffer-substring-no-properties
(org-element-begin elem)
(org-element-end elem)))))
(thing-at-point 'url)
(thing-at-point 'email)
(thing-at-point 'filename)
(thing-at-point 'word)))))
(catch'done
(let (links)
(with-temp-buffer
(insert text-or-url)
(org-mode)
(goto-char (point-min))
;; We add all the links to a list first because following them may change the point
(while (re-search-forward org-any-link-re nil t)
(cl-pushnew (match-string-no-properties 0) links))
(when links
(dolist (link links)
(org-link-open-from-string link))
(throw'done links))
;; Try emails
(while (re-search-forward thing-at-point-email-regexp nil t)
(cl-pushnew (match-string-no-properties 0) links))
(when links
(compose-mail (string-join links ", "))
(throw'done links)))
;; Open filename if specified, or do a web search
(cond
((ffap-guesser) (find-file-at-point))
((functionp my-search-web-handler)
(funcall my-search-web-handler text-or-url))
((stringp my-search-web-handler)
(browse-url (concat my-search-web-handler (url-hexify-string text-or-url))))))))
I've been really liking how consult-omni lets me do quick searches as I type from within Emacs,
which is actually really cool. I've even extended
it to search my bookmarks as well, so that I can
find things using my words for them and not trust
the internet's words for them. So if I wanted to
search using consult-omni, this is how I would do
it instead.
(setopt my-search-web-handler #'consult-omni)
Now I can bind that to C-c o in my config
with this bit of Emacs Lisp.
With DuckDuckGo handling searches: (setopt my-search-web-handler "https://duckduckgo.com/html?q=")
antidisestablishmentarianism
With consult-omni handling searches: (setopt my-search-web-handler #'consult-omni)
antidisestablishmentarianism
Depending on the kind of URL, I might want to look
at it in different browsers. For example, some
websites like https://emacswiki.org work perfectly
fine without JavaScript, so opening them in EWW
(the Emacs Web Wowser) is great. Then it's right
there within Emacs for easy copying, searching,
etc. Some websites are a little buggy when run in
anything other than Chromium. For example,
MailChimp and BigBlueButton (which is the
webconference server we use for EmacsConf) both
behave a bit better under Google Chrome. There are
some URLs I want to ignore because they don't work
for me or they tend to be too paywalled, like
permalink.gmane.org and medium.com. I want to open
Mastodon URLs in mastodon.el. I want to open the
rest of the URLs in Firefox, which is my current
default browser.
To change the way Emacs opens URLs, you can
customize browse-url-browser-function and
browse-url-handlers. For example, to set up the
behaviour I described, I can use:
June 2025
2025-06-30-04
playdates, splash pads, sewing, Stardew
🖼️ art gallery
💦 splash pad
🪴 jump rope, seedlings
🪡 lots of sewing
🪡 sewed a hat
🙃 upside down with friends
🍦 radishes, ice cream
🚲 biked through rain
🪡 storage bag
🍪 cracker
😴 tough bedtime
🍦 ice cream bar
🚲 friend delivery
🥔 potato print, pizza party
👴 visited grandparents
👰 wedding dress in Stardew
🍓 hulled lots of strawberries
🌧️ rainy day, golden walnuts
🦕 ROM
🌡 sick day for A+
🥧 apple pies
😷 my turn to be sick
🌡 fever, naps
🍓 strawberries, lettuce, report card
🎵 stayed up for music homework
🪡 aprons
🏊 last day of school, first day of wading pool
🏺 pottery, two pies
🐸 hopping with J- & K-
🪡 swim skirt, 23x9= math
A+ finished virtual grade 3 and is now on summer
break. I let her decide between mostly structured
and mostly unstructured time. She picked mostly
unstructured time, with one set of private
swimming lessons at an outdoor pool and one
week-long afternoon summer camp focused on pottery
wheels. The rest of the time is for hanging out at
splash pads, wading pools, and swimming pools,
often with A+'s friends. When it's too hot even
for that, we stay inside. There haven't been as
many "I'm booored!"s as I expected. I think
dealing with school gave her a lot of practice in
managing boredom and coming up with her own
activities, which is fantastic. It's important to
be able to check in with herself and figure out
what she's curious about, what she wants to do,
and to know that she can come up with that instead
of needing someone else to direct her day.
Sometimes A+ uses Claude to help her write
stories, sometimes she builds LEGO, sometimes she
plays Minecraft or Stardew Valley, and sometimes
she watches Clone Wars. Sometimes we tag along on
W-'s Bike Brigade deliveries, so that's nice.
Sometimes she helps me with sewing by doing
straight seams, winding the bobbin, or threading
the needle. She's been cubing again, packing a 3x3
Rubik's cube when she thinks there might be some
waiting time. I still have the timer app on my
phone, so she can check how she's doing. This
feels like a good kind of busy: not externally
imposed, but intrinsically motivated. Not
regimented, but going with the flow.
A+ has lots of ideas for things to sew based on
things she wants to wear or use, and is very much
into having us both wear matching outfits. It
turns out that I fit into kid-sized Crocs, so it's
easy to get matching colours there too. The
pendulum of childhood, I guess. We're currently on
the "let's match" side, and then we'll swing over
to individuation, and then we'll swing back, and
then further out to individuation, and so on. I
love that we can explore this through our clothes,
shoes, and interests. Some days she wants to be
just like me, and almost physically tries to
occupy the same space. (Cuddles are great! I know
this opportunity is time-limited.) Other days she
grumps at me and nothing I say is right. It's
great to be able to not take it personally. It's
all part of healthy development.
We're making quick progress through my fabric
stash. I've been making clothes: mostly training
bras, skorts, and swim skirts out of Spandex so
that we can wear it straight into the pool and out
again. I've even been able to make a few clothes
for me instead of just for her. I used godets to
turn last year's swim skirt for A+ into a swim
skirt for me, and I added in-seam pockets. Pockets
are great for stashing goggles, glasses, and
diving toys. I want pockets in everything now.
It's nice getting the hang of more of these little
techniques, especially since it means I can turn
more scraps and outgrown clothes into new things.
I sewed a large zippered liner for W-'s drawer so
that we could protect out-of-season wool clothes
and blankets from moths. I used the leftover
canvas to make a bag for A+ so that she could shop
for snacks independently, since the reusable bags
from the store dragged on the ground when she held
them in her hand. This one is just the right size.
It's great to be able to make things that fit. I
also made aprons for her and one of her friends,
whom we treated to a pottery class. A+ enjoyed
potato-printing her bag and apron at the Bike
Brigade x Not Far From the Tree pizza party at the
park, which was a lot of fun. It might be
interesting to pick up more paintable/dyeable
fabric and some fabric paint so that we can make
our own designs.
A+ was briefly sick with a fever, and then I had a
sore throat and a fever too. Now no one has a
fever, but I still have a persistent cough. We
think we might have picked something up at the
party. Even though it was outdoors it was a bit
crowded, lots of people were talking, and we
hadn't worn our masks. Oh well, just gotta do
better next time and mask up at big events. At
least I'm still testing negative for COVID. I'm
masking at home so that W- doesn't get sick, and
generally taking it easy. We got a membership for
the ROM, but the annoyance of this cough is making
me extra grumpy about crowds and indoor things, so
it might be a while before we're back. Plenty to
do outdoors now that the weather is warm and her
friends play outside.
I probably should sleep more, but I've been
staying up to play Stardew Valley, which you'd be
able to tell from my time records. I like the
game. Even the kiddo is learning to slow down and
take care of her farm. Sometimes we play co-op,
and sometimes we work on our own playthroughs. I
have a fairly built-up standard farm playthrough
where I let A+ take over Ginger Island. I'm proud
of how I successfully didn't grump when she
decided to rip up most of my starfruit plants
there and then ended up not replacing them with
anything. Not even a blip of grumpiness. I already
had more money than I felt like spending, thanks
to the ancient fruit winery I'd set up. Aside from
cooking and puttering around with the sewing
machine, A+ also liked giving my character
relationship advice. She encouraged me to marry
Emily, pronouncing her the most compatible. (She
married Elliott in her own playthrough.) After I
gave Emily the mermaid pendant and came back to
the farmhouse, A+ had set up a mannequin with a
full wedding outfit as a gift for me. She was
proud of gathering all the materials needed and
sewing the virtual outfit herself. I love that the
sandbox nature of the game lets her come up with
her own ideas and make things happen.
I also have a four corners farm with remixed
bundles where I've just completed the community
centre and I'm now slowly collecting hardwood for
the boat to Ginger Island. I've developed an
appreciation for the fishing minigame that I used
to avoid. It's a great way to get treasure.
Anyway, Stardew is a pleasant enough way to spend
little bits of time here and there, and to relax
after A+'s bedtime. It's encouraging to see that I
could actually find plenty of discretionary time
in my day for playing, and I can use that time for
other things once this hyperfocus passes.
Our real-life garden is doing all right, too. Most
of the remaining radishes have bolted, although
some of the larger ones are still growing well. In
spring I gave A+ a bunch of seed packets and let
her plant entirely at her own discretion. I've
been having fun figuring out how to identify and
manage the results, thinning out the ones that are
definitely not what we're looking for in that
space or that just need a little more spacing. We
get a lot of volunteer tomatoes, perilla,
goosefoot, wood sorrel, and clover. I've been
putting those in the compost to make room for the
marigolds and poppies that I recognize from the
seed packet pictures. I'm learning to identify
other plants as they grow. It's fun letting A+ try
whatever she likes and then figuring out how to
work with that. It's also fun blending the
real-life world and the virtual world. We make the
sound effect from Stardew Valley when we uproot
our radishes and hold them up above our heads.
Taking advantage of those last days of predictable
focus time while virtual school was in session, I
got the ball rolling for EmacsConf 2025 with the
call for participation. I also enjoyed attending
the virtual Emacs Berlin meetup and taking notes.
I wrote a bunch of blog posts, too.
We'll see how my focused time settles down now
that we're on summer schedule. It turns out that I
still have plenty of free time. The daytime part
is just more interruptible now because I want to
be ready to do something with A+ or head out the
door when A+ expresses an interest in going to a
playdate or a pool. I still want to get my own
stuff done instead of feeling like I'm on standby,
so it's great that my notes make it easier for me
to make progress in stop-and-go segments. I want
her to feel like I'm happy to spend time with her
instead of being distracted by an interrupted task. I also want
her to see how I choose things to do with my time
and how I use notes to help me work around the
limitations of my brain and my attention. It's an
interesting challenge balancing between occupation
and flexibility. I want her to enjoy unstructured
time and to be able to shift between solo
interests and shared time according to the rhythms
of her energy.
July is probably going to be about hanging out
with A+ near some kind of water. I like this
approach of trusting her to manage her time and
attention, letting her take the initiative when it
comes to going out and playing with friends or
swimming in the pool. In the meantime, there's
time for me to write and play.