From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 06 10:57:00 2014 Received: (at submit) by debbugs.gnu.org; 6 Jul 2014 14:57:00 +0000 Received: from localhost ([127.0.0.1]:45059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X3nsB-0007Ja-Kd for submit@debbugs.gnu.org; Sun, 06 Jul 2014 10:57:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46231) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X3ns7-0007JH-1C for submit@debbugs.gnu.org; Sun, 06 Jul 2014 10:56:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X3nrv-00043i-KU for submit@debbugs.gnu.org; Sun, 06 Jul 2014 10:56:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3nrv-00043e-HH for submit@debbugs.gnu.org; Sun, 06 Jul 2014 10:56:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3nrq-0004Hl-BM for bug-gnu-emacs@gnu.org; Sun, 06 Jul 2014 10:56:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X3nrl-00041n-7G for bug-gnu-emacs@gnu.org; Sun, 06 Jul 2014 10:56:38 -0400 Received: from mx.sdf.org ([192.94.73.24]:59251 helo=sdf.lonestar.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3nrk-00040o-Vq for bug-gnu-emacs@gnu.org; Sun, 06 Jul 2014 10:56:33 -0400 Received: from wm.sdf.org (mx.sdf.org [192.94.73.24]) by sdf.lonestar.org (8.14.8/8.14.5) with ESMTP id s66EHMns000728 for ; Sun, 6 Jul 2014 14:17:22 GMT MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 06 Jul 2014 15:17:22 +0100 From: Mat Smiglarski To: bug-gnu-emacs@gnu.org Subject: 24.3.92; Calling highlight-regexp non-interactively causes errors from face-name Message-ID: X-Sender: penthief@SDF.ORG User-Agent: Roundcube Webmail/1.0.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) The logic within #'highlight-regexp for selecting a face is based on previous calls. This is a good feature, however it may be the cause of an issue where deleting the frame, visiting the same buffer in another frame, and then calling the highlight-regexp function interactively. This does not happen on 24.3.1. To reproduce: 1. Start emacs: $ emacs -Q 2. Create new frame: C-x 5 2 3. create buffer: C-x b "bug" 4. (optional) Insert text: 123 5. Highlight text non-interactively: M-: (highlight-regexp "1" "hi-green") 6. Kill frame C-x 5 0 7. Visit buffer on initial frame C-x b "bug" 8. Highlight-regexp non-interactively, supplying a default argument M-x highlight-regexp 2 The following error is encountered: face-name: Wrong type argument: symbolp, "hi-green" NB: This bug does not occur when the second call to highlight-regexp is interactive. An alternative recipe to reproduce the bug is the following: A. start emacs with the following script: $ emacs -Q -l bug-highlight-regexp.el Where bug-highlight-regexp.el contains the following: (defun bug-highlight-regexp-non-interactive-then-interactive () " Calling #'highlight-regexp non-interactively and supplying a non-nil face parameter causes errors with interactive calls (to #'highlight-regexp). " (interactive) (let ((bug-frame (make-frame)) (bug-buffer (get-buffer-create "Bug Demo"))) (select-frame bug-frame) (switch-to-buffer bug-buffer) ;; The regexp does not have to match, and ;; any valid face parameter can be supplied. (highlight-regexp "anything" "hi-green") (delete-frame bug-frame) (with-selected-frame (make-frame) (switch-to-buffer bug-buffer) (message "Do `M-x highlight-regexp' with any pattern to invoke bug\n")))) B. Do M-x bug-highlight-regexp-non-interactive-then-interactive C. Call M-x highlight-regexp Regards, Mat In GNU Emacs 24.3.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2014-06-29 on zz Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04 LTS Configured using: `configure --with-dbus --with-libotf --with-m17n-flt' Important settings: value of $LC_CTYPE: en_US.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: hi-lock-mode: t tooltip-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 blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x b u g - h i M-x h i g h l i r e a M-x r e p o r Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Do `M-x highlight-regexp' with any pattern to invoke bug face-name: Wrong type argument: symbolp, "hi-green" Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils hi-lock time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 73527 8937) (symbols 48 17463 0) (miscs 40 45 114) (strings 32 9680 4115) (string-bytes 1 258474) (vectors 16 9839) (vector-slots 8 401423 10857) (floats 8 74 272) (intervals 56 173 4) (buffers 960 12) (heap 1024 22961 900)) From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 06 19:58:22 2014 Received: (at 17956) by debbugs.gnu.org; 6 Jul 2014 23:58:22 +0000 Received: from localhost ([127.0.0.1]:45302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X3wK6-0001hW-0z for submit@debbugs.gnu.org; Sun, 06 Jul 2014 19:58:22 -0400 Received: from alc-vshost7.dreamhost.com ([69.163.216.107]:36309 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X3wK3-0001hL-D6 for 17956@debbugs.gnu.org; Sun, 06 Jul 2014 19:58:19 -0400 Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 00D4B348328C64; Sun, 6 Jul 2014 16:58:17 -0700 (PDT) From: Juri Linkov To: Mat Smiglarski Subject: Re: bug#17956: 24.3.92; Calling highlight-regexp non-interactively causes errors from face-name Organization: JURTA References: Date: Mon, 07 Jul 2014 02:38:18 +0300 In-Reply-To: (Mat Smiglarski's message of "Sun, 06 Jul 2014 15:17:22 +0100") Message-ID: <87r41y59v6.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 2.4 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > M-: (highlight-regexp "1" "hi-green") > [...] > The following error is encountered: > face-name: Wrong type argument: symbolp, "hi-green" The reason why `highlight-regexp' fails is because `face-name' rejects non-symbol faces whereas `facep' accepts them. This contradiction might cause similar bugs in other places that naively expect a face always to be a symbol. For instance, grepping for `face-name' shows such code as in `x-resolve-font-name' [...] Content analysis details: (2.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 RCVD_IN_XBL RBL: Received via a relay in Spamhaus XBL [69.163.216.107 listed in zen.spamhaus.org] 1.6 RCVD_IN_BRBL_LASTEXT RBL: RCVD_IN_BRBL_LASTEXT [69.163.216.107 listed in bb.barracudacentral.org] X-Debbugs-Envelope-To: 17956 Cc: 17956@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.4 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > M-: (highlight-regexp "1" "hi-green") > [...] > The following error is encountered: > face-name: Wrong type argument: symbolp, "hi-green" The reason why `highlight-regexp' fails is because `face-name' rejects non-symbol faces whereas `facep' accepts them. This contradiction might cause similar bugs in other places that naively expect a face always to be a symbol. For instance, grepping for `face-name' shows such code as in `x-resolve-font-name' [...] Content analysis details: (2.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 RCVD_IN_XBL RBL: Received via a relay in Spamhaus XBL [69.163.216.107 listed in zen.spamhaus.org] 1.6 RCVD_IN_BRBL_LASTEXT RBL: RCVD_IN_BRBL_LASTEXT [69.163.216.107 listed in bb.barracudacentral.org] > M-: (highlight-regexp "1" "hi-green") > [...] > The following error is encountered: > face-name: Wrong type argument: symbolp, "hi-green" The reason why `highlight-regexp' fails is because `face-name' rejects non-symbol faces whereas `facep' accepts them. This contradiction might cause similar bugs in other places that naively expect a face always to be a symbol. For instance, grepping for `face-name' shows such code as in `x-resolve-font-name' (or (symbolp face) (setq face (face-name face))) that didn't fail only because was never called with a non-nil non-symbol `face'. So it would be safer not to assume that a face can be only a symbol: === modified file 'lisp/faces.el' --- lisp/faces.el 2014-04-30 18:01:36 +0000 +++ lisp/faces.el 2014-07-06 23:38:01 +0000 @@ -359,7 +359,10 @@ (defun make-face-x-resource-internal (fa (defun face-name (face) "Return the name of face FACE." - (symbol-name (check-face face))) + (check-face face) + (if (symbolp face) + (symbol-name face) + face)) (defun face-all-attributes (face &optional frame) @@ -2731,8 +2734,8 @@ (defun x-resolve-font-name (pattern &opt contains wildcards. Given optional arguments FACE and FRAME, return a font which is also the same size as FACE on FRAME, or fail." - (or (symbolp face) - (setq face (face-name face))) + (when face + (setq face (face-name face))) (and (eq frame t) (setq frame nil)) (if pattern From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 08 05:04:36 2014 Received: (at 17956-done) by debbugs.gnu.org; 8 Jul 2014 09:04:36 +0000 Received: from localhost ([127.0.0.1]:46547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X4RKF-0002BL-Jq for submit@debbugs.gnu.org; Tue, 08 Jul 2014 05:04:35 -0400 Received: from alc-vshost7.dreamhost.com ([69.163.216.107]:57424 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X4RKD-0002BE-Tc for 17956-done@debbugs.gnu.org; Tue, 08 Jul 2014 05:04:34 -0400 Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 5593D30CBB68C5; Tue, 8 Jul 2014 02:04:31 -0700 (PDT) From: Juri Linkov To: Mat Smiglarski Subject: Re: bug#17956: 24.3.92; Calling highlight-regexp non-interactively causes errors from face-name Organization: JURTA References: <87r41y59v6.fsf@mail.jurta.org> Date: Tue, 08 Jul 2014 12:03:57 +0300 In-Reply-To: <87r41y59v6.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 07 Jul 2014 02:38:18 +0300") Message-ID: <87y4w42pdu.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 2.4 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Version: 24.3.92 > So it would be safer not to assume that a face can be only a symbol: This regression is fixed now in the emacs-24 branch. [...] Content analysis details: (2.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 RCVD_IN_XBL RBL: Received via a relay in Spamhaus XBL [69.163.216.107 listed in zen.spamhaus.org] 1.6 RCVD_IN_BRBL_LASTEXT RBL: RCVD_IN_BRBL_LASTEXT [69.163.216.107 listed in bb.barracudacentral.org] X-Debbugs-Envelope-To: 17956-done Cc: 17956-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.4 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Version: 24.3.92 > So it would be safer not to assume that a face can be only a symbol: This regression is fixed now in the emacs-24 branch. [...] Content analysis details: (2.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 RCVD_IN_XBL RBL: Received via a relay in Spamhaus XBL [69.163.216.107 listed in zen.spamhaus.org] 1.6 RCVD_IN_BRBL_LASTEXT RBL: RCVD_IN_BRBL_LASTEXT [69.163.216.107 listed in bb.barracudacentral.org] Version: 24.3.92 > So it would be safer not to assume that a face can be only a symbol: This regression is fixed now in the emacs-24 branch. From unknown Wed Jun 25 03:56:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 05 Aug 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator