comparison lisp/progmodes/sh-script.el @ 61316:283f977b41fb

(sh-builtins) <bash>: Add `caller'. (sh-escaped-newline): New face. (sh-font-lock-keywords) <shell>: Improve regexp for escaped newline, and use sh-escaped-newline face.
author Glenn Morris <rgm@gnu.org>
date Tue, 05 Apr 2005 13:07:42 +0000
parents 87f9bb9d3718
children 31aa9a390538
comparison
equal deleted inserted replaced
61315:d41150c0605f 61316:283f977b41fb
572 572
573 ;; customized this out of sheer bravado. not for the faint of heart. 573 ;; customized this out of sheer bravado. not for the faint of heart.
574 ;; but it *did* have an asterisk in the docstring! 574 ;; but it *did* have an asterisk in the docstring!
575 (defcustom sh-builtins 575 (defcustom sh-builtins
576 '((bash sh-append posix 576 '((bash sh-append posix
577 "." "alias" "bg" "bind" "builtin" "compgen" "complete" 577 "." "alias" "bg" "bind" "builtin" "caller" "compgen" "complete"
578 "declare" "dirs" "disown" "enable" "fc" "fg" "help" "history" 578 "declare" "dirs" "disown" "enable" "fc" "fg" "help" "history"
579 "jobs" "kill" "let" "local" "popd" "printf" "pushd" "shopt" 579 "jobs" "kill" "let" "local" "popd" "printf" "pushd" "shopt"
580 "source" "suspend" "typeset" "unalias") 580 "source" "suspend" "typeset" "unalias")
581 581
582 ;; The next entry is only used for defining the others 582 ;; The next entry is only used for defining the others
789 (:weight bold))) 789 (:weight bold)))
790 "Face to show a here-document" 790 "Face to show a here-document"
791 :group 'sh-indentation) 791 :group 'sh-indentation)
792 (defvar sh-heredoc-face 'sh-heredoc-face) 792 (defvar sh-heredoc-face 'sh-heredoc-face)
793 793
794 (defface sh-escaped-newline '((t :inherit font-lock-string-face))
795 "Face used for (non-escaped) backslash at end of a line in Shell-script mode."
796 :group 'sh-script
797 :version "22.1")
794 798
795 (defvar sh-font-lock-keywords 799 (defvar sh-font-lock-keywords
796 '((csh sh-append shell 800 '((csh sh-append shell
797 ("\\${?[#?]?\\([A-Za-z_][A-Za-z0-9_]*\\|0\\)" 1 801 ("\\${?[#?]?\\([A-Za-z_][A-Za-z0-9_]*\\|0\\)" 1
798 font-lock-variable-name-face)) 802 font-lock-variable-name-face))
813 (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t))) 817 (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t)))
814 818
815 ;; The next entry is only used for defining the others 819 ;; The next entry is only used for defining the others
816 (shell sh-append executable-font-lock-keywords 820 (shell sh-append executable-font-lock-keywords
817 ;; Using font-lock-string-face here confuses sh-get-indent-info. 821 ;; Using font-lock-string-face here confuses sh-get-indent-info.
818 ("\\\\$" 0 font-lock-warning-face) 822 ("\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\\\)$" 3 'sh-escaped-newline)
819 ("\\\\[^A-Za-z0-9]" 0 font-lock-string-face) 823 ("\\\\[^A-Za-z0-9]" 0 font-lock-string-face)
820 ("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1 824 ("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1
821 font-lock-variable-name-face)) 825 font-lock-variable-name-face))
822 (rpm sh-append rpm2 826 (rpm sh-append rpm2
823 ("%{?\\(\\sw+\\)" 1 font-lock-keyword-face)) 827 ("%{?\\(\\sw+\\)" 1 font-lock-keyword-face))