unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "David Kågedal" <davidk@lysator.liu.se>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: Is this tempo.el patch correct?
Date: Sun, 11 Mar 2007 14:29:39 +0100	[thread overview]
Message-ID: <878xe3x60s.fsf@morpheus.local> (raw)
In-Reply-To: <E1HNHT2-0002Xv-My@fencepost.gnu.org> (Richard Stallman's message of "Fri, 02 Mar 2007 18:47:16 -0500")

Richard Stallman <rms@gnu.org> writes:

> Please tell us whether to install this patch.
>
> From: Lawrence Mitchell <wence@gmx.li>
> 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
> ===================================================================
> 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  <wence@gmx.li>
>
> 	* 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

  reply	other threads:[~2007-03-11 13:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-02 23:47 Is this tempo.el patch correct? Richard Stallman
2007-03-11 13:29 ` David Kågedal [this message]
2007-03-12  1:27   ` Richard Stallman
2007-03-12 22:11     ` Kim F. Storm
  -- strict thread matches above, loose matches on Subject: below --
2007-03-09 21:26 Richard Stallman
2007-03-09 22:46 ` David Kågedal
2007-03-11  4:23   ` Richard Stallman
2007-03-10 15:55 ` David Hansen
2007-03-10 20:00   ` Lawrence Mitchell
2007-03-11 20:00   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878xe3x60s.fsf@morpheus.local \
    --to=davidk@lysator.liu.se \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).