diff options
| author | Dmitry Antipov | 2012-07-20 11:29:04 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-07-20 11:29:04 +0400 |
| commit | d7ea76b4f34c4e2c43bf0b1deeedde354ca540f7 (patch) | |
| tree | ac3cb2ab6d00e89542afc9a5290191e549ce1d81 /src/frame.c | |
| parent | 765e61e391ee0937ff6b30510b6c4651064fe38e (diff) | |
| download | emacs-d7ea76b4f34c4e2c43bf0b1deeedde354ca540f7.tar.gz emacs-d7ea76b4f34c4e2c43bf0b1deeedde354ca540f7.zip | |
Simple wrapper for make_unibyte_string, adjust font_open_by_name.
* src/lisp.h (build_unibyte_string): New function.
* src/dosfns.c, src/fileio.c, src/fns.c, src/ftfont.c, src/process.c:
* src/sysdep.c, src/w32fns.c, src/xfns.c: Use it.
* src/font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
of type Lisp_Object to avoid redundant calls to make_unibyte_string.
Adjust users accordingly.
* src/font.h (font_open_by_name): Adjust prototype.
* admin/coccinelle/unibyte_string.cocci: Semantic patch to convert from
make_unibyte_string to build_unibyte_string where appropriate.
Diffstat (limited to 'src/frame.c')
| -rw-r--r-- | src/frame.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/frame.c b/src/frame.c index 9668ea4d831..bf2b180f2d3 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -3167,16 +3167,14 @@ x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 3167 | fontset = fs_query_fontset (arg, 0); | 3167 | fontset = fs_query_fontset (arg, 0); |
| 3168 | if (fontset < 0) | 3168 | if (fontset < 0) |
| 3169 | { | 3169 | { |
| 3170 | font_object = font_open_by_name (f, SSDATA (arg), SBYTES (arg)); | 3170 | font_object = font_open_by_name (f, arg); |
| 3171 | if (NILP (font_object)) | 3171 | if (NILP (font_object)) |
| 3172 | error ("Font `%s' is not defined", SSDATA (arg)); | 3172 | error ("Font `%s' is not defined", SSDATA (arg)); |
| 3173 | arg = AREF (font_object, FONT_NAME_INDEX); | 3173 | arg = AREF (font_object, FONT_NAME_INDEX); |
| 3174 | } | 3174 | } |
| 3175 | else if (fontset > 0) | 3175 | else if (fontset > 0) |
| 3176 | { | 3176 | { |
| 3177 | Lisp_Object ascii_font = fontset_ascii (fontset); | 3177 | font_object = font_open_by_name (f, fontset_ascii (fontset)); |
| 3178 | |||
| 3179 | font_object = font_open_by_name (f, SSDATA (ascii_font), SBYTES (ascii_font)); | ||
| 3180 | if (NILP (font_object)) | 3178 | if (NILP (font_object)) |
| 3181 | error ("Font `%s' is not defined", SDATA (arg)); | 3179 | error ("Font `%s' is not defined", SDATA (arg)); |
| 3182 | arg = AREF (font_object, FONT_NAME_INDEX); | 3180 | arg = AREF (font_object, FONT_NAME_INDEX); |