mirror of
				https://github.com/larstvei/Focus.git
				synced 2025-11-04 02:00:11 +00:00 
			
		
		
		
	Added functions for jumping between things
This commit is contained in:
		
							parent
							
								
									cd2aad5590
								
							
						
					
					
						commit
						497d13d758
					
				
							
								
								
									
										12
									
								
								focus.el
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								focus.el
									
									
									
									
									
								
							@ -145,6 +145,18 @@ deleted, and `focus-move-focus' is removed from `post-command-hook'."
 | 
				
			|||||||
  (progn (mapc 'delete-overlay (list focus-pre-overlay focus-post-overlay))
 | 
					  (progn (mapc 'delete-overlay (list focus-pre-overlay focus-post-overlay))
 | 
				
			||||||
         (remove-hook 'post-command-hook 'focus-move-focus t)))
 | 
					         (remove-hook 'post-command-hook 'focus-move-focus t)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(defun focus-next-thing (&optional n)
 | 
				
			||||||
 | 
					  "Moves the point to the middle of the Nth next thing."
 | 
				
			||||||
 | 
					  (interactive "p")
 | 
				
			||||||
 | 
					  (forward-thing (focus-get-thing) (+ 1 n))
 | 
				
			||||||
 | 
					  (let ((bounds (focus-bounds)))
 | 
				
			||||||
 | 
					    (goto-char (/ (+ (car bounds) (cdr bounds)) 2)))
 | 
				
			||||||
 | 
					  (recenter nil))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(defun focus-prev-thing (&optional n)
 | 
				
			||||||
 | 
					  "Moves the point to the middle of the Nth previous thing."
 | 
				
			||||||
 | 
					  (interactive "p")
 | 
				
			||||||
 | 
					  (focus-next-thing (- (+ 2 n))))
 | 
				
			||||||
;;;###autoload
 | 
					;;;###autoload
 | 
				
			||||||
(define-minor-mode focus-mode
 | 
					(define-minor-mode focus-mode
 | 
				
			||||||
  "Dim the font color of text in surrounding sections."
 | 
					  "Dim the font color of text in surrounding sections."
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user