Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
9b6a601f
Commit
9b6a601f
authored
Aug 28, 1998
by
Kenichi Handa
Browse files
(Fchar_bytes): Now always return 1.
(char_bytes): New function.
parent
3124bc0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
src/charset.c
src/charset.c
+17
-7
No files found.
src/charset.c
View file @
9b6a601f
...
...
@@ -1015,29 +1015,39 @@ The conversion is done based on `nonascii-translation-table' (which see)\n\
}
DEFUN
(
"char-bytes"
,
Fchar_bytes
,
Schar_bytes
,
1
,
1
,
0
,
"Return byte length of multi-byte form of CHAR."
)
"Return 1 regardless of the argument CHAR.
This is now an obsolte function. We keep is just for backward compatibility."
)
(
ch
)
Lisp_Object
ch
;
{
Lisp_Object
val
;
int
bytes
;
CHECK_NUMBER
(
ch
,
0
);
if
(
COMPOSITE_CHAR_P
(
XFASTINT
(
ch
)))
return
make_number
(
1
);
}
/* Return how many bytes C will occupy in a multibyte buffer.
Don't call this function directly, instead use macro CHAR_BYTES. */
int
char_bytes
(
c
)
int
c
;
{
int
bytes
;
if
(
COMPOSITE_CHAR_P
(
c
))
{
unsigned
int
id
=
COMPOSITE_CHAR_ID
(
XFASTINT
(
ch
)
);
unsigned
int
id
=
COMPOSITE_CHAR_ID
(
c
);
bytes
=
(
id
<
n_cmpchars
?
cmpchar_table
[
id
]
->
len
:
1
);
}
else
{
int
charset
=
CHAR_CHARSET
(
XFASTINT
(
ch
)
);
int
charset
=
CHAR_CHARSET
(
c
);
bytes
=
CHARSET_DEFINED_P
(
charset
)
?
CHARSET_BYTES
(
charset
)
:
1
;
}
XSETFASTINT
(
val
,
bytes
);
return
val
;
return
make_number
(
bytes
);
}
/* Return the width of character of which multi-byte form starts with
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment