From: "Drew Adams" <drew.adams@oracle.com>
To: "'Juri Linkov'" <juri@jurta.org>, <emacs-devel@gnu.org>
Subject: RE: lisp-indent-line and comment-region in emacs-lisp-mode menu
Date: Tue, 4 Mar 2008 16:49:02 -0800 [thread overview]
Message-ID: <003a01c87e5a$b5554580$0600a8c0@us.oracle.com> (raw)
In-Reply-To: <87y78yqcmr.fsf@jurta.org>
> > Wouldn't it be better if the emacs-lisp-mode menu used
> > indent-for-tab-command instead of lisp-indent-line and
>
> Here is what I currently use:
>
> (define-key emacs-lisp-mode-map [tab] 'my-lisp-indent-or-complete)
> (defun my-lisp-indent-or-complete (&optional arg)
> "Complete Lisp symbol, or indent line or region.
> If the character preceding point is symbol-constituent, then perform
> completion on Lisp symbol preceding point using
> `lisp-complete-symbol'.
> Otherwise, call `indent-for-tab-command' that indents line or region."
> (interactive "P")
> (if (and (not (and transient-mark-mode mark-active
> (not (eq (region-beginning) (region-end)))))
> (memq (char-syntax (preceding-char)) (list ?w ?_))
> (not (bobp)))
> (lisp-complete-symbol)
> (indent-for-tab-command arg)))
>
> and find this very useful. Maybe something like this should be added
> to emacs-lisp-mode and its menu?
I don't care if you add it, but please don't bind it to TAB. I use TAB to do
`lisp-indent-line' (the default) always. I don't want to have to move the
cursor away from a symbol constituent, just to be able to indent the line.
The beauty of TAB is that it works no matter where the cursor is on a line.
If you want to have TAB sometimes not indent (e.g. `lisp-complete-symbol'),
please do it via `tab-always-indent' = nil.
next prev parent reply other threads:[~2008-03-05 0:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-04 22:23 lisp-indent-line and comment-region in emacs-lisp-mode menu Dan Nicolaescu
2008-03-04 23:33 ` Juri Linkov
2008-03-05 0:49 ` Drew Adams [this message]
2008-03-05 10:40 ` Juri Linkov
2008-03-05 15:33 ` Drew Adams
2008-03-05 3:32 ` Dan Nicolaescu
2008-03-05 10:43 ` Juri Linkov
2008-03-05 18:41 ` Stefan Monnier
2008-03-05 19:00 ` Dan Nicolaescu
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='003a01c87e5a$b5554580$0600a8c0@us.oracle.com' \
--to=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=juri@jurta.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).