April 14th 2026 - Stocks, Journal, and Readability Tests
Interesting things I came across today
- Emacsen Emacs docs - Nicely styled Emacs manuals
- Itihasas - a beautiful way to explore Hindu texts in the style of roam-ui
- Tamagotchi on Emacs
- Davinci Resolve - A seriously good looking Adobe competitor
Added displaying stock info in Emacs minibuffer
I like to track my stock portfolio and I use Mac widgets for a quick glance at stock prices but after moving to the Philippines the widgets have become unreliable. Sometimes they don't update and other times they give wrong stock prices.
So I wrote a python script to pull stock prices and return them in the terminal. Then I wrote an Elisp function to call this script from inside Emacs. This displays the results in the minibuffer.
Python Code:
Imports. This uses yfinance to do most of the heavy lifting and tabulate to display the results in a tabular format:
import yfinance as yf from tabulate import tabulate
Setting up which tickers I want to tracks. This is just an example as I don't want to reveal my actual portfolio here. Maybe one day I'll do a post on what I invest in.
tickers = [ 'SPY', 'VOO', ]
The main function. This grabs the date for each ticker and extracts the current price and percent change for the day. It then prints the data to the terminal in tabular format:
def run(): stocks = [] for ticker in tickers: data = get_data(ticker) current_price = format_price(data['current_price']) movement = format_change(data['movement']) stocks.append([ticker, current_price, movement]) print(tabulate(stocks))
The output looks like this:
---- -------- ------ SPY $ 710.14 1.21 % VOO $ 652.78 1.23 % ---- -------- ------
The helper function definitions:
def format_change(change): return f'{round(change, 2)} %' def format_price(price): return f'$ {round(price, 2)}' def get_data(ticker): ticker_result = yf.Ticker(ticker) history = ticker_result.history() current_price = history.tail(1)['Close'].iloc[0] prev_close = history.tail(2)['Close'].iloc[0] movement = ((current_price - prev_close) / prev_close) * 100 return { 'current_price': current_price, 'movement': movement }
Elisp
Calling it from inside Emacs is trivial. I've added a bash script to my bin directory which calls the python script and I call that in Emacs in a different process so that the editor doesn't hang. The results are then shown in the minibuffer:
(defun my/show-stocks () "Show stocks in portfolio along with current price and percent movement for the day" (interactive) (message "Getting stocks...") (async-start (lambda () (shell-command-to-string "export PATH=$PATH:~/bin && stocks")) (lambda (result) (message "%s" result))))
My Journal
I keep a journal where I track all the interesting things I discover and the thoughts I have every day. I then take these entries and massage them into blog posts and roam entries.
My journal is an org file with one top level entry for each day. I wanted to add a way to open my journal and move the pointer to the last entry so I can start writing immediately.
One challenge was opening up only the last date heading to reveal the entries for that day.
I solved it by using re-search-backward. This uses regex to search backwards for a top level org heading.
(defun my/open-journal-file () "Open journal.org file." (interactive) (find-file "~/org/journal.org") ;; Go to the last line of the file (evil-goto-line) ;; Go to the last top level heading (re-search-backward "^\\* ") ;; Reveal text immediately after the heading (org-fold-show-entry) ;; Reveal children of the heading (org-fold-show-children) ;; Go to the last line of the file (evil-goto-line))
One thing to note is if you want to see everything under a heading you need to call both:
(org-fold-show-entry) (org-fold-show-children)
- org-fold-show-entry: to show the text immediately following the heading
- org-fold-show-children: to show the children of the heading
Pasting from the Kill Ring after the point
When I try to paste from the Kill Ring it always pastes before the point when I want it to paste after. I don't know if this is a problem for people not using Evil Mode but I solved this by writing my own function:
(defun my/paste-from-kill-ring () "Pastes after the point from the selected item in the kill ring" (interactive) (unless (eolp) (forward-char)) (call-interactively #'consult-yank-from-kill-ring))
This moves the pointer 1 character forward unless its already at the end of the line (eolp) and then calls the paste function.
Google is implementing a new spam policy
Google is implementing a new spam policy to curb back button hijacking.
Some malicious websites are treating the back button as an opportunity to spam users or hijack the intended behavior by showing them ads or preventing them from leaving pages.
Google is implementing a new policy that will rank demote pages that participate in this behavior.
Flesch Kincaid readability test
I learned about the Flesch Kincaid readability test. Its test devised to indicate how readable a piece of text is. It gives two values; an ease of readability score and a reading grade level.
There are some issues identified with these formulas but its useful to get a general idea of the difficulty of text. You can find a calculator here.
The formulas are below. There are some algorithms for determining the total number of syllables which I may explore later:
Flesch Reading Ease Score
206.835 − 1.015 × ( Total Words / Total Sentences ) − 84.6 × ( Total Syllables / Total Words )
Flesch-Kincaid Grade Level
0.39 × ( Total Words / Total Sentences ) + 11.8 × ( Total Syllables / Total Words ) − 15.59
Reading
The Hobbit Reading Summary
- Chapter 3 - A long journey ahead
They continued on their journey and eventually are left with little food. They finally see the beginning of The Misty Mountains and Bilbo asks if that is their destination. But Balin tells him that its not and they have to get through all of the Misty Mountains and then past the Wilderlands and even then its a long way from there. Bilbo felt very tired at that moment.
The continued their path further to find Elrond's house. And they went very far. They came across many valleys and gullies and bogs.
The Eye of the World Reading Summary
Atomic Habits Reading Summary
- The problems with only setting goals instead of working on systems
- Winners and losers have the same goals
- Achieving a goal is only a momentary change
- Goals restrict your happiness
- Goals are at odds with progress
Number 3 reminds me of the Stoic approach where instead of making results the source of your happiness you make what you can control the source of your happiness. Making results the source always keeps putting off the happiness until the next milestone.
Number 4 is about not continuing to do our systems after we achieve a large enough goal. This limits progress.
- Why its hard to change habits
- We try to change the wrong thing
- We try to change them in the wrong way
Prot's Elisp Book Reading Summary
- Function calls
Function calls are just lists. (message "Hello") is a list with 2 elements in it.
- Single ticks '
Single tick ' means not to evaluate the expression right now and to only use it as is.
Example:
(message "This is a message with %s" '(one two three))
Output:
This is a message with (one two three)