Stefan Kangas <stefankangas@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 51614) by debbugs.gnu.org; 7 Oct 2022 00:09:34 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 06 20:09:34 2022 Received: from localhost ([127.0.0.1]:33858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ogavm-0001pp-BX for submit <at> debbugs.gnu.org; Thu, 06 Oct 2022 20:09:34 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:53036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <raaahh@HIDDEN>) id 1ogavk-0001pd-O1 for 51614 <at> debbugs.gnu.org; Thu, 06 Oct 2022 20:09:33 -0400 Received: by mail-wm1-f48.google.com with SMTP id l8so1978281wmi.2 for <51614 <at> debbugs.gnu.org>; Thu, 06 Oct 2022 17:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date; bh=AW9sbFwVq1B17BvR8LVJ9AVWW/5FJ2v+jeobff2NJak=; b=A/5b02b22gUC4g9fFR7Hmd/B0ugx4W57ZKV2DjIpVqFguMII3MVxRjiYIx+53daV9i k2MnzSAN6Q0Xd1bD2RY1lfPcjAjRLBw9T72/wCC4DabsSCTvlfmgeFrgREeZ9vsDHIfy DQOu08U4AWdbLwtP3InO7oPNqRCwUq8yiXX4Y05IkY06WId6F0g49RB8lGgBPEMt+ixX 0mFlck8c5HcPTNTIAtgWWcj/sZWrGg+5Xp2jvI9ngGAwskKt6nGtxU+qcSx1AywSjz1r c+duB0hTQs9pgVAPZb8OzSKJuHzP9gwBEKII+pGPDNJQ/9vOw6p4gA/29lXP6HpfxMzV gZnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date; bh=AW9sbFwVq1B17BvR8LVJ9AVWW/5FJ2v+jeobff2NJak=; b=oylA7VHdRuHwNxUJ1GnKoS6vZfHPxggKGafEQcQt+AnJTZ2d6hFC1YU2gRgzb4XEJl faEDjq9vS0YNS7KdoFiTeRefZl0X65G4oRVdqUTcuI4Xfz9sx/tx+2Pg895t5wdw5rH6 w5nqJz607NopTrY8RFuJhnBr17Y5MjqdLbW7LrOL1z8Hec3zGjZZpLSy9jYMjaBIO4tl n3seXiHMU44mQ1nrLAyuJhffUW4XqeO6AfH/Vn4LJ3U52bQNFohvOKk9aV8X7eyI6msW HAyUpUDL2yhoR9QCb1tt5TfgQLDMaCW8kFmvNJHpRjiIPf1Z0O2NP2MMcwqIb+5ofgM0 68Nw== X-Gm-Message-State: ACrzQf2lhPxqwEWFUq48A0HoPMrvNPQEApROhn/YbTD2Z2GVuq3uA/SV 8skfxuwd6i/rhdjR9M7YdNc= X-Google-Smtp-Source: AMsMyM6lZjSbDzcIu8ykga09AAliRLgUxmphO6tht2l3T5zrx3df7PyfGzfAHak1vmy1NrJJ6RxoFg== X-Received: by 2002:a05:600c:2143:b0:3bd:5dbf:e28b with SMTP id v3-20020a05600c214300b003bd5dbfe28bmr1498680wml.158.1665101366681; Thu, 06 Oct 2022 17:09:26 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id l5-20020adfe9c5000000b0022da3977ec5sm524992wrn.113.2022.10.06.17.09.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Oct 2022 17:09:26 -0700 (PDT) Message-ID: <e5cd9fb3-27bd-de44-ec3e-77dbaa18e149@HIDDEN> Date: Fri, 7 Oct 2022 03:09:24 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: bug#51614: 29.0.50; [PATCH] vc-switches ignore file or directory variables Content-Language: en-US To: Lars Ingebrigtsen <larsi@HIDDEN>, Aleksandr Vityazev <avityazev@HIDDEN> References: <875yt68skq.fsf@HIDDEN> <87mtb7rg93.fsf@HIDDEN> From: Dmitry Gutov <dgutov@HIDDEN> In-Reply-To: <87mtb7rg93.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 51614 Cc: 51614 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) On 10.09.2022 07:43, Lars Ingebrigtsen wrote: >> + (let* ((buffer (other-buffer (current-buffer) t)) >> + (switches >> + (or (when backend >> + (let ((sym (vc-make-backend-sym >> + backend (intern (concat (symbol-name op) >> + "-switches"))))) >> + (when (boundp sym) (buffer-local-value sym buffer)))) >> + (let ((sym (intern (format "vc-%s-switches" (symbol-name op))))) >> + (when (boundp sym) (buffer-local-value sym buffer))) >> + (cond >> + ((eq op 'diff) diff-switches))))) > I don't think using `other-buffer' here is a reliable way of getting the > buffer we're interested in here, so I think this would have to be fixed > in a different way. Right. > I'm adding Dmitry to the CCs; perhaps he has some comments here. I was thinking vc-switches could have a new, optional argument: buffer. But even that seems hard to get ahold of in vc-diff-internal (the FILES var might have one element, which is a directory, with no visiting buffers). Perhaps support for this would need to be added on command-by-command basis, with some helper which would collect all buffer-local vars and bind them dynamically. Alternatively, we could support setting 'vc-XX-switches' to a function value. That function could take the current default-directory and compute the value based on it. I'm not sure if that'll fit Aleksandr's workflow, though.
bug-gnu-emacs@HIDDEN
:bug#51614
; Package emacs
.
Full text available.Lars Ingebrigtsen <larsi@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Lars Ingebrigtsen <larsi@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 51614) by debbugs.gnu.org; 10 Sep 2022 04:43:51 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 10 00:43:51 2022 Received: from localhost ([127.0.0.1]:36104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1oWsLP-0001ap-8l for submit <at> debbugs.gnu.org; Sat, 10 Sep 2022 00:43:51 -0400 Received: from quimby.gnus.org ([95.216.78.240]:53750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <larsi@HIDDEN>) id 1oWsLJ-0001aX-Nc for 51614 <at> debbugs.gnu.org; Sat, 10 Sep 2022 00:43:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YnMXw/upbcnoJQC5Q9sbfAmgmde82TA0fWNGA0vtow0=; b=ARkrwaIMQtA3J2FQS5hhp0aSs+ pEdTTHRyoz7Mz7u8xQ3RvGy/VD1lhLHqrLo4SshEHsrA5vtTtwg8Whdj1tSoz0BmqQHKem7tM/Ltn SIXLHITV7b6ePm0MNTtKHB1/YF0aTcXdlRJyCEVGDSpOqek1ixkD+02KyAC/hHMH6PRo=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <larsi@HIDDEN>) id 1oWsLB-0006Kv-5T; Sat, 10 Sep 2022 06:43:39 +0200 From: Lars Ingebrigtsen <larsi@HIDDEN> To: Aleksandr Vityazev <avityazev@HIDDEN> Subject: Re: bug#51614: 29.0.50; [PATCH] vc-switches ignore file or directory variables In-Reply-To: <875yt68skq.fsf@HIDDEN> (Aleksandr Vityazev's message of "Fri, 05 Nov 2021 16:39:49 +0000") References: <875yt68skq.fsf@HIDDEN> X-Now-Playing: Peter Gabriel's _Peter Gabriel 3_: "I Don't Remember" Date: Sat, 10 Sep 2022 06:43:36 +0200 Message-ID: <87mtb7rg93.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Aleksandr Vityazev <avityazev@HIDDEN> writes: > The current implementation of the vc-switches function from > lisp/vc/vc.el ignores the values of vc-BACKEND-diff-switches, > vc-diff-switches set as local directory or file variables. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51614 Cc: 51614 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Aleksandr Vityazev <avityazev@HIDDEN> writes: > The current implementation of the vc-switches function from > lisp/vc/vc.el ignores the values =E2=80=8B=E2=80=8Bof vc-BACKEND-diff-swi= tches, > vc-diff-switches set as local directory or file variables. (I'm going through old bug reports that unfortunately weren't resolved at the time.) > Perhaps the attached patch can solve the problem. [...] > + (let* ((buffer (other-buffer (current-buffer) t)) > + (switches > + (or (when backend > + (let ((sym (vc-make-backend-sym > + backend (intern (concat (symbol-name op) > + "-switches"))))) > + (when (boundp sym) (buffer-local-value sym buffer)))) > + (let ((sym (intern (format "vc-%s-switches" (symbol-name op))))) > + (when (boundp sym) (buffer-local-value sym buffer))) > + (cond > + ((eq op 'diff) diff-switches))))) I don't think using `other-buffer' here is a reliable way of getting the buffer we're interested in here, so I think this would have to be fixed in a different way. I'm adding Dmitry to the CCs; perhaps he has some comments here.
bug-gnu-emacs@HIDDEN
:bug#51614
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 5 Nov 2021 16:39:54 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 05 12:39:54 2021 Received: from localhost ([127.0.0.1]:46986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1mj2Ft-0005Bp-LJ for submit <at> debbugs.gnu.org; Fri, 05 Nov 2021 12:39:53 -0400 Received: from lists.gnu.org ([209.51.188.17]:57186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <avityazev@HIDDEN>) id 1mj2Fo-0005Bd-RU for submit <at> debbugs.gnu.org; Fri, 05 Nov 2021 12:39:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <avityazev@HIDDEN>) id 1mj2Fo-0004Tp-1d for bug-gnu-emacs@HIDDEN; Fri, 05 Nov 2021 12:39:48 -0400 Received: from mout02.posteo.de ([185.67.36.66]:49499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <avityazev@HIDDEN>) id 1mj2Fk-000402-Ao for bug-gnu-emacs@HIDDEN; Fri, 05 Nov 2021 12:39:47 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 18B5A240101 for <bug-gnu-emacs@HIDDEN>; Fri, 5 Nov 2021 17:39:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.org; s=2017; t=1636130378; bh=vq13Kot2f0rDdJTsSlECxTp1KSIy9sU0JFyjaZ4YfWU=; h=From:To:Subject:Date:From; b=Hcm5zQgzgp7L8lW1vlDfnJX2ak06cPBmpUxa7MoLpWUVziIecCtgO8HMwQ548u5bN UHXIGoqIBDm+P6jLBYP9igGzC6H9tZr09rx/mz7KXAJSKTpWUV7xr8fxQZA50uFZOM 0m2pmOdzvlTYUfNknvtcVc58L6nhii8DXnQqVAR6npH9evFpoX18HXnHuwFozKLe/p +1kE6yHZ+/nZmAZLP/AWTlmIDDpWCrZTNxtUUSqLRS9FM5hVvQuakajAwQRj6wFdYE NOQdVa8IHUYgMJYFw1ZVAw1fKgLkO9F2dtSiR7pjqwcHZ07i0ArOgFDRMCRrNlfIAb toFFBZtjSR3hQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Hm5nh55Qrz9rxB for <bug-gnu-emacs@HIDDEN>; Fri, 5 Nov 2021 17:39:36 +0100 (CET) From: Aleksandr Vityazev <avityazev@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: 29.0.50; [PATCH] vc-switches ignore file or directory variables Date: Fri, 05 Nov 2021 16:39:49 +0000 Message-ID: <875yt68skq.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=avityazev@HIDDEN; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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 <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, The current implementation of the vc-switches function from lisp/vc/vc.el ignores the values =E2=80=8B=E2=80=8Bof vc-BACKEND-diff-switc= hes, vc-diff-switches set as local directory or file variables. Here's a reproduction: 1. Run "emacs -Q" 2. "C-x C-f" to open file /tmp/test-project/.dir-locals.el 3. Type this into the buffer: ((nil ((vc-git-diff-switches . ("--binary" "--textconv"))))) 4. "C-x C-s" to save the buffer 5. "C-x C-f" to open the file /tmp/test-project/test.gpg. Without --binary and --textconv, diff will not be displayed for a file with a .gpg extension. 6. Type something in the buffer for example: "Just a test" 7. "C-x C-s" to save the file 8. "C-x v v" to choose VCS backend: in this case, Git and register the file under VCS 9. "C-x v v" to commit changes 10. Type commit message and "C-c C-c" 11. Type something in the buffer with file /tmp/test-project/test.gpg 12. "C-x C-s" to save the buffer 13. "C-x v =3D" to show the diff 14. Bug occurs: diff is not displayed. Perhaps the attached patch can solve the problem. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-vc-vc.el-vc-switches-Handle-dir-local-variables.patch Content-Description: lisp/vc/vc.el From 9b031423294224a6fe142abf6bd469b5cfa99c83 Mon Sep 17 00:00:00 2001 From: Alexandr Vityazev <avityazev@HIDDEN> Date: Thu, 28 Oct 2021 22:43:28 +0300 Subject: [PATCH] * lisp/vc/vc.el (vc-switches): Handle dir local variables. * lisp/vc/vc.el (vc-switches): Handle vc-BACKEND-diff-switches, vc-diff-switches set as local directory or file variables. --- lisp/vc/vc.el | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 927a241a60..a858cbc451 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1700,16 +1700,17 @@ diff only, `diff-switches'. If the chosen value is not a string or a list, return nil. This is so that you may set, e.g. `vc-svn-diff-switches' to t in order to override the value of `vc-diff-switches' and `diff-switches'." - (let ((switches - (or (when backend - (let ((sym (vc-make-backend-sym - backend (intern (concat (symbol-name op) - "-switches"))))) - (when (boundp sym) (symbol-value sym)))) - (let ((sym (intern (format "vc-%s-switches" (symbol-name op))))) - (when (boundp sym) (symbol-value sym))) - (cond - ((eq op 'diff) diff-switches))))) + (let* ((buffer (other-buffer (current-buffer) t)) + (switches + (or (when backend + (let ((sym (vc-make-backend-sym + backend (intern (concat (symbol-name op) + "-switches"))))) + (when (boundp sym) (buffer-local-value sym buffer)))) + (let ((sym (intern (format "vc-%s-switches" (symbol-name op))))) + (when (boundp sym) (buffer-local-value sym buffer))) + (cond + ((eq op 'diff) diff-switches))))) (if (stringp switches) (list switches) ;; If not a list, return nil. ;; This is so we can set vc-diff-switches to t to override -- 2.33.1 --=-=-= Content-Type: text/plain -- Best regards, Aleksandr Vityazev --=-=-=--
Aleksandr Vityazev <avityazev@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#51614
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.