Commit graph

139364 commits

Author SHA1 Message Date
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
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
Paul Eggert
2b1dc8c26e Update from Gnulib
This incorporates:
2019-10-24 timespec-add, timespec-sub: simplify
* lib/timespec-add.c, lib/timespec-sub.c:
Copy from Gnulib.
2019-11-05 22:59:27 -08:00
Paul Eggert
6039acb861 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).
2019-11-05 22:55:51 -08: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
edec35aa94 * admin/unidata/uvs.el: Use lexical-binding 2019-11-05 15:05:38 -05: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
Paul Eggert
799d738bc7 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.
2019-11-04 23:39:55 -08:00
Paul Eggert
5ab29400a4 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.
2019-11-04 23:39:54 -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
Eli Zaretskii
a256e03bd9 Fix last change in dired.c
* src/dired.c (file_name_completion): Fix arguments to
Fcompare_strings.  (Bug#38056)
2019-11-04 17:39:12 +02: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
Paul Eggert
8ae7c8866d Improve time documentation a bit more
* doc/lispref/os.texi (Time of Day, Time Conversion)
(Time Parsing, Time Calculations): Improve doc.
2019-11-03 17:38:33 -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
fc6f1f59fe Fix doc of font-lock-syntactic-face-function
* doc/lispref/modes.texi (Syntactic Font Lock): Don't refer to
no-longer-existing OTHER-VARS (bug#17730) and include an example.
2019-11-03 17:20:35 +01:00
Eli Zaretskii
2ad06e28e3 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.
2019-11-03 18:13:38 +02:00
Eli Zaretskii
0b21ecdb5e 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)
2019-11-03 18:08:45 +02:00
Eli Zaretskii
3c86424a18 ; * src/font.c (Ffont_info): Minor fix of doc string. 2019-11-03 17:58:31 +02: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
Óscar Fuentes
e6b806f29e Fix data-directory when executing from an out-of-source build
Fixes #36828.

* src/callproc.c (init_callproc): detect out-of-source build.
2019-11-02 18:04:00 +01: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
3937c9f6e2 Further fixup of the previous doc fix in the Faces node
* doc/lispref/display.texi (Faces): Improve wording from previous
change.
2019-11-02 16:05:42 +01: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