all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* What's the hook that's about cursor movement?
@ 2016-04-29  9:01 Shiyao Ma
  2016-04-29 11:16 ` Phillip Lord
  0 siblings, 1 reply; 3+ messages in thread
From: Shiyao Ma @ 2016-04-29  9:01 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I want to add a function to a hook to achieve effect that, whenever the
cursors moves by K lines, or goes to another buffer, then center the cursor
on the screen.


So, what's the related hook?


Regards

-- 

吾輩は猫である。ホームーページはhttps://introo.me <http://introo.me>。


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

* Re: What's the hook that's about cursor movement?
  2016-04-29  9:01 What's the hook that's about cursor movement? Shiyao Ma
@ 2016-04-29 11:16 ` Phillip Lord
  2016-04-29 12:26   ` Andreas Röhler
  0 siblings, 1 reply; 3+ messages in thread
From: Phillip Lord @ 2016-04-29 11:16 UTC (permalink / raw)
  To: Shiyao Ma; +Cc: help-gnu-emacs

Shiyao Ma <i@introo.me> writes:

> Hi,
>
> I want to add a function to a hook to achieve effect that, whenever the
> cursors moves by K lines, or goes to another buffer, then center the cursor
> on the screen.
>
>
> So, what's the related hook?


I'm not sure that there is one directly -- post-command-hook is called
after any command, though which covers all of the things that you have
mentioned (but also others).

Phil



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

* Re: What's the hook that's about cursor movement?
  2016-04-29 11:16 ` Phillip Lord
@ 2016-04-29 12:26   ` Andreas Röhler
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Röhler @ 2016-04-29 12:26 UTC (permalink / raw)
  To: help-gnu-emacs



On 29.04.2016 13:16, Phillip Lord wrote:
> Shiyao Ma <i@introo.me> writes:
>
>> Hi,
>>
>> I want to add a function to a hook to achieve effect that, whenever the
>> cursors moves by K lines, or goes to another buffer, then center the cursor
>> on the screen.
>>
>>
>> So, what's the related hook?
>
> I'm not sure that there is one directly -- post-command-hook is called
> after any command, though which covers all of the things that you have
> mentioned (but also others).
>
> Phil

Just to add: as beacon-mode deals with similar issues, the stuff at the 
end of beacon.el should provide some hints:

https://github.com/Malabarba/beacon/blob/master/beacon.el




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

end of thread, other threads:[~2016-04-29 12:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-29  9:01 What's the hook that's about cursor movement? Shiyao Ma
2016-04-29 11:16 ` Phillip Lord
2016-04-29 12:26   ` Andreas Röhler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.