about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el31
1 files changed, 21 insertions, 10 deletions
diff --git a/init.el b/init.el index 74f3258..1a54c79 100644 --- a/init.el +++ b/init.el
@@ -1694,16 +1694,17 @@ successive invocations."
1694 ;; I don't use paredit-splice-sexp much, and it stomps on isearch. 1694 ;; I don't use paredit-splice-sexp much, and it stomps on isearch.
1695 (:unbind "M-s") 1695 (:unbind "M-s")
1696 1696
1697 (defun setup-paredit-mode () 1697 (defun paredit@setup ()
1698 "Correct weirdnesses and set up paredit mode." 1698 "Correct weirdnesses and set up paredit mode."
1699 (paredit-mode +1) 1699 (:with-map lisp-mode-shared-map
1700 (let ((map lisp-mode-shared-map)) 1700 (:bind "DEL" paredit-backward-delete
1701 (define-key map (kbd "DEL") #'paredit-backward-delete) 1701 "C-M-;" comment-or-uncomment-sexp
1702 (define-key map (kbd "C-M-;") #'comment-or-uncomment-sexp))) 1702 "C-<backspace>" paredit-backward-kill-word))
1703 (paredit-mode +1))
1703 1704
1704 (dolist (mode lispy-modes) 1705 (dolist (mode lispy-modes)
1705 (add-hook (intern (concat (symbol-name mode) "-hook")) 1706 (add-hook (intern (concat (symbol-name mode) "-hook"))
1706 #'setup-paredit-mode)) 1707 #'paredit@setup))
1707 1708
1708 (require 'eldoc) 1709 (require 'eldoc)
1709 (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)) 1710 (eldoc-add-command 'paredit-backward-delete 'paredit-close-round))
@@ -1807,19 +1808,29 @@ successive invocations."
1807 ;; MARK) is /not/ an apostrophe. Making it curly is a typographical 1808 ;; MARK) is /not/ an apostrophe. Making it curly is a typographical
1808 ;; consideration, not an input consideration. (I suppose you could make the 1809 ;; consideration, not an input consideration. (I suppose you could make the
1809 ;; argument that all of these are typographical considerations, but .. bleh.) 1810 ;; argument that all of these are typographical considerations, but .. bleh.)
1810 (:bind "'" self-insert-command 1811 (define-typo-cycle typo-cycle-apostrophe
1811 "`" self-insert-command) 1812 "Cycle through apostrophe-like graphemes.
1813If used with a numeric prefix argument N, N apostrophes will be inserted."
1814 ("'" "′" "″" "’"))
1815
1816 (define-typo-cycle typo-cycle-backtick
1817 "Cycle through backtick and left single quotation mark.
1818If used with a numeric prefix argument N, N backticks will be inserted."
1819 ("`" "‘"))
1820
1821 (:bind "'" typo-cycle-apostrophe
1822 "`" typo-cycle-backtick)
1812 1823
1813 ;; Enable C-c 8 map in all buffers 1824 ;; Enable C-c 8 map in all buffers
1814 (typo-global-mode +1) 1825 (typo-global-mode +1)
1815 1826
1816 (add-hook 'text-mode-hook 1827 (add-hook 'text-mode-hook
1817 (defun text-mode@typo-unless () 1828 (defun text-mode@typo-unless ()
1818 ;; I use this /instead/ of the provided 1829 "Start `typo-mode' UNLESS the buffer matches a predicate."
1830 ;; I implement this instead of using
1819 ;; `typo-disable-electricity-functions' because the latter checks 1831 ;; `typo-disable-electricity-functions' because the latter checks
1820 ;; on every pertinent keypress. I know I want /no/ typo-ing in 1832 ;; on every pertinent keypress. I know I want /no/ typo-ing in
1821 ;; these certain buffers, so I won't even turn on the mode. 1833 ;; these certain buffers, so I won't even turn on the mode.
1822 "Start `typo-mode' UNLESS the buffer matches a predicate."
1823 (unless (or ; predicates here 1834 (unless (or ; predicates here
1824 (string-match-p "COMMIT_EDITMSG" 1835 (string-match-p "COMMIT_EDITMSG"
1825 (or (buffer-name) ""))) 1836 (or (buffer-name) "")))