[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Positioning point after insert in another buffer
From: |
francis |
Subject: |
Positioning point after insert in another buffer |
Date: |
Thu, 9 Dec 2004 19:28:01 +0100 |
I am internationalising an application, and am trying to write a simple
emacs lisp function to kill the current region, insert a message into a
resource file in another buffer and then insert code to retrieve and
display the message.
The problem I have is that after I have executed my function the point
in the resource file is at the beginning of the inserted message. I
want it to be at the end, so when I run my function several times the
messages appear in the resource file in the order I created them. How
can I do this?
Here's the function:
(defvar fjdjava-message-buffer-name "ApplicationResources.properties")
(defun fjdjava-region-to-message (key)
"Converts the region into a message in the buffer named
`fjdjava-message-buffer-name'"
(interactive "sMessage key: \n")
(kill-region (point) (mark))
(save-excursion
(set-buffer fjdjava-message-buffer-name)
(insert key " = ")
(yank)
(insert "\n"))
(insert "<bean:message key=\"" key "\" />"))
Thanks,
Francis.
- Positioning point after insert in another buffer,
francis <=