From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: BibTeX mode --- remove unwanted fields Date: Fri, 29 Apr 2016 08:59:24 +0200 Message-ID: <87fuu4yk6r.fsf@student.uu.se> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1461913203 21128 80.91.229.3 (29 Apr 2016 07:00:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Apr 2016 07:00:03 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 29 08:59:53 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aw2P2-0005Tu-90 for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Apr 2016 08:59:52 +0200 Original-Received: from localhost ([::1]:52623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw2P1-0003yX-Oc for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Apr 2016 02:59:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw2Oq-0003uz-TS for help-gnu-emacs@gnu.org; Fri, 29 Apr 2016 02:59:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aw2Ol-00083I-Tp for help-gnu-emacs@gnu.org; Fri, 29 Apr 2016 02:59:40 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw2Ol-00082z-NZ for help-gnu-emacs@gnu.org; Fri, 29 Apr 2016 02:59:35 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aw2Oh-0005Ms-Rr for help-gnu-emacs@gnu.org; Fri, 29 Apr 2016 08:59:31 +0200 Original-Received: from c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se ([85.230.225.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Apr 2016 08:59:31 +0200 Original-Received: from embe8573 by c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Apr 2016 08:59:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 30 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:tttkc2+i2VcJ/51lLlh5ZYjxS2E= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:109830 Archived-At: "N. Raghavendra" 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 -