From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michal Nazarewicz Newsgroups: gmane.emacs.devel Subject: Re: key-binding for cycle-spacing Date: Mon, 10 Feb 2014 14:45:03 +0100 Organization: http://mina86.com/ Message-ID: References: <20140129202810.GA3092@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1392039929 7250 80.91.229.3 (10 Feb 2014 13:45:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Feb 2014 13:45:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie , Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 10 14:45:36 2014 Return-path: Envelope-to: ged-emacs-devel@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 1WCrB0-0003V2-JU for ged-emacs-devel@m.gmane.org; Mon, 10 Feb 2014 14:45:34 +0100 Original-Received: from localhost ([::1]:55691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCrB0-0000KJ-8d for ged-emacs-devel@m.gmane.org; Mon, 10 Feb 2014 08:45:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCrAp-0000KD-96 for emacs-devel@gnu.org; Mon, 10 Feb 2014 08:45:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCrAi-0004IT-SD for emacs-devel@gnu.org; Mon, 10 Feb 2014 08:45:23 -0500 Original-Received: from mail-ee0-x235.google.com ([2a00:1450:4013:c00::235]:37027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCrAi-0004Ez-Hl for emacs-devel@gnu.org; Mon, 10 Feb 2014 08:45:16 -0500 Original-Received: by mail-ee0-f53.google.com with SMTP id t10so2917232eei.26 for ; Mon, 10 Feb 2014 05:45:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:organization:references :user-agent:face:date:message-id:mime-version:content-type; bh=RnTVT4orUQr8t3ACQahG2BVcI+B3yQ/o1ifPPLHDdng=; b=kdQXTii9LzQHIMQg2He1JDfJQogghfrhyU9346oU5PoYjSMKZLhQDhVmsAvvcQ9+U5 k7dG0USYwRQGvZV3fIhz9DmYm+oi7CFERqIlG3CuNaETCJzRJodF0RXWu0ees7chudNE qKRxyfhHQK6ew5GVhW6OApRrRYYPCSIHtf8AW99quocInnfIsC4Xq6Hx6s7m1bYr6D+P p2GIutZUkJgaYLIFAzTrh5YH7mimCtIbJdzJuBEN/4Htw/F8XjyI55hdgq6aj/6W2RIQ gkqDzLzlZU/mWxCqY7I/9vSWVCgIFyOHMC+CM2vkQz6Kd5ZHzbdhQ3prER1XqylLTb8v tsOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to :organization:references:user-agent:face:date:message-id :mime-version:content-type; bh=RnTVT4orUQr8t3ACQahG2BVcI+B3yQ/o1ifPPLHDdng=; b=TPY6SkN7KvMUQoBhUlHjCWxFgq1lzNui2Q+D/IdmQlNqSit1UB2f/GZV5B5GGQbx5k GhhJcedgARAYtGF7hYhei+6e0qUQk8OPMOxkx5jvik8Ab2MCitA/Gdj2YvklHUhbRAnV rPS5eal91qbD1hYMjchOB5rB479g3Pz2SJ1eFgS3iCi8G8KCNmzvOnj28dVLBBBZDRK8 iunfmPB6sCxPV46qRQzgnmH5dJdJfN9nYrRvkiscSZxlT1Le63cHJk3TV+AalDFpOQ4h DFYtr/pwyi8WxZGhug2nsikuF5Rqw1tzHTdqNsrVqmxDNicSoi796MJRCGpk7FzvNQvO p5RQ== X-Gm-Message-State: ALoCoQlwpEAmSaP490zLF8x7H0ur+ekZOyYK+lwgK1tEGs6dvVFPWB4N7KZL9jrFKoRXNfjomfm6SJIB66r54OtUkwC2Op/D9TO+CjynzG9GXkGNFSMihphi/Jre/U5mGGY7rr/l91zdy/XpJ4zupmxsQzorHRPVw2iXbEsDnHxjnR9VlJU4ZwEGpiegcGzhhQrwyODylR/DCFbcPJYLTbCMbMUlI3Eucg== X-Received: by 10.15.67.197 with SMTP id u45mr36212728eex.24.1392039915604; Mon, 10 Feb 2014 05:45:15 -0800 (PST) Original-Received: from mpn-glaptop.roam.corp.google.com (159-205-221-55.adsl.inetia.pl. [159.205.221.55]) by mx.google.com with ESMTPSA id u6sm54702186eep.11.2014.02.10.05.45.11 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 10 Feb 2014 05:45:14 -0800 (PST) In-Reply-To: <20140129202810.GA3092@acm.acm> User-Agent: Notmuch/0.17+15~gb65ca8e (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu) X-Face: PbkBB1w#)bOqd`iCe"Ds{e+!C7`pkC9a|f)Qo^BMQvy\q5x3?vDQJeN(DS?|-^$uMti[3D*#^_Ts"pU$jBQLq~Ud6iNwAw_r_o_4]|JO?]}P_}Nc&"p#D(ZgUb4uCNPe7~a[DbPG0T~!&c.y$Ur,=N4RT>]dNpd; KFrfMCylc}gc??'U2j,!8%xdD Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWbfGlUPDDHgE57V0jUupKjgIObY0PLrom9mH4dFRK4gmjPs41MxjOgAAACQElEQVQ4jW3TMWvbQBQHcBk1xE6WyALX1069oZBMlq+ouUwpEQQ6uRjttkWP4CmBgGM0BQLBdPFZYPsyFUo6uEtKDQ7oy/U96XR2Ux8ehH/89Z6enqxBcS7Lg81jmSuujrfCZcLI/TYYvbGj+jbgFpHJ/bqQAUISj8iLyu4LuFHJTosxsucO4jSDNE0Hq3hwK/ceQ5sx97b8LcUDsILfk+ovHkOIsMbBfg43VuQ5Ln9YAGCkUdKJoXR9EclFBhixy3EGVz1K6eEkhxCAkeMMnqoAhAKwhoUJkDrCqvbecaYINlFKSRS1i12VKH1XpUd4qxL876EkMcDvHj3s5RBajHHMlA5iK32e0C7VgG0RlzFPvoYHZLRmAC0BmNcBruhkE0KsMsbEc62ZwUJDxWUdMsMhVqovoT96i/DnX/ASvz/6hbCabELLk/6FF/8PNpPCGqcZTGFcBhhAaZZDbQPaAB3+KrWWy2XgbYDNIinkdWAFcCpraDE/knwe5DBqGmgzESl1p2E4MWAz0VUPgYYzmfWb9yS4vCvgsxJriNTHoIBz5YteBvg+VGISQWUqhMiByPIPpygeDBE6elD973xWwKkEiHZAHKjhuPsFnBuArrzxtakRcISv+XMIPl4aGBUJm8Emk7qBYU8IlgNEIpiJhk/No24jHwkKTFHDWfPniR 4iw5vJaw2nzSjfq2zffcE/GDjRC2dn0J0XwPAbDL84TvaFCJEU4Oml9pRyEUhR3Cl2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC X-PGP: 50751FF4 X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4 X-Hashcash: 1:20:140210:emacs-devel@gnu.org::ncfgKOOIcqniikxi:0000000000000000000000000000000000000000002buW X-Hashcash: 1:20:140210:acm@muc.de::dKMOhLaJru8B3noF:00000002DY1 X-Hashcash: 1:20:140210:rgm@gnu.org::NVyIO/uar7dkztFp:0000002djs X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169507 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Jan 29 2014, Alan Mackenzie wrote: > Also, why do we need this function? Surely somebody adjusting her > whitespace at some place will know in advance whether she wants: > (a) 1 space; > (b) n spaces; > (c) no space, > and cycling through the possibilities to get there is an inefficient > waste of time. Albeit no. I'm using `cycle-spacing' with the following binding: (define-key esc-map " " (lambda (n) (interactive "*p") (cycle-spacing (- n) t))) and I sometimes end up with a situation like this one: const unsigned long long foo =3D-!- calculate_stuff() * calculate_other_stuff(); (-!- denoting point) in which case I don't know if I want 1 space or whatever there is now. What I end up doing is hit M-SPC to end up with: const unsigned long long foo =3D calculate_stuff() * calculate_other_st= uff(); and if it fits in my window (which is 80-character wide) I go on with my life, if it does not, I press M-SPC two more times. (And before you ask, yes, I am aware of M-^ and C-_ but see below.) > There are already suitable commands and bindings for them to do each of > the things done by `cycle-spacing', namely M-SPC, C-u n M-space, M-\, > and C-_. Sure, but: * It is *much* easier to press the same key sequence three times in a row than to use different key sequences. Compare: - hold ALT down - press SPACE - press SPACE - press SPACE - release ALT with: - hold ALT down - press SPACE - press \ (which in many keyboard layouts is on far right which forces you to extend your pinky) - release ALT - hold SHIFT and CTRL down - press _ - release SHIFT and CTRL * I find it easier to remember one key sequence that does magic stuff then to remember bindings for everything. I never use M-\ and don't have to remember it's there because M-SPC almost always does what I want it to do if I press it enough times. Similarly, I have no idea what is the key binding is for going back to indention or to the beginning of buffer since my C-a does all that for me. BTW. M-\ does not work on new line characters whereas `cycle-spacing' can. > I don't thing we need this function. I can't see a use case. Hope the above helps. --=20 Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o ..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz = (o o) ooo +------ooO--(_)--Ooo-- --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJS+NffAAoJECBgQBJQdR/0sE0P/37Z3GxUr76KPGB+orjVQ5zj N4ctEHWjqCBAqz6zblbMTHp023JI250ttADGJS4IjUD69LxIQqxgqmBCOcVXjTeX 42L4frjimjfYNHYaUhQYffGkLqtcR1LXwCgljOehnK3MxMeQM3r84JwW0kIfUuXO EysFJ/MqVparuv0TEwGSajdF4zHDuyQEsbORkiV6YGoLJQxThVrcXAFw5dVgVn4L ZApfGXjjxahr2eDGntnqelAHhGtKeoqasiOnYL/U6I6+oOsPmr1qyNSU31vOIKbs 5G+95IVm43qAhNYNADlZugd0xjAK2N/EMu3XvAQRhdkh6XL9tJFePNssbxiaFw0G B+cojv0lrfJuUX0Y3//xTO7jJ9cw5migAcDc57ciwDpe1ZovsukghuqYSBjR3IOT ObsSPgGOyx1SLbgXrJbL9Rciz/7+CqEhamNbjIk4foHhtVdsF8rIt7Rv2UTpTapK anfcKZ0aEEBou9oxd53Q4ZP46ls0OHfrQZR4rzAKyKRIpJ1MMNTjAau9X0yq5DJ0 99ZFKIw3giuuxvNkSZRHvKAvIUJnj1s4hOnptwnIiuQVRAjc96xwJcytNC4MVA/e fLbra6ekt2gke+TSAz6skiUiueOJa0QoQec+h5Z+w7Zd4gxed3OR9Wji7RrFZov/ X6m6fogjjhtPIkrah88s =EjpN -----END PGP SIGNATURE----- --==-=-=-- --=-=-=--