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

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

Re: Minibuffer selection that changes cursor-type


From: goncholden
Subject: Re: Minibuffer selection that changes cursor-type
Date: Sun, 12 Jun 2022 11:58:50 +0000

------- Original Message -------
On Sunday, June 12th, 2022 at 11:21 PM, carlmarcos--- via Users list for the 
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:


> Jun 12, 2022, 10:31 by help-gnu-emacs@gnu.org:
>
> > Would like to change cursor-type by selecting type in the minibuffer. What 
> > can I do?
>
> Started like this, Need to select from minibuffer to call the set-default 
> commands.
>
> (defun cursort ()
> ""
> (interactive)
> (completing-read "Chose one: "
> '(("find-file" . 'find-file)
> ("switch-to-buffer" . 'switch-to-buffer))))
>
> (set-default 'cursor-type 'box)
> (set-default 'cursor-type 'hollow)
> (set-default 'cursor-type 'bar)
> (set-default 'cursor-type 'hbar))


(defun typex-cursor ()
  "Modify the cursor form.
M-x typex-cursor
Select cursor choice from list using arrow keys (up, down).
Hit RETURN key."

  (interactive)
  (let* ( (cser '("box" "hollow" "bar" "hbar"))
          (csel  (completing-read "Cursor: " cser nil t)) )

  (pcase csel
    ("box"
     (set-default 'cursor-type 'box))
    ("hollow"
     (set-default 'cursor-type 'hollow))
    ("bar"
     (set-default 'cursor-type 'bar))
    ("hbar"
     (set-default 'cursor-type 'hbar))) ))



reply via email to

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