unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Minibuffer selection that changes cursor-type
@ 2022-06-12 10:31 carlmarcos--- via Users list for the GNU Emacs text editor
       [not found] ` <N4MSvyd--F-2@tutanota.com-N4MT1CU----2>
  0 siblings, 1 reply; 3+ messages in thread
From: carlmarcos--- via Users list for the GNU Emacs text editor @ 2022-06-12 10:31 UTC (permalink / raw)
  To: Help Gnu Emacs

Would like to change cursor-type by selecting type in the minibuffer.  What can I do? 


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

* Re: Minibuffer selection that changes cursor-type
       [not found] ` <N4MSvyd--F-2@tutanota.com-N4MT1CU----2>
@ 2022-06-12 11:21   ` carlmarcos--- via Users list for the GNU Emacs text editor
  2022-06-12 11:58     ` goncholden
  0 siblings, 1 reply; 3+ messages in thread
From: carlmarcos--- via Users list for the GNU Emacs text editor @ 2022-06-12 11:21 UTC (permalink / raw)
  To: carlmarcos; +Cc: Help Gnu Emacs


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


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

* Re: Minibuffer selection that changes cursor-type
  2022-06-12 11:21   ` carlmarcos--- via Users list for the GNU Emacs text editor
@ 2022-06-12 11:58     ` goncholden
  0 siblings, 0 replies; 3+ messages in thread
From: goncholden @ 2022-06-12 11:58 UTC (permalink / raw)
  To: carlmarcos; +Cc: Help Gnu Emacs


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



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

end of thread, other threads:[~2022-06-12 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-12 10:31 Minibuffer selection that changes cursor-type carlmarcos--- via Users list for the GNU Emacs text editor
     [not found] ` <N4MSvyd--F-2@tutanota.com-N4MT1CU----2>
2022-06-12 11:21   ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-06-12 11:58     ` goncholden

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