From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?David_K=C3=A5gedal?= Newsgroups: gmane.emacs.devel Subject: Re: Is this tempo.el patch correct? Date: Sun, 11 Mar 2007 14:29:39 +0100 Message-ID: <878xe3x60s.fsf@morpheus.local> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1173646798 21867 80.91.229.12 (11 Mar 2007 20:59:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Mar 2007 20:59:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 11 21:59:52 2007 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 1HQV8x-0003DT-Th for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2007 21:59:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQV9X-0001oK-On for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2007 16:00:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HQO82-0000qk-Nl for emacs-devel@gnu.org; Sun, 11 Mar 2007 09:30:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HQO81-0000qN-8t for emacs-devel@gnu.org; Sun, 11 Mar 2007 09:30:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQO81-0000qK-5i for emacs-devel@gnu.org; Sun, 11 Mar 2007 08:30:25 -0500 Original-Received: from mail.lysator.liu.se ([130.236.254.3]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HQO7O-0003ex-8I; Sun, 11 Mar 2007 09:29:46 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 0ACA0200A202; Sun, 11 Mar 2007 14:29:43 +0100 (CET) Original-Received: from mail.lysator.liu.se ([127.0.0.1]) by localhost (lenin.lysator.liu.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04339-01-15; Sun, 11 Mar 2007 14:29:42 +0100 (CET) Original-Received: from morpheus (c83-253-22-207.bredband.comhem.se [83.253.22.207]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTP id 0BBDF200A205; Sun, 11 Mar 2007 14:29:42 +0100 (CET) Original-Received: by morpheus (Postfix, from userid 1000) id 7AB50BFF19; Sun, 11 Mar 2007 14:29:39 +0100 (CET) In-Reply-To: (Richard Stallman's message of "Fri, 02 Mar 2007 18:47:16 -0500") User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at lysator.liu.se X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Sun, 11 Mar 2007 17:00:12 -0400 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:67736 Archived-At: Richard Stallman writes: > Please tell us whether to install this patch. > > From: Lawrence Mitchell > Subject: r> insertion marker not handled correctly in tempo > To: emacs-pretest-bug@gnu.org > Date: Fri, 02 Mar 2007 14:39:11 +0000 > > > If you define a tempo template that includes the "r>" insertion > marker, attempting to use that template results in an error that the > function "r>" is undefined. ... > The following patch fixes this problem in, I believe, the correct > manner: > > Index: tempo.el > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /sources/emacs/emacs/lisp/tempo.el,v > retrieving revision 1.20.6.11 > diff -c -r1.20.6.11 tempo.el > *** tempo.el 26 Jan 2007 06:15:15 -0000 1.20.6.11 > - --- tempo.el 2 Mar 2007 14:36:39 -0000 > *************** > *** 352,357 **** > - --- 352,364 ---- > (goto-char tempo-region-stop) > (tempo-insert-prompt-compat > (cdr element)))) > + ((and (consp element) > + (eq (car element) 'r>)) (if on-region > + (progn > + (goto-char tempo-region-sto= p) > + (indent-region (mark) (poin= t) nil)) > + (tempo-insert-prompt-compat > + (cdr element)))) > ((and (consp element) > (eq (car element) 's)) (tempo-insert-named (car (cdr element)))) > ((and (consp element) > > Changelog entry: > > 2007-03-02 Lawrence Mitchell > > * tempo.el (tempo-insert): Deal with 'r> if it appears > specified with a prompt argument. It looks good, but since it adds a new form, the documentation needs an update as well. This diff is against CVS head: --- tempo.el 21 Jan 2007 03:53:10 -0000 1.33 +++ tempo.el 11 Mar 2007 13:27:37 -0000 @@ -266,6 +266,8 @@ that you often should place this item after the text you want on the line. - `r>': Like `r', but it also indents the region. + - (r> PROMPT ): Like (r ...), but is also indents + the region. - `n>': Inserts a newline and indents line. - `o': Like `%' but leaves the point before the newline. - nil: It is ignored. @@ -352,6 +354,13 @@ (goto-char tempo-region-stop) (tempo-insert-prompt-compat (cdr element)))) + ((and (consp element) + (eq (car element) 'r>)) (if on-region + (progn + (goto-char tempo-region-stop) + (indent-region (mark) (point) = nil)) + (tempo-insert-prompt-compat + (cdr element)))) ((and (consp element) (eq (car element) 's)) (tempo-insert-named (car (cdr element)))) ((and (consp element) --=20 David K=C3=A5gedal