From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2C0dLQgfmmAFRAEAgWs5BA (envelope-from ) for ; Tue, 11 May 2021 08:07:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id UGzUKAgfmmCzRgAA1q6Kng (envelope-from ) for ; Tue, 11 May 2021 06:07:04 +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 EB2EA1FE30 for ; Tue, 11 May 2021 08:07:03 +0200 (CEST) Received: from localhost ([::1]:51002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgLXr-00079c-5D for larch@yhetil.org; Tue, 11 May 2021 02:07:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgLTy-00052p-HE for emacs-orgmode@gnu.org; Tue, 11 May 2021 02:03:02 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:34679) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgLTq-0007mJ-M8 for emacs-orgmode@gnu.org; Tue, 11 May 2021 02:03:02 -0400 Received: by mail-pf1-x432.google.com with SMTP id 10so15429554pfl.1 for ; Mon, 10 May 2021 23:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=bsWQsmZZFfv7DkIyjNmI5RXDDDwQUZOzIsO2PjnKlbA=; b=tbw/+EnTM2vLoqv+t1Ph0vnIrM9vu/oZA0jQPGjzlqYImzmVMff/7gdW/1a6lTbysl FrP41aXlSOYwO6t/WPbq74s0OgOdvwDMcpkX+i4rb7S/tDeMret/k4VRf085Mt2O8mGX PPHgQzkjYCyn0TbKE63T8RZB1or7jB90uXPcTPQUTppAJTr2rucFrQIG+7mZPBNctp4v O9rbnb4sYadZL0Y1w9ttfJAYKx7GRoMElDIlhxFdbzQOW7Hs2Zn4LGmpQSwbYQdGb8n3 U/uTyQtgkGAzdfai2ujJm6e/JqV24bAkVBFB4DOzEyxL+rE77wI1l9uK3PjxiTQIBKE/ HKqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=bsWQsmZZFfv7DkIyjNmI5RXDDDwQUZOzIsO2PjnKlbA=; b=Pvh+0PLuFkz1IprKFzZIQptoHiQb4RYwiVM5eT1DqzofP6JQt1PbzWTIY0AZtBpVfe 2Wbf22IXe1AXDK5VaLI3OC8eyU8RltLUzNIAoyyZYfl87ZK9oCs9yvgQPNGI1Etk95WV 8nxIH0CTzIPVb2bEoZ7IcP6MppQmF1Cff/jd3z4ZOFay7+Yc1vn8UsZjjDodBOHIIC59 z/YsUM30V0Lmsxo9lugnrm3XPVH/CPeHw6ajMpSnpdSk8JKdnK9DkloxmY7cCLx3fapX ZLPfP2FSbJhDQlgvlZbR/3I0g4cD4Nkt4p1jRy/xRjXbS2msn5vQoikTuaxmW6/TSPmI TuOQ== X-Gm-Message-State: AOAM530kcLKgToWWxtdTHleVz0F1cz7MSQq0mv3MH7IvP5Hkwp5sAjrG oTeIM5HSZdPRyvNvoeNox5XukyIupAI= X-Google-Smtp-Source: ABdhPJytn8eOadF/5VubFaDa19zM+E72F8O5fS6Cm8CuhQPj/Jk8EpaQBsrMhSqt5erwAsWJ60bSPQ== X-Received: by 2002:a62:1a4b:0:b029:24e:ba53:aaa4 with SMTP id a72-20020a621a4b0000b029024eba53aaa4mr29371171pfa.63.1620712973005; Mon, 10 May 2021 23:02:53 -0700 (PDT) Received: from tim-desktop (106-69-120-32.dyn.iinet.net.au. [106.69.120.32]) by smtp.gmail.com with ESMTPSA id a16sm12554682pfc.37.2021.05.10.23.02.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 23:02:52 -0700 (PDT) References: <87zgx1c1a4.fsf@gmail.com> User-agent: mu4e 1.5.13; emacs 28.0.50 From: Tim Cross To: Christopher Dimech Subject: Re: Highlighting and Background Colour for Source Code Date: Tue, 11 May 2021 15:50:17 +1000 In-reply-to: Message-ID: <87wns5byeu.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=theophilusx@gmail.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620713224; 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=bsWQsmZZFfv7DkIyjNmI5RXDDDwQUZOzIsO2PjnKlbA=; b=EELubYMdKhG+jbYgqGKrVFtGLd5bsq4Fplmvm+oNDgJtdobDMxwZN5nzgrerwAY/VJ8J8t 9jc1icAkf4L9ne54GLSof3dUxAmIHOysZ62dGhGlAP/vIXJSiHO875+q+dFJL1j87MH9lV RKhh0y/BFPNzjNgxNjHIn00Z5KyPHHtd2/gRryDy3+5zby7xarqvGXRpRvU5uplmmY5S7u ovhehAUK3zCd+G5XGURfYG+i8504+9MYE1TX/Z2C9fFmPOASradjGmX+mlaJpJZYEDAQ9A EWk8HHbqpgGdQPgeP3MkEoZzF32wbhkNF+lBEG/wncM4i2qZG/I0urmuv61jFQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620713224; a=rsa-sha256; cv=none; b=hYz2Xtqg7AjmoTEjlSh5TtTQr4K5q/Iyaeun5O4bi7gIrnRWUcrERWSEaVkoekCi6zbEtT inviH+FE/heWo3jtzSvpWWUfWUCMU5zcDXaWYZlfkn5gN6s10Zj600/bmMFj/A/VJnEgn0 hOiNr41PuEoWk9E1G2yal2KQ+WS8UKEOHq4o4T2UkN79onA4AAyP/TldG9M1uEbENg5QOG EXTN8GlM/j3mAtt71zGi88SWst0WlO6Zx1rbzalOJoliTs9TXzW0TuG+Jn3A4Cmu0JPaiT lzJ392MDDyvczfhBL4BW8/4Di/XCW/YWcL0WVyq6jpRTvfCx7+uVe626fPOY1A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="tbw/+EnT"; 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-Migadu-Spam-Score: -3.15 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="tbw/+EnT"; 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-Migadu-Queue-Id: EB2EA1FE30 X-Spam-Score: -3.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5aygnxHx2rKJ Christopher Dimech writes: >> Sent: Tuesday, May 11, 2021 at 4:50 PM >> From: "Tim Cross" >> To: emacs-orgmode@gnu.org >> Subject: Re: Highlighting and Background Colour for Source Code >> >> >> Christopher Dimech writes: >> >> > Currently currently handles the highlighting of programming languages through >> > "Code Blocks". Could org-mode have the capability of highlighting a whole buffer >> > with a particular language highlight typeface. >> > >> >> Sorry, I don't quite understand what exactly your asking for? > > Suppose I have an elisp file and I change to org-mode by hitting "M-x org-mode". > The code does not get highlighted because it is not embedded within org-babel > construct. > > If I have a programming language file with some org-mode heading commands in it, > and change to org-mode, it would be neat to have language highlighting available. > OK, now I think I understand. Basically, with full org-mode, this is not possible and I don't think it is actually want you want. Once you switch modes, say from elisp mode to org mode, a lot more changes than just the font locking. Keybindings, various support minor modes and lots more. The 'normal' Emacs way to handle what you are looking for is to add a minor mode. A minor mode is used to add some level of functionality to a buffer without losing the major mode settings. Normally, you only have one major mode associated with a buffer and often that mode is augmented with a bunch of minor modes. For example, outshine mode is a minor mode which adds some org-like functionality to non org-mode buffers. Have a look at https://orgmode.org/worg/org-tutorials/org-outside-org.html I think that might give you some ideas to get you started. You may need a few different minor modes to get the full setup you want and you will likely need to do some customisation of key bindings etc to get things how you like it. -- Tim Cross