Ruijie Yu <rui...@netyu.xyz> writes:

>> Hello,
>>
>> 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; -*-
>> ...
>> --8<---------------cut here---------------end--------------->8---
>>
>> 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.
>
> In case I am right, I'll send a patch for this and another issue I find
> for review shortly.

Here attached is the patch for orgweb.  The commit message describes the
two issues I find regarding orgweb/publish.sh.

>From 90fd8ecc39cb279ee27e0db2f637f60c7b80af07 Mon Sep 17 00:00:00 2001
From: Ruijie Yu <rui...@netyu.xyz>
Date: Fri, 14 Apr 2023 16:04:27 +0800
Subject: [PATCH] * publish.sh: fixed major mode; converted load into require

Major mode was erronously set to shell-script-mode because of the empty line.

Converted the `load' into `require' because it allows someone working on a local
repo to `eval-buffer' successfully, given that the individual installs these
dependencies from GNU/NonGNU Elpa.  Previously, due to the hard-coded path,
`eval-buffer' would not be successful.
---
 publish.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/publish.sh b/publish.sh
index f756ff6..b3911d2 100755
--- a/publish.sh
+++ b/publish.sh
@@ -1,13 +1,13 @@
 #!/usr/bin/env sh
-
-":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-
+":" ; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-
 
 (add-to-list 'load-path "~/org-mode/lisp/")
 (add-to-list 'load-path "~/org-contrib/lisp/")
 (require 'ox-html)
 (require 'ox-extra)
 (ox-extras-activate '(ignore-headlines))
-(load "/usr/share/emacs/site-lisp/elpa-src/htmlize-1.56/htmlize.el")
+(add-to-list 'load-path "/usr/share/emacs/site-lisp/elpa-src/htmlize-1.56")
+(require 'htmlize)
 
 (setq make-backup-files nil
       debug-on-error t)
-- 
2.40.0

-- 
Best,


RY

Reply via email to