From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Narendra Joshi Newsgroups: gmane.emacs.devel Subject: Face text property for `minor-mode-alist` item. Date: Sun, 27 Dec 2020 16:13:02 +0100 Message-ID: <87im8nz3i9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34554"; mail-complaints-to="usenet@ciao.gmane.io" To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 27 16:13:57 2020 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 1ktXk5-0008t3-Ge for ged-emacs-devel@m.gmane-mx.org; Sun, 27 Dec 2020 16:13:57 +0100 Original-Received: from localhost ([::1]:58046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktXk4-000752-JC for ged-emacs-devel@m.gmane-mx.org; Sun, 27 Dec 2020 10:13:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktXjJ-0006bk-P0 for emacs-devel@gnu.org; Sun, 27 Dec 2020 10:13:09 -0500 Original-Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:35564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ktXjH-0006FQ-Ab for emacs-devel@gnu.org; Sun, 27 Dec 2020 10:13:09 -0500 Original-Received: by mail-ej1-x636.google.com with SMTP id q22so11374463eja.2 for ; Sun, 27 Dec 2020 07:13:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=YD2NZvojOQiEnGzipK0o3Ming2Hoa58gbhaTnVmVVJI=; b=cbeEVP/URIZ5z/Jc5GrwDFch/mdDK5W+PVbwndl3Mmou6Tx4K/Uugr1atAYvETG4il I20rTy7C7uJV24liuLQ/qKFVnZHBpsxCxVw8k/KH1g/m833C2pbhZ/R3DrGBIUVW8mTz PaRvMjXyXs/YEw8gvvMb636nBWgHJdhLcH7o8jyCzlzWNYWZUEVk7T6xpNZx9GuIwjbr mPL9/3W4P5JuGgzcFLbvDoRZPnfrGg2rm/BzLRnhZ3DRgKnpGy5zyDWZ+ZhcLQ4vC4qS eryQDwJrx33sVeJYbn+k7u7wAO7hN91edb1/cI3fzVEk/i2xSKMzhoGT8gR0Cv1mCKIF N6Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=YD2NZvojOQiEnGzipK0o3Ming2Hoa58gbhaTnVmVVJI=; b=eBeh6CU8rLcDtLFivpz7dzoM4qI7nVYkp2c7RiRnCMUer1FZO25vwnXuwbmJZ3y9Nc sfPPui84HKBpdvgvFUEr8jhkTpO2HLnYyjxYxSZsr2BRehKsuOnyN2gaa1WHyH0L6dQy jXE0tleR6+jP1GkRv7Z64Tho9cXulvryDXJXjotVYOuaKX+LCuPTi3CWLtQRdWOo+sGg qGQR8X/tCP/NFP2d5DBKry+EuGcyWvKofJCqGHezcseZm+cKZmsWcXMqHyvd0I4p6p62 UfvxZ+K7rf/SC9C20lTOSpnPCTcP2uKNdWiI8x50BhhR4RRfYTfOTN8AgQg5DKB2TbOQ fXhQ== X-Gm-Message-State: AOAM532+J3LsYUHqaUhlP6wjwRmZPJpzRL2oKV7GGap+VxDuTPESTTDT YS5oKbevbaYDcIFNuonOY7zIS6GzkHhx8s0= X-Google-Smtp-Source: ABdhPJzL7yioFJElRBmlMNbS77bU4MhQ49KaYffJOEHx2W0gnxSdjWsCgWhhHViG7qWQJjJms2y40Q== X-Received: by 2002:a17:906:5293:: with SMTP id c19mr39097539ejm.72.1609081984652; Sun, 27 Dec 2020 07:13:04 -0800 (PST) Original-Received: from vicarie ([2a02:8109:b640:2344::4d4d]) by smtp.gmail.com with ESMTPSA id j23sm21773803edv.45.2020.12.27.07.13.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Dec 2020 07:13:03 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=narendraj9@gmail.com; helo=mail-ej1-x636.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.23 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:261902 Archived-At: Hi everyone, I am trying to understand the following behaviour regarding `mode-line-format' rendering the `:lighter` for `flycheck-mode'. I wanted to have the flycheck lighter display different colors for the error count and the warning count as `flymake` does. The following doesn't work. The face property of the first character of the string returned by `flycheck-mode-line-status-text' is used for the whole string in this case. --8<---------------cut here---------------start------------->8--- (setq flycheck-mode-line '(:eval (flycheck-mode-line-status-text)) (defun flycheck-mode-line-status-text () ... returns a single string with substrings propertized, e.g. #("some string" 1 2 ('face 'error) 2 3 ('face 'warning))) --8<---------------cut here---------------end--------------->8--- If I change it to something like this: --8<---------------cut here---------------start------------->8--- (setq flycheck-mode-line '(:eval (flycheck-mode-line-status-text)) (defun flycheck-mode-line-status-text () ... returns a (list ... part_1_with_face_1 part_2_with_face_2 ...)) --8<---------------cut here---------------end--------------->8--- This seems to work as expected and the parts have their respective faces applied to them in the mode-line. Is this a bug in Emacs or is this expected behaviour? Best regards, -- Narendra Joshi