diff options
| author | Andrea Corallo | 2020-05-09 20:04:41 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-05-09 20:04:41 +0100 |
| commit | bc50c0c57eca22cb290465ae5df93d48326eeb05 (patch) | |
| tree | ee2d35699a5307cf43c03c7788bac8b637db0174 /src | |
| parent | bd8be64ce3f314c152d009f5bf88bcfadf6daef7 (diff) | |
| parent | 9d8fc3a598090da518fcdd5c0503ed0f7faa41a9 (diff) | |
| download | emacs-bc50c0c57eca22cb290465ae5df93d48326eeb05.tar.gz emacs-bc50c0c57eca22cb290465ae5df93d48326eeb05.zip | |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs-module.h.in | 16 | ||||
| -rw-r--r-- | src/xdisp.c | 66 |
2 files changed, 57 insertions, 25 deletions
diff --git a/src/emacs-module.h.in b/src/emacs-module.h.in index cd75c0907e4..6a39d507c84 100644 --- a/src/emacs-module.h.in +++ b/src/emacs-module.h.in | |||
| @@ -48,10 +48,14 @@ information how to write modules and use this header file. | |||
| 48 | # define EMACS_NOEXCEPT_TYPEDEF | 48 | # define EMACS_NOEXCEPT_TYPEDEF |
| 49 | #endif | 49 | #endif |
| 50 | 50 | ||
| 51 | #ifdef __has_attribute | 51 | #if 3 < __GNUC__ + (3 <= __GNUC_MINOR__) |
| 52 | #if __has_attribute(__nonnull__) | 52 | # define EMACS_ATTRIBUTE_NONNULL(...) \ |
| 53 | # define EMACS_ATTRIBUTE_NONNULL(...) __attribute__((__nonnull__(__VA_ARGS__))) | 53 | __attribute__ ((__nonnull__ (__VA_ARGS__))) |
| 54 | #endif | 54 | #elif defined __has_attribute |
| 55 | # if __has_attribute (__nonnull__) | ||
| 56 | # define EMACS_ATTRIBUTE_NONNULL(...) \ | ||
| 57 | __attribute__ ((__nonnull__ (__VA_ARGS__))) | ||
| 58 | # endif | ||
| 55 | #endif | 59 | #endif |
| 56 | #ifndef EMACS_ATTRIBUTE_NONNULL | 60 | #ifndef EMACS_ATTRIBUTE_NONNULL |
| 57 | # define EMACS_ATTRIBUTE_NONNULL(...) | 61 | # define EMACS_ATTRIBUTE_NONNULL(...) |
| @@ -81,7 +85,7 @@ struct emacs_runtime | |||
| 81 | 85 | ||
| 82 | /* Return an environment pointer. */ | 86 | /* Return an environment pointer. */ |
| 83 | emacs_env *(*get_environment) (struct emacs_runtime *runtime) | 87 | emacs_env *(*get_environment) (struct emacs_runtime *runtime) |
| 84 | EMACS_ATTRIBUTE_NONNULL(1); | 88 | EMACS_ATTRIBUTE_NONNULL (1); |
| 85 | }; | 89 | }; |
| 86 | 90 | ||
| 87 | /* Type aliases for function pointer types used in the module API. | 91 | /* Type aliases for function pointer types used in the module API. |
| @@ -166,7 +170,7 @@ struct emacs_env_28 | |||
| 166 | /* Every module should define a function as follows. */ | 170 | /* Every module should define a function as follows. */ |
| 167 | extern int emacs_module_init (struct emacs_runtime *runtime) | 171 | extern int emacs_module_init (struct emacs_runtime *runtime) |
| 168 | EMACS_NOEXCEPT | 172 | EMACS_NOEXCEPT |
| 169 | EMACS_ATTRIBUTE_NONNULL(1); | 173 | EMACS_ATTRIBUTE_NONNULL (1); |
| 170 | 174 | ||
| 171 | #ifdef __cplusplus | 175 | #ifdef __cplusplus |
| 172 | } | 176 | } |
diff --git a/src/xdisp.c b/src/xdisp.c index 140d134572f..d65bb388699 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10486,7 +10486,7 @@ include the height of both, if present, in the return value. */) | |||
| 10486 | struct buffer *b; | 10486 | struct buffer *b; |
| 10487 | struct it it; | 10487 | struct it it; |
| 10488 | struct buffer *old_b = NULL; | 10488 | struct buffer *old_b = NULL; |
| 10489 | ptrdiff_t start, end, pos; | 10489 | ptrdiff_t start, end, bpos; |
| 10490 | struct text_pos startp; | 10490 | struct text_pos startp; |
| 10491 | void *itdata = NULL; | 10491 | void *itdata = NULL; |
| 10492 | int c, max_x = 0, max_y = 0, x = 0, y = 0; | 10492 | int c, max_x = 0, max_y = 0, x = 0, y = 0; |
| @@ -10501,29 +10501,55 @@ include the height of both, if present, in the return value. */) | |||
| 10501 | } | 10501 | } |
| 10502 | 10502 | ||
| 10503 | if (NILP (from)) | 10503 | if (NILP (from)) |
| 10504 | start = BEGV; | 10504 | { |
| 10505 | start = BEGV; | ||
| 10506 | bpos = BEGV_BYTE; | ||
| 10507 | } | ||
| 10505 | else if (EQ (from, Qt)) | 10508 | else if (EQ (from, Qt)) |
| 10506 | { | 10509 | { |
| 10507 | start = pos = BEGV; | 10510 | start = BEGV; |
| 10508 | while ((pos++ < ZV) && (c = FETCH_CHAR (pos)) | 10511 | bpos = BEGV_BYTE; |
| 10509 | && (c == ' ' || c == '\t' || c == '\n' || c == '\r')) | 10512 | while (bpos < ZV_BYTE) |
| 10510 | start = pos; | 10513 | { |
| 10511 | while ((pos-- > BEGV) && (c = FETCH_CHAR (pos)) && (c == ' ' || c == '\t')) | 10514 | c = fetch_char_advance (&start, &bpos); |
| 10512 | start = pos; | 10515 | if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r')) |
| 10516 | break; | ||
| 10517 | } | ||
| 10518 | while (bpos > BEGV_BYTE) | ||
| 10519 | { | ||
| 10520 | dec_both (&start, &bpos); | ||
| 10521 | c = FETCH_CHAR (bpos); | ||
| 10522 | if (!(c == ' ' || c == '\t')) | ||
| 10523 | break; | ||
| 10524 | } | ||
| 10513 | } | 10525 | } |
| 10514 | else | 10526 | else |
| 10515 | start = clip_to_bounds (BEGV, fix_position (from), ZV); | 10527 | { |
| 10528 | start = clip_to_bounds (BEGV, fix_position (from), ZV); | ||
| 10529 | bpos = CHAR_TO_BYTE (start); | ||
| 10530 | } | ||
| 10531 | |||
| 10532 | SET_TEXT_POS (startp, start, bpos); | ||
| 10516 | 10533 | ||
| 10517 | if (NILP (to)) | 10534 | if (NILP (to)) |
| 10518 | end = ZV; | 10535 | end = ZV; |
| 10519 | else if (EQ (to, Qt)) | 10536 | else if (EQ (to, Qt)) |
| 10520 | { | 10537 | { |
| 10521 | end = pos = ZV; | 10538 | end = ZV; |
| 10522 | while ((pos-- > BEGV) && (c = FETCH_CHAR (pos)) | 10539 | bpos = ZV_BYTE; |
| 10523 | && (c == ' ' || c == '\t' || c == '\n' || c == '\r')) | 10540 | while (bpos > BEGV_BYTE) |
| 10524 | end = pos; | 10541 | { |
| 10525 | while ((pos++ < ZV) && (c = FETCH_CHAR (pos)) && (c == ' ' || c == '\t')) | 10542 | dec_both (&end, &bpos); |
| 10526 | end = pos; | 10543 | c = FETCH_CHAR (bpos); |
| 10544 | if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r')) | ||
| 10545 | break; | ||
| 10546 | } | ||
| 10547 | while (bpos < ZV_BYTE) | ||
| 10548 | { | ||
| 10549 | c = fetch_char_advance (&end, &bpos); | ||
| 10550 | if (!(c == ' ' || c == '\t')) | ||
| 10551 | break; | ||
| 10552 | } | ||
| 10527 | } | 10553 | } |
| 10528 | else | 10554 | else |
| 10529 | end = clip_to_bounds (start, fix_position (to), ZV); | 10555 | end = clip_to_bounds (start, fix_position (to), ZV); |
| @@ -10537,7 +10563,6 @@ include the height of both, if present, in the return value. */) | |||
| 10537 | max_y = XFIXNUM (y_limit); | 10563 | max_y = XFIXNUM (y_limit); |
| 10538 | 10564 | ||
| 10539 | itdata = bidi_shelve_cache (); | 10565 | itdata = bidi_shelve_cache (); |
| 10540 | SET_TEXT_POS (startp, start, CHAR_TO_BYTE (start)); | ||
| 10541 | start_display (&it, w, startp); | 10566 | start_display (&it, w, startp); |
| 10542 | /* It makes no sense to measure dimensions of region of text that | 10567 | /* It makes no sense to measure dimensions of region of text that |
| 10543 | crosses the point where bidi reordering changes scan direction. | 10568 | crosses the point where bidi reordering changes scan direction. |
| @@ -34965,7 +34990,8 @@ It has no effect when set to 0, or when line numbers are not absolute. */); | |||
| 34965 | Fmake_variable_buffer_local (Qdisplay_line_numbers_offset); | 34990 | Fmake_variable_buffer_local (Qdisplay_line_numbers_offset); |
| 34966 | 34991 | ||
| 34967 | DEFVAR_BOOL ("display-fill-column-indicator", Vdisplay_fill_column_indicator, | 34992 | DEFVAR_BOOL ("display-fill-column-indicator", Vdisplay_fill_column_indicator, |
| 34968 | doc: /* Non-nil means display the fill column indicator. */); | 34993 | doc: /* Non-nil means display the fill column indicator. |
| 34994 | See Info node `Displaying Boundaries' for details. */); | ||
| 34969 | Vdisplay_fill_column_indicator = false; | 34995 | Vdisplay_fill_column_indicator = false; |
| 34970 | DEFSYM (Qdisplay_fill_column_indicator, "display-fill-column-indicator"); | 34996 | DEFSYM (Qdisplay_fill_column_indicator, "display-fill-column-indicator"); |
| 34971 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator); | 34997 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator); |
| @@ -34974,7 +35000,8 @@ It has no effect when set to 0, or when line numbers are not absolute. */); | |||
| 34974 | doc: /* Column for indicator when `display-fill-column-indicator' is non-nil. | 35000 | doc: /* Column for indicator when `display-fill-column-indicator' is non-nil. |
| 34975 | The default value is t which means that the indicator | 35001 | The default value is t which means that the indicator |
| 34976 | will use the `fill-column' variable. If it is set to an integer the | 35002 | will use the `fill-column' variable. If it is set to an integer the |
| 34977 | indicator will be drawn in that column. */); | 35003 | indicator will be drawn in that column. |
| 35004 | See Info node `Displaying Boundaries' for details. */); | ||
| 34978 | Vdisplay_fill_column_indicator_column = Qt; | 35005 | Vdisplay_fill_column_indicator_column = Qt; |
| 34979 | DEFSYM (Qdisplay_fill_column_indicator_column, "display-fill-column-indicator-column"); | 35006 | DEFSYM (Qdisplay_fill_column_indicator_column, "display-fill-column-indicator-column"); |
| 34980 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator_column); | 35007 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator_column); |
| @@ -34982,7 +35009,8 @@ indicator will be drawn in that column. */); | |||
| 34982 | DEFVAR_LISP ("display-fill-column-indicator-character", Vdisplay_fill_column_indicator_character, | 35009 | DEFVAR_LISP ("display-fill-column-indicator-character", Vdisplay_fill_column_indicator_character, |
| 34983 | doc: /* Character to draw the indicator when `display-fill-column-indicator' is non-nil. | 35010 | doc: /* Character to draw the indicator when `display-fill-column-indicator' is non-nil. |
| 34984 | The default is U+2502 but a good alternative is (ascii 124) | 35011 | The default is U+2502 but a good alternative is (ascii 124) |
| 34985 | if the font in fill-column-indicator face does not support Unicode characters. */); | 35012 | if the font in fill-column-indicator face does not support Unicode characters. |
| 35013 | See Info node `Displaying Boundaries' for details. */); | ||
| 34986 | Vdisplay_fill_column_indicator_character = Qnil; | 35014 | Vdisplay_fill_column_indicator_character = Qnil; |
| 34987 | DEFSYM (Qdisplay_fill_column_indicator_character, "display-fill-column-indicator-character"); | 35015 | DEFSYM (Qdisplay_fill_column_indicator_character, "display-fill-column-indicator-character"); |
| 34988 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator_character); | 35016 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator_character); |