diff options
-rw-r--r-- | init.org | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 |