Commit 92eadba5 authored by Chong Yidong's avatar Chong Yidong
Browse files

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.
parent 75b4f59c
2012-12-01 Chong Yidong <cyd@gnu.org>
* 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.
2012-12-01 Kirk Kelsey <kirk.kelsey@0x4b.net>
 
* vc/vc-hg.el (vc-hg-next-revision):
......
......@@ -195,45 +195,33 @@ score-mode.el. KEYWORDS-CASE-INSENSITIVE non-nil means that for
font-lock keywords will not be case sensitive."
(when lisp-syntax
(set-syntax-table lisp-mode-syntax-table))
(make-local-variable 'paragraph-ignore-fill-prefix)
(setq paragraph-ignore-fill-prefix t)
(make-local-variable 'fill-paragraph-function)
(setq fill-paragraph-function 'lisp-fill-paragraph)
(setq-local paragraph-ignore-fill-prefix t)
(setq-local fill-paragraph-function 'lisp-fill-paragraph)
;; Adaptive fill mode gets the fill wrong for a one-line paragraph made of
;; a single docstring. Let's fix it here.
(set (make-local-variable 'adaptive-fill-function)
(lambda () (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") "")))
(setq-local adaptive-fill-function
(lambda () (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") "")))
;; Adaptive fill mode gets in the way of auto-fill,
;; and should make no difference for explicit fill
;; because lisp-fill-paragraph should do the job.
;; I believe that newcomment's auto-fill code properly deals with it -stef
;;(set (make-local-variable 'adaptive-fill-mode) nil)
(make-local-variable 'indent-line-function)
(setq indent-line-function 'lisp-indent-line)
(make-local-variable 'outline-regexp)
(setq outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(")
(make-local-variable 'outline-level)
(setq outline-level 'lisp-outline-level)
(make-local-variable 'comment-start)
(setq comment-start ";")
(make-local-variable 'comment-start-skip)
(setq-local indent-line-function 'lisp-indent-line)
(setq-local outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(")
(setq-local outline-level 'lisp-outline-level)
(setq-local comment-start ";")
;; Look within the line for a ; following an even number of backslashes
;; after either a non-backslash or the line beginning.
(setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
(make-local-variable 'font-lock-comment-start-skip)
(setq-local comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
;; Font lock mode uses this only when it KNOWS a comment is starting.
(setq font-lock-comment-start-skip ";+ *")
(make-local-variable 'comment-add)
(setq comment-add 1) ;default to `;;' in comment-region
(make-local-variable 'comment-column)
(setq comment-column 40)
(setq-local font-lock-comment-start-skip ";+ *")
(setq-local comment-add 1) ;default to `;;' in comment-region
(setq-local comment-column 40)
;; Don't get confused by `;' in doc strings when paragraph-filling.
(set (make-local-variable 'comment-use-global-state) t)
(make-local-variable 'imenu-generic-expression)
(setq imenu-generic-expression lisp-imenu-generic-expression)
(make-local-variable 'multibyte-syntax-as-symbol)
(setq multibyte-syntax-as-symbol t)
(set (make-local-variable 'syntax-begin-function) 'beginning-of-defun)
(setq-local comment-use-global-state t)
(setq-local imenu-generic-expression lisp-imenu-generic-expression)
(setq-local multibyte-syntax-as-symbol t)
(setq-local syntax-begin-function 'beginning-of-defun)
(setq font-lock-defaults
`((lisp-font-lock-keywords
lisp-font-lock-keywords-1 lisp-font-lock-keywords-2)
......@@ -519,10 +507,9 @@ or to switch back to an existing one.
Entry to this mode calls the value of `lisp-mode-hook'
if that value is non-nil."
(lisp-mode-variables nil t)
(set (make-local-variable 'find-tag-default-function) 'lisp-find-tag-default)
(make-local-variable 'comment-start-skip)
(setq comment-start-skip
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
(setq-local find-tag-default-function 'lisp-find-tag-default)
(setq-local comment-start-skip
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
(setq imenu-case-fold-search t))
(defun lisp-find-tag-default ()
......
......@@ -78,22 +78,19 @@ searching backwards at another AC_... command."
;;;###autoload
(define-derived-mode autoconf-mode prog-mode "Autoconf"
"Major mode for editing Autoconf configure.ac files."
(set (make-local-variable 'parens-require-spaces) nil) ; for M4 arg lists
(set (make-local-variable 'defun-prompt-regexp)
"^[ \t]*A[CM]_\\(\\sw\\|\\s_\\)+")
(set (make-local-variable 'comment-start) "dnl ")
(set (make-local-variable 'comment-start-skip)
"\\(?:\\(\\W\\|\\`\\)dnl\\|#\\) +")
(set (make-local-variable 'syntax-propertize-function)
(syntax-propertize-rules ("\\<dnl\\>" (0 "<"))))
(set (make-local-variable 'font-lock-defaults)
`(autoconf-font-lock-keywords nil nil (("_" . "w"))))
(set (make-local-variable 'imenu-generic-expression)
autoconf-imenu-generic-expression)
(set (make-local-variable 'imenu-syntax-alist) '(("_" . "w")))
(set (make-local-variable 'indent-line-function) #'indent-relative)
(set (make-local-variable 'add-log-current-defun-function)
#'autoconf-current-defun-function))
(setq-local parens-require-spaces nil) ; for M4 arg lists
(setq-local defun-prompt-regexp "^[ \t]*A[CM]_\\(\\sw\\|\\s_\\)+")
(setq-local comment-start "dnl ")
(setq-local comment-start-skip "\\(?:\\(\\W\\|\\`\\)dnl\\|#\\) +")
(setq-local syntax-propertize-function
(syntax-propertize-rules ("\\<dnl\\>" (0 "<"))))
(setq-local font-lock-defaults
`(autoconf-font-lock-keywords nil nil (("_" . "w"))))
(setq-local imenu-generic-expression autoconf-imenu-generic-expression)
(setq-local imenu-syntax-alist '(("_" . "w")))
(setq-local indent-line-function #'indent-relative)
(setq-local add-log-current-defun-function
#'autoconf-current-defun-function))
(provide 'autoconf-mode)
(provide 'autoconf)
......
......@@ -3306,29 +3306,21 @@ If one hasn't been set, or if it's stale, prompt for a new one."
(define-derived-mode js-mode prog-mode "Javascript"
"Major mode for editing JavaScript."
:group 'js
(setq-local indent-line-function 'js-indent-line)
(setq-local beginning-of-defun-function 'js-beginning-of-defun)
(setq-local end-of-defun-function 'js-end-of-defun)
(setq-local open-paren-in-column-0-is-defun-start nil)
(setq-local font-lock-defaults (list js--font-lock-keywords))
(setq-local syntax-propertize-function #'js-syntax-propertize)
(set (make-local-variable 'indent-line-function) 'js-indent-line)
(set (make-local-variable 'beginning-of-defun-function)
'js-beginning-of-defun)
(set (make-local-variable 'end-of-defun-function)
'js-end-of-defun)
(set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil)
(set (make-local-variable 'font-lock-defaults)
(list js--font-lock-keywords))
(set (make-local-variable 'syntax-propertize-function)
#'js-syntax-propertize)
(set (make-local-variable 'parse-sexp-ignore-comments) t)
(set (make-local-variable 'parse-sexp-lookup-properties) t)
(set (make-local-variable 'which-func-imenu-joiner-function)
#'js--which-func-joiner)
(setq-local parse-sexp-ignore-comments t)
(setq-local parse-sexp-lookup-properties t)
(setq-local which-func-imenu-joiner-function #'js--which-func-joiner)
;; Comments
(set (make-local-variable 'comment-start) "// ")
(set (make-local-variable 'comment-end) "")
(set (make-local-variable 'fill-paragraph-function)
'js-c-fill-paragraph)
(setq-local comment-start "// ")
(setq-local comment-end "")
(setq-local fill-paragraph-function 'js-c-fill-paragraph)
;; Parse cache
(add-hook 'before-change-functions #'js--flush-caches t t)
......@@ -3338,8 +3330,7 @@ If one hasn't been set, or if it's stale, prompt for a new one."
;; Imenu
(setq imenu-case-fold-search nil)
(set (make-local-variable 'imenu-create-index-function)
#'js--imenu-create-index)
(setq imenu-create-index-function #'js--imenu-create-index)
;; for filling, pretend we're cc-mode
(setq c-comment-prefix-regexp "//+\\|\\**"
......@@ -3350,10 +3341,10 @@ If one hasn't been set, or if it's stale, prompt for a new one."
c-comment-start-regexp "/[*/]\\|\\s!"
comment-start-skip "\\(//+\\|/\\*+\\)\\s *")
(set (make-local-variable 'electric-indent-chars)
(append "{}():;," electric-indent-chars)) ;FIXME: js2-mode adds "[]*".
(set (make-local-variable 'electric-layout-rules)
'((?\; . after) (?\{ . after) (?\} . before)))
(setq-local electric-indent-chars
(append "{}():;," electric-indent-chars)) ;FIXME: js2-mode adds "[]*".
(setq-local electric-layout-rules
'((?\; . after) (?\{ . after) (?\} . before)))
(let ((c-buffer-is-cc-mode t))
;; FIXME: These are normally set by `c-basic-common-init'. Should
......@@ -3365,8 +3356,7 @@ If one hasn't been set, or if it's stale, prompt for a new one."
(make-local-variable 'adaptive-fill-regexp)
(c-setup-paragraph-variables))
(set (make-local-variable 'syntax-begin-function)
#'js--syntax-begin-function)
(setq-local syntax-begin-function #'js--syntax-begin-function)
;; Important to fontify the whole buffer syntactically! If we don't,
;; then we might have regular expression literals that aren't marked
......
......@@ -879,41 +879,42 @@ Makefile mode can be configured by modifying the following variables:
(make-local-variable 'makefile-need-macro-pickup)
;; Font lock.
(set (make-local-variable 'font-lock-defaults)
;; SYNTAX-BEGIN set to backward-paragraph to avoid slow-down
;; near the end of a large buffer, due to parse-partial-sexp's
;; trying to parse all the way till the beginning of buffer.
'(makefile-font-lock-keywords
nil nil
((?$ . "."))
backward-paragraph))
(set (make-local-variable 'syntax-propertize-function)
makefile-syntax-propertize-function)
(setq-local font-lock-defaults
;; Set SYNTAX-BEGIN to backward-paragraph to avoid
;; slow-down near the end of a large buffer, due to
;; `parse-partial-sexp' trying to parse all the way till
;; the beginning of buffer.
'(makefile-font-lock-keywords
nil nil
((?$ . "."))
backward-paragraph))
(setq-local syntax-propertize-function
makefile-syntax-propertize-function)
;; Add-log.
(set (make-local-variable 'add-log-current-defun-function)
'makefile-add-log-defun)
(setq-local add-log-current-defun-function
'makefile-add-log-defun)
;; Imenu.
(set (make-local-variable 'imenu-generic-expression)
makefile-imenu-generic-expression)
(setq-local imenu-generic-expression
makefile-imenu-generic-expression)
;; Dabbrev.
(set (make-local-variable 'dabbrev-abbrev-skip-leading-regexp) "\\$")
(setq-local dabbrev-abbrev-skip-leading-regexp "\\$")
;; Other abbrevs.
(setq local-abbrev-table makefile-mode-abbrev-table)
;; Filling.
(set (make-local-variable 'fill-paragraph-function) 'makefile-fill-paragraph)
(setq-local fill-paragraph-function 'makefile-fill-paragraph)
;; Comment stuff.
(set (make-local-variable 'comment-start) "#")
(set (make-local-variable 'comment-end) "")
(set (make-local-variable 'comment-start-skip) "#+[ \t]*")
(setq-local comment-start "#")
(setq-local comment-end "")
(setq-local comment-start-skip "#+[ \t]*")
;; Make sure TAB really inserts \t.
(set (make-local-variable 'indent-line-function) 'indent-to-left-margin)
(setq-local indent-line-function 'indent-to-left-margin)
;; Real TABs are important in makefiles
(setq indent-tabs-mode t))
......@@ -934,8 +935,7 @@ Makefile mode can be configured by modifying the following variables:
;;;###autoload
(define-derived-mode makefile-makepp-mode makefile-mode "Makeppfile"
"An adapted `makefile-mode' that knows about makepp."
(set (make-local-variable 'makefile-rule-action-regex)
makefile-makepp-rule-action-regex)
(setq-local makefile-rule-action-regex makefile-makepp-rule-action-regex)
(setq font-lock-defaults
`(makefile-makepp-font-lock-keywords ,@(cdr font-lock-defaults))
imenu-generic-expression
......@@ -945,11 +945,9 @@ Makefile mode can be configured by modifying the following variables:
;;;###autoload
(define-derived-mode makefile-bsdmake-mode makefile-mode "BSDmakefile"
"An adapted `makefile-mode' that knows about BSD make."
(set (make-local-variable 'makefile-dependency-regex)
makefile-bsdmake-dependency-regex)
(set (make-local-variable 'makefile-dependency-skip) "^:!")
(set (make-local-variable 'makefile-rule-action-regex)
makefile-bsdmake-rule-action-regex)
(setq-local makefile-dependency-regex makefile-bsdmake-dependency-regex)
(setq-local makefile-dependency-skip "^:!")
(setq-local makefile-rule-action-regex makefile-bsdmake-rule-action-regex)
(setq font-lock-defaults
`(makefile-bsdmake-font-lock-keywords ,@(cdr font-lock-defaults))))
......@@ -957,7 +955,7 @@ Makefile mode can be configured by modifying the following variables:
(define-derived-mode makefile-imake-mode makefile-mode "Imakefile"
"An adapted `makefile-mode' that knows about imake."
:syntax-table makefile-imake-mode-syntax-table
(set (make-local-variable 'syntax-propertize-function) nil)
(setq-local syntax-propertize-function nil)
(setq font-lock-defaults
`(makefile-imake-font-lock-keywords ,@(cdr font-lock-defaults))))
......@@ -1501,8 +1499,8 @@ Insertion takes place at point."
(pop-to-buffer browser-buffer)
(makefile-browser-fill targets macros)
(shrink-window-if-larger-than-buffer)
(set (make-local-variable 'makefile-browser-selection-vector)
(make-vector (+ (length targets) (length macros)) nil))
(setq-local makefile-browser-selection-vector
(make-vector (+ (length targets) (length macros)) nil))
(makefile-browser-start-interaction))))
(defun makefile-switch-to-browser ()
......
......@@ -631,15 +631,15 @@ Various indentation styles: K&R BSD BLK GNU LW
Turning on Perl mode runs the normal hook `perl-mode-hook'."
:abbrev-table perl-mode-abbrev-table
(set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
(set (make-local-variable 'paragraph-separate) paragraph-start)
(set (make-local-variable 'paragraph-ignore-fill-prefix) t)
(set (make-local-variable 'indent-line-function) #'perl-indent-line)
(set (make-local-variable 'comment-start) "# ")
(set (make-local-variable 'comment-end) "")
(set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *")
(set (make-local-variable 'comment-indent-function) #'perl-comment-indent)
(set (make-local-variable 'parse-sexp-ignore-comments) t)
(setq-local paragraph-start (concat "$\\|" page-delimiter))
(setq-local paragraph-separate paragraph-start)
(setq-local paragraph-ignore-fill-prefix t)
(setq-local indent-line-function #'perl-indent-line)
(setq-local comment-start "# ")
(setq-local comment-end "")
(setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *")
(setq-local comment-indent-function #'perl-comment-indent)
(setq-local parse-sexp-ignore-comments t)
;; Tell font-lock.el how to handle Perl.
(setq font-lock-defaults '((perl-font-lock-keywords
perl-font-lock-keywords-1
......@@ -647,22 +647,20 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'."
nil nil ((?\_ . "w")) nil
(font-lock-syntactic-face-function
. perl-font-lock-syntactic-face-function)))
(set (make-local-variable 'syntax-propertize-function)
#'perl-syntax-propertize-function)
(setq-local syntax-propertize-function #'perl-syntax-propertize-function)
(add-hook 'syntax-propertize-extend-region-functions
#'syntax-propertize-multiline 'append 'local)
;; Electricity.
;; FIXME: setup electric-layout-rules.
(set (make-local-variable 'electric-indent-chars)
(append '(?\{ ?\} ?\; ?\:) electric-indent-chars))
(setq-local electric-indent-chars
(append '(?\{ ?\} ?\; ?\:) electric-indent-chars))
(add-hook 'electric-indent-functions #'perl-electric-noindent-p nil t)
;; Tell imenu how to handle Perl.
(set (make-local-variable 'imenu-generic-expression)
perl-imenu-generic-expression)
(setq-local imenu-generic-expression perl-imenu-generic-expression)
(setq imenu-case-fold-search nil)
;; Setup outline-minor-mode.
(set (make-local-variable 'outline-regexp) perl-outline-regexp)
(set (make-local-variable 'outline-level) 'perl-outline-level))
(setq-local outline-regexp perl-outline-regexp)
(setq-local outline-level 'perl-outline-level))
;; This is used by indent-for-comment
;; to decide how much to indent a comment in Perl code
......
......@@ -1497,42 +1497,41 @@ with your script for an edit-interpret-debug cycle."
(make-local-variable 'sh-shell-file)
(make-local-variable 'sh-shell)
(set (make-local-variable 'skeleton-pair-default-alist)
sh-skeleton-pair-default-alist)
(set (make-local-variable 'skeleton-end-hook)
(lambda () (or (eolp) (newline) (indent-relative))))
(set (make-local-variable 'paragraph-start) (concat page-delimiter "\\|$"))
(set (make-local-variable 'paragraph-separate) paragraph-start)
(set (make-local-variable 'comment-start) "# ")
(set (make-local-variable 'comment-start-skip) "#+[\t ]*")
(set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table)
(set (make-local-variable 'comint-dynamic-complete-functions)
sh-dynamic-complete-functions)
(setq-local skeleton-pair-default-alist
sh-skeleton-pair-default-alist)
(setq-local skeleton-end-hook
(lambda () (or (eolp) (newline) (indent-relative))))
(setq-local paragraph-start (concat page-delimiter "\\|$"))
(setq-local paragraph-separate paragraph-start)
(setq-local comment-start "# ")
(setq-local comment-start-skip "#+[\t ]*")
(setq-local local-abbrev-table sh-mode-abbrev-table)
(setq-local comint-dynamic-complete-functions
sh-dynamic-complete-functions)
(add-hook 'completion-at-point-functions 'comint-completion-at-point nil t)
;; we can't look if previous line ended with `\'
(set (make-local-variable 'comint-prompt-regexp) "^[ \t]*")
(set (make-local-variable 'imenu-case-fold-search) nil)
(set (make-local-variable 'font-lock-defaults)
`((sh-font-lock-keywords
sh-font-lock-keywords-1 sh-font-lock-keywords-2)
nil nil
((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil
(font-lock-syntactic-face-function
. sh-font-lock-syntactic-face-function)))
(set (make-local-variable 'syntax-propertize-function)
#'sh-syntax-propertize-function)
(setq-local comint-prompt-regexp "^[ \t]*")
(setq-local imenu-case-fold-search nil)
(setq font-lock-defaults
`((sh-font-lock-keywords
sh-font-lock-keywords-1 sh-font-lock-keywords-2)
nil nil
((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil
(font-lock-syntactic-face-function
. sh-font-lock-syntactic-face-function)))
(setq-local syntax-propertize-function #'sh-syntax-propertize-function)
(add-hook 'syntax-propertize-extend-region-functions
#'syntax-propertize-multiline 'append 'local)
(sh-electric-here-document-mode 1)
(set (make-local-variable 'skeleton-pair-alist) '((?` _ ?`)))
(set (make-local-variable 'skeleton-pair-filter-function) 'sh-quoted-p)
(set (make-local-variable 'skeleton-further-elements)
'((< '(- (min sh-indentation (current-column))))))
(set (make-local-variable 'skeleton-filter-function) 'sh-feature)
(set (make-local-variable 'skeleton-newline-indent-rigidly) t)
(set (make-local-variable 'defun-prompt-regexp)
(concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)"))
(setq-local skeleton-pair-alist '((?` _ ?`)))
(setq-local skeleton-pair-filter-function 'sh-quoted-p)
(setq-local skeleton-further-elements
'((< '(- (min sh-indentation (current-column))))))
(setq-local skeleton-filter-function 'sh-feature)
(setq-local skeleton-newline-indent-rigidly t)
(setq-local defun-prompt-regexp
(concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)"))
;; Parse or insert magic number for exec, and set all variables depending
;; on the shell thus determined.
(sh-set-shell
......@@ -2104,19 +2103,19 @@ Calls the value of `sh-set-shell-hook' if set."
(executable-set-magic shell (sh-feature sh-shell-arg)
no-query-flag insert-flag)))
(setq mode-line-process (format "[%s]" sh-shell))
(set (make-local-variable 'sh-shell-variables) nil)
(set (make-local-variable 'sh-shell-variables-initialized) nil)
(set (make-local-variable 'imenu-generic-expression)
(sh-feature sh-imenu-generic-expression))
(setq-local sh-shell-variables nil)
(setq-local sh-shell-variables-initialized nil)
(setq-local imenu-generic-expression
(sh-feature sh-imenu-generic-expression))
(let ((tem (sh-feature sh-mode-syntax-table-input)))
(when tem
(set (make-local-variable 'sh-mode-syntax-table)
(apply 'sh-mode-syntax-table tem))
(setq-local sh-mode-syntax-table
(apply 'sh-mode-syntax-table tem))
(set-syntax-table sh-mode-syntax-table)))
(dolist (var (sh-feature sh-variables))
(sh-remember-variable var))
(if (set (make-local-variable 'sh-indent-supported-here)
(sh-feature sh-indent-supported))
(if (setq-local sh-indent-supported-here
(sh-feature sh-indent-supported))
(progn
(message "Setting up indent for shell type %s" sh-shell)
(if sh-use-smie
......@@ -2127,16 +2126,16 @@ Calls the value of `sh-set-shell-hook' if set."
(funcall mksym "rules")
:forward-token (funcall mksym "forward-token")
:backward-token (funcall mksym "backward-token")))
(set (make-local-variable 'parse-sexp-lookup-properties) t)
(set (make-local-variable 'sh-kw-alist) (sh-feature sh-kw))
(setq-local parse-sexp-lookup-properties t)
(setq-local sh-kw-alist (sh-feature sh-kw))
(let ((regexp (sh-feature sh-kws-for-done)))
(if regexp
(set (make-local-variable 'sh-regexp-for-done)
(sh-mkword-regexpr (regexp-opt regexp t)))))
(setq-local sh-regexp-for-done
(sh-mkword-regexpr (regexp-opt regexp t)))))
(message "setting up indent stuff")
;; sh-mode has already made indent-line-function local
;; but do it in case this is called before that.
(set (make-local-variable 'indent-line-function) 'sh-indent-line))
(setq-local indent-line-function 'sh-indent-line))
(if sh-make-vars-local
(sh-make-vars-local))
(message "Indentation setup for shell type %s" sh-shell))
......
......@@ -266,22 +266,21 @@
;;;###autoload
(define-derived-mode css-mode fundamental-mode "CSS"
"Major mode to edit Cascading Style Sheets."
(set (make-local-variable 'font-lock-defaults) css-font-lock-defaults)
(set (make-local-variable 'comment-start) "/*")
(set (make-local-variable 'comment-start-skip) "/\\*+[ \t]*")
(set (make-local-variable 'comment-end) "*/")
(set (make-local-variable 'comment-end-skip) "[ \t]*\\*+/")
(set (make-local-variable 'forward-sexp-function) 'css-forward-sexp)
(set (make-local-variable 'parse-sexp-ignore-comments) t)
(set (make-local-variable 'indent-line-function) 'css-indent-line)
(set (make-local-variable 'fill-paragraph-function)
'css-fill-paragraph)
(setq-local font-lock-defaults css-font-lock-defaults)
(setq-local comment-start "/*")
(setq-local comment-start-skip "/\\*+[ \t]*")
(setq-local comment-end "*/")
(setq-local comment-end-skip "[ \t]*\\*+/")
(setq-local forward-sexp-function 'css-forward-sexp)
(setq-local parse-sexp-ignore-comments t)
(setq-local indent-line-function 'css-indent-line)
(setq-local fill-paragraph-function 'css-fill-paragraph)
(when css-electric-keys
(let ((fc (make-char-table 'auto-fill-chars)))
(set-char-table-parent fc auto-fill-chars)
(dolist (c css-electric-keys)
(aset fc c 'indent-according-to-mode))
(set (make-local-variable 'auto-fill-chars) fc))))
(setq-local auto-fill-chars fc))))
(defvar comment-continue)
......
......@@ -463,47 +463,39 @@ Do \\[describe-key] on the following bindings to discover what they do.
;; A start or end tag by itself on a line separates a paragraph.
;; This is desirable because SGML discards a newline that appears
;; immediately after a start tag or immediately before an end tag.
(set (make-local-variable 'paragraph-start) (concat "[ \t]*$\\|\
(setq-local paragraph-start (concat "[ \t]*$\\|\
\[ \t]*</?\\(" sgml-name-re sgml-attrs-re "\\)?>"))
(set (make-local-variable 'paragraph-separate)
(concat paragraph-start "$"))
(set (make-local-variable 'adaptive-fill-regexp) "[ \t]*")
(setq-local paragraph-separate (concat paragraph-start "$"))
(setq-local adaptive-fill-regexp "[ \t]*")
(add-hook 'fill-nobreak-predicate 'sgml-fill-nobreak nil t)
(set (make-local-variable 'indent-line-function) 'sgml-indent-line)
(set (make-local-variable 'comment-start) "<!-- ")
(set (make-local-variable 'comment-end) " -->")
(set (make-local-variable 'comment-indent-function) 'sgml-comment-indent)
(set (make-local-variable 'comment-line-break-function)
'sgml-comment-indent-new-line)
(set (make-local-variable 'skeleton-further-elements)
'((completion-ignore-case t)))
(set (make-local-variable 'skeleton-end-hook)
(lambda ()
(or (eolp)
(not (or (eq v2 '\n) (eq (car-safe v2) '\n)))
(newline-and-indent))))
(set (make-local-variable 'font-lock-defaults)
'((sgml-font-lock-keywords
sgml-font-lock-keywords-1
sgml-font-lock-keywords-2)
nil t))
(set (make-local-variable 'syntax-propertize-function)
sgml-syntax-propertize-function)
(set (make-local-variable 'facemenu-add-face-function)
'sgml-mode-facemenu-add-face-function)
(set (make-local-variable 'sgml-xml-mode) (sgml-xml-guess))
(if sgml-xml-mode
()
(set (make-local-variable 'skeleton-transformation-function)
sgml-transformation-function))
(setq-local indent-line-function 'sgml-indent-line)
(setq-local comment-start "<!-- ")
(setq-local comment-end " -->")
(setq-local comment-indent-function 'sgml-comment-indent)
(setq-local comment-line-break-function 'sgml-comment-indent-new-line)
(setq-local skeleton-further-elements '((completion-ignore-case t)))
(setq-local skeleton-end-hook
(lambda ()
(or (eolp)
(not (or (eq v2 '\n) (eq (car-safe v2) '\n)))
(newline-and-indent))))
(setq font-lock-defaults '((sgml-font-lock-keywords
sgml-font-lock-keywords-1
sgml-font-lock-keywords-2)
nil t))
(setq-local syntax-propertize-function sgml-syntax-propertize-function)
(setq-local facemenu-add-face-function 'sgml-mode-facemenu-add-face-function)
(setq-local sgml-xml-mode (sgml-xml-guess))
(unless sgml-xml-mode
(setq-local skeleton-transformation-function sgml-transformation-function))
;; This will allow existing comments within declarations to be
;; recognized.
;; I can't find a clear description of SGML/XML comments, but it seems that
;; the only reliable ones are <!-- ... --> although it's not clear what
;; "..." can contain. It used to accept -- ... -- as well, but that was
;; apparently a mistake.
(set (make-local-variable 'comment-start-skip) "<!--[ \t]*")
(set (make-local-variable 'comment-end-skip) "[ \t]*--[ \t\n]*>")
(setq-local comment-start-skip "<!--[ \t]*")
(setq-local comment-end-skip "[ \t]*--[ \t\n]*>")
;; This definition has an HTML leaning but probably fits well for other modes.