From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: Re: Proposed extension of show-paren-mode: Highlight parens when point is in L or R margin. Date: Tue, 14 Oct 2014 22:50:18 +0100 Message-ID: References: <20141011134312.GA4148@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1413323465 25646 80.91.229.3 (14 Oct 2014 21:51:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Oct 2014 21:51:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 14 23:50:57 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 1Xe9zc-00067x-Ka for ged-emacs-devel@m.gmane.org; Tue, 14 Oct 2014 23:50:56 +0200 Original-Received: from localhost ([::1]:40541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xe9zZ-0004dt-R1 for ged-emacs-devel@m.gmane.org; Tue, 14 Oct 2014 17:50:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xe9zG-0004dm-DI for emacs-devel@gnu.org; Tue, 14 Oct 2014 17:50:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xe9z7-0001zK-9I for emacs-devel@gnu.org; Tue, 14 Oct 2014 17:50:34 -0400 Original-Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:59686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xe9z7-0001xY-31 for emacs-devel@gnu.org; Tue, 14 Oct 2014 17:50:25 -0400 Original-Received: by mail-wi0-f181.google.com with SMTP id hi2so281879wib.14 for ; Tue, 14 Oct 2014 14:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; bh=NfXjWpHdOwqrtcA07DXSD9tTiyMGGRK9/v1BGgK75rw=; b=UQxFghBM9dlREEWqxVmDZbPcwuwQv8kn+L02IB1bH7kyXEgviTp99lNEFYdsMhlToe 4PIpAbFgg2gEi/CQykhFy6yYi1Et77xpIylRxcWXnHPdsHpKBdooyKRIgeRZ7G3Kj0pf Ap14i4MkR4mYMSDaHROCMlxSqfosnvH+z4JxR7KAwgbfed/Db2qn6F432Q09H4KDvMrt Wf8xt54S47DGVm4CJ/uved4B0uBIQ9Ewh3jYlipuCgrGHmF5m5lPNif2TidOBAqZ8CJV ha33ixeTroqoQIC9SlhUIp0nkqTo6Bc3ZCcRr0pjood22APOsvrJWRmREmdPgmbuT5xa cVhw== X-Received: by 10.194.79.201 with SMTP id l9mr7845895wjx.59.1413323423534; Tue, 14 Oct 2014 14:50:23 -0700 (PDT) Original-Received: from king.lan.yourcompany.com (31.57.37.188.rev.vodafone.pt. [188.37.57.31]) by mx.google.com with ESMTPSA id au4sm21583157wjc.15.2014.10.14.14.50.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Oct 2014 14:50:22 -0700 (PDT) In-Reply-To: <20141011134312.GA4148@acm.acm> (Alan Mackenzie's message of "Sat, 11 Oct 2014 13:43:12 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (darwin) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::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:175379 Archived-At: Alan Mackenzie writes: > This is an idea which struck me when I was reading CC Mode code. I find > myself frequently scrolling through it, and frequently wanting to know > where the matching paren for one at beginning of indentation is. That > involved me typing M-m an awful lot, and I've got tired of doing that. I've gotten tired of that too, but I took a different approach (perhaps one that has already been discussed here?) (global-set-key [remap move-beginning-of-line] 'joaot/move-beginning-of= -line) (defun joaot/move-beginning-of-line () (interactive) (let ((pos (point))) (back-to-indentation) (when (=3D pos (point)) (move-beginning-of-line nil)))) If the code is not self-explanatory enough, it makes C-a do-what-I-mean: The first C-a brings me to start of indentation, a second one forces a move to the proper beginning of line. It solves this problem because C-a is perhaps the most ergonomic binding of all, provided you remap caps-lock to control. Of course, Alan, your solution requires no typing at all, but it also does not solve the almost-as-common problem that you might want to move the cursor to the opening parenthesis.=20 This is the single feature that I miss most when using other people's emacsen or Emacs -Q. It's the only piece of editor that I keep around since I switched to Emacs 10 years ago, from Eclipse, which had (has?) this on by default. I also used to have it on C-e, but I don't miss that nearly as much. Its current implementation as a separate command is slightly brittle for modes that remap C-a such, as `message-mode', so I wonder if it could be integrated in Emacs's own `move-beginning-of-line' via a suitably named customization variable. What do you think? Jo=C3=A3o