help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Application of 'cursor-type.


From: Heime
Subject: Application of 'cursor-type.
Date: Sat, 30 Nov 2024 00:12:43 +0000

I am having difficulty understanding the application of 'cursor-type.

I want to call the function on the current buffer to change the cursor 
form upon the buffer I am working with.  I use set-default which affects
those buffers which do not have local binding of 'cursor-type.  But how
would I know whether there is a local binding or not?  If there is a local
binding and want to change it, would one use setq instead.

How would the implementation change?

(defun paulatuk-cursor-form (actm)

  (interactive
    (list
      (let ( (cseq '("bar" "hbar" "hollow" "box")) )
        (completing-read " Cursor Form: " cseq nil t "box"))))

  (let ( (actn (if (stringp actm) (intern actm) actm)))

    (cond
      ((eq actn 'bar)     (set-default 'cursor-type 'bar))
      ((eq actn 'hbar)    (set-default 'cursor-type 'hbar))
      ((eq actn 'hollow)  (set-default 'cursor-type 'hollow))
      ((eq actn 'box)     (set-default 'cursor-type 'box))
      (t
         (message "cupola-cursor-form")
         (message " └── Cursor Form: Invalid")
         (message " └── Got: %s" actn)
         (message " └── Choice: 'bar, 'hbar, 'hollow, 'box "))) ))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]