help-gnu-emacs
[Top][All Lists]
Advanced

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

Removing colourising details from body of minor-mode definition


From: uzibalqa
Subject: Removing colourising details from body of minor-mode definition
Date: Sun, 04 Jun 2023 09:33:59 +0000

I have the following definition for a minor mode.  Where the variable $keyword
is a list used to colourise org headings.  Would it be possible to define
$keyword as a global variable so that I can remove the details of the 
colourising
procedure from the minor-mode declaration ?

;;;###autoload
(define-minor-mode komis-minor-mode
  "Enhances visibility of heading levels and text emphasis."
  :init-value nil
  :lighter " Komis"

  (let*
      (($keyword
        `(("^\\*+ "
           (0 (let* ( ($kondor
                         (- (match-end 0) (match-beginning 0) 1))
                      ($inline-task
                         (and (boundp 'org-inlinetask-min-level)
                              (>= $kondor org-inlinetask-min-level))) )
                ;;--------------------------------------
                (compose-region (- (match-end 0) 2)
                                (- (match-end 0) 1)
                                (komis-luna-hgshape-select $kondor))
                ;;---------------------------------------
                (when $inline-task
                  (compose-region (- (match-end 0) 3)
                                  (- (match-end 0) 2)
                                  (komis-luna-hgshape-select $kondor)))
                ;;---------------------------------------
                (when (facep komis-luna-hgshape-typefc)
                  (put-text-property
                     (- (match-end 0) (if $inline-task 3 2))
                     (- (match-end 0) 1)
                     'face komis-luna-hgshape-typefc))
                ;;---------------------------------------
                (put-text-property
                  (match-beginning 0)
                  (- (match-end 0) 2)
                  'face (list :foreground
                              (face-attribute 'default :background)))
                ;;---------------------------------------
                (put-text-property (match-beginning 0)
                                   (match-end 0)
                                   'keymap komis-luna-hgcycle-wmouse)
                ;;---------------------------------------
                nil)) ))))





reply via email to

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