aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp/my/my-mariadb.el
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2024-10-11 20:13:06 +1100
committerYuchen Pei <id@ypei.org>2024-10-11 20:22:34 +1100
commitb1e707d5544da0811f602eed125d8d5e64accd65 (patch)
tree8ab2a31c3f08ed8096df1c2e86215c677714f0a3 /emacs/.emacs.d/lisp/my/my-mariadb.el
parentb4068a7ad802f5a3b2bb014412e2f88ccf8384ea (diff)
[emacs] Some changes from the past months
* emacs/.emacs.d/init/ycp-complete.el: comment why corfu does not work well with gud * emacs/.emacs.d/init/ycp-editing.el: bind my-write-file to C-x C-w; change viper-syntax-preference to 'extended * emacs/.emacs.d/init/ycp-org.el: comment on tab-width * emacs/.emacs.d/lisp/my/my-buffer.el: add a function `my-save-text-and-switch-to-buffer' that Save TEXT to FILE-NAME and switch to the buffer * emacs/.emacs.d/lisp/my/my-editing.el: renamed a function; and override `viper-forward-word-kernel' and `viper-backward-word-kernel' (why?); add function `my-write-file', which is the same as `write-file', but keep the old buffer and remain there. * emacs/.emacs.d/lisp/my/my-mariadb.el: remove sleep in `my-gdb-maria-spider'; add a function to fetch source of a mariadb kb entry * emacs/.emacs.d/lisp/my/my-net.el: extract out local I/O and buffer logic from `my-fetch-url-save-and-switch' to `my-save-text-and-switch-to-buffer'. * emacs/.emacs.d/lisp/my/my-org-jira.el: fix formatting of `my-org-jira--render-issue', and add affected-versions, fix-versions and related-issues for rendering * emacs/.emacs.d/lisp/my/my-prog.el: ensure indent-tabs-mode is by default nil in prog-modes, to protect from c-style-alist overriding * mariadb-server/.dir-locals.el: Moved from sql/.dir-locals.el
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-mariadb.el')
-rw-r--r--emacs/.emacs.d/lisp/my/my-mariadb.el23
1 files changed, 21 insertions, 2 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-mariadb.el b/emacs/.emacs.d/lisp/my/my-mariadb.el
index 52ca8bc..6b0e06b 100644
--- a/emacs/.emacs.d/lisp/my/my-mariadb.el
+++ b/emacs/.emacs.d/lisp/my/my-mariadb.el
@@ -56,14 +56,14 @@
(when (and (buffer-live-p gud-comint-buffer)
(get-buffer-process gud-comint-buffer))
(my-gdb-quit))
- (sleep-for 1)
+ ;; (sleep-for 1)
(my-gdb
(format "rr replay %s -d %s"
(expand-file-name
(replace-regexp-in-string
"/src"
"/build/mysql-test/var/log/mysqld.1.1.rr/latest-trace"
- ;; "/build/mysql-test/var/log/mysqld.3.1.rr/latest-trace"
+ ;; "/build/mysql-test/var/log/mysqld.2.2.rr/latest-trace"
(project-root (project-current t))))
(expand-file-name "~/bin/gdb-mi.sh"))))
@@ -251,5 +251,24 @@ enum spider_malloc_id {
nil t)
(tempel-insert 'ps)))
+(defun my-mariadb-fetch-kb-source (url)
+ "Fetches the source to an maridb kb entry at URL.
+
+The source is saved in a .wiki file under the /tmp dir, and it
+switches to the buffer."
+ (interactive "sURL: ")
+ (let* ((term
+ (progn
+ (string-match "https://mariadb.com/kb/en/\\([^/]+\\)/" url)
+ (match-string 1 url)))
+ (source
+ (dom-text
+ (dom-by-id
+ (my-url-fetch-dom
+ (format "https://mariadb.com/kb/en/%s/+source/" term))
+ "answer_source")))
+ (file-name (format "/tmp/%s.wiki" term)))
+ (my-save-text-and-switch-to-buffer source file-name)))
+
(provide 'my-mariadb)
;;; my-mariadb.el ends here