From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Emacs Lisp Question Date: Thu, 27 Jun 2013 11:33:00 -0400 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1372349118 30110 80.91.229.3 (27 Jun 2013 16:05:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Jun 2013 16:05:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 27 18:05:22 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UsEhG-0000X5-8D for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Jun 2013 18:05:22 +0200 Original-Received: from localhost ([::1]:45200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsEhF-0002hK-R4 for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Jun 2013 12:05:21 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!barmar.motzarella.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Injection-Info: barmar.motzarella.org; posting-host="2be9e9f5dd9af768b8861af71b85fc28"; logging-data="21518"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EfOd6f4NXBH+O1BsyhQga" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:oTSL6G6NzCd4n+Q5iWzYih84ji8= Original-Xref: usenet.stanford.edu gnu.emacs.help:199520 X-Mailman-Approved-At: Thu, 27 Jun 2013 12:04:45 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91783 Archived-At: In article , drain wrote: > (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 suspect it's left over from an old version of the function whose last expression returned the contents of the kill ring (probably before transient mark mode was added to Emacs). If you ran it interactively (e.g. in the *scratch* buffer), this would produce enormous amounts of output. So they put nil there to avoid this. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***