From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleh Krehel Newsgroups: gmane.emacs.devel Subject: Re: Adding a few more finder keywords Date: Tue, 09 Jun 2015 18:47:51 +0200 Message-ID: <874mmgygjs.fsf@gmail.com> References: <87sia2l04r.fsf@gmail.com> <873821xzon.fsf@uwakimon.sk.tsukuba.ac.jp> <048d389e-cd09-468e-b93f-729505e56ab0@default> <87zj49kkff.fsf@gmail.com> <6cb2edd7-dfca-41ab-b3cb-e09e29b39a94@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1433868872 26615 80.91.229.3 (9 Jun 2015 16:54:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Jun 2015 16:54:32 +0000 (UTC) Cc: "Stephen J. Turnbull" , Stefan Monnier , Artur Malabarba , emacs-devel To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 09 18:54:31 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z2MnG-0007S9-AT for ged-emacs-devel@m.gmane.org; Tue, 09 Jun 2015 18:54:30 +0200 Original-Received: from localhost ([::1]:36302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2MnF-00026A-Bo for ged-emacs-devel@m.gmane.org; Tue, 09 Jun 2015 12:54:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2MnA-00025l-JT for emacs-devel@gnu.org; Tue, 09 Jun 2015 12:54:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2Mn6-0003y9-Fy for emacs-devel@gnu.org; Tue, 09 Jun 2015 12:54:24 -0400 Original-Received: from mail-wi0-x242.google.com ([2a00:1450:400c:c05::242]:35878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2Mn6-0003xr-8R for emacs-devel@gnu.org; Tue, 09 Jun 2015 12:54:20 -0400 Original-Received: by wivr20 with SMTP id r20so4344874wiv.3 for ; Tue, 09 Jun 2015 09:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=W/w5K36XxrIm1S8xd/woAt9PG0il6HUL3cv0dZdhyag=; b=AY/GopzPCntHwLUhQ4elmjD2uvVY0oEFIp4EHh4Wn9jXRB4NlmfjuBjIWvZ6JmzsGa JPDSF6hWnxKXbKOAKIz0VLiRGrpBx/vkSFPfxqTNZVmRw5F3Pqi7AnGxBFDeIkeUT2Gj go0y+WGbZndZYc/4Nre3jnImB/QpLBTdNXLOsE0XA616MJhSd4zMOgROJfYvD2gLBZvW 6CnXm2G8TbynEde4PJd/THk84xen95gUpGQCsjN83h6ZZs9sjRUax+B9xj4edjKfdTN0 fNavMzqZc7QJbTf/HmfRh0ijQmvI8w1ITYVs4Pf4R5hpDrTVJ4OnBFSxPCazcx7VB1ot kXWg== X-Received: by 10.180.108.142 with SMTP id hk14mr33649468wib.5.1433868859567; Tue, 09 Jun 2015 09:54:19 -0700 (PDT) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by mx.google.com with ESMTPSA id pd7sm10316451wjb.27.2015.06.09.09.54.17 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 09 Jun 2015 09:54:18 -0700 (PDT) In-Reply-To: <6cb2edd7-dfca-41ab-b3cb-e09e29b39a94@default> (Drew Adams's message of "Tue, 9 Jun 2015 09:05:40 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::242 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187135 Archived-At: Drew Adams writes: > If you need something new, then add something new. Don't > compromise existing constructs that others have been happily > using in ways you don't approve of or cannot make use of. > Share the road. It seems that a misunderstanding lead you to believe that someone is enforcing something. I ensure you that this isn't so. There will never be a warning unless the package author specifically runs an interactive command because he wants to check if his package will generate a warning. Inventing a new section is an option, but it's a cumbersome and unnecessary path. I can have what I want with just `Keywords:' without imposing anything on anyone, possibly offering a guideline through a separate checkdoc utility that so far comes disabled by default. Let me show you what I have in mind. All the code I wrote just now, I require nothing more than extending the list of recommended keywords: (defun finder-add-packages () (let ((keys (delete-dups (package-all-keywords)))) (dolist (key keys) (let ((packages (package-menu--refresh t (list key))) (kw (intern key))) (puthash kw (delete-dups (append (gethash kw finder-keywords-hash) (mapcar (lambda (x) (package-desc-name (car x))) packages))) finder-keywords-hash))))) (defun finder-add-keywords () (setq finder-known-keywords (mapcar (lambda (x) (cons x (prin1-to-string x))) (hash-table-keys finder-keywords-hash)))) (defun finder-add-good-keywords () (setq finder-known-keywords (delete-dups (append finder-known-keywords '((python . "Python programming language") (clojure . "Clojure programming language") (ocaml . "OCaml programming language")))))) Call `finder-add-packages' to add the `package-list-packages' content to `finder-keywords-hash'. Now, calling `finder-add-keywords' will cause chaos: "M-x" `finder-list-keywords' results in a buffer with 1473 lines. But resetting `finder-known-keywords' to its definition and calling `finder-add-good-keywords' will extend the amount of sections by 3 to 39 - still a comfortable number. Now, very conveniently I can browse the packages available for Python, Clojure and OCaml. Zero changes in outside packages. Zero changes to `Keywords:'. Only change is that some keywords were promoted to `finder-known-keywords', and the package list was processed into finder (which takes quite long - around 10 seconds). This is all the functionality that I wanted. Now, I'd like to make this functionality available to users, with (almost) zero configuration. What remains to do is to add more than just these 3 keywords to `finder-add-good-keywords', but not 1200.