From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: lisp-indent-line and comment-region in emacs-lisp-mode menu Date: Tue, 04 Mar 2008 19:32:06 -0800 Message-ID: <200803050332.m253W6YN016997@sallyv1.ics.uci.edu> 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 X-Trace: ger.gmane.org 1204688125 14845 80.91.229.12 (5 Mar 2008 03:35:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Mar 2008 03:35:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 05 04:35:51 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 1JWkQ1-0001pv-DF for ged-emacs-devel@m.gmane.org; Wed, 05 Mar 2008 04:35:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWkPT-0003s6-PM for ged-emacs-devel@m.gmane.org; Tue, 04 Mar 2008 22:35:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JWkPO-0003rL-UX for emacs-devel@gnu.org; Tue, 04 Mar 2008 22:35:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JWkPM-0003qp-HJ for emacs-devel@gnu.org; Tue, 04 Mar 2008 22:35:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWkPM-0003qm-Bg for emacs-devel@gnu.org; Tue, 04 Mar 2008 22:35:08 -0500 Original-Received: from sallyv1.ics.uci.edu ([128.195.1.109]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1JWkPL-0002ae-St for emacs-devel@gnu.org; Tue, 04 Mar 2008 22:35:08 -0500 X-ICS-MailScanner-Watermark: 1205292729.46611@5tJsThygHpSlndY4+bE1QQ Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by sallyv1.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id m253W6YN016997; Tue, 4 Mar 2008 19:32:06 -0800 (PST) In-Reply-To: <87y78yqcmr.fsf@jurta.org> (Juri Linkov's message of "Wed, 05 Mar 2008 01:33:08 +0200") Original-Lines: 28 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) 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:91351 Archived-At: Juri Linkov writes: > > 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? Maybe, but let's go one step at a time, first use for menus a command that is also bound to a key. And after that, discuss changing the key bindings. The former should be easy, it's mostly a bug fix. The later might be controversial.