branch: externals/altcaps commit c5fc69691656cec22f156dba446135fcc8e96da0 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
BREAKING make altcaps-force-character-casing value be a string, not character --- README.org | 14 +++++++------- altcaps.el | 9 +++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/README.org b/README.org index 71fa391ee3..241b0326eb 100644 --- a/README.org +++ b/README.org @@ -105,9 +105,9 @@ Use any of the following commands to achieve the desired results: #+vindex: altcaps-force-character-casing The user option ~altcaps-force-character-casing~ forces the given letter casing for specified characters. Its value is an alist of -=(CHARACTER . CASE)= pairs. =CHARACTER= is a single character -(satisfies the ~characterp~ condition), while =CASE= is the ~upcase~ -or ~downcase~ symbol (code sample further below). +=(STRING . CASE)= pairs. =STRING= is a string with a single +character, while =CASE= is the ~upcase~ or ~downcase~ symbol (code +sample further below). The idea is to always render certain characters in lower or upper case, in consideration of their legibility in context. For example, @@ -124,8 +124,8 @@ The code to do this: #+begin_src emacs-lisp (setq altcaps-force-character-casing - '((?i . downcase) - (?l . upcase))) + '(("i" . downcase) + ("l" . upcase))) #+end_src * Installation @@ -192,8 +192,8 @@ Everything is in place to set up the package. ;; Force letter casing for certain characters (for legibility). (setq altcaps-force-character-casing - '((?i . downcase) - (?l . upcase))) + '(("i" . downcase) + ("l" . upcase))) ;; We do not bind any keys, but you are free to do so: (define-key global-map (kbd "C-x C-a") #'altcaps-dwim) diff --git a/altcaps.el b/altcaps.el index 121938b48b..21ec86a37c 100644 --- a/altcaps.el +++ b/altcaps.el @@ -101,9 +101,9 @@ communication. Plus, you appear more sophisticated. tRuSt Me." :group 'editing) (defcustom altcaps-force-character-casing nil - "Force the given letter casing for specified characters. -This is an alist of (CHARACTER . CASE). CHARACTER must satisfy -`characterp', while CASE is the symbol `upcase' or `downcase'. + "Force the given letter casing for specified single character strings. +This is an alist of (STRING . CASE). STRING must satisfy +`stringp', while CASE is the symbol `upcase' or `downcase'. The idea is to always render certain characters in lower or upper case, in consideration of their legibility in context. For @@ -121,10 +121,11 @@ You do want to communicate mockery or sarcasm, though legibility still matters! (Regardless, I encourage everyone to use a decent font that disambiguates characters.)" :type '(alist - :key-type (character :tag "Single character") + :key-type (string :tag "Single character string") :value-type (radio :tag "Letter casing" (const :tag "Lower case" downcase) (const :tag "Upper case" upcase))) + :package-version '(altcaps . "1.2.0") :group 'altcaps) (defun altcaps-transform (string)