From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleh Krehel Newsgroups: gmane.emacs.devel Subject: Re: beginning-of-defun (again) Date: Thu, 29 Oct 2015 14:07:17 +0100 Message-ID: <87oafhesca.fsf@gmail.com> References: <56320200.4050503@online.de> <87twp951ug.fsf@gmail.com> <87lhal990p.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1446124025 373 80.91.229.3 (29 Oct 2015 13:07:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Oct 2015 13:07:05 +0000 (UTC) Cc: Andreas =?utf-8?Q?R=C3=B6hler?= , emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 29 14:07:00 2015 Return-path: Envelope-to: ged-emacs-devel@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 1Zrmuw-0006sN-DI for ged-emacs-devel@m.gmane.org; Thu, 29 Oct 2015 14:06:58 +0100 Original-Received: from localhost ([::1]:43965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrmuv-0007Nz-VS for ged-emacs-devel@m.gmane.org; Thu, 29 Oct 2015 09:06:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrmur-0007Nu-Oo for emacs-devel@gnu.org; Thu, 29 Oct 2015 09:06:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zrmuo-0003Sx-Ic for emacs-devel@gnu.org; Thu, 29 Oct 2015 09:06:53 -0400 Original-Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:33557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrmuo-0003Sr-8H; Thu, 29 Oct 2015 09:06:50 -0400 Original-Received: by wmeg8 with SMTP id g8so24096770wme.0; Thu, 29 Oct 2015 06:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=lZQwDbUxX88PFZEXBgQehX+CLQwlaafAvF9IJ0ncy94=; b=Dcs8ruPO/FSIzuGKB+4X01BRcTTQNVP6zGLBaFda1wwag81Q3nU2gWGkx8BX8LMgZ7 eXKOko8+hGwsiYZ8+BecLsu2cP3uV2zYZukL+Lgh/EmWGrNa8f+IlTvxkeusjM1VtsBO I+LhpHhRMYU4Tv5uwzvBrx+xTKBSOibpb+M+/Xl2molVCowUkhXb2TcEksh1JnRp9QuG dNGOK96tg++/fDBeMiv+eW40ZCcTC6szdxw4QhBksQ4nQxbq4K8L8qXgUhg1OzncYyFW 13SYJJnMvUoF1b3HPtrszO6QqVybZVCUOiJcxnCfNvVDTB0oup8gNnMe/VNS89zFDXQH mEhg== X-Received: by 10.28.54.3 with SMTP id d3mr3594786wma.13.1446124009546; Thu, 29 Oct 2015 06:06:49 -0700 (PDT) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by smtp.gmail.com with ESMTPSA id t126sm3431303wmd.23.2015.10.29.06.06.48 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 29 Oct 2015 06:06:48 -0700 (PDT) In-Reply-To: <87lhal990p.fsf@fencepost.gnu.org> (David Kastrup's message of "Thu, 29 Oct 2015 13:03:34 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192889 Archived-At: David Kastrup writes: > Oleh Krehel writes: > >> Hi Andreas, >> >> Andreas R=C3=B6hler writes: >> >>> maybe it's time to have a reasonable default-behavior of >>> beginning-of-defun in Emacs Lisp. >> >> I think it works pretty well as is. >> >>> open-paren-in-column-0-is-defun-start >> >> It's a strange variable that doesn't seem to do anything. > > Huh? Please give an example then. I'm not able to see a difference when it's unset. >> The only relevant setting is 0 or non-zero (the default). > > Huh?!? The only relevant settings are nil and non-nil. The only relevant use is: if (!open_paren_in_column_0_is_defun_start) { find_start_value =3D BEGV; find_start_value_byte =3D BEGV_BYTE; goto found; } Note that it's not checked against Qnil. It may be that Qnil is conveniently defined to be 0 though, I'm not sure. > Speeds up syntax highlighting by giving it anchor points. If you > encounter > > ( > > in a file, that counts as the start of some list even without looking > whether it might be part of something like I see. I wonder what the speed-up factor is. For example in org.el. >>> A function resp. top-level-form starts if the beginning of a list is >>> followed by a respective keyword. >>> The list of keywords being customizable seems a plus :) >> >> There's no reason for a defun to not start on a newline. > > But there's a reason for non-defuns to start on a newline. I call these defuns anyway.