unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* problem with elisp
@ 2008-10-08 18:57 Seweryn Kokot
  2008-10-08 19:05 ` Nikolaj Schumacher
       [not found] ` <mailman.606.1223492748.25473.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Seweryn Kokot @ 2008-10-08 18:57 UTC (permalink / raw)
  To: help-gnu-emacs

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





^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <mailman.604.1223491809.25473.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2008-10-09 21:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-08 18:57 problem with elisp Seweryn Kokot
2008-10-08 19:05 ` Nikolaj Schumacher
2008-10-08 20:04   ` Seweryn Kokot
2008-10-08 20:33     ` Nikolaj Schumacher
2008-10-09 21:23       ` Seweryn Kokot
     [not found] ` <mailman.606.1223492748.25473.help-gnu-emacs@gnu.org>
2008-10-08 19:25   ` Barry Margolin
     [not found] <mailman.604.1223491809.25473.help-gnu-emacs@gnu.org>
2008-10-08 18:59 ` Joost Kremers

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).