X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/4df043c55892b20418c763df48e313f1c44f442e..bdda4855c635ecf4135e23321bdba023e9ae65c9:/lisp/emacs-lisp/lisp-mode.el diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 8d57c193f4..ee3bda95b8 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -58,7 +58,7 @@ (setq i (1+ i))) (modify-syntax-entry ?\s " " table) ;; Non-break space acts as whitespace. - (modify-syntax-entry ?\x8a0 " " table) + (modify-syntax-entry ?\xa0 " " table) (modify-syntax-entry ?\t " " table) (modify-syntax-entry ?\f " " table) (modify-syntax-entry ?\n "> " table) @@ -168,7 +168,10 @@ (defvar lisp-doc-string-elt-property 'doc-string-elt "The symbol property that holds the docstring position info.") -(defconst lisp-prettify-symbols-alist '(("lambda" . ?λ)) +(defconst lisp-prettify-symbols-alist + '(("lambda" . ?λ) + ("sqrt" . ?√) + ("not" . ?¬)) "Alist of symbol/\"pretty\" characters to be displayed.") ;;;; Font-lock support. @@ -398,6 +401,9 @@ This will generate compile-time constants from BINDINGS." lisp-el-font-lock-keywords-1 `( ;; Regexp negated char group. ("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend) + ;; Erroneous structures. + (,(concat "(" el-errs-re "\\_>") + (1 font-lock-warning-face)) ;; Control structures. Common Lisp forms. (lisp--el-match-keyword . 1) ;; Exit/Feature symbols as constants. @@ -405,14 +411,11 @@ This will generate compile-time constants from BINDINGS." "[ \t']*\\(" lisp-mode-symbol-regexp "\\)?") (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) - ;; Erroneous structures. - (,(concat "(" el-errs-re "\\_>") - (1 font-lock-warning-face prepend)) ;; Words inside \\[] tend to be for `substitute-command-keys'. (,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]") (1 font-lock-constant-face prepend)) - ;; Words inside ‘’ and '' and `' tend to be symbol names. - (,(concat "['`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)" + ;; Words inside ‘’ and `' tend to be symbol names. + (,(concat "[`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)" lisp-mode-symbol-regexp "\\)['’]") (1 font-lock-constant-face prepend)) ;; Constant values. @@ -463,8 +466,8 @@ This will generate compile-time constants from BINDINGS." ;; Erroneous structures. (,(concat "(" cl-errs-re "\\_>") (1 font-lock-warning-face)) - ;; Words inside ‘’ and '' and `' tend to be symbol names. - (,(concat "['`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)" + ;; Words inside ‘’ and `' tend to be symbol names. + (,(concat "[`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)" lisp-mode-symbol-regexp "\\)['’]") (1 font-lock-constant-face prepend)) ;; Constant values. @@ -1216,8 +1219,15 @@ and initial semicolons." ;; ;; The `fill-column' is temporarily bound to ;; `emacs-lisp-docstring-fill-column' if that value is an integer. - (let ((paragraph-start (concat paragraph-start - "\\|\\s-*\\([(;:\"]\\|`(\\|#'(\\)")) + (let ((paragraph-start + (concat paragraph-start + (format "\\|\\s-*\\([(;%s\"]\\|`(\\|#'(\\)" + ;; If we're inside a string (like the doc + ;; string), don't consider a colon to be + ;; a paragraph-start character. + (if (nth 3 (syntax-ppss)) + "" + ":")))) (paragraph-separate (concat paragraph-separate "\\|\\s-*\".*[,\\.]$")) (fill-column (if (and (integerp emacs-lisp-docstring-fill-column)