From 4163d8ce1e28b82a542bf26ff649e66c9b4ae59e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 30 Aug 2021 16:37:34 -0500 Subject: Betterize typo-mode --- init.el | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 08f99b8..856c9c5 100644 --- a/init.el +++ b/init.el @@ -1762,19 +1762,29 @@ successive invocations." ;; MARK) is /not/ an apostrophe. Making it curly is a typographical ;; consideration, not an input consideration. (I suppose you could make the ;; argument that all of these are typographical considerations, but .. bleh.) - (:bind "'" self-insert-command - "`" self-insert-command) + (define-typo-cycle typo-cycle-apostrophe + "Cycle through apostrophe-like graphemes. +If used with a numeric prefix argument N, N apostrophes will be inserted." + ("'" "′" "″" "’")) + + (define-typo-cycle typo-cycle-backtick + "Cycle through backtick and left single quotation mark. +If used with a numeric prefix argument N, N backticks will be inserted." + ("`" "‘")) + + (:bind "'" typo-cycle-apostrophe + "`" typo-cycle-backtick) ;; Enable C-c 8 map in all buffers (typo-global-mode +1) (add-hook 'text-mode-hook (defun text-mode@typo-unless () - ;; I use this /instead/ of the provided + "Start `typo-mode' UNLESS the buffer matches a predicate." + ;; I implement this instead of using ;; `typo-disable-electricity-functions' because the latter checks ;; on every pertinent keypress. I know I want /no/ typo-ing in ;; these certain buffers, so I won't even turn on the mode. - "Start `typo-mode' UNLESS the buffer matches a predicate." (unless (or ; predicates here (string-match-p "COMMIT_EDITMSG" (or (buffer-name) ""))) -- cgit 1.4.1-21-gabe81