Skip to content

Commit

Permalink
Make use of display-graphical-p
Browse files Browse the repository at this point in the history
No need for `org-ol-tree-system--graphical-frame-p' as we have the
built-in `display-graphical-p', and that recognises the pgtk window
system.
  • Loading branch information
tecosaur committed Jun 25, 2022
1 parent 207c748 commit 116c777
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions org-ol-tree.el
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,6 @@ The outline chooses the theme based on the following criteria:
(fboundp 'evil-window-middle)
(fboundp 'evil-window-bottom)))

(defun org-ol-tree-system--graphical-frame-p ()
"Return t if current frame is a GUI frame, nil otherwise.
To find out if Emacs is running in GUI mode, we query the variable
`window-system'."
(member window-system '(x w32 ns)))



;;;; --- Core objects

Expand Down Expand Up @@ -645,17 +637,17 @@ check the `org-ol-tree-ui-icon-set' variable documentation."
(cond
((member org-ol-tree-ui-icon-set org-ol-tree-ui-icon-set-list)
org-ol-tree-ui-icon-set)
((and (org-ol-tree-system--graphical-frame-p)
((and (display-graphic-p)
(org-ol-tree-system--all-the-icons-p))
'all-the-icons)
((org-ol-tree-system--graphical-frame-p)
((display-graphic-p)
'unicode)
(t 'ascii)))))


(defun org-ol-tree-ui--use-fancy-icons-p ()
"Return t if the selected icon set is one of the `all-the-icons' set."
(and (org-ol-tree-system--graphical-frame-p)
(and (display-graphic-p)
(org-ol-tree-system--all-the-icons-p)
(or (not org-ol-tree-ui-icon-set)
(member org-ol-tree-ui-icon-set '(all-the-icons iconless-fancy)))))
Expand Down Expand Up @@ -800,7 +792,7 @@ Valid states are 'visible, 'exists and 'none."
This function takes in account the value of `org-ol-tree-ui-window-use-pixel'
and if this frame is a graphical frame or not."
(and (org-ol-tree-system--graphical-frame-p)
(and (display-graphic-p)
org-ol-tree-ui-window-use-pixel))


Expand Down

0 comments on commit 116c777

Please sign in to comment.