aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp/my/my-mariadb.el
diff options
context:
space:
mode:
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