summaryrefslogtreecommitdiff
path: root/init.org
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2017-02-21 10:24:15 +0100
committerRicardo Wurmus <rekado@elephly.net>2017-02-21 10:24:15 +0100
commit9d39c90f037bc05defff3cec2ab467099453ef46 (patch)
tree92c76fcf49ac5c2faee0cc8198d44de1601df577 /init.org
parent71d25d4457ed56ec32613a29ecc621c1e578b9bd (diff)
Shorten lines when they are longer than 380 characters.
Diffstat (limited to 'init.org')
-rw-r--r--init.org4
1 files changed, 3 insertions, 1 deletions
diff --git a/init.org b/init.org
index a08d7f2..f7a82f6 100644
--- a/init.org
+++ b/init.org
@@ -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