help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: problems with save-excursion


From: Peter Lee
Subject: Re: problems with save-excursion
Date: Wed, 15 Mar 2006 14:26:41 GMT
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt)

>>>> filcab  writes:

    >> I have the following function:
    >> (defun copy-line ()
    >>    (interactive)
    >>    (save-excursion
    >>       (beginning-of-line)
    >>       (set-mark-command)
    >>       (end-of-line)
    >>       (copy-region-as-kill)))

    >> But it's not working...

you could do:

(defun copy-line ()
  (interactive)
  (kill-new (thing-at-point 'line)))


reply via email to

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