#+title: Change log of sxhkdrc-mode
#+author: Protesilaos
#+email: info@protesilaos.com
#+options: ':nil toc:nil num:nil author:nil email:nil

This document contains the release notes for each tagged commit on the
project's main git repository: <https://github.com/protesilaos/sxhkdrc-mode>.

The newest release is at the top.  For further details, please consult
the manual: <https://protesilaos.com/emacs/sxhkdrc-mode>.

* 1.2.0 on 2025-08-14
:PROPERTIES:
:CUSTOM_ID: h:485a3878-d01f-4f3a-af79-a12b2294921f
:END:

The package is stable and gets the job done. This version introduces a
small new feature to restart the daemon from inside Emacs. Thanks to
Jonathan Neidel for making the suggestion in issue 1:
<https://github.com/protesilaos/sxhkdrc-mode/issues/1>.

** Reload the SXHKD daemon on demand
:PROPERTIES:
:CUSTOM_ID: h:7cfa6dc6-1d8a-4910-bad0-3a0675a313c9
:END:

The command ~sxhkdrc-mode-restart~ sends a signal to the ~sxhkd~
process which causes it to restart, thus reloading its configuration
file. Use this after modifying the =sxhkdrc= to make the new changes
available.

** Automatically reload the daemon on file save
:PROPERTIES:
:CUSTOM_ID: h:799a92c9-39c4-4682-8438-ffa0050bcfde
:END:

The function ~sxhkdrc-mode-auto-restart~ can be assigned to the
~sxhkdrc-mode-hook~ to automatically reload the daemon after the
=sxhkdrc= file is saved (well, technically, after the file which is
using the ~sxhkdrc-mode~ is saved).

** Sample configuration with ~use-package~
:PROPERTIES:
:CUSTOM_ID: h:6ac9a539-f61f-46d9-ac67-36f995c148e1
:END:

The project's =README.md= includes this sample configuration:

#+begin_src emacs-lisp
(use-package sxhkdrc-mode
  :ensure t
  :mode "sxhkdrc.*" ; if you want more than just "sxhkdrc"
  :commands (sxhkdrc-mode-restart)
  :hook (sxhkdrc-mode . sxhkdrc-mode-auto-restart))
#+end_src

* 1.1.0 on 2024-12-24
:PROPERTIES:
:CUSTOM_ID: h:340134d7-b457-4e23-b478-9ffe2ba2ffc9
:END:

This is a small set of changes to an already stable package.

** The Outline of a file is more refined
:PROPERTIES:
:CUSTOM_ID: h:caa3ed79-ee5b-43fd-a02a-fed8a449b59f
:END:

Each file now has an outline which consists of comment pseudo headings
(starting with three or more =#= followed by a space) and lines with a
key binding. Before it was just the comment headings.

Additionally, the heading levels are defined such that key bindings
are inside the comment headings when we do the folding. This is what
we have in, for example, ~elisp-mode~.

The built-in ~outline-minor-mode~ benefits from this change as do
third-party commands like ~consult-outline~ from the ~consult~
package.

For example, we can get ~outline-minor-mode~ folding of this:

#+begin_src sxhkdrc-mode
# Focus in the given direction. With Shift move the client in the
# given direction. With Ctrl resize the frame in the given direction.
mod4 + {_, shift +, ctrl +} {h,j,k,l}
    herbstclient {focus,shift,resize} {left,down,up,right} {_,_,0.05}
#+end_src

To this:

#+begin_src sxhkdrc-mode
# Focus in the given direction. With Shift move the client in the
# given direction. With Ctrl resize the frame in the given direction.
mod4 + {_, shift +, ctrl +} {h,j,k,l}...
#+end_src

And the same idea for all heading levels.

** Syntax highlighting includes the dot in command names
:PROPERTIES:
:CUSTOM_ID: h:51c5137f-e85c-400d-a118-0e8ecf79aa28
:END:

I made it so that when we bind a command to a key, we get its full
name highlighted even if that includes a file name extension. So now
the ~herbstluftwm_load_workspace_layout.sh~ in the following sample
will get colourised instead of the name without =.sh=:

#+begin_src sxhkdrc-mode
mod4 + w ; {f,t,h,m}
    herbstluftwm_load_workspace_layout.sh {full,third,half,middle}
#+end_src

Another benefit of this refinement is that something like the built-in
command ~mark-sexp~ will recognise the whole name as a syntactic unit.

* 1.0.0
:PROPERTIES:
:CUSTOM_ID: h:5faff63a-1c90-4b57-8881-ec5741403f31
:END:

This version addresses all the issues that were present in the
original release of ~sxhkdrc-mode~.  The package should now provide a
fully fledged major mode for editing =sxhkdrc= files.  Concretely, I
have made the following user-facing changes:

- Refined the indentation rules.  The indent function is robust: it
  knows how to correctly align (i) key definitions, (ii) commands,
  (iii) commands with continuation lines per the =\= shell script
  notation.  Furthermore, indentation is no longer added to wrong
  places, such as at the end of a line.

- Added support for an Imenu index (use =M-x imenu= or the better =M-x
  consult-imenu= from the ~consult~ package).  This provides a
  minibuffer completion interface to all relevant syntactic constructs
  in the buffer.  The index consists of entries for keys and commands.

- Defined an ~outline-regexp~.  One can now use ~sxhkdrc-mode~ in
  tandem with =M-x outline-minor-mode=.  The outline consists of any
  comment that starts with at least three comment characters (=#=).
  Use this to create headings in the document that can be folded in an
  Org-style fashion and/or navigate between them with minibuffer
  completion with the command ~consult-outline~.

  [ Also see my ~logos~ package for more with pages/sections/headings. ]

- Rectified the "filling" of comments.  With default key bindings,
  this is done with =M-q= for ~fill-paragraph~.
