Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/Makefile.am b/Makefile.am
- index 799bef7..6f7f26e 100644
- --- a/Makefile.am
- +++ b/Makefile.am
- @@ -6,6 +6,7 @@ lisp_LISP = navi2ch-version.el \
- navi2ch-board.el navi2ch-articles.el navi2ch-bookmark.el \
- navi2ch-history.el navi2ch-search.el navi2ch-message.el \
- navi2ch.el \
- + navi2ch-inline.el \
- navi2ch-head.el navi2ch-mona.el navi2ch-e21.el navi2ch-xmas.el \
- navi2ch-splash.el navi2ch-directory.el \
- navi2ch-be2ch.el navi2ch-multibbs.el \
- diff --git a/Makefile.in b/Makefile.in
- index cb43249..9d57377 100644
- --- a/Makefile.in
- +++ b/Makefile.in
- @@ -175,6 +175,7 @@ lisp_LISP = navi2ch-version.el \
- navi2ch-board.el navi2ch-articles.el navi2ch-bookmark.el \
- navi2ch-history.el navi2ch-search.el navi2ch-message.el \
- navi2ch.el \
- + navi2ch-inline.el \
- navi2ch-head.el navi2ch-mona.el navi2ch-e21.el navi2ch-xmas.el \
- navi2ch-splash.el navi2ch-directory.el \
- navi2ch-be2ch.el navi2ch-multibbs.el \
- diff --git a/bcomp.el b/bcomp.el
- index 0c4017d..0090f5b 100644
- --- a/bcomp.el
- +++ b/bcomp.el
- @@ -7,7 +7,7 @@
- (setq bcomp-files
- '(
- - "navi2ch-version.el" "navi2ch-vars.el" "navi2ch-face.el" "navi2ch-util.el" "navi2ch-net.el" "navi2ch-list.el" "navi2ch-article.el" "navi2ch-popup-article.el" "navi2ch-board-misc.el" "navi2ch-board.el" "navi2ch-articles.el" "navi2ch-bookmark.el" "navi2ch-history.el" "navi2ch-search.el" "navi2ch-message.el" "navi2ch.el" "navi2ch-head.el" "navi2ch-mona.el" "navi2ch-e21.el" "navi2ch-xmas.el" "navi2ch-splash.el" "navi2ch-directory.el" "navi2ch-be2ch.el" "navi2ch-multibbs.el" "navi2ch-jbbs-net.el" "navi2ch-jbbs-shitaraba.el" "navi2ch-machibbs.el" "navi2ch-futaba.el" "navi2ch-megabbs.el" "navi2ch-http-date.el" "navi2ch-localfile.el" "navi2ch-oyster.el" "navi2ch-auto-modify.el" "navi2ch-p2.el" "navi2ch-thumbnail.el"
- + "navi2ch-version.el" "navi2ch-vars.el" "navi2ch-face.el" "navi2ch-util.el" "navi2ch-net.el" "navi2ch-list.el" "navi2ch-article.el" "navi2ch-popup-article.el" "navi2ch-board-misc.el" "navi2ch-board.el" "navi2ch-articles.el" "navi2ch-bookmark.el" "navi2ch-history.el" "navi2ch-search.el" "navi2ch-message.el" "navi2ch.el" "navi2ch-inline.el" "navi2ch-head.el" "navi2ch-mona.el" "navi2ch-e21.el" "navi2ch-xmas.el" "navi2ch-splash.el" "navi2ch-directory.el" "navi2ch-be2ch.el" "navi2ch-multibbs.el" "navi2ch-jbbs-net.el" "navi2ch-jbbs-shitaraba.el" "navi2ch-machibbs.el" "navi2ch-futaba.el" "navi2ch-megabbs.el" "navi2ch-http-date.el" "navi2ch-localfile.el" "navi2ch-oyster.el" "navi2ch-auto-modify.el" "navi2ch-p2.el" "navi2ch-thumbnail.el"
- ))
- (let* ((dir (expand-file-name default-directory))
- diff --git a/navi2ch-article.el b/navi2ch-article.el
- index cf5be30..c2b9923 100644
- --- a/navi2ch-article.el
- +++ b/navi2ch-article.el
- @@ -38,6 +38,7 @@
- (defvar navi2ch-board-last-seen-alist)
- (defvar navi2ch-popup-article-current-board)
- (defvar navi2ch-popup-article-current-article)
- + (require 'navi2ch-inline)
- (require 'wid-edit))
- (require 'base64)
- diff --git a/navi2ch-be2ch.el b/navi2ch-be2ch.el
- index 848e510..0cb9796 100644
- --- a/navi2ch-be2ch.el
- +++ b/navi2ch-be2ch.el
- @@ -27,9 +27,9 @@
- ;;; Code:
- (provide 'navi2ch-be2ch)
- -(eval-when-compile (require 'cl))
- +(eval-when-compile
- + (require 'cl))
- (require 'navi2ch-net)
- -(require 'navi2ch-util)
- (defconst navi2ch-be2ch-ident
- "$Id$")
- diff --git a/navi2ch-board-misc.el b/navi2ch-board-misc.el
- index 5247768..4f53439 100644
- --- a/navi2ch-board-misc.el
- +++ b/navi2ch-board-misc.el
- @@ -32,6 +32,7 @@
- (eval-when-compile
- (require 'cl)
- + (require 'navi2ch-inline)
- (defvar navi2ch-board-last-seen-alist)
- (defvar navi2ch-board-subject-alist)
- (defvar navi2ch-board-current-board))
- diff --git a/navi2ch-e21.el b/navi2ch-e21.el
- index 423bbd0..a3d8011 100644
- --- a/navi2ch-e21.el
- +++ b/navi2ch-e21.el
- @@ -30,7 +30,10 @@
- (provide 'navi2ch-e21)
- (defconst navi2ch-e21-ident
- "$Id$")
- -(require 'navi2ch)
- +
- +(eval-when-compile
- + (require 'navi2ch-vars)
- + (require 'navi2ch-inline))
- ;;; 以下、Wanderlust (wl-e21.el) からほとんどコピペ。これ最強。
- (add-hook 'navi2ch-hook 'navi2ch-offline-init-icons)
- diff --git a/navi2ch-inline.el b/navi2ch-inline.el
- new file mode 100644
- index 0000000..e810625
- --- /dev/null
- +++ b/navi2ch-inline.el
- @@ -0,0 +1,89 @@
- +;;; navi2ch-inline.el --- User variables for navi2ch. -*- coding: iso-2022-7bit; -*-
- +
- +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2023
- +;; by Navi2ch Project
- +
- +;; Author: Taiki SUGAWARA <[email protected]>
- +;; Keywords: www 2ch
- +
- +;; This file is free software; you can redistribute it and/or modify
- +;; it under the terms of the GNU General Public License as published by
- +;; the Free Software Foundation; either version 2, or (at your option)
- +;; any later version.
- +
- +;; This file is distributed in the hope that it will be useful,
- +;; but WITHOUT ANY WARRANTY; without even the implied warranty of
- +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- +;; GNU General Public License for more details.
- +
- +;; You should have received a copy of the GNU General Public License
- +;; along with GNU Emacs; see the file COPYING. If not, write to
- +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- +;; Boston, MA 02111-1307, USA.
- +
- +;;; Commentary:
- +
- +;;
- +
- +;;; Code:
- +(provide 'navi2ch-inline)
- +
- +;;;; macros
- +;;; navi2ch-util
- +(defmacro navi2ch-with-default-file-modes (mode &rest body)
- + "default-file-modes を MODE にして BODY を実行する。"
- + (let ((temp (make-symbol "--file-modes-temp--")))
- + `(let ((,temp (default-file-modes)))
- + (unwind-protect
- + (progn
- + (set-default-file-modes
- + (navi2ch-ifxemacs
- + (if (integerp ,mode)
- + ,mode
- + (char-to-int ,mode))
- + ,mode))
- + ,@body)
- + (set-default-file-modes ,temp)))))
- +
- +(put 'navi2ch-with-default-file-modes 'lisp-indent-function 1)
- +
- +(defmacro navi2ch-cache-get (key value cache)
- + `(or (gethash ,key (navi2ch-cache-hash-table ,cache))
- + (navi2ch-cache-put ,key ,value ,cache)))
- +
- +(defmacro navi2ch-region-active-p ()
- + "Say whether the region is active."
- + (if (fboundp 'region-active-p)
- + (list 'region-active-p)
- + (list 'and 'transient-mark-mode 'mark-active)))
- +
- +(defmacro navi2ch-defalias-maybe (symbol definition)
- + "Define SYMBOL as an alias for DEFINITION if SYMBOL is not defined.
- +See also the function `defalias'."
- + (setq symbol (eval symbol))
- + (or (and (fboundp symbol)
- + (not (get symbol 'defalias-maybe)))
- + `(or (fboundp (quote ,symbol))
- + (prog1
- + (defalias (quote ,symbol) ,definition)
- + ;; `defalias' updates `load-history' internally.
- + (put (quote ,symbol) 'defalias-maybe t)))))
- +
- +(defmacro navi2ch-ifxemacs (then &rest else)
- + "If on XEmacs, do THEN, else do ELSE.
- +Like \"(if (featurep 'xemacs) THEN ELSE)\", but expanded at
- +compilation time. Because byte-code of XEmacs is not compatible with
- +GNU Emacs's one, this macro is very useful."
- + (if (featurep 'xemacs)
- + then
- + (cons 'progn else)))
- +;; Navi2chのコードをハクする人は↓を~/.emacsにも入れときましょう。
- +(put 'navi2ch-ifxemacs 'lisp-indent-function 1)
- +
- +(defmacro navi2ch-ifemacsce (then &rest else)
- + "If on EmacsCE, do THEN, else do ELSE.
- +Expanded at compilation time."
- + `(if (string-match "windowsce" system-configuration)
- + ,then
- + (progn ,@else)))
- +(put 'navi2ch-ifemacsce 'lisp-indent-function 1)
- diff --git a/navi2ch-jbbs-net.el b/navi2ch-jbbs-net.el
- index 9db69ea..3232ac4 100644
- --- a/navi2ch-jbbs-net.el
- +++ b/navi2ch-jbbs-net.el
- @@ -32,6 +32,8 @@
- (defconst navi2ch-jbbs-net-ident
- "$Id$")
- +(eval-when-compile
- + (require 'navi2ch-inline))
- (require 'navi2ch-multibbs)
- (defvar navi2ch-jbbs-func-alist
- diff --git a/navi2ch-jbbs-shitaraba.el b/navi2ch-jbbs-shitaraba.el
- index 1b05a25..1f7964c 100644
- --- a/navi2ch-jbbs-shitaraba.el
- +++ b/navi2ch-jbbs-shitaraba.el
- @@ -34,7 +34,8 @@
- "$Id$")
- (eval-when-compile
- - (require 'cl))
- + (require 'cl)
- + (require 'navi2ch-inline))
- (require 'navi2ch-util)
- (require 'navi2ch-multibbs)
- diff --git a/navi2ch-list.el b/navi2ch-list.el
- index 4188735..3860665 100644
- --- a/navi2ch-list.el
- +++ b/navi2ch-list.el
- @@ -37,7 +37,6 @@
- (defvar navi2ch-board-buffer-name)
- (defvar navi2ch-board-current-board))
- -(require 'navi2ch)
- (defvar navi2ch-list-mode-map nil)
- (unless navi2ch-list-mode-map
- @@ -94,7 +93,9 @@
- (nil " " navi2ch-list-board-name-face))))
- (defconst navi2ch-list-bbstable-default-url
- - "http://menu.2ch.net/bbsmenu.html")
- + (if (fboundp 'json-parse-string)
- + "https://menu.5ch.net/bbsmenu.json"
- + "https://menu.5ch.net/bbsmenu.html"))
- ;; add hook
- (add-hook 'navi2ch-save-status-hook 'navi2ch-list-save-info)
- @@ -567,10 +568,56 @@ changed-list は '((board-id old-board new-board) ...) な alist。
- (let ((board-id (cdr (assoc url navi2ch-list-board-id-alist))))
- (or board-id
- (save-match-data
- - (if (string-match "\\`http://.+/\\([^/]+\\)/\\'" url)
- + (if (string-match "\\`https?://.+/\\([^/]+\\)/\\'" url)
- (match-string 1 url))))))
- +
- (defun navi2ch-list-make-board-txt ()
- + (if (and navi2ch-list-media-type
- + (string-equal (cdr navi2ch-list-media-type) "application/json"))
- + (navi2ch-list-make-board-txt-from-json)
- + (navi2ch-list-make-board-txt-from-html)))
- +
- +(defun navi2ch-list-make-board-txt-from-json ()
- + "bbstable.json から (navi2ch 用の) board.txt を作る。
- +`navi2ch-net-update-file' のハンドラ。"
- + (let ((coding-system-for-read 'binary)
- + (coding-system-for-write 'binary)
- + (case-fold-search t)
- + (beg (point))
- + (id-to-url-table (make-hash-table :test 'eq))
- + (bbstable (json-parse-string (decode-coding-string (buffer-string) 'utf-8))))
- + (erase-buffer)
- + (seq-doseq (category (gethash "menu_list" bbstable))
- + (let ((category-name (gethash "category_name" category)))
- + (unless
- + ;; ignore category?
- + (member category-name navi2ch-list-ignore-category-list)
- + (insert (encode-coding-string category-name navi2ch-coding-system) "\n\n\n")
- + (seq-doseq (board (gethash "category_content" category))
- + (let ((url (gethash "url" board))
- + (board-name (gethash "board_name" board))
- + board-id id u)
- + (setq url (or (cdr (assoc url navi2ch-list-moved-board-alist))
- + url))
- + (when (and (navi2ch-list-valid-board url)
- + (setq board-id (navi2ch-list-board-id-from-url url)))
- + (setq id (intern board-id))
- + (when (and (setq u (gethash id id-to-url-table))
- + (not (string= u url)))
- + ;; 同じ ID で URL が違う板がある場合
- + (let ((i 2)
- + newid)
- + (while (and (setq newid (intern (format "%s:%d" id i)))
- + (setq u (gethash newid id-to-url-table))
- + (not (string= u url)))
- + (setq i (1+ i)))
- + (setq id newid)))
- + (insert (encode-coding-string board-name navi2ch-coding-system) "\n"
- + url "\n" (symbol-name id) "\n")))))))))
- +
- +
- +(defun navi2ch-list-make-board-txt-from-html ()
- "bbstable.html から (navi2ch 用の) board.txt を作る。
- `navi2ch-net-update-file' のハンドラ。"
- (let ((coding-system-for-read 'binary)
- @@ -590,7 +637,7 @@ changed-list は '((board-id old-board new-board) ...) な alist。
- (if (string-match "a" tag)
- (let (url board-id id u)
- (when (and (not ignore)
- - (string-match "href=\\(.+/\\([^/]+\\)/\\)" attr))
- + (string-match "href=\"?\\(.+/\\([^/]+\\)/\\)" attr))
- (setq url (match-string 1 attr))
- (setq url (or (cdr (assoc
- url
- @@ -624,7 +671,7 @@ changed-list は '((board-id old-board new-board) ...) な alist。
- (defun navi2ch-list-valid-board (uri)
- (save-match-data
- - (when (string-match "http://\\([^/]+\\)/\\([^/]+\\)/" uri)
- + (when (string-match "https?://\\([^/]+\\)/\\([^/]+\\)/" uri)
- (let ((host (match-string 1 uri)))
- (and (not (string-match navi2ch-list-invalid-host-regexp host))
- (string-match navi2ch-list-valid-host-regexp host))))))
- diff --git a/navi2ch-machibbs.el b/navi2ch-machibbs.el
- index 8159575..5b0a623 100644
- --- a/navi2ch-machibbs.el
- +++ b/navi2ch-machibbs.el
- @@ -32,7 +32,9 @@
- (defconst navi2ch-machibbs-ident
- "$Id$")
- -(eval-when-compile (require 'cl))
- +(eval-when-compile
- + (require 'cl)
- + (require 'navi2ch-inline))
- (require 'navi2ch-multibbs)
- (defvar navi2ch-machibbs-func-alist
- diff --git a/navi2ch-mona.el b/navi2ch-mona.el
- index a76735b..d23894a 100644
- --- a/navi2ch-mona.el
- +++ b/navi2ch-mona.el
- @@ -43,7 +43,9 @@
- (provide 'navi2ch-mona)
- (defconst navi2ch-mona-ident
- "$Id$")
- -(eval-when-compile (require 'cl))
- +(eval-when-compile
- + (require 'cl)
- + (require 'navi2ch-inline))
- (require 'base64)
- (require 'navi2ch-util)
- diff --git a/navi2ch-multibbs.el b/navi2ch-multibbs.el
- index 8e49f28..e3d7b99 100644
- --- a/navi2ch-multibbs.el
- +++ b/navi2ch-multibbs.el
- @@ -34,10 +34,9 @@
- (defconst navi2ch-multibbs-ident
- "$Id$")
- -(eval-when-compile (require 'cl))
- -(require 'navi2ch-http-date)
- -(require 'navi2ch)
- -(require 'navi2ch-be2ch)
- +(eval-when-compile
- + (require 'cl)
- + (require 'navi2ch-inline))
- (defvar navi2ch-multibbs-func-table nil
- "BBS の種類と関数群の hash。
- @@ -345,7 +344,7 @@ START, END, NOFIRST で範囲を指定する"
- ;;;-----------------------------------------------
- -(defsubst navi2ch-2ch-subject-callback ()
- +(defsubst navi2ch-2ch-subject-callback (&optional args)
- (when navi2ch-board-use-subback-html
- (navi2ch-board-make-subject-txt)))
- @@ -525,7 +524,7 @@ START, END, NOFIRST で範囲を指定する"
- 'equal)))
- (navi2ch-cache-get
- (cons uri file-name)
- - (cond ((string-match "http://\\(?:[^@/]+@\\)?\\(.+\\)" uri)
- + (cond ((string-match "https?://\\(?:[^@/]+@\\)?\\(.+\\)" uri)
- (navi2ch-expand-file-name
- (concat (match-string 1 uri)
- file-name)))
- diff --git a/navi2ch-net.el b/navi2ch-net.el
- index dc11ec5..6fedaa6 100644
- --- a/navi2ch-net.el
- +++ b/navi2ch-net.el
- @@ -31,12 +31,12 @@
- "$Id$")
- (eval-when-compile
- - (require 'cl))
- + (require 'cl)
- + (require 'navi2ch-inline))
- +(require 'navi2ch-util)
- (require 'timezone)
- (require 'base64)
- -(require 'navi2ch)
- -
- (defvar navi2ch-net-connection-name "navi2ch connection")
- (defvar navi2ch-net-user-agent "Monazilla/1.00 Navi2ch")
- (defvar navi2ch-net-setting-file-name "SETTING.TXT")
- @@ -121,13 +121,13 @@ BODY の評価中にエラーが起こると nil を返す。"
- (signal (car err) (cdr err)))))))
- proc))
- -(defun navi2ch-open-network-stream-via-command (name buffer host service)
- +(defun navi2ch-open-network-stream-via-command (name buffer host service &rest rest)
- (let ((command (cond ((stringp navi2ch-open-network-stream-command)
- (format navi2ch-open-network-stream-command
- - host service))
- + host service (member (plist-get rest :type) '(tls ssl))))
- ((functionp navi2ch-open-network-stream-command)
- (funcall navi2ch-open-network-stream-command
- - host service)))))
- + host service (member (plist-get rest :type) '(tls ssl)))))))
- (apply #'start-process name buffer
- (if (stringp command)
- (list shell-file-name shell-command-switch command)
- @@ -220,7 +220,7 @@ nil なら常に再接続する。")
- (process-connection-type nil)
- (inherit-process-coding-system
- navi2ch-net-inherit-process-coding-system)
- - user pass host file port host2ch credentials auth)
- + user pass host file port host2ch credentials auth rest)
- (let ((list (navi2ch-net-split-url url navi2ch-net-http-proxy)))
- (setq list (navi2ch-net-connect-check list))
- (setq user (cdr (assq 'user list))
- @@ -228,7 +228,8 @@ nil なら常に再接続する。")
- host (cdr (assq 'host list))
- file (cdr (assq 'file list))
- port (cdr (assq 'port list))
- - host2ch (cdr (assq 'host2ch list))))
- + host2ch (cdr (assq 'host2ch list))
- + rest (cdr (assq 'rest list))))
- (when navi2ch-net-http-proxy
- (setq credentials (navi2ch-net-http-basic-credentials
- navi2ch-net-http-proxy-userid
- @@ -257,11 +258,8 @@ nil なら常に再接続する。")
- (setq proc nil)
- (unless (navi2ch-net-down-p host)
- (condition-case nil
- - (if (string-match "^https://" url)
- - (setq proc (funcall 'open-tls-stream
- - navi2ch-net-connection-name buf host "443"))
- - (setq proc (funcall navi2ch-open-network-stream-function
- - navi2ch-net-connection-name buf host port)))
- + (setq proc (apply navi2ch-open-network-stream-function
- + navi2ch-net-connection-name buf host port rest))
- (error (navi2ch-net-add-down-host host)))))
- (when proc
- (with-current-buffer buf
- @@ -275,7 +273,7 @@ nil なら常に再接続する。")
- (process-send-string
- proc
- (format (concat
- - "%s %s %s\r\n"
- + "%s %s HTTP/1.1\r\n"
- "MIME-Version: 1.0\r\n"
- "Host: %s\r\n"
- "%s" ;connection
- @@ -283,9 +281,6 @@ nil なら常に再接続する。")
- "%s" ;content
- "\r\n")
- method file
- - (if navi2ch-net-enable-http11
- - "HTTP/1.1"
- - "HTTP/1.0")
- host2ch
- (if navi2ch-net-enable-http11
- ""
- @@ -300,10 +295,15 @@ nil なら常に再接続する。")
- (format "Content-length: %d\r\n\r\n%s"
- (length content) content)
- "")))
- + (process-put proc 'method method)
- (message "%sdone" (current-message)))
- (navi2ch-net-cleanup-vars)
- (setq navi2ch-net-process proc))))
- +(defun navi2ch-net-split-url-scheme-to-rest (scheme)
- + (if (string-prefix-p "https:" scheme)
- + '(:type tls)))
- +
- (defun navi2ch-net-split-url (url &optional proxy)
- (let (host2ch authinfo user pass)
- (string-match "https?://\\([^@/]+@\\)?\\([^/]+\\)" url)
- @@ -324,16 +324,21 @@ nil なら常に再接続する。")
- (cons 'host (match-string 2 proxy))
- (cons 'file url)
- (cons 'port (string-to-number (match-string 3 proxy)))
- - (cons 'host2ch host2ch)))
- - (string-match "https?://\\(?:[^@/]+@\\)?\\([^/:]+\\)\\(?::\\([0-9]+\\)\\)?\\(.*\\)" url)
- + (cons 'host2ch host2ch)
- + (cons 'rest (navi2ch-net-split-url-scheme-to-rest (match-string 1 proxy)))))
- + (string-match "\\(https?://\\)\\(?:[^@/]+@\\)?\\([^/:]+\\)\\(?::\\([0-9]+\\)\\)?\\(.*\\)" url)
- (list
- (cons 'user user)
- (cons 'pass pass)
- - (cons 'host (match-string 1 url))
- - (cons 'port (string-to-number (or (match-string 2 url)
- - "80")))
- - (cons 'file (match-string 3 url))
- - (cons 'host2ch host2ch)))))
- + (cons 'host (match-string 2 url))
- + (cons 'port
- + (if (match-string 3 url)
- + (string-to-number (match-string 3 url))
- + (if (string-prefix-p "https:" (match-string 1 url))
- + 443 80)))
- + (cons 'file (match-string 4 url))
- + (cons 'host2ch host2ch)
- + (cons 'rest (navi2ch-net-split-url-scheme-to-rest (match-string 1 url)))))))
- (defun navi2ch-net-http-basic-credentials (user pass)
- "USER と PASS から Basic 認証の証明書 (?) 部分を返す。"
- @@ -473,7 +478,9 @@ chunk のサイズを返す。point は chunk の直後に移動。"
- (defun navi2ch-net-get-content (proc)
- "PROC の接続の本文を返す。"
- - (when (and (navi2ch-net-get-status proc) (navi2ch-net-get-header proc))
- + (when (and (navi2ch-net-get-status proc)
- + (navi2ch-net-get-header proc)
- + (not (string= (process-get proc 'method) "HEAD")))
- (navi2ch-net-ignore-errors
- (or navi2ch-net-content
- (let* ((header (navi2ch-net-get-header proc))
- @@ -642,6 +649,9 @@ OTHER-HEADER は `navi2ch-net-download-file' に渡される。
- (navi2ch-set-buffer-multibyte nil)
- (insert cont)
- (goto-char (point-min))
- + (set (make-local-variable 'navi2ch-list-media-type)
- + (if (assq 'content-type header)
- + (assq 'content-type header)))
- (funcall func)
- (buffer-string))))
- (when (navi2ch-net-is-tanpan-thread-p cont)
- @@ -999,7 +1009,7 @@ This is taken from RFC 2396.")
- "BBS_\\(TITLE_PICTURE\\|FIGUREHEAD\\)=\\(.+\\)" content))
- (setq src (match-string 2 content))
- (let (url file)
- - (setq url (if (string-match "http://" src)
- + (setq url (if (string-match "https?://" src)
- src
- (navi2ch-board-get-url board src)))
- (string-match "/\\([^/]+\\)$" url)
- diff --git a/navi2ch-splash.el b/navi2ch-splash.el
- index bcda292..3c60bc4 100644
- --- a/navi2ch-splash.el
- +++ b/navi2ch-splash.el
- @@ -39,7 +39,8 @@
- "$Id$")
- (eval-when-compile
- - (require 'cl))
- + (require 'cl)
- + (require 'navi2ch-inline))
- (require 'navi2ch-vars)
- (require 'navi2ch-face)
- (require 'navi2ch-util)
- @@ -61,15 +62,15 @@ Navi2ch comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for ful
- ;; これはさすがに差しかえないと……
- (defvar navi2ch-splash-logo-ascii "\
- - ■ ■■ ■■ ■
- - ■ ■ ■■■■ ■ ■
- + ■ ■■ ■■ ■
- + ■ ■ ■■■■ ■ ■
- ■ ■ ■ ■
- ■ ■ ■ ■
- ■ ■ ■ ■
- ■ ■ ■ ■
- ■ ■ ■ ■
- - ■ ■■■■■■■ ■
- - ■ ■ ■ ■
- + ■ ■■■■■■■ ■
- + ■ ■ ■ ■
- Navi2ch"
- "Ascii picture used to splash the startup screen.")
- diff --git a/navi2ch-thumbnail.el b/navi2ch-thumbnail.el
- index 94aea37..48cbc6b 100644
- --- a/navi2ch-thumbnail.el
- +++ b/navi2ch-thumbnail.el
- @@ -141,7 +141,8 @@
- (defun navi2ch-thumbnail-image-pre (url &optional force)
- "forceはスレ再描画ではnil"
- - (let ((rtn nil) (real-image-url url) (target-list nil) (cache-url url))
- + (let ((rtn nil) (real-image-url url) (target-list nil) (cache-url url)
- + url-regex ext)
- ;;imepic等のURLが画像っぽくない場合の処理
- (dolist (l navi2ch-thumbnail-url-coversion-table)
- diff --git a/navi2ch-util.el b/navi2ch-util.el
- index 84e60b3..f819f8b 100644
- --- a/navi2ch-util.el
- +++ b/navi2ch-util.el
- @@ -33,7 +33,9 @@
- (defconst navi2ch-util-ident
- "$Id$")
- -(eval-when-compile (require 'cl))
- +(eval-when-compile
- + (require 'cl)
- + (require 'navi2ch-inline))
- (require 'timezone)
- (require 'browse-url)
- (require 'base64)
- @@ -209,56 +211,7 @@
- (eval-when-compile
- (defvar minibuffer-allow-text-properties))
- -;;;; macros
- -(defmacro navi2ch-ifxemacs (then &rest else)
- - "If on XEmacs, do THEN, else do ELSE.
- -Like \"(if (featurep 'xemacs) THEN ELSE)\", but expanded at
- -compilation time. Because byte-code of XEmacs is not compatible with
- -GNU Emacs's one, this macro is very useful."
- - (if (featurep 'xemacs)
- - then
- - (cons 'progn else)))
- -;; Navi2chのコードをハクする人は↓を~/.emacsにも入れときましょう。
- -(put 'navi2ch-ifxemacs 'lisp-indent-function 1)
- -
- -(defmacro navi2ch-ifemacsce (then &rest else)
- - "If on EmacsCE, do THEN, else do ELSE.
- -Expanded at compilation time."
- - `(if (string-match "windowsce" system-configuration)
- - ,then
- - (progn ,@else)))
- -(put 'navi2ch-ifemacsce 'lisp-indent-function 1)
- -
- ;; from apel
- -(eval-and-compile
- - (defmacro navi2ch-defalias-maybe (symbol definition)
- - "Define SYMBOL as an alias for DEFINITION if SYMBOL is not defined.
- -See also the function `defalias'."
- - (setq symbol (eval symbol))
- - (or (and (fboundp symbol)
- - (not (get symbol 'defalias-maybe)))
- - `(or (fboundp (quote ,symbol))
- - (prog1
- - (defalias (quote ,symbol) ,definition)
- - ;; `defalias' updates `load-history' internally.
- - (put (quote ,symbol) 'defalias-maybe t))))))
- -
- -(defmacro navi2ch-with-default-file-modes (mode &rest body)
- - "default-file-modes を MODE にして BODY を実行する。"
- - (let ((temp (make-symbol "--file-modes-temp--")))
- - `(let ((,temp (default-file-modes)))
- - (unwind-protect
- - (progn
- - (set-default-file-modes
- - (navi2ch-ifxemacs
- - (if (integerp ,mode)
- - ,mode
- - (char-to-int ,mode))
- - ,mode))
- - ,@body)
- - (set-default-file-modes ,temp)))))
- -
- -(put 'navi2ch-with-default-file-modes 'lisp-indent-function 1)
- (defsubst navi2ch-cache-limit (cache)
- (elt cache 0))
- @@ -266,10 +219,6 @@ See also the function `defalias'."
- (defsubst navi2ch-cache-hash-table (cache)
- (elt cache 1))
- -(defmacro navi2ch-cache-get (key value cache)
- - `(or (gethash ,key (navi2ch-cache-hash-table ,cache))
- - (navi2ch-cache-put ,key ,value ,cache)))
- -
- ;;;; other misc stuff
- (defun navi2ch-mouse-key (num)
- @@ -1513,12 +1462,6 @@ properties to add to the result."
- (memq item maybe-list)
- (eq item maybe-list)))
- -(defmacro navi2ch-region-active-p ()
- - "Say whether the region is active."
- - (if (fboundp 'region-active-p)
- - (list 'region-active-p)
- - (list 'and 'transient-mark-mode 'mark-active)))
- -
- (navi2ch-update-html-tag-regexp)
- (run-hooks 'navi2ch-util-load-hook)
- diff --git a/navi2ch-vars.el b/navi2ch-vars.el
- index 7bb307c..f3170af 100644
- --- a/navi2ch-vars.el
- +++ b/navi2ch-vars.el
- @@ -255,7 +255,7 @@ nil ならば手動で更新しないかぎり取りにいかない。"
- (defcustom navi2ch-list-valid-host-regexp
- (concat "\\("
- - (regexp-opt '(".2ch.net" ".bbspink.com" ".machibbs.com" ".machi.to"))
- + (regexp-opt '(".5ch.net" ".2ch.net" ".bbspink.com" ".machibbs.com" ".machi.to"))
- "\\)\\'")
- "*2ちゃんねるの板とみなすホストの正規表現。"
- :type 'regexp
- @@ -263,7 +263,7 @@ nil ならば手動で更新しないかぎり取りにいかない。"
- (defcustom navi2ch-list-invalid-host-regexp
- (concat "\\`\\("
- - (regexp-opt '("find.2ch.net" "info.2ch.net"))
- + (regexp-opt '("find.5ch.net" "find.2ch.net" "info.5ch.net" "info.2ch.net" ))
- "\\)\\'")
- "*2ちゃんねるの板とみなさないホストの正規表現。
- `navi2ch-list-valid-host-regexp' より優先される。"
- diff --git a/navi2ch-xmas.el b/navi2ch-xmas.el
- index 9f0626e..6aec258 100644
- --- a/navi2ch-xmas.el
- +++ b/navi2ch-xmas.el
- @@ -33,6 +33,7 @@
- (add-hook 'navi2ch-hook 'navi2ch-offline-init-icons)
- (eval-when-compile
- + (require 'navi2ch-inline)
- (navi2ch-defalias-maybe 'make-extent 'ignore)
- (navi2ch-defalias-maybe 'make-glyph 'ignore)
- (navi2ch-defalias-maybe 'make-modeline-command-wrapper 'ignore)
- diff --git a/navi2ch.el b/navi2ch.el
- index 5c31661..992e0f8 100644
- --- a/navi2ch.el
- +++ b/navi2ch.el
- @@ -30,7 +30,9 @@
- (defconst navi2ch-ident
- "$Id$")
- -(eval-when-compile (require 'cl))
- +(eval-when-compile
- + (require 'cl)
- + (require 'navi2ch-inline))
- ;; BEWARE: order is important.
- (require 'navi2ch-vars)
Add Comment
Please, Sign In to add comment