From: joaotavora@gmail.com (João Távora)
To: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel@gnu.org
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 [thread overview]
Message-ID: <m2y4siwcbp.fsf@king.lan> (raw)
In-Reply-To: <20141011134312.GA4148@acm.acm> (Alan Mackenzie's message of "Sat, 11 Oct 2014 13:43:12 +0000")
Alan Mackenzie <acm@muc.de> 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 (= 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.
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ão
prev parent reply other threads:[~2014-10-14 21:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-11 13:43 Proposed extension of show-paren-mode: Highlight parens when point is in L or R margin Alan Mackenzie
2014-10-11 14:21 ` Eli Zaretskii
2014-10-12 8:39 ` Alan Mackenzie
2014-10-12 8:55 ` David Kastrup
2014-10-12 9:25 ` Alan Mackenzie
2014-10-12 9:01 ` Eli Zaretskii
2014-10-12 10:18 ` Alan Mackenzie
2014-10-12 4:12 ` Stefan Monnier
2014-10-12 10:04 ` Alan Mackenzie
2014-10-14 17:49 ` Stefan Monnier
2014-10-14 18:32 ` John Yates
2014-10-15 9:12 ` Alan Mackenzie
2014-10-15 22:38 ` Andy Moreton
2014-10-16 2:43 ` Stefan Monnier
2014-10-16 9:53 ` Alan Mackenzie
2014-10-16 12:59 ` Stefan Monnier
2014-10-16 13:31 ` Alan Mackenzie
2014-10-16 14:37 ` Stefan Monnier
2014-10-16 15:46 ` Alan Mackenzie
2014-10-16 17:40 ` Stefan Monnier
2014-10-16 21:26 ` Alan Mackenzie
2014-10-17 0:14 ` Stefan Monnier
2014-10-14 21:50 ` João Távora [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2y4siwcbp.fsf@king.lan \
--to=joaotavora@gmail.com \
--cc=acm@muc.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.