1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-13 06:50:39 -08:00
Commit graph

38413 commits

Author SHA1 Message Date
Lars Ingebrigtsen
87e9e1b61c Fix async TLS boot problem
* src/process.c (wait_reading_process_output): Verify the boot
of the correct process.
2016-02-22 15:29:15 +11:00
Lars Ingebrigtsen
f50074922e Clean up debugging code
* src/process.c (Fmake_network_process): Remove debugging printf.
(wait_for_socket_fds, wait_while_connecting)
(wait_for_tls_negotiation): Remove newlines from messages.
2016-02-22 15:18:41 +11:00
Lars Ingebrigtsen
f577f59a52 Fix merge conflicts in network-stream-tests.el 2016-02-22 15:06:33 +11:00
Lars Ingebrigtsen
0d3c0f6f90 add_to_log expects Lisp parameters 2016-02-22 13:34:54 +11:00
Lars Ingebrigtsen
b55bf9f45a Mention in the doc strings that process functions may block
(Fprocess_contact, Fprocess_datagram_address)
(Fset_process_datagram_address, Fset_network_process_option)
(Fprocess_send_region, Fprocess_send_string): Mention that the
functions may block.
(Fset_process_coding_system): Ditto.
2016-02-22 13:14:35 +11:00
Lars Ingebrigtsen
fc4457d714 Add blocker warnings to the *Messages* buffer
* src/process.c (wait_for_socket_fds): Add warning to the log.
(wait_while_connecting): Ditto.
(wait_for_tls_negotiation): Ditto.
2016-02-22 13:07:27 +11:00
Paul Eggert
1f7feecaee Use Gnulib filevercmp for version comparison
* admin/merge-gnulib (GNULIB_MODULES): Add filevercmp.
* doc/lispref/strings.texi (Text Comparison):
* etc/NEWS, src/fns.c:
* test/src/fns-tests.el (fns-tests-string-version-lessp):
Rename newly-introduced function to string-version-lessp, by
analogy with strverscmp.
* lib/filevercmp.c, lib/filevercmp.h: New files, copied from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* src/fns.c: Include <filevercmp.h>.
(gather_number_from_string): Remove.
(Fstring_version_lessp): Reimplement via filevercmp.
2016-02-21 13:27:40 -08:00
Lars Ingebrigtsen
336dac5820 Avoid integer overflows in string-numeric-lessp
* src/fns.c (Fstring_numeric_lessp): If we have an integer
overflow, compare lexicographically.
2016-02-21 16:28:37 +11:00
Lars Ingebrigtsen
71783e90a4 Add the string-numeric-lessp function
* doc/lispref/strings.texi (Text Comparison): Document
`string-numerical-lessp'.

* src/fns.c (Fstring_numeric_lessp): New function.
(gather_number_from_string): Helper function for that function.

* test/src/fns-tests.el (fns-tests-string-numeric-lessp): Add tests.
2016-02-21 15:32:45 +11:00
Alain Schneble
7993679210 Respect DNS timeouts
* src/process.c (check_for_dns): If the async DNS request
failed and the associated process is still in "connect" state,
deactivate the process and set status to "failed".
2016-02-21 13:36:25 +11:00
Lars Ingebrigtsen
ad1951dbfb Get explicit width/height + scale computations right
* src/image.c (compute_image_size): :scale should also be
taken into account when :width and :height are explicitly names.
2016-02-20 18:03:37 +11:00
Lars Ingebrigtsen
b73e5254ea Fix coding system setup
* src/process.c (set_network_socket_coding_system): Pass in
the host/service that's been computed already.
2016-02-19 11:58:50 +11:00
Lars Ingebrigtsen
e96df838af Verify the TLS connection asynchronously
* src/gnutls.c (gnutls_verify_boot): Refactor out into its own
function so that we can call it asynchronously.
(Fgnutls_boot): Use it.

* src/process.c (wait_reading_process_output): Verify the TLS
negotiation.
2016-02-18 16:25:37 +11:00
Lars Ingebrigtsen
d4bb0b923b Deactivate the correct process
* src/process.c (wait_reading_process_output): Deactivate the
correct process on failure.
2016-02-16 16:47:55 +11:00
Lars Ingebrigtsen
ac6e085cf6 Implement asynch TLS negotiation
* src/gnutls.c (gnutls_try_handshake): Factor out into its own
function.
(emacs_gnutls_handshake): Use it.
(emacs_gnutls_read): Just return instead of retrying the handshake.

* src/process.c (finish_after_tls_connection): Factor out
into its own function.
(connect_network_socket): Use it.
(wait_reading_process_output): Retry TLS handshakes.
(wait_reading_process_output): Defer sentinel until TLS completes.
2016-02-16 15:56:56 +11:00
Lars Ingebrigtsen
c43bb7f136 Simplify the DNS resolution loop a bit
* src/process.c (wait_reading_process_output): Simplify the
DNS resolution loop a bit.
2016-02-16 13:58:26 +11:00
Alain Schneble
d1fc5a548e Loop over the process list instead of maintaining a separate list
* src/process.c: Remove declaration/definition of dns_processes list.
* src/process.c (wait_reading_process_output): Loop over all processes in
Vprocess_alist instead of dns_processes, to check for completed DNS
requests.
2016-02-16 13:50:23 +11:00
Lars Ingebrigtsen
9755b75300 Allow setting the filter masks later
* src/process.c (Fset_process_filter): Don't set the socket
masks here, because we may not have a socket yet.
(set_process_filter_masks): New function.
(connect_network_socket): Set the filter masks here.
2016-02-16 13:37:33 +11:00
Lars Ingebrigtsen
df91173405 Ensure we always free DNS resources when deleting a process
* src/process.c (free_dns_request): Factor out into own function.
(Fdelete_process): When deleting a process, free any DNS
structures associated with it.
(check_for_dns): Always free all DNS resources.
2016-02-16 13:23:15 +11:00
Alain Schneble
e4324bdf56 Don't block in set-process-window-size
* src/process.c (set-process-window-size): Explicitly return Qnil when
called with network processes as set_window_size won't work anyway on
socket fds.  As a welcome side effect, this makes the blocking
wait_for_socket_fds call obsolete.
2016-02-16 13:13:06 +11:00
Lars Ingebrigtsen
7f3441cc33 Do most of the coding system setup earlier
* src/process.c (Fmake_network_process): Set the read/write
coding systems here, so that special bindings work.
(Fmake_network_process): Complete the coding system setup here.
2016-02-16 13:01:05 +11:00
John Wiegley
220613e089 Merge from origin/emacs-25
d4b93e1 Minor fixes in global-auto-composition-mode
02b037b Allow arithmetic operators inside C++ template constructs.
44b16f6 Avoid crashes in semi-malformed 'condition-case'
652e5b4 Allow arithmetic operators inside C++ template constructs.
d9ea795 Fix regression with 'recent-keys' and keyboard macros
903603f Fix wording in a doc-view.el comment
cf79616 ; Spelling fixes
f8bf1b3 CONTRIBUTE cleanups and updates
f3aaca3 Port USE_STACK_LISP_OBJECTS fix to Clang
1834ac7 Port to x86 GCC 4.3.1 and earlier
8482949 Fix point movement under 'scroll-conservatively'
c1313b5 Replace colon in file name (not legal on Windows)
f7af26c Fix a typo in edt.texi
8badf95 Make 'mmap_realloc' on MS-Windows more reliable
856cd94 Grep alias `all' shall not match parent directory
2016-02-15 14:11:03 -08:00
John Wiegley
c79978fcad Merge from origin/emacs-25
dacde7e * etc/AUTHORS: Update the AUTHORS file
478ca5d ; fix changelog entries
2b7d006 ; make change-history-commit
851decb * lisp/dired-aux.el: Require cl-lib.  (Bug#22613)
47896c8 ; Improve commentary in insdel.c
53ca1e1 Index tilde characters in names of backup files
d97f522 Document deprecation of hi-lock-mode's 'C-x w' bindings
b55f06d ; * etc/NEWS: Use double spaces to end a sentence.
28bb214 Announce that the `C-x w' bindings are deprecated
1c98f98 Suppress GNUstep hardening
d82f24b Fix redisplay after a large insertion
85a2753 Revert "Fix gnus-group-get-new-news-this-group on group with
        closed server"
e8e3db0 ; Improve merge documentation in CONTRIBUTE
5be9989 * lib-src/make-docfile.c: Include stdarg.h.
c95ebbf Extend gpm-mouse-mode's doc string and doc to point out
        limitations.
2016-02-15 14:10:25 -08:00
John Wiegley
a644fa3675 Merge from origin/emacs-25
f5d6b9b Revert "Support integer image rotation and respect EXIF rotations"
afe7d1f Revert "Document EXIF image rotation"
c6f377c Document OS X LANG default
eb4a18c Set locale when run from OS X GUI
456c0a3 make-docfile cleanup for I/O, etc.
25ec995 Memory-management cleanup in make-docfile
02d925e Kevin Gallagher has new email address
4ef153b Improve doc strings of 'forward/backward-word-strictly'
3ad05a0 Describe Makefile test targets in test/README
2016-02-15 14:09:12 -08:00
John Wiegley
33bb679af9 Merge from origin/emacs-25
10b8ed2 Document EXIF image rotation
0f60049 Support integer image rotation and respect EXIF rotations
7dd45b6 Quote table names for postgres listings (sql-mode)
6bac035 * lisp/replace.el (replace-match-maybe-edit): Make arg
        `backward' optional.
ee909aa * lisp/simple.el (next-line-or-history-element): Reset
        temporary-goal-column.
0a289d3 Suppress ACL ops if configured with --disable-acl
1a9dbf5 Mention web bugs
fa55da2 Make mm-html-blocked-images default to "" again
2016-02-15 14:07:46 -08:00
Eli Zaretskii
44b16f60fd Avoid crashes in semi-malformed 'condition-case'
* src/eval.c (internal_lisp_condition_case): Treat a handler
'(nil)' as if it were '(nil nil)'.  (Bug#22675)
2016-02-15 16:03:54 +02:00
Eli Zaretskii
d9ea795035 Fix regression with 'recent-keys' and keyboard macros
* src/keyboard.c (record_char): Don't record in 'recent_keys'
events that come from executing keyboard macros.  (Bug#22674)
2016-02-15 14:03:57 +02:00
Lars Ingebrigtsen
2d7af7e206 Protect against initial handshake failures
* src/process.c (connect_network_socket): Mark the connection
as failed if the handshake didn't succeed yet.  This should be
reworked later.
2016-02-15 20:10:10 +11:00
Lars Ingebrigtsen
9c74f2fea6 Call the network security manager after doing TLS negotiation
* lisp/net/network-stream.el (network-stream-open-tls):
Postpone NSM verification when running async.

* src/process.c (Fset_process_filter): This function doesn't
need to wait.
(connect_network_socket): Set the process status to "run" only
after TLS negotiation.
(wait_for_socket_fds): Take a name parameter for more debugging.
(wait_reading_process_output): Don't change status to "run"
unless TLS negotiation has finished.
(send_process): Wait for the process here instead of
send_process_string.
(connect_network_socket): Call the network security manager.
2016-02-15 18:24:08 +11:00
Lars Ingebrigtsen
40155283c3 Remove some #ifdefs and update documentation
* doc/lispref/processes.texi (Network Processes): Remove
mention of `dns'.

* lisp/net/network-stream.el (open-network-stream): Remove
mention of `dns'.

* src/process.c (Fset_process_filter)
(Fset_process_window_size, Fprocess_contact)
(Fprocess_datagram_address, Fset_process_datagram_address)
(Fset_network_process_option, Fprocess_send_region)
(Fprocess_send_string, Fset_process_coding_system)
(Fset_process_filter_multibyte): Remove the #ifdef
HAVE_GETADDRINFO_A checks.
(Fprocess_send_string): Wait for TLS negotiation.
(wait_for_tls_negotiation): New function.
(send_process): Remove the TLS boot check.

* src/process.c (Fmake_network_process): Ditto.
2016-02-15 16:05:14 +11:00
Alain Schneble
c740d190e8 Add blockers to process functions
* src/process.c (set-process-filter, set-process-window-size,
process-contact, process-datagram-address, set-process-datagram-address,
set-network-process-option): Make functions wait (block) on network
process until pending DNS requests have been processed and associated
socket initialized.

* src/process.c (process-send-region, process-send-string,
process-send-eof): Make functions wait (block) while network process is
in connect state.
2016-02-15 15:44:29 +11:00
Paul Eggert
cf79616133 ; Spelling fixes 2016-02-14 19:45:12 -08:00
Paul Eggert
f3aaca3552 Port USE_STACK_LISP_OBJECTS fix to Clang
* src/lisp.h (USE_STACK_LISP_OBJECTS): Default to false for Clang.
Recent versions of Clang claim to be GCC 4.2.1 but do not have
the GCC bug.
2016-02-14 11:43:04 -08:00
Paul Eggert
1834ac7d24 Port to x86 GCC 4.3.1 and earlier
This tries to port to x86 FreeBSD 9, where Emacs dumps core (Bug#22065).
* src/lisp.h (USE_STACK_LISP_OBJECTS): Default to false
for GCC 4.3.1 and earlier.
2016-02-14 11:23:52 -08:00
Eli Zaretskii
84829495b5 Fix point movement under 'scroll-conservatively'
* src/xdisp.c (redisplay_window): Correct a typo in computing the
effective number of text lines in a window.  (Bug#22637)
2016-02-14 21:20:48 +02:00
Eli Zaretskii
8badf953da Make 'mmap_realloc' on MS-Windows more reliable
* src/w32heap.c (mmap_alloc): If reserving memory succeeds, but
committing fails, return NULL.  Don't call GetLastError twice for
the same API error.
(mmap_realloc): Zero out MEMORY_BASIC_INFORMATION structures
before calling VirtualQuery, to avoid using garbled values if the
call fails.  If committing more pages from the same block fails,
fall back on mmap_alloc + CopyMemory.  Enhance debugging printouts
if the call to VirtualAlloc to commit more pages fails.
(Bug#22526)
2016-02-14 19:46:29 +02:00
Eli Zaretskii
47896c8446 ; Improve commentary in insdel.c
* src/insdel.c (gap_left, gap_right, make_gap_larger)
(make_gap_smaller): Improve commentary.
2016-02-13 17:48:38 +02:00
Paul Eggert
1c98f98991 Suppress GNUstep hardening
Fedora 23 normally hardens GNUstep applications, which causes
‘./configure --with-ns’ to break Emacs’s funky way of undumping.
Fix this by eliding the hardening options (Bug#22518).
* src/Makefile.in (LIBS_GNUSTEP): Omit options like
‘-specs=/usr/lib/rpm/redhat/redhat-hardened-ld’.
(GNU_OBJC_CFLAGS): Omit options like
‘-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1’.
2016-02-12 16:24:04 -08:00
Eli Zaretskii
d82f24ba85 Fix redisplay after a large insertion
* src/xdisp.c (redisplay_internal): Don't accept the results of
"optimization 3" if the cursor ends up in a partially visible
glyph row.  (Bug22637)
2016-02-12 21:38:44 +02:00
Lars Ingebrigtsen
980836d80e Check for MagickAutoOrientImage
* configure.ac: Check for MagickAutoOrientImage.

* src/image.c (imagemagick_load_image): Don't use
MagickAutoOrientImage unless it's available.
2016-02-11 14:21:38 +11:00
Dima Kogan
48b19a4494 Support integer image rotation and respect EXIF rotations
* src/image.c (imagemagick_load_image): Allow integer rotations in
addition to floating point rotations (bug#22591).
* src/image.c (imagemagick_load_image): Images that have an
orientation given in EXIF and have no explicit :rotation tag are now
pre-rotated.  All information such as width/height is reported for the
rotated image.
2016-02-11 14:07:48 +11:00
Lars Ingebrigtsen
f5d6b9bb5b Revert "Support integer image rotation and respect EXIF rotations"
This reverts commit 0f60049605.

This change does not work on Fedora.
2016-02-11 14:05:48 +11:00
Alan Third
eb4a18c7db Set locale when run from OS X GUI
* src/emacs.c (main): Call ns_init_locale.
* src/nsterm.m (ns_init_locale): Get locale from OS and set LANG.
* src/nsterm.h: Include ns_init_locale.
2016-02-10 18:36:04 -08:00
Eli Zaretskii
4ef153b55a Improve doc strings of 'forward/backward-word-strictly'
* lisp/simple.el (backward-word): Refer to 'backward-word-strictly'
in the doc string.  Suggested by Glenn Morris <rgm@gnu.org>.
* lisp/subr.el (forward-word-strictly, backward-word-strictly):
Mention 'subword-mode' in the doc strings.

* src/syntax.c (Fforward_word): Refer to 'forward-word-strictly'
in the doc string.  (Bug#22560)
2016-02-10 20:30:12 +02:00
Dima Kogan
0f60049605 Support integer image rotation and respect EXIF rotations
* src/image.c (imagemagick_load_image): Allow integer rotations in
addition to floating point rotations (bug#22591).
* src/image.c (imagemagick_load_image): Images that have an
orientation given in EXIF and have no explicit :rotation tag are now
pre-rotated.  All information such as width/height is reported for the
rotated image.
2016-02-10 15:45:46 +11:00
Paul Eggert
812cddf306 Omit valloc decl if redundant
* src/gmalloc.c (valloc): Omit decl if malloc.h is included,
to pacify --enable-gcc-warnings.
2016-02-09 15:25:58 -08:00
Wolfgang Jenkner
09ece4d341 Restore the calloc family.
* src/gmalloc.c (calloc, gcalloc, hybrid_calloc): Restore definitions.
They were lost in a4817d8 but calloc is still (marginally) used in
code statically liked with emacs, so hybrid_calloc is needed.
Also, in the non-hybrid case, we can't get rid of calloc anyway as
other libraries liked with emacs may need it.
* src/conf_post.h: Restore redefinition of calloc to hybrid_calloc.
2016-02-09 15:25:58 -08:00
Paul Eggert
0a289d38b5 Suppress ACL ops if configured with --disable-acl
Without this patch, some ACL operations were suppressed, but not all.
* src/fileio.c [!USE_ACL]: Do not include sys/acl.h.
(Ffile_acl, Fset_file_acl) [!USE_ACL]: Return nil in this case.
2016-02-09 15:02:59 -08:00
Paul Eggert
8456ba1d49 - 2016-02-09 14:26:40 -08:00
Paul Eggert
05595c2e59 - 2016-02-09 14:23:53 -08:00