diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 20 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-generic.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio-opt.el | 20 | ||||
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 8 | ||||
-rw-r--r-- | lisp/emacs-lisp/package.el | 6 |
5 files changed, 30 insertions, 28 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 18361c8888f..4761ac5e6fc 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1524,7 +1524,7 @@ may require more formatting") ;; Instead, use the `\\[...]' construct to stand for them. (save-excursion (let ((f nil) (m nil) (start (point)) - (re "[^`A-Za-z0-9_]\\([CMA]-[a-zA-Z]\\|\\(\\([CMA]-\\)?\ + (re "[^`‘A-Za-z0-9_]\\([CMA]-[a-zA-Z]\\|\\(\\([CMA]-\\)?\ mouse-[0-3]\\)\\)\\>")) ;; Find the first key sequence not in a sample (while (and (not f) (setq m (re-search-forward re e t))) @@ -1554,7 +1554,8 @@ mouse-[0-3]\\)\\)\\>")) (save-excursion (let ((case-fold-search t) (ret nil) mb me) - (while (and (re-search-forward "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'" e t) + (while (and (re-search-forward + "[`‘]\\(\\sw\\(\\sw\\|\\s_\\)+\\)['’]" e t) (not ret)) (let* ((ms1 (match-string 1)) (sym (intern-soft ms1))) @@ -1785,16 +1786,17 @@ Replace with \"%s\"? " original replace) ))) ;;* When a documentation string refers to a Lisp symbol, write it as ;; it would be printed (which usually means in lower case), with - ;; single-quotes around it. For example: `lambda'. There are two - ;; exceptions: write t and nil without single-quotes. (In this - ;; manual, we normally do use single-quotes for those symbols.) + ;; single-quotes around it. For example: ‘lambda’. There are two + ;; exceptions: write t and nil without single-quotes. (For + ;; compatibility with an older Emacs style, quoting with ` and ' + ;; also works, e.g., `lambda' is treated like ‘lambda’.) (save-excursion (let ((found nil) (start (point)) (msg nil) (ms nil)) (while (and (not msg) (re-search-forward ;; Ignore manual page references like ;; git-config(1). - "[^-([`':a-zA-Z]\\(\\w+[:-]\\(\\w\\|\\s_\\)+\\)[^](']" + "[^-([`'‘’:a-zA-Z]\\(\\w+[:-]\\(\\w\\|\\s_\\)+\\)[^]('’]" e t)) (setq ms (match-string 1)) ;; A . is a \s_ char, so we must remove periods from @@ -1812,7 +1814,7 @@ Replace with \"%s\"? " original replace) (if (checkdoc-autofix-ask-replace (match-beginning 1) (+ (match-beginning 1) (length ms)) - msg (concat "`" ms "'") t) + msg (concat "‘" ms "’") t) (setq msg nil) (setq msg (format "Lisp symbol `%s' should appear in quotes" @@ -1824,7 +1826,7 @@ Replace with \"%s\"? " original replace) nil))) ;; t and nil case (save-excursion - (if (re-search-forward "\\(`\\(t\\|nil\\)'\\)" e t) + (if (re-search-forward "\\([`‘]\\(t\\|nil\\)['’]\\)" e t) (if (checkdoc-autofix-ask-replace (match-beginning 1) (match-end 1) (format "%s should not appear in quotes. Remove? " @@ -1989,7 +1991,7 @@ If the offending word is in a piece of quoted text, then it is skipped." (if (and (not (save-excursion (goto-char b) (forward-char -1) - (looking-at "`\\|\"\\|\\.\\|\\\\"))) + (looking-at "[`\".‘]\\|\\\\"))) ;; surrounded by /, as in a URL or filename: /emacs/ (not (and (= ?/ (char-after e)) (= ?/ (char-before b)))) diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index 24a04d445de..96b86aa21cc 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -876,11 +876,11 @@ Can only be used from within the lexical body of a primary or around method." (cl--generic-method-specializers method))) (file (find-lisp-object-file-name met-name 'cl-defmethod))) (when file - (insert " in `") + (insert " in ‘") (help-insert-xref-button (help-fns-short-filename file) 'help-function-def met-name file 'cl-defmethod) - (insert "'.\n"))) + (insert "’.\n"))) (insert "\n" (or (nth 2 info) "Undocumented") "\n\n"))))))) ;;; Support for (head <val>) specializers. diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el index 02b89e043e4..11d99849a97 100644 --- a/lisp/emacs-lisp/eieio-opt.el +++ b/lisp/emacs-lisp/eieio-opt.el @@ -90,11 +90,11 @@ If CLASS is actually an object, then also display current values of that object. " class") (let ((location (find-lisp-object-file-name class 'eieio-defclass))) (when location - (insert " in `") + (insert " in ‘") (help-insert-xref-button (help-fns-short-filename location) 'eieio-class-def class location 'eieio-defclass) - (insert "'"))) + (insert "’"))) (insert ".\n") ;; Parents (let ((pl (eieio-class-parents class)) @@ -103,10 +103,10 @@ If CLASS is actually an object, then also display current values of that object. (insert " Inherits from ") (while (setq cur (pop pl)) (setq cur (eieio--class-name cur)) - (insert "`") + (insert "‘") (help-insert-xref-button (symbol-name cur) 'help-function cur) - (insert (if pl "', " "'"))) + (insert (if pl "’, " "’"))) (insert ".\n"))) ;; Children (let ((ch (eieio-class-children class)) @@ -114,10 +114,10 @@ If CLASS is actually an object, then also display current values of that object. (when ch (insert " Children ") (while (setq cur (pop ch)) - (insert "`") + (insert "‘") (help-insert-xref-button (symbol-name cur) 'help-function cur) - (insert (if ch "', " "'"))) + (insert (if ch "’, " "’"))) (insert ".\n"))) ;; System documentation (let ((doc (documentation-property class 'variable-documentation))) @@ -130,9 +130,9 @@ If CLASS is actually an object, then also display current values of that object. (when generics (insert (propertize "Specialized Methods:\n\n" 'face 'bold)) (dolist (generic generics) - (insert "`") + (insert "‘") (help-insert-xref-button (symbol-name generic) 'help-function generic) - (insert "'") + (insert "’") (pcase-dolist (`(,qualifiers ,args ,doc) (eieio-method-documentation generic class)) (insert (format " %s%S\n" qualifiers args) @@ -245,11 +245,11 @@ are not abstract." (setq location (find-lisp-object-file-name ctr def))) (when location - (insert " in `") + (insert " in ‘") (help-insert-xref-button (help-fns-short-filename location) 'eieio-class-def ctr location 'eieio-defclass) - (insert "'")) + (insert "’")) (insert ".\nCreates an object of class " (symbol-name ctr) ".") (goto-char (point-max)) (if (autoloadp def) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 6facf576055..ab01a109b7a 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -403,8 +403,8 @@ ;; Words inside \\[] tend to be for `substitute-command-keys'. ("\\\\\\\\\\[\\(\\(?:\\sw\\|\\s_\\)+\\)\\]" (1 font-lock-constant-face prepend)) - ;; Words inside `' tend to be symbol names. - ("`\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)'" + ;; Words inside ‘’ and `' tend to be symbol names. + ("[`‘]\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)['’]" (1 font-lock-constant-face prepend)) ;; Constant values. ("\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" 0 font-lock-builtin-face) @@ -452,8 +452,8 @@ ;; Erroneous structures. (,(concat "(" cl-errs-re "\\_>") (1 font-lock-warning-face)) - ;; Words inside `' tend to be symbol names. - ("`\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)'" + ;; Words inside ‘’ and `' tend to be symbol names. + ("[`‘]\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)['’]" (1 font-lock-constant-face prepend)) ;; Constant values. ("\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" 0 font-lock-builtin-face) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 3d5afa3edd2..97e6bd63da9 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2137,17 +2137,17 @@ will be deleted." "Installed" (capitalize status)) ;FIXME: Why comment-face? 'font-lock-face 'font-lock-comment-face)) - (insert " in `") + (insert " in ‘") ;; Todo: Add button for uninstalling. (help-insert-xref-button (abbreviate-file-name (file-name-as-directory pkg-dir)) 'help-package-def pkg-dir) (if (and (package-built-in-p name) (not (package-built-in-p name version))) - (insert "',\n shadowing a " + (insert "’,\n shadowing a " (propertize "built-in package" 'font-lock-face 'font-lock-builtin-face)) - (insert "'")) + (insert "’")) (if signed (insert ".") (insert " (unsigned).")) |