Paul Eggert [Thu, 22 Dec 2016 17:25:58 +0000 (09:25 -0800)]
Pacify --enable-gcc-warnings
* src/charset.c (load_charset_map):
* src/coding.c (decode_coding_object):
* src/frame.c (make_frame):
* src/window.c (Frecenter):
Mark locals with UNINIT to silence false alarms from
-Wmaybe-uninitialized.
* src/lisp.h (SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD)
(SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD):
Check and assume that values are nonnull. This pacifies
-Wmaybe-uninitialized in Fmake_variable_buffer_local and
Fmake_local_variable.
Noam Postavsky [Sun, 14 Aug 2016 02:13:56 +0000 (22:13 -0400)]
Use completion-at-point in verilog-mode
There were some functions in verilog-mode that implemented in-buffer
completion, but this needlessly duplicates completion-at-point
functionality, and the popup window management had problems
(see Bug #23842). We need to keep them for backwards compatibility with
older emacs versions, but use completion-at-point if available.
* lisp/progmodes/verilog-mode.el (verilog-toggle-completions): Mark as
obsolete if completion-cycle-threshold is available.
(verilog-mode-map, verilog-menu): Bind completion-at-point and
completion-help-at-point in preference to verilog-complete-word and
verilog-show-completions, respectively.
(verilog-mode): Add verilog-completion-at-point to
completion-at-point-functions.
(verilog-completion-at-point): New function.
(verilog-show-completions, verilog-complete-word): Use it to avoid code
duplication.
Reuben Thomas [Wed, 21 Dec 2016 17:30:44 +0000 (17:30 +0000)]
Keep default CASECHARS/NOT-CASECHARS for ispell built-in dictionaries
* lisp/textmodes/ispell.el (ispell-set-spellchecker-params): Do not
override CASECHARS and NOT-CASECHARS. The ispell dictionaries
retain their hardwired values, and all other dictionaries are given
sensible defaults.
Eli Zaretskii [Wed, 21 Dec 2016 20:16:24 +0000 (22:16 +0200)]
Fix aborts in GC under GC_CHECK_MARKED_OBJECTS
* src/alloc.c (mark_object) [GC_CHECK_MARKED_OBJECTS]: Don't abort
for thread objects. They are marked via the all_threads list, and
therefore don't need to be inserted into the red-black tree, so
mem_find will never find them. Reported by Daniel Colascione
<dancol@dancol.org> in
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00817.html.
Add several new filters and improve documentation.
See discussion on:
https://lists.gnu.org/archive/html/emacs-devel/2016-11/msg00399.html
* lisp/ibuf-ext.el: Add paragraph to file commentary.
(ibuffer-saved-filters, ibuffer-filtering-qualifiers)
(ibuffer-filter-groups): Update doc string.
(ibuffer-unary-operand): Add new function that transparently
handles 'not' formats for compound filters.
(ibuffer-included-in-filter-p): Handle 'not' fully; update doc string.
(ibuffer-included-in-filter-p-1): Handle 'and' compound filters.
(ibuffer-decompose-filter): Handle 'and' as well,
and handle 'not' consistently with other uses.
(ibuffer-and-filter): New defun analogous to 'ibuffer-or-filter'.
(ibuffer--or-and-filter): New defun.
(ibuffer-or-filter, ibuffer-and-filter): Use it.
(ibuffer-format-qualifier): Handle 'and' filters as well.
(ibuffer-filter-by-basename, ibuffer-filter-by-file-extension)
(ibuffer-filter-by-directory, ibuffer-filter-by-starred-name)
(ibuffer-filter-by-modified, ibuffer-filter-by-visiting-file):
Add new pre-defined filters.
(ibuffer-filter-chosen-by-completion): Add new interactive command
for easily choosing a filter from the descriptions.
* lisp/ibuffer.el (ibuffer-mode-map):
Bind ibuffer-filter-by-basename, ibuffer-filter-by-file-extension,
ibuffer-filter-by-starred-name, ibuffer-filter-by-modified,
ibuffer-filter-by-visiting-file to '/b', '/.', '/*', '/i', '/v'
respectively; bind 'ibuffer-or-filter', 'ibuffer-and-filter',
'ibuffer-pop-filter' ,'ibuffer-pop-filter-group' and
'ibuffer-filter-disable' to '/|', '/&', '/<up>', '/S-<up>'
and '/ DEL' respectively.
* test/lisp/ibuffer-tests.el (ibuffer-autoload): Add appropriate
skip specification.
Add menu entries for the new filters.
(ibuffer-filter-inclusion-1, ibuffer-filter-inclusion-2
ibuffer-filter-inclusion-3, ibuffer-filter-inclusion-4
ibuffer-filter-inclusion-5, ibuffer-filter-inclusion-6
ibuffer-filter-inclusion-7, ibuffer-filter-inclusion-8
ibuffer-decompose-filter, ibuffer-and-filter
ibuffer-or-filter): Add new tests; they are skipped unless
ibuf-ext is loaded.
; * etc/NEWS: Add entries for new user-facing features.
Mark Oteiza [Tue, 20 Dec 2016 01:35:02 +0000 (20:35 -0500)]
Recognize graphicsmagick in image-dired
* lisp/image-dired.el (image-dired-cmd-create-thumbnail-program):
(image-dired-cmd-create-thumbnail-options):
(image-dired-cmd-create-temp-image-program):
(image-dired-cmd-create-temp-image-options):
(image-dired-cmd-create-standard-thumbnail-options):
(image-dired-cmd-rotate-thumbnail-program):
(image-dired-cmd-rotate-thumbnail-options): Account for existence of
gm(1) executable.
Mark Oteiza [Tue, 20 Dec 2016 00:47:06 +0000 (19:47 -0500)]
Implement asynchronous thumbnail generation in image-dired
Additionally, all FOO-options defcustoms that were in fact shell command
strings have been converted to argument lists. Another method for
shrinking PNG thumbs with optipng(1) has been added.
* lisp/image-dired.el: Remove TODO item in commentary.
(image-dired-cmd-create-thumbnail-options):
(image-dired-cmd-create-temp-image-options):
(image-dired-cmd-rotate-thumbnail-options):
(image-dired-cmd-rotate-original-options):
(image-dired-cmd-write-exif-data-options):
(image-dired-cmd-read-exif-data-options): Convert to argument lists.
(image-dired-cmd-pngnq-program, image-dired-cmd-pngcrush-program):
Change string type to file.
(image-dired-cmd-create-standard-thumbnail-command): Remove.
(image-dired-cmd-pngnq-options):
(image-dired-cmd-create-standard-thumbnail-options):
(image-dired-cmd-optipng-program, image-dired-cmd-optipng-options):
New defcustoms.
(image-dired-queue, image-dired-queue-active-jobs):
(image-dired-queue-active-limit): New variables.
(image-dired-pngnq-thumb, image-dired-pngcrush-thumb):
(image-dired-optipng-thumb): New functions.
(image-dired-create-thumb-1): Renamed from image-dired-create-thumb.
Use start-process instead of call-process. Set file modes. Trigger
PNG file optimization in process sentinel.
(image-dired-thumb-queue-run, image-dired-create-thumb): New functions.
(image-dired-display-thumbs):
(image-dired-create-thumbs): Don't expect call-process return value.
(image-dired-display-image, image-dired-rotate-thumbnail): Use
start-process instead of call-process.
(image-dired-rotate-original, image-dired-set-exif-data):
(image-dired-get-exif-data): Adapt to arguments being an arg list.
Glenn Morris [Mon, 19 Dec 2016 18:32:55 +0000 (13:32 -0500)]
Improve default load-path for uninstalled CANNOT_DUMP builds
* src/lread.c (load_path_default) [CANNOT_DUMP]:
Use build load-path if we seem to be running uninstalled. (Bug#24974)
I think this became an issue several years ago when we stopped
using EMACSLOADPATH in the Makefiles; however this change should
improve the CANNOT_DUMP uninstalled case in general.
Eli Zaretskii [Mon, 19 Dec 2016 17:11:16 +0000 (19:11 +0200)]
Fix crashes upon C-g on Posix TTY frames
* src/thread.h (struct thread_state): New member not_holding_lock.
(maybe_reacquire_global_lock): Add prototype.
* src/thread.c: Include syssignal.h.
(maybe_reacquire_global_lock): New function.
(really_call_select): Set the not_holding_lock member of the
thread state before releasing the lock, and rest it after
re-acquiring the lock when the select function returns. Block
SIGINT while doing this to make sure we are not interrupted on TTY
frames.
* src/sysdep.c (block_interrupt_signal, restore_signal_mask): New
functions.
* src/syssignal.h (block_interrupt_signal, restore_signal_mask):
Add prototypes.
* src/keyboard.c (read_char) [THREADS_ENABLED]: Call
maybe_reacquire_global_lock. (Bug#25178)
* loadup.el [ns]: "ucs-normalize" uses `string-to-list' which is defined
in "mule-util", so we have to load "mule-util" before "ucs-normalize",
otherwise I get "Eager macro-expansion failure" on "make bootstrap"
Philipp Stephani [Sat, 10 Dec 2016 20:39:55 +0000 (21:39 +0100)]
Add a new compile error regexp for Clang includes
Clang uses a slight variation of GCC's include format, causing includes
to be treated as warnings instead of informational messages. Use a new
regular expression instead.
* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): New element
`clang-include' for Clang-style "included from" lines.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data): Add unit test.
Mark Oteiza [Sun, 18 Dec 2016 12:28:03 +0000 (07:28 -0500)]
Use floor of mtime instead of rounding for thumb property
This seems to be the correct thing to do, at least more in line with
what at least one other implementation does. Anything using
gnome-desktop [0] effectively does the same, as
gnome_desktop_thumbnail_is_valid applies atol(3) to mtime for
comparison and time_t on GNU/Linux is a signed int.
[0] https://git.gnome.org/browse/gnome-desktop/
* lisp/image-dired.el (image-dired-create-thumb): Use floor here.
* lisp/net/tramp-sh.el (tramp-make-copy-program-file-name): Quote file
name properly.
* test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name):
Mark quoted file name as absolute. (Bug#25183)
(tramp--test-windows-nt-and-batch)
(tramp--test-windows-nt-and-pscp-psftp-p): New defuns.
(tramp--test-windows-nt-or-smb-p): Rename from
`tramp--test-smb-windows-nt-p'. Adapt callees.
(tramp--test-check-files): Improve checks for environment variables.
(tramp-test33-special-characters)
(tramp-test33-special-characters-with-stat)
(tramp-test33-special-characters-with-perl)
(tramp-test33-special-characters-with-ls, tramp-test34-utf8)
(tramp-test34-utf8-with-stat, tramp-test34-utf8-with-perl)
(tramp-test34-utf8-with-ls): Add more checks for skip.
Eli Zaretskii [Sat, 17 Dec 2016 11:08:52 +0000 (13:08 +0200)]
Fix crashes on MS-Windows during dumping
* src/unexw32.c (get_section_info): Make extra_bss_size be the
maximum of extra_bss_size and extra_bss_size_static. This avoids
computing the size of the output file smaller than it actually
needs to be, which then causes copy_executable_and_dump_data to
write beyond the requested size of the file mapping, thus relying
on the OS roundup to page boundary to save us from ourselves. See
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00642.html
for the details.
* lib/stdio-impl.h: Revert the workaround fix of not including
errno.h for MinGW.
Mark Oteiza [Fri, 16 Dec 2016 15:14:01 +0000 (10:14 -0500)]
Be more selective clearing the image cache
* lisp/image-dired.el (image-dired-create-thumbs):
(image-dired-rotate-thumbnail, image-dired-refresh-thumb): Only clear
the current thumbnail file from the image cache.
Nicolas Petton [Fri, 16 Dec 2016 10:18:04 +0000 (11:18 +0100)]
Make seq-into return the sequence when no conversion needed
* lisp/emacs-lisp/seq.el (seq-into): Do not convert the sequence when
no conversion is needed.
* test/lisp/emacs-lisp/seq-tests.el (test-seq-into-and-identity): Add
a regression test checking for identity.
Mark Oteiza [Fri, 16 Dec 2016 01:36:24 +0000 (20:36 -0500)]
More image-dired refactoring
* lisp/image-dired.el (image-dired-thumbnail-mode):
(image-dired-display-image-mode): Add :group 'image-dired so
customize-mode works.
(image-dired-display-image): Rearrange.
(image-dired-copy-with-exif-file-name): This map is for side effect.
(image-dired-dired-edit-comment-and-tags): Just use #'identity.
Mark Oteiza [Fri, 16 Dec 2016 00:55:47 +0000 (19:55 -0500)]
Teach image-dired to also generate large thumbs
* lisp/image-dired.el (image-dired-thumbnail-storage): Add
standard-large option.
(image-dired-thumb-size): Add condition for standard-large storage.
(image-dired-insert-thumbnail): Check for new option. Change
thumbnail path conditionally.
(image-dired-thumb-size): New function.
(image-dired-create-thumb, image-dired-line-up-dynamic): Use it.
Paul Eggert [Thu, 15 Dec 2016 20:18:28 +0000 (12:18 -0800)]
Merge from gnulib
This incorporates:
2016-12-14 xalloc-oversized: check for PTRDIFF_MAX too
2016-12-12 fpending: port to native Windows with MSVC
* .gitignore: Do not ignore lib/stdio-impl.h.
* lib/fpending.c, lib/xalloc-oversized.h, m4/fpending.m4:
Copy from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/stdio-impl.h:
New file, copied from gnulib.
* nt/gnulib.mk (EXTRA_DIST): Add stdio-impl.h.
Mark Oteiza [Thu, 15 Dec 2016 18:25:08 +0000 (13:25 -0500)]
Fix some image-dired customization types
* lisp/image-dired.el (image-dired): Add info link to defgroup.
(image-dired-dir, image-dired-gallery-dir): Set type to directory.
(image-dired-db-file, image-dired-temp-image-file):
(image-dired-cmd-create-thumbnail-program):
(image-dired-cmd-create-temp-image-program):
(image-dired-cmd-rotate-thumbnail-program):
(image-dired-cmd-rotate-original-program):
(image-dired-temp-rotate-image-file):
(image-dired-cmd-write-exif-data-program):
(image-dired-cmd-read-exif-data-program): Set type to file.
(image-dired-create-thumb, image-dired-line-up-dynamic): Check storage
type at runtime, since setting image-dired-thumb-size does not
automatically set image-dired-thumb-width and image-dired-thumb-height.
Eli Zaretskii [Thu, 15 Dec 2016 16:18:59 +0000 (18:18 +0200)]
Prevent crashes in xg_select due to concurrency
* src/xgselect.c (xg_select): Don't call Glib functions that use
'context' if we failed to acquire it. This means some other
thread owns the context, in which case both using the context and
calling block_input/unblock_input will step on that thread's toes
and eventually lead to crashes. (Bug#25172)
Nicolas Petton [Thu, 15 Dec 2016 09:24:57 +0000 (10:24 +0100)]
Fix circular list handling in seq-mapn
* lisp/emacs-lisp/seq.el (seq-mapn): Do not copy list arguments.
* test/lisp/emacs-lisp/seq-tests.el (test-seq-mapn-circular-lists):
Add a regression test.
Mark Oteiza [Wed, 14 Dec 2016 17:25:04 +0000 (12:25 -0500)]
Reset window scroll when displaying an image
When viewing a large image full size and scrolling, for instance, to
the lower right corner, then selecting a much smaller image in the
thumbnail buffer, the window stays scrolled so the new image is out of
the window. One must scroll back to the "origin" to view the new
displayed image, or just kill the image-dired-display-image buffer and
try again. This fixes the issue.
* lisp/image-dired.el (image-dired-display-window-width):
(image-dired-display-window-height): Operate on a window as argument.
(image-dired-display-image): Bind (image-dired-display-window) and use
it. Set window vscroll and hscroll to zero when refreshing the
buffer's contents.
Mark Oteiza [Wed, 14 Dec 2016 03:56:42 +0000 (22:56 -0500)]
More image-dired polish
* lisp/image-dired.el (image-dired-file-name-at-point): New function.
(image-dired-thumbnail-mode, image-dired-display-image-mode): Disable
undo list. Add image-dired-file-name-at-point to
file-name-at-point-functions to facilitate find-file and friends.
(image-dired-thumbnail-display-external):
(image-dired-dired-display-external): Use start-process instead, to
avoid needlessly blocking and using a shell.
Reuben Thomas [Tue, 13 Dec 2016 00:30:51 +0000 (00:30 +0000)]
Minor docstring and comment fixes to ispell.el
lisp/textmodes/ispell.el (ispell-aspell-dictionary-alist): Mention
ispell-aspell-dictionary-alist, not ispell-dictionary-alist.
(ispell-set-spellchecker-params): Change double-single quotes to
single single quotes in comment.
Reuben Thomas [Sun, 4 Dec 2016 22:01:56 +0000 (22:01 +0000)]
Remove XEmacs-specific ispell-with-no-warnings
* lisp/textmodes/ispell.el (ispell-with-no-warnings): Remove this
defmacro, needed only for XEmacs.
(ispell-command-loop, ispell-message): Use with-no-warnings directly.
Reuben Thomas [Sun, 4 Dec 2016 21:58:00 +0000 (21:58 +0000)]
Remove meaningless defconst ispell-version
* lisp/textmodes/ispell.el (ispell-version): Since ispell.el is now
firmly part of Emacs, and the version hasn’t changed since 2003, and
isn’t used anywhere, remove it. 3rd-party code can better use the
Emacs version, or feature or function checks.
(ispell-check-version): No longer report ispell.el version.
Reuben Thomas [Sun, 4 Dec 2016 21:50:18 +0000 (21:50 +0000)]
Remove support for ispell < 3.1.12
* lisp/textmodes/ispell.el (ispell-offset): Remove.
(ispell-check-version): Require ispell >= 3.1.12, released in 1994.
(ispell-process-line): No longer use ispell-offset.
Reuben Thomas [Sun, 4 Dec 2016 13:55:31 +0000 (13:55 +0000)]
Generalise over-specific documentation
* lisp/textmodes/ispell.el (ispell-personal-dictionary): Rather than
document precise personal wordlist filenames for only two supported
spelling checkers, simply say that the default personal dictionary
depends on the chosen spelling checker. The user can check the
spelling checker’s documentation if necessary. This is simpler, and
works for other supported (and future, or unknown) spelling checkers.
Reuben Thomas [Sun, 4 Dec 2016 00:49:35 +0000 (00:49 +0000)]
Remove ispell.el pre-GNU Emacs comments
* lisp/textmodes/ispell.el (Commentary): Remove original maintainer
details, as Emacs version, bug report address and so forth should be
used instead for this version. Remove in-line change history; use
git instead.
Mark Oteiza [Tue, 13 Dec 2016 16:47:21 +0000 (11:47 -0500)]
More small fixes for image-dired
* lisp/image-dired.el: Fix commentary to refer to correct Emacs manual
node.
(image-dired--with-db-file): Add declare forms.
(image-dired-hidden-p): Rewrite with cl-loop. It's not necessary to
run through the whole list.
Mark Oteiza [Tue, 13 Dec 2016 16:41:45 +0000 (11:41 -0500)]
Remove image-dired-kill-buffer-and-window
This breaks window layout, especially when quitting a
image-dired-display-image-mode buffer.
* lisp/image-dired.el (image-dired-thumbnail-mode-map):
(image-dired-display-image-mode-map): Replace in keymap and menu items
bindings to image-dired-kill-buffer-and-window with quit-window.
(image-dired-kill-buffer-and-window): Remove.
Mark Oteiza [Tue, 13 Dec 2016 16:32:04 +0000 (11:32 -0500)]
Replace image-dired-setup-dired-keybindings with a minor mode
* lisp/image-dired.el (image-dired-thumbnail-mode): Fix docstring to
remove mention of nonexistent image-dired-dired and to refer to the
new minor mode.
(image-dired-minor-mode-map): New keymap assimilated from
image-dired-setup-dired-keybindings. In the future, the keymap parent
should be removed, and perhaps also the duplicate bindings that
already exist in dired-mode-map.
(image-dired-setup-dired-keybindings): Remove. Replace with an
obsolete function alias.
(image-dired-minor-mode): New minor mode, assuming the role of
image-dired-setup-dired-keybindings.
Noam Postavsky [Sun, 11 Dec 2016 18:08:15 +0000 (13:08 -0500)]
Clean up var watcher disabling on thread switching
* src/data.c (Fset_default): Move code into new C level function,
`set_default_internal'.
(set_default_internal): New function, like `Fset_default' but also takes
additional bindflag parameter.
(set_internal): Only call `notify_variable_watchers' if bindflag is not
SET_INTERNAL_THREAD_SWITCH.
* src/eval.c (do_specbind, do_one_unbind): Add bindflag parameter,
passed on to set_internal and set_default_internal. Adjust callers.
(rebind_for_thread_switch, unbind_for_thread_switch): Pass
SET_INTERNAL_THREAD_SWITCH to do_specbind, do_one_unbind instead of
temporarily adjusting symbol's trapped_write field.
Glenn Morris [Tue, 13 Dec 2016 01:03:20 +0000 (20:03 -0500)]
Minor fix for define-derived-mode
* lisp/emacs-lisp/derived.el (define-derived-mode):
Do not let eg eval-defun reset the values of syntax or abbrev tables,
since they might have been defined externally. (Bug#16160)
Move backtrace to ELisp using a new mapbacktrace primitive
* src/eval.c (get_backtrace_starting_at, backtrace_frame_apply)
(Fmapbacktrace, Fbacktrace_frame_internal): New functions.
(get_backtrace_frame, Fbacktrace_debug): Use `get_backtrace_starting_at'.
* lisp/subr.el (backtrace--print-frame): New function.
(backtrace): Reimplement using `backtrace--print-frame' and `mapbacktrace'.
(backtrace-frame): Reimplement using `backtrace-frame--internal'.
* lisp/emacs-lisp/debug.el (debugger-setup-buffer): Pass a base to
`mapbacktrace' instead of searching for "(debug" in the output of
`backtrace'.
* test/lisp/subr-tests.el (subr-test-backtrace-simple-tests)
(subr-test-backtrace-integration-test): New tests.
* doc/lispref/debugging.texi (Internals of Debugger): Document
`mapbacktrace' and missing argument BASE of `backtrace-frame'.
Paul Eggert [Mon, 12 Dec 2016 22:27:35 +0000 (14:27 -0800)]
Use C99 syntax for font drivers
Problem reported by Daniel Colascione in:
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00515.html
* src/ftcrfont.c (ftcrfont_driver):
* src/ftfont.c (ftfont_driver):
* src/ftxfont.c (ftxfont_driver):
* src/macfont.m (macfont_driver):
* src/nsfont.m (nsfont_driver):
* src/xfont.c (xfont_driver):
* src/xftfont.c (xftfont_driver):
Use C99 syntax, not the old GNU C syntax.
Glenn Morris [Mon, 12 Dec 2016 20:20:39 +0000 (15:20 -0500)]
Minor advice.el fix
* lisp/emacs-lisp/advice.el (ad-preactivate-advice):
Avoid setting the function definition of nil.
This was happening during bootstrap of org-compat.el,
apparently due to eager macro expansion of code behind
a (featurep 'xemacs) test.
Eli Zaretskii [Mon, 12 Dec 2016 17:56:03 +0000 (19:56 +0200)]
Make etags-tests work in out-of-tree builds
* test/lisp/progmodes/etags-tests.el (etags-bug-158)
(etags-bug-23164): Make them work in an out-of-tree build.
Reported by Ken Brown <kbrown@cornell.edu>.
Eli Zaretskii [Mon, 12 Dec 2016 17:08:21 +0000 (19:08 +0200)]
Avoid crashing if a new thread is signaled right away
* src/thread.c (post_acquire_global_lock): Don't raise the pending
signal if the thread's handlers were not yet set up, as that will
cause Emacs to exit with a fatal error. This can happen if a
thread is signaled as soon as make-thread returns, before the new
thread had an opportunity to acquire the global lock, set up the
handlers, and call the thread function.
* test/src/thread-tests.el (thread-signal-early): New test.
Eli Zaretskii [Mon, 12 Dec 2016 16:03:40 +0000 (18:03 +0200)]
Fix point motion in cloned buffers
* src/thread.c (post_acquire_global_lock): Call
set_buffer_internal_2 instead of tricking set_buffer_internal_1
into resetting the current buffer even if it didn't change. This
avoids bug#25165, caused by failing to record the modified values
of point and mark, because current_buffer was set to NULL. Also,
don't bother re-setting the buffer if there was no thread switch,
as that just wastes cycles.
* src/buffer.c (set_buffer_internal_2): New function, with most of
the body of set_buffer_internal_1, but without the test for B
being identical to the current buffer.
(set_buffer_internal_1): Call set_buffer_internal_2 if B is not
identical to the current buffer.
* src/buffer.h (set_buffer_internal_2): Add prototype.
* test/src/thread-tests.el (thread-sticky-point): New test.
Michael Albinus [Mon, 12 Dec 2016 10:12:34 +0000 (11:12 +0100)]
Further improvements in Tramp's file name unquoting
* lisp/net/tramp-adb.el (tramp-adb-handle-file-local-copy)
(tramp-adb-handle-write-region): Unquote localname.
(tramp-adb-handle-copy-file): Implement direct copy on remote device.
(tramp-adb-handle-rename-file): Quote arguments, add "-f" to force.
* lisp/net/tramp.el (tramp-file-name-unquote-localname): New defun.
(tramp-handle-file-name-case-insensitive-p):
* lisp/net/tramp-gvfs.el (tramp-gvfs-get-file-attributes)
(tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec)
(tramp-gvfs-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-make-copy-program-file-name):
* lisp/net/tramp-smb.el (tramp-smb-get-share)
(tramp-smb-get-localname): Use it.
* test/lisp/net/tramp-tests.el (tramp--test-docker-p): New defun.
(tramp--test-special-characters, tramp-test34-utf8)
(tramp-test34-utf8-with-stat, tramp-test34-utf8-with-perl)
(tramp-test34-utf8-with-ls): Use it.
Noam Postavsky [Fri, 28 Oct 2016 02:17:11 +0000 (22:17 -0400)]
Quote filenames containing '~' in prompts
When in a directory named '~', the default value given by
`read-file-name' should be quoted by prepending '/:', in order to
prevent it from being interpreted as referring to the $HOME
directory (Bug#16984).
* lisp/minibuffer.el (minibuffer-maybe-quote-filename): New function.
(completion--sifn-requote, read-file-name-default): Use it instead of
`minibuffer--double-dollars'.
* test/lisp/files-tests.el (files-test-read-file-in-~): Test it.
Eli Zaretskii [Sun, 11 Dec 2016 15:59:55 +0000 (17:59 +0200)]
Avoid aborts when a thread signals an error
* src/thread.h (struct thread_state): Add members
m_waiting_for_input and m_input_available_clear_time.
(waiting_for_input, input_available_clear_time): New macros.
* src/keyboard.c (waiting_for_input, input_available_clear_time):
Remove; they are now macros that reference the current thread.
(Bug#25171)
* src/w32select.c: Don't include keyboard.h.
* test/src/thread-tests.el (thread-errors): New test.