diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2017-02-21 10:24:15 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2017-02-21 10:24:15 +0100 |
commit | 9d39c90f037bc05defff3cec2ab467099453ef46 (patch) | |
tree | 92c76fcf49ac5c2faee0cc8198d44de1601df577 /init.org | |
parent | 71d25d4457ed56ec32613a29ecc621c1e578b9bd (diff) |
Shorten lines when they are longer than 380 characters.
Diffstat (limited to 'init.org')
-rw-r--r-- | init.org | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -206,7 +206,9 @@ Emacs doesn’t deal well with very long lines. I often produce very long lines #+BEGIN_SRC elisp (defun my/comint-shorten-long-lines (text) - (let* ((regexp "^\\(.\\{80\\}\\).*?\\(\"?\\)$") + ;; Use \x22 here instead of straight double quotes because that would + ;; break the regular expression for prettifying Org src blocks. + (let* ((regexp "^\\(.\\{380\\}\\).*?\\(\x22?\\)$") (shortened-text (replace-regexp-in-string regexp "\\1\\2" text))) (if (string= shortened-text text) text |