From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: Narrow cursor at end of line? Date: Sun, 10 Jan 2010 03:20:44 +0100 Organization: Informatimago Message-ID: <87wrzqpuo3.fsf@hubble.informatimago.com> References: <87eilzvygz.fsf@topper.koldfront.dk> <871vhzqb39.fsf@hubble.informatimago.com> <87ocl3t2fz.fsf@topper.koldfront.dk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1263091255 32142 80.91.229.12 (10 Jan 2010 02:40:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2010 02:40:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 10 03:40:48 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NTnjR-0001ck-Oe for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Jan 2010 03:40:46 +0100 Original-Received: from localhost ([127.0.0.1]:41928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTnjS-0003C0-BO for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Jan 2010 21:40:46 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-X-Trace: individual.net zxJQXIQuuuKFJicOZrKPrQNScvVJhnVlYj92K5X126vENiQhsD Cancel-Lock: sha1:MTNhMmFiMzBiZDZjMjdmZTdlOWI2MjU4NjJiOWJmYmY2YmEzNTFmYQ== sha1:OOX8WnYvXJMSotronGHTbl2dkKI= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.101 (Gnus v5.10.10) Emacs/22.3 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:176029 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71142 Archived-At: 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/