emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* undo-tree and Org visibility
@ 2013-02-27 16:52 Samuel Wales
  2013-02-27 17:22 ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel Wales @ 2013-02-27 16:52 UTC (permalink / raw)
  To: emacs-orgmode

When I went back and forth with undo-tree, Org did not show the same
visibility that it did during each stage, so I added this defadvice.
What it does is make everything visible.

(defadvice undo-tree-undo (after org-undo-reveal activate compile)
  "Make point and context visible after an undo command in org-mode."
  (alpha-org-reveal-for-undo))
;;might be nec, not sure why
(defadvice undo-tree-redo (after org-undo-reveal activate compile)
  "Make point and context visible after an undo command in org-mode."
  (alpha-org-reveal-for-undo))
(defun alpha-org-reveal-for-undo ()
  (when (and (eq major-mode 'org-mode)
             (outline-invisible-p))
     (org-reveal t)))

However, this is also confusing, because I often move headlines, and
revealing everything takes up the whole screen.  Therefore it is not
possible to show where the headline was moved to or from.

What I want is for Org to show the same visibility that it did originally.

Is this possible to do efficiently, and if not, can Emacs be changed
to support it in the next version?

Thanks.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is no hope without action.

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

* Re: undo-tree and Org visibility
  2013-02-27 16:52 undo-tree and Org visibility Samuel Wales
@ 2013-02-27 17:22 ` Bastien
  2013-02-27 17:58   ` Samuel Wales
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2013-02-27 17:22 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Samuel,

Samuel Wales <samologist@gmail.com> writes:

> When I went back and forth with undo-tree, Org did not show the same
> visibility that it did during each stage, so I added this defadvice.
> What it does is make everything visible.

My suggestion here is to use M-x show-all RET (or Org cycling) 
before playing around with `undo-tree-undo' or `undo-tree-visualize'.

You will then have a clear view of what is un-done,
without the need to worry about the visibility state.

-- 
 Bastien

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

* Re: undo-tree and Org visibility
  2013-02-27 17:22 ` Bastien
@ 2013-02-27 17:58   ` Samuel Wales
  2013-02-27 22:35     ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel Wales @ 2013-02-27 17:58 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hi Bastien,

On 2/27/13, Bastien <bzg@altern.org> wrote:
> My suggestion here is to use M-x show-all RET (or Org cycling)
> before playing around with `undo-tree-undo' or `undo-tree-visualize'.
>
> You will then have a clear view of what is un-done,
> without the need to worry about the visibility state.

Correct me if I'm wrong, but M-x show-all is equivalent to my
defadvice (even worse because it shows more).  Cycling will work
initially, but that will change as soon as some changes in body text
forces revealing that entry.

Finally, this requires careful consideration of when to do undo and
redo, and preparation beforehand, while I'd prefer those to be
natural, quick operations that do not require setting visibility
manually first.

The "clear view" is only a clear view if you have all of the headlines
showing.  They will not show unless you have a very tall screen or
very small fonts or a very small amount of body text.

If you do not show the following headlines because the body text is
too long, then you cannot easily tell that the operation was a move.

Not saying anybody is interested, but I wanted to make the problem clear.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is no hope without action.

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

* Re: undo-tree and Org visibility
  2013-02-27 17:58   ` Samuel Wales
@ 2013-02-27 22:35     ` Bastien
  2013-02-28  7:01       ` Samuel Wales
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2013-02-27 22:35 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Hi Samuel,

Samuel Wales <samologist@gmail.com> writes:

> Correct me if I'm wrong, but M-x show-all is equivalent to my
> defadvice (even worse because it shows more).  Cycling will work
> initially, but that will change as soon as some changes in body text
> forces revealing that entry.

What I suggest is a less convoluted version of your advice,
where you would call `show-all' as a "before" advice for
undo-tree-undo.

Maybe Toby (the author of undo-tree) is reading the thread
and has been thinking about interactions between undo-tree
and the visibility state of the buffer.

-- 
 Bastien

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

* Re: undo-tree and Org visibility
  2013-02-27 22:35     ` Bastien
@ 2013-02-28  7:01       ` Samuel Wales
  2013-02-28  7:46         ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel Wales @ 2013-02-28  7:01 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

On 2/27/13, Bastien <bzg@altern.org> wrote:
> What I suggest is a less convoluted version of your advice,
> where you would call `show-all' as a "before" advice for
> undo-tree-undo.

Ah, I thought you meant manually.

Still, I thought (org-reveal t) not to be convoluted, but to show the
minimal amount, which is the best workaround I know of.  Is that not
the case?

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is no hope without action.

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

* Re: undo-tree and Org visibility
  2013-02-28  7:01       ` Samuel Wales
@ 2013-02-28  7:46         ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2013-02-28  7:46 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Hi Samuel,

Samuel Wales <samologist@gmail.com> writes:

> Still, I thought (org-reveal t) not to be convoluted, but to show the
> minimal amount, which is the best workaround I know of.  Is that not
> the case?

Yes it is, and org-reveal will not display wrong ellispsis at the top
of the window anymore.  If you find it does, please report it.

Thanks,

-- 
 Bastien

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

end of thread, other threads:[~2013-02-28  7:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27 16:52 undo-tree and Org visibility Samuel Wales
2013-02-27 17:22 ` Bastien
2013-02-27 17:58   ` Samuel Wales
2013-02-27 22:35     ` Bastien
2013-02-28  7:01       ` Samuel Wales
2013-02-28  7:46         ` 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).