Eli Zaretskii [Wed, 10 May 2017 17:06:15 +0000 (20:06 +0300)]
Ensure cursor's foreground color is in sync with 'default' face
* src/w32term.c (x_set_cursor_gc): Don't reuse cursor GC if its
foreground color is different from the background of the glyph
string's face. (Bug#26851)
Eli Zaretskii [Wed, 10 May 2017 16:58:06 +0000 (19:58 +0300)]
Fix vertical cursor motion when columns are of unequal size
* lisp/simple.el (line-move-finish): In line-move-visual mode, use
vertical-motion to move to the goal column, as the goal column
should in that case be interpreted in units of frame's canonical
character width. (Bug#26852)
Tino Calancha [Wed, 10 May 2017 02:53:20 +0000 (11:53 +0900)]
Tweak a recent test
This test fails in my local machine because the data files
are compiled, and the test doesn't expect that.
* test/src/lread-tests.el (lread-test-bug26837): Match a suffix
ending with '.elc' when the data files are compiled.
Glenn Morris [Wed, 10 May 2017 01:31:46 +0000 (21:31 -0400)]
Put license information in each generated uni-*.el
* admin/unidata/unidata-gen.el (unidata-gen-file):
Get Copyright line from copyright.html.
Put information in file header, not separate README.
(unidata-gen-charprop): Mention the source location.
* lisp/international/README: Remove file.
Fix lisp-indent-region and indent-sexp (Bug#26619)
The new lisp-indent-region introduced in 2017-04-22 "Add new
`lisp-indent-region' that doesn't reparse the code." is broken because
it doesn't save the calculated indent amounts for already seen sexp
depths. Fix this by unifying the indent-sexp and lisp-indent-region
code. Furthermore, only preserve position 2 of the running parse
when the depth doesn't change.
* lisp/emacs-lisp/lisp-mode.el (lisp-ppss): Use an OLDSTATE that
corresponds with the start point when calling parse-partial-sexp.
(lisp-indent-state): New struct.
(lisp-indent-calc-next): New function, extracted from indent-sexp.
(indent-sexp, lisp-indent-region): Use it.
(lisp-indent-line): Take indentation, instead of parse state.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-mode-tests--correctly-indented-sexp): New constant.
(lisp-indent-region, lisp-indent-region-defun-with-docstring):
(lisp-indent-region-open-paren, lisp-indent-region-in-sexp): New
tests.
Dmitry Gutov [Wed, 10 May 2017 00:34:16 +0000 (03:34 +0300)]
Simplify url-encode-url and add a test
* lisp/url/url-util.el (url-encode-url): Simplify.
url-generic-parse-url copes with multibyte strings just fine
(https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24117#185).
* test/lisp/url/url-parse-tests.el
(url-generic-parse-url/multibyte-host-and-path): New test.
Glenn Morris [Tue, 9 May 2017 23:44:09 +0000 (19:44 -0400)]
Put re-loaded file back at start of load-history (bug#26837)
* src/lread.c (readevalloop): Fix the "whole buffer" check to
operate in the correct buffer.
(Feval_buffer): Move point back to the start after checking
for lexical binding.
* test/src/lread-tests.el (lread-test-bug26837): New test.
* test/data/somelib.el, test/data/somelib2.el: New test data files.
Noam Postavsky [Tue, 9 May 2017 02:17:53 +0000 (22:17 -0400)]
Revert "Output number of characters added to file (Bug#354)"
The extra message text turned out to be quite annoying in practice,
and is generally more trouble than it's worth. Also revert several
related changes.
Partially revert "Handle `write-region' messages in Tramp properly"
Revert "New var write-region-verbose, default nil"
Revert "* src/fileio.c (write_region): Don't say "1 characters". (Bug#26796)"
Revert "Minor tuneup of write-region change"
Revert "Adjust write-region so file name is at the beginning again"
Revert "Fix handling of non-integer START param to write-region"
Revert "Output number of characters added to file (Bug#354)"
Ken Brown [Mon, 8 May 2017 19:11:23 +0000 (15:11 -0400)]
Skip a test from filenotify-tests.el on Cygwin
* test/lisp/filenotify-tests.el (file-notify-test02-rm-watch):
Skip the last part of the test on Cygwin; it fails due to timing
issues.
(file-notify--test-read-event): Remove `sit-for' that was added
for Cygwin.
Paul Eggert [Mon, 8 May 2017 17:46:21 +0000 (10:46 -0700)]
Merge from gnulib
This incorporates:
2017-05-08 intprops: don’t depend on ‘verify’
2017-05-07 utimens: on native Windows, improve resolution if fd < 0
2017-05-07 utimens: Improve error code on native Windows
* lib/intprops.h, lib/utimens.c: Copy from gnulib.
Wilson Snyder [Mon, 8 May 2017 17:44:47 +0000 (13:44 -0400)]
Fix various verilog-mode.el issues.
* lisp/progmodes/verilog-mode.el (verilog-read-decls): Fix SystemVerilog
2012 import breaking AUTOINST. Reported by Johannes Schaefer.
(verilog-auto-wire-type, verilog-insert-definition): Fix AUTOWIRE using
logic in top-level non-SystemVerilog module, bug1142. Reported by Marcin K.
(verilog-define-abbrev-table) (verilog-mode-abbrev-table): Don't expand
abbrev inside comment/strings, bug1102. Reported by Slava Yuzhaninov.
(verilog-auto): Fix AUTORESET widths pulling from AUTOREGINPUT,
msg2143. Reported by Galen Seitz.
(verilog-modify-compile-command): Fix expansion of __FLAGS__ when
compile-command is globally set, bug1119. Reported by Galen Seitz.
Fix glyph string generation for multi-font compositions (Bug#26742)
* src/xdisp.c (glyph_string_containing_background_width): New function.
(draw_glyphs): Use it to get correct background width.
(compute_overhangs_and_x): Don't change x in the middle of composite
characters.
Alan Mackenzie [Sun, 7 May 2017 09:27:00 +0000 (09:27 +0000)]
CC Mode internal cache: Handle a cache pos being inside a two-char construct.
Cache c-state-semi-nonlit-pos-cache was failing when a cache position was,
e.g., between the two characters of an opening comment "/*", and additionally
there were an odd number of quote marks (apostrophes) in the comment. This
happened in .../src/xdisp.c in the Emacs master branch around 2017-05-02 at
buffer position 615001.
* lisp/progmodes/cc-defs.el (c-emacs-features): Repurpose symbol
pps-extended-state to mean that there are at least 11 elements in the parser
state.
* lisp/progmodes/cc-engine.el (c-cache-to-parse-ps-state)
(c-parse-ps-state-to-cache): Rewrite these to use enhanced cache element list
types which indicate potentially being inside two-char constructs.
(c-parse-ps-state-below): Rewrite to use the new versions of the above two
functions.
Glenn Morris [Sun, 7 May 2017 01:20:21 +0000 (18:20 -0700)]
Evaluate mh-require when compiling
* lisp/mh-e/mh-alias.el, lisp/mh-e/mh-folder.el:
* lisp/mh-e/mh-gnus.el, lisp/mh-e/mh-search.el:
Evaluate mh-require when compiling, as require is automatically.
* lisp/mh-e/mh-gnus.el: No longer disable byte-compilation.
Paul Eggert [Sun, 7 May 2017 01:00:23 +0000 (18:00 -0700)]
New var write-region-verbose, default nil
By popular demand, write-region char counts are now off by default
(Bug#26796).
* src/fileio.c (write-region-verbose): New Lisp var.
(write_region): Output char count only if the var is non-nil.
* doc/emacs/files.texi (Misc File Ops), etc/NEWS: Document this.
Glenn Morris [Sun, 7 May 2017 00:58:20 +0000 (17:58 -0700)]
Write autoloads file atomically
* lisp/emacs-lisp/autoload.el (autoload--save-buffer):
New function, to save buffer atomically.
(autoload-save-buffers, update-directory-autoloads):
Use autoload--save-buffer.
* lisp/Makefile.in ($(lisp)/loaddefs.el):
No longer write to a temp file by hand.
Paul Eggert [Sat, 6 May 2017 22:29:16 +0000 (15:29 -0700)]
Port .gdbinit to GDB 7.11.1 + Python 2.7.12
* src/.gdbinit (Lisp_Object_Printer.to_string):
Explicitly convert integer val to 'int', so that
older GDBs do not complain about the conversion.
* src/lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]:
Give the struct a tag, so that older GDB pretty-printers have a
tag to hang their hat on.
Paul Eggert [Sat, 6 May 2017 21:24:12 +0000 (14:24 -0700)]
Pretty-print const Lisp_Objects in .gdbinit
* src/.gdbinit (Emacs_Pretty_Printers.__call__):
Compare unqualified type to Lisp_Object, to do the right thing
when the expression has type ‘Lisp_Object const’.
Problem reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00138.html
Paul Eggert [Sat, 6 May 2017 21:21:19 +0000 (14:21 -0700)]
Pacify GCC setjmp/longjmp warning
* src/eval.c (internal_lisp_condition_case): Do not modify local
var VAR, to pacify GCC’s setjmp/longjmp warning which in some
cases mistakenly diagnoses VAR possibly being modified between a
setjmp and a longjmp.
Philipp Stephani [Sat, 22 Apr 2017 16:04:29 +0000 (18:04 +0200)]
Introduce new misc type for module function
This resolves a couple of FIXMEs in emacs-module.c.
* src/lisp.h (MODULE_FUNCTIONP, XMODULE_FUNCTION): New functions.
* src/alloc.c (make_module_function): New function.
(mark_object): GC support.
* src/data.c (Ftype_of, syms_of_data): Handle module function type.
* src/print.c (print_object): Print support for new type.
* src/emacs-module.c (module_make_function, Finternal_module_call):
Use new module function type, remove FIXMEs.
(module_format_fun_env): Adapt and give it external linkage.
* test/src/emacs-module-tests.el (module-function-object): Add unit
test.
Eli Zaretskii [Sat, 6 May 2017 08:22:44 +0000 (11:22 +0300)]
Turn on GC_CHECK_MARKED_OBJECTS by default under ENABLE_CHECKING
* src/alloc.c (GC_CHECK_MARKED_OBJECTS): Define to 1 by default of
ENABLE_CHECKING is defined.
(mark_object): Test for GC_CHECK_MARKED_OBJECTS being non-zero,
instead of being defined.
Tom Tromey [Thu, 5 Jan 2017 14:11:06 +0000 (07:11 -0700)]
Fix erc-join with channel password
Bug#25349
* lisp/erc/erc-join.el (erc-autojoin-after-ident): Switch order of
server names.
(erc-autojoin-channels, erc-autojoin-add, erc-autojoin-remove):
Likewise.
(erc-server-join-channel): Move to erc.el.
* lisp/erc/erc.el (erc-server-join-channel): Move from erc-join.el.
(erc-cmd-JOIN): Use erc-server-join-channel.
Glenn Morris [Sat, 6 May 2017 01:44:09 +0000 (21:44 -0400)]
Decruftify dns-mode.el a little bit
* lisp/textmodes/dns-mode.el (dns-mode-control-entities):
New constant.
(dns-mode-control-entity, dns-mode-bad-control-entity)
(dns-mode-type, dns-mode-class): New faces.
(dns-mode-control-entity-face, dns-mode-bad-control-entity-face)
(dns-mode-type-face, dns-mode-class): Make these variables use the
new faces, and mark as obsolete.
(dns-mode-font-lock-keywords): Use dns-mode-control-entities.
Paul Eggert [Fri, 5 May 2017 22:59:24 +0000 (15:59 -0700)]
Pretty-print Lisp_Object values in GDB
* src/.gdbinit: Add a pretty-printer for Lisp_Object values. Now,
GDB displays them as "XIL(0xXXX)" rather than displaying them
as "..." when CHECK_LISP_OBJECT_TYPE is in effect and as "DDDDD"
otherwise.
Dmitry Gutov [Fri, 5 May 2017 00:43:07 +0000 (03:43 +0300)]
cl-defmethod: Make the edebug spec more technically correct
* lisp/emacs-lisp/cl-generic.el (cl-defmethod): Denote the
edebug spec part for qualifiers as [&rest atom], per
http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00053.html.
Mike Kupfer [Thu, 4 May 2017 22:30:17 +0000 (14:30 -0800)]
Fix MH-E not to load cl at runtime (Bug#25552)
* lisp/mh-e/mh-acros.el (defun-mh): Check at runtime, not
compile time, whether the target is bound.
* lisp/mh-e/mh-compat.el: Enable compilation. Pull in
mh-acros at compile time. Authored-by: Glenn Morris <rgm@gnu.org>, Noam Postavsky
<npostavs@users.sourceforge.net>
Multiline support in NS "Open Selected File" service.
* lisp/term/ns-win.el (ns-open-file-service): new function. Wraps the
original call in a (split-string) to create as many calls as there
are lines.
(ns-spi-service-call): Call `ns-open-file-service' instead of
`dnd-open-file'.
Tino Calancha [Thu, 4 May 2017 10:47:45 +0000 (19:47 +0900)]
Inherit incompatible/obsolete package faces from error
Don't use the same face for installed packages as for incompatible
or obsolete ones.
* lisp/emacs-lisp/package.el (package-status-incompat): Inherit from error.
Paul Eggert [Thu, 4 May 2017 01:21:20 +0000 (18:21 -0700)]
Spelling fixes
* lisp/gnus/nndiary.el (nndiary-last-occurrence):
Rename from nndiary-last-occurence.
(nndiary-next-occurrence):
Rename from nndiary-next-occurence. All uses changed.
Tom Tromey [Wed, 25 Jan 2017 07:53:49 +0000 (00:53 -0700)]
Add color highlighting to css-mode
Bug#25525
* lisp/textmodes/css-mode.el (css--color-map): New constant.
(css-value-class-alist): Use css--color-map.
(css--number-regexp, css--percent-regexp)
(css--number-or-percent-regexp, css--angle-regexp): New constants.
(css--color-skip-blanks, css--rgb-color, css--hsl-color): New
functions.
(css--colors-regexp): New constant.
(css--hex-color, css--named-color, css--compute-color)
(css--contrasty-color, css--fontify-colors)
(css--fontify-region): New functions.
(css-mode): Set font-lock-fontify-region-function.
(css-mode-syntax-table): Set syntax on more characters.
(css-fontify-colors): New defcustom.
(scss-mode-syntax-table): Define syntax for ?$ and ?%.
* test/lisp/textmodes/css-mode-tests.el (css-test-property-values):
Update.
(css-test-rgb-parser, css-test-hsl-parser)
(css-test-named-color): New tests.
* etc/NEWS: Add entry.
Paul Eggert [Tue, 2 May 2017 21:52:21 +0000 (14:52 -0700)]
Check list object type if --enable-gcc-warnings
* configure.ac (--enable-check-lisp-object-type):
Default to "yes" if --enable-gcc-warnings is not "no".
* etc/NEWS: Mention this.
* src/eval.c (internal_lisp_condition_case): Fix some glitches
with 'volatile' uncovered by the above: in particular, 'clauses'
should be a pointer to volatile storage on the stack, and need not
be volatile itself. Use an int, not ptrdiff_t, to count clauses.
Don’t bother gathering binding count if VAR is nil. Use
more-specific local names to try to clarify what’s going on.
Gemini Lasswell [Tue, 2 May 2017 07:19:12 +0000 (10:19 +0300)]
Fix Edebug specs for 'cl-defmethod' and 'defmethod'
* lisp/emacs-lisp/cl-generic.el (cl-defmethod): Change Edebug spec
to make Edebug generate a new symbol for each method (Bug#24753) and
to support a string following :extra (Bug#23995).
* lisp/emacs-lisp/eieio-compat.el (defmethod): Change Edebug spec to
make Edebug generate a new symbol for each method (Bug#24753).
Eli Zaretskii [Tue, 2 May 2017 06:24:25 +0000 (09:24 +0300)]
Temporary fix for the MS_Windows build
* nt/inc/ms-w32.h (WIN32_LEAN_AND_MEAN): Define to an empty value,
to be consistent with Gnulib's utimens.c. This is because utimens.c
unconditionally defines WIN32_LEAN_AND_MEAN to an empty value, so the
previous definition here conflicted with that.
Paul Eggert [Mon, 1 May 2017 22:33:06 +0000 (15:33 -0700)]
Merge from gnulib
This incorporates:
2017-05-01 New module 'localtime-buffer'
2017-04-30 utimens: Add support for native Windows
* admin/merge-gnulib (AVOIDED_MODULES): Add tzset.
* configure.ac (tzset): No need for Emacs itself to check now.
* lib/gettimeofday.c, lib/time.in.h, lib/time_rz.c, lib/utimens.c:
* m4/gettimeofday.m4, m4/time_h.m4, m4/time_rz.m4: Copy from gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/localtime-buffer.c, lib/localtime-buffer.h:
* m4/localtime-buffer.m4: New files, copied from gnulib.
* src/editfns.c (init_editfns): Assume tzset is callable.
Dmitry Gutov [Mon, 1 May 2017 21:09:09 +0000 (00:09 +0300)]
Speed up project-find-regexp for simple regexps
* lisp/progmodes/xref.el (xref--regexp-syntax-dependent-p):
New function.
(xref--collect-matches): Use it. Don't try to enable the
appropriate major mode and file-local variables if the regexp
does not depend on the buffer's syntax (bug#26710).
(xref--collect-matches-1): Don't syntax-propertize in that
case either.
Philipp Stephani [Tue, 30 Jun 2015 20:38:35 +0000 (22:38 +0200)]
Warn about missing backslashes during load
* src/lread.c (load_warn_unescaped_character_literals, Fload, read1)
(syms_of_lread): Warn if unescaped character literals are
found (Bug#20152).
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Check for
unescaped character literals during byte compilation.
* test/src/lread-tests.el (lread-tests--unescaped-char-literals): New
unit test.
(lread-tests--with-temp-file, lread-tests--last-message): Helper
functions for unit test.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--unescaped-char-literals): New unit test.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file):
Helper macro for unit test.
Paul Eggert [Mon, 1 May 2017 17:41:50 +0000 (10:41 -0700)]
Don’t stress-test time zones near the Epoch
* test/src/editfns-tests.el (format-time-string-with-zone)
(format-time-string-with-outlandish-zone): Don’t format
timestamps near the Epoch, as this runs into bugs on MS-Windows,
and we don’t want to worry about those bugs.
Dmitry Gutov [Mon, 1 May 2017 16:46:24 +0000 (19:46 +0300)]
vc-git-state: Return `ignored' as appropriate with newer Git
* lisp/vc/vc-git.el
(vc-git--program-version): New variable.
(vc-git--program-version): New function.
(vc-git-state): Use it to choose whether to add '--ignored' (bug#19343).
Martin Rudalics [Mon, 1 May 2017 10:24:56 +0000 (12:24 +0200)]
Rewrite w32fns.c's `x_set_menu_bar_lines'
* src/w32fns.c (x_set_menu_bar_lines): Redraw frame immediately
regardless of whether menu bar is added or removed. Clear
under internal border iff a W32 window exists. Store either 0
or 1 as new parameter value.
(x_change_tool_bar_height): Use FRAME_W32_WINDOW instead of
FRAME_X_WINDOW.
Jonathan Ganc [Mon, 1 May 2017 01:23:59 +0000 (04:23 +0300)]
Speed up vc-git-status and make it more precise
* lisp/vc/vc-git.el (vc-git-state)
(vc-git--git-status-to-vc-state): Update 'vc-git-state' to use
'git status', so that 'vc-git-state' can now return 'ignored',
'conflict', or 'unregistered' when appropriate. Discussed in
bug#26066. Fixes bug#19343.
Fix Git revision navigation in currently removed directories
* lisp/vc/vc-git.el (vc-git-next-revision): Use the repo root as
default-directory because FILE's parent directory might not exist
anymore (bug#26345).
Paul Eggert [Sun, 30 Apr 2017 21:52:10 +0000 (14:52 -0700)]
Merge from gnulib
This incorporates:
2017-04-30 strftime-fixes: New module
2017-04-30 mktime: Work around TZ problem on native Windows
2017-04-30 ctime, localtime: New modules
2017-04-30 gettimeofday: Provide higher resolution on native Windows
2017-04-29 utime-h: Modernize handling of 'struct utimbuf'
2017-04-29 Make use of module 'utime-h'
2017-04-30 Fix a few typos
* admin/merge-gnulib (AVOIDED_MODULES): Avoid utime-h, too.
* lib/gettimeofday.c, lib/mktime.c, lib/time.in.h, lib/utimens.c:
* m4/gettimeofday.m4, m4/include_next.m4, m4/mktime.m4:
* m4/strftime.m4, m4/time_h.m4, m4/timegm.m4, m4/utimens.m4:
Copy from gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Eli Zaretskii [Sun, 30 Apr 2017 18:55:58 +0000 (21:55 +0300)]
Don't lose key bindings on mis-spelled text in flyspell-mode
* lisp/textmodes/flyspell.el (flyspell-mouse-map): Bind mouse-2
explicitly.
(make-flyspell-overlay): If the mis-spelled text already has a
'keymap' property, make that keymap the parent of
flyspell-mouse-map, so as not to lose the parent's bindings.
(Bug#26672)
Martin Rudalics [Sun, 30 Apr 2017 08:02:53 +0000 (10:02 +0200)]
Fix `delete-frame' behavior including Bug#26682
* src/frame.c (other_frames): Accept two arguments now. Don't
care about minibuffer window. Don't care about visibility when
called from delete_frame with FORCE true (Bug#26682).
(delete_frame, Fmake_frame_invisible): Adjust other_frames
calls.
* src/w32term.c (w32_read_socket): Don't add a move frame event
for an invisible frame.
* lisp/frame.el (handle-delete-frame): Don't kill Emacs when
attempting to delete a surrogate minibuffer frame.
Paul Eggert [Sun, 30 Apr 2017 07:38:28 +0000 (00:38 -0700)]
Merge from gnulib
This avoids incorporating the following, which I suspect are
more trouble for Emacs than they’re worth:
2017-04-29 stat, fstat: fix time_t etc. on native Windows platforms
* admin/merge-gnulib (AVOIDED_MODULES): Avoid stat, too.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/pathmax.h, lib/stat.c, m4/pathmax.m4, m4/stat.m4: Remove.
Paul Eggert [Sun, 30 Apr 2017 06:35:27 +0000 (23:35 -0700)]
Fix buffer overflow in make-docfile
* lib-src/make-docfile.c (scan_c_stream): Check for buffer
overflow when reading an identifier. Use a static buffer for NAME
rather than a small dynamically-allocated buffer.
Paul Eggert [Sun, 30 Apr 2017 06:11:16 +0000 (23:11 -0700)]
Merge from gnulib
This incorporates:
2017-04-29 getopt: port to Solaris 10 with circa-1997 glibc getopt.h
* lib/getopt-pfx-ext.h: Copy from gnulib.
* lib/gnulib.mk.in: Regenerate.
Philipp Stephani [Sat, 22 Apr 2017 18:58:38 +0000 (20:58 +0200)]
Reimplement auto-saving to visited files
This reacts to confusing behavior of 'auto-save-visited-file-name',
cf. Bug#25478.
* lisp/files.el (auto-save-visited-interval): New customization option.
(auto-save-visited-mode): New global minor mode.
(auto-save-visited-file-name): Make obsolete.
(auto-save--timer): New internal helper variable.
* doc/emacs/files.texi (Auto Save Files): Document
'auto-save-visited-mode' instead of obsolete
'auto-save-visited-file-name'.
(Auto Save Control): Document customization option
'auto-save-visited-interval'.