mirror of
				https://github.com/larstvei/Focus.git
				synced 2025-11-04 02:00:11 +00:00 
			
		
		
		
	Define faces for the unfocused and focused regions
This commit is contained in:
		
							parent
							
								
									a80b7b6eba
								
							
						
					
					
						commit
						246eaeb8d1
					
				
							
								
								
									
										11
									
								
								focus.el
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								focus.el
									
									
									
									
									
								
							@ -59,14 +59,13 @@ Things that are defined include `symbol', `list', `sexp',
 | 
				
			|||||||
  :type '(float)
 | 
					  :type '(float)
 | 
				
			||||||
  :group 'focus)
 | 
					  :group 'focus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defcustom focus-unfocused-face 'font-lock-comment-face
 | 
					(defface focus-unfocused-face
 | 
				
			||||||
 | 
					  '((t :inherit font-lock-comment-face))
 | 
				
			||||||
  "The face that overlays the unfocused area."
 | 
					  "The face that overlays the unfocused area."
 | 
				
			||||||
  :type '(face)
 | 
					 | 
				
			||||||
  :group 'focus)
 | 
					  :group 'focus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defcustom focus-focused-face nil
 | 
					(defface focus-focused-face nil
 | 
				
			||||||
  "The face that overlays the focused area."
 | 
					  "The face that overlays the focused area."
 | 
				
			||||||
  :type '(face)
 | 
					 | 
				
			||||||
  :group 'focus)
 | 
					  :group 'focus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defvar focus-cursor-type cursor-type
 | 
					(defvar focus-cursor-type cursor-type
 | 
				
			||||||
@ -132,8 +131,8 @@ It sets the `focus-pre-overlay', `focus-min-overlay', and
 | 
				
			|||||||
          focus-mid-overlay  (make-overlay (point-min) (point-max))
 | 
					          focus-mid-overlay  (make-overlay (point-min) (point-max))
 | 
				
			||||||
          focus-post-overlay (make-overlay (point-max) (point-max))
 | 
					          focus-post-overlay (make-overlay (point-max) (point-max))
 | 
				
			||||||
          focus-buffer (current-buffer))
 | 
					          focus-buffer (current-buffer))
 | 
				
			||||||
    (overlay-put focus-mid-overlay 'face focus-focused-face)
 | 
					    (overlay-put focus-mid-overlay 'face 'focus-focused-face)
 | 
				
			||||||
    (mapc (lambda (o) (overlay-put o 'face focus-unfocused-face))
 | 
					    (mapc (lambda (o) (overlay-put o 'face 'focus-unfocused-face))
 | 
				
			||||||
          (list focus-pre-overlay focus-post-overlay))
 | 
					          (list focus-pre-overlay focus-post-overlay))
 | 
				
			||||||
    (add-hook 'post-command-hook 'focus-move-focus nil t)
 | 
					    (add-hook 'post-command-hook 'focus-move-focus nil t)
 | 
				
			||||||
    (add-hook 'change-major-mode-hook 'focus-terminate nil t)))
 | 
					    (add-hook 'change-major-mode-hook 'focus-terminate nil t)))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user