diff options
| author | Joakim Verona | 2011-09-15 22:46:45 +0200 |
|---|---|---|
| committer | Joakim Verona | 2011-09-15 22:46:45 +0200 |
| commit | c139d20a0c582a2c8fe3766128092c32b692ac23 (patch) | |
| tree | 8a43a32e9935cc55eb8ead6e95c473693d9c3c11 | |
| parent | b728e88fdffdd34065f996682113b072bbc7008c (diff) | |
| parent | 7812ba2dea75097980bb6371381385b417479c74 (diff) | |
| download | emacs-c139d20a0c582a2c8fe3766128092c32b692ac23.tar.gz emacs-c139d20a0c582a2c8fe3766128092c32b692ac23.zip | |
upstream
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/window.el | 58 | ||||
| -rw-r--r-- | src/ChangeLog | 30 | ||||
| -rw-r--r-- | src/composite.c | 4 | ||||
| -rw-r--r-- | src/editfns.c | 4 | ||||
| -rw-r--r-- | src/term.c | 2 | ||||
| -rw-r--r-- | src/w32term.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 15 | ||||
| -rw-r--r-- | src/xterm.c | 2 |
9 files changed, 92 insertions, 32 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 91ffbcff96b..57c623df56a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2011-09-15 Chong Yidong <cyd@stupidchicken.com> | 1 | 2011-09-15 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 2 | ||
| 3 | * window.el (display-buffer-base-action): Rename from | ||
| 4 | display-buffer-default-action. Make default value empty. | ||
| 5 | (display-buffer-overriding-action): Convert to defvar. | ||
| 6 | (display-buffer-fallback-action): New var. | ||
| 7 | |||
| 8 | 2011-09-15 Chong Yidong <cyd@stupidchicken.com> | ||
| 9 | |||
| 3 | * emacs-lisp/package.el (package-alist): Fix risky-local-variable | 10 | * emacs-lisp/package.el (package-alist): Fix risky-local-variable |
| 4 | declaration. | 11 | declaration. |
| 5 | (package--add-to-archive-contents): If there is a duplicate entry | 12 | (package--add-to-archive-contents): If there is a duplicate entry |
diff --git a/lisp/window.el b/lisp/window.el index 24d95f367e4..c0e8781aab0 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -4465,6 +4465,14 @@ BUFFER-OR-NAME and return that buffer." | |||
| 4465 | :value-type (sexp :tag "Value"))) | 4465 | :value-type (sexp :tag "Value"))) |
| 4466 | "Custom type for `display-buffer' actions.") | 4466 | "Custom type for `display-buffer' actions.") |
| 4467 | 4467 | ||
| 4468 | (defvar display-buffer-overriding-action '(nil . nil) | ||
| 4469 | "Overriding action to perform to display a buffer. | ||
| 4470 | It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a | ||
| 4471 | function or a list of functions. Each function should accept 2 | ||
| 4472 | arguments: a buffer to display and an alist similar to ALIST. | ||
| 4473 | See `display-buffer' for details.") | ||
| 4474 | (put 'display-buffer-overriding-action 'risky-local-variable t) | ||
| 4475 | |||
| 4468 | (defcustom display-buffer-alist nil | 4476 | (defcustom display-buffer-alist nil |
| 4469 | "Alist of conditional actions for `display-buffer'. | 4477 | "Alist of conditional actions for `display-buffer'. |
| 4470 | This is a list of elements (CONDITION . ACTION), where: | 4478 | This is a list of elements (CONDITION . ACTION), where: |
| @@ -4485,15 +4493,8 @@ This is a list of elements (CONDITION . ACTION), where: | |||
| 4485 | :version "24.1" | 4493 | :version "24.1" |
| 4486 | :group 'windows) | 4494 | :group 'windows) |
| 4487 | 4495 | ||
| 4488 | (defcustom display-buffer-default-action | 4496 | (defcustom display-buffer-base-action '(nil . nil) |
| 4489 | '((display-buffer--maybe-same-window | 4497 | "User-specified default action for `display-buffer'. |
| 4490 | display-buffer-reuse-window | ||
| 4491 | display-buffer--special | ||
| 4492 | display-buffer--maybe-pop-up-frame-or-window | ||
| 4493 | display-buffer-use-some-window | ||
| 4494 | ;; If all else fails, pop up a new frame. | ||
| 4495 | display-buffer-pop-up-frame)) | ||
| 4496 | "List of default actions for `display-buffer'. | ||
| 4497 | It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a | 4498 | It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a |
| 4498 | function or a list of functions. Each function should accept 2 | 4499 | function or a list of functions. Each function should accept 2 |
| 4499 | arguments: a buffer to display and an alist similar to ALIST. | 4500 | arguments: a buffer to display and an alist similar to ALIST. |
| @@ -4503,16 +4504,19 @@ See `display-buffer' for details." | |||
| 4503 | :version "24.1" | 4504 | :version "24.1" |
| 4504 | :group 'windows) | 4505 | :group 'windows) |
| 4505 | 4506 | ||
| 4506 | (defcustom display-buffer-overriding-action '(nil . nil) | 4507 | (defconst display-buffer-fallback-action |
| 4507 | "Overriding action to perform to display a buffer. | 4508 | '((display-buffer--maybe-same-window |
| 4508 | It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a | 4509 | display-buffer-reuse-window |
| 4509 | function or a list of functions. Each function should accept 2 | 4510 | display-buffer--special |
| 4510 | arguments: a buffer to display and an alist similar to ALIST. | 4511 | display-buffer--maybe-pop-up-frame-or-window |
| 4511 | See `display-buffer' for details." | 4512 | display-buffer-use-some-window |
| 4512 | :type display-buffer--action-custom-type | 4513 | ;; If all else fails, pop up a new frame. |
| 4513 | :risky t | 4514 | display-buffer-pop-up-frame)) |
| 4514 | :version "24.1" | 4515 | "Default fallback action for `display-buffer'. |
| 4515 | :group 'windows) | 4516 | This is the action used by `display-buffer' if no other actions |
| 4517 | specified, e.g. by the user options `display-buffer-alist' or | ||
| 4518 | `display-buffer-base-action'. See `display-buffer'.") | ||
| 4519 | (put 'display-buffer-fallback-action 'risky-local-variable t) | ||
| 4516 | 4520 | ||
| 4517 | (defun display-buffer-assq-regexp (buffer-name alist) | 4521 | (defun display-buffer-assq-regexp (buffer-name alist) |
| 4518 | "Retrieve ALIST entry corresponding to BUFFER-NAME." | 4522 | "Retrieve ALIST entry corresponding to BUFFER-NAME." |
| @@ -4553,12 +4557,13 @@ function is called with 2 arguments: the buffer to display and an | |||
| 4553 | alist. It should either display the buffer and return the | 4557 | alist. It should either display the buffer and return the |
| 4554 | window, or return nil if unable to display the buffer. | 4558 | window, or return nil if unable to display the buffer. |
| 4555 | 4559 | ||
| 4556 | `display-buffer' builds a function list and an alist from | 4560 | The `display-buffer' function builds a function list and an alist |
| 4557 | `display-buffer-overriding-action', `display-buffer-alist', | 4561 | from `display-buffer-overriding-action', `display-buffer-alist', |
| 4558 | ACTION, and `display-buffer-default-action' (in that order). | 4562 | the ACTION argument, `display-buffer-base-action', and |
| 4559 | Then it calls each function in the combined function list in | 4563 | `display-buffer-fallback-action' (in that order). Then it calls |
| 4560 | turn, passing the buffer as the first argument and the combined | 4564 | each function in the combined function list in turn, passing the |
| 4561 | alist as the second argument, until a function returns non-nil. | 4565 | buffer as the first argument and the combined alist as the second |
| 4566 | argument, until one of the functions returns non-nil. | ||
| 4562 | 4567 | ||
| 4563 | Available action functions include: | 4568 | Available action functions include: |
| 4564 | `display-buffer-same-window' | 4569 | `display-buffer-same-window' |
| @@ -4608,7 +4613,8 @@ search for a window that is already displaying the buffer. See | |||
| 4608 | ;; Construct action function list and action alist. | 4613 | ;; Construct action function list and action alist. |
| 4609 | (actions (list display-buffer-overriding-action | 4614 | (actions (list display-buffer-overriding-action |
| 4610 | user-action action extra-action | 4615 | user-action action extra-action |
| 4611 | display-buffer-default-action)) | 4616 | display-buffer-base-action |
| 4617 | display-buffer-fallback-action)) | ||
| 4612 | (functions (apply 'append | 4618 | (functions (apply 'append |
| 4613 | (mapcar (lambda (x) | 4619 | (mapcar (lambda (x) |
| 4614 | (setq x (car x)) | 4620 | (setq x (car x)) |
diff --git a/src/ChangeLog b/src/ChangeLog index 3dbddc9b215..15281f47438 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,33 @@ | |||
| 1 | 2011-09-15 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514). | ||
| 4 | Don't mishandle (length (format "%%")) and (format "%4000s%%" ""). | ||
| 5 | |||
| 6 | 2011-09-15 Andreas Schwab <schwab@linux-m68k.org> | ||
| 7 | |||
| 8 | * editfns.c (Fformat): Correctly handle text properties on "%%". | ||
| 9 | |||
| 10 | 2011-09-15 Eli Zaretskii <eliz@gnu.org> | ||
| 11 | |||
| 12 | * xterm.c (x_draw_composite_glyph_string_foreground): | ||
| 13 | * w32term.c (x_draw_composite_glyph_string_foreground): | ||
| 14 | * term.c (encode_terminal_code): | ||
| 15 | * composite.c (composition_update_it, get_composition_id): | ||
| 16 | * xdisp.c (get_next_display_element) | ||
| 17 | (fill_composite_glyph_string): Add comments about special meaning | ||
| 18 | of TAB characters in a composition. | ||
| 19 | |||
| 20 | 2011-09-15 Paul Eggert <eggert@cs.ucla.edu> | ||
| 21 | |||
| 22 | * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514). | ||
| 23 | This occurs when processing a multibyte format. | ||
| 24 | Problem reported by Wolfgang Jenker. | ||
| 25 | |||
| 26 | 2011-09-15 Johan Bockgård <bojohan@gnu.org> | ||
| 27 | |||
| 28 | * xdisp.c (try_cursor_movement): Only check for exact match if | ||
| 29 | cursor hpos found by set_cursor_from_row is valid. (Bug#9495) | ||
| 30 | |||
| 1 | 2011-09-14 Paul Eggert <eggert@cs.ucla.edu> | 31 | 2011-09-14 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 32 | ||
| 3 | Remove unused external symbols. | 33 | Remove unused external symbols. |
diff --git a/src/composite.c b/src/composite.c index 2a3fbe29552..c8e4dd082ae 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -345,6 +345,8 @@ get_composition_id (EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT nchars, | |||
| 345 | { | 345 | { |
| 346 | int this_width; | 346 | int this_width; |
| 347 | ch = XINT (key_contents[i]); | 347 | ch = XINT (key_contents[i]); |
| 348 | /* TAB in a composition means display glyphs with padding | ||
| 349 | space on the left or right. */ | ||
| 348 | this_width = (ch == '\t' ? 1 : CHAR_WIDTH (ch)); | 350 | this_width = (ch == '\t' ? 1 : CHAR_WIDTH (ch)); |
| 349 | if (cmp->width < this_width) | 351 | if (cmp->width < this_width) |
| 350 | cmp->width = this_width; | 352 | cmp->width = this_width; |
| @@ -1384,6 +1386,8 @@ composition_update_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_I | |||
| 1384 | else | 1386 | else |
| 1385 | { | 1387 | { |
| 1386 | for (i = 0; i < cmp->glyph_len; i++) | 1388 | for (i = 0; i < cmp->glyph_len; i++) |
| 1389 | /* TAB in a composition means display glyphs with padding | ||
| 1390 | space on the left or right. */ | ||
| 1387 | if ((c = COMPOSITION_GLYPH (cmp, i)) != '\t') | 1391 | if ((c = COMPOSITION_GLYPH (cmp, i)) != '\t') |
| 1388 | break; | 1392 | break; |
| 1389 | if (c == '\t') | 1393 | if (c == '\t') |
diff --git a/src/editfns.c b/src/editfns.c index 596765d899e..3dd58377ada 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -4137,8 +4137,8 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 4137 | format++; | 4137 | format++; |
| 4138 | while (! CHAR_HEAD_P (*format)); | 4138 | while (! CHAR_HEAD_P (*format)); |
| 4139 | 4139 | ||
| 4140 | convbytes = format - format0; | 4140 | convbytes = format - src; |
| 4141 | memset (&discarded[format0 + 1 - format_start], 2, convbytes - 1); | 4141 | memset (&discarded[src + 1 - format_start], 2, convbytes - 1); |
| 4142 | } | 4142 | } |
| 4143 | else | 4143 | else |
| 4144 | { | 4144 | { |
diff --git a/src/term.c b/src/term.c index 10416090b80..4a671d048c4 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -574,6 +574,8 @@ encode_terminal_code (struct glyph *src, int src_len, struct coding_system *codi | |||
| 574 | { | 574 | { |
| 575 | int c = COMPOSITION_GLYPH (cmp, i); | 575 | int c = COMPOSITION_GLYPH (cmp, i); |
| 576 | 576 | ||
| 577 | /* TAB in a composition means display glyphs with | ||
| 578 | padding space on the left or right. */ | ||
| 577 | if (c == '\t') | 579 | if (c == '\t') |
| 578 | continue; | 580 | continue; |
| 579 | if (char_charset (c, charset_list, NULL)) | 581 | if (char_charset (c, charset_list, NULL)) |
diff --git a/src/w32term.c b/src/w32term.c index 8d9d8f72029..39f1e245e18 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -1294,6 +1294,8 @@ x_draw_composite_glyph_string_foreground (struct glyph_string *s) | |||
| 1294 | old_font = SelectObject (s->hdc, FONT_HANDLE (font)); | 1294 | old_font = SelectObject (s->hdc, FONT_HANDLE (font)); |
| 1295 | 1295 | ||
| 1296 | for (i = 0, j = s->cmp_from; i < s->nchars; i++, j++) | 1296 | for (i = 0, j = s->cmp_from; i < s->nchars; i++, j++) |
| 1297 | /* TAB in a composition means display glyphs with padding | ||
| 1298 | space on the left or right. */ | ||
| 1297 | if (COMPOSITION_GLYPH (s->cmp, j) != '\t') | 1299 | if (COMPOSITION_GLYPH (s->cmp, j) != '\t') |
| 1298 | { | 1300 | { |
| 1299 | int xx = x + s->cmp->offsets[j * 2]; | 1301 | int xx = x + s->cmp->offsets[j * 2]; |
diff --git a/src/xdisp.c b/src/xdisp.c index 32007f52f4d..ddbbcbb1278 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -6479,6 +6479,8 @@ get_next_display_element (struct it *it) | |||
| 6479 | 6479 | ||
| 6480 | c = ' '; | 6480 | c = ' '; |
| 6481 | for (i = 0; i < cmp->glyph_len; i++) | 6481 | for (i = 0; i < cmp->glyph_len; i++) |
| 6482 | /* TAB in a composition means display glyphs with | ||
| 6483 | padding space on the left or right. */ | ||
| 6482 | if ((c = COMPOSITION_GLYPH (cmp, i)) != '\t') | 6484 | if ((c = COMPOSITION_GLYPH (cmp, i)) != '\t') |
| 6483 | break; | 6485 | break; |
| 6484 | } | 6486 | } |
| @@ -11970,9 +11972,9 @@ hscroll_window_tree (Lisp_Object window) | |||
| 11970 | } | 11972 | } |
| 11971 | hscroll = max (hscroll, XFASTINT (w->min_hscroll)); | 11973 | hscroll = max (hscroll, XFASTINT (w->min_hscroll)); |
| 11972 | 11974 | ||
| 11973 | /* Don't call Fset_window_hscroll if value hasn't | 11975 | /* Don't prevent redisplay optimizations if hscroll |
| 11974 | changed because it will prevent redisplay | 11976 | hasn't changed, as it will unnecessarily slow down |
| 11975 | optimizations. */ | 11977 | redisplay. */ |
| 11976 | if (XFASTINT (w->hscroll) != hscroll) | 11978 | if (XFASTINT (w->hscroll) != hscroll) |
| 11977 | { | 11979 | { |
| 11978 | XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; | 11980 | XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; |
| @@ -14688,7 +14690,10 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 14688 | is set, we are done. */ | 14690 | is set, we are done. */ |
| 14689 | at_zv_p = | 14691 | at_zv_p = |
| 14690 | MATRIX_ROW (w->current_matrix, w->cursor.vpos)->ends_at_zv_p; | 14692 | MATRIX_ROW (w->current_matrix, w->cursor.vpos)->ends_at_zv_p; |
| 14691 | if (!at_zv_p) | 14693 | if (rv && !at_zv_p |
| 14694 | && w->cursor.hpos >= 0 | ||
| 14695 | && w->cursor.hpos < MATRIX_ROW_USED (w->current_matrix, | ||
| 14696 | w->cursor.vpos)) | ||
| 14692 | { | 14697 | { |
| 14693 | struct glyph_row *candidate = | 14698 | struct glyph_row *candidate = |
| 14694 | MATRIX_ROW (w->current_matrix, w->cursor.vpos); | 14699 | MATRIX_ROW (w->current_matrix, w->cursor.vpos); |
| @@ -21835,6 +21840,8 @@ fill_composite_glyph_string (struct glyph_string *s, struct face *base_face, | |||
| 21835 | { | 21840 | { |
| 21836 | int c = COMPOSITION_GLYPH (s->cmp, i); | 21841 | int c = COMPOSITION_GLYPH (s->cmp, i); |
| 21837 | 21842 | ||
| 21843 | /* TAB in a composition means display glyphs with padding space | ||
| 21844 | on the left or right. */ | ||
| 21838 | if (c != '\t') | 21845 | if (c != '\t') |
| 21839 | { | 21846 | { |
| 21840 | int face_id = FACE_FOR_CHAR (s->f, base_face->ascii_face, c, | 21847 | int face_id = FACE_FOR_CHAR (s->f, base_face->ascii_face, c, |
diff --git a/src/xterm.c b/src/xterm.c index 0c096e8f729..1357afa0c15 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -1309,6 +1309,8 @@ x_draw_composite_glyph_string_foreground (struct glyph_string *s) | |||
| 1309 | int y = s->ybase; | 1309 | int y = s->ybase; |
| 1310 | 1310 | ||
| 1311 | for (i = 0, j = s->cmp_from; i < s->nchars; i++, j++) | 1311 | for (i = 0, j = s->cmp_from; i < s->nchars; i++, j++) |
| 1312 | /* TAB in a composition means display glyphs with padding | ||
| 1313 | space on the left or right. */ | ||
| 1312 | if (COMPOSITION_GLYPH (s->cmp, j) != '\t') | 1314 | if (COMPOSITION_GLYPH (s->cmp, j) != '\t') |
| 1313 | { | 1315 | { |
| 1314 | int xx = x + s->cmp->offsets[j * 2]; | 1316 | int xx = x + s->cmp->offsets[j * 2]; |