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: Any infrastructure to select one of a few options in Emacs core? Date: Sat, 14 May 2016 06:18:43 +0200 Message-ID: <86r3d55l24.fsf@student.uu.se> References: <87shxrczlt.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1463419395 7385 80.91.229.3 (16 May 2016 17:23:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 May 2016 17:23: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 Mon May 16 19:23:00 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 1b2MEK-00089a-JK for geh-help-gnu-emacs@m.gmane.org; Mon, 16 May 2016 19:22:56 +0200 Original-Received: from localhost ([::1]:45142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2MCf-0004s6-Bn for geh-help-gnu-emacs@m.gmane.org; Mon, 16 May 2016 13:21:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2MBv-0003mr-A3 for help-gnu-emacs@gnu.org; Mon, 16 May 2016 13:20:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2MBo-0001OJ-1z for help-gnu-emacs@gnu.org; Mon, 16 May 2016 13:20:26 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:34334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2MBn-0001Nr-Rt for help-gnu-emacs@gnu.org; Mon, 16 May 2016 13:20:20 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b1R2X-0005Id-1A for help-gnu-emacs@gnu.org; Sat, 14 May 2016 06:18:57 +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 ; Sat, 14 May 2016 06:18:57 +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 ; Sat, 14 May 2016 06:18:57 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 42 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:NqaBd4XiJPP1uQwqUhD+Ft/IKWc= 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:109977 Archived-At: Marcin Borkowski writes: > ... Check out my 'buc' module! (I don't remember why I called it that.) It is actually brilliant. You have a bunch of options: A, B, ... N. Then you have keys on your keyboard: RET, SPC, TAB, DEL, that are close and fast and singular. So there is an association between the options, and the keys! But the genius of it is, if you don't care for any of the options displayed and shortcutted, just type! Any other char will take away the whole "buc prompt" and instead appear as the first char in the input string, i.e., an arbitrary string is still inputable! Also, I added a function so that it works like a cache, with the most recently selected option always being the leftmost (RET), and then sorted rightways... It is an open question if this really is beneficial - it can be frustrating as well, if the keys keep moving around! It should at least be disableable. A screenshot: http://user.it.uu.se/~embe8573/dumps/buc.png The source: http://user.it.uu.se/~embe8573/conf/emacs-init/buc.el -- underground experts united .... http://user.it.uu.se/~embe8573 Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic - so far: 29 Blogomatic articles -