• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/textmodes/

Lines Matching +defs:entry +defs:format

46   " n / p      Go to next/previous entry (Cursor motion works as well).
48 SPC Show full database entry in other window.
49 f Toggle follow mode: Other window will follow with full db entry.
53 RET Accept current entry (also on mouse-2) and create \\cite macro.
54 m / u Mark/Unmark the entry.
124 (defun reftex-pop-to-bibtex-entry (key file-list &optional mark-to-kill
129 ;; If ITEM in non-nil, search for bibitem instead of database entry.
130 ;; If RETURN is non-nil, just return the entry and restore point.
155 ;; Just return the relevant entry
158 (point) (reftex-end-of-bib-entry item)))
171 (error "No BibTeX entry with citation key %s" key)))))
173 (defun reftex-end-of-bib-entry (item)
192 found-list entry buffer1 buffer alist
264 ;;(setq entry (concat
266 (setq entry (buffer-substring start-point (point)))
271 (unless (string-match (car re-list) entry)
276 (setq alist (reftex-parse-bibtex-entry
278 (push (cons "&entry" entry) alist)
286 ;; format the entry
287 (push (cons "&formatted" (reftex-format-bib-entry alist))
327 (defun reftex-get-crossref-alist (entry)
328 ;; return the alist from a crossref entry
329 (let ((crkey (cdr (assoc "crossref" entry)))
342 (reftex-parse-bibtex-entry nil start (point)))
414 (if (string-match re (cdr (assoc "&entry" x)))
420 (push (cons "&formatted" (reftex-format-bibitem x)) x)
437 ;; Parse and format individual entries
439 (defun reftex-get-bib-names (field entry)
441 (let ((names (reftex-get-bib-field field entry)))
443 (setq names (reftex-get-bib-field "editor" entry)))
454 (defun reftex-parse-bibtex-entry (entry &optional from to)
458 (if entry
464 (insert entry))
505 (defun reftex-get-bib-field (fieldname entry &optional format)
507 (let ((cell (assoc fieldname entry)))
509 (if format
510 (format format (cdr cell))
514 (defun reftex-format-bib-entry (entry)
517 ((auth-list (reftex-get-bib-names "author" entry))
519 (year (reftex-get-bib-field "year" entry))
520 (title (reftex-get-bib-field "title" entry))
521 (type (reftex-get-bib-field "&type" entry))
522 (key (reftex-get-bib-field "&key" entry))
526 (concat (reftex-get-bib-field "journal" entry) " "
527 (reftex-get-bib-field "volume" entry) ", "
528 (reftex-get-bib-field "pages" entry)))
530 (concat "book (" (reftex-get-bib-field "publisher" entry) ")"))
532 (concat "PhD: " (reftex-get-bib-field "school" entry)))
534 (concat "Master: " (reftex-get-bib-field "school" entry)))
536 (concat "Chap: " (reftex-get-bib-field "chapter" entry)
537 ", pp. " (reftex-get-bib-field "pages" entry)))
541 (reftex-get-bib-field "booktitle" entry "in: %s"))
561 ;; Parse a \bibitem entry
574 (cons "&entry" (concat key " " text)))))
576 (defun reftex-format-bibitem (item)
577 ;; Format a \bibitem entry so that it is (relatively) nice to look at.
597 (defun reftex-citation (&optional no-insert format-key)
601 matching entries for selection. The selected entry is formatted according
602 to `reftex-cite-format' and inserted into the buffer.
606 FORMAT-KEY can be used to pre-select a citation format.
612 `reftex-cite-format'.
632 (reftex-do-citation current-prefix-arg no-insert format-key)
635 (defun reftex-do-citation (&optional arg no-insert format-key)
638 (let* ((format (reftex-figure-out-cite-format arg no-insert format-key))
642 entry string cite-view)
649 ;; Nonexistent entry
669 (while (setq entry (pop insert-entries))
671 (setq string (if reftex-format-cite-function
672 (funcall reftex-format-cite-function
673 (reftex-get-bib-field "&key" entry)
674 format)
675 (reftex-format-citation entry format)))
681 (setq value (read-string (format "Optional argument %d: "
712 (mapcar (lambda (entry)
713 (reftex-make-cite-echo-string entry docstruct-symbol))
733 (defun reftex-figure-out-cite-format (arg &optional no-insert format-key)
734 ;; Check if there is already a cite command at point and change cite format
737 (cite-format-value (reftex-get-cite-format))
738 key format)
742 (setq format "%l"))
748 (setq format
753 (setq format "%l")))
755 ;; Figure out the correct format
756 (setq format
757 (if (and (symbolp cite-format-value)
758 (assq cite-format-value reftex-cite-format-builtin))
759 (nth 2 (assq cite-format-value reftex-cite-format-builtin))
760 cite-format-value))
761 (when (listp format)
763 (or format-key
768 (format "[%c] %s %s" (car x)
771 format "\n")))))
772 (if (assq key format)
773 (setq format (cdr (assq key format)))
774 (error "No citation format associated with key `%c'" key)))))
775 format))
778 "Call `reftex-citation' with a format selector `?p'."
783 "Call `reftex-citation' with a format selector `?t'."
918 re (cdr (assoc "&entry" x)))
933 (format "Overwrite non-empty file %s? " file))
942 (cdr (assoc "&entry" x))
944 (cdr (assoc "&entry" x))))
967 (defun reftex-format-names (namelist n)
983 (defun reftex-format-citation (entry format)
986 (unless (stringp format) (setq format "\\cite{%l}"))
989 (string-match "%l" reftex-cite-comment-format))
990 (error "reftex-cite-comment-format contains invalid %%l"))
994 format)
995 (let ((n (string-to-number (match-string 4 format)))
996 (l (string-to-char (match-string 5 format)))
1002 (reftex-get-bib-field "&key" entry)
1004 reftex-cite-comment-format
1006 ((= l ?a) (reftex-format-names
1007 (reftex-get-bib-names "author" entry)
1009 ((= l ?A) (car (reftex-get-bib-names "author" entry)))
1010 ((= l ?b) (reftex-get-bib-field "booktitle" entry "in: %s"))
1012 (reftex-get-bib-field "booktitle" entry "in: %s")))
1013 ((= l ?c) (reftex-get-bib-field "chapter" entry))
1014 ((= l ?d) (reftex-get-bib-field "edition" entry))
1015 ((= l ?e) (reftex-format-names
1016 (reftex-get-bib-names "editor" entry)
1018 ((= l ?E) (car (reftex-get-bib-names "editor" entry)))
1019 ((= l ?h) (reftex-get-bib-field "howpublished" entry))
1020 ((= l ?i) (reftex-get-bib-field "institution" entry))
1021 ((= l ?j) (reftex-get-bib-field "journal" entry))
1022 ((= l ?k) (reftex-get-bib-field "key" entry))
1023 ((= l ?m) (reftex-get-bib-field "month" entry))
1024 ((= l ?n) (reftex-get-bib-field "number" entry))
1025 ((= l ?o) (reftex-get-bib-field "organization" entry))
1026 ((= l ?p) (reftex-get-bib-field "pages" entry))
1028 (reftex-get-bib-field "pages" entry)
1030 ((= l ?s) (reftex-get-bib-field "school" entry))
1031 ((= l ?u) (reftex-get-bib-field "publisher" entry))
1032 ((= l ?r) (reftex-get-bib-field "address" entry))
1033 ((= l ?t) (reftex-get-bib-field "title" entry))
1035 (reftex-get-bib-field "title" entry)))
1036 ((= l ?v) (reftex-get-bib-field "volume" entry))
1037 ((= l ?y) (reftex-get-bib-field "year" entry)))))
1042 (setq format (concat (substring format 0 b) rpl (substring format e)))))
1043 (while (string-match "%%" format)
1044 (setq format (replace-match "%" t t format)))
1045 (while (string-match "[ ,.;:]*%<" format)
1046 (setq format (replace-match "" t t format)))
1047 format)
1049 (defun reftex-make-cite-echo-string (entry docstruct-symbol)
1050 ;; Format a bibtex entry for the echo area and cache the result.
1051 (let* ((key (reftex-get-bib-field "&key" entry))
1054 (reftex-format-citation entry reftex-cite-view-format)))
1056 (cache-entry (assoc key (cdr cache))))
1065 (if cache-entry
1066 (unless (string= (cdr cache-entry) string)
1067 (setcdr cache-entry string)
1105 (reftex-pop-to-bibtex-entry
1142 file key entries beg end entry)
1163 (setq entry (buffer-substring beg end)
1164 entries (cons entry entries)
1169 (format "Overwrite non-empty file %s? " bibfile))