[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using `save-window-excursion' instead of `save-excursion' for `comme
From: |
Bastien |
Subject: |
Re: Using `save-window-excursion' instead of `save-excursion' for `comment-region'? |
Date: |
Fri, 06 Dec 2013 10:49:17 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
> I think your analysis is exactly right, and the reason why
> save-window-excursion doesn't exhibit the problem is because
> save-window-excursion does not save-excursion in the current buffer.
> I.e. paradoxically it's because it "preserves less" rather than because
> it "preserves more". Replacing the save-excursion with
> save-current-buffer would probably work as well.
I see, thanks.
I've fixed the problem in Org by creating `org-comment-dwim',
which use comment-dwim when outside a source block, and
`org-babel-do-in-edit-buffer' (directly, not wrapped into
comment-region) when the point is within a buffer.
Aaron, thanks for your input and for testing this heavily.
--
Bastien