;; -*- lexical-binding: t -*- (require 'cl-lib) (cl-pushnew "." load-path :test #'string=) (cl-pushnew (file-name-concat ".." "ll") load-path :test #'string=) (require 'll) (-> 'thingatpt) (-> 'w3m-bookmark) (-> 'w3m-tabs) (defun localhost () (i) (w3m-browse-url-new-tab "http://localhost")) (defun w3m-show-bookmarks () (i) (switch-to-buffer (w3m-new-tab "bookmarks")) (w3m-bookmark-view t)) (defun w3m-bookmark-dwim (url title) (interactive (if (use-region-p) (list w3m-current-url (buffer-substring-no-properties (region-beginning) (region-end))) (let ((url-at-point (thing-at-point 'url))) (if url-at-point (list url-at-point (read-string "title: ")) (let ((link-url (w3m-url-valid (w3m-anchor)))) (if link-url (list link-url (or (w3m-anchor-title) ; doesn't always work (thing-at-point 'word t))) (list w3m-current-url w3m-current-title))))))) (& url title (w3m-bookmark-add url title))) (defun w3m-edit-url-or-bookmarks () (i) (if (s= w3m-current-url "about://bookmark/") (w3m-bookmark-edit) (w3m-edit-current-url))) (<- 'w3m-bookmark-more)