From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Patch] hard-widen-limits [was Re: Syntax tables for multiple modes [was: bug#22983: syntax-ppss returns wrong result.]] Date: Sat, 30 Apr 2016 10:06:51 -0400 Message-ID: References: <20160311151512.GD2888@acm.fritz.box> <20160314151621.GF1894@acm.fritz.box> <874mc2dqtk.fsf@gmail.com> <87egb5cpmg.fsf@gmail.com> <87a8lsd4j3.fsf@gmail.com> <87mvpsbeok.fsf_-_@gmail.com> <87pounew9e.fsf@gmail.com> <87twjzda4h.fsf@gmail.com> <87lh5bd4ib.fsf@gmail.com> <87egb3ryjc.fsf@gmail.com> <877fgusum3.fsf@gmail.com> <8737risu8d.fsf@gmail.com> <87twilq2te.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1462025234 9560 80.91.229.3 (30 Apr 2016 14:07:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 Apr 2016 14:07:14 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 30 16:07:06 2016 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 1awVXz-0007Zu-41 for ged-emacs-devel@m.gmane.org; Sat, 30 Apr 2016 16:07:03 +0200 Original-Received: from localhost ([::1]:58537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awVXv-0007So-CL for ged-emacs-devel@m.gmane.org; Sat, 30 Apr 2016 10:06:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awVXm-0007Es-DB for emacs-devel@gnu.org; Sat, 30 Apr 2016 10:06:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awVXa-0006hc-O1 for emacs-devel@gnu.org; Sat, 30 Apr 2016 10:06:44 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:45389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awVXa-0006c9-Hg for emacs-devel@gnu.org; Sat, 30 Apr 2016 10:06:38 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1awVXQ-0007Dy-KQ for emacs-devel@gnu.org; Sat, 30 Apr 2016 16:06:28 +0200 Original-Received: from c-24-91-183-66.hsd1.ct.comcast.net ([24.91.183.66]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 Apr 2016 16:06:28 +0200 Original-Received: from monnier by c-24-91-183-66.hsd1.ct.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 Apr 2016 16:06:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-24-91-183-66.hsd1.ct.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:L9p7C7OWEyOaQ2GZiMFRAExyHdk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:203450 Archived-At: > Stefan, adding extra argument turned to be a train wreck. I am afraid, if I > cannot get help on how to extend primitives, I am giving up at this point. Indeed, I didn't consider the fact that some (most?) of those functions are also implemented as bytecode. Hmm... > case (Bbobp): > - PUSH (Fbobp ()); > + TOP = Fbobp (TOP); > NEXT; You can't change the bytecode's behavior since existing .elc files will otherwise break down completely since the stack's will be modified in a way it doesn't expect [ For new .elc files you could make it work by changing bytecomp.el to update the byte compiler's understanding of how the bytecode works. ] So for functions that have a corresponding bytecode, you can either stop using the bytecode when the new arg is used (this requires changing bytecomp.el accordingly, e.g. by removing the corresponding code such as "(byte-defop 125 -1 byte-narrow-to-region)"), or you leave the function unchanged and introduce another function instead. Having a bytecode for `narrow-to-region` is not very useful (the main/only benefit is speed of executing narrow-to-region, but the difference shouldn't be significant) so it'd be perfectly OK to stop using this bytecode. For `bobp` I'm not completely sure of the potential performance impact, OTOH. Stefan