Commit graph

15 commits

Author SHA1 Message Date
Glenn Morris
b69bcf3452 ; * lisp/emacs-lisp/cl-print.el (cl-prin1): Whitespace fix. 2017-10-02 13:19:11 -04:00
Paul Eggert
bc511a64f6 Prefer HTTPS to FTP and HTTP in documentation
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November.  Change these FTP URLs to https://ftp.gnu.org
instead.  Make similar changes for URLs to other organizations moving
away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
2017-09-13 15:54:37 -07:00
Mark Oteiza
370e04fbb2 Add cl-print method for hash tables
* lisp/emacs-lisp/cl-print.el (cl-print-object): New method.
2017-09-11 22:20:41 -04:00
Mark Oteiza
8130186cfb Add docstrings to cl-print entry points
* lisp/emacs-lisp/cl-print.el (cl-print-compiled): Fix docstring.
(cl-prin1, cl-prin1-to-string): Add docstrings.
2017-09-11 22:16:14 -04:00
Mark Oteiza
f6474b4808 ; Fix previous commit
The printer otherwise includes the 0x prefix.
* lisp/emacs-lisp/cl-print.el: Add 0x to format.
2017-09-11 21:23:38 -04:00
Mark Oteiza
a66155555b Include sxhash of object with printed bytecode
This printing, while succint, is rather opaque.  At least give an
immediate clue of whether different byte code printouts are for the
same or different byte code objects.
* lisp/emacs-lisp/cl-print.el (cl-print-object): Add object sxhash to
printed token "#<bytecode>".
2017-09-11 16:06:06 -04:00
Noam Postavsky
9a65b57796 * lisp/emacs-lisp/cl-print.el (cl-print-compiled-button): t by default.
* lisp/emacs-lisp/debug.el (debugger-insert-backtrace):
* lisp/help-fns.el (describe-variable): No need to let-bind
`cl-print-compiled-button' to t anymore.
2017-07-02 11:57:34 -04:00
Noam Postavsky
b567c48869 Don't redundantly cl-print arglist in function docstring again
* lisp/emacs-lisp/cl-print.el (cl-print-object): Don't print arglist
part of docstring.
* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-1): Update
test accordingly.
2017-06-29 19:40:23 -04:00
Noam Postavsky
9b0f52a86e Buttonize #<bytecode> part of printed functions (Bug#25226)
* lisp/emacs-lisp/cl-print.el: Autoload `disassemble-1'.
(cl-print-compiled-button): New variable.
(help-byte-code): New button type, calls `disassemble' in its action.
(cl-print-object): Use it if `cl-print-compiled-button' is
non-nil.
2017-06-12 22:52:37 -04:00
Noam Postavsky
a415c8bccb cl-print: handle circular objects when `print-circle' is nil (Bug#27117)
* lisp/emacs-lisp/cl-print.el (cl-print--currently-printing): New variable.
(cl-print-object): When `print-circle' is nil, bind it to a list of
objects that are currently printing to avoid printing the same object
endlessly.
* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-circle): New test.
2017-05-31 07:45:43 -04:00
Lars Brinkhoff
0565482838 Make cl-defstruct use records.
* lisp/emacs-lisp/cl-extra.el (cl--describe-class)
(cl--describe-class-slots): Use the new `type-of'.

* lisp/emacs-lisp/cl-generic.el (cl--generic-struct-tag): Use type-of.
(cl--generic-struct-specializers): Adjust to new tag.

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): When type is nil, use records.
Use the type symbol as the tag.  Use copy-record to copy structs.
(cl--defstruct-predicate): New function.
(cl--pcase-mutually-exclusive-p): Use it.
(cl-struct-sequence-type): Can now return `record'.

* lisp/emacs-lisp/cl-preloaded.el (cl--make-slot-desc): Adjust ad-hoc
code to new format.
(cl--struct-register-child): Work with records.
(cl-struct-define): Don't touch the tag's symbol-value and
symbol-function slots when we use the type as tag.

* lisp/emacs-lisp/cl-print.el (cl-print-object): Adjust to new tag.

* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-defstruct-record):
New test.

* doc/lispref/records.texi, doc/misc/cl.texi: Update for records.
2017-04-04 08:23:46 +02:00
Stefan Monnier
94b59f7dd1 * lisp/emacs-lisp/cl-print.el (cl-print-compiled): New variable
(cl-print-object) <compiled-function>: Print the docstring and
interactive form.  Obey cl-print-compiled.
2017-03-12 22:09:02 -04:00
Stefan Monnier
1a6597660a * lisp/emacs-lisp/cl-print.el (cl-print-object): Use #f(..) for functions. 2017-03-07 20:35:40 -05:00
Paul Eggert
788a5b8447 ; Spelling fixes 2017-03-05 08:19:06 -08:00
Stefan Monnier
407e650413 * lisp/emacs-lisp/cl-print.el: New file
* lisp/emacs-lisp/nadvice.el (advice--where): New function.
(advice--make-docstring): Use it.

* src/print.c (print_number_index): Don't declare here any more.
(Fprint_preprocess): New function.

* test/lisp/emacs-lisp/cl-print-tests.el: New file.
2017-02-23 21:06:54 -05:00