diff --git a/.dir-locals.el b/.dir-locals.el index 7d36b01..7fe8606 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,7 +1,15 @@ ;;; Directory Local Variables ;;; For more information see (info "(emacs) Directory Variables") -((c-mode +((nil + (eval . (setq-local gud-gdb-command-name + (string-join `("gdb" "-i=mi" + "-ex 'handle SIGPIPE nostop noprint pass'" + ,(concat "--args weechat -a -P 'alias,buflist,exec,irc' -r '/plugin load " + (expand-file-name "xmpp.so" (projectile-project-root)) + "'; /debug tags")) + " ")))) + (c++-mode (eval . (setq-local flycheck-clang-include-path (list (expand-file-name "libstrophe" (projectile-project-root)) (expand-file-name "json-c" (projectile-project-root)) @@ -19,13 +27,6 @@ (list (concat "-I" (expand-file-name "libstrophe" (projectile-project-root))) (concat "-I" (expand-file-name "json-c" (projectile-project-root)))))) (eval . (setq-local tags-table-list (expand-file-name ".git/tags" (projectile-project-root)))) - (eval . (setq-local gud-gdb-command-name - (string-join `("gdb" - "-ex 'handle SIGPIPE nostop noprint pass'" - ,(concat "--args weechat -a -P 'alias,buflist,exec,irc' -r '/plugin load " - (expand-file-name "xmpp.so" (projectile-project-root)) - "'; /debug tags")) - " "))) (flycheck-clang-warnings . ("all" "extra" "error-implicit-function-declaration" "no-missing-field-initializers")) (flycheck-clang-language-standard . "c++20") (flycheck-checker . c/c++-clang) diff --git a/account.cpp b/account.cpp index 442f435..f85b068 100644 --- a/account.cpp +++ b/account.cpp @@ -50,19 +50,19 @@ void weechat::log_emit(void *const userdata, const xmpp_log_level_t level, return; } xmlNodePtr root = xmlDocGetRootElement(doc); - const char *tag = root ? (const char*)root->name : ""; - const char *colour = weechat_color("blue"); - if (weechat_strcasecmp(tag, "message")) + std::string tag = root ? (const char*)root->name : ""; + const char *colour = weechat_color("red"); + if (tag == "message") { - colour = weechat_color("green"); + colour = weechat_color("yellow"); } - else if (weechat_strcasecmp(tag, "presence")) + else if (tag == "presence") { - colour = weechat_color("yellow"); + colour = weechat_color("green"); } - else if (weechat_strcasecmp(tag, "iq")) + else if (tag == "iq") { - colour = weechat_color("red"); + colour = weechat_color("blue"); } xmlChar *buf = (xmlChar*)malloc(strlen(xml) * 2); if (buf == NULL) { diff --git a/channel.cpp b/channel.cpp index 91229ce..4f6dbe6 100644 --- a/channel.cpp +++ b/channel.cpp @@ -606,6 +606,7 @@ weechat::channel::member *weechat::channel::remove_member(const char *id, const user = user::search(&account, id); if (user) user->nicklist_remove(&account, this); + else return nullptr; // TODO !! member = member_search(id); diff --git a/debug.el b/debug.el new file mode 100644 index 0000000..7f7fb58 --- /dev/null +++ b/debug.el @@ -0,0 +1,15 @@ +(let ((vterm-shell "/bin/sh -c 'trap \"\" SIGINT ; read < /dev/zero'")) + (with-current-buffer (vterm t) + (let ((process (get-buffer-process (current-buffer)))) + (unless (boundp 'gud-comint-buffer) + (gdb (string-join `("gdb" "-i=mi" + "-ex 'handle SIGPIPE nostop noprint pass'" + ,(concat "--args weechat -a -P 'alias,buflist,exec,irc' -r '/plugin load " + (expand-file-name "xmpp.so" (projectile-project-root)) + "'; /debug tags")) + " "))) + (dolist (line + (list (concat "tty " (process-tty-name process)) + "set env TERM=xterm-256color")) + (comint-send-string (get-buffer-process gud-comint-buffer) + (concat line "\n"))))))