From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id WFq1KQoQOWQ+TgAASxT56A (envelope-from ) for ; Fri, 14 Apr 2023 10:34:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +MSRKQoQOWRA3QAAauVa8A (envelope-from ) for ; Fri, 14 Apr 2023 10:34:18 +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 4E643E5A for ; Fri, 14 Apr 2023 10:34:18 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnEre-0005ZS-UM; Fri, 14 Apr 2023 04:33:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pnErc-0005Tj-UP for emacs-orgmode@gnu.org; Fri, 14 Apr 2023 04:33:00 -0400 Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pnErJ-0002yU-LD for emacs-orgmode@gnu.org; Fri, 14 Apr 2023 04:32:54 -0400 Received: from fw.net.yu.netyu.xyz ( [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id b0dc53e4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 14 Apr 2023 08:32:37 +0000 (UTC) References: <87edomooxk.fsf@localhost> User-agent: mu4e 1.9.22; emacs 30.0.50 To: Ihor Radchenko Cc: Emacs orgmode Subject: Re: Major mode of orgweb/publish.sh? Date: Fri, 14 Apr 2023 16:19:26 +0800 In-reply-to: <87edomooxk.fsf@localhost> Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz 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, 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.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Ruijie Yu From: Ruijie Yu via "General discussions about Org-mode." Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681461258; a=rsa-sha256; cv=none; b=O4eP43UK/vv/j6WBGPYuY/DtS0cFTGTiuuEn6l41fHtEtPPLkejsRt73Olbw3WUh7O8fDi wmEwqab8x6JVKp/bSnBypcuCL+X4W1D25GxKqenlJf0nYcK/YtbP+DbFktljeEa6LJ2PIk X36hPOUrUQpPA1ps7VmjWSAwMOcME/6AJZoeMfo/k8dMggH5xdIQ2YYPOuAORXCx+8/SQo E713UZ5bNlNDdRotQIBYSG8JKypDQxI5Wyu2jHZFlMeGmbLSkQtjbBunASIFtPhpqsPkob uQX1o7qHcme6IDGVnLVsBnau7ENow7JOi2T5NPrCvxGS7re8ePB41BwBMkG/AA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681461258; h=from:from:sender:sender:reply-to: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; bh=Ul4ZqUFt/uZCK+eLSkT5JfHMPkcm8ftEB7oUM1nsZ9g=; b=t3r75qHUteYO1pb5aKao3zqM2l8U6Sqtx5oGMUIIJAkj0HU5UQhA/tcv3/85GphrSVNm44 ebrL/UGB1Oem7KcTdEXp5dWoQnphwakX9R/TFTqYFXiHQannq5mXHVK/u/auyjMJk296/n xLbBpFpYPSYIMtPWtXXegChG9UMerNwJEO3aa8XChO7vAw+b8rvWfO7G1MBS3toqkn+QLC VCwckXX0mt+l8mEzY7wrBZaCtAzj0OatnfymcRDcEDYPDEtuvLjfFcey61qcUkTcsBTutu 89D8v5XPSSlRLT0XLxoOlNJG7N3p4fmQRrKEsWNNLjHmQRyUTMLnygc9LmkevQ== X-Migadu-Queue-Id: 4E643E5A Authentication-Results: aspmx1.migadu.com; dkim=none; 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"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -1.32 X-Spam-Score: -1.32 X-TUID: vCGoKuc/55H9 Ihor Radchenko writes: > Ruijie Yu via "General discussions about Org-mode." > writes: > >> What is the expected major mode for orgweb/publish.sh? When I open it, >> I see it is in `shell-script-mode'. This is what I see in >> orgweb/publish.sh: >> >> --8<---------------cut here---------------start------------->8--- >> #!/usr/bin/env sh >> >> ":" ; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*- >> ... > > The mode is technically shell-script. The file is using shell script > magic to write foreign language (Elisp) script inline. > >> When I remove the empty line 2 and run `normal-mode', the file now opens >> in `emacs-lisp-mode'. I have a sneaking suspicion that >> `emacs-lisp-mode' is the expected major mode for this file, because >> there is also the `lexical-binding' variable declaration on the property >> line, which has no effects when the major mode is shell. > > You can do either way, depending on which part of the script you want to edit. I tried to actually compare the two versions, and found out that the lexical-binding does nothing at all during the script execution, regardless of whether there is an empty line or not. Is this a bug or an expected behavior? FTR, when opening the file in a buffer, the property line in a file without empty line is properly recognized, whereas in the file with empty line it is not recognized. -- Best, RY