Last active
December 19, 2015 03:48
-
-
Save jiyoo/5892224 to your computer and use it in GitHub Desktop.
instruction for what to do with a code you copied from a blog comment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; copy the following and | |
;; paste it in your emacs init file (the dotemacs file) | |
(defun fix-quotes (beg end) | |
"replaces pretty quotes to ugly quotes." | |
(interactive "r") | |
(save-excursion | |
(format-replace-strings '(("\x2019" . "'") | |
("\x201c" . "\"") | |
("\x201d" . "\"") | |
("\x2018" . "'") | |
) nil beg end)) | |
(indent-region (region-beginning) (region-end))) | |
;; then restart your emacs. | |
;; now you can copy an emacs lisp code example from a blog comment and | |
;; paste it in your scratch buffer and | |
;; then select the pasted region (this step usually not necessary) | |
;; and then do M-x fix-quotes and quotes will be fixed | |
;; and the pasted code will be indented. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment