From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luca Ferrari Newsgroups: gmane.emacs.help Subject: Re: creating a function that works for active region or whole buffer Date: Fri, 1 Feb 2013 11:36:49 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1359752916 21587 80.91.229.3 (1 Feb 2013 21:08:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Feb 2013 21:08:36 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 01 22:08:56 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 1U1Nqx-0000cx-2S for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Feb 2013 22:08:55 +0100 Original-Received: from localhost ([::1]:52876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1Nqe-0000uM-QA for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Feb 2013 16:08:36 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1NpV-0000WX-0r for help-gnu-emacs@gnu.org; Fri, 01 Feb 2013 16:08:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U1NoQ-0004Pc-Ux for help-gnu-emacs@gnu.org; Fri, 01 Feb 2013 16:07:24 -0500 Original-Received: from mail-wi0-f175.google.com ([209.85.212.175]:49368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1E52-0003aS-CZ for help-gnu-emacs@gnu.org; Fri, 01 Feb 2013 05:42:48 -0500 Original-Received: by mail-wi0-f175.google.com with SMTP id hq12so405702wib.2 for ; Fri, 01 Feb 2013 02:42:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=iGKKNP42ExQmQIX0tHbRWvmEEimoxD9iejvvHFDz738=; b=bPAmTorvCGvCNahvU061tLgWAzTQr2FfIALpEF5H/Gz0b9zqk8UJfxVdOB2eLLR0cz 4502t8+5LZdk4BvA7R/PGUNQahOeyFL1D/TG4epkS1ApR/Yf+INgrdMGaAKmBWCdLaVM oJZpNC17E/KZm3Psx1VMTJa+aEUiHgPKAP/yPVG0bucXOXyqF84zkHrXTARC1XaZPKvp 5L/oICADx6f0X0o7ohi7yKQrpN7cXbdzFAfaTvVlS5eIN/hR/z/7iiaB6wOarzM0BhCM LeZtnHC5DhFL3kjkiTPcFdEHt8KREYA0NvLAuMtWVTaoVneEZxHCMk53SEjxwGAzxAQG ef1w== X-Received: by 10.180.104.69 with SMTP id gc5mr1812458wib.17.1359715009966; Fri, 01 Feb 2013 02:36:49 -0800 (PST) Original-Received: by 10.194.39.1 with HTTP; Fri, 1 Feb 2013 02:36:49 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: wAkOnK7Qbu5jF0IaqYDWHj0w7gI X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.175 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:88912 Archived-At: On Mon, Jan 28, 2013 at 3:02 PM, Stefan Monnier wrote: > goto-line and line-number-at-pos are expensive operations that count > (and re-count and re-re-count every time) the number of LF chars from > the beginning of the buffer. > I'm using them only at the beginning of the function, and therefore once per function call, that does not sound very expensive to me. What do you suggest instead? Luca