emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Leonard Randall <leonard.a.randall@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Feature Request. org-bibtex-tags-are-keywords inherit tags
Date: Fri, 18 Apr 2014 10:02:10 +0100	[thread overview]
Message-ID: <CAMRQoA=WLntzgRpQbRtOhu8_Qavz9EB_Adrxi9LGYTJ-e8ifOA@mail.gmail.com> (raw)
In-Reply-To: <CAMRQoAnD9W7DpuXp5ELsN2fTBPJ2URS3p3+=ERZxM_ESduXtmQ@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1594 bytes --]

I
​
t was indeed easier than I had thought. I tested the modified function on
my reading list file and it works as expected under most conditions (It
plays well with other variables etc.). The only exception was the
previously mentioned issue with nonstandard bibtex types. If I have time
this weekend, I will try to look into this problem. (I think it might be
time to break down and actually learn lisp.)

Attached is the requested diff. In addition to adding the new variable
`org-bibtex-tags-inherit' and editing the function `org-bibtex-headline', I
modified a couple of customize doc strings to reflect the change. I also
edited one doc string that seemed to refer to an old variable that is no
longer in use.


On 17 April 2014 15:25, Bastien <bzg@gnu.org> wrote:

> Hi Leonard,
>
> Leonard Randall <leonard.a.randall@gmail.com> writes:
>
> > Unfortunately, my knowledge of lisp is particularly rudimentary so I
> > can't offer to do it myself.
>
> I think you certainly underestimate yourself and can start hacking :)
>
> 1. install Git on your machine
> 2. ~$ git clone git://orgmode.org/org-mode.git
> 3. ~$ cd org-mode/
> 4. Edit lisp/org-bibtex.el
> 5. Use C-x C-e at the end of the edited functions and check it works
>
> When you're done, simple C-x v = in the edited buffer, C-x o to go to
> that buffer, then save it and send it to us.
>
> Otherwise let's wait someone with a better understanding than mine
> can hack it together.  But I'm sure you can give us something that
> will be useful enough.
>
> Best,
>
> --
>  Bastien
>

[-- Attachment #1.2: Type: text/html, Size: 2696 bytes --]

[-- Attachment #2: org-bibtexpatch.diff --]
[-- Type: text/plain, Size: 1995 bytes --]

diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el
index ed645e5..848d0e4 100644
--- a/lisp/org-bibtex.el
+++ b/lisp/org-bibtex.el
@@ -270,20 +270,31 @@ with underscores, and characters that are not permitted in org
 tags will be removed.
 
 If t, local tags in an org entry will be exported as a
-comma-separated string of keywords when exported to bibtex.  Tags
-defined in `org-bibtex-tags' or `org-bibtex-no-export-tags' will
-not be exported."
+comma-separated string of keywords when exported to bibtex. If
+`org-bibtex-inherit-tags' is t, inherited tags will also be
+exported as keywords. Tags defined in `org-bibtex-tags' or
+`org-bibtex-no-export-tags' will not be exported."
   :group 'org-bibtex
   :version "24.1"
   :type 'boolean)
 
 (defcustom org-bibtex-no-export-tags nil
   "List of tag(s) that should not be converted to keywords.
-This variable is relevant only if `org-bibtex-export-tags-as-keywords' is t."
+This variable is relevant only if `org-bibtex-tags-are-keywords' is t."
   :group 'org-bibtex
   :version "24.1"
   :type '(repeat :tag "Tag" (string)))
 
+(defcustom org-bibtex-inherit-tags nil
+  "This variable controlls whether inherited tags are included
+when converting org tags to bibtex keywords. It is relevant only
+if `org-bibtex-tags-are-keywords' is t. Tag inheritence itself is
+controlled by `org-use-tag-inheritence' and
+`org-exclude-tags-from-inheritence'"
+  :group 'org-bibtex
+  :version "24.1"
+  :type 'boolean)
+
 (defcustom org-bibtex-type-property-name "btype"
   "Property in which to store bibtex entry type (e.g., article)."
   :group 'org-bibtex
@@ -332,7 +343,9 @@ This variable is relevant only if `org-bibtex-export-tags-as-keywords' is t."
 					  (append org-bibtex-tags
 						  org-bibtex-no-export-tags))
 			    tag))
-			(org-get-local-tags-at))))))
+			(if org-bibtex-inherit-tags
+			    (org-get-tags-at)
+			  (org-get-local-tags-at)))))))
     (when type
       (let ((entry (format
 		    "@%s{%s,\n%s\n}\n" type id

  parent reply	other threads:[~2014-04-18  9:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 10:43 Feature Request. org-bibtex-tags-are-keywords inherit tags Leonard Randall
2014-04-04 11:31 ` Leonard Randall
2014-04-17 14:25   ` Bastien
     [not found]     ` <CAMRQoAnD9W7DpuXp5ELsN2fTBPJ2URS3p3+=ERZxM_ESduXtmQ@mail.gmail.com>
2014-04-18  9:02       ` Leonard Randall [this message]
2014-04-18 11:14         ` Bastien
2014-04-18 13:44           ` Leonard Randall
2014-04-18 14:47             ` Bastien
2014-04-19 13:34               ` Leonard Randall
2014-04-19 14:41                 ` Bastien

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to='CAMRQoA=WLntzgRpQbRtOhu8_Qavz9EB_Adrxi9LGYTJ-e8ifOA@mail.gmail.com' \
    --to=leonard.a.randall@gmail.com \
    --cc=emacs-orgmode@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 public inbox

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

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).