[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs Lisp Question
From: |
Thorsten Jolitz |
Subject: |
Re: Emacs Lisp Question |
Date: |
Thu, 27 Jun 2013 15:25:38 +0200 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) |
drain <aeuster@gmail.com> writes:
> (defun copy-region-as-kill (beg end)
> "Save the region as if killed, but don't kill it.
> In Transient Mark mode, deactivate the mark.
> If `interprogram-cut-function' is non-nil, also save the text for a
> window
> system cut and paste."
> (interactive "r")
> (if (eq last-command 'kill-region)
> (kill-append (filter-buffer-substring beg end) (< end beg))
> (kill-new (filter-buffer-substring beg end)))
> (if transient-mark-mode
> (setq deactivate-mark t))
> nil)
>
> What is the "nil" doing at the end here? The syntax seems to be:
>
> (defun copy-region-as-kill (beg end) [...] nil)
I think the nil makes sure the function returns nil and not anything
killed in the function body or so. Its seems to be a function called
only for its side-effects, not for its return value.
--
cheers,
Thorsten