From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#45068: [PATCH] Modus themes 1.2.0 Date: Sat, 06 Mar 2021 13:24:01 +0000 Message-ID: <7de1aeec52597093157c@heytings.org> References: <87im9fgm27.fsf@protesilaos.com> <83czxt2fpd.fsf@gnu.org> <87h7m0n0em.fsf@protesilaos.com> <83v9agryuz.fsf@gnu.org> <87tupyw83e.fsf@protesilaos.com> <83zgzqncxx.fsf@gnu.org> <874khwn1qf.fsf@protesilaos.com> <603b8171.1c69fb81.aa664.7f40@mx.google.com> <87mtvoxsvs.fsf@protesilaos.com> <603b9b9d.1c69fb81.f37aa.cb7c@mx.google.com> <83eegz7xcx.fsf@gnu.org> <87o8g3exjv.fsf@protesilaos.com> <603d053a.1c69fb81.f4cb8.fb14@mx.google.com> <87h7luga3p.fsf@protesilaos.com> <87o8g2bg89.fsf@tcd.ie> <87r1kyrtrl.fsf@protesilaos.com> <878s75x2uk.fsf@tcd.ie> <87o8g0ryfz.fsf@tcd.ie> <6040d37e.1c69fb81.63467.ad62@mx.google.com> <87wnun9dgo.fsf_-_@protesilaos.com> <87ft1aoj74.fsf@tcd.ie> <87eeguab7o.fsf@protesilaos.com> <81b38e8b77db937f064a@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1193"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45068@debbugs.gnu.org To: Protesilaos Stavrou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 06 14:25:19 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lIWvn-0000Cy-0f for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Mar 2021 14:25:19 +0100 Original-Received: from localhost ([::1]:35222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIWvl-0000Az-SZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Mar 2021 08:25:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIWvW-0000Af-Nv for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2021 08:25:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52952) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lIWvW-0008Mn-GZ for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2021 08:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lIWvW-00033O-Bw for bug-gnu-emacs@gnu.org; Sat, 06 Mar 2021 08:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Mar 2021 13:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45068 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 45068-submit@debbugs.gnu.org id=B45068.161503704511664 (code B ref 45068); Sat, 06 Mar 2021 13:25:02 +0000 Original-Received: (at 45068) by debbugs.gnu.org; 6 Mar 2021 13:24:05 +0000 Original-Received: from localhost ([127.0.0.1]:36265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIWub-000324-9N for submit@debbugs.gnu.org; Sat, 06 Mar 2021 08:24:05 -0500 Original-Received: from heytings.org ([95.142.160.155]:45522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIWuZ-00031w-Qr for 45068@debbugs.gnu.org; Sat, 06 Mar 2021 08:24:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1615037042; bh=UYBMpNlAWuVNfm4pbO6YqqYMrMjKlVdAf9hvgdg8nQw=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=JZoZhJ51Q26OvtE/LUqR1ceaTXec6P1GVtXBFHoNiE/vPeXCo9dXJ8veha9dM/GvI WSq5dwo7gmzXr97h0R/Z4Nh8mqOZUzR4LyTO2LJgHHaI72Ps/yydHWyh7Qos0H75YN YfXz/TftLgbkKjp+xIdO8Aq2LvUQ0+q8cwyyP2Wc0xZysN9PyQouf76F5CE1h+nH72 rv8ltcJHcApmwb9JLwAeZHCc8tR6JrzfgqFv7HEp50dPl9REOEHU2kq7rDd8w6nLM0 DKF7gBiKiyW3Ui58atxubfH7Vd9L7zGvjpzw4G+WjMCVyYSqZFxHMFEearLbEnyAlf uxkxeI/fr3u4A== In-Reply-To: <81b38e8b77db937f064a@heytings.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201629 Archived-At: >>> +(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))))