aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/cedet
diff options
context:
space:
mode:
authorPaul Eggert2015-05-28 00:06:14 -0700
committerPaul Eggert2015-05-28 00:22:02 -0700
commit0fd5e6593af620863dcf90dff5d04631458e24cd (patch)
treeeba3529cdd544089f6661db3b3b09f0218aa1076 /lisp/cedet
parent11b2744f48fc03f1511de1152ad49807557c6f85 (diff)
downloademacs-0fd5e6593af620863dcf90dff5d04631458e24cd.tar.gz
emacs-0fd5e6593af620863dcf90dff5d04631458e24cd.zip
Support curved quotes in doc strings
Emacs's traditional doc string style has been to quote symbols `like this'. This worked well on now-obsolete terminals where ` and ' were symmetric quotes, but nowadays curved quotes ‘like this’ look better. Support quoting the new way too. (Bug#20385) * doc/lispref/tips.texi (Documentation Tips): Symbols can be quoted ‘like-this’ as well as `like-this'. * etc/NEWS: Mention this. * lisp/cedet/mode-local.el (overload-docstring-extension) (mode-local-print-binding, mode-local-describe-bindings-2): * lisp/cus-theme.el (describe-theme-1): * lisp/descr-text.el (describe-text-properties-1, describe-char): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/cl-generic.el (cl--generic-describe): * lisp/emacs-lisp/eieio-opt.el (eieio-help-class) (eieio-help-constructor): * lisp/emacs-lisp/package.el (describe-package-1): * lisp/faces.el (describe-face): * lisp/help-fns.el (help-fns--key-bindings) (help-fns--compiler-macro, help-fns--parent-mode, help-fns--obsolete): (help-fns--interactive-only, describe-function-1): (describe-variable): * lisp/help.el (describe-mode): * lisp/international/mule-cmds.el (describe-input-method) (describe-language-environment): * lisp/international/mule-diag.el (describe-character-set) (print-coding-system-briefly, list-input-methods) (list-input-methods-1): Insert curved quotes rather than grave accent and apostrophe. * lisp/cedet/srecode/texi.el (srecode-texi-texify-docstring): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine) (checkdoc-proper-noun-region-engine): * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2) (lisp-cl-font-lock-keywords-2): * lisp/finder.el (finder-font-lock-keywords): * lisp/gnus/gnus-art.el (gnus-button-alist): * lisp/help-fns.el (help-do-arg-highlight) (describe-function-1, describe-variable): * lisp/help-mode.el (help-xref-symbol-regexp) (help-xref-info-regexp, help-xref-url-regexp): * lisp/help.el (describe-mode): * lisp/international/mule-cmds.el (help-xref-mule-regexp-template): * lisp/wid-edit.el (widget-documentation-link-regexp): Parse symbols quoted ‘like-this’ as well as `like-this'. * lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Add "‘" and "’" to electric-pair-text-pairs. (elisp--form-quoted-p): Also allow "‘" as a quoting char. (elisp-completion-at-point, elisp--preceding-sexp): Also treat "‘" and "’" as quoting chars.
Diffstat (limited to 'lisp/cedet')
-rw-r--r--lisp/cedet/mode-local.el17
-rw-r--r--lisp/cedet/srecode/texi.el2
2 files changed, 10 insertions, 9 deletions
diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el
index 3c176aeaf05..35363337aee 100644
--- a/lisp/cedet/mode-local.el
+++ b/lisp/cedet/mode-local.el
@@ -598,15 +598,16 @@ PROMPT, INITIAL, HIST, and DEFAULT are the same as for `completing-read'."
598(defun overload-docstring-extension (overload) 598(defun overload-docstring-extension (overload)
599 "Return the doc string that augments the description of OVERLOAD." 599 "Return the doc string that augments the description of OVERLOAD."
600 (let ((doc "\n\This function can be overloaded\ 600 (let ((doc "\n\This function can be overloaded\
601 with `define-mode-local-override'.") 601 with define-mode-local-override.")
602 (sym (overload-obsoleted-by overload))) 602 (sym (overload-obsoleted-by overload)))
603 (when sym 603 (when sym
604 (setq doc (format "%s\nIt has made the overload `%s' obsolete since %s." 604 (setq doc (format "%s\nIt has made the overload %s obsolete since %s."
605 doc sym (get sym 'overload-obsoleted-since)))) 605 doc sym (get sym 'overload-obsoleted-since))))
606 (setq sym (overload-that-obsolete overload)) 606 (setq sym (overload-that-obsolete overload))
607 (when sym 607 (when sym
608 (setq doc (format "%s\nThis overload is obsolete since %s;\nUse `%s' instead." 608 (setq doc (format
609 doc (get overload 'overload-obsoleted-since) sym))) 609 "%s\nThis overload is obsolete since %s;\nuse ‘%s’ instead."
610 doc (get overload 'overload-obsoleted-since) sym)))
610 doc)) 611 doc))
611 612
612(defun mode-local-augment-function-help (symbol) 613(defun mode-local-augment-function-help (symbol)
@@ -629,9 +630,9 @@ SYMBOL is a function that can be overridden."
629(defun mode-local-print-binding (symbol) 630(defun mode-local-print-binding (symbol)
630 "Print the SYMBOL binding." 631 "Print the SYMBOL binding."
631 (let ((value (symbol-value symbol))) 632 (let ((value (symbol-value symbol)))
632 (princ (format "\n `%s' value is\n " symbol)) 633 (princ (format "\n %s value is\n " symbol))
633 (if (and value (symbolp value)) 634 (if (and value (symbolp value))
634 (princ (format "`%s'" value)) 635 (princ (format "%s" value))
635 (let ((pt (point))) 636 (let ((pt (point)))
636 (pp value) 637 (pp value)
637 (save-excursion 638 (save-excursion
@@ -689,7 +690,7 @@ SYMBOL is a function that can be overridden."
689 ) 690 )
690 ((symbolp buffer-or-mode) 691 ((symbolp buffer-or-mode)
691 (setq mode buffer-or-mode) 692 (setq mode buffer-or-mode)
692 (princ (format "`%s'\n" buffer-or-mode)) 693 (princ (format "%s\n" buffer-or-mode))
693 ) 694 )
694 ((signal 'wrong-type-argument 695 ((signal 'wrong-type-argument
695 (list 'buffer-or-mode buffer-or-mode)))) 696 (list 'buffer-or-mode buffer-or-mode))))
@@ -699,7 +700,7 @@ SYMBOL is a function that can be overridden."
699 (while mode 700 (while mode
700 (setq table (get mode 'mode-local-symbol-table)) 701 (setq table (get mode 'mode-local-symbol-table))
701 (when table 702 (when table
702 (princ (format "\n- From `%s'\n" mode)) 703 (princ (format "\n- From %s\n" mode))
703 (mode-local-print-bindings table)) 704 (mode-local-print-bindings table))
704 (setq mode (get-mode-local-parent mode))))) 705 (setq mode (get-mode-local-parent mode)))))
705 706
diff --git a/lisp/cedet/srecode/texi.el b/lisp/cedet/srecode/texi.el
index be75f3765c1..b75a6609323 100644
--- a/lisp/cedet/srecode/texi.el
+++ b/lisp/cedet/srecode/texi.el
@@ -253,7 +253,7 @@ that class.
253 [ stuff ] => @code{[ stuff ]} 253 [ stuff ] => @code{[ stuff ]}
254 Key => @kbd{Key} (key is C\\-h, M\\-h, SPC, RET, TAB and the like) 254 Key => @kbd{Key} (key is C\\-h, M\\-h, SPC, RET, TAB and the like)
255 ... => @dots{}" 255 ... => @dots{}"
256 (while (string-match "`\\([-a-zA-Z0-9<>.]+\\)'" string) 256 (while (string-match "[`‘]\\([-a-zA-Z0-9<>.]+\\)['’]" string)
257 (let* ((vs (substring string (match-beginning 1) (match-end 1))) 257 (let* ((vs (substring string (match-beginning 1) (match-end 1)))
258 (v (intern-soft vs))) 258 (v (intern-soft vs)))
259 (setq string 259 (setq string