all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Patch for tempo.el
@ 2005-12-21 10:58 Barney Dalton
  0 siblings, 0 replies; 2+ messages in thread
From: Barney Dalton @ 2005-12-21 10:58 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 516 bytes --]


When you expand a tempo template with ON-REGION (C-u)
then if the template uses 'r functionality i.e.
something like:

(tempo-define-template "example"
		       '("repeated value first=" 
                         (r "value " value) 
                         "second=" (s value) "]\n"))

r doesn't save anything in value so the second
expansion is empty. 

This patch saves the active region as value so it can
be used later in the template. I haven't written much
lisp before so it may need some tidying up.

Barney

[-- Attachment #2: 689395294-tempo.patch --]
[-- Type: application/octet-stream, Size: 355 bytes --]

351a352
> 					 (progn 
352a354
>                                            (apply 'tempo-save-region-as (cdr element)))
756a759,763
> (defun tempo-save-region-as (prompt &optional save-name)
>   "Save current region as save-name"
>   (if save-name
>       (tempo-save-named save-name (buffer-substring tempo-region-start tempo-region-stop))))
> 

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch for tempo.el
@ 2005-12-28 15:31 Barney Dalton
  0 siblings, 0 replies; 2+ messages in thread
From: Barney Dalton @ 2005-12-28 15:31 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

Frist patch was sent in haste and didn't work too
well. Hopefully  this version is better. Is there any
chance that this (or some variant of it) will make it
into the official version?

Barney


--- Barney Dalton <barney@daltons.net> wrote:

> 
> When you expand a tempo template with ON-REGION
> (C-u)
> then if the template uses 'r functionality i.e.
> something like:
> 
> (tempo-define-template "example"
> 		       '("repeated value first=" 
>                          (r "value " value) 
>                          "second=" (s value) "]\n"))
> 
> r doesn't save anything in value so the second
> expansion is empty. 
> 
> This patch saves the active region as value so it
> can
> be used later in the template. I haven't written
> much
> lisp before so it may need some tidying up.
> 
> Barney

[-- Attachment #2: 689395294-tempo.patch --]
[-- Type: application/octet-stream, Size: 660 bytes --]

209a210,213
> (defvar tempo-region-text nil
>   "Region text when inserting around the region.")
> 
> 
311c315,316
< 	     (set-marker tempo-region-stop (max (mark) (point))))
---
> 	     (set-marker tempo-region-stop (max (mark) (point)))
>              (setq tempo-region-text (buffer-substring tempo-region-start tempo-region-stop)))
351a357
> 					 (progn 
352a359
>                                            (apply 'tempo-save-region-as (cdr element)))
756a764,768
> (defun tempo-save-region-as (prompt &optional save-name)
>   "Save current region as save-name"
>   (if save-name
>       (tempo-save-named save-name tempo-region-text)))
> 

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-28 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-21 10:58 Patch for tempo.el Barney Dalton
  -- strict thread matches above, loose matches on Subject: below --
2005-12-28 15:31 Barney Dalton

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.