Ensure ' in docstring code snippets is not replaced

As of Emacs 25.1, `foo' is displayed as ‘foo’. This is controlled by
text-quoting-style, but curved quotes are the default.

This causes problems for docstrings that contain ' in code
snippets. Help buffers show e.g. (funcall 'foo) as (funcall ’foo),
which isn't legal elisp.

Instead, escape the quotes with \=. See substitute-command-keys for
the full docs on \= escaping.
master
Wilfred Hughes 8 years ago
parent 91d8cb01e6
commit 4e907430b1
  1. 8
      dash-functional.el
  2. 4
      dash.el

@ -207,10 +207,10 @@ In types (for n=2): ((a -> b), (c -> d)) -> (a, c) -> (b, d)
This function satisfies the following laws:
(-compose (-prodfn f g ...) (-prodfn f' g' ...)) = (-prodfn (-compose f f') (-compose g g') ...)
(-prodfn f g ...) = (-juxt (-compose f (-partial 'nth 0)) (-compose g (-partial 'nth 1)) ...)
(-compose (-prodfn f g ...) (-juxt f' g' ...)) = (-juxt (-compose f f') (-compose g g') ...)
(-compose (-partial 'nth n) (-prod f1 f2 ...)) = (-compose fn (-partial 'nth n))"
(-compose (-prodfn f g ...) (-prodfn f\\=' g\\=' ...)) = (-prodfn (-compose f f\\=') (-compose g g\\=') ...)
(-prodfn f g ...) = (-juxt (-compose f (-partial \\='nth 0)) (-compose g (-partial \\='nth 1)) ...)
(-compose (-prodfn f g ...) (-juxt f\\=' g\\=' ...)) = (-juxt (-compose f f\\=') (-compose g g\\=') ...)
(-compose (-partial \\='nth n) (-prod f1 f2 ...)) = (-compose fn (-partial \\='nth n))"
(lambda (x) (-zip-with 'funcall fns x)))
(provide 'dash-functional)

@ -1324,7 +1324,7 @@ combinations created by taking one element from each list in
order. The results are flattened, ignoring the tensor structure
of the result. This is equivalent to calling:
(-flatten-n (1- (length lists)) (apply '-table fn lists))
(-flatten-n (1- (length lists)) (apply \\='-table fn lists))
but the implementation here is much more efficient.
@ -2046,7 +2046,7 @@ execute body."
"Tests for equality use this function or `equal' if this is nil.
It should only be set using dynamic scope with a let, like:
(let ((-compare-fn #'=)) (-union numbers1 numbers2 numbers3)")
(let ((-compare-fn #\\='=)) (-union numbers1 numbers2 numbers3)")
(defun -distinct (list)
"Return a new list with all duplicates removed.

Loading…
Cancel
Save