all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Thorpe <rt@robertthorpeconsulting.com>
To: wael-zwaiter@gmx.com
Cc: help-gnu-emacs@gnu.org
Subject: Re: Lisp error when using M-x
Date: Mon, 11 Jan 2021 04:25:24 +0000	[thread overview]
Message-ID: <87y2h0qevf.fsf@robertthorpeconsulting.com> (raw)
In-Reply-To: <trinity-e0339e16-1af1-4aa3-8e5f-d72da413d080-1610319548575@3c-app-mailcom-bs11> (wael-zwaiter@gmx.com)

wael-zwaiter@gmx.com writes:

> I want to use C-i for ivy related commands.
>
>   (global-set-key (kbd "C-i C-s") 'swiper)
>   (global-set-key (kbd "C-i C-r") 'ivy-resume)
>   (global-set-key (kbd "C-i C-i") 'ivy-resume)
>   (global-set-key (kbd "C-i M-x") 'counsel-M-x)
>   (global-set-key (kbd "C-i C-f") 'counsel-find-file)

Just a bit of general advice....

In Emacs if the keys beginning with C-c followed by an unescaped letter
are reserved for the user.  For example "C-c a" or "C-c b".  That prefix
is specifically for the user adding things.  If you add thing there then
they certainly won't collide with other things.  Note that the keys
beginning C-c and ending with another ctrl key are used by major modes.
So, although "C-c a" will always be free "C-c C-a" is probably used.

Secondly, if you want to use counsel then I suggest replacing the
standard keybindings.  Replace M-x with counsel-M-x, there is no reason
to have both of them.  The same is true of find-file, you may as well
just over-ride "C-x C-f" with counsel-find-file.  So you may as well
just do:

(global-set-key (kbd "M-x") 'counsel-M-x)
(global-set-key (kbd "C-x C-f") 'counsel-find-file)

This is what the Ivy/counsel/swiper manual suggests.  Try it out and see
if you like it.  If you don't you can go back to the original in-built
version or try out the other alternatives.

For the other keys I would do this:

(global-set-key (kbd "C-c s") 'swiper)
(global-set-key (kbd "C-c r") 'ivy-resume)

Lastly, if you want to use Emacs in a terminal emulator then there's a
problem with C-i.  In a terminal emulator (or a linux console screen)
C-i and tab always do the same thing.  So, if you press tab it will do
the same thing as C-i.  In your case that means it'll run your prefix
key.  So, there will be no way to press tab in the terminal.  This is
not an Emacs problem, it's a problem of the interface between
terminal-emulators and programs.  For some of these keys it can be fixed
by changing terminal configuration.

BR,
Robert Thorpe



      parent reply	other threads:[~2021-01-11  4:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-10 20:38 Lisp error when using M-x wael-zwaiter
2021-01-10 20:42 ` wael-zwaiter
2021-01-10 20:54   ` Óscar Fuentes
2021-01-10 21:03     ` Stefan Monnier
2021-01-10 21:10       ` wael-zwaiter
2021-01-10 21:17       ` wael-zwaiter
2021-01-10 22:55         ` Óscar Fuentes
2021-01-10 22:59           ` wael-zwaiter
2021-01-10 23:33             ` Óscar Fuentes
2021-01-11  0:00               ` wael-zwaiter
2021-01-11  4:25             ` Robert Thorpe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2h0qevf.fsf@robertthorpeconsulting.com \
    --to=rt@robertthorpeconsulting.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=wael-zwaiter@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.