XEmacs shell-script-mode vs. Emacs shell-script-mode[bash]

XEmacs shell-script-mode vs. Emacs shell-script-mode[bash]

Post by Hattuar » Tue, 25 May 2004 16:40:23


I've noticed the shell-script-mode I get with Emacs behaves differently from
that which I get with XEmacs. In particular the Emacs version provides a
hard indentation feature (I don't know the formal term for hitting Tab to
indent code to reflect the syntactic structure, but that's what I mean).
Can I configure XEmacs (latest CVS) to support hard indentation when
editing bash scripts?
--
p->m == (*p).m == p[0].m
 
 
 

XEmacs shell-script-mode vs. Emacs shell-script-mode[bash]

Post by Stephen J. » Tue, 25 May 2004 18:13:52

>>>>> "Hattuari" == Hattuari < XXXX@XXXXX.COM > writes:

Hattuari> Can I configure XEmacs (latest CVS) to support hard
Hattuari> indentation when editing bash scripts?

Yes. Move the file sh-script.el in the sh-script package to
sh-script.el.old, copy the file sh-script.el for GNU Emacs into that
directory, run M-x byte-compile-file, fix any bugs you notice, and
send the output of "diff -u sh-script.el.old sh-script.el" to
XXXX@XXXXX.COM .

The version of sh-script.el currently packaged for XEmacs looks
ancient, and apparently doesn't support anything more intelligent than
"indent-to-match-previous-line", followed by "indent by N more
spaces", for N configurable.

--
Institute of Policy and Planning Sciences http://www.yqcomputer.com/
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.

 
 
 

XEmacs shell-script-mode vs. Emacs shell-script-mode[bash]

Post by Bruce Inga » Tue, 25 May 2004 20:39:33


There's both sh-mode, as well as shell-script-mode, and ksh-mode.
All of these are part of the sumo tarball, afaik.
Perhaps one of them works better?
 
 
 

XEmacs shell-script-mode vs. Emacs shell-script-mode[bash]

Post by Stephen J. » Wed, 26 May 2004 12:32:22

>>>>> "Bruce" == Bruce Ingalls < XXXX@XXXXX.COM > writes:



>> The version of sh-script.el currently packaged for XEmacs looks
>> ancient,

Bruce> There's both sh-mode, as well as shell-script-mode, and
Bruce> ksh-mode. All of these are part of the sumo tarball,
Bruce> afaik. Perhaps one of them works better?

Thanks for pointing those out! If somebody tries one and likes it
better than the default, please let us know at xemacs-beta (use M-x
report-xemacs-bug). We can change the default mode used for files
with .sh extension.

If you want to try them, just save your file (making absolutely sure
you don't break anything important), then do M-x ksh-mode RET (for
example). If the modes are properly written, there should be no side
effects on one mode just because you were in another previously.

--
Institute of Policy and Planning Sciences http://www.yqcomputer.com/
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.
 
 
 

XEmacs shell-script-mode vs. Emacs shell-script-mode[bash]

Post by Hattuar » Wed, 02 Jun 2004 23:19:13

tephen J. Turnbull wrote:


It looks to me that shell-script-mode is an alias for sh-mode. I tried M-x
find-function shell-script-mode and that's what what Charlotte told me.

I also tried to use the Emacs sh-script.el. That resulted in an error listed
below. I checked Emacs (recent cvs) and it uses a compiled function
written in c. The file is syntax.c. I tried the naive approach of copy,
paste, and compile. That, as expected, resulted in errors. In particular
it said: syntax.c:2459:19: macro "DEFUN" passed 7 arguments, but takes just
6

It's gettin' a bit deep for me right now. If I find a bit of time in the
near future, I'll try to revisit the situation.

Error follows:

(1) (file-mode-spec/warning) Error in File mode specification: Symbol's
function definition is void: string-to-syntax

Backtrace follows:

string-to-syntax(".")
byte-code("..." [sh-here-doc-syntax sh-st-symbol sh-st-punc
sh-here-doc-open-re current-load-list string-to-syntax "." "_" "|" "<<-
\\s-*\\\\?\\(\\(?:['\"][^'\"]+['\"]\\|\\sw\\|\\s_\\)+\\).*\\(\n\\)"
sh-here-doc-markers default-boundp set-default nil
make-variable-buffer-local sh-here-doc-re] 3)
# bind (current-load-list)
# (unwind-protect ...)
# bind (load-file-name)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
load-internal("sh-script" nil nil nil binary)
# bind (path handler filename nosuffix nomessage noerror file)
load("sh-script" nil nil nil)
# (unwind-protect ...)
sh-mode()
# bind (alist mode name keep-going)
# (unwind-protect ...)
# bind (just-from-file-name)
set-auto-mode()
#<compiled-function nil "...(5)" [set-auto-mode t] 1>()
# (unwind-protect ...)
call-with-condition-handler(#<compiled-function
(__call_trapping_errors_arg__) "...(17)" [__call_trapping_errors_arg__
errstr error-message-string lwarn file-mode-spec warning "Error in %s:
%s\n\nBacktrace follows:\n\n%s" "File mode specification"
backtrace-in-condition-handler-eliminating-handler] 8> #<compiled-function
nil "...(5)" [set-auto-mode t] 1>)
# (condition-case ... . ((error)))
# bind (find-file)
normal-mode(t)
# bind (nomodes after-find-file-from-revert-buffer noauto warn error)
after-find-file(t t)
# (unwind-protect ...)
# bind (inhibit-read-only error number truename rawfile nowarn filename
buf)
find-file-noselect-1(#<buffer ".bashrc">
"/home/hattons/opt/org/xemacs/.bashrc" nil nil
"/home/hattons/opt/org/xemacs/.bashrc" nil)
byte-code("..." [number truename rawfile nowarn filename buf
set-buffer-major-mode find-file-noselect-1] 7)
# (condition-case ... . ((t (byte-code "?! @ A\"? [buf data
kill-buffer signal] 3))))
# bind (number truename buf wildcards rawfile nowarn filename)
find-file-noselect("~/opt/org/xemacs/.bashrc" nil nil t)
# bind (wildcards codesys filename)
#<compiled-function (filename &optional codesys wildcards) "..
(53)" [coding-system-for-read wildcards filename codesys value
get-coding-system find-file-noselect nil mapcar switch-to-buffer] 6 1047335
(list (read-file-name "Find file: ") (and current-prefix-arg
(read-coding-system "Coding system: ")) t)>("~/opt/org/xemacs/.bashrc" nil
t)
call-interactively(find-file)
# (condition-case ... . error)
# (catch top-level ...)

--
p->m == (*p).m == p[0].m