all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug: org-capture - org-vm store link requires buffer file not always present [7.4]
@ 2011-02-09  3:35 Arik Mitschang
  2011-02-09 16:19 ` Bastien
  2011-02-12 18:40 ` Bastien
  0 siblings, 2 replies; 4+ messages in thread
From: Arik Mitschang @ 2011-02-09  3:35 UTC (permalink / raw)
  To: emacs-orgmode

In VM if you have created a virtual folder, the buffer is not associated
with any file. However, during org-capture a function called
org-vm-store-link requires that the buffer (the vm folder in this case)
be associated with a file causing a type-mismatch error. I can fix the
problem with the following patch:

----------------------------------
diff -U3 /usr/local/share/emacs/23.2/site-lisp/org-vm.el /var/folders/Qm/Qm3iuPk7E18cewjBO5PgL5AVPiY/-Tmp-/buffer-content-66395kXL
--- /usr/local/share/emacs/23.2/site-lisp/org-vm.el	2010-12-11 00:16:33.000000000 +1100
+++ /var/folders/Qm/Qm3iuPk7E18cewjBO5PgL5AVPiY/-Tmp-/buffer-content-66395kXL	2011-02-09 14:27:35.000000000 +1100
@@ -54,8 +54,12 @@
 ;; Implementation
 (defun org-vm-store-link ()
   "Store a link to a VM folder or message."
-  (when (or (eq major-mode 'vm-summary-mode)
+  (when (and (or (eq major-mode 'vm-summary-mode)
 	    (eq major-mode 'vm-presentation-mode))
+			 (save-excursion (vm-select-folder-buffer)
+							 (eq (type-of buffer-file-name)
+							 'string)))
     (and (eq major-mode 'vm-presentation-mode) (vm-summarize))
     (vm-follow-summary-cursor)
     (save-excursion
----------------------------------

Thanks
Arik

Emacs  : GNU Emacs 23.2.1 (x86_64-apple-darwin10.5.0, X toolkit)
 of 2011-01-14 on IT-4064.local
Package: Org-mode version 7.4

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

* Re: Bug: org-capture - org-vm store link requires buffer file not always present [7.4]
  2011-02-09  3:35 Bug: org-capture - org-vm store link requires buffer file not always present [7.4] Arik Mitschang
@ 2011-02-09 16:19 ` Bastien
  2011-02-12 18:40 ` Bastien
  1 sibling, 0 replies; 4+ messages in thread
From: Bastien @ 2011-02-09 16:19 UTC (permalink / raw)
  To: Arik Mitschang; +Cc: emacs-orgmode

Hi Arik,

Arik Mitschang <arik.mitschang@mq.edu.au> writes:

> In VM if you have created a virtual folder, the buffer is not associated
> with any file. However, during org-capture a function called
> org-vm-store-link requires that the buffer (the vm folder in this case)
> be associated with a file causing a type-mismatch error. I can fix the
> problem with the following patch:

This looks fine to me, but I'm not using VM.  

Can some VM user double-check this?

> ----------------------------------
> diff -U3 /usr/local/share/emacs/23.2/site-lisp/org-vm.el /var/folders/Qm/Qm3iuPk7E18cewjBO5PgL5AVPiY/-Tmp-/buffer-content-66395kXL
> --- /usr/local/share/emacs/23.2/site-lisp/org-vm.el	2010-12-11 00:16:33.000000000 +1100
> +++ /var/folders/Qm/Qm3iuPk7E18cewjBO5PgL5AVPiY/-Tmp-/buffer-content-66395kXL	2011-02-09 14:27:35.000000000 +1100
> @@ -54,8 +54,12 @@
>  ;; Implementation
>  (defun org-vm-store-link ()
>    "Store a link to a VM folder or message."
> -  (when (or (eq major-mode 'vm-summary-mode)
> +  (when (and (or (eq major-mode 'vm-summary-mode)
>  	    (eq major-mode 'vm-presentation-mode))
> +			 (save-excursion (vm-select-folder-buffer)
> +							 (eq (type-of buffer-file-name)
> +							 'string)))

(Better use (stringp buffer-file-name) instead of type-of.)

-- 
 Bastien

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

* Re: Bug: org-capture - org-vm store link requires buffer file not always present [7.4]
  2011-02-09  3:35 Bug: org-capture - org-vm store link requires buffer file not always present [7.4] Arik Mitschang
  2011-02-09 16:19 ` Bastien
@ 2011-02-12 18:40 ` Bastien
       [not found]   ` <19800.33799.716636.291461@nobunaga.local>
  1 sibling, 1 reply; 4+ messages in thread
From: Bastien @ 2011-02-12 18:40 UTC (permalink / raw)
  To: Arik Mitschang; +Cc: emacs-orgmode

Hi Arik,

Arik Mitschang <arik.mitschang@mq.edu.au> writes:

> In VM if you have created a virtual folder, the buffer is not associated
> with any file. However, during org-capture a function called
> org-vm-store-link requires that the buffer (the vm folder in this case)
> be associated with a file causing a type-mismatch error. I can fix the
> problem with the following patch:

I've now impemented a slightly different solution - please test and
report any problem.

Thanks for proposing the patch,

-- 
 Bastien

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

* Re: Bug: org-capture - org-vm store link requires buffer file not always present [7.4]
       [not found]   ` <19800.33799.716636.291461@nobunaga.local>
@ 2011-02-14 10:15     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2011-02-14 10:15 UTC (permalink / raw)
  To: Arik Mitschang; +Cc: emacs-orgmode

Hi Arik,

Arik Mitschang <arik.mitschang@mq.edu.au> writes:

> Unfortunately that does not do the trick. Two reasons:
>
> 1) the vm-select-folder-buffer only triggers an error if there is no
>    folder buffer, not if there is no file associated with that buffer.
>
> 2) raising an error stops the execution of the org-capture which
>    results in the same problem - one will not be able to capture while
>    visiting this "virtual" folder. Such a restriction is not practical
>    or useful.

Thanks for the explanations.

> Here is a patch that works on that change, if the style is not
> satisfactory that's okay, but the spirit of the change is there.

I've applied a slightly different patch that should do the trick in a
simpler way.  Please test it and report any problem.

Thanks!

-- 
 Bastien

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

end of thread, other threads:[~2011-02-14 10:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-09  3:35 Bug: org-capture - org-vm store link requires buffer file not always present [7.4] Arik Mitschang
2011-02-09 16:19 ` Bastien
2011-02-12 18:40 ` Bastien
     [not found]   ` <19800.33799.716636.291461@nobunaga.local>
2011-02-14 10:15     ` Bastien

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.