From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: Lisp error when using M-x Date: Mon, 11 Jan 2021 04:25:24 +0000 Message-ID: <87y2h0qevf.fsf@robertthorpeconsulting.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39303"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: wael-zwaiter@gmx.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 11 05:26:44 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kyomy-000A9G-4j for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 11 Jan 2021 05:26:44 +0100 Original-Received: from localhost ([::1]:58496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyomx-00057p-62 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 10 Jan 2021 23:26:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyomH-000549-Qj for help-gnu-emacs@gnu.org; Sun, 10 Jan 2021 23:26:01 -0500 Original-Received: from outbound-smtp33.blacknight.com ([81.17.249.66]:55453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyomE-0003NQ-Mg for help-gnu-emacs@gnu.org; Sun, 10 Jan 2021 23:26:00 -0500 Original-Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp33.blacknight.com (Postfix) with ESMTPS id 67951BB018 for ; Mon, 11 Jan 2021 04:25:54 +0000 (GMT) Original-Received: (qmail 22092 invoked from network); 11 Jan 2021 04:25:54 -0000 Original-Received: from unknown (HELO rt-inspiron-3480) (rt@robertthorpeconsulting.com@[109.76.74.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 11 Jan 2021 04:25:54 -0000 In-Reply-To: (wael-zwaiter@gmx.com) Received-SPF: pass client-ip=81.17.249.66; envelope-from=rt@robertthorpeconsulting.com; helo=outbound-smtp33.blacknight.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127176 Archived-At: 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