* test/src/emacs-module-tests.el (emacs-module-tests--generic): New
helper function.
(module-function-object, mod-test-userptr-fun-test): Test that type
dispatching works with module types.
Philipp Stephani [Thu, 21 Dec 2017 17:25:49 +0000 (18:25 +0100)]
Prevent name clashes between CL structures and builtin types
* lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Don't allow
structures with the same names as builtin types.
(cl--typeof-types, cl--all-builtin-types): Move from cl-generic.el and
rename.
(cl--struct-name-p): New helper function.
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Don't allow structures
with the same names as builtin types.
* lisp/emacs-lisp/cl-generic.el (cl--generic-typeof-generalizer)
(cl-generic-generalizers): Adapt to name change.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-defstruct/builtin-type):
* test/lisp/emacs-lisp/cl-preloaded-tests.el
(cl-struct-define/builtin-type): New unit tests.
Alan Mackenzie [Sun, 28 Jan 2018 17:53:07 +0000 (17:53 +0000)]
Fix some errors in c-display-defun-name when the type is "struct {..}", etc.
Also fix some errors with c-display-defun-name when there are nested classes.
* lisp/progmodes/cc-cmds.el (c-in-function-trailer-p): Deal with a struct {..}
being merely the type of a function.
(c-where-wrt-brace-construct): Deal with a struct {..} being merely the type
of a function. Rearrange the order of some Lisp forms. Insert a check for
c-protection-key ("private", etc.) alongside the checking for a label.
(c-defun-name-1): New function extracted form c-defun-name, which works within
the existing restriction. Don't regard 'at-function-end as being within the
defun any more. Recognize "struct", etc., with the new
c-defun-type-name-decl-key rather than c-type-prefix-key. Make the
recognition of a normal function more accurate.
(c-defun-name): Part left after extracting the above function. It now just
widens and calls c-defun-name-1.
(c-declaration-limits-1): New function extracted from c-declaration-limits,
which works within the existing restriction. Move LIM back one block to
account for the possibility of struct {..} as a function type. Check we're
not inside a declaration without braces.
(c-declaration-limits): Part left after extracting the above function. It now
just narrows to an enclosing decl block and calls c-declaration-limits-1.
(c-defun-name-and-limits): New function which identifies the name and limits
of the most nested enclosing declaration or macro.
(c-display-defun-name): Use c-defun-name-and-limits rather than two separate
functions (which didn't always agree on which function).
* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1): If we have struct
{..} as the type of a function, go back over this, too.
* lisp/progmodes/cc-langs.el (c-defun-type-name-decl-kwds)
(c-defun-type-name-decl-key): New lang const/var.
Noam Postavsky [Tue, 23 Jan 2018 23:50:23 +0000 (18:50 -0500)]
Fix round tripping of read->print for symbols with strange quotes
Since 2017-07-22 "Signal error for symbol names with strange
quotes (Bug#2967)", symbol names beginning with certain quote
characters require an escaping backslash. However, the corresponding
change for printing missed, so that (eq (read (prin1-to-string SYM))
SYM) does not give `t' for such symbols.
* src/character.c (confusable_symbol_character_p): New function,
extracted from test `read1'.
* src/lread.c (read1): Use it.
* src/print.c (print_object): Use it to print a backslash for symbols
starting with characters that `read1' requires to be escaped.
* test/src/print-tests.el (print-read-roundtrip): New test.
* etc/NEWS.26:
* etc/NEWS: Clarify the announcement for the earlier reader
change (Bug#30217).
Simen Heggestøyl [Sun, 28 Jan 2018 14:35:46 +0000 (15:35 +0100)]
Shorten CSS hex colors when possible
* lisp/textmodes/css-mode.el (css--format-hex): New function for
shortening CSS hex colors when possible.
(css--named-color-to-hex, css--rgb-to-named-color-or-hex): Use it.
* test/lisp/textmodes/css-mode-tests.el (css-test-format-hex): New
tests for 'css--format-hex'.
(css-test-named-color-to-hex, css-test-cycle-color-format): Adjust for
the changes to 'css--named-color-to-hex' and
'css--rgb-to-named-color-or-hex'.
Noam Postavsky [Mon, 11 Dec 2017 23:53:34 +0000 (18:53 -0500)]
Raise limit of regexp repetition (Bug#24914)
* src/regex.h (RE_DUP_MAX): Raise limit to 2^16-1.
* etc/NEWS: Announce it.
* doc/lispref/searching.texi (Regexp Backslash): Document it.
* test/src/regex-tests.el (regex-repeat-limit): Test it.
* src/regex.h (reg_errcode_t): Add REG_ESIZEBR code.
* src/regex.c (re_error_msgid): Add corresponding entry.
(GET_INTERVAL_COUNT): Return it instead of the more generic REG_EBADBR
when encountering a repetition greater than RE_DUP_MAX.
* lisp/isearch.el (isearch-search): Don't convert errors starting with
"Invalid" into "incomplete". Such errors are not incomplete, in the
sense that they cannot be corrected by appending more characters to
the end of the regexp. The affected error messages are:
- REG_BADPAT "Invalid regular expression"
- \\(?X:\\) where X is not a legal group number
- \\_X where X is not < or >
- REG_ECOLLATE "Invalid collation character"
- There is no code to throw this.
- REG_ECTYPE "Invalid character class name"
- [[:foo:] where foo is not a valid class name
- REG_ESUBREG "Invalid back reference"
- \N where N is referenced before matching group N
- REG_BADBR "Invalid content of \\{\\}"
- \\{N,M\\} where N < 0, M < N, M or N larger than max
- \\{NX where X is not a digit or backslash
- \\{N\\X where X is not a }
- REG_ERANGE "Invalid range end"
- There is no code to throw this.
- REG_BADRPT "Invalid preceding regular expression"
- We never throw this. It would usually indicate a "*" with no
preceding regexp text, but Emacs allows that to match a literal
"*".
Noam Postavsky [Sat, 27 Jan 2018 01:45:38 +0000 (20:45 -0500)]
Merge from emacs-26
463f96b481 * doc/lispref/searching.texi: Document regexp repetition l... 08a6195571 ; test/README: Document TEST_LOAD_EL parameter. 7bbea90b1a * src/syntax.c (char-syntax): Warn about ignoring text pro... 50fcbb5f61 ; * src/process.c (Fprocess_contact): Fix docstring typo. 81ae9c8c05 Load mm-util as needed for url-file and url-data (Bug#30258) 5a1ee67ae1 Another minor copyedit in the manual's "Scroll Bars" 226a651e9e Minor fix in documentation of 'equal' b26786c8d9 * lisp/dired-x.el (dired-guess-shell-alist-user): Doc fix.... 5699a824f0 Minor rewording in Emacs manual's "Help Mode" node f35ff0156e Fixes for Emacs manual in frames.texi 6cd4e8dcc5 * doc/misc/cl.texi (Efficiency Concerns): Fix 2012-10-27 t... 1412cf3edd Fix a few issues with latest GTK scaling changes 59db8dca03 Use scaled coordinates when calling into GTK 2892f05792 Scale monitor dimensions obtained from GTK
Eli Zaretskii [Fri, 26 Jan 2018 13:48:30 +0000 (15:48 +0200)]
Another minor copyedit in the manual's "Scroll Bars"
* doc/emacs/frames.texi (Scroll Bars): Mention that up/down and
left/right buttons may be absent from the toolkit scroll bars.
Reported by Robert Pluim <rpluim@gmail.com> in
emacs-manual-bugs@gnu.org.
Andy Moreton [Fri, 26 Jan 2018 10:09:42 +0000 (12:09 +0200)]
Fix emacs-module-tests to work out of build tree
* test/Makefile.in (test_module_dir): Build the test module library in
a subdirectory of the build directory (not the source tree).
(MODULE_CFLAGS): Fix location of emacs-module.h header file.
(test_module): Move built library out of the source tree.
* test/src/emacs-module-tests.el (mod-test-file): Locate the test module
library relative to the running Emacs executable.
Eli Zaretskii [Fri, 26 Jan 2018 09:43:05 +0000 (11:43 +0200)]
Minor rewording in Emacs manual's "Help Mode" node
* doc/emacs/help.texi (Help Mode): Minor rewording of description
of 'help-follow-symbol'. Suggested by Richard Stallman
<rms@gnu.org> in emacs-manual-bugs@gnu.org.
Eli Zaretskii [Fri, 26 Jan 2018 09:25:24 +0000 (11:25 +0200)]
Fixes for Emacs manual in frames.texi
* doc/emacs/frames.texi (Scroll Bars, Mouse Commands)
(Window Dividers): Minor clarifications and spelling/markup
changes. Suggested by Robert Pluim <rpluim@gmail.com> in
emacs-manual-bugs@gnu.org.
Juri Linkov [Thu, 25 Jan 2018 21:40:52 +0000 (23:40 +0200)]
* lisp/arc-mode.el (archive-extract): Let-bind `create-lockfiles' to nil
to prevent directory time modification by lock_file on visiting
a file from archive. (Bug#30215)
(archive-summarize): Let-bind `create-lockfiles' to nil
instead of `buffer-file-truename'.
Robert Pluim [Wed, 24 Jan 2018 07:55:34 +0000 (08:55 +0100)]
Use scaled coordinates when calling into GTK
This is part two of a two part fix for the GTK scaling
problems. See the thread starting at
http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00372.html
for an explanation of why it has been added to Emacs 26.
* src/gtkutil.c (xg_set_geometry): Scale down the coordinates that we
pass to gtk_window_move and to gtk_window_parse_geometry.
* src/xterm.c (x_set_offset): Likewise.
Robert Pluim [Wed, 24 Jan 2018 07:53:59 +0000 (08:53 +0100)]
Scale monitor dimensions obtained from GTK
This is part one of a two part fix for the GTK scaling
problems. See the thread starting at
http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00372.html
for an explanation of why it has been added to Emacs 26.
* src/xfns.c (Fx_display_monitor_attributes_list): Take scaling factor
into account when using GTK to query the monitor dimensions, which
allows frameset-restore to position frames correctly.
Stefan Monnier [Tue, 23 Jan 2018 19:13:50 +0000 (14:13 -0500)]
* lisp/net/imap.el: Use lexical-binding and cl-lib
Require packages instead of autoloading their functions.
(imap-send-command): Remove unused vars 'stream' and 'eol'.
(imap-parse-response): Use pcase.
(imap-parse-fetch): Remove unused arg 'response'.
Stefan Monnier [Tue, 23 Jan 2018 18:55:35 +0000 (13:55 -0500)]
* lisp/gnus/message.el: Tweak header font-lock and ecomplete completion
(message-font-lock-make-header-matcher): Delete.
(message-match-to-eoh): New function to replace it.
(message-font-lock-keywords): Use it.
(message-strip-forbidden-properties): Remove redundant binding.
(message-goto-body): Avoid called-interactively-p, only use
push-mark when called interactively.
(message-goto-body-1): Merge into message-goto-body. Redefine as alias.
(message-goto-eoh): Call message-goto-body interactively.
(message--in-tocc-p): New function, extracted from message-display-abbrev.
(message-ecomplete-capf): New function.
Stefan Monnier [Tue, 23 Jan 2018 17:14:48 +0000 (12:14 -0500)]
* lisp/ecomplete.el: Add completion-table; use lexical-binding and cl-lib
Also remove redundant :group args.
(ecomplete-database-file): Use locate-user-emacs-file.
(ecomplete-completion-table): New completion table.
(completion-category-defaults): Set default behavior for that table.
(ert-describe-test): Return the description text as well.
Remove left over version check.
* lisp/help-mode.el (describe-symbol-backends): Add docstring.
Juri Linkov [Mon, 22 Jan 2018 22:14:10 +0000 (00:14 +0200)]
Restore isearch correctly after M-e in special modes (bug#30187)
* lisp/isearch.el (isearch-suspended): New defvar.
(with-isearch-suspended): Set isearch-suspended to t
at the beginning, then set it back to nil at the end.
* lisp/comint.el (comint-history-isearch-backward)
(comint-history-isearch-backward-regexp): Set global value of
comint-history-isearch to t.
(comint-history-isearch-end): Reevaluate
comint-history-isearch when isearch-edit-string finishes.
* lisp/dired-aux.el (dired-isearch-filenames)
(dired-isearch-filenames-regexp): Set global value of
dired-isearch-filenames to t.
(dired-isearch-filenames-end): Reevaluate
dired-isearch-filenames when isearch-edit-string finishes.
Paul Eggert [Mon, 22 Jan 2018 16:43:54 +0000 (08:43 -0800)]
Merge from origin/emacs-26
1fc98ed073 ; Spelling fix bb396a369c Update Org to v9.1.6 fa582153f7 Use text-pixels values only when saving framesets (Bug#30141) 6b01b9475d Minor improvement in section "Pages" of the usere manual e8c8bd3de2 Minor improvements in user manual 26b8b92e63 Improve the "Mark" chapter of the user manual 759569fe40 Improve the "Buffers" chapter of the user manual c2e6d121ff * lisp/term.el (term-send-input): Fix text duplication in ... 854a1c0a61 Improve "Buffers" in the user manual
Michael Albinus [Mon, 22 Jan 2018 14:07:56 +0000 (15:07 +0100)]
Fix byte-compiler warning in tramp-sh.el
* lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
Use `set-process-coding-system' rather than interactive
`set-buffer-process-coding-system'.
Aaron Jensen [Mon, 22 Jan 2018 09:52:32 +0000 (10:52 +0100)]
Use text-pixels values only when saving framesets (Bug#30141)
* lisp/frameset.el (frameset-persistent-filter-alist): Specify
that text-pixels values are by default only saved by framesets
so the parameter is not set when restoring (Bug#30141).
Alan Mackenzie [Sun, 21 Jan 2018 18:29:26 +0000 (18:29 +0000)]
Handle C99 Compound Literals in return statements and argument lists.
* lisp/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): Recognize
a brace list when preceded by "return" or inside parentheses, either
immediately after the "(" or following a comma.
(c-looking-at-inexpr-block): Test c-has-compound-literals rather than hard
coded C++ Mode.
(c-guess-basic-syntax, CASE 7B): Test additionally for not being just inside a
parenthesis or being at a Java "new" keyword. CASE 9: Remove the simple
minded test on the contents of a block to determine a brace list.
* lisp/progmodes/cc-langs.el (c-has-compound-literals): New lang const and lang var.
Eli Zaretskii [Sun, 21 Jan 2018 17:45:14 +0000 (19:45 +0200)]
Minor improvements in user manual
* doc/emacs/trouble.texi (Emergency Escape, Contributing): Clarify
text. Suggested by Jonathan Kyle Mitchell <kyle@jonathanmitchell.org>
in emacs-manual-bugs@gnu.org
Eli Zaretskii [Sun, 21 Jan 2018 17:36:57 +0000 (19:36 +0200)]
Improve the "Mark" chapter of the user manual
* doc/emacs/mark.texi (Setting Mark, Marking Objects): Improve and
clarify wording. Suggested by John Cummings <john@rootabega.net>
in emacs-manual-bugs@gnu.org.
Paul Eggert [Sun, 21 Jan 2018 03:12:05 +0000 (19:12 -0800)]
Fix tempfile creation when byte compiling
This improves on the recent fix for master failing to build
on FreeBSD. Suggested by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2018-01/msg00600.html
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Put tempfile next to the target file, as was the original intent.
Michael Albinus [Sat, 20 Jan 2018 23:14:33 +0000 (00:14 +0100)]
Extend tramp-test02-file-name-dissect* tests
* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate): Test also
`tramp-default-method-alist', `tramp-default-user-alist' and
`tramp-default-host-alist'.
Eli Zaretskii [Sat, 20 Jan 2018 19:37:30 +0000 (21:37 +0200)]
Improve "Buffers" in the user manual
Suggested by John Cummings <john@rootabega.net> in
emacs-manual-bugs@gnu.org:
* doc/emacs/buffers.texi (Select Buffer): Add cross-references to
"Windows" and "Frames".
(Misc Buffer, Kill Buffer): Use BUFFER consistently in commands
that accept buffer names.
(Select Buffer): Improve description of "M-g M-g". Improve
wording.
(Misc Buffer, Kill Buffer): Improve wording.
(Kill Buffer): Fix the response required by kill-some-buffers.
Mention customizable options that control what clean-buffer-list
does.
(Several Buffers): More detail about
'Buffer-menu-unmark-all-buffers'.
Glenn Morris [Sat, 20 Jan 2018 16:23:30 +0000 (08:23 -0800)]
Merge from origin/emacs-26
cfc94fd (origin/emacs-26) Don't mention 'vc-stay-local' in the user m... 8ce430b Fix a typo in calendar.texi bb748b3 Minor improvement in wording of the Emacs manual b603aff Revert "Fix tempfile creation when byte compiling" 4fd446e Fix tempfile creation when byte compiling 7f48a11 Improve the Emacs manual as suggested in emacs-manual-bugs 728ded0 * lisp/emacs-lisp/bytecomp.el: Tweak last change c6c05e2 Unbreak building Emacs on FreeBSD a41ad3d Don't unnecessarily use non-ASCII characters in C sources c28d4b6 Portability fixes in emacs-module-tests 1d50c18 Add tests for term.el
Michael Albinus [Sat, 20 Jan 2018 15:26:02 +0000 (16:26 +0100)]
Use file notification in autorevert also for recreated files
* lisp/autorevert.el (auto-revert-mode)
(global-auto-revert-mode, auto-revert-notify-add-watch)
(auto-revert-notify-handler, auto-revert-handler): Do not use
buffer local `auto-revert-use-notify' anymore.
* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file): Adapt test in
order to check, that file notification is reenabled when possible.
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Do not follow a
definite article with an action verb in C-h help text. Use
'with-help-window' instead of 'with-output-to-temp-buffer'.
Simplify string concatenation. (Bug#30064)
Eli Zaretskii [Sat, 20 Jan 2018 08:56:15 +0000 (10:56 +0200)]
Fix a typo in calendar.texi
* doc/emacs/calendar.texi (Writing Calendar Files): Capitalize
"Filofax". Reported by Will Korteland <emacs-devel@korte.land>
in emacs-manual-bugs@gnu.org.
Eli Zaretskii [Sat, 20 Jan 2018 07:48:22 +0000 (09:48 +0200)]
Revert "Fix tempfile creation when byte compiling"
This reverts commit 4fd446e9f65e5531b18d4a0c5e08a6eeabc292d8:
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Put tempfile next to the target file, as was the original intent.
Paul Eggert [Fri, 19 Jan 2018 22:37:31 +0000 (14:37 -0800)]
Fix tempfile creation when byte compiling
This improves on the recent fix for master failing to build
on FreeBSD. Suggested by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2018-01/msg00600.html
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Put tempfile next to the target file, as was the original intent.
Eli Zaretskii [Fri, 19 Jan 2018 19:18:03 +0000 (21:18 +0200)]
Improve the Emacs manual as suggested in emacs-manual-bugs
* doc/emacs/killing.texi (Deletion and Killing): Add
cross-reference to "Kill Ring".
* doc/emacs/help.texi (Help Mode, Package Keywords): Improve
wording. Suggested by Will Korteland <emacs-devel@korte.land> in
emacs-manual-bugs@gnu.org.
Eli Zaretskii [Fri, 19 Jan 2018 15:31:54 +0000 (17:31 +0200)]
Unbreak building Emacs on FreeBSD
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't create
the temporary file under temporary-file-directory if the file
being compiled is specified by an absolute file name. This avoids
problems with ACL copying from temporary-file-directory on
FreeBSD. For the details, see
http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00513.html.