From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 12 10:16:38 2019 Received: (at submit) by debbugs.gnu.org; 12 Nov 2019 15:16:38 +0000 Received: from localhost ([127.0.0.1]:58175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUXuH-0001yz-FE for submit@debbugs.gnu.org; Tue, 12 Nov 2019 10:16:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:53094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUXuD-0001yo-JK for submit@debbugs.gnu.org; Tue, 12 Nov 2019 10:16:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42104) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUXuB-0003LE-N5 for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 10:16:33 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUXuA-0001AZ-32 for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 10:16:31 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:45496) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUXu9-00019Q-Q0 for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 10:16:30 -0500 Received: by mail-wr1-x432.google.com with SMTP id z10so13639528wrs.12 for ; Tue, 12 Nov 2019 07:16:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=GjDgbzlb/rLy6jy8zJqcPZEib/7igHX2okFyBfk3HMs=; b=WiQBzP80jd5lB7U7YHbgKiJjKRql5vgtak/HP0a0y+xR4+FmCeVD1Fr3OT1r9wvNvL bDWfT6Yo9AD1HI/OUlJivTUl4h3wU1ZCEoX3th0swbsZvNWXCvkJ/1X2mURcWNFsDQYV W1QScDHVQx6MNI5fQrIUMw6mp2M9PDHNMha1bPV00cHV2aJQKd/US8mGidVKBCEZq2Sc jJjAFq4jH0s43c3BiFiHQUSytYoCH5x5rYSkdxkU5VVnwgSQ73We/h5GsBmvyAriOURw A6M6YxxhE3hR5yaqT7f8VQWE9aINyiPoxe3OxrSNXnASHNNBk5ydtIKBFwpcYuHTt68d 6WCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=GjDgbzlb/rLy6jy8zJqcPZEib/7igHX2okFyBfk3HMs=; b=m1DTkaavYwRkv6QUVvvtmX7tkEM1doiZJJGnnXisznDTtdLCN3w3XwpDeQ7UWE52eG 4W2/UG8YUwj4kjELnxlQGe8A8we5yHu5d5EPgd1kZt3XCxISHZLxKJxt+PBuce2Rdeo7 j3Ym1rU4Q2WlbDt5HkrJDZuRzWNpphgBrLW2k8umCh4RhOlFknOp5dL9jiQw4BHw8BYr WEIVL/z4ofT0rsyLsM0luM6MYy5VpMjpr3B7EMPqauN5LqB5OQsWaU8qZueWn2EPKLPj +6RpC5vfI03goLH4S2H4vMcBu0G7oG7FRzvjU3qH9gF1bfI9vgFMzgvLdZP20F8tWw47 AykA== X-Gm-Message-State: APjAAAUocPpLGE6RPWs2h9Hq0CO8S9hbqyJGjCLGpbmBEP3HMViM9v0i iOn9LSSv0ord30IqqqSa3Gx346uS X-Google-Smtp-Source: APXvYqyxN/+C+MuCsbuYXQ6eASaUJ8Zz056xjTmRCfJiboFwbEfTBZpFNJv+jiEpSYsdUlWQEvDpLA== X-Received: by 2002:a5d:694d:: with SMTP id r13mr24729623wrw.395.1573571787960; Tue, 12 Nov 2019 07:16:27 -0800 (PST) Received: from gabor.localnet (254C4FA9.nat.pool.telekom.hu. [37.76.79.169]) by smtp.gmail.com with ESMTPSA id x6sm19157004wrw.34.2019.11.12.07.16.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 07:16:26 -0800 (PST) From: Braun =?ISO-8859-1?Q?G=E1bor?= To: bug-gnu-emacs@gnu.org Subject: 26.1; clone-buffer globally unsets locally void variable Date: Tue, 12 Nov 2019 16:16:16 +0100 Message-ID: <10286828.kQ2LJabMkc@gabor> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 X-Spam-Score: 0.9 (/) 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: -2.1 (--) Hi, * Idea: Let's create a test, which sets the default value of a variable but undefines it locally in some buffer. Then clone the buffer and check that the default value of the variable is unchanged, and it is locally undefined in both the original buffer and the clone. * Recipe to reproduce the bug: Create test.el with the following content (there is no empty line in the file): (ert-deftest clone-buffer-unbound-local-variable () "Test `clone-buffer' on locally unbound variables." (let ((var (make-symbol "test"))) (set-default var 1) (with-temp-buffer (makunbound (make-local-variable var)) (let ((buffer (current-buffer)) (clone (clone-buffer))) (unwind-protect (progn (should (eq (default-value var) 1)) (should-not (boundp var)) (with-current-buffer clone (should-not (boundp var)))) (when (buffer-live-p clone) (kill-buffer clone))))))) Run the test: $ emacs -Q -batch -l ert -l test.el -f ert-run-tests-batch-and-exit Running 1 tests (2019-11-12 15:55:39+0100) Test clone-buffer-unbound-local-variable backtrace: signal(void-variable (test)) apply(signal (void-variable (test))) (setq value-2 (apply fn-0 args-1)) (unwind-protect (setq value-2 (apply fn-0 args-1)) (setq form-descri (if (unwind-protect (setq value-2 (apply fn-0 args-1)) (setq form-de (let (form-description-4) (if (unwind-protect (setq value-2 (apply f (let ((value-2 'ert-form-evaluation-aborted-3)) (let (form-descripti (let* ((fn-0 (function eq)) (args-1 (condition-case err (let ((signa (progn (let* ((fn-0 (function eq)) (args-1 (condition-case err (let (unwind-protect (progn (let* ((fn-0 (function eq)) (args-1 (conditio (let ((buffer (current-buffer)) (clone (clone-buffer))) (unwind-prot (progn (makunbound (make-local-variable var)) (let ((buffer (current (unwind-protect (progn (makunbound (make-local-variable var)) (let ( (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-b (let ((var (make-symbol "test"))) (set-default var 1) (let ((temp-bu (lambda nil (let ((var (make-symbol "test"))) (set-default var 1) (l ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test ert-run-test(#s(ert-test :name clone-buffer-unbound-local-variable : ert-run-or-rerun-test(#s(ert--stats :selector t :tests [#s(ert-test ert-run-tests(t #f(compiled-function (event-type &rest event-args) # ert-run-tests-batch(nil) ert-run-tests-batch-and-exit() command-line-1(("-l" "ert" "-l" "test.el" "-f" "ert-run-tests-batch- command-line() normal-top-level() Test clone-buffer-unbound-local-variable condition: (void-variable test) FAILED 1/1 clone-buffer-unbound-local-variable Ran 1 tests, 0 results as expected, 1 unexpected (2019-11-12 15:55:40+0100) 1 unexpected results: FAILED clone-buffer-unbound-local-variable The test failed but it should pass. * Patch to fix the problem When copying buffer local variables, make even undefined variables buffer local before undefining them: =2D-- lisp/simple.el +++ lisp/simple.el @@ -8535,7 +8535,7 @@ (mapc (lambda (v) (condition-case () ;in case var is read-only (if (symbolp v) =2D (makunbound v) + (makunbound (make-local-variable v)) (set (make-local-variable (car v)) (cdr v))) (error nil))) lvars) Best wishes, G=C3=A1bor In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.4) of 2019-02-03, modified by Debian built on zam904 Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Debian GNU/Linux 10 (buster) Recent messages: =46or information about GNU Emacs and the GNU system, type C-h C-a. Ran 1 tests, 0 results were as expected, 1 unexpected scroll-up-command: End of buffer Configured using: 'configure --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --enable-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:= /usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share= /emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --enable-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:= /usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share= /emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars 'CFLAGS=3D-g -O2 -fdebug-prefix-map=3D/build/emacs-26.1+1=3D. -fstack-protector-strong -Wformat -Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' LDFLAGS=3D-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2 Important settings: value of $LANG: hu_HU.UTF-8 locale-coding-system: utf-8-unix Major mode: ERT-Results Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. =46eatures: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-seq cl-extra help-mode cl-macs gv ert pp find-func ewoc easymenu debug cl-loaddefs cl-lib elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 104606 9545) (symbols 48 21227 1) (miscs 40 55 129) (strings 32 30450 1108) (string-bytes 1 805629) (vectors 16 15583) (vector-slots 8 506210 7590) (floats 8 59 58) (intervals 56 284 0) (buffers 992 12)) From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 12 10:38:35 2019 Received: (at 38179) by debbugs.gnu.org; 12 Nov 2019 15:38:35 +0000 Received: from localhost ([127.0.0.1]:58207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUYFW-0002Xi-Ow for submit@debbugs.gnu.org; Tue, 12 Nov 2019 10:38:34 -0500 Received: from mail-qk1-f172.google.com ([209.85.222.172]:36201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUYFV-0002XT-54 for 38179@debbugs.gnu.org; Tue, 12 Nov 2019 10:38:33 -0500 Received: by mail-qk1-f172.google.com with SMTP id d13so14806183qko.3 for <38179@debbugs.gnu.org>; Tue, 12 Nov 2019 07:38:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=duUPpOo/9EwVo5c+ZyvM1GDKodGVfYTTTqo+aNJtyCQ=; b=p6GSukYf5g9og0fBU4Ckt8viHX+7gzwmx2RzEmOUJLB6tylzcX+/k6N6DrbIn3CGCU DcHram8jJ15M7OQp/TH9ONaYu8nvrK5Oq0EXbP+vQH1zOb2cbWyzPkD/ed3Q4JdOYZMQ GRcmn/oAGOmtOUzpy0SPynt7bXdajnCR1DjJBr8asyxkdsrGAkPMHPAcVsrS2jH4zEgu Cx8Jo/V3FApcIhZ0kfnpBdHPd0yi7VmBRVzJFXq0U3aWMr8IC21Bp5hjnlj8tKZxbhJd XTU55wzEctw1VV5b+//e4FrtRZLP7qMWlZ0cJtczBqYXOYWyBzX89qNgZBbUheYriPKQ hR/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=duUPpOo/9EwVo5c+ZyvM1GDKodGVfYTTTqo+aNJtyCQ=; b=CHZF9P81XGB9Cx/lK4s9FeVY0rgluQ6+Vjq+MhSmgC9SqWFc05/sB7IzkEsDxH+mfO aitlRAK70mt7JNvhLfeUOmUyNi1hOwbIknha26/PKqirDDX18nUh6GVAj4fsH/sY1eXp 5dTOoUfej+nqVjsesshVVJHlO02HrY6bHWwmokZiYr5sCp+7sAQEBtauQUoDfUJLG5+a KCAKaAZquit49cHe9Nqe0Ilz/+e0nG7n8jqvZB/bdy89lReMW70NyiWXsA7rSvOBanoC 8hlUl62+QeOYkAmoHlRaZxVVyvYQN+fXDlTV69k/Gnr84iv1Zc7G/NGwVhXuwEw6+1Az Q4fw== X-Gm-Message-State: APjAAAXJ1+sMP7JCiox4ah2M3RAohXhCeGzc1ETnN3xyG3EiOCPbUz/w rwxrX+cOoji4rzaAW3JieOYROwoH X-Google-Smtp-Source: APXvYqyog9i5HARI8ADMH8uzRnofKi2wLxLHqYWJw0N6MS9H/eCsUZgbzSjH7o1gXRP7wEwswk1DIQ== X-Received: by 2002:a37:9d8c:: with SMTP id g134mr16087432qke.352.1573573107406; Tue, 12 Nov 2019 07:38:27 -0800 (PST) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.38.42]) by smtp.gmail.com with ESMTPSA id i189sm9060435qkc.65.2019.11.12.07.38.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 07:38:26 -0800 (PST) From: Noam Postavsky To: Braun =?iso-8859-1?Q?G=E1bor?= Subject: Re: bug#38179: 26.1; clone-buffer globally unsets locally void variable References: <10286828.kQ2LJabMkc@gabor> Date: Tue, 12 Nov 2019 10:38:27 -0500 In-Reply-To: <10286828.kQ2LJabMkc@gabor> ("Braun \=\?iso-8859-1\?Q\?G\=E1bor\=22\?\= \=\?iso-8859-1\?Q\?'s\?\= message of "Tue, 12 Nov 2019 16:16:16 +0100") Message-ID: <85k185jea4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38179 Cc: 38179@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 (-) There is no way to make a "locally void" variable. > Let's create a test, which sets the default value of a variable but > undefines it locally in some buffer. > (with-temp-buffer > (makunbound (make-local-variable var)) That will unbind the global value and local values, not just the local one. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 13 05:17:49 2019 Received: (at 38179) by debbugs.gnu.org; 13 Nov 2019 10:17:49 +0000 Received: from localhost ([127.0.0.1]:58849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUpif-00007G-5d for submit@debbugs.gnu.org; Wed, 13 Nov 2019 05:17:49 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:36830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUpic-000071-Am for 38179@debbugs.gnu.org; Wed, 13 Nov 2019 05:17:47 -0500 Received: by mail-wm1-f51.google.com with SMTP id c22so1353909wmd.1 for <38179@debbugs.gnu.org>; Wed, 13 Nov 2019 02:17:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zxgpb2CZvaRSugvMMnIF0uoe0HiOIQb7WVinAhQ5Gos=; b=bjmXe1nWMwQumLdmk/F0fXX503i0EbpOwvqVXb26cblHYKEdj8Hyx06gwW8wffK7Hl SI06rWvKCEIcncuWZ371mQQLyPRijLF+OqOyDhOBhJS9yyljU5INgHSzTVGpp5ra5QRk P79J2dUZgrFqxbiReXNsnSeLqE0w8XkVT2Zo7C7i1NOayYi1BveAi+1o92E1/hWICR6q A7h9ZTHmEpFP4dqxzBQKjFERiKxtFxTZwYQTuczHOY+nNSh0IX4BvX7KqyKvqdzqb3H9 oei8yxHJvtNwxif++2gzwq/6HM53RXtQKGbHcktXo9yzawt67KhES/y1KehwotfePAYR FRhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zxgpb2CZvaRSugvMMnIF0uoe0HiOIQb7WVinAhQ5Gos=; b=tfcnQiJ9A3cebYqeiDOf/FZyiCEAsfCCV5m9Qjcggy87dV8Rv9AkyqrmofJ82NG/YK nmo9RADmpqOnb8jUyRg63LItaPMV36x3REgAiCBvnKlHcbbtLilOOKi5DfC4URvLob0k D9aJPiWfmV2aOn0jL4Jj5B/o8eXCdE6j5d/2D5uCyv4mr0WBEYjLxa3Fg0jCxZc9ElOQ Mv7e1lC0AEEto/LehakQYdCvv/C4bIr37Z1AQvCif5HnM8uZq8LrYAMP5K2PNHihgsRK GTUgvT2JICPYqzCGh8C7/TxnS8h7myu/iggD6iRdzMAUMrMalQBJkOTVINSCI/VfenDe m08A== X-Gm-Message-State: APjAAAUjIcFQRYQNmslRg/SdUrmTZ0tedt42vAjLzKY3Av8wKTofZqmj u9wCGaGO7Q+Bk0zepmbb4OM= X-Google-Smtp-Source: APXvYqzNI1UpNMSjYh2VmjiJXCDvIxKo19btBgYSzJp0cCQcKUBuLJAGyW0t4wDceSzANESLfqlymQ== X-Received: by 2002:a1c:2395:: with SMTP id j143mr1922069wmj.128.1573640260553; Wed, 13 Nov 2019 02:17:40 -0800 (PST) Received: from gabor.localnet (254C3764.nat.pool.telekom.hu. [37.76.55.100]) by smtp.gmail.com with ESMTPSA id q15sm2320400wrs.91.2019.11.13.02.17.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 02:17:39 -0800 (PST) From: Braun =?ISO-8859-1?Q?G=E1bor?= To: Noam Postavsky Subject: Re: bug#38179: 26.1; clone-buffer globally unsets locally void variable Date: Wed, 13 Nov 2019 11:17:27 +0100 Message-ID: <1978574.4cfOVRSGya@gabor> In-Reply-To: <85k185jea4.fsf@gmail.com> References: <10286828.kQ2LJabMkc@gabor> <85k185jea4.fsf@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 38179 Cc: 38179@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: -0.8 (/) Hi Noam, > > (with-temp-buffer > > (makunbound (make-local-variable var)) >=20 > That will unbind the global value and local values, not just the local > one. My Emacs 26.1 does not seem to behave that way. =46or example, evaluating the following form returns 2: (with-temp-buffer (setq-default test 2) (makunbound (make-local-variable 'test)) (default-value 'test)) Neither the info documentation nor the docstring of makunbound say how=20 makunbound behaves for buffer-local variables, so my assumption was that=20 like other Lisp forms it acts on the buffer-local value of local=20 variables. Best wishes, G=C3=A1bor From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 13 10:41:57 2019 Received: (at 38179) by debbugs.gnu.org; 13 Nov 2019 15:41:57 +0000 Received: from localhost ([127.0.0.1]:60008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUumI-0005do-Vd for submit@debbugs.gnu.org; Wed, 13 Nov 2019 10:41:57 -0500 Received: from mail-qk1-f175.google.com ([209.85.222.175]:33169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUumG-0005da-RJ for 38179@debbugs.gnu.org; Wed, 13 Nov 2019 10:41:53 -0500 Received: by mail-qk1-f175.google.com with SMTP id 71so2127716qkl.0 for <38179@debbugs.gnu.org>; Wed, 13 Nov 2019 07:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=ChL7mBprhKiuCN/89oT6HHP5goYNWIUilNegD+jLzBE=; b=hezOE0RQ0i4vMWCiZLJnOye6HthjyoTH8NKtaypxmPUErwJ6lgLcECityQ7m9y6ejK jp51dnvu6iSgDCs8xJUxKlDgBDjrdiEdFlAwTr0q8xBJ0eMqUAZMfEFraMW48BZcsGMO KqlYgvZ9wPG8WPlBuc4A6a20dsASaQ6/BfzkZ64KDfqrPdJtKMbuGZTYiSECrjIagkO2 dZul02eiJI3W0DYOHYDsshYp02o+ARpVJIEYkK71kASSs0HU+rXgex9kotEux7LNCVRJ LbJ38XfyDB9/FdPoJrHCl79ytq8/no9zGXw6wKfJkx8ew18ZrDguOdQ0xg9BeCetpLAe rDHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=ChL7mBprhKiuCN/89oT6HHP5goYNWIUilNegD+jLzBE=; b=lxBtKg6dZ1xcJ44A/BUpAdd11t+bGGSCp1USXdzAqXExPzMPNX7aWQBYbl4q30+SUU FEawNsDgpgkxLsY0ho2LOocJaTWKwNyLbW1nbL3bKjFA1lt7ZnMT9GrFUPV7yAciPu9D Kgxn9CEKPXuCaQOYEj3VFF1B4MfsRO4j3FmjnvgegoKBPzo2njGbrM+iHPmzvIOdG8LR l6PHCbZW0ncIGXYLBAtI5+AViZoJACE1LNl5tB3/wqrpIy2HfnIummZbFmmtEAMGl22o twQITB4zr74lVC8UkkH4LMQ63xM0ZzNx0KONw5SGJY8QQkA6EmjLS/pCSnhGGIglOamL k0jg== X-Gm-Message-State: APjAAAViHMy2cSv9XBfTxVi+rR7drvrT4THT4rUyJxvnvKe/h/T5HG+v FXeajg6monh9nNlfxiQRRfd9ryUT X-Google-Smtp-Source: APXvYqxmvvhyHYGApkcVcR49E0TwYbDKDMKCBKfopT93wrZNap1zPIZupmae+IOArvv22JNblebrUg== X-Received: by 2002:a37:4bc2:: with SMTP id y185mr3122438qka.474.1573659707040; Wed, 13 Nov 2019 07:41:47 -0800 (PST) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.38.42]) by smtp.gmail.com with ESMTPSA id h44sm1642813qtc.1.2019.11.13.07.41.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Nov 2019 07:41:46 -0800 (PST) From: Noam Postavsky To: Braun =?iso-8859-1?Q?G=E1bor?= Subject: Re: bug#38179: 26.1; clone-buffer globally unsets locally void variable References: <10286828.kQ2LJabMkc@gabor> <85k185jea4.fsf@gmail.com> <1978574.4cfOVRSGya@gabor> Date: Wed, 13 Nov 2019 10:41:47 -0500 In-Reply-To: <1978574.4cfOVRSGya@gabor> ("Braun \=\?iso-8859-1\?Q\?G\=E1bor\=22'\?\= \=\?iso-8859-1\?Q\?s\?\= message of "Wed, 13 Nov 2019 11:17:27 +0100") Message-ID: <85h837kclg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38179 Cc: 38179@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 (-) Braun G=E1bor writes: >> > (with-temp-buffer >> > (makunbound (make-local-variable var)) >>=20 >> That will unbind the global value and local values, not just the local >> one. > > My Emacs 26.1 does not seem to behave that way. > For example, evaluating the following form returns 2: Oh, you're right. I was confused because describe-variable doesn't see the global value when the local value is void. > Neither the info documentation nor the docstring of makunbound say how=20 > makunbound behaves for buffer-local variables, so my assumption was that= =20 > like other Lisp forms it acts on the buffer-local value of local=20 > variables. Yeah, I think the current behaviour is a bit strange, but changing it is probably too risky with regards to backwards compatibility. So I think your patch is correct. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 14 00:46:10 2019 Received: (at 38179) by debbugs.gnu.org; 14 Nov 2019 05:46:10 +0000 Received: from localhost ([127.0.0.1]:60653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iV7xJ-0001K9-RO for submit@debbugs.gnu.org; Thu, 14 Nov 2019 00:46:10 -0500 Received: from quimby.gnus.org ([95.216.78.240]:49542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iV7xH-0001EL-7s for 38179@debbugs.gnu.org; Thu, 14 Nov 2019 00:46:08 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iV7x9-0000jV-Af; Thu, 14 Nov 2019 06:46:01 +0100 From: Lars Ingebrigtsen To: Noam Postavsky Subject: Re: bug#38179: 26.1; clone-buffer globally unsets locally void variable References: <10286828.kQ2LJabMkc@gabor> <85k185jea4.fsf@gmail.com> <1978574.4cfOVRSGya@gabor> <85h837kclg.fsf@gmail.com> Date: Thu, 14 Nov 2019 06:45:58 +0100 In-Reply-To: <85h837kclg.fsf@gmail.com> (Noam Postavsky's message of "Wed, 13 Nov 2019 10:41:47 -0500") Message-ID: <87r22bqacp.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Noam Postavsky writes: >> Neither the info documentation nor the docstring of makunbound say how >> makunbound behaves for buffer-local variables, so my assumption was that >> like other Lisp forms it acts on the buffer-loc [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: ingebrigtsen.no] -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38179 Cc: Braun =?utf-8?Q?G=C3=A1bor?= , 38179@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 (-) Noam Postavsky writes: >> Neither the info documentation nor the docstring of makunbound say how >> makunbound behaves for buffer-local variables, so my assumption was that >> like other Lisp forms it acts on the buffer-local value of local >> variables. > > Yeah, I think the current behaviour is a bit strange, but changing it is > probably too risky with regards to backwards compatibility. > > So I think your patch is correct. OK; I've now applied the patch to Emacs 27. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 14 00:46:18 2019 Received: (at control) by debbugs.gnu.org; 14 Nov 2019 05:46:18 +0000 Received: from localhost ([127.0.0.1]:60656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iV7xS-0001RK-7q for submit@debbugs.gnu.org; Thu, 14 Nov 2019 00:46:18 -0500 Received: from quimby.gnus.org ([95.216.78.240]:49556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iV7xN-0001IQ-6I for control@debbugs.gnu.org; Thu, 14 Nov 2019 00:46:14 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iV7xF-0000jg-FI for control@debbugs.gnu.org; Thu, 14 Nov 2019 06:46:07 +0100 Date: Thu, 14 Nov 2019 06:46:04 +0100 Message-Id: <87pnhvqacj.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #38179 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 38179 fixed close 38179 27.1 quit Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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 (-) tags 38179 fixed close 38179 27.1 quit From unknown Tue Jun 24 13:59:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 12 Dec 2019 12:24:11 +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