emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* This is probably a misconfiguration rather than a bug, but...
@ 2010-09-02 14:15 Tim O'Callaghan
  2010-09-02 15:13 ` Carsten Dominik
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Tim O'Callaghan @ 2010-09-02 14:15 UTC (permalink / raw)
  To: org-mode

When i try and use org-capture in a buffer, it fails to display the
template menu, and it generates the backtrace below.

It works for org files, but not for some other files.

Tim.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  directory-file-name(nil)
  (file-name-directory (directory-file-name dirpath))
  (let ((dirname ...) (basename ...)) (list dirname basename))
  org-git-split-dirpath(nil)
  (let ((dirlist ...)) (when (string= ... "") (throw ... nil)) (setq
dir (first dirlist) relpath (concat ... relpath)))
  (while (not (file-exists-p ...)) (let (...) (when ... ...) (setq dir
... relpath ...)))
  (catch (quote toplevel) (while (not ...) (let ... ... ...)) (list
(expand-file-name ".git" dir) relpath))
  (let ((dir ...) (relpath ...)) (catch (quote toplevel) (while ...
...) (list ... relpath)))
  org-git-gitrepos-p("~/.dotfiles/zemacsen/site-lisp/policy-switch.el")
  (if (org-git-gitrepos-p file) (progn (org-store-link-props :type
"git" :link ...)))
  (when (org-git-gitrepos-p file) (org-store-link-props :type "git"
:link (org-git-create-git-link file)))
  (let ((file ...)) (when (org-git-gitrepos-p file)
(org-store-link-props :type "git" :link ...)))
  (progn (let (...) (when ... ...)))
  (if (buffer-file-name) (progn (let ... ...)))
  (when (buffer-file-name) (let (...) (when ... ...)))
  org-git-store-link()
  run-hook-with-args-until-success(org-git-store-link)
  (cond ((run-hook-with-args-until-success ...) (setq link ... desc
...)) ((equal ... "*Org Edit Src Example*") (let ... ... ... ... ...
... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...)
(let ... ... ...)) ((eq major-mode ...) (setq cpltxt ... link ...)
(org-store-link-props :type "w3" :url ...)) ((eq major-mode ...) (setq
cpltxt ... link ...) (org-store-link-props :type "w3m" :url ...))
((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode
...) (setq cpltxt ... link ...) (org-store-link-props :type "image"
:file buffer-file-name)) ((eq major-mode ...) (let ... ... ...)) ((and
... ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name
...) (setq cpltxt ...) (when ... ... ...) (setq link ...))
((interactive-p) (error "Cannot link to a buffer which is not visiting
a file")) (t (setq link nil)))
  (let ((outline-regexp ...) link cpltxt desc description search txt
custom-id agenda-link) (cond (... ...) (... ...) (... ...) (... ...)
(... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (...
... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq
cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc
cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and ... link)
(progn ... ... ...) (or agenda-link ...)))
  org-store-link(nil)
  (if (and (boundp ...) org-capture-link-is-already-stored) (plist-get
org-store-link-plist :annotation) (org-store-link nil))
  (let* ((orig-buf ...) (annotation ...) (initial ...) (entry ...))
(when initial (remove-text-properties 0 ... ... initial)) (when
annotation (remove-text-properties 0 ... ... annotation)) (cond (...
...) (... ...) (t ... ... ... ... ... ... ...)))
  (cond ((equal goto ...) (org-capture-goto-target)) ((equal goto ...)
(org-capture-goto-last-stored)) (t (let* ... ... ... ...)))
  org-capture(nil)
  call-interactively(org-capture nil nil)

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

* Re: This is probably a misconfiguration rather than a bug, but...
  2010-09-02 14:15 This is probably a misconfiguration rather than a bug, but Tim O'Callaghan
@ 2010-09-02 15:13 ` Carsten Dominik
  2010-09-02 15:50 ` Bastien
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2010-09-02 15:13 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: org-mode

Looks like a bug in org-git-store-link....

- Carsten

On Sep 2, 2010, at 4:15 PM, Tim O'Callaghan wrote:

> When i try and use org-capture in a buffer, it fails to display the
> template menu, and it generates the backtrace below.
>
> It works for org files, but not for some other files.
>
> Tim.
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>  directory-file-name(nil)
>  (file-name-directory (directory-file-name dirpath))
>  (let ((dirname ...) (basename ...)) (list dirname basename))
>  org-git-split-dirpath(nil)
>  (let ((dirlist ...)) (when (string= ... "") (throw ... nil)) (setq
> dir (first dirlist) relpath (concat ... relpath)))
>  (while (not (file-exists-p ...)) (let (...) (when ... ...) (setq dir
> ... relpath ...)))
>  (catch (quote toplevel) (while (not ...) (let ... ... ...)) (list
> (expand-file-name ".git" dir) relpath))
>  (let ((dir ...) (relpath ...)) (catch (quote toplevel) (while ...
> ...) (list ... relpath)))
>  org-git-gitrepos-p("~/.dotfiles/zemacsen/site-lisp/policy-switch.el")
>  (if (org-git-gitrepos-p file) (progn (org-store-link-props :type
> "git" :link ...)))
>  (when (org-git-gitrepos-p file) (org-store-link-props :type "git"
> :link (org-git-create-git-link file)))
>  (let ((file ...)) (when (org-git-gitrepos-p file)
> (org-store-link-props :type "git" :link ...)))
>  (progn (let (...) (when ... ...)))
>  (if (buffer-file-name) (progn (let ... ...)))
>  (when (buffer-file-name) (let (...) (when ... ...)))
>  org-git-store-link()
>  run-hook-with-args-until-success(org-git-store-link)
>  (cond ((run-hook-with-args-until-success ...) (setq link ... desc
> ...)) ((equal ... "*Org Edit Src Example*") (let ... ... ... ... ...
> ... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...)
> (let ... ... ...)) ((eq major-mode ...) (setq cpltxt ... link ...)
> (org-store-link-props :type "w3" :url ...)) ((eq major-mode ...) (setq
> cpltxt ... link ...) (org-store-link-props :type "w3m" :url ...))
> ((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode
> ...) (setq cpltxt ... link ...) (org-store-link-props :type "image"
> :file buffer-file-name)) ((eq major-mode ...) (let ... ... ...)) ((and
> ... ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name
> ...) (setq cpltxt ...) (when ... ... ...) (setq link ...))
> ((interactive-p) (error "Cannot link to a buffer which is not visiting
> a file")) (t (setq link nil)))
>  (let ((outline-regexp ...) link cpltxt desc description search txt
> custom-id agenda-link) (cond (... ...) (... ...) (... ...) (... ...)
> (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (...
> ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq
> cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc
> cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and ... link)
> (progn ... ... ...) (or agenda-link ...)))
>  org-store-link(nil)
>  (if (and (boundp ...) org-capture-link-is-already-stored) (plist-get
> org-store-link-plist :annotation) (org-store-link nil))
>  (let* ((orig-buf ...) (annotation ...) (initial ...) (entry ...))
> (when initial (remove-text-properties 0 ... ... initial)) (when
> annotation (remove-text-properties 0 ... ... annotation)) (cond (...
> ...) (... ...) (t ... ... ... ... ... ... ...)))
>  (cond ((equal goto ...) (org-capture-goto-target)) ((equal goto ...)
> (org-capture-goto-last-stored)) (t (let* ... ... ... ...)))
>  org-capture(nil)
>  call-interactively(org-capture nil nil)
>
> _______________________________________________
> 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

- Carsten

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

* Re: This is probably a misconfiguration rather than a bug, but...
  2010-09-02 14:15 This is probably a misconfiguration rather than a bug, but Tim O'Callaghan
  2010-09-02 15:13 ` Carsten Dominik
@ 2010-09-02 15:50 ` Bastien
  2010-09-02 19:15 ` David Maus
  2010-09-03  0:05 ` Sebastian Rose
  3 siblings, 0 replies; 7+ messages in thread
From: Bastien @ 2010-09-02 15:50 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: org-mode

"Tim O'Callaghan" <tim.ocallaghan@gmail.com> writes:

> When i try and use org-capture in a buffer, it fails to display the
> template menu, and it generates the backtrace below.
>
> It works for org files, but not for some other files.

Can you be a bit more specific?  What kind of buffer make the capture
mechanism fail?  (Can you share your templates?)

Thanks!

-- 
 Bastien

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

* Re: This is probably a misconfiguration rather than a bug, but...
  2010-09-02 14:15 This is probably a misconfiguration rather than a bug, but Tim O'Callaghan
  2010-09-02 15:13 ` Carsten Dominik
  2010-09-02 15:50 ` Bastien
@ 2010-09-02 19:15 ` David Maus
  2010-09-03  0:05 ` Sebastian Rose
  3 siblings, 0 replies; 7+ messages in thread
From: David Maus @ 2010-09-02 19:15 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: org-mode


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

Tim O'Callaghan wrote:
>When i try and use org-capture in a buffer, it fails to display the
>template menu, and it generates the backtrace below.

Which version of Org mode are you running?  IIRC There was a bug in
`org-git-store-link' that caused this error and was fixed in Feb 2010
(commit 6a5f6deaac1bcf4244625e5843bbaf511b8e4b57).

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] 7+ messages in thread

* Re: This is probably a misconfiguration rather than a bug, but...
  2010-09-02 14:15 This is probably a misconfiguration rather than a bug, but Tim O'Callaghan
                   ` (2 preceding siblings ...)
  2010-09-02 19:15 ` David Maus
@ 2010-09-03  0:05 ` Sebastian Rose
  2010-09-03  9:01   ` Tim O'Callaghan
  3 siblings, 1 reply; 7+ messages in thread
From: Sebastian Rose @ 2010-09-03  0:05 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: org-mode

"Tim O'Callaghan" <tim.ocallaghan@gmail.com> writes:
> When i try and use org-capture in a buffer, it fails to display the
> template menu, and it generates the backtrace below.
>
> It works for org files, but not for some other files.
>
> Tim.


If you pull the current Org version, the template menu should be there.
Just make sure, your variable `org-protocol-default-template-key' is nil
(which is the default since a few hours).

We always had the "w" template as the default of that variable for
historical reasons.  I changed that, since this broke lately  and I
wanted to avoid dependencies between the different source files
(org-capture.el and org-protocol.el in this case).

As an aside, the interactive template selection is now on by default
(just as long as the above variable is nil).



  Sebastian



>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   directory-file-name(nil)
>   (file-name-directory (directory-file-name dirpath))
>   (let ((dirname ...) (basename ...)) (list dirname basename))
>   org-git-split-dirpath(nil)
>   (let ((dirlist ...)) (when (string= ... "") (throw ... nil)) (setq
> dir (first dirlist) relpath (concat ... relpath)))
>   (while (not (file-exists-p ...)) (let (...) (when ... ...) (setq dir
> ... relpath ...)))
>   (catch (quote toplevel) (while (not ...) (let ... ... ...)) (list
> (expand-file-name ".git" dir) relpath))
>   (let ((dir ...) (relpath ...)) (catch (quote toplevel) (while ...
> ...) (list ... relpath)))
>   org-git-gitrepos-p("~/.dotfiles/zemacsen/site-lisp/policy-switch.el")
>   (if (org-git-gitrepos-p file) (progn (org-store-link-props :type
> "git" :link ...)))
>   (when (org-git-gitrepos-p file) (org-store-link-props :type "git"
> :link (org-git-create-git-link file)))
>   (let ((file ...)) (when (org-git-gitrepos-p file)
> (org-store-link-props :type "git" :link ...)))
>   (progn (let (...) (when ... ...)))
>   (if (buffer-file-name) (progn (let ... ...)))
>   (when (buffer-file-name) (let (...) (when ... ...)))
>   org-git-store-link()
>   run-hook-with-args-until-success(org-git-store-link)
>   (cond ((run-hook-with-args-until-success ...) (setq link ... desc
> ...)) ((equal ... "*Org Edit Src Example*") (let ... ... ... ... ...
> ... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...)
> (let ... ... ...)) ((eq major-mode ...) (setq cpltxt ... link ...)
> (org-store-link-props :type "w3" :url ...)) ((eq major-mode ...) (setq
> cpltxt ... link ...) (org-store-link-props :type "w3m" :url ...))
> ((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode
> ...) (setq cpltxt ... link ...) (org-store-link-props :type "image"
> :file buffer-file-name)) ((eq major-mode ...) (let ... ... ...)) ((and
> ... ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name
> ...) (setq cpltxt ...) (when ... ... ...) (setq link ...))
> ((interactive-p) (error "Cannot link to a buffer which is not visiting
> a file")) (t (setq link nil)))
>   (let ((outline-regexp ...) link cpltxt desc description search txt
> custom-id agenda-link) (cond (... ...) (... ...) (... ...) (... ...)
> (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (...
> ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq
> cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc
> cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and ... link)
> (progn ... ... ...) (or agenda-link ...)))
>   org-store-link(nil)
>   (if (and (boundp ...) org-capture-link-is-already-stored) (plist-get
> org-store-link-plist :annotation) (org-store-link nil))
>   (let* ((orig-buf ...) (annotation ...) (initial ...) (entry ...))
> (when initial (remove-text-properties 0 ... ... initial)) (when
> annotation (remove-text-properties 0 ... ... annotation)) (cond (...
> ...) (... ...) (t ... ... ... ... ... ... ...)))
>   (cond ((equal goto ...) (org-capture-goto-target)) ((equal goto ...)
> (org-capture-goto-last-stored)) (t (let* ... ... ... ...)))
>   org-capture(nil)
>   call-interactively(org-capture nil nil)
>

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

* Re: This is probably a misconfiguration rather than a bug, but...
  2010-09-03  0:05 ` Sebastian Rose
@ 2010-09-03  9:01   ` Tim O'Callaghan
  2010-09-04  5:06     ` Noorul Islam
  0 siblings, 1 reply; 7+ messages in thread
From: Tim O'Callaghan @ 2010-09-03  9:01 UTC (permalink / raw)
  Cc: org-mode

I'm tracking the master git repo, the emacs git repo (running emacs
24.0.50.1) and just updated git from 11e7a57 to ba4bf2c.

The problem is still there, I've been trying to work out exactly what
the criteria is for this problem, and i'm still not sure, but i can
replicate it without any trouble.
If i try to capture the *scratch* buffer directly after emacs startup,
it shows me the template menu. If i then change the mode of scratch to
emacs-lisp, and try to capture it generates the trace-back, which I've
attached after my org-capture configuration.

Tim.

------------------ config snippet

(define-key global-map [(meta r)] 'org-capture)

(defun toc:remap-capture-keys ()
    ;; default as save to inbox when hit save button
    (define-key
      org-capture-mode-map [(control x) (control s)] 'ispell-buffer)
    (define-key
      org-capture-mode-map [(control x) (control w)] '(org-capture-finalize 1))
    (define-key
      org-capture-mode-map [(meta k)]                'org-capture-kill)
    )
(add-hook 'org-capture-mode-hook 'toc:remap-capture-keys 'append)


(setq org-capture-templates
      `(
        ("0" "0+inbox" entry
         (file+headline (concat toc:ze-org-dir "0+inbox.org") "+INBOX")
         "* %? \n\n")
        ("1" "1+projects" entry
         (file+olp ,(concat toc:ze-org-dir "1+work.org") "+TASKS" "+PROJECTS")
         "* TODO %?\n")
        ("2" "2+someDay" entry
         (file+regexp (concat toc:ze-org-dir "2+someday.org") "^\*+ \+")
         "* SMDY %?\n")
        ("4" "4+calendar" entry
         (file+headline (concat toc:ze-org-dir "1+work.org") "+WORKINBOX")
         "* TODO %?\n")
        ("5" "5+toRead" entry
         (file+headline (concat toc:ze-org-dir "5+toread.org") "")
         "* %? \n %^{Link?}")
        ("7" "7+toWatch" entry
         (file+headline (concat toc:ze-org-dir "7+towatch.org") "")
         "* %^{Title}\nSOURCE:%c\n  %i")
        ("8" "8+contacts" entry
         (file (concat toc:ze-org-dir "8+contacts.org"))
         "* %^{Title}\nSOURCE:%c\n  %i")
        ("q" "8+quotes" entry
         (file (concat toc:ze-org-dir "8+quotes.org"))
         "* %^{Title}\nSOURCE:%c\n  %i")
        ("s" "8+scrapbook" entry
         (file (concat toc:ze-org-dir "8+scrapbook.org"))
         "* %^{Title}\nSOURCE:%c\n  %i")
        ("9" "9+journal" entry
         (file+datetree (concat toc:ze-org-dir "9+journal.org"))
         "* %T %?\n  %i\n  %a")
        ("e" "1+emacsTweaking" entry
         (file+headline (concat toc:ze-org-dir "1+emacsTweaking.org")
"+EMACSINBOX")
         "* %? \n %?\n")
        ("w" "1+work" entry
         (file+headline (concat toc:ze-org-dir "1+work.org") "+WORKINBOX")
         "* TODO %?\n")
        ("W" "9+work-journal" entry
         (file+datetree (concat toc:ze-org-dir "9+work-journal.org"))
         "* %^{Title}\n %c\n  %i %?")
        ("!" "into clocked task" entry
         (clock)
         "* %? \n %?\n")
        ))

------------------ traceback

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^/tmp_mnt/" nil)
  abbreviate-file-name(nil)
  (concat "file:" (abbreviate-file-name buffer-file-name) "::" def " " name)
  (setq link (concat "file:" (abbreviate-file-name buffer-file-name)
"::" def " " name))
  (let* ((end ...) (def ...) (name ...) (sym-name ...) (stype ...)
(args ...) (docstring ...) (doc ...) (fixme ...) (comment ...) keys
keys-desc link description) (if (equal stype "Command") (setq keys ...
keys-desc ...)) (setq link (concat "file:" ... "::" def " " name))
(setq description (concat stype ": " name)) (org-store-link-props
:type "elisp-symbol" :link link :description description :def def
:name name :stype stype :args args :keys keys-desc :docstring
docstring :doc doc :fixme fixme :comment comment))
  (save-excursion (or (looking-at "^(") (beginning-of-defun))
(looking-at "^(\\([a-z]+\\) \\([^)\n ]+\\) ?\n?[
	]*\\(?:(\\(.*\\))\\)?") (let* (... ... ... ... ... ... ... ... ...
... keys keys-desc link description) (if ... ...) (setq link ...)
(setq description ...) (org-store-link-props :type "elisp-symbol"
:link link :description description :def def :name name :stype stype
:args args :keys keys-desc :docstring docstring :doc doc :fixme fixme
:comment comment)))
  (progn (save-excursion (or ... ...) (looking-at "^(\\([a-z]+\\)
\\([^)\n ]+\\) ?\n?[ 	]*\\(?:(\\(.*\\))\\)?") (let* ... ... ... ...
...)))
  (if (eq major-mode (quote emacs-lisp-mode)) (progn (save-excursion
... ... ...)))
  (when (eq major-mode (quote emacs-lisp-mode)) (save-excursion (or
... ...) (looking-at "^(\\([a-z]+\\) \\([^)\n ]+\\) ?\n?[
	]*\\(?:(\\(.*\\))\\)?") (let* ... ... ... ... ...)))
  org-elisp-symbol-store-link()
  run-hook-with-args-until-success(org-elisp-symbol-store-link)
  (cond ((run-hook-with-args-until-success ...) (setq link ... desc
...)) ((equal ... "*Org Edit Src Example*") (let ... ... ... ... ...
... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...)
(let ... ... ...)) ((eq major-mode ...) (setq cpltxt ... link ...)
(org-store-link-props :type "w3" :url ...)) ((eq major-mode ...) (setq
cpltxt ... link ...) (org-store-link-props :type "w3m" :url ...))
((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode
...) (setq cpltxt ... link ...) (org-store-link-props :type "image"
:file buffer-file-name)) ((eq major-mode ...) (let ... ... ...)) ((and
... ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name
...) (setq cpltxt ...) (when ... ... ...) (setq link ...))
((interactive-p) (error "Cannot link to a buffer which is not visiting
a file")) (t (setq link nil)))
  (let ((outline-regexp ...) link cpltxt desc description search txt
custom-id agenda-link) (cond (... ...) (... ...) (... ...) (... ...)
(... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (...
... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq
cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc
cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and ... link)
(progn ... ... ...) (or agenda-link ...)))
  org-store-link(nil)
  (if (and (boundp ...) org-capture-link-is-already-stored) (plist-get
org-store-link-plist :annotation) (org-store-link nil))
  (let* ((orig-buf ...) (annotation ...) (initial ...) (entry ...))
(when (stringp initial) (remove-text-properties 0 ... ... initial))
(when (stringp annotation) (remove-text-properties 0 ... ...
annotation)) (cond (... ...) (... ...) (t ... ... ... ... ... ...
...)))
  (cond ((equal goto ...) (org-capture-goto-target)) ((equal goto ...)
(org-capture-goto-last-stored)) (t (let* ... ... ... ...)))
  org-capture(nil)
  call-interactively(org-capture nil nil)








On 3 September 2010 02:05, Sebastian Rose <sebastian_rose@gmx.de> wrote:
> "Tim O'Callaghan" <tim.ocallaghan@gmail.com> writes:
>> When i try and use org-capture in a buffer, it fails to display the
>> template menu, and it generates the backtrace below.
>>
>> It works for org files, but not for some other files.
>>
>> Tim.
>
>
> If you pull the current Org version, the template menu should be there.
> Just make sure, your variable `org-protocol-default-template-key' is nil
> (which is the default since a few hours).
>
> We always had the "w" template as the default of that variable for
> historical reasons.  I changed that, since this broke lately  and I
> wanted to avoid dependencies between the different source files
> (org-capture.el and org-protocol.el in this case).
>
> As an aside, the interactive template selection is now on by default
> (just as long as the above variable is nil).
>
>
>
>  Sebastian
>
>
>
>>
>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>   directory-file-name(nil)
>>   (file-name-directory (directory-file-name dirpath))
>>   (let ((dirname ...) (basename ...)) (list dirname basename))
>>   org-git-split-dirpath(nil)
>>   (let ((dirlist ...)) (when (string= ... "") (throw ... nil)) (setq
>> dir (first dirlist) relpath (concat ... relpath)))
>>   (while (not (file-exists-p ...)) (let (...) (when ... ...) (setq dir
>> ... relpath ...)))
>>   (catch (quote toplevel) (while (not ...) (let ... ... ...)) (list
>> (expand-file-name ".git" dir) relpath))
>>   (let ((dir ...) (relpath ...)) (catch (quote toplevel) (while ...
>> ...) (list ... relpath)))
>>   org-git-gitrepos-p("~/.dotfiles/zemacsen/site-lisp/policy-switch.el")
>>   (if (org-git-gitrepos-p file) (progn (org-store-link-props :type
>> "git" :link ...)))
>>   (when (org-git-gitrepos-p file) (org-store-link-props :type "git"
>> :link (org-git-create-git-link file)))
>>   (let ((file ...)) (when (org-git-gitrepos-p file)
>> (org-store-link-props :type "git" :link ...)))
>>   (progn (let (...) (when ... ...)))
>>   (if (buffer-file-name) (progn (let ... ...)))
>>   (when (buffer-file-name) (let (...) (when ... ...)))
>>   org-git-store-link()
>>   run-hook-with-args-until-success(org-git-store-link)
>>   (cond ((run-hook-with-args-until-success ...) (setq link ... desc
>> ...)) ((equal ... "*Org Edit Src Example*") (let ... ... ... ... ...
>> ... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...)
>> (let ... ... ...)) ((eq major-mode ...) (setq cpltxt ... link ...)
>> (org-store-link-props :type "w3" :url ...)) ((eq major-mode ...) (setq
>> cpltxt ... link ...) (org-store-link-props :type "w3m" :url ...))
>> ((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode
>> ...) (setq cpltxt ... link ...) (org-store-link-props :type "image"
>> :file buffer-file-name)) ((eq major-mode ...) (let ... ... ...)) ((and
>> ... ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name
>> ...) (setq cpltxt ...) (when ... ... ...) (setq link ...))
>> ((interactive-p) (error "Cannot link to a buffer which is not visiting
>> a file")) (t (setq link nil)))
>>   (let ((outline-regexp ...) link cpltxt desc description search txt
>> custom-id agenda-link) (cond (... ...) (... ...) (... ...) (... ...)
>> (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (...
>> ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq
>> cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc
>> cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and ... link)
>> (progn ... ... ...) (or agenda-link ...)))
>>   org-store-link(nil)
>>   (if (and (boundp ...) org-capture-link-is-already-stored) (plist-get
>> org-store-link-plist :annotation) (org-store-link nil))
>>   (let* ((orig-buf ...) (annotation ...) (initial ...) (entry ...))
>> (when initial (remove-text-properties 0 ... ... initial)) (when
>> annotation (remove-text-properties 0 ... ... annotation)) (cond (...
>> ...) (... ...) (t ... ... ... ... ... ... ...)))
>>   (cond ((equal goto ...) (org-capture-goto-target)) ((equal goto ...)
>> (org-capture-goto-last-stored)) (t (let* ... ... ... ...)))
>>   org-capture(nil)
>>   call-interactively(org-capture nil nil)
>>
>

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

* Re: This is probably a misconfiguration rather than a bug, but...
  2010-09-03  9:01   ` Tim O'Callaghan
@ 2010-09-04  5:06     ` Noorul Islam
  0 siblings, 0 replies; 7+ messages in thread
From: Noorul Islam @ 2010-09-04  5:06 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: org-mode

On Fri, Sep 3, 2010 at 2:31 PM, Tim O'Callaghan
<tim.ocallaghan@gmail.com> wrote:
> I'm tracking the master git repo, the emacs git repo (running emacs
> 24.0.50.1) and just updated git from 11e7a57 to ba4bf2c.
>
> The problem is still there, I've been trying to work out exactly what
> the criteria is for this problem, and i'm still not sure, but i can
> replicate it without any trouble.
> If i try to capture the *scratch* buffer directly after emacs startup,
> it shows me the template menu. If i then change the mode of scratch to
> emacs-lisp, and try to capture it generates the trace-back, which I've
> attached after my org-capture configuration.
>
> Tim.
>
> ------------------ config snippet
>
> (define-key global-map [(meta r)] 'org-capture)
>
> (defun toc:remap-capture-keys ()
>    ;; default as save to inbox when hit save button
>    (define-key
>      org-capture-mode-map [(control x) (control s)] 'ispell-buffer)
>    (define-key
>      org-capture-mode-map [(control x) (control w)] '(org-capture-finalize 1))
>    (define-key
>      org-capture-mode-map [(meta k)]                'org-capture-kill)
>    )
> (add-hook 'org-capture-mode-hook 'toc:remap-capture-keys 'append)
>
>
> (setq org-capture-templates
>      `(
>        ("0" "0+inbox" entry
>         (file+headline (concat toc:ze-org-dir "0+inbox.org") "+INBOX")
>         "* %? \n\n")
>        ("1" "1+projects" entry
>         (file+olp ,(concat toc:ze-org-dir "1+work.org") "+TASKS" "+PROJECTS")
>         "* TODO %?\n")
>        ("2" "2+someDay" entry
>         (file+regexp (concat toc:ze-org-dir "2+someday.org") "^\*+ \+")
>         "* SMDY %?\n")
>        ("4" "4+calendar" entry
>         (file+headline (concat toc:ze-org-dir "1+work.org") "+WORKINBOX")
>         "* TODO %?\n")
>        ("5" "5+toRead" entry
>         (file+headline (concat toc:ze-org-dir "5+toread.org") "")
>         "* %? \n %^{Link?}")
>        ("7" "7+toWatch" entry
>         (file+headline (concat toc:ze-org-dir "7+towatch.org") "")
>         "* %^{Title}\nSOURCE:%c\n  %i")
>        ("8" "8+contacts" entry
>         (file (concat toc:ze-org-dir "8+contacts.org"))
>         "* %^{Title}\nSOURCE:%c\n  %i")
>        ("q" "8+quotes" entry
>         (file (concat toc:ze-org-dir "8+quotes.org"))
>         "* %^{Title}\nSOURCE:%c\n  %i")
>        ("s" "8+scrapbook" entry
>         (file (concat toc:ze-org-dir "8+scrapbook.org"))
>         "* %^{Title}\nSOURCE:%c\n  %i")
>        ("9" "9+journal" entry
>         (file+datetree (concat toc:ze-org-dir "9+journal.org"))
>         "* %T %?\n  %i\n  %a")
>        ("e" "1+emacsTweaking" entry
>         (file+headline (concat toc:ze-org-dir "1+emacsTweaking.org")
> "+EMACSINBOX")
>         "* %? \n %?\n")
>        ("w" "1+work" entry
>         (file+headline (concat toc:ze-org-dir "1+work.org") "+WORKINBOX")
>         "* TODO %?\n")
>        ("W" "9+work-journal" entry
>         (file+datetree (concat toc:ze-org-dir "9+work-journal.org"))
>         "* %^{Title}\n %c\n  %i %?")
>        ("!" "into clocked task" entry
>         (clock)
>         "* %? \n %?\n")
>        ))
>

I think above snippet works for me on emacs 24. I tried to re-create
with the steps mentioned by you using scratch buffer.

GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of
2010-08-29 on sajida
release_7.01h-228-g782f
Org-mode version 7.01trans (release_7.01h.228.g782f)

Thanks and Regards
Noorul

> ------------------ traceback
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>  string-match("^/tmp_mnt/" nil)
>  abbreviate-file-name(nil)
>  (concat "file:" (abbreviate-file-name buffer-file-name) "::" def " " name)
>  (setq link (concat "file:" (abbreviate-file-name buffer-file-name)
> "::" def " " name))
>  (let* ((end ...) (def ...) (name ...) (sym-name ...) (stype ...)
> (args ...) (docstring ...) (doc ...) (fixme ...) (comment ...) keys
> keys-desc link description) (if (equal stype "Command") (setq keys ...
> keys-desc ...)) (setq link (concat "file:" ... "::" def " " name))
> (setq description (concat stype ": " name)) (org-store-link-props
> :type "elisp-symbol" :link link :description description :def def
> :name name :stype stype :args args :keys keys-desc :docstring
> docstring :doc doc :fixme fixme :comment comment))
>  (save-excursion (or (looking-at "^(") (beginning-of-defun))
> (looking-at "^(\\([a-z]+\\) \\([^)\n ]+\\) ?\n?[
>        ]*\\(?:(\\(.*\\))\\)?") (let* (... ... ... ... ... ... ... ... ...
> ... keys keys-desc link description) (if ... ...) (setq link ...)
> (setq description ...) (org-store-link-props :type "elisp-symbol"
> :link link :description description :def def :name name :stype stype
> :args args :keys keys-desc :docstring docstring :doc doc :fixme fixme
> :comment comment)))
>  (progn (save-excursion (or ... ...) (looking-at "^(\\([a-z]+\\)
> \\([^)\n ]+\\) ?\n?[    ]*\\(?:(\\(.*\\))\\)?") (let* ... ... ... ...
> ...)))
>  (if (eq major-mode (quote emacs-lisp-mode)) (progn (save-excursion
> ... ... ...)))
>  (when (eq major-mode (quote emacs-lisp-mode)) (save-excursion (or
> ... ...) (looking-at "^(\\([a-z]+\\) \\([^)\n ]+\\) ?\n?[
>        ]*\\(?:(\\(.*\\))\\)?") (let* ... ... ... ... ...)))
>  org-elisp-symbol-store-link()
>  run-hook-with-args-until-success(org-elisp-symbol-store-link)
>  (cond ((run-hook-with-args-until-success ...) (setq link ... desc
> ...)) ((equal ... "*Org Edit Src Example*") (let ... ... ... ... ...
> ... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...)
> (let ... ... ...)) ((eq major-mode ...) (setq cpltxt ... link ...)
> (org-store-link-props :type "w3" :url ...)) ((eq major-mode ...) (setq
> cpltxt ... link ...) (org-store-link-props :type "w3m" :url ...))
> ((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode
> ...) (setq cpltxt ... link ...) (org-store-link-props :type "image"
> :file buffer-file-name)) ((eq major-mode ...) (let ... ... ...)) ((and
> ... ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name
> ...) (setq cpltxt ...) (when ... ... ...) (setq link ...))
> ((interactive-p) (error "Cannot link to a buffer which is not visiting
> a file")) (t (setq link nil)))
>  (let ((outline-regexp ...) link cpltxt desc description search txt
> custom-id agenda-link) (cond (... ...) (... ...) (... ...) (... ...)
> (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (...
> ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq
> cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc
> cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and ... link)
> (progn ... ... ...) (or agenda-link ...)))
>  org-store-link(nil)
>  (if (and (boundp ...) org-capture-link-is-already-stored) (plist-get
> org-store-link-plist :annotation) (org-store-link nil))
>  (let* ((orig-buf ...) (annotation ...) (initial ...) (entry ...))
> (when (stringp initial) (remove-text-properties 0 ... ... initial))
> (when (stringp annotation) (remove-text-properties 0 ... ...
> annotation)) (cond (... ...) (... ...) (t ... ... ... ... ... ...
> ...)))
>  (cond ((equal goto ...) (org-capture-goto-target)) ((equal goto ...)
> (org-capture-goto-last-stored)) (t (let* ... ... ... ...)))
>  org-capture(nil)
>  call-interactively(org-capture nil nil)
>
>
>
>
>
>
>
>
> On 3 September 2010 02:05, Sebastian Rose <sebastian_rose@gmx.de> wrote:
>> "Tim O'Callaghan" <tim.ocallaghan@gmail.com> writes:
>>> When i try and use org-capture in a buffer, it fails to display the
>>> template menu, and it generates the backtrace below.
>>>
>>> It works for org files, but not for some other files.
>>>
>>> Tim.
>>
>>
>> If you pull the current Org version, the template menu should be there.
>> Just make sure, your variable `org-protocol-default-template-key' is nil
>> (which is the default since a few hours).
>>
>> We always had the "w" template as the default of that variable for
>> historical reasons.  I changed that, since this broke lately  and I
>> wanted to avoid dependencies between the different source files
>> (org-capture.el and org-protocol.el in this case).
>>
>> As an aside, the interactive template selection is now on by default
>> (just as long as the above variable is nil).
>>
>>
>>
>>  Sebastian
>>
>>
>>
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>>   directory-file-name(nil)
>>>   (file-name-directory (directory-file-name dirpath))
>>>   (let ((dirname ...) (basename ...)) (list dirname basename))
>>>   org-git-split-dirpath(nil)
>>>   (let ((dirlist ...)) (when (string= ... "") (throw ... nil)) (setq
>>> dir (first dirlist) relpath (concat ... relpath)))
>>>   (while (not (file-exists-p ...)) (let (...) (when ... ...) (setq dir
>>> ... relpath ...)))
>>>   (catch (quote toplevel) (while (not ...) (let ... ... ...)) (list
>>> (expand-file-name ".git" dir) relpath))
>>>   (let ((dir ...) (relpath ...)) (catch (quote toplevel) (while ...
>>> ...) (list ... relpath)))
>>>   org-git-gitrepos-p("~/.dotfiles/zemacsen/site-lisp/policy-switch.el")
>>>   (if (org-git-gitrepos-p file) (progn (org-store-link-props :type
>>> "git" :link ...)))
>>>   (when (org-git-gitrepos-p file) (org-store-link-props :type "git"
>>> :link (org-git-create-git-link file)))
>>>   (let ((file ...)) (when (org-git-gitrepos-p file)
>>> (org-store-link-props :type "git" :link ...)))
>>>   (progn (let (...) (when ... ...)))
>>>   (if (buffer-file-name) (progn (let ... ...)))
>>>   (when (buffer-file-name) (let (...) (when ... ...)))
>>>   org-git-store-link()
>>>   run-hook-with-args-until-success(org-git-store-link)
>>>   (cond ((run-hook-with-args-until-success ...) (setq link ... desc
>>> ...)) ((equal ... "*Org Edit Src Example*") (let ... ... ... ... ...
>>> ... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...)
>>> (let ... ... ...)) ((eq major-mode ...) (setq cpltxt ... link ...)
>>> (org-store-link-props :type "w3" :url ...)) ((eq major-mode ...) (setq
>>> cpltxt ... link ...) (org-store-link-props :type "w3m" :url ...))
>>> ((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode
>>> ...) (setq cpltxt ... link ...) (org-store-link-props :type "image"
>>> :file buffer-file-name)) ((eq major-mode ...) (let ... ... ...)) ((and
>>> ... ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name
>>> ...) (setq cpltxt ...) (when ... ... ...) (setq link ...))
>>> ((interactive-p) (error "Cannot link to a buffer which is not visiting
>>> a file")) (t (setq link nil)))
>>>   (let ((outline-regexp ...) link cpltxt desc description search txt
>>> custom-id agenda-link) (cond (... ...) (... ...) (... ...) (... ...)
>>> (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (...
>>> ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq
>>> cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc
>>> cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and ... link)
>>> (progn ... ... ...) (or agenda-link ...)))
>>>   org-store-link(nil)
>>>   (if (and (boundp ...) org-capture-link-is-already-stored) (plist-get
>>> org-store-link-plist :annotation) (org-store-link nil))
>>>   (let* ((orig-buf ...) (annotation ...) (initial ...) (entry ...))
>>> (when initial (remove-text-properties 0 ... ... initial)) (when
>>> annotation (remove-text-properties 0 ... ... annotation)) (cond (...
>>> ...) (... ...) (t ... ... ... ... ... ... ...)))
>>>   (cond ((equal goto ...) (org-capture-goto-target)) ((equal goto ...)
>>> (org-capture-goto-last-stored)) (t (let* ... ... ... ...)))
>>>   org-capture(nil)
>>>   call-interactively(org-capture nil nil)
>>>
>>
>
> _______________________________________________
> 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] 7+ messages in thread

end of thread, other threads:[~2010-09-04  5:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-02 14:15 This is probably a misconfiguration rather than a bug, but Tim O'Callaghan
2010-09-02 15:13 ` Carsten Dominik
2010-09-02 15:50 ` Bastien
2010-09-02 19:15 ` David Maus
2010-09-03  0:05 ` Sebastian Rose
2010-09-03  9:01   ` Tim O'Callaghan
2010-09-04  5:06     ` Noorul Islam

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