Change default values for customization options
This commit is contained in:
parent
eafd97fc70
commit
9b9356cd63
21
origami.el
21
origami.el
@ -40,18 +40,19 @@
|
|||||||
;;; fold display mode and faces
|
;;; fold display mode and faces
|
||||||
|
|
||||||
(defcustom origami-fold-replacement "..."
|
(defcustom origami-fold-replacement "..."
|
||||||
|
;; TODO: this should also be specifiable as a function: folded text -> string
|
||||||
"Show this string instead of the folded text."
|
"Show this string instead of the folded text."
|
||||||
:type 'string
|
:type 'string
|
||||||
:group 'origami)
|
:group 'origami)
|
||||||
|
|
||||||
(defcustom origami-show-fold-header t
|
(defcustom origami-show-fold-header nil
|
||||||
"Highlight the line the fold start on."
|
"Highlight the line the fold start on."
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
:group 'origami)
|
:group 'origami)
|
||||||
|
|
||||||
(defface origami-fold-header-face
|
(defface origami-fold-header-face
|
||||||
'((t (:box (:line-width 1 :color "#050")
|
`((t (:box (:line-width 1 :color ,(face-attribute 'highlight :background))
|
||||||
:background "#001500")))
|
:background ,(face-attribute 'highlight :background))))
|
||||||
"Face used to display fold headers.")
|
"Face used to display fold headers.")
|
||||||
|
|
||||||
(defface origami-fold-fringe-face
|
(defface origami-fold-fringe-face
|
||||||
@ -59,13 +60,13 @@
|
|||||||
"Face used to display fringe contents.")
|
"Face used to display fringe contents.")
|
||||||
|
|
||||||
(defface origami-fold-replacement-face
|
(defface origami-fold-replacement-face
|
||||||
'((t :foreground "#555"))
|
'((t :inherit 'font-lock-comment-face))
|
||||||
"Face used to display the fold replacement text.")
|
"Face used to display the fold replacement text.")
|
||||||
|
|
||||||
(defgroup origami '((origami-fold-header-face custom-face)
|
(defgroup origami '((origami-fold-header-face custom-face)
|
||||||
(origami-fold-fringe-face custom-face)
|
(origami-fold-fringe-face custom-face)
|
||||||
(origami-fold-replacement-face custom-face))
|
(origami-fold-replacement-face custom-face))
|
||||||
"Origami: A text folding minor mode for Emacs, by Greg Sexton.")
|
"Origami: A text folding minor mode for Emacs.")
|
||||||
|
|
||||||
;;; overlay manipulation
|
;;; overlay manipulation
|
||||||
|
|
||||||
@ -110,7 +111,7 @@ header overlay should cover. Result is a cons cell of (begin . end)."
|
|||||||
;; changed.
|
;; changed.
|
||||||
(let* ((range (origami-header-overlay-range ov))
|
(let* ((range (origami-header-overlay-range ov))
|
||||||
(header-ov (make-overlay (car range) (cdr range) buffer
|
(header-ov (make-overlay (car range) (cdr range) buffer
|
||||||
nil))) ;; no front advance
|
nil))) ;; no front advance
|
||||||
(overlay-put header-ov 'creator 'origami)
|
(overlay-put header-ov 'creator 'origami)
|
||||||
(overlay-put header-ov 'fold-overlay ov)
|
(overlay-put header-ov 'fold-overlay ov)
|
||||||
(overlay-put header-ov 'modification-hooks '(origami-header-modify-hook))
|
(overlay-put header-ov 'modification-hooks '(origami-header-modify-hook))
|
||||||
@ -118,12 +119,11 @@ header overlay should cover. Result is a cons cell of (begin . end)."
|
|||||||
ov)))
|
ov)))
|
||||||
|
|
||||||
(defun origami-hide-overlay (ov)
|
(defun origami-hide-overlay (ov)
|
||||||
;; TODO: make more of this customizable
|
|
||||||
(overlay-put ov 'invisible 'origami)
|
(overlay-put ov 'invisible 'origami)
|
||||||
(overlay-put ov 'display origami-fold-replacement)
|
(overlay-put ov 'display origami-fold-replacement)
|
||||||
(overlay-put ov 'face 'origami-fold-replacement-face)
|
(overlay-put ov 'face 'origami-fold-replacement-face)
|
||||||
(if origami-show-fold-header
|
(if origami-show-fold-header
|
||||||
(origami-activate-header (overlay-get ov 'header-ov))))
|
(origami-activate-header (overlay-get ov 'header-ov))))
|
||||||
|
|
||||||
(defun origami-show-overlay (ov)
|
(defun origami-show-overlay (ov)
|
||||||
(overlay-put ov 'invisible nil)
|
(overlay-put ov 'invisible nil)
|
||||||
@ -143,7 +143,6 @@ header overlay should cover. Result is a cons cell of (begin . end)."
|
|||||||
;; Reposition the header overlay. Since it extends before the folded area, it
|
;; Reposition the header overlay. Since it extends before the folded area, it
|
||||||
;; may no longer cover the appropriate locations.
|
;; may no longer cover the appropriate locations.
|
||||||
(origami-header-overlay-reset-position ov)
|
(origami-header-overlay-reset-position ov)
|
||||||
|
|
||||||
(overlay-put ov 'origami-header-active t)
|
(overlay-put ov 'origami-header-active t)
|
||||||
(overlay-put ov 'face 'origami-fold-header-face)
|
(overlay-put ov 'face 'origami-fold-header-face)
|
||||||
(overlay-put ov 'before-string
|
(overlay-put ov 'before-string
|
||||||
|
Loading…
Reference in New Issue
Block a user