comparison lisp/progmodes/sh-script.el @ 9484:255efa3fb8d0

* sh-script.el: (sh-set-shell): Set font-lock-defaults.
author Simon Marshall <simon@gnu.org>
date Wed, 12 Oct 1994 09:15:14 +0000
parents 2cccfdee4f95
children 07dd35326963
comparison
equal deleted inserted replaced
9483:a8f745eaee5c 9484:255efa3fb8d0
390 (make-local-variable 'sh-shell-path) 390 (make-local-variable 'sh-shell-path)
391 (make-local-variable 'sh-shell) 391 (make-local-variable 'sh-shell)
392 (make-local-variable 'sh-shell-is-csh) 392 (make-local-variable 'sh-shell-is-csh)
393 (make-local-variable 'pair-alist) 393 (make-local-variable 'pair-alist)
394 (make-local-variable 'pair-filter) 394 (make-local-variable 'pair-filter)
395 (make-local-variable 'font-lock-keywords) 395 (make-local-variable 'font-lock-defaults)
396 (make-local-variable 'font-lock-keywords-case-fold-search)
397 (make-local-variable 'sh-variables) 396 (make-local-variable 'sh-variables)
398 (setq major-mode 'sh-mode 397 (setq major-mode 'sh-mode
399 mode-name "Shell-script" 398 mode-name "Shell-script"
400 ;; Why can't Emacs have one standard function with some parameters? 399 ;; Why can't Emacs have one standard function with some parameters?
401 ;; Only few modes actually analyse the previous line's contents 400 ;; Only few modes actually analyse the previous line's contents
403 comment-start "# " 402 comment-start "# "
404 after-save-hook 'sh-chmod 403 after-save-hook 'sh-chmod
405 tab-width sh-tab-width 404 tab-width sh-tab-width
406 ;; C shells do 405 ;; C shells do
407 require-final-newline t 406 require-final-newline t
408 font-lock-keywords-case-fold-search nil
409 pair-alist '((?` _ ?`)) 407 pair-alist '((?` _ ?`))
410 pair-filter 'sh-quoted-p) 408 pair-filter 'sh-quoted-p)
411 ;; parse or insert magic number for exec 409 ;; parse or insert magic number for exec
412 (save-excursion 410 (save-excursion
413 (goto-char (point-min)) 411 (goto-char (point-min))
826 shell 824 shell
827 (or (sh-executable shell) 825 (or (sh-executable shell)
828 (error "Cannot find %s." shell))) 826 (error "Cannot find %s." shell)))
829 sh-shell (intern (file-name-nondirectory sh-shell-path)) 827 sh-shell (intern (file-name-nondirectory sh-shell-path))
830 sh-shell-is-csh (memq sh-shell '(csh tcsh)) 828 sh-shell-is-csh (memq sh-shell '(csh tcsh))
831 font-lock-keywords 829 font-lock-defaults
832 (intern-soft (format "sh-%s-font-lock-keywords" sh-shell)) 830 (list (intern-soft (format "sh-%s-font-lock-keywords" sh-shell)))
833 font-lock-keywords (if (and font-lock-keywords 831 font-lock-keywords (if (and font-lock-keywords
834 (boundp font-lock-keywords)) 832 (boundp font-lock-keywords))
835 (symbol-value font-lock-keywords) 833 (symbol-value font-lock-keywords)
836 sh-font-lock-keywords) 834 sh-font-lock-keywords)
837 comment-start-skip (if sh-shell-is-csh 835 comment-start-skip (if sh-shell-is-csh