emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-map-entries moves point
@ 2014-02-05 19:49 Florian Beck
  2014-02-05 20:59 ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Beck @ 2014-02-05 19:49 UTC (permalink / raw)
  To: Org Mode List

When I call org-map-entries with scope set to 'tree, the current heading 
gets realigned to the top.

Behold:

(org-map-entries (lambda ()
		   ;; do something or even nothing
		   ) nil 'tree)

I think the culprit is the call to `org-agenda-prepare-buffers', or 
rather commit fe3379bda6ca23474639b114592958bf14431c88, which replaces 
save-excursion with save-window-excursion.

What's interesting: This does NOT restore the window configuration. When 
I replace save-window-excursion with save-excursion the window 
configuration is restored again.

I'm not sure *why* this happens.


-- 
Florian Beck

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

* Re: org-map-entries moves point
  2014-02-05 19:49 org-map-entries moves point Florian Beck
@ 2014-02-05 20:59 ` Nick Dokos
  2014-02-05 22:10   ` Florian Beck
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2014-02-05 20:59 UTC (permalink / raw)
  To: emacs-orgmode

Florian Beck <fb@miszellen.de> writes:

> When I call org-map-entries with scope set to 'tree, the current
> heading gets realigned to the top.
>
> Behold:
>
> (org-map-entries (lambda ()
> 		   ;; do something or even nothing
> 		   ) nil 'tree)
>
> I think the culprit is the call to `org-agenda-prepare-buffers', or
> rather commit fe3379bda6ca23474639b114592958bf14431c88, which replaces
> save-excursion with save-window-excursion.
>
> What's interesting: This does NOT restore the window
> configuration. When I replace save-window-excursion with
> save-excursion the window configuration is restored again.
>
> I'm not sure *why* this happens.

John Kitchin reported this last week and Bastien reverted that commit:

  http://thread.gmane.org/gmane.emacs.orgmode/81587

But it's not clear *why* that commit was done in the first place so if
you get some enlightenment from your experiments, please share.

Nick

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

* Re: org-map-entries moves point
  2014-02-05 20:59 ` Nick Dokos
@ 2014-02-05 22:10   ` Florian Beck
  2014-02-05 23:00     ` Nick Dokos
  2014-02-05 23:30     ` Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: Florian Beck @ 2014-02-05 22:10 UTC (permalink / raw)
  To: Nick Dokos, emacs-orgmode

On 05.02.2014 21:59, Nick Dokos wrote:

> John Kitchin reported this last week and Bastien reverted that commit:
>
>    http://thread.gmane.org/gmane.emacs.orgmode/81587

Missed that. But this reverts commit
3ec38f5c064c3270f54876ba33c5ca1097b46853 [1] (in org-map-entries)

I was talking about
fe3379bda6ca23474639b114592958bf14431c88 [2] (which did the same to 
org-agenda-prepare-buffer)

In fact, the revert *caused* my bug. Again, the recipe:

The bug doesn't really move the point, rather it recenters the current 
line. To see it, move into the middle of a document, unfold a second 
level headline and in the middle of the window execute

(org-map-entries (lambda ()
            ;; do something or even nothing
            ) nil 'tree)

This works correctly if either commit [1] is restored or [2] is reverted.


> But it's not clear *why* that commit was done in the first place so if
> you get some enlightenment from your experiments, please share.

Will do.

>
> Nick
>
>
>


-- 
Florian Beck

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

* Re: org-map-entries moves point
  2014-02-05 22:10   ` Florian Beck
@ 2014-02-05 23:00     ` Nick Dokos
  2014-02-05 23:30     ` Bastien
  1 sibling, 0 replies; 5+ messages in thread
From: Nick Dokos @ 2014-02-05 23:00 UTC (permalink / raw)
  To: emacs-orgmode

Florian Beck <fb@miszellen.de> writes:

> On 05.02.2014 21:59, Nick Dokos wrote:
>
>> John Kitchin reported this last week and Bastien reverted that commit:
>>
>>    http://thread.gmane.org/gmane.emacs.orgmode/81587
>
> Missed that. But this reverts commit
> 3ec38f5c064c3270f54876ba33c5ca1097b46853 [1] (in org-map-entries)
>
> I was talking about
> fe3379bda6ca23474639b114592958bf14431c88 [2] (which did the same to
> org-agenda-prepare-buffer)
>
> In fact, the revert *caused* my bug. Again, the recipe:
>
> The bug doesn't really move the point, rather it recenters the current
> line. To see it, move into the middle of a document, unfold a second
> level headline and in the middle of the window execute
>
> (org-map-entries (lambda ()
>            ;; do something or even nothing
>            ) nil 'tree)
>
> This works correctly if either commit [1] is restored or [2] is reverted.
>
>
Does all of [2] have to be reverted? Or can save-window-excursion be
changed back to save-excursion? AFAICT, the rest of the fix is
independent of that.

-- 
Nick

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

* Re: org-map-entries moves point
  2014-02-05 22:10   ` Florian Beck
  2014-02-05 23:00     ` Nick Dokos
@ 2014-02-05 23:30     ` Bastien
  1 sibling, 0 replies; 5+ messages in thread
From: Bastien @ 2014-02-05 23:30 UTC (permalink / raw)
  To: Florian Beck; +Cc: Nick Dokos, emacs-orgmode

Hi Florian,

Florian Beck <fb@miszellen.de> writes:

> Missed that. But this reverts commit
> 3ec38f5c064c3270f54876ba33c5ca1097b46853 [1] (in org-map-entries)
>
> I was talking about
> fe3379bda6ca23474639b114592958bf14431c88 [2] (which did the same to
> org-agenda-prepare-buffer)
>
> In fact, the revert *caused* my bug. Again, the recipe:
>
> The bug doesn't really move the point, rather it recenters the current
> line. To see it, move into the middle of a document, unfold a second
> level headline and in the middle of the window execute
>
> (org-map-entries (lambda ()
>            ;; do something or even nothing
>            ) nil 'tree)
>
> This works correctly if either commit [1] is restored or [2] is
> reverted.

I partially revert [2] (only replacing `save-window-excursion' by
`save-excursion') and didn't touch [1] -- if we can produce a bug
from there, let's fix it the right way this time.

Thanks in advance for digging further,

-- 
 Bastien

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

end of thread, other threads:[~2014-02-05 23:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-05 19:49 org-map-entries moves point Florian Beck
2014-02-05 20:59 ` Nick Dokos
2014-02-05 22:10   ` Florian Beck
2014-02-05 23:00     ` Nick Dokos
2014-02-05 23:30     ` Bastien

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