emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug (?) adding attachment to note in remember buffer
@ 2008-11-17 16:20 Robert Goldman
  2008-11-18  7:59 ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Goldman @ 2008-11-17 16:20 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

When I try to add an attachment to a note in the remember buffer, I get
an error that looks like this:

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  file-truename(nil)
  byte-code(xxxxx [org-id-locations list locs file id nil file-truename
throw exit t] 3)
  org-id-add-location("xvsc3fr01ge0@sift.info" nil)
  org-id-get(353 t)
  org-attach-dir(t)
  org-attach-attach("~/Desktop/hold-notification.eml" nil)
  call-interactively(org-attach-attach)
  org-attach()
  call-interactively(org-attach)

[sorry about the byte-code-garble]

This is on the latest version, pulled from git this morning.

Clearly what's wrong is the call to org-id-add-location with NIL as the
FILE argument.  That's the proximal cause.  The root cause seems to be
that when we call (buffer-file-name (buffer-base-buffer)) inside a
buffer created by org-remember, it returns nil (buffer-base-buffer is nil).

This suggests that the org-attachment code needs a special way of
handling attachment placement when it's invoked inside remember.

A short-term fix might be to use advice to intercept calls to org-attach
when invoked inside a remember buffer and have it raise an error and
tell you to wait until the remember note has been filed before adding an
attachment.

[as an aside, this whole mess is caused because I have no way to create
an org link to an email from Thunderbird, so I have to handle all my
email-related tasks through attachments.  Grrrr....]

An alternative would be to have org-id-get handle remember buffers
specially.  org-remember has some default location for putting its new
item, and that could presumably be looked up.  However, given that one
has the possibility of changing the destination of the note, this would
have to be handled carefully.  If (a) org-refile handles relocating
attachments correctly and (b) the code in org-remember for handling,
e.g., C-1 C-c C-c. uses the org-refile code; then this should be
relatively easy to handle.

Best,
Robert

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

end of thread, other threads:[~2008-11-18  9:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-17 16:20 Bug (?) adding attachment to note in remember buffer Robert Goldman
2008-11-18  7:59 ` Carsten Dominik
2008-11-18  9:08   ` 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).