mirror of
				https://github.com/larstvei/Focus.git
				synced 2025-11-04 02:00:11 +00:00 
			
		
		
		
	Fix buffer-local variables definition
Define focus-current-thing, focus-buffer, focus-pre-overlay, focus-post-overlay, focus-read-only-blink-timer as buffer-local variable
This commit is contained in:
		
							parent
							
								
									3a2c4f1198
								
							
						
					
					
						commit
						ab42b87799
					
				
							
								
								
									
										18
									
								
								focus.el
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								focus.el
									
									
									
									
									
								
							@ -73,31 +73,23 @@ Things that are defined include `symbol', `list', `sexp',
 | 
				
			|||||||
(defvar focus-cursor-type cursor-type
 | 
					(defvar focus-cursor-type cursor-type
 | 
				
			||||||
  "Used to restore the users `cursor-type'")
 | 
					  "Used to restore the users `cursor-type'")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defvar focus-current-thing nil
 | 
					(defvar-local focus-current-thing nil
 | 
				
			||||||
  "Overrides the choice of thing dictated by `focus-mode-to-thing' if set.")
 | 
					  "Overrides the choice of thing dictated by `focus-mode-to-thing' if set.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defvar focus-buffer nil
 | 
					(defvar-local focus-buffer nil
 | 
				
			||||||
  "Local reference to the buffer focus functions operate on.")
 | 
					  "Local reference to the buffer focus functions operate on.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defvar focus-pre-overlay nil
 | 
					(defvar-local focus-pre-overlay nil
 | 
				
			||||||
  "The overlay that dims the text prior to the current-point.")
 | 
					  "The overlay that dims the text prior to the current-point.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defvar focus-post-overlay nil
 | 
					(defvar-local focus-post-overlay nil
 | 
				
			||||||
  "The overlay that dims the text past the current-point.")
 | 
					  "The overlay that dims the text past the current-point.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defvar focus-read-only-blink-timer nil
 | 
					(defvar-local focus-read-only-blink-timer nil
 | 
				
			||||||
  "Timer started from `focus-read-only-cursor-blink'.
 | 
					  "Timer started from `focus-read-only-cursor-blink'.
 | 
				
			||||||
The timer calls `focus-read-only-hide-cursor' after
 | 
					The timer calls `focus-read-only-hide-cursor' after
 | 
				
			||||||
`focus-read-only-blink-seconds' seconds.")
 | 
					`focus-read-only-blink-seconds' seconds.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; Use make-local-variable for backwards compatibility.
 | 
					 | 
				
			||||||
(dolist (var '(focus-current-thing
 | 
					 | 
				
			||||||
               focus-buffer
 | 
					 | 
				
			||||||
               focus-pre-overlay
 | 
					 | 
				
			||||||
               focus-post-overlay
 | 
					 | 
				
			||||||
               focus-read-only-blink-timer))
 | 
					 | 
				
			||||||
  (make-local-variable var))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(defun focus-get-thing ()
 | 
					(defun focus-get-thing ()
 | 
				
			||||||
  "Return the current thing, based on `focus-mode-to-thing'."
 | 
					  "Return the current thing, based on `focus-mode-to-thing'."
 | 
				
			||||||
  (or focus-current-thing
 | 
					  (or focus-current-thing
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user