Better bibtex URL highlighting and matching
This commit is contained in:
parent
b148423914
commit
190627d982
11
init.el
11
init.el
@ -1379,6 +1379,17 @@ COMMAND and COMINT are like `compile'."
|
|||||||
|
|
||||||
;; Bibtex (built in)
|
;; Bibtex (built in)
|
||||||
(require 'bibtex)
|
(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)
|
(defun my/bibtex-in-entry-p (&optional exclude-braces)
|
||||||
"Return t is point is inside a BibTeX entry.
|
"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
|
When EXCLUDE-BRACES is non-nil, don't count the first and last brace of the
|
||||||
|
Loading…
Reference in New Issue
Block a user