From 0e0d0fbd9a9926739c014b83f268fe06e113bfe4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 16 Nov 2015 09:59:27 +0100 Subject: Fix indentation --- tag-emacs/emacs.d/init.org | 200 +++++++++++++++++++++++---------------------- 1 file changed, 101 insertions(+), 99 deletions(-) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 75811af..ed21bd1 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -1995,35 +1995,36 @@ With =web-mode= being so good, I don’t really use this much. It’s good for embedded SQL though. #+BEGIN_SRC emacs-lisp -(req-package mmm-auto - :config (progn - (mmm-add-classes - '((php-sql - :submode sql-mode - :front "<< (point) (mark)) - (exchange-point-and-mark)) - (save-excursion - (while (re-search-forward (regexp-quote (string omark)) (mark) t) - (replace-match (regexp-quote (string singleo)) nil nil))) - (save-excursion - (while (re-search-forward (regexp-quote (string qmark)) (mark) t) - (replace-match (regexp-quote (string singleq)) nil nil))) - (skeleton-insert (list nil omark '_ qmark) -1))) - ((looking-at (regexp-opt (list (string omark) (string qmark)))) - (forward-char 1)) - (t ad-do-it))))) - :init (progn - (add-hook 'text-mode-hook #'typopunct-mode))) + ((or (eq (char-before) typopunct-em-dash) + (looking-back "\\([[:blank:]]\\|^\\)\\^")) + (delete-char -1) + (insert typopunct-minus)) + ((looking-back "[^[:blank:]]\\^") + (insert typopunct-minus)) + (t ad-do-it))) + + (defconst typopunct-ellipsis (decode-char 'ucs #x2026)) + (defconst typopunct-middot (decode-char 'ucs #xB7)) ; or 2219 + (defun typopunct-insert-ellipsis-or-middot (arg) + "Change three consecutive dots to a typographical ellipsis mark." + (interactive "p") + (cond + ((and (= 1 arg) + (eq (char-before) ?^)) + (delete-char -1) + (insert typopunct-middot)) + ((and (= 1 arg) + (eq this-command last-command) + (looking-back "\\.\\.")) + (replace-match "") + (insert typopunct-ellipsis)) + (t + (self-insert-command arg)))) + (define-key typopunct-map "." 'typopunct-insert-ellipsis-or-middot) + + (defconst typopunct-times (decode-char 'ucs #xD7)) + (defun typopunct-insert-times (arg) + (interactive "p") + (if (and (= 1 arg) (looking-back "\\([[:blank:]]\\|^\\)\\^")) + (progn (delete-char -1) + (insert typopunct-times)) + (self-insert-command arg))) + (define-key typopunct-map "x" 'typopunct-insert-times) + + (defadvice typopunct-insert-quotation-mark (around wrap-region activate) + (let* ((lang (or (get-text-property (point) 'typopunct-language) + typopunct-buffer-language)) + (omark (if single + (typopunct-opening-single-quotation-mark lang) + (typopunct-opening-quotation-mark lang))) + (qmark (if single + (typopunct-closing-single-quotation-mark lang) + (typopunct-closing-quotation-mark lang)))) + (cond + (mark-active + (let ((skeleton-end-newline nil) + (singleo (typopunct-opening-single-quotation-mark lang)) + (singleq (typopunct-closing-single-quotation-mark lang))) + (if (> (point) (mark)) + (exchange-point-and-mark)) + (save-excursion + (while (re-search-forward (regexp-quote (string omark)) (mark) t) + (replace-match (regexp-quote (string singleo)) nil nil))) + (save-excursion + (while (re-search-forward (regexp-quote (string qmark)) (mark) t) + (replace-match (regexp-quote (string singleq)) nil nil))) + (skeleton-insert (list nil omark '_ qmark) -1))) + ((looking-at (regexp-opt (list (string omark) (string qmark)))) + (forward-char 1)) + (t ad-do-it))))) + :init (progn + (add-hook 'text-mode-hook #'typopunct-mode))) #+END_SRC ** avy -- cgit 1.4.1