From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 15 13:15:08 2020 Received: (at submit) by debbugs.gnu.org; 15 Nov 2020 18:15:09 +0000 Received: from localhost ([127.0.0.1]:54135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keMYO-0001N2-Li for submit@debbugs.gnu.org; Sun, 15 Nov 2020 13:15:08 -0500 Received: from lists.gnu.org ([209.51.188.17]:51116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keMYJ-0001Mn-I2 for submit@debbugs.gnu.org; Sun, 15 Nov 2020 13:15:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keMYJ-0000Sy-D1 for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 13:15:03 -0500 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]:40470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1keMYH-0001HM-Er for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 13:15:03 -0500 Received: by mail-oi1-x22a.google.com with SMTP id m143so16374852oig.7 for ; Sun, 15 Nov 2020 10:15:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jimeh-me.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=ppXbawjKCkNQJ9ODS/G3X3OZUKYwRD13wcjj6dOotdE=; b=agExlpnL00QttqQFplj64yDRVOQSNGzxJxOsXZnpT4w7qPgGEssBK8Y3r+axnRsLw6 itkZKfSmyF5cVGNDsEUvGOdsVHk+uwYhWTxuECZw3ZpISFOTxuas7gGlx8Jw1pTcGwjs HzbAyHnfK1M25B5UYfJuCXFpYU3J8qGcrJ75Dw2iR7DcNpJjBkgmWMxHV9hAoFuSxshZ mfrmVVfiDRZFcYIgKB3BB0KNevtKReK9lnWwVeEYg+uoni10UtLOgUzcIE4HThWQ8XmX CdqK5ZHyU4/2/L3TVZzBlBa19f6fuCkvIo5nMmnHkD4K3fKbqCxtFk/Qq2y9+XpRZ7pI 8uIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=ppXbawjKCkNQJ9ODS/G3X3OZUKYwRD13wcjj6dOotdE=; b=FrmYEb7C0jn6qMf0xriQTWY+MM3oE/Z1oAQ263BKgEfCmMyl80/9+uydmlGfrWtlH3 Qka1EBsH6A822ECtrHt4/aG8z4GBw3HmQ3XItQN9eqPS00v9IvIwNuMRORxTdsY6yjYG a/1uS3tBPO+e6Tjd1hBzbs1kUX8vu4hnX3oW8cMTG+PoKxuk0z/XLpabrmZv4OrswBGo 343oKOh6ZkCcLuejT0Hid7WPZNRX0QCR0GfQdDDOa/eNlY/Rl6bbX9znn5Ji22UUPLlk 3gBXwVWnLlKUcsySDaI7nQYCaDe8sx7OCJSodBNbgEmPofT2YcMe5QALQR9YxRXkUwCv 17/Q== X-Gm-Message-State: AOAM5332QDhWBULwzZLOVQMFLNVCl7qdWG9PLa2WM0Ke9SBx7Dkz+tpj mq/KDEIsdEeK9bG8GlUqNHtS/yjW4E1UVbV62FxBDxTe5D+u4BaX X-Google-Smtp-Source: ABdhPJxJMxmQZnut9+1BvLFLwMV1bSqx52SWs8NlK9TLCSb6Ol6tPAUt316SHnNE4Gu2uAmbYBIEXtvUKO3XAPRita0= X-Received: by 2002:aca:180a:: with SMTP id h10mr7621168oih.4.1605464098821; Sun, 15 Nov 2020 10:14:58 -0800 (PST) MIME-Version: 1.0 From: Jim Myhrberg Date: Sun, 15 Nov 2020 18:14:48 +0000 Message-ID: Subject: [feature/native-comp] defalias to macro in compiled elisp seems to not work in smartparens To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: none client-ip=2607:f8b0:4864:20::22a; envelope-from=contact@jimeh.me; helo=mail-oi1-x22a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, After the following pull request was merged: https://github.com/Fuco1/smartparens/pull/958 I started getting this error: Error running timer =E2=80=98sp-show--pair-function=E2=80=99: (invalid-= function sp--while-no-input) The offending code seems to be: (defalias 'sp--while-no-input 'while-no-input) And then later the call to "sp--while-no-input" within the "sp-show--pair-function" function. If I manually eval the "sp-show--pair-function" so it's no longer a natively compiled function, things start working again. For now in my personal config (which is not native-compiled), I've resorted to this work-around which seems to work: (defun sp--while-no-input (&rest body) (eval (append '(while-no-input) body))) Thanks again :) From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 15 15:42:50 2020 Received: (at 44660) by debbugs.gnu.org; 15 Nov 2020 20:42:50 +0000 Received: from localhost ([127.0.0.1]:54269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keOrK-000560-5b for submit@debbugs.gnu.org; Sun, 15 Nov 2020 15:42:50 -0500 Received: from mx.sdf.org ([205.166.94.24]:61745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keOrE-00055o-B8 for 44660@debbugs.gnu.org; Sun, 15 Nov 2020 15:42:48 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0AFKghsn029460; Sun, 15 Nov 2020 20:42:43 GMT From: Andrea Corallo To: Jim Myhrberg Subject: Re: bug#44660: [feature/native-comp] defalias to macro in compiled elisp seems to not work in smartparens References: Date: Sun, 15 Nov 2020 20:42:42 +0000 In-Reply-To: (Jim Myhrberg's message of "Sun, 15 Nov 2020 18:14:48 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44660 Cc: 44660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Jim Myhrberg writes: > Hi, > > After the following pull request was merged: > https://github.com/Fuco1/smartparens/pull/958 > > I started getting this error: > > Error running timer =E2=80=98sp-show--pair-function=E2=80=99: (invali= d-function > sp--while-no-input) > > The offending code seems to be: > > (defalias 'sp--while-no-input 'while-no-input) > > And then later the call to "sp--while-no-input" within the > "sp-show--pair-function" function. If I manually eval the > "sp-show--pair-function" so it's no longer a natively compiled > function, things start working again. > > For now in my personal config (which is not native-compiled), I've > resorted to this work-around which seems to work: > > (defun sp--while-no-input (&rest body) > (eval (append '(while-no-input) body))) > > Thanks again :) Hi Jim, does the attached patch to smartparens.el fix the issue? Ciao! Andrea --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=smartparens.patch diff --git a/smartparens.el b/smartparens.el index ea5221a..2822074 100644 --- a/smartparens.el +++ b/smartparens.el @@ -9408,44 +9408,45 @@ support custom pairs." (sp-show--pair-enc-function ok))) (execute-kbd-macro cmd)))) -(defalias 'sp--while-no-input 'while-no-input) -(when (version< emacs-version "27") - ;; Ripped from Emacs 27.0 subr.el. - ;; See Github Issue#946 and Emacs bug#31692. - (defmacro sp--while-no-input (&rest body) - "Execute BODY only as long as there's no pending input. +(eval-when-compile + (defalias 'sp--while-no-input 'while-no-input) + (when (version< emacs-version "27") + ;; Ripped from Emacs 27.0 subr.el. + ;; See Github Issue#946 and Emacs bug#31692. + (defmacro sp--while-no-input (&rest body) + "Execute BODY only as long as there's no pending input. If input arrives, that ends the execution of BODY, and `while-no-input' returns t. Quitting makes it return nil. If BODY finishes, `while-no-input' returns whatever value BODY produced." - (declare (debug t) (indent 0)) - (let ((catch-sym (make-symbol "input"))) - `(with-local-quit - (catch ',catch-sym - (let ((throw-on-input ',catch-sym) - val) - (setq val (or (input-pending-p) - (progn ,@body))) - (cond - ;; When input arrives while throw-on-input is non-nil, - ;; kbd_buffer_store_buffered_event sets quit-flag to the - ;; value of throw-on-input. If, when BODY finishes, - ;; quit-flag still has the same value as throw-on-input, it - ;; means BODY never tested quit-flag, and therefore ran to - ;; completion even though input did arrive before it - ;; finished. In that case, we must manually simulate what - ;; 'throw' in process_quit_flag would do, and we must - ;; reset quit-flag, because leaving it set will cause us - ;; quit to top-level, which has undesirable consequences, - ;; such as discarding input etc. We return t in that case - ;; because input did arrive during execution of BODY. - ((eq quit-flag throw-on-input) - (setq quit-flag nil) - t) - ;; This is for when the user actually QUITs during - ;; execution of BODY. - (quit-flag - nil) - (t val)))))))) + (declare (debug t) (indent 0)) + (let ((catch-sym (make-symbol "input"))) + `(with-local-quit + (catch ',catch-sym + (let ((throw-on-input ',catch-sym) + val) + (setq val (or (input-pending-p) + (progn ,@body))) + (cond + ;; When input arrives while throw-on-input is non-nil, + ;; kbd_buffer_store_buffered_event sets quit-flag to the + ;; value of throw-on-input. If, when BODY finishes, + ;; quit-flag still has the same value as throw-on-input, it + ;; means BODY never tested quit-flag, and therefore ran to + ;; completion even though input did arrive before it + ;; finished. In that case, we must manually simulate what + ;; 'throw' in process_quit_flag would do, and we must + ;; reset quit-flag, because leaving it set will cause us + ;; quit to top-level, which has undesirable consequences, + ;; such as discarding input etc. We return t in that case + ;; because input did arrive during execution of BODY. + ((eq quit-flag throw-on-input) + (setq quit-flag nil) + t) + ;; This is for when the user actually QUITs during + ;; execution of BODY. + (quit-flag + nil) + (t val))))))))) (defun sp-show--pair-function () "Display the show pair overlays and print the line of the --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 15 17:33:01 2020 Received: (at 44660) by debbugs.gnu.org; 15 Nov 2020 22:33:01 +0000 Received: from localhost ([127.0.0.1]:54487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keQZx-00082I-E4 for submit@debbugs.gnu.org; Sun, 15 Nov 2020 17:33:01 -0500 Received: from mail-oi1-f177.google.com ([209.85.167.177]:33225) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keQZv-00081d-Pl for 44660@debbugs.gnu.org; Sun, 15 Nov 2020 17:33:00 -0500 Received: by mail-oi1-f177.google.com with SMTP id k26so16877454oiw.0 for <44660@debbugs.gnu.org>; Sun, 15 Nov 2020 14:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jimeh-me.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=p3I5G+ScKC62aMeDzU6UxTYxwuZN7ZhH4dVLwhT60wk=; b=19DODadHkfgsd0a2s9x+Je0SA8V4Sb/Jcf+bIZkYdbLEIvdDkaXbR9HVimhgxUAZbF Ab8jdQPOYhRQw2fZdql8U73UhcKJVPiBZWAvtSdXU8/OAY+dgXvidDmkyPkvATXRKym2 JqkbJMjQhdQ6YZE/idUzAtGXoAdkyJeUHCMhgBTLdM5KQ9LWt/cS24N3WrrsmgwFhi9z t9rsAXcVuRHY/5MrZVjsB6eJ58obqcmg4mRliTZvJ1RF1sP6vqohDrT3vgRMc9tgH4Ix x2+7TZAMZvhfLxVFHGf2yXrD3u2c+OxVOmgEH1SK3UCeFJgY0e8zTstiuM/TJX1W2JH/ M0Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=p3I5G+ScKC62aMeDzU6UxTYxwuZN7ZhH4dVLwhT60wk=; b=qaubf8ID3vKlasdYxV/YpR1GeUXFHLVgEh3q4GiSzMt/D+iCRH79aQUopzGt2GIYn3 tzz1IabcrXFux7970jt/6nQzoG3oE+O696wD8TpCtvWSeegnUk4etdL9+evf9JKpoift YkU4igJkL0+72AX9DxUWT2MRlgrJIZD8DFqzh8NLTwifyZBTndUcwfKPMoj5mwdYVSCf t9QBizkaoK5g2kWk3VwCRBH/pqWJq6uyO48/vanfudKS5jgoZwhqjUC1JgJ4APd9ZcOd JJ6eJSILwExvC7BvnVXLPRmbPVJzDNbNaqBV3CE7vjz2i9XiJDMVh1uKQ0jAUnRMi2Cs Ny6w== X-Gm-Message-State: AOAM532SEwPC157EXkuB3XoaxM4AkPvu/x16wuNAta9mNcP9ENUovQgt kpI+wUZxBxDvVbCpP9YItFb+G/6UCsZcBtUmR1UrSQ== X-Google-Smtp-Source: ABdhPJzjkI2nk29z1qwk1eoiB9bDGCpSJRHunBl8x99NnFfm/8PUSifmoZ7z1Ph0dgadkRRY4b4CQNv/q8Dp7A+Yc8k= X-Received: by 2002:aca:180a:: with SMTP id h10mr8023606oih.4.1605479573737; Sun, 15 Nov 2020 14:32:53 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jim Myhrberg Date: Sun, 15 Nov 2020 22:32:42 +0000 Message-ID: Subject: Re: bug#44660: [feature/native-comp] defalias to macro in compiled elisp seems to not work in smartparens To: Andrea Corallo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 44660 Cc: 44660@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Andrea, Yep, it does indeed fix it. I assume it's related to byte compilation then, and not native-comp? Thanks for your quick response, and I'm sorry for wasting your time with this :( On Sun, Nov 15, 2020 at 8:42 PM Andrea Corallo wrote: > > Jim Myhrberg writes: > > > Hi, > > > > After the following pull request was merged: > > https://github.com/Fuco1/smartparens/pull/958 > > > > I started getting this error: > > > > Error running timer =E2=80=98sp-show--pair-function=E2=80=99: (inva= lid-function > > sp--while-no-input) > > > > The offending code seems to be: > > > > (defalias 'sp--while-no-input 'while-no-input) > > > > And then later the call to "sp--while-no-input" within the > > "sp-show--pair-function" function. If I manually eval the > > "sp-show--pair-function" so it's no longer a natively compiled > > function, things start working again. > > > > For now in my personal config (which is not native-compiled), I've > > resorted to this work-around which seems to work: > > > > (defun sp--while-no-input (&rest body) > > (eval (append '(while-no-input) body))) > > > > Thanks again :) > > Hi Jim, > > does the attached patch to smartparens.el fix the issue? > > Ciao! > > Andrea > From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 16 09:38:21 2020 Received: (at 44660-done) by debbugs.gnu.org; 16 Nov 2020 14:38:21 +0000 Received: from localhost ([127.0.0.1]:55492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kefe9-0005E3-4d for submit@debbugs.gnu.org; Mon, 16 Nov 2020 09:38:21 -0500 Received: from mx.sdf.org ([205.166.94.24]:50827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kefe4-0005Ds-Oh for 44660-done@debbugs.gnu.org; Mon, 16 Nov 2020 09:38:19 -0500 Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTP id 0AGEcFCY002351; Mon, 16 Nov 2020 14:38:15 GMT From: Andrea Corallo To: Jim Myhrberg Subject: Re: bug#44660: [feature/native-comp] defalias to macro in compiled elisp seems to not work in smartparens References: Date: Mon, 16 Nov 2020 14:38:15 +0000 In-Reply-To: (Jim Myhrberg's message of "Sun, 15 Nov 2020 22:32:42 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 44660-done Cc: 44660-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jim Myhrberg writes: > Hi Andrea, > > Yep, it does indeed fix it. I assume it's related to byte compilation > then, and not native-comp? Thanks for your quick response, and I'm > sorry for wasting your time with this :( Hi Jim, yes this "front-end" related. To have top level forms taking effect in the compile time those has to be enclosed into `eval-when-compile' or `cl-eval-when'. You should be able to see the same issue from command line using like `batch-byte-compile-file'. I'm closing this, thanks for reporting! Andrea From unknown Sun Jun 15 08:50:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 15 Dec 2020 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator