/[emacs]/emacs/lisp/textmodes/bibtex.el
ViewVC logotype

Diff of /emacs/lisp/textmodes/bibtex.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.93 by monnier, Sun Apr 10 20:35:00 2005 UTC revision 1.94 by monnier, Thu May 5 15:18:05 2005 UTC
# Line 776  If non-nil, the column for the equal sig Line 776  If non-nil, the column for the equal sig
776    :type '(repeat string))    :type '(repeat string))
777    
778  (defcustom bibtex-summary-function 'bibtex-summary  (defcustom bibtex-summary-function 'bibtex-summary
779    "Function to call for generating a one-line summary of a BibTeX entry.    "Function to call for generating a summary of current BibTeX entry.
780  It takes one argument, the key of the entry.  It takes no arguments.  Point must be at beginning of entry.
781  Used by `bibtex-complete-crossref-cleanup' and `bibtex-copy-summary-as-kill'."  Used by `bibtex-complete-crossref-cleanup' and `bibtex-copy-summary-as-kill'."
782    :group 'bibtex    :group 'bibtex
783    :type '(choice (const :tag "Default" bibtex-summary)    :type '(choice (const :tag "Default" bibtex-summary)
# Line 2550  Use `bibtex-summary-function' to generat Line 2550  Use `bibtex-summary-function' to generat
2550    (save-excursion    (save-excursion
2551      (if (and (stringp key)      (if (and (stringp key)
2552               (bibtex-find-entry key t))               (bibtex-find-entry key t))
2553          (message "Ref: %s" (funcall bibtex-summary-function key)))))          (message "Ref: %s" (funcall bibtex-summary-function)))))
2554    
2555  (defun bibtex-copy-summary-as-kill ()  (defun bibtex-copy-summary-as-kill ()
2556    "Push summery of current BibTeX entry to kill ring.    "Push summery of current BibTeX entry to kill ring.
2557  Use `bibtex-summary-function' to generate summary."  Use `bibtex-summary-function' to generate summary."
2558    (interactive)    (interactive)
2559    (let ((key (save-excursion    (save-excursion
2560                 (bibtex-beginning-of-entry)      (bibtex-beginning-of-entry)
2561                 (if (looking-at bibtex-entry-maybe-empty-head)      (if (looking-at bibtex-entry-maybe-empty-head)
2562                     (bibtex-key-in-head)          (kill-new (message "%s" (funcall bibtex-summary-function)))
2563                   (error "No key found")))))        (error "No entry found"))))
     (kill-new (message "%s" (funcall bibtex-summary-function key)))))  
2564    
2565  (defun bibtex-summary (key)  (defun bibtex-summary ()
2566    "Return summary of BibTeX entry KEY.    "Return summary of current BibTeX entry.
2567  Used as default value of `bibtex-summary-function'."  Used as default value of `bibtex-summary-function'."
2568    ;; It would be neat to customize this function.  How?    ;; It would be neat to customize this function.  How?
2569    (save-excursion    (save-excursion
2570      (if (bibtex-find-entry key t)      (if (looking-at bibtex-entry-maybe-empty-head)
2571          (let* ((bibtex-autokey-name-case-convert 'identity)          (let* ((bibtex-autokey-name-case-convert 'identity)
2572                 (bibtex-autokey-name-length 'infty)                 (bibtex-autokey-name-length 'infty)
2573                 (bibtex-autokey-names 1)                 (bibtex-autokey-names 1)
# Line 2594  Used as default value of `bibtex-summary Line 2593  Used as default value of `bibtex-summary
2593                       `((" " . ,names) (" " . ,year) (": " . ,title)                       `((" " . ,names) (" " . ,year) (": " . ,title)
2594                         (", " . ,journal) (" " . ,volume) (":" . ,pages))                         (", " . ,journal) (" " . ,volume) (":" . ,pages))
2595                       ""))                       ""))
2596        (error "Key `%s' not found" key))))        (error "Entry not found"))))
2597    
2598  (defun bibtex-pop (arg direction)  (defun bibtex-pop (arg direction)
2599    "Fill current field from the ARGth same field's text in DIRECTION.    "Fill current field from the ARGth same field's text in DIRECTION.
# Line 2743  works only with buffers containing valid Line 2742  works only with buffers containing valid
2742  entries.  This is usually the case, if you have created a buffer completely  entries.  This is usually the case, if you have created a buffer completely
2743  with BibTeX mode and finished every new entry with \\[bibtex-clean-entry].  with BibTeX mode and finished every new entry with \\[bibtex-clean-entry].
2744    
2745  For third party BibTeX files, call the function `bibtex-convert-alien'  For third party BibTeX files, call the command \\[bibtex-convert-alien]
2746  to fully take advantage of all features of BibTeX mode.  to fully take advantage of all features of BibTeX mode.
2747    
2748    
# Line 3346  INDEX is a list (KEY CROSSREF-KEY ENTRY- Line 3345  INDEX is a list (KEY CROSSREF-KEY ENTRY-
3345  Move point where the entry KEY should be placed.  Move point where the entry KEY should be placed.
3346  If `bibtex-maintain-sorted-entries' is non-nil, perform a binary  If `bibtex-maintain-sorted-entries' is non-nil, perform a binary
3347  search to look for place for KEY.  This requires that buffer is sorted,  search to look for place for KEY.  This requires that buffer is sorted,
3348  see \\[bibtex-validate].)  see `bibtex-validate'.
3349  Return t if preparation was successful or nil if entry KEY already exists."  Return t if preparation was successful or nil if entry KEY already exists."
3350    (let ((key (nth 0 index))    (let ((key (nth 0 index))
3351          key-exist)          key-exist)
# Line 3770  but do not actually kill it." Line 3769  but do not actually kill it."
3769    "Reinsert the last BibTeX item.    "Reinsert the last BibTeX item.
3770  More precisely, reinsert the field or entry killed or yanked most recently.  More precisely, reinsert the field or entry killed or yanked most recently.
3771  With argument N, reinsert the Nth most recently killed BibTeX item.  With argument N, reinsert the Nth most recently killed BibTeX item.
3772  See also the command \\[bibtex-yank-pop]]."  See also the command \\[bibtex-yank-pop]."
3773    (interactive "*p")    (interactive "*p")
3774    (bibtex-insert-kill (1- n))    (bibtex-insert-kill (1- n))
3775    (setq this-command 'bibtex-yank))    (setq this-command 'bibtex-yank))

Legend:
Removed from v.1.93  
changed lines
  Added in v.1.94

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26