emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/modus-operandi-theme 65a0c89 086/112: Add customisation


From: Stefan Monnier
Subject: [elpa] externals/modus-operandi-theme 65a0c89 086/112: Add customisation option for distinct Org blocks
Date: Mon, 30 Mar 2020 15:59:44 -0400 (EDT)

branch: externals/modus-operandi-theme
commit 65a0c89a627b12330a4b500ae3538d61c95d41bf
Author: Protesilaos Stavrou <address@hidden>
Commit: Protesilaos Stavrou <address@hidden>

    Add customisation option for distinct Org blocks
    
    This is off by default, as with all customisation options.
    
    The idea is to render `org-mode' source blocks in a different background
    than that of the main buffer.  Source block beginning and end lines are
    configured to extend to the edge of the window when this option is set
    to true.
    
    Also tweak the background of the beginning and end lines of source
    blocks, so that it differs from the block's contents.
---
 README.org              | 10 ++++++++++
 modus-operandi-theme.el | 14 ++++++++++++--
 modus-vivendi-theme.el  | 14 ++++++++++++--
 3 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 8da0706..1ae0b11 100644
--- a/README.org
+++ b/README.org
@@ -150,6 +150,16 @@ theme of your choice):
 (setq modus-operandi-theme-visible-fringes nil)
 
 (setq modus-vivendi-theme-visible-fringes nil)
+
+;; Use a distinct background for Org's source blocks and extend their
+;; headings until the edge of the window (the "extend" part is for Emacs
+;; versions >= 27, whereas before they would extend anyhow).  The
+;; default is to use the same background as the rest of the buffer,
+;; while beginning and end lines do not extend to the end of the window
+;; (again, the extend is for Emacs 27 or higher).
+(setq modus-operandi-theme-distinct-org-blocks nil)
+
+(setq modus-vivendi-theme-distinct-org-blocks nil)
 #+END_SRC
 
 *NOTE* that all customisation options must be declared /before/ loading
diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el
index 56ba429..52b6367 100644
--- a/modus-operandi-theme.el
+++ b/modus-operandi-theme.el
@@ -44,6 +44,7 @@
 ;;     modus-operandi-theme-proportional-fonts
 ;;     modus-operandi-theme-scale-headings
 ;;     modus-operandi-theme-visible-fringes
+;;     modus-operandi-theme-distinct-org-blocks
 ;;
 ;; The default scale is as follows (it can be customised as well):
 ;;
@@ -352,6 +353,10 @@ between foreground and background is >= 7:1)."
   "Use a visible style for fringes."
   :type 'boolean)
 
+(defcustom modus-operandi-theme-distinct-org-blocks nil
+  "Use a distinct background for `org-mode' source blocks."
+  :type 'boolean)
+
 ;; Define colour palette.  Each colour must have a >= 7:1 contrast
 ;; ratio relative to the foreground/background colour it is rendered
 ;; against.
@@ -2070,8 +2075,13 @@ between foreground and background is >= 7:1)."
                                              ,@(when 
modus-operandi-theme-scale-headings
                                            (list :height 
modus-operandi-theme-scale-3))))))
    `(org-archived ((,class (:background ,bg-alt :foreground ,fg-alt))))
-   `(org-block ((,class (:background ,bg-main :foreground ,fg-main))))
-   `(org-block-begin-line ((,class (:background ,bg-dim :foreground 
,fg-special-mild))))
+   `(org-block ((,class (,@(and (>= emacs-major-version 27) '(:extend t))
+                         :background ,(if 
modus-operandi-theme-distinct-org-blocks bg-dim bg-main)
+                         :foreground ,fg-main))))
+   `(org-block-begin-line ((,class (,@(and (>= emacs-major-version 27)
+                                           
modus-operandi-theme-distinct-org-blocks
+                                           '(:extend t))
+                                    :background ,bg-alt :foreground 
,fg-special-mild))))
    `(org-block-end-line ((,class (:inherit org-block-begin-line))))
    `(org-checkbox ((,class (:weight bold))))
    `(org-checkbox-statistics-done ((,class (:foreground ,green :weight bold))))
diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el
index 51c9f48..ec44d4d 100644
--- a/modus-vivendi-theme.el
+++ b/modus-vivendi-theme.el
@@ -44,6 +44,7 @@
 ;;     modus-vivendi-theme-proportional-fonts
 ;;     modus-vivendi-theme-scale-headings
 ;;     modus-vivendi-theme-visible-fringes
+;;     modus-vivendi-theme-distinct-org-blocks
 ;;
 ;; The default scale is as follows (it can be customised as well):
 ;;
@@ -352,6 +353,10 @@ between foreground and background is >= 7:1)."
   "Use a visible style for fringes."
   :type 'boolean)
 
+(defcustom modus-vivendi-theme-distinct-org-blocks nil
+  "Use a distinct background for `org-mode' source blocks."
+  :type 'boolean)
+
 ;; Define colour palette.  Each colour must have a >= 7:1 contrast
 ;; ratio relative to the foreground/background colour it is rendered
 ;; against.
@@ -2070,8 +2075,13 @@ between foreground and background is >= 7:1)."
                                              ,@(when 
modus-vivendi-theme-scale-headings
                                            (list :height 
modus-vivendi-theme-scale-3))))))
    `(org-archived ((,class (:background ,bg-alt :foreground ,fg-alt))))
-   `(org-block ((,class (:background ,bg-main :foreground ,fg-main))))
-   `(org-block-begin-line ((,class (:background ,bg-dim :foreground 
,fg-special-mild))))
+   `(org-block ((,class (,@(and (>= emacs-major-version 27) '(:extend t))
+                         :background ,(if 
modus-vivendi-theme-distinct-org-blocks bg-dim bg-main)
+                         :foreground ,fg-main))))
+   `(org-block-begin-line ((,class (,@(and (>= emacs-major-version 27)
+                                           
modus-vivendi-theme-distinct-org-blocks
+                                           '(:extend t))
+                                    :background ,bg-alt :foreground 
,fg-special-mild))))
    `(org-block-end-line ((,class (:inherit org-block-begin-line))))
    `(org-checkbox ((,class (:weight bold))))
    `(org-checkbox-statistics-done ((,class (:foreground ,green :weight bold))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]