unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Application of 'cursor-type.
@ 2024-11-30  0:12 Heime via Users list for the GNU Emacs text editor
  2024-12-05  2:43 ` Joel Reicher
  0 siblings, 1 reply; 2+ messages in thread
From: Heime via Users list for the GNU Emacs text editor @ 2024-11-30  0:12 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

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 "))) ))





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Application of 'cursor-type.
  2024-11-30  0:12 Application of 'cursor-type Heime via Users list for the GNU Emacs text editor
@ 2024-12-05  2:43 ` Joel Reicher
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Reicher @ 2024-12-05  2:43 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor; +Cc: Heime

Heime via Users list for the GNU Emacs text editor 
<help-gnu-emacs@gnu.org> writes:

> 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.

One of the functions mentioned on

(elisp) Creating Buffer-Local

will give you that information.

Regards,

        - Joel



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-05  2:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-30  0:12 Application of 'cursor-type Heime via Users list for the GNU Emacs text editor
2024-12-05  2:43 ` Joel Reicher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).