From aeb03f9144e39c882ca6c5c61b9ed1300a2a12ee Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 5 Jun 2025 13:16:09 +0200 Subject: Add more remaps and add documentation strings --- xcompose-mode.el | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/xcompose-mode.el b/xcompose-mode.el index ff27965..073447a 100644 --- a/xcompose-mode.el +++ b/xcompose-mode.el @@ -100,7 +100,10 @@ :group 'languages) (defcustom xcompose-rule-style 'string-codepoint - "TODO" + "Rule style to use for `xcompose-insert-rule.' + +XCompose rules may include a codepoint, a string, or both. For more +details, checkout the xcompose(5) manual page." :type '(choice (const :tag "Codepoint only" codepoint) (const :tag "String and codepoint" string-codepoint) (const :tag "String only" string)) @@ -121,13 +124,13 @@ (?} . "| "))) (modify-syntax-entry (car pair) (cdr pair) st)) st) - "Syntax table for xcompose-mode") + "Syntax table for `xcompose-mode'.") (defvar xcompose-mode-map (let ((map (make-sparse-keymap))) (keymap-set map "C-c C-i" #'xcompose-insert-rule) map) - "Keymap for xcompose-mode") + "Keymap for `xcompose-mode'.") (defvar xcompose--modifier-rx (regexp-opt '("Ctrl" "Lock" "Caps" "Shift" "Alt" "Meta" "None"))) @@ -141,10 +144,7 @@ ("[!~]" . 'xcompose-modifier-prefix-face) (":" . 'xcompose-colon-face) ("^[ \t]*include" . 'xcompose-keyword-face)) - "Keywords for xcompose-mode") - -(defvar xcompose-key-regexp "<[a-zA-Z0-9_]+" - "Regexp matching the beginning of a keystroke.") + "Keywords for `xcompose-mode'.") (defvar xcompose--char-name-table (let ((ht (make-hash-table :test #'eq)) @@ -163,13 +163,14 @@ (puthash (car pair) (cdr pair) ht)) ht)) -;; I wonder if this will be useful or really annoying. (define-abbrev-table 'xcompose-mode-abbrev-table - '(("" nil :system t) + '(("" nil :system t) + ("" nil :system t) ("" nil :system t) ("" nil :system t) ("" nil :system t) ("" nil :system t) + ("" nil :system t) ("" nil :system t) ("" nil :system t) ("" nil :system t) @@ -179,6 +180,8 @@ ("" nil :system t) ("" nil :system t) ("" nil :system t) + ("" nil :system t) + ("" nil :system t) ("" nil :system t) ("" nil :system t) ("" nil :system t) @@ -189,12 +192,13 @@ ("" nil :system t) ("" nil :system t) ("" nil :system t) + ("" nil :system t) ("" nil :system t) ("" nil :system t) + ("" nil :system t) ("" nil :system t) - ("" nil :system t) - ("" nil :system t)) - "Abbrev table" + ("" nil :system t)) + "Abbreviation table for `compose-mode'." :regexp "\\(<[a-zA-Z0-9_]+\\)" :case-fixed t) @@ -205,7 +209,11 @@ (insert ?< (gethash key xcompose--char-name-table key) "> ")) (defun xcompose-insert-rule () - "TODO" + "Insert a new remapping rule at point. + +Reads a key sequence and a resulting rune from the minibuffer, and +inserts the corresponding remapping rule at point. The style of the rule +is determined by the variable `xcompose-rule-style'." (interactive) (let ((keys (vconcat (read-string (format-prompt "Key sequence" nil)))) (rune (read-char-from-minibuffer (format-prompt "Resulting rune" nil)))) @@ -231,4 +239,4 @@ comment-end "")) (provide 'xcompose-mode) -;;; xcompose-mode.el ends here +;;; xcompose-mode.el ends here \ No newline at end of file -- cgit v1.2.3