From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: lisp-indent-line and comment-region in emacs-lisp-mode menu Date: Wed, 05 Mar 2008 01:33:08 +0200 Organization: JURTA Message-ID: <87y78yqcmr.fsf@jurta.org> References: <200803042223.m24MNxAA001171@sallyv1.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204674376 11515 80.91.229.12 (4 Mar 2008 23:46:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Mar 2008 23:46:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 05 00:46:43 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 1JWgqI-0003EH-KA for ged-emacs-devel@m.gmane.org; Wed, 05 Mar 2008 00:46:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWgpl-0001HC-EU for ged-emacs-devel@m.gmane.org; Tue, 04 Mar 2008 18:46:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JWgpg-0001Gx-Tp for emacs-devel@gnu.org; Tue, 04 Mar 2008 18:46:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JWgpe-0001FG-Fc for emacs-devel@gnu.org; Tue, 04 Mar 2008 18:46:03 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWgpe-0001Ev-9d for emacs-devel@gnu.org; Tue, 04 Mar 2008 18:46:02 -0500 Original-Received: from relay02.kiev.sovam.com ([62.64.120.197]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JWgpd-0004MF-Rp for emacs-devel@gnu.org; Tue, 04 Mar 2008 18:46:02 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1JWgpS-000Nr6-Po for emacs-devel@gnu.org; Wed, 05 Mar 2008 01:45:59 +0200 In-Reply-To: <200803042223.m24MNxAA001171@sallyv1.ics.uci.edu> (Dan Nicolaescu's message of "Tue, 04 Mar 2008 14:23:59 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-unknown-linux-gnu) X-Scanner-Signature: 367251710ae6d8069d2a2bb66b314d03 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2355 [Mar 4 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 11 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 6.x (1) 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:91338 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? -- Juri Linkov http://www.jurta.org/emacs/