From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel Subject: a simple convenience function Date: Sun, 14 Nov 2004 23:36:00 +0200 Message-ID: <200411142336.00131.pogonyshev@gmx.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1100473609 24630 80.91.229.6 (14 Nov 2004 23:06:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 14 Nov 2004 23:06:49 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 15 00:06:40 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CTTSC-0004ca-00 for ; Mon, 15 Nov 2004 00:06:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTTas-0003ch-3L for ged-emacs-devel@m.gmane.org; Sun, 14 Nov 2004 18:15:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CTTak-0003cb-LJ for emacs-devel@gnu.org; Sun, 14 Nov 2004 18:15:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CTTak-0003cP-6k for emacs-devel@gnu.org; Sun, 14 Nov 2004 18:15:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTTak-0003cM-47 for emacs-devel@gnu.org; Sun, 14 Nov 2004 18:15:30 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1CTTRi-0003GI-Ow for emacs-devel@gnu.org; Sun, 14 Nov 2004 18:06:11 -0500 Original-Received: (qmail 21702 invoked by uid 65534); 14 Nov 2004 23:06:07 -0000 Original-Received: from unknown (EHLO localhost.localdomain) (195.50.12.121) by mail.gmx.net (mp003) with SMTP; 15 Nov 2004 00:06:07 +0100 X-Authenticated: #16844820 Original-To: emacs-devel@gnu.org User-Agent: KMail/1.4.3 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: main.gmane.org gmane.emacs.devel:29842 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29842 I'm not sure this issue wasn't raised already, but what do you think about adding this simple function to Emasc? It could just sit there for optional binding through `~/.emacs' by those who like this behaviour. Or we could make behaviour of the Home key customizeable. Quick explanation: in the line =09 some t[>>point<<]ext here after first evaluation of proposed function we get =09 [>>point<<]some text here and after second evaluation we get [>>point<<]=09 some text here Paul --- indent.el=0924 Oct 2004 23:58:43 +0300=091.59 +++ indent.el=0914 Nov 2004 23:28:35 +0200=09 @@ -329,6 +329,21 @@ line, but does not move past any whitesp (if (memq (current-justification) '(center right)) (skip-chars-forward " \t"))) =20 +(defun beginning-of-line-smart (&optional n) + "Move to the beginning of the text on this line, or to the beginning o= f the line. +More exactly, if the point is already at the beginning of the +line's text (as defined by `beginning-of-line-text'), it is +placed at the very beginning of the line. Otherwise it is moved +to the text beginning. + +With optional argument, different from 1, behave identically to +`beginning-of-line-text'." + (interactive "p") + (let ((current-point (point))) + (beginning-of-line-text n) + (when (=3D (point) current-point) + (beginning-of-line)))) + (defvar indent-region-function nil "Short cut function to indent region using `indent-according-to-mode'. A value of nil means really run `indent-according-to-mode' on each line.= ")