From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Elijah G Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: colorful-mode Date: Mon, 22 Apr 2024 20:49:44 -0600 Message-ID: References: <878r15vnr1.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6709"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 23 04:50:55 2024 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 1rz6FD-0001Zh-IP for ged-emacs-devel@m.gmane-mx.org; Tue, 23 Apr 2024 04:50:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rz6EN-0000U1-Uy; Mon, 22 Apr 2024 22:50:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rz6EM-0000Th-Jt for emacs-devel@gnu.org; Mon, 22 Apr 2024 22:50:02 -0400 Original-Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rz6EK-0006ct-Rt for emacs-devel@gnu.org; Mon, 22 Apr 2024 22:50:02 -0400 Original-Received: by mail-qk1-x742.google.com with SMTP id af79cd13be357-78f05afc8d6so355268385a.3 for ; Mon, 22 Apr 2024 19:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713840599; x=1714445399; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=bH4kiRLv1CyGA9s3uexrZzybb0t9AcfcradNCmClUsY=; b=gPAsByvKYKFZoRdklQobJXRL3ff770v1WfIfbv04dRXvTndo1CjJnD/EvSdx8mbjha CnoUneDpzeuNZ9al++OOCtJ4et9F6z5UNckugAm/yI5jpqw+V3jcjEPm1g/suxdD6Zez vw852QXkLXHdS5Z5beYeZneHkf1au0DvjdjPeRVuAbwJsUmlKOqwH5CtDq/QW5ba9jDZ uo5kXTyUlje6kHd3xqIBk7GHaPLPqZ4rZxnK7TZ84agIZDyKccKvi2mtU7dG1OWkAx0Z /9Y/e2XQM6SLoKFb7wpxSgANWi8Guj8Q+6XK9EVVgdpNs1+l2ylpRWxa+9/AYF4f3dne 7/Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713840599; x=1714445399; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bH4kiRLv1CyGA9s3uexrZzybb0t9AcfcradNCmClUsY=; b=BmMFagQM4xY0V0ii8UwoCBnFk5Plp/urbn1T6cuJj4a9sOIwFvKYBBlJWR5sjIt/6R B7OLtclqgPx1cLfz5/kiGG7LHUuiqR576LwuRTCREXMX53F+skO+BUZzUkancENXSBcP rx0dpYVK5HtePPWLzyN4LH9eLj3s8W/BSexLnk7B8t3sg2v1vymbsCBCLHhop/xeaQ3Q 4MgG5VdxLEQF1ezhrrVZQQ1DYnTCpOH9LwKO/wsdJe4xmYw2mDOExBfiT5iyu+KVBrGI XeHCZ8mG//Sgw8jKDdJkjC9qpVm2RdPIV1DL1yLuPJkS4lIVU5GymttuylcmMXmkOyU0 Mf0A== X-Gm-Message-State: AOJu0YwYQbBnJAxV3sPzwomkD7afTAwIQWkTGPb+bzkAutru50ZfVlvP 5L3t1Om6DhQcup5mTLXfVU0svfqLqIXxYJ6uJbvclSQ18msTbd+gAc/n7hCZeTsy0GEj5c2B7Vv PVcRhTyNVTNV8jbxJTrPgE9eNfDA= X-Google-Smtp-Source: AGHT+IHE3lrplvtkpd7NxS/zAuLTXBhMfl9eEx32JlNj717SV/yJ0eMUx+Fn1BmhLgGWQMrGSwi/NM6ha47BA6WFEXs= X-Received: by 2002:ac8:7fcc:0:b0:436:888f:80d0 with SMTP id b12-20020ac87fcc000000b00436888f80d0mr15580934qtk.28.1713840599700; Mon, 22 Apr 2024 19:49:59 -0700 (PDT) In-Reply-To: <878r15vnr1.fsf@posteo.net> Received-SPF: pass client-ip=2607:f8b0:4864:20::742; envelope-from=eg642616@gmail.com; helo=mail-qk1-x742.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317993 Archived-At: Hi Philip, thank you for your suggestions, I've now added some of them to my package, here are my answers to your questions. On Mon, Apr 22, 2024 at 1:51=E2=80=AFAM Philip Kaludercic wrote: > > (defun colorful--latex-gray-to-hex (gray) > "Return LaTex GRAY as hexadecimal format. GRAY must be a string." > @@ -350,6 +342,8 @@ HSL must be a string." > (string-remove-prefix "hsl(" hsl) > (string-remove-prefix "hsla(" hsl)) > (rx (one-or-more (any "," " " "\t" "\n""\r" "\v" "\f")= )))) > + ;; what error is being ignored here? if (nth n hsl) is > + ;; nil, we can check this manually I had to add ignore-errors because it nth was throwing an error when nth is nil, it was bugging the other overlays in the next lines, using ignore-errors allows returning nil in case it can't be done and break the if-let conditional without affecting the other overlays. > (h (ignore-errors (/ (string-to-number (nth 0 hsl)) 360.0))) > (s (ignore-errors (/ (string-to-number (nth 1 hsl)) 100.0))) > (l (ignore-errors (/ (string-to-number (nth 2 hsl)) 100.0))) > (defvar colorful-hex-font-lock-keywords > `((,(rx (seq (not (any "&")) > @@ -639,6 +631,7 @@ converted to a Hex color." > "Function for add hex colors to `colorful-color-keywords'. > This is intended to be used with `colorful-extra-color-keyword-functions= '." > (dolist (colors colorful-hex-font-lock-keywords) > + ;; why are you using `add-to-list' here? > (add-to-list 'colorful-color-keywords colors t))) It was the way I found for adding the other color keywords, i found that using add-to-list with a buffer-local variable doesn't override the other buffer ones, If you know another way in how I would gladly implement it in my package. Thanks.