Better bibtex URL highlighting and matching
This commit is contained in:
		
							
								
								
									
										11
									
								
								init.el
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								init.el
									
									
									
									
									
								
							@ -1379,6 +1379,17 @@ COMMAND and COMINT are like `compile'."
 | 
			
		||||
 | 
			
		||||
;; Bibtex (built in)
 | 
			
		||||
(require 'bibtex)
 | 
			
		||||
;; Better URL highlighting and matching
 | 
			
		||||
(dolist (field '("howpublished" "url"))
 | 
			
		||||
  (add-to-list 'bibtex-generate-url-list
 | 
			
		||||
               `((,field . ,(rx "http" (? "s") "://" (+ (not "}"))))
 | 
			
		||||
                 "%s"
 | 
			
		||||
                 (,field
 | 
			
		||||
                  ,(rx (? (or "\\url{" "{")) (group "http" (? "s") "://"
 | 
			
		||||
                                                    (+ (not "}")))
 | 
			
		||||
                       (? "}"))
 | 
			
		||||
                  ,(lambda (field)
 | 
			
		||||
                     (match-string 1 field))))))
 | 
			
		||||
(defun my/bibtex-in-entry-p (&optional exclude-braces)
 | 
			
		||||
  "Return t is point is inside a BibTeX entry.
 | 
			
		||||
When EXCLUDE-BRACES is non-nil, don't count the first and last brace of the
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user