summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--exwm.org37
-rw-r--r--init.org3
-rw-r--r--lib/doc/jao-doc-view.el2
-rw-r--r--lib/doc/jao-org-notes.el2
-rw-r--r--lib/prog/jao-compilation.el2
-rw-r--r--notmuch.org12
6 files changed, 42 insertions, 16 deletions
diff --git a/exwm.org b/exwm.org
index 5c25d7b..9f6fae9 100644
--- a/exwm.org
+++ b/exwm.org
@@ -166,22 +166,29 @@
(defvar jao-exwm--current-name nil)
(defun jao-exwm--check-name (name)
- (or (equalp jao-exwm--name name)
- (equalp (buffer-name) name)
- (equalp exwm-class-name name)
- (equalp exwm-title name)))
+ (or (string= jao-exwm--name name)
+ (string= (buffer-name) name)
+ (string= exwm-class-name name)
+ (string= exwm-title name)))
+
+ (defun jao-exwm-find-class-buffer (cln)
+ (if (jao-exwm--check-name cln)
+ (current-buffer)
+ (let* ((cur-buff (current-buffer))
+ (bfs (seq-filter (lambda (b)
+ (and (not (eq b cur-buff))
+ (with-current-buffer b
+ (jao-exwm--check-name cln))))
+ (buffer-list))))
+ (when (car bfs) (car (reverse bfs))))))
(defun jao-exwm-switch-to-class/title (cln)
(interactive)
(when cln
(if (jao-exwm--check-name cln)
(current-buffer)
- (let ((bfs (seq-filter `(lambda (b)
- (and (not (eq b ,(current-buffer)))
- (with-current-buffer b
- (jao-exwm--check-name ,cln))))
- (buffer-list))))
- (when (car bfs) (pop-to-buffer (car (reverse bfs))))))))
+ (when-let ((b (jao-exwm-find-class-buffer cln)))
+ (pop-to-buffer b)))))
(defun jao-exwm-switch-to-next-class ()
(interactive)
@@ -412,6 +419,16 @@
(pop-to-buffer b)))
#+end_src
+* Firefox helpers
+ #+begin_src emacs-lisp
+ (defun jao-exwm-kill-firefox-url ()
+ (interactive)
+ (when-let (b (jao-exwm-find-class-buffer "Firefox"))
+ (let ((cb (current-buffer)))
+ (switch-to-buffer b)
+ (jao-exwm--send-str "yy")
+ (switch-to-buffer cb))))
+ #+end_src
* Hydras
#+begin_src emacs-lisp
(major-mode-hydra-define+ (doc-view-mode pdf-view-mode) nil
diff --git a/init.org b/init.org
index 0c38cb6..0e3db42 100644
--- a/init.org
+++ b/init.org
@@ -1501,7 +1501,7 @@
(defun jao-rss-subscribe (url)
"Subscribe to a given RSS URL. If URL not given, look for it."
- (interactive "s")
+ (interactive "sURL: ")
(let* ((url (or url
(jao-url-around-point)
(jao-rss--find-url)
@@ -2307,6 +2307,7 @@
*** Erlang
#+begin_src emacs-lisp
(use-package erlang
+ :disabled t
:ensure t
:custom ((inferior-erlang-machine-options '("shell"))
(inferior-erlang-machine "rebar3")
diff --git a/lib/doc/jao-doc-view.el b/lib/doc/jao-doc-view.el
index 95a22a6..4e210f3 100644
--- a/lib/doc/jao-doc-view.el
+++ b/lib/doc/jao-doc-view.el
@@ -61,7 +61,7 @@
(cb (when skip-current (current-buffer))))
(dolist (b (buffer-list))
(with-current-buffer b
- (when-let (fn (and (not (equalp cb b)) (jao-doc-view--is-pdf)))
+ (when-let (fn (and (not (eq cb b)) (jao-doc-view--is-pdf)))
(add-to-list 'docs fn))))
(when (> (length docs) 0)
(jao-doc-view--save-to-file jao-doc-view-session-file docs))))
diff --git a/lib/doc/jao-org-notes.el b/lib/doc/jao-org-notes.el
index 3f6e725..dd8746e 100644
--- a/lib/doc/jao-org-notes.el
+++ b/lib/doc/jao-org-notes.el
@@ -118,7 +118,7 @@
(defun jao-org-notes--template (k)
`(,k "Note" plain (file jao-org-notes-open-or-create)
- "\n- %a"
+ "\n- %a\n %i"
:jump-to-captured t))
;;;###autoload
diff --git a/lib/prog/jao-compilation.el b/lib/prog/jao-compilation.el
index ef303ea..1c8e465 100644
--- a/lib/prog/jao-compilation.el
+++ b/lib/prog/jao-compilation.el
@@ -100,7 +100,7 @@
"Find the root of current file's project and issue a
compilation command"
(interactive)
- (let ((default-directory (jao-compilation-root))
+ (let ((default-directory (or (jao-compilation-root) default-directory))
(compilation-environment (jao-compilation--environment))
(compilation-read-command 'compilation-read-command))
(call-interactively 'compile)))
diff --git a/notmuch.org b/notmuch.org
index 5e838e4..3dc46b7 100644
--- a/notmuch.org
+++ b/notmuch.org
@@ -345,9 +345,17 @@
(interactive)
(jao-notmuch-tree--forward t))
+ (defun jao-notmuch--via-url ()
+ (when (window-live-p notmuch-tree-message-window)
+ (with-selected-window notmuch-tree-message-window
+ (goto-char (point-min))
+ (when (re-search-forward "^Via: http" nil t)
+ (thing-at-point-url-at-point)))))
+
(defun jao-notmuch-browse-url (ext)
(interactive "P")
- (when-let (url (car (last (jao-notmuch-message-urls))))
+ (when-let (url (or (jao-notmuch--via-url)
+ (car (last (jao-notmuch-message-urls)))))
(funcall (if ext browse-url-secondary-browser-function #'browse-url)
url)))
@@ -424,7 +432,7 @@
(defun org-notmuch-store-link ()
"Store a link to a notmuch mail message."
- (case major-mode
+ (cl-case major-mode
((notmuch-show-mode notmuch-tree-mode)
;; Store link to the current message
(let* ((id (notmuch-show-get-message-id))