New Package, xkb-mode, to edit X Keyboard Extension Files

New Package, xkb-mode, to edit X Keyboard Extension Files

James Dyer
Based on my recent forays into ergonomic key-mapping in Emacs for SwayWM, and effectively for any Wayland compositor or X11-based system using the X Keyboard Extension (XKB) standard, I realized that there doesn’t seem to be an Emacs mode to edit these keyboard configuration files (*.xkb). This is surprising, considering they have been around for more than 30 years! So I wrote one, and its on MELPA. Summary Features Installation Usage Customization Contributing License Contact ISSUES TODOs / ROADMAP Testing Summary A Major mode for editing X Keyboard Extension (XKB) files
Writing Elisp to Find Available Keybindings in a Sway Config

Writing Elisp to Find Available Keybindings in a Sway Config

James Dyer
I thought I would provide an example of how I typically use elisp to make my life easier (well eventually - I still need to write the function after all!) In the example below, I wanted to find a simple elispy method to determine which Sway keybindings are available, specifically those that utilize the $mod key (typically Mod4/Super). Running out of available $mod keybindings in Sway, and then realizing upon reload that I have inadvertently added a duplicate keybinding, can be quite frustrating.
Emacs Vim Navigation Without Evil

Emacs Vim Navigation Without Evil

James Dyer
Introduction Modal Editing and Emacs My Non-Modal Solution Conclusion Introduction Every now and then I find it necessary to use Vim! (mainly for work) - was that clickbait on an Emacs blog?! 😀 I therefore like to have the muscle memory for basic Vim navigation keybindings already built up as that for me is half the battle when using Vim and I also appreciate the efficiency and natural feel of the navigation keybindings `hjkl`.
How To Map RAlt to Ctrl for Emacs

How To Map RAlt to Ctrl for Emacs

James Dyer
In a recent post I was talking about the benefits of mapping the RAlt key to the Ctrl key and this set up is so far still feeling very comfortable. However, there are many ways to set up the mapping, so below are instructions on how to map the right Alt key (RAlt) to Ctrl for different platforms. These are just the methods I have used in the past, I’m sure there are a multitude of other options out there.
My Emacs Key Workflow Moments Over The Last 30 Years

My Emacs Key Workflow Moments Over The Last 30 Years

James Dyer
I am just at the moment reflecting on how my experience with Emacs over the last 30 years has evolved. I thought that just for fun I would list all the key moments along my Emacs journey regarding work-flow efficiency breakthroughs, roughly in year order!. I think you can see that my investment of time has spiked in recent years, probably spurred on by writing this blog! Firstly I went through the barren years… :
Transitioning RAlt to Ctrl - Enhancing Emacs Keybindings

Transitioning RAlt to Ctrl - Enhancing Emacs Keybindings

James Dyer
In the midst of adjusting my Emacs keybindings for a more ergonomic workflow, I’ve experimented with various configurations. For example, I duplicated the right Alt key (RAlt) to function as an additional Alt key allowing for versatile key presses across the keyboard based on command keybinding locations. The RAlt key is certainly accessible with a little curl under of the right thumb and a modifier key activator I hadn’t even considered before.
Waybar Toggling Sticky Key Keymaps

Waybar Toggling Sticky Key Keymaps

James Dyer
For my previous post I was talking about a software visual indicator to discern which key has been locked in a sticky key situation. For example there are typically two modes of stickiness, being latched and locked, by default I had set up the locked variant as I thought it would be more useful for Emacs and in fact I have found this to be the case. For example, double tapping the Control key allows nice easy single key navigation via ’n’ ‘p’ ‘f’ and ‘b’, possible page down with ‘v’ and to delete lines I can use ‘k’ .
Waybar Sticky Key LED indicators on a Laptop

Waybar Sticky Key LED indicators on a Laptop

James Dyer
From my previous post regarding setting up sticky keys mainly for Control, Alt and Shift in Emacs to remove the dependence on key chording I just wanted to scratch another itch, and that was to provide a modifier LED indicator type experience on a laptop that you would commonly get on a full size keyboard. For example most laptops typically have a single LED indicator on the Caps Lock key with a full size keyboard having Num Lock, Caps Lock and Scroll Lock specific LEDs and generally in that order.
Eliminating Key Chords in Emacs under Linux with Sticky Keys

Eliminating Key Chords in Emacs under Linux with Sticky Keys

James Dyer
I spend many hours living in emacs and a large proportion of this time is using a laptop. Recently I have been thinking about my hands and how to protect them from any future pain or RSI. Emacs out of the box can be a little, lets say tortuous awkward. For example I’ve always found the default keybindings for switching windows (`C-x o`) and saving buffers (`C-x C-s`) to be particularly uncomfortable, a feeling exacerbated by their frequent use.
My Dotfile

My Dotfile

James Dyer
Simply a link to my emacs literate config file 😀
kmonad Sticky Keys on Sway to Help Prevent RSI

kmonad Sticky Keys on Sway to Help Prevent RSI

James Dyer
I primarily use Emacs on a laptop, and unfortunately, Emacs isn’t inherently designed for ergonomic use. Coupled with the less-than-ideal typing experience of continuous laptop use, I’m considering adopting preemptive measures to protect my hands from potential strain injuries, including the infamous emacs pinky and RSI. My awareness of this issue heightened after watching numerous informative coding videos by Xah Lee, from which I’ve gleaned valuable tips on making simple yet effective adjustments to safeguard my hands.
Unified Interface for Switching Contexts - Switch to Thing

Unified Interface for Switching Contexts - Switch to Thing

James Dyer
Now I have ditched save-desktop for recentf which gives me a faster startup time but still being able to quickly access my most common files (i.e. those I have most recently opened) I have realised that I would like to have quick access to other Emacs resources after a startup. This has led me to creating a unified interface of sorts to switch to different contexts through a single keybinding.
selected-window-accent-mode now on MELPA

selected-window-accent-mode now on MELPA

James Dyer
The selected-window-accent-mode is now present on MELPA and is my first Emacs package! It is designed to visually distinguish the currently selected window by applying a unique accent color to its fringes, mode line, header line, and margins. See https://github.com/captainflasmr/selected-window-accent-mode for more information and examples. Whats New Version 0.6.0 DONE ISSUE #1 Do not apply highlighting when frame only contains 1 window when selected-window-accent-smart-borders is set DONE define accent color saturation adjustment
Winner Undo to Tab Bar History

Winner Undo to Tab Bar History

James Dyer
Now I am using the tab-bar workflow I noticed that winner-mode was not working per tab in that the winner undo would return to the previous state of another tab, pretty annoying! 😕 But there is an easy fix, replace (winner-mode 1) with (tab-bar-history-mode 1) and for example I replaced my following keybindings: (global-set-key (kbd "M-u") 'winner-undo) (global-set-key (kbd "M-i") 'winner-redo) with (global-set-key (kbd "M-u") 'tab-bar-history-back) (global-set-key (kbd "M-i") 'tab-bar-history-forward) Ironically I had just been reading a related section in Mastering Emacs and this configuration was recommended to avoid confusion and general vexation.
Opening Frequently Used Files More Efficiently using consult

Opening Frequently Used Files More Efficiently using consult

James Dyer
Periodically, I find myself in situations where I restart Emacs frequently, such as when tweaking my configuration or simply experimenting. During these phases, to achieve a swift start-up, I often resorted to clearing my ibuffer as I tended to have more of an automatic desktop-save type workflow for restoring Emacs sessions. However this would leave me with the task of manually reconstructing my previous session by reopening files. There are of course dired functions, like find-name-dired to more quickly locate files and although I have a good grasp of where my files are, this process became somewhat repetitive and time-consuming.
Emacs asynchronous copying using dired-async-mode

Emacs asynchronous copying using dired-async-mode

James Dyer
For a while now I’ve been using an rsync based dired-copy replacement for large copy asynchronous operations within emacs. It is not uncommon for me to want to copy large files in emacs and rather than waiting for the operation to finish I leveraged async-shell-command to perform an rsync copy as thus: (define-key dired-mode-map (kbd "C") 'my/rsync) (defun my/rsync (dest) "Rsync copy." (interactive (list (expand-file-name (read-file-name "rsync to:" (dired-dwim-target-directory))))) (let ((files (dired-get-marked-files nil current-prefix-arg)) (command "rsync -arvz --progress --no-g ")) (dolist (file files) (setq command (concat command (shell-quote-argument file) " "))) (setq command (concat command (shell-quote-argument dest))) (async-shell-command command "*rsync*") (dired-unmark-all-marks) (other-window 1) (sleep-for 1) (dired-revert) (revert-buffer nil t nil))) Generally this has worked pretty well for me and as a plus I could see the progress in a buffer named *rsync* (although I would typically dismiss it quickly using winner-undo or maybe adding something to display-buffer-alist)
My first emacs package - *selected-window-accent-mode*

My first emacs package - *selected-window-accent-mode*

James Dyer
From my previous two posts regarding defining a Selected Window Accent some interesting posts from irreal arose, especially: Marking The Active Window Where it looks like the simple mode-line-active and mode-line-inactive was a good way to indicate the current focussed window, and I do agree. However to practice my elisp and to create my first emacs package I thought I would bring together my preference which is to have a tiling window manager type of focus involving typically a border around the current window while leveraging the usual customization options that come with emacs.
Improvements to Selected Window Accent

Improvements to Selected Window Accent

James Dyer
Given my previous post regarding accenting the current window: Selected Window Accent “This routine provides a coloured left fringe accent on the selected window to emphasize the current working window.” I had a little issue with visual-fill-column-mode in that : Note that I also had to set the margins to make the window traversal less visually disturbing and it seems to affect visual-fill-column-mode in the fact that it doesn’t work, but maybe I can just try and not use it or eventually figure it out, but for now this is a starting point and I’m sure I will refine it over time.
Selected Window Accent

Selected Window Accent

James Dyer
Borrowing from the concept of a tiling window manager I thought that emacs could better indicate the currently selected window by a form of highlight/emphasis like the following: “This routine provides a coloured left fringe accent on the selected window to emphasize the current working window.” Since I have been using more of an emacs tab-bar based work-flow I found myself spending a second or two looking for my current window when switching tabs.
Redefining mark-paragraph and mark-word

Redefining mark-paragraph and mark-word

James Dyer
I can’t say that I’m completely happy with the way emacs marks some elements, namely : mark-paragraph mark-word mark-paragraph The default mark-paragraph visually selects a paragraph as follows: but I think I would rather have the cursor show at the bottom of the selected paragraph, it just feels more natural to me, so as thus: To achieve this I wrote the following with a rebind to the default mark-paragraph keybinding or in orgs case the mark-element
Describe Character / Face Under Cursor

Describe Character / Face Under Cursor

James Dyer
Every now and then I find myself tweaking the look of emacs and have started to build up a list of my own common faces in custom-set-faces to suit my needs, for example here is my current setup: (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance.
SwayFX Losing Corners

SwayFX Losing Corners

James Dyer
I seemed to temporarily lose the rounded corners in SwayFX and I think the reason for this is that the gaps inner need to be a certain width, for example the following doesn’t seem to work: gaps inner 8px but the following does!: gaps inner 10px
Quick Search Through Org Headers using Consult Outline

Quick Search Through Org Headers using Consult Outline

James Dyer
I’ve been on the lookout for an efficient way to swiftly scan through org headings exclusively for a specified input string, akin to the functionality of isearch. This would enable me to promptly navigate to a past blog post which is typically stored under an org heading. By default, a standard isearch examines the entire file, a behaviour that in this case I don’t really want. I specifically need to limit the search to org headings only, allowing me to swiftly navigate to an org heading.
Battery Laptop Optimisations on Garuda Linux

Battery Laptop Optimisations on Garuda Linux

James Dyer
Table Of Contents auto-cpufreq intel_pstate=passive turning of bluetooth There are quite a few different ways to reduce power consumption on a laptop, most linux distros will be geared towards desktop, but I am always installing on a laptop, generally I was looking to use tlp but the options are quite bewildering and can be daunting so I was looking for something more lightweight and in fact garuda has a good starting point for this:
Window Divider Mode

Window Divider Mode

James Dyer
I was playing around with the look of emacs and thought it might be nice to have more control over the border between windows (I have now learnt that this is referred to as a window divider!) Although I could change the colour using custom-set-faces (vertical-border ((t (:foreground "#444444")))) I wanted the default thin dividing window line to be larger, but initially I couldn’t seem to figure out how do change this.
Digital Art Using Artist Mode #1

Digital Art Using Artist Mode #1

James Dyer
I have been using ArtRage, Krita and Infinite Painter for many years now but I thought I would try that other well known digital art tool… emacs! Using the built-in artist-mode now I really can truly live in emacs full time! Here is my emacs time-lapse! : https://youtu.be/1JZ6ljIRGus 😀
Better Syntax Highlighting Sway Configuration Files

Better Syntax Highlighting Sway Configuration Files

James Dyer
I have been delving into the nuts and bolts of the Sway window manager lately and especially its fork SwayFX which adds a little eye candy in the style of Hyprland. This has led to lots of sway config file editing and hence trying to work out the best way in emacs to work with them. By default a typical sway/config file has its own configuration format and emacs tries its best to figure out which best mode to use and settles on conf-space-mode.
Guide to Creating an Advent Calendar

Guide to Creating an Advent Calendar

James Dyer
Table of Contents template get images resize images import images export print create Here are the steps to create a new advent calendar. template Get the latest template from: nas/Art/Projects/AdventCalendar/advent-calendar--template.kra Copy into a new directory of the named convention: advent-calendar--2023-windows__work.tar.gz get images Get the calendar door images using a ratio of screenshot dimensions 600:420, for example in wayland Win-S-s: slurp -a 600:420 -d | grim -g - ~/DCIM/Screenshots/$(date +'%Y-%m-%d-%H-%M-%S.jpg') Put each image into the img subfolder.
More Improvements to Dired Duplicate Here

More Improvements to Dired Duplicate Here

James Dyer
On a previous post I created an elisp function to quickly duplicate a file or directory in dired, by default it would copy the dired item under the cursor to an old suffix or append a number based on the universal argument. Dired Duplicate Here Revisited (defun my/dired-duplicate-file (arg) "Duplicate the current file in Dired." (interactive "p") (let ((filename (dired-get-filename))) (setq target (concat (file-name-sans-extension filename) "-old" (if (> arg 1) (number-to-string arg)) (file-name-extension filename t))) (if (file-directory-p filename) (copy-directory filename target) (copy-file filename target)) ) ) This worked well for a while but now I want something a little more robust and after working within Krita for a while I decided that I would like to implement its incremental save naming convention.
More Improvements To My Weight Loss Org Table

More Improvements To My Weight Loss Org Table

James Dyer
More improvements to my weight loss table, this time I have added the following: The first column now auto populates an incremental integer Extra column to display the average loss #+PLOT: title:"Weight Loss" ind:1 deps:(4) type:2d with:lines set:"yrange [150:220]" | | date | stn | pnd | lss | tot | bar | av-loss | |---+------------------+-------+-----+-----+-----+----------------+---------| | 0 | <2023-08-18 Fri> | 15:5 | 215 | | | WWWWWWWWWWWWWH | | | 1 | <2023-08-25 Fri> | 14:9 | 205 | -10 | -10 | WWWWWWWWWWWV | 10.
Recursively Listing Files in Size Order using find-name-dired

Recursively Listing Files in Size Order using find-name-dired

James Dyer
For a while now I have been looking for a simple method in emacs for trimming down my largest files, usually this means locating those large image files and compressing them as I like keeping my media compressed or deleting any large files I didn’t know were lurking around my system. The obvious choice for this is find-name-dired but for me always had the annoying habit of reordering the final result after finishing the recursive search.
Plotting Other Org Tables

Plotting Other Org Tables

James Dyer
I’m currently in the process of learning how to create graphical plots from org tables using gnuplot. I’ve noticed that it’s generally more straightforward to extract x-axis data from an org table column with incrementing numbers, as opposed to relying on gnuplot to potentially sort out data from an existing column (which may not be plot-friendly) Generally my existing org tables do not have such an incrementing integer column, so how do I quickly create and populate such a column?
Plotting Org Table Weight Loss Using gnuplot

Plotting Org Table Weight Loss Using gnuplot

James Dyer
Now I have a weight loss org table defined and therefore an easy way to track the total amount of weight loss each week I had an idea for an improvement with some form of a satisfying graphical representation. I have been aware of gnuplot for while now and I think this is an opportunity to give it a try through org-mode The first step is a simple (use-package gnuplot)
Opening Files Externally from dired

Opening Files Externally from dired

James Dyer
I have been using C-RET or W in dired for a while now to open a file externally via browse-url-of-dired-file. I was never quite sure how that worked but it just worked, however now it doesn’t work so I need to do something about it. I suspect that the reason it doesn’t work now is that I have been hopping around different window managers / compositors. My tried and tested workhorse environment is generally kde plasma on arch where the browse-url-of-dired-file was working just fine, but now I have switched to sway / wayland or i3 / x11 this functionality seems to be broken.
Org Table to Calculate Weight Loss

Org Table to Calculate Weight Loss

James Dyer
For a while now I have been using org tables to represent and calculate pieces of data, obviating the need to open up a normal spreadsheet. Recently I have been wanting to create a table to keep track of weight loss and this is what I came up with (with example weights): | date | weight | pounds | loss | total | |------------------+--------+--------+------+-------| | <2023-08-18 Fri> | 15:5 | 215 | | | | <2023-08-25 Fri> | 14:9 | 205 | -10 | -10 | | <2023-09-01 Fri> | 14:2 | 198 | -7 | -17 | | <2023-09-08 Fri> | 13:11 | 193 | -5 | -22 | #+TBLFM: $3='(convert-weight $2)::@3$4.
My Evolving Modeline

My Evolving Modeline

James Dyer
I am a tinkerer and of course emacs is a perfect vehicle for this mentality. A prime example of this is my constant evolving modeline. For many years the default modeline hasn’t presented itself as being a problem, but is it optimal for me?, the answer I have now realised is no, and I think I can do better for my use cases. So after a period of introspection (regarding emacs!
ahk-mode and Updating To AutoHotKey Version 2

ahk-mode and Updating To AutoHotKey Version 2

James Dyer
I have now managed to set up my external USB numeric keypad on Linux using kmonad which lets me use any regular plugged-in number keypad as a shortcut tool for my digital art. This comes in very handy when painting in Krita and ArtRage (through Wine) and maybe one day I will expand this functionality to GIMP when version 3.0 comes out! I would like the same keymapping functionality to be reflected on Windows (as ArtRage is fundamentally a Windows application).
Reverting Buffers

Reverting Buffers

James Dyer
It is not uncommon for me to want to revert my current buffer. For a long while I have used (find-alternate-file) which by default is bound to C-x C-v Recently I switched to mapping this keybinding to revert-buffer but now I have found out about: (revert-buffer-quick &optional AUTO-SAVE) Like ‘revert-buffer’, but asks for less confirmation. If the current buffer is visiting a file, and the buffer is not modified, no confirmation is required.
No Bell For Me

No Bell For Me

James Dyer
Now I have set (pixel-scroll-precision-mode 1) which comes with emacs 29 this has led to an unexpected issue in that I now often get the following messages which cause a bell sound to be generated each time: pixel-scroll-precision-scroll-up-page: Beginning of buffer [22 times] pixel-scroll-precision-scroll-down-page: End of buffer [54 times] I had turned to (setq visible-bell t) in the past but this generates an annoying flash each time rather than an annoying bell sound.
Emacs 29.1 Transparency Alpha On Sway

Emacs 29.1 Transparency Alpha On Sway

James Dyer
I have just been been going through the new features added to emacs 29.1 and have been trying out the transparency or alpha-background on sway. “alpha-background controls the opacity of the text background when running on a composited display.”. I was keenly looking for an emacs improvement to the swaywm built in compositing method which in the case of emacs would make transparent the whole window including text which of course isn’t ideal.
Saving My Favourite Wallpapers

Saving My Favourite Wallpapers

James Dyer
I am using the styli.sh script as my wallpaper changer in sway and with a little transparency and wallpapers from unsplash I can quickly switch randomly through my wallpaper images and get things looking pretty nice. I tend to switch a few times before I find one that I like, but that image tends to disappear when I restart my laptop and the wallpaper gets reset. What I would like to do is to have the ability to send the current wallpaper to a wallpaper favourite folder to build up a chosen set of images.
Simplifying My Modeline

Simplifying My Modeline

James Dyer
After watching the latest informative video from Protesilaos Stavrou (Prot): Emacs: write custom mode line I decided to try and create my own simple mode line incorporating the features I regularly glance at throughout a day. Having mu4e and magit details on my mode line plus other mysterious characters seems a bit much. After adapting the examples given in the video I created the following: (setq-default mode-line-format '("%e" " %o " "%* " my-modeline-buffer-name my-modeline-major-mode)) (defvar-local my-modeline-buffer-name '(:eval (when (mode-line-window-selected-p) (propertize (format " %s " (buffer-name)) 'face '(t :background "#3355bb" :foreground "white" :inherit bold)))) "Mode line construct to display the buffer name.
Showing Org Agenda For The Year

Showing Org Agenda For The Year

James Dyer
I am just starting to include more of my org files into org-agenda. By default C-c a a gives a show for the next 7 days but I think for now I would like something of a more calendarish overview with a long form look of scheduled and completed tasks. I thought I would write an elisp function: (defun display-year-agenda (&optional year) "Display an agenda entry for a whole year.
Shrinking Media With The Help Of Emacs

Shrinking Media With The Help Of Emacs

James Dyer
Often I find myself refining my collection of photos and family videos, usually with the following process: removing media clutter removing any duplicates tagging as necessary compressing where reasonable renaming to a more denote format Emacs and the associated muscle memory greatly helps with this process. Firstly though I leverage other applications, for example, duplicate removal and tagging takes place through digikam, media clutter through thunar and gthumb My emacs process is then:
Defining Categories in Org Files for Hugo

Defining Categories in Org Files for Hugo

James Dyer
I use Hugo to generate my web site and I made a decision early on to use ox-hugo withing emacs and to manage a single large org file with each subheading a blog post and each subheading tag representing… well, tags! I was aware of the concept of defining categories but decided to sort that out at a later date until I really understood what I was doing - this is a common thing that I do.
Porting Dolphin Context Sensitive Scripts To Thunar

Porting Dolphin Context Sensitive Scripts To Thunar

James Dyer
I have decided to switch my linux file manager from Dolphin to Thunar and this means transferring the context sensitive menus I have set up through KDE Plasma to using Thunar’s custom actions. I quickly figured out that I can just modify $HOME/.config/Thunar/uca.xml to add in new Thunar actions, so all I need to do is to firstly work out how to perform the translation from Dolphin to Thunar actions and then how to set up emacs in such a way that would get me to a quick solution.
Dired Duplicate Here Revisited

Dired Duplicate Here Revisited

James Dyer
It is not uncommon for me to want the ability to quickly duplicate a file, especially if I am hacking around and just want a quick snapshot of a working file. Previously I was using dired in a slightly convoluted manner, namely: open dired cursor over the desired item to rename w (dired-copy-filename-as-kill) C (dired-do-copy) paste from the kill ring (yank) modify the filename as desired return But I never actually used this functionality so I think its time for a different approach.
Cycling Colours in CSS and Other Files

Cycling Colours in CSS and Other Files

James Dyer
I try and keep a simple colour scheme definition for my web site using some CSS variables: --theme-fg: #2b2d3a; --theme-bg: #fffbef; --theme-alt: #ffa500; rainbow-mode of course helps to show the colours in situ, but sometimes if I am changing the colour scheme I use list-colors-display and then copy and paste the hex value. But should I use the name instead?, it is tempting as the colour would be very apparent and readable in the CSS file but then it is difficult to just incrementally tweak a hex value to get the colours to look just right.
Revert Git Permission Changes On Repository Transfer

Revert Git Permission Changes On Repository Transfer

James Dyer
I recently reinstalled my laptop and copied across my git repositories from an external backup drive. However most of my repositories were flagged by magit as having been updated mainly with the following issue on multiple files: old mode 100644 new mode 100755 I found a fix for a single repository on stackoverflow but I have quite a few repositories now, so I wrote the following bash script borrowing the core git diff command fix and then ran it in eshell
Magit Status To Show Tracked Files

Magit Status To Show Tracked Files

James Dyer
While currently piecing together my git repositories and figuring out which files to commit I am invariably going to have some Untracked files but I also would like to see the Tracked files in magit-status Well emacs being emacs this can be easily achieved, I added the following to my use-package magit declaration. :config (magit-add-section-hook 'magit-status-sections-hook 'magit-insert-tracked-files nil 'append)
Quickly Deleting Duplicate Blank Lines

Quickly Deleting Duplicate Blank Lines

James Dyer
I am currently hacking around with my org files and in fact macro removing quite a few unnecessary lines. However this has had the side effect of leaving some significant holes in the form of blank lines. Sometimes just two duplicate blank lines and sometimes more! I found that I can quickly trim them down by using delete-duplicate-lines and making sure the identical lines must be adjacent argument is set by passing in a C-u C-u prefix.
Insert Unique Log Message

Insert Unique Log Message

James Dyer
I had tried to implement a debugging logging/print method myself using macros but hadn’t really achieved the level of elegance outlined in https://xenodium.com/sprinkle-me-logs/ I added a couple of programming modes to the function defined in the post above and have now incorporated it into my workflow: ((equal major-mode 'ada-mode) (cons (format "Ada.Text_Io.Put_Line (\"%s: \\([0-9]+\\)\");" word) (format "Ada.Text_Io.Put_Line (\"%s: %%s\");" word))) ((equal major-mode 'c++-mode) (cons (format "std::cout << \"%s: \\([0-9]+\\)\" << std::endl;" word) (format "std::cout << \"%s: %%s\" << std::endl;" word))) For some reason I always seem to tend to ribald statements within my code, something like poop or some other unsavoury variant, I just need to remember to tidy these up later on!
Initial focus in Occur Buffer

Initial focus in Occur Buffer

James Dyer
Just a quick one today! I am finding occur extremely useful, from building an index from my emacs init file to searching through org headers to generally just having my isearch all there in a single window. However I would rather the cursor would jump to the *Occur* buffer when invoked as it just feels a little more natural, so I added the following: (advice-add 'isearch-occur :after '(lambda (origin &rest args) (isearch-exit) (select-window (get-buffer-window "*Occur*")) (goto-char (point-min)) ))
Cursor Blinking Rate

Cursor Blinking Rate

James Dyer
Sometimes I can find a blinking cursor distracting and somewhat expectant!, so currently I am favouring a solid non blinking cursor while still being able to easily locate my cursor using hl-line-mode I have tried beacon and pulsar in the past but have found that a simple line highlight nicely serves my purpose. This however led to a weird issue at work with my emacs setup and although I am not quite sure why it is happening (although I have my theories) I have found a workaround.
Imenu Indexing My emacs Init File

Imenu Indexing My emacs Init File

James Dyer
After implementing my simple occur indexing in my last post : Indexing My Emacs Init File A suggestion was made to put this into an imenu. I thought that was rather a good idea and it would also give me the opportunity to explore imenu I came up with the following to add to the emacs init file : (add-hook 'emacs-lisp-mode-hook (lambda () (setq imenu-sort-function 'imenu--sort-by-name) (setq imenu-generic-expression '( (nil "^;;[[:space:]]+-> \\(.