]> git.eshelyaron.com Git - emacs.git/log
emacs.git
7 years agoImprove symlinks for Tramp
Michael Albinus [Wed, 30 Aug 2017 10:00:26 +0000 (12:00 +0200)]
Improve symlinks for Tramp

* lisp/files.el (files--splice-dirname-file): Quote whole file.

* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link):
Do not expand TARGET, it could be remote.
(tramp-sh-handle-file-truename): Check for cyclic symlink also
in case of readlink.  Quote result if it looks remote.
(tramp-sh-handle-file-local-copy): Use `file-truename'.

* test/lisp/net/tramp-tests.el (tramp-test08-file-local-copy)
(tramp-test09-insert-file-contents): Test also file missing.
(tramp-test21-file-links): Extend test.

7 years agoPreserve display's foreground color when clearing internal borders (Bug#28278)
Martin Rudalics [Wed, 30 Aug 2017 08:27:36 +0000 (10:27 +0200)]
Preserve display's foreground color when clearing internal borders (Bug#28278)

* src/xterm.c (x_after_update_window_line): Preserve display's
foreground color when clearing internal borders (Bug#28278).

7 years agoUse cl-print for all values printed by `describe-variable'
Noam Postavsky [Wed, 30 Aug 2017 01:59:42 +0000 (21:59 -0400)]
Use cl-print for all values printed by `describe-variable'

* lisp/help-fns.el (describe-variable): Use cl-prin1 for original and
global values too.

7 years agoMinor simplification for byte-compile-constant-push
Noam Postavsky [Sun, 13 Aug 2017 14:06:45 +0000 (10:06 -0400)]
Minor simplification for byte-compile-constant-push

* lisp/emacs-lisp/bytecomp.el (byte-compile-constant): Move the meat
of the code from here...
(byte-compile-constant-push): ... to here.  No need to bind
byte-compile--for-effect anymore.

7 years agoPrefer file-name-quote to concat "/:"
Paul Eggert [Wed, 30 Aug 2017 02:17:54 +0000 (19:17 -0700)]
Prefer file-name-quote to concat "/:"

Suggested by Michael Albinus (Bug#28264#13).
* lisp/files.el (files--splice-dirname-file): Use file-name-quote
rather than attempting to do it by hand.

7 years ago* configure.ac: fix typo in previous change
Paul Eggert [Wed, 30 Aug 2017 01:56:36 +0000 (18:56 -0700)]
* configure.ac: fix typo in previous change

7 years agoBe more conservative in link time optimization doc
Paul Eggert [Tue, 29 Aug 2017 21:52:57 +0000 (14:52 -0700)]
Be more conservative in link time optimization doc

While testing --enable-link-time-optimization with GCC 7.1.1
I ran into a serious GCC code-generation bug which makes me
think that --enable-link-time-optimization should be
discouraged for typical installs (Bug#28213).  See:
https://bugzilla.redhat.com/show_bug.cgi?id=1486455

7 years agoMake garbage collection more conservative
Paul Eggert [Tue, 29 Aug 2017 21:35:37 +0000 (14:35 -0700)]
Make garbage collection more conservative

Check for a pointer anywhere within the object, as opposed to just
the start of the object.  This is needed for gcc -Os -flto on
x86-64 (Bug#28213).  This change means that the garbage collector
is more conservative, and will incorrectly keep objects that it
does not need to, but that is better than incorrectly discarding
objects that should be kept.
* src/alloc.c (ADVANCE, VINDEX): Now functions, not macros;
this is easier to debug.
(setup_on_free_list): Rename from SETUP_ON_FREE_LIST.
Now a function with two args, not a macro with three.
All callers changed.
(live_string_holding, live_cons_holding, live_symbol_holding)
(live_misc_holding, live_vector_holding, live_buffer_holding):
New functions, which check for any object containing the addressed
byte, not just for an object at the given address.
(live_string_p, live_cons_p, live_symbol_p, live_misc_p)
(live_vector_p, live_buffer_p):
Redefine in terms of the new functions.
(live_float_p): Refactor slightly to match the new functions.
(mark_maybe_object, mark_maybe_pointer): Use the new functions.
Don’t bother checking mark bits, as mark_object already does that,
and omitting the checks here simplifies the code.  Although
mark_maybe_object can continue to insist that tagged pointers
still address the start of the object, mark_maybe_pointer now is
more conservative and checks for pointers anywhere into an object.

7 years agoImprove stack-top heuristic
Paul Eggert [Tue, 29 Aug 2017 21:20:47 +0000 (14:20 -0700)]
Improve stack-top heuristic

This is needed for gcc -Os -flto on x86-64; otherwise, GC misses part
of the stack when scanning for heap roots, causing Emacs to crash
later (Bug#28213).  The problem is that Emacs's hack for getting an
address near the stack top does not work when link-time optimization
moves stack variables around.
* configure.ac (HAVE___BUILTIN_FRAME_ADDRESS): New macro.
* lib-src/make-docfile.c (DEFUN_noinline): New constant.
(write_globals, scan_c_stream): Support noinline.
* src/alloc.c (NEAR_STACK_TOP): New macro.
(SET_STACK_TOP_ADDRESS): Use it.
(flush_stack_call_func, Fgarbage_collect): Now noinline.

7 years agoAlign stack bottom properly.
Paul Eggert [Tue, 29 Aug 2017 19:49:22 +0000 (12:49 -0700)]
Align stack bottom properly.

This is needed for gcc -Os -flto on x86-64 (Bug#28213).
* src/emacs.c (main): Align stack-bottom variable as a pointer,
since mark_memory requires this.

7 years agoAvoid spinning waiting for git-gui.exe on Windows
Eli Zaretskii [Tue, 29 Aug 2017 18:53:49 +0000 (21:53 +0300)]
Avoid spinning waiting for git-gui.exe on Windows

* src/w32proc.c (waitpid): If GetExitCodeProcess returns
STILL_ACTIVE, and we were called with WNOHANG, pretend that the
process exited.  (Bug#28268)

7 years agoDocument '--module-assertions'
Eli Zaretskii [Tue, 29 Aug 2017 16:39:15 +0000 (19:39 +0300)]
Document '--module-assertions'

* doc/emacs/cmdargs.texi (Initial Options): Document the
'--module-assertions' command-line option.
* doc/lispref/loading.texi (Dynamic Modules): Add a
cross-reference to the description of '--module-assertions'.

* etc/NEWS: Update the NEWS entry for --module-assertions.

7 years agoAdd news entry about new macOS features
Alan Third [Thu, 24 Aug 2017 20:59:33 +0000 (21:59 +0100)]
Add news entry about new macOS features

* etc/NEWS: Add entry about ns-appearance, ns-transparent-titlebar and
ns-use-thin-smoothing.

7 years agoFix cross macOS version building (bug#28222)
Alan Third [Sat, 26 Aug 2017 08:44:42 +0000 (09:44 +0100)]
Fix cross macOS version building (bug#28222)

* src/macfont.h (CGContextSetFontSmoothingStyle): Function
declaration.
* src/macfont.m (macfont_draw): Limit new code to macOS 10.8 and up.

7 years agoEnable thin font smoothing in macOS (bug#28222)
Ben Bonfil [Sat, 26 Aug 2017 08:41:41 +0000 (09:41 +0100)]
Enable thin font smoothing in macOS (bug#28222)

* src/nsterm.m (syms_of_nsterm): Define var ns-use-thin-smoothing.
* src/macfont.m (macfont_draw): Use font smoothing.

Copyright-paperwork-exempt: yes

7 years agoMinor improvement in documentation of display-line-numbers
Eli Zaretskii [Tue, 29 Aug 2017 16:13:19 +0000 (19:13 +0300)]
Minor improvement in documentation of display-line-numbers

* doc/emacs/display.texi (Display Custom): Document the
display-line-numbers-mode and related options.

7 years agoAvoid aborting in 'waitpid' on MS-Windows
Eli Zaretskii [Tue, 29 Aug 2017 15:13:44 +0000 (18:13 +0300)]
Avoid aborting in 'waitpid' on MS-Windows

* src/w32proc.c (waitpid): Don't allow quitting if called with
WNOHANG in OPTIONS.  (Bug#28268)

7 years ago; Fix Org sync 3ad8ca429bac
Rasmus [Tue, 29 Aug 2017 14:47:21 +0000 (16:47 +0200)]
; Fix Org sync 3ad8ca429bac

* etc/refcards/orgcard.tex: Restore dropped line from 54aadd94f

See http://permalink.gmane.org/gmane.emacs.devel/217877

7 years ago* lisp/progmodes/sh-script.el: Test "in-string" of the right char!
Stefan Monnier [Tue, 29 Aug 2017 13:44:19 +0000 (09:44 -0400)]
* lisp/progmodes/sh-script.el: Test "in-string" of the right char!

(sh-syntax-propertize-function): Fix off-by-one error.
Fixes bug#23526.

7 years agoUpdate Org to v9.0.10
Rasmus [Tue, 29 Aug 2017 08:07:08 +0000 (10:07 +0200)]
Update Org to v9.0.10

Please see etc/ORG-NEWS for major changes. Note, this is a bugfix
release.

7 years agoSilence false alarms for symlinks to sources
Paul Eggert [Tue, 29 Aug 2017 04:50:09 +0000 (21:50 -0700)]
Silence false alarms for symlinks to sources

Problem reported by Glenn Morris (Bug#28264).
* lisp/files.el (files--splice-dirname-file): New function.
(file-truename, file-chase-links): Use it.

7 years agoSimplify remove_slash_colon
Paul Eggert [Tue, 29 Aug 2017 04:47:16 +0000 (21:47 -0700)]
Simplify remove_slash_colon

* src/process.c (remove_slash_colon): Simplify
and avoid a special case for "/:" by itself.

7 years agoRemove font family from minibuffer-prompt face
Tassilo Horn [Mon, 28 Aug 2017 16:13:59 +0000 (18:13 +0200)]
Remove font family from minibuffer-prompt face

* etc/themes/tsdh-light-theme.el (tsdh-light): Remove font family from
minibuffer-prompt face.

7 years agoFurther fixes in tramp-smb.el
Michael Albinus [Mon, 28 Aug 2017 16:08:16 +0000 (18:08 +0200)]
Further fixes in tramp-smb.el

* lisp/net/tramp-smb.el (tramp-smb-handle-file-truename): New defun.
(tramp-smb-file-name-handler-alist): Use it.
(tramp-smb-handle-make-symbolic-link): Unquote target.

* test/lisp/net/tramp-tests.el
(tramp--test-ignore-make-symbolic-link-error): New defmacro.
(tramp-test18-file-attributes, tramp-test21-file-links)
(tramp--test-check-files): Use it.

7 years ago; Fix last ido patch
Michael Albinus [Mon, 28 Aug 2017 15:55:31 +0000 (17:55 +0200)]
; Fix last ido patch

7 years agoDon’t assume -g3 in .gdbinit
Paul Eggert [Mon, 28 Aug 2017 15:38:05 +0000 (08:38 -0700)]
Don’t assume -g3 in .gdbinit

* src/.gdbinit (EMACS_INT_WIDTH, USE_LSB_TAG):
Use reasonable defaults if not in the symbol table.

7 years agoUse string-match to check for dotfiles in ido
Robert Pluim [Mon, 28 Aug 2017 07:49:56 +0000 (09:49 +0200)]
Use string-match to check for dotfiles in ido

* lisp/ido.el (ido-make-file-list): Use string-match to check
for dotfiles instead of substring, as when using tramp
simplified syntax ido-temp-list may contain empty strings.

Copyright-paperwork-exempt: yes

7 years agoFont-lock FDO desktop files correctly
Mark Oteiza [Mon, 28 Aug 2017 02:22:29 +0000 (22:22 -0400)]
Font-lock FDO desktop files correctly

Single and double quotes do not have a special meaning in
desktop files.
https://standards.freedesktop.org/desktop-entry-spec/latest/
* etc/NEWS: Mention new mode.
* lisp/files.el (auto-mode-alist): Split out an entry for handling
the .desktop extension with conf-desktop-mode.
* lisp/textmodes/conf-mode.el (conf-desktop-font-lock-keywords): New
variable with rules for booleans and format specifiers.
(conf-unix-mode): Remove desktop file entry example from docstring.
(conf-desktop-mode): New derived major mode.

7 years agoFix auto-fill bug in js-mode
Tom Tromey [Sun, 27 Aug 2017 18:54:01 +0000 (12:54 -0600)]
Fix auto-fill bug in js-mode

* lisp/progmodes/js.el (js-do-auto-fill): New function.
(js-mode): Set normal-auto-fill-function.
* test/lisp/progmodes/js-tests.el (js-mode-fill-comment-bug): New
test.

7 years agoDisable completion while entering python multiline statements
Noam Postavsky [Sat, 19 Aug 2017 15:45:07 +0000 (11:45 -0400)]
Disable completion while entering python multiline statements

The "legacy" completion mechanism sends newlines to the running python
process to get the list of completions, which confuses things if the
user is in the middle of entering a multiline statement (Bug#28051).
It's better to disable completion in this case.
* lisp/progmodes/python.el (python-shell--block-prompt): New variable.
(python-shell-prompt-set-calculated-regexps): Set it.
(python-shell-completion-at-point): Return 'ignore' as the completion
function when the current prompt is a block prompt.

7 years agoTramp cleanup
Michael Albinus [Sun, 27 Aug 2017 17:16:58 +0000 (19:16 +0200)]
Tramp cleanup

* lisp/net/tramp-sh.el (tramp-sh-extra-args): Remove compat code.
(tramp-sh-handle-make-symbolic-link): More robust check for
TARGET remoteness.

* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory):
Disable copying by tar temporarily, it doesn't work reliably.
(tramp-smb-do-file-attributes-with-stat): Resolve symlink.
(tramp-smb-handle-make-symbolic-link): Fix implementation.

* lisp/net/tramp.el (tramp-handle-file-symlink-p): Simplify.

* test/lisp/net/tramp-tests.el (tramp-test21-file-links):
Extend test.

7 years agoFix previous xterm.h change for non-gtk builds
Glenn Morris [Sun, 27 Aug 2017 17:06:30 +0000 (10:06 -0700)]
Fix previous xterm.h change for non-gtk builds

* src/xterm.h (GTK_CHECK_VERSION) [!USE_GTK]: Define it.

7 years agoFix GdkSettings-related deprecation warnings
Philipp Stephani [Sun, 27 Aug 2017 11:13:16 +0000 (13:13 +0200)]
Fix GdkSettings-related deprecation warnings

* src/gtkutil.c (xg_initialize): Don’t set deprecated and ignored
gtk-menu-bar-accel setting in new versions of GTK+.  Use g_object_set
instead of deprecated gtk_settngs_set_string_property otherwise.

7 years agoAlways use gtk_window_move in new versions
Philipp Stephani [Sun, 27 Aug 2017 10:38:46 +0000 (12:38 +0200)]
Always use gtk_window_move in new versions

* src/gtkutil.c (my_log_handler): Don’t define in new versions of
GTK+.
(xg_set_geometry): Always use gtk_window_move in new versions of GTK+.

* src/xterm.c (syms_of_xterm): Document that x-gtk-use-window-move
is ignored.

* lisp/subr.el (x-gtk-use-window-move): Make obsolete.

7 years agoFix 'diff-goto-source' when buffer is narrowed (Bug#21262)
Charles A. Roelli [Tue, 22 Aug 2017 13:57:01 +0000 (15:57 +0200)]
Fix 'diff-goto-source' when buffer is narrowed (Bug#21262)

* lisp/vc/diff-mode.el (diff-find-file-name): Save the current
narrowing, and widen the buffer before searching for the name of the
file corresponding to the diff.

With thanks to Noam Postavsky.

7 years agoRemove use of a deprecated GTK+ function in new versions
Philipp Stephani [Sun, 27 Aug 2017 11:11:55 +0000 (13:11 +0200)]
Remove use of a deprecated GTK+ function in new versions

* src/gtkutil.c (xg_make_tool_item): Use gtk_widget_set_focus_on_click
if available

7 years agoStop using deprecated GdkScreen monitor functions in newer GDK
Philipp Stephani [Sun, 27 Aug 2017 11:15:34 +0000 (13:15 +0200)]
Stop using deprecated GdkScreen monitor functions in newer GDK

* src/xfns.c (Fx_display_monitor_attributes_list): Use GdkMonitor
objects instead of the deprecated GdkScreen functions in GDK 3.22+

7 years agoUse GdkSeat in new GDK versions
Philipp Stephani [Sun, 27 Aug 2017 11:53:36 +0000 (13:53 +0200)]
Use GdkSeat in new GDK versions

* src/gtkutil.c (xg_event_is_for_scrollbar): Use GdkSeat instead of
GdkDeviceManager in GDK 3.20+

7 years ago* src/xterm.c (XTflash): Don’t use gdk_cairo_create in GDK 3.22+
Philipp Stephani [Sun, 27 Aug 2017 11:19:26 +0000 (13:19 +0200)]
* src/xterm.c (XTflash): Don’t use gdk_cairo_create in GDK 3.22+

7 years agoRemove call of deprecated GDK function
Philipp Stephani [Fri, 25 Aug 2017 09:08:25 +0000 (11:08 +0200)]
Remove call of deprecated GDK function

* src/xterm.h (XSync): Don’t call gdk_window_process_all_updates in
GDK 3.22 or later.

7 years agoAmend the CC Mode macro cache to cope with changes at the macro start
Alan Mackenzie [Sun, 27 Aug 2017 10:38:47 +0000 (10:38 +0000)]
Amend the CC Mode macro cache to cope with changes at the macro start

Fixes bug #28233.

* lisp/progmodes/cc-engine.el (c-invalidate-macro-cache): Fix an off-by-1
error.

7 years agoFix over-protection of byte-compiled files
Paul Eggert [Sun, 27 Aug 2017 06:07:01 +0000 (23:07 -0700)]
Fix over-protection of byte-compiled files

Problem reported by Sven Joachim (Bug#28244).
Also, fix similar problem for autoload files.
* lisp/emacs-lisp/autoload.el (autoload--save-buffer):
Set temp file modes to the buffer-file-name file modes (or 666
if not available) as adjusted by umask.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Set temp file modes to 666 as adjusted by umask.

7 years agoRefine conf-toml-mode font-lock
Tom Tromey [Sat, 26 Aug 2017 22:23:34 +0000 (16:23 -0600)]
Refine conf-toml-mode font-lock

Bug#28218
* lisp/textmodes/conf-mode.el (conf-toml-font-lock-keywords): Use
conf-toml-recognize-section.  Use \s- in variable regexp.
(conf-toml-recognize-section): New function.

7 years agoDo not munge contents of local symbolic links
Paul Eggert [Sun, 27 Aug 2017 01:36:38 +0000 (18:36 -0700)]
Do not munge contents of local symbolic links

This lets Emacs deal with arbitrary local symlinks without
mishandling their contents (Bug#28156).  For example,
(progn (shell-command "ln -fs '~' 'x'") (rename-file "x" "/tmp/x"))
now consistently creates a symbolic link from '/tmp/x' to '~'.
Formerly, it did that only if the working directory was on the
same filesystem as /tmp; otherwise, it expanded the '~' to
the user's home directory.
* lisp/dired.el (dired-get-filename): Use files--name-absolute-system-p
instead of rolling our own code.
* lisp/files.el (files--name-absolute-system-p): New function.
(file-truename, file-chase-links): Use it to avoid mishandling
symlink contents that begin with ~.
(copy-directory, move-file-to-trash):
Use concat rather than expand-file-name, to avoid mishandling
symlink contents that begin with ~.
* src/fileio.c (Fmake_symbolic_link): Do not expand leading "~" in the
target unless interactive.  Strip leading "/:" if interactive.
(emacs_readlinkat): Do not prepend "/:" to the link target if
it starts with "/" and contains ":" before NUL.
* test/src/fileio-tests.el (try-link): Rename from try-char,
and accept a string instead of a char.  All uses changed.
(fileio-tests--symlink-failure): Also test leading ~, and "/:",
to test the new behavior.

7 years agoRemove invalid regexp for shell builtins for wksh
Reuben Thomas [Sat, 26 Aug 2017 23:26:28 +0000 (00:26 +0100)]
Remove invalid regexp for shell builtins for wksh

* lisp/progmodes/sh-script.el (sh-builtins): Shell built-ins have to
be literal strings, so remove a regexp for wksh. In any case, it’s a
defunct proprietary shell.

7 years agoImprove doc for file-name-absolute-p.
Paul Eggert [Sat, 26 Aug 2017 20:44:41 +0000 (13:44 -0700)]
Improve doc for file-name-absolute-p.

7 years agoFix Tramp part of Bug#28156
Michael Albinus [Sat, 26 Aug 2017 13:09:55 +0000 (15:09 +0200)]
Fix Tramp part of Bug#28156

* lisp/files.el (file-name-non-special): Use `file-name-quote'
instead prefixing "/:", the file could already be quoted.

* lisp/net/tramp.el (tramp-error): Handle null arguments.
(tramp-handle-make-symbolic-link):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link)
(tramp-sh-handle-add-name-to-file):
* lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file)
(tramp-smb-handle-make-symbolic-link): Adapt implementation to
stronger semantics in Emacs.  (Bug#28156)

* test/lisp/net/tramp-tests.el (tramp-test21-file-links):
Extend test.

7 years agoFix bugs merged with bug#25428
Eli Zaretskii [Sat, 26 Aug 2017 09:52:07 +0000 (12:52 +0300)]
Fix bugs merged with bug#25428

* lisp/simple.el (auto-fill-mode, visual-line-mode): Doc fix.
(Bug#13926)  (Bug#25434)  (Bug#25435)

7 years agoImprove documentation of Info virtual files and nodes
Eli Zaretskii [Sat, 26 Aug 2017 09:40:02 +0000 (12:40 +0300)]
Improve documentation of Info virtual files and nodes

* lisp/info.el (Info-virtual-files, Info-virtual-nodes): Doc fix.
(Bug#28237)

7 years ago* lisp/delsel.el (delete-selection-mode): Doc fix. (Bug#25428)
Eli Zaretskii [Sat, 26 Aug 2017 09:01:24 +0000 (12:01 +0300)]
* lisp/delsel.el (delete-selection-mode): Doc fix.  (Bug#25428)

7 years agoSupport multi-lingual detection of SEE ALSO man sections
Grégory Mounié [Sat, 26 Aug 2017 08:36:58 +0000 (11:36 +0300)]
Support multi-lingual detection of SEE ALSO man sections

* lisp/man.el (Man-see-also-regexp): Add support for SEE ALSO
section detection in several langages: French, German, Spanish,
Portugese, Italian, Polish, Turkish, Japanese, Chinese.  (Bug#28142)

Copyright-paperwork-exempt: yes

7 years agoImprove expand-file-name doc
Paul Eggert [Sat, 26 Aug 2017 04:12:37 +0000 (21:12 -0700)]
Improve expand-file-name doc

* doc/lispref/files.texi (Relative File Names, Directory Names)
(File Name Expansion):
* doc/lispref/minibuf.texi (Reading File Names):
Document expand-file-name behavior with ~ more clearly
and accurately.
* doc/misc/org.texi (Batch execution): Simplify example
script so that it does not need expand-file-name and thus
will not mishandle file names with leading ~.

7 years agoSupport all perl variable declarators and prefixes (Bug#27613)
Jefferson Carpenter [Fri, 7 Jul 2017 22:08:52 +0000 (17:08 -0500)]
Support all perl variable declarators and prefixes (Bug#27613)

* lisp/progmodes/perl-mode.el (perl-imenu-generic-expression)
(perl-font-lock-keywords-2): Match declators 'anon', 'argument', 'has',
'local', 'state', 'supersede', 'let', and 'temp'.

Copyright-paperwork-exempt: yes

7 years ago; * doc/lispref/files.texi (File Attributes): Add missing word.
Noam Postavsky [Sat, 26 Aug 2017 02:47:51 +0000 (22:47 -0400)]
; * doc/lispref/files.texi (File Attributes): Add missing word.

7 years agoFix file-attributes race on GNU hosts
Paul Eggert [Fri, 25 Aug 2017 19:44:52 +0000 (12:44 -0700)]
Fix file-attributes race on GNU hosts

* doc/lispref/files.texi (File Attributes):
Document file-attributes atomicity.
* etc/NEWS: Document the fix.
* src/dired.c (file_attributes): New args DIRNAME and FILENAME,
for diagnostics.  All callers changed.  On platforms like
GNU/Linux that support O_PATH, fix a race condition in
file-attributes and similar functions, so that these functions do
not return nonsense if a directory entry is replaced while getting
its attributes.  On non-GNU platforms, do a better (though not
perfect) job of detecting the race, and return nil if detected.

7 years agoSimplify expand_and_dir_to_file
Paul Eggert [Fri, 25 Aug 2017 16:20:52 +0000 (09:20 -0700)]
Simplify expand_and_dir_to_file

* src/fileio.c (expand_and_dir_to_file): Simplify by omitting 2nd
argument, since in practice it always has the default value.  All
callers changed.  Prefer C99 style decls in nearby code.

7 years ago; * src/w32.c (faccessat): Fix last change. (Bug#28207)
Eli Zaretskii [Fri, 25 Aug 2017 15:01:19 +0000 (18:01 +0300)]
; * src/w32.c (faccessat): Fix last change.  (Bug#28207)

7 years agoFix file-name completion on network shares
Eli Zaretskii [Fri, 25 Aug 2017 14:43:15 +0000 (17:43 +0300)]
Fix file-name completion on network shares

* src/w32.c (faccessat): Don't assume that F_OK is non-zero.
(Bug#28207)

7 years agoFix a FIXME with an exegetical comment
Reuben Thomas [Fri, 25 Aug 2017 12:58:11 +0000 (13:58 +0100)]
Fix a FIXME with an exegetical comment

* lisp/progmodes/sh-script.el (sh-builtins): Explain why we have a
regexp for wksh builtins.

7 years agoMinor docstring language fix
Reuben Thomas [Fri, 25 Aug 2017 12:46:50 +0000 (13:46 +0100)]
Minor docstring language fix

* lisp/progmodes/sh-script.el (sh-show-indent): Remove spurious “the”.

7 years agoRemove old commented code from sh-script.el
Reuben Thomas [Fri, 25 Aug 2017 12:45:32 +0000 (13:45 +0100)]
Remove old commented code from sh-script.el

* lisp/progmodes/sh-script.el (sh-abbrevs): Remove commented function
and variable, commented since 2001.

7 years ago* lisp/emacs-lisp/package.el: Don't let failure stop us
Stefan Monnier [Fri, 25 Aug 2017 06:10:53 +0000 (02:10 -0400)]
* lisp/emacs-lisp/package.el: Don't let failure stop us

(package-activate-1): Don't throw an error for missing deps.
(package-unpack): Don't bother compiling if activation failed.
(package-initialize): Report failures but keep activating other packages.

7 years agoPrefer ‘double’ for FP temps in xterm.c
Paul Eggert [Thu, 24 Aug 2017 23:15:59 +0000 (16:15 -0700)]
Prefer ‘double’ for FP temps in xterm.c

* src/xterm.c (xm_scroll_callback, xaw_jump_callback)
(x_set_toolkit_scroll_bar_thumb)
(x_set_toolkit_horizontal_scroll_bar_thumb): Prefer ‘double’ to
‘float’ for individual local floating-point temporaries.

7 years agoAvoid using string-to-multibyte in ispell.el
Reuben Thomas [Tue, 22 Aug 2017 00:46:27 +0000 (01:46 +0100)]
Avoid using string-to-multibyte in ispell.el

* lisp/textmodes/ispell.el (ispell-get-decoded-string): Use
decode-coding-string instead. Note that decode-coding-string returns a
string that satisfies multibyte-string-p even if its input is pure
ASCII and the third argument is t, so the result of
ispell-get-decoded-string is always a multibyte string.

7 years agoStore the regexp just when there are matches
Tino Calancha [Thu, 24 Aug 2017 15:24:59 +0000 (00:24 +0900)]
Store the regexp just when there are matches

* lisp/hi-lock.el (hi-lock-set-pattern): When font-lock-mode is
disabled and there are no matches do not store REGEXP
in hi-lock-interactive-patterns.

7 years agoKeep face available if there are no matches
Tino Calancha [Thu, 24 Aug 2017 15:00:20 +0000 (00:00 +0900)]
Keep face available if there are no matches

If font-lock-mode is disabled in the current buffer, and
there are no matches for REGEXP, then keep FACE available
for a next search.
* lisp/hi-lock.el (hi-lock-set-pattern): Add FACE into
hi-lock--unused-faces if font-lock-mode is disabled and
there are no matches.
* test/lisp/hi-lock-tests.el (hi-lock-test-set-pattern): Add test.

7 years agoMinor improvements for tramp-interrupt-process, documentation
Michael Albinus [Thu, 24 Aug 2017 13:53:56 +0000 (15:53 +0200)]
Minor improvements for tramp-interrupt-process, documentation

* doc/lispref/processes.texi (Signals to Processes):
* etc/NEWS: Document interrupt-process-functions.

* lisp/net/tramp.el (tramp-interrupt-process): Test also for
`process-live-p'.

* src/process.c (Vinterrupt_process_functions): Fix docstring.

* test/lisp/net/tramp-tests.el (tramp-test28-interrupt-process):
Extend test.

7 years agoFix a comment whitespace typo.
Reuben Thomas [Wed, 23 Aug 2017 22:47:19 +0000 (23:47 +0100)]
Fix a comment whitespace typo.

src/fileio.c: A double space was added after "..", used in a code
example. Make it a single space.

7 years agoRemove old commented code and obsolete comments
Reuben Thomas [Wed, 23 Aug 2017 10:54:34 +0000 (11:54 +0100)]
Remove old commented code and obsolete comments

* lisp/files.el (locate-dominating-files): Remove old commented
implementation from 9 years ago.  Since the current version
appears (at least to me) not just more efficient but clearer than the
version removed, also delete a comment in the new version referring to
the old version. Remove old commented heuristic code,
and explanatory comments.

7 years agoRemove old duplicate commented code
Reuben Thomas [Wed, 23 Aug 2017 10:34:21 +0000 (11:34 +0100)]
Remove old duplicate commented code

* lisp/files.el (file-relative-name): Remove old commented version,
replaced 14 years ago in commit 753ad9889.

7 years agoAdd conf-toml-mode
Tom Tromey [Wed, 23 Aug 2017 22:06:48 +0000 (16:06 -0600)]
Add conf-toml-mode

* etc/NEWS: Mention conf-toml-mode.
* lisp/files.el (auto-mode-alist): Add entry for .toml.
* lisp/textmodes/conf-mode.el (conf-toml-mode-syntax-table)
(conf-toml-font-lock-keywords): New defvars.
(conf-toml-mode): New mode.

7 years agoUse lisp type in log message (bug#28176)
Alan Third [Wed, 23 Aug 2017 20:13:22 +0000 (21:13 +0100)]
Use lisp type in log message (bug#28176)

* src/nsimage.m (ns_load_image): Use make_number on index.

7 years agoFix PNGs on macOS (bug#28176)
Alan Third [Wed, 23 Aug 2017 18:53:23 +0000 (19:53 +0100)]
Fix PNGs on macOS (bug#28176)

* src/nsimage.m (ns_load_image): Remove index check.
(EmacsImage::getAnimatedBitmapImageRep): New function.
(EmacsImage::getMetadata): Use getAnimatedBitmapImageRep.
(EmacsImage::setFrame): Use getAnimatedBitmapImageRep and check index
is valid.

7 years agoAdd ability to change macOS WM theme (bug#27973)
Alan Third [Sun, 20 Aug 2017 20:14:47 +0000 (21:14 +0100)]
Add ability to change macOS WM theme (bug#27973)

* src/frame.c (make_frame, frame_parms, syms_of_frame)
[NS_IMPL_COCOA]: Add ns-appearance and ns-transparent-titlebar
options.
* src/frame.h (ns_appearance_type) [NS_IMPL_COCOA]: Add enum to
represent NSAppearance options.
(struct frame) [NS_IMPL_COCOA]: Add ns_appearance and
ns_transparent_titlebar frame parameters.
* src/nsfns.m (ns_frame_parm_handlers) [NS_IMPL_COCOA]: Add
ns_set_appearance and ns_set_transparent_titlebar handlers.
(Sx_create_frame): Handle ns-appearance and ns-transparent-titlebar
frame parameters.
(Qdark): Add new symbol for use with ns-appearance.
* src/nsterm.h (ns_set_appearance, ns_set_transparent_titlebar)
[NS_IMPL_COCOA]: Add prototypes.
* src/nsterm.m (ns_set_appearance, ns_set_transparent_titlebar)
[NS_IMPL_COCOA]: New functions.
(initFrameFromEmacs) [NS_IMPL_COCOA]: Handle ns-appearance and
ns-transparent-titlebar frame parameters.
* doc/lispref/frames.texi (Window Management Parameters): Document
ns-apperance and ns-transparent-titlebar.

7 years agoWhen looking for the end of a declarator, prevent macros fouling up the search
Alan Mackenzie [Tue, 22 Aug 2017 17:04:34 +0000 (17:04 +0000)]
When looking for the end of a declarator, prevent macros fouling up the search

The practical implication of this bug was a random jit-lock chunk remaining
entirely unfontified.

* lisp/progmodes/cc-mode (c-fl-decl-end): If point starts inside a macro,
restrict two forward searches to the end of that macro.

7 years ago; * src/w32.c: Fix a typo in a comment.
Eli Zaretskii [Tue, 22 Aug 2017 16:52:47 +0000 (19:52 +0300)]
; * src/w32.c: Fix a typo in a comment.

7 years agoTest `file-expand-wildcards' for Tramp
Michael Albinus [Tue, 22 Aug 2017 14:22:33 +0000 (16:22 +0200)]
Test `file-expand-wildcards' for Tramp

* lisp/net/tramp-compat.el (tramp-advice-file-expand-wildcards):
Remove, not needed anymore.

* test/lisp/net/tramp-tests.el (top): Require seq.el.
(tramp-test16-directory-files): Simplify.
(tramp-test16-file-expand-wildcards): New test.
(tramp-test28-interrupt-process): Skip for older Emacsen.

7 years agoAdd tests for cl-macs.el (Bug#27559)
Alexander Gramiak [Fri, 11 Aug 2017 23:53:27 +0000 (17:53 -0600)]
Add tests for cl-macs.el (Bug#27559)

* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-test-loop): Remove
duplicate.
(cl-loop-destructuring-with): Move to cl-macs-tests.el.
* test/lisp/emacs-lisp/cl-macs-tests.el: New file.

7 years agoOptimize skkdic conversion (Bug#28043)
Noam Postavsky [Sun, 2 Jul 2017 02:39:16 +0000 (22:39 -0400)]
Optimize skkdic conversion (Bug#28043)

The primary speedup comes from the optimizing lookup-nested-alist and
set-nested-alist for the case where the key is a string.  This brings
the time down to less than half the original.

* lisp/international/mule-util.el (lookup-nested-alist)
(set-nested-alist): Use `assq' instead of `assoc' when KEYSEQ is a
string.

* lisp/international/ja-dic-cnv.el (skkdic-collect-okuri-nasi)
(skkdic-convert-okuri-nasi): Use progress-reporter functions instead
of calculating ratio of work done inline.

(skkdic-reduced-candidates): Call `char-category-set' on the first
character of the string directly, instead of using a regexp for the
character category.
(skkdic--japanese-category-set): New constant.
(skkdic-collect-okuri-nasi): Just set
`skkdic-okuri-nasi-entries-count' at once at the end rather than
updating it throughout the loop.

(skkdic-convert-postfix skkdic-convert-prefix)
skkdic-get-candidate-list, skkdic-collect-okuri-nasi)
(skkdic-extract-conversion-data): Use `match-string-no-properties'
instead of `match-string'.

7 years agoTreat tests in lib-src like tests in src
Reuben Thomas [Tue, 22 Aug 2017 00:39:10 +0000 (01:39 +0100)]
Treat tests in lib-src like tests in src

* test/Makefile.in (test_template): Depend on a .c source file for a
test under lib-src, as for src.  (Thanks, Glenn Morris for pointing me
in the right direction.)

7 years agoPort /bin/sh scripts to Solaris 10
Paul Eggert [Mon, 21 Aug 2017 22:34:07 +0000 (15:34 -0700)]
Port /bin/sh scripts to Solaris 10

Its /bin/sh builtin ‘test’ command does not support -e.
* autogen.sh, build-aux/git-hooks/pre-commit:
* build-aux/gitlog-to-emacslog, make-dist:
Use test -r, not test -e.

7 years agoAvoid losing the buffer restriction in flyspell-mode
Eli Zaretskii [Mon, 21 Aug 2017 17:21:28 +0000 (20:21 +0300)]
Avoid losing the buffer restriction in flyspell-mode

* src/intervals.c (get_local_map): Don't allow C-g to quit as long
as we have the buffer widened, to make sure the restriction is
preserved.  (Bug#28161)

7 years agoFix the 'versionclean' target in src/Makefile
Sven Joachim [Mon, 21 Aug 2017 16:28:55 +0000 (19:28 +0300)]
Fix the 'versionclean' target in src/Makefile

* src/Makefile.in (versionclean): Don't accidentally remove
emacs-module.h.  (Bug#28169)

7 years agoImplement `interrupt-process-functions'
Michael Albinus [Mon, 21 Aug 2017 15:30:33 +0000 (17:30 +0200)]
Implement `interrupt-process-functions'

* lisp/net/tramp.el (tramp-interrupt-process): Rename from
`tramp-advice-interrupt-process'.  Adapt according to changed API.
(top): Add it to `interrupt-process-functions'.

* src/process.c (Finternal_default_interrupt_process): New defun.
(Finterrupt_process): Change implementation, based on
Vinterrupt_process_functions.
(Vinterrupt_process_functions): New defvar.

* test/lisp/net/tramp-tests.el (tramp-test40-unload): Do not
test removal of advice.

7 years agoAvoid floating-point exceptions while drawing underwave
Eli Zaretskii [Mon, 21 Aug 2017 14:46:42 +0000 (17:46 +0300)]
Avoid floating-point exceptions while drawing underwave

* src/w32term.c (x_get_scale_factor):
* src/xterm.c (x_get_scale_factor): Don't let the scale factors
become less than 1.  Reported by Yuri D'Elia <wavexx@thregr.org> in
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00459.html.

7 years agomark flymake-mode as safe local variable when the value is nil
Sam Steingold [Mon, 21 Aug 2017 13:50:09 +0000 (09:50 -0400)]
mark flymake-mode as safe local variable when the value is nil

7 years agoallow nil init in flymake-allowed-file-name-masks to disable flymake
Sam Steingold [Mon, 21 Aug 2017 13:48:14 +0000 (09:48 -0400)]
allow nil init in flymake-allowed-file-name-masks to disable flymake

(flymake-allowed-file-name-masks): Update doc and :type.
(flymake-get-file-name-mode-and-masks): Handle nil init.

7 years ago; Fix typo in lispref
Mark Oteiza [Mon, 21 Aug 2017 02:31:25 +0000 (22:31 -0400)]
; Fix typo in lispref

* doc/lispref/variables.texi (Using Lexical Binding): Append an s.

7 years agoRemove the workaround for bug#20719
Dmitry Gutov [Sun, 20 Aug 2017 21:41:59 +0000 (00:41 +0300)]
Remove the workaround for bug#20719

* lisp/cedet/semantic/symref/grep.el
(semantic-symref-grep-use-template): Remove the workaround for
bug#20719, it's been fixed for a while now.

7 years agoFix byte-compilation warnings in semantic/symref/grep
Dmitry Gutov [Sun, 20 Aug 2017 21:39:22 +0000 (00:39 +0300)]
Fix byte-compilation warnings in semantic/symref/grep

* lisp/cedet/semantic/symref/grep.el (greppattern): Remove.
(grepflags): Rename to semantic-symref-grep-flags.
(semantic-symref-grep-expand-keywords): Update accordingly.
(semantic-symref-grep-use-template): Remove the last two
arguments to make sure they don't shadow the (not renamed)
global variables.
(semantic-symref-perform-search)
(semantic-symref-parse-tool-output-one-line): Use slot names
instead of keywords, like the byte-compiler wants us to.

7 years agoSimplify eldoc-message
Dmitry Gutov [Sun, 20 Aug 2017 21:26:45 +0000 (00:26 +0300)]
Simplify eldoc-message

* lisp/emacs-lisp/eldoc.el (eldoc-message): Simplify.
Don't use ARGS because no callers pass them.  Discussed in bug#27230.

7 years agoWork around w32-python-2.x bug to fix prompt detection (Bug#21376)
Noam Postavsky [Tue, 15 Aug 2017 21:49:10 +0000 (17:49 -0400)]
Work around w32-python-2.x bug to fix prompt detection (Bug#21376)

* lisp/progmodes/python.el (python-shell-prompt-detect): Don't put
carriage returns into the temporary file when running in unbuffered
mode, the w32 build of python 2.7 chokes on them.

7 years ago; Remove python-shell-calculate-command-1 test
Noam Postavsky [Wed, 16 Aug 2017 11:06:38 +0000 (07:06 -0400)]
; Remove python-shell-calculate-command-1 test

* test/lisp/progmodes/python-tests.el
(python-shell-calculate-pythonpath-1): Remove, it merely reprises the
body of `python-shell-calculate-command' and it has been broken on w32
since the fix for Bug#25025 was applied.

7 years ago; * lisp/textmodes/ispell.el: `subr-x' is only needed at compile time.
Noam Postavsky [Sun, 20 Aug 2017 20:40:35 +0000 (16:40 -0400)]
; * lisp/textmodes/ispell.el: `subr-x' is only needed at compile time.

7 years agoAdd missing require
Reuben Thomas [Sun, 20 Aug 2017 20:32:40 +0000 (21:32 +0100)]
Add missing require

* lisp/textmodes/ispell.el: Require subr-x. (Thanks, Eli Zaretskii.)

7 years agoImplement `interrupt-process' for remote processes (Bug#28066)
Michael Albinus [Sun, 20 Aug 2017 19:18:05 +0000 (21:18 +0200)]
Implement `interrupt-process' for remote processes (Bug#28066)

* lisp/net/tramp-sh.el (tramp-sh-handle-start-file-process):
Support sending signals remotely.
(tramp-open-connection-setup-interactive-shell):
Trace "remote-tty" connection property.

* lisp/net/tramp.el (tramp-advice-interrupt-process): New defun.
(top): Add advice to `interrupt-process'.  (Bug#28066)

* test/lisp/net/tramp-tests.el (tramp-test28-interrupt-process):
New test.
(tramp-test29-shell-command)
(tramp-test30-environment-variables)
(tramp-test30-environment-variables-and-port-numbers)
(tramp-test31-explicit-shell-file-name)
(tramp-test32-vc-registered)
(tramp-test33-make-auto-save-file-name)
(tramp-test34-make-nearby-temp-file)
(tramp-test35-special-characters)
(tramp-test35-special-characters-with-stat)
(tramp-test35-special-characters-with-perl)
(tramp-test35-special-characters-with-ls, tramp-test36-utf8)
(tramp-test36-utf8-with-stat, tramp-test36-utf8-with-perl)
(tramp-test36-utf8-with-ls)
(tramp-test37-asynchronous-requests)
(tramp-test38-recursive-load, tramp-test39-remote-load-path)
(tramp-test40-unload): Rename.
(tramp-test40-unload): Test also removal of advice.

7 years agoDocument Enchant support
Reuben Thomas [Sun, 20 Aug 2017 12:56:38 +0000 (13:56 +0100)]
Document Enchant support

* doc/emacs/fixit.texi: Mention Enchant.
* doc/misc/efaq.texi: Likewise.
* etc/NEWS: Add an item on Enchant support.

7 years agoRemove old comments and a redundant FIXME
Reuben Thomas [Tue, 8 Aug 2017 14:56:03 +0000 (15:56 +0100)]
Remove old comments and a redundant FIXME

* lisp/textmodes/ispell.el (ispell-process-line): Remove some old
commented code, a redundant FIXME, and outdated usage instructions.

7 years agoAdd Enchant support to ispell.el (Bug#17742)
Reuben Thomas [Sun, 4 Dec 2016 22:39:27 +0000 (22:39 +0000)]
Add Enchant support to ispell.el (Bug#17742)

* lisp/textmodes/ispell.el (ispell-program-name): Add “enchant”.
(ispell-really-enchant): Add variable.
(ispell-check-version): If using Enchant, check it’s new enough (at
least 1.6.1).  (Like the ispell check, this is absolute: cannot work
without.)
(ispell-enchant-dictionary-alist): Add variable.
(ispell-find-enchant-dictionaries): Add function, based on
ispell-find-aspell-dictionaries.
(ispell-set-spellchecker-params): Allow dictionary auto-detection for
Enchant, and call ispell-find-enchant-dictionaries to find them.  Use
old ispell name to locale mapping code for Enchant too.
(ispell-send-replacement): Make it work with Enchant.

7 years ago* lisp/term.el (term-mode): Use `window-text-height' (Bug#5615).
Noam Postavsky [Fri, 11 Aug 2017 00:43:13 +0000 (20:43 -0400)]
* lisp/term.el (term-mode): Use `window-text-height' (Bug#5615).