diff options
| author | Paul Eggert | 2016-12-31 09:13:38 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-12-31 09:16:36 -0800 |
| commit | 0513e16459fdd3edb41358478a1194b943d84896 (patch) | |
| tree | 87c15baa9b2e0d9ccb90ca4549a4a298a771b179 /src | |
| parent | e0e5b0f4a4ce1d19ee0240c514dedd873d4165dc (diff) | |
| download | emacs-0513e16459fdd3edb41358478a1194b943d84896.tar.gz emacs-0513e16459fdd3edb41358478a1194b943d84896.zip | |
* src/xdisp.c (string_from_display_spec): Simplify.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 45a04caebfd..aced59e1b8e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1250,26 +1250,18 @@ default_line_pixel_height (struct window *w) | |||
| 1250 | static Lisp_Object | 1250 | static Lisp_Object |
| 1251 | string_from_display_spec (Lisp_Object spec) | 1251 | string_from_display_spec (Lisp_Object spec) |
| 1252 | { | 1252 | { |
| 1253 | if (CONSP (spec)) | 1253 | if (VECTORP (spec)) |
| 1254 | { | 1254 | { |
| 1255 | do { | 1255 | for (ptrdiff_t i = 0; i < ASIZE (spec); i++) |
| 1256 | if (STRINGP (XCAR (spec))) | 1256 | if (STRINGP (AREF (spec, i))) |
| 1257 | return XCAR (spec); | 1257 | return AREF (spec, i); |
| 1258 | spec = XCDR (spec); | ||
| 1259 | } while (CONSP (spec)); | ||
| 1260 | } | 1258 | } |
| 1261 | else if (VECTORP (spec)) | 1259 | else |
| 1262 | { | 1260 | { |
| 1263 | ptrdiff_t i; | 1261 | for (; CONSP (spec); spec = XCDR (spec)) |
| 1264 | 1262 | if (STRINGP (XCAR (spec))) | |
| 1265 | for (i = 0; i < ASIZE (spec); i++) | 1263 | return XCAR (spec); |
| 1266 | { | ||
| 1267 | if (STRINGP (AREF (spec, i))) | ||
| 1268 | return AREF (spec, i); | ||
| 1269 | } | ||
| 1270 | return Qnil; | ||
| 1271 | } | 1264 | } |
| 1272 | |||
| 1273 | return spec; | 1265 | return spec; |
| 1274 | } | 1266 | } |
| 1275 | 1267 | ||