diff options
| author | Paul Eggert | 2016-04-11 09:07:16 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-04-11 09:07:16 -0700 |
| commit | 435da5d2955ce35be4785b7d46566ed9b42ea9fb (patch) | |
| tree | 581fac64374d0997e53bba0ae3cbd4968fa55121 /src | |
| parent | 7c9e6254bbac949aa5493ab1741d2523a7d595b7 (diff) | |
| parent | b134c206bc07dbbb9e74b3be2db269c4f1196e40 (diff) | |
| download | emacs-435da5d2955ce35be4785b7d46566ed9b42ea9fb.tar.gz emacs-435da5d2955ce35be4785b7d46566ed9b42ea9fb.zip | |
Merge from origin/emacs-25
b134c20 Sync with gnulib
bb30fa9 Fix last change on 2016-01-02
488a72f ; Spelling fixes
9b1aab9 Port run-prolog EMACS to SWI-Prolog 7.2.3
0e7bcec Avoid crashes due to unreasonably large or small text scaling
85f257c Improve documentation of 'with-eval-after-load'
668c7bc Improve handling of non-ASCII characters in Git log messages
b570769 Remove undefined behavior in OS X dumper.
97211f3 Fix clipping of xwidgets
e87fbc0 Improve Lisp-level documentation of tooltips
9f1786e Faces names should not end in "-face".
3283271 * src/xsmfns.c (syms_of_xsmfns): Remove stray "s in doc strings.
a1f221b Comint and compile no longer set EMACS
5c28890 * lisp/subr.el (read-key): Don't let the prompt linger (bug#2...
a75b9a6 Merge branch 'emacs-25' of git.savannah.gnu.org:/srv/git/emac...
c93ae7a Allow to customize names of executables used by grep.el
f6497c6 Set locale encoding to UTF-8 when run from OS X GUI.
7ad1d07 Avoid signaling errors in 'M-n' at the 'C-x C-f' prompt
a3f1ac2 Avoid infinite loop in 'studlify-word'
f36df4b Don’t recommend obsolete EMACS env var
fb0b531 * lisp/emacs-lisp/package.el: Change from a few days ago need...
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog.12 | 2 | ||||
| -rw-r--r-- | src/nsterm.m | 9 | ||||
| -rw-r--r-- | src/unexmacosx.c | 21 | ||||
| -rw-r--r-- | src/xsmfns.c | 4 | ||||
| -rw-r--r-- | src/xwidget.c | 34 |
5 files changed, 47 insertions, 23 deletions
diff --git a/src/ChangeLog.12 b/src/ChangeLog.12 index 3045ecdca92..b2df482ba77 100644 --- a/src/ChangeLog.12 +++ b/src/ChangeLog.12 | |||
| @@ -2895,7 +2895,7 @@ | |||
| 2895 | (wait_reading_process_output, init_process_emacs): | 2895 | (wait_reading_process_output, init_process_emacs): |
| 2896 | Assume O_NONBLOCK. | 2896 | Assume O_NONBLOCK. |
| 2897 | (wait_reading_process_output): Put in a special case for WINDOWSNT | 2897 | (wait_reading_process_output): Put in a special case for WINDOWSNT |
| 2898 | to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK. | 2898 | to mimic the older behavior where it had O_NDELAY but not O_NONBLOCK. |
| 2899 | It's not clear this is needed, but it's a more-conservative change. | 2899 | It's not clear this is needed, but it's a more-conservative change. |
| 2900 | (create_process): Assume FD_CLOEXEC. | 2900 | (create_process): Assume FD_CLOEXEC. |
| 2901 | (create_process, create_pty): Assume O_NOCTTY. | 2901 | (create_process, create_pty): Assume O_NOCTTY. |
diff --git a/src/nsterm.m b/src/nsterm.m index 4048ac46546..34c5395b630 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -596,8 +596,15 @@ ns_init_locale (void) | |||
| 596 | 596 | ||
| 597 | @try | 597 | @try |
| 598 | { | 598 | { |
| 599 | /* It seems OS X should probably use UTF-8 everywhere. | ||
| 600 | 'localeIdentifier' does not specify the encoding, and I can't | ||
| 601 | find any way to get the OS to tell us which encoding to use, | ||
| 602 | so hard-code '.UTF-8'. */ | ||
| 603 | NSString *localeID = [NSString stringWithFormat:@"%@.UTF-8", | ||
| 604 | [locale localeIdentifier]]; | ||
| 605 | |||
| 599 | /* Set LANG to locale, but not if LANG is already set. */ | 606 | /* Set LANG to locale, but not if LANG is already set. */ |
| 600 | setenv("LANG", [[locale localeIdentifier] UTF8String], 0); | 607 | setenv("LANG", [localeID UTF8String], 0); |
| 601 | } | 608 | } |
| 602 | @catch (NSException *e) | 609 | @catch (NSException *e) |
| 603 | { | 610 | { |
diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 827eda56e08..bdacc8b540b 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c | |||
| @@ -103,9 +103,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 103 | #include <stdio.h> | 103 | #include <stdio.h> |
| 104 | #include <fcntl.h> | 104 | #include <fcntl.h> |
| 105 | #include <stdarg.h> | 105 | #include <stdarg.h> |
| 106 | #include <stdint.h> | ||
| 106 | #include <sys/types.h> | 107 | #include <sys/types.h> |
| 107 | #include <unistd.h> | 108 | #include <unistd.h> |
| 108 | #include <mach/mach.h> | 109 | #include <mach/mach.h> |
| 110 | #include <mach/vm_map.h> | ||
| 109 | #include <mach-o/loader.h> | 111 | #include <mach-o/loader.h> |
| 110 | #include <mach-o/reloc.h> | 112 | #include <mach-o/reloc.h> |
| 111 | #ifdef HAVE_MALLOC_MALLOC_H | 113 | #ifdef HAVE_MALLOC_MALLOC_H |
| @@ -217,10 +219,27 @@ unexec_read (void *dest, size_t n) | |||
| 217 | static int | 219 | static int |
| 218 | unexec_write (off_t dest, const void *src, size_t count) | 220 | unexec_write (off_t dest, const void *src, size_t count) |
| 219 | { | 221 | { |
| 222 | task_t task = mach_task_self(); | ||
| 223 | if (task == MACH_PORT_NULL || task == MACH_PORT_DEAD) | ||
| 224 | return false; | ||
| 225 | |||
| 220 | if (lseek (outfd, dest, SEEK_SET) != dest) | 226 | if (lseek (outfd, dest, SEEK_SET) != dest) |
| 221 | return 0; | 227 | return 0; |
| 222 | 228 | ||
| 223 | return write (outfd, src, count) == count; | 229 | /* We use the Mach virtual memory API to read our process memory |
| 230 | because using src directly would be undefined behavior and fails | ||
| 231 | under Address Sanitizer. */ | ||
| 232 | bool success = false; | ||
| 233 | vm_offset_t data; | ||
| 234 | mach_msg_type_number_t data_count; | ||
| 235 | if (vm_read (task, (uintptr_t) src, count, &data, &data_count) | ||
| 236 | == KERN_SUCCESS) | ||
| 237 | { | ||
| 238 | success = | ||
| 239 | write (outfd, (const void *) (uintptr_t) data, data_count) == count; | ||
| 240 | vm_deallocate (task, data, data_count); | ||
| 241 | } | ||
| 242 | return success; | ||
| 224 | } | 243 | } |
| 225 | 244 | ||
| 226 | /* Write COUNT bytes of zeros to outfd starting at offset DEST. | 245 | /* Write COUNT bytes of zeros to outfd starting at offset DEST. |
diff --git a/src/xsmfns.c b/src/xsmfns.c index 296b1cc3603..a7ec8e0c7e2 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c | |||
| @@ -545,7 +545,7 @@ syms_of_xsmfns (void) | |||
| 545 | Changing the value does not change the session id used by Emacs. | 545 | Changing the value does not change the session id used by Emacs. |
| 546 | The value is nil if no session manager is running. | 546 | The value is nil if no session manager is running. |
| 547 | See also `x-session-previous-id', `emacs-save-session-functions', | 547 | See also `x-session-previous-id', `emacs-save-session-functions', |
| 548 | `emacs-session-save' and `emacs-session-restore'." */); | 548 | `emacs-session-save' and `emacs-session-restore'. */); |
| 549 | Vx_session_id = Qnil; | 549 | Vx_session_id = Qnil; |
| 550 | 550 | ||
| 551 | DEFVAR_LISP ("x-session-previous-id", Vx_session_previous_id, | 551 | DEFVAR_LISP ("x-session-previous-id", Vx_session_previous_id, |
| @@ -568,7 +568,7 @@ The session id Emacs has while it is running is in the variable | |||
| 568 | same, depending on how the session manager works. | 568 | same, depending on how the session manager works. |
| 569 | 569 | ||
| 570 | See also `emacs-save-session-functions', `emacs-session-save' and | 570 | See also `emacs-save-session-functions', `emacs-session-save' and |
| 571 | `emacs-session-restore'." */); | 571 | `emacs-session-restore'. */); |
| 572 | Vx_session_previous_id = Qnil; | 572 | Vx_session_previous_id = Qnil; |
| 573 | 573 | ||
| 574 | defsubr (&Shandle_save_session); | 574 | defsubr (&Shandle_save_session); |
diff --git a/src/xwidget.c b/src/xwidget.c index 8ff4c23b1f2..7e96307bdd8 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -578,24 +578,22 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 578 | other time to know things like window placement etc. */ | 578 | other time to know things like window placement etc. */ |
| 579 | xv = xwidget_init_view (xww, s, x, y); | 579 | xv = xwidget_init_view (xww, s, x, y); |
| 580 | 580 | ||
| 581 | /* Calculate clipping, which is used for all manner of onscreen | 581 | int text_area_x, text_area_y, text_area_width, text_area_height; |
| 582 | xwidget views. Each widget border can get clipped by other emacs | 582 | |
| 583 | objects so there are four clipping variables. */ | 583 | window_box (s->w, |
| 584 | clip_right = | 584 | ANY_AREA, |
| 585 | min (xww->width, | 585 | &text_area_x, |
| 586 | WINDOW_RIGHT_EDGE_X (s->w) - x - | 586 | &text_area_y, |
| 587 | WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w) - | 587 | &text_area_width, |
| 588 | WINDOW_RIGHT_FRINGE_WIDTH (s->w)); | 588 | &text_area_height); |
| 589 | clip_left = | 589 | clip_right = min (xww->width, |
| 590 | max (0, | 590 | text_area_width); |
| 591 | WINDOW_LEFT_EDGE_X (s->w) - x + | 591 | clip_left = max (0, |
| 592 | WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (s->w) + | 592 | text_area_x); |
| 593 | WINDOW_LEFT_FRINGE_WIDTH (s->w)); | 593 | |
| 594 | 594 | clip_bottom = min (xww->height, | |
| 595 | clip_bottom = | 595 | text_area_height); |
| 596 | min (xww->height, | 596 | clip_top = max (0, text_area_y); |
| 597 | WINDOW_BOTTOM_EDGE_Y (s->w) - WINDOW_MODE_LINE_HEIGHT (s->w) - y); | ||
| 598 | clip_top = max (0, WINDOW_TOP_EDGE_Y (s->w) - y); | ||
| 599 | 597 | ||
| 600 | /* We are concerned with movement of the onscreen area. The area | 598 | /* We are concerned with movement of the onscreen area. The area |
| 601 | might sit still when the widget actually moves. This happens | 599 | might sit still when the widget actually moves. This happens |