From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: lisp-indent-line and comment-region in emacs-lisp-mode menu Date: Tue, 4 Mar 2008 16:49:02 -0800 Message-ID: <003a01c87e5a$b5554580$0600a8c0@us.oracle.com> References: <200803042223.m24MNxAA001171@sallyv1.ics.uci.edu> <87y78yqcmr.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1204678246 22683 80.91.229.12 (5 Mar 2008 00:50:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Mar 2008 00:50:46 +0000 (UTC) To: "'Juri Linkov'" , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 05 01:51:12 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JWhqf-00054x-TN for ged-emacs-devel@m.gmane.org; Wed, 05 Mar 2008 01:51:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWhq8-0006Cm-QY for ged-emacs-devel@m.gmane.org; Tue, 04 Mar 2008 19:50:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JWhq3-0006A1-A4 for emacs-devel@gnu.org; Tue, 04 Mar 2008 19:50:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JWhq1-00069Y-SU for emacs-devel@gnu.org; Tue, 04 Mar 2008 19:50:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWhq1-00069V-Mk for emacs-devel@gnu.org; Tue, 04 Mar 2008 19:50:29 -0500 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JWhq0-0008JV-Ac for emacs-devel@gnu.org; Tue, 04 Mar 2008 19:50:29 -0500 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m250oP2A020187; Tue, 4 Mar 2008 17:50:25 -0700 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m24Dwblj005064; Tue, 4 Mar 2008 17:50:24 -0700 Original-Received: from inet-141-146-46-1.oracle.com by acsmt351.oracle.com with ESMTP id 3599930551204678138; Tue, 04 Mar 2008 16:48:58 -0800 Original-Received: from dradamslap1 (/141.144.88.200) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 04 Mar 2008 16:48:58 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ach+UgELawX8dxPvRUmzWA7JD4EuVwABy78Q In-Reply-To: <87y78yqcmr.fsf@jurta.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:91340 Archived-At: > > 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.