From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: beginning-of-defun (again) Date: Thu, 29 Oct 2015 14:28:15 +0100 Message-ID: <87d1vx953k.fsf@fencepost.gnu.org> References: <56320200.4050503@online.de> <87twp951ug.fsf@gmail.com> <87lhal990p.fsf@fencepost.gnu.org> <87oafhesca.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1446125328 23288 80.91.229.3 (29 Oct 2015 13:28:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Oct 2015 13:28:48 +0000 (UTC) Cc: Andreas =?iso-8859-1?Q?R=F6hler?= , emacs-devel@gnu.org To: Oleh Krehel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 29 14:28:48 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 1ZrnFw-0007NX-LY for ged-emacs-devel@m.gmane.org; Thu, 29 Oct 2015 14:28:40 +0100 Original-Received: from localhost ([::1]:44097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrnFv-0004p8-CN for ged-emacs-devel@m.gmane.org; Thu, 29 Oct 2015 09:28:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrnFe-0004on-7j for emacs-devel@gnu.org; Thu, 29 Oct 2015 09:28:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrnFa-0000n0-8K for emacs-devel@gnu.org; Thu, 29 Oct 2015 09:28:22 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrnFY-0000lJ-NP; Thu, 29 Oct 2015 09:28:16 -0400 Original-Received: from localhost ([127.0.0.1]:60685 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZrnFY-0005ai-50; Thu, 29 Oct 2015 09:28:16 -0400 Original-Received: by lola (Postfix, from userid 1000) id C1D60DF96B; Thu, 29 Oct 2015 14:28:15 +0100 (CET) In-Reply-To: <87oafhesca.fsf@gmail.com> (Oleh Krehel's message of "Thu, 29 Oct 2015 14:07:17 +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: 2001:4830:134:3::e 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:192894 Archived-At: Oleh Krehel writes: > David Kastrup writes: > >> Oleh Krehel writes: >> >>> Hi Andreas, >>> >>> Andreas R=F6hler 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. open_paren_in_column_0_is_defun_start is a C variable. You were talking about open-paren-in-column-0-is-defun-start which is a Lisp variable. It is defined using DEFVAR_BOOL: @code{DEFVAR_BOOL} makes a C variable of type @code{int} visible in Lisp with a value that is either @code{t} or @code{nil}. Note that variables defined with @code{DEFVAR_BOOL} are automatically added to the list @code{byte-boolean-vars} used by the byte compiler. >> 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. Can be significant depending on the file. > 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. Then you should be happy with the default setting. --=20 David Kastrup