diff options
| author | Chong Yidong | 2012-12-01 12:09:55 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-12-01 12:09:55 +0800 |
| commit | 92eadba57fe86a49d67a7e3d797e3180ca0f6ae7 (patch) | |
| tree | 0b6588412e5b894cd2ee09e08fda5e52201d5ba9 /lisp/progmodes/sh-script.el | |
| parent | 75b4f59c279cbab4ad6a056b39f876b9a7518267 (diff) | |
| download | emacs-92eadba57fe86a49d67a7e3d797e3180ca0f6ae7.tar.gz emacs-92eadba57fe86a49d67a7e3d797e3180ca0f6ae7.zip | |
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
Diffstat (limited to 'lisp/progmodes/sh-script.el')
| -rw-r--r-- | lisp/progmodes/sh-script.el | 87 |
1 files changed, 43 insertions, 44 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 5af14e51f49..243b712febb 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1497,42 +1497,41 @@ with your script for an edit-interpret-debug cycle." | |||
| 1497 | (make-local-variable 'sh-shell-file) | 1497 | (make-local-variable 'sh-shell-file) |
| 1498 | (make-local-variable 'sh-shell) | 1498 | (make-local-variable 'sh-shell) |
| 1499 | 1499 | ||
| 1500 | (set (make-local-variable 'skeleton-pair-default-alist) | 1500 | (setq-local skeleton-pair-default-alist |
| 1501 | sh-skeleton-pair-default-alist) | 1501 | sh-skeleton-pair-default-alist) |
| 1502 | (set (make-local-variable 'skeleton-end-hook) | 1502 | (setq-local skeleton-end-hook |
| 1503 | (lambda () (or (eolp) (newline) (indent-relative)))) | 1503 | (lambda () (or (eolp) (newline) (indent-relative)))) |
| 1504 | 1504 | ||
| 1505 | (set (make-local-variable 'paragraph-start) (concat page-delimiter "\\|$")) | 1505 | (setq-local paragraph-start (concat page-delimiter "\\|$")) |
| 1506 | (set (make-local-variable 'paragraph-separate) paragraph-start) | 1506 | (setq-local paragraph-separate paragraph-start) |
| 1507 | (set (make-local-variable 'comment-start) "# ") | 1507 | (setq-local comment-start "# ") |
| 1508 | (set (make-local-variable 'comment-start-skip) "#+[\t ]*") | 1508 | (setq-local comment-start-skip "#+[\t ]*") |
| 1509 | (set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table) | 1509 | (setq-local local-abbrev-table sh-mode-abbrev-table) |
| 1510 | (set (make-local-variable 'comint-dynamic-complete-functions) | 1510 | (setq-local comint-dynamic-complete-functions |
| 1511 | sh-dynamic-complete-functions) | 1511 | sh-dynamic-complete-functions) |
| 1512 | (add-hook 'completion-at-point-functions 'comint-completion-at-point nil t) | 1512 | (add-hook 'completion-at-point-functions 'comint-completion-at-point nil t) |
| 1513 | ;; we can't look if previous line ended with `\' | 1513 | ;; we can't look if previous line ended with `\' |
| 1514 | (set (make-local-variable 'comint-prompt-regexp) "^[ \t]*") | 1514 | (setq-local comint-prompt-regexp "^[ \t]*") |
| 1515 | (set (make-local-variable 'imenu-case-fold-search) nil) | 1515 | (setq-local imenu-case-fold-search nil) |
| 1516 | (set (make-local-variable 'font-lock-defaults) | 1516 | (setq font-lock-defaults |
| 1517 | `((sh-font-lock-keywords | 1517 | `((sh-font-lock-keywords |
| 1518 | sh-font-lock-keywords-1 sh-font-lock-keywords-2) | 1518 | sh-font-lock-keywords-1 sh-font-lock-keywords-2) |
| 1519 | nil nil | 1519 | nil nil |
| 1520 | ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil | 1520 | ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil |
| 1521 | (font-lock-syntactic-face-function | 1521 | (font-lock-syntactic-face-function |
| 1522 | . sh-font-lock-syntactic-face-function))) | 1522 | . sh-font-lock-syntactic-face-function))) |
| 1523 | (set (make-local-variable 'syntax-propertize-function) | 1523 | (setq-local syntax-propertize-function #'sh-syntax-propertize-function) |
| 1524 | #'sh-syntax-propertize-function) | ||
| 1525 | (add-hook 'syntax-propertize-extend-region-functions | 1524 | (add-hook 'syntax-propertize-extend-region-functions |
| 1526 | #'syntax-propertize-multiline 'append 'local) | 1525 | #'syntax-propertize-multiline 'append 'local) |
| 1527 | (sh-electric-here-document-mode 1) | 1526 | (sh-electric-here-document-mode 1) |
| 1528 | (set (make-local-variable 'skeleton-pair-alist) '((?` _ ?`))) | 1527 | (setq-local skeleton-pair-alist '((?` _ ?`))) |
| 1529 | (set (make-local-variable 'skeleton-pair-filter-function) 'sh-quoted-p) | 1528 | (setq-local skeleton-pair-filter-function 'sh-quoted-p) |
| 1530 | (set (make-local-variable 'skeleton-further-elements) | 1529 | (setq-local skeleton-further-elements |
| 1531 | '((< '(- (min sh-indentation (current-column)))))) | 1530 | '((< '(- (min sh-indentation (current-column)))))) |
| 1532 | (set (make-local-variable 'skeleton-filter-function) 'sh-feature) | 1531 | (setq-local skeleton-filter-function 'sh-feature) |
| 1533 | (set (make-local-variable 'skeleton-newline-indent-rigidly) t) | 1532 | (setq-local skeleton-newline-indent-rigidly t) |
| 1534 | (set (make-local-variable 'defun-prompt-regexp) | 1533 | (setq-local defun-prompt-regexp |
| 1535 | (concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)")) | 1534 | (concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)")) |
| 1536 | ;; Parse or insert magic number for exec, and set all variables depending | 1535 | ;; Parse or insert magic number for exec, and set all variables depending |
| 1537 | ;; on the shell thus determined. | 1536 | ;; on the shell thus determined. |
| 1538 | (sh-set-shell | 1537 | (sh-set-shell |
| @@ -2104,19 +2103,19 @@ Calls the value of `sh-set-shell-hook' if set." | |||
| 2104 | (executable-set-magic shell (sh-feature sh-shell-arg) | 2103 | (executable-set-magic shell (sh-feature sh-shell-arg) |
| 2105 | no-query-flag insert-flag))) | 2104 | no-query-flag insert-flag))) |
| 2106 | (setq mode-line-process (format "[%s]" sh-shell)) | 2105 | (setq mode-line-process (format "[%s]" sh-shell)) |
| 2107 | (set (make-local-variable 'sh-shell-variables) nil) | 2106 | (setq-local sh-shell-variables nil) |
| 2108 | (set (make-local-variable 'sh-shell-variables-initialized) nil) | 2107 | (setq-local sh-shell-variables-initialized nil) |
| 2109 | (set (make-local-variable 'imenu-generic-expression) | 2108 | (setq-local imenu-generic-expression |
| 2110 | (sh-feature sh-imenu-generic-expression)) | 2109 | (sh-feature sh-imenu-generic-expression)) |
| 2111 | (let ((tem (sh-feature sh-mode-syntax-table-input))) | 2110 | (let ((tem (sh-feature sh-mode-syntax-table-input))) |
| 2112 | (when tem | 2111 | (when tem |
| 2113 | (set (make-local-variable 'sh-mode-syntax-table) | 2112 | (setq-local sh-mode-syntax-table |
| 2114 | (apply 'sh-mode-syntax-table tem)) | 2113 | (apply 'sh-mode-syntax-table tem)) |
| 2115 | (set-syntax-table sh-mode-syntax-table))) | 2114 | (set-syntax-table sh-mode-syntax-table))) |
| 2116 | (dolist (var (sh-feature sh-variables)) | 2115 | (dolist (var (sh-feature sh-variables)) |
| 2117 | (sh-remember-variable var)) | 2116 | (sh-remember-variable var)) |
| 2118 | (if (set (make-local-variable 'sh-indent-supported-here) | 2117 | (if (setq-local sh-indent-supported-here |
| 2119 | (sh-feature sh-indent-supported)) | 2118 | (sh-feature sh-indent-supported)) |
| 2120 | (progn | 2119 | (progn |
| 2121 | (message "Setting up indent for shell type %s" sh-shell) | 2120 | (message "Setting up indent for shell type %s" sh-shell) |
| 2122 | (if sh-use-smie | 2121 | (if sh-use-smie |
| @@ -2127,16 +2126,16 @@ Calls the value of `sh-set-shell-hook' if set." | |||
| 2127 | (funcall mksym "rules") | 2126 | (funcall mksym "rules") |
| 2128 | :forward-token (funcall mksym "forward-token") | 2127 | :forward-token (funcall mksym "forward-token") |
| 2129 | :backward-token (funcall mksym "backward-token"))) | 2128 | :backward-token (funcall mksym "backward-token"))) |
| 2130 | (set (make-local-variable 'parse-sexp-lookup-properties) t) | 2129 | (setq-local parse-sexp-lookup-properties t) |
| 2131 | (set (make-local-variable 'sh-kw-alist) (sh-feature sh-kw)) | 2130 | (setq-local sh-kw-alist (sh-feature sh-kw)) |
| 2132 | (let ((regexp (sh-feature sh-kws-for-done))) | 2131 | (let ((regexp (sh-feature sh-kws-for-done))) |
| 2133 | (if regexp | 2132 | (if regexp |
| 2134 | (set (make-local-variable 'sh-regexp-for-done) | 2133 | (setq-local sh-regexp-for-done |
| 2135 | (sh-mkword-regexpr (regexp-opt regexp t))))) | 2134 | (sh-mkword-regexpr (regexp-opt regexp t))))) |
| 2136 | (message "setting up indent stuff") | 2135 | (message "setting up indent stuff") |
| 2137 | ;; sh-mode has already made indent-line-function local | 2136 | ;; sh-mode has already made indent-line-function local |
| 2138 | ;; but do it in case this is called before that. | 2137 | ;; but do it in case this is called before that. |
| 2139 | (set (make-local-variable 'indent-line-function) 'sh-indent-line)) | 2138 | (setq-local indent-line-function 'sh-indent-line)) |
| 2140 | (if sh-make-vars-local | 2139 | (if sh-make-vars-local |
| 2141 | (sh-make-vars-local)) | 2140 | (sh-make-vars-local)) |
| 2142 | (message "Indentation setup for shell type %s" sh-shell)) | 2141 | (message "Indentation setup for shell type %s" sh-shell)) |