help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to speed up cutting & pasting from/to emacs?


From: Jorge A. Alfaro-Murillo
Subject: Re: How to speed up cutting & pasting from/to emacs?
Date: Mon, 13 Jul 2015 11:30:27 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Sharon Kimble writes:

Emanuel Berg <embe8573@student.uu.se> writes:
Sharon Kimble <boudiccas@skimble.plus.com> writes:
I'm involved in a project which involves a lot of pasting into emacs From the clipboard, which is taking a long time.

The best answer/method is: don't do it! What other program(s) are you using, to/from which you copy/paste? Have you examined if Emacs can do what these programs do, in what case you don't have that problem anymore but can rely on kill/yank instead, which is much more powerful and fast.

Primarily 'zim' and pasting to and from 'JabRef', I'm mostly creating bibtex records from a published bibliography on an article on the web, which I've opened in w3m. I would use 'eew' if I could only find out how to use tabs with it!

Generally (at least for STEAM and medical fields) you can download the references of the article in bibtex format from the journal website.

I have a bash script ~/bin/emacsbib with the following:

#+BEGIN_SRC shell
 #!/bin/bash
$HOME/bin/emacsclient -a '' -e "(jaam/bibtex-add-citation \"${1}\")"
#+END_SRC

and then in my .emacs I have:

#+BEGIN_SRC emacs-lisp
 (defun jaam/bibtex-add-citation (filename &optional bibfile)
     (interactive)
     (if bibfile
         (find-file bibfile)
       (find-file (car bibtex-string-files)))
     (read-only-mode 0)
     (goto-char (point-max))
     (re-search-backward "}$" nil t)
     (forward-char 1)
     (delete-blank-lines)
     (insert "\n")
     (insert-file-contents filename))
#+END_SRC

Additionally you should set bibtex-string-files with a list of your reference files. Then opening a file from the browser with emacsbib yanks the citation to the first entry of bibtex-string-files.

This works with almost any journal, in rare (stupid) occasions, e.g. Nature, the journal does not provide bibtex files, but they have RIS format. For those occasions I have another script ~/bin/emacsris with:

#+BEGIN_SRC shell
 #!/bin/bash
 /usr/share/cb2bib/c2btools/ris2bib $1 /tmp/tempbib
 $HOME/bin/emacsbib /tmp/tempbib
#+END_SRC

You need to have the ris2bib script which in debian is part of the package cb2bib.

Best,
--
Jorge.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]