Closed tshu-w closed 4 years ago
Can you provide a way to reproduce this? I don't see this.
sorry, here is my minimal config to reproduce this, you can change bibliography list to yours:
;;; emacs -nw -Q -l ~/.emacs.d/test.el
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("gnu" . "https://elpa.gnu.org/packages/")))
;; initialize packages
(unless (bound-and-true-p package--initialized) ; To avoid warnings in 27
(setq package-enable-at-startup nil) ; To prevent initializing twice
(package-initialize))
;; setup `use-package'
(unless (package-installed-p 'use-package)
(when (not package-archive-contents)
(package-refresh-contents))
(package-install 'use-package))
(require 'use-package)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-package org-ref
:ensure t
:after (:any org autex bibtex)
:init
(setq org-ref-completion-library 'org-ref-ivy-cite)
:config
(setq reftex-default-bibliography '("~/Documents/Zotero/references.bib")
org-ref-default-bibliography '("~/Documents/Zotero/references.bib")
org-ref-bibliography-notes "~/Documents/Org/notes/papers/")
;; (use-package bibtex-completion
;; :commands (bibtex-completion-edit-notes bibtex-completion-find-pdf)
;; :init
;; (setq bibtex-autokey-year-length 4
;; bibtex-completion-additional-search-fields '(keywords)
;; bibtex-completion-bibliography '("~/Documents/Zotero/references.bib")
;; bibtex-completion-library-path '("~/Documents/Zotero/storage/")
;; bibtex-completion-notes-path "~/Documents/Org/notes/papers/"
;; bibtex-completion-notes-template-multiple-files
;; "#+title: ${author-or-editor} (${year}): ${title}\n#+roam_key: cite:${=key=}\n\n"
;; bibtex-completion-pdf-field "file"
;; bibtex-dialect 'biblatex))
;; ;; Tell org-ref to let bibtex-completion find notes for it
;; (setq org-ref-notes-function
;; (lambda (citekey)
;; (let ((bibtex-completion-bibliography (org-ref-find-bibliography)))
;; (bibtex-completion-edit-notes
;; (list (car (org-ref-get-bibtex-key-and-file citekey)))))))
;; ;; Override `org-ref-open-pdf-at-point' directly since `H-p' is bound to it.
;; (defun org-ref-open-pdf-at-point ()
;; "Open the pdf for bibtex key under point if it exists."
;; (interactive)
;; (let* ((results (org-ref-get-bibtex-key-and-file))
;; (key (car results))
;; (pdf-file (car (bibtex-completion-find-pdf key))))
;; (if (file-exists-p pdf-file)
;; (org-open-file pdf-file)
;; (message "No PDF found for %s" key))))
;; (defun org-ref-list-index (substring list)
;; "Return the index of SUBSTRING in a LIST of strings."
;; (let ((i 0)
;; (found nil))
;; (cl-dolist (arg list i)
;; (if (string-match (concat "^" substring "$") arg)
;; (progn
;; (setq found t)
;; (cl-return i)))
;; (setq i (+ i 1)))
;; ;; return counter if found, otherwise return nil
;; (if found i nil)))
)
emacs -nw -Q -l ~/.emacs.d/test.el
I change dolist
to cl-dolist
in org-ref-list-index
and works fine on my side.
I think the simplest solution might be just change dolist to cl-dolist. I have pushed that. Does that fix this issue?
yes, it fixed. thx you.
I got
eval: No catch for tag: --cl-block-nil--, 1 cl-return
if I insert link after an existing link.Backtrace:
GNU Emacs 27.1 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.6 (Build 19G2021)) of 2020-08-25