all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo)
To: help-gnu-emacs@gnu.org
Subject: Re: How to speed up cutting & pasting from/to emacs?
Date: Mon, 13 Jul 2015 11:30:27 -0400	[thread overview]
Message-ID: <878uakqdm4.fsf@yale.edu> (raw)
In-Reply-To: 87y4ilp5iv.fsf@skimble.plus.com

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.




  parent reply	other threads:[~2015-07-13 15:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-12 12:17 How to speed up cutting & pasting from/to emacs? Sharon Kimble
2015-07-12 16:11 ` Ian Zimmerman
2015-07-12 17:28   ` Sharon Kimble
     [not found]   ` <mailman.6791.1436722135.904.help-gnu-emacs@gnu.org>
2015-07-12 17:35     ` Rusi
2015-07-12 18:20       ` Sharon Kimble
2015-07-12 18:24       ` Ian Zimmerman
2015-07-12 17:13 ` Emanuel Berg
2015-07-12 18:02   ` Ian Zimmerman
2015-07-12 18:58   ` Sharon Kimble
2015-07-13  0:32     ` Emanuel Berg
2015-07-13  0:51       ` Emanuel Berg
2015-07-13 15:05       ` Sharon Kimble
2015-07-13 23:55         ` Emanuel Berg
2015-07-27  1:36         ` Emanuel Berg
2015-07-13 15:30     ` Jorge A. Alfaro-Murillo [this message]
2015-07-12 17:35 ` Yuri Khan
     [not found] <mailman.6773.1436703421.904.help-gnu-emacs@gnu.org>
2015-07-12 15:24 ` Raffaele Ricciardi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878uakqdm4.fsf@yale.edu \
    --to=jorge.alfaro-murillo@yale.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.