emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug?: 7.02/7.3 - Unable to set `org-capture-templates' in a
@ 2010-11-06 17:05 Anupam Sengupta
  2010-11-07  5:52 ` Bug?: 7.02/7.3 - Unable to set `org-capture-templates'in a Anupam Sengupta
  0 siblings, 1 reply; 3+ messages in thread
From: Anupam Sengupta @ 2010-11-06 17:05 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug?: 7.02/7.3 - Unable to set `org-capture-templates'in a
  2010-11-06 17:05 Bug?: 7.02/7.3 - Unable to set `org-capture-templates' in a Anupam Sengupta
@ 2010-11-07  5:52 ` Anupam Sengupta
  2010-11-14 18:03   ` David Maus
  0 siblings, 1 reply; 3+ messages in thread
From: Anupam Sengupta @ 2010-11-07  5:52 UTC (permalink / raw)
  To: emacs-orgmode

Anupam Sengupta <anupamsg <at> gmail.com> writes:


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

...

Found a solution to the problem.  This has to do with order of setting the
custom-file and loading it (needs to be done *after* the org-install). 

I.e., the order in init.el needs to be:

 ...

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

 ...
 ;; Needs to be done after org-mode is loaded
 (setq custom-file (concat my-customizations-dir "emacs-custom.el"))
 (load custom-file)


This allows the `org-capture-templates' saved in the separate emacs-custom.el 
file to be correctly loaded.  Note that this behavior is from 7.02/7.3, and 
probably has to do with the custom-autoload definition of this variable in
org-install.el.


Hope this explanation helps.

Regards,
-- 
Anupam Sengupta

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: Bug?: 7.02/7.3 - Unable to set `org-capture-templates'in a
  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
  0 siblings, 0 replies; 3+ messages in thread
From: David Maus @ 2010-11-14 18:03 UTC (permalink / raw)
  To: Anupam Sengupta; +Cc: emacs-orgmode


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

At Sun, 7 Nov 2010 05:52:23 +0000 (UTC),
Anupam Sengupta wrote:

> This allows the `org-capture-templates' saved in the separate emacs-custom.el
> file to be correctly loaded.  Note that this behavior is from 7.02/7.3, and
> probably has to do with the custom-autoload definition of this variable in
> org-install.el.

Thanks for looking at this problem.  The change that caused this
dependency between org-install.el and custom.el has just been
reverted:

http://mid.gmane.org/CA5F6295%2DECC9%2D4B51%2D8F36%2DAEB4F524D9E9%40gmail%2Ecom

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-14 18:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-06 17:05 Bug?: 7.02/7.3 - Unable to set `org-capture-templates' in a Anupam Sengupta
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

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