1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-17 10:06:13 +00:00
Commit Graph

139216 Commits

Author SHA1 Message Date
Mattias Engdegård
cbd439e785 Expand rx definitions inside (not ...)
* lisp/emacs-lisp/rx.el (rx--translate-not):
* test/lisp/emacs-lisp/rx-tests.el (rx-not, rx-def-in-not):
* doc/lispref/searching.texi (Rx Constructs, Extending Rx):

Allow user-defined rx constructs to be expanded inside (not ...)
forms, for better composability (bug#37849).
2019-10-27 09:54:54 +01:00
Michael Albinus
6e66d9a95c Some Tramp trace improvements
* lisp/net/tramp.el (tramp-call-process): `result' can also be nil.

* test/lisp/net/tramp-tests.el (tramp--test-timeout-handler):
Improve trace format.
2019-10-27 09:36:56 +01:00
João Távora
63fd71cd09 Improve scoring algorithm for flex-style completions
The previous algorithm had two problems: it considered non-matches in
the beginning and end of the string as matching "holes" and failed to
penalize larger holes, making flex-score-match-tightness only
effective in some corner cases.

The new formula, which is described in code and in pseudo-code in the
comments, fixes these problems.

As a result, by default, C-h f flex now correctly bubbles up
"company-search-flex-regexp" to the top, in front of "file-exists-p".
With a flex-score-match-tightness smaller than 1.0, the situation is
reversed.

* lisp/minibuffer.el (flex-score-match-tightness): Adjust default
value.  Improve docstring example.
(completion-pcm--hilit-commonality): Improve example.  Remove unused
variable.  Improve algorithm.
2019-10-27 01:46:56 +01:00
Juanma Barranquero
f4ee7c8382 minibuffer.el: Remove leftover code, unused after recent change
* lisp/minibuffer.el (completion-pcm--hilit-commonality):
Don't set point-idx.
2019-10-27 02:31:50 +02:00
Juri Linkov
c6667cc6a9 dired-dwim-target uses most recently visited window instead of next window.
* doc/emacs/dired.texi (Operating on Files): Document behavior change.

* lisp/dired-aux.el (dired-dwim-target-directories): New function.
(dired-dwim-target-directory, dired-dwim-target-defaults): Use it
to get the most recently used window instead of the next window (bug#35385).

* lisp/dired.el (dired-dwim-target): Doc fix.

* test/lisp/dired-tests.el: Remove unnecessary require and pacify
byte-compiler.
2019-10-27 02:20:15 +03:00
Juri Linkov
1660f5875c Customizable tab-line-tabs-function and new buffer-local tab-line-mode.
* lisp/tab-line.el (tab-line-tabs-function): Turn defvar into defcustom
with default of tab-line-tabs-window-buffers.
(tab-line-tabs-mode-buffers): New function.
(tab-line-tabs-window-buffers): Rename from tab-line-tabs.
(tab-line-select-tab, tab-line-switch-to-prev-tab)
(tab-line-switch-to-next-tab): Handle the value tab-line-tabs-window-buffers
of tab-line-tabs-function specially.
(tab-line-mode): Rename from global-tab-line-mode and change scope
to buffer-local.
(global-tab-line-mode): New globalized-minor-mode.
(tab-line-mode--turn-on): New function.
(tab-line-exclude-modes): New defcustom.
(tab-line-exclude): New buffer-local variable.
https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg00988.html

* lisp/dired.el (dired-mark-pop-up): Set tab-line-exclude to nil.
Don't set tab-line-format.   (Bug#37699)
* lisp/speedbar.el (speedbar-mode): Set tab-line-exclude to nil.
Don't set tab-line-format.
2019-10-27 01:38:32 +03:00
Juri Linkov
5a9a01797b * lisp/tab-bar.el (tab-bar-switch-to-recent-tab): New command.
(tab-recent): Alias to tab-bar-switch-to-recent-tab.
(tab-bar--tab-index-recent): New internal function.
(tab-bar-close-tab-select): Add new default option 'recent'.
(tab-bar-close-tab): Handle it.

* lisp/emacs-lisp/seq.el (seq-sort-by, seq-remove): Add autoload.
2019-10-27 01:16:10 +03:00
Juri Linkov
802dc5d4dc * lisp/tab-bar.el (tab-bar-move-tab-to): Add force-mode-line-update.
(tab-bar-close-last-tab-choice, tab-bar-close-tab): Adjust option names.
2019-10-27 00:57:04 +03:00
Robert Cochran
6d2ea60ca8 Add customization option for what do when the last tab is closed
* lisp/tab-bar.el (tab-bar-close-last-tab-choice): New custom
variable.
(tab-bar-close-tab): Handle closing the last tab specially, referring to
tab-bar-close-last-tab-choice.
2019-10-27 00:41:45 +03:00
Stephen Gildea
f247599e16 time-stamp-tests: add name prefix to tests of formatting
* time-stamp-tests.el: rename all the time-stamp-string formatting tests
to have the word "format" in their name, to make room in the namespace
for other, future tests.
2019-10-26 14:31:39 -07:00
João Távora
54477c6177 Restore default value of face completions-common-part
The previous commit titled "Rework face hints for partial-string
completion styles" contained a potentially controversial
backwards-incompatible change to this face's default value.

* lisp/minibuffer.el (completions-common-part): Restore empty
default value.
2019-10-26 21:47:36 +01:00
Arash Esbati
75b9f4652b Improve support for biblatex and cleveref macros
* lisp/textmodes/reftex-cite.el (reftex-figure-out-cite-format):
Extend regexp to match additional cite commands from biblatex.sty.

* lisp/textmodes/reftex-dcr.el (reftex-view-crossref): Extend
regexp to match additional cite commands from biblatex.sty and
reference commands from cleveref.sty.
2019-10-26 20:38:55 +02:00
Arash Esbati
368e88b8cb Avoid infloop's by doing a case-sensitive match
* lisp/textmodes/reftex-ref.el (reftex-format-special): Be
case-sensitive when checking the actual reference macro against
\ref.  This avoids infloop when \Ref is chosen.
2019-10-26 20:38:16 +02:00
Eli Zaretskii
5fcb8d8ba0 ; * etc/NEWS: Fix entry about map.el's 'type' argument. (Bug#37936) 2019-10-26 21:25:46 +03:00
Glenn Morris
8ea63ecdd9 Merge from origin/emacs-26
55dcd32 (origin/emacs-26) Fix rcirc not to interpret nil as nickname ...
2019-10-26 09:55:12 -07:00
Glenn Morris
045bcdb7c4 ; Merge from origin/emacs-26
The following commit was skipped:

bd0f173 Fix trig simplification crash (bug#33052)
2019-10-26 09:55:12 -07:00
Glenn Morris
6624fc4bab Merge from origin/emacs-26
73e1727 Fix linear equation system solving in Calc (bug#35374)

# Conflicts:
#	test/lisp/calc/calc-tests.el
2019-10-26 09:55:12 -07:00
Glenn Morris
3d7d926e04 ; Merge from origin/emacs-26
The following commit was skipped:

bba9757 Backport: Fix an assignment to free variable warning
2019-10-26 09:53:42 -07:00
João Távora
da0f8dbf8f Rework face hints for partial-string completion styles
Don't use completions-first-difference for the 'substring', 'flex' and
'partial-completion' styles, since there can be really no reasonable
definition of a "first" difference there.

Make completions-common-part inherit from 'underline' so that it is
useful by default for all completion styles.

* lisp/minibuffer.el (completions-common-part): Adjust
description and change default value.
(completions-first-difference): Ajust docstring.
(completion-pcm--hilit-commonality): Don't use
completions-first-difference.
2019-10-26 14:33:02 +01:00
João Távora
e21a1da8dc Allow completion styles to adjust completion metadata
This commit re-does the now-reverted commit with the same title.  That
version relied on generic functions, which cannot be used yet in files
such as lisp/minibuffer.el.  This version uses a symbol property
completion--adjust-metadata instead.

The new facility allows completion styles to have a say in metadata
properties such as cycle-sort-function and display-sort-function.
This is especially useful for completion styles such as 'flex', which
generally produce many matches, including some potentially "obscure"
ones.  The default sorting strategy would often bubble the latter to
the top of the list.

The sorting function for 'flex' considers pre-computed matching scores
and is thus much better than the default for this particular style.

Additionally, it overrides the completion table's cycle-sort-function
or display-sort-function properties if they exist, although it still
uses them to pre-sort the result, so that they are still relevant for
resolving ties.

* lisp/minibuffer.el (completion--nth-completion)
(completion--flex-adjust-metadata): New helper.
(flex): Put completion--adjust-metadata property.
2019-10-26 14:20:39 +01:00
João Távora
878ea4d840 Revert "Allow completion styles to adjust completion metadata"
Unbreaks the build.

This reverts commit 7fc0292f5c.

Unfortunately, cl-defgeneric has some problems when used in
lisp/minibuffer.el.
2019-10-26 13:45:14 +01:00
Stefan Monnier
feae2de424 subr.el (run-window-configuration-change-hook): Mark obsolete 2019-10-26 08:17:09 -04:00
João Távora
7fc0292f5c Allow completion styles to adjust completion metadata
The new facility, realized in the completion-adjust-metadata-for-style
generic, allows completion styles to have a say in metadata properties
such as cycle-sort-function and display-sort-function.  This is
especially useful for completion styles such as 'flex', which
generally produce many matches, including some potentially "obscure"
ones.  The default sorting strategy would often bubble the latter
to the top of the list.

The sorting function for 'flex' considers pre-computed matching scores
and is thus much better than the default for this particular style.

Additionally, it overrides the completion table's cycle-sort-function
or display-sort-function properties if they exist, although it still
uses them to pre-sort the result, so that they are still relevant for
resolving ties.

* lisp/minibuffer.el (completion--nth-completion): Call
completion-adjust-metadata-for-style.
(completion-adjust-metadata-for-style): New generic.
(completion-adjust-metadata-for-style 'flex): New method.
2019-10-26 13:09:52 +01:00
memeplex
e3cebbb839 Replay key if kboard is interrupted while initializing (Bug#37782)
The problem with the original fix for bug#5095 is that it drops
the current event, which is a valid character event and not -2.
Thus, the first ESC character sent by the terminal after turning
on focus tracking is lost and we get '[' and 'I' events separately
inserted into the buffer afterwards.

* src/keyboard.c (read_key_sequence): Add key as mock_input and replay
sequence using new keyboard, when the key is not -2.
2019-10-26 13:29:29 +03:00
memeplex
16372a5a04 Remove redundant initialization of fringe bitmap (Bug#37756)
* src/fringe.c (Fdefine-fringe-bitmap): Remove redundant zeroing
of fb.bits that only zeroed half of the array anyway.
2019-10-26 13:16:46 +03:00
Eli Zaretskii
c3b0950639 Improve the documentation of 'vc-tor'
* lisp/vc/vc-dispatcher.el (vc-tor): Add :version.  Enhance
the doc string.

* etc/NEWS: Announce the new option.
2019-10-26 12:57:09 +03:00
Richard Stallman
626e0a6aad New defcustom 'vc-tor'
* lisp/vc/vc-dispatcher.el (vc-tor): New user option.
(vc-do-command): If vc-tor is non-nil, use 'torsocks'.
2019-10-26 12:46:12 +03:00
Tassilo Horn
a0f7ea5999 Adapt doc-view to latest image-mode changes
The functions image-scroll-down, image-scroll-up, image-next-line, and
image-previous-line now return pixel values instead of multiples of
character height as of commit 9c66b09950.

* lisp/doc-view.el (doc-view-scroll-up-or-next-page):
(doc-view-scroll-down-or-previous-page):
(doc-view-next-line-or-next-page):
(doc-view-previous-line-or-previous-page):
(doc-view-insert-image): Adapt to image-scroll-up/down and
image-next/previous-line now returning pixel values instead of
multiples of character heights.  Fixes bug#37874.
2019-10-25 22:19:46 +02:00
Alan Mackenzie
25ed447b7b CC Mode: Fix positioning of point whilst inserting comments without non-ws
* lisp/progmodes/cc-cmds.el (c-guess-fill-prefix): When determining a new
block comment prefix (i.e. there isn't one already there to copy), and that
prefix is hard up against a comment closer, ensure there are at least two
spaces before the closer.
(c-indent-new-comment-line): Amend the strategy for ensuring that point isn't
left hard up against the comment closer after M-j.
2019-10-25 20:11:48 +00:00
Stephen Gildea
4e271a6c36 time-stamp-tests: consistently name the time vars
* time-stamp-tests.el (with-time-stamp-test-env): rename local variable
'ref-time' to 'ref-time1', for parallelism with ref-time2 and ref-time3.
2019-10-25 08:45:27 -07:00
Michael Albinus
084007a594 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2019-10-25 16:52:14 +02:00
Michael Albinus
4bcf3a5fdc Mention completion styles for Tramp user/host name completion
* doc/misc/tramp.texi (File name completion): Emacs must have one
of the completion styles `basic', `emacs21', or `emacs22'.
2019-10-25 16:45:48 +02:00
Juanma Barranquero
d56e84409d windmove.el: Suppress warnings for obsolete functions
* lisp/windmove.el (windmove-constrain-loc-for-movement)
(windmove-wrap-loc-for-movement, windmove-reference-loc)
(windmove-other-window-loc): Wrap calls to obsolete functions
in `with-suppressed-warnings'.
2019-10-25 16:39:54 +02:00
Juanma Barranquero
17db4a0a02 windmove.el: Mark unused code as obsolete
* lisp/windmove.el (windmove-window-distance-delta)
(windmove-coord-add, windmove-constrain-to-range)
(windmove-constrain-around-range, windmove-frame-edges)
(windmove-constrain-loc-for-movement)
(windmove-wrap-loc-for-movement, windmove-reference-loc)
(windmove-other-window-loc): Declare obsolete.
(windmove-find-other-window, windmove-do-window-select):
Doc fixes.

* etc/NEWS: Document it.
2019-10-25 15:42:13 +02:00
Juanma Barranquero
372c4ebf6d * lisp/windmove.el (windmove-frame-edges): Simplify. 2019-10-25 14:23:07 +02:00
Lars Ingebrigtsen
fcc427f356 Fix gnus-thread-hide-subtree defcustom
* lisp/gnus/gnus-sum.el (gnus-thread-hide-subtree): Make the
"Non-nil" predicate do what it's supposed to (i.e., return non-nil
on non-nil values (excepting predicates)) (bug#37916).
2019-10-25 12:41:36 +02:00
Stefan Monnier
f131e396f8 * lisp/cedet/mode-local.el: Clean up name space
Mostly renaming functions by adding `mode-local--` to their name
and leaving an obsolete alias behind, just in case.

(define-child-mode): Make obsolete.
(mode-local--set-parent): Rename from set-mode-local-parent.
(mode-local--new-bindings): Rename from new-mode-local-bindings.
Use `obarray-make`.
(mode-local--activate-bindings): Rename from activate-mode-local-bindings.
(mode-local--deactivate-bindings): Rename from
deactivate-mode-local-bindings.
(make-obsolete-overload): Rename properties with a `mode-local--` prefix.
Adjust all users.
(mode-local--overload-obsoleted-by): Rename from overload-obsoleted-by.
(mode-local--overload-that-obsolete): Rename from overload-that-obsolete.
(mode-local--function-overload-p): Rename from function-overload-p.
(mode-local-read-function): Mark obsolete.
(mode-local--overload-docstring-extension): Rename from
overload-docstring-extension.
(mode-local--describe-overload): Rename from describe-mode-local-overload.

* lisp/cedet/semantic/fw.el (semantic-install-function-overrides):
Remove unused `mode` argument.

* lisp/cedet/semantic/grammar-wy.el (semantic-grammar-wy--install-parser):
* lisp/cedet/semantic/bovine/grammar.el (bovine-grammar-mode):
* lisp/cedet/semantic/texi.el (semantic-default-texi-setup):
* lisp/cedet/semantic/wisent/grammar.el (wisent-grammar-setupcode-builder)
(wisent-grammar-mode):
* lisp/cedet/semantic/html.el (semantic-default-html-setup):
Make the `semantic-` prefix explicit to ease grep search.
(html-helper-mode): Remove obsolete setting.

* lisp/cedet/semantic/wisent/javascript.el: Fix js-mode/javascript-mode
mixup so we don't need define-child-mode any more.
(semantic-get-local-variables, semantic-ctxt-current-symbol)
(semantic-tag-protection, semantic-analyze-scope-calculate-access):
Use `js-mode` rather than `javascript-mode` as the mode name since
that's the real mode's name.

* lisp/cedet/semantic/wisent/python.el (python-2-mode, python-3-mode):
Remove child declaration for non-existing modes.

* lisp/cedet/srecode/map.el (srecode-map-validate-file-for-mode): Simplify.
2019-10-24 23:06:23 -04:00
Paul Eggert
4a083b0d36 Update from Gnulib
This incorporates:
2019-10-23 nstrftime: speed up integer overflow checking
2019-10-23 port better to GCC under macOS
2019-10-15 inttypes: use more-robust test for int range
2019-10-14 update-copyright: use en dashes in .texi ranges
* build-aux/update-copyright, lib/intprops.h, lib/inttypes.in.h:
* lib/nstrftime.c, lib/verify.h:
Copy from Gnulib.
2019-10-24 14:35:06 -07:00
Juanma Barranquero
57162dbc06 * doc/lispref/display.texi: Document `delay-warning' 2019-10-24 21:16:43 +02:00
Mattias Engdegård
539d0411bb rx.el: Refactor user-definition expansion
* lisp/emacs-lisp/rx.el (rx--translate-not): Simplify structure.
* lisp/emacs-lisp/rx.el (rx--expand-def): New.
(rx--translate-symbol, rx--translate-form): Use rx--expand-def.
2019-10-24 10:23:00 +02:00
Stefan Kangas
b3b74514e9 Update FAQ section on large files (Bug#37818)
* doc/misc/efaq.texi (Problems with very large files): Extend section
and remove information about ancient versions of Emacs.
2019-10-24 01:08:30 +02:00
Stefan Kangas
61223a046c Update FAQ section on Emacs security (Bug#37818)
* doc/misc/efaq.texi (Security risks with Emacs): Remove section on
movemail.  Add section on third-party packages.
2019-10-24 01:08:20 +02:00
Stefan Monnier
53e7a763dd * lisp/cedet/mode-local.el: Use lexical-binding and declare
(with-mode-local-symbol, with-mode-local, setq-mode-local)
(defvar-mode-local, defconst-mode-local)
(define-overloadable-function, define-mode-local-override):
Use `declare` for indent and edebug specs.
(xref-mode-local-find-overloadable-regexp): Simplify regexp.
(mode-local-setup-edebug-specs): Delete.
(edebug-setup-hook): Don't use any more.
2019-10-23 17:48:41 -04:00
Juri Linkov
042fd120cc * lisp/dired.el (dired-mark-pop-up): Set tab-line-format to nil (bug#37699). 2019-10-24 00:34:07 +03:00
Juri Linkov
96afd74bf8 * lisp/tab-bar.el: Allow to specify interactively where to add a new tab.
* lisp/tab-bar.el (tab-bar-new-tab-to): Rename from tab-bar-new-tab.
Add optional arg TO-INDEX.
(tab-bar-new-tab): New implementation to use relative ARG.
(tab-new-to): Alias to tab-bar-new-tab-to.
2019-10-23 23:58:30 +03:00
Juri Linkov
9f52f61be5 * lisp/tab-bar.el: Rename tab-bar-swap-tabs to tab-bar-move-tab-to.
* lisp/tab-bar.el (tab-bar-move-tab-to): Rename from tab-bar-swap-tabs.
Change logic to push the moved tab between existing tabs.
(tab-bar-move-tab): Call tab-bar-move-tab-to instead of tab-bar-swap-tabs.
(tab-move-to): Rename alias from tab-swap.
2019-10-23 23:53:08 +03:00
Juri Linkov
666686a388 Implement tab close undo feature for tab-bar.
* lisp/tab-bar.el (tab-bar-closed-tabs): New variable.
(tab-bar-close-tab): Add closed tab to tab-bar-closed-tabs.
Disable tab-bar-mode on closing the last tab.
(tab-bar-close-other-tabs): Add all closed tabs to tab-bar-closed-tabs.
(tab-bar-undo-close-tab): New command.
(tab-undo): Alias to tab-bar-undo-close-tab.
2019-10-23 23:39:31 +03:00
Stefan Monnier
72e1e30afe * lisp/cedet/semantic/analyze/complete.el: Fix completion-at-point
Completion tables are not supposed to signal errors:

    emacs -q
    M-x semantic-mode
    ; visit a file supported by semantic, such as a C file
    ; put cursor in a blank space
    M-x completion-at-point
    It will error with: "Nothing to complete"

(semantic-analyze-possible-completions): Return nil instead of
signaling errors.
2019-10-23 16:15:41 -04:00
Lars Ingebrigtsen
b7037662e1 Ensure that the prompt is kept on the final line
* lisp/erc/erc-goodies.el (erc-possibly-scroll-to-bottom): New
function.
(scrolltobottom): Add to erc-insert-done-hook.

* lisp/erc/erc.el (erc-insert-done-hook): New hook (bug#11697).
(erc-display-line-1): Use it.
2019-10-23 11:55:13 +02:00
Lars Ingebrigtsen
496202d00e Make erc-cmd-CLEAR do what its doc string says
* lisp/erc/erc.el (erc-cmd-CLEAR): Delete the buffer contents
instead of recentering (bug#31743).
2019-10-23 11:13:54 +02:00