diff options
| author | Axel Forsman <axelsfor@gmail.com> | 2023-07-04 22:13:45 +0200 |
|---|---|---|
| committer | Axel Forsman <axelsfor@gmail.com> | 2023-07-09 21:30:03 +0200 |
| commit | 759392a1cd8c90c27a2ecc67d3e65f752452e33f (patch) | |
| tree | bd0193185fa3d6219df6b32ef4763ebdeadf9390 /evil-digraphs.el | |
| parent | be4815e7e779c2cc8898d3ebd17a950d22d04723 (diff) | |
Autoload evil-digraph
Diffstat (limited to 'evil-digraphs.el')
| -rw-r--r-- | evil-digraphs.el | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/evil-digraphs.el b/evil-digraphs.el index 7344bd9..2bd3687 100644 --- a/evil-digraphs.el +++ b/evil-digraphs.el @@ -25,10 +25,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with Evil. If not, see <http://www.gnu.org/licenses/>. -(require 'evil-vars) - ;;; Code: +(require 'evil-vars) + (defgroup evil-digraphs nil "Digraph support based on RFC 1345." :group 'evil @@ -41,9 +41,7 @@ a cons cell of the digraph and its character replacement, where the digraph is a list of two characters. See also `evil-digraphs-table'." :type '(alist :key-type (list character character) - :value-type character) - :require 'evil-digraphs - :group 'evil-digraphs) + :value-type character)) (defconst evil-digraphs-table '(((?N ?U) . ?\x00) @@ -1716,16 +1714,16 @@ This includes all digraphs defined in RFC 1345, as well as miscellaneous digraphs for multi-byte characters. See also `evil-digraphs-table-user'.") +;;;###autoload (defun evil-digraph (digraph) "Convert DIGRAPH to character or list representation. If DIGRAPH is a list (CHAR1 CHAR2), return the corresponding character; if DIGRAPH is a character, return the corresponding list. Searches in `evil-digraphs-table-user' and `evil-digraphs-table'." (if (listp digraph) - (let* ((char1 (car digraph)) - (char2 (cadr digraph))) - (or (cdr (assoc (list char1 char2) evil-digraphs-table-user)) - (cdr (assoc (list char1 char2) evil-digraphs-table)) + (or (cdr (assoc digraph evil-digraphs-table-user)) + (cdr (assoc digraph evil-digraphs-table)) + (cl-destructuring-bind (char1 char2) digraph (unless (eq char1 char2) (or (cdr (assoc (list char2 char1) evil-digraphs-table-user)) (cdr (assoc (list char2 char1) evil-digraphs-table)))))) |
