[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is this tempo.el patch correct?
From: |
David Kågedal |
Subject: |
Re: Is this tempo.el patch correct? |
Date: |
Sun, 11 Mar 2007 14:29:39 +0100 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Richard Stallman <address@hidden> writes:
> Please tell us whether to install this patch.
>
> From: Lawrence Mitchell <address@hidden>
> Subject: r> insertion marker not handled correctly in tempo
> To: address@hidden
> 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
> ===================================================================
> 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-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)
>
> Changelog entry:
>
> 2007-03-02 Lawrence Mitchell <address@hidden>
>
> * 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 <NAME> <NOINSERT>): 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)
--
David Kågedal