aboutsummaryrefslogtreecommitdiffstats
path: root/lisp (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-07-08Have Python mode cooperate asynchronously with Eldocscratch/python-eldoc-asyncJoão Távora1-69/+119
When combined with Flymake mode, which also adds a value to eldoc-documentation-functions, Python-mode users can now experiment with different eldoc-documentation-strategy values. Also, this shoulda allow us to write automatic tests for this particular Eldoc functionality. * lisp/progmodes/python.el (inferior-python-mode): Set coming-preoutput-filter-functions. (python--shell-output-filter-in-progress) (python--shell-output-filter-buffer): Rename from python- variant. (python-shell-output-filter): Rework to support async operation. (python-eldoc--get-doc-at-point): Rework to support async. (python-eldoc-function): Use callback.
2020-07-08Shoosh warnings about obsolete eldoc-documentation-functionJoão Távora2-17/+12
* lisp/progmodes/cfengine.el (cfengine3-mode): Remove mention to obsolete eldoc-documentation-function. * lisp/progmodes/python.el (python-mode): Use with-no-warnings.
2020-07-08Improve Eldoc docstringsJoão Távora1-31/+87
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-strategy): Improve docstring. (eldoc--make-callback): Improve docstring. (eldoc--invoke-strategy): New helper function. (eldoc-print-current-symbol-info): Call eldoc--invoke-strategy. (eldoc-documentation-functions): Improve docstring.
2020-07-08Change version scheme of two Eldoc obsolete specsJoão Távora1-2/+2
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-function) (eldoc-message): Obsolete spec uses eldoc-1.1.0.
2020-07-08Adjust describe-char-eldoc to new eldoc-documentation-functions protocolJoão Távora1-2/+7
* lisp/descr-text.el (describe-char-eldoc): Adjust to new eldoc-documentation-functions protocol.
2020-07-08Adjust Eldoc documentation after Eli's reviewJoão Távora1-95/+106
* etc/NEWS (Eldoc): Adjust paragraphs. * lisp/emacs-lisp/eldoc.el (eldoc-prefer-doc-buffer): Adjust docstring. (eldoc--enthusiasm-curbing-timer, eldoc-documentation-strategy) (eldoc-documentation-functions): Adjust docstring. (eldoc--handle-docs): Adjust comments. (eldoc--documentation-compose-1): New helper. (eldoc-documentation-compose) (eldoc-documentation-compose-eagerly): Use it. (eldoc-print-current-symbol-info): Adjust comments.
2020-07-08Make more parts of Emacs use new Eldoc capabilitiesJoão Távora7-78/+92
Elisp-mode was doing a lot of work that can now be delegated to Eldoc. Flymake uses the new Eldoc functionality, too, installing a global documentation function that may report on diagnostics under point. CEDET's grammar.el was left as the only user of an Eldoc-internal function. That function was moved to grammar.el. That file is still, somewhat reprehensibly, using an internal function of elisp-mode.el, but this was left unchanged. In other situations, eldoc-documentation-functions is used or recommended. The only other places where the obsolete eldoc-documentation-function is still used is in libraries which are presumably meant to remain compatible with previous Emacs versions. * lisp/progmodes/elisp-mode.el (elisp-eldoc-funcall) (elisp-eldoc-var-docstring): New functions. (emacs-lisp-mode): Put two elements in eldoc-documentation-functions. * lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Setup new Elisp eldoc-documentation-functions. * lisp/progmodes/flymake.el (flymake-mode): Use flymake-eldoc-function. (flymake-eldoc-function): New function. (Package-Requires): Require eldoc 1.1.0 * lisp/descr-text.el (describe-char-eldoc): Recommend eldoc-documentation-functions. * lisp/progmodes/cfengine.el (cfengine3-documentation-function): Recommend eldoc-documentation-functions * lisp/progmodes/octave.el (inferior-octave-mode): Use eldoc-documentation-functions. * lisp/cedet/semantic/grammar.el (semantic--docstring-format-sym-doc): New function. (semantic-grammar-eldoc-get-macro-docstring): Adjust.
2020-07-08* lisp/emacs-lisp/eldoc.el (Version): Bump to 1.1.0João Távora1-1/+1
2020-07-08New M-x eldoc for on-demand and interactive documentation requestsJoão Távora1-0/+3
The function eldoc is just an alias for eldoc-print-current-symbol-info, which is made interactive. * lisp/emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): Now an interactive function. (eldoc): Alias to eldoc-print-current-symbol-info.
2020-07-08Better handle asynchronous Eldoc sourcesJoão Távora6-93/+325
This is a backward compatible redesign of significant parts of the eldoc.el library. Previously, Eldoc clients (major/minor modes setting its documentation gathering variables) needed to directly call eldoc-message, an internal function, to display the docstring to the user. When more asynchronous sources are involved, this is hard to do or even breaks down. Now, an Eldoc backend may return any non-nil, non-string value and call a callback afterwards. This restores power to Eldoc over how (and crucially also when) to display the docstrings to the user. Among other things, this fixes so called "doc blinking", or the very short-lived display of a lower priority Eldoc message. This would happen if a particular producer of documentation finishes shortly before a higher priority one, like in the LSP engine Eglot as reported by Andrii Kolomoiets <andreyk.mad@gmail.com> and Dmitry Gutov <dgutov@yandex.ru>. Gathering docstrings is now delegated to the variable eldoc-documentation-strategy, which is the new name for the now-obsolete eldoc-documentation-function, and still accepts the so-called "old protocol". Examples of the new strategies enabled are codified in functions such as eldoc-documentation-enthusiast, eldoc-documentation-compose-eagerly, along with the existing eldoc-documentation-compose and eldoc-documentation-default. The work of displaying and formatting docstrings is shifted almost fully to Eldoc itself and is delegated to the internal function eldoc--handle-docs. Among other improvements, it handles most of eldoc-echo-area-use-multiline-p and outputs documentation to a temporary *eldoc* buffer. The manual and NEWS are updated to mention the new Eldoc features. * lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions): Overhaul docstring. (eldoc-documentation-compose, eldoc-documentation-default): Handle non-nil, non-string values of elements of eldoc-documentation-functions. Use eldoc--handle-multiline. (eldoc-print-current-symbol-info): Honour non-nil, non-string values returned by eldoc-documentation-callback. (eldoc--make-callback): Now also a function. (eldoc-documentation-default, eldoc-documentation-compose): Tweak docstring. (eldoc-documentation-enthusiast, eldoc-documentation-compose-eagerly): New functions. (eldoc-echo-area-use-multiline-p): Add new semantics. (eldoc--handle-docs): Handle some of eldoc-echo-area-use-multiline-p. (eldoc-doc-buffer): New command. (eldoc-prefer-doc-buffer): New defcustom. (eldoc--enthusiasm-curbing-timer): New variable. (eldoc-documentation-strategy): Rename from eldoc-documentation-function. (eldoc--supported-p): Use eldoc-documentation-strategy (eldoc-highlight-function-argument) (eldoc-argument-case, global-eldoc-mode) (turn-on-eldoc-mode): Mention eldoc-documentation-strategy. (eldoc-message-function): Mention eldoc--message. (eldoc-message): Made obsolete. (eldoc--message): New helper. * lisp/hexl.el (hexl-print-current-point-info): Adjust to new eldoc-documentation-functions protocol. * lisp/progmodes/cfengine.el (cfengine3-documentation-function): Adjust to new eldoc-documentation-functions protocol. * lisp/progmodes/elisp-mode.el (elisp-eldoc-documentation-function): Adjust to new eldoc-documentation-functions protocol. * lisp/progmodes/octave.el (octave-eldoc-function): Adjust to new eldoc-documentation-functions protocol. * lisp/progmodes/python.el (python-eldoc-function): Adjust to new eldoc-documentation-functions protocol. (eldoc-print-current-symbol-info): Rework with cl-labels. * doc/emacs/programs.texi (Lisp Doc): Mention eldoc-documentation-strategy. * doc/lispref/modes.texi (Major Mode Conventions): Mention eldoc-documentation-functions. * etc/NEWS: Mention eldoc-documentation-strategy.
2020-07-07Optimise assoc and rassoc with symbol key to assq and rassqMattias Engdegård1-0/+11
This is the same transformation made for member to memq. * lisp/emacs-lisp/byte-opt.el (byte-optimize-assoc): New function. (assoc, rassoc): Set the byte-optimizer property.
2020-07-06* lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add `keyword`Stefan Monnier1-10/+16
2020-07-06Simplify byte-code optimisation of pure functionsMattias Engdegård1-43/+14
Most pure functions need no explicit optimisation; we can do away with almost all uses of byte-optimize-predicate (now renamed to byte-optimize-constant-args, since it is not just for predicates). Also remove some superfluous arity warnings. * lisp/emacs-lisp/byte-opt.el (byte-optimize-identity, byte-optimize-memq) (byte-optimize-nth, byte-optimize-nthcdr): Remove arity warnings and simplify. * lisp/emacs-lisp/byte-opt.el (<, >, <=, >=, not, null, consp, listp) (symbolp, stringp, string<, string-lessp, proper-list-p, logand) (logior, logxor, lognot, car, cdr, car-safe, cdr-safe): Remove superfluous byte-optimizer property. (byte-optimize-predicate): Rename to byte-optimize-constant-args. All uses changed.
2020-07-06Mark more functions pure (bug#42147)Mattias Engdegård1-7/+42
Extend the list of 'pure' functions to many predicates and numerical functions that we are reasonably confident will give portable results. Also include various list and array accessors, because our use of purity in the byte compiler isn't affected by the mutability of arguments. * lisp/emacs-lisp/byte-opt.el: Update example in comment. (pure-fns): Add many functions. (byte-optimize-form-code-walker) Don't signal errors during evaluation of calls to pure functions with constant arguments at compile time, since such calls are not necessarily reachable.
2020-07-06; Revert "; Add a note about a bottleneck"Dmitry Gutov1-2/+0
This reverts commit 9f9ce631a2ff44ebcb87b0b1390a21b13665db43. It's still a bottleneck, but so are mapcar (with its effect on GC) and concat. So our limits show in several places at once.
2020-07-06; Add a note about a bottleneckDmitry Gutov1-0/+2
2020-07-06* lisp/progmodes/project.el: Bump the version.Dmitry Gutov1-1/+1
2020-07-06; Add a couple of FIXMEsDmitry Gutov1-1/+4
2020-07-06project-switch-to-buffer: Don't filter based on default-directoryDmitry Gutov1-13/+11
* lisp/progmodes/project.el (project-switch-to-buffer): Don't filter based on default-directory (https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00075.html). (project-switch-to-buffer): Ditto.
2020-07-05Verilog-Mode collected updates.Wilson Snyder1-36/+76
* lisp/progmodes/verilog-mode.el (verilog-auto-inst): Support regexp of what AUTOINST I/O to include, issue #1682. Reported by Mrainy. (verilog-font-lock-keywords-1): Fix highlighting module names with no following (, issue #1679. Reported by Vinam Arora. (verilog-font-lock-keywords) Adds syntax highlighting for identifiers in declaration statements, #1678. (verilog-calculate-indent, verilog-inject-arg) (verilog-keywords, verilog-showscopes): Support AMS connectmodule/endconnectmodule, #1665. Reported by Dan McMahill.
2020-07-05Relax portable number check in byte compiler (bug#42147)Mattias Engdegård1-30/+9
With bignums, the set of representable integers is no longer platform-dependent, and since we use nothing but IEEE754 64-bit floats, all numbers are now portable. Take advantage of this fact to simplify constant-folding in the byte compiler, allowing it to be applied more widely. * lisp/emacs-lisp/byte-opt.el (byte-opt--portable-max) (byte-opt--portable-min, byte-opt--portable-numberp): Remove. (byte-opt--arith-reduce, byte-optimize-minus, byte-optimize-1+) (byte-optimize-1-): Simplify: any number will do, and if N is a number, then so are -N, N+1 and N-1.
2020-07-04Remove long obsolete c-looking-at-bos. Make c-at-expression-start-p obsoleteAlan Mackenzie1-11/+1
* lisp/progmodes/cc-engine.el (c-looking-at-bos): Remove. (c-at-expression-start-p): Make obsolete, with no alternative function.
2020-07-04Fix filling in js-mode and mhtml-mode (js-mode parts), fixing bug #41897Alan Mackenzie2-13/+26
* lisp/progmodes/js.el (js-mode): Use "\\(?:" in the value of comment-start-skip rather than "\\(", fixing the second half of bug #41952. Call c-foreign-init-lit-pos-cache and install c-foreign-truncate-lit-pos-cache on before-change-functions, to connect up correctly with CC Mode's filling mechanism. * lisp/textmodes/mhtml-mode.el (mhtml--crucial-variable-prefix): Add prefixes "adaptive-fill-", "fill-", "normal-auto-fill-function" and "paragraph-" to pull in variables crucial to filling. (mhtml-syntax-propertize): Read the current submode from the piece of text being propertized rather than one character before it, and do so before erasing the submode text-property. (mhtml-mode): Set the js-mode value of auto-fill-function to js-do-auto-fill. Correctly initialize and use CC Mode's filling facilities, as above.
2020-07-04CC Mode: Fix wrong value of comment-start-skip, fixing half of bug #41952Alan Mackenzie2-1/+19
Also add functions to enable correct use of CC Mode's filling functionality from major modes which don't initialize CC Mode fully. These modes are currently js-mode and mhtml-mode. * lisp/progmodes/cc-langs.el (comment-start-skip): Replace "\\(" by "\\(?:" so that (match-end 1) isn't falsely taken to be the start of the comment. * lisp/progmodes/cc-engine.el (c-foreign-truncate-lit-pos-cache) (c-foreign-init-lit-pos-cache): New functions.
2020-07-04Use 'emacs-lisp-mode-syntax-table' for reading Lisp expressionsDaniel Koning1-2/+5
* lisp/simple.el (read--expression): Set syntax table to 'emacs-lisp-mode-syntax-table' when reading a Lisp expression from the minibuffer. (Bug#41781) Copyright-paperwork-exempt: yes
2020-07-02* lisp/progmodes/cc-mode.el (c-or-c++-mode--regexp): Change WS to [ \t] in itAlan Mackenzie1-1/+1
2020-07-02Revert feature added in bfd96e995d using project directories in vc (bug#41821)Juri Linkov3-10/+3
2020-07-01; Auto-commit of loaddefs files.Glenn Morris1-16/+111
2020-07-01; Auto-commit of loaddefs files.Glenn Morris1-0/+4
2020-07-01Bind 'C-x 4 1' to 'same-window-prefix' and document new commands (bug#41691)Juri Linkov1-0/+1
* lisp/window.el (ctl-x-4-map): Bind 'C-x 4 1' to 'same-window-prefix'. * doc/emacs/windows.texi (Pop Up Window): Add 'C-x 4 4' and 'C-x 4 1'. * doc/emacs/frames.texi (Creating Frames): Add 'C-x 5 5'. (Tab Bars): Add 'C-x t t'.
2020-06-30Subject: Frame-local tab-bar for numeric value of tab-bar-show (bug#42052)James N. V. Cash1-12/+17
* lisp/tab-bar.el (tab-bar-new-tab-to): Set frame parameter tab-bar-lines to 1 when tab-bar-show is the same as number of tabs. (tab-bar-close-tab, tab-bar-close-other-tabs): Set frame parameter tab-bar-lines to 0 when tab-bar-show is the same as number of tabs. Copyright-paperwork-exempt: yes
2020-06-29CC Mode: optimize for repeated simple operations.Alan Mackenzie3-169/+183
Do this by recognising that unterminated strings in a buffer are typically going to be few and close together. Also optimize code for C++ attributes. * lisp/progmodes/cc-defs.el (c-previous-single-property-change): New macro. (c-put-syn-tab, c-clear-syn-tab): Turned from macros into functions, and moved to cc-mode.el. (c-clear-syn-tab-properties): Amended to use c-min/max-syn-tab-mkr. (c-with-extended-string-fences): Removed. * lisp/progmodes/cc-engine-el (c-enclosing-c++-attribute): Rewritten for speed. (c-slow-enclosing-c++-attribute): Removed. (c-semi-pp-to-literal): Remove a superfluous call to c-with-extended-string-fences. * lisp/progmodes/cc-mode.el (c-min-syn-tab-mkr, c-max-syn-tab-mkr): two new marker variables which bound the region occupied by positions with c-fl-syn-tab text properties. (c-basic-common-init): Initialize these two variables. (c-fl-syn-tab-region): Removed. (c-put-syn-tab, c-clear-syn-tab): Functions moved from cc-defs.el. (c-clear-string-fences): Amended to use the new scheme. (c-restore-string-fences): Now takes no arguments; amended to use the new scheme. (c-font-lock-fontify-region): Amended to use the new scheme.
2020-06-28Fix ACTION argument of 'display-buffer' call in gud.elRichard Kim1-3/+3
* lisp/progmodes/gud.el (gud-common-init): The ACTION argument of 'display-buffer' should be a list of list of functions. (Bug#41888)
2020-06-27Improve do string of 'man'Eli Zaretskii1-1/+5
* lisp/man.el (man): Mention the need to use C-q for quoting the SPC character in the man-page input. (Bug#41859)
2020-06-26; Fix recent indentation in project.elBasil L. Contovounesios1-9/+8
* lisp/progmodes/project.el (project-ignores, project-find-file-in) (project-eshell, project--read-project-list): Fix indentation.
2020-06-26Improve documentation of Info node movement commandsEli Zaretskii1-4/+14
* lisp/info.el (Info-next, Info-prev, Info-forward-node) (Info-backward-node): More detailed descriptions of what each commands does with respect to child and parent nodes. (Bug#42050)
2020-06-26Fix byte-compilation warning in project.elEli Zaretskii1-0/+1
* lisp/emacs-lisp/seq.el (seq-every-p): Autoload it. This fixes byte-compilation warning in project.el.
2020-06-26vc-known-roots: Actually updateDmitry Gutov1-1/+1
* lisp/vc/vc-hooks.el (vc-known-roots): Actually update for the change in 733921edfe (bug#41821).
2020-06-26project--read-project-list: Add structure verificationDmitry Gutov1-2/+10
* lisp/progmodes/project.el (project--list): Update docstring. (project--read-project-list): Add structure verification.
2020-06-26project-known-roots: Rename and improveDmitry Gutov1-3/+3
* lisp/progmodes/project.el (project-known-project-roots): Rename from 'project-known-roots'. Update the docstring. Make sure the returned value is a list of strings. Update the caller (bug#41821).
2020-06-26Rename project-kill-buffers-{skip-conditions,ignores}Dmitry Gutov1-4/+5
* lisp/progmodes/project.el (project-kill-buffers-ignores): Rename from project-kill-buffers-skip-conditions (bug#41868). Update both references. Add a :package-version attribute.
2020-06-25Fix last changeEli Zaretskii1-2/+3
* lisp/menu-bar.el (menu-bar-describe-menu): Improve the wording and the help-echo of the new list-recent-keystrokes Help menu item. (Bug#41933) * etc/NEWS: Call out the new menu item.
2020-06-25Add help menu entry for view-lossageTino Calancha1-0/+3
* lisp/menu-bar.el (menu-bar-describe-menu): Add an entry for view-lossage (Bug#41933).
2020-06-25CC Mode. Fix an off by one error. Fixes bug #41809Alan Mackenzie1-2/+2
* lisp/progmodes/cc-engine.el (c-full-pp-to-literal): Change > to >= (twice).
2020-06-25Push action to list of functions in display-buffer-override-next-commandJuri Linkov1-3/+3
* lisp/window.el (display-buffer-override-next-command): Push action to 'car' of 'display-buffer-overriding-action' and in exitfun remove action from 'car'. https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00803.html
2020-06-24Make switch work in AWK Mode. Fixes bug #41923Alan Mackenzie1-3/+2
lisp/progmodes/cc-langs.el (c-block-stmt-2-kwds): Insert "switch" into the AWK Mode entry. (c-case-kwds): Remove the special entry for AWK Mode.
2020-06-24M-n in read-directory-name of vc commands gets project dirs (bug#41821)Juri Linkov4-3/+16
* lisp/progmodes/project.el (project-known-roots): New autoloaded function. * lisp/vc/vc-hooks.el (vc-known-roots): New function. * lisp/vc/vc.el (vc-root-diff, vc-print-root-log): * lisp/vc/vc-dir.el (vc-dir): Use 'vc-known-roots' for default values for read-directory-name.
2020-06-24More not-state-changing vc commands can be used from non-file buffersJuri Linkov1-3/+1
* lisp/vc/vc.el (vc-deduce-fileset): Instead of checking for log-view-mode, check for '(not buffer-file-name)' before trying to get the backend for default-directory. Remove the branch that checks for '(not buffer-file-name)' and signals the error because vc-responsible-backend used in previous condition already signals its error. (Bug#41974)
2020-06-23Fix problem in tramp-smb.elMichael Albinus1-2/+2
* lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Use `directory-file-name'. * test/lisp/net/tramp-tests.el (trace): Require it. (tramp--test-instrument-test-case): Print also function traces. (tramp--test-smb-p): New defun. (tramp-test03-file-name-method-rules) (tramp-test05-expand-file-name-relative) (tramp-test21-file-links, tramp--test-windows-nt-or-smb-p) (tramp--test-check-files): Use it.
2020-06-23; Fix indentation in last changeBasil L. Contovounesios1-2/+1
* lisp/gnus/gnus-cloud.el (gnus-cloud-download-data): Reindent first argument of prog1.