GNU bug report logs -
#45068
[PATCH] 28.0.50; Update Modus themes 1.0.2 (backward-incompatible)
Previous Next
Reported by: Protesilaos Stavrou <info <at> protesilaos.com>
Date: Sun, 6 Dec 2020 12:25:02 UTC
Severity: normal
Tags: patch
Fixed in version 28.1
Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>>> +(deftheme modus-vivendi
>>> + "Accessible and customizable light theme (WCAG AAA standard).
>> ^^^^^
>> dark
>
> [ Answer only if it is easy: how do you draw those ^^^ below the text? ]
>
Here's a more polished version, which takes care of the prefix /
fill-prefix, and works on multiple lines:
(defun undercaret (&optional arg)
(interactive "p")
(let* ((begin (if (region-active-p) (region-beginning) (line-beginning-position)))
(end (if (region-active-p) (region-end) (line-end-position)))
(lines (- (line-number-at-pos end) (line-number-at-pos begin) -1))
(comment (and (/= arg 1) (= lines 1)))
(final-forward-line -1))
(goto-char begin)
(dotimes (i lines)
(let* ((line-begin (if (zerop i) begin (line-beginning-position)))
(line-end (if (= (1+ i) lines) end (line-end-position)))
(begin-column (progn (goto-char line-begin) (current-column)))
(prefix-begin (line-beginning-position))
(prefix-end (progn (beginning-of-line-text) (point)))
(prefix-end-column (progn (goto-char prefix-end) (current-column)))
(delta (if (< begin-column prefix-end-column) (- prefix-end-column begin-column) 0))
(prefix-string (buffer-substring-no-properties prefix-begin prefix-end))
(prefix (if (string-blank-p prefix-string) "" prefix-string))
(whitespace (make-string (- (+ begin-column delta) (length prefix)) ?\ ))
(do-under (< delta (- line-end line-begin)))
(under (if do-under (make-string (- line-end line-begin delta) ?^) ""))
(under-string (concat prefix whitespace under "\n")))
(forward-line 1)
(if do-under (insert under-string) (setq final-forward-line -2))
(setq end (+ end (length under-string)))
(when comment (insert prefix whitespace "\n"))))
(forward-line final-forward-line)
(goto-char (line-end-position))))
This bug report was last modified 4 years and 135 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.