From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CO72JvYMVmHn/AAAgWs5BA (envelope-from ) for ; Thu, 30 Sep 2021 21:16:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id yAKzIvYMVmFqSwAAB5/wlQ (envelope-from ) for ; Thu, 30 Sep 2021 19:16:06 +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 AE45F86FC for ; Thu, 30 Sep 2021 21:16:05 +0200 (CEST) Received: from localhost ([::1]:39372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW1XH-0001jG-Fe for larch@yhetil.org; Thu, 30 Sep 2021 15:16:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW1WF-0001gp-G7 for emacs-orgmode@gnu.org; Thu, 30 Sep 2021 15:15:00 -0400 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]:39601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mW1WD-0006Eb-D7 for emacs-orgmode@gnu.org; Thu, 30 Sep 2021 15:14:59 -0400 Received: by mail-qk1-x729.google.com with SMTP id f130so6912208qke.6 for ; Thu, 30 Sep 2021 12:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=zxwvL0oRDLMCV1rsYeI9SInf3sGU279Wpf145Yql5I4=; b=l+Gt1RsQImmWuBE+EVShuWn0oMjF6MH/CklyxjqW1H4yHTjchCLIvVBclcytW/TGS6 FI0r0/lwlw+T5uzhibjMTb8r/FCmZ3zhVsNCE1F6aLgby3sjpeN66ZBl8GBt76fT9PkI HBEg/C1ogxYyuEvC12Kg64p1qtKKcV6anQUTkMvI2BQj8N8k4XH4RhWbiNDS2alVqven frl1u99Y5S8UywPOorqK1Rl04Orc5DnNvnNNycOp7kz5qF7sDaxmRSzDuB94l87TUq5r I2un5HfNOtDi0AgFm9PJYB9O0CzRjHOOJVTUXXZVwZzWcxKf2CRdoQilqBUULK9fJGKs oKKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :date:in-reply-to:message-id:mime-version; bh=zxwvL0oRDLMCV1rsYeI9SInf3sGU279Wpf145Yql5I4=; b=Lp9hXfwPtDfEwELL0ZPTSJ9Ozj3B46siOHdhuIIAn7vFcX2IWU2zbJhHC53EVbP4ZP UD/YCWpjnuZoTjPZY8pySLgUQf36AxSqUfHb0GhmgMmekJfY6AHxAJDC7jg51ASGxx4/ y54mSbJ1YPLFQhQWnH64Lu+f9/cCjOO2ys/H8fcY+Azgrx0dthbTb4cci1bclbAQ1bnO aN1Cm2tXloWPL4X5vqV5dgjyXiQ75z2UgZ2STcBBU3JhdsyVJWqh0cdZADZEwzy1ZXW/ gpNNnub4VG+iV3G2WMuFRZYo8R1BMg9QrxghinB03freUeFAv0hih7dZX+1Os2+DW4qx qkLw== X-Gm-Message-State: AOAM530vENTFUBAK/gIgXW+/LOF7lsQoFohSsdMD8da720UPnOtu4msu QM+LhyZEBxlPBlgmnVDVmmEs7FOoBW8= X-Google-Smtp-Source: ABdhPJzsq1WxCpkWo2za5Wieytf3JhQzLOA8Ew/yj4cDID77bY3lX6kIP1QB/+F3UXSpKp5QyDNGsg== X-Received: by 2002:a37:d48:: with SMTP id 69mr6452215qkn.143.1633029295518; Thu, 30 Sep 2021 12:14:55 -0700 (PDT) Received: from Johns-iMac.local ([2601:547:901:82e0:3551:54b7:1c9f:da8a]) by smtp.gmail.com with ESMTPSA id 75sm1863190qkh.121.2021.09.30.12.14.54 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Sep 2021 12:14:55 -0700 (PDT) References: <87h7e5dtbb.fsf@ucl.ac.uk> User-agent: mu4e 1.6.5; emacs 28.0.50 From: John Kitchin To: Alper Alimoglu Subject: Re: Would it be possible to color horizontal lines in org mode? Date: Thu, 30 Sep 2021 15:14:24 -0400 In-reply-to: Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::729; envelope-from=johnrkitchin@gmail.com; helo=mail-qk1-x729.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633029365; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=zxwvL0oRDLMCV1rsYeI9SInf3sGU279Wpf145Yql5I4=; b=T8gOBvCEKsqkqjkJlhkyAHQnCKslPvrPbPOey4Eo1Nwb+kjgGhqW/XPgGsIpSb1uUjOFqy em9rqHVLIcS1TcTjZ7FuPccG5DaPfTQKzaQSrKZkX8td9dTHXYyxt8C1wy/BRhVMdie6AQ PnHOYXQ48vlNFOqffDQSipdyVaTCfa4Ew4YtBisxNqtziVXef2B6Wi08ihwupe9dPrNAur +1D5QUo1gMiXa90aAMVqsfdqJT7WQpEqAmPQhFJMJm+U6DbLiURPghmd/bSiSwbpv8kMoK U47r9zlbmo5mnxUHg62ZpvYWfnm20JwT2OiA4kr7p85Q8okOUxVcV49Z9r5Ovw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633029365; a=rsa-sha256; cv=none; b=mQ9eRf4fVxdlKLaHK919jku+MmRM4PccysO4TBkM3nwDumQY9OYpQDKd8DkN/nwOLa6qax 09kTuIrQxvDycDHY58NliFs0o7l7aceTqitNf1SP5KY+L392hCG1YFBJhbNTQ/mzC9lp5f aXX0o5zjE1S1yogJiiSjrlnbqgGIBqJt6n6dy3UoqFfMBBw/WROWQTHJHELkraak6v5h/K rKNRyspqrkpwEwdYId4Jp9tnrqdgHfsMEVMNCn752c5j3nP+zALlaHIGO1yD/TVO2Dmafl J/oLmrYJcZF/mIU0XmDY/UUEnouzWc5FIH8STGvXDCConXq0BcxJknZbX0gf7A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=l+Gt1RsQ; 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-Migadu-Spam-Score: -0.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=l+Gt1RsQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=andrew.cmu.edu (policy=none); 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-Migadu-Queue-Id: AE45F86FC X-Spam-Score: -0.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: EKyc84brLJHk This looks correct. Some people prefer to use named functions for this, so it is easier to remove them, but this works fine. Alper Alimoglu writes: > Thank you Professor Kitchin. Would something like follows would work? > #+BEGIN_SRC emacs-lisp :results silent > (add-hook 'org-mode-hook (lambda () (font-lock-add-keywords > nil > '(("^-\\{5,\\}" 0 '(:foreground "red" :weight bold)))))) > #+END_SRC > > -Alper > > On Tue, Sep 28, 2021 at 8:18 PM John Kitchin wrote: > > you can add a rule like this in an org-mode hook: > > #+BEGIN_SRC emacs-lisp :results silent > (font-lock-add-keywords > nil > '(("^-\\{5,\\}" 0 '(:foreground "red" :weight bold)))) > #+END_SRC > > that will make a line starting with at least 5 - be red and bold in color. > > John > > ----------------------------------- > Professor John Kitchin (he/him/his) > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > On Tue, Sep 28, 2021 at 4:00 AM Eric S Fraga wrote: > > You could use hi-lock-mode to define your own colouring for such > lines. But I'm sure those that under font-locking better might be able > to add appropriate rules for this horizontal line construct. > > -- > : Eric S Fraga via Emacs 28.0.50, Org 9.5-g9a4a24 > : Latest paper written in org: https://arxiv.org/abs/2106.05096 -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu Pronouns: he/him/his