🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by XIAO Yan Fri, 19 Jun 1992 04:46
Changing shape/color of cursorS according to buffer/mode
#1247
Author: XIAO Yan
Date: Fri, 19 Jun 1992 04:46
77 lines
3231 bytes
Want to do:
	Changing cursor/glyph shapes/colors according to buffer
	and mode
Questions:
	Possible?
	Done before?
	Why my solution is so poor?
Key problems for me:
	1. within one screen, MOUSE cursor shape does not change
	      with window change
	2. within one window, MOUSE cursor shape does not change
	      with buffer change
	3. TEXT cursor does not change cursor immediately but after
	      a TEXT cursor movement.
Background:
I am an ex-vi user and of course I stick to VIP package, 
with occasionally epoch mode.  
One problem in use is to keep track what mode I am in:
	insert-mode
	vi-mode
	emacs-mode
(please don't say "you stupid!! Why not look at the modeline") 

As my vision is mostly around TEXT cursor or MOUSE cursor glyph,
I am thinking of change the color of TEXT cursor, 
             and change the shape of MOUSE cursor.

Achieved/Problems: 
	1. Within one window, switching among mode will
	   change the color of TEXT cursor, but I have to
	   move the TEXT cursor to activate the color
	   change.  (Example: in vi-mode, "o" and "a" will
	   change the color right away. But \C-Z doesn't)
	2. MOUSE cursor changes withing one window according
	   to mode change, but not across window and buffer.
My attempt:
	See below
	
Xiao
<xiaoy@bullet.ecf.utoronto.ca>
	
(defun cursor-to-emacs()
  "change TEXT cursor's color and MOUSE cursor according to  emacs mode"
  (cursor-glyph 60) 			; hand
  (epoch::cursor-color "purple"   )  	; sexy color to match epoch
  )

(defun cursor-to-vi()
  "change TEXT cursor's color and MOUSE cursor according to  vi mode"
  (cursor-glyph 22) 			; arrow up
  (epoch::cursor-color "blue"   )	; safe color for vi command mode
  )

(defun cursor-to-insert()
 "change TEXT cursor's color and MOUSE cursor according to  vi insert mode"
	(cursor-glyph 152)		; A Mac style "I" cursor
	(epoch::cursor-color "red"   )	; what you type is what you get!!
	)


(defun vip-change-mode-to-vi ()
  "Change mode to vi mode. Modified VIP function"
  (interactive)
  (cursor-to-vi)			; Added line
  (vip-change-mode 'vi-mode))

(defun vip-change-mode-to-insert ()
  "Change mode to insert mode. Modified VIP function"
  (interactive)
  (cursor-to-insert)			; Added line
  (vip-change-mode 'insert-mode))

(defun vip-change-mode-to-emacs ()
  "Change mode to emacs mode. Modified VIP function"
  (interactive)
  (cursor-to-emacs)			; Added line
  (vip-change-mode 'emacs-mode))
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads