emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] Help with my elisp


From: Chris Lowis
Subject: [emacs-wiki-discuss] Help with my elisp
Date: Wed, 30 Mar 2005 10:38:11 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Hello group,

I wrote a little elisp function (almost my first!) to replace a selected name in my planner page with the appropriate bbdb:// link. It works, but I am sure it is a terrible elisp style. Any suggestions on how to improve it ? I hope to learn some good elisp style from you !

(defun crl/planner-create-bbdb-link ()
  (interactive)
  (kill-region (point) (mark))
  (let ((beg (point)))
    (insert "[[bbdb://")
    (yank)
    (insert "][")
    (let ((end (point)))
      (yank)
      (insert "]]")
      (replace-string " " ".*" nil beg end)
      )
    )
  )

The idea is to replace the selected text with [[bbdb://some.*text][some text]] , I am not sure about the (yank)s is that the correct way to do things ?

Chris





reply via email to

[Prev in Thread] Current Thread [Next in Thread]