emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Error when bulk-refile and org-refile-use-outline-path is 'file [6.36trans]
@ 2010-07-04  8:55 David Maus
  2010-07-05 19:28 ` [PATCH] Don't create marker if target is entire file David Maus
  0 siblings, 1 reply; 5+ messages in thread
From: David Maus @ 2010-07-04  8:55 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1.1: Type: text/plain, Size: 8998 bytes --]


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

When I try to bulk-refile some entries, Emacs throws an error when
starting the refile action.

,----
| Debugger entered--Lisp error: (error "Marker does not point anywhere")
|   goto-char(#<marker in no buffer>)
`----

I've marked the entries (m), called bulk actions (B), chose refile (r)
and a file as target[1]

While trying to debug this situation I found out that this happens if
`org-refile-use-outline-path' is set to 'file -- if it set it to nil,
bulk refiling works.

I've tried to bisect this problem but apparently this problem was
there since bulk actions were introduced (commit 2e3a26ae).

Best,
  -- David

[1] See attached minimal file that I used to bisect the problem (git
bisect run emacs -Q -l bisect-run.el).

Emacs  : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
 of 2010-05-16 on raven, modified by Debian
Package: Org-mode version 6.36trans

current state:
==============
(setq
 org-export-html-final-hook '(org-inlinetask-remove-terminator)
 org-log-done 'time
 org-wl-nntp-prefer-web-links t
 org-export-author-info nil
 org-export-latex-default-class "scrartcl"
 org-clock-in-switch-to-state 'bh/clock-in-to-next
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-todo-keyword-faces '(("MAYBE" :foreground "coral" :weight bold) ("TODO" :foreground "red" :weight bold)
			  ("NEXT" :foreground "orange red" :weight bold) ("WAIT" :foreground "dark red" :weight bold)
			  ("DONE" :foreground "forest green" :weight bold)
			  ("CANCELLED" :foreground "dark gray" :weight bold))
 org-wl-shimbun-prefer-web-links t
 org-agenda-custom-commands '(("r" "Refile new tasks, projects, notes, and references" tags "LEVEL=1+REFILE"
			       ((org-agenda-overriding-header "New tasks, projects, notes, and references")))
			      ("o" "Other tasks" tags-todo "STYLE<>\"habit\"/!TODO"
			       ((org-agenda-skip-function (quote dmj/has-timestamp))
				(org-agenda-overriding-header "Other tasks"))
			       )
			      ("n" "Next actions w/o schedule or deadline" tags-todo "/!NEXT"
			       ((org-agenda-skip-function (quote dmj/has-timestamp))
				(org-agenda-overriding-header "Next actions"))
			       )
			      ("M" "Someday/maybe" tags-todo "/!MAYBE")
			      ("p" "Projects" tags "project" ((org-agenda-overriding-header "Projects")))
			      ("P" "New projects" tags-todo "/!-DONE-CANCELLED"
			       ((org-agenda-overriding-header "New projects")
				(org-agenda-skip-function (quote dmj/skip-non-project)))
			       )
			      ("N" "Notes and references" tags "note"
			       ((org-agenda-overriding-header "Notes and references")))
			      ("R" "Recent" tags-todo "created>=\"<-2d>\""
			       ((org-agenda-overriding-header "Recent (last two days)")))
			      )
 org-agenda-files '("~/org/")
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent org-depend-block-todo)
 org-agenda-tags-column -100
 org-export-ascii-final-hook '(org-inlinetask-remove-terminator)
 org-hide-leading-stars t
 org-clock-into-drawer "CLOCK"
 org-checklist-export-function 'org-export-as-ascii
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current org-checklist)
 org-agenda-todo-ignore-scheduled t
 org-todo-state-tags-triggers '((todo ("note")))
 org-log-state-notes-insert-after-drawers t
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-stuck-projects '("project/-DONE-CANCELLED" ("NEXT") nil nil)
 org-trigger-hook '(org-depend-trigger-todo)
 org-export-preprocess-hook '(org-export-blocks-preprocess)
 org-tags-exclude-from-inheritance '("note" "project")
 org-tab-first-hook '(org-hide-block-toggle-maybe org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-wl-link-remove-filter t
 org-startup-indented t
 org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(D)") (sequence "MAYBE(m)" "WAIT(w@/!)" "|" "CANCELLED(C@)"))
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-default-notes-file "/home/dmaus/org//bucket.org"
 org-directory "/home/dmaus/org/"
 org-habit-graph-column 72
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines
		  org-optimize-window-after-visibility-change)
 org-export-latex-classes '(("scrartcl" "\\documentclass[12pt]{scrartcl}" ("\\section{%s}" . "\\section*{%s}")
			     ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
			     ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
			    ("article" "\\documentclass[11pt]{article}" ("\\section{%s}" . "\\section*{%s}")
			     ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
			     ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
			    ("report" "\\documentclass[11pt]{report}" ("\\part{%s}" . "\\part*{%s}")
			     ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}")
			     ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
			    ("book" "\\documentclass[11pt]{book}" ("\\part{%s}" . "\\part*{%s}")
			     ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}")
			     ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
			    ("beamer" "\\documentclass{beamer}" org-beamer-sectioning))
 org-publish-project-alist '(("ictsoc-base-dyn" :base-directory "~/www/ictsoc.de/src/" :base-extension "org"
			      :publishing-directory "~/www/ictsoc.de/www/" :publishing-function org-publish-org-to-html
			      :author "David Maus" :email "dmaus@ictsoc.de" :author-info t :email-info nil :creator-info t
			      :section-numbers t :sub-superscript nil :recursive t)
			     ("ictsoc-base-stat" :base-directory "~/www/ictsoc.de/src/" :base-extension
			      "css\\|png\\|atom\\|patch" :publishing-directory "~/www/ictsoc.de/www/" :publishing-function
			      org-publish-attachment :recursive t)
			     ("ictsoc-bookmarks" :base-directory "~/.emacs.d/bookmarks/" :base-extension "org"
			      :publishing-directory "~/www/ictsoc.de/www/" :publishing-function org-publish-org-to-html
			      :author "David Maus" :email "dmaus@ictsoc.de" :author-info t :email-info nil :creator-info t
			      :section-numbers t :recursive nil)
			     ("ictsoc" :components ("ictsoc-base-dyn" "ictsoc-base-stat" "ictsoc-bookmarks")))
 org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers)
 org-email-link-description-format "%m"
 org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-show-block-all append local] 5]
		 #[nil "\300\301\302\303\304$\207"
		   [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
		 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-clock-out-remove-zero-time-clocks t
 org-font-lock-hook '(org-inlinetask-fontify)
 org-export-creator-info nil
 org-agenda-ndays 1
 org-refile-targets '((org-agenda-files :maxlevel . 3))
 org-ctrl-c-ctrl-c-hook '(org-babel-lob-execute-maybe org-babel-hash-at-point org-babel-execute-src-block-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-refile-use-outline-path 'file
 org-log-into-drawer "LOGBOOK"
 org-export-interblocks '((lob org-babel-exp-lob-one-liners) (src org-babel-exp-inline-src-blocks))
 org-export-html-style-include-default nil
 org-enforce-todo-dependencies t
 org-refile-allow-creating-parent-nodes 'confirm
 org-occur-hook '(org-first-headline-recenter)
 org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code)
 org-tags-column -100
 org-agenda-todo-ignore-deadlines t
 org-modules '(org-habit org-bbdb org-bibtex org-docview org-gnus org-info org-jsinfo org-irc org-mew org-mhe org-rmail
	       org-vm org-w3m org-wl)
 org-export-preprocess-after-tree-selection-hook '(org-inlinetask-export-handler)
 org-export-docbook-final-hook '(org-inlinetask-remove-terminator)
 org-export-latex-final-hook '(org-inlinetask-remove-terminator org-beamer-amend-header org-beamer-fix-toc
			       org-beamer-auto-fragile-frames org-beamer-place-default-actions-for-lists)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-export-blocks '((src org-babel-exp-src-blocks nil) (comment org-export-blocks-format-comment t)
		     (ditaa org-export-blocks-format-ditaa nil) (dot org-export-blocks-format-dot nil))
 )

[-- Attachment #1.1.2: bisect-run.el --]
[-- Type: application/octet-stream, Size: 1003 bytes --]

(add-to-list 'load-path "~/code/org-mode/git/lisp/")
(add-to-list 'load-path "~/code/org-mode/git/lisp/babel/")
(add-to-list 'load-path "~/code/org-mode/git/lisp/langs/")

(require 'org-install)
(require 'org)

;;; BUG SPECIFIC

(unless (file-directory-p "/tmp/org")
  (make-directory "/tmp/org" t))

(with-current-buffer (find-file-noselect "/tmp/org/inbox.org")
  (erase-buffer)
  (insert "* TODO Headline 1\n\n* TODO Headline 2")
  (save-buffer)
  (kill-buffer))

(with-current-buffer (find-file-noselect "/tmp/org/target.org")
  (erase-buffer)
  (insert "* TARGET")
  (save-buffer)
  (kill-buffer))

(setq org-agenda-files '("/tmp/org"))
(setq org-refile-targets '((org-agenda-files . (:maxlevel . 3))))
(setq org-refile-use-outline-path 'file)

(fset 'agenda-macro
   [?\M-x ?o ?r ?g ?- ?a ?g ?e ?n ?d ?a return ?t down down ?m ?m ?B ?r ?t ?a ?r tab return])

(if (condition-case nil
	(progn
	  (execute-kbd-macro 'agenda-macro)
	  t)
      (error
       nil))
    (kill-emacs 0)
  (kill-emacs 1))

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

* [PATCH] Don't create marker if target is entire file.
  2010-07-04  8:55 Bug: Error when bulk-refile and org-refile-use-outline-path is 'file [6.36trans] David Maus
@ 2010-07-05 19:28 ` David Maus
  2010-07-06  6:17   ` Noorul Islam K M
  2010-07-06  7:01   ` [PATCH] " Carsten Dominik
  0 siblings, 2 replies; 5+ messages in thread
From: David Maus @ 2010-07-05 19:28 UTC (permalink / raw)
  To: emacs-orgmode

* org-agenda.el (org-agenda-bulk-action): Don't create marker for
position if target is entire file.

If the target of a bulk refile operation is the entire file,
`org-refile-get-location' returns nil for the refile position.
Creating a marker for the target file's buffer at position nil returns
a marker that points nowhere (Cf. GNU Emacs Lisp Reference Manual,
31.6).  `org-refile' adds headings to level 1 if the target position
for the target file is nil -- and hence a marker that points nowhere
is not nil, tries to jump to nowhere.
---
 lisp/org-agenda.el |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 4345f06..1fe4639 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7489,11 +7489,12 @@ The prefix arg is passed through to the command if possible."
 		   "Refile to: "
 		   (marker-buffer (car org-agenda-bulk-marked-entries))
 		   org-refile-allow-creating-parent-nodes))
-      (setcar (nthcdr 3 rfloc)
-	      (move-marker (make-marker) (nth 3 rfloc)
-			   (or (get-file-buffer (nth 1 rfloc))
-			       (find-buffer-visiting (nth 1 rfloc))
-			       (error "This should not happen"))))
+      (if (nth 3 rfloc)
+	  (setcar (nthcdr 3 rfloc)
+		  (move-marker (make-marker) (nth 3 rfloc)
+			       (or (get-file-buffer (nth 1 rfloc))
+				   (find-buffer-visiting (nth 1 rfloc))
+				   (error "This should not happen")))))
 
       (setq cmd (list 'org-agenda-refile nil (list 'quote rfloc) t)
 	    redo-at-end t))
-- 
1.7.1

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

* Re: Don't create marker if target is entire file.
  2010-07-05 19:28 ` [PATCH] Don't create marker if target is entire file David Maus
@ 2010-07-06  6:17   ` Noorul Islam K M
  2010-07-06  6:25     ` David Maus
  2010-07-06  7:01   ` [PATCH] " Carsten Dominik
  1 sibling, 1 reply; 5+ messages in thread
From: Noorul Islam K M @ 2010-07-06  6:17 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-orgmode

David Maus <dmaus@ictsoc.de> writes:

> * org-agenda.el (org-agenda-bulk-action): Don't create marker for
> position if target is entire file.
>
> If the target of a bulk refile operation is the entire file,
> `org-refile-get-location' returns nil for the refile position.
> Creating a marker for the target file's buffer at position nil returns
> a marker that points nowhere (Cf. GNU Emacs Lisp Reference Manual,
> 31.6).  `org-refile' adds headings to level 1 if the target position
> for the target file is nil -- and hence a marker that points nowhere
> is not nil, tries to jump to nowhere.


Does this patch fix bulk refile issue that you faced?

Thank you!

Noorul

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

* Re: Don't create marker if target is entire file.
  2010-07-06  6:17   ` Noorul Islam K M
@ 2010-07-06  6:25     ` David Maus
  0 siblings, 0 replies; 5+ messages in thread
From: David Maus @ 2010-07-06  6:25 UTC (permalink / raw)
  To: Noorul Islam K M; +Cc: emacs-orgmode


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

Noorul Islam K M wrote:
>David Maus <dmaus@ictsoc.de> writes:

>> * org-agenda.el (org-agenda-bulk-action): Don't create marker for
>> position if target is entire file.
>>
>> If the target of a bulk refile operation is the entire file,
>> `org-refile-get-location' returns nil for the refile position.
>> Creating a marker for the target file's buffer at position nil returns
>> a marker that points nowhere (Cf. GNU Emacs Lisp Reference Manual,
>> 31.6).  `org-refile' adds headings to level 1 if the target position
>> for the target file is nil -- and hence a marker that points nowhere
>> is not nil, tries to jump to nowhere.


>Does this patch fix bulk refile issue that you faced?

It does; and as soon as the patch is reviewed it might get accepted.

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

* Re: [PATCH] Don't create marker if target is entire file.
  2010-07-05 19:28 ` [PATCH] Don't create marker if target is entire file David Maus
  2010-07-06  6:17   ` Noorul Islam K M
@ 2010-07-06  7:01   ` Carsten Dominik
  1 sibling, 0 replies; 5+ messages in thread
From: Carsten Dominik @ 2010-07-06  7:01 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-orgmode

Applied, thanks.

I am really enjoying how things get resolved now
without me interacting, and all I need to do is to apply
a patch.

Thanks to all who contributed in this thread and in others!

- Carsten

On Jul 5, 2010, at 9:28 PM, David Maus wrote:

> * org-agenda.el (org-agenda-bulk-action): Don't create marker for
> position if target is entire file.
>
> If the target of a bulk refile operation is the entire file,
> `org-refile-get-location' returns nil for the refile position.
> Creating a marker for the target file's buffer at position nil returns
> a marker that points nowhere (Cf. GNU Emacs Lisp Reference Manual,
> 31.6).  `org-refile' adds headings to level 1 if the target position
> for the target file is nil -- and hence a marker that points nowhere
> is not nil, tries to jump to nowhere.
> ---
> lisp/org-agenda.el |   11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index 4345f06..1fe4639 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -7489,11 +7489,12 @@ The prefix arg is passed through to the  
> command if possible."
> 		   "Refile to: "
> 		   (marker-buffer (car org-agenda-bulk-marked-entries))
> 		   org-refile-allow-creating-parent-nodes))
> -      (setcar (nthcdr 3 rfloc)
> -	      (move-marker (make-marker) (nth 3 rfloc)
> -			   (or (get-file-buffer (nth 1 rfloc))
> -			       (find-buffer-visiting (nth 1 rfloc))
> -			       (error "This should not happen"))))
> +      (if (nth 3 rfloc)
> +	  (setcar (nthcdr 3 rfloc)
> +		  (move-marker (make-marker) (nth 3 rfloc)
> +			       (or (get-file-buffer (nth 1 rfloc))
> +				   (find-buffer-visiting (nth 1 rfloc))
> +				   (error "This should not happen")))))
>
>       (setq cmd (list 'org-agenda-refile nil (list 'quote rfloc) t)
> 	    redo-at-end t))
> -- 
> 1.7.1
>
>
> _______________________________________________
> 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] 5+ messages in thread

end of thread, other threads:[~2010-07-06  7:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-04  8:55 Bug: Error when bulk-refile and org-refile-use-outline-path is 'file [6.36trans] David Maus
2010-07-05 19:28 ` [PATCH] Don't create marker if target is entire file David Maus
2010-07-06  6:17   ` Noorul Islam K M
2010-07-06  6:25     ` David Maus
2010-07-06  7:01   ` [PATCH] " Carsten Dominik

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