Permalink
Browse files

* navi2ch.el (navi2ch-goto-url): Use navi2ch-link,

navi2ch-link-type properties instead of url property.

* navi2ch-article.el (navi2ch-article-select-current-link-url):
Remove duplicated condition check.

* navi2ch-machibbs.el (navi2ch-machibbs-article-to-url): Follow
the machibbs's change.
  • Loading branch information...
1 parent 6b246fc commit 6de3a077461941b7e4adf38c42441c5845030836 nawota committed Feb 25, 2009
Showing with 48 additions and 31 deletions.
  1. +11 −0 ChangeLog
  2. +1 −3 navi2ch-article.el
  3. +2 −1 navi2ch-face.el
  4. +28 −24 navi2ch-machibbs.el
  5. +6 −3 navi2ch.el
View
11 ChangeLog
@@ -1,3 +1,14 @@
+2009-02-26 Naohiro Aota <naota@elisp.net>
+
+ * navi2ch.el (navi2ch-goto-url): Use navi2ch-link,
+ navi2ch-link-type properties instead of url property.
+
+ * navi2ch-article.el (navi2ch-article-select-current-link-url):
+ Remove duplicated condition check.
+
+ * navi2ch-machibbs.el (navi2ch-machibbs-article-to-url): Follow
+ the machibbs's change.
+
2009-02-25 Naohiro Aota <naota@elisp.net>
* navi2ch-machibbs.el (navi2ch-machibbs-article-to-url): Change
View
4 navi2ch-article.el
@@ -1805,9 +1805,7 @@ FIRST $B$,(B nil $B$J$i$P!"%U%!%$%k$,99?7$5$l$F$J$1$l$P2?$b$7$J$$!#(B"
(defun navi2ch-article-select-current-link-url (url browse-p popup)
(if (and (not browse-p)
- (navi2ch-2ch-url-p url)
- (or (navi2ch-board-url-to-board url)
- (navi2ch-article-url-to-article url)))
+ (navi2ch-2ch-url-p url))
(progn
(if popup
(navi2ch-popup-article-exit)
View
3 navi2ch-face.el
@@ -1,6 +1,7 @@
;;; navi2ch-face.el --- face definitions for navi2ch -*- coding: iso-2022-7bit; -*-
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 by Navi2ch Project
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009 by Navi2ch
+;; Project
;; Author: Taiki SUGAWARA <taiki@users.sourceforge.net>
;; Keywords: network 2ch
View
52 navi2ch-machibbs.el
@@ -1,6 +1,6 @@
;;; navi2ch-machibbs.el --- View machiBBS module for Navi2ch. -*- coding: iso-2022-7bit; -*-
-;; Copyright (C) 2002, 2003, 2004 by Navi2ch Project
+;; Copyright (C) 2002, 2003, 2004, 2009 by Navi2ch Project
;; Author:
;; Part5 $B%9%l$N(B 509 $B$NL>L5$7$5$s(B
@@ -76,8 +76,8 @@
(navi2ch-multibbs-defcallback navi2ch-machibbs-subject-callback (machibbs)
"subject.txt $B$r<hF@$9$k$H$-(B navi2ch-net-update-file
$B$G;H$o$l$k%3!<%k%P%C%/4X?t(B"
- (while (re-search-forward "\\([0-9]+\\.\\)cgi\\([^\n]+\n\\)" nil t)
- (replace-match "\\1dat\\2")))
+ (while (re-search-forward "[0-9]+<>\\([0-9]+\\)<>\\([^\n]+\n\\)" nil t)
+ (replace-match "\\1.dat<>\\2")))
(defun navi2ch-machibbs-article-update (board article start)
"BOARD ARTICLE $B$N5-;v$r99?7$9$k!#(B
@@ -88,26 +88,26 @@ START $B$,(B non-nil $B$J$i$P%l%9HV9f(B START $B$+$i$N:9J,$r<hF@$9$k!#(B
(url (navi2ch-machibbs-article-to-url board article start nil start))
(func (if start 'navi2ch-machibbs-article-callback-diff
'navi2ch-machibbs-article-callback)))
+ (message "URL %s" url)
(navi2ch-net-update-file url file time func nil start)))
(defun navi2ch-machibbs-article-to-url (board article &optional start end nofirst)
"BOARD, ARTICLE $B$+$i(B url $B$KJQ49!#(B
-START, END, NOFIRST $B$GHO0O$r;XDj$9$k(B" ; $B8z$+$J$+$C$?$i65$($F$/$@$5$$!#(B
- (let ((uri (cdr (assq 'uri board)))
- (artid (cdr (assq 'artid article))))
- (string-match "\\(.*\\)\\/\\([^/]*\\)\\/" uri) ; \\/ --> / ?
- (concat
- (format "%s/bbs/read.cgi?BBS=%s&KEY=%s"
- (match-string 1 uri) (match-string 2 uri) artid)
- (if (and (stringp start)
- (string-match "l\\([0-9]+\\)" start))
- (format "&LAST=%s" (match-string 1 start))
- (concat
- (and start (format "&START=%d" start))
- (and end (format "&END=%d" end))))
- (and nofirst
- (not (eq start 1))
- "&NOFIRST=TRUE"))))
+START, END, NOFIRST $B$GHO0O$r;XDj$9$k(B"
+ (let ((uri (navi2ch-board-get-uri board))
+ (start (if (numberp start)
+ (number-to-string start)
+ start))
+ (end (if (numberp end)
+ (number-to-string end)
+ end)))
+ (if (string-match "\\(.+\\)/\\([^/]+\\)/$" uri)
+ (format "%s/bbs/read.cgi/%s/%s/%s"
+ (match-string 1 uri) (match-string 2 uri)
+ (cdr (assq 'artid article))
+ (if (equal start end)
+ (or start "")
+ (concat start (and (or start end) "-") end))))))
(defun navi2ch-machibbs-url-to-board (url)
"url $B$+$i(B BOARD $B$KJQ49!#(B"
@@ -228,10 +228,14 @@ START, END, NOFIRST $B$GHO0O$r;XDj$9$k(B" ; $B8z$+$J$+$C$?$i65$($F$/$@$5$$!#
(navi2ch-machibbs-article-callback t))
(defun navi2ch-machibbs-board-update (board)
- (let ((url (navi2ch-board-get-url board))
- (file (navi2ch-board-get-file-name board))
- (time (cdr (assq 'time board)))
- (func (navi2ch-multibbs-subject-callback board)))
- (navi2ch-net-update-file url file time func)))
+ (let ((uri (navi2ch-board-get-uri board)))
+ (when (string-match "\\(.+\\)/\\([^/]+\\)/$" uri)
+ (let ((url (format "%s/bbs/offlaw.cgi/%s/"
+ (match-string 1 uri)
+ (cdr (assq 'id board))))
+ (file (navi2ch-board-get-file-name board))
+ (time (cdr (assq 'time board)))
+ (func (navi2ch-multibbs-subject-callback board)))
+ (navi2ch-net-update-file url file time func)))))
;;; navi2ch-machibbs.el ends here
View
9 navi2ch.el
@@ -390,9 +390,12 @@ DISPLAY $B$,(B `article' $B$N$H$-$O(B article $B$rI=<($9$kMQ$KJ,3d$9$k!#(B
(defun navi2ch-goto-url (url &optional force)
"URL $B$+$i%9%l$^$?$OHD$rA*$V!#(B"
- (interactive (list (navi2ch-read-string "URL: "
- (get-text-property (point) 'url))
- current-prefix-arg))
+ (interactive (list (navi2ch-read-string
+ "URL: "
+ (when (eq (get-text-property (point) 'navi2ch-link-type)
+ 'url)
+ (get-text-property (point) 'navi2ch-link))
+ current-prefix-arg)))
(let ((article (navi2ch-article-url-to-article url))
(board (navi2ch-board-url-to-board url)))
(cond (article

0 comments on commit 6de3a07

Please sign in to comment.