emacs/lisp/emacs-lisp
Stefan Monnier e9a668274e bytecomp.el: Rewrite the way we print dynamic docstrings
We used to print dynamic docstrings "manually" for two reasons:

- References should look like `(#$ . POS)` but `prin1` was unable
  to print just `#$` for an sexp.
- `make-docfile` needed to find those docstrings and the object
  to which they belonged.

The second point is moot now that we don't use `make-docfile` on
`.elc` files.  So this patch lifts the first restriction,
using `print-number-table`.

The rest of the patch then simplifies and regularises the
bytecompiler's generation of dynamic docstrings, which can
now also easily be done for "inner" defvars and other places.

* src/print.c (print_preprocess, print_object): Handle strings in
`print-number-table`.
(Vprint_number_table): Improve docstring.

* lisp/emacs-lisp/bytecomp.el:
(byte-compile--list-with-n): New function.
(byte-compile--docstring-style-warn): Rename from
`byte-compile-docstring-style-warn` and change calling convention.
(byte-compile--\#$, byte-compile--docstrings): New vars.
(byte-compile-close-variables): Bind them.
(byte-compile--docstring): New function.
(byte-compile-from-buffer): Set `byte-compile--\#$`.
(byte-compile-output-file-form): Use `byte-compile--\#$` instead
of special casing specific forms.
(byte-compile--output-docform-recurse, byte-compile-output-docform):
Delete functions.
(byte-compile-file-form-autoload, byte-compile-file-form-defalias)
(byte-compile-file-form-defvar-function, byte-compile-lambda):
Use `byte-compile--docstring` and `byte-compile--list-with-n`.
(byte-compile--declare-var): Add optional `not-toplevel` arg.
(byte-compile-defvar): Add `toplevel` arg.  Use `byte-compile--docstring`.
(byte-compile-file-form-defvar): Delegate to `byte-compile-defvar`.
(byte-compile--custom-declare-face): New function.  Use it for
`custom-declare-face`.
(byte-compile-file-form-defmumble): Use `byte-compile-output-file-form`

* src/doc.c (Fdocumentation_stringp): New function.
(syms_of_doc): Defsubr it.
(store_function_docstring): Remove left-over code from when we
used DOC for the docstring of some Lisp files.

* lisp/cus-face.el (custom-declare-face): Accept dynamic docstrings.
* lisp/faces.el (face-documentation): Handle dynamic docstrings.
* lisp/help-fns.el (describe-face): Simplify accordingly.
2024-02-02 13:07:53 -05:00
..
advice.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
avl-tree.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
backquote.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
backtrace.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
benchmark.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
bindat.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
byte-opt.el ; Clarify two comments in byte-optimize-letX 2024-01-02 04:08:43 +01:00
byte-run.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
bytecomp.el bytecomp.el: Rewrite the way we print dynamic docstrings 2024-02-02 13:07:53 -05:00
cconv.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
chart.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
check-declare.el Avoid defconst for vars which we modify 2024-01-04 18:44:43 -05:00
checkdoc.el Use special-mode in checkdoc status buffer 2024-01-05 22:58:39 +01:00
cl-extra.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
cl-generic.el * lisp/emacs-lisp/cl-generic.el (cl--generic-compiler): Clarify the test 2024-01-25 14:24:43 -05:00
cl-indent.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
cl-lib.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
cl-macs.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
cl-preloaded.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
cl-print.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
cl-seq.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
comp-common.el ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
comp-cstr.el ; Fix typos in symbol names 2024-01-21 15:28:06 +01:00
comp-run.el ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
comp.el ; Spelling fixes 2024-01-30 17:23:25 -08:00
copyright.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
crm.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
cursor-sensor.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
debug-early.el (backtrace-on-redisplay-error): Use handler-bind 2024-01-04 16:37:01 -05:00
debug.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
derived.el derived.el: Delete old code (bug#68625) 2024-01-29 19:04:59 -05:00
disass.el Eliminate lazy bytecode loading 2024-01-31 17:12:25 +01:00
easy-mmode.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
easymenu.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
edebug.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
eieio-base.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
eieio-core.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
eieio-custom.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
eieio-datadebug.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
eieio-opt.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
eieio-speedbar.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
eieio.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
eldoc.el Eldoc: play nice with mode-line-format-right-align (bug#68547) 2024-01-20 06:00:21 -06:00
elint.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
elp.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
ert-font-lock.el ; Add 2024 to copyright years 2024-01-02 10:30:05 +08:00
ert-x.el Complete change of ert-remote-temporary-file-directory 2024-01-06 18:15:23 +01:00
ert.el ert.el: Use handler-bind to record backtraces 2024-01-04 16:33:25 -05:00
ewoc.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
faceup.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
find-func.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
float-sup.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
generate-lisp-file.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
generator.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
generic.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
gv.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
helper.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
hierarchy.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
icons.el Fix documentation of icon-elements 2024-01-14 17:03:16 +02:00
inline.el * lisp/emacs-lisp/inline.el (inline-const-val): Improve docstring 2024-01-30 13:14:32 -05:00
let-alist.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
lisp-mnt.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
lisp-mode.el Increase emacs-lisp-docstring-fill-column to 72 2024-02-02 13:33:35 +01:00
lisp.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
loaddefs-gen.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
macroexp.el (macroexp--with-extended-form-stack): Use plain let 2024-01-04 16:35:53 -05:00
map-ynp.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
map.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
memory-report.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
multisession.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
nadvice.el Set the 'name' prop in 'define-advice' 2024-01-13 11:43:01 +02:00
oclosure.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
package-vc.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
package-x.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
package.el Handle package versions that are not version strings 2024-01-10 15:59:56 +02:00
pcase.el * lisp/emacs-lisp/pcase.el (Commentary:): Add paper reference 2024-01-24 08:21:26 -05:00
pp.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
radix-tree.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
range.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
re-builder.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
regexp-opt.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
regi.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
ring.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
rmc.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
rx.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
seq.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
shadow.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
shortdoc.el Don't pretend that hash-table-size is useful 2024-01-13 20:50:39 +01:00
shorthands.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
smie.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
subr-x.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
syntax.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
tabulated-list.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
tcover-ses.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
testcover.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
text-property-search.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
thunk.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
timer-list.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
timer.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
tq.el ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
trace.el trace.el: Make it usable in batch mode as well 2024-01-19 15:02:50 -05:00
unsafep.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
vtable.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00
warnings.el Merge from savannah/emacs-29 2024-01-02 10:28:14 +08:00