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).
Filipp Gunbin [Thu, 31 Oct 2019 18:39:01 +0000 (21:39 +0300)]
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.
Paul Eggert [Fri, 1 Nov 2019 06:31:17 +0000 (23:31 -0700)]
Fix insert-file-contents file error regression
Problem reported for dired-view-file (Bug#37950).
* src/fileio.c (Finsert_file_contents): When visiting,
signal an error if the file could not be opened for any reason,
rather than signaling an error only for nonexistent files, fixing
a bug introduced in 2019-09-16T03:17:43!eggert@cs.ucla.edu.
* 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.
Eric Ludlam [Mon, 28 Oct 2019 01:01:54 +0000 (21:01 -0400)]
* test/lisp/cedet/semantic-utest-ia.el: Update from upstream
Merge content from CEDET on SF to bring in additional test points
and support more types of languages.
(semantic-utest-ia-struct.cpp, semantic-utest-ia-templates.cpp)
(semantic-utest-ia-using.cpp, semantic-utest-ia-nsp.cpp)
(semantic-utest-ia-localvars.cpp, semantic-utest-ia-varnamse.java)
(semantic-utest-ia-wisent.wy, semantic-utest-ia-texi)
(semantic-utest-ia-make, semantic-utest-ia-srecoder): New test points
(semantic-ia-utest-buffer): Use comment-start-skip when looking
for test point tokens.
Capture errors ignoring debugger to enable test for empty results.
Improve output from test diagnostics.
(semantic-ia-utest-buffer-refs): Use comment-start-skip to find
test point tokens.
Author: Eric Ludlam <zappo@gnu.org>
Eric Ludlam [Mon, 28 Oct 2019 00:51:54 +0000 (20:51 -0400)]
* test/manual/cedet/tests/test*: More updates from upstream
* test/manual/cedet/tests/testjavacomp.java,
test/manual/cedet/tests/testnsp.cpp,
test/manual/cedet/tests/testsppcomplete.c,
test/manual/cedet/tests/testtypedefs.cpp,
test/manual/cedet/tests/testvarnames.c:
Merge content from CEDET on SF with extended test points for use with
test/lisp/cedet/semantic-utest-ia.el
Author: Eric Ludlam <zappo@gnu.org>
Eric Ludlam [Mon, 28 Oct 2019 00:36:17 +0000 (20:36 -0400)]
* test/manual/cedet/tests/testdoublens.cpp: Update from upstream
* test/manual/cedet/tests/testdoublens.hpp:
Merge content from CEDET on SF with extended test points for use with
test/lisp/cedet/semantic-utest-ia.el
Author: Eric Ludlam <zappo@gnu.org>
Eric Ludlam [Mon, 28 Oct 2019 00:31:34 +0000 (20:31 -0400)]
* test/manual/cedet/tests/: New files for semantic-utest-ia.el
* test/manual/cedet/tests/test.mk,
test/manual/cedet/tests/test.srt, test/manual/cedet/tests/test.texi,
test/manual/cedet/tests/testlocalvars.cpp,
test/manual/cedet/tests/teststruct.cpp,
test/manual/cedet/tests/testtemplates.cpp,
test/manual/cedet/tests/testusing.cpp,
test/manual/cedet/tests/testusing.hh,
test/manual/cedet/tests/testvarnames.java.
test/manual/cedet/tests/testwisent.wy:
New files to be used by test/lisp/cedet/semantic-utest-ia.el.
Author: Eric Ludlam <zappo@gnu.org>
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.
* 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).
* 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.
Robert Pluim [Thu, 31 Oct 2019 09:52:20 +0000 (10:52 +0100)]
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.
* 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.
Paul Eggert [Wed, 30 Oct 2019 21:40:06 +0000 (14:40 -0700)]
Fix print.c infloop on circular lists
Fix infinite loops in print.c when a circular list is passed
to command-error-default-function or to error-message-string.
* src/print.c (print_error_message):
Use FOR_EACH_TAIL to avoid infloop on circular lists.
(print_object): Use FOR_EACH_TAIL_SAFE, as it uses
Brent’s teleporting tortoise-hare algorithm which is
asymptotically better than the classic tortoise-hare
algorithm that the code wsas using.
* test/src/print-tests.el (print-circle-2): When print-circle
is nil, do not insist on a particular cycle-detection heuristic.
(error-message-string-circular): New test.
Paul Eggert [Wed, 30 Oct 2019 21:24:29 +0000 (14:24 -0700)]
Fix keyboard.c infloops on circular lists
Fix infinite loops in keyboard.c when a circular list is
found in a hook, or in help-event-list, or in the argument
of event-convert-list, or in a keymap where a Lucid event
type list is expected, or in a menu or tab spec.
* src/keyboard.c (safe_run_hooks_error, menu_bar_items)
(parse_menu_item, parse_tab_bar_item, parse_tool_bar_item):
Use FOR_EACH_TAIL to avoid infloop on circular lists.
(help_char_p, Fevent_convert_list, lucid_event_type_list_p):
Use FOR_EACH_TAIL_SAFE to avoid infloop on circular lists,
when the action is idempotent so a circular list can be
treated as a noncircular one.
Paul Eggert [Wed, 30 Oct 2019 21:17:40 +0000 (14:17 -0700)]
Fix fileio.c infloops on circular lists
Fix infinite loops in fileio.c when a circular list is the
value of after_insert_file_functions,
buffer-auto-save-file-format, buffer-file-format, or
write-region-annotate-functions.
* src/fileio.c (Finsert_file_contents, build_annotations):
Use FOR_EACH_TAIL to avoid infloop on circular lists.
(build_annotations): Use an EMACS_INT, not an int, to count
nesting level.
* test/src/fileio-tests.el:
(fileio-tests--circular-after-insert-file-functions): New test.
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).
* 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.
* 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.
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.
Juri Linkov [Wed, 30 Oct 2019 00:00:02 +0000 (02:00 +0200)]
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.