From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: A question about cycle-spacing--context Date: Mon, 26 Jan 2015 00:28:19 +0100 Message-ID: <87twzefnjg.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1422228526 16490 80.91.229.3 (25 Jan 2015 23:28:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Jan 2015 23:28:46 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 26 00:28:42 2015 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 1YFWbi-0004pE-2o for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Jan 2015 00:28:42 +0100 Original-Received: from localhost ([::1]:39323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFWbh-0000pR-4i for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Jan 2015 18:28:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFWbV-0000pK-F0 for help-gnu-emacs@gnu.org; Sun, 25 Jan 2015 18:28:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFWbR-0004FD-EK for help-gnu-emacs@gnu.org; Sun, 25 Jan 2015 18:28:29 -0500 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:36749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFWbR-0004F9-7Y for help-gnu-emacs@gnu.org; Sun, 25 Jan 2015 18:28:25 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id AB6BA4AC58 for ; Mon, 26 Jan 2015 00:28:24 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G-OeBTs6vdc6 for ; Mon, 26 Jan 2015 00:28:24 +0100 (CET) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 5F52F4AC4F for ; Mon, 26 Jan 2015 00:28:24 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 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:102266 Archived-At: Hello Emacsers, as I mentioned elsewhere, I'm studying simple.el (whose name I consider a bit, hm, ironic;-)). Here's what I found in the definition of cycle-spacing: (cons n (cons orig-pos (buffer-substring start (point)))) Is there any particular reason for using this instead of just (list n orig-pos (buffer-substring start (point)))? (Of course, the results are formally different, but functionally the same, and in the current implementation, thus defined cycle-spacing--context is not even a "proper", nil-terminated list!) I understand that the current implementation saves memory (but taking into account that there is one instance of cycle-spacing--context per Emacs instance (!), this is negligible). I guess it *might* improve performance - but again, this is an interactive command clearly not intended for non-interactive use, so saving a microsecond or two (and I guess much less in reality) is not really a gain. OTOH, we pay for this with less readable code. So, my question is: (1) why is that so and (2) would it be a good practice to employ such an idea in my own code? (I suppose the answers are (1) why not? and (2) no, but I'd like to ask anyway.) Also, this is yet another time I see a symbol with two consecutive dashes. This might be a naive question, but is there any convention used here that I do not know of? TIA, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University