Commit graph

280 commits

Author SHA1 Message Date
Gerd Moellmann
f2d20357bb (sh-mode): If there is no #!-line, use the shell
from sh-shell-file.
1999-12-16 13:21:37 +00:00
Gerd Moellmann
b062282286 Fix for when font-lock mode is active.
(sh-font-lock-unfontify-region-function): New function.
1999-12-12 13:18:54 +00:00
Gerd Moellmann
f964dfcb0d Added support for indenting existing scripts.
(sh-mode-map): Added new bindings.
(sh-mode): Updated mode doc-string for new commands, added
make-local-variable calls, initialize mode-specific variables.
(sh-indent-line):  Renamed to sh-basic-indent-line;  sh-indent-line
is now a different function.
(sh-header-marker):  Changed docstring.
(sh-set-shell): Initialize mode-specific variables.
(sh-case, sh-for, sh-if, sh-indexed-loop, sh-repeat, sh-select)
(sh-tmp-file, sh-until, sh-until, sh-while, sh-while-getopts):
Changed these define-skeleton calls to work with user-specified
indentation settings.
(sh-basic-indent-line, sh-blink, sh-calculate-indent)
(sh-check-paren-in-case, sh-check-rule, sh-do-nothing)
(sh-electric-hash, sh-electric-less, sh-electric-rparen)
(sh-find-prev-matching, sh-find-prev-switch, sh-get-indent-info)
(sh-get-indent-var-for-line, sh-get-kw, sh-get-word)
(sh-goto-match-for-done, sh-goto-matching-case, sh-goto-matching-if)
(sh-guess-basic-offset, sh-handle-after-case-label)
(sh-handle-prev-case, sh-handle-prev-case-alt-end, sh-handle-prev-do)
(sh-handle-prev-done, sh-handle-prev-else, sh-handle-prev-esac)
(sh-handle-prev-fi, sh-handle-prev-if, sh-handle-prev-open)
(sh-handle-prev-rc-case, sh-handle-prev-then, sh-handle-this-close)
(sh-handle-this-do, sh-handle-this-done, sh-handle-this-else)
(sh-handle-this-esac, sh-handle-this-fi, sh-handle-this-rc-case)
(sh-handle-this-then, sh-help-string-for-variable)
(sh-in-comment-or-string, sh-indent-line, sh-learn-buffer-indent)
(sh-learn-line-indent, sh-load-style, sh-make-vars-local, sh-mark-init)
(sh-mark-line, sh-mkword-regexpr, sh-mkword-regexp)
(sh-must-be-shell-mode, sh-must-support-indent, sh-name-style)
(sh-prev-line, sh-prev-stmt, sh-prev-thing, sh-read-variable)
(sh-remove-our-text-properties, sh-rescan-buffer)
(sh-reset-indent-vars-to-global-values, sh-safe-backward-sexp)
(sh-safe-forward-sexp, sh-save-styles-to-buffer, sh-scan-buffer)
(sh-scan-case, sh-search-word, sh-set-char-syntax)
(sh-set-here-doc-region, sh-set-indent, sh-set-var-value)
(sh-show-indent, sh-this-is-a-continuation, sh-var-value): New
functions.
(sh-debug, sh-electric-rparen-needed, sh-here-doc-syntax)
(sh-indent-supported, sh-kw, sh-kw-alist, sh-kws-for-done)
(sh-learned-buffer-hook, sh-make-vars-local, sh-regexp-for-done)
(sh-special-keywords, sh-special-syntax, sh-st-punc, sh-styles-alist)
(sh-var-list): New variables.
1999-10-12 12:30:38 +00:00
Eli Zaretskii
751d474c0a (sh-tmp-file): Use $TMPDIR, if defined, for sh. 1999-09-06 09:05:24 +00:00
Richard M. Stallman
1c64011b78 (sh-feature): If nothing is known about the given shell, use the
values for `sh'.
1999-07-01 01:00:42 +00:00
Karl Heuer
9a1136f4de (sh-mode): When setting syntax
table, default to the standard one.
1999-06-29 17:06:17 +00:00
Karl Heuer
1448f5894e (sh-mode): Do not fail if buffer has no
magic number and is not associated with a file.
1999-05-15 05:57:39 +00:00
Karl Heuer
3e9103768f Update comment. 1998-12-14 03:22:44 +00:00
Andreas Schwab
842cc0e685 (sh-canonicalize-shell): Fix regexp.
(sh-set-shell): Likewise.
1998-10-30 11:02:42 +00:00
Richard M. Stallman
b946fbad39 (sh-font-lock-keywords): Don't crash for an unrecognized shell. 1998-10-21 03:47:41 +00:00
Richard M. Stallman
547745f5b3 (sh-mode): Handle .spec and .mspec files.
(sh-font-lock-keywords): Handle rpm and rpm2.
(sh-ancestor-alist): Handle rpm.
1998-10-20 18:50:13 +00:00
Richard M. Stallman
c8b88e9f92 (sh-set-shell): Remove .exe suffix from shell name.
Don't reuse local var `shell' for two different things.
(sh-canonicalize-shell): Remove .exe suffix from shell name.
1998-09-28 13:31:53 +00:00
Richard M. Stallman
a8fa6fc274 (sh-mode): parse-sexp-ignore-comments = t. 1998-07-19 21:58:03 +00:00
Richard M. Stallman
ced7b4a427 (sh-shell-file): Add cmdproxy to MS shells. 1998-05-07 19:18:29 +00:00
Eli Zaretskii
eee86eff46 (sh-shell-file): If $SHELL evaluates to
one of MS-DOS or MS-Windows shells, use "bin/sh" instead.
1998-05-03 15:57:33 +00:00
Dan Nicolaescu
cd32a7baa4 *** empty log message *** 1998-04-20 02:34:53 +00:00
Richard M. Stallman
4d7ce99c2f (sh-font-lock-keywords): Fontify sh-style function names in declarations. 1998-02-15 00:30:24 +00:00
Richard M. Stallman
0775c032ae (sh-set-shell): Use standard-syntax-table if none other is specified. 1998-02-11 07:14:24 +00:00
Richard M. Stallman
cef926f318 (sh-case): Fix paren error. 1998-01-26 02:33:48 +00:00
Dave Love
c0b08eb017 Use imenu-case-fold-search. 1997-12-12 17:10:08 +00:00
Simon Marshall
87002f70a3 Deal with `#'s in variable references. 1997-12-04 19:47:59 +00:00
Karl Heuer
aa2c242656 (sh-imenu-generic-expression): New variable.
(sh-mode): Make imenu-generic-expression local.
(sh-set-shell): Set imenu-generic-expression based on which shell.
1997-12-04 04:27:50 +00:00
Dave Love
59c14ec62d (sh-mode): Set `comment-start-skip' always. 1997-11-30 12:21:42 +00:00
Richard M. Stallman
af9944ea8b (sh-indent-line): Delete debugging code. 1997-08-27 17:39:44 +00:00
Richard M. Stallman
54c87e2714 (sh-indent-line): Avoid infinite loop
on indented line at start of buffer, when calculating PREVIOUS.
1997-08-23 05:19:09 +00:00
Richard M. Stallman
43c89a968e Whitespace change. 1997-06-22 18:47:05 +00:00
Simon Marshall
38c979d349 Update for syntax-table text properties.
sh-script.el now directs font-lock.el to add them to instances of # which are not comments.
1997-05-29 07:04:00 +00:00
Richard M. Stallman
c410bd65f5 (sh-case): Make this a simple define-skeleton
as it was originally.  Don't add a menu-enable property.
(sh-assignment-regexp): Renamed from sh-assignment-prefix
undoing a renaming made by mistake.
1997-04-22 04:37:22 +00:00
Richard M. Stallman
ea39159ea2 Remove all menu-enable properties except for sh-case. 1997-04-17 23:08:33 +00:00
Richard M. Stallman
c02f273d17 (sh-while-getopts): Don't add menu-enable property. 1997-04-15 18:16:28 +00:00
Richard M. Stallman
cd482e0573 Add defgroup's; change use defcustom for user vars. 1997-04-12 02:51:38 +00:00
Richard M. Stallman
2718efdd52 (sh-mode): Set font-lock-comment-start-regexp via font-lock-defaults.
(sh-set-shell): Don't set font-lock-keywords or font-lock-syntax-table,
and don't toggle Font Lock mode if it is already on.
1997-04-10 06:38:26 +00:00
Richard M. Stallman
22d5cb5048 (sh-set-shell): If file has no #! line,
set the syntax table based on the default shell.
1997-03-30 02:10:40 +00:00
Richard M. Stallman
ff9c168275 (sh-case): Define with defun and defvar
instead of define-skeleton.
1997-03-22 03:53:10 +00:00
Karl Heuer
2bffb7c4d4 (sh-mode-hook, sh-set-shell-hook): Add defvars. 1997-02-23 08:40:41 +00:00
Richard M. Stallman
5c4491697a (sh-shell-file): Downcase and remove extension on shells in NT. 1997-01-07 09:02:48 +00:00
Richard M. Stallman
d9de8c0454 (sh-shell-file): On MSDOS, collapse $SHELL to lower
case and remove the executable extension, if any.
(sh-other-keywords): Define an entry for `sh' and make `bourne'
inherit from that.

(sh-mode): Always pass nil as 3rd arg to sh-set-shell.
1997-01-02 02:51:05 +00:00
Richard M. Stallman
e3dce9ba22 (sh-set-shell): Pass args no-query-flag
and insert-flag to executable-set-magic.
Don't call executable-set-magic if insert-flag is nil.
(sh-mode): Always call sh-set-shell, but use insert-flag arg
to control whether to call executable-set-magic.
No need to set comment-start-skip directly here.

(sh-mode): Parse the interpreter from the file text.
1996-11-09 22:17:58 +00:00
Richard M. Stallman
c8005e7012 (sh-mode-syntax-table): Turn on comment syntax for #,
comment-end for newline, string for `, and excape for $.
rc can use the same as sh.  Move csh after sh.
(sh-comment-prefix, sh-font-lock-keyw-rds-only): Variables deleted.
(sh-mode): Adjust setting of font-lock-defaults.
(sh-font-lock-keywords): No need for anything special for comments.
(sh-set-shell, sh-mode): Set comment-start-skip to a simple constant.
1996-11-07 06:21:19 +00:00
Richard M. Stallman
a14bf24d3a (sh-mode): Set `comment-start-skip'; otherwise
only set if `sh-set-shell' gets called.
1996-11-07 05:59:43 +00:00
Simon Marshall
f802bd0253 Use new face. 1996-10-28 10:08:07 +00:00
Richard M. Stallman
44d7776b5b (sh-mode): Don't make font-lock-keywords buffer-local. 1996-10-26 16:06:24 +00:00
Richard M. Stallman
6dd4407cdc (sh-alias-alist): Use gnu/linux, not lignux. 1996-08-28 20:09:51 +00:00
Karl Heuer
c14c7a0511 (sh-mode): Call sh-set-shell only for a writable
empty buffer.
1996-07-15 20:17:53 +00:00
Richard M. Stallman
c898fb2821 (sh-while-getopts): Punctuate help message better. 1996-04-15 21:17:59 +00:00
Richard M. Stallman
a124b2795d (sh-alias-alist): Recognize lignux. 1996-03-27 02:39:09 +00:00
Richard M. Stallman
8d31ff153a (sh-shell-arg): Add no options for bash, ksh, or wksh. 1996-03-27 00:09:54 +00:00
Richard M. Stallman
8e46e26749 (sh-shell-arg): Don't add any options for bash, ksh. 1996-03-25 01:42:05 +00:00
Richard M. Stallman
b48a16d28d (sh-font-lock-keywords): Highlight \ only with non-alphanumeric char. 1996-03-20 16:18:23 +00:00
Richard M. Stallman
5d73ac6685 (sh-shell-variables-initialized): New variable.
(sh-mode): Make sh-shell-variables and
sh-shell-variables-initialized local.
(sh-set-shell): Don't scan the buffer for variable assignments.
Set sh-shell-variables-initialized to nil.
(sh-shell-initialize-variables): New function.
(sh-add-completer): New function.  Initialize sh-shell-variables
here if not yet done.
(sh-add): Use sh-add-completer for completion.
1996-01-29 23:11:40 +00:00