From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uTxgJ2anbV+QHAAA0tVLHw (envelope-from ) for ; Fri, 25 Sep 2020 08:16:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aJWyImanbV9ASwAAbx9fmQ (envelope-from ) for ; Fri, 25 Sep 2020 08:16:38 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 347FD9404C2 for ; Fri, 25 Sep 2020 08:16:38 +0000 (UTC) Received: from localhost ([::1]:47576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLiuD-0004fP-4T for larch@yhetil.org; Fri, 25 Sep 2020 04:16:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLitJ-0004dx-KX for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 04:15:42 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:52551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLitE-0000wq-0x for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 04:15:37 -0400 Received: by mail-pj1-x1036.google.com with SMTP id bw23so1454168pjb.2 for ; Fri, 25 Sep 2020 01:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=mfXnGcbk4D8kw375FTHk4We+fo2GmhfSZoMOtv+6hj8=; b=cttox8b86HWrRWynjN6JG6IxZW5p6Dm/GwROPTW4Je8QRT+mcLM4K0/Gg7zvo8yaVO +hrqX6aKYyGwtIuW4r6TeDjq42YgJYgIUsfEcfrt3NFJCUlzzTw8RDgvUxryHjvr8/GZ SUan7W+ZaQkb+Aqv4f/jADYgWG1bo/MYRsj8LFNLT15hd847e8TJduMvZmGA5Xz7JX1j CfNoqj2DIcFKoQFCcRJYnQxeFzMrbuTftnvYNb3iSerPSrbf/b19qJ6sq5lAk2iI+SJK lxeFYJn51qbmtV6O3Nft9AyC9Dv5/RdVU7rgmyNOUBWEqm1gn/3IkIKEWN1/HJd0v+n7 9GAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=mfXnGcbk4D8kw375FTHk4We+fo2GmhfSZoMOtv+6hj8=; b=rWNbLPBOD6PodNde+l8AFbTIxKZeJtGp29Nq1hVPEvuf7uo9HC0F4UubwzjTw8nWCT rPKV3CEO02HP0XuQCNeJtFEawpMM919KNt6UHmM6dCNJpZYz35GjxIBHOPHKmH/p2IFI WwCtK/lmy1X5nTKWE6IQuNuqktWn1EsDNJMUeCR8XUYgQc4mK5VlKhz0kQ6T6NA0Jw4A Wdsvg+IQzQUomYo0DCn+/0UemTU2Zh5LdRPo3uvZwyn4QKaKziJTDxOa1vTZH7QsNfWT k8EZIVOan28Jf6i7hqXpWzSwg/wqm+IZeVEuQy4uHICgfc+bBjDBAveSLIBZ5RD7T2up tAgQ== X-Gm-Message-State: AOAM532OQ0aDNg2DxKNCFmpCTo4X+R3qI6LlChZhdO74obHjG4F8juy0 PKKMQkjOD3SC9uLSrIfCRuONVf/sICeqKw== X-Google-Smtp-Source: ABdhPJzK5Z4ZCqepBrgTOSu9YY52vBl2ak5JL6FQD9Mx4iGtG4z49W5R6r5KFP4Pp7R91JhcoM+phw== X-Received: by 2002:a17:90a:49c8:: with SMTP id l8mr1533687pjm.24.1601021734407; Fri, 25 Sep 2020 01:15:34 -0700 (PDT) Received: from localhost ([104.250.131.79]) by smtp.gmail.com with ESMTPSA id x6sm1405076pjp.25.2020.09.25.01.15.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 01:15:33 -0700 (PDT) From: Ihor Radchenko To: "Pierre-Henry F." Subject: Re: Help: how to extend org-mode markup? In-Reply-To: <87y2ky46l9.fsf@localhost> References: <871riq5nbe.fsf@localhost> <87y2ky46l9.fsf@localhost> Date: Fri, 25 Sep 2020 16:14:29 +0800 Message-ID: <87v9g246je.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1036.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: -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-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "emacs-orgmode\\\\@gnu.org" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=cttox8b8; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 1.29 X-TUID: 4rxjwYYrTT2d Sorry, misplaced the argument. 'append should be the last argument to font-lock-add-keywords: (font-lock-add-keywords 'org-mode '(("\\W\\(:next:\\)\\W" 1 font-lock-warning-face prepend)) 'append) Ihor Radchenko writes: >> As suggested by Ihor, I tried: >> >> (font-lock-add-keywords 'org-mode >> '(("\\W\\(:next:\\)\\W" 1 font-lock-warning-face prepend))) > > You need to fontify it _after_ all other org-mode font settings: > > (font-lock-add-keywords 'org-mode > '(("\\W\\(:next:\\)\\W" 1 font-lock-warning-face prepend) 'append)) > > Best, > Ihor > > > "Pierre-Henry F." writes: > >> Thank you very much for your replies. >> >> Here is the use case: >> >> |-----------+--------| >> | something | :next: | >> |-----------+--------| >> >> I would like :next: to show up using an arbitrary face. >> >> >> As suggested by Ihor, I tried: >> >> (font-lock-add-keywords 'org-mode >> '(("\\W\\(:next:\\)\\W" 1 font-lock-warning-face prepend))) >> >> in my init.el >> >> It does not work either. >> >> >> @Christian yes, it's the same syntax as tags, I would like to extend it = eventually. >> >> >> Thanks, >> PHF >> >> =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original= Message =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 >> On Friday, September 25, 2020 9:26 AM, Ihor Radchenko wrote: >> >>> > (add-to-list 'org-font-lock-extra-keywords >>> >>> It is internal variable. You should not use it. >>> >>> Simply use font-lock-add-keywords instead. >>> >>> Best, >>> Ihor >>> >>> "Pierre-Henry F." contact@phfrohring.com writes: >>> >>> > Hello, >>> > I would like to extend the org-mode markup. >>> > For example, I would like to change the face of a keyword, say: :next= : . >>> > Whenever :next: is displayed from an org-mode buffer, it should show = up in using an arbitrary face. >>> > I tried this: >>> > (defun org-add-my-extra-markup () >>> > (add-to-list 'org-font-lock-extra-keywords >>> > '("[^\\w]\\(:next:\\)[^\\w]" >>> > (1 font-lock-warning-face t)))) >>> > (add-hook 'org-font-lock-set-keywords-hook #'org-add-my-extra-markup) >>> > But it does not work. >>> > So: how to extend org-mode markup? >>> > Many thanks, >>> > PHF