1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-11 09:20:51 +00:00
Commit Graph

139509 Commits

Author SHA1 Message Date
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
f2019fc676 Fix case-insensitive completion of buffer names
* test/src/minibuf-tests.el (test-try-completion-ignore-case):
New test, suggested by Stefan Monnier <monnier@iro.umontreal.ca>.

* src/minibuf.c (Ftry_completion): Don't treat strings that
are identical but for the case as if they were identical for
the purposes of not counting the same string twice.  This
fixes case-insensitive completion when all the candidates are
identical but for the letter-case.  (Bug#11339)
2019-11-09 21:56:30 +02: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
Nick Helm
6daa80d04e Fix unresponsive Help menu in macOS
* src/nsterm.m (ns_check_menu_open): Don't postpone mouse drag and
non-user-generated mouse down events (Bug#31371).
2019-11-09 10:57:59 +01:00
Eli Zaretskii
273604dd87 Avoid compiler warnings in addpm.c and ddeclient.c
* nt/ddeclient.c (DdeCallback):
* nt/addpm.c (DdeCallback): Modify types of the last 2
arguments to avoid compiler warnings in 64-bit builds.
(Bug#38040)
2019-11-09 11:53:02 +02: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
Eli Zaretskii
05167c1173 Fix MS-Windows version reference in FAQ
* doc/misc/efaq-w32.texi (Which versions of Windows): Clarify that we
support all recent versions of MS-Windows.  (Bug#38023)
2019-11-08 15:43:08 +01: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
Eli Zaretskii
42eaac3134 Minor copyedits in ELisp manual
* doc/lispref/lists.texi (Sets And Lists): Minor rewording of
the "Common Lisp note".  (Bug#37811)
2019-11-08 11:55:36 +02:00
Robert Pluim
063277c5ec Ensure building and running on non-IPv6 capable hosts works
* src/process.c (Fmake_network_process) [AF_INET6]: Only build ::1
localhost when IPv6 is supported.
(Fnetwork_lookup_address_info) [AF_INET6]: Move check for Qipv6 inside
ifdef, since its definition depends on AF_INET6.  Don't return IPv6
addresses when they're not supported.

* test/src/process-tests.el (lookup-family-specification,
lookup-google): Only do IPv6 lookup if IPv6 is supported.
2019-11-08 10:04:13 +01:00
Jimmy Aguilar Mena
8232325337 Handle case where a face's :extend attribute is unspecified (Bug#37774)
* src/xfaces.c (merge_face_vectors, merge_named_face): Handle case
where the :extend attribute's value is 'unspecified' (Bug#37774).
2019-11-08 09:31:33 +01: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
Robert Pluim
8ce2ec15f4 Describe IPv6 format in docstring for 'make-network-process'
* src/process.c (Fmake_network_process): Add description of IPv6
address format.
2019-11-07 18:16:07 +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
Eli Zaretskii
1b715834c3 ; * etc/NEWS: Fix wording of last change. 2019-11-07 18:55:55 +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
Eli Zaretskii
3df1cf75f2 ; * etc/NEWS: Minor copyedits in the Fido mode entry. 2019-11-07 16:16:12 +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
Stefan Kangas
1428dfe630 Test that comint-password-prompt-regexp matches "git push"
* test/lisp/comint-tests.el (comint-testsuite-password-strings): Test
that 'comint-password-prompt-regexp' matches 'git push'
output.  (Bug#20910)
2019-11-07 01:48:13 +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
Paul Eggert
b5bcc6f9ea Simplify fixnum division slightly
* src/data.c (arith_driver): Streamline fixnum division a bit
more, and add a comment about why overflow is impossible.
This responds to a private comment by Stefan Monnier.
2019-11-06 11:48:23 -08: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
Eli Zaretskii
e72a48ee8b Minor fix in the Emacs manual
* doc/emacs/msdos.texi (ls in Lisp): Fix the description of
'ls-lisp-verbosity'.  (Bug#38077)
2019-11-06 19:22:11 +02: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