From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.bugs Subject: bug#44837: 28.0.50; Local-variables: in middle of file wants to get executed Date: Thu, 26 Nov 2020 08:47:50 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27981"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) To: 44837@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 26 06:49:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kiA9W-0007Bl-Rc for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Nov 2020 06:49:10 +0100 Original-Received: from localhost ([::1]:58346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kiA9V-0003Tq-SF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Nov 2020 00:49:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiA9O-0003Rb-6f for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2020 00:49:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54899) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kiA9N-0006fu-WE for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2020 00:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kiA9N-0000kG-TY for bug-gnu-emacs@gnu.org; Thu, 26 Nov 2020 00:49:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jean Louis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Nov 2020 05:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44837 X-GNU-PR-Package: emacs Original-Received: via spool by 44837-submit@debbugs.gnu.org id=B44837.16063697062823 (code B ref 44837); Thu, 26 Nov 2020 05:49:01 +0000 Original-Received: (at 44837) by debbugs.gnu.org; 26 Nov 2020 05:48:26 +0000 Original-Received: from localhost ([127.0.0.1]:38212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kiA8Z-0000jE-Hf for submit@debbugs.gnu.org; Thu, 26 Nov 2020 00:48:26 -0500 Original-Received: from static.rcdrun.com ([95.85.24.50]:55215) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kiA8X-0000iz-Pj for 44837@debbugs.gnu.org; Thu, 26 Nov 2020 00:48:10 -0500 Original-Received: from localhost ([::ffff:41.202.241.56]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by static.rcdrun.com with ESMTPSA id 00000000002C000E.000000005FBF4193.000014C0; Thu, 26 Nov 2020 05:48:02 +0000 Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:194262 Archived-At: I am proposing following changes to the dialogue with unsafe variables: - to include on minibuffer the option ? to READ MANUAL and lead user to the section 49.2.4.2 Safety of File Variables where there are dangerous to data cited - to make the dialogue window with cursor rather than without any cursor how it is now, so that user can click on buttons pointing to the above manual page - to designate some parts as shown below to be buttons to the manual page clickable both from console and from X Emacs - to give user option to permanently mark specific file or directory variables as unsafe and not to be asked again to accept them over and over again as that makes unfair choice to user - if user clicks ? or C-g or tries to escape or anything else but Y or !, then the dialogue should fail and file get loaded just as usual. Upon the next opening of the file everything should go as usual. - to add section in the tutorial that references that variables should not be opened as nothing about these issues is written in the tutorial. One could say that before accepting any variables user shall read the manual section 49.2.4.2 Safety of File Variables, and until full understanding is achieved user is advised not to accept such variables. >From the current template: ========================== The local variables list in /home/data1/protected/x contains values that may not be safe (*). Do you want to apply it? You can type y -- to apply the local variables list. n -- to ignore the local variables list. ! -- to apply the local variables list, and permanently mark these values (*) as safe (in the future, they will be set automatically.) * eval : (when (and (buffer-file-name) (not (file-directory-p (....... Proposed hyperlinks to manual page: =================================== The local variables list in /home/data1/protected/x ^^^^^^^^^^^^^^^ contains values that may not be safe (*). ^^^^^^ ^^^^^^^^^^^^^^^^^^^ Do you want to apply it? You can type y -- to apply the local variables list. ^^^^^^^^^^^^^^^^^^^^^^^^^ n -- to ignore the local variables list. ! -- to apply the local variables list, and permanently mark these ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values (*) as safe (in the future, they will be set automatically.) * eval : (when (and (buffer-file-name) (not (file-directory-p (....... ^^^^^^ - to give to user option to permanently NOT mark these values to be accepted, as the choice above is inclined to accept variables and it makes users error prone to accept unsafe variables, but it does not give option to permanently mark those as unsafe. This is more important for dir local variables where user may be asked many times to accept variables. Being asked 20 times will make user finally permanently accept variables. But user has no visible way to permanently ignore those variables. - safety for millions of users who do not use Emacs Lisp or who may not be programmers. Reasons: ======== - Emacs assumes wrongly that millions of users will know the meanings of "variable", "value", "apply" variable, "eval" and "safe", including the meanings of all of the Emacs Lisp that may be shown after eval: line and that seem not to be user friendly - to follow the principle of being self-documenting one shall give hyperlinks or references to documentation, thus giving user the actual informed choice. - right now user does not have informed choice and is coerced to permanently accept variables. More references: https://lists.gnu.org/archive/html/emacs-orgmode/2020-11/msg00609.html https://lists.gnu.org/archive/html/emacs-orgmode/2020-11/msg00633.html Here are references of confused users on Stack-something: https://lists.gnu.org/archive/html/emacs-orgmode/2020-11/msg00655.html https://lists.gnu.org/archive/html/emacs-orgmode/2020-11/msg00665.html