[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-26 Thread Bastien
Hi Stefan,

Stefan Monnier monn...@iro.umontreal.ca writes:

 IOW, if needed we could wrap the calls to bookmark-set in
 with-demoted-errors, but maybe those errors are signaled late enough
 already that while the command signals an error, it did do what it was
 expected to do.

I've now wrapped calls to `bookmark-set' within `with-demoted-errors'
in Org, the capture and the refile processes will not be stopped by
corrupted bookmark files.

I'm now closing this bug.

Thanks,

-- 
 Bastien





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-25 Thread Jonathan Schaeffer

Le 24/10/2012 17:09, Drew Adams a écrit :


But AFAIK an empty bookmark file should not present any problems for Emacs (for
bookmark handling, at least, and I would hope for Org mode and anything else
too).

Yes, you have a point here.

I tested again the Org refile function in 3 cases :
- no bookmarks file
- an empty bookmarks file
- changed the ownership of the file so that the user has no rights to 
write the bookmarks file


And it behaves gently in the 3 cases.

But I'm positive about the fact that the error disapeared when I removed 
an empty bookmarks files.


Maybe Glenn could tell how he was able to corrupt his bookmarks file ?

jonathan
--
IUEM - Service Informatique
rue Dumont D'Urville
Technopôle Brest-Iroise
29280 Plouzané
France
tel: +33 2 98 49 87 94





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-25 Thread Glenn Morris
Jonathan Schaeffer wrote:

 Maybe Glenn could tell how he was able to corrupt his bookmarks file ?

I intentionally added junk to it.





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-24 Thread Jonathan Schaeffer

Le 23/10/2012 18:24, Glenn Morris a écrit :


I found a way to reproduce this: have a corrupt bookmarks file.
Check the contents of your bookmark-default-file. Try (re)moving it.

Wonderfull.
I had an empty ~/.emacs.d/bookmarks file.
I removed it and the problem is gone.

Thanks a lot for your help.


Perhaps Org could trap and report such errors more gracefully.

The error message makes sense ... as soon as you know where the problem 
comes from :)


cheers,

Jonathan

PS. I'm kind of new to emacs, and use orgmode intensively now, and it's 
my first emacs bug report. Your reactivity is realy great, I appreciate it.


--
IUEM - Service Informatique
rue Dumont D'Urville
Technopôle Brest-Iroise
29280 Plouzané
France
tel: +33 2 98 49 87 94





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-24 Thread Bastien
Hi Jonathan,

Jonathan Schaeffer jonathan.schaef...@univ-brest.fr writes:

 Perhaps Org could trap and report such errors more gracefully.

 The error message makes sense ... as soon as you know where the problem
 comes from :)

I enhanced the error message, which now says to save the buffer in a
file when refiling to the current non-file buffer.

(Reporting an error when the bookmark format is corrupted is left to
the bookmark library.)

I'm closing this bug now.

Thanks for reporting this!

-- 
 Bastien





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-24 Thread Stefan Monnier
 I found a way to reproduce this: have a corrupt bookmarks file.
 Check the contents of your bookmark-default-file. Try (re)moving it.
 Wonderfull.
 I had an empty ~/.emacs.d/bookmarks file.
 I removed it and the problem is gone.

Hmm... it would be good if Emacs were a bit more helpful here by
maybe including the bookmark file name in the error.

 The error message makes sense ... as soon as you know where the problem
 comes from :)

Also, while it's good to signal to the user that his bookmark file is
corrupted (and to make sure we don't overwrite it with something else),
I don't see why that should prevent Org's Refile from working.


Stefan





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-24 Thread Drew Adams
  I found a way to reproduce this: have a corrupt bookmarks file.
  Check the contents of your bookmark-default-file. Try 
  (re)moving it.
  Wonderfull. I had an empty ~/.emacs.d/bookmarks file.
  I removed it and the problem is gone.
 
 Hmm... it would be good if Emacs were a bit more helpful here by
 maybe including the bookmark file name in the error.
 
  The error message makes sense ... as soon as you know where 
  the problem comes from :)
 
 Also, while it's good to signal to the user that his bookmark file
 is corrupted (and to make sure we don't overwrite it with 
 something else), I don't see why that should prevent Org's
 Refile from working.

Sorry, I have not been following this thread - excuse me if I misunderstand.

But AFAIK an empty bookmark file should not present any problems for Emacs (for
bookmark handling, at least, and I would hope for Org mode and anything else
too).

Is that really what the problem was - an empty bookmark file was interpreted (by
something) as a corrupt bookmark file?  If so, that in itself sounds like a bug,
to me.

I use Bookmark+, but I would guess that vanilla bookmark.el too handles the
existence of an empty bookmark file with no problem.  If not, that would be the
first thing to fix, I would think.

(Again, ignore if I've misunderstood.)






[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-24 Thread Bastien
Hi Stefan,

Stefan Monnier monn...@iro.umontreal.ca writes:

 The error message makes sense ... as soon as you know where the problem
 comes from :)

 Also, while it's good to signal to the user that his bookmark file is
 corrupted (and to make sure we don't overwrite it with something else),
 I don't see why that should prevent Org's Refile from working.

By default, org-refile and org-capture store bookmarks to the last
refiled/captured Org headline.  (There is org-capture-bookmark in
case users want to deactivate this for captured headlines.)

We could skip this step in Org in case the bookmark format is
corrupted, or have a more informative message that makes clear to 
the user that Org tries to store a bookmark.

What do you think?

-- 
 Bastien





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-24 Thread Stefan Monnier
 The error message makes sense ... as soon as you know where the problem
 comes from :)
 Also, while it's good to signal to the user that his bookmark file is
 corrupted (and to make sure we don't overwrite it with something else),
 I don't see why that should prevent Org's Refile from working.
 By default, org-refile and org-capture store bookmarks to the last
 refiled/captured Org headline.  (There is org-capture-bookmark in
 case users want to deactivate this for captured headlines.)
 We could skip this step in Org in case the bookmark format is
 corrupted, or have a more informative message that makes clear to 
 the user that Org tries to store a bookmark.

I don't know the details of what happens currently when the bookmark file is
corrupted but at least such an occurrence shouldn't prevent org-refile
from working (tho obviously in a degraded way).

IOW, if needed we could wrap the calls to bookmark-set in
with-demoted-errors, but maybe those errors are signaled late enough
already that while the command signals an error, it did do what it was
expected to do.


Stefan





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-23 Thread Glenn Morris
Jonathan Schaeffer wrote:

 (I made a reply all, is that alright ?)

Yes, that's the right thing to do.

 with emacs -Q, I can not reproduce the bug. But refile does not work
 at all, (Complains : wrong type argument arrayp,nil).
 I do :
 1. emacs -Q
 2. C-x C-f refiletest.org
 3. Fill the buffer with :
 * Entry One
 * Entry Two
 ** Refile Me

 4. Hit C-c C-w
 5. The entry is duplicated and I can read the error message Not
 bookmark format)

Sorry, this works fine for me with Emacs 24.2. Maybe someone who
actually uses Org will step in and help...

 If, instead of visiting a file, I open just a new buffer with C-x b
 test.org, the behaviour is different :
 On refile (C-c C-w) nothing happens but the error message shows:
 wrong type argument: arrayp, nil

This doesn't make sense to me; because just doing `C-x b test.org' creates
a buffer in fundamental mode, where C-c C-w is not bound to any key.

It seems like your Emacs must be customized in some way, even with
`emacs -Q'...

 I hope this helps. I have the archlinux build of emacs, so maybe the
 error is on the packaging side ?





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-23 Thread Jonathan Schaeffer

Le 22/10/2012 18:15, Glenn Morris a écrit :

Jonathan Schaeffer wrote:


To reproduce :

Create a .org file, create 2 level-1 entries. Create one level-2 entry
and hit C-c C-w to refile it into the other level-1 entry.

Like this :

* Entry One
* Entry Two
** Refile Me

The level-2 entry is copied in the correct location but is not removed
from original location.
Minibuffer shows message Not Bookmark Format. And the file looks like :


Thanks for the report, but it works fine for me with Emacs 24.2.
Can you give a complete recipe starting from emacs -Q?


Hi Glenn,

(I made a reply all, is that alright ?)

with emacs -Q, I can not reproduce the bug. But refile does not work at 
all, (Complains : wrong type argument arrayp,nil).

I do :
1. emacs -Q
2. C-x C-f refiletest.org
3. Fill the buffer with :
* Entry One
* Entry Two
** Refile Me

4. Hit C-c C-w
5. The entry is duplicated and I can read the error message Not 
bookmark format)


If, instead of visiting a file, I open just a new buffer with C-x b 
test.org, the behaviour is different :

On refile (C-c C-w) nothing happens but the error message shows:
wrong type argument: arrayp, nil

Just to be sure, I moved the ~/.emacs away, same result.

I hope this helps. I have the archlinux build of emacs, so maybe the 
error is on the packaging side ?


cheers,

jonathan

--
IUEM - Service Informatique
rue Dumont D'Urville
Technopôle Brest-Iroise
29280 Plouzané
France
tel: +33 2 98 49 87 94





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-23 Thread Jonathan Schaeffer

Le 23/10/2012 09:50, Glenn Morris a écrit :

Jonathan Schaeffer wrote:


If, instead of visiting a file, I open just a new buffer with C-x b
test.org, the behaviour is different :
On refile (C-c C-w) nothing happens but the error message shows:
wrong type argument: arrayp, nil


This doesn't make sense to me; because just doing `C-x b test.org' creates
a buffer in fundamental mode, where C-c C-w is not bound to any key.
Sorry, I missed a step : I manualy load the org-mode mode (Alt-x 
org-mode) before doing anything in the buffer.

This might be an orgmode bug, from what I read on the internet.


It seems like your Emacs must be customized in some way, even with
`emacs -Q'...

I'll submit a post on Archlinux forum to see if someone can reproduce this.

jonathan

--
IUEM - Service Informatique
rue Dumont D'Urville
Technopôle Brest-Iroise
29280 Plouzané
France
tel: +33 2 98 49 87 94





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-23 Thread Bastien
Hi Jonathan,

Jonathan Schaeffer jonathan.schaef...@univ-brest.fr writes:

 I'll submit a post on Archlinux forum to see if someone can reproduce
 this.

You can also try reporting your problem to the emacs-orgmode mailing
list: https://lists.gnu.org/mailman/listinfo/emacs-orgmode

There are some ArchLinux Org-mode users there.

-- 
 Bastien





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-23 Thread Glenn Morris
Bastien wrote:

 You can also try reporting your problem to the emacs-orgmode mailing
 list: https://lists.gnu.org/mailman/listinfo/emacs-orgmode

It's already there, since I reassigned this bug.
http://lists.gnu.org/archive/html/emacs-orgmode/2012-10/msg00563.html





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-23 Thread Glenn Morris
Jonathan Schaeffer wrote:

 Sorry, I missed a step : I manualy load the org-mode mode (Alt-x 
 org-mode) before doing anything in the buffer.
 This might be an orgmode bug, from what I read on the internet.

I can reproduce that in Emacs 24.2 and current trunk.

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  file-truename(nil)
  find-buffer-visiting(nil)
  org-refile-check-position((#(Entry One 0 9 (face org-level-1 fontified t))
  org-refile-get-location(Refile subtree \Refile Me\ to nil nil nil)
  org-refile(nil)
  call-interactively(org-refile nil nil)


org-refile-check-position does not handle being called from a buffer not
visiting a file.

(Still no idea about the original issue.)





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-23 Thread Glenn Morris
Jonathan Schaeffer wrote:

 To reproduce :

 Create a .org file, create 2 level-1 entries. Create one level-2 entry
 and hit C-c C-w to refile it into the other level-1 entry.

 Like this :

 * Entry One
 * Entry Two
 ** Refile Me

 The level-2 entry is copied in the correct location but is not removed
 from original location.
 Minibuffer shows message Not Bookmark Format. And the file looks like :

 * Entry One
 ** Refile Me
 * Entry Two
 ** Refile Me

I found a way to reproduce this: have a corrupt bookmarks file.
Check the contents of your bookmark-default-file. Try (re)moving it.

Perhaps Org could trap and report such errors more gracefully.





[O] bug#12702: 24.2; Orgmode Refile complains Not bookmark format

2012-10-22 Thread Glenn Morris
Jonathan Schaeffer wrote:

 To reproduce :

 Create a .org file, create 2 level-1 entries. Create one level-2 entry
 and hit C-c C-w to refile it into the other level-1 entry.

 Like this :

 * Entry One
 * Entry Two
 ** Refile Me

 The level-2 entry is copied in the correct location but is not removed
 from original location.
 Minibuffer shows message Not Bookmark Format. And the file looks like :

Thanks for the report, but it works fine for me with Emacs 24.2.
Can you give a complete recipe starting from emacs -Q?