diff options
Diffstat (limited to 'w3m.org')
-rw-r--r-- | w3m.org | 38 |
1 files changed, 1 insertions, 37 deletions
@@ -185,42 +185,6 @@ (setq w3m-goto-article-function 'jao-w3m-browse-url) #+END_SRC -* Subscribe rss using r2e - #+begin_src emacs-lisp - (defconst jao-w3m-rss-rx - (concat "type=\"application/\\(?:atom\\|rss\\)\\+xml\" +" - "\\(?:title=\"\\([^\n\"]+\\)\" +\\)?href=\"\\([^\n\"]+\\)\"")) - - (defun jao-w3m-find-rss () - (when (eq major-mode 'w3m-mode) - (save-excursion - (w3m-view-source) - (goto-char (point-min)) - (let* ((m (re-search-forward jao-w3m-rss-rx nil t)) - (url (and m (match-string 2))) - (title (and m (match-string 1)))) - (w3m-view-source) - (cons url (or title "")))))) - - (defun jao-w3m-subscribe-rss () - (interactive) - (let* ((url (or (w3m-anchor) (ffap-url-at-point))) - (url+title (if url (cons url "") (jao-w3m-find-rss))) - (url (car url+title)) - (title (cdr url+title))) - (if url - (let ((url (if (string-match "^feed:" url) - (substring url 5) url))) - (when (y-or-n-p (format "Subscribe to <%s>? " url)) - (let* ((name (read-string "Name: " title)) - (cat (completing-read "Category: " - (jao-list-mailboxes "feeds") - nil t))) - (shell-command - (format "r2e add %s %s jao+feeds_%s@localhost && r2e run %s" - name url cat name))))) - (message "No feeds found")))) - #+end_src * Tweeting and tooting #+BEGIN_SRC emacs-lisp (defun jao-w3m--toot-text (from to title) @@ -365,6 +329,6 @@ (define-key w3m-mode-map "c" 'w3m-print-this-url) (define-key w3m-mode-map "v" 'jao-view-video) (define-key w3m-mode-map "V" 'w3m-download) - (define-key w3m-mode-map "x" 'jao-w3m-subscribe-rss) + (define-key w3m-mode-map "x" 'jao-rss-subscribe-rss) (define-key w3m-mode-map "Y" 'w3m-print-current-url) #+END_SRC |