From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu 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: Thu, 28 Apr 2016 15:29:33 +0200 Message-ID: <87twilq2te.fsf@gmail.com> References: <20160311151512.GD2888@acm.fritz.box> <2c301ec9-041d-9172-d628-479062314b23@yandex.ru> <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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1461850350 28128 80.91.229.3 (28 Apr 2016 13:32:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Apr 2016 13:32:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 28 15:32:25 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 1avm3N-0002lz-2D for ged-emacs-devel@m.gmane.org; Thu, 28 Apr 2016 15:32:25 +0200 Original-Received: from localhost ([::1]:49190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avm3M-0003ME-IW for ged-emacs-devel@m.gmane.org; Thu, 28 Apr 2016 09:32:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avm0a-0007Pn-Rs for emacs-devel@gnu.org; Thu, 28 Apr 2016 09:29:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avm0Y-0000B0-4p for emacs-devel@gnu.org; Thu, 28 Apr 2016 09:29:32 -0400 Original-Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:36008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avm0X-0000Aw-Qz for emacs-devel@gnu.org; Thu, 28 Apr 2016 09:29:30 -0400 Original-Received: by mail-wm0-x233.google.com with SMTP id n129so65524924wmn.1 for ; Thu, 28 Apr 2016 06:29:29 -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; bh=XQ2rO/a8fOJXw+h01w3fQcRVjeCOGS5gnWGo7mdE4To=; b=s53axaoGgLavaGxTP97/wuBaIlvQGun4reCYoSRsIWlVeI0YfvHEbHEq1W8a+kIINz euik8hd7f/mdXRL3ZNOZSiPiv1ymnMVUVQ00BLzjX3FMxCvduwwy2UifY9AI442xRbHe 2h2G6OMsp7mhYtGt+oZRciZC7tKFczirAprLLM23Dm+/wjIDnSe/uWm+jj8A0TLFNv28 PqkW92iJaqnD7t6JesC77/KxtDFgWNlyk6ef5zsPTbTJCzz58yGCx5Djl/dbcZbolyqN Z0d3byk+pbwjvW2NwGm3/QiXsk4svucIsM82Ut55L9k/GGdgG152r7JdDkMIfGQIELK3 gaRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=XQ2rO/a8fOJXw+h01w3fQcRVjeCOGS5gnWGo7mdE4To=; b=mf1Ul5aHiQhzgBg6AVFiZ3MA+bmY83hSmgaiSJntrgKSuCjM8Z3fCqUZKqeaLDDB6/ ynbMaDQE4oEBx5FJjRzVE2jVBlVqX3+JtwHaQn9j4AgB+TkjC/U/G9+Jw5QjeEVaS5oA 39rSR4yG4rSpACgLrgAQ4HADIP5ZEMJ7qMaCcaCV72ePC5N0ne+J39shbIKo4DVnKh3m tBn2T3uWSbhLGd/Oq9+cYsJ2/wgYxcXgkstOcBPiYWhRJOoRxU7PBUbybqCHGBt2zVVw MNzY3X3IwT29MzyGiT/bliRP5+Gy1rs+TKNFxZ/KvHmPveEdtc6Cag34TB/oYlvtTf1G I0XQ== X-Gm-Message-State: AOPr4FW6c2UoceUl9NACrDAUjCxD5MlONPL7htsOv+jMGzlmGgJ9nYVMao1teXN2YEJ/HQ== X-Received: by 10.194.116.9 with SMTP id js9mr17906994wjb.112.1461850168906; Thu, 28 Apr 2016 06:29:28 -0700 (PDT) Original-Received: from localhost (ma-130-115-180-173.mobile-devices.eur.nl. [130.115.180.173]) by smtp.gmail.com with ESMTPSA id d1sm9671726wjb.47.2016.04.28.06.29.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Apr 2016 06:29:27 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Tue, 22 Mar 2016 07:57:27 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::233 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:203398 Archived-At: --=-=-= Content-Type: text/plain >> On Tue, Mar 22 2016 06:57, Stefan Monnier wrote: > IIRC past discussions on this issue, one option was to merge your > set-widen-limits into narrow-to-region by adding an optional argument `hard'. 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. Adding a dummy argument to Fbobp like this: --=-=-= Content-Type: text/x-diff Content-Disposition: inline 2 files changed, 3 insertions(+), 3 deletions(-) src/bytecode.c | 2 +- src/editfns.c | 4 ++-- modified src/bytecode.c @@ -1589,7 +1589,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, NEXT; CASE (Bbobp): - PUSH (Fbobp ()); + TOP = Fbobp (TOP); NEXT; CASE (Bcurrent_buffer): modified src/editfns.c @@ -1164,10 +1164,10 @@ At the beginning of the buffer or accessible region, return 0. */) return temp; } -DEFUN ("bobp", Fbobp, Sbobp, 0, 0, 0, +DEFUN ("bobp", Fbobp, Sbobp, 0, 1, 0, doc: /* Return t if point is at the beginning of the buffer. If the buffer is narrowed, this means the beginning of the narrowed part. */) - (void) + (Lisp_Object dummy) { if (PT == BEGV) return Qt; --=-=-= Content-Type: text/plain then make extraclean && git clean -f && make bootstrap gives "Wrong type argument" during byte compilation: make[3]: Entering directory '/home/vspinu/bin/emacs-test/lisp' ELC ../lisp/international/eucjp-ms.elc Reloading stale loaddefs.el Loading /home/vspinu/bin/emacs-test/lisp/loaddefs.el (source)... make[3]: Leaving directory '/home/vspinu/bin/emacs-test/lisp' make -C ../admin/unidata all EMACS="../../src/bootstrap-emacs" make[3]: Entering directory '/home/vspinu/bin/emacs-test/admin/unidata' GEN ../../src/macuvs.h GEN ../../lisp/international/charprop.el Wrong type argument: char-or-string-p, # Makefile:87: recipe for target '../../lisp/international/charprop.el' failed make[3]: *** [../../lisp/international/charprop.el] Error 255 make[3]: Leaving directory '/home/vspinu/bin/emacs-test/admin/unidata' Makefile:498: recipe for target '../lisp/international/charprop.el' failed make[2]: *** [../lisp/international/charprop.el] Error 2 make[2]: Leaving directory '/home/vspinu/bin/emacs-test/src' Makefile:398: recipe for target 'src' failed make[1]: *** [src] Error 2 make[1]: Leaving directory '/home/vspinu/bin/emacs-test' GNUmakefile:79: recipe for target 'bootstrap' failed I am defining Bbobp, Fbobp, Sbobp just as it's done with any other primitive with an optional argument. `Fbobp` is never used at C level, so the above diff is complete and could be run as it is. Vitalie --=-=-=--