aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjixiufeng <jixiufeng@luojilab.com>2019-04-22 23:39:52 +0800
committerjixiuf <jixiuf@qq.com>2019-07-30 22:00:57 +0800
commitd97260c902524850b4b90489231a3fe00f606921 (patch)
tree980ba15b1aacaf389ff73f6d8b2412935719ab1e
parent44570d15d220f5d41aa1ce20e84644bd7f891d54 (diff)
clean code,remove unused function get_hex_color_fg and get_hex_color_bg
-rw-r--r--elisp.c11
-rw-r--r--elisp.h3
-rw-r--r--vterm-module.c2
-rw-r--r--vterm-module.h10
4 files changed, 7 insertions, 19 deletions
diff --git a/elisp.c b/elisp.c
index 3fe511f..951791f 100644
--- a/elisp.c
+++ b/elisp.c
@@ -109,14 +109,9 @@ void set_cursor_type(emacs_env *env, emacs_value QCursorType) {
}
-emacs_value get_hex_color_fg(emacs_env *env, emacs_value face) {
- return env->funcall(env, Fvterm_face_color_hex, 2,
- (emacs_value[]){face, Qforeground});
-}
-
-emacs_value get_hex_color_bg(emacs_env *env, emacs_value face) {
- return env->funcall(env, Fvterm_face_color_hex, 2,
- (emacs_value[]){face, Qbackground});
+emacs_value vterm_get_color(emacs_env *env, int index) {
+ emacs_value idx = env->make_integer(env, index);
+ return env->funcall(env, Fvterm_get_color, 1, (emacs_value[]){idx});
}
void set_title(emacs_env *env, emacs_value string) {
diff --git a/elisp.h b/elisp.h
index 584a1d8..f853b5b 100644
--- a/elisp.h
+++ b/elisp.h
@@ -42,7 +42,6 @@ emacs_value Fpoint;
emacs_value Fput_text_property;
emacs_value Fset;
-emacs_value Fvterm_face_color_hex;
emacs_value Fvterm_flush_output;
emacs_value Fget_buffer_window;
emacs_value Fselected_window;
@@ -66,8 +65,6 @@ void forward_line(emacs_env *env, int n);
void goto_line(emacs_env *env, int n);
void set_cursor_type(emacs_env *env, emacs_value cursor_type);
void delete_lines(emacs_env *env, int linenum, int count, bool del_whole_line);
-emacs_value get_hex_color_fg(emacs_env *env, emacs_value face);
-emacs_value get_hex_color_bg(emacs_env *env, emacs_value face);
emacs_value buffer_line_number(emacs_env *env);
void recenter(emacs_env *env, emacs_value pos);
void set_window_point(emacs_env *env, emacs_value win, emacs_value point);
diff --git a/vterm-module.c b/vterm-module.c
index f753280..45b97b3 100644
--- a/vterm-module.c
+++ b/vterm-module.c
@@ -749,8 +749,6 @@ int emacs_module_init(struct emacs_runtime *ert) {
Fput_text_property =
env->make_global_ref(env, env->intern(env, "put-text-property"));
Fset = env->make_global_ref(env, env->intern(env, "set"));
- Fvterm_face_color_hex =
- env->make_global_ref(env, env->intern(env, "vterm--face-color-hex"));
Fvterm_flush_output =
env->make_global_ref(env, env->intern(env, "vterm--flush-output"));
Fforward_line = env->make_global_ref(env, env->intern(env, "forward-line"));
diff --git a/vterm-module.h b/vterm-module.h
index 9ed1831..356a6dd 100644
--- a/vterm-module.h
+++ b/vterm-module.h
@@ -8,7 +8,6 @@
int plugin_is_GPL_compatible;
-
#define SB_MAX 100000 // Maximum 'scrollback' value.
#ifndef MIN
@@ -64,11 +63,10 @@ typedef struct Term {
static bool compare_cells(VTermScreenCell *a, VTermScreenCell *b);
static bool is_key(unsigned char *key, size_t len, char *key_description);
-static emacs_value render_text(emacs_env *env, Term *term, char *string, int len,
- VTermScreenCell *cell);
-static emacs_value cell_to_face(emacs_env *env, Term *term, VTermScreenCell *cell);
-static emacs_value color_to_face(emacs_env *env, VTermColor *color, emacs_value palette);
-static emacs_value color_to_rgb_string(emacs_env *env, Term *term, VTermColor *color);
+static emacs_value render_text(emacs_env *env, Term *term, char *string,
+ int len, VTermScreenCell *cell);
+static emacs_value color_to_rgb_string(emacs_env *env, Term *term,
+ VTermColor *color);
static int term_settermprop(VTermProp prop, VTermValue *val, void *user_data);