emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Anupam Sengupta <anupamsg@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Bug?: 7.02/7.3 - Unable to set `org-capture-templates' in a
Date: Sat, 06 Nov 2010 22:35:10 +0530	[thread overview]
Message-ID: <m2y696bcxl.fsf@gmail.com> (raw)

Hi All,

I have been facing this problem since version 7.02/7.3.  I am using GNU
Emacs 23.2.50 on OSX.

I use a _separate_ file for saving the settings using the Custom
interface.  This includes all org-mode settings and templates, and have
been working well till 7.01h.

*However*, after upgrading to 7.02, I found that the capture templates
are *not* getting set from the custom-file, which does contain the
correct template (info "(Emacs) Saving Customizations").

The basic problem is that the `org-capture-templates' variable is set as
`nil' on load, and `describe-variable' returns a 'nil' as well.

On accessing the variable using `customize-variable', the custom
interface displays an empty value, and the message:

"Value Changed outside of Customize".

I have tested this behavior using org-7.02, using a bare-bone test setup
which just loads the org-mode, and an empty test.org file.  

The init.el is given below:

,----
|  ;;; Define some variables for use later
|  (defvar my-emacs-dir          "~/.emacs.d/")
|  (defvar my-lisp-dir           (concat my-emacs-dir "elisp/"))
|  (defvar my-customizations-dir (concat my-emacs-dir "customizations/"))
|  (setq custom-file (concat my-customizations-dir "emacs-custom.el"))
|  (load custom-file)
| 
|  (message "Setting orgmode stuff")
|  (setq load-path
|          (cons (expand-file-name (concat my-lisp-dir "org-7.02/lisp")) load-path))
| 
|  (setq load-path
|          (cons (expand-file-name (concat my-lisp-dir "org-7.02/contrib/lisp")) load-path))
| 
|  (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
| 
|  (require 'org-install)
|  (setq org-default-notes-file "~/test.org")
| 
|  (define-key global-map "\C-ca"      'org-agenda)
|  (define-key global-map "\C-cc"      'org-capture)
`----


The corresponding emacs-custom.el (comments elided) is:

,----
|  (custom-set-variables
|   '(org-capture-templates (quote (("n" "Next Action" entry
|   (file+headline "~/org/test.org" "INBOX") "* TODO %^{Heading}")))))
`----


As noted above, even though the `org-capture-templates' has been set
correctly in the emacs-custom.el, this setting is *not loaded* and the
variable remains `nil'.

If the variable is set in the init.el file *itself*, then it *does* get
loaded correctly.  E.g., in the init.el content, if the lines are
changed to:

,----
|  (require 'org-install)
|  (setq org-default-notes-file "~/test.org")
|  
|    (setq org-capture-templates 
|          (quote (("n" "Next Action" entry (file+headline
|          "~/org/test.org" "INBOX") "* TODO %^{Heading}"))))
`----


Then `org-capture' is able to correctly access the templates.

I have currently reverted back to 7.01h, as I have quite a few
customized templates, and don't want to stop using the customization
mechanism to setup / modify the somewhat complex templates.

Any help is very much appreciated.  Prior to this, I did not quite
realize how addicted I have become to the remember/capture method!


Regards,
-- 
Anupam Sengupta

             reply	other threads:[~2010-11-06 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-06 17:05 Anupam Sengupta [this message]
2010-11-07  5:52 ` Bug?: 7.02/7.3 - Unable to set `org-capture-templates'in a Anupam Sengupta
2010-11-14 18:03   ` David Maus

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=m2y696bcxl.fsf@gmail.com \
    --to=anupamsg@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).