From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: Narrow cursor at end of line?
Date: Sun, 10 Jan 2010 03:20:44 +0100 [thread overview]
Message-ID: <87wrzqpuo3.fsf@hubble.informatimago.com> (raw)
In-Reply-To: 87ocl3t2fz.fsf@topper.koldfront.dk
asjo@koldfront.dk (Adam Sjøgren) writes:
> On Sat, 09 Jan 2010 21:26:02 +0100, Pascal wrote:
>
>> asjo@koldfront.dk (Adam Sjøgren) writes:
>
>>> XEmacs indicates that point is at the end of a line by making the cursor
>>> slightly less wide. How do I make GNU Emacs do the same?
>
>> I guess you could change the cursor-type when it's at the end of line.
>> See the variable: cursor-type
>
> Ah, nice - thanks for the pointer.
>
> I guess what I want to do is to have cursor-type set to (bar . 6) at the
> end of the line and t otherwise. Perhaps something like:
>
> (defun asjo-indicate-end-of-line ()
> "Change the cursor to a narrow one when at the end of line"
> (if (eq (point) (line-end-position))
> (setq cursor-type '(bar . 6))
> (setq cursor-type t)))
>
> I would need a hook called every time point is moved (or any time it is
> moved to/from end of line) or add an advice to something, I guess?
>
> I have looked though the list found with M-x apropos hook, but couldn't
> really a good candidate...
You can do that after a command is executed: post-command-hook
--
__Pascal Bourguignon__ http://www.informatimago.com/
next prev parent reply other threads:[~2010-01-10 2:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-09 20:02 Narrow cursor at end of line? Adam Sjøgren
2010-01-09 20:26 ` Pascal J. Bourguignon
2010-01-09 21:04 ` Adam Sjøgren
2010-01-10 2:20 ` Pascal J. Bourguignon [this message]
2010-01-10 12:55 ` Adam Sjøgren
2010-01-10 6:47 ` Lennart Borgman
2010-01-11 16:46 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wrzqpuo3.fsf@hubble.informatimago.com \
--to=pjb@informatimago.com \
--cc=help-gnu-emacs@gnu.org \
/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 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.