aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Have Python mode cooperate asynchronously with Eldocscratch/python-eldoc-asyncJoão Távora2020-07-081-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.
* Shoosh warnings about obsolete eldoc-documentation-functionJoão Távora2020-07-082-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.
* Make more parts of Emacs use new Eldoc capabilitiesJoão Távora2020-07-084-37/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Better handle asynchronous Eldoc sourcesJoão Távora2020-07-084-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge from origin/emacs-27Glenn Morris2020-07-071-3/+3
|\ | | | | | | | | | | | | | | 59e768d64a Fix undefined behavior in json.c (Bug#42113) cce00bef03 Fix ACTION argument of 'display-buffer' call in gud.el 0121db2702 * src/keyboard.c (Fclear_this_command_keys): Doc fix. b9abf5ceb2 Improve do string of 'man' b87fc938a0 ; * src/xdisp.c (pos_visible_p): Yet another minor fix for...
| * Fix ACTION argument of 'display-buffer' call in gud.elRichard Kim2020-06-281-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)
* | ; Revert "; Add a note about a bottleneck"Dmitry Gutov2020-07-061-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.
* | ; Add a note about a bottleneckDmitry Gutov2020-07-061-0/+2
| |
* | * lisp/progmodes/project.el: Bump the version.Dmitry Gutov2020-07-061-1/+1
| |
* | ; Add a couple of FIXMEsDmitry Gutov2020-07-061-1/+4
| |
* | project-switch-to-buffer: Don't filter based on default-directoryDmitry Gutov2020-07-061-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.
* | Verilog-Mode collected updates.Wilson Snyder2020-07-051-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.
* | Remove long obsolete c-looking-at-bos. Make c-at-expression-start-p obsoleteAlan Mackenzie2020-07-041-11/+1
| | | | | | | | | | * lisp/progmodes/cc-engine.el (c-looking-at-bos): Remove. (c-at-expression-start-p): Make obsolete, with no alternative function.
* | Fix filling in js-mode and mhtml-mode (js-mode parts), fixing bug #41897Alan Mackenzie2020-07-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | CC Mode: Fix wrong value of comment-start-skip, fixing half of bug #41952Alan Mackenzie2020-07-042-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.
* | * lisp/progmodes/cc-mode.el (c-or-c++-mode--regexp): Change WS to [ \t] in itAlan Mackenzie2020-07-021-1/+1
| |
* | CC Mode: optimize for repeated simple operations.Alan Mackenzie2020-06-293-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.
* | ; Fix recent indentation in project.elBasil L. Contovounesios2020-06-261-9/+8
| | | | | | | | | | * lisp/progmodes/project.el (project-ignores, project-find-file-in) (project-eshell, project--read-project-list): Fix indentation.
* | project--read-project-list: Add structure verificationDmitry Gutov2020-06-261-2/+10
| | | | | | | | | | * lisp/progmodes/project.el (project--list): Update docstring. (project--read-project-list): Add structure verification.
* | project-known-roots: Rename and improveDmitry Gutov2020-06-261-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).
* | Rename project-kill-buffers-{skip-conditions,ignores}Dmitry Gutov2020-06-261-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.
* | CC Mode. Fix an off by one error. Fixes bug #41809Alan Mackenzie2020-06-251-2/+2
| | | | | | | | * lisp/progmodes/cc-engine.el (c-full-pp-to-literal): Change > to >= (twice).
* | Make switch work in AWK Mode. Fixes bug #41923Alan Mackenzie2020-06-241-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.
* | M-n in read-directory-name of vc commands gets project dirs (bug#41821)Juri Linkov2020-06-241-0/+6
| | | | | | | | | | | | | | | | | | | | * 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.
* | project-switch-to-buffer: Improve Ido compatibilityDmitry Gutov2020-06-221-1/+2
| | | | | | | | | | * lisp/progmodes/project.el (project-switch-to-buffer): Check that the entry contains a non-nil CDR.
* | project-switch-to-buffer: Do not require matching inputDmitry Gutov2020-06-221-1/+1
| | | | | | | | | | | | * lisp/progmodes/project.el (project-switch-to-buffer): Do not require matching input, to allow creating buffers as well (bug#41879).
* | Fix spurious error in beginning-of-defun in pascal-mode (bug#41740)Mattias Engdegård2020-06-221-1/+1
| | | | | | | | | | | | * lisp/progmodes/pascal.el (pascal-beg-of-defun): Ignore errors in forward-sexp. * test/lisp/progmodes/pascal-tests.el (pascal-beg-of-defun): New test.
* | Preserve point in pascal-mode completion (bug#41740)Mattias Engdegård2020-06-221-24/+27
| | | | | | | | | | | | | | | | | | Failure to do so caused errors in several cases. Reported by Shinichi Sakata. * lisp/progmodes/pascal.el (pascal-type-completion) (pascal-completion): Wrap code that may move point in save-excursion. * test/lisp/progmodes/pascal-tests.el: New file.
* | Forward declare eshell-buffer-name in project-eshellTheodor Thornhill2020-06-221-0/+1
| | | | | | | | | | * lisp/progmodes/project.el: Forward declare 'eshell-buffer-name' so that 'project-eshell' can use dynamically scoping with it.
* | ; project-shell, project-eshell: Doc fixesDmitry Gutov2020-06-221-2/+2
| |
* | Improve doc strings of 'project-shell' and 'project-eshell'Eli Zaretskii2020-06-211-8/+8
| | | | | | | | | | * lisp/progmodes/project.el (project-shell, project-eshell): Doc fixes.
* | Replace some uses of cl-mapcan with mapcanBasil L. Contovounesios2020-06-212-5/+5
| | | | | | | | | | | | | | | | | | * lisp/progmodes/project.el (project-files, project-files): * lisp/progmodes/xref.el (xref-backend-references) (xref--convert-hits): * test/lisp/emacs-lisp/package-tests.el (package-test-strip-version): Replace cl-mapcan with equivalent calls to mapcan.
* | Evaluate some unnecessarily quoted lambdasBasil L. Contovounesios2020-06-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/cedet/semantic/complete.el (semantic-displayer-tooltip-max-tags): * lisp/emacs-lisp/benchmark.el (benchmark-run-compiled): * lisp/emacs-lisp/package.el (package--default-summary) (package-menu-filter-by-version): * lisp/eshell/em-pred.el (eshell-pred-file-time): * lisp/progmodes/verilog-mode.el (verilog-auto-lineup) (verilog-auto-reset-widths, verilog-auto-arg-format) (verilog-auto-inst-vector, verilog-auto-inst-template-numbers): * lisp/textmodes/bibtex.el (bibtex-dialect): * test/lisp/autoinsert-tests.el (autoinsert-tests-define-auto-insert-before) (autoinsert-tests-define-auto-insert-after): Remove some unnecessary quoting around anonymous functions.
* | ; project-shell, project-eshell: Docstring tweaksDmitry Gutov2020-06-211-6/+8
| |
* | Pop to an existing Eshell buffer by defaultTheodor Thornhill2020-06-211-5/+17
| | | | | | | | | | | | | | | | | | | | * lisp/progmodes/project.el (project-shell): Improve docstring to include information about an implementation detail. * list/progmodes/project.el (project-eshell): Modelled after 'project-shell', change default behavior such that we don't create too many eshell buffers by default. Use universal argument to create subsequent buffers.
* | Fix last change for bug#41619Eli Zaretskii2020-06-201-1/+0
| | | | | | | | | | * lisp/progmodes/python.el (python-shell-virtualenv-root): Fix last change. (Bug#41619)
* | project-shell: Pop to an existing shell buffer by defaultTheodor Thornhill2020-06-201-4/+13
| | | | | | | | | | | | | | | | * lisp/progmodes/project.el (project-shell): Pop to an existing shell buffer by default. If there's none, or if universal argument is used, open a subsequent shell buffer and jump to it. Prefix shell buffer name with the base name of project root directory. (Bug#41858)
* | Fix last change in doc strings of project.elEli Zaretskii2020-06-191-1/+3
| | | | | | | | | | * lisp/progmodes/project.el (project-switch-to-buffer): More accurate doc string.
* | Improve doc strings of project.elEli Zaretskii2020-06-191-22/+23
| | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/project.el (project-dired, project-shell) (project-eshell, project-switch-to-buffer, project-kill-buffers) (project-list-file, project--read-project-list) (project--ensure-read-project-list, project--write-project-list) (project--add-to-project-list-front) (project--remove-from-project-list, project-prompt-project-dir) (project-switch-commands, project-switch-project): Fix wording and formatting of doc strings.
* | project-switch-to-buffer: Use the "other buffer" as defaultAndrii Kolomoiets2020-06-191-6/+16
| | | | | | | | | | | | * lisp/progmodes/project.el (project-switch-to-buffer): Pass the "other buffer" as DEF to read-buffer if it belongs to the current project (bug#41879).
* | Add binding for project-kill-buffersDmitry Gutov2020-06-181-0/+1
| | | | | | | | | | * lisp/progmodes/project.el (project-prefix-map): Add binding for project-kill-buffers (bug#41868).
* | ;Fix error in commit dcdf6d7124Tassilo Horn2020-06-181-14/+14
| |
* | Make bug-reference auto-setup work in vc-dir or Magit like modesTassilo Horn2020-06-181-2/+5
| | | | | | | | | | | | * lisp/progmodes/bug-reference.el (bug-reference-try-setup-from-vc): Use default-directory if not in a file-visiting buffer to determine VC URL.
* | New command: project-kill-buffersPhilip K2020-06-181-0/+41
| | | | | | | | | | | | | | * lisp/progmodes/project.el (project-kill-buffers-skip-conditions): New variable. (project--buffer-list): New function. (project-kill-buffers): New command (bug#41868).
* | ; Add a heading and a bindingDmitry Gutov2020-06-181-0/+4
| |
* | New command: project-switch-to-bufferTheodor Thornhill2020-06-181-0/+13
| | | | | | | | * lisp/progmodes/project.el (project-switch-to-buffer): New command.
* | Add global bindings for project commandsTheodor Thornhill2020-06-181-0/+17
| | | | | | | | | | | | * lisp/progmodes/project.el (project-prefix-map): New variable. Add the new keymap to ctl-x-map.
* | Fix setting project-vc-merge-submodules via .dir-locals.elDmitry Gutov2020-06-181-14/+20
| | | | | | | | | | | | * lisp/progmodes/project.el (project--vc-merge-submodules-p): New function. (project-try-vc, project--vc-list-files): Use it.
* | Auto-setup for bug-reference-modeTassilo Horn2020-06-171-0/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tries to guess suitable bug-reference-bug-regexp and bug-reference-url-format values based on version control URL (in file buffers) and mail information (in Gnus summary and article buffers). * lisp/progmodes/bug-reference.el (bug-reference--maybe-setup-from-vc): New defun. (bug-reference-setup-from-vc-alist): New defvar defining setup rules based on version control URL. (bug-reference-try-setup-from-vc): New defun using above defvar. (bug-reference--maybe-setup-from-mail): New defun. (bug-reference-setup-from-mail-alist): New defvar defining setup rules based on mail/newsgroups and header values. (bug-reference-try-setup-from-gnus): New defun using above defvar. (bug-reference--try-setup-gnus-article): New defun. (bug-reference--run-auto-setup): New defun. (bug-reference-mode): Call bug-reference--run-auto-setup as :after-hook. (bug-reference-prog-mode): Call bug-reference--run-auto-setup as :after-hook.
* | Bump the project.el package versionDmitry Gutov2020-06-171-2/+1
| | | | | | | | * lisp/progmodes/project.el: Bump the package version.