diff options
| author | Kenichi Handa | 2012-10-30 20:14:15 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-10-30 20:14:15 +0900 |
| commit | aee5b18ec3c7844ca125249914113eeaef04342c (patch) | |
| tree | fc23a336c177f6c8a730041792e17a89e5a93139 /src | |
| parent | 6a8f8193298e05931baeebb1bd3aba6f8f5a7b5e (diff) | |
| download | emacs-aee5b18ec3c7844ca125249914113eeaef04342c.tar.gz emacs-aee5b18ec3c7844ca125249914113eeaef04342c.zip | |
font.c (Ffont_at): If WINDOW is specified and it is not displaying the current buffer, signal an error.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/font.c | 14 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e59a286110d..a5f76b22def 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-10-30 Kenichi Handa <handa@gnu.org> | ||
| 2 | |||
| 3 | * font.c (Ffont_at): If WINDOW is specified and it is not | ||
| 4 | displaying the current buffer, signal an error. | ||
| 5 | |||
| 1 | 2012-10-23 Kenichi Handa <handa@gnu.org> | 6 | 2012-10-23 Kenichi Handa <handa@gnu.org> |
| 2 | 7 | ||
| 3 | The following change is to make face-font-rescale-alist work | 8 | The following change is to make face-font-rescale-alist work |
diff --git a/src/font.c b/src/font.c index bff2356d6ca..e79ce5d80bc 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -4760,14 +4760,22 @@ FONT is a font-spec, font-entity, or font-object. */) | |||
| 4760 | DEFUN ("font-at", Ffont_at, Sfont_at, 1, 3, 0, | 4760 | DEFUN ("font-at", Ffont_at, Sfont_at, 1, 3, 0, |
| 4761 | doc: /* Return a font-object for displaying a character at POSITION. | 4761 | doc: /* Return a font-object for displaying a character at POSITION. |
| 4762 | Optional second arg WINDOW, if non-nil, is a window displaying | 4762 | Optional second arg WINDOW, if non-nil, is a window displaying |
| 4763 | the current buffer. It defaults to the currently selected window. */) | 4763 | the current buffer. It defaults to the currently selected window. |
| 4764 | Optional third arg STRING, if non-nil, is a string containing the target | ||
| 4765 | character at index specified by POSITION. */) | ||
| 4764 | (Lisp_Object position, Lisp_Object window, Lisp_Object string) | 4766 | (Lisp_Object position, Lisp_Object window, Lisp_Object string) |
| 4765 | { | 4767 | { |
| 4766 | struct window *w; | 4768 | struct window *w; |
| 4767 | ptrdiff_t pos; | 4769 | ptrdiff_t pos; |
| 4768 | 4770 | ||
| 4771 | if (NILP (window)) | ||
| 4772 | window = selected_window; | ||
| 4773 | CHECK_LIVE_WINDOW (window); | ||
| 4774 | w = XWINDOW (window); | ||
| 4769 | if (NILP (string)) | 4775 | if (NILP (string)) |
| 4770 | { | 4776 | { |
| 4777 | if (XBUFFER (w->buffer) != current_buffer) | ||
| 4778 | error ("Specified window is not displaying the current buffer."); | ||
| 4771 | CHECK_NUMBER_COERCE_MARKER (position); | 4779 | CHECK_NUMBER_COERCE_MARKER (position); |
| 4772 | if (! (BEGV <= XINT (position) && XINT (position) < ZV)) | 4780 | if (! (BEGV <= XINT (position) && XINT (position) < ZV)) |
| 4773 | args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); | 4781 | args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); |
| @@ -4781,10 +4789,6 @@ the current buffer. It defaults to the currently selected window. */) | |||
| 4781 | args_out_of_range (string, position); | 4789 | args_out_of_range (string, position); |
| 4782 | pos = XINT (position); | 4790 | pos = XINT (position); |
| 4783 | } | 4791 | } |
| 4784 | if (NILP (window)) | ||
| 4785 | window = selected_window; | ||
| 4786 | CHECK_LIVE_WINDOW (window); | ||
| 4787 | w = XWINDOW (window); | ||
| 4788 | 4792 | ||
| 4789 | return font_at (-1, pos, NULL, w, string); | 4793 | return font_at (-1, pos, NULL, w, string); |
| 4790 | } | 4794 | } |