The Lambda Lab
/
projects
/
elpher.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
fbf5fbc
)
Explicitly disable adaptive (not auto) fill mode for gemini maps.
author
Tim Vaughan
<vaughant@bs-mbpr538.d.ethz.ch>
Wed, 6 Oct 2021 10:43:18 +0000
(12:43 +0200)
committer
Tim Vaughan
<vaughant@bs-mbpr538.d.ethz.ch>
Wed, 6 Oct 2021 10:43:18 +0000
(12:43 +0200)
elpher.el
patch
|
blob
|
history
diff --git
a/elpher.el
b/elpher.el
index
6bb36b3
..
3d8e77f
100644
(file)
--- a/
elpher.el
+++ b/
elpher.el
@@
-1569,7
+1569,6
@@
This function uses Emacs' auto-fill to wrap text sensibly to a maximum
width defined by `elpher-gemini-max-fill-width'."
(string-match
(rx (: line-start
width defined by `elpher-gemini-max-fill-width'."
(string-match
(rx (: line-start
- (* (any " \t"))
(optional
(group (or (: "*" (+ (any " \t")))
(: ">" (* (any " \t"))))))))
(optional
(group (or (: "*" (+ (any " \t")))
(: ">" (* (any " \t"))))))))
@@
-1587,10
+1586,7
@@
width defined by `elpher-gemini-max-fill-width'."
(propertize text-line 'face 'elpher-gemini-quoted))
(t text-line))
text-line))
(propertize text-line 'face 'elpher-gemini-quoted))
(t text-line))
text-line))
- (adaptive-fill-mode t)
- ;; fill-prefix is important for adaptive-fill-mode: without
- ;; it, multi-line list items are not indented correct
- (fill-prefix (if (match-string 1 text-line)
+ (fill-prefix (if line-prefix
(make-string (length (match-string 0 text-line)) ?\s)
nil)))
(insert (elpher-process-text-for-display processed-text-line))
(make-string (length (match-string 0 text-line)) ?\s)
nil)))
(insert (elpher-process-text-for-display processed-text-line))
@@
-1599,8
+1595,9
@@
width defined by `elpher-gemini-max-fill-width'."
(defun elpher-render-gemini-map (data _parameters)
"Render DATA as a gemini map file, PARAMETERS is currently unused."
(elpher-with-clean-buffer
(defun elpher-render-gemini-map (data _parameters)
"Render DATA as a gemini map file, PARAMETERS is currently unused."
(elpher-with-clean-buffer
- (let ((preformatted nil))
- (auto-fill-mode 1)
+ (auto-fill-mode 1)
+ (let ((preformatted nil)
+ (adaptive-fill-mode nil)) ;Prevent automatic setting of fill-prefix
(setq-local fill-column (min (window-width) elpher-gemini-max-fill-width))
(dolist (line (split-string data "\n"))
(cond
(setq-local fill-column (min (window-width) elpher-gemini-max-fill-width))
(dolist (line (split-string data "\n"))
(cond