emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Fabrice Popineau <fabrice.popineau@supelec.fr>
To: Xebar Saram <zeltakc@gmail.com>, org mode <emacs-orgmode@gnu.org>
Subject: Re: org-refile works but dosent work from within a capture window (org-capture-refile)
Date: Wed, 15 Jun 2016 21:18:39 +0200	[thread overview]
Message-ID: <CAFgFV9ORdrJfqb8BZB6Q8m+9trX+k6h_vMWYjdbDbrui2qU_fQ@mail.gmail.com> (raw)
In-Reply-To: <87shx0msyn.fsf@saiph.selenimh>

[-- Attachment #1: Type: text/plain, Size: 13746 bytes --]

Hi,

I don't know what is the minimal setup to reproduce the problem.
Basically:

- call capture from Chrome (in my case)
- select n for note
- select C-c C-w for org-capture-refile

Here is a backtrace.

The advice around call-interactively is set up by ido-ubiquitous.

Regards,

Fabrice

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)

replace-regexp-in-string("\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
"\\3" nil)
  (setq heading-text (replace-regexp-in-string org-bracket-link-regexp
"\\3" (nth 4 (org-heading-components))))
  (if (and arg (listp arg)) nil (org-back-to-heading t) (setq heading-text
(replace-regexp-in-string org-bracket-link-regexp "\\3" (nth 4
(org-heading-components)))))
  (save-excursion (if (and arg (listp arg)) nil (org-back-to-heading t)
(setq heading-text (replace-regexp-in-string org-bracket-link-regexp "\\3"
(nth 4 (org-heading-components))))) (org-refile-get-location (cond ((and
arg (listp arg)) "Goto") (regionp (concat actionmsg " region to")) (t
(concat actionmsg " subtree \"" heading-text "\" to"))) default-buffer (and
(not (equal (quote (4)) arg)) org-refile-allow-creating-parent-nodes)))
  (let (heading-text) (save-excursion (if (and arg (listp arg)) nil
(org-back-to-heading t) (setq heading-text (replace-regexp-in-string
org-bracket-link-regexp "\\3" (nth 4 (org-heading-components)))))
(org-refile-get-location (cond ((and arg (listp arg)) "Goto") (regionp
(concat actionmsg " region to")) (t (concat actionmsg " subtree \""
heading-text "\" to"))) default-buffer (and (not (equal (quote (4)) arg))
org-refile-allow-creating-parent-nodes))))
  (or rfloc (let (heading-text) (save-excursion (if (and arg (listp arg))
nil (org-back-to-heading t) (setq heading-text (replace-regexp-in-string
org-bracket-link-regexp "\\3" (nth 4 (org-heading-components)))))
(org-refile-get-location (cond ((and arg (listp arg)) "Goto") (regionp
(concat actionmsg " region to")) (t (concat actionmsg " subtree \""
heading-text "\" to"))) default-buffer (and (not (equal (quote ...) arg))
org-refile-allow-creating-parent-nodes)))))
  (setq it (or rfloc (let (heading-text) (save-excursion (if (and arg
(listp arg)) nil (org-back-to-heading t) (setq heading-text
(replace-regexp-in-string org-bracket-link-regexp "\\3" (nth 4 ...))))
(org-refile-get-location (cond ((and arg ...) "Goto") (regionp (concat
actionmsg " region to")) (t (concat actionmsg " subtree \"" heading-text
"\" to"))) default-buffer (and (not (equal ... arg))
org-refile-allow-creating-parent-nodes))))))
  (or (and (equal arg 2) org-clock-hd-marker (marker-buffer
org-clock-hd-marker) (prog1 (setq it (list (or org-clock-heading "running
clock") (buffer-file-name (marker-buffer org-clock-hd-marker)) ""
(marker-position org-clock-hd-marker))) (setq arg nil))) (setq it (or rfloc
(let (heading-text) (save-excursion (if (and arg (listp arg)) nil
(org-back-to-heading t) (setq heading-text (replace-regexp-in-string
org-bracket-link-regexp "\\3" ...))) (org-refile-get-location (cond (...
"Goto") (regionp ...) (t ...)) default-buffer (and (not ...)
org-refile-allow-creating-parent-nodes)))))))
  (if (or (and (equal arg 2) org-clock-hd-marker (marker-buffer
org-clock-hd-marker) (prog1 (setq it (list (or org-clock-heading "running
clock") (buffer-file-name (marker-buffer org-clock-hd-marker)) ""
(marker-position org-clock-hd-marker))) (setq arg nil))) (setq it (or rfloc
(let (heading-text) (save-excursion (if (and arg ...) nil
(org-back-to-heading t) (setq heading-text ...)) (org-refile-get-location
(cond ... ... ...) default-buffer (and ...
org-refile-allow-creating-parent-nodes))))))) (progn (setq file (nth 1 it)
pos (nth 3 it)) (if (and (not arg) pos (equal (buffer-file-name) file) (if
regionp (and (>= pos region-start) (<= pos region-end)) (and (>= pos
(point)) (< pos (save-excursion ...))))) (progn (error "Cannot refile to
position inside the tree or region"))) (setq nbuf (or (find-buffer-visiting
file) (find-file-noselect file))) (if (and arg (not (equal arg 3))) (progn
(org-pop-to-buffer-same-window nbuf) (goto-char pos) (org-show-context
(quote org-goto))) (if regionp (progn (org-kill-new (buffer-substring
region-start region-end)) (org-save-markers-in-region region-start
region-end)) (org-copy-subtree 1 nil t)) (save-current-buffer (set-buffer
(setq nbuf (or (find-buffer-visiting file) (find-file-noselect file))))
(setq reversed (org-notes-order-reversed-p)) (save-excursion
(save-restriction (widen) (if pos (progn ... ... ... ...) (setq level 1)
(if ... ... ... ...)) (if (bolp) nil (newline)) (org-paste-subtree level
nil nil t) (if org-log-refile (progn ... ...)) (and org-auto-align-tags
(let ... ...)) (let (...) (if bookmark-name ...)) (if (and ...
org-capture-is-refiling) (progn ... ...)) (if (fboundp ...) (progn ...))
(run-hooks (quote org-after-refile-insert-hook))))) (if org-refile-keep nil
(if regionp (delete-region (point) (+ (point) (- region-end region-start)))
(delete-region (and (org-back-to-heading t) (point)) (min (1+ ...)
(org-end-of-subtree t t) (point))))) (if (featurep (quote org-inlinetask))
(progn (org-inlinetask-remove-END-maybe))) (setq org-markers-to-move nil)
(message (concat actionmsg " to \"%s\" in file %s: done") (car it) file))))
  (if (equal arg (quote (16))) (org-refile-goto-last-stored) (if (or (and
(equal arg 2) org-clock-hd-marker (marker-buffer org-clock-hd-marker)
(prog1 (setq it (list (or org-clock-heading "running clock")
(buffer-file-name ...) "" (marker-position org-clock-hd-marker))) (setq arg
nil))) (setq it (or rfloc (let (heading-text) (save-excursion (if ... nil
... ...) (org-refile-get-location ... default-buffer ...)))))) (progn (setq
file (nth 1 it) pos (nth 3 it)) (if (and (not arg) pos (equal
(buffer-file-name) file) (if regionp (and (>= pos region-start) (<= pos
region-end)) (and (>= pos ...) (< pos ...)))) (progn (error "Cannot refile
to position inside the tree or region"))) (setq nbuf (or
(find-buffer-visiting file) (find-file-noselect file))) (if (and arg (not
(equal arg 3))) (progn (org-pop-to-buffer-same-window nbuf) (goto-char pos)
(org-show-context (quote org-goto))) (if regionp (progn (org-kill-new
(buffer-substring region-start region-end)) (org-save-markers-in-region
region-start region-end)) (org-copy-subtree 1 nil t)) (save-current-buffer
(set-buffer (setq nbuf (or ... ...))) (setq reversed
(org-notes-order-reversed-p)) (save-excursion (save-restriction (widen) (if
pos ... ... ...) (if ... nil ...) (org-paste-subtree level nil nil t) (if
org-log-refile ...) (and org-auto-align-tags ...) (let ... ...) (if ...
...) (if ... ...) (run-hooks ...)))) (if org-refile-keep nil (if regionp
(delete-region (point) (+ ... ...)) (delete-region (and ... ...) (min ...
... ...)))) (if (featurep (quote org-inlinetask)) (progn
(org-inlinetask-remove-END-maybe))) (setq org-markers-to-move nil) (message
(concat actionmsg " to \"%s\" in file %s: done") (car it) file)))))
  (let* ((actionmsg (cond (msg msg) ((equal arg 3) "Refile (and keep)") (t
"Refile"))) (regionp (org-region-active-p)) (region-start (and regionp
(region-beginning))) (region-end (and regionp (region-end)))
(org-refile-keep (if (equal arg 3) t org-refile-keep)) pos it nbuf file
level reversed) (setq last-command nil) (if regionp (progn (goto-char
region-start) (or (bolp) (goto-char (point-at-bol))) (setq region-start
(point)) (if (or (org-kill-is-subtree-p (buffer-substring region-start
region-end)) (prog1 org-refile-active-region-within-subtree (let (...)
(org-toggle-heading) (setq region-end ...)))) nil (user-error "The region
is not a (sequence of) subtree(s)")))) (if (equal arg (quote (16)))
(org-refile-goto-last-stored) (if (or (and (equal arg 2)
org-clock-hd-marker (marker-buffer org-clock-hd-marker) (prog1 (setq it
(list ... ... "" ...)) (setq arg nil))) (setq it (or rfloc (let
(heading-text) (save-excursion ... ...))))) (progn (setq file (nth 1 it)
pos (nth 3 it)) (if (and (not arg) pos (equal (buffer-file-name) file) (if
regionp (and ... ...) (and ... ...))) (progn (error "Cannot refile to
position inside the tree or region"))) (setq nbuf (or (find-buffer-visiting
file) (find-file-noselect file))) (if (and arg (not (equal arg 3))) (progn
(org-pop-to-buffer-same-window nbuf) (goto-char pos) (org-show-context
(quote org-goto))) (if regionp (progn (org-kill-new ...)
(org-save-markers-in-region region-start region-end)) (org-copy-subtree 1
nil t)) (save-current-buffer (set-buffer (setq nbuf ...)) (setq reversed
(org-notes-order-reversed-p)) (save-excursion (save-restriction ... ... ...
... ... ... ... ... ... ...))) (if org-refile-keep nil (if regionp
(delete-region ... ...) (delete-region ... ...))) (if (featurep (quote
org-inlinetask)) (progn (org-inlinetask-remove-END-maybe))) (setq
org-markers-to-move nil) (message (concat actionmsg " to \"%s\" in file %s:
done") (car it) file))))))
  (if (member arg (quote (0 (64)))) (org-refile-cache-clear) (let*
((actionmsg (cond (msg msg) ((equal arg 3) "Refile (and keep)") (t
"Refile"))) (regionp (org-region-active-p)) (region-start (and regionp
(region-beginning))) (region-end (and regionp (region-end)))
(org-refile-keep (if (equal arg 3) t org-refile-keep)) pos it nbuf file
level reversed) (setq last-command nil) (if regionp (progn (goto-char
region-start) (or (bolp) (goto-char (point-at-bol))) (setq region-start
(point)) (if (or (org-kill-is-subtree-p (buffer-substring region-start
region-end)) (prog1 org-refile-active-region-within-subtree (let ... ...
...))) nil (user-error "The region is not a (sequence of) subtree(s)"))))
(if (equal arg (quote (16))) (org-refile-goto-last-stored) (if (or (and
(equal arg 2) org-clock-hd-marker (marker-buffer org-clock-hd-marker)
(prog1 (setq it ...) (setq arg nil))) (setq it (or rfloc (let ... ...))))
(progn (setq file (nth 1 it) pos (nth 3 it)) (if (and (not arg) pos (equal
... file) (if regionp ... ...)) (progn (error "Cannot refile to position
inside the tree or region"))) (setq nbuf (or (find-buffer-visiting file)
(find-file-noselect file))) (if (and arg (not ...)) (progn
(org-pop-to-buffer-same-window nbuf) (goto-char pos) (org-show-context
...)) (if regionp (progn ... ...) (org-copy-subtree 1 nil t))
(save-current-buffer (set-buffer ...) (setq reversed ...) (save-excursion
...)) (if org-refile-keep nil (if regionp ... ...)) (if (featurep ...)
(progn ...)) (setq org-markers-to-move nil) (message (concat actionmsg " to
\"%s\" in file %s: done") (car it) file)))))))
  org-refile(nil)
  funcall-interactively(org-refile nil)
  #<subr call-interactively>(org-refile nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> org-refile)
  apply(ad-Advice-call-interactively #<subr call-interactively> org-refile)
  call-interactively(org-refile)
  (save-restriction (widen) (goto-char pos) (call-interactively (quote
org-refile)))
  (save-excursion (save-restriction (widen) (goto-char pos)
(call-interactively (quote org-refile))))
  (save-current-buffer (set-buffer (or base (current-buffer)))
(save-excursion (save-restriction (widen) (goto-char pos)
(call-interactively (quote org-refile)))))
  (progn (save-current-buffer (set-buffer (or base (current-buffer)))
(save-excursion (save-restriction (widen) (goto-char pos)
(call-interactively (quote org-refile))))))
  (unwind-protect (progn (save-current-buffer (set-buffer (or base
(current-buffer))) (save-excursion (save-restriction (widen) (goto-char
pos) (call-interactively (quote org-refile)))))) (set-window-configuration
wconfig))
  (let ((wconfig (current-window-configuration))) (unwind-protect (progn
(save-current-buffer (set-buffer (or base (current-buffer)))
(save-excursion (save-restriction (widen) (goto-char pos)
(call-interactively (quote org-refile)))))) (set-window-configuration
wconfig)))
  (let ((pos (point)) (base (buffer-base-buffer (current-buffer)))
(org-capture-is-refiling t) (kill-buffer (org-capture-get :kill-buffer
(quote local)))) (org-capture-put :kill-buffer nil) (org-capture-finalize)
(let ((wconfig (current-window-configuration))) (unwind-protect (progn
(save-current-buffer (set-buffer (or base (current-buffer)))
(save-excursion (save-restriction (widen) (goto-char pos)
(call-interactively ...))))) (set-window-configuration wconfig))) (if
kill-buffer (progn (kill-buffer base))))
  org-capture-refile()
  funcall-interactively(org-capture-refile)
  #<subr call-interactively>(org-capture-refile nil nil)
  ad-Advice-call-interactively(#<subr call-interactively>
org-capture-refile nil nil)
  apply(ad-Advice-call-interactively #<subr call-interactively>
(org-capture-refile nil nil))
  call-interactively(org-capture-refile nil nil)
  command-execute(org-capture-refile)

2016-05-29 23:53 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:

> Hello,
>
> Xebar Saram <zeltakc@gmail.com> writes:
>
> > do you mind guiding me on how to produce the backtrace and ECM, im not
> very
> > technical ;-)
>
> The backtrace is easy: M-x toggle-debug-on-error.
>
> Just make sure you're using an un-compiled Org (you can call
> `org-reload' with a C-u prefix).
>
> The ECM is a minimal document that enables me to reproduce the error. It
> may not be needed if the backtrace is obvious enough, but it doesn't
> hurt to provide it either, if it is simple to create.
>
> Regards,
>
> --
> Nicolas Goaziou
>
>


-- 
Fabrice Popineau
-----------------------------
SUPELEC
Département Informatique
3, rue Joliot Curie
91192 Gif/Yvette Cedex
Tel direct : +33 (0) 169851950
Standard : +33 (0) 169851212
------------------------------

[-- Attachment #2: Type: text/html, Size: 15399 bytes --]

  reply	other threads:[~2016-06-15 19:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-28  7:17 org-refile works but dosent work from within a capture window (org-capture-refile) Xebar Saram
2016-05-28 11:57 ` Nicolas Goaziou
2016-05-28 12:03   ` Xebar Saram
2016-05-29 21:53     ` Nicolas Goaziou
2016-06-15 19:18       ` Fabrice Popineau [this message]
2016-06-16 22:43         ` Nicolas Goaziou
2016-06-17  4:47           ` Fabrice Popineau

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=CAFgFV9ORdrJfqb8BZB6Q8m+9trX+k6h_vMWYjdbDbrui2qU_fQ@mail.gmail.com \
    --to=fabrice.popineau@supelec.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=fabrice.popineau@centralesupelec.fr \
    --cc=zeltakc@gmail.com \
    /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).