{"id":117,"date":"2010-09-07T09:22:00","date_gmt":"2010-09-07T09:22:00","guid":{"rendered":"https:\/\/www.root42.de\/blog\/?p=117"},"modified":"2010-09-07T09:22:00","modified_gmt":"2010-09-07T09:22:00","slug":"redefining-quit-char-in-emacs-23","status":"publish","type":"post","link":"https:\/\/www.root42.de\/blog\/?p=117","title":{"rendered":"Redefining quit-char in Emacs 23"},"content":{"rendered":"<p>The quit command C-g is pretty much standard in Emacs. It runs the interactive function keyboard-quit and also serves as the default quit-char. It aborts basically every running function, also it allows you to cancel operations in the minibuffer. The Emacs documentation describes current-input-mode, set-input-mode and set-quit-char for getting and setting the quit-char value. Also, global-set-key allows you to rebind keyboard-quit to another character. However, this does not work very well. The quit-char is not settable for non-tty Emacs versions, e.g. on OS X using Cocoa Emacs you get this:<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"http:\/\/2.bp.blogspot.com\/_Mc79Xvd2xvE\/TIYDf2S2dqI\/AAAAAAAAAVo\/Lh94r19pvRg\/s1600\/Bildschirmfoto+2010-09-07+um+11.14.32.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img border=\"0\" src=\"http:\/\/2.bp.blogspot.com\/_Mc79Xvd2xvE\/TIYDf2S2dqI\/AAAAAAAAAVo\/Lh94r19pvRg\/s320\/Bildschirmfoto+2010-09-07+um+11.14.32.png\" \/><\/a><\/div>\n<p>So, basically nothing changes. On a tty it looks more promising:<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"http:\/\/2.bp.blogspot.com\/_Mc79Xvd2xvE\/TIYDm9sekUI\/AAAAAAAAAVw\/CYheuBNJbCs\/s1600\/Bildschirmfoto+2010-09-07+um+11.15.49.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img border=\"0\" src=\"http:\/\/2.bp.blogspot.com\/_Mc79Xvd2xvE\/TIYDm9sekUI\/AAAAAAAAAVw\/CYheuBNJbCs\/s320\/Bildschirmfoto+2010-09-07+um+11.15.49.png\" \/><\/a><\/div>\n<p>After rebinding the keyboard quit as well, using <span style=\"font-family: 'Courier New', Courier, monospace;\">(global-set-key (kbd &#8220;C-q&#8221;) &#8216;keyboard-quit)<\/span>, not much happens either. It seems the minibuffer assumes C-g to be the choice of the day. Running find-file with C-x C-f or interactively via M-x find-file, and then hitting C-q does nothing except printing &#8220;Quit&#8221;. Hitting C-g however quits the minibuffer. This seems to be documented in <a href=\"http:\/\/debbugs.gnu.org\/db\/12\/1218.html\">Bug #1218<\/a> of Emacs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The quit command C-g is pretty much standard in Emacs. It runs the interactive function keyboard-quit and also serves as the default quit-char. It aborts basically every running function, also it allows you to cancel operations in the minibuffer. The Emacs documentation describes current-input-mode, set-input-mode and set-quit-char for getting and setting the quit-char value. Also, &hellip; <a href=\"https:\/\/www.root42.de\/blog\/?p=117\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Redefining quit-char in Emacs 23&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,6,24,10],"tags":[],"_links":{"self":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/117"}],"collection":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=117"}],"version-history":[{"count":0,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/117\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}