aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2024-04-05 09:04:39 +1100
committerYuchen Pei <id@ypei.org>2024-04-05 09:04:39 +1100
commit1843b1e8d19acf8688bbb7981d9d75eae4f1378b (patch)
tree9a4828aedcefd45fae59c3dbfd7d3297e026b702 /emacs/.emacs.d/lisp
parent546aac08434bce4e8f109be0b8144d800e2a8009 (diff)
[emacs] fix gitlab parsing
Diffstat (limited to 'emacs/.emacs.d/lisp')
-rw-r--r--emacs/.emacs.d/lisp/my/my-dired.el2
-rw-r--r--emacs/.emacs.d/lisp/my/my-gitlab.el7
2 files changed, 5 insertions, 4 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-dired.el b/emacs/.emacs.d/lisp/my/my-dired.el
index ee6f7b0..83607ab 100644
--- a/emacs/.emacs.d/lisp/my/my-dired.el
+++ b/emacs/.emacs.d/lisp/my/my-dired.el
@@ -183,7 +183,7 @@ Format: yyyymmdd_hhmmss[_N].ext"
(defun my-dired-do-rename-by-mtime ()
"Generates new file name based on mtime.
-Format: yyyymmdd_hhmmss.ext"
+Format: yyyymmdd_hhmmss_[N].ext"
(interactive)
(seq-do
'my-dired-rename-by-mtime
diff --git a/emacs/.emacs.d/lisp/my/my-gitlab.el b/emacs/.emacs.d/lisp/my/my-gitlab.el
index a25533f..6dd484c 100644
--- a/emacs/.emacs.d/lisp/my/my-gitlab.el
+++ b/emacs/.emacs.d/lisp/my/my-gitlab.el
@@ -30,9 +30,10 @@
(defun my-get-gitlab-project-id (url)
(with-current-buffer (url-retrieve-synchronously
(replace-regexp-in-string "\\.git$" "" url))
- (goto-char (point-min))
- (when (re-search-forward "Project ID: \\([0-9]+\\)" nil t)
- (match-string 1))))
+ (let ((dom (libxml-parse-html-region (point-min) (point-max))))
+ (dom-attr (car
+ (dom-search dom (lambda (n) (dom-attr n 'data-project-id))))
+ 'data-project-id))))
(defun my-grok-gitlab (url)
(when-let* ((urlobj (url-generic-parse-url url))