Mercurial > hg > xemacs-beta
diff lisp/modes/sh-script.el @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | 56c54cf7c5b6 |
children | 0d2f883870bc |
line wrap: on
line diff
--- a/lisp/modes/sh-script.el Mon Aug 13 09:00:04 2007 +0200 +++ b/lisp/modes/sh-script.el Mon Aug 13 09:02:59 2007 +0200 @@ -49,55 +49,6 @@ (require 'executable) -;;; interpreter-mode-alist is not compatible between Emacs and XEmacs. -;;; So fake it. - -(defvar sh-interpreter-mode-alist - '(("perl" . perl-mode) - ("perl5" . perl-mode) - ("wish" . tcl-mode) - ("wishx" . tcl-mode) - ("tcl" . tcl-mode) - ("tclsh" . tcl-mode) - ("awk" . awk-mode) - ("mawk" . awk-mode) - ("nawk" . awk-mode) - ("gawk" . awk-mode) - ("scm" . scheme-mode) - ("ash" . sh-mode) - ("bash" . sh-mode) - ("csh" . sh-mode) - ("dtksh" . sh-mode) - ("es" . sh-mode) - ("itcsh" . sh-mode) - ("jsh" . sh-mode) - ("ksh" . sh-mode) - ("oash" . sh-mode) - ("pdksh" . sh-mode) - ("rc" . sh-mode) - ("sh" . sh-mode) - ("sh5" . sh-mode) - ("tcsh" . sh-mode) - ("wksh" . sh-mode) - ("wsh" . sh-mode) - ("zsh" . sh-mode) - ("tail" . text-mode) - ("more" . text-mode) - ("less" . text-mode) - ("pg" . text-mode)) - "Alist mapping interpreter names to major modes. -This alist applies to files whose first line starts with `#!'. -Each element looks like (INTERPRETER . MODE). -The car of each element is compared with -the name of the interpreter specified in the first line. -If it matches, mode MODE is selected.") - -(defvar sh-mode-hook nil - "*Hook run by `sh-mode'.") - -(defvar sh-set-shell-hook nil - "*Hook run by `sh-set-shell'.") - (defvar sh-ancestor-alist '((ash . sh) (bash . jsh) @@ -382,8 +333,8 @@ "Word to delimit here documents.") (defvar sh-test - '((sh "[ ]" . 2) - (ksh88 "[[ ]]" . 3)) + '((sh "[ ]" . 3) + (ksh88 "[[ ]]" . 4)) "Initial input in Bourne if, while and until skeletons. See `sh-feature'.") @@ -721,15 +672,6 @@ ;;;###autoload (defalias 'shell-script-mode 'sh-mode) -;;; XEmacs -(put 'sh-mode 'font-lock-defaults - `((sh-font-lock-keywords - sh-font-lock-keywords-1 - sh-font-lock-keywords-2) - ,sh-font-lock-keywords-only - nil - ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")))) - (defun sh-font-lock-keywords (&optional keywords) "Function to get simple fontification based on `sh-font-lock-keywords'. @@ -777,8 +719,7 @@ Makes this script executable via `executable-set-magic'. Calls the value of `sh-set-shell-hook' if set." (interactive (list (completing-read "Name or path of shell: " - ;; XEmacs change - sh-interpreter-mode-alist + interpreter-mode-alist (lambda (x) (eq (cdr x) 'sh-mode))) (eq executable-query 'function) t)) @@ -788,10 +729,8 @@ (setq sh-shell-file (executable-set-magic shell (sh-feature sh-shell-arg))) (setq require-final-newline (sh-feature sh-require-final-newline) ;;; local-abbrev-table (sh-feature sh-abbrevs) - font-lock-defaults-computed nil - ;; Next two lines kill XEmacs - ;font-lock-keywords nil ; force resetting - ;font-lock-syntax-table nil + font-lock-keywords nil ; force resetting + font-lock-syntax-table nil comment-start-skip (concat (sh-feature sh-comment-prefix) "#+[\t ]*") mode-line-process (format "[%s]" sh-shell) sh-shell-variables nil @@ -803,9 +742,7 @@ (setq shell (cdr shell))) (and (boundp 'font-lock-mode) font-lock-mode - ;; Gnu Emacs, doesn't work (font-lock-mode (font-lock-mode 0))) - ;; (font-lock-fontify-buffer)) (run-hooks 'sh-set-shell-hook)) @@ -926,7 +863,6 @@ (interactive) (let ((previous (save-excursion (while (and (not (bobp)) - (not (eq (point-min) (point-at-bol))) (progn (forward-line -1) (back-to-indentation)