* Re: Keeping column when up/down
2016-12-11 17:34 Keeping column when up/down Andreas Röhler
@ 2016-12-11 17:33 ` tomas
2016-12-11 18:45 ` Andreas Röhler
2016-12-11 17:36 ` Eli Zaretskii
1 sibling, 1 reply; 11+ messages in thread
From: tomas @ 2016-12-11 17:33 UTC (permalink / raw)
To: Andreas Röhler; +Cc: Help Gnu Emacs mailing list
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sun, Dec 11, 2016 at 06:34:59PM +0100, Andreas Röhler wrote:
> Hi,
>
> would like to keep the column at start when C-p resp. C-n
>
> Tweaking previous-line?
Is perhaps set-goal-column what you're looking for?
regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlhNjd4ACgkQBcgs9XrR2kbw6ACfewk51jOWBjsnKRtvT7nmvZzL
dj4AnAr9+yI+KYuORVaf/QtxAWN1YEGM
=BPqV
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 11+ messages in thread
* Keeping column when up/down
@ 2016-12-11 17:34 Andreas Röhler
2016-12-11 17:33 ` tomas
2016-12-11 17:36 ` Eli Zaretskii
0 siblings, 2 replies; 11+ messages in thread
From: Andreas Röhler @ 2016-12-11 17:34 UTC (permalink / raw)
To: Help Gnu Emacs mailing list
Hi,
would like to keep the column at start when C-p resp. C-n
Tweaking previous-line?
Thanks,
Andreas
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Keeping column when up/down
2016-12-11 17:34 Keeping column when up/down Andreas Röhler
2016-12-11 17:33 ` tomas
@ 2016-12-11 17:36 ` Eli Zaretskii
2016-12-11 18:43 ` Andreas Röhler
1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-12-11 17:36 UTC (permalink / raw)
To: help-gnu-emacs
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> Date: Sun, 11 Dec 2016 18:34:59 +0100
>
> would like to keep the column at start when C-p resp. C-n
>
> Tweaking previous-line?
Happens by default here.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Keeping column when up/down
2016-12-11 17:36 ` Eli Zaretskii
@ 2016-12-11 18:43 ` Andreas Röhler
2016-12-11 18:44 ` Eli Zaretskii
0 siblings, 1 reply; 11+ messages in thread
From: Andreas Röhler @ 2016-12-11 18:43 UTC (permalink / raw)
To: help-gnu-emacs
On 11.12.2016 18:36, Eli Zaretskii wrote:
>> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
>> Date: Sun, 11 Dec 2016 18:34:59 +0100
>>
>> would like to keep the column at start when C-p resp. C-n
>>
>> Tweaking previous-line?
> Happens by default here.
>
Hallo Eli,
sorry, don't understand your answer. Cursor travels goal-column of EOL
if shorter.
Andreas
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Keeping column when up/down
2016-12-11 18:43 ` Andreas Röhler
@ 2016-12-11 18:44 ` Eli Zaretskii
2016-12-11 19:58 ` Andreas Röhler
0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-12-11 18:44 UTC (permalink / raw)
To: help-gnu-emacs
> Cc: Eli Zaretskii <eliz@gnu.org>
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> Date: Sun, 11 Dec 2016 19:43:53 +0100
>
> >> would like to keep the column at start when C-p resp. C-n
> >>
> >> Tweaking previous-line?
> > Happens by default here.
>
> Hallo Eli,
>
> sorry, don't understand your answer. Cursor travels goal-column of EOL
> if shorter.
And what did you want it to do instead? There's no text beyond EOL.
(Your OP didn't mention EOL at all.)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Keeping column when up/down
2016-12-11 17:33 ` tomas
@ 2016-12-11 18:45 ` Andreas Röhler
2016-12-11 18:46 ` Eli Zaretskii
0 siblings, 1 reply; 11+ messages in thread
From: Andreas Röhler @ 2016-12-11 18:45 UTC (permalink / raw)
To: tomas; +Cc: Help Gnu Emacs mailing list
On 11.12.2016 18:33, tomas@tuxteam.de wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sun, Dec 11, 2016 at 06:34:59PM +0100, Andreas Röhler wrote:
>> Hi,
>>
>> would like to keep the column at start when C-p resp. C-n
>>
>> Tweaking previous-line?
> Is perhaps set-goal-column what you're looking for?
>
>
As goal-column is used otherwise too, seems not recommendable to change
it WRT a vertical move.
AFAIU a tweak must keep the original value and restore it after move.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Keeping column when up/down
2016-12-11 18:45 ` Andreas Röhler
@ 2016-12-11 18:46 ` Eli Zaretskii
2016-12-11 19:46 ` Andreas Röhler
0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-12-11 18:46 UTC (permalink / raw)
To: help-gnu-emacs
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> Date: Sun, 11 Dec 2016 19:45:53 +0100
> Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
>
> As goal-column is used otherwise too, seems not recommendable to change
> it WRT a vertical move.
There's temporary-goal-column as well.
(Not that I understand how this is related to the original question,
since vertical motion tries to keep the column by default.)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Keeping column when up/down
2016-12-11 18:46 ` Eli Zaretskii
@ 2016-12-11 19:46 ` Andreas Röhler
2016-12-11 20:30 ` Eli Zaretskii
0 siblings, 1 reply; 11+ messages in thread
From: Andreas Röhler @ 2016-12-11 19:46 UTC (permalink / raw)
To: help-gnu-emacs
On 11.12.2016 19:46, Eli Zaretskii wrote:
>> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
>> Date: Sun, 11 Dec 2016 19:45:53 +0100
>> Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
>>
>> As goal-column is used otherwise too, seems not recommendable to change
>> it WRT a vertical move.
> There's temporary-goal-column as well.
>
> (Not that I understand how this is related to the original question,
> since vertical motion tries to keep the column by default.)
>
Here it travels goal-column, when set.
Keeps column when goal-column is nil.
Looks like a bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Keeping column when up/down
2016-12-11 18:44 ` Eli Zaretskii
@ 2016-12-11 19:58 ` Andreas Röhler
0 siblings, 0 replies; 11+ messages in thread
From: Andreas Röhler @ 2016-12-11 19:58 UTC (permalink / raw)
To: help-gnu-emacs
On 11.12.2016 19:44, Eli Zaretskii wrote:
>> Hallo Eli,
>> sorry, don't understand your answer. Cursor travels goal-column of EOL
>> if shorter.
> And what did you want it to do instead? There's no text beyond EOL.
>
> (Your OP didn't mention EOL at all.)
>
There was a typo, please read: travels goal-column or EOL.
EOL makes sense at empty lines. It also would make sense when line is
shorter than column-at-start.
OTOH goal-colum seems unrelated to vertical move.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Keeping column when up/down
2016-12-11 19:46 ` Andreas Röhler
@ 2016-12-11 20:30 ` Eli Zaretskii
2016-12-11 21:24 ` Andreas Röhler
0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-12-11 20:30 UTC (permalink / raw)
To: help-gnu-emacs
> Cc: Eli Zaretskii <eliz@gnu.org>
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> Date: Sun, 11 Dec 2016 20:46:36 +0100
>
> Keeps column when goal-column is nil.
>
> Looks like a bug.
No, it's a feature (assuming I understood what you are complaining
about; sorry if I didn't).
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Keeping column when up/down
2016-12-11 20:30 ` Eli Zaretskii
@ 2016-12-11 21:24 ` Andreas Röhler
0 siblings, 0 replies; 11+ messages in thread
From: Andreas Röhler @ 2016-12-11 21:24 UTC (permalink / raw)
To: help-gnu-emacs
On 11.12.2016 21:30, Eli Zaretskii wrote:
>> Cc: Eli Zaretskii <eliz@gnu.org>
>> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
>> Date: Sun, 11 Dec 2016 20:46:36 +0100
>>
>> Keeps column when goal-column is nil.
>>
>> Looks like a bug.
> No, it's a feature (assuming I understood what you are complaining
> about; sorry if I didn't).
>
Thought at something like that:
(defun ar-previous-line (arg)
"Moving ARG upwards.
Keep the column if possible. "
(interactive "^p")
(unless (bobp)
(let ((col
(if
(eq last-command 'ar-previous-line)
ar-vertical-move-start-column
(setq ar-vertical-move-start-column (current-column)))))
(previous-line arg arg)
(when (< col (save-excursion (end-of-line) (current-column)))
(move-to-column col)))))
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-12-11 21:24 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-11 17:34 Keeping column when up/down Andreas Röhler
2016-12-11 17:33 ` tomas
2016-12-11 18:45 ` Andreas Röhler
2016-12-11 18:46 ` Eli Zaretskii
2016-12-11 19:46 ` Andreas Röhler
2016-12-11 20:30 ` Eli Zaretskii
2016-12-11 21:24 ` Andreas Röhler
2016-12-11 17:36 ` Eli Zaretskii
2016-12-11 18:43 ` Andreas Röhler
2016-12-11 18:44 ` Eli Zaretskii
2016-12-11 19:58 ` Andreas Röhler
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).