Flaky Goodness

Quickly summing up the whole stack in Emacs Calc

February 2, 2025

Here is a nice little improvement to calc-mode that adds up all the numbers on the stack. It’s equivalent to hitting the + key until the stack is exhausted, and it’s more handy than I would have expected.

(defun my/calc-sum-stack ()
  (interactive)
  (when-let* ((stack calc-stack)
              (additions (- (length stack) 2))
              (_ (> additions 0)))
    (dotimes (i additions) (call-interactively 'calc-plus))))

I’ve bound it to Ctrl + like this:

(with-eval-after-load 'calc
  (define-key calc-mode-map (kbd "C-+") #'my/calc-sum-stack))

All posts

2025-02-02Quickly summing up the whole stack in Emacs Calc
2024-10-29Setting up an iPad as a dedicated sketchbook
2024-09-19Battery Service
2024-08-28Speeding up Emacs Lisp functions by disabling garbage collection
2024-08-19Failing to share the benefits of using Emacs
2024-08-17Upgrading to Emacs 29.4 on Apple Silicon Macs
2024-06-09Always Yes in Emacs Lisp
2024-05-29I Don’t Trust Parental Controls
2023-12-28Read-Only PDFs
2023-12-23Printing PostScript from Emacs in macOS Sonoma
2023-08-14Oven Fresh
2023-08-13Upgrading to Emacs 29.1 on Apple Silicon Macs
2022-04-10Upgrading to Emacs 28.1 on Apple Silicon (M1) Macs
2021-05-09Visual debugging for Swift Package Manager projects on Linux
2021-05-08Controlling TIDAL with AppleScript
2021-04-26Debug Swift Package Manager projects using dap-debug
2020-12-20Automatic switch for the macOS firewall
2020-12-06Multi-TTY support in Emacs 27
2020-05-27The Best Thing About eGPUs
2020-05-23Faster Dark Mode on macOS
2020-02-28Saving to Empty iCloud Drive Folders
2020-01-03Ensure Proper Ventilation
2019-10-06How to Lose Your Apple Health Data
2019-01-29How Many Conferences
2018-10-11Paste as Code
2018-06-09The iPad Productivity Paradox
2017-06-05Don't Give Up
2017-05-30Hey Siri on the Apple Watch
2017-03-31Networking at WWDC
2016-10-13Making Xcode more like Emacs
2016-02-10Three Products I Hope Apple Makes but They Probably Won't
2016-02-0714-day Week View in Calendar
2015-02-03Pile of Poo
2015-01-21My Priorities
2014-03-03My Problem with Objective-C Dot Syntax
2014-02-24Integrating terminal Vim with Finder [UPDATED 2015-02-10]
2013-07-07NIB-less
2013-06-30My RSS Setup
2013-05-01New Feed URL
2013-04-14The Creamiest TextView in the App Store
2013-04-11Using Panic's Status Board to monitor TimeTiger data
2013-04-07The Softphone that Gene Built
2013-03-29For the Most Part
2013-01-27Be Careful What You Start
2013-01-20User Intention
2013-01-13Unstuck
2013-01-06Archiving a TV News Segment
2012-12-30Pizza Segmentation
2012-12-23Spinning in Circles
2012-12-16Circling the Declarative Drain
2012-12-09How to Draw a Circle
2012-12-02Just Give Up Now
2012-11-25Native Mobile or HTML5
2012-11-18A Consumption Device
2012-11-11Best Enough
2012-11-04The Lifification of Games
2012-10-28Report the Bug
2012-10-21A User by Any Other Name
2012-10-14Getting Rid of Stuff
2012-10-07Start by Being Terrible
2012-09-30Taking Advantage of the Sum of Errors
2012-09-23An Alternative to QuickBooks
2012-09-16There and Back Again
2012-09-09Leader of the Pack
2012-09-023-day
2012-08-26Is Git useful at the beginning of a project?
2008-05-13Tables Anonymous