From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kII9N/WGkWIwNwAAbAwnHQ (envelope-from ) for ; Sat, 28 May 2022 04:20:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kJRANvWGkWK6ZQAAG6o9tA (envelope-from ) for ; Sat, 28 May 2022 04:20:37 +0200 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 7C7219A61 for ; Sat, 28 May 2022 04:20:37 +0200 (CEST) Received: from localhost ([::1]:53118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1num4C-0002PD-Ma for larch@yhetil.org; Fri, 27 May 2022 22:20:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1num3Q-0002N2-Vc for emacs-orgmode@gnu.org; Fri, 27 May 2022 22:19:48 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:54898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1num3O-0002GW-Ny for emacs-orgmode@gnu.org; Fri, 27 May 2022 22:19:47 -0400 Received: by mail-pj1-x1033.google.com with SMTP id j7so201371pjn.4 for ; Fri, 27 May 2022 19:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=dexLiQ2L91Tcy5n32eykjjGXvyQOYHm6X9MjbZEUtbM=; b=kzMClJU6SPw7pdu/F9fXstL7aGEtsSa84A7pB0A28QF2HgfPeMnvlpp1teP+8f1pXX 4sfxbtNaAuq3GmFNRyqD6MCXRlk1H20ibpDvQ3uFAHpBdfpsztZzDJdc3iah5m6BMCTk BOzMb1/muHqNZOY5vJQDjjNq8bOAddyt6an5uNc75hNyDhCTVP2Br5TSmEeG4ZwowVu6 B1ltlhmyCreE95QcXXPADiXYNEW+T9CYIDFTBH+Vpa6CGOyy+OZvQThkMKqrqFc1pcRX Hp010SCaYueTbH3HtiMe3LzWQmnFf6Mss++BgG7vFsAgIySi9K+uG9ePKWxBlBMCHWWj ddNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=dexLiQ2L91Tcy5n32eykjjGXvyQOYHm6X9MjbZEUtbM=; b=Bd72yBISGUO8Zr2/8NCRIE/5L6aKWYYvpnZi5MXcrDPxf3DdmW5bAt8b6MisapCoQG OeAaknm31HScKb5zvbGuCOpedz2iujDdA67l7gvtR/wLckxWNYi9XWp8fbEM8+yqYtEy ng596QhyosnrGjZeletr6T6HNPtIYvh38fJYyEn3xh/nuwHo8NFMTE8uO4pjL+dl+8b7 wE48Bo0ljn/j8zPDZ2uTPAUiZePW1s/Addy/FGmSKRqpctJFlRkC+tv/xB6+wkSAKT3H xlImG4qTZYIM2p9o3b2Lk+b0GIfvFhOEILh6SkocFSQWdc5IhSzVSMmDW3Li1lZgGLoL kPEg== X-Gm-Message-State: AOAM532/tx9nfZM954C6kJCPEoDdMzIznSKjpBYjCSSiJKXi1o3nJN5U 2X/QyQouBNlySdYwPXN6Uxs= X-Google-Smtp-Source: ABdhPJwcwsGvD+5++F8c+0tR23Khc0W9ypBAKne0VKGTMaKI4ln0HE//lA3iXDnvll2GCFFuyKFqSg== X-Received: by 2002:a17:90a:d705:b0:1e2:a03c:a4c5 with SMTP id y5-20020a17090ad70500b001e2a03ca4c5mr956481pju.58.1653704385251; Fri, 27 May 2022 19:19:45 -0700 (PDT) Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id v3-20020a17090331c300b0015e8d4eb276sm4337531ple.192.2022.05.27.19.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 19:19:44 -0700 (PDT) From: Ihor Radchenko To: numbchild@gmail.com Cc: Marvin =?utf-8?Q?G=C3=BClker?= , emacs-orgmode@gnu.org Subject: Re: [BUG] Setting compile command causes fontification error [9.5 (release_9.5-661-g5e0afb @ /home/quintus/.emacs.d/org-mode/lisp/)] In-Reply-To: <629180cb.1c69fb81.4263.8e2fSMTPIN_ADDED_BROKEN@mx.google.com> References: <87k0a7kzlh.fsf@guelker.eu> <629180cb.1c69fb81.4263.8e2fSMTPIN_ADDED_BROKEN@mx.google.com> Date: Sat, 28 May 2022 10:20:25 +0800 Message-ID: <87czfye6ty.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653704437; 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=dexLiQ2L91Tcy5n32eykjjGXvyQOYHm6X9MjbZEUtbM=; b=NLbmUglJtuCT633+FXoqy+B5Znx3ihJ6Wyu/8jkPXYYd8lGSlK6P6M/inP1JbG3Urv5iku 5oxAiWi/xueIvzb1U0zHhpiX5cLryGZIQGmkAbFP9LmRS3GXuWNy7932AuFlAqQll+49dW pgPeZJQJ44CDJxPxqG26U+R2VbxpknNroS+/yjonTevyF84gwfkkFa/Y3PrAakzmAXH8+s b2zFRZ/XoV7eVBAD4QvI8U1WbT8c28KQjSQDKg8ZIT9zfGQ9t6qMQYEEiPCdn1sdqwTfCo XfE2OZ4CMwr99A5kqEx/H5zNtJPUpMEaOo034464yciWAuP0PVMVlP7w/oXISA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653704437; a=rsa-sha256; cv=none; b=QgS2sCSdQgF5MaigOplNJqPUlBdzXLNptqH/uzb4V70LYtvFd+3QxKiGYNDSeJmCQPSbvC diN1ay8hBuCqaMbTT3tLQCDi/7MaRmkD1bu5tpCRKw2iAd0Prc0YZpKqTUJdAGArNf6Sah SKdj1VkaljnJkA7hkC9MfBbZC3oeW3zYIqufK7uSuYHf9cmlQ1xXUH3ftbQChMoA1QmRhD PZhttznEV4wJTmKNK9X3HtVe4BlKJVjlXTWlG8f2RwiUhmR6a1VW1THA9X+Kc1jnDk/Uqq OY3bd6cj+mVUVk1ZBANeNYrH6Rj4Qs76PzNGpcwFbi/zaRfke+bfCx/kY6rHLg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kzMClJU6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.84 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kzMClJU6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 7C7219A61 X-Spam-Score: -3.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: OZt6RSqi1RSO "Christopher M. Miles" writes: > From the backtrace, seems (buffer-file-name) returned nil, I guess you > first created a new buffer and have not saved it to file. That caused it > return nil. Not Org Mode problem. Not saving file is a common problem in > young programmer as I experienced. No offence. To clarify, the problem is in the user-defined hook: (add-hook 'latex-mode-hook (lambda() (set (make-local-variable 'compile-command) (concat "lualatex " (shell-quote-argument (buffer-file-name)))))) The hook does not work when (buffer-file-name) returns nil, which is exactly what happens when Org mode tries to fontify the source block. Org does it inside a temporary buffer not associated with any real file. One way to fix the problem would be (add-hook 'latex-mode-hook (lambda() (when (buffer-file-name) (set (make-local-variable 'compile-command) (concat "lualatex " (shell-quote-argument (buffer-file-name))))))) Best, Ihor