all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hrvoje Niksic <hniksic@xemacs.org>
Subject: Feature suggestion: thin cursor at end of line
Date: Mon, 31 Oct 2005 17:13:19 +0100	[thread overview]
Message-ID: <877jbtbr6o.fsf@xemacs.org> (raw)

XEmacs has a neat feature that it draws a slightly thinner cursor when
point is at the end of line or buffer.  This subtle visual cue allows
easy detection of whether the point is really at end of line or there
is more whitespace (or otherwise invisible text) after it.

This Lisp code implements a mostly equivalent Lisp-only substitute,
but I'd prefer to see this supported within Emacs itself, so that one
doesn't clutter post-command-hook and so that it works correctly
while, for example, dragging the point with the mouse and in other
situations where post-command-hook is not run.

(defun set-cursor-adaptive ()
  "Make the cursor five pixels wide if it is at end of line or buffer."
  (let ((type (let ((c (char-after (point))))
		(if (or (eq c ?\n) (null c))
		    '(bar . 5)
		  t))))
    (or (equal cursor-type type)
	(progn
	  (setq cursor-type type)
	  (sit-for 0)))))
(add-hook 'post-command-hook 'set-cursor-adaptive)

             reply	other threads:[~2005-10-31 16:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-31 16:13 Hrvoje Niksic [this message]
2005-10-31 20:27 ` Feature suggestion: thin cursor at end of line Eli Zaretskii
2005-11-07 15:34 ` Richard M. Stallman

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=877jbtbr6o.fsf@xemacs.org \
    --to=hniksic@xemacs.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.