From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Overriding emacs key bindings Date: Tue, 17 May 2016 01:29:37 +0200 Message-ID: <86k2iteg4e.fsf@student.uu.se> References: <86a8jpg76k.fsf@student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1463441415 6305 80.91.229.3 (16 May 2016 23:30:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 May 2016 23:30:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 17 01:30:05 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b2Rxd-0001it-JS for geh-help-gnu-emacs@m.gmane.org; Tue, 17 May 2016 01:30:05 +0200 Original-Received: from localhost ([::1]:47753 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2Rxc-0005ZL-OL for geh-help-gnu-emacs@m.gmane.org; Mon, 16 May 2016 19:30:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2RxS-0005Va-CO for help-gnu-emacs@gnu.org; Mon, 16 May 2016 19:29:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2RxO-0004lT-1y for help-gnu-emacs@gnu.org; Mon, 16 May 2016 19:29:53 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:33400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2RxN-0004lG-Qk for help-gnu-emacs@gnu.org; Mon, 16 May 2016 19:29:49 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b2RxL-0001eE-Ty for help-gnu-emacs@gnu.org; Tue, 17 May 2016 01:29:47 +0200 Original-Received: from c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se ([85.230.225.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 May 2016 01:29:47 +0200 Original-Received: from embe8573 by c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 May 2016 01:29:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 78 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Mail-Copies-To: never Cancel-Lock: sha1:D/sZTY9XSkekmymIa8tifc8JbXw= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110002 Archived-At: xiongtk writes: > I kind of run out of keys on my keyboard. > Since this function is rarely used(I use > English for 99% of the time), I think the > function keys is fine. To each his own. And Emacs makes that much easier to achieve. By changing Emacs, you become a better programmer and better computer user, and even Emacs gets better, until the point you realize there is already a built-in function, or module, that does what you have done, only better, and then it all starts over at a higher level... Because, if anything can start anew, then everything must continue! That said, if you rarely use the function, there is no need for a shortcut. Remember, "optimize the common case". If you think it is to much to type the actual function name, instead make an alias - or several! You'll find that it is actually faster to invoke as it is easier to remember and, again, does not require arm movement way from typing position. Why several aliases? Because sometimes you remember "test-colors", and sometimes "color-test" - with aliases, they can all be correct! But here, compare: will you remember that "color-test" years ago was assigned F6? So, e.g., (defalias 'download 'w3m-dl-dwim) (defalias 'dl 'w3m-dl-dwim) Regardless, I don't think you are running out of shutcuts :) Many shortcuts are assigned to stuff you never use - you can replace those. It is not because the stuff is bad - it can be just appealing to another personality, or involve technology you just don't use! Here is a tool - eval, invoke, and start hammering away, and you'll see: (defun show-key-command (&optional the-key command) (interactive) (let*((key-prompt "(hit key! or C-g to quit)") (prompt (if command (format " %s %s " command key-prompt) key-prompt)) (key (or the-key (read-key-sequence-vector prompt))) (new-command (key-binding key)) (command-or-undefined (or new-command "undefined")) ) (if the-key (message "%s" command-or-undefined) (unless (equal key [7]) ; [7] is C-g (show-key-command nil command-or-undefined) )))) If you really *do* run out of shortcuts, get a new prefix key, e.g. C-o which is short and close - check your hands when at asdf jkl; and note the required movement to strike C-o! Now even a new world of shortcuts opens. E.g., (define-prefix-command 'C-o-prefix) (global-set-key "\C-o" 'C-o-prefix) (global-set-key "\C-ow" #'window-increase-size) -- underground experts united .... http://user.it.uu.se/~embe8573 Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic - so far: 31 Blogomatic articles -