all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: BibTeX mode --- remove unwanted fields
Date: Fri, 29 Apr 2016 08:59:24 +0200	[thread overview]
Message-ID: <87fuu4yk6r.fsf@student.uu.se> (raw)
In-Reply-To: m2fuu5x8v2.fsf@hydra.local

"N. Raghavendra" <raghu@hri.res.in> writes:

> Is there a way to remove unwanted fields from
> a BibTeX entry when doing `bibtex-clean-entry'?
> I'd like to have a variable `my-bibtex-fields' with
> a value like
>
> '("author" "editor" "title" "journal" "year"
> "publisher" "doi" "url" ...)
>
> and kill any field that doesn't belong to
> `my-bibtex-fields', when I run `bibtex-clean-entry'
> on an entry.

With Elisp, this isn't super-difficult to do (God
willing).

There is already `bibtex-next-field'. Then get the
data preferrable with a built-in, otherwise use
`thing-at-point' or something to that end. Oh, and the
"data" here is the field name, not the field data!
Then use `member' and see if that data is in your
variable of desired fields. If it isn't, kill with
`bibtex-kill-field'. After that/otherwise loop the
whole thing.

-- 
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 29 Blogomatic articles -                   




  parent reply	other threads:[~2016-04-29  6:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29  5:49 BibTeX mode --- remove unwanted fields N. Raghavendra
2016-04-29  6:27 ` Emanuel Berg
2016-04-29  6:59 ` Emanuel Berg [this message]
2016-04-29  7:11   ` N. Raghavendra
2016-04-29  7:16   ` N. Raghavendra

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=87fuu4yk6r.fsf@student.uu.se \
    --to=embe8573@student.uu.se \
    --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.