1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00
Commit Graph

74767 Commits

Author SHA1 Message Date
Braun Gábor
c9ede465de Make clone-buffer not unbind global variable
* lisp/simple.el (clone-buffer): Make clone-buffer not globally
unset locally void variable (bug#38179).

Copyright-paperwork-exempt: yes
2019-11-14 06:45:37 +01:00
Lars Ingebrigtsen
3591cb8dcc Make dired-do-compress-to require format-spec
* lisp/dired-aux.el (dired-do-compress-to): Require format-spec
runtime (bug#38189).
2019-11-14 06:31:50 +01:00
Lars Ingebrigtsen
d9ea77af4c Allow using edebug-remove-instrumentation more fine-grained
* lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation):
Prompt the user for what functions to remove instrumentation from
a la cancel-edebug-on-entry (bug#38195).
2019-11-14 06:20:04 +01:00
Stephen Gildea
1d189843bb time-stamp: update support for time zone numeric offset
* time-stamp.el (time-stamp-string-preprocess): Change new format for
numeric time zone from %:z to %5z to match format-time-string better.
(time-stamp-format): Document support for numeric time zone.
See discussion in bug#32931.

* NEWS: Mention time-stamp-format %5z.
2019-11-13 21:11:28 -08:00
Katsumi Yamaoka
3ecbfefa72 Don't show Attachment(s) header in html article viewed with browse-url
* lisp/gnus/gnus-art.el (gnus-article-browse-html-article):
Bind gnus-mime-display-attachment-buttons-in-header to nil.
2019-11-14 02:24:26 +00:00
Juri Linkov
ea73c66423 * lisp/tab-line.el (tab-line-tabs-buffer-list): Use window-prev-buffers too.
* lisp/tab-line.el (tab-line-tabs-buffer-list): Move window-prev-buffers here
from tab-line-tabs-buffer-groups.
2019-11-14 00:09:06 +02:00
Michael Albinus
65fb04801c Finish last Tramp patch
* lisp/net/tramp.el (outline-regexp): Remove declaration.
(tramp-debug-outline-regexp): Add thread regexp.
(tramp-debug-font-lock-keywords): New defconst.
(tramp-debug-outline-level): Adapt to changed
`tramp-debug-outline-regexp'.
(tramp-get-debug-buffer): Use `tramp-debug-font-lock-keywords'.
2019-11-13 15:55:35 +01:00
Michael Albinus
3b88ab1a50 Some refinement in Tramp debug buffer.
* lisp/net/tramp.el (outline-regexp): Remove declaration.
(tramp-debug-font-lock-keywords): New defconst.
(tramp-get-debug-buffer): Use it.
2019-11-13 14:53:43 +01:00
Michael Albinus
d3438460ef Adapt Tramp docstrings according to checkdoc
* lisp/net/tramp.el (tramp-backup-directory-alist)
(tramp-echoed-echo-mark-regexp, tramp-syntax-values)
(tramp-lookup-syntax, tramp-build-prefix-format)
(tramp-build-prefix-regexp, tramp-build-method-regexp)
(tramp-build-postfix-method-format)
(tramp-build-postfix-method-regexp)
(tramp-build-prefix-ipv6-format, tramp-build-prefix-ipv6-regexp)
(tramp-build-postfix-ipv6-format)
(tramp-build-postfix-ipv6-regexp)
(tramp-build-postfix-host-format)
(tramp-build-postfix-host-regexp, tramp-unknown-id-string)
(tramp-unknown-id-integer, tramp-build-file-name-regexp)
(tramp-build-completion-file-name-regexp, tramp-chunksize)
(tramp-find-method, tramp-find-user, tramp-find-host)
(tramp-dissect-file-name, tramp-get-buffer)
(tramp-get-connection-buffer, tramp-debug-message, tramp-error)
(with-tramp-connection-property, tramp-run-real-handler)
(tramp-file-name-for-operation, tramp-file-name-handler)
(tramp-completion-file-name-handler)
(tramp-completion-handle-file-name-completion)
(tramp-completion-dissect-file-name)
(tramp-completion-dissect-file-name1)
(tramp-handle-file-name-as-directory)
(tramp-handle-file-name-directory)
(tramp-handle-file-name-nondirectory, tramp-mode-string-to-int)
(tramp-file-mode-from-int):
* lisp/net/tramp-adb.el (tramp-adb-file-name-p):
* lisp/net/tramp-archive.el (tramp-archive-run-real-handler)
(tramp-archive-file-name-handler)
(tramp-archive-dissect-file-name)
(with-parsed-tramp-archive-file-name)
(tramp-archive-gvfs-file-name, tramp-archive-handle-access-file):
* lisp/net/tramp-cmds.el (tramp-list-remote-buffers):
* lisp/net/tramp-compat.el (tramp-unload-file-name-handlers)
(tramp-compat-funcall, tramp-compat-tramp-file-name-slots):
* lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler)
(tramp-ftp-file-name-p):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-p)
(tramp-gvfs-file-name-handler)
(tramp-gvfs-stringify-dbus-message)
(tramp-gvfs-monitor-process-filter)
(tramp-gvfs-handler-mounted-unmounted):
* lisp/net/tramp-integration.el
(tramp-rfn-eshadow-update-overlay-regexp):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-p)
(tramp-rclone-file-name-handler, tramp-rclone-send-command):
* lisp/net/tramp-sh.el (tramp-sh--quoting-style-options)
(tramp-sh-gio-monitor-process-filter)
(tramp-sh-gvfs-monitor-dir-process-filter)
(tramp-sh-inotifywait-process-filter, tramp-find-executable)
(tramp-set-remote-path, tramp-open-shell, tramp-find-shell)
(tramp-send-command-and-check, tramp-shell-case-fold)
(tramp-get-remote-path):
* lisp/net/tramp-smb.el (tramp-smb-file-name-p)
(tramp-smb-file-name-handler)
(tramp-smb-do-file-attributes-with-stat)
(tramp-smb-handle-substitute-in-file-name)
(tramp-smb-get-stat-capability, tramp-smb-shell-quote-argument):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-p)
(tramp-sudoedit-file-name-handler)
(tramp-sudoedit-send-command-string):
* test/lisp/net/tramp-archive-tests.el (tramp-archive-test-all):
* test/lisp/net/tramp-tests.el (tramp--test-gvfs-p)
(tramp--test-with-proper-process-name-and-buffer)
(tramp-test-all): Adapt docstrings according to `checkdoc'.
2019-11-13 13:10:58 +01:00
João Távora
bf7debec3b Avoid fido-mode's setup on non-icomplete minibuffers
Otherwise we would lose things like C-r (isearch-backward) when doing
simple stuff like non-icomplete pp-eval-expression.

* lisp/icomplete.el (icomplete--fido-mode-setup): Restrict setup
to when icomplete-mode really kicks in.
2019-11-13 09:49:47 +00:00
Juri Linkov
0a492e4dfa * lisp/tab-line.el (tab-line-tabs-buffer-list-function): New variable.
(tab-line-tabs-buffer-list): New function.
(tab-line-tabs-mode-buffers, tab-line-tabs-buffer-groups):
Call tab-line-tabs-mode-buffers.
(tab-line-tabs-buffer-groups): Add 'close' function that uses
kill-buffer instead of bury-buffer that makes no sense here.
(tab-line-format): Don't show the close button when a tab
has no 'close' function or buffer.
(tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab):
Support tabs with 'buffer' properties.
(tab-line-close-tab): Call 'close' function when defined.
2019-11-12 23:31:12 +02:00
Juri Linkov
d0351f4d20 * lisp/dired.el (dired-dwim-target): Add new choices (bug#35385)
* lisp/dired.el (dired-dwim-target): Add choices
dired-dwim-target-next and dired-dwim-target-recent.

* lisp/dired-aux.el (dired-dwim-target-next)
(dired-dwim-target-recent): New functions.
(dired-dwim-target-directories): Call either of them.

* doc/emacs/dired.texi (Operating on Files): Mention new
preferences in dired-dwim-target.
2019-11-12 23:21:14 +02:00
Stefan Monnier
6eaf62df20 * lisp/emacs-lisp/easymenu.el (easy-menu-make-symbol): Fix last change 2019-11-12 08:39:18 -05:00
Paul Eggert
555f5f78f8 Fix a few more minor quoting problems. 2019-11-11 22:54:41 -08:00
Lars Ingebrigtsen
c5fd4d373e Rename font-log-refontify
* lisp/font-lock.el (font-lock-debug-fontify): Rename to make it
clearer what the function is for.
* doc/lispref/modes.texi (Font Lock Basics): Ditto.
2019-11-12 03:40:29 +01:00
Stefan Monnier
96828581d9 * lisp/startup.el (command-line): Fix last change in package--activated 2019-11-11 17:14:30 -05:00
Paul Eggert
6b4a97c1c7 Fix some quoting glitches in doc strings 2019-11-11 10:32:53 -08:00
Paul Eggert
269796288a Fix quoting glitch in formatting Gnus messages
* lisp/gnus/gnus-util.el (defmacro, gnus-message): Use
‘format-message’, not ‘format’, to be compatible with ‘message’.
2019-11-11 10:32:52 -08:00
Paul Eggert
72729014fc Fix glitch in generating cxterm doc strings
* lisp/international/titdic-cnv.el (tit-process-header):
In generated doc strings, escape \, ", ', and ` properly.
Currently only ' appears but we might as well future-proof this.
2019-11-11 10:32:52 -08:00
Wilson Snyder
292f73fc72 Verilog-Mode collected updates.
* lisp/progmodes/verilog-mode.el (verilog-read-decls): Fix to skip
over base64-encoded protected data while reading AUTO declarations.
Reported by Berend Ozceri.
(verilog-auto-inst-port, verilog-auto-inst-vector): Support 'unsigned'
in `verilog-auto-inst-vector'. Reported by Jeff Riley.
(verilog-read-decls): Fix to ignore `line in AUTOINST, git
bug18. Reported by Berend Ozceri.
(verilog-library-extensions): Support .va /.vah/.sva/.svah file
extensions to load verilog-mode for Verilog-AMS.  Reported by Shareef
Jalloq.
(verilog-read-sub-decls-expr): Fix AUTOOUTPUT etc misparsing Verilog
casts, bug1526.  Reported by Udi Finkelstein.
2019-11-11 11:47:54 -05:00
Stefan Kangas
d0a3c94996 Add several configuration files to auto-mode-alist
* lisp/files.el (auto-mode-alist): Use conf-mode for .asoundrc,
.mairixrc, .mbsyncr, .msmtprc, .nvidia-settings-rc, .offlineimaprc,
.reportbugrc, .rtorrent.rc, .screenrc, .mpdconf, .notmuch-config.  Use
conf-windows-mode for .redshift.conf.  (Bug#38065)
2019-11-11 16:05:21 +01:00
Paul Eggert
b6942c0c37 Document Lisp floats a bit better
* doc/lispref/numbers.texi (Float Basics):
* doc/misc/cl.texi (Implementation Parameters):
* lisp/emacs-lisp/cl-lib.el (cl-most-positive-float)
(cl-least-positive-float)
(cl-least-positive-normalized-float, cl-float-epsilon)
(cl-float-negative-epsilon):
Document IEEE floating point better.  Don’t suggest that Emacs
might use some floating-point format other than IEEE format, as
Emacs currently assumes IEEE in several places and there seems
little point in removing those assumptions.
2019-11-10 15:04:20 -08:00
Juri Linkov
6ad5eb9794 * lisp/tab-bar.el: Better handling of closed-tabs in tab-bar-list.
* lisp/tab-bar.el (tab-bar-list-delete-from-list): Add closed tab to
tab-bar-closed-tabs.
(tab-bar-list-select): Don't add the closed intermediate tab to
tab-bar-closed-tabs.
2019-11-10 23:30:41 +02:00
Juri Linkov
7e151f5bcf * lisp/autorevert.el: Use 'minibuffer-message' to not obscure the prompt.
* lisp/autorevert.el (auto-revert-handler): Use 'minibuffer-message'
instead of 'message'.  Call it from the original window's buffer
that in case of the minibuffer should be current, so
minibuffer-message could add a message to it.  (Bug#34614)

* lisp/emacs-lisp/ert-x.el (ert--make-message-advice): Add nil to
the list of values to not use for format-message, because
minibuffer-message calls 'message' with nil argument, and tests fail.
2019-11-10 23:21:46 +02:00
Stefan Kangas
0154e41b18 Make dired-get-subdir-min obsolete
* lisp/dired.el (dired-get-subdir-min): Redefine as obsolete function
alias for 'cdr'.  (Bug#11571)
(dired-get-subdir, dired-get-subdir-max, dired-clear-alist)
(dired-next-subdir, dired-current-directory):
* lisp/dired-aux.el (dired-rename-subdir-2)
(dired-alist-sort, dired-insert-subdir-del)
(dired-insert-subdir-doupdate, dired-goto-subdir)
(dired-hide-subdir, dired-hide-all): Use 'cdr' instead of
the above obsolete function.
(dired-subdir-alist): Doc fix.

Co-authored-by: Drew Adams <drew.adams@oracle.com>
2019-11-10 22:15:31 +01:00
Juri Linkov
f216f38870 Move read-char-from-minibuffer from simple.el to subr.el and document it.
* doc/lispref/minibuf.texi (Multiple Queries):
Document read-char-from-minibuffer (bug#10477, bug#38076).

* lisp/subr.el (read-char-history)
(read-char-from-minibuffer-map)
(read-char-from-minibuffer-map-hash)
(read-char-from-minibuffer-insert-char)
(read-char-from-minibuffer-insert-other, empty-history)
(read-char-from-minibuffer): Move from simple.el to subr.el.
2019-11-10 23:06:37 +02:00
Stefan Monnier
b15a2fc348 * lisp/cedet/semantic/wisent/comp.el (wisent-struct): Remove
(core, shifts, reductions, errs): Use cl-defstruct instead.
Adjust all users of the set-<struct>-<field> setters to use
`setf` instead.
2019-11-09 23:57:37 -05:00
Jimmy Aguilar Mena
e3043a73fb Add extra bindings to fido-mode.
* lisp/icomplete.el (icomplete-fido-mode-map) : Add arrows and other
bindings to reproduce ido behaviour.
2019-11-10 04:48:23 +01:00
Juri Linkov
732e942798 Don't overwrite y-or-n-p prompt by message from asynchronous man (bug#19064)
* lisp/man.el (Man-bgproc-sentinel): Postpone displaying the message
and deleting the buffer until exiting the code block with
with-current-buffer.  Use minibuffer-message to display message
to handle possibly active minibuffer.
2019-11-10 00:51:25 +02:00
Juri Linkov
8693611136 Don't obscure the minibuffer by message (bug#17272)
* lisp/subr.el (do-after-load-evaluation): Use minibuffer-message
to not obscure a possibly active minibuffer.

* lisp/minibuffer.el (minibuffer-message):
Record message in the *Messages* buffer.
2019-11-10 00:46:29 +02:00
Juri Linkov
8d68025baf Use the minibuffer to read answer in userlock.el (bug#38076)
* lisp/userlock.el: Rename 'fn' to 'filename'.
(ask-user-about-supersession-threat): Use read-char-from-minibuffer
instead of read-char-choice.
2019-11-10 00:43:09 +02:00
Stefan Monnier
d370c6a686 * lisp/startup.el (package--activated): Fix redundant definition 2019-11-09 17:42:36 -05:00
Stefan Monnier
8685db187b * lisp/ffap.el (ffap-read-file-or-url): Don't use url-file-handler
Simplify accordingly (and don't call substitute-in-file-name redundantly).
2019-11-09 17:34:45 -05:00
Juri Linkov
027f218ad2 hack-local-variables-confirm uses the minibuffer to read answer (bug#38076)
* lisp/files.el (hack-local-variables-confirm):
Use read-char-from-minibuffer instead of read-char-choice.
Remove special handling of original window scrolling
that is now supported in the minibuffer.  This fixes
https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg01020.html
(files--ask-user-about-large-file): Use read-char-from-minibuffer
instead of read-char-choice.
2019-11-10 00:32:09 +02:00
Juri Linkov
04ab674707 Add CHARS arg to read-char-from-minibuffer compatible with read-char-choice.
* lisp/simple.el (read-char-history):
Rename from read-char-from-minibuffer-history.  (Bug#38076)
(read-char-from-minibuffer-insert-char):
Rename from read-char-from-minibuffer-self-insert.
(read-char-from-minibuffer-map-hash): New defconst.
(read-char-from-minibuffer-insert-other): New command.
(read-char-from-minibuffer): Add optional args CHARS and HISTORY.
(zap-to-char): Use 'read-char-history as HISTORY arg of
read-char-from-minibuffer.

* lisp/emacs-lisp/map-ynp.el (read-answer): Use sit-for instead of sleep-for.
Replace short answer history yes-or-no-p-history with read-char-history.
2019-11-10 00:21:26 +02:00
Juri Linkov
a26a8cc1c8 'y-or-n-p' now uses the minibuffer to read 'y' or 'n' answer (bug#38076)
* doc/lispref/minibuf.texi (Yes-or-No Queries): Update the fact
that y-or-n-p uses the minibuffer.

* lisp/subr.el (y-or-n-p-history-variable): New variable.
(y-or-n-p-map): New keymap.
(y-or-n-p-insert-y, y-or-n-p-insert-n, y-or-n-p-insert-other):
New commands.
(y-or-n-p): Rewrite to use read-from-minibuffer and make-composed-keymap
with y-or-n-p-map and query-replace-map.
2019-11-10 00:04:13 +02:00
Juri Linkov
898cdc67f1 Run scroll/recenter commands from minibuffer in original window (bug#38076)
* lisp/minibuffer.el (with-minibuffer-selected-window): New macro.
(minibuffer-recenter-top-bottom, minibuffer-scroll-up-command)
(minibuffer-scroll-down-command, minibuffer-scroll-other-window):
(minibuffer-scroll-other-window-down): New commands.
(minibuffer-local-map): Remap recenter/scroll symbols to their
minibuffer wrappers: recenter-top-bottom to minibuffer-recenter-top-bottom.

* src/window.c (Fother_window_for_scrolling): Use 'lambda' value for
MINIBUF arg of Fnext_window, so minibuffer-scroll-other-window and
minibuffer-scroll-other-window-down doesn't try to scroll the
minibuffer window.
2019-11-09 23:32:46 +02:00
Karl Fogel
06cb8350c6 Improve an error about the message signer
* lisp/gnus/mml-sec.el (mml-secure-epg-sign): Don't suggest setting
  `mml-secure-smime-sign-with-sender' if it's already non-nil.
2019-11-09 15:30:09 -05:00
Lars Ingebrigtsen
a67b51e92b Fix font-lock-keywords slightly
* lisp/font-lock.el (font-lock-keywords): Tweak doc string
slightly (bug#35005).
2019-11-09 21:02:24 +01:00
Eli Zaretskii
a1a724d73a Fix an error in selecting encoding when writing zip files
* lisp/international/mule-cmds.el (select-safe-coding-system):
Treat no-conversion-multibyte that came from find-auto-coding
the same as no-conversion for the purposes of encoding.  The
same logic that considers no-conversion always safe should do
the same with no-conversion-multibyte.  (Bug#38155)
2019-11-09 21:40:53 +02:00
Glenn Morris
e73184138d * lisp/progmodes/cc-vars.el (c-mark-wrong-style-of-comment):
Fix version.
2019-11-09 11:17:20 -08:00
João Távora
afe4969a3b Revert "Nudge icomplete-mode a little closer to fido-mode"
Fixes bug#38131.

This is not the best way to have fido-mdoe emulate that particular bit
of ido-mode.

This reverts commit 5761a1a393.
2019-11-09 14:55:42 +00:00
João Távora
5c74b806a6 Rename some commands to reflect they are fido-mode specific
* lisp/icomplete.el (icomplete-fido-kill)
(icomplete-fido-delete-char, icomplete-fido-ret)
(icomplete-fido-backward-updir): Rename from icomplete-magic-ido-*
versions.
(icomplete-fido-mode-map): Use new command names.
2019-11-09 14:55:42 +00:00
João Távora
d9c6b4378a Protect flex's display-sort-function against 0-length candidates
* lisp/minibuffer.el (completion--flex-adjust-metadata): Assume a
candidate missing a score has a score of 0.
2019-11-09 14:55:42 +00:00
Alan Mackenzie
7362554eaf Widen around c-font-lock-fontify-region. This fixes bug #38049.
* lisp/progmodes/cc-mode (c-font-lock-fontify-region): Widen in this function,
to ensure that the CC Mode font locking mechanism can examine characters
outside the given region.
2019-11-09 14:37:55 +00:00
Alan Mackenzie
b293aa91bc CC Mode. Allow fontification of "wrong" style comments with warning face.
This fixes bug #4192.

* etc/NEWS: Add a new entry.

* lisp/progmodes/cc-defs.el (c-font-lock-flush): New macro.

* lisp/progmodes/cc-cmds.el (c-toggle-comment-style): On toggling the comment
style, invoke c-font-lock-flush when c-mark-wrong-style-of-comment is non-nil,
to cause that marking to be done instead on the other style of comment.

* lisp/progmodes/cc-fonts.el (c-maybe-font-lock-wrong-style-comments): New
function.
(c-cpp-matchers): Call c-maybe-font-lock-wrong-style-comments when
appropriate.

* lisp/progmodes/cc-vars.el (c-mark-wrong-style-of-comment): New customizable
option.

* doc/misc/cc-mode.texi (top level, Indentation Commands, Guessing the Style,
Custom Macros): For some opening quote marks, correct '' to ``.
(Minor Modes): Add an xref to the new page "Wrong Comment Style" in a
footnote.
(Wrong Comment Style): New page.
2019-11-09 12:09:30 +00:00
Eli Zaretskii
4e4440272e Fix last change
* lisp/simple.el (goto-history-element)
(next-history-element): Fix quoting of "future history".

* doc/lispref/minibuf.texi (Minibuffer Commands)
(Text from Minibuffer): Add index entry and cross-reference
for "future history".  (Bug#38026)
2019-11-09 11:43:19 +02:00
Hong Xu
15f4c4156c Mention future history in history-related minibuffer commands
* lisp/simple.el (goto-history-element):
* doc/lispref/minibuf.texi (Minibuffer Commands): Explain
negative NABS.
* lisp/simple.el (next-history-element):
* doc/lispref/minibuf.texi (Minibuffer Commands): Mention
"future history."  (Bug#38026)
2019-11-09 11:36:35 +02:00
Paul Eggert
f8284f1e40 Fix some quoting glitches in doc strings
This also fixes a misplaced "only".
2019-11-08 17:11:01 -08:00
Stefan Monnier
b7f843adfd * lisp/ffap.el (ffap-read-file-or-url): Fix some URL cases 2019-11-08 13:59:23 -05:00
Stefan Monnier
24b74c35d5 * lisp/ffap.el (ffap-read-file-or-url): Simplify further 2019-11-08 13:32:46 -05:00
Thierry Volpiatto
0a51c70122 * lisp/ffap.el (ffap-read-file-or-url): Use read-file-name
Since we use `url-handler-mode` to deal with URLs, `read-file-name`
works just as well, with the added benefit that it interacts correctly
with packages that rebind `read-file-name-function`, such as Helm.

(ffap-read-url-internal, ffap-read-file-or-url-internal): Remove, unused.
2019-11-08 10:20:40 -05:00
João Távora
5761a1a393 Nudge icomplete-mode a little closer to fido-mode
* lisp/icomplete.el (icomplete-completions): Don't use ellipsis when
truncating determ in fido-mode.  Highlight the center part of
determ with icomplete-first-match.
2019-11-08 10:18:33 +00:00
João Távora
d558d9fa1e Have pcm styles apply faces to face prop, not font-lock-face
This is the way the basic completion styles work.  This fixes
candidate highlighting in icomplete.

* lisp/minibuffer.el (completion-pcm--hilit-commonality): Apply
faces to 'face property, not font-lock-face.
2019-11-08 10:18:33 +00:00
Stefan Monnier
a070bd1c8b * lisp/emacs-lisp/easymenu.el: Don't quote lambdas
(easy-menu-do-define, easy-menu-make-symbol): Replace `(lambda ..)
with a closure.
2019-11-07 17:09:16 -05:00
Michael Albinus
e8bcf45f30 Handle different system names of w32 in Tramp (Bug#38079)
* lisp/net/tramp.el (tramp-restricted-shell-hosts-alist):
Initialize with `system-name' in small and capital chars.
2019-11-07 18:40:13 +01:00
Eli Zaretskii
e06324a032 Revert "Don't flash previous buffer when connecting with emacsclient"
This reverts commit 49fc040077.
It turns out that the fix for a minor aesthetical annoyance
caused much more serious bugs: bug#31038, bug#35726, Bug#37097,
2019-11-07 19:11:23 +02:00
Andrii Kolomoiets
e50587b1db python.el: Pdbtracking improvements
Allow not to kill buffers when pdbtracking session is finished.
Pdbtracking session considered finished judging from the user input.

* lisp/progmodes/python.el (python-pdbtrack-kill-buffers): New
customizable variable.
(python-pdbtrack-set-tracked-buffer): Use it.
(python-pdbtrack-unset-tracked-buffer)
(python-pdbtrack-tracking-finish): New functions.
(python-pdbtrack-continue-command, python-pdbtrack-exit-command):
New customizable variables.
(python-pdbtrack-process-sentinel): New function.  Finish
pdbtracking session when process is killed.
(python-pdbtrack-prev-command-continue): New variable.
(python-pdbtrack-comint-input-filter-function): New function.
Finish pdbtracking session based on commands sent to pdb.
(python-pdbtrack-comint-output-filter-function): Unset/set
tracking buffer if looking at pdb prompt; finish pdbtracking
session if filename of current stack frame starts with
"<" e.g. "<stdin>".
(python-pdbtrack-comint-output-filter-function): Don't override
overlay-arrow-string.
(python-pdbtrack-setup-tracking): New function.
(inferior-python-mode): Use it.
(python-pdbtrack-stacktrace-info-regexp): Default value is changed.
Must also match lines with filename like "<stdin>" and "<string>".
* etc/NEWS: Mention python-pdbtrack-kill-buffers
2019-11-07 18:53:04 +02:00
Michael Albinus
4ab7800126 Make ange-ftp fit for tramp-tests
* lisp/net/ange-ftp.el (ange-ftp-repaint-minibuffer): Use empty message.
(ange-ftp-quote-string): Unquote the string.
(ange-ftp-substitute-in-file-name, ange-ftp-access-file)
(ange-ftp-copy-directory, ange-ftp-make-symbolic-link)
(ange-ftp-add-name-to-file): New defuns.  Set 'ange-ftp property.
(ange-ftp-real-substitute-in-file-name)
(ange-ftp-real-copy-directory): New defuns.
(ange-ftp-file-name-as-directory): Care about `non-essential'.
(ange-ftp-file-attributes): Handle ID-STRING.
(ange-ftp-copy-file-internal, ange-ftp-rename-file)
(ange-ftp-make-directory): Improve error handling.
(ange-ftp-insert-directory): Initialize SWITCHES if they are nil.

* test/lisp/net/tramp-tests.el (ange-ftp-make-backup-files): Declare.
(tramp-test39-make-nearby-temp-file, tramp--test-ange-ftp-p): New defun.
(tramp-test05-expand-file-name-relative)
(tramp-test06-directory-file-name, tramp-test10-write-region)
(tramp-test11-copy-file, tramp-test12-rename-file)
(tramp-test17-insert-directory)
(tramp-test26-file-name-completion)
(tramp-test37-make-auto-save-file-name)
(tramp-test38-find-backup-file-name)
(tramp--test-special-characters): Use it.
2019-11-07 12:03:19 +01:00
Stefan Kangas
ddb797cf4c Clean up major mode check in package-menu-mode
* lisp/emacs-lisp/package.el (package--ensure-package-menu-mode):
Extract function to warn about incorrect major mode...
(package-menu-toggle-hiding, package-menu-refresh)
(package-menu-execute): ...from here.
(package-menu--mark-upgrades-1): And here, but move call...
(package-menu-mark-upgrades): ...here instead.
(package-menu-hide-package, package-menu-mark-delete)
(package-menu-mark-install, package-menu-mark-unmark)
(package-menu-quick-help, package-menu-get-status)
(package-menu-filter-by-keyword, package-menu-filter-by-name)
(package-menu-clear-filter): Add call to new function.  (Bug#37891)
2019-11-07 04:12:01 +01:00
Juri Linkov
deb61da7a2 * lisp/dired-aux.el (dired-vc-rename-file): New defcustom.
(dired-rename-file): Call vc-rename-file when dired-vc-rename-file is non-nil.

* lisp/vc/vc.el (vc-rename-file): Allow renaming added files.
Call vc-file-clearprops on new file too for the case when
old and new files were renamed to each other back and forth.

https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00069.html
2019-11-07 01:14:58 +02:00
Juri Linkov
528485d017 * lisp/tab-bar.el (tab-bar-history-old): Rename from tab-bar-history-current.
(tab-bar-history-old-minibuffer-depth):
Rename from tab-bar-history--minibuffer-depth.
2019-11-07 01:01:12 +02:00
Juri Linkov
f5f40af1da * lisp/tab-line.el: More configurability for tab buffer groups.
* lisp/tab-line.el (tab-line-tabs-buffer-group-function)
(tab-line-tabs-buffer-group-sort-function)
(tab-line-tabs-buffer-groups-sort-function): New defvars.
(tab-line-tabs-buffer-group-name): Rename from
tab-line-tabs-buffer-groups--name and use tab-line-tabs-buffer-group-function.
(tab-line-tabs-buffer-groups): Use tab-line-tabs-buffer-groups-sort-function
and tab-line-tabs-buffer-group-sort-function.
(tab-line-new-tab): Let bind tab-line-tabs-buffer-groups to
mouse-buffer-menu-mode-groups.
2019-11-07 00:59:28 +02:00
Alan Mackenzie
4ad6c932a8 Add a full set of CC Mode language variables to js.el.
This will allow js.el to work after maintenance changes in CC Mode, e.g. the
fix to bug #11165.

* lisp/progmodes/js.el (top level): Create a CC Mode derived language called
js-mode and based on Java Mode.
(js-mode): call c-init-language-vars for js-mode.  Remove the direct settings
of several CC Mode language variables which are now defined through the
derived language mechanism.  Call c-set-style and set up the needed style
variables c-block-comment-prefix and c-comment-prefix-regexp.
2019-11-06 19:35:43 +00:00
Stephen Gildea
9ce67baa9a time-stamp: add support for time zone numeric offset
* time-stamp.el: Implement %:z as expanding to the numeric time zone
offset, to address the feature request of bug#32931.  Do not document it
yet, to discourage compatibility problems in mixed Emacs 26 and Emacs 27
environments.  Documentation will be added in a subsequent release at
least two years later.  (We cannot yet use %z for numeric time zone
because in Emacs 26 it was documented to do something else.)

* time-stamp-tests.el (time-stamp-test-format-time-zone): expand this
test and break it into two tests, time-stamp-test-format-time-zone-name
and time-stamp-test-format-time-zone-offset.
2019-11-06 08:33:51 -08:00
Michael Albinus
da2df1c1b5 More error checks in Tramp's make-directory
* lisp/net/tramp-adb.el (tramp-adb-handle-make-directory):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-make-directory):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-directory):
* lisp/net/tramp-smb.el (tramp-smb-handle-make-directory):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-make-directory):
Signal `file-already-exists' if DIR exists.

* test/lisp/net/tramp-tests.el (tramp-test04-substitute-in-file-name):
Fix thinko.
(tramp-test13-make-directory, tramp-test14-delete-directory)
(tramp-test15-copy-directory): Extend tests.
2019-11-06 16:49:35 +01:00
Stefan Kangas
d30f5e7eee Fix problem with my last commit in package.el
* lisp/emacs-lisp/package.el (package-menu--refresh-archives): Rename
from duplicated name package-menu--refresh.  (Bug#38084)
(package-menu-mode, list-packages): Use new name.
2019-11-06 15:01:37 +01:00
Stefan Kangas
0661a39d1b Avoid changing value of defcustom package-enable-at-startup
* lisp/emacs-lisp/package.el (package--activated): New variable to
avoid changing value of defcustom 'package-enable-at-startup'.
(package-initialize): Don't set 'package-enable-at-startup'.
(package-initialize, package-activate-all): Set 'package--activated'
instead of 'package-enable-at-startup'.
(package--initialized): Add doc string.

* lisp/startup.el (command-line): Check if 'package--activated' is
non-nil before activating packages.

* doc/lispref/package.texi (Packaging Basics): Update docs.
2019-11-06 01:19:23 +01:00
Stefan Kangas
0c293f1520 Make 'g' refresh package data in package menu
* lisp/emacs-lisp/package.el (package-menu--refresh): Rename from
'package-menu-refresh', make internal and non-interactive.
(package-menu-mode-map, package-menu-mode-menu, package-menu-mode)
(list-packages): Use the above.  (Bug#35504)
(package-menu-refresh): Redefine as obsolete fuction alias for
'revert-buffer'.
* doc/emacs/package.texi (Package Menu): Document it.
* etc/NEWS: Announce it.
2019-11-06 00:58:57 +01:00
Stefan Kangas
c91c145d61 Rename *-multiframe-window to *-window-any-frame
Suggested by Drew Adams.

* lisp/frame.el
(next-multiframe-window): Define as obsolete alias for...
(next-window-any-frame): ...new function name.
(previous-multiframe-window): Define as obsolete alias for...
(previous-window-any-frame): ...new function name.  (Bug#12436)

* lisp/term/ns-win.el (global-map): Use new command name.
* doc/emacs/windows.texi (Other Window): Document it.
* etc/NEWS: Announce it.
2019-11-06 00:49:19 +01:00
João Távora
a8dbb7cc86 Follow JSONRPC spec by not sending :result field on errors
Also don't send :error field on non-errors.

* lisp/jsonrpc.el (jsonrpc--reply): Don't send :result and :error
if none supplied.
(Version): Bump to 1.0.8
2019-11-05 23:37:53 +00:00
Juri Linkov
fbcfee3ae4 Add prefix arg to more isearch commands (bug#14563)
* lisp/isearch.el (isearch--yank-char-or-syntax)
(isearch-yank-word-or-char, isearch-yank-symbol-or-char)
(isearch-yank-until-char): Add optional prefix arg.
2019-11-06 01:35:47 +02:00
Juri Linkov
e4f49e87e7 * lisp/tab-line.el: New option for tabs where buffers are grouped by mode.
* lisp/tab-line.el (tab-line-tabs-function): Add option
tab-line-tabs-buffer-groups.
(tab-line-tabs-buffer-groups): New defvar defaulted to
mouse-buffer-menu-mode-groups.
(tab-line-tabs-buffer-groups--name, tab-line-tabs-buffer-groups):
New functions.
(tab-line-format): Support tabs in the format '(tab (name . "name") ...)'.
(tab-line-select-tab): Move part of code to tab-line-select-tab-buffer.
(tab-line-select-tab-buffer): New function.
(tab-line-tab-current): Rename from tab-line-tab-selected.
2019-11-06 01:21:57 +02:00
João Távora
213643a890 Document fido-mode
* doc/emacs/buffers.texi (Icomplete): Document Fido Mode.

* etc/NEWS: Mention Fido Mode.

* lisp/icomplete.el (icomplete-mode): Ensure fido-mode is off.
(fido-mode): Ensure icomplete-mode is off.
(icomplete-magic-ido-ret): Don't force completions if no
completions.
2019-11-05 22:59:33 +00:00
João Távora
e1d24f3c4c New fido-mode, emulates ido-mode with icomplete-mode
* lisp/icomplete.el (icomplete-fido-mode-map): New variable.
(icomplete--fido-mode-setup): New function.
(fido-mode): New global minor mode.
2019-11-05 22:59:33 +00:00
Paul Eggert
e5f10c6755 Pacify byte-compiler in calculator.el
* lisp/calculator.el (calculator-expt): Open-code cl-evenp to
pacify warning “the function ‘cl-evenp’ might not be defined”.
Problem reported by Juanma Barranquero in:
https://lists.gnu.org/r/emacs-devel/2019-11/msg00118.html
2019-11-05 13:44:02 -08:00
Stefan Monnier
ec5433f676 * lisp/doc-view.el (doc-view--revert-buffer): Fix last change 2019-11-05 14:33:36 -05:00
Stefan Kangas
d76bc06abc Declare unused macro package--push obsolete
* lisp/emacs-lisp/package.el (package--push): Declare obsolete.
2019-11-05 15:49:29 +01:00
Michael Albinus
d270d7d4ad Improve Tramp's copy-directory
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add `copy-directory'.

* lisp/net/tramp.el (tramp-handle-copy-directory): New defun.
2019-11-05 12:58:47 +01:00
Robert Pluim
91c732f687 Always check for client-certificates
* lisp/net/network-stream.el
(network-stream-use-client-certificates): New user option.
(open-network-stream): If 'network-stream-use-client-certificates'
is t, and the user hasn't specified :client-certificate, do
certificate lookups via 'auth-source'.
(network-stream-certificate): Only return key and certificate
files that exist.

* doc/lispref/processes.texi (Network): Document new
client-certificate behavior.

* etc/NEWS: Document 'network-stream-use-client-certificates'.
2019-11-05 09:32:51 +01:00
Paul Eggert
3843711abd Simplify calculator-expt
* lisp/calculator.el (calculator-expt): Simplify, now that
expt does the right thing if the first arg is -1, 0, or 1.
2019-11-04 23:39:55 -08:00
Ronnie Schnell
96c8e4fa41 Fixes bug where restoring game saved in an endgame question room would show 'nil' as the question. 2019-11-04 13:54:48 -05:00
Michael Albinus
dd19cc3aa1 Improve Tramp error handling
* lisp/net/tramp.el (tramp-set-syntax): Add missing argument.
(tramp-signal-hook-function): Make it more robust.
(tramp-handle-directory-files):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes)
(tramp-adb-handle-copy-file, tramp-adb-handle-rename-file):
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file):
* lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file)
(tramp-rclone-handle-directory-files):
* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes)
(tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-copy-file, tramp-smb-handle-directory-files)
(tramp-smb-handle-rename-file):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file):
Improve error handling.

* test/lisp/net/tramp-tests.el (tramp-test11-copy-file)
(tramp-test12-rename-file, tramp-test14-delete-directory)
(tramp-test15-copy-directory, tramp-test16-directory-files)
(tramp-test19-directory-files-and-attributes): Extend tests.
2019-11-04 17:34:31 +01:00
Stephen Gildea
1d4862e8c1 Fix English grammar in some doc strings and comments
(files.el subr.el): Fix some grammar errors in doc strings and comments.
(frame.c fringe.c image.c xfns.c xterm.c): Fix some English grammar
errors in doc strings.
2019-11-03 18:36:45 -08:00
Juri Linkov
58fde6362f * lisp/help-fns.el (describe-variable): Add quotes to symbol value of origval. 2019-11-03 23:52:23 +02:00
Juri Linkov
da087965f2 * lisp/tab-bar.el: Better handling of tab-bar-history.
* lisp/tab-bar.el (tab-bar-history-limit): Increase to 10 since wc
is not saved to the desktop file anymore, so doesn't affect its size.
(tab-bar-history--pre-change, tab-bar--history-change):
Store wc before possibly entering the minibuffer.
2019-11-03 23:48:53 +02:00
Juri Linkov
c472df8ad3 * lisp/tab-bar.el: Filter out non-persistent tab parameters from frameset.
* lisp/tab-bar.el (frameset-filter-tabs): New function
added to 'frameset-filter-alist' for frame parameter 'tabs'.
(tab-bar--tab): Remove ws-bl/ws-bbl that are not needed because
frameset doesn't save frame buffer-list to desktop anyway.
(tab-bar-select-tab): Remove ws-bl/ws-bbl related code.

* lisp/emacs-lisp/seq.el (seq-reduce): Add autoload cookie.
2019-11-03 23:44:44 +02:00
Stefan Kangas
84a3793b19 Handle truncate-lines in customize-group
* lisp/cus-edit.el (custom-group--draw-horizontal-line): New
function to draw horizontal lines which handles a non-nil value of
'truncate-lines'.  (Bug#25308)
(custom-group-value-create): Use it.

Co-authored-by: Jonas Bernoulli <jonas@bernoul.li>
2019-11-03 17:45:48 +01:00
Lars Ingebrigtsen
5c8375bd68 describe-font/font-info works with unloaded fonts
* lisp/international/mule-diag.el (describe-font): This function
can be used on unloaded fonts, so remove that restriction from the
doc string (bug#16815).  Also allow completion over all fonts on
the system.

* src/font.c (Ffont_info): Ditto for the doc string.
2019-11-03 16:33:15 +01:00
Lars Ingebrigtsen
ba8a7882de Add a <a id=...> skeleton to html-mode
* lisp/textmodes/sgml-mode.el (html-id-anchor): New skeleton
and keystroke (bug#37651).
2019-11-03 16:06:35 +01:00
Juanma Barranquero
e323a84c9f * lisp/bs.el (bs-mode): Improve mode docstring. 2019-11-03 14:15:18 +01:00
Juri Linkov
0b9dc0a8fe * lisp/tab-line.el (tab-line-tab-selected): New face.
(tab-line-format): Use new face tab-line-tab-selected.
([tab-line]): Move tab-switching mouse wheel commands to S-keys.
2019-11-02 23:39:15 +02:00
João Távora
adb5f45d7b Allow flymake diagnostic types to have shorter names
Eglot, a third-party package which uses Flymake, has its own
diagnostic types such as 'eglot-error', 'eglot-warning', etc...  While
not being too long, they will not fit in the type column of the "list
all diagnostics" buffer.  This commit allows diagnostic types to have
user-defined names and also assigns names to the default categories.

* doc/misc/flymake.texi (Flymake error types): Describe
flymake-type-name prop.

* lisp/progmodes/flymake.el (flymake--diagnostics-buffer-entries):
Use type names.
(flymake-error, flymake-warning, flymake-note): Give these
diagnostic categories default type names.
2019-11-02 16:38:53 +00:00
João Távora
455e753a2b Avoid face clashes between Flymake and region highlighting
Fix bug#34022.

* lisp/progmodes/flymake.el (flymake--highlight-line): Use
(PRIMARY . SECONDARY) priority value.
2019-11-02 16:16:14 +00:00
João Távora
b32c4d7bac Clarify consequences of mismatching Flymake diagnostic buffers
Fix bug#34418.

* doc/misc/flymake.texi (Flymake utility functions): Add note to
flymake-make-diagnostic.

* lisp/progmodes/flymake.el (flymake--handle-report): Discard
diagnostics from other buffers.
2019-11-02 15:56:19 +00:00
Lars Ingebrigtsen
c2e77ff89a Revert "Make the debbugs groups also include robot messages"
This reverts commit 682eae776e.

The change made the bug# disappear from the Subject lines.
2019-11-02 15:37:14 +01:00
Alan Mackenzie
ec16dd1a1e CC Mode. Fix slow scrolling by adding a search limit.
This fixes bug #10149.

* lisp/progmodes/cc-fonts.el (c-font-lock-single-decl) Limit the search by
c-go-up-list-backwards to 500 non-literal characters.
2019-11-02 13:03:50 +00:00
João Távora
6911ef3da6 Correct merge blunder in last icomplete commit
* lisp/icomplete.el (icomplete-exhibit): Use
while-no-input-ignore-events.
2019-11-02 11:10:04 +00:00
Eli Zaretskii
cacd58463b Improve documentation of 'set-face-font'
* lisp/faces.el (set-face-font):
* doc/emacs/frames.texi (Fonts):
* doc/lispref/display.texi (Face Attributes)
(Attribute Functions): Clarify and correct the documentation
of set-face-font and related descriptions of font
specifications.  (Bug#14647)
2019-11-02 12:41:51 +02:00
Stefan Kangas
6c82aafcc0 Add auto-insert skeleton for ".dir-locals.el"
* lisp/autoinsert.el (auto-insert-alist): Add auto-insert skeleton for
".dir-locals.el".
2019-11-02 04:23:24 +01:00
João Távora
730e7da7ba New icomplete-tidy-shadowed-file-names variable
* lisp/icomplete.el (rfn-eshadow): Require it.
(icomplete-tidy-shadowed-file-names): New variable.
(icomplete-exhibit): Use icomplete-tidy-shadowed-file-names.
2019-11-02 02:38:45 +00:00
João Távora
0bb97ad8b8 Fix icomplete-force-complete-and-exit for no-input situations
If there is no minibuffer input, but the user has already cycled some
pre-calculated completions, we should be calling
minibuffer-force-complete-and-exit instead of
minibuffer-complete-and-exit.  The former is guaranteed to be fast in
this situation and yields the desired "selected" completion, while the
latter will just give us the default, ignoring all the cycling of
icomplete-{forward|backward}-completions.

* lisp/icomplete.el (icomplete-force-complete-and-exit): Add
comments and fix for empty input but some completions calculated.
2019-11-02 02:35:45 +00:00
João Távora
88f193ed05 Improve fix for icomplete's backward-kill-word bug#38024
* lisp/icomplete.el (icomplete-exhibit): Use
while-no-input-ignore-events, not redisplay.

Co-authored-by: Stefan Monnier <j.schmoe@example.org>
2019-11-02 02:35:45 +00:00
Stefan Kangas
6b2745fe2e Use PASSWORD_STORE_DIR in auth-source-pass when set
* lisp/auth-source-pass.el (auth-source-pass-filename): Initialize to
PASSWORD_STORE_DIR environment variable when set.  (Bug#29663)
2019-11-02 01:33:40 +01:00
Stefan Kangas
6297eb0fca Don't refuse to install packages without a "footer line"
* lisp/emacs-lisp/package.el (package-buffer-info): Don't signal an
error when the "footer line" is missing.  Warn only.  (Bug#26490)
* etc/NEWS: Announce it.
2019-11-02 01:30:36 +01:00
Lars Ingebrigtsen
a8b8744665 set-face-font doc string update
* lisp/faces.el (set-face-font): Mention what the string formats
are (bug#14647).
2019-11-01 18:32:29 +01:00
Lars Ingebrigtsen
0714d6664c Really enable setting a breakpoint without instrumenting first
* lisp/emacs-lisp/edebug.el (edebug-set-breakpoint): Really enable
setting a breakpoint without instrumenting first (bug#23469).
2019-11-01 17:42:28 +01:00
Glenn Morris
64a1541175 ; Auto-commit of loaddefs files. 2019-11-01 06:27:08 -07:00
Filipp Gunbin
0bffb3e69d Make ant regexp in compilation-error-regexp-alist-alist more lax
* lisp/progmodes/compile.el: Make ant regexp accept filenames that may
occur on Cygwin (like c:/test) and optional additional severity level
after task name.
* etc/compilation.txt: Add sample.
2019-11-01 15:20:42 +03:00
Eric Ludlam
9d209c9034 * lisp/cedet/ (semantic-analyze-possible-completions): Add flags arg
* lisp/cedet/semantic/texi.el (semantic-analyze-possible-completions),
lisp/cedet/srecode/srt-mode.el (semantic-analyze-possible-completions),
lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions):
Add `flags` arg.
* lisp/cedet/semantic/grammar.el (semantic-analyze-possible-completions):
Add `flags` arg.  Reverse the found prefix.
(semantic-ctxt-current-class-list): Include token tags as things to
appear in non-lisp context.
2019-10-31 19:10:58 -04:00
Mattias Engdegård
d75794fd5c Inhibit undo-in-region for mouse-drag-region (bug#37700)
'mouse-drag-region' leaves the region active around the dragged text,
so a straight undo did not revert the entire operation.  To remedy
this, inhibit undo-in-region when the last command was
mouse-drag-region.  (Method suggested by Stefan Monnier.)

* lisp/mouse.el (undo-drag-region): Set the undo-inhibit-region property.
* lisp/simple.el (undo): Inhibit undo-in-region if the last command
had the undo-inhibit-region property set.
* doc/lispref/symbols.texi (Standard Properties):
* doc/lispref/text.texi (Undo): Document undo-inhibit-region.
* etc/NEWS: Announce the property.
2019-10-31 17:41:29 +01:00
Lars Ingebrigtsen
111a95fe6d Ensure that font-local variables are buffer-local
* lisp/font-lock.el (font-lock-set-defaults): Ensure that the font
lock variables are buffer-local even when nil, so that they're
copied correctly by mhtml mode when changing sub-modes (bug#33937).
2019-10-31 14:06:08 +01:00
Lars Ingebrigtsen
60ad3d63cf Clean up font-lock-refontify slightly
* lisp/font-lock.el (font-lock-refontify): Use
syntax-ppss-flush-cache instead of internal variable.
2019-10-31 13:26:19 +01:00
Lars Ingebrigtsen
d630a047bb Further tweaks to sh-script \ #foo font locking
* lisp/progmodes/sh-script.el (sh-syntax-propertize-function):
Tweak previous \ #foo change to work on all quoted characters, but
check that the backslash itself is not backslashed.  Regexp from
Stefan Monnier.
2019-10-31 13:07:37 +01:00
Michael Albinus
bdb33af39d Fix some minor Tramp problems
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
Check, that `tramp-password-save-function' is a function.

* lisp/net/tramp-smb.el (tramp-smb-handle-file-system-info):
Check, that there is a share.

* lisp/net/tramp.el (outline-regexp): Declare.
(tramp-get-debug-buffer): Let-bind `signal-hook-function'.

* test/lisp/net/tramp-tests.el (tramp-test04-substitute-in-file-name):
Skip some tests for Emacs 24 and 25; they let Emacs crash.
2019-10-31 11:13:13 +01:00
Robert Pluim
e168bb7386 Rework vc stash bindings
This adds create/snapshot bindings to the stash button even when there
are no stashes, and extends the stash menu bindings.

* etc/NEWS: Announce the bindings.

* lisp/vc/vc-git.el (vc-git-stash-shared-map): New keymap.  Holds
shared bindings between stash button and stash list.
(vc-git-stash-map): Inherit from vc-git-stash-shared-map.
(vc-git-stash-button-map): New keymap.  Holds button bindings,
inherit from vc-git-stash-shared-map.
(vc-git-stash-shared-help, vc-git-stash-list-help): New
defconsts.  Abstract out list/button help texts.
(vc-git--make-button-text): Set keymap property to
vc-git-stash-button-map.
(vc-git-make-stash-button): Use vc-git-stash-shared-help.
(vc-git-stash-menu-map): Add items for vc-git-stash and
vc-git-stash-snapshot.
(vc-git-dir-extra-headers): Use vc-git-stash-list-help and
vc-git-stash-shared-help.  Add vc-git-stash and
vc-git-stash-snapshot bindings to text shown when there are no stashes.
2019-10-31 10:53:05 +01:00
Lars Ingebrigtsen
48fdfd8b93 Font-lock symlinks in dired buffers better
* lisp/dired.el (dired-font-lock-keywords): Font-lock symlinks
differently based on whether they point at a directory or not
(bug#17064).  Based on code from Michael Heerdegen.
2019-10-31 00:31:32 +01:00
Juri Linkov
390dd2cff9 * lisp/tab-bar.el (tab-bar-select-tab): Use set-frame-parameter.
(tab-bar-list-noselect, tab-bar-list-mode): Rearrange buffer-read-only.
2019-10-31 01:11:05 +02:00
Kevin Ryde
94b8153eaa Support \pagebreak[0] for paragraph-separate in latex-mode
* textmodes/tex-mode.el (latex-mode): In 'paragraph-separate' allow
optional argument ('[0]', etc.) for '\pagebreak[0]'.  (Bug#19039)
2019-10-30 22:35:19 +01:00
Tom Tromey
772f1c4189 Send -enable-frame-filters to gdb
* lisp/progmodes/gdb-mi.el (gdb-init-1): Send -enable-frame-filters to
gdb.
2019-10-30 22:25:23 +01:00
Lars Ingebrigtsen
f9ffb81fb8 Fix previous sh-script.el font-lock #comment change
* lisp/progmodes/sh-script.el (sh-syntax-propertize-function): We
want to match "\ " before a comment; not a space character.
2019-10-30 22:06:18 +01:00
Lars Ingebrigtsen
77d4491391 Revert "Move description of value to syntax-ppss function."
This reverts commit 305dbc7e2b.

Both of the functions in question are used a lot in the sources, so move it back to the more basic function.
2019-10-30 21:26:22 +01:00
Lars Ingebrigtsen
f7673c147c Add a new ppss structure for syntax-ppss data
* lisp/emacs-lisp/syntax.el (ppss): Add a new structure to provide
accessors to the syntax-ppss data.
2019-10-30 21:25:23 +01:00
Lars Ingebrigtsen
b21ea56edc Tweak fontification of \url{http://foo.org/bar%zot} in (la)tex-mode
* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-1):
\url{http://foo.org/bar%zot} shouldn't be fontified as having a
comment, so make the tex-verbatim face overwrite the
already-applied syntactical comment bits (bug#37134).
2019-10-30 21:06:47 +01:00
Lars Ingebrigtsen
4650aa3523 Bind vc-git-stash to a key
* lisp/vc/vc-git.el (vc-git-stash-map): Give `vc-git-stash' a
keystroke, because it's a useful command.

When there are no stashes, there's no way to use that keystroke (since
it's only bound on the stash lines), so perhaps that should also be
fixed somehow.
2019-10-30 20:54:44 +01:00
Lars Ingebrigtsen
f8134d2753 Clear more data in font-lock-refontify to ensure refontifying
* lisp/font-lock.el (font-lock-refontify): Clear out even more data.
2019-10-30 15:39:44 +01:00
Lars Ingebrigtsen
b996117fe5 font-lock \ #foo in shell mode more correctly
* lisp/progmodes/sh-script.el (sh-syntax-propertize-function):
\ #foo isn't a comment -- it's a symbol that starts with a space
character (bug#17538).
2019-10-30 15:39:15 +01:00
Lars Ingebrigtsen
9df254119c Make font-lock-refontify try even harder to refontify
* lisp/font-lock.el (font-lock-refontify): Make this command work
even after switching global font lock mode on and then off again.
2019-10-30 15:04:17 +01:00
Lars Ingebrigtsen
1fc8bf71d9 Fix setgid fontification in dired on some OS-es
* lisp/dired.el (dired-font-lock-keywords): Apparently some
versions of ls use "S" for setgid and other use "s" (bug#8186).
2019-10-30 13:30:47 +01:00
Lars Ingebrigtsen
66efb2f3a6 Fix "dnl" highlights in m4-mode
* lisp/progmodes/m4-mode.el (m4-font-lock-keywords): "dnl"
comments should override any previous syntax-based highlighting
(37132).  This makes "dnl foo#bar" be highlighted correctly.
2019-10-30 13:16:44 +01:00
Lars Ingebrigtsen
e1409379f7 Add a convenience function to be used when working on font locking
* doc/lispref/modes.texi (Font Lock Basics): Document it.

* lisp/font-lock.el (font-lock-refontify): New convenience command.
2019-10-30 13:16:44 +01:00
Lars Ingebrigtsen
305dbc7e2b Move description of value to syntax-ppss function.
* lisp/emacs-lisp/syntax.el (syntax-ppss): Move the description of
the return value from...

* src/syntax.c (Fparse_partial_sexp): ... here because
`syntax-ppss' is what's called over the place, and jumping through
an indirection to get to the value description is inconvenient.
2019-10-30 13:16:44 +01:00
Lars Ingebrigtsen
40c787ff4e Indent font-lock-fontify-syntactically-region
* lisp/font-lock.el (font-lock-fontify-syntactically-region):
Indent function.
2019-10-30 13:16:43 +01:00
Michael Albinus
fc05708248 * lisp/net/tramp.el (outline-regexp): Remove declaration. 2019-10-30 09:44:24 +01:00
Lars Ingebrigtsen
7ce00e9a8b Fix image-converter probes
* lisp/image/image-converter.el (image-converter--probe): Check
that the executable exists before trying to call it.
2019-10-30 01:02:48 +01:00
Juri Linkov
ba7755bfb7 Rename read-char-with-history to read-char-from-minibuffer (bug#10477)
* lisp/simple.el (read-char-from-minibuffer-history):
Rename from read-char-with-history--history.
(read-char-from-minibuffer-map):
Rename from read-char-with-history--map.
(read-char-from-minibuffer): Rename from read-char-with-history.
(read-char-from-minibuffer-self-insert): New command.
(zap-to-char): Use read-char-from-minibuffer.
2019-10-30 02:00:02 +02:00
Lars Ingebrigtsen
682eae776e Make the debbugs groups also include robot messages
* lisp/gnus/gnus-group.el (gnus-bug-group-download-format-alist):
Change the URL to also include robot messages.
2019-10-30 00:17:57 +01:00
Juri Linkov
bafcef87c3 Reimplement read-char-with-history based on read-from-minibuffer
* lisp/simple.el (read-char-with-history): Reimplement based on
read-from-minibuffer.
* lisp/simple.el (read-char-with-history--map): New variable
(bug#10477).
2019-10-30 00:01:11 +01:00
Juri Linkov
d7f62ce0cd * lisp/tab-bar.el: Store point position and frame buffer-lists in tab.
* lisp/tab-bar.el (tab-bar--tab): Store additionally point-marker,
frame parameters buffer-list and buried-buffer-list, both for wc and ws.
Use seq-filter.
(tab-bar-select-tab): Restore point-marker after restoring
window-configuration.  Also restore frame parameters buffer-list
and buried-buffer-list both for window-configuration and window-state.
(tab-bar-history-limit, tab-bar-history--minibuffer-depth): New variables.
(tab-bar-history-current): Rename from tab-bar-history--pre-change.
(tab-bar-history--pre-change): Set tab-bar-history-current.
(tab-bar--history-change): Use seq-take for tab-bar-history-limit.
(tab-bar-history-back, tab-bar-history-forward): Restore point-marker.
(tab-bar-list-noselect): Use seq-remove.

* lisp/emacs-lisp/seq.el (seq-take, seq-filter): Add autoload cookie.
2019-10-30 00:31:11 +02:00
Lars Ingebrigtsen
d3517de4b4 Make url-cookie.el be more resistant against bogus data
* lisp/url/url-cookie.el (url-cookie-handle-set-cookie): Don't bug
out on large max-age values (bug#37974).
2019-10-29 22:53:00 +01:00
Lars Ingebrigtsen
19c98f7620 Default exotic image formats (like .webp) to image-mode
* doc/lispref/errors.texi (Standard Errors): Mention the new error.

* lisp/files.el (auto-mode-alist): Add a bunch of image suffixes
to the list (bug#37972) based on the output from "gm convert -list
format" (i.e., graphicsmagick).

* lisp/image-mode.el (image-mode): Rewrite to possibly notify the
user about image-use-external-converter.
(image-mode--setup-mode): Factor out into own function and don't
run under `condition-case' as there's nothing here that should
error.

* lisp/image.el (unknown-image-type): New error.
(image-type): Signal that error so that image-mode can offer
sensible feedback to the user.
2019-10-29 21:42:39 +01:00
Lars Ingebrigtsen
1997e3b80f Fix image-converter probing
* lisp/image/image-converter.el (image-converter--find-converter):
Stop probing on the first successful probe.
2019-10-29 21:42:39 +01:00
Stefan Monnier
7208c4f8c9 * lisp/minibuffer.el: Tweak and undo parts of recent changes
(completion-metadata): Always return a fresh new cons cell.
(completion--nth-completion): Don't bother calling adjust-metadata
if the result won't be used.
(completion-pcm--hilit-commonality): Revert recent change which had
removed support for `completions-first-difference` in `substring` and
`partial-completion` styles.
(completion--flex-adjust-metadata): Treat the arg as immutable.
2019-10-29 16:17:14 -04:00
Filipp Gunbin
6d2c73e8c7 Add gradle-kotlin to compilation-error-regexp-alist-alist
* lisp/progmodes/compile.el: Add gradle-kotlin to
compilation-error-regexp-alist-alist.
* etc/compilation.txt: Add samples for it.
2019-10-29 23:06:20 +03:00
Lars Ingebrigtsen
0956a65e6f Make shr scale images on all frames
* lisp/net/shr.el (shr-rescale-image): Rescale images even if the
window isn't on the current frame.
2019-10-29 13:56:49 +01:00
João Távora
5860fd3123 Make icomplete-exhibit actually work when navigating up directories
Sometimes, when finding files with icomplete-mode, backward-deleting
the previous word or sexp (to move up a directory) doesn't actually
refresh the file list of the new directory.  Forcing redisplay in
icomplete-exhibit misteriously fixes the problem.

* lisp/icomplete.el (icomplete-exhibit): Add call to redisplay.
2019-10-29 00:19:33 +00:00
João Távora
7373d6eae8 New commands for making icomplete behave more like ido
This tries (not particularly hard) to emulate Ido's magic C-k, C-d,
RET and DEL.  For now, the new commands have to be explicitly added to
an active map by the user, using something like this:

(let ((imap icomplete-minibuffer-map))
  (define-key imap (kbd "C-k") 'icomplete-magic-ido-kill)
  (define-key imap (kbd "C-d") 'icomplete-magic-ido-delete-char)
  (define-key imap (kbd "RET") 'icomplete-magic-ido-ret)
  (define-key imap (kbd "DEL") 'icomplete-magic-ido-backward-updir))

* lisp/icomplete.el (icomplete-magic-ido-kill)
(icomplete-magic-ido-delete-char, icomplete-magic-ido-ret)
(icomplete-magic-ido-backward-updir): New commands.
2019-10-29 00:19:33 +00:00
Juri Linkov
4e3676726a * lisp/tab-bar.el: Check for minibuffer-depth in tab-bar-history-mode.
* lisp/tab-bar.el (tab-bar-history--pre-change): Store also minibuffer-depth.
(tab-bar-history-change): Check stored minibuffer-depth for zero.
(tab-bar-history-mode): Use prefix -- for internal functions.
2019-10-28 23:55:16 +02:00
Mattias Engdegård
2aed0430c7 Use new-style rx extensions in python.el
* lisp/progmodes/python.el (python-rx): Use `rx-let' instead of
`rx-constituents'.  This allows for some slight redundancy reduction,
since `rx-let' definitions are expanded inside `not' (bug#37849).
Reorder some `or' forms for more efficient matching.
2019-10-28 17:38:33 +01:00
Hong Xu
70578e0777 Add doc for goto-history-element
* doc/lispref/minibuf.texi (Minibuffer Commands): Add
goto-history-element (bug#37948).
* lisp/simple.el (goto-history-element): Clarify NABS.
2019-10-28 16:20:52 +01:00
Stefan Kangas
9ee2caac4d * lisp/eshell/em-term.el: Remove commented out XEmacs compat code. 2019-10-28 16:17:41 +01:00
Stefan Kangas
1f1ce5b311 Remove more XEmacs compat code from CEDET
* lisp/cedet/mode-local.el (mode-local-describe-bindings-1):
* lisp/cedet/semantic/idle.el (semantic-idle-summary-out-of-context-faces):
* lisp/cedet/semantic/imenu.el (semantic-imenu-rebuild-directory-indexes):
* lisp/cedet/semantic/texi.el (semantic-texi-command-completion-list):
Remove XEmacs compat code.
2019-10-28 16:07:10 +01:00
Stefan Kangas
c515d4eeb2 Remove obsolete doc references to XEmacs (Bug#37899)
* doc/misc/edt.texi (Changes, Goals):
* doc/misc/emacs-mime.texi (Charset Translation):
* doc/misc/gnus-faq.texi (FAQ 4-15):
* doc/misc/pcl-cvs.texi (Bugs):
* doc/misc/srecode.texi (SRecode Minor Mode):
* lisp/cedet/srecode/insert.el (srecode-insert-ask-variable-method):
* lisp/follow.el:
* lisp/leim/quail/ipa.el (ipa-x-sampa, ipa-kirshenbaum):
* lisp/net/newsticker.el:
* lisp/obsolete/iswitchb.el:
* lisp/progmodes/hideshow.el:
* lisp/savehist.el (savehist-file):
* lisp/vc/ediff.el: Remove obsolete references to XEmacs in doc
strings and comments.
2019-10-28 15:55:10 +01:00
Michal Nowak
97cfb4f1e7 Add cert bundle path for OpenIndiana
* lisp/net/gnutls.el (gnutls-trustfiles): Add cert bundle path for
OpenIndiana (bug#37960).

Copyright-paperwork-exempt: yes
2019-10-28 15:38:34 +01:00
Lars Ingebrigtsen
925872ee7b Make ERC respect erc-channel-hide-list
* lisp/erc/erc.el (erc-hide-current-message-p): Make
erc-channel-hide-list work (bug#37879) by getting matching on the
channel name instead of the ERC client name.
2019-10-28 15:31:39 +01:00
Lars Ingebrigtsen
4367c296ce Fix `G c' in Gnus group buffers for non-ASCII text
* lisp/gnus/gnus-cus.el (gnus-group-customize): Decoding is
superfluous here -- everything is utf-8 already.
(gnus-group-customize-done): Don't double-encode the text (bug#37901).
2019-10-28 15:10:51 +01:00
Lars Ingebrigtsen
2864c5201d Be more permissive when interpreting IMAP mail headers
* lisp/gnus/nnimap.el (nnimap-transform-headers): Some mail
doesn't have space after the colon of the header name.  Don't
ignore these.
2019-10-28 13:31:37 +01:00
Lars Ingebrigtsen
3478f2f3d6 Make <up> work in read-char-with-history
* lisp/simple.el (read-char-with-history): Tweak to make
<up>/<down> also traverse the history (bug#10477).
2019-10-28 12:12:00 +01:00
Koichi Arakawa
098873b4f2 Reorder command-line switches in Tramp
* lisp/net/tramp-sh.el (tramp-maybe-open-connection):
`tramp-encoding-command-interactive' must be the last command-line
switch, at least for bash.  (Bug#37953)

Copyright-paperwork-exempt: yes
2019-10-28 09:49:59 +01:00
Juri Linkov
7e30076225 * lisp/tab-bar.el: Add tab-bar-history-mode with arrow buttons for navigation.
* lisp/tab-bar.el (tab-bar-back-button, tab-bar-forward-button):
New variables.
(tab-bar-make-keymap-1): Show these buttons in tab-bar-history-mode.
(tab-bar--tab): Add history-back and history-forward.
(tab-bar-select-tab): Restore history-back and history-forward.
(tab-bar-history-omit, tab-bar-history-back)
(tab-bar-history-forward, tab-bar-history-pre-change): New variables.
(tab-bar-history-pre-change, tab-bar-history-change)
(tab-bar-history-back, tab-bar-history-forward)
(tab-bar-history-mode): New functions.
2019-10-28 01:04:47 +02:00
Stefan Monnier
0e4dd67aae * lisp/emacs-lisp/seq.el: Don't require cl-lib.
(seq-subseq): Move cl-subseq's code here instyead of calling it.
* lisp/emacs-lisp/cl-extra.el (cl-subseq): Use seq-subseq.
2019-10-27 13:25:00 -04:00
Stefan Monnier
2aaced1686 * lisp/loadup.el: Load minibuffer after cl-generic
This is so minibuffer.el can make use of cl-generic

* lisp/minibuffer.el (minibuffer-local-completion-map):
Move switch-to-completions bindings here from...
* lisp/simple.el (minibuffer-local-completion-map): ... here.
2019-10-27 13:21:21 -04:00
Stephen Gildea
113ff954db time-stamp-time-zone: update customization
* time-stamp.el (time-stamp-time-zone): Support customization with
an integer offset (a new possible value of the ZONE argument to
format-time-string in Emacs 27).
Update the safe-local-variable predicate from string-or-null-p
(describing time-stamp-time-zone's domain before 2015) to new
predicate time-stamp-zone-type-p (describing the current domain).

* time-stamp-tests.el (time-stamp-test-helper-zone-type-p): New test.
2019-10-27 08:21:16 -07:00
Eli Zaretskii
fc0f98a8a8 Fix point position after revert-buffer in tabulated-list mode
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print):
Don't use count-screen-lines, as it is unreliable when lines
are truncated and the region ends before a newline (the root
cause is in vertical-motion, but is very hard to fix there).
Instead, use vertical-motion directly, as the problems with
counting/not counting the newline that ends the region are not
relevant to what we need in this function, which is simply the
number of the current window line.  (Bug#37941)
2019-10-27 17:07:47 +02:00
João Távora
1b687e171e Optimize lisp/icomplete.el when default completion available
Often, when using icomplete with icomplete-show-matches-on-no-input
and commands like C-h f, icomplete-exhibit will take a long time (like
several seconds) to show all the completions.

However, if there is a non-nil default value, like when the C-h f is
performed exactly on a function name, the minibuffer prompt will
reflect that immediately.  If the user immediately presses RE
(icomplete-force-complete-and-exit) we take that to mean "use the
default" and avoid the long wait.

As an extra performance tweak, this commit also removes an unneeded
call to icomplete-exhibit in icomplete-minibuffer-setup.

* lisp/icomplete.el (icomplete-force-complete-and-exit): Short-circuit
possibility of non-nil minibuffer-default.
(icomplete-minibuffer-setup): No need to explicitly icomplete-exhibit
here since icomplete-post-command-hook will call it unconditionally.
2019-10-27 13:21:22 +00:00
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
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
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
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
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
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
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 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