From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "John W. Eaton" Newsgroups: gmane.emacs.devel Subject: Re: [gail@tnp-online.de: octave-mod.el: wrong indentation for "IF", "FOR", etc.] Date: Thu, 11 Oct 2007 21:57:22 -0400 Message-ID: <18190.54402.978037.548816@segfault.lan> References: <18188.40056.604794.828796@mithrandir.hornik.net> <18188.61920.576598.871247@segfault.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1192154278 16717 80.91.229.12 (12 Oct 2007 01:57:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 Oct 2007 01:57:58 +0000 (UTC) Cc: Kurt.Hornik@wu-wien.ac.at, emacs-devel@gnu.org, GAIL , rms@gnu.org, "John W. Eaton" To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 12 03:57:47 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ig9mc-000674-EI for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2007 03:57:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ig9mW-0003WP-Ht for ged-emacs-devel@m.gmane.org; Thu, 11 Oct 2007 21:57:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ig9mT-0003WG-2v for emacs-devel@gnu.org; Thu, 11 Oct 2007 21:57:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ig9mQ-0003Vw-My for emacs-devel@gnu.org; Thu, 11 Oct 2007 21:57:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ig9mQ-0003Vt-HS for emacs-devel@gnu.org; Thu, 11 Oct 2007 21:57:34 -0400 Original-Received: from adsum.doit.wisc.edu ([144.92.197.210]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1Ig9mI-0002qd-Bo; Thu, 11 Oct 2007 21:57:26 -0400 Original-Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0JPS0020103OQ000@smtpauth1.wiscmail.wisc.edu>; Thu, 11 Oct 2007 20:57:24 -0500 (CDT) Original-Received: from segfault.lan (cpe-75-187-161-108.neo.res.rr.com [75.187.161.108]) by smtpauth1.wiscmail.wisc.edu (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0JPS00ND703N3W30@smtpauth1.wiscmail.wisc.edu>; Thu, 11 Oct 2007 20:57:24 -0500 (CDT) In-reply-to: X-Mailer: VM 7.19 under Emacs 22.1.1 X-Spam-PmxInfo: Server=avs-10, Version=5.3.3.310218, Antispam-Engine: 2.5.2.313940, Antispam-Data: 2007.10.11.183426, SenderIP=75.187.161.108 X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:80684 Archived-At: On 11-Oct-2007, Glenn Morris wrote: | "John W. Eaton" wrote: | | > 2007-10-10 John W. Eaton | > | > * progmodes/octave-mod.el (octave-looking-at-kw, | > octave-re-search-forward-kw, octave-re-search-backward-kw): | > New functions. | | Why so complicated - why not just let-bind case-fold search in the | functions that need it? I wanted to avoid repeating the same code in multiple places. Isn't that what subroutines/functions are for? But in any case, my Emacs Lisp skills are minimal. That's one of the reasons I would like for octave-*.el to live only in the Emacs distribution instead of also in the Octave sources. That way, maybe someone who knows Emacs Lisp better than I can take over maintenance. So please fix it as you see fit. | > +(defun octave-re-search-forward-kw (regexp) | > + (let ((case-fold-search nil)) | > + (re-search-forward regexp nil 'move inc))) | > + | > +(defun octave-re-search-backward-kw (regexp) | > + (let ((case-fold-search nil)) | > + (re-search-backward regexp nil 'move inc))) | | It seems ugly to (ab)use the variable `inc' in this way. If you do | want to do it this way, wouldn't it be nicer to use something like: | | (defun octave-re-search-forward (regexp &optional bound noerror count) | "Like `re-search-forward', but sets `case-fold-search' nil." | (let (case-fold-search) | (re-search-forward regexp bound noerror count))) All the uses of these function are searching for kewords, which is why I appended the -kw to the name. I thought it best to simplify the interface to only what is needed. I missed inc, so yes, it should also appear in the argument list. But since the other two arguments are always nil and 'move in this context, I don't see why they need to be exposed in the argument list of the new functions. jwe