From 515c42355982a2c5eacd51a7ffaf25e592c8e0a1 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 18 Feb 2017 22:23:37 +0100 Subject: Add work-around for long lines. --- init.org | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/init.org b/init.org index 471cba1..185228e 100644 --- a/init.org +++ b/init.org @@ -199,6 +199,19 @@ After years of using a dark theme I found that the most important thing for me i (load-theme 'solarized-light t) #+END_SRC +Emacs doesn’t deal well with very long lines. I often produce very long lines when hacking Scheme using Geiser, which regularly kills my session. The following snippet shortens long lines in =comint=-derived modes such as Geiser. This code was provided by wasamasa as [[http://emacs.stackexchange.com/a/5559/2005][an answer to my question on the Emacs StackExchange]]. + +#+BEGIN_SRC elisp +(defun my/comint-shorten-long-lines (text) + (let* ((regexp "^\\(.\\{80\\}\\).*?\\(\"?\\)$") + (shortened-text (replace-regexp-in-string regexp "\\1\\2" text))) + (if (string= shortened-text text) + text + (propertize shortened-text 'font-lock-face 'shadow 'help-echo text)))) + +(add-hook 'comint-preoutput-filter-functions 'my/comint-shorten-long-lines) +#+END_SRC + * Default fonts :PROPERTIES: :header-args: :noweb-ref default-fonts -- cgit v1.2.3