From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 kH88GCEdQGQ9AgEASxT56A (envelope-from ) for ; Wed, 19 Apr 2023 18:56:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iDhPGCEdQGSmcAEA9RJhRA (envelope-from ) for ; Wed, 19 Apr 2023 18:56:01 +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 1FC5B2D378 for ; Wed, 19 Apr 2023 18:56:01 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppB5A-0000xB-G4; Wed, 19 Apr 2023 12:55:00 -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 1ppB59-0000x2-08 for emacs-orgmode@gnu.org; Wed, 19 Apr 2023 12:54:59 -0400 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppB57-0004Ii-Bc for emacs-orgmode@gnu.org; Wed, 19 Apr 2023 12:54:58 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1ppB54-0002T5-AH for emacs-orgmode@gnu.org; Wed, 19 Apr 2023 18:54:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: Major mode of orgweb/publish.sh? Date: Wed, 19 Apr 2023 23:54:42 +0700 Message-ID: References: <87a5zaookb.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 2 X-Spam_score: 0.2 X-Spam_bar: / X-Spam_report: (0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-2.597, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN 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=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681923361; a=rsa-sha256; cv=none; b=DwdPE+K4je/yDpkjSMpl9Mze03ySg3RmdxieE/zo4NRVMFiP0BqKcee15M0tkX/9mCe9n4 Ai1CDwYct2TsN0UUNUtI/jH9sZgUPDzNDvvjhOyQ3Nd1qb1t7qhn5mAp/Ugu042ChORmfo ppFNE4zLsiaEzwzmoHktY7ffCQQWfuJNLJfUc1413j7M/E3cnCPeA0B/cj5qYrj65W1j5i kejm72i+DghEg56ssk+q+oi7rG5A0G871DgR/NNIALscKgx7FAXxz5KXuUIF6j+IG3rr6G L9G46+2hB3W23HqvUIYfI4TK6jOTqsxGt0uWmjnWPT5w3fPC/GYWeoPoaGVU5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681923361; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=BpvjawHNKA61UGy8FblBEJOGGcINY6nJnC6oGVGaP+w=; b=QEsbgKae+9EDcI7xXY/XaSa/Dys0jcAqpr60yhoscoBOw0pKfPSj0XMecrlZUwsTuJLbGE 6kwsBHLfkn+dd5jNp/426nNjfjtjUGFLbbj28roRTMrgd/9njrYRDB9BHD0x2ZcFRsn9pC bPM4rT13kgxQZQOtXBOHRJDRaRdBUOjE0d9mKnGtEt9kkahHaqi4hdnra2tUp75cS2dL9s IXwIp+RnylpisvIVlOJiIxgomzyPWiqIgYQCfAeewCWvfaWkmIfW5LbwSebWKDBkF3yJij O7JBq1xRUpBch0rl1D5O5SD2bO2VHyFz+jXVThwyD6iF5qpLDHzIJAqGoRBD3Q== X-Migadu-Spam-Score: 3.49 X-Spam-Score: 3.49 X-Migadu-Queue-Id: 1FC5B2D378 X-Migadu-Scanner: scn0.migadu.com 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=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) X-TUID: NPnHdJQMtcvu On 14/04/2023 16:20, Ruijie Yu wrote: > Ihor Radchenko writes: >> Ruijie Yu writes: >>> Major mode was erronously set to shell-script-mode because of the empty line. Empty line was added by mistake, see "23.3 Choosing File Modes" in the Emacs manual: (info "(emacs) Choosing Modes") https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html ---- When the first line starts with ‘#!’, you usually cannot use the ‘-*-’ feature on the first line, because the system would get confused when running the interpreter. So Emacs looks for ‘-*-’ on the second line in such files as well as on the first line. The same is true for man pages which start with the magic string ‘'\"’ to specify a list of troff preprocessors. ---- >> The line in question is inline stdin redirect >> in shell. "#..." is what is fed to exec emacs. There is no stdin redirection, ":"; exec emacs --script "$0" #... line instructs shell to stop interpreting this file and to execute emacs instead, passing file name for this script. This line is valid for both shell (sequence of "true" and "exec" commands) and elisp (string and comment). So this is a valid elisp file for emacs. > I was about to propose changing the shbang line into just > #!/usr/bin/emacs -x It would fix path to emacs binary. Currently double trampoline is used. I see no point in /usr/bin/env since location of shell is considered fixed. That is why #!/bin/sh should work as well. Shell looks up for emacs in the $PATH environment variable. /usr/bin/env can do it as well, but shebang allows just single argument. Latest GNU env versions are able to split passed string to separate argument (-S option), but currently interpreting of script arguments as emacs options are suppressed by -- before "$@", so they are passed as `argv' list elements. #!/usr/bin/env -S emacs --quick --script should work, but it is less portable since relies on recent GNU env version and less safe since script options may modify emacs behavior.