[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problem with elisp
From: |
Seweryn Kokot |
Subject: |
problem with elisp |
Date: |
Wed, 08 Oct 2008 20:57:52 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Hello,
Could you explain to me why the following function doesn't work in the first
version and when swapping line
(let ((string-temp (make-temp-name "")))
with
(let ((string-temp "@temp@"))
it works correctly?
(defun my-swap-string (string-a string-b)
(interactive "sFirst string to swap: \nsSecond string to swap: ")
(save-excursion
(let ((string-temp (make-temp-name ""))) ; this doesn't work
;; (let ((string-temp "@temp@")) ; this works
(goto-char (point-min))
(while (search-forward string-a nil t)
(replace-match string-temp))
(goto-char (point-min))
(while (search-forward string-b nil t)
(replace-match string-a))
(goto-char (point-min))
(while (search-forward string-temp nil t)
(replace-match string-b)))))
Thanks in advance.
--
regards,
Seweryn
- problem with elisp,
Seweryn Kokot <=
- Message not available