* BibTeX mode --- remove unwanted fields
@ 2016-04-29 5:49 N. Raghavendra
2016-04-29 6:27 ` Emanuel Berg
2016-04-29 6:59 ` Emanuel Berg
0 siblings, 2 replies; 5+ messages in thread
From: N. Raghavendra @ 2016-04-29 5:49 UTC (permalink / raw)
To: help-gnu-emacs
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.
Cheers,
Raghu.
--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BibTeX mode --- remove unwanted fields
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
1 sibling, 0 replies; 5+ messages in thread
From: Emanuel Berg @ 2016-04-29 6:27 UTC (permalink / raw)
To: help-gnu-emacs
"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.
Well... I'd say this is over-engineering unless you
have several hundred entries. Because with
finger-habits, C-p, C-n, and C-k, and so on, you can
clean an entry almost in zero time.
Anyway, there is `bibtex-entry-format', a list in
which you can put the symbol opts-or-alts - this will
"Delete empty optional and alternative fields" but,
alas, only if they are empty.
But if they are not empty, why remove them? If you
don't want it to show up when you compile the Biblatex
into a PDF, you can specify that there, instead of
removing valid data.
I.e., is this a data problem, or an interface problem,
or an OCB problem?
Anyway, I'm happy someone besides me takes an interest
in Biblatex. I've done some stuff on top of the BibTeX
mode, and there are links in that file to LaTeX and
ISBN stuff as well, if you care to check it out:
http://user.it.uu.se/~embe8573/conf/emacs-init/my-bibtex.el
Here is another project that might be interesting to
you:
http://user.it.uu.se/~embe8573/books/
Good luck!
--
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
- so far: 29 Blogomatic articles -
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BibTeX mode --- remove unwanted fields
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
2016-04-29 7:11 ` N. Raghavendra
2016-04-29 7:16 ` N. Raghavendra
1 sibling, 2 replies; 5+ messages in thread
From: Emanuel Berg @ 2016-04-29 6:59 UTC (permalink / raw)
To: help-gnu-emacs
"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 -
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BibTeX mode --- remove unwanted fields
2016-04-29 6:59 ` Emanuel Berg
@ 2016-04-29 7:11 ` N. Raghavendra
2016-04-29 7:16 ` N. Raghavendra
1 sibling, 0 replies; 5+ messages in thread
From: N. Raghavendra @ 2016-04-29 7:11 UTC (permalink / raw)
To: help-gnu-emacs
At 2016-04-29T08:59:24+02:00, Emanuel Berg wrote:
> 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.
Thanks, I'll look at bibtex.el, and see if I can cook up a method.
Cheers,
Raghu.
--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BibTeX mode --- remove unwanted fields
2016-04-29 6:59 ` Emanuel Berg
2016-04-29 7:11 ` N. Raghavendra
@ 2016-04-29 7:16 ` N. Raghavendra
1 sibling, 0 replies; 5+ messages in thread
From: N. Raghavendra @ 2016-04-29 7:16 UTC (permalink / raw)
To: help-gnu-emacs
At 2016-04-29T08:59:24+02:00, Emanuel Berg wrote:
> 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.
Thanks, I'll look at bibtex.el, and see if I can cook up a method.
Cheers,
Raghu.
--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-04-29 7:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-04-29 7:11 ` N. Raghavendra
2016-04-29 7:16 ` N. Raghavendra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).