emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Exporter interface question
@ 2013-02-27  8:04 Carsten Dominik
  2013-02-27  8:52 ` Nicolas Goaziou
  0 siblings, 1 reply; 16+ messages in thread
From: Carsten Dominik @ 2013-02-27  8:04 UTC (permalink / raw)
  To: Org-mode List

Hi,

I have a question about the exporter dispatcher.

I much appreciate that `C-u C-c C-e' repeats the
previous export action, that is extremely useful.

I often only export a subtree of a document, and I
was wondering if others would also find this proposal
useful:

When exporting a subtree, lets drop a mark at the
headline and then go to this mark when C-c C-e is
called with a prefix arguments.  This would allow
to keep the cursor somewhere deep in the subtree while
working on it, and still be able to quickly repeat the
export command.

If others would find this useful, I'd make a patch.

- Carsten

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

* Re: Exporter interface question
  2013-02-27  8:04 Exporter interface question Carsten Dominik
@ 2013-02-27  8:52 ` Nicolas Goaziou
  2013-02-27 12:00   ` Carsten Dominik
  2013-02-27 15:02   ` Carsten Dominik
  0 siblings, 2 replies; 16+ messages in thread
From: Nicolas Goaziou @ 2013-02-27  8:52 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org-mode List

Hello,

Carsten Dominik <carsten.dominik@gmail.com> writes:

> I much appreciate that `C-u C-c C-e' repeats the
> previous export action, that is extremely useful.
>
> I often only export a subtree of a document, and I
> was wondering if others would also find this proposal
> useful:
>
> When exporting a subtree, lets drop a mark at the
> headline and then go to this mark when C-c C-e is
> called with a prefix arguments.  This would allow
> to keep the cursor somewhere deep in the subtree while
> working on it, and still be able to quickly repeat the
> export command.

It would be nice indeed.

Though, it may be useful to put some additional limitations to this
feature. For example, it would trigger only when on the same buffer as
before, perhaps even within the same subtree.

What do you think about it?

> If others would find this useful, I'd make a patch.

Be my guest. ;)


Regards,

-- 
Nicolas Goaziou

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

* Re: Exporter interface question
  2013-02-27  8:52 ` Nicolas Goaziou
@ 2013-02-27 12:00   ` Carsten Dominik
  2013-02-27 12:25     ` Suvayu Ali
  2013-02-27 15:02   ` Carsten Dominik
  1 sibling, 1 reply; 16+ messages in thread
From: Carsten Dominik @ 2013-02-27 12:00 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-mode List


On 27.2.2013, at 09:52, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Hello,
> 
> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> I much appreciate that `C-u C-c C-e' repeats the
>> previous export action, that is extremely useful.
>> 
>> I often only export a subtree of a document, and I
>> was wondering if others would also find this proposal
>> useful:
>> 
>> When exporting a subtree, lets drop a mark at the
>> headline and then go to this mark when C-c C-e is
>> called with a prefix arguments.  This would allow
>> to keep the cursor somewhere deep in the subtree while
>> working on it, and still be able to quickly repeat the
>> export command.
> 
> It would be nice indeed.
> 
> Though, it may be useful to put some additional limitations to this
> feature. For example, it would trigger only when on the same buffer as
> before, perhaps even within the same subtree.

Yes, this is possible.  I'll look into it.

- Carsten

> 
> What do you think about it?
> 
>> If others would find this useful, I'd make a patch.
> 
> Be my guest. ;)
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou

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

* Re: Exporter interface question
  2013-02-27 12:00   ` Carsten Dominik
@ 2013-02-27 12:25     ` Suvayu Ali
  0 siblings, 0 replies; 16+ messages in thread
From: Suvayu Ali @ 2013-02-27 12:25 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, Feb 27, 2013 at 01:00:30PM +0100, Carsten Dominik wrote:
> 
> On 27.2.2013, at 09:52, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> 
> > Carsten Dominik <carsten.dominik@gmail.com> writes:
> > 
> >> When exporting a subtree, lets drop a mark at the
> >> headline and then go to this mark when C-c C-e is
> >> called with a prefix arguments.  This would allow
> >> to keep the cursor somewhere deep in the subtree while
> >> working on it, and still be able to quickly repeat the
> >> export command.
> > 
> > It would be nice indeed.
> > 
> > Though, it may be useful to put some additional limitations to this
> > feature. For example, it would trigger only when on the same buffer as
> > before, perhaps even within the same subtree.
> 
> Yes, this is possible.  I'll look into it.

I love the idea, including Nicolas' proposed restrictions.  Until now I
was defining keyboard macros for this.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Exporter interface question
  2013-02-27  8:52 ` Nicolas Goaziou
  2013-02-27 12:00   ` Carsten Dominik
@ 2013-02-27 15:02   ` Carsten Dominik
  2013-02-27 15:22     ` Nicolas Goaziou
  1 sibling, 1 reply; 16+ messages in thread
From: Carsten Dominik @ 2013-02-27 15:02 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-mode List


On 27.2.2013, at 09:52, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Hello,
> 
> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> I much appreciate that `C-u C-c C-e' repeats the
>> previous export action, that is extremely useful.
>> 
>> I often only export a subtree of a document, and I
>> was wondering if others would also find this proposal
>> useful:
>> 
>> When exporting a subtree, lets drop a mark at the
>> headline and then go to this mark when C-c C-e is
>> called with a prefix arguments.  This would allow
>> to keep the cursor somewhere deep in the subtree while
>> working on it, and still be able to quickly repeat the
>> export command.
> 
> It would be nice indeed.
> 
> Though, it may be useful to put some additional limitations to this
> feature. For example, it would trigger only when on the same buffer as
> before, perhaps even within the same subtree.
> 
> What do you think about it?
> 
>> If others would find this useful, I'd make a patch.
> 
> Be my guest. ;)

OK, I see that this is a bit less trivial then I thought, requires that I study the ui interface a bit more.  If you want to rush ahead and implement it let me know - otherwise this will be a few days before I find the time.

- Carsten

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

* Re: Exporter interface question
  2013-02-27 15:02   ` Carsten Dominik
@ 2013-02-27 15:22     ` Nicolas Goaziou
  2013-02-28  8:39       ` Carsten Dominik
  0 siblings, 1 reply; 16+ messages in thread
From: Nicolas Goaziou @ 2013-02-27 15:22 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org-mode List

Carsten Dominik <carsten.dominik@gmail.com> writes:

> OK, I see that this is a bit less trivial then I thought, requires
> that I study the ui interface a bit more. 

I think the only pieces of the UI involved are `org-export-dispatch'
function and `org-export-dispatch-last-action' variable.

> If you want to rush ahead and implement it let me know - otherwise
> this will be a few days before I find the time.

There's no hurry. It can wait a few days.

Thank you for looking into it.


Regards,

-- 
Nicolas Goaziou

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

* Re: Exporter interface question
  2013-02-27 15:22     ` Nicolas Goaziou
@ 2013-02-28  8:39       ` Carsten Dominik
  2013-02-28  9:05         ` Carsten Dominik
  2013-02-28 10:22         ` Nicolas Goaziou
  0 siblings, 2 replies; 16+ messages in thread
From: Carsten Dominik @ 2013-02-28  8:39 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-mode List


On 27.2.2013, at 16:22, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> OK, I see that this is a bit less trivial then I thought, requires
>> that I study the ui interface a bit more. 
> 
> I think the only pieces of the UI involved are `org-export-dispatch'
> function and `org-export-dispatch-last-action' variable.
> 
>> If you want to rush ahead and implement it let me know - otherwise
>> this will be a few days before I find the time.
> 
> There's no hurry. It can wait a few days.

OK, I pushed this change, maybe it is good if you have a brief look, Nicolas.
It was great fun and educational to study your very clear code.

Cheers

- Carsten

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

* Re: Exporter interface question
  2013-02-28  8:39       ` Carsten Dominik
@ 2013-02-28  9:05         ` Carsten Dominik
  2013-02-28 10:22         ` Nicolas Goaziou
  1 sibling, 0 replies; 16+ messages in thread
From: Carsten Dominik @ 2013-02-28  9:05 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-mode List


On 28.2.2013, at 09:39, Carsten Dominik <carsten.dominik@gmail.com> wrote:

> 
> On 27.2.2013, at 16:22, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> 
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>> 
>>> OK, I see that this is a bit less trivial then I thought, requires
>>> that I study the ui interface a bit more. 
>> 
>> I think the only pieces of the UI involved are `org-export-dispatch'
>> function and `org-export-dispatch-last-action' variable.
>> 
>>> If you want to rush ahead and implement it let me know - otherwise
>>> this will be a few days before I find the time.
>> 
>> There's no hurry. It can wait a few days.
> 
> OK, I pushed this change, maybe it is good if you have a brief look, Nicolas.
> It was great fun and educational to study your very clear code.

Sorry for following up on my own post.  I forgot to mention that
I did put in the restriction to make this work only if the export
command is called in the same buffer.  However, I am not checking
if the cursor is in the same subtree - it seems to me that the
behavior would become too unpredictable.

Also, I have not yet documented the change in the manual, of course.

- Carsten

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

* Re: Exporter interface question
  2013-02-28  8:39       ` Carsten Dominik
  2013-02-28  9:05         ` Carsten Dominik
@ 2013-02-28 10:22         ` Nicolas Goaziou
  2013-02-28 11:50           ` Carsten Dominik
  1 sibling, 1 reply; 16+ messages in thread
From: Nicolas Goaziou @ 2013-02-28 10:22 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org-mode List

Hello,

Carsten Dominik <carsten.dominik@gmail.com> writes:

> OK, I pushed this change, maybe it is good if you have a brief look,
> Nicolas.

Thanks for the patch. It looks good. I have one minor suggestion,
though. In the following snippet:

  (eq (marker-buffer org-export-dispatch-last-position)
  		   (current-buffer))

wouldn't it be better to check equality with:

  (org-base-buffer (current-buffer))

instead or simply (current-buffer)?

> It was great fun and educational to study your very clear code.

Thank you. 


Regards,

-- 
Nicolas Goaziou

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

* Re: Exporter interface question
  2013-02-28 10:22         ` Nicolas Goaziou
@ 2013-02-28 11:50           ` Carsten Dominik
  2013-02-28 12:30             ` Nicolas Goaziou
  0 siblings, 1 reply; 16+ messages in thread
From: Carsten Dominik @ 2013-02-28 11:50 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-mode List


On 28.2.2013, at 11:22, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Hello,
> 
> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> OK, I pushed this change, maybe it is good if you have a brief look,
>> Nicolas.
> 
> Thanks for the patch. It looks good. I have one minor suggestion,
> though. In the following snippet:
> 
>  (eq (marker-buffer org-export-dispatch-last-position)
>  		   (current-buffer))
> 
> wouldn't it be better to check equality with:
> 
>  (org-base-buffer (current-buffer))
> 
> instead or simply (current-buffer)?

I agree, but I think then also setting the mark need to take care to set the mark in the base buffer. Will do this.

- Carsten

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

* Re: Exporter interface question
  2013-02-28 11:50           ` Carsten Dominik
@ 2013-02-28 12:30             ` Nicolas Goaziou
  2013-02-28 18:52               ` Carsten Dominik
  0 siblings, 1 reply; 16+ messages in thread
From: Nicolas Goaziou @ 2013-02-28 12:30 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org-mode List

Carsten Dominik <carsten.dominik@gmail.com> writes:

> I agree, but I think then also setting the mark need to take care to
> set the mark in the base buffer. Will do this.

AFAICT, this is not necessary. Indirect buffers share markers with base
buffer.


Regards,

-- 
Nicolas Goaziou

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

* Re: Exporter interface question
  2013-02-28 12:30             ` Nicolas Goaziou
@ 2013-02-28 18:52               ` Carsten Dominik
  2013-02-28 21:10                 ` Nicolas Goaziou
  0 siblings, 1 reply; 16+ messages in thread
From: Carsten Dominik @ 2013-02-28 18:52 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-mode List


On 28.2.2013, at 13:30, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> I agree, but I think then also setting the mark need to take care to
>> set the mark in the base buffer. Will do this.
> 
> AFAICT, this is not necessary. Indirect buffers share markers with base
> buffer.

I think it is necessary.  If I move a marker to a position
in a buffer and another marker to the same position in a connected
indirect buffer, both markers are different and point to different
buffers.  So if I start an export from an indirect buffer, the
dispatch marker will point to the indirect buffer.  If I later
compare the marker-buffer with (org-base-buffer (current-buffer)) I
do get a mismatch.  So if you want to compare to org-base-buffer,
I think I clearly need to set the marker to a position in the base
buffer.

Regards

- Carsten

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

* Re: Exporter interface question
  2013-02-28 18:52               ` Carsten Dominik
@ 2013-02-28 21:10                 ` Nicolas Goaziou
  2013-03-04  9:17                   ` Carsten Dominik
  0 siblings, 1 reply; 16+ messages in thread
From: Nicolas Goaziou @ 2013-02-28 21:10 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org-mode List

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On 28.2.2013, at 13:30, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>> 
>>> I agree, but I think then also setting the mark need to take care to
>>> set the mark in the base buffer. Will do this.
>> 
>> AFAICT, this is not necessary. Indirect buffers share markers with base
>> buffer.
>
> I think it is necessary.  If I move a marker to a position
> in a buffer and another marker to the same position in a connected
> indirect buffer, both markers are different and point to different
> buffers.  So if I start an export from an indirect buffer, the
> dispatch marker will point to the indirect buffer.  If I later
> compare the marker-buffer with (org-base-buffer (current-buffer)) I
> do get a mismatch.  So if you want to compare to org-base-buffer,
> I think I clearly need to set the marker to a position in the base
> buffer.

Then what about comparing base buffer for both entities?


Regards,

-- 
Nicolas Goaziou

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

* Re: Exporter interface question
  2013-02-28 21:10                 ` Nicolas Goaziou
@ 2013-03-04  9:17                   ` Carsten Dominik
  2013-03-04 14:45                     ` Nicolas Goaziou
  0 siblings, 1 reply; 16+ messages in thread
From: Carsten Dominik @ 2013-03-04  9:17 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-mode List


On 28.2.2013, at 22:10, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> On 28.2.2013, at 13:30, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>> 
>>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>> 
>>>> I agree, but I think then also setting the mark need to take care to
>>>> set the mark in the base buffer. Will do this.
>>> 
>>> AFAICT, this is not necessary. Indirect buffers share markers with base
>>> buffer.
>> 
>> I think it is necessary.  If I move a marker to a position
>> in a buffer and another marker to the same position in a connected
>> indirect buffer, both markers are different and point to different
>> buffers.  So if I start an export from an indirect buffer, the
>> dispatch marker will point to the indirect buffer.  If I later
>> compare the marker-buffer with (org-base-buffer (current-buffer)) I
>> do get a mismatch.  So if you want to compare to org-base-buffer,
>> I think I clearly need to set the marker to a position in the base
>> buffer.
> 
> Then what about comparing base buffer for both entities?

That would be the alternative, right.  Do you think this would be preferred to what I am doing right now?

- Carsten

> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou

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

* Re: Exporter interface question
  2013-03-04  9:17                   ` Carsten Dominik
@ 2013-03-04 14:45                     ` Nicolas Goaziou
  2013-03-04 19:21                       ` Carsten Dominik
  0 siblings, 1 reply; 16+ messages in thread
From: Nicolas Goaziou @ 2013-03-04 14:45 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org-mode List

Hello,

Carsten Dominik <carsten.dominik@gmail.com> writes:

>> Then what about comparing base buffer for both entities?
>
> That would be the alternative, right.  Do you think this would be
> preferred to what I am doing right now?

I didn't realize you had already modified the code. I think both methods
are equivalent.

Thank you again.


Regards,

-- 
Nicolas Goaziou

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

* Re: Exporter interface question
  2013-03-04 14:45                     ` Nicolas Goaziou
@ 2013-03-04 19:21                       ` Carsten Dominik
  0 siblings, 0 replies; 16+ messages in thread
From: Carsten Dominik @ 2013-03-04 19:21 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-mode List

OK, great.

- Carsten

On 4.3.2013, at 15:45, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Hello,
> 
> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>>> Then what about comparing base buffer for both entities?
>> 
>> That would be the alternative, right.  Do you think this would be
>> preferred to what I am doing right now?
> 
> I didn't realize you had already modified the code. I think both methods
> are equivalent.
> 
> Thank you again.
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou

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

end of thread, other threads:[~2013-03-04 19:22 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-27  8:04 Exporter interface question Carsten Dominik
2013-02-27  8:52 ` Nicolas Goaziou
2013-02-27 12:00   ` Carsten Dominik
2013-02-27 12:25     ` Suvayu Ali
2013-02-27 15:02   ` Carsten Dominik
2013-02-27 15:22     ` Nicolas Goaziou
2013-02-28  8:39       ` Carsten Dominik
2013-02-28  9:05         ` Carsten Dominik
2013-02-28 10:22         ` Nicolas Goaziou
2013-02-28 11:50           ` Carsten Dominik
2013-02-28 12:30             ` Nicolas Goaziou
2013-02-28 18:52               ` Carsten Dominik
2013-02-28 21:10                 ` Nicolas Goaziou
2013-03-04  9:17                   ` Carsten Dominik
2013-03-04 14:45                     ` Nicolas Goaziou
2013-03-04 19:21                       ` 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).