summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* Fix subtle problems in tabulated-list-mode with line numbersEli Zaretskii2017-11-041-2/+13
| | | | | | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-watch-line-number-width): Call tabulated-list-init-header instead of tabulated-list-revert. (tabulated-list-window-scroll-function): New function. (tabulated-list-mode): Put 'tabulated-list-window-scroll-function' on the buffer-local 'window-scroll-functions' list.
* * lisp/emacs-lisp/generator.el (iter-do): Add a debug declaration.Paul Pogonyshev2017-11-031-1/+2
|
* Handle generic variables in cl-defgeneric Edebug specGemini Lasswell2017-11-011-1/+2
| | | | | | *lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Fix Edebug spec to match (setf name) and replace incorrect cl-lambda-list with listp (Bug#27747).
* Fix customization of debugger-print-function (Bug#29077)Noam Postavsky2017-11-011-2/+3
| | | | | | * lisp/emacs-lisp/debug.el (debugger-print-function): The :options keyword has no effect for :type 'function, use :type '(choice ...) instead.
* Don't clobber docstrings of explicitly-defined mode hook variablesPhil Sainty2017-10-312-6/+10
| | | | | | * lisp/emacs-lisp/derived.el (define-derived-mode): * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): When defining the mode hook variable, do not clobber pre-existing docstrings.
* Fix some doc typosGlenn Morris2017-10-271-1/+1
| | | | | | | | | | | * lisp/calendar/todo-mode.el (todo-next-item) (todo-previous-item, todo-toggle-item-header): * lisp/window.el (move-to-window-group-line): * src/editfns.c (Fformat): * test/lisp/calendar/todo-mode-tests.el (todo-test-move-item05): Fix doc typos. ; And in some comments.
* Require seq in rmc.elTino Calancha2017-10-271-0/+2
| | | | | * lisp/emacs-lisp/rmc.el: Require seq (Bug#28975). * test/lisp/emacs-lisp/rmc-tests.el (test-read-multiple-choice): Add test.
* Display commit in package description, if available (Bug#28637)David Glasser2017-10-241-0/+3
| | | | | | | | | | | MELPA includes a :commit field in its packages (https://github.com/melpa/package-build/pull/6). You can use this to tell if MELPA has processed a recently-merged change. This commit adds that metadata to the package description buffer. * lisp/emacs-lisp/package.el: Display commit in package description. Copyright-paperwork-exempt: yes
* Fix Edebug specs for map-let and with-maps-doGemini Lasswell2017-10-241-1/+2
| | | | | * lisp/emacs-lisp/map.el (map-let): Fix Edebug spec (bug#24777). * test/lisp/emacs-lisp/map-tests.el (with-maps-do): Fix Edebug spec.
* Don't fill keywords after Emacs Lisp docstringAlexander Gramiak2017-10-221-8/+3
| | | | | | | | | | | | This approach does mean that keywords that have spaces before them inside of docstrings aren't filled, but I think this is should be fine until Bug#28937 is fixed. * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Add a colon to paragraph-start unconditionally, but require that it follows at least one space. (Bug#24622) * test/lisp/emacs-lisp/lisp-tests.el: New tests for Bug#24622 and Bug#7751.
* Prevent eldoc from changing the mode lineNick Helm2017-10-211-1/+2
| | | | | * lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Don't change the mode line if it is not displayed. (Bug#28697)
* Make :align-to account for display-line-numbersEli Zaretskii2017-10-201-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These changes also update the various bundled packages to use new feature, and better support customizations of the line-number face. * src/xdisp.c (calc_pixel_width_or_height): Improve commentary. Make :align-to count from the end of the line-number display when the offset or the width form reference that of the text area. (Bug#28855) * src/indent.c (Fline_number_display_width): Implement support for the PIXELWISE argument being 'columns'. Update the doc string. (syms_of_indent): New symbol 'columns'. * lisp/ruler-mode.el (ruler-mode-window-col, ruler-mode-ruler): Call line-number-display-width with last argument 'columns'. * lisp/proced.el (proced-header-line): Call line-number-display-width with 2nd arg 'columns', which also fixes a problem when display-line-numbers is nil. * lisp/emacs-lisp/tabulated-list.el (tabulated-list-line-number-width): Call line-number-display-width with 2nd arg 'columns. (tabulated-list-entry-lnum-width): Remove unneeded defvar. (tabulated-list-print, tabulated-list-print-entry): No need to account for the value of tabulated-list-entry-lnum-width. (tabulated-list--current-lnum-width): New defvar. (tabulated-list-watch-line-number-width): New function. (tabulated-list-mode): Bind tabulated-list--current-lnum-width locally, and set up tabulated-list-watch-line-number-width as pre-redisplay-functions hook. * doc/lispref/display.texi (Size of Displayed Text): Document the 'columns' value of the PIXELWISE argument. (Pixel Specification): Update and improve the documentation of the supported forms.
* Fix Edebug spec for cl-defun (bug#24255)Gemini Lasswell2017-10-161-9/+23
| | | | | | | | * lisp/emacs-lisp/cl-macs.el: Modify the Edebug spec for `cl-lambda-list' to support destructuring argument lists. (cl-defun, cl-defmacro): Fix spelling errors in docstrings. * lisp/textmodes/rst.el: Remove alternate version of Edebug specs for `cl-lambda-list' and `cl-type-spec'.
* Fix ert-test finding by symbol (Bug#28849)Noam Postavsky2017-10-151-2/+2
| | | | | | | | | | | In 2017-07-28 "* lisp/subr.el (define-symbol-prop): New function", the symbol used for ert tests in load-history was changed from `ert-deftest' to `ert--test', but a couple of other places were not updated accordingly. * lisp/emacs-lisp/ert.el (ert-find-test-other-window): Pass `ert--test' as the TYPE to `find-function-do-it'. (top-level): Use `ert--test' as the key to the `find-function-regexp-alist' entry.
* Don't remember old debugger window (Bug#17882)Noam Postavsky2017-10-151-1/+3
| | | | | * lisp/emacs-lisp/debug.el (debug): Unset debugger-previous-window when `debugger-will-be-back' is nil.
* ; Prefer https: to http: in GNU URLsPaul Eggert2017-10-141-1/+1
|
* ; Typo fixes, mostly repeated wordsPaul Eggert2017-10-091-1/+1
|
* ; * lisp/emacs-lisp/rmc.el: Minor fix for copyright and license.Glenn Morris2017-10-091-2/+2
|
* Create new Edebug spec for docstrings and use it in closuresGemini Lasswell2017-10-065-20/+34
| | | | | | | | | | | | | | | | | | | | | | | | Since (:documentation FORM) can be used to create a docstring when lexical-binding is on, allow for that possibility in Edebug specs (bug#24773). * lisp/emacs-lisp/edebug.el: Define an Edebug spec for docstrings called lambda-doc and modify the Edebug specs for defun and defmacro to use it. (edebug-instrument-function): Check for generic functions first, to fix bug where edebug-step-in didn't work on methods now that cl-defgeneric has an Edebug spec. * lisp/subr.el (lambda): Modify Edebug spec to use lambda-doc. * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Add Edebug spec (bug#27747). (cl-defmethod): Use lambda-doc in Edebug spec. * lisp/emacs-lisp/cl-macs.el: Modify Edebug spec for cl-declarations-or-string to use lambda-doc, and modify Edebug spec for cl-lambda-expr to use cl-declarations-or-string. * lisp/emacs-lisp/pcase.el (pcase-lambda): Modify Edebug spec to use lambda-doc, as well as &define and def-body which are necessary for using Edebug on code wrapped by lambda. * lisp/emacs-lisp/generator.el (iter-defun, iter-lambda): Add Edebug specs.
* Move read-multiple-choice to its own libraryMark Oteiza2017-10-062-170/+199
| | | | | | | * lisp/emacs-lisp/rmc.el: New file. * lisp/emacs-lisp/subr-x.el (read-multiple-choice): Remove. * lisp/gnus/message.el: * lisp/net/nsm.el: Change required library.
* Fix dynamic binding wrapper in iter-lambda (bug#25965)Gemini Lasswell2017-10-051-2/+1
| | | | | | | * lisp/emacs-lisp/generator.el (cps--make-dynamic-binding-wrapper): Remove extra evaluation of form. * test/lisp/emacs-lisp/generator-tests.el (cps-iter-lambda-with-dynamic-binding): New test.
* Fix breakage due to recent change in tabulated-list-print-entryEli Zaretskii2017-10-051-19/+13
| | | | | | | | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-printer): Update the doc string. (tabulated-list-print-entry): Revert to using only 2 arguments. Update the doc string. (tabulated-list-entry-lnum-width): New defvar. (tabulated-list-print): Compute the width of line-number display once, then store that value in tabulated-list-entry-lnum-width, for tabulated-list-printer to use. (Bug#28704)
* Speed up list-packages when 'visual' line numbers are displayedEli Zaretskii2017-10-051-13/+20
| | | | | | | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-printer): Update the doc string. (tabulated-list-print-entry): Accept an additional optional argument INDENT. Update the doc string. (tabulated-list-print): Compute the width of line-number display once, then call tabulated-list-printer with that value as 3rd argument. (Bug#28704)
* Hook Flymake onto proper checkdoc and byte-compile interfacesJoão Távora2017-10-032-3/+38
| | | | | | | | | | | | | | | | | | | | | The interfaces in bytecomp.el and checkdoc.el are mostly boilerplate, with little knowledge of actual internals or thought given to the usefulness of said interfaces in contexts other than Flymake's. * lisp/emacs-lisp/bytecomp.el (byte-compile-log-warning-function): New variable. (byte-compile-log-warning): Use it. (byte-compile--log-warning-for-byte-compile): New function. * lisp/emacs-lisp/checkdoc.el (checkdoc-create-error-function): New variable. (checkdoc-create-error): Use it. (checkdoc--create-error-for-checkdoc): New function.xo * lisp/progmodes/flymake-elisp.el (flymake-elisp--checkdoc-1): Use checkdoc-create-error-function. (flymake-elisp--batch-byte-compile): Use byte-compile-log-warning-function.
* ; * lisp/emacs-lisp/cl-print.el (cl-prin1): Whitespace fix.Glenn Morris2017-10-021-1/+1
|
* Prefer HTTPS to HTTP for gnu.orgPaul Eggert2017-10-012-2/+2
| | | | | | | | | This fixes some URLs I omitted from my previous pass, notably those in lists.gnu.org. Although lists.gnu.org does not yet support TLS 1.1, TLS 1.0 is better than nothing. * lisp/erc/erc.el (erc-official-location): * lisp/mail/emacsbug.el (report-emacs-bug): Use https:, not http:.
* Fix slot typecheck in eieio-persistentEric Abrahamsen2017-09-301-15/+14
| | | | | | | | | | | | * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): An `or' form can specify multiple potential classes (or null) as valid types for a slot, but previously only the final element of the `or' was actually checked. Now returns all valid classes in the `or' form. (eieio-persistent-validate/fix-slot-value): Check if proposed value matches any of the valid classes. * test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el (eieio-test-multiple-class-slot): Test this behavior.
* Fix ert backtrace saving for non-`signal'ed errors (Bug#28333)Noam Postavsky2017-09-281-3/+2
| | | | | | * lisp/emacs-lisp/ert.el (ert--run-test-debugger): Take the frames above the `debugger' frame, rather than assuming there will be a `signal' frame.
* Use a separate syntax-ppss cache for narrowed buffersDmitry Gutov2017-09-261-35/+72
| | | | | | | | | | | | * lisp/emacs-lisp/syntax.el (syntax-ppss-wide): New variable, to contain the data from `syntax-ppss-last' and `syntax-ppss-cache'. (syntax-ppss-cache, syntax-ppss-last): Remove. (syntax-ppss-narrow, syntax-ppss-narrow-start): New variables. (syntax-ppss-flush-cache): Flush both caches. (syntax-ppss--data): Return the appropriate last result and buffer cache for the current restriction. (syntax-ppss, syntax-ppss-debug): Use it (bug#22983).
* Fix loading of smie-config rules (Bug#24848)Noam Postavsky2017-09-251-2/+2
| | | | | | | | | | | | * lisp/emacs-lisp/smie.el (smie-config--setter): Use `set-default' instead of `setq-default'. (smie-config): Use `custom-initialize-set' instead of `custom-initialize-default' as the :initialize argument. * lisp/progmodes/sh-script.el (sh-learn-buffer-indent): Mention that we call `smie-config-guess' so that the user will have a chance to find the correct docstring to consult. Remove hedging comments regarding use of abnormal hooks.
* ; Spelling and URL fixesPaul Eggert2017-09-231-1/+1
|
* ; Fix typoMark Oteiza2017-09-221-1/+1
| | | | * lisp/emacs-lisp/subr-x.el: Nix extra parenthesis.
* Catch more messages in ert-with-message-captureGemini Lasswell2017-09-211-12/+45
| | | | | | | * lisp/emacs-lisp/ert-x.el (ert-with-message-capture): Capture messages from prin1, princ and print. (ert--make-message-advice): New function. (ert--make-print-advice): New function.
* Rename timer-list to list-timersMark Oteiza2017-09-191-3/+3
| | | | | | | | * doc/emacs/anti.texi (Antinews): * doc/lispref/os.texi (Timers): * etc/NEWS: * lisp/emacs-lisp/timer-list.el: (timer-list-mode): Rename timer-list to list-timers.
* * lisp/emacs-lisp/cl-macs.el (cl-letf): Fix Edebug spec (bug#24765)Gemini Lasswell2017-09-161-1/+3
|
* Use cl-print in timer listMark Oteiza2017-09-151-14/+6
| | | | | | | * lisp/emacs-lisp/timer-list.el (timer-list): Use cl-print for handling functions. (timer-list-mode): Capitalize major mode name. Set bidi direction as in tabulated-list-mode.
* Bind n,p in timer-listMark Oteiza2017-09-141-0/+2
| | | | | * lisp/emacs-lisp/timer-list.el (timer-list-mode-map): Bind n and p to next- and previous-line, respectively.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-1386-90/+90
| | | | | | | | | | | | | 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.
* Add clarification to if-let* docstringMark Oteiza2017-09-131-4/+5
| | | | | | Also make its behaviour consistent with and-let* in that empty bindings results in success, not failure. * lisp/emacs-lisp/subr-x.el: Edit docstring, change else to then.
* Remove "baroque" use of prefix argument from gensymMark Oteiza2017-09-131-2/+9
| | | | | | | | | 'cl-gensym' was simply moved here, but let us take an opportunity to shed some historical baggage. * lisp/subr.el (gensym): Remove special treatment of PREFIX as a number. Use "g" as prefix to differentiate from cl-gensym defaults. * doc/lispref/symbols.texi (Creating Symbols): Update accordingly. * lisp/emacs-lisp/cl-macs.el (cl--gensym-counter, cl-gensym): Restore.
* ; Fix previous commitMark Oteiza2017-09-131-6/+2
| | | | | | | Removing extraneous code, thanks to Michael Heerdegen. * lisp/emacs-lisp/subr-x.el (internal--listify): Remove latter condition which always evaluates to t. (internal--build-binding-value-form): Remove dead code.
* Update uses of if-let and when-letMark Oteiza2017-09-121-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/dom.el (dom-previous-sibling): * lisp/emacs-lisp/package.el (package--with-work-buffer): (package--sort-deps-in-alist, package--sort-by-dependence): (package-install-from-archive, package-install): (package-menu-execute, package-menu--populate-new-package-list): * lisp/filenotify.el (file-notify--rm-descriptor): (file-notify--event-watched-file, file-notify--event-file-name): (file-notify--event-file1-name, file-notify-rm-watch): (file-notify-valid-p): * lisp/gnus/message.el (message-toggle-image-thumbnails): * lisp/gnus/nnimap.el (nnimap-request-move-article): * lisp/ibuf-ext.el (ibuffer-repair-saved-filters): * lisp/mpc.el (mpc-format): * lisp/net/eww.el (eww-tag-meta, eww-process-text-input): (eww-save-history): * lisp/net/shr.el (shr-tag-base, shr-tag-object, shr-make-table-1): * lisp/progmodes/prog-mode.el (prettify-symbols--post-command-hook): * lisp/svg.el (svg-remove): * lisp/textmodes/css-mode.el (css--named-color): (css--colon-inside-funcall): * lisp/textmodes/sgml-mode.el (html-current-buffer-classes): (html-current-buffer-ids): Use if-let* and when-let* instead.
* Implement and-let*Mark Oteiza2017-09-121-38/+70
| | | | | | | | | | | | | | | | | | | | This also includes changes to if-let and when-let. The single tuple special case is ambiguous, and binding a symbol to nil is not as useful as binding it to its value outside the lexical scope of the binding. (Bug#28254) * etc/NEWS: Mention. * lisp/emacs-lisp/subr-x.el (internal--listify): (internal--build-binding-value-form): Extend to account for solitary symbols and (EXPR) items in binding varlist. (if-let*, when-let*): Nix single tuple case and incumbent bind-symbol-to-nil behavior. (and-let*): New macro. (if-let, when-let): Mark obsolete. Redefine in terms of if-let*, so they implicitly gain the new features without breaking existing code. * test/lisp/emacs-lisp/subr-x-tests.el: Adjust tests for: lack of single-tuple special case, lack of binding solitary symbols to nil, and the introduction of uninterned symbols for (EXPR) bindings. Add SRFI-2 test suite adapted to Elisp.
* Move gensym to core ElispMark Oteiza2017-09-129-32/+21
| | | | | | | | | | | | | | | | | | | | | * doc/lispref/symbols.texi (Creating Symbols): Mention gensym right after make-symbol. * etc/NEWS: Mention. * lisp/emacs-lisp/cl-macs.el (cl--gensym-counter): Alias to gensym-counter. (cl-gensym): Alias to gensym. * lisp/emacs-lisp/cl.el: Remove gensym from list of aliases. * lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): * lisp/emacs-lisp/ert-x.el (ert-with-message-capture): (ert--expand-should-1, ert--expand-should): (ert--should-error-handle-error): * lisp/emacs-lisp/generator.el (cps--gensym): * lisp/emacs-lisp/gv.el (setf): * lisp/emacs-lisp/inline.el (inline--do-letlisteval): * lisp/emacs-lisp/pcase.el (pcase--make-docstring, pcase-dolist): (pcase--funcall, pcase--u1): Use gensym. * lisp/subr.el (gensym-counter): New variable. (gensym): New function, assimilated from cl-lib.
* Fix cl-gentempMark Oteiza2017-09-121-4/+5
| | | | | * lisp/emacs-lisp/cl-macs.el (cl--gentemp-counter): New variable. (cl-gentemp): Use it. Change prefix to "T".
* Add cl-print method for hash tablesMark Oteiza2017-09-111-0/+10
| | | | * lisp/emacs-lisp/cl-print.el (cl-print-object): New method.
* Add docstrings to cl-print entry pointsMark Oteiza2017-09-111-1/+8
| | | | | * lisp/emacs-lisp/cl-print.el (cl-print-compiled): Fix docstring. (cl-prin1, cl-prin1-to-string): Add docstrings.
* ; Fix previous commitMark Oteiza2017-09-111-1/+1
| | | | | The printer otherwise includes the 0x prefix. * lisp/emacs-lisp/cl-print.el: Add 0x to format.
* Include sxhash of object with printed bytecodeMark Oteiza2017-09-111-1/+1
| | | | | | | | 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>".
* ; * lisp/emacs-lisp/ert.el (ert-batch-backtrace-right-margin): Fix tag.Glenn Morris2017-09-051-1/+1
|