summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cl-lib.el
Commit message (Collapse)AuthorAgeFilesLines
* Fix compilation warning in cl-lib.elLars Ingebrigtsen2020-09-121-0/+1
| | | | | * lisp/emacs-lisp/cl-lib.el (cl-old-struct-compat-mode): Put the minor mode in the tools group (to avoid a compilation warning).
* Preserve setf semantics in 'substring', 'cons', 'logand' expandersŠtěpán Němec2020-08-251-2/+5
| | | | | | | * doc/lispref/variables.texi (Adding Generalized Variables): Fix example. * lisp/emacs-lisp/cl-lib.el (substring) * lisp/emacs-lisp/gv.el (cons, logand): Return the value being assigned, as specified for 'setf'. (bug#35546)
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Document Lisp floats a bit betterPaul Eggert2019-11-101-9/+7
| | | | | | | | | | | | | * doc/lispref/numbers.texi (Float Basics): * doc/misc/cl.texi (Implementation Parameters): * lisp/emacs-lisp/cl-lib.el (cl-most-positive-float) (cl-least-positive-float) (cl-least-positive-normalized-float, cl-float-epsilon) (cl-float-negative-epsilon): Document IEEE floating point better. Don’t suggest that Emacs might use some floating-point format other than IEEE format, as Emacs currently assumes IEEE in several places and there seems little point in removing those assumptions.
* Preserve more markers when reverting .gpg filesLars Ingebrigtsen2019-09-041-0/+1
| | | | | | | | | | | * lisp/epa-file.el (epa-file--replace-text): Gingerly replace the text in the buffer to preserve as many markers as possible (bug#34720). This emulates the behaviour of Finsert_file_contents more accurately. (epa-file-decode-and-insert): Remove compat code. (epa-file-insert-file-contents): Use the new function. * lisp/emacs-lisp/cl-lib.el (cl-incf): Add autoload cookie.
* ; * lisp/emacs-lisp/cl-lib.el (cl-pushnew): Doc fix.Eli Zaretskii2019-08-231-3/+3
|
* Clarify doc string of cl-pushnewLars Ingebrigtsen2019-08-231-3/+6
| | | | | * lisp/emacs-lisp/cl-lib.el (cl-pushnew): Clarify doc string (bug#37016).
* Make cl-values-list signal an error if its argument isn't a listLars Ingebrigtsen2019-07-281-5/+9
| | | | | * lisp/emacs-lisp/cl-lib.el (cl-values-list): Signal an error if LIST isn't a list (bug#23597).
* * lisp/emacs-lisp/bytecomp.el (byte-compile-dynamic): Mark obsoleteStefan Monnier2019-06-211-4/+0
| | | | | | | | | | | | See bug#11649 for an example problem, and emacs-devel discussion «Prickliness of the "invalid byte code" stuff». * lisp/wid-edit.el, lisp/wdired.el, lisp/vc/pcvs-util.el: * lisp/progmodes/executable.el, lisp/mail/sendmail.el: * lisp/emacs-lisp/cl-seq.el, lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/cl-lib.el, lisp/emacs-lisp/cl-extra.el: * lisp/dired-x.el, lisp/dired-aux.el, lisp/calendar/calendar.el: Don't use byte-compile-dynamic any more.
* * lisp/emacs-lisp/cl-lib.el (cl-endp): Move to cl-seq.elStefan Monnier2019-02-181-7/+0
| | | | Use 'cl-check-type'.
* * lisp/emacs-lisp/cl-lib.el (cl-endp): Remove stray 'x.Paul Eggert2019-02-171-1/+1
|
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Allow setf of buffer-modified-p without argument (Bug#21201)Noam Postavsky2018-08-271-2/+3
|/ | | | | * lisp/emacs-lisp/cl-lib.el (setf buffer-modified-p): Take current buffer if optional argument BUF is not passed.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | 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.
* * emacs-lisp/cl-lib.el (cl--old-struct-type-of): Accept `[]'Stefan Monnier2017-07-181-1/+1
|
* * lisp/emacs-lisp/cl-lib.el (cl--random-time): Remove as wellStefan Monnier2017-07-141-5/+0
| | | | It's also defined in cl-extra.el.
* Remove duplicate cl--random-state definitionPaul Eggert2017-07-141-3/+0
| | | | | * lisp/emacs-lisp/cl-lib.el (cl--random-state): Remove. This variable is now defined in cl-extra.el (Bug#27617).
* * lisp/emacs-lisp/cl-lib.el (cl-mapcar): Remove recent autoload cookie.Glenn Morris2017-05-041-1/+0
|
* Backward compatibility with pre-existing struct instances.Stefan Monnier2017-04-041-0/+36
| | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-lib.el (cl--old-struct-type-of): New function. (cl-old-struct-compat-mode): New minor mode. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Pass `record' to cl-struct-define to signal use of record objects. * lisp/emacs-lisp/cl-preloaded.el (cl--struct-get-class, cl-struct-define): Enable legacy defstruct compatibility. * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-old-struct, old-struct): New tests. * doc/lispref/elisp.texi, doc/lispref/records.texi: Document `old-struct-compat'.
* Prevent for consing in cl-mapc and cl-maplTino Calancha2017-02-271-2/+3
| | | | | | | | | | | | * lisp/emacs-lisp/cl-extra.el (cl--mapcar-many): Add optional arg ACC; If non-nil, accumulate values in the result (Bug#25826). (cl-mapc): Do computations inside function instead of call cl-map. (cl-mapl): Do computations inside function instead of call cl-maplist. * lisp/emacs-lisp/cl-lib.el (mapcar): Add autoload cookie. Call cl--mapcar-many with non-nil 3rd argument. * test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-map) (cl-extra-test-mapc, cl-extra-test-mapcar, cl-extra-test-mapl) (cl-extra-test-maplist): New tests.
* Move cXXXr and cXXXXr to subr.elMark Oteiza2017-01-251-119/+24
| | | | | | | | | | | | | | | | | | * etc/NEWS: Mention new core Elisp. * doc/lispref/lists.texi (List Elements): Document and index the new functions. * doc/misc/cl.texi (List Functions): Change "defines" to "aliases". * lisp/subr.el (caaar, caadr, cadar, caddr, cdaar, cdadr, cddar) (cdddr, caaaar caaadr, caadar, caaddr, cadaar, cadadr, caddar): (cadddr, cdaaar, cdaadr, cdadar, cdaddr, cddaar, cddadr, cdddar): (cddddr): New functions. * lisp/emacs-lisp/cl-lib.el (cl-caaar, cl-caadr, cl-cadar, cl-caddr): (cl-cdaar, cl-cdadr, cl-cddar cl-cdddr, cl-caaaar cl-caaadr): (cl-caadar, cl-caaddr, cl-cadaar, cl-cadadr, cl-caddar, cl-cadddr): (cl-cdaaar, cl-cdaadr, cl-cdadar, cl-cdaddr, cl-cddaar, cl-cddadr): (cl-cdddar, cl-cddddr): Alias to new subr functions. * lisp/emacs-lisp/cl.el (cl-unload-function): Remove cXXXr and cXXXXr elements.
* Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | Run admin/update-copyright.
* Make setf for frame-height/width work againChristopher Wellons2016-02-231-2/+4
| | | | | * lisp/emacs-lisp/cl-lib.el (frame-height): Make setf for frame-height/width work again (bug#21979).
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Initialize cl--gensym-counter to 0Paul Eggert2015-06-271-10/+5
| | | | | | | | | | | | Previously it was initialized to a random value, which made it harder to reproduce earlier Emacs runs. The need for a random value went away when Emacs introduced and used the #: syntax for uninterned symbols (Bug#20862). * doc/misc/cl.texi (Creating Symbols, Common Lisp Compatibility): Document that cl--gensym-counter now starts with 0. * lisp/emacs-lisp/cl-lib.el (cl--gensym-counter): Remove. (cl--random-time): Move to near only remaining use. * lisp/emacs-lisp/cl-macs.el (cl--gensym-counter): Initialize to 0.
* Fix bootstrap (void function cl-member).Glenn Morris2015-05-131-3/+4
| | | | | * lisp/emacs-lisp/cl-lib.el: Load cl-seq if no cl-loaddefs file. * lisp/emacs-lisp/cl-seq.el: Provide a feature.
* cl-lib.el: Partial revert of "2015-04-05 Rationalize c[ad]+r"Stefan Monnier2015-04-101-83/+50
| | | | | | * lisp/emacs-lisp/cl-lib.el: Partial revert of "2015-04-05 Rationalize use of c[ad]+r", so as to keep the "cl-" prefix on all cl-lib definitions.
* Rationalize use of c[ad]+r, expunging cl-c[ad]\{3,4\}r.Alan Mackenzie2015-04-051-26/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also expunge eudc-c[ad]+r. * subr.el (internal--compiler-macro-cXXr): "New" function, copied from cl--compiler-macro-cXXr. (caar, cadr, cdar, cddr): Change from defsubsts to defuns with the above compiler-macro. * net/eudc.el (eudc-cadr, eudc-cdar, eudc-caar, eudc-cdaar): Remove. * emacs-lisp/cl.el (Top level dolist doing defaliases): Remove caaar, etc., from list of new alias functions. * emacs-lisp/cl-lib.el (cl-caaar, etc): Rename to caaar, etc. (gen-cXXr--rawname, gen-cXXr-all-cl-aliases): New function/macro which generate obsolete cl- aliases for caaar, etc. Invoke them. * desktop.el: * edmacro.el: * emacs-lisp/cl-macs.el: * frameset.el: * ibuffer.el: * mail/footnote.el: * net/dbus.el: * net/eudc-export.el: * net/eudc.el: * net/eudcb-ph.el: * net/rcirc.el: * net/secrets.el: * play/5x5.el: * play/decipher.el: * play/hanoi.el: * progmodes/hideif.el: * ses.el: Replace cl-caaar, eudc-cadr, etc. with caaar and cadr, etc.
* Add new `cl-struct' and `eieio' pcase patterns.Stefan Monnier2015-03-231-1/+0
| | | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-struct): New pcase pattern. * lisp/emacs-lisp/eieio.el (eieio-pcase-slot-index-table) (eieio-pcase-slot-index-from-index-table): New functions. (eieio): New pcase pattern. * lisp/emacs-lisp/pcase.el (pcase--make-docstring): New function. (pcase): Use it to build the docstring. (pcase-defmacro): Make sure the macro is lazy-loaded. (\`): Move its docstring from `pcase'.
* * lisp/emacs-lisp/cl*.el: Use define-inline and move some codeStefan Monnier2015-02-141-16/+0
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-lib.el: Move autoloaded code to cl-preload. * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Register as children of the parent. (cl--assertion-failed): New function. (cl-assertion-failed): Move in from cl-lib.el. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Don't generate code to register as children of its parents. (cl--make-type-test, cl--compiler-macro-typep): Remove functions. (cl-typep): Reimplement using define-inline. (cl-assert): Use cl--assertion-failed. (cl-struct-slot-value): Use define-inline.
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.
* New macro macroexp-let2*Leo Liu2014-11-241-6/+5
| | | | | | | | | | * emacs-lisp/macroexp.el (macroexp-let2*): New macro. * window.el (with-temp-buffer-window) (with-current-buffer-window, with-displayed-buffer-window): * emacs-lisp/cl-macs.el (cl--compiler-macro-adjoin): * emacs-lisp/cl-lib.el (substring): * emacs-lisp/cl-extra.el (cl-getf): Use it.
* Consolidate x-select-text.Stefan Monnier2014-10-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/frame.el (gui-method, gui-method-define, gui-method-declare) (gui-call): New macros. (gui-method--name): New function. (frame-creation-function-alist): Use gui-method-declare. (make-frame): Use gui-method. * lisp/select.el (gui-select-enable-clipboard): Rename from x-select-enable-clipboard and move here. (x-select-enable-clipboard): Define as obsolete alias. (gui-last-selected-text): New var, to replace x-last-selected-text. (gui-select-text): New GUI method. (gui-select-text): New function. (x-select-text): Define as obsolete alias. * lisp/term/common-win.el (x-select-enable-clipboard, x-select-text): Move to select.el. * lisp/simple.el (interprogram-cut-function): Change default to x-select-text. (interprogram-paste-function): Change default to `ignore'. * lisp/w32-common-fns.el (interprogram-cut-function): Don't modify. * lisp/term/x-win.el (interprogram-cut-function): Don't modify. (gui-select-text): Add method for x. * lisp/term/w32-win.el (gui-select-text): Add method for w32. * lisp/term/pc-win.el (x-last-selected-text): Remove, use gui-last-selected-text instead. (msdos-initialize-window-system): Don't set interprogram-cut-function. (gui-select-text): Add method for pc. * lisp/term/ns-win.el (ns-last-selected-text): Remove, use gui-last-selected-text instead. (gui-select-text): Add method for ns. (x-setup-function-keys): Don't change interprogram-cut-function. * lisp/loadup.el ("startup"): Load after "frame". * lisp/subr.el (package--builtin-versions, package--description-file): Move from startup.el. * lisp/startup.el (package--builtin-versions, package--description-file): Move to subr.el. (handle-args-function-alist, window-system-initialization-alist): Use gui-method-declare. (command-line): Use gui-method. * src/xselect.c (selection-converter-alist): Fix docstring.
* Add cl-parse-integer based on parse-integerLeo Liu2014-09-261-0/+19
| | | | | | | | | | | | | | | | | | | | * doc/misc/cl.texi (Predicates on Numbers): Document cl-digit-char-p. (Numerical Functions): Document cl-parse-integer. * lisp/calendar/parse-time.el (parse-time-digits): Remove. (digit-char-p, parse-integer) Moved to cl-lib.el. (parse-time-tokenize, parse-time-rules, parse-time-string): Use cl-parse-integer. * lisp/emacs-lisp/cl-extra.el (cl-parse-integer): New function. * lisp/emacs-lisp/cl-lib.el (cl-digit-char-table): New var. (cl-digit-char-p): New function. * test/automated/cl-lib.el (cl-digit-char-p, cl-parse-integer): New tests. Fixes: debbugs:18557
* * emacs-lisp/cl-lib.el (cl-endp): Fix last change.Leo Liu2014-05-211-1/+1
|
* * emacs-lisp/cl-lib.el (cl-endp): Conform to CL's semantics.Leo Liu2014-05-201-1/+7
|
* * lisp/emacs-lisp/cl-macs.el (cl-struct-slot-offset): Mark as pure.Stefan Monnier2014-04-211-3/+0
| | | | | | | | | | | (cl--set-elt): Don't proclaim as inline. (cl-struct-slot-value): Remove explicit gv-setter and compiler-macro. Define as inlinable instead. (cl-struct-set-slot-value): Remove. * doc/misc/cl.texi (Structures): Remove cl-struct-set-slot-value. * lisp/emacs-lisp/cl-lib.el (cl--set-elt): Remove. * lisp/emacs-lisp/cl-seq.el (cl-replace, cl-substitute, cl-nsubstitute): Use setf instead.
* * lisp/emacs-lisp/cl-lib.el (current-case-table): Remove setter.Stefan Monnier2014-04-121-1/+0
| | | | * lisp/leim/quail/sisheng.el (sisheng-list): Use with-case-table.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* * lisp/subr.el (define-error): New function.Stefan Monnier2013-08-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/control.texi (Signaling Errors): Refer to define-error. (Error Symbols): Add `define-error'. * doc/lispref/errors.texi (Standard Errors): Don't refer to `error-conditions'. * lisp/progmodes/ada-xref.el (ada-error-file-not-found): Rename from error-file-not-found and define with define-error. * lisp/emacs-lisp/cl-lib.el (cl-assertion-failed): Move here from subr.el and define with define-error. * lisp/userlock.el (file-locked, file-supersession): * lisp/simple.el (mark-inactive): * lisp/progmodes/js.el (js-moz-bad-rpc, js-js-error): * lisp/progmodes/ada-mode.el (ada-mode-errors): * lisp/play/life.el (life-extinct): * lisp/nxml/xsd-regexp.el (xsdre-invalid-regexp, xsdre-parse-error): * lisp/nxml/xmltok.el (xmltok-markup-declaration-parse-error): * lisp/nxml/rng-util.el (rng-error): * lisp/nxml/rng-uri.el (rng-uri-error): * lisp/nxml/rng-match.el (rng-compile-error): * lisp/nxml/rng-cmpct.el (rng-c-incorrect-schema): * lisp/nxml/nxml-util.el (nxml-error, nxml-file-parse-error): * lisp/nxml/nxml-rap.el (nxml-scan-error): * lisp/nxml/nxml-outln.el (nxml-outline-error): * lisp/net/soap-client.el (soap-error): * lisp/net/gnutls.el (gnutls-error): * lisp/net/ange-ftp.el (ftp-error): * lisp/mpc.el (mpc-proc-error): * lisp/json.el (json-error, json-readtable-error, json-unknown-keyword) (json-number-format, json-string-escape, json-string-format) (json-key-format, json-object-format): * lisp/jka-compr.el (compression-error): * lisp/international/quail.el (quail-error): * lisp/international/kkc.el (kkc-error): * lisp/emacs-lisp/ert.el (ert-test-failed): * lisp/calc/calc.el (calc-error, inexact-result, math-overflow) (math-underflow): * lisp/bookmark.el (bookmark-error-no-filename): * lisp/epg.el (epg-error): Define with define-error.
* * lisp/emacs-lisp/cl-loaddefs.el: Don't version-control any more.Stefan Monnier2013-06-201-2/+3
| | | | | | | | | | * lisp/emacs-lisp/cl-lib.el: Load cl-macs when cl-loaddefs is not yet available. * lisp/Makefile.in (AUTOGEN_VCS): Move cl-loaddefs.el... (AUTOGENEL): ... here. * lisp/emacs-lisp/cl-macs.el (cl--sublis): New function. (cl--defsubst-expand): Use it. * .bzrignore: Don't unignore cl-loaddefs.el.
* * lisp/emacs-lisp/package.el: Don't activate packages older than builtin.Stefan Monnier2013-06-151-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (package-obsolete-list): Rename from package-obsolete-alist, and make it into a simple list of package-desc. (package-strip-version): Remove. (package-built-in-p): Use package--builtin-versions. (package-mark-obsolete): Simplify. (package-process-define-package): Mark it obsolete if older than the builtin version. (package-handle-response): Use line-end-position. (package-read-archive-contents, package--download-one-archive): Simplify. (package--add-to-archive-contents): Skip if older than the builtin or installed version. (package-menu-describe-package): Fix last change. (package-list-unversioned): New var. (package-menu--generate): Use it. * lisp/Makefile.in (autoloads): Set autoload-builtin-package-versions. * lisp/startup.el (package--builtin-versions): New var. (package-subdirectory-regexp): Remove. (package--description-file): Hard code its value instead. * lisp/emacs-lisp/autoload.el: Manage package--builtin-versions. (autoload--insert-text, autoload--insert-cookie-text): New functions. (autoload-builtin-package-versions): New variable. (autoload-generate-file-autoloads): Use them. Remove the list of autoloaded functions/macros from the (autoload...) comments.
* Fix compilation error with simultaneous dynamic+lexical scoping.Stefan Monnier2013-06-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add warning when a defvar appears after the first let-binding. * lisp/emacs-lisp/bytecomp.el (byte-compile-lexical-variables): New var. (byte-compile-close-variables): Initialize it. (byte-compile--declare-var): New function. (byte-compile-file-form-defvar) (byte-compile-file-form-define-abbrev-table) (byte-compile-file-form-custom-declare-variable): Use it. (byte-compile-make-lambda-lexenv): Change the argument. Simplify. (byte-compile-lambda): Share call to byte-compile-arglist-vars. (byte-compile-bind): Handle dynamic bindings that shadow lexical bindings. (byte-compile-unbind): Make arg non-optional. (byte-compile-let): Simplify. * lisp/emacs-lisp/cconv.el (byte-compile-lexical-variables): Declare var. (cconv--analyse-function, cconv-analyse-form): Populate it. Protect byte-compile-bound-variables to limit the scope of defvars. (cconv-analyse-form): Add missing rule for (defvar <foo>). Remove unneeded rule for `declare'. * lisp/emacs-lisp/cl-macs.el (cl--compiler-macro-adjoin): Use macroexp-let2 so as to avoid depending on cl-adjoin at run-time. * lisp/emacs-lisp/cl-lib.el (cl-pushnew): Use backquotes. * lisp/emacs-lisp/macroexp.el (macroexp--compiling-p): New function. (macroexp--warn-and-return): Use it.
* Make cl-floatp-safe just an alias for floatpGlenn Morris2013-02-191-5/+1
| | | | | | | | | * lisp/emacs-lisp/cl-lib.el (cl-floatp-safe): Make it an alias for floatp. * lisp/emacs-lisp/cl-macs.el (cl--make-type-test) (cl--compiler-macro-assoc): Use floatp rather than cl-floatp-safe. * doc/misc/cl.texi: Remove commented out sections about cl-floatp-safe.
* Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.caPaul Eggert2013-01-021-1/+1
|\
| * Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
| |
* | Merge from emacs-24; up to 2012-11-26T19:56:14Z!monnier@iro.umontreal.caGlenn Morris2012-12-091-8/+0
|\|
| * * lisp/emacs-lisp/cl.el, lisp/emacs-lisp/cl-lib.el: Move cl-unload-function andStefan Monnier2012-12-061-8/+0
| | | | | | | | cl-load-hook where they belong.