@@ -1234,35 +1234,35 @@ if REMOTE is https://github.com/X/Y then LOCAL becomes ∼/Y."
12341234 :defer nil
12351235 :config (doom-modeline-mode))
12361236
1237- ; ; Use minimal height so icons still fit; modeline gets slightly larger when
1238- ; ; buffer is modified since the "save icon" shows up. Let's disable the icon.
1239- ; ; Let's also essentially disable the hud bar, a sort of progress-bar on where we are in the buffer.
1240- (setq doom-modeline-height 1 )
1241- (setq doom-modeline-buffer-state-icon nil )
1242- (setq doom-modeline-hud t )
1243- (setq doom-modeline-bar-width 1 )
1237+ ; ; Use minimal height so icons still fit; modeline gets slightly larger when
1238+ ; ; buffer is modified since the "save icon" shows up. Let's disable the icon.
1239+ ; ; Let's also essentially disable the hud bar, a sort of progress-bar on where we are in the buffer.
1240+ (setq doom-modeline-height 21 )
1241+ (setq doom-modeline-buffer-state-icon nil )
1242+ (setq doom-modeline-hud t )
1243+ (setq doom-modeline-bar-width 1 )
12441244
1245- ; ; Show 3 Flycheck numbers: “red-error / yellow-warning / green-info”, which
1246- ; ; we can click to see a listing.
1247- ; ; If not for doom-modeline, we'd need to use flycheck-status-emoji.el.
1248- (setq doom-modeline-checker-simple-format nil )
1245+ ; ; Show 3 Flycheck numbers: “red-error / yellow-warning / green-info”, which
1246+ ; ; we can click to see a listing.
1247+ ; ; If not for doom-modeline, we'd need to use flycheck-status-emoji.el.
1248+ (setq doom-modeline-checker-simple-format nil )
12491249
1250- ; ; Don't display the buffer encoding, E.g., “UTF-8”.
1251- (setq doom-modeline-buffer-encoding nil )
1250+ ; ; Don't display the buffer encoding, E.g., “UTF-8”.
1251+ (setq doom-modeline-buffer-encoding nil )
12521252
1253- ; ; Inactive buffers' modeline is greyed out.
1254- ; ; (let ((it "Source Code Pro Light" ))
1255- ; ; (set-face-attribute 'mode-line nil :family it :height 100)
1256- ; ; (set-face-attribute 'mode-line-inactive nil :family it :height 100))
1253+ ; ; Inactive buffers' modeline is greyed out.
1254+ ; ; (let ((it "Source Code Pro Light" ))
1255+ ; ; (set-face-attribute 'mode-line nil :family it :height 100)
1256+ ; ; (set-face-attribute 'mode-line-inactive nil :family it :height 100))
12571257
1258- ; ; A quick hacky way to add stuff to doom-modeline is to add to the mode-line-process list.
1259- ; ; E.g.: (add-to-list 'mode-line-process '(:eval (format "%s" (count-words (point-min) (point-max)))))
1260- ; ; We likely want to add this locally, to hooks on major modes.
1258+ ; ; A quick hacky way to add stuff to doom-modeline is to add to the mode-line-process list.
1259+ ; ; E.g.: (add-to-list 'mode-line-process '(:eval (format "%s" (count-words (point-min) (point-max)))))
1260+ ; ; We likely want to add this locally, to hooks on major modes.
12611261
1262- (setq doom-modeline-minor-modes t )
1263- (use-package minions
1262+ (setq doom-modeline-minor-modes t )
1263+ (use-package minions
12641264
1265- :init (minions-mode 1 ))
1265+ :init (minions-mode 1 ))
12661266
12671267; ; If not for doom-modeline, we'd need to use fancy-battery-mode.el.
12681268(display-battery-mode +1 )
@@ -2101,21 +2101,38 @@ Functin Source: https://xenodium.com/emacs-dwim-do-what-i-mean/"
21012101 (region-content (when (region-active-p )
21022102 (buffer-substring-no-properties (region-beginning )
21032103 (region-end )))))
2104- (cond ((and region-content clipboard-url (not point-in-link))
2105- (delete-region (region-beginning ) (region-end ))
2106- (insert (org-make-link-string clipboard-url region-content)))
2107- ((and clipboard-url (not point-in-link))
2108- (insert (org-make-link-string
2109- clipboard-url
2110- (read-string " title: "
2111- (with-current-buffer (url-retrieve-synchronously clipboard-url)
2112- (dom-text (car
2113- (dom-by-tag (libxml-parse-html-region
2114- (point-min )
2115- (point-max ))
2116- 'title ))))))))
2117- (t
2118- (call-interactively 'org-insert-link )))))
2104+ (-let [ (gerrit-title gerrit-url) (ai/extract-title-and-url (current-kill 0 )) ]
2105+ (cond
2106+ ((and gerrit-title gerrit-url) (insert (org-make-link-string gerrit-url gerrit-title)))
2107+ ((and region-content clipboard-url (not point-in-link))
2108+ (delete-region (region-beginning ) (region-end ))
2109+ (insert (org-make-link-string clipboard-url region-content)))
2110+ ((and clipboard-url (not point-in-link))
2111+ (insert (org-make-link-string
2112+ clipboard-url
2113+ (read-string " title: "
2114+ (with-current-buffer (url-retrieve-synchronously clipboard-url)
2115+ (dom-text (car
2116+ (dom-by-tag (libxml-parse-html-region
2117+ (point-min )
2118+ (point-max ))
2119+ 'title ))))))))
2120+ (t
2121+ (call-interactively 'org-insert-link ))))))
2122+
2123+
2124+ (defun ai/extract-title-and-url (str )
2125+ " Extract the title and URL from the given string STR, omitting the leading number and tags in brackets."
2126+ (if (string-match " \\ (?:[0-9]+: \\ )?\\ (?:\\ [[^]]+\\ ] \\ )?\\ (.*?\\ ) | \\ (https?://[^\" ]+\\ )" str)
2127+ (let ((title (match-string 1 str))
2128+ (url (match-string 2 str)))
2129+ (list title url))))
2130+ ; ; example usage
2131+ (when nil
2132+ (let ((input " 12345: [nqe, fix] NQE Regex Syntax: Fix parsing of quantifiers | https://gerrit.local.company.com/c/fwd/+/12345" ))
2133+ (-let [ (title url) (ai/extract-title-and-url input) ]
2134+ (message " Title: %s \n URL: %s " title url))))
2135+
21192136; ; C-c C-l Org-mode ⇐ HTML:3 ends here
21202137
21212138; ; [[file:init.org::*get the pkg][get the pkg:1]]
@@ -2811,5 +2828,12 @@ associated major mode; that's what we aim to do here."
28112828; ; [[file:init.org::*DONE?][DONE?:1]]
28122829; ; (find-file "~/.emacs.d/init.org")
28132830(add-to-list 'default-frame-alist '(fullscreen . maximized))
2814- (message-box " Done" )
2831+
2832+
2833+
28152834; ; DONE?:1 ends here
2835+
2836+
2837+ (set-language-environment " UTF-8" )
2838+ (set-default-coding-systems 'utf-8 )
2839+ (load-file " /Users/musa/Documents/private-goal-getting/planning.el" )
0 commit comments