summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Make `/ a' in *Package* filter by nameLars Ingebrigtsen2022-06-131-10/+8
| | | | | | | | | | | | * lisp/emacs-lisp/package.el (package-menu-filter-by-archive): Filter by package name instead of by regexp, so that if the user types "gnu", they won't get "nongnu", too (bug#55919).
* | bindat (str, strz): Reject non-ASCII, non-`eight-bit' charactersRichard Hansen2022-06-121-4/+6
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (str) (strz): Signal an error if the user attempts to pack a multibyte string containing characters other than ASCII and `eight-bit' characters (bug#55897). * doc/lispref/processes.texi (Bindat Types): Update documentation. * test/lisp/emacs-lisp/bindat-tests.el (str) (strz): Add tests.
* | * lisp/emacs-lisp/find-func.el (find-function-advised-original): SimplifyStefan Monnier2022-06-111-5/+1
| |
* | Recognize processes as a CL type againBasil L. Contovounesios2022-06-111-0/+1
| | | | | | | | | | | | | | | | For discussion, see: https://lists.gnu.org/r/emacs-devel/2022-06/msg00567.html * lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Include process as a type, to avoid cl-typep complaining about process objects.
* | Fix loaddefs installation of packages with no autoloadsLars Ingebrigtsen2022-06-111-50/+62
| | | | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Always generate an output file if we have EXTRA-DATA. This fixes package installation of packages with no ;;;###autoload forms.
* | Bindat: Document `sint`; add `le` arg to `uint`; deprecate `uintr`Stefan Monnier2022-06-111-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (bindat--type) <uint>: Add `le` optional arg. (bindat--type) <uintr>: Delete method. (uintr): Re-define as a bindat-macro instead. (bindat-type): Update docstring accordingly. (bindat--primitives): Update. (sint): Simplify. * doc/lispref/processes.texi (Bindat Types): Update `uint`, add `sint`, and remove `uintr`. * test/lisp/emacs-lisp/bindat-tests.el (data-bindat-spec): Use the new `le` arg of `uint` instead of `uintr`.
* | ; bindat (bindat--length-group): Fix indentationRichard Hansen2022-06-101-66/+66
| |
* | ; bindat (strz): Consistent length type check, take twoRichard Hansen2022-06-101-8/+13
| | | | | | | | | | | | | | | | | | | | | | Commit 30ec4a7347b2944818c6fc469ae871374ce7caa4 is incorrect -- the length computation logic uses a simple nilness test, not `numberp'. The `numberp' case is just an optimization if `len' is a literal number; it does not affect the behavior. Revert that commit, add some comments to help future readers avoid the same mistake, and update the pack logic to use the same optimization as the length computation for consistency.
* | Factor out test configuration for remote filesMichael Albinus2022-06-081-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/ert-x.el (tramp-methods) (tramp-default-host-alist): Declare. (ert-remote-temporary-file-directory): New defconst. * test/README: Mention dnd-tests.el. * test/lisp/autorevert-tests.el (auto-revert-test-remote-temporary-file-directory): Remove. Replace all uses by `ert-remote-temporary-file-directory'. * test/lisp/dnd-tests.el (ert-x): Require. (dnd-tests-temporary-file-directory): Remove. Replace all uses by `ert-remote-temporary-file-directory'. * test/lisp/filenotify-tests.el (file-notify-test-remote-temporary-file-directory): Remove. Replace all uses by `ert-remote-temporary-file-directory'. * test/lisp/shadowfile-tests.el (ert-x): Require. (shadow-test-remote-temporary-file-directory): Remove. Replace all uses by `ert-remote-temporary-file-directory'. * test/lisp/net/tramp-tests.el: Don't require ert. (ert-remote-temporary-file-directory): Define if it doesn't exist. (tramp-test-temporary-file-directory): Remove. Replace all uses by `ert-remote-temporary-file-directory'.
* | Preserve doc string in `byte-compile` (bug#55830)Mattias Engdegård2022-06-081-0/+1
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Don't transpose doc string and interactive spec, which must come in this order. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-function-attributes): New test.
* | Fix loaddefs-generate--rubric recorded nameLars Ingebrigtsen2022-06-071-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric): Fix the name that's recorded in the file -- this is only used by loaddefs-gen now, I think.
* | find-func.el: Fix bug#41104Stefan Monnier2022-06-071-3/+3
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/find-func.el (find-function-advised-original): Look at the actual function definition rather than `advice--symbol-function` which sometimes returns only the advice. * test/lisp/emacs-lisp/find-func-tests.el (find-func-tests--find-library-verbose): Add test.
* | ; * lisp/emacs-lisp/lisp.el (raise-sexp): Doc fix. (Bug#55788)Eli Zaretskii2022-06-061-5/+9
| |
* | cl-typep: Emit warning when using a type not known to be a typeStefan Monnier2022-06-064-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `cl-typep` has used a heuristic that if there's a `<foo>-p` function, then <foo> can be used as a type. This made sense in the past where most types were not officially declared to be (cl-)types, but nowadays this just encourages abuses such as using `cl-typecase` with "types" like `fbound`. It's also a problem for EIEIO objects, where for historical reasons `<foo>-p` tests if the object is of type exactly `<foo>` whereas (cl-typep OBJ <foo>) should instead test if OBJ is a *subtype* of `<foo>`. So we change `cl-typep` to emit a warning whenever this "-p" heuristic is used, to discourage abuses, encourage the use of explicit `cl-deftype` declarations, and try and detect some misuses of `<foo>-p` for EIEIO objects. * lisp/emacs-lisp/eieio.el (defclass): Define as type not only at run-time but also for the current compilation unit. * lisp/emacs-lisp/eieio-core.el (class, eieio-object): Define as types. * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Don't abuse the "-p" heuristic. * lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add entries for frames, windows, markers, and overlays. (cl-typep): Emit a warning when using a predicate that is not known to correspond to a type. * lisp/files.el (file-relative-name): Fix error that can trigger if there's an(other) error between loading `files.el` and loading `minibuffer.el`.
* | Clarify syntax-ppss doc stringLars Ingebrigtsen2022-06-051-1/+2
| | | | | | | | * lisp/emacs-lisp/syntax.el (syntax-ppss): Clarify doc string.
* | Move two more variables from autoload.el to loaddefs-gen.elLars Ingebrigtsen2022-06-052-25/+25
| | | | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (generated-autoload-file) (generated-autoload-load-name): Move the remaining two autoload.el variables used by loaddefs-gen.el from autoload.el.
* | Rename generate-file to generate-lisp-fileLars Ingebrigtsen2022-06-052-20/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/url/url-cookie.el (url-cookie-write-file): * lisp/international/titdic-cnv.el (tit-process-header) (miscdic-convert): * lisp/international/ja-dic-cnv.el (skkdic-convert): * lisp/international/emoji.el (emoji--generate-file): * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric): * admin/unidata/unidata-gen.el (unidata-gen-file) (unidata-gen-charprop): Adjust callers. * lisp/emacs-lisp/generate-lisp-file.el: Renamed from generate-file.el. Also rename some keyword parameters and require a generator function.
* | Add convenience functions for generating Emacs Lisp filesLars Ingebrigtsen2022-06-052-26/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/url/url-cookie.el (url-cookie-write-file): * lisp/international/titdic-cnv.el (tit-process-header): * lisp/international/ja-dic-cnv.el (skkdic-convert): * lisp/international/emoji.el (emoji--generate-file): * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric) * admin/unidata/unidata-gen.el (unidata-gen-file) (unidata-gen-charprop): Use the new functions. * lisp/emacs-lisp/generate-file.el: New file to provide convenience functions for generated files. It's not always trivial to know which parts of the trailer that has to be obfuscated to avoid not getting byte-compiled etc, and some parts of the headers/trailers are usually forgotten when hand-coding these.
* | Extend file-expand-wildcards to allow regexpsLars Ingebrigtsen2022-06-051-1/+3
| | | | | | | | | | | | | | | | * doc/lispref/files.texi (Contents of Directories): Document it. * lisp/files.el (file-expand-wildcards): Extend to allow regexps. * lisp/emacs-lisp/shortdoc.el (file): Expand the file-expand-wildcards example.
* | Make loaddefs-generate--parse-file more robustLars Ingebrigtsen2022-06-041-36/+43
| | | | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file): Ensure that we don't have an autoload cookie on the first column inside a string.
* | Fix failing shortdoc testLars Ingebrigtsen2022-06-041-5/+5
| | | | | | | | | | | | * lisp/emacs-lisp/shortdoc.el (string): Each example section is supposed to contain only examples of using the function in question (as policed by the FAILED shortdoc-examples test).
* | Further raise-sexp doc string improvementLars Ingebrigtsen2022-06-041-1/+1
| | | | | | | | | | * lisp/emacs-lisp/lisp.el (raise-sexp): Fix the key binding syntax in the doc string.
* | Improve the raise-sexp doc stringLars Ingebrigtsen2022-06-041-1/+16
| | | | | | | | | | * lisp/emacs-lisp/lisp.el (raise-sexp): Try to explain what the command does (bug#55788).
* | Fix warnings introduced by the lisp-mode-autoload-regexp changeLars Ingebrigtsen2022-06-041-1/+1
| | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): The package name bit in ###;;;foo-autoload may be missing, so do a lax match (bug#55784).
* | Add a face to \\= doc string escapesLars Ingebrigtsen2022-06-041-0/+3
| | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): Add a face to \\= doc string escapes (bug#55783).
* | * lisp/emacs-lisp/shortdoc.el (string): Add `string-collate-lessp'.Michael Albinus2022-06-041-1/+6
| |
* | Don't issue warnings for Unicode quotes for nowLars Ingebrigtsen2022-06-031-6/+0
| | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-style-warn): Remove warning for "Unicode quotes" for now (bug#55780).
* | Make checkdoc-file-comments-engine match more ;;;### formsLars Ingebrigtsen2022-06-021-4/+2
| | | | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine): Use the more general lisp-mode-autoload-regexp instead of generate-autoload-cookie (i.e., also match ;;;###tramp-autoload).
* | Fix out-of-tree build problems with loaddefs.elLars Ingebrigtsen2022-06-021-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/Makefile.in ($(lisp)/loaddefs.el): Use the new function. * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Pass in whether to inhibit a partial build (to make the code more general). (loaddefs-generate--emacs-batch): Add a new function specially for the Emacs build that has the special rules needed. (This also fixes out-of-tree builds.) loaddefs-generate-batch can be used in general for packages etc. (loaddefs-generate-batch): Remove the special code for Emacs builds.
* | Speed up loaddefs-generate on slow disksLars Ingebrigtsen2022-06-021-1/+5
| | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Make file update comparisons faster.
* | Merge remote-tracking branch 'refs/remotes/origin/master'Stefan Monnier2022-06-011-2/+9
|\ \
| * | Fix up the loaddefs-gen updating logicLars Ingebrigtsen2022-06-011-1/+1
| | | | | | | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Only do the updating logic if we're really updating.
| * | Revert "Fix loaddefs generation"Lars Ingebrigtsen2022-06-011-1/+1
| | | | | | | | | | | | | | | | | | This reverts commit 28358db93007456a1e0a6d9118823d4ddea4ba39. This has been fixed in a different way.
| * | Tweak how loaddefs-gen decides whether to do a full updateLars Ingebrigtsen2022-06-011-1/+8
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Do a complete build more often to avoid problems with going from old loaddefs.el files to new ones.
| * | Fix loaddefs generationPo Lu2022-06-011-1/+1
| | | | | | | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Prevent one kind of string match error.
* | | bindat (strz): Fix wrong-type-argument error when unpackingRichard Hansen2022-06-011-2/+2
| | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (strz): Fix (wrong-type-argument number-or-marker-p nil) error when unpacking a strz with unspecified (variable) length. * test/lisp/emacs-lisp/bindat-tests.el (strz): Mark test as passing.
* | | ; bindat (strz): Consistent length type checkRichard Hansen2022-06-011-1/+1
| | | | | | | | | | | | | | | The strz length computation uses `numberp' to switch between fixed-length and variable-length modes, so packing should too.
* | | bindat (strz): Fix off-by-one bug in computed lengthRichard Hansen2022-06-011-2/+2
|/ / | | | | | | | | | | * lisp/emacs-lisp/bindat.el (strz): Include null terminator when computing packed string length. * test/lisp/emacs-lisp/bindat-tests.el (strz): Mark tests as passing.
* | Fix the loaddefs updating logicLars Ingebrigtsen2022-05-311-49/+49
| | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Fix the logic of updating -- we update per loaddefs file.
* | Make partial loaddefs updates work againLars Ingebrigtsen2022-05-311-24/+43
| | | | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Only update the loaddefs section for the files that have changed. This makes "git pull" (when few/no Lisp files have changed much faster).
* | Speed up generation of loaddefs filesLars Ingebrigtsen2022-05-314-343/+663
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/loading.texi (Autoload, Autoload by Prefix): Refer to loaddefs-generate instead of update-file-autoloads. * lisp/Makefile.in (LOADDEFS): Remove, because all the loaddefs files are created in one go now. (COMPILE_FIRST): Add loaddefs-gen/radix-tree, and drop autoload. ($(lisp)/loaddefs.el): Use loaddefs-gen. (MH_E_DIR, $(TRAMP_DIR)/tramp-loaddefs.el) ($(MH_E_DIR)/mh-loaddefs.el, $(CAL_DIR)/cal-loaddefs.el) ($(CAL_DIR)/diary-loaddefs.el, $(CAL_DIR)/hol-loaddefs.el): Remove. * lisp/generic-x.el: Inhibit computing prefixes, because the namespace here is all wonky. * lisp/w32-fns.el (w32-batch-update-autoloads): Removed -- unused function. * lisp/calendar/holidays.el ("holiday-loaddefs"): Renamed from hol-loaddefs to have a more regular name. * lisp/cedet/ede/proj-elisp.el (ede-emacs-cedet-autogen-compiler): Refer to loaddefs-gen instead of autoload. * lisp/emacs-lisp/autoload.el (make-autoload, autoload-rubric) (autoload-insert-section-header): Made into aliases of loaddefs-gen functions. (autoload--make-defs-autoload): Ditto. (autoload-ignored-definitions, autoload-compute-prefixes): Moved to loaddefs-gen. * lisp/emacs-lisp/lisp-mode.el (lisp-mode-autoload-regexp): New constant. (lisp-fdefs, lisp-mode-variables, lisp-outline-level): Use it to recognize all ;;;###autoload forms. * lisp/emacs-lisp/loaddefs-gen.el: New file. * lisp/emacs-lisp/package.el: Use loaddefs-generate instead of make-directory-autoloads. * test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-faulty-bzr-autoloads): Use loaddefs instead of autoloads.
* | Traverse record literals in byte-compile--first-symbol-with-posMattias Engdegård2022-05-291-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--first-symbol-with-pos): Traverse record literals as well as vectors. Either is rather pointless but there were some strong feelings about it.
* | pp--insert-lisp: Don't bug out on certain forms at beginning of bufferVisuwesh2022-05-281-1/+1
| | | | | | | | | | * pp.el (pp--insert): Check if point is in beginning of buffer before calling `looking-back' (bug#55677).
* | Fix native-comp of trampolines after previous changeLars Ingebrigtsen2022-05-281-0/+1
| | | | | | | | | | * lisp/emacs-lisp/comp.el (comp--native-compile): Don't delete the explicitly specified output file, just temp files.
* | Make package-update-all also refresh the listLars Ingebrigtsen2022-05-271-1/+2
| | | | | | | | | | * lisp/emacs-lisp/package.el (package-update-all): Also refresh package list.
* | Merge from origin/emacs-28Stefan Kangas2022-05-271-1/+1
|\| | | | | | | | | 9283508fb2 Fix format specifiers in tramp-adb.el a9f17ccce3 ; Fix some doc typos and minor language issues
| * ; Fix some doc typos and minor language issuesŠtěpán Němec2022-05-261-1/+1
| |
* | Merge remote-tracking branch 'origin/scratch/bug-55156'Stefan Monnier2022-05-261-13/+10
|\ \
| * | eval.c: New functions `defvar-1` and `defconst-1` (bug#55156)Stefan Monnier2022-05-261-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bytecode interpreter can't directly call special forms, so the byte-compiler usually converts special forms into some sequence of byte codes (basically, providing a duplicate definition of the special form). There are still two exceptions to this: `defconst` and `defvar`, where the compiler instead generates a convoluted chunk of code like: (funcall '(lambda (x) (defvar <sym> x <doc>)) <value>) where the quote makes sure we keep the function non-compiled, so as to end up running the special form at run time. Get rid of this workaround by introducing `defvar-1` and `defconst-1` which provide a *functional* interface to the functionality of the corresponding special form. * src/eval.c (defvar, Fdefvar_1, Fdefconst_1): New functions, extracted from `Fdefvar` and `Fdefconst`. (Fdefvar, Fdefconst): Use them. (syms_of_eval): `defsubr` the new functions. * lisp/emacs-lisp/bytecomp.el (byte-compile-tmp-var): Delete const. (byte-compile-defvar): Simplify using the new functions. * doc/lispref/variables.texi (Defining Variables): Adjust the doc of `defvar` to reflect the actual semantics implemented.
* | | package-activate-all: Use the quickstart more conservativelyStefan Monnier2022-05-261-1/+3
| | | | | | | | | | | | | | | * lisp/emacs-lisp/package.el (package-activate-all): Don't use the quickstart file if some packages have already been activated.