From unknown Sat Aug 16 10:44:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43339: 27.1; Hi-Lock mode mishandles face names specified as strings Resent-From: Sean Devlin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Sep 2020 14:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43339 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 43339@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159983412413688 (code B ref -1); Fri, 11 Sep 2020 14:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Sep 2020 14:22:04 +0000 Received: from localhost ([127.0.0.1]:44975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGjwB-0003YZ-Sn for submit@debbugs.gnu.org; Fri, 11 Sep 2020 10:22:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:43674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGjwA-0003Xx-Ix for submit@debbugs.gnu.org; Fri, 11 Sep 2020 10:22:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGjwA-0007hY-8F for bug-gnu-emacs@gnu.org; Fri, 11 Sep 2020 10:22:02 -0400 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]:34456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGjw8-0002pc-6U for bug-gnu-emacs@gnu.org; Fri, 11 Sep 2020 10:22:01 -0400 Received: by mail-qv1-xf2e.google.com with SMTP id q10so5273355qvs.1 for ; Fri, 11 Sep 2020 07:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=tTuwB9wVPfk6eYQhgtZ6g5JiGgN0MR/nyqSj8v/Koog=; b=Wr5mIamzzi1/wPWaCrLO89Bbu1Y9LiSL5aKUMonfxkygCZfbPF7Kj4pyyvnSDPRE8K FWMfTtEnzO57OzlSgMT/sEDxELp3Ul4UyQGWr14mTvZg+XxyPTOf5odKe3Wm6eG9NoK0 e/8cv9g6my8PxIrEYkgiNiYdiJ59zs6PvR3+cLE7ErC75prnqAjoFiOEea/76ICoeDZO gxaQH2zm5CfmaY+aN6rnSnajFeoUN8JZtxcQUmdCTU+TG7Bi2o27UIbIDL1/LwR6d+oG yqhQCTfy5CD2siYIdz/Bmm7SxUz1zcF8Ic3+OG+tI8WvzR+riTmHUGw//eZjb5rUwc3Y etJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=tTuwB9wVPfk6eYQhgtZ6g5JiGgN0MR/nyqSj8v/Koog=; b=sZ226zxn+W8Xg/am5LdUoHlMQHnVm+AB8mCw8e+kRgEBm7prgPpcqK4uwrMH8SFzqm Flc26lLpuTVpg2UASsKVKxD1TdMWeZjqZb1m4HQH3Zo81CzX/7sDB4vRkMOgnmfoUdL/ f3k3aHc2kW9kiOc+9fJC0WYr/UH5hoONEYA4efn5XVLkADABsu7TqqgYioz7ExjycssE y166UzSaa438mcHmbdAVu8IBYs0jpnZ8SOP/mJpoValljgA58m2C63hHu7qOFaJUZxlc N8NxLwnTgMIaTFTEYH+yqzVfpepYL/VgI+JleSKy7R0BcVNVQN076FTnSyiHdYlb7RO9 7bOQ== X-Gm-Message-State: AOAM532ZvMqB9FaqAEqioUbxjWfjRe78wsWw39kHck4g8YZvIHrm9HJF Si8+u/OrxalA6daN43pKm3nqN6D359nVNHyj X-Google-Smtp-Source: ABdhPJwm5TrLP/rreQe3h2I6ObddKvYb1U3zA63XpPsF7G1dd777tcWRYy7cKLjTWpoFdhhz9/qNdw== X-Received: by 2002:a0c:fb47:: with SMTP id b7mr2102237qvq.48.1599834117439; Fri, 11 Sep 2020 07:21:57 -0700 (PDT) Received: from localhost.localdomain ([2604:2000:14c6:84b0:3d15:4eaf:d011:d8e8]) by smtp.gmail.com with ESMTPSA id 8sm3134527qkd.47.2020.09.11.07.21.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2020 07:21:56 -0700 (PDT) From: Sean Devlin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.0.3.2.26\)) Message-Id: <822A7570-D797-4EAB-B359-89EBC796B4FD@toadstyle.org> Date: Fri, 11 Sep 2020 10:21:55 -0400 X-Mailer: Apple Mail (2.3654.0.3.2.26) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2e; envelope-from=spd@toadstyle.org; helo=mail-qv1-xf2e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi folks, Hi-Lock mode seems to get into an erroneous state when you call its functions with the face name specified as a string rather than a symbol. For example, open the scratch buffer and evaluate the following forms: (require 'hi-lock) (hi-lock-face-buffer "create" "hi-yellow") hi-lock-interactive-patterns ;; (("create" (0 '"hi-yellow" prepend))) The comment on the last line shows the value of hi-lock-interactive-patterns after evaluating the forms. Note the quote in front of "hi-yellow". Note also that no error has been raised. The function has apparently worked correctly, and the string "create" is highlighted in yellow. Now move point onto some symbol and invoke interactively the command hi-lock-face-symbol-at-point. There is an error message: Wrong type argument: symbolp, "hi-yellow" Hi-Lock is passing this string to the face-name function, but it expects a symbol. I think the core issue is that Hi-Lock fails to canonicalize the face name as a symbol in its internal data structures. It seems to rely on the underlying faces API to enforce data consistency, but whereas facep returns non-nil on string inputs, face-name does not allow them. You might be able to argue that the above is an issue in the faces library rather than Hi-Lock. I'm not sure if changing something at that layer would break things elsewhere. Either way, I think Hi-Lock should probably canonicalize its own data structures and convert faces to symbols. Note that everything works correctly when these functions are called interactively, because the package does convert faces to symbols in hi-lock-read-face-name. Thanks! In GNU Emacs 27.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 = Version 10.14.6 (Build 18G95)) of 2020-08-12 built on builder10-14.porkrind.org Windowing system distributor 'Apple', version 10.3.2009 System Description: macOS 11.0 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set hi-lock nil (("create" (0 '"hi-yellow" prepend))) nil [2 times] Making completion list... face-name: Wrong type argument: symbolp, "hi-blue" Making completion list... [2 times] Configured using: 'configure --with-ns '--enable-locallisppath=3D/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules' Configured features: NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS JSON PDUMPER Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: hi-lock-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt time-date subr-x cl-loaddefs cl-lib hi-lock tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 46803 9943) (symbols 48 6022 1) (strings 32 15725 2224) (string-bytes 1 515994) (vectors 16 10380) (vector-slots 8 129643 8794) (floats 8 21 51) (intervals 56 262 12) (buffers 1000 12)) From unknown Sat Aug 16 10:44:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43339: 27.1; Hi-Lock mode mishandles face names specified as strings Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Oct 2020 15:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43339 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Sean Devlin Cc: 43339@debbugs.gnu.org Received: via spool by 43339-submit@debbugs.gnu.org id=B43339.160277674429227 (code B ref 43339); Thu, 15 Oct 2020 15:46:02 +0000 Received: (at 43339) by debbugs.gnu.org; 15 Oct 2020 15:45:44 +0000 Received: from localhost ([127.0.0.1]:56261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kT5Ro-0007bK-Bw for submit@debbugs.gnu.org; Thu, 15 Oct 2020 11:45:44 -0400 Received: from quimby.gnus.org ([95.216.78.240]:44592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kT5Rm-0007b6-JL for 43339@debbugs.gnu.org; Thu, 15 Oct 2020 11:45:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Z2LvIm/nGZ3ZxawN1Yp9Y/fqxuysgiUAxvFsbeC0Sz0=; b=WMm6n7d9TcXGKpydgvVwAbtutP mfoBRMds7JQQKLtJMwwJ4/C2moSYML2PzXYlbA85TQQsm4p0XdsFlVwA/8e2tcYbSXIzqcskaWvX2 0MRjfepW1TWfm+ecC3N/xuCYr8u7K+8n5aY+wX+T4iAry54sxQ/qwOSYrG0nEa9af038=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kT5Rd-0005wO-9N; Thu, 15 Oct 2020 17:45:36 +0200 From: Lars Ingebrigtsen References: <822A7570-D797-4EAB-B359-89EBC796B4FD@toadstyle.org> X-Now-Playing: Oval's _Popp_: "ve" Date: Thu, 15 Oct 2020 17:45:31 +0200 In-Reply-To: <822A7570-D797-4EAB-B359-89EBC796B4FD@toadstyle.org> (Sean Devlin's message of "Fri, 11 Sep 2020 10:21:55 -0400") Message-ID: <87eelzv6g4.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Sean Devlin writes: > Either way, I think Hi-Lock should probably canonicalize its own data > structures and convert faces to symbols. Yup. This has now been fixed in Emacs 28. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Sean Devlin writes: > Either way, I think Hi-Lock should probably canonicalize its own data > structures and convert faces to symbols. Yup. This has now been fixed in Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 15 11:45:49 2020 Received: (at control) by debbugs.gnu.org; 15 Oct 2020 15:45:49 +0000 Received: from localhost ([127.0.0.1]:56264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kT5Rs-0007ba-Mj for submit@debbugs.gnu.org; Thu, 15 Oct 2020 11:45:48 -0400 Received: from quimby.gnus.org ([95.216.78.240]:44606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kT5Rr-0007bC-HG for control@debbugs.gnu.org; Thu, 15 Oct 2020 11:45:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=50jA3rX7NQIcqAufAGq1r7WiI9qvnYnUPw11aQUD2H4=; b=EKndw63D6jYkmtO/mSwdQh/z0i oleVRfj8O5ZkTS+rvv0e7zSks4hfcD3sE4Zv/4P7UkRG8NcytGBn0xxomvpXIki8nz/L9Nfel/F3d HnEpm1fdsZNWbqCaCr6b3P/LsgC6AJ5MyJvcls8tyVM3XmsYUpT4H8dZ/Zf8bdFeQoTQ=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kT5Rj-0005wa-Nw for control@debbugs.gnu.org; Thu, 15 Oct 2020 17:45:41 +0200 Date: Thu, 15 Oct 2020 17:45:38 +0200 Message-Id: <87d01jv6fx.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #43339 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 43339 fixed close 43339 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 43339 fixed close 43339 28.1 quit