From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Jo=C3=A3o?= Pedro Newsgroups: gmane.emacs.devel Subject: Re: [NonGNU ELPA] New packages: popon, corfu-popup, flymake-popon Date: Fri, 20 May 2022 01:37:29 -0300 Message-ID: <87tu9k95va.fsf@gmail.com> References: <87leuyc1uz.fsf@disroot.org> <87mtfeadeu.fsf@posteo.net> <87mtfd93r1.fsf@disroot.org> <87tu9l1tsl.fsf@posteo.net> <874k1l8ksp.fsf@disroot.org> <87wneh9y4x.fsf@gmail.com> <87wneh71db.fsf@disroot.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33892"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Akib Azmain Turja , Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 20 06:38:27 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nruPC-0008fG-NK for ged-emacs-devel@m.gmane-mx.org; Fri, 20 May 2022 06:38:26 +0200 Original-Received: from localhost ([::1]:58748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nruPB-0002Kr-16 for ged-emacs-devel@m.gmane-mx.org; Fri, 20 May 2022 00:38:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nruOR-0001ep-Ni for emacs-devel@gnu.org; Fri, 20 May 2022 00:37:39 -0400 Original-Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]:46310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nruOP-0006HV-D5 for emacs-devel@gnu.org; Fri, 20 May 2022 00:37:39 -0400 Original-Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-d39f741ba0so9071398fac.13 for ; Thu, 19 May 2022 21:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=JiREZjbOMbsP+GrOIH9/MMehDB88jNVI1yGv0pL9vRY=; b=ga+KpyfOacOln4pZ56RW3MDz88QHIefvusVdFwBnbKmOLHMad8gAvvoy0FV60eJTgN 9pUlCTeP//BZgbkBridetttAOzVWXeYJch71Y3kwLyC+XvVvwIQHHl6BQE9eqLWyIpSj FJ3Bwba5eDS//WkOsqsvd4GAcrbB+5yJSwbVixRELrNbSBx0DwIHNBOGW9kQNPTaifgT URIcOqNy9HSZPzuQtEu8cKlmpmQNxahvl5QIxRan2XcezUO8BSIv7TD1jzhAoRvcaG28 B08Elw6Exe5BcH1DJ6iuIArdfMT6lKyLdtf0C/2QklJ+PTIjLsk1T1Eco6iaYCnR+/9n WMeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=JiREZjbOMbsP+GrOIH9/MMehDB88jNVI1yGv0pL9vRY=; b=FvLHFhRRrU/JNXS1B7w/+lusi2NuQoB6lUry6Ro/eHatXbJGfVVUCRw3ShVCA/CrAL 9cbI8e++yBEs4Q9qIFFKMJlutryJLGqv2oxSi4gbHQtAzNzc1lScywfO5m2opyPCcyot 2TWrDvcU/MaxxOpPhxWoMDcazWgedurg0HidbpbzixCFYUjHQWGQQfoawMQqW9EwjBF8 RY13rsPSkMlcofxqmqwL0Yyy2aEdHuUsI5AbMlek3wQVNnOo75PP1o68meljcKFSbODR p+0uPHZEM4NBRUHY2sMeQTPzKYl5dFWrDyC05szRUwA82AkSW2+FyK7OG/X4AsNKN+bm fUFQ== X-Gm-Message-State: AOAM532R5K5/SkXk1OrIW/5AJ1XsSxKYWIESks3GVW8C7lTiz6xaUJ54 ltZyNzjcNPcwsnZNHFZdaVM/L/X3nVY= X-Google-Smtp-Source: ABdhPJznoe7QXW5C5Micb0ah6L4wuvVdVUmhNjQpq22E+XhwPzubrcvEBI2WbdVAkZvOSWfO9vYQrw== X-Received: by 2002:a05:6870:b40a:b0:d7:5c87:64ab with SMTP id x10-20020a056870b40a00b000d75c8764abmr4677003oap.168.1653021454833; Thu, 19 May 2022 21:37:34 -0700 (PDT) Original-Received: from ergo ([186.236.209.77]) by smtp.gmail.com with ESMTPSA id e4-20020a9d2a84000000b0060603221248sm533673otb.24.2022.05.19.21.37.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 21:37:33 -0700 (PDT) In-Reply-To: <87wneh71db.fsf@disroot.org> Received-SPF: pass client-ip=2001:4860:4864:20::2e; envelope-from=jpedrodeamorim@gmail.com; helo=mail-oa1-x2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289993 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 T24gRnJpLCBNYXkgMjAgMjAyMiAwMTo0NSwgQWtpYiBBem1haW4gVHVyamEgPGFraWJAZGlzcm9v dC5vcmc+IHdyb3RlOg0KDQo+IFdlbGwsIG1hbnkgbWF5IG5vdCB1bmRlcnN0YW5kIHdoYXQgZG9l cyBwb3BvbiBpbiB0aGUgbmFtZSBtZWFuLCBhbmQgdGhpcw0KPiBuYW1lIGNoYW5nZSBpcyBqdXN0 IHRvIHJlZmxlY3QgdGhlIG1haW4gcHVycG9zZSBvZiB0aGUgcGFja2FnZSwgYWxsb3dpbmcNCj4g dG8gdXNlIENvcmZ1IGluIHRlcm1pbmFsLCBpbiBpdHMgbmFtZS4gIGNvcmZ1LXRlcm1pbmFsIGlz IG1haW5seSBmb3INCj4gdGVybWluYWwsIGFzIHRoZXJlIGlzIGFscmVhZHkgYSBiZXR0ZXIgc29s dXRpb24gZm9yIGdyYXBoaWNhbCBpbnRlcmZhY2UuDQoNCk9oaCwgSSBnZXQgaXQhIFdlbHAsIGtl ZXBpbmcgY29yZnUtdGVybWluYWwgb3IgZ29pbmcgZm9yIGNvcmZ1LXBvcG9uIG5vdw0KaXMgYSBt YXR0ZXIgb2Ygd2hhdCB5b3UnZCBsaWtlIHRvIGFkdmVydGlzZSBtb3JlLCB0aGUgZmFjdCB0aGF0 IGl0IHVzZXMNCnBvcG9uLmVsLCBvciB0aGUgZmFjdCB0aGF0IGl0IGVuYWJsZXMgQ29yZnUgdG8g YmUgdXNlZCBvbiB0aGUgdGVybWluYWwuDQpCeSB5b3VyIGFuc3dlciBJIGNhbiBhbHJlYWR5IHN1 cHBvc2UgdGhhdCB0aGUgbGF0dGVyIGlzIG1vcmUgaW1wb3J0YW50DQp0byB5b3UsIGluIHdoaWNo IGNhc2UgaXQgbWFrZXMgdG90YWwgc2Vuc2Uga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cnNpb24gaW4gdGhpcyBlbWFpbC4NCg0KPiBQbGVhc2UgZG9uJ3QgaGVzdGl0YXRl IHRvIHRlbGwgaWYgeW91IGhhdmUgYW55IHN1Z2dlc3Rpb25zIGFib3V0IHRoZQ0KPiBuYW1lcyBv ciBhbnkgb3RoZXIgdGhpbmcsIEknbSB3aWxsaW5nIHRvIGhlYXIgZnJvbSB0aGUgY29tbXVuaXR5 Lg0KDQpUaGF0J3MgZ3JlYXQhIFRoYW5rIHlvdSBmb3IgeW91ciB0aW1lIG9uIGJvdGggYW5zd2Vy aW5nIG15IHF1ZXN0aW9ucyBhbmQNCmRldmVsb3BpbmcgdGhlc2UgcGFja2FnZXMuDQoNCkJlc3Qs DQoNCi0tIA0KSm/Do28gUGVkcm8gZGUgQW1vcmltIFBhdWxhDQpJVCB1bmRlcmdyYWR1YXRlIGF0 IFVuaXZlcnNpZGFkZSBGZWRlcmFsIGRvIFJpbyBHcmFuZGUgZG8gTm9ydGUgKFVGUk4pDQoNCg== --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=flymake-posframe.el ;;; flymake-posframe.el --- Display flymake diagnostics at point -*- lexical-binding: t; -*- ;; Copyright (C) 2018 Aya Igarashi ;; Author: Aya Igarashi ;; URL: https://github.com/Ladicle/flymake-posframe ;; Keywords: convenience, languages, tools ;; Version: 1.0.0 ;; Package-Requires: ((emacs "26.1") (posframe "0.4.2")) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; Display flymake message at point using a posframe. ;; Check out the README for more information. ;;; Code: (require 'flymake) (require 'posframe) (require 'subr-x) (defcustom flymake-posframe-error-prefix "!! " "String to be displayed before every error line." :group 'flymake-posframe :type '(choice (const :tag "No prefix" nil) string)) (defcustom flymake-posframe-warning-prefix "! " "String to be displayed before every warning line." :group 'flymake-posframe :type '(choice (const :tag "No prefix" nil) string)) (defcustom flymake-posframe-note-prefix "? " "String to be displayed before every note line." :group 'flymake-posframe :type '(choice (const :tag "No prefix" nil) string)) (defcustom flymake-posframe-buffer " *flymake-posframe-buffer*" "Name of the flymake posframe buffer." :group 'flymake-posframe :type 'string) (defcustom flymake-posframe-idle-delay 0.5 "Amount of seconds to wait before displaying the posframe. If you'd like for the posframe to be displayed instantly, set this to 0 instead of nil. When this variable is nil, we just fall back to the default value." :group 'flymake-posframe :type 'float) (defface flymake-posframe-face '((t :inherit nil)) "The background color of the flymake-posframe frame. Only the `background' and `:foreground' are used from this face." :group 'flymake-posframe) (defvar flymake-posframe--last-diag nil "Last buffer diagnostics displayed in a Flymake posframe.") (defvar flymake-posframe--last-position nil "Last position for which a posframe for Flymake was displayed.") (defvar flymake-posframe--hide-posframe-hooks '(pre-command-hook post-command-hook focus-out-hook) "The hooks which should trigger automatic removal of the posframe.") (defvar flymake-posframe--prefix-alist '((:error . flymake-posframe-error-prefix) (:warning . flymake-posframe-warning-prefix) (:note . flymake-posframe-note-prefix)) "Alist of (DIAG-TYPE . PREFIX). The DIAG-TYPE is the return of `flymake--diag-type' and PREFIX is the prefix text to be shown for that type.") (defvar flymake-posframe--face-alist '((:error . error) (:warning . warning) (:note . success)) "Alist of (DIAG-TYPE . FACE). The DIAG-TYPE is the return of `flymake--diag-type' and FACE is the face to propertize the prefix text with.") (defvar flymake-posframe--timer nil "Variable to hold a timer in order to display the posframe.") (defun flymake-posframe--check-position () "Update `flymake-posframe--last-position', returning t if there was no change." (equal flymake-posframe--last-position (setq flymake-posframe--last-position (list (current-buffer) (buffer-modified-tick) (point))))) (defun flymake-posframe--hide () "Hide the Flymake posframe. Also remove the `flymake-posframe--hide-posframe-hooks'." (posframe-hide flymake-posframe-buffer) (dolist (hook flymake-posframe--hide-posframe-hooks) (remove-hook hook #'flymake-posframe--hide t))) (defun flymake-posframe--format-diag (diag) "Propertize DIAG according to `flymake--diag-type'. The argument DIAG is a `flymake--diag' object from Flymake." (let* ((type (flymake--diag-type diag)) (prefix (alist-get type flymake-posframe--prefix-alist)) (face (alist-get type flymake-posframe--face-alist))) (concat (propertize (eval prefix) 'face face) (flymake--diag-text diag)))) (defun flymake-posframe--current-frame () "Return current `posframe--frame' or nil if none." (buffer-local-value 'posframe--frame (get-buffer-create flymake-posframe-buffer))) (defun flymake-posframe--show (contents) "Show CONTENTS with `posframe-show'." (let* ((fg (face-foreground 'flymake-posframe-face nil t)) (bg (face-background 'flymake-posframe-face nil t)) (frame (posframe-show flymake-posframe-buffer :internal-border-width 2 :left-fringe 1 :right-fringe 1 :position (point) :foreground-color fg :background-color bg :string contents))) (redirect-frame-focus frame (frame-parent frame)) (dolist (hook flymake-posframe--hide-posframe-hooks) (add-hook hook #'flymake-posframe--hide nil t)))) (defun flymake-posframe--display-or-hide () "Display the Flymake posframe." (when flymake-posframe--timer (cancel-timer flymake-posframe--timer) (setq flymake-posframe--timer nil)) (when flymake-mode (if-let ((diag (get-char-property (point) 'flymake-diagnostic))) (unless (and (eq flymake-posframe--last-diag (setq flymake-posframe--last-diag diag)) (ignore-error 'wrong-type-argument (frame-visible-p (flymake-posframe--current-frame)))) (flymake-posframe--check-position) (setq flymake-posframe--timer (run-at-time (or flymake-posframe-idle-delay (default-value 'flymake-posframe-idle-delay)) nil (lambda () (flymake-posframe--show (flymake-posframe--format-diag diag)))))) (flymake-posframe--hide)))) ;;;###autoload (define-minor-mode flymake-posframe-mode "Minor mode for displaying Flymake diagnostics using `posframe'." :lighter nil :group flymake-posframe (cond (flymake-posframe-mode (add-hook 'post-command-hook #'flymake-posframe--display-or-hide nil 'local)) (t (remove-hook 'post-command-hook #'flymake-posframe--display-or-hide 'local)))) (provide 'flymake-posframe) ;;; flymake-posframe.el ends here --=-=-=--