emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Follow link scrolls current buffer when table aligns
Date: Thu, 17 Jan 2013 19:40:15 +0100	[thread overview]
Message-ID: <CALn3zogy9iXs8E+X7VnZaxErjEbbYEsqSRM5ojmQPo4Ko8HfuA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]

(continued from bug-gnu-emacs@gnu.org:
“find-file-noselect scrolls current buffer”
http://lists.gnu.org/archive/html/bug-gnu-emacs/2013-01/msg00619.html )

Hi all

On Thu, Jan 17, 2013 at 12:10 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
> I.e. use
>   M-: (add-hook 'text-mode-hook (lambda () (goto-char (point-max))))

I changed my code for the org-mode-hook accordingly to resolve the
first issue related with using end-of-buffer.

This change uncovers a second scroll issue, this time caused by
set-window-start used in org-table-align. The scroll happens in an Org
buffer under some circumstances when a link to an other Org mode
buffer with a table alignment is followed. The first time when the
target file is opened by find-file-noselect, org-table-align is called
and its set-window-start is the reason for the scroll in the original
buffer.

Minimal test to reproduce:
1) put the attached n.org and t.org into one directory
2) emacs -q
3) C-x 3
4) open n.org
5) M->, C-p, C-c C-o
The last step changes the scroll state of n.org but the return value
of window-start is expected be the same before and after.

How can org-table-align be changed that set-window-start affects only
the visited target buffer but not the original buffer which called
find-file-noselect to follow its link?

Michael

[-- Attachment #2: n.org --]
[-- Type: application/octet-stream, Size: 320 bytes --]

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
[[file:t.org::*table]]

[-- Attachment #3: t.org --]
[-- Type: application/octet-stream, Size: 725 bytes --]

#+STARTUP: align
* table
  | bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla |
  | bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla |
  | bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla |
  | bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla |
  | bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla |
  | bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla |
  | bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla |
  | bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla |
  | bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla |
  | bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla |

             reply	other threads:[~2013-01-17 18:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17 18:40 Michael Brand [this message]
2013-02-16 13:13 ` Follow link scrolls current buffer when table aligns Bastien
2013-02-16 14:19   ` Michael Brand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALn3zogy9iXs8E+X7VnZaxErjEbbYEsqSRM5ojmQPo4Ko8HfuA@mail.gmail.com \
    --to=michael.ch.brand@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).