]> git.eshelyaron.com Git - emacs.git/log
emacs.git
7 years agoRevert "Ignore angle mode while simplifying units"
Tino Calancha [Thu, 18 May 2017 04:15:50 +0000 (13:15 +0900)]
Revert "Ignore angle mode while simplifying units"

This reverts commit 713e922243fb60d850f7b0ff83f3e2a3682f1832.
This commit causes Bug#25652.

7 years ago; Spelling fix
Paul Eggert [Wed, 17 May 2017 21:58:54 +0000 (14:58 -0700)]
; Spelling fix

7 years agoAvoid undefined behavior in struct sockaddr
Paul Eggert [Wed, 17 May 2017 20:35:52 +0000 (13:35 -0700)]
Avoid undefined behavior in struct sockaddr

Problem noted by Philipp Stephani in:
http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00391.html
* src/conf_post.h (ATTRIBUTE_MAY_ALIAS, DECLARE_POINTER_ALIAS):
New macros.
* src/process.c (conv_sockaddr_to_lisp, conv_lisp_to_sockaddr)
(connect_network_socket, network_interface_info)
(server_accept_connection): Use it when aliasing non-char objects.

7 years ago* lisp/vc/smerge-mode.el (smerge-refine-regions): Work in multi-bufs
Stefan Monnier [Wed, 17 May 2017 19:44:36 +0000 (15:44 -0400)]
* lisp/vc/smerge-mode.el (smerge-refine-regions): Work in multi-bufs

Rename from smerge-refine-subst.  Allow the `beg's to be markers.
Add autoload cookie.
(smerge--refine-forward): Rename from smerge-refine-forward.
(smerge--refine-chopup-region): Rename from smerge-refine-chopup-region.
Assume that its `beg` arg is a marker.
(smerge--refine-highlight-change): Rename from
smerge-refine-highlight-change.  Remove `buf` arg.
(smerge-refine-subst): Redefine as an obsolete alias.

7 years agoWork around AddressSanitizer bug with vfork
Paul Eggert [Wed, 17 May 2017 17:58:11 +0000 (10:58 -0700)]
Work around AddressSanitizer bug with vfork

Problem reported by Jim Meyering in:
http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00246.html
* src/conf_post.h (vfork) [ADDRESS_SANITIZER]: Define to fork.
Unfortunately with the AddressSanitizer in Fedora 25 x86-64, the
vforked child messes up the parent’s shadow memory.  This is too
bad, as we’d rather have AddressSanitizer catch memory-access bugs
related to vfork.

7 years agoCatch IPv4/IPv6 issues at compile time
Paul Eggert [Wed, 17 May 2017 17:27:31 +0000 (10:27 -0700)]
Catch IPv4/IPv6 issues at compile time

* src/process.c (connect_network_socket): Use verify,
not eassert, so that any problems are caught at compile-time.
Avoid dodgy cast by using a local var of the correct type.

7 years agoPacify --enable-gcc-warnings --with-x-toolkit=no
Paul Eggert [Wed, 17 May 2017 17:25:21 +0000 (10:25 -0700)]
Pacify --enable-gcc-warnings --with-x-toolkit=no

* src/composite.c (autocmp_chars) [!HAVE_WINDOW_SYSTEM]:
Avoid unused local.

7 years ago* admin/update_autogen (commit): Pull before push.
Glenn Morris [Wed, 17 May 2017 16:44:29 +0000 (12:44 -0400)]
* admin/update_autogen (commit): Pull before push.

7 years agoautoload-rubric no longer provides a feature by default
Glenn Morris [Wed, 17 May 2017 16:43:23 +0000 (12:43 -0400)]
autoload-rubric no longer provides a feature by default

* lisp/emacs-lisp/autoload.el (autoload-rubric):
Stop providing a feature unless explicitly requested.
(autoload-find-generated-file): Update autoload-rubric call.

7 years agoRemove redundant code in connect_network_socket
Eli Zaretskii [Wed, 17 May 2017 15:12:58 +0000 (18:12 +0300)]
Remove redundant code in connect_network_socket

* src/process.c (connect_network_socket) [HAVE_GETSOCKNAME]:
Remove redundant type-casting and variables.  Don't call
'getsockname' to find the port for AF_LOCAL sockets.
[AF_INET6]: Add an assertion to verify that the ports in the IPv4
and IPv6 structures are at the same offset and have the same size.

7 years agoFix minor timezone memory leak
Paul Eggert [Tue, 16 May 2017 21:19:36 +0000 (14:19 -0700)]
Fix minor timezone memory leak

* src/editfns.c (wall_clock_tz): Remove; unused.

7 years agoDo not discard AddressSanitizer stderr
Paul Eggert [Tue, 16 May 2017 21:30:37 +0000 (14:30 -0700)]
Do not discard AddressSanitizer stderr

* src/emacs.c (close_output_streams) [ADDRESS_SANITIZER]:
Do not close stderr.

7 years agoSimplify procname code to avoid GCC bug
Paul Eggert [Tue, 16 May 2017 21:29:18 +0000 (14:29 -0700)]
Simplify procname code to avoid GCC bug

* src/process.c (server_accept_connection): Simplify and avoid
multiple calls and struct literals in the last case of a switch.
The old code ran afoul of GCC bug 80659, which caused an internal
compiler error.  Problem reported by Jim Meyering in:
http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00182.html
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80659

7 years agoPacify GCC 7 with --enable-gcc-warnings
Paul Eggert [Tue, 16 May 2017 20:24:33 +0000 (13:24 -0700)]
Pacify GCC 7 with --enable-gcc-warnings

* src/regex.c (regex_compile): Swap labels, so that the
FALLTHROUGH immediately precedes the case label.

7 years agoMerge with gnulib, pacifying GCC 7
Paul Eggert [Tue, 16 May 2017 17:24:19 +0000 (10:24 -0700)]
Merge with gnulib, pacifying GCC 7

This incorporates:
2017-05-16 manywarnings: update for GCC 7
2017-05-15 sys_select: Avoid "was expanded before it was required"
* configure.ac (nw): Suppress GCC 7’s new -Wduplicated-branches and
-Wformat-overflow=2 options, due to too many false alarms.
* doc/misc/texinfo.tex, lib/strftime.c, m4/manywarnings.m4:
Copy from gnulib.
* m4/gnulib-comp.m4: Regenerate.
* src/coding.c (decode_coding_iso_2022):
Fix bug uncovered by -Wimplicit-fallthrough.
* src/conf_post.h (FALLTHROUGH): New macro.
Use it to mark all switch cases that fall through.
* src/editfns.c (styled_format): Use !, not ~, on bool.
* src/gtkutil.c (xg_check_special_colors):
When using sprintf, don’t trust Gtk to output colors in [0, 1] range.
(xg_update_scrollbar_pos): Avoid use of possibly-uninitialized bool;
this bug was actually caught by Clang.
* src/search.c (boyer_moore):
Tell GCC that CHAR_BASE, if nonzero, must be a non-ASCII character.
* src/xterm.c (x_draw_glyphless_glyph_string_foreground):
Tell GCC that glyph->u.glyphless.ch must be a character.

7 years agoMake autoloading Tramp more robust
Michael Albinus [Tue, 16 May 2017 13:55:06 +0000 (15:55 +0200)]
Make autoloading Tramp more robust

* lisp/net/tramp.el (tramp-file-name-for-operation):
Use `default-directory' where appropriate.
(tramp-file-name-handler): Do not autoload.
(tramp-autoload-file-name-handler): Reintroduce function.
(tramp-register-autoload-file-name-handlers): Use it.

7 years agoExtend tramp-tests.el
Michael Albinus [Tue, 16 May 2017 12:49:51 +0000 (14:49 +0200)]
Extend tramp-tests.el

* test/lisp/net/tramp-tests.el (tramp-change-syntax):
Remove declaration, not needed anymore.
(tramp-test05-expand-file-name-relative): New test.
(tramp-test10-write-region): Extend test.

7 years ago* lisp/net/tramp.el: Avoid recursive load of Tramp. (Bug#26943)
Michael Albinus [Tue, 16 May 2017 09:22:33 +0000 (11:22 +0200)]
* lisp/net/tramp.el: Avoid recursive load of Tramp.  (Bug#26943)

7 years agoMake `indent-line-to' respect field boundaries (Bug#26891)
Noam Postavsky [Fri, 12 May 2017 01:06:33 +0000 (21:06 -0400)]
Make `indent-line-to' respect field boundaries (Bug#26891)

* lisp/indent.el (indent-line-to): Use `back-to-indentation' instead
of `backward-to-indentation'.

7 years agoMake sure indent-sexp stops at end of sexp (Bug#26878)
Noam Postavsky [Thu, 11 May 2017 22:12:40 +0000 (18:12 -0400)]
Make sure indent-sexp stops at end of sexp (Bug#26878)

* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Check endpos before
indenting.
* test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp-stop): New
test.

7 years agoStop some epg tests failing on rhel7 with gpg 2.0.22 (bug#23619)
Glenn Morris [Tue, 16 May 2017 01:01:30 +0000 (21:01 -0400)]
Stop some epg tests failing on rhel7 with gpg 2.0.22 (bug#23619)

* test/lisp/epg-tests.el (with-epg-tests):
Also set GNUPGHOME in the environment of child processes.
This avoids problems if gpg does not pass --homedir to spawned agent.
; Ref eg https://gpgtools.tenderapp.com/discussions/problems/29537-gpg2-doesnt-start-agent-properly-if-using-homedir

7 years agoAdd oldxmenu to system-configuration-features
Glenn Morris [Tue, 16 May 2017 00:56:46 +0000 (20:56 -0400)]
Add oldxmenu to system-configuration-features

* configure.ac (HAVE_OLDXMENU): New.
(emacs_config_features): Add oldxmenu.

7 years ago* .gitlab-ci.yml: Adjust disclaimer as per RMS.
Ted Zlatanov [Mon, 15 May 2017 20:06:08 +0000 (16:06 -0400)]
* .gitlab-ci.yml: Adjust disclaimer as per RMS.

7 years agoRemove unneeded stuff from nt/inc/sys/time.h
Eli Zaretskii [Mon, 15 May 2017 19:45:57 +0000 (22:45 +0300)]
Remove unneeded stuff from nt/inc/sys/time.h

* nt/inc/sys/time.h (_TIMEVAL_DEFINED, struct timevat, timerisset)
(timercmp, timerclear): Don't define.  Instead, include the system
header sys/time.h, and add only the interval timers stuff.  This
avoids compiler warnings about 'gettimeofday's prototype, and also
avoids redefinition of macros from system headers.

7 years agoFix address violation found by AddressSanitizer
Paul Eggert [Mon, 15 May 2017 01:44:36 +0000 (18:44 -0700)]
Fix address violation found by AddressSanitizer

* src/process.c (connect_network_socket):
Use struct sockaddr_storage, not struct sockaddr_in, to store info
about a socket address.  Problem reported by Philipp Stephani in:
http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00314.html
This fix is based on a patch by Philipp in:
http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00357.html

7 years agoMake edebug-step-in work on generic methods (Bug#22294)
Gemini Lasswell [Sat, 13 May 2017 18:35:49 +0000 (11:35 -0700)]
Make edebug-step-in work on generic methods (Bug#22294)

* lisp/emacs-lisp/edebug.el (edebug-match-cl-generic-method-args):
New function to implement the edebug-form-spec property of
the symbol cl-generic-method-args.
(edebug-instrument-function): If the function is a generic
function, find and instrument all of its methods. Return a list
instead of a single symbol.
(edebug-instrument-callee): Now returns a list. Update docstring.
(edebug-step-in): Handle the list returned by edebug-instrument-callee.
* lisp/emacs-lisp/cl-generic.el (cl-defmethod): Use name and
cl-generic-method-args in its Edebug spec.
* lisp/emacs-lisp/eieio-compat.el (defmethod): Use name and
cl-generic-method-args in its Edebug spec.
* lisp/subr.el (method-files): New function.
* test/lisp/subr-tests.el (subr-tests--method-files--finds-methods)
(subr-tests--method-files--nonexistent-methods): New tests.

7 years agoMerge from gnulib
Paul Eggert [Sun, 14 May 2017 19:39:26 +0000 (12:39 -0700)]
Merge from gnulib

This incorporates:
2017-05-14 same-inode: Adapt for windows-stat-inodes
2017-05-14 windows-stat-inodes: New module
2017-05-14 stat-time: Adapt for windows-stat-timespec
* lib/gnulib.mk.in: Regenerate.
* lib/stat-time.h, lib/sys_types.in.h, m4/sys_types_h.m4:
Copy from gnulib.

7 years agoRemove gettimeofday from w32 sources
Eli Zaretskii [Sun, 14 May 2017 16:02:50 +0000 (19:02 +0300)]
Remove gettimeofday from w32 sources

* lib-src/ntlib.c (gettimeofday):
* nt/inc/sys/time.h (gettimeofday, struct timezone): Remove unused
function 'gettimeofday' and all of its supporting code.

7 years agoFix the MS-Windows build
Eli Zaretskii [Sun, 14 May 2017 14:53:39 +0000 (17:53 +0300)]
Fix the MS-Windows build

* nt/inc/sys/time.h (gettimeofday):
* src/w32.c (gettimeofday): Adjust signature to match Gnulib.

7 years agoMerge from gnulib
Paul Eggert [Sun, 14 May 2017 08:29:05 +0000 (01:29 -0700)]
Merge from gnulib

This incorporates:
2017-05-13 largefile: Simplify
2017-05-13 largefile: Improve and document
2017-05-13 truncate: New module
2017-05-13 windows-stat-timespec: New module
2017-05-13 windows-stat-override: New module
2017-05-11 getopt-posix: port to mingw
2017-05-11 gettimeofday: Increase precision on mingw
2017-05-10 time: Fix missing initialization of HAVE_TIMEZONE_T
2017-05-10 Implement a way to opt out from MSVC support
2017-05-09 tzset: Expand comment about TZ problem on native Windows
* build-aux/config.guess, lib/dup2.c, lib/fcntl.c, lib/fsync.c:
* lib/getdtablesize.c, lib/getopt.c, lib/gettimeofday.c:
* lib/mktime.c, lib/stat-time.h, lib/sys_stat.in.h, lib/unistd.in.h:
* lib/utimens.c, m4/gettimeofday.m4, m4/largefile.m4:
* m4/sys_stat_h.m4, m4/sys_time_h.m4, m4/time_h.m4, m4/time_rz.m4:
* m4/unistd_h.m4: Copy from gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.

7 years agoMerge branch 'fix/bug-21072'
Marcin Borkowski [Sun, 14 May 2017 05:09:54 +0000 (07:09 +0200)]
Merge branch 'fix/bug-21072'

7 years ago* .gitlab-ci.yml: Add setup for GitLab CI builds.
Ted Zlatanov [Wed, 26 Apr 2017 18:40:03 +0000 (14:40 -0400)]
* .gitlab-ci.yml: Add setup for GitLab CI builds.

7 years ago; Revert "Adjust the edebug spec of if-let*"
Mark Oteiza [Sun, 14 May 2017 01:40:23 +0000 (21:40 -0400)]
; Revert "Adjust the edebug spec of if-let*"

This reverts commit fd4b83ca7c20a68060772ec13aadbe29db612b3f.

7 years agoNew minor mode 'pixel-scroll-mode'
Tak Kunihiro [Sat, 13 May 2017 17:25:39 +0000 (20:25 +0300)]
New minor mode 'pixel-scroll-mode'

* lisp/pixel-scroll.el: New file.

* etc/NEWS: Mention pixel-scroll-mode.

7 years agoMake `old-style-backquotes' variable internal
Philipp [Sat, 6 May 2017 20:23:03 +0000 (22:23 +0200)]
Make `old-style-backquotes' variable internal

* src/lread.c (load_warn_old_style_backquotes, Fload, read1)
(syms_of_lread): Rename `old-style-backquotes' to
`lread--old-style-backquotes', and clarify that it's for internal
use only.
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Rename
variable.
* test/src/lread-tests.el (lread-tests--old-style-backquotes): Add
unit test.
* emacs-lisp/bytecomp-tests.el
(bytecomp-tests--old-style-backquotes): Add unit test.

7 years agoImprove unescaped character literal warnings
Philipp Stephani [Sat, 13 May 2017 10:28:48 +0000 (12:28 +0200)]
Improve unescaped character literal warnings

* src/lread.c (load_warn_unescaped_character_literals)
(syms_of_lread):
lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Improve
formatting of unescaped character literal warnings.

* test/src/lread-tests.el (lread-tests--unescaped-char-literals):
test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--unescaped-char-literals): Adapt unit tests.

7 years agoFontify C++ for loop variable as variable, even when followed by parentheses
Alan Mackenzie [Fri, 12 May 2017 21:11:49 +0000 (21:11 +0000)]
Fontify C++ for loop variable as variable, even when followed by parentheses

In the following: "for (auto *Friend : Class->friends()) {", "Friend" was
getting fontified as a function, due to insufficient checking of the tokens
between it and "()".

* lisp/progmodes/cc-langs.el (c-:-op-cont-tokens, c-:-op-cont-regexp): New
lang-consts/vars.

* lisp/progmodes/cc-engine.el (c-forward-declarator): After finding a putative
declarator's identifier, check for a ":" token inside a for's parentheses, and
abort the search for "(" if this is found.

7 years agoMake Tramp backward compatible
Michael Albinus [Fri, 12 May 2017 16:36:41 +0000 (18:36 +0200)]
Make Tramp backward compatible

* lisp/net/tramp-cmds.el (tramp-change-syntax):
Set tramp-autoload cookie.

* lisp/net/tramp-compat.el: Run `tramp-change-syntax' at
startup, if necessary.

* lisp/net/tramp.el (tramp-syntax): Use `tramp-compat-user-error'.
(tramp-register-autoload-file-name-handlers): Do not mark
`operations' for `tramp-file-name-handler'.
(tramp-register-file-name-handlers): Remove also
`tramp-autoload-file-name-handler' for backward compatibility.
(tramp-register-foreign-file-name-handler): Use `delete-dups'.

* test/lisp/net/tramp-tests.el (tramp-change-syntax): Declare.

7 years agoModify `beginning-of-defun-comments'
Noam Postavsky [Tue, 9 May 2017 07:38:49 +0000 (09:38 +0200)]
Modify `beginning-of-defun-comments'

* lisp/emacs-lisp/lisp.el (beginning-of-defun-comments): Try not to stop
in the middle of a multiline comment.

7 years agoFix elisp-tests-with-temp-buffer compilation
Noam Postavsky [Thu, 27 Apr 2017 21:13:33 +0000 (17:13 -0400)]
Fix elisp-tests-with-temp-buffer compilation

* test/lisp/emacs-lisp/lisp-tests.el (elisp-tests-with-temp-buffer):
Don't refer to the =!NAME= as "markers" since they produce variables
with just plain positions, not marker objects.  Explicitly specify
that CONTENTS is evaluated at compile time.  Don't re-evaluate
CONTENTS at runtime.  Fix debug specification.  Suppress warnings due
to BODY not using =!NAME= variables.
(elisp-test-point-position-regex): Rename from
`elisp-test-point-marker-regex'.
(mark-defun-test-buffer): Wrap in `eval-and-compile'.

7 years ago* lisp/emacs-lisp/lisp.el (mark-defun): Simplify moving the point.
Noam Postavsky [Thu, 20 Apr 2017 12:07:19 +0000 (14:07 +0200)]
* lisp/emacs-lisp/lisp.el (mark-defun): Simplify moving the point.

7 years agoFix Bug#21072 and rework `mark-defun'
Marcin Borkowski [Fri, 31 Mar 2017 11:06:06 +0000 (13:06 +0200)]
Fix Bug#21072 and rework `mark-defun'

* test/lisp/progmodes/elisp-mode-tests.el (mark-defun-test-buffer):
  New variable
(mark-defun-no-arg-region-inactive)
(mark-defun-no-arg-region-active)
(mark-defun-arg-region-active)
(mark-defun-pos-arg-region-inactive)
(mark-defun-neg-arg-region-inactive, mark-defun-bob): Add tests for
the new `mark-defun'.

* lisp/emacs-lisp/lisp.el (beginning-of-defun--in-emptyish-line-p):
  New function.
(beginning-of-defun-comments): New function.
(mark-defun): Fix bug#21072, also rewrite large parts of `mark-defun'
to accept a numerical prefix argument.

7 years ago* lisp/mail/rmail.el (rmail-ignored-headers): Add 3 headers to ignore.
Alfred M. Szmidt [Fri, 12 May 2017 08:44:07 +0000 (11:44 +0300)]
* lisp/mail/rmail.el (rmail-ignored-headers): Add 3 headers to ignore.

Copyright-paperwork-exempt: yes.

7 years agoImprove doc strings in net-utils.el
Eli Zaretskii [Fri, 12 May 2017 08:38:04 +0000 (11:38 +0300)]
Improve doc strings in net-utils.el

* lisp/net/net-utils.el (ifconfig, iwconfig, netstat, arp)
(route, traceroute, nslookup, ftp, smbclient)
(smbclient-list-shares, finger, whois)
(network-connection-to-service, network-service-connection)
(network-connection-reconnect): Improve doc strings.

7 years agoExtend DNS lookup commands to allow specifying the name server
Andrew Robbins [Fri, 12 May 2017 08:19:46 +0000 (11:19 +0300)]
Extend DNS lookup commands to allow specifying the name server

* lisp/net/net-utils.el (ffap-string-at-point): Removed due to
'net-utils-machine-at-point' obviating this autoloaded
function (Bug#25426).
(dig-program-options): New customization variable.
(nslookup-host, dns-lookup-host, run-dig): Can now specify
optional name server argument interactively (by prefix arg) and
non-interactively.

* etc/NEWS: Mention the extension of DNS lookup commands.

7 years agoDon't hard-code loaddefs files in lisp/Makefile
Glenn Morris [Fri, 12 May 2017 01:22:13 +0000 (21:22 -0400)]
Don't hard-code loaddefs files in lisp/Makefile

* lisp/Makefile.in (loaddefs): New variable.
(AUTOGENEL): Use $loaddefs, and include directory.
(bootstrap-clean): Update for AUTOGENEL change.

7 years agoKill modified buffers silently when quitting (bug#26862)
Katsumi Yamaoka [Thu, 11 May 2017 05:49:45 +0000 (05:49 +0000)]
Kill modified buffers silently when quitting (bug#26862)

* lisp/gnus/gnus-start.el (gnus-clear-system): Run do-auto-save to make
sure that latest drafts are saved, and kill modified buffers silently.

7 years agoImplement 1-based column numbering in mode line
Perry E. Metzger [Wed, 10 May 2017 17:57:21 +0000 (20:57 +0300)]
Implement 1-based column numbering in mode line

* src/xdisp.c (decode_mode_spec): Implement the %C construct.

* lisp/bindings.el (column-number-indicator-zero-based): New
defcustom.
(mode-line-position): Use %C when
column-number-indicator-zero-based is nil.

* src/xdisp.c (syms_of_xdisp) <frame-title-format>:
* src/buffer.c (syms_of_buffer) <mode-line-format>:
* doc/lispref/modes.texi (%-Constructs):
* doc/lispref/frames.texi (Frame Titles): Document the %C
construct.

* doc/emacs/display.texi (Optional Mode Line): Document
'column-number-indicator-zero-based'.

* etc/NEWS: Mention 'column-number-indicator-zero-based' and the
%C construct.

7 years agoEnsure cursor's foreground color is in sync with 'default' face
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)

7 years agoFix vertical cursor motion when columns are of unequal size
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)

7 years agoFix finding test .el files
Glenn Morris [Wed, 10 May 2017 06:20:52 +0000 (23:20 -0700)]
Fix finding test .el files

* test/Makefile.in (ELFILES): Exclude the data/ directory.
* test/src/lread-tests.el (lread-test-bug26837): Revert previous.

7 years agoTweak a recent test
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.

7 years agoPut license information in each generated uni-*.el
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.

7 years agoFix lisp-indent-region and indent-sexp (Bug#26619)
Noam Postavsky [Sun, 23 Apr 2017 14:43:05 +0000 (10:43 -0400)]
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.

7 years agoSimplify url-encode-url and add a test
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.

7 years agoMore informative error when required feature missing
Glenn Morris [Tue, 9 May 2017 23:47:16 +0000 (19:47 -0400)]
More informative error when required feature missing

* src/fns.c (Frequire): Include file name in missing feature error.
* doc/lispref/loading.texi (Named Features): Don't quote actual error.

7 years agoPut re-loaded file back at start of load-history (bug#26837)
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.

7 years agoDon't duplicate autoload code in package.el
Glenn Morris [Tue, 9 May 2017 17:03:04 +0000 (13:03 -0400)]
Don't duplicate autoload code in package.el

* lisp/emacs-lisp/autoload.el (autoload-rubric): Add a package option.
* lisp/emacs-lisp/package.el (autoload-rubric): Declare.
(package-autoload-ensure-default-file): Use autoload-rubric.

7 years ago* test/lisp/net/tramp-tests.el: Keep additional test.
Michael Albinus [Tue, 9 May 2017 12:35:56 +0000 (14:35 +0200)]
* test/lisp/net/tramp-tests.el: Keep additional test.

7 years agoAdd elisp-tests-with-temp-buffer, a new testing macro
Marcin Borkowski [Tue, 14 Feb 2017 10:30:36 +0000 (11:30 +0100)]
Add elisp-tests-with-temp-buffer, a new testing macro

* test/lisp/emacs-lisp/lisp-tests.el
(elisp-test-point-marker-regex) New variable.
(elisp-tests-with-temp-buffer): New macro to help test functions
moving the point and/or mark.

7 years agoRevert "Output number of characters added to file (Bug#354)"
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)"

* doc/emacs/files.texi (Misc File Ops):
* etc/NEWS:
* lisp/epa-file.el (epa-file-write-region):
* lisp/gnus/mm-util.el (mm-append-to-file):
* lisp/jka-compr.el (jka-compr-write-region):
* lisp/net/ange-ftp.el (ange-ftp-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region):
* lisp/net/tramp.el (tramp-handle-write-region-message):
* src/fileio.c (write_region, syms_of_fileio):
* test/lisp/net/tramp-tests.el (tramp-test10-write-region): Remove
extra characters from file writing messages.

7 years agoSkip a test from filenotify-tests.el on Cygwin
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.

7 years agoMerge from gnulib
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.

7 years agoFix various verilog-mode.el issues.
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.

7 years agoHandle `write-region' messages in Tramp properly
Michael Albinus [Mon, 8 May 2017 15:27:50 +0000 (17:27 +0200)]
Handle `write-region' messages in Tramp properly

* lisp/net/tramp.el (tramp-handle-write-region-message): New defsubst.
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Use it.

* lisp/net/tramp.el (tramp-password-prompt-regexp)
(tramp-completion-mode-p):
* lisp/net/tramp-cmds.el (tramp-reporter-dump-variable)
(tramp-append-tramp-buffers):
* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection):
Use `bound-and-true-p'.

* lisp/net/tramp-compat.el (tramp-compat-delete-file):
Don't check for `boundp' anymore.

* test/lisp/net/tramp-tests.el (ert-x): Require it.
(tramp--test-messages): New defvar.
(tramp-test10-write-region): Extend test.

7 years agoFix glyph string generation for multi-font compositions (Bug#26742)
YAMAMOTO Mitsuharu [Sun, 7 May 2017 23:20:53 +0000 (08:20 +0900)]
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.

7 years agoFix all unescaped character literals
Philipp Stephani [Sat, 6 May 2017 17:16:49 +0000 (19:16 +0200)]
Fix all unescaped character literals

7 years agoCC Mode internal cache: Handle a cache pos being inside a two-char construct.
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.

7 years ago; Update contributor name
Glenn Morris [Sun, 7 May 2017 01:34:36 +0000 (18:34 -0700)]
; Update contributor name
; Ref http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00114.html

7 years ago; Spelling fixes
Paul Eggert [Sun, 7 May 2017 01:29:56 +0000 (18:29 -0700)]
; Spelling fixes

7 years agoSilence an mh-compat compiler warning
Glenn Morris [Sun, 7 May 2017 01:21:04 +0000 (18:21 -0700)]
Silence an mh-compat compiler warning

* lisp/mh-e/mh-compat.el (mh-url-unreserved-chars): Always define.

7 years agoEvaluate mh-require when compiling
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.

7 years agoRemove obsolete method of changing byte-compile-dest-file
Glenn Morris [Sun, 7 May 2017 01:01:34 +0000 (18:01 -0700)]
Remove obsolete method of changing byte-compile-dest-file

* lisp/emacs-lisp/bytecomp.el (byte-compile-dest-file):
Define unconditionally.

7 years agoNew var write-region-verbose, default nil
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.

7 years agoWrite autoloads file atomically
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.

7 years agoWrite autoloads file once only
Glenn Morris [Sun, 7 May 2017 00:07:10 +0000 (17:07 -0700)]
Write autoloads file once only

* lisp/emacs-lisp/autoload.el (autoload-find-generated-file):
Simplify.  Don't bother about ensuring the output file exists.
(autoload-generated-file): Add doc.
(autoload-ensure-writable): Update doc.
(autoload-ensure-file-writeable): Handle non-existing file.
(autoload-ensure-default-file): Remove function.

7 years agoPort .gdbinit to GDB 7.11.1 + Python 2.7.12
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.

7 years agoPretty-print const Lisp_Objects in .gdbinit
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

7 years agoPacify GCC setjmp/longjmp warning
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.

7 years agoFix bootstrap build of files.el
Philipp [Sat, 6 May 2017 21:19:22 +0000 (23:19 +0200)]
Fix bootstrap build of files.el

* lisp/files.el (file-name-non-special): Don't use cl-letf.

7 years ago; INSTALL.REPO: Mention cases that 'make bootstrap' can't handle (Bug#26246).
Noam Postavsky [Sat, 6 May 2017 20:20:57 +0000 (16:20 -0400)]
; INSTALL.REPO: Mention cases that 'make bootstrap' can't handle (Bug#26246).

7 years ago; Fix last change
Eli Zaretskii [Sat, 6 May 2017 20:23:36 +0000 (23:23 +0300)]
; Fix last change

* test/src/emacs-module-tests.el (module-function-object): Fix thinko
in last change.

7 years agoFix last change for MS-Windows
Eli Zaretskii [Sat, 6 May 2017 20:00:34 +0000 (23:00 +0300)]
Fix last change for MS-Windows

* test/src/emacs-module-tests.el (module-function-object): Port to
MS-Windows.

7 years ago; * src/alloc.c (make_module_function): Avoid compiler warning.
Eli Zaretskii [Sat, 6 May 2017 19:54:45 +0000 (22:54 +0300)]
; * src/alloc.c (make_module_function): Avoid compiler warning.

7 years agoIntroduce new misc type for module function
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.

7 years agoFix quoted files for 'verify-visited-file-modtime'
Philipp Stephani [Fri, 21 Apr 2017 22:12:23 +0000 (00:12 +0200)]
Fix quoted files for 'verify-visited-file-modtime'

Fixes Bug#25951.

* lisp/files.el (file-name-non-special): Set the file name for the
correct buffer.

* test/lisp/files-tests.el (files-tests--file-name-non-special--buffers):
Add unit test.
(files-tests--with-advice, files-tests--with-temp-file): New helper
macros.

7 years ago; etc/NEWS: Fix default-frame-alist reference (Bug#26280).
Noam Postavsky [Sat, 6 May 2017 18:03:06 +0000 (14:03 -0400)]
; etc/NEWS: Fix default-frame-alist reference (Bug#26280).

7 years ago* src/fileio.c (write_region): Don't say "1 characters". (Bug#26796)
Eli Zaretskii [Sat, 6 May 2017 10:39:36 +0000 (13:39 +0300)]
* src/fileio.c (write_region): Don't say "1 characters".  (Bug#26796)

7 years agoTurn on GC_CHECK_MARKED_OBJECTS by default under ENABLE_CHECKING
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.

7 years ago; * lisp/replace.el (query-replace-regexp, replace-regexp): Doc fixes.
Eli Zaretskii [Sat, 6 May 2017 08:06:38 +0000 (11:06 +0300)]
; * lisp/replace.el (query-replace-regexp, replace-regexp): Doc fixes.

7 years agoFix erc-join with channel password
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.

7 years agoEnsure the created temp file in a test is new
Tino Calancha [Sat, 6 May 2017 03:30:48 +0000 (12:30 +0900)]
Ensure the created temp file in a test is new

* test/lisp/buff-menu-tests.el (buff-menu-24962): Use `make-temp-file'
to create the temp file.

7 years agoDecruftify dns-mode.el a little bit
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.

7 years agoPretty-print Lisp_Object values in GDB
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.

7 years agoTweak dns-mode font-lock
Peder O. Klingenberg [Fri, 5 May 2017 18:03:04 +0000 (14:03 -0400)]
Tweak dns-mode font-lock

* lisp/textmodes/dns-mode.el (dns-mode-font-lock-keywords):
Highlight $TTL as a control entity.  (Bug#26780)

7 years agoFontify the doc-string in some CL forms as such
Glenn Morris [Fri, 5 May 2017 06:15:53 +0000 (23:15 -0700)]
Fontify the doc-string in some CL forms as such

* lisp/emacs-lisp/lisp-mode.el (defconstant, defparameter):
Add the doc-string-elt property.  (Bug#26778)

7 years ago* lisp/emacs-lisp/cl-lib.el (cl-mapcar): Remove recent autoload cookie.
Glenn Morris [Fri, 5 May 2017 05:26:17 +0000 (22:26 -0700)]
* lisp/emacs-lisp/cl-lib.el (cl-mapcar): Remove recent autoload cookie.

7 years agocl-defmethod: Make the edebug spec more technically correct
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.

7 years agoFix MH-E not to load cl at runtime (Bug#25552)
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>

7 years agoMultiline support in NS "Open Selected File" service.
Jean-Christophe Helary [Thu, 4 May 2017 18:32:40 +0000 (20:32 +0200)]
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'.