From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Nikolay Kudryavtsev Newsgroups: gmane.emacs.devel Subject: Re: Summary and next steps for (package-initialize) Date: Wed, 23 Aug 2017 18:57:30 +0300 Message-ID: <42c93165-2d85-8501-9cc8-99830b7b3646@gmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------75E45EBA7274A6B305E731E2" X-Trace: blaine.gmane.org 1503504242 8469 195.159.176.226 (23 Aug 2017 16:04:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 Aug 2017 16:04:02 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 To: Radon Rosborough , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 23 18:03:57 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkY83-00017F-Jw for ged-emacs-devel@m.gmane.org; Wed, 23 Aug 2017 18:03:39 +0200 Original-Received: from localhost ([::1]:44462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkY8A-0005Qg-Aw for ged-emacs-devel@m.gmane.org; Wed, 23 Aug 2017 12:03:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkY2G-0008Cb-Ij for emacs-devel@gnu.org; Wed, 23 Aug 2017 11:57:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkY2D-0002oK-HC for emacs-devel@gnu.org; Wed, 23 Aug 2017 11:57:40 -0400 Original-Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]:37557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dkY2D-0002n5-8J for emacs-devel@gnu.org; Wed, 23 Aug 2017 11:57:37 -0400 Original-Received: by mail-lf0-x229.google.com with SMTP id f7so2350118lfg.4 for ; Wed, 23 Aug 2017 08:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=r07kZmcKUsfzLRqv7ie/eIruNQGfHa7lvTCHRFYi8RI=; b=E5faYNdfmvzEWvJR6DM7Qe/6IMcAPgZ3CP4+3C1bQbJ7zMS/lw9ZMjCcddQCwOdVYX Ipk1agKQZAZX0ISjum1PjUSOVIL7AHgl3ARYZh8x9YhGv5w8HNM6x5qVuPGN4HeY6gb1 ZHDPTda7AKbZYRS1SwPxA/tNDdUOQ1ND1k6eRO8hu8O5ytRtWxAClismPgq7ZWgm/gv/ nIckluKmF4gTNajOlkwnZYy3VL7MbHqlVuBFALfa5lZphDioIiCvYiu382LANWf8tutr B0tW5GpC0NtNLLih9R0xUqUn5n9l0xzOnrVDh9Rk0rwJg196IzvALREW6+6f+i22MuKP Y7Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=r07kZmcKUsfzLRqv7ie/eIruNQGfHa7lvTCHRFYi8RI=; b=ZaIh6vpUqMjGPHa2gppF9CzorYMbe+bRuZC3i/VaFYbsE8Yh+8PBZ+Awe0wg7qfBx/ UzOf8Qllb/yEzAItiPPJ5HWyrtFldS9M0towyFeIE8Nzq8Xk6kpBO+jYJ5UeVLIKJP+e 0AgTgy0/vc4qeO17xOL9+jYJ2AwM3PVLk4a9j4sZDFJjySQTsUxF1UHVMHa1fR8iQUkt VYohmWzOH2ieoRGOaz6ObJPZ5WfMIye+2GnpBvhLuxlBDSpn9NRRumWkFILJpcW3lp8w jAakjXRdBjeNK/k5en5hxU2HyOCm2WsieMO1IQT3ZQMlTimSgkA5Efe5tFHOqT7wQaXz F3vw== X-Gm-Message-State: AHYfb5g0XDGSZTyAwEjTHs3N6xFyKPehFsO3SVA9m8ckJZBOPmvfebpp HydNSNKik4h97WzC X-Received: by 10.25.216.212 with SMTP id r81mr1039063lfi.26.1503503854101; Wed, 23 Aug 2017 08:57:34 -0700 (PDT) Original-Received: from [192.168.199.6] (broadband-95-84-209-126.moscow.rt.ru. [95.84.209.126]) by smtp.gmail.com with ESMTPSA id i138sm308915lfe.20.2017.08.23.08.57.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 08:57:33 -0700 (PDT) X-Google-Original-From: Nikolay Kudryavtsev In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::229 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:217724 Archived-At: This is a multi-part message in MIME format. --------------75E45EBA7274A6B305E731E2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hello. I have another proposal that was not considered so far. The main problem we're trying to solve here is when a new user calls something from package.el without having it initialized first. We also want the solution to touch only that group of users and no one else. So I propose, we don't do anything until user either: 1. Requires something that's not available. 2. Calls a function that's not available. In either of those cases we check whether (package-initialize) was already called. And, if not, we give user an interactive window along the lines of: /"//You tried to call X which is not available and Emacs package manager was not initialized. Press: // / /i to initialize and try again/ /w to initialize, try again and don't ask again/ /x to dismiss/ /K to dissmiss and never ask again."/ w writes (package-initialize) to init) K would set variable dear-emacs-i-totally-don-t-need-any-begginers-advice-thanks to t. We also don't show this window when kill-package-el-and-burn-its-body is t. I'm not entirely sure on the technical side of catching requires and void-functions, but this seems to be the best solution when all other things are considered. Also similar approach is already used in Emacs, there's some key binding that's disabled until you confirm it in a similar way, sorry at the moment I don't remember which one. -- Best Regards, Nikolay Kudryavtsev --------------75E45EBA7274A6B305E731E2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

Hello.

I have another proposal that was not considered so far.

The main problem we're trying to solve here is when a new user calls something from package.el without having it initialized first. We also want the solution to touch only that group of users and no one else.

So I propose, we don't do anything until user either:

1. Requires something that's not available.

2. Calls a function that's not available.

In either of those cases we check whether (package-initialize) was already called. And, if not, we give user an interactive window along the lines of:

"You tried to call X which is not available and Emacs package manager was not initialized. Press:

i to initialize and try again

w to initialize, try again and don't ask again

x to dismiss

K to dissmiss and never ask again."

w writes (package-initialize) to init)

K would set variable dear-emacs-i-totally-don-t-need-any-begginers-advice-thanks to t.

We also don't show this window when kill-package-el-and-burn-its-body is t.

I'm not entirely sure on the technical side of catching requires and void-functions, but this seems to be the best solution when all other things are considered.

Also similar approach is already used in Emacs, there's some key binding that's disabled until you confirm it in a similar way, sorry at the moment I don't remember which one.

-- 
Best Regards,
Nikolay Kudryavtsev
--------------75E45EBA7274A6B305E731E2--