João Távora [Fri, 8 Nov 2019 23:44:44 +0000 (23:44 +0000)]
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.
Alan Mackenzie [Sat, 9 Nov 2019 14:30:52 +0000 (14:30 +0000)]
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.
Alan Mackenzie [Sat, 9 Nov 2019 12:09:30 +0000 (12:09 +0000)]
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.
Eli Zaretskii [Sat, 9 Nov 2019 09:53:02 +0000 (11:53 +0200)]
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)
* 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.
João Távora [Fri, 8 Nov 2019 00:11:34 +0000 (00:11 +0000)]
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.
Robert Pluim [Thu, 7 Nov 2019 15:16:39 +0000 (16:16 +0100)]
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.
Eli Zaretskii [Thu, 7 Nov 2019 17:11:23 +0000 (19:11 +0200)]
Revert "Don't flash previous buffer when connecting with emacsclient"
This reverts commit 49fc040077b33bd1e78ee425575e76329b772a41.
It turns out that the fix for a minor aesthetical annoyance
caused much more serious bugs: bug#31038, bug#35726, Bug#37097,
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
Michael Albinus [Thu, 7 Nov 2019 11:03:19 +0000 (12:03 +0100)]
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.
Stefan Kangas [Thu, 7 Nov 2019 03:10:43 +0000 (04:10 +0100)]
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)
Juri Linkov [Wed, 6 Nov 2019 23:14:58 +0000 (01:14 +0200)]
* 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.
Juri Linkov [Wed, 6 Nov 2019 22:59:28 +0000 (00:59 +0200)]
* 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.
Paul Eggert [Wed, 6 Nov 2019 19:47:39 +0000 (11:47 -0800)]
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.
Alan Mackenzie [Wed, 6 Nov 2019 19:35:43 +0000 (19:35 +0000)]
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.
Stephen Gildea [Wed, 6 Nov 2019 16:31:48 +0000 (08:31 -0800)]
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.
Stefan Kangas [Wed, 6 Nov 2019 13:48:23 +0000 (14:48 +0100)]
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.
Paul Eggert [Wed, 6 Nov 2019 06:55:23 +0000 (22:55 -0800)]
Remove unneeded overflow check in integer division
* src/data.c (arith_driver): Remove unnecessary runtime test,
since integer overflow is impossible on division of fixnums,
given that the worst case is MOST_NEGATIVE_FIXNUM / -1 which is
representable as an EMACS_INT (albeit not as a fixnum).
Stefan Kangas [Wed, 6 Nov 2019 00:19:23 +0000 (01:19 +0100)]
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.
Stefan Kangas [Tue, 5 Nov 2019 23:58:57 +0000 (00:58 +0100)]
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.
Stefan Kangas [Tue, 5 Nov 2019 23:49:02 +0000 (00:49 +0100)]
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.
Juri Linkov [Tue, 5 Nov 2019 23:21:57 +0000 (01:21 +0200)]
* 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.
* 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.
Paul Eggert [Tue, 5 Nov 2019 21:43:44 +0000 (13:43 -0800)]
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
Robert Pluim [Thu, 24 Jan 2019 13:35:30 +0000 (14:35 +0100)]
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.
Paul Eggert [Tue, 5 Nov 2019 07:17:06 +0000 (23:17 -0800)]
Overflow errors are range errors
* etc/NEWS: Mention this.
* doc/lispref/errors.texi (Standard Errors):
Document overflow-error, which was formerly undocumented.
It is a range error, not a domain error.
* src/data.c (syms_of_data): overflow-error and (undocumented)
underflow-error are subtypes range-error, not domain-error.
This fixes bugs in timezone-time-from-absolute and in
erc-ctcp-reply-PING.
Paul Eggert [Tue, 5 Nov 2019 07:10:12 +0000 (23:10 -0800)]
Don’t signal overflow for (expt 1 bignum)
Similarly for (expt 0 bignum) and (expt -1 bignum).
The result is always a -1, 0 or 1, so do not signal overflow.
* src/data.c (expt_integer): Do not signal an overflow if
-1 <= X <= 1. Be clearer about when overflow is signaled.
* test/src/floatfns-tests.el (bignum-expt): Test this.
Stephen Gildea [Mon, 4 Nov 2019 02:36:05 +0000 (18:36 -0800)]
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.
Juri Linkov [Sun, 3 Nov 2019 21:48:53 +0000 (23:48 +0200)]
* 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.
Juri Linkov [Sun, 3 Nov 2019 21:44:44 +0000 (23:44 +0200)]
* 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.
Stefan Kangas [Sun, 3 Nov 2019 16:45:48 +0000 (17:45 +0100)]
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>
Eli Zaretskii [Sun, 3 Nov 2019 16:13:38 +0000 (18:13 +0200)]
Fix file-tests.el on MS-Windows
* test/lisp/files-tests.el
(files-tests-file-name-non-special-start-file-process): On
MS-Windows, wait till the process dies before returning from
the files-tests--with-temp-non-special macro, to ensure the
temporary directory is successfully deleted.
Eli Zaretskii [Sun, 3 Nov 2019 16:08:45 +0000 (18:08 +0200)]
Fix case-insensitive completion of non-ASCII file names
* src/dired.c (scmp): Comment on (non)applicability to
comparisons of non-ASCII strings case-insensitively.
(file_name_completion): Decode early the file names read from
the directory, and use the decoded names for comparison when
letter-case should be ignored. (Bug#11339)
* 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.
João Távora [Sat, 2 Nov 2019 16:38:53 +0000 (16:38 +0000)]
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.
* lisp/progmodes/flymake.el (flymake--diagnostics-buffer-entries):
Use type names.
(flymake-error, flymake-warning, flymake-note): Give these
diagnostic categories default type names.
Eli Zaretskii [Sat, 2 Nov 2019 10:41:51 +0000 (12:41 +0200)]
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)
Eli Zaretskii [Sat, 2 Nov 2019 07:52:39 +0000 (09:52 +0200)]
Revert "Omit edition numbers and dates in manuals"
This reverts commit 2f42832895942fdeaa0c500511aa19860fa806cd.
Editions of Emacs manuals must be coordinated with the FSF
publishing staff, as they appear on the printed books.
João Távora [Thu, 31 Oct 2019 10:58:38 +0000 (10:58 +0000)]
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.
João Távora [Thu, 31 Oct 2019 20:19:35 +0000 (20:19 +0000)]
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.
Stefan Kangas [Sat, 2 Nov 2019 00:30:36 +0000 (01:30 +0100)]
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.
Paul Eggert [Sat, 2 Nov 2019 00:24:02 +0000 (17:24 -0700)]
Omit edition numbers and dates in manuals
These seem to cause more confusion than they cure; e.g.,
https://shop.fsf.org/books/gnu-emacs-manual-18th-edition-v-261
currently advertises "18th edition" even as it points to
https://www.gnu.org/software/emacs/manual/pdf/emacs.pdf
which says "Seventeenth Edition". It is simpler and less
confusing to stick to one version number like "26.3". If we
need a separate edition number for each printed manual for
some reason (marketing?) we can put “@ifset printed-edition”
around anything specific to the printed editions.
(as opposed to online PDF copies).
* doc/emacs/emacs.texi (EDITION):
* doc/lispintro/emacs-lisp-intro.texi (edition-number, update-date):
* doc/lispref/elisp.texi (VERSION, DATE):
Remove, and remove uses.
Paul Eggert [Fri, 1 Nov 2019 23:13:31 +0000 (16:13 -0700)]
Document limits on some time-conversion functions
* doc/lispref/os.texi (Time of Day, Time Zone Rules)
(Time Conversion, Time Parsing, Time Calculations):
Document functions that limit the range of time values
due to OS limits (Bug#37974).