;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/bibtex/bibtex-field.el ;; ;; test here: ;; https://dataswamp.org/~incal/books/books.bib (require 'cl-lib) (defun bibtex-prev-field () (interactive) (cl-labels ((search-prev () (when (re-search-backward "=\\|^@" nil t) (unless (re-search-forward "{" (pos-eol) t) (forward-char 2) )) (point) )) (when (= (point) (search-prev)) (let ((beg (point))) (beginning-of-line) (when (= (point) (search-prev)) (goto-char beg) ))))) (provide 'bibtex-field)