f



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

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
0
Hattuari
5/24/2004 7:40:23 AM
comp.emacs.xemacs 2750 articles. 0 followers. Post Follow

4 Replies
1681 Views

Similar Articles

[PageSpeed] 26

>>>>> "Hattuari" == Hattuari  <susudata@setidava.kushan.aa> 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
xemacs-patches@xemacs.org.

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://turnbull.sk.tsukuba.ac.jp
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.
0
Stephen
5/24/2004 9:13:52 AM
Stephen J. Turnbull wrote:

> The version of sh-script.el currently packaged for XEmacs looks
> ancient, 
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?
0
Bruce
5/24/2004 11:39:33 AM
>>>>> "Bruce" == Bruce Ingalls <ingallsb@verizon._NO.SPAM_.net> writes:

    Bruce> Stephen J. Turnbull wrote:

    >> 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://turnbull.sk.tsukuba.ac.jp
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.
0
Stephen
5/25/2004 3:32:22 AM
Stephen J. Turnbull wrote:

>>>>>> "Bruce" == Bruce Ingalls <ingallsb@verizon._NO.SPAM_.net> writes:
> 
>     Bruce> Stephen J. Turnbull wrote:
> 
>     >> 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.

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
0
Hattuari
6/1/2004 2:19:13 PM
Reply:

Similar Artilces:

Convert Bash shell script to Korn shell script
The following bash script works fine to delete all files that are older than $1 minutes. To execute this script, bash cleanup +10 find /mypath -type f -cmin $1 -exec rm -f {} \; Unfortunately, now I just realize I need to make it work in Korn Shell. Even I change the header from #!/bin/bash to #!/usr/bin/ksh, and execute the script by ksh cleanup +10, it still have different errors: cleanup[9]: -cmin: not found. cleanup[10]: -type: not found. Looks like it doesn't work anymore. I think I need to re-write the Korn Shell script that do the task. I tried to search for equivalent Korn ...

Convert Bash shell script to Korn shell script
The following bash script works fine to delete all files that are older than $1 minutes. To execute this script, bash cleanup +10 find /mypath -type f -cmin $1 -exec rm -f {} \; Unfortunately, now I just realize I need to make it work in Korn Shell. Even I change the header from #!/bin/bash to #!/usr/bin/ksh, and execute the script by ksh cleanup +10, it still have different errors: cleanup[9]: -cmin: not found. cleanup[10]: -type: not found. Looks like it doesn't work anymore. I think I need to re-write the Korn Shell script that do the task. I tried to search for equivalent Korn ...

scripting XEmacs, batch mode, remote control xemacs?
Hi, is it possible to write a script for xemacs to do some things in an automated way _without_ _user_ _interaction_? Specifically, i'd like to tell xemacs to load a certain file, call M-x htmlize-buffer and then save the new buffer. Is that possible? In one posting i found a reference to the option "-script", but haven't found any other references. Best regards, Torsten. Torsten Mohr <tmohr@s.netic.de> writes: > is it possible to write a script for xemacs to do some things > in an automated way _without_ _user_ _interaction_? xemacs ...

execute a shell script in a shell script
Please help. I have been stumbled on this issue, please see below. I am unable to execute a shell script in a shell script. I need to use perl script but not others and have tried eval, -exec and other on perl script but failed. system"cleartool setview -exec \"cleartool describe -fmt 'On %Sd modified %En and comment:\n %c\n\n' /myproject/vob/myprogram.C\" my_lag "; tks. On Dec 3, 8:30 am, moongeegee <moongee...@gmail.com> wrote: > Please help. > I have been stumbled on this issue, please see below. I am unable to > execute a shell script in a shel...

setting buffer mode to shell-script[bash]
Ciao, how do I enable "shell-script[bash]" mode using buffer local variables? I can do: ### end of file # Local Variables: # mode: sh # End: to enable "shell-script[sh]", but the Bash variant? I do *not* want to put "#!/bin/bash" at the top of the file. TIA -- Marco Maggi Hello Marco, > how do I enable "shell-script[bash]" mode using buffer local > variables? the following seems to work: # Local Variables: # mode: sh # eval: (sh-set-shell "bash") # End: Regards, Michael. ...

Bash `smart' completion in Emacs shell mode
Hi, As you know Bash readline implementation allows `smart' program specific completion for things like program options or allowed arguments. Since Emacs shell mode uses non-interactive Bash shell the readline functionality is suppressed, and replaced with more less equivalent comint interface. That is, more or less... I wish to have all this features in Shell comint interface. So the question is: anybody knows any project that includes this functionality? I am tempted to start a project like this, maybe generate completion stuff from shell scripts and maybe C files (and convert this t...

C-shell Script to Bash Script?
Dear Everyone: I used to use the following three lines of C-shell script foreach file (`ls -1 name.list.txt`) a.out $file end to do a loop. The 1st line lists the content in the file named "name.list.txt", and in the 2nd line, an excutable file, a.out, takes each listed item as an argument, and the 3rd line ends the loop. How would you convert the above three lines to BAsh (Bourne Again shell) script to be used on a Mac? Thank you for reading and replying! --Roland On 2007-08-01, qquito wrote: > Dear Everyone: > > I used to use the following th...

pg_dumpall shell script in bash shell
I am pretty much stumped atm and am hoping someone can shed some light for me. I am attempting to write a set of automated BASH Shell Scripts that tie in with PostgreSQL and PHP to manage our backups. There are a few teething troubles the main one is that when psql calls out the names of the databases to feed them into a shell script array it feeds them in as one value EG: dbname1 dbname2 dbname3 etc and they are all stored within the array value $dbname[0] when I want dbname1 stored in $dbname[0] and dbname2 stored in $dbname[1] etc In the original version I just defined all the databases ...

Problem of shell mode in emacs
Hi all, It is really convenient to use "shell mode" in emacs. But i have a problem, the characters in "shell mode" display strange. Following is what i get in emacs shell mode when using "ls" command: ------------------------------ bash-2.05b$ ls ^[[0m^[[01;34mhello^[[0m ------------------------------ In actual system shell, it is ------------------------------ bash-2.05b$ ls hello ------------------------------ I use default setting for emacs, so what is wrong? How should make the setting to solve the problem? Thank you for any suggestion. >>>&...

Writing Shell script to interactively control another shell script??
Using Solaris, Say you want to write a shell script to control another simple menu entry shell script like the following testscript.sh file /////////////////////// themenu() { echo "MENU" echo "1 - Check Status and other stuff " echo "2 - Run program" echo "3 - Exit" echo "" } while true do themenu read input case $input 1) //check status and do some other stuff ;; 2) //start program and other background processes;; 3) break;; //exit loop and program *) ;; done ////////////////////////////////////////////////////////////////// What I wan...

handling SIGINT in shell scripts when executing another shell script.
I have a simple shell script foo1.sh that invokes another shell script foo2.sh, something like below: #!/bin/sh SIGINT_handler() { echo "## [$DATE_TIME] User interrupt ignored," continue } trap SIGINT_handler 2 .... ../foo2.sh .... ---------- while executing foo1.sh, if the script receives SIGINT, how do I ignore the SIGINT in foo2.sh ? somehow foo2.sh does not finish to completion and is killed after receiving SIGINT. but foo1.sh is still executing. Is there any way to trap this signal in the child script. ? Please share your thots and inputs on this topic. Regards, Vikram S...

interactive mode vs. non-interactive mode of a shell
I have some questions. 1) Are there really 2 modes (interactive vs. non) for shells (e.g. / bin/sh). Or is the interactive one just with echo on? 2) If a shell script runs in a noninteractive shell, how we can start interactive programs with it (e.g. last line of script has name of program to start)? Does the shell then start another interactive shell? >>>>> G Patel <gaya.patel@gmail.com> writes: > I have some questions. > 1) Are there really 2 modes (interactive vs. non) for shells (e.g. / > bin/sh). Yes, there are. > Or is the interactive one jus...

Emacs: perl-mode vs cperl-mode comparison
some tips for perl coders. =E3=80=88Emacs: perl-mode vs cperl-mode=E3=80=89 http://xahlee.org/emacs/emacs_perl_vs_cperl_mode.html here's a plain text excerpt only (visit the link for syntax coloring comparison) --------------------------------------------- Emacs: perl-mode vs cperl-mode Xah Lee, 2011-07-13 In emacs, there are 2 modes for perl: perl-mode and cperl-mode. Both are included in emacs 23. perl-mode is the simpler of the two. This page is a comparisonn of their syntax coloring features. By default, perl-mode is loaded when you open a p...

Terminate a python script from linux shell / bash script
Hello :-) I have a question about Python and Linux shell. I have a python program whi= ch is permanently resident in the end-user system. I'm currently producing = a RPM package=2C and it works nicely. The problem is that when I uninstall = it=2C my program keeps running in the background=2C even if the files are d= eleted. I know I can terminate python shell directly=2C but this is not a good idea= because the end-user may be working with another important python applicat= ion=2C and would be very angry if mine would close everything that is using= python shell. So=2C is there a way...

Web resources about - XEmacs shell-script-mode vs. Emacs shell-script-mode[bash] - comp.emacs.xemacs

Resources last updated: 2/1/2016 9:59:14 AM