yagnesh raghava yakkala avatar yagnesh raghava yakkala committed 658e814

* init-gnus.el: fix

Comments (0)

Files changed (1)

 
 ;;; url
 
+(defun gnus-summary-guess-article-url ()
+  "guess url of the article"
+  (interactive)
+  (let ((url
+         (with-current-buffer gnus-article-buffer
+           (let ((msgids (split-string (aref gnus-current-headers 8) "[ :]")))
+             (cond ((and (equal (substring (second msgids) 0 6)
+                                "gwene.")
+                         (goto-char (point-max))
+                         (search-backward "Link" (point-min) 'noerror))
+                    (w3m-active-region-or-url-at-point))
+                   ((equal (substring (second msgids) 0 6)
+                           "gmane.")
+                    (concat "http://comments.gmane.org/" (second msgids) "/" (third msgids))))))))
+    (if url
+        (browse-url (message url))
+      (message "Couldn't find any likely url"))))
+
 (add-hook 'gnus-startup-hook
-          (lambda nil
-            (define-key gnus-summary-mode-map (kbd "C-c C-o")
-              (lambda () (interactive)
-                (let ((url
-                       (with-current-buffer gnus-article-buffer
-                         (let ((msgids (split-string (aref gnus-current-headers 8) "[ :]")))
-                           (cond ((and (equal (substring (second msgids) 0 6)
-                                              "gwene.")
-                                       (goto-char (point-max))
-                                       (search-backward "Link" (point-min) 'noerror))
-                                  (w3m-active-region-or-url-at-point))
-                                 ((equal (substring (second msgids) 0 6)
-                                         "gmane.")
-                                  (concat "http://comments.gmane.org/" (second msgids) "/" (third msgids))))))))
-                  (if url
-                      (browse-url (message url))
-                    (message "Couldn't find any likely url")))))))
+          (lambda ()
+            (define-key gnus-summary-mode-map
+              (kbd "C-c C-o") 'gnus-summary-guess-article-url)))
 
 ;;; misc
 ;;; --------------------------------------------------
 (setq gnus-expert-user 't)      ;dont prompt me when i want to quit gnus
 
-
 ;;; init-gnus.el ends here
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.